Compare commits
150 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8291422086 | |||
| 4a34b201cb | |||
| 1c575522c7 | |||
| 4d67d33f02 | |||
| 7c02992921 | |||
| 50ff8e97f9 | |||
| 7cd37d663b | |||
| 06a15ebedb | |||
| 5bbe06755f | |||
| 154f5dad5b | |||
| d9a12031a2 | |||
| 304f9655f9 | |||
| e9786ce85d | |||
| 96ad6fc4bf | |||
| df8a418a8f | |||
| 7cf485c594 | |||
| 0b9bdc7987 | |||
| 781d7b3364 | |||
| 1a12599fdb | |||
| f1331d8410 | |||
| 529fb0f44f | |||
| ac680cad1e | |||
| 632ce3d3ae | |||
| cf098bba4b | |||
| b4fa63e261 | |||
| b5b88a69aa | |||
| 02f7f14cf2 | |||
| b741e5d3a4 | |||
| ad7adfb4e3 | |||
| e782c03412 | |||
| 0fe0cbaf0c | |||
| 8faf265c12 | |||
| faec05473d | |||
| e753dc2e5a | |||
| b85ef7f732 | |||
| ebe22cd6d3 | |||
| ef50ede3b6 | |||
| 292b331f5b | |||
| eb86193b07 | |||
| c518a56720 | |||
| 204d0e0003 | |||
| af19500ed3 | |||
| f408e1f17f | |||
| c3e91c2604 | |||
| bcd4a8cdb3 | |||
| a7df1508a6 | |||
| 8dbbf8321b | |||
| 3cc2f664cd | |||
| 4fb311b311 | |||
| 96425d2e3c | |||
| 34121a9108 | |||
| ce88affe29 | |||
| af65cdb24e | |||
| 5ca944a813 | |||
| 8f382907d7 | |||
| 4915dc0ef8 | |||
| 105deb1810 | |||
| 3a364cd602 | |||
| 0ed32754f4 | |||
| f740c34dcb | |||
| c8a682947a | |||
| d004f2901e | |||
| 569090f11e | |||
| 32eed3d40a | |||
| 37c0651b95 | |||
| bb6dd7da57 | |||
| 2fb484d7cc | |||
| d0c98af5f8 | |||
| bec6655a7c | |||
| d436ab3def | |||
| 6da13b2f0a | |||
| 35f8965bed | |||
| d516dac5b2 | |||
| b55a0e4921 | |||
| 71d1467304 | |||
| 41bf2931d2 | |||
| aad633f661 | |||
| d29d5fd365 | |||
| f3e0bab511 | |||
| 34b133c8b9 | |||
| 876528e16b | |||
| 5f1caa9779 | |||
| 9f18204cc5 | |||
| 798e56c1e9 | |||
| 0c18fe881b | |||
| ce4015d2ec | |||
| 3ac2421694 | |||
| 9846287396 | |||
| 5b9f86b96a | |||
| c1a4a4cd56 | |||
| 516d2b85e5 | |||
| 24739f4261 | |||
| f6e4a6ae2b | |||
| 3d7693a13c | |||
| 4f525073c6 | |||
| 9e4e9889da | |||
| fbbd38ddb1 | |||
| 6e92d31415 | |||
| a075ca97ed | |||
| af177c8c1c | |||
| e0e5f1fd52 | |||
| 1594006ba2 | |||
| 087ea955d9 | |||
| 41e1167283 | |||
| 0988088c47 | |||
| 47a464fcb6 | |||
| 78068978a0 | |||
| 7bdde1e104 | |||
| f951eff62e | |||
| 653190b0df | |||
| 6caac23b8e | |||
| 2c2fdce82f | |||
| 205be12b37 | |||
| 245e344eff | |||
| d9fb9d5963 | |||
| be8d1d14b7 | |||
| 1322998cd6 | |||
| 5d2c80e124 | |||
| 0e7ede9036 | |||
| cd396b22ae | |||
| a2e52bc8cc | |||
| fffd34a24d | |||
| 39043b9dcc | |||
| 5d21cd3b72 | |||
| fccbe77810 | |||
| 79648eb953 | |||
| 458d964173 | |||
| 1cf67fae1b | |||
| 4635094c2f | |||
| 809c1777a4 | |||
| 61fddfc0ef | |||
| d9808b04bb | |||
| 457e5acb0b | |||
| 37976d540d | |||
| 4b38323296 | |||
| 4c9adc8d19 | |||
| 3c032484c1 | |||
| 20016b1511 | |||
| b95a071007 | |||
| fa98ac6287 | |||
| e3f5861fa0 | |||
| c5f53b623c | |||
| e6fbe340fa | |||
| 0f205e9172 | |||
| f48cdf2100 | |||
| b834eee6c6 | |||
| 620c316530 | |||
| db0bc7fb3b | |||
| bcf28d3444 | |||
| e69970bd65 |
@@ -1,3 +1,947 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-09 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes #137031:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (get_fallback_icon): New helper
|
||||
function, fetches a stock icon as a fallback.
|
||||
(gtk_file_system_unix_volume_render_icon): Fall back to a stock
|
||||
icon.
|
||||
(gtk_file_system_unix_render_icon): Fall back to a stock icon.
|
||||
Use helper functions rather than being a mega-function.
|
||||
(get_icon_name_for_directory): Renamed from
|
||||
get_icon_for_directory().
|
||||
(get_icon_type_from_path): New helper function; code pulled out
|
||||
from gtk_file_system_unix_render_icon().
|
||||
(get_special_icon): Likewise.
|
||||
(get_icon_for_mime_type): Likewise.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_paint_window): Use the
|
||||
requisition of the widget instead of relying on the style
|
||||
drawing function to supply the size of the drawable. (#146531)
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* NEWS: Updates.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make GtkEntry work harder to protect passwords: (#143955,
|
||||
Morten Welinder)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_destroy): Add a destroy handler
|
||||
to clear the password even if the widget is leaked.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_delete_text):
|
||||
* gtk/gtkentry.c (gtk_entry_finalize): Zero out the memory
|
||||
before freeing it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_insert_text): Zero and free
|
||||
the old memory instead of just reallocating it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_create_layout): Don't leak text
|
||||
direction information for passwords.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Fix some cases where style functions were
|
||||
not handling widget == NULL properly. (#146282)
|
||||
|
||||
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (get_default_icons):
|
||||
* gtk/stock-icons/Makefile.am: Add stock file and
|
||||
directory icons in sizes 16 and 24. Do not add the stock ids
|
||||
to the gtkstock.h, since they are only for internal use on the
|
||||
2.4 branch.
|
||||
|
||||
2004-07-08 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #139290:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Add a
|
||||
GError argument. Do check for errors when getting the
|
||||
GtkFileFolder: get the folder and read the children before
|
||||
actually creating the model. Removed obsolete code that handled
|
||||
roots-changed on the file system.
|
||||
(file_model_node_get_info): Assert that we don't reach the old
|
||||
case to display file system roots.
|
||||
(roots_changed_callback): Removed.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (set_list_model): Add a GError
|
||||
argument, and a boolean return value. Return an error if we
|
||||
cannot create the file system model. On error, set a NULL model
|
||||
on the tree.
|
||||
(gtk_file_chooser_default_set_current_folder): Use the error value
|
||||
from set_list_model().
|
||||
(gtk_file_chooser_default_set_property): Set the show_hidden
|
||||
property only if the browse_files_model exists.
|
||||
(gtk_file_chooser_default_unselect_path): Only operate if the
|
||||
browse_files_model exists.
|
||||
(check_preview_change): Check whether we have the sort_model.
|
||||
(change_folder_and_display_error): Copy the path we get passed
|
||||
before using it. There's a comment in there that explains why we
|
||||
need to copy it; basically, if the passed path belongs to the
|
||||
model, the model may go away in the middle of this function and
|
||||
we'll be left with a dangling pointer.
|
||||
(install_list_model_filter): Assert that the model is not NULL.
|
||||
(set_current_filter): Check whether the model exists.
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Don't
|
||||
g_return_if_fail if the model is NULL.
|
||||
(gtk_tree_selection_get_selected_rows): Likewise.
|
||||
(gtk_tree_selection_count_selected_rows): Likewise.
|
||||
(gtk_tree_selection_selected_foreach): Likewise.
|
||||
(gtk_tree_selection_path_is_selected): Likewise; rather just
|
||||
return FALSE.
|
||||
(gtk_tree_selection_select_all): Likewise.
|
||||
(gtk_tree_selection_unselect_all): Likewise.
|
||||
(gtk_tree_selection_select_range): Do g_return_if_fail() if the
|
||||
model is NULL.
|
||||
(gtk_tree_selection_unselect_range): Likewise.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (fill_in_names): Return immediately if
|
||||
g_dir_open() fails: there is no need to set the error ourselves,
|
||||
as g_dir_open() already does it.
|
||||
|
||||
2004-07-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_search_equal_func): Allow
|
||||
to restore the default search function. (#145365, John Finlay)
|
||||
|
||||
* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
|
||||
references to the drag context. (#144324, Alex Larsson)
|
||||
|
||||
Thu Jul 8 00:33:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_model): Stop editing
|
||||
when a new model is set. (#145566, Dmitry M. Shatrov)
|
||||
|
||||
Wed Jul 7 23:44:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Make sure that subpixbufs
|
||||
are properly aligned for gdk_pixbuf_saturate_and_pixelate(),
|
||||
in order to avoid rendering artifacts from misaligned
|
||||
pixelation patterns. (#145585, Felipe Heidrich, Billy Biggs)
|
||||
|
||||
Tue Jul 6 23:00:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Fix
|
||||
a 64bit alignment issue. (#144302, Sunil)
|
||||
|
||||
2004-07-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
|
||||
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
|
||||
* gdk/win32/gdkproperty-win32.c (find_common_locale,
|
||||
gdk_property_change)
|
||||
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
|
||||
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
|
||||
below).
|
||||
|
||||
* gdk/win32/gdkglobals-win32.c
|
||||
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
|
||||
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
|
||||
atom. Initialize it. Declare it. Drop the variable for the
|
||||
COMPOUND_TEXT atom.
|
||||
|
||||
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
|
||||
function is supposed to return the string in the locale's charset
|
||||
and encoding. Use g_convert().
|
||||
|
||||
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
|
||||
string in the locale's charset. Use g_convert().
|
||||
|
||||
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
|
||||
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
|
||||
GLib's UTF-16 functions instead. Windows uses UTF-16.
|
||||
|
||||
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
|
||||
functions mentioned above.
|
||||
|
||||
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
|
||||
also if the string is of type STRING, i.e. ISO-8859-1, and the
|
||||
current codepage is 1252, and contains no C1 chars. Accept
|
||||
also UTF8_STRING.
|
||||
|
||||
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
|
||||
Mark as static. When storing STRING data, convert to
|
||||
Latin-1. (#140537)
|
||||
(gdk_selection_owner_set_for_display): Now that STRING is always
|
||||
ISO-8859-1, use UTF8_STRING when sending the selection request
|
||||
to ourselves.
|
||||
|
||||
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
|
||||
Ehresman)
|
||||
|
||||
(gdk_text_property_to_text_list_for_display): Make work more like
|
||||
X11 version. Do obey the encoding parameter.
|
||||
|
||||
(gdk_string_to_compound_text_for_display,
|
||||
gdk_utf8_to_compound_text_for_display): Don't even pretend
|
||||
supporting COMPOUND_TEXT.
|
||||
|
||||
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
|
||||
|
||||
(sanitize_utf8): Zero-terminate string.
|
||||
|
||||
Tue Jul 6 10:00:22 2004 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
Fix for #136496, Pawel Salek:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_changed): Queue a redraw on
|
||||
a node when it changes in fixed_height mode.
|
||||
|
||||
(gtk_tree_view_node_queue_redraw): new function to queue a redraw
|
||||
on a node.
|
||||
|
||||
2004-07-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_position): Make sure
|
||||
private->monitor_num is a valid monitor number before
|
||||
using it. (#139187, Michael Natterer)
|
||||
|
||||
2004-06-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid
|
||||
a crash if the font doesn't exist. (#144967, Yevgen Muntyan)
|
||||
|
||||
Tue Jul 6 02:00:28 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (popup_position_func):
|
||||
* gtk/gtkentry.c (popup_position_func):
|
||||
* gtk/gtktextview.c (popup_position_func): Improve positioning
|
||||
of keyboard-activated menus with Xinerama.
|
||||
|
||||
Tue Jul 6 00:29:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkuimanager.c (do_updates):
|
||||
(do_updates_idle): Only call GDK_THREADS_ENTER() / _LEAVE()
|
||||
when called from an idle handler. (#145429, Jan-Marek Glogowski)
|
||||
|
||||
Mon Jul 5 23:47:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserutils.c (delegate_notify): Use
|
||||
the less efficient g_object_interface_find_property () instead
|
||||
of the param_id range check, since the GParamSpecs we're
|
||||
dealing with are the overridden onces on the interface, whose
|
||||
param_id is always zero. (#145312, Alex Roitman, fix proposed
|
||||
by Owen Taylor)
|
||||
|
||||
Sun Jul 4 01:29:35 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_drag_data_get):
|
||||
(gtk_calendar_drag_data_received): Fix off-by-one error.
|
||||
GDate month is one-based and GtkCalendar month is zero-based.
|
||||
(#145134, William Jon McCann)
|
||||
|
||||
Sun Jul 4 01:11:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Don't crash if
|
||||
somebody tries to move a node after itself in a list of
|
||||
length 1. (#145291, Sampo Nurmentaus)
|
||||
|
||||
Sat Jul 3 23:43:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* docs/faq/gtk-faq.sgml:
|
||||
* gtk/gtkwindow.c: Fix links to www.freedesktop.org. (#145210,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jul 3 02:09:51 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtksocket.c (gtk_socket_end_embedding): Reset current_width
|
||||
and current_height to 0 when ending the embedding. (#143675,
|
||||
Nickolay V. Shmyrev)
|
||||
|
||||
Sat Jul 3 01:48:19 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_move_visually): Let the cursor move
|
||||
to the right end of the entry text, even if it ends in combining
|
||||
marks. (#141728, Theppitak Karoonboonyanan)
|
||||
|
||||
Fri Jul 2 23:34:33 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_unset_model): Unset the displayed
|
||||
row when unsetting the model. (#138560, Christian Persch)
|
||||
|
||||
Fri Jul 2 22:41:27 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Properly align mask and
|
||||
pixbuf if a subarea is exposed. (#135423, fix by John Ehresman)
|
||||
|
||||
2004-07-01 J. Ali Harlow <ali@juiblex.co.uk>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_ungrab_pointer): Fix
|
||||
win32 build problem w/o wintab. Fixed #145242
|
||||
|
||||
Sat Jun 26 01:15:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (set_initial_hints): Handle
|
||||
_NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. (#144851,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jun 26 01:04:31 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (clear_cache): Prevent unwanted
|
||||
recursion by resetting icon_set->cache before freeing
|
||||
the cache. (#144947, Tim Janik)
|
||||
|
||||
Sat Jun 26 00:40:02 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (render_icon_name_pixbuf):
|
||||
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon):
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): Accept a NULL
|
||||
style.
|
||||
|
||||
Sat Jun 26 00:06:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Reflect the
|
||||
last change in the docs.
|
||||
|
||||
Fri Jun 25 23:35:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
|
||||
NULL to unset the model. (#137211, patch by Mariano Suárez-Alvarez)
|
||||
|
||||
Fri Jun 25 23:33:05 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
|
||||
placement policy for GtkComboBoxEntry to be: if it fits below,
|
||||
place below, if it fits above place above, else place in the
|
||||
larger space and scroll so that the scroll arrow appear at the
|
||||
far end. (#144362, David A. Knight)
|
||||
|
||||
Fri Jun 25 22:49:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
|
||||
use of &parent_iter. (#145007, John Finlay)
|
||||
|
||||
2004-06-25 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
reviewed by: Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkkeys-x11.c: (get_symbol), (update_keymaps),
|
||||
(gdk_keymap_lookup_key), (translate_keysym): fix keys parsing when
|
||||
the number of keysyms per keycode is odd. Fixes #144808.
|
||||
|
||||
Fri Jun 25 00:32:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change
|
||||
which was mentioned below.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a Save
|
||||
or an Open stock button for the C-l dialog depending on the action
|
||||
in which the file chooser operates. Fixes #141753.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes the GTK+ part of #142308:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_filename_to_path):
|
||||
Use filename_to_path().
|
||||
(gtk_file_system_unix_uri_to_path): Likewise.
|
||||
(filename_to_path): Use remove_trailing_slash().
|
||||
|
||||
2004-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaccelmap.c (_gtk_accel_path_is_valid): Accept
|
||||
"<WINDOWTYPE>" as a valid accel path. (#144427, Philip
|
||||
Kendall)
|
||||
|
||||
* gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure
|
||||
this gets defined for all backends, so linux-fb has a
|
||||
chance of compiling.
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Make this work
|
||||
for children of the root. (#139785, Jean-François Wauthy,
|
||||
patch by John Finlay)
|
||||
|
||||
* gtk/gtkicontheme.h (GTK_ICON_THEME_GET_CLASS): Typo
|
||||
fix. (#144750, Jeff Franks)
|
||||
|
||||
2004-06-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gdk/x11/gdkdrawable-x11.[ch]: made convert_format() utility
|
||||
function public as _gdk_x11_convert_to_format().
|
||||
|
||||
* gdk/x11/gdkcursor-x11.c (create_cursor_image): premultiply
|
||||
the pixels from the GdkPixbuf when putting them in the
|
||||
Xcursor image. Fixes bug #144350.
|
||||
|
||||
2004-06-16 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_added): When inserting a
|
||||
visible node, free the old path before creating the new one.
|
||||
Fixes #144356.
|
||||
|
||||
Tue Jun 15 01:10:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c: Make GtkComboBox work without model.
|
||||
(#144198, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-11 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #143578:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_add_editable):
|
||||
Don't ref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Don't unref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Ahem, free the node.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
|
||||
Added fields for edited_idle and edited_new_text.
|
||||
(renderer_edited_cb): Queue the
|
||||
creation of the folder in an idle handler.
|
||||
(renderer_editing_canceled_cb): Likewise for the cancellation.
|
||||
(gtk_file_chooser_default_finalize): Free the impl->edited_new_text.
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.4
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Thu Jun 10 22:15:01 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmain.c (gtk_parse_args): Typo fix.
|
||||
|
||||
Thu Jun 10 21:16:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_destroy):
|
||||
Check whether priv->box is NULL before disconnecting
|
||||
from its signals. Fix merged from HEAD.
|
||||
|
||||
2004-06-10 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #144110, patch by Bastien Nocera <hadess@hadess.net>.
|
||||
|
||||
* gtk/gtkfilechooser.c (gtk_file_chooser_list_shortcut_folders):
|
||||
Refer to gtk_file_chooser_add_shortcut_folder().
|
||||
(gtk_file_chooser_list_shortcut_folder_uris): Refer to
|
||||
gtk_file_chooser_add_shortcut_folder_uri().
|
||||
|
||||
Thu Jun 10 00:36:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_main_button): Start
|
||||
the drag before focusing the selected.day.
|
||||
* gtk/gtkcalendar.c (gtk_calendar_state_changed): Stop
|
||||
a beginning drag if the widget becomes insensitive.
|
||||
|
||||
Thu Jun 10 00:05:11 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_button_press): Start
|
||||
spinning before calling arrow_action(), so that a signal
|
||||
handler triggered from arrow_action() has a chance to
|
||||
stop the spinning. (#143966, Davyd Madeley)
|
||||
|
||||
Wed Jun 9 23:05:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a
|
||||
typo. (#144070, Kent Sandvik)
|
||||
|
||||
Thu Jun 10 00:22:51 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert the "drag select" part of
|
||||
#141169. (#144011).
|
||||
|
||||
Mon Jun 7 23:07:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): Handle
|
||||
priv->model being NULL. (#143856, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-07 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_button_press): Revert the patch
|
||||
from 2003/Sep/12. This kept DnD in tree views within modal
|
||||
dialogs from working, which is especially bad for the file
|
||||
chooser. Fixes #135168.
|
||||
|
||||
Sat Jun 5 23:07:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c: (gtk_entry_completion_init),
|
||||
(gtk_entry_completion_list_enter_notify),
|
||||
(gtk_entry_completion_list_motion_notify),
|
||||
(_gtk_entry_completion_popup), (_gtk_entry_completion_popdown):
|
||||
* gtk/gtkentryprivate.h: Add an ignore_enter flag and
|
||||
use it as in the menu code to avoid the initial selection if
|
||||
the window pops up under the pointer. (Anders Carlsson)
|
||||
|
||||
Sat Jun 5 20:05:39 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* tests/testmerge.c: Add a checkbox to queue an
|
||||
merge/unmerge. Patch from Matthias Clasen.
|
||||
|
||||
* gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Add a new flag
|
||||
"need_rebuild"
|
||||
(rebuild_menu): New function that rebuilds the overflow menu and
|
||||
makes sure it doesn't start or end with a separator.
|
||||
(toolbar_content_new_tool_item)
|
||||
(toolbar_content_remove)
|
||||
(toolbar_content_new_compatibility): Set the rebuild_needed flag
|
||||
(gtk_toolbar_size_allocate): Only show the overflow arrow when we
|
||||
have actually overflown an item with a proxy menu item. Also make
|
||||
sure we rebuild the menu if needed.
|
||||
|
||||
Fix #125504, #142377, #143463
|
||||
|
||||
* gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_expose):
|
||||
Obey the "priv->draw" flag. (#143692)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/widget_geometry.txt: Add a note about the !CAN_FOCUS
|
||||
quirk in the button size allocation code.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Give the space
|
||||
requested for drawing the focus indicator to the child in the
|
||||
!CAN_FOCUS case. This should fix issues which the Gimp has with
|
||||
the button allocation changes in 2.4.2.
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.3
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
|
||||
length of the entry contents in characters, not in bytes.
|
||||
|
||||
* gtk/gtkentry.c (paste_received): Don't pop up the completion
|
||||
window on paste, noticed by Anders Carlsson.
|
||||
|
||||
Thu Jun 3 20:51:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
|
||||
values and default value for the ::active property. (#143669,
|
||||
Olivier Andrieu)
|
||||
|
||||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkimagemenuitem.c: use gtk_widget_get_child_requisition()
|
||||
instead of accessing item->image->allocation.width/height
|
||||
directly. Makes widgets which only have a requisition set using
|
||||
gtk_widget_set_size_request() work and fixes bug #142789.
|
||||
|
||||
Thu Jun 3 08:07:59 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert previous commit. It caused the problem
|
||||
of sticky right click menus to return.
|
||||
|
||||
Wed Jun 2 01:56:02 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Fix the stay up algorithm for combo boxes to
|
||||
better handle the "click" case. Better fix for #141169.
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_init): Bail out if the
|
||||
model is empty. Fixes #143536.
|
||||
|
||||
2004-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_size_focus_out): Don't
|
||||
close the dialog on focus out of the size entry. (#143505,
|
||||
David Hawthorne)
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #138807.
|
||||
|
||||
* gtk/fnmatch.c (_gtk_fnmatch): Take a no_leading_period argument.
|
||||
(gtk_fnmatch_intern): Likewise; also implement this option.
|
||||
|
||||
* gtk/gtkprivate.h (_gtk_fnmatch): Updated prototype.
|
||||
|
||||
* gtk/gtkfilesel.c (find_completion_dir): Pass TRUE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
(attempt_file_completion): Likewise.
|
||||
|
||||
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Pass FALSE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
|
||||
Wed Jun 2 00:46:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkselection.c (_gtk_selection_request): Remove leftover
|
||||
debug code.
|
||||
|
||||
Wed Jun 2 00:17:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_select_range): Don't
|
||||
allow unless selection mode is multiple. (#142634, John Finlay)
|
||||
|
||||
Tue Jun 1 23:14:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktoolbar.h:
|
||||
* gtk/gtktoolbar.c:
|
||||
* gtk/gtkentrycompletion.h:
|
||||
* gtk/gtkentrycompletion.c:
|
||||
* gtk/gtkcombobox.h:
|
||||
* gtk/gtkcombobox.c: Rename function parameters from
|
||||
index to index_ to prevent clash with BSD index(). (#143001)
|
||||
|
||||
Tue Jun 1 22:41:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenu.c (get_accel_path): Handle accel_closure being
|
||||
NULL on an accel label. (#139641, Sam Stephenson, patch by
|
||||
Michael Natterer)
|
||||
|
||||
Tue Jun 1 22:19:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkicontheme.c (theme_subdir_load): Prevent icon
|
||||
lookup finding icons in the wrong prefix. (#143328,
|
||||
Mark McLoughlin)
|
||||
|
||||
Wed Jun 2 00:39:58 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
Bug #141169.
|
||||
|
||||
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Make menus
|
||||
only stay up if you release within 500 milliseconds.
|
||||
(gtk_menu_shell_button_press): Set the activate_time to the event
|
||||
time when a button is pressed.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_motion_notify, gtk_menu_enter_notify):
|
||||
Interprete button releases as activate when we have seen both an
|
||||
enter an a motion event.
|
||||
|
||||
2004-06-01 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_removed): Don't insert a
|
||||
dummy node if there is no parent node. Fixes #143362.
|
||||
|
||||
2004-05-31 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (renderer_edited_cb): Change to the
|
||||
newly-created folder. Fixes #138932.
|
||||
(trap_activate_cb): Only return TRUE if we did handle the event.
|
||||
Fixes #143359; patch by jylefort@brutele.be.
|
||||
|
||||
Mon May 31 02:38:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_new_from_pixmap): Fix typo in
|
||||
docs. (#142892, Tommi Komulainen)
|
||||
|
||||
Mon May 31 02:21:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhandlebox.c: Make detached handleboxes work when their
|
||||
parent is minimized, porting the fix from 1.2. (#1923, #57182)
|
||||
|
||||
Mon May 31 02:03:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwindow.c (gtk_window_show): Make moving realized,
|
||||
unmapped windows work.
|
||||
|
||||
2004-05-29 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* configure.in: Added "tk" to ALL_LINGUAS.
|
||||
|
||||
Fri May 28 14:57:13 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
|
||||
messages for common problems. (#137974, Owen Taylor)
|
||||
|
||||
Fri May 28 14:14:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkevents-x11.c: Fix off-by-one errors. (#143337,
|
||||
Billy Biggs)
|
||||
|
||||
Thu May 27 00:12:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_request): Fix a typo.
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Send key
|
||||
modifiers (shift, ctrl etc) in button and motion events from the
|
||||
tablet. (#143240)
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (gdk_device_get_state): Simple
|
||||
implementation for extended input devices using last known
|
||||
device state (#143237)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (propagate): Don't propagate mouse
|
||||
events to windows that want extended input events. (#142943)
|
||||
(gdk_event_translate): Move check for extended input devices to
|
||||
propagate, new parameter to propagate.
|
||||
(gdk_pointer_grab, gdk_display_pointer_ungrab): Enable calls to
|
||||
_gdk_input_(un)grab_pointer. (#142943)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Check for
|
||||
input grab. [Fix missing update of impl in "dijkstra" event
|
||||
propagation loop] Drop the parallel "impl" pointer, just use a
|
||||
cast. Don't propagate beyond windows that want normal input
|
||||
events. (#142943)
|
||||
(gdk_input_grab_pointer, gdk_input_ungrab_pointer): Limited
|
||||
implementation of input grab. (#142943)
|
||||
|
||||
2004-05-22 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (print_lc): Remove duplicated
|
||||
line. (Spotted by Benoît Carpentier.)
|
||||
|
||||
2004-05-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
|
||||
Restrict the width of the popup to be no larger than the
|
||||
monitor. (#142678, DmD Ljungmark)
|
||||
|
||||
* gtk/gtkbutton.c: Go back to the initial fix for the
|
||||
focus-overdrawing problem, which was actually correct
|
||||
according to docs/widget_geometry.txt.
|
||||
|
||||
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
|
||||
arrow size from 11 to 15 to compensate for that.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_request)
|
||||
(gtk_button_size_allocate, _gtk_button_paint): Allocate
|
||||
space for the focus rectangle only if necessary. (#142668,
|
||||
Michael Natterer)
|
||||
|
||||
Sun May 16 23:14:37 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove two useless
|
||||
lines. (#142479, Morten Welinder)
|
||||
|
||||
2004-05-15 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Put back the ref_count field in the
|
||||
GdkDragContextPrivateWin32 struct (but inside ifdef OLE2_DND this
|
||||
time). It is used by the OLE2_DND code, which is unfinished and
|
||||
presumably horribly broken, but still, let's not make it not
|
||||
compile on purpose. Silence some gcc warnings in the OLE2_DND
|
||||
code.
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_tree_window_to_tree_coords):
|
||||
New function to go from tree window to tree coordinates, kept
|
||||
static for now until we figure out the multiple coordinate
|
||||
system mess in GtkTreeView API-wise.
|
||||
(gtk_tree_view_scroll_to_cell): Transform the coordinates
|
||||
from tree window to tree coordinates, using the new function.
|
||||
Previously, the x coordinate was wrongly transformed. (#142494)
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdktypes.h (GdkModifierType): Add a comment about unused
|
||||
bits.
|
||||
|
||||
* gtk/gtkstock.c (real_add, gtk_stock_lookup): Use an unused
|
||||
modifier bit to mark stock item which need to be freed
|
||||
eventually. (#140654, Michal Pasternak, Scott Tsai)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add missing
|
||||
call to g_object_ref in Wintab code. (#138341)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c: Fix numerous Wintab problems
|
||||
including unallocated buffers for event->motion.axes and
|
||||
event->button.axes, unsigned wraparound problem in the code for
|
||||
detecting missing press/release events and assigning min instead
|
||||
of max when setting up axes.
|
||||
|
||||
2004-05-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
|
||||
previous change to this function, clarify the docs instead.
|
||||
|
||||
2004-05-11 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): don't allocate the popup
|
||||
smaller than the combobox. Fixes bug #59660.
|
||||
|
||||
2004-05-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeprivate.h:
|
||||
* gtk/gtktreeview.c: Add a hove selection mode, which
|
||||
when TRUE makes the selection follow the mouse.
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_init):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection
|
||||
mode. (#127648, Dave Bordoley)
|
||||
|
||||
Mon May 10 23:04:25 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.h: Add prototype for _gtk_widget_grab_notify()
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkwindow.c (get_screen_icon_info):
|
||||
Make static.
|
||||
|
||||
* gdk/gdkdisplay.c (singlehead_...):
|
||||
* gdk/x11/gdkkeys-x11.c (get_effective_keymap):
|
||||
* gdk/x11/gdkgeometry-x11.c (expose_serial_predicate):
|
||||
* gdk/x11/gdkdisplay-x11.c (escape_for_xmessage): Make static.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below):
|
||||
Place the window above the combobox, if there is not enough
|
||||
room below.
|
||||
|
||||
* tests/testentrycompletion.c: Make the second example use the
|
||||
::match-selected signal to make it actually work.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): Make sure the menu pops up
|
||||
as wide as the combobox. (#59660, Havoc Pennington)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfontsel.c (list_row_activated): Make Return activate the
|
||||
default button. (#118921)
|
||||
|
||||
Mon May 10 15:03:50 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.c (_gtk_widget_grab_notify): New internal function
|
||||
that emits the grab notify signal.
|
||||
|
||||
* gtk/gtkmain.c (gtk_grab_notify_foreach): Use it here.
|
||||
|
||||
Mon May 10 00:51:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkmenu.c: Make destruction of a torn off menu work
|
||||
like un-tearing off.
|
||||
|
||||
Sun May 9 21:05:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
|
||||
Allow to suppress the stock accelerator by using "". (#142196,
|
||||
David A Knight)
|
||||
|
||||
2004-05-08 Hans Breuer <hans@breuer.org>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemwin32.c (extract_icon) : finally also
|
||||
create the correct mask for 'pseudo mime' icons
|
||||
|
||||
Sun May 9 01:57:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_button_released):
|
||||
In list mode, accept the same mouse/wheel bindings on
|
||||
the cellview as on the button. (#136967)
|
||||
|
||||
Sun May 9 01:29:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkiconfactory.c (add_to_cache): Actually count the
|
||||
cached icons. (#135888, Crispin Flowerday)
|
||||
|
||||
Sun May 9 00:03:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure
|
||||
that we actually return menus for nodes of type menu, not the
|
||||
menuitems they're attached to.
|
||||
|
||||
2004-05-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
|
||||
draw over the focus rectangle.
|
||||
|
||||
Thu May 6 23:48:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): Also
|
||||
popup the submenu for items in torn off menus. (#122051)
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_state_changed): Remove
|
||||
this no longer needed signal handler. (#141817, Paul Pogonyshev)
|
||||
|
||||
2004-05-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gtk/gtkexpander.c (gtk_expander_size_allocate): in RTL mode,
|
||||
position the title lable next to the arrow just as we do for LTR
|
||||
rendering. Fixes bug #141825.
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/RELEASE-HOWTO: Document the new policy of
|
||||
bumping version numbers after release.
|
||||
|
||||
* configure.in: Bump version number to 2.4.2.
|
||||
|
||||
Wed May 5 22:23:59 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (icon_source_clear): Don't
|
||||
call g_free() on a pixbuf. (#141961, Crispin Flowerday)
|
||||
|
||||
2004-05-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (print_node): Make the output
|
||||
parseable. (#141929, Sven Neumann)
|
||||
|
||||
2004-05-05 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window_for_screen): Add
|
||||
multi-monitor offset. (#141842, John Ehresman)
|
||||
|
||||
2004-05-04 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Fixes #139562, based on a patch by Christian Neumair.
|
||||
|
||||
@@ -1,3 +1,947 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-09 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes #137031:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (get_fallback_icon): New helper
|
||||
function, fetches a stock icon as a fallback.
|
||||
(gtk_file_system_unix_volume_render_icon): Fall back to a stock
|
||||
icon.
|
||||
(gtk_file_system_unix_render_icon): Fall back to a stock icon.
|
||||
Use helper functions rather than being a mega-function.
|
||||
(get_icon_name_for_directory): Renamed from
|
||||
get_icon_for_directory().
|
||||
(get_icon_type_from_path): New helper function; code pulled out
|
||||
from gtk_file_system_unix_render_icon().
|
||||
(get_special_icon): Likewise.
|
||||
(get_icon_for_mime_type): Likewise.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_paint_window): Use the
|
||||
requisition of the widget instead of relying on the style
|
||||
drawing function to supply the size of the drawable. (#146531)
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* NEWS: Updates.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make GtkEntry work harder to protect passwords: (#143955,
|
||||
Morten Welinder)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_destroy): Add a destroy handler
|
||||
to clear the password even if the widget is leaked.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_delete_text):
|
||||
* gtk/gtkentry.c (gtk_entry_finalize): Zero out the memory
|
||||
before freeing it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_insert_text): Zero and free
|
||||
the old memory instead of just reallocating it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_create_layout): Don't leak text
|
||||
direction information for passwords.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Fix some cases where style functions were
|
||||
not handling widget == NULL properly. (#146282)
|
||||
|
||||
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (get_default_icons):
|
||||
* gtk/stock-icons/Makefile.am: Add stock file and
|
||||
directory icons in sizes 16 and 24. Do not add the stock ids
|
||||
to the gtkstock.h, since they are only for internal use on the
|
||||
2.4 branch.
|
||||
|
||||
2004-07-08 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #139290:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Add a
|
||||
GError argument. Do check for errors when getting the
|
||||
GtkFileFolder: get the folder and read the children before
|
||||
actually creating the model. Removed obsolete code that handled
|
||||
roots-changed on the file system.
|
||||
(file_model_node_get_info): Assert that we don't reach the old
|
||||
case to display file system roots.
|
||||
(roots_changed_callback): Removed.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (set_list_model): Add a GError
|
||||
argument, and a boolean return value. Return an error if we
|
||||
cannot create the file system model. On error, set a NULL model
|
||||
on the tree.
|
||||
(gtk_file_chooser_default_set_current_folder): Use the error value
|
||||
from set_list_model().
|
||||
(gtk_file_chooser_default_set_property): Set the show_hidden
|
||||
property only if the browse_files_model exists.
|
||||
(gtk_file_chooser_default_unselect_path): Only operate if the
|
||||
browse_files_model exists.
|
||||
(check_preview_change): Check whether we have the sort_model.
|
||||
(change_folder_and_display_error): Copy the path we get passed
|
||||
before using it. There's a comment in there that explains why we
|
||||
need to copy it; basically, if the passed path belongs to the
|
||||
model, the model may go away in the middle of this function and
|
||||
we'll be left with a dangling pointer.
|
||||
(install_list_model_filter): Assert that the model is not NULL.
|
||||
(set_current_filter): Check whether the model exists.
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Don't
|
||||
g_return_if_fail if the model is NULL.
|
||||
(gtk_tree_selection_get_selected_rows): Likewise.
|
||||
(gtk_tree_selection_count_selected_rows): Likewise.
|
||||
(gtk_tree_selection_selected_foreach): Likewise.
|
||||
(gtk_tree_selection_path_is_selected): Likewise; rather just
|
||||
return FALSE.
|
||||
(gtk_tree_selection_select_all): Likewise.
|
||||
(gtk_tree_selection_unselect_all): Likewise.
|
||||
(gtk_tree_selection_select_range): Do g_return_if_fail() if the
|
||||
model is NULL.
|
||||
(gtk_tree_selection_unselect_range): Likewise.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (fill_in_names): Return immediately if
|
||||
g_dir_open() fails: there is no need to set the error ourselves,
|
||||
as g_dir_open() already does it.
|
||||
|
||||
2004-07-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_search_equal_func): Allow
|
||||
to restore the default search function. (#145365, John Finlay)
|
||||
|
||||
* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
|
||||
references to the drag context. (#144324, Alex Larsson)
|
||||
|
||||
Thu Jul 8 00:33:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_model): Stop editing
|
||||
when a new model is set. (#145566, Dmitry M. Shatrov)
|
||||
|
||||
Wed Jul 7 23:44:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Make sure that subpixbufs
|
||||
are properly aligned for gdk_pixbuf_saturate_and_pixelate(),
|
||||
in order to avoid rendering artifacts from misaligned
|
||||
pixelation patterns. (#145585, Felipe Heidrich, Billy Biggs)
|
||||
|
||||
Tue Jul 6 23:00:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Fix
|
||||
a 64bit alignment issue. (#144302, Sunil)
|
||||
|
||||
2004-07-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
|
||||
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
|
||||
* gdk/win32/gdkproperty-win32.c (find_common_locale,
|
||||
gdk_property_change)
|
||||
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
|
||||
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
|
||||
below).
|
||||
|
||||
* gdk/win32/gdkglobals-win32.c
|
||||
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
|
||||
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
|
||||
atom. Initialize it. Declare it. Drop the variable for the
|
||||
COMPOUND_TEXT atom.
|
||||
|
||||
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
|
||||
function is supposed to return the string in the locale's charset
|
||||
and encoding. Use g_convert().
|
||||
|
||||
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
|
||||
string in the locale's charset. Use g_convert().
|
||||
|
||||
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
|
||||
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
|
||||
GLib's UTF-16 functions instead. Windows uses UTF-16.
|
||||
|
||||
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
|
||||
functions mentioned above.
|
||||
|
||||
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
|
||||
also if the string is of type STRING, i.e. ISO-8859-1, and the
|
||||
current codepage is 1252, and contains no C1 chars. Accept
|
||||
also UTF8_STRING.
|
||||
|
||||
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
|
||||
Mark as static. When storing STRING data, convert to
|
||||
Latin-1. (#140537)
|
||||
(gdk_selection_owner_set_for_display): Now that STRING is always
|
||||
ISO-8859-1, use UTF8_STRING when sending the selection request
|
||||
to ourselves.
|
||||
|
||||
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
|
||||
Ehresman)
|
||||
|
||||
(gdk_text_property_to_text_list_for_display): Make work more like
|
||||
X11 version. Do obey the encoding parameter.
|
||||
|
||||
(gdk_string_to_compound_text_for_display,
|
||||
gdk_utf8_to_compound_text_for_display): Don't even pretend
|
||||
supporting COMPOUND_TEXT.
|
||||
|
||||
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
|
||||
|
||||
(sanitize_utf8): Zero-terminate string.
|
||||
|
||||
Tue Jul 6 10:00:22 2004 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
Fix for #136496, Pawel Salek:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_changed): Queue a redraw on
|
||||
a node when it changes in fixed_height mode.
|
||||
|
||||
(gtk_tree_view_node_queue_redraw): new function to queue a redraw
|
||||
on a node.
|
||||
|
||||
2004-07-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_position): Make sure
|
||||
private->monitor_num is a valid monitor number before
|
||||
using it. (#139187, Michael Natterer)
|
||||
|
||||
2004-06-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid
|
||||
a crash if the font doesn't exist. (#144967, Yevgen Muntyan)
|
||||
|
||||
Tue Jul 6 02:00:28 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (popup_position_func):
|
||||
* gtk/gtkentry.c (popup_position_func):
|
||||
* gtk/gtktextview.c (popup_position_func): Improve positioning
|
||||
of keyboard-activated menus with Xinerama.
|
||||
|
||||
Tue Jul 6 00:29:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkuimanager.c (do_updates):
|
||||
(do_updates_idle): Only call GDK_THREADS_ENTER() / _LEAVE()
|
||||
when called from an idle handler. (#145429, Jan-Marek Glogowski)
|
||||
|
||||
Mon Jul 5 23:47:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserutils.c (delegate_notify): Use
|
||||
the less efficient g_object_interface_find_property () instead
|
||||
of the param_id range check, since the GParamSpecs we're
|
||||
dealing with are the overridden onces on the interface, whose
|
||||
param_id is always zero. (#145312, Alex Roitman, fix proposed
|
||||
by Owen Taylor)
|
||||
|
||||
Sun Jul 4 01:29:35 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_drag_data_get):
|
||||
(gtk_calendar_drag_data_received): Fix off-by-one error.
|
||||
GDate month is one-based and GtkCalendar month is zero-based.
|
||||
(#145134, William Jon McCann)
|
||||
|
||||
Sun Jul 4 01:11:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Don't crash if
|
||||
somebody tries to move a node after itself in a list of
|
||||
length 1. (#145291, Sampo Nurmentaus)
|
||||
|
||||
Sat Jul 3 23:43:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* docs/faq/gtk-faq.sgml:
|
||||
* gtk/gtkwindow.c: Fix links to www.freedesktop.org. (#145210,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jul 3 02:09:51 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtksocket.c (gtk_socket_end_embedding): Reset current_width
|
||||
and current_height to 0 when ending the embedding. (#143675,
|
||||
Nickolay V. Shmyrev)
|
||||
|
||||
Sat Jul 3 01:48:19 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_move_visually): Let the cursor move
|
||||
to the right end of the entry text, even if it ends in combining
|
||||
marks. (#141728, Theppitak Karoonboonyanan)
|
||||
|
||||
Fri Jul 2 23:34:33 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_unset_model): Unset the displayed
|
||||
row when unsetting the model. (#138560, Christian Persch)
|
||||
|
||||
Fri Jul 2 22:41:27 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Properly align mask and
|
||||
pixbuf if a subarea is exposed. (#135423, fix by John Ehresman)
|
||||
|
||||
2004-07-01 J. Ali Harlow <ali@juiblex.co.uk>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_ungrab_pointer): Fix
|
||||
win32 build problem w/o wintab. Fixed #145242
|
||||
|
||||
Sat Jun 26 01:15:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (set_initial_hints): Handle
|
||||
_NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. (#144851,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jun 26 01:04:31 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (clear_cache): Prevent unwanted
|
||||
recursion by resetting icon_set->cache before freeing
|
||||
the cache. (#144947, Tim Janik)
|
||||
|
||||
Sat Jun 26 00:40:02 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (render_icon_name_pixbuf):
|
||||
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon):
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): Accept a NULL
|
||||
style.
|
||||
|
||||
Sat Jun 26 00:06:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Reflect the
|
||||
last change in the docs.
|
||||
|
||||
Fri Jun 25 23:35:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
|
||||
NULL to unset the model. (#137211, patch by Mariano Suárez-Alvarez)
|
||||
|
||||
Fri Jun 25 23:33:05 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
|
||||
placement policy for GtkComboBoxEntry to be: if it fits below,
|
||||
place below, if it fits above place above, else place in the
|
||||
larger space and scroll so that the scroll arrow appear at the
|
||||
far end. (#144362, David A. Knight)
|
||||
|
||||
Fri Jun 25 22:49:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
|
||||
use of &parent_iter. (#145007, John Finlay)
|
||||
|
||||
2004-06-25 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
reviewed by: Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkkeys-x11.c: (get_symbol), (update_keymaps),
|
||||
(gdk_keymap_lookup_key), (translate_keysym): fix keys parsing when
|
||||
the number of keysyms per keycode is odd. Fixes #144808.
|
||||
|
||||
Fri Jun 25 00:32:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change
|
||||
which was mentioned below.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a Save
|
||||
or an Open stock button for the C-l dialog depending on the action
|
||||
in which the file chooser operates. Fixes #141753.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes the GTK+ part of #142308:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_filename_to_path):
|
||||
Use filename_to_path().
|
||||
(gtk_file_system_unix_uri_to_path): Likewise.
|
||||
(filename_to_path): Use remove_trailing_slash().
|
||||
|
||||
2004-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaccelmap.c (_gtk_accel_path_is_valid): Accept
|
||||
"<WINDOWTYPE>" as a valid accel path. (#144427, Philip
|
||||
Kendall)
|
||||
|
||||
* gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure
|
||||
this gets defined for all backends, so linux-fb has a
|
||||
chance of compiling.
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Make this work
|
||||
for children of the root. (#139785, Jean-François Wauthy,
|
||||
patch by John Finlay)
|
||||
|
||||
* gtk/gtkicontheme.h (GTK_ICON_THEME_GET_CLASS): Typo
|
||||
fix. (#144750, Jeff Franks)
|
||||
|
||||
2004-06-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gdk/x11/gdkdrawable-x11.[ch]: made convert_format() utility
|
||||
function public as _gdk_x11_convert_to_format().
|
||||
|
||||
* gdk/x11/gdkcursor-x11.c (create_cursor_image): premultiply
|
||||
the pixels from the GdkPixbuf when putting them in the
|
||||
Xcursor image. Fixes bug #144350.
|
||||
|
||||
2004-06-16 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_added): When inserting a
|
||||
visible node, free the old path before creating the new one.
|
||||
Fixes #144356.
|
||||
|
||||
Tue Jun 15 01:10:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c: Make GtkComboBox work without model.
|
||||
(#144198, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-11 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #143578:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_add_editable):
|
||||
Don't ref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Don't unref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Ahem, free the node.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
|
||||
Added fields for edited_idle and edited_new_text.
|
||||
(renderer_edited_cb): Queue the
|
||||
creation of the folder in an idle handler.
|
||||
(renderer_editing_canceled_cb): Likewise for the cancellation.
|
||||
(gtk_file_chooser_default_finalize): Free the impl->edited_new_text.
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.4
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Thu Jun 10 22:15:01 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmain.c (gtk_parse_args): Typo fix.
|
||||
|
||||
Thu Jun 10 21:16:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_destroy):
|
||||
Check whether priv->box is NULL before disconnecting
|
||||
from its signals. Fix merged from HEAD.
|
||||
|
||||
2004-06-10 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #144110, patch by Bastien Nocera <hadess@hadess.net>.
|
||||
|
||||
* gtk/gtkfilechooser.c (gtk_file_chooser_list_shortcut_folders):
|
||||
Refer to gtk_file_chooser_add_shortcut_folder().
|
||||
(gtk_file_chooser_list_shortcut_folder_uris): Refer to
|
||||
gtk_file_chooser_add_shortcut_folder_uri().
|
||||
|
||||
Thu Jun 10 00:36:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_main_button): Start
|
||||
the drag before focusing the selected.day.
|
||||
* gtk/gtkcalendar.c (gtk_calendar_state_changed): Stop
|
||||
a beginning drag if the widget becomes insensitive.
|
||||
|
||||
Thu Jun 10 00:05:11 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_button_press): Start
|
||||
spinning before calling arrow_action(), so that a signal
|
||||
handler triggered from arrow_action() has a chance to
|
||||
stop the spinning. (#143966, Davyd Madeley)
|
||||
|
||||
Wed Jun 9 23:05:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a
|
||||
typo. (#144070, Kent Sandvik)
|
||||
|
||||
Thu Jun 10 00:22:51 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert the "drag select" part of
|
||||
#141169. (#144011).
|
||||
|
||||
Mon Jun 7 23:07:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): Handle
|
||||
priv->model being NULL. (#143856, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-07 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_button_press): Revert the patch
|
||||
from 2003/Sep/12. This kept DnD in tree views within modal
|
||||
dialogs from working, which is especially bad for the file
|
||||
chooser. Fixes #135168.
|
||||
|
||||
Sat Jun 5 23:07:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c: (gtk_entry_completion_init),
|
||||
(gtk_entry_completion_list_enter_notify),
|
||||
(gtk_entry_completion_list_motion_notify),
|
||||
(_gtk_entry_completion_popup), (_gtk_entry_completion_popdown):
|
||||
* gtk/gtkentryprivate.h: Add an ignore_enter flag and
|
||||
use it as in the menu code to avoid the initial selection if
|
||||
the window pops up under the pointer. (Anders Carlsson)
|
||||
|
||||
Sat Jun 5 20:05:39 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* tests/testmerge.c: Add a checkbox to queue an
|
||||
merge/unmerge. Patch from Matthias Clasen.
|
||||
|
||||
* gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Add a new flag
|
||||
"need_rebuild"
|
||||
(rebuild_menu): New function that rebuilds the overflow menu and
|
||||
makes sure it doesn't start or end with a separator.
|
||||
(toolbar_content_new_tool_item)
|
||||
(toolbar_content_remove)
|
||||
(toolbar_content_new_compatibility): Set the rebuild_needed flag
|
||||
(gtk_toolbar_size_allocate): Only show the overflow arrow when we
|
||||
have actually overflown an item with a proxy menu item. Also make
|
||||
sure we rebuild the menu if needed.
|
||||
|
||||
Fix #125504, #142377, #143463
|
||||
|
||||
* gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_expose):
|
||||
Obey the "priv->draw" flag. (#143692)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/widget_geometry.txt: Add a note about the !CAN_FOCUS
|
||||
quirk in the button size allocation code.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Give the space
|
||||
requested for drawing the focus indicator to the child in the
|
||||
!CAN_FOCUS case. This should fix issues which the Gimp has with
|
||||
the button allocation changes in 2.4.2.
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.3
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
|
||||
length of the entry contents in characters, not in bytes.
|
||||
|
||||
* gtk/gtkentry.c (paste_received): Don't pop up the completion
|
||||
window on paste, noticed by Anders Carlsson.
|
||||
|
||||
Thu Jun 3 20:51:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
|
||||
values and default value for the ::active property. (#143669,
|
||||
Olivier Andrieu)
|
||||
|
||||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkimagemenuitem.c: use gtk_widget_get_child_requisition()
|
||||
instead of accessing item->image->allocation.width/height
|
||||
directly. Makes widgets which only have a requisition set using
|
||||
gtk_widget_set_size_request() work and fixes bug #142789.
|
||||
|
||||
Thu Jun 3 08:07:59 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert previous commit. It caused the problem
|
||||
of sticky right click menus to return.
|
||||
|
||||
Wed Jun 2 01:56:02 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Fix the stay up algorithm for combo boxes to
|
||||
better handle the "click" case. Better fix for #141169.
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_init): Bail out if the
|
||||
model is empty. Fixes #143536.
|
||||
|
||||
2004-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_size_focus_out): Don't
|
||||
close the dialog on focus out of the size entry. (#143505,
|
||||
David Hawthorne)
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #138807.
|
||||
|
||||
* gtk/fnmatch.c (_gtk_fnmatch): Take a no_leading_period argument.
|
||||
(gtk_fnmatch_intern): Likewise; also implement this option.
|
||||
|
||||
* gtk/gtkprivate.h (_gtk_fnmatch): Updated prototype.
|
||||
|
||||
* gtk/gtkfilesel.c (find_completion_dir): Pass TRUE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
(attempt_file_completion): Likewise.
|
||||
|
||||
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Pass FALSE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
|
||||
Wed Jun 2 00:46:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkselection.c (_gtk_selection_request): Remove leftover
|
||||
debug code.
|
||||
|
||||
Wed Jun 2 00:17:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_select_range): Don't
|
||||
allow unless selection mode is multiple. (#142634, John Finlay)
|
||||
|
||||
Tue Jun 1 23:14:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktoolbar.h:
|
||||
* gtk/gtktoolbar.c:
|
||||
* gtk/gtkentrycompletion.h:
|
||||
* gtk/gtkentrycompletion.c:
|
||||
* gtk/gtkcombobox.h:
|
||||
* gtk/gtkcombobox.c: Rename function parameters from
|
||||
index to index_ to prevent clash with BSD index(). (#143001)
|
||||
|
||||
Tue Jun 1 22:41:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenu.c (get_accel_path): Handle accel_closure being
|
||||
NULL on an accel label. (#139641, Sam Stephenson, patch by
|
||||
Michael Natterer)
|
||||
|
||||
Tue Jun 1 22:19:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkicontheme.c (theme_subdir_load): Prevent icon
|
||||
lookup finding icons in the wrong prefix. (#143328,
|
||||
Mark McLoughlin)
|
||||
|
||||
Wed Jun 2 00:39:58 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
Bug #141169.
|
||||
|
||||
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Make menus
|
||||
only stay up if you release within 500 milliseconds.
|
||||
(gtk_menu_shell_button_press): Set the activate_time to the event
|
||||
time when a button is pressed.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_motion_notify, gtk_menu_enter_notify):
|
||||
Interprete button releases as activate when we have seen both an
|
||||
enter an a motion event.
|
||||
|
||||
2004-06-01 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_removed): Don't insert a
|
||||
dummy node if there is no parent node. Fixes #143362.
|
||||
|
||||
2004-05-31 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (renderer_edited_cb): Change to the
|
||||
newly-created folder. Fixes #138932.
|
||||
(trap_activate_cb): Only return TRUE if we did handle the event.
|
||||
Fixes #143359; patch by jylefort@brutele.be.
|
||||
|
||||
Mon May 31 02:38:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_new_from_pixmap): Fix typo in
|
||||
docs. (#142892, Tommi Komulainen)
|
||||
|
||||
Mon May 31 02:21:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhandlebox.c: Make detached handleboxes work when their
|
||||
parent is minimized, porting the fix from 1.2. (#1923, #57182)
|
||||
|
||||
Mon May 31 02:03:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwindow.c (gtk_window_show): Make moving realized,
|
||||
unmapped windows work.
|
||||
|
||||
2004-05-29 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* configure.in: Added "tk" to ALL_LINGUAS.
|
||||
|
||||
Fri May 28 14:57:13 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
|
||||
messages for common problems. (#137974, Owen Taylor)
|
||||
|
||||
Fri May 28 14:14:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkevents-x11.c: Fix off-by-one errors. (#143337,
|
||||
Billy Biggs)
|
||||
|
||||
Thu May 27 00:12:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_request): Fix a typo.
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Send key
|
||||
modifiers (shift, ctrl etc) in button and motion events from the
|
||||
tablet. (#143240)
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (gdk_device_get_state): Simple
|
||||
implementation for extended input devices using last known
|
||||
device state (#143237)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (propagate): Don't propagate mouse
|
||||
events to windows that want extended input events. (#142943)
|
||||
(gdk_event_translate): Move check for extended input devices to
|
||||
propagate, new parameter to propagate.
|
||||
(gdk_pointer_grab, gdk_display_pointer_ungrab): Enable calls to
|
||||
_gdk_input_(un)grab_pointer. (#142943)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Check for
|
||||
input grab. [Fix missing update of impl in "dijkstra" event
|
||||
propagation loop] Drop the parallel "impl" pointer, just use a
|
||||
cast. Don't propagate beyond windows that want normal input
|
||||
events. (#142943)
|
||||
(gdk_input_grab_pointer, gdk_input_ungrab_pointer): Limited
|
||||
implementation of input grab. (#142943)
|
||||
|
||||
2004-05-22 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (print_lc): Remove duplicated
|
||||
line. (Spotted by Benoît Carpentier.)
|
||||
|
||||
2004-05-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
|
||||
Restrict the width of the popup to be no larger than the
|
||||
monitor. (#142678, DmD Ljungmark)
|
||||
|
||||
* gtk/gtkbutton.c: Go back to the initial fix for the
|
||||
focus-overdrawing problem, which was actually correct
|
||||
according to docs/widget_geometry.txt.
|
||||
|
||||
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
|
||||
arrow size from 11 to 15 to compensate for that.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_request)
|
||||
(gtk_button_size_allocate, _gtk_button_paint): Allocate
|
||||
space for the focus rectangle only if necessary. (#142668,
|
||||
Michael Natterer)
|
||||
|
||||
Sun May 16 23:14:37 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove two useless
|
||||
lines. (#142479, Morten Welinder)
|
||||
|
||||
2004-05-15 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Put back the ref_count field in the
|
||||
GdkDragContextPrivateWin32 struct (but inside ifdef OLE2_DND this
|
||||
time). It is used by the OLE2_DND code, which is unfinished and
|
||||
presumably horribly broken, but still, let's not make it not
|
||||
compile on purpose. Silence some gcc warnings in the OLE2_DND
|
||||
code.
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_tree_window_to_tree_coords):
|
||||
New function to go from tree window to tree coordinates, kept
|
||||
static for now until we figure out the multiple coordinate
|
||||
system mess in GtkTreeView API-wise.
|
||||
(gtk_tree_view_scroll_to_cell): Transform the coordinates
|
||||
from tree window to tree coordinates, using the new function.
|
||||
Previously, the x coordinate was wrongly transformed. (#142494)
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdktypes.h (GdkModifierType): Add a comment about unused
|
||||
bits.
|
||||
|
||||
* gtk/gtkstock.c (real_add, gtk_stock_lookup): Use an unused
|
||||
modifier bit to mark stock item which need to be freed
|
||||
eventually. (#140654, Michal Pasternak, Scott Tsai)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add missing
|
||||
call to g_object_ref in Wintab code. (#138341)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c: Fix numerous Wintab problems
|
||||
including unallocated buffers for event->motion.axes and
|
||||
event->button.axes, unsigned wraparound problem in the code for
|
||||
detecting missing press/release events and assigning min instead
|
||||
of max when setting up axes.
|
||||
|
||||
2004-05-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
|
||||
previous change to this function, clarify the docs instead.
|
||||
|
||||
2004-05-11 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): don't allocate the popup
|
||||
smaller than the combobox. Fixes bug #59660.
|
||||
|
||||
2004-05-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeprivate.h:
|
||||
* gtk/gtktreeview.c: Add a hove selection mode, which
|
||||
when TRUE makes the selection follow the mouse.
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_init):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection
|
||||
mode. (#127648, Dave Bordoley)
|
||||
|
||||
Mon May 10 23:04:25 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.h: Add prototype for _gtk_widget_grab_notify()
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkwindow.c (get_screen_icon_info):
|
||||
Make static.
|
||||
|
||||
* gdk/gdkdisplay.c (singlehead_...):
|
||||
* gdk/x11/gdkkeys-x11.c (get_effective_keymap):
|
||||
* gdk/x11/gdkgeometry-x11.c (expose_serial_predicate):
|
||||
* gdk/x11/gdkdisplay-x11.c (escape_for_xmessage): Make static.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below):
|
||||
Place the window above the combobox, if there is not enough
|
||||
room below.
|
||||
|
||||
* tests/testentrycompletion.c: Make the second example use the
|
||||
::match-selected signal to make it actually work.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): Make sure the menu pops up
|
||||
as wide as the combobox. (#59660, Havoc Pennington)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfontsel.c (list_row_activated): Make Return activate the
|
||||
default button. (#118921)
|
||||
|
||||
Mon May 10 15:03:50 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.c (_gtk_widget_grab_notify): New internal function
|
||||
that emits the grab notify signal.
|
||||
|
||||
* gtk/gtkmain.c (gtk_grab_notify_foreach): Use it here.
|
||||
|
||||
Mon May 10 00:51:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkmenu.c: Make destruction of a torn off menu work
|
||||
like un-tearing off.
|
||||
|
||||
Sun May 9 21:05:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
|
||||
Allow to suppress the stock accelerator by using "". (#142196,
|
||||
David A Knight)
|
||||
|
||||
2004-05-08 Hans Breuer <hans@breuer.org>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemwin32.c (extract_icon) : finally also
|
||||
create the correct mask for 'pseudo mime' icons
|
||||
|
||||
Sun May 9 01:57:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_button_released):
|
||||
In list mode, accept the same mouse/wheel bindings on
|
||||
the cellview as on the button. (#136967)
|
||||
|
||||
Sun May 9 01:29:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkiconfactory.c (add_to_cache): Actually count the
|
||||
cached icons. (#135888, Crispin Flowerday)
|
||||
|
||||
Sun May 9 00:03:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure
|
||||
that we actually return menus for nodes of type menu, not the
|
||||
menuitems they're attached to.
|
||||
|
||||
2004-05-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
|
||||
draw over the focus rectangle.
|
||||
|
||||
Thu May 6 23:48:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): Also
|
||||
popup the submenu for items in torn off menus. (#122051)
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_state_changed): Remove
|
||||
this no longer needed signal handler. (#141817, Paul Pogonyshev)
|
||||
|
||||
2004-05-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gtk/gtkexpander.c (gtk_expander_size_allocate): in RTL mode,
|
||||
position the title lable next to the arrow just as we do for LTR
|
||||
rendering. Fixes bug #141825.
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/RELEASE-HOWTO: Document the new policy of
|
||||
bumping version numbers after release.
|
||||
|
||||
* configure.in: Bump version number to 2.4.2.
|
||||
|
||||
Wed May 5 22:23:59 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (icon_source_clear): Don't
|
||||
call g_free() on a pixbuf. (#141961, Crispin Flowerday)
|
||||
|
||||
2004-05-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (print_node): Make the output
|
||||
parseable. (#141929, Sven Neumann)
|
||||
|
||||
2004-05-05 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window_for_screen): Add
|
||||
multi-monitor offset. (#141842, John Ehresman)
|
||||
|
||||
2004-05-04 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Fixes #139562, based on a patch by Christian Neumair.
|
||||
|
||||
@@ -1,3 +1,947 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-09 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes #137031:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (get_fallback_icon): New helper
|
||||
function, fetches a stock icon as a fallback.
|
||||
(gtk_file_system_unix_volume_render_icon): Fall back to a stock
|
||||
icon.
|
||||
(gtk_file_system_unix_render_icon): Fall back to a stock icon.
|
||||
Use helper functions rather than being a mega-function.
|
||||
(get_icon_name_for_directory): Renamed from
|
||||
get_icon_for_directory().
|
||||
(get_icon_type_from_path): New helper function; code pulled out
|
||||
from gtk_file_system_unix_render_icon().
|
||||
(get_special_icon): Likewise.
|
||||
(get_icon_for_mime_type): Likewise.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_paint_window): Use the
|
||||
requisition of the widget instead of relying on the style
|
||||
drawing function to supply the size of the drawable. (#146531)
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* NEWS: Updates.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make GtkEntry work harder to protect passwords: (#143955,
|
||||
Morten Welinder)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_destroy): Add a destroy handler
|
||||
to clear the password even if the widget is leaked.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_delete_text):
|
||||
* gtk/gtkentry.c (gtk_entry_finalize): Zero out the memory
|
||||
before freeing it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_insert_text): Zero and free
|
||||
the old memory instead of just reallocating it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_create_layout): Don't leak text
|
||||
direction information for passwords.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Fix some cases where style functions were
|
||||
not handling widget == NULL properly. (#146282)
|
||||
|
||||
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (get_default_icons):
|
||||
* gtk/stock-icons/Makefile.am: Add stock file and
|
||||
directory icons in sizes 16 and 24. Do not add the stock ids
|
||||
to the gtkstock.h, since they are only for internal use on the
|
||||
2.4 branch.
|
||||
|
||||
2004-07-08 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #139290:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Add a
|
||||
GError argument. Do check for errors when getting the
|
||||
GtkFileFolder: get the folder and read the children before
|
||||
actually creating the model. Removed obsolete code that handled
|
||||
roots-changed on the file system.
|
||||
(file_model_node_get_info): Assert that we don't reach the old
|
||||
case to display file system roots.
|
||||
(roots_changed_callback): Removed.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (set_list_model): Add a GError
|
||||
argument, and a boolean return value. Return an error if we
|
||||
cannot create the file system model. On error, set a NULL model
|
||||
on the tree.
|
||||
(gtk_file_chooser_default_set_current_folder): Use the error value
|
||||
from set_list_model().
|
||||
(gtk_file_chooser_default_set_property): Set the show_hidden
|
||||
property only if the browse_files_model exists.
|
||||
(gtk_file_chooser_default_unselect_path): Only operate if the
|
||||
browse_files_model exists.
|
||||
(check_preview_change): Check whether we have the sort_model.
|
||||
(change_folder_and_display_error): Copy the path we get passed
|
||||
before using it. There's a comment in there that explains why we
|
||||
need to copy it; basically, if the passed path belongs to the
|
||||
model, the model may go away in the middle of this function and
|
||||
we'll be left with a dangling pointer.
|
||||
(install_list_model_filter): Assert that the model is not NULL.
|
||||
(set_current_filter): Check whether the model exists.
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Don't
|
||||
g_return_if_fail if the model is NULL.
|
||||
(gtk_tree_selection_get_selected_rows): Likewise.
|
||||
(gtk_tree_selection_count_selected_rows): Likewise.
|
||||
(gtk_tree_selection_selected_foreach): Likewise.
|
||||
(gtk_tree_selection_path_is_selected): Likewise; rather just
|
||||
return FALSE.
|
||||
(gtk_tree_selection_select_all): Likewise.
|
||||
(gtk_tree_selection_unselect_all): Likewise.
|
||||
(gtk_tree_selection_select_range): Do g_return_if_fail() if the
|
||||
model is NULL.
|
||||
(gtk_tree_selection_unselect_range): Likewise.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (fill_in_names): Return immediately if
|
||||
g_dir_open() fails: there is no need to set the error ourselves,
|
||||
as g_dir_open() already does it.
|
||||
|
||||
2004-07-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_search_equal_func): Allow
|
||||
to restore the default search function. (#145365, John Finlay)
|
||||
|
||||
* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
|
||||
references to the drag context. (#144324, Alex Larsson)
|
||||
|
||||
Thu Jul 8 00:33:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_model): Stop editing
|
||||
when a new model is set. (#145566, Dmitry M. Shatrov)
|
||||
|
||||
Wed Jul 7 23:44:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Make sure that subpixbufs
|
||||
are properly aligned for gdk_pixbuf_saturate_and_pixelate(),
|
||||
in order to avoid rendering artifacts from misaligned
|
||||
pixelation patterns. (#145585, Felipe Heidrich, Billy Biggs)
|
||||
|
||||
Tue Jul 6 23:00:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Fix
|
||||
a 64bit alignment issue. (#144302, Sunil)
|
||||
|
||||
2004-07-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
|
||||
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
|
||||
* gdk/win32/gdkproperty-win32.c (find_common_locale,
|
||||
gdk_property_change)
|
||||
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
|
||||
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
|
||||
below).
|
||||
|
||||
* gdk/win32/gdkglobals-win32.c
|
||||
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
|
||||
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
|
||||
atom. Initialize it. Declare it. Drop the variable for the
|
||||
COMPOUND_TEXT atom.
|
||||
|
||||
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
|
||||
function is supposed to return the string in the locale's charset
|
||||
and encoding. Use g_convert().
|
||||
|
||||
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
|
||||
string in the locale's charset. Use g_convert().
|
||||
|
||||
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
|
||||
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
|
||||
GLib's UTF-16 functions instead. Windows uses UTF-16.
|
||||
|
||||
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
|
||||
functions mentioned above.
|
||||
|
||||
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
|
||||
also if the string is of type STRING, i.e. ISO-8859-1, and the
|
||||
current codepage is 1252, and contains no C1 chars. Accept
|
||||
also UTF8_STRING.
|
||||
|
||||
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
|
||||
Mark as static. When storing STRING data, convert to
|
||||
Latin-1. (#140537)
|
||||
(gdk_selection_owner_set_for_display): Now that STRING is always
|
||||
ISO-8859-1, use UTF8_STRING when sending the selection request
|
||||
to ourselves.
|
||||
|
||||
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
|
||||
Ehresman)
|
||||
|
||||
(gdk_text_property_to_text_list_for_display): Make work more like
|
||||
X11 version. Do obey the encoding parameter.
|
||||
|
||||
(gdk_string_to_compound_text_for_display,
|
||||
gdk_utf8_to_compound_text_for_display): Don't even pretend
|
||||
supporting COMPOUND_TEXT.
|
||||
|
||||
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
|
||||
|
||||
(sanitize_utf8): Zero-terminate string.
|
||||
|
||||
Tue Jul 6 10:00:22 2004 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
Fix for #136496, Pawel Salek:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_changed): Queue a redraw on
|
||||
a node when it changes in fixed_height mode.
|
||||
|
||||
(gtk_tree_view_node_queue_redraw): new function to queue a redraw
|
||||
on a node.
|
||||
|
||||
2004-07-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_position): Make sure
|
||||
private->monitor_num is a valid monitor number before
|
||||
using it. (#139187, Michael Natterer)
|
||||
|
||||
2004-06-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid
|
||||
a crash if the font doesn't exist. (#144967, Yevgen Muntyan)
|
||||
|
||||
Tue Jul 6 02:00:28 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (popup_position_func):
|
||||
* gtk/gtkentry.c (popup_position_func):
|
||||
* gtk/gtktextview.c (popup_position_func): Improve positioning
|
||||
of keyboard-activated menus with Xinerama.
|
||||
|
||||
Tue Jul 6 00:29:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkuimanager.c (do_updates):
|
||||
(do_updates_idle): Only call GDK_THREADS_ENTER() / _LEAVE()
|
||||
when called from an idle handler. (#145429, Jan-Marek Glogowski)
|
||||
|
||||
Mon Jul 5 23:47:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserutils.c (delegate_notify): Use
|
||||
the less efficient g_object_interface_find_property () instead
|
||||
of the param_id range check, since the GParamSpecs we're
|
||||
dealing with are the overridden onces on the interface, whose
|
||||
param_id is always zero. (#145312, Alex Roitman, fix proposed
|
||||
by Owen Taylor)
|
||||
|
||||
Sun Jul 4 01:29:35 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_drag_data_get):
|
||||
(gtk_calendar_drag_data_received): Fix off-by-one error.
|
||||
GDate month is one-based and GtkCalendar month is zero-based.
|
||||
(#145134, William Jon McCann)
|
||||
|
||||
Sun Jul 4 01:11:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Don't crash if
|
||||
somebody tries to move a node after itself in a list of
|
||||
length 1. (#145291, Sampo Nurmentaus)
|
||||
|
||||
Sat Jul 3 23:43:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* docs/faq/gtk-faq.sgml:
|
||||
* gtk/gtkwindow.c: Fix links to www.freedesktop.org. (#145210,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jul 3 02:09:51 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtksocket.c (gtk_socket_end_embedding): Reset current_width
|
||||
and current_height to 0 when ending the embedding. (#143675,
|
||||
Nickolay V. Shmyrev)
|
||||
|
||||
Sat Jul 3 01:48:19 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_move_visually): Let the cursor move
|
||||
to the right end of the entry text, even if it ends in combining
|
||||
marks. (#141728, Theppitak Karoonboonyanan)
|
||||
|
||||
Fri Jul 2 23:34:33 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_unset_model): Unset the displayed
|
||||
row when unsetting the model. (#138560, Christian Persch)
|
||||
|
||||
Fri Jul 2 22:41:27 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Properly align mask and
|
||||
pixbuf if a subarea is exposed. (#135423, fix by John Ehresman)
|
||||
|
||||
2004-07-01 J. Ali Harlow <ali@juiblex.co.uk>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_ungrab_pointer): Fix
|
||||
win32 build problem w/o wintab. Fixed #145242
|
||||
|
||||
Sat Jun 26 01:15:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (set_initial_hints): Handle
|
||||
_NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. (#144851,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jun 26 01:04:31 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (clear_cache): Prevent unwanted
|
||||
recursion by resetting icon_set->cache before freeing
|
||||
the cache. (#144947, Tim Janik)
|
||||
|
||||
Sat Jun 26 00:40:02 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (render_icon_name_pixbuf):
|
||||
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon):
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): Accept a NULL
|
||||
style.
|
||||
|
||||
Sat Jun 26 00:06:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Reflect the
|
||||
last change in the docs.
|
||||
|
||||
Fri Jun 25 23:35:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
|
||||
NULL to unset the model. (#137211, patch by Mariano Suárez-Alvarez)
|
||||
|
||||
Fri Jun 25 23:33:05 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
|
||||
placement policy for GtkComboBoxEntry to be: if it fits below,
|
||||
place below, if it fits above place above, else place in the
|
||||
larger space and scroll so that the scroll arrow appear at the
|
||||
far end. (#144362, David A. Knight)
|
||||
|
||||
Fri Jun 25 22:49:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
|
||||
use of &parent_iter. (#145007, John Finlay)
|
||||
|
||||
2004-06-25 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
reviewed by: Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkkeys-x11.c: (get_symbol), (update_keymaps),
|
||||
(gdk_keymap_lookup_key), (translate_keysym): fix keys parsing when
|
||||
the number of keysyms per keycode is odd. Fixes #144808.
|
||||
|
||||
Fri Jun 25 00:32:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change
|
||||
which was mentioned below.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a Save
|
||||
or an Open stock button for the C-l dialog depending on the action
|
||||
in which the file chooser operates. Fixes #141753.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes the GTK+ part of #142308:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_filename_to_path):
|
||||
Use filename_to_path().
|
||||
(gtk_file_system_unix_uri_to_path): Likewise.
|
||||
(filename_to_path): Use remove_trailing_slash().
|
||||
|
||||
2004-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaccelmap.c (_gtk_accel_path_is_valid): Accept
|
||||
"<WINDOWTYPE>" as a valid accel path. (#144427, Philip
|
||||
Kendall)
|
||||
|
||||
* gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure
|
||||
this gets defined for all backends, so linux-fb has a
|
||||
chance of compiling.
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Make this work
|
||||
for children of the root. (#139785, Jean-François Wauthy,
|
||||
patch by John Finlay)
|
||||
|
||||
* gtk/gtkicontheme.h (GTK_ICON_THEME_GET_CLASS): Typo
|
||||
fix. (#144750, Jeff Franks)
|
||||
|
||||
2004-06-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gdk/x11/gdkdrawable-x11.[ch]: made convert_format() utility
|
||||
function public as _gdk_x11_convert_to_format().
|
||||
|
||||
* gdk/x11/gdkcursor-x11.c (create_cursor_image): premultiply
|
||||
the pixels from the GdkPixbuf when putting them in the
|
||||
Xcursor image. Fixes bug #144350.
|
||||
|
||||
2004-06-16 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_added): When inserting a
|
||||
visible node, free the old path before creating the new one.
|
||||
Fixes #144356.
|
||||
|
||||
Tue Jun 15 01:10:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c: Make GtkComboBox work without model.
|
||||
(#144198, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-11 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #143578:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_add_editable):
|
||||
Don't ref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Don't unref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Ahem, free the node.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
|
||||
Added fields for edited_idle and edited_new_text.
|
||||
(renderer_edited_cb): Queue the
|
||||
creation of the folder in an idle handler.
|
||||
(renderer_editing_canceled_cb): Likewise for the cancellation.
|
||||
(gtk_file_chooser_default_finalize): Free the impl->edited_new_text.
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.4
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Thu Jun 10 22:15:01 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmain.c (gtk_parse_args): Typo fix.
|
||||
|
||||
Thu Jun 10 21:16:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_destroy):
|
||||
Check whether priv->box is NULL before disconnecting
|
||||
from its signals. Fix merged from HEAD.
|
||||
|
||||
2004-06-10 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #144110, patch by Bastien Nocera <hadess@hadess.net>.
|
||||
|
||||
* gtk/gtkfilechooser.c (gtk_file_chooser_list_shortcut_folders):
|
||||
Refer to gtk_file_chooser_add_shortcut_folder().
|
||||
(gtk_file_chooser_list_shortcut_folder_uris): Refer to
|
||||
gtk_file_chooser_add_shortcut_folder_uri().
|
||||
|
||||
Thu Jun 10 00:36:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_main_button): Start
|
||||
the drag before focusing the selected.day.
|
||||
* gtk/gtkcalendar.c (gtk_calendar_state_changed): Stop
|
||||
a beginning drag if the widget becomes insensitive.
|
||||
|
||||
Thu Jun 10 00:05:11 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_button_press): Start
|
||||
spinning before calling arrow_action(), so that a signal
|
||||
handler triggered from arrow_action() has a chance to
|
||||
stop the spinning. (#143966, Davyd Madeley)
|
||||
|
||||
Wed Jun 9 23:05:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a
|
||||
typo. (#144070, Kent Sandvik)
|
||||
|
||||
Thu Jun 10 00:22:51 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert the "drag select" part of
|
||||
#141169. (#144011).
|
||||
|
||||
Mon Jun 7 23:07:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): Handle
|
||||
priv->model being NULL. (#143856, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-07 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_button_press): Revert the patch
|
||||
from 2003/Sep/12. This kept DnD in tree views within modal
|
||||
dialogs from working, which is especially bad for the file
|
||||
chooser. Fixes #135168.
|
||||
|
||||
Sat Jun 5 23:07:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c: (gtk_entry_completion_init),
|
||||
(gtk_entry_completion_list_enter_notify),
|
||||
(gtk_entry_completion_list_motion_notify),
|
||||
(_gtk_entry_completion_popup), (_gtk_entry_completion_popdown):
|
||||
* gtk/gtkentryprivate.h: Add an ignore_enter flag and
|
||||
use it as in the menu code to avoid the initial selection if
|
||||
the window pops up under the pointer. (Anders Carlsson)
|
||||
|
||||
Sat Jun 5 20:05:39 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* tests/testmerge.c: Add a checkbox to queue an
|
||||
merge/unmerge. Patch from Matthias Clasen.
|
||||
|
||||
* gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Add a new flag
|
||||
"need_rebuild"
|
||||
(rebuild_menu): New function that rebuilds the overflow menu and
|
||||
makes sure it doesn't start or end with a separator.
|
||||
(toolbar_content_new_tool_item)
|
||||
(toolbar_content_remove)
|
||||
(toolbar_content_new_compatibility): Set the rebuild_needed flag
|
||||
(gtk_toolbar_size_allocate): Only show the overflow arrow when we
|
||||
have actually overflown an item with a proxy menu item. Also make
|
||||
sure we rebuild the menu if needed.
|
||||
|
||||
Fix #125504, #142377, #143463
|
||||
|
||||
* gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_expose):
|
||||
Obey the "priv->draw" flag. (#143692)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/widget_geometry.txt: Add a note about the !CAN_FOCUS
|
||||
quirk in the button size allocation code.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Give the space
|
||||
requested for drawing the focus indicator to the child in the
|
||||
!CAN_FOCUS case. This should fix issues which the Gimp has with
|
||||
the button allocation changes in 2.4.2.
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.3
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
|
||||
length of the entry contents in characters, not in bytes.
|
||||
|
||||
* gtk/gtkentry.c (paste_received): Don't pop up the completion
|
||||
window on paste, noticed by Anders Carlsson.
|
||||
|
||||
Thu Jun 3 20:51:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
|
||||
values and default value for the ::active property. (#143669,
|
||||
Olivier Andrieu)
|
||||
|
||||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkimagemenuitem.c: use gtk_widget_get_child_requisition()
|
||||
instead of accessing item->image->allocation.width/height
|
||||
directly. Makes widgets which only have a requisition set using
|
||||
gtk_widget_set_size_request() work and fixes bug #142789.
|
||||
|
||||
Thu Jun 3 08:07:59 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert previous commit. It caused the problem
|
||||
of sticky right click menus to return.
|
||||
|
||||
Wed Jun 2 01:56:02 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Fix the stay up algorithm for combo boxes to
|
||||
better handle the "click" case. Better fix for #141169.
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_init): Bail out if the
|
||||
model is empty. Fixes #143536.
|
||||
|
||||
2004-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_size_focus_out): Don't
|
||||
close the dialog on focus out of the size entry. (#143505,
|
||||
David Hawthorne)
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #138807.
|
||||
|
||||
* gtk/fnmatch.c (_gtk_fnmatch): Take a no_leading_period argument.
|
||||
(gtk_fnmatch_intern): Likewise; also implement this option.
|
||||
|
||||
* gtk/gtkprivate.h (_gtk_fnmatch): Updated prototype.
|
||||
|
||||
* gtk/gtkfilesel.c (find_completion_dir): Pass TRUE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
(attempt_file_completion): Likewise.
|
||||
|
||||
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Pass FALSE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
|
||||
Wed Jun 2 00:46:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkselection.c (_gtk_selection_request): Remove leftover
|
||||
debug code.
|
||||
|
||||
Wed Jun 2 00:17:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_select_range): Don't
|
||||
allow unless selection mode is multiple. (#142634, John Finlay)
|
||||
|
||||
Tue Jun 1 23:14:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktoolbar.h:
|
||||
* gtk/gtktoolbar.c:
|
||||
* gtk/gtkentrycompletion.h:
|
||||
* gtk/gtkentrycompletion.c:
|
||||
* gtk/gtkcombobox.h:
|
||||
* gtk/gtkcombobox.c: Rename function parameters from
|
||||
index to index_ to prevent clash with BSD index(). (#143001)
|
||||
|
||||
Tue Jun 1 22:41:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenu.c (get_accel_path): Handle accel_closure being
|
||||
NULL on an accel label. (#139641, Sam Stephenson, patch by
|
||||
Michael Natterer)
|
||||
|
||||
Tue Jun 1 22:19:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkicontheme.c (theme_subdir_load): Prevent icon
|
||||
lookup finding icons in the wrong prefix. (#143328,
|
||||
Mark McLoughlin)
|
||||
|
||||
Wed Jun 2 00:39:58 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
Bug #141169.
|
||||
|
||||
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Make menus
|
||||
only stay up if you release within 500 milliseconds.
|
||||
(gtk_menu_shell_button_press): Set the activate_time to the event
|
||||
time when a button is pressed.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_motion_notify, gtk_menu_enter_notify):
|
||||
Interprete button releases as activate when we have seen both an
|
||||
enter an a motion event.
|
||||
|
||||
2004-06-01 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_removed): Don't insert a
|
||||
dummy node if there is no parent node. Fixes #143362.
|
||||
|
||||
2004-05-31 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (renderer_edited_cb): Change to the
|
||||
newly-created folder. Fixes #138932.
|
||||
(trap_activate_cb): Only return TRUE if we did handle the event.
|
||||
Fixes #143359; patch by jylefort@brutele.be.
|
||||
|
||||
Mon May 31 02:38:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_new_from_pixmap): Fix typo in
|
||||
docs. (#142892, Tommi Komulainen)
|
||||
|
||||
Mon May 31 02:21:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhandlebox.c: Make detached handleboxes work when their
|
||||
parent is minimized, porting the fix from 1.2. (#1923, #57182)
|
||||
|
||||
Mon May 31 02:03:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwindow.c (gtk_window_show): Make moving realized,
|
||||
unmapped windows work.
|
||||
|
||||
2004-05-29 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* configure.in: Added "tk" to ALL_LINGUAS.
|
||||
|
||||
Fri May 28 14:57:13 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
|
||||
messages for common problems. (#137974, Owen Taylor)
|
||||
|
||||
Fri May 28 14:14:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkevents-x11.c: Fix off-by-one errors. (#143337,
|
||||
Billy Biggs)
|
||||
|
||||
Thu May 27 00:12:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_request): Fix a typo.
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Send key
|
||||
modifiers (shift, ctrl etc) in button and motion events from the
|
||||
tablet. (#143240)
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (gdk_device_get_state): Simple
|
||||
implementation for extended input devices using last known
|
||||
device state (#143237)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (propagate): Don't propagate mouse
|
||||
events to windows that want extended input events. (#142943)
|
||||
(gdk_event_translate): Move check for extended input devices to
|
||||
propagate, new parameter to propagate.
|
||||
(gdk_pointer_grab, gdk_display_pointer_ungrab): Enable calls to
|
||||
_gdk_input_(un)grab_pointer. (#142943)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Check for
|
||||
input grab. [Fix missing update of impl in "dijkstra" event
|
||||
propagation loop] Drop the parallel "impl" pointer, just use a
|
||||
cast. Don't propagate beyond windows that want normal input
|
||||
events. (#142943)
|
||||
(gdk_input_grab_pointer, gdk_input_ungrab_pointer): Limited
|
||||
implementation of input grab. (#142943)
|
||||
|
||||
2004-05-22 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (print_lc): Remove duplicated
|
||||
line. (Spotted by Benoît Carpentier.)
|
||||
|
||||
2004-05-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
|
||||
Restrict the width of the popup to be no larger than the
|
||||
monitor. (#142678, DmD Ljungmark)
|
||||
|
||||
* gtk/gtkbutton.c: Go back to the initial fix for the
|
||||
focus-overdrawing problem, which was actually correct
|
||||
according to docs/widget_geometry.txt.
|
||||
|
||||
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
|
||||
arrow size from 11 to 15 to compensate for that.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_request)
|
||||
(gtk_button_size_allocate, _gtk_button_paint): Allocate
|
||||
space for the focus rectangle only if necessary. (#142668,
|
||||
Michael Natterer)
|
||||
|
||||
Sun May 16 23:14:37 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove two useless
|
||||
lines. (#142479, Morten Welinder)
|
||||
|
||||
2004-05-15 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Put back the ref_count field in the
|
||||
GdkDragContextPrivateWin32 struct (but inside ifdef OLE2_DND this
|
||||
time). It is used by the OLE2_DND code, which is unfinished and
|
||||
presumably horribly broken, but still, let's not make it not
|
||||
compile on purpose. Silence some gcc warnings in the OLE2_DND
|
||||
code.
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_tree_window_to_tree_coords):
|
||||
New function to go from tree window to tree coordinates, kept
|
||||
static for now until we figure out the multiple coordinate
|
||||
system mess in GtkTreeView API-wise.
|
||||
(gtk_tree_view_scroll_to_cell): Transform the coordinates
|
||||
from tree window to tree coordinates, using the new function.
|
||||
Previously, the x coordinate was wrongly transformed. (#142494)
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdktypes.h (GdkModifierType): Add a comment about unused
|
||||
bits.
|
||||
|
||||
* gtk/gtkstock.c (real_add, gtk_stock_lookup): Use an unused
|
||||
modifier bit to mark stock item which need to be freed
|
||||
eventually. (#140654, Michal Pasternak, Scott Tsai)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add missing
|
||||
call to g_object_ref in Wintab code. (#138341)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c: Fix numerous Wintab problems
|
||||
including unallocated buffers for event->motion.axes and
|
||||
event->button.axes, unsigned wraparound problem in the code for
|
||||
detecting missing press/release events and assigning min instead
|
||||
of max when setting up axes.
|
||||
|
||||
2004-05-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
|
||||
previous change to this function, clarify the docs instead.
|
||||
|
||||
2004-05-11 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): don't allocate the popup
|
||||
smaller than the combobox. Fixes bug #59660.
|
||||
|
||||
2004-05-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeprivate.h:
|
||||
* gtk/gtktreeview.c: Add a hove selection mode, which
|
||||
when TRUE makes the selection follow the mouse.
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_init):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection
|
||||
mode. (#127648, Dave Bordoley)
|
||||
|
||||
Mon May 10 23:04:25 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.h: Add prototype for _gtk_widget_grab_notify()
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkwindow.c (get_screen_icon_info):
|
||||
Make static.
|
||||
|
||||
* gdk/gdkdisplay.c (singlehead_...):
|
||||
* gdk/x11/gdkkeys-x11.c (get_effective_keymap):
|
||||
* gdk/x11/gdkgeometry-x11.c (expose_serial_predicate):
|
||||
* gdk/x11/gdkdisplay-x11.c (escape_for_xmessage): Make static.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below):
|
||||
Place the window above the combobox, if there is not enough
|
||||
room below.
|
||||
|
||||
* tests/testentrycompletion.c: Make the second example use the
|
||||
::match-selected signal to make it actually work.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): Make sure the menu pops up
|
||||
as wide as the combobox. (#59660, Havoc Pennington)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfontsel.c (list_row_activated): Make Return activate the
|
||||
default button. (#118921)
|
||||
|
||||
Mon May 10 15:03:50 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.c (_gtk_widget_grab_notify): New internal function
|
||||
that emits the grab notify signal.
|
||||
|
||||
* gtk/gtkmain.c (gtk_grab_notify_foreach): Use it here.
|
||||
|
||||
Mon May 10 00:51:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkmenu.c: Make destruction of a torn off menu work
|
||||
like un-tearing off.
|
||||
|
||||
Sun May 9 21:05:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
|
||||
Allow to suppress the stock accelerator by using "". (#142196,
|
||||
David A Knight)
|
||||
|
||||
2004-05-08 Hans Breuer <hans@breuer.org>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemwin32.c (extract_icon) : finally also
|
||||
create the correct mask for 'pseudo mime' icons
|
||||
|
||||
Sun May 9 01:57:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_button_released):
|
||||
In list mode, accept the same mouse/wheel bindings on
|
||||
the cellview as on the button. (#136967)
|
||||
|
||||
Sun May 9 01:29:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkiconfactory.c (add_to_cache): Actually count the
|
||||
cached icons. (#135888, Crispin Flowerday)
|
||||
|
||||
Sun May 9 00:03:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure
|
||||
that we actually return menus for nodes of type menu, not the
|
||||
menuitems they're attached to.
|
||||
|
||||
2004-05-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
|
||||
draw over the focus rectangle.
|
||||
|
||||
Thu May 6 23:48:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): Also
|
||||
popup the submenu for items in torn off menus. (#122051)
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_state_changed): Remove
|
||||
this no longer needed signal handler. (#141817, Paul Pogonyshev)
|
||||
|
||||
2004-05-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gtk/gtkexpander.c (gtk_expander_size_allocate): in RTL mode,
|
||||
position the title lable next to the arrow just as we do for LTR
|
||||
rendering. Fixes bug #141825.
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/RELEASE-HOWTO: Document the new policy of
|
||||
bumping version numbers after release.
|
||||
|
||||
* configure.in: Bump version number to 2.4.2.
|
||||
|
||||
Wed May 5 22:23:59 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (icon_source_clear): Don't
|
||||
call g_free() on a pixbuf. (#141961, Crispin Flowerday)
|
||||
|
||||
2004-05-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (print_node): Make the output
|
||||
parseable. (#141929, Sven Neumann)
|
||||
|
||||
2004-05-05 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window_for_screen): Add
|
||||
multi-monitor offset. (#141842, John Ehresman)
|
||||
|
||||
2004-05-04 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Fixes #139562, based on a patch by Christian Neumair.
|
||||
|
||||
@@ -1,3 +1,947 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-09 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes #137031:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (get_fallback_icon): New helper
|
||||
function, fetches a stock icon as a fallback.
|
||||
(gtk_file_system_unix_volume_render_icon): Fall back to a stock
|
||||
icon.
|
||||
(gtk_file_system_unix_render_icon): Fall back to a stock icon.
|
||||
Use helper functions rather than being a mega-function.
|
||||
(get_icon_name_for_directory): Renamed from
|
||||
get_icon_for_directory().
|
||||
(get_icon_type_from_path): New helper function; code pulled out
|
||||
from gtk_file_system_unix_render_icon().
|
||||
(get_special_icon): Likewise.
|
||||
(get_icon_for_mime_type): Likewise.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_paint_window): Use the
|
||||
requisition of the widget instead of relying on the style
|
||||
drawing function to supply the size of the drawable. (#146531)
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* NEWS: Updates.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make GtkEntry work harder to protect passwords: (#143955,
|
||||
Morten Welinder)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_destroy): Add a destroy handler
|
||||
to clear the password even if the widget is leaked.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_delete_text):
|
||||
* gtk/gtkentry.c (gtk_entry_finalize): Zero out the memory
|
||||
before freeing it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_real_insert_text): Zero and free
|
||||
the old memory instead of just reallocating it.
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_create_layout): Don't leak text
|
||||
direction information for passwords.
|
||||
|
||||
2004-07-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Fix some cases where style functions were
|
||||
not handling widget == NULL properly. (#146282)
|
||||
|
||||
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (get_default_icons):
|
||||
* gtk/stock-icons/Makefile.am: Add stock file and
|
||||
directory icons in sizes 16 and 24. Do not add the stock ids
|
||||
to the gtkstock.h, since they are only for internal use on the
|
||||
2.4 branch.
|
||||
|
||||
2004-07-08 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #139290:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Add a
|
||||
GError argument. Do check for errors when getting the
|
||||
GtkFileFolder: get the folder and read the children before
|
||||
actually creating the model. Removed obsolete code that handled
|
||||
roots-changed on the file system.
|
||||
(file_model_node_get_info): Assert that we don't reach the old
|
||||
case to display file system roots.
|
||||
(roots_changed_callback): Removed.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (set_list_model): Add a GError
|
||||
argument, and a boolean return value. Return an error if we
|
||||
cannot create the file system model. On error, set a NULL model
|
||||
on the tree.
|
||||
(gtk_file_chooser_default_set_current_folder): Use the error value
|
||||
from set_list_model().
|
||||
(gtk_file_chooser_default_set_property): Set the show_hidden
|
||||
property only if the browse_files_model exists.
|
||||
(gtk_file_chooser_default_unselect_path): Only operate if the
|
||||
browse_files_model exists.
|
||||
(check_preview_change): Check whether we have the sort_model.
|
||||
(change_folder_and_display_error): Copy the path we get passed
|
||||
before using it. There's a comment in there that explains why we
|
||||
need to copy it; basically, if the passed path belongs to the
|
||||
model, the model may go away in the middle of this function and
|
||||
we'll be left with a dangling pointer.
|
||||
(install_list_model_filter): Assert that the model is not NULL.
|
||||
(set_current_filter): Check whether the model exists.
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Don't
|
||||
g_return_if_fail if the model is NULL.
|
||||
(gtk_tree_selection_get_selected_rows): Likewise.
|
||||
(gtk_tree_selection_count_selected_rows): Likewise.
|
||||
(gtk_tree_selection_selected_foreach): Likewise.
|
||||
(gtk_tree_selection_path_is_selected): Likewise; rather just
|
||||
return FALSE.
|
||||
(gtk_tree_selection_select_all): Likewise.
|
||||
(gtk_tree_selection_unselect_all): Likewise.
|
||||
(gtk_tree_selection_select_range): Do g_return_if_fail() if the
|
||||
model is NULL.
|
||||
(gtk_tree_selection_unselect_range): Likewise.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (fill_in_names): Return immediately if
|
||||
g_dir_open() fails: there is no need to set the error ourselves,
|
||||
as g_dir_open() already does it.
|
||||
|
||||
2004-07-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_search_equal_func): Allow
|
||||
to restore the default search function. (#145365, John Finlay)
|
||||
|
||||
* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
|
||||
references to the drag context. (#144324, Alex Larsson)
|
||||
|
||||
Thu Jul 8 00:33:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_set_model): Stop editing
|
||||
when a new model is set. (#145566, Dmitry M. Shatrov)
|
||||
|
||||
Wed Jul 7 23:44:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Make sure that subpixbufs
|
||||
are properly aligned for gdk_pixbuf_saturate_and_pixelate(),
|
||||
in order to avoid rendering artifacts from misaligned
|
||||
pixelation patterns. (#145585, Felipe Heidrich, Billy Biggs)
|
||||
|
||||
Tue Jul 6 23:00:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Fix
|
||||
a 64bit alignment issue. (#144302, Sunil)
|
||||
|
||||
2004-07-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
|
||||
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
|
||||
* gdk/win32/gdkproperty-win32.c (find_common_locale,
|
||||
gdk_property_change)
|
||||
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
|
||||
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
|
||||
below).
|
||||
|
||||
* gdk/win32/gdkglobals-win32.c
|
||||
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
|
||||
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
|
||||
atom. Initialize it. Declare it. Drop the variable for the
|
||||
COMPOUND_TEXT atom.
|
||||
|
||||
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
|
||||
function is supposed to return the string in the locale's charset
|
||||
and encoding. Use g_convert().
|
||||
|
||||
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
|
||||
string in the locale's charset. Use g_convert().
|
||||
|
||||
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
|
||||
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
|
||||
GLib's UTF-16 functions instead. Windows uses UTF-16.
|
||||
|
||||
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
|
||||
functions mentioned above.
|
||||
|
||||
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
|
||||
also if the string is of type STRING, i.e. ISO-8859-1, and the
|
||||
current codepage is 1252, and contains no C1 chars. Accept
|
||||
also UTF8_STRING.
|
||||
|
||||
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
|
||||
Mark as static. When storing STRING data, convert to
|
||||
Latin-1. (#140537)
|
||||
(gdk_selection_owner_set_for_display): Now that STRING is always
|
||||
ISO-8859-1, use UTF8_STRING when sending the selection request
|
||||
to ourselves.
|
||||
|
||||
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
|
||||
Ehresman)
|
||||
|
||||
(gdk_text_property_to_text_list_for_display): Make work more like
|
||||
X11 version. Do obey the encoding parameter.
|
||||
|
||||
(gdk_string_to_compound_text_for_display,
|
||||
gdk_utf8_to_compound_text_for_display): Don't even pretend
|
||||
supporting COMPOUND_TEXT.
|
||||
|
||||
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
|
||||
|
||||
(sanitize_utf8): Zero-terminate string.
|
||||
|
||||
Tue Jul 6 10:00:22 2004 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
Fix for #136496, Pawel Salek:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_changed): Queue a redraw on
|
||||
a node when it changes in fixed_height mode.
|
||||
|
||||
(gtk_tree_view_node_queue_redraw): new function to queue a redraw
|
||||
on a node.
|
||||
|
||||
2004-07-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_position): Make sure
|
||||
private->monitor_num is a valid monitor number before
|
||||
using it. (#139187, Michael Natterer)
|
||||
|
||||
2004-06-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid
|
||||
a crash if the font doesn't exist. (#144967, Yevgen Muntyan)
|
||||
|
||||
Tue Jul 6 02:00:28 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (popup_position_func):
|
||||
* gtk/gtkentry.c (popup_position_func):
|
||||
* gtk/gtktextview.c (popup_position_func): Improve positioning
|
||||
of keyboard-activated menus with Xinerama.
|
||||
|
||||
Tue Jul 6 00:29:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkuimanager.c (do_updates):
|
||||
(do_updates_idle): Only call GDK_THREADS_ENTER() / _LEAVE()
|
||||
when called from an idle handler. (#145429, Jan-Marek Glogowski)
|
||||
|
||||
Mon Jul 5 23:47:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfilechooserutils.c (delegate_notify): Use
|
||||
the less efficient g_object_interface_find_property () instead
|
||||
of the param_id range check, since the GParamSpecs we're
|
||||
dealing with are the overridden onces on the interface, whose
|
||||
param_id is always zero. (#145312, Alex Roitman, fix proposed
|
||||
by Owen Taylor)
|
||||
|
||||
Sun Jul 4 01:29:35 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_drag_data_get):
|
||||
(gtk_calendar_drag_data_received): Fix off-by-one error.
|
||||
GDate month is one-based and GtkCalendar month is zero-based.
|
||||
(#145134, William Jon McCann)
|
||||
|
||||
Sun Jul 4 01:11:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Don't crash if
|
||||
somebody tries to move a node after itself in a list of
|
||||
length 1. (#145291, Sampo Nurmentaus)
|
||||
|
||||
Sat Jul 3 23:43:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* docs/faq/gtk-faq.sgml:
|
||||
* gtk/gtkwindow.c: Fix links to www.freedesktop.org. (#145210,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jul 3 02:09:51 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtksocket.c (gtk_socket_end_embedding): Reset current_width
|
||||
and current_height to 0 when ending the embedding. (#143675,
|
||||
Nickolay V. Shmyrev)
|
||||
|
||||
Sat Jul 3 01:48:19 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_move_visually): Let the cursor move
|
||||
to the right end of the entry text, even if it ends in combining
|
||||
marks. (#141728, Theppitak Karoonboonyanan)
|
||||
|
||||
Fri Jul 2 23:34:33 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_unset_model): Unset the displayed
|
||||
row when unsetting the model. (#138560, Christian Persch)
|
||||
|
||||
Fri Jul 2 22:41:27 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_expose): Properly align mask and
|
||||
pixbuf if a subarea is exposed. (#135423, fix by John Ehresman)
|
||||
|
||||
2004-07-01 J. Ali Harlow <ali@juiblex.co.uk>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_ungrab_pointer): Fix
|
||||
win32 build problem w/o wintab. Fixed #145242
|
||||
|
||||
Sat Jun 26 01:15:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (set_initial_hints): Handle
|
||||
_NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. (#144851,
|
||||
Billy Biggs)
|
||||
|
||||
Sat Jun 26 01:04:31 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (clear_cache): Prevent unwanted
|
||||
recursion by resetting icon_set->cache before freeing
|
||||
the cache. (#144947, Tim Janik)
|
||||
|
||||
Sat Jun 26 00:40:02 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (render_icon_name_pixbuf):
|
||||
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon):
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): Accept a NULL
|
||||
style.
|
||||
|
||||
Sat Jun 26 00:06:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Reflect the
|
||||
last change in the docs.
|
||||
|
||||
Fri Jun 25 23:35:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
|
||||
NULL to unset the model. (#137211, patch by Mariano Suárez-Alvarez)
|
||||
|
||||
Fri Jun 25 23:33:05 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
|
||||
placement policy for GtkComboBoxEntry to be: if it fits below,
|
||||
place below, if it fits above place above, else place in the
|
||||
larger space and scroll so that the scroll arrow appear at the
|
||||
far end. (#144362, David A. Knight)
|
||||
|
||||
Fri Jun 25 22:49:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
|
||||
use of &parent_iter. (#145007, John Finlay)
|
||||
|
||||
2004-06-25 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
reviewed by: Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkkeys-x11.c: (get_symbol), (update_keymaps),
|
||||
(gdk_keymap_lookup_key), (translate_keysym): fix keys parsing when
|
||||
the number of keysyms per keycode is odd. Fixes #144808.
|
||||
|
||||
Fri Jun 25 00:32:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change
|
||||
which was mentioned below.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a Save
|
||||
or an Open stock button for the C-l dialog depending on the action
|
||||
in which the file chooser operates. Fixes #141753.
|
||||
|
||||
2004-06-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fixes the GTK+ part of #142308:
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_filename_to_path):
|
||||
Use filename_to_path().
|
||||
(gtk_file_system_unix_uri_to_path): Likewise.
|
||||
(filename_to_path): Use remove_trailing_slash().
|
||||
|
||||
2004-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaccelmap.c (_gtk_accel_path_is_valid): Accept
|
||||
"<WINDOWTYPE>" as a valid accel path. (#144427, Philip
|
||||
Kendall)
|
||||
|
||||
* gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure
|
||||
this gets defined for all backends, so linux-fb has a
|
||||
chance of compiling.
|
||||
|
||||
* gtk/gtktreestore.c (gtk_tree_store_swap): Make this work
|
||||
for children of the root. (#139785, Jean-François Wauthy,
|
||||
patch by John Finlay)
|
||||
|
||||
* gtk/gtkicontheme.h (GTK_ICON_THEME_GET_CLASS): Typo
|
||||
fix. (#144750, Jeff Franks)
|
||||
|
||||
2004-06-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gdk/x11/gdkdrawable-x11.[ch]: made convert_format() utility
|
||||
function public as _gdk_x11_convert_to_format().
|
||||
|
||||
* gdk/x11/gdkcursor-x11.c (create_cursor_image): premultiply
|
||||
the pixels from the GdkPixbuf when putting them in the
|
||||
Xcursor image. Fixes bug #144350.
|
||||
|
||||
2004-06-16 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_added): When inserting a
|
||||
visible node, free the old path before creating the new one.
|
||||
Fixes #144356.
|
||||
|
||||
Tue Jun 15 01:10:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c: Make GtkComboBox work without model.
|
||||
(#144198, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-11 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #143578:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_add_editable):
|
||||
Don't ref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Don't unref the editable node.
|
||||
(_gtk_file_system_model_remove_editable): Ahem, free the node.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
|
||||
Added fields for edited_idle and edited_new_text.
|
||||
(renderer_edited_cb): Queue the
|
||||
creation of the folder in an idle handler.
|
||||
(renderer_editing_canceled_cb): Likewise for the cancellation.
|
||||
(gtk_file_chooser_default_finalize): Free the impl->edited_new_text.
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.4
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Thu Jun 10 22:15:01 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmain.c (gtk_parse_args): Typo fix.
|
||||
|
||||
Thu Jun 10 21:16:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_destroy):
|
||||
Check whether priv->box is NULL before disconnecting
|
||||
from its signals. Fix merged from HEAD.
|
||||
|
||||
2004-06-10 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
Fixes #144110, patch by Bastien Nocera <hadess@hadess.net>.
|
||||
|
||||
* gtk/gtkfilechooser.c (gtk_file_chooser_list_shortcut_folders):
|
||||
Refer to gtk_file_chooser_add_shortcut_folder().
|
||||
(gtk_file_chooser_list_shortcut_folder_uris): Refer to
|
||||
gtk_file_chooser_add_shortcut_folder_uri().
|
||||
|
||||
Thu Jun 10 00:36:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_main_button): Start
|
||||
the drag before focusing the selected.day.
|
||||
* gtk/gtkcalendar.c (gtk_calendar_state_changed): Stop
|
||||
a beginning drag if the widget becomes insensitive.
|
||||
|
||||
Thu Jun 10 00:05:11 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcalendar.c (gtk_calendar_button_press): Start
|
||||
spinning before calling arrow_action(), so that a signal
|
||||
handler triggered from arrow_action() has a chance to
|
||||
stop the spinning. (#143966, Davyd Madeley)
|
||||
|
||||
Wed Jun 9 23:05:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a
|
||||
typo. (#144070, Kent Sandvik)
|
||||
|
||||
Thu Jun 10 00:22:51 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert the "drag select" part of
|
||||
#141169. (#144011).
|
||||
|
||||
Mon Jun 7 23:07:40 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): Handle
|
||||
priv->model being NULL. (#143856, Mariano Suárez-Alvarez)
|
||||
|
||||
2004-06-07 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_button_press): Revert the patch
|
||||
from 2003/Sep/12. This kept DnD in tree views within modal
|
||||
dialogs from working, which is especially bad for the file
|
||||
chooser. Fixes #135168.
|
||||
|
||||
Sat Jun 5 23:07:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentrycompletion.c: (gtk_entry_completion_init),
|
||||
(gtk_entry_completion_list_enter_notify),
|
||||
(gtk_entry_completion_list_motion_notify),
|
||||
(_gtk_entry_completion_popup), (_gtk_entry_completion_popdown):
|
||||
* gtk/gtkentryprivate.h: Add an ignore_enter flag and
|
||||
use it as in the menu code to avoid the initial selection if
|
||||
the window pops up under the pointer. (Anders Carlsson)
|
||||
|
||||
Sat Jun 5 20:05:39 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* tests/testmerge.c: Add a checkbox to queue an
|
||||
merge/unmerge. Patch from Matthias Clasen.
|
||||
|
||||
* gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Add a new flag
|
||||
"need_rebuild"
|
||||
(rebuild_menu): New function that rebuilds the overflow menu and
|
||||
makes sure it doesn't start or end with a separator.
|
||||
(toolbar_content_new_tool_item)
|
||||
(toolbar_content_remove)
|
||||
(toolbar_content_new_compatibility): Set the rebuild_needed flag
|
||||
(gtk_toolbar_size_allocate): Only show the overflow arrow when we
|
||||
have actually overflown an item with a proxy menu item. Also make
|
||||
sure we rebuild the menu if needed.
|
||||
|
||||
Fix #125504, #142377, #143463
|
||||
|
||||
* gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_expose):
|
||||
Obey the "priv->draw" flag. (#143692)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/widget_geometry.txt: Add a note about the !CAN_FOCUS
|
||||
quirk in the button size allocation code.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Give the space
|
||||
requested for drawing the focus indicator to the child in the
|
||||
!CAN_FOCUS case. This should fix issues which the Gimp has with
|
||||
the button allocation changes in 2.4.2.
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Bump version to 2.4.3
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
|
||||
length of the entry contents in characters, not in bytes.
|
||||
|
||||
* gtk/gtkentry.c (paste_received): Don't pop up the completion
|
||||
window on paste, noticed by Anders Carlsson.
|
||||
|
||||
Thu Jun 3 20:51:23 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
|
||||
values and default value for the ::active property. (#143669,
|
||||
Olivier Andrieu)
|
||||
|
||||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkimagemenuitem.c: use gtk_widget_get_child_requisition()
|
||||
instead of accessing item->image->allocation.width/height
|
||||
directly. Makes widgets which only have a requisition set using
|
||||
gtk_widget_set_size_request() work and fixes bug #142789.
|
||||
|
||||
Thu Jun 3 08:07:59 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Revert previous commit. It caused the problem
|
||||
of sticky right click menus to return.
|
||||
|
||||
Wed Jun 2 01:56:02 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenu.c: Fix the stay up algorithm for combo boxes to
|
||||
better handle the "click" case. Better fix for #141169.
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_init): Bail out if the
|
||||
model is empty. Fixes #143536.
|
||||
|
||||
2004-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_size_focus_out): Don't
|
||||
close the dialog on focus out of the size entry. (#143505,
|
||||
David Hawthorne)
|
||||
|
||||
2004-06-02 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
Fix #138807.
|
||||
|
||||
* gtk/fnmatch.c (_gtk_fnmatch): Take a no_leading_period argument.
|
||||
(gtk_fnmatch_intern): Likewise; also implement this option.
|
||||
|
||||
* gtk/gtkprivate.h (_gtk_fnmatch): Updated prototype.
|
||||
|
||||
* gtk/gtkfilesel.c (find_completion_dir): Pass TRUE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
(attempt_file_completion): Likewise.
|
||||
|
||||
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Pass FALSE for the
|
||||
no_leading_period argument of _gtk_fnmatch().
|
||||
|
||||
Wed Jun 2 00:46:32 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkselection.c (_gtk_selection_request): Remove leftover
|
||||
debug code.
|
||||
|
||||
Wed Jun 2 00:17:07 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktreeselection.c (gtk_tree_selection_select_range): Don't
|
||||
allow unless selection mode is multiple. (#142634, John Finlay)
|
||||
|
||||
Tue Jun 1 23:14:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktoolbar.h:
|
||||
* gtk/gtktoolbar.c:
|
||||
* gtk/gtkentrycompletion.h:
|
||||
* gtk/gtkentrycompletion.c:
|
||||
* gtk/gtkcombobox.h:
|
||||
* gtk/gtkcombobox.c: Rename function parameters from
|
||||
index to index_ to prevent clash with BSD index(). (#143001)
|
||||
|
||||
Tue Jun 1 22:41:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenu.c (get_accel_path): Handle accel_closure being
|
||||
NULL on an accel label. (#139641, Sam Stephenson, patch by
|
||||
Michael Natterer)
|
||||
|
||||
Tue Jun 1 22:19:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkicontheme.c (theme_subdir_load): Prevent icon
|
||||
lookup finding icons in the wrong prefix. (#143328,
|
||||
Mark McLoughlin)
|
||||
|
||||
Wed Jun 2 00:39:58 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
Bug #141169.
|
||||
|
||||
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Make menus
|
||||
only stay up if you release within 500 milliseconds.
|
||||
(gtk_menu_shell_button_press): Set the activate_time to the event
|
||||
time when a button is pressed.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_motion_notify, gtk_menu_enter_notify):
|
||||
Interprete button releases as activate when we have seen both an
|
||||
enter an a motion event.
|
||||
|
||||
2004-06-01 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (do_files_removed): Don't insert a
|
||||
dummy node if there is no parent node. Fixes #143362.
|
||||
|
||||
2004-05-31 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (renderer_edited_cb): Change to the
|
||||
newly-created folder. Fixes #138932.
|
||||
(trap_activate_cb): Only return TRUE if we did handle the event.
|
||||
Fixes #143359; patch by jylefort@brutele.be.
|
||||
|
||||
Mon May 31 02:38:15 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimage.c (gtk_image_new_from_pixmap): Fix typo in
|
||||
docs. (#142892, Tommi Komulainen)
|
||||
|
||||
Mon May 31 02:21:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhandlebox.c: Make detached handleboxes work when their
|
||||
parent is minimized, porting the fix from 1.2. (#1923, #57182)
|
||||
|
||||
Mon May 31 02:03:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwindow.c (gtk_window_show): Make moving realized,
|
||||
unmapped windows work.
|
||||
|
||||
2004-05-29 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* configure.in: Added "tk" to ALL_LINGUAS.
|
||||
|
||||
Fri May 28 14:57:13 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
|
||||
messages for common problems. (#137974, Owen Taylor)
|
||||
|
||||
Fri May 28 14:14:48 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkevents-x11.c: Fix off-by-one errors. (#143337,
|
||||
Billy Biggs)
|
||||
|
||||
Thu May 27 00:12:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_request): Fix a typo.
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Send key
|
||||
modifiers (shift, ctrl etc) in button and motion events from the
|
||||
tablet. (#143240)
|
||||
|
||||
2004-05-26 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (gdk_device_get_state): Simple
|
||||
implementation for extended input devices using last known
|
||||
device state (#143237)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (propagate): Don't propagate mouse
|
||||
events to windows that want extended input events. (#142943)
|
||||
(gdk_event_translate): Move check for extended input devices to
|
||||
propagate, new parameter to propagate.
|
||||
(gdk_pointer_grab, gdk_display_pointer_ungrab): Enable calls to
|
||||
_gdk_input_(un)grab_pointer. (#142943)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Check for
|
||||
input grab. [Fix missing update of impl in "dijkstra" event
|
||||
propagation loop] Drop the parallel "impl" pointer, just use a
|
||||
cast. Don't propagate beyond windows that want normal input
|
||||
events. (#142943)
|
||||
(gdk_input_grab_pointer, gdk_input_ungrab_pointer): Limited
|
||||
implementation of input grab. (#142943)
|
||||
|
||||
2004-05-22 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkinput-win32.c (print_lc): Remove duplicated
|
||||
line. (Spotted by Benoît Carpentier.)
|
||||
|
||||
2004-05-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
|
||||
Restrict the width of the popup to be no larger than the
|
||||
monitor. (#142678, DmD Ljungmark)
|
||||
|
||||
* gtk/gtkbutton.c: Go back to the initial fix for the
|
||||
focus-overdrawing problem, which was actually correct
|
||||
according to docs/widget_geometry.txt.
|
||||
|
||||
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
|
||||
arrow size from 11 to 15 to compensate for that.
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_request)
|
||||
(gtk_button_size_allocate, _gtk_button_paint): Allocate
|
||||
space for the focus rectangle only if necessary. (#142668,
|
||||
Michael Natterer)
|
||||
|
||||
Sun May 16 23:14:37 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove two useless
|
||||
lines. (#142479, Morten Welinder)
|
||||
|
||||
2004-05-15 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Put back the ref_count field in the
|
||||
GdkDragContextPrivateWin32 struct (but inside ifdef OLE2_DND this
|
||||
time). It is used by the OLE2_DND code, which is unfinished and
|
||||
presumably horribly broken, but still, let's not make it not
|
||||
compile on purpose. Silence some gcc warnings in the OLE2_DND
|
||||
code.
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_tree_window_to_tree_coords):
|
||||
New function to go from tree window to tree coordinates, kept
|
||||
static for now until we figure out the multiple coordinate
|
||||
system mess in GtkTreeView API-wise.
|
||||
(gtk_tree_view_scroll_to_cell): Transform the coordinates
|
||||
from tree window to tree coordinates, using the new function.
|
||||
Previously, the x coordinate was wrongly transformed. (#142494)
|
||||
|
||||
2004-05-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdktypes.h (GdkModifierType): Add a comment about unused
|
||||
bits.
|
||||
|
||||
* gtk/gtkstock.c (real_add, gtk_stock_lookup): Use an unused
|
||||
modifier bit to mark stock item which need to be freed
|
||||
eventually. (#140654, Michal Pasternak, Scott Tsai)
|
||||
|
||||
2004-05-11 Robert Ögren <gtk@roboros.com>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add missing
|
||||
call to g_object_ref in Wintab code. (#138341)
|
||||
|
||||
* gdk/win32/gdkinput-win32.c: Fix numerous Wintab problems
|
||||
including unallocated buffers for event->motion.axes and
|
||||
event->button.axes, unsigned wraparound problem in the code for
|
||||
detecting missing press/release events and assigning min instead
|
||||
of max when setting up axes.
|
||||
|
||||
2004-05-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
|
||||
previous change to this function, clarify the docs instead.
|
||||
|
||||
2004-05-11 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): don't allocate the popup
|
||||
smaller than the combobox. Fixes bug #59660.
|
||||
|
||||
2004-05-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtktreeprivate.h:
|
||||
* gtk/gtktreeview.c: Add a hove selection mode, which
|
||||
when TRUE makes the selection follow the mouse.
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_init):
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection
|
||||
mode. (#127648, Dave Bordoley)
|
||||
|
||||
Mon May 10 23:04:25 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.h: Add prototype for _gtk_widget_grab_notify()
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkwindow.c (get_screen_icon_info):
|
||||
Make static.
|
||||
|
||||
* gdk/gdkdisplay.c (singlehead_...):
|
||||
* gdk/x11/gdkkeys-x11.c (get_effective_keymap):
|
||||
* gdk/x11/gdkgeometry-x11.c (expose_serial_predicate):
|
||||
* gdk/x11/gdkdisplay-x11.c (escape_for_xmessage): Make static.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below):
|
||||
Place the window above the combobox, if there is not enough
|
||||
room below.
|
||||
|
||||
* tests/testentrycompletion.c: Make the second example use the
|
||||
::match-selected signal to make it actually work.
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_popup)
|
||||
(gtk_combo_box_menu_button_press): Make sure the menu pops up
|
||||
as wide as the combobox. (#59660, Havoc Pennington)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfontsel.c (list_row_activated): Make Return activate the
|
||||
default button. (#118921)
|
||||
|
||||
Mon May 10 15:03:50 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkwidget.c (_gtk_widget_grab_notify): New internal function
|
||||
that emits the grab notify signal.
|
||||
|
||||
* gtk/gtkmain.c (gtk_grab_notify_foreach): Use it here.
|
||||
|
||||
Mon May 10 00:51:18 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkmenu.c: Make destruction of a torn off menu work
|
||||
like un-tearing off.
|
||||
|
||||
Sun May 9 21:05:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
|
||||
Allow to suppress the stock accelerator by using "". (#142196,
|
||||
David A Knight)
|
||||
|
||||
2004-05-08 Hans Breuer <hans@breuer.org>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkfilesystemwin32.c (extract_icon) : finally also
|
||||
create the correct mask for 'pseudo mime' icons
|
||||
|
||||
Sun May 9 01:57:17 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_list_button_released):
|
||||
In list mode, accept the same mouse/wheel bindings on
|
||||
the cellview as on the button. (#136967)
|
||||
|
||||
Sun May 9 01:29:46 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkiconfactory.c (add_to_cache): Actually count the
|
||||
cached icons. (#135888, Crispin Flowerday)
|
||||
|
||||
Sun May 9 00:03:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merge from HEAD:
|
||||
|
||||
* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure
|
||||
that we actually return menus for nodes of type menu, not the
|
||||
menuitems they're attached to.
|
||||
|
||||
2004-05-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
|
||||
draw over the focus rectangle.
|
||||
|
||||
Thu May 6 23:48:42 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): Also
|
||||
popup the submenu for items in torn off menus. (#122051)
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_menu_state_changed): Remove
|
||||
this no longer needed signal handler. (#141817, Paul Pogonyshev)
|
||||
|
||||
2004-05-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gtk/gtkexpander.c (gtk_expander_size_allocate): in RTL mode,
|
||||
position the title lable next to the arrow just as we do for LTR
|
||||
rendering. Fixes bug #141825.
|
||||
|
||||
2004-05-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/RELEASE-HOWTO: Document the new policy of
|
||||
bumping version numbers after release.
|
||||
|
||||
* configure.in: Bump version number to 2.4.2.
|
||||
|
||||
Wed May 5 22:23:59 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkiconfactory.c (icon_source_clear): Don't
|
||||
call g_free() on a pixbuf. (#141961, Crispin Flowerday)
|
||||
|
||||
2004-05-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkuimanager.c (print_node): Make the output
|
||||
parseable. (#141929, Sven Neumann)
|
||||
|
||||
2004-05-05 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window_for_screen): Add
|
||||
multi-monitor offset. (#141842, John Ehresman)
|
||||
|
||||
2004-05-04 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Fixes #139562, based on a patch by Christian Neumair.
|
||||
|
||||
@@ -18,8 +18,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.4.1.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.4.1 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.4.4.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.4.4 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,90 @@
|
||||
Overview of Changes from GTK+ 2.4.3 to GTK+ 2.4.4
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Use Save button in save mode. [Federico Mena Quintero]
|
||||
- Check for errors when opening folders [Federico]
|
||||
- Fall back to stock icons if icon theme is not found [Federico]
|
||||
- Bug fixes [Federico, Alex Roitman, Owen Taylor]
|
||||
* GtkComboBox
|
||||
- Make it work without a model [Mariano Suarez-Alvarez, Christian Persch]
|
||||
- Improve placement of popup [David A. Knight]
|
||||
* GtkImage
|
||||
- Fix issues with partial redrawing [John Ehresman, Felipe Heidrich,
|
||||
Billy Biggs]
|
||||
* GtkEntry
|
||||
- Fix cursor movement with combining marks [Theppitak Karoonboonyanan]
|
||||
- Protect passwords better [Morten Welinder]
|
||||
* Win32 fixes
|
||||
- Fix build without wintab [J. Ali Harlow]
|
||||
- Improve Clipboard handling [Tor Lillqvist, John Ehresman]
|
||||
* Gdk
|
||||
- Make RGBA cursors work [Michael Natterer]
|
||||
- Work with odd XServers [Bastien Nocera]
|
||||
- Handle _NET_WM_STATE_ABOVE/_BELOW better [Billy Biggs]
|
||||
- Don't leak DND contexts [Alex Larsson]
|
||||
* gdk-pixbuf
|
||||
- Make tiff loader work with libtiff 3.6.1 [Marco Ghirlanda]
|
||||
- Fix math for GDK_INTERP_HYPER [Brian Cameron]
|
||||
- Fix Win32 exported symbols [Tor Lillqvist]
|
||||
* Documentation improvements [Billy Biggs, Matthias Clasen,
|
||||
Oliver Andrieu]
|
||||
* Other bug fixes [Federico, Michael, Matthias, Philip Kendall,
|
||||
Jean-François Wauthy, John Finlay, Jeff Franks, Tim Janik,
|
||||
Nickolay V. Shmyrev, Sampo Nurmentaus, William Jon McCann,
|
||||
Jan-Marek Glogowski, Yevgen Muntyan, Pawel Salek,
|
||||
Jonathan Blandford, Sunil, Dimitiry. M Shatrov]
|
||||
* Updated translations (bg,he,hu,ne,sq)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.2 to GTK+ 2.4.3
|
||||
=================================================
|
||||
* GtkButton
|
||||
- Give extra space to children of !CAN_FOCUS buttons [Matthias Clasen]
|
||||
* GtkFileChooser
|
||||
- Make DND work when the dialog is modal [Federico Mena Quintero]
|
||||
* GtkToolbar
|
||||
- Don't show empty overflow menu [Soeren Sandmann]
|
||||
- Don't show initial separator in overflow menu [Soeren]
|
||||
- Handle dynamic changes to overflow menu [Soeren]
|
||||
* Documentation improvements [Bastien Nocera, Matthias]
|
||||
* Other bug fixes [Matthias, Soeren, Sven Neumann]
|
||||
* Updated translations (hu,ne)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.1 to GTK+ 2.4.2
|
||||
=================================================
|
||||
* GtkUIManager
|
||||
- Install signals correctly [Michael Natterer]
|
||||
- Make the output of gtk_ui_manager_get_ui() parsable. [Michael]
|
||||
- Add a way to suppress stock accelerators. [David A Knight]
|
||||
* GtkClipboard
|
||||
- Fix INCRemental transfer of MULTIPLE targets [Matthias Clasen]
|
||||
- Increase the chunk size for INCRemental transfers [Matthias]
|
||||
* GtkFileChooser
|
||||
- Hide the combo box when appropriate [Christian Neumair]
|
||||
- bug fixes [Federico Mena Quintero]
|
||||
* GtkComboBox
|
||||
- add mouse/wheel bindings on the cellview [Matthias]
|
||||
- improve positioning of popup [Matthias]
|
||||
- make the selection follow the mouse [Matthias]
|
||||
* GtkEntryCompletion
|
||||
- make the selection follow the mouse [Matthias]
|
||||
- restrict popup size to monitor size [Matthias, DmD Ljungmark]
|
||||
- don't complete on paste [Anders Carlsson]
|
||||
* Win32
|
||||
- bug fixes [Benoît Carpentier, Hans Breuer, John Ehresman,
|
||||
Tor Lillqvist, Robert Ögren]
|
||||
* GtkButton/GtkArrow
|
||||
- Don't draw the focus over the button child [Matthias]
|
||||
- Increase default arrow size to compensate [Matthias]
|
||||
* Documentation improvements [Doug Quale, Matthias,
|
||||
Steffen Röcker, Steve Chaplin, Tommi Komulainen]
|
||||
* Other bug fixes [Billy Biggs, Crispin Flowerday,
|
||||
David Hawthorne, Federico, Havoc Pennington, John Finlay,
|
||||
Kouichirou Hiratsuka, Mark McLoughlin, Matthias, Michael,
|
||||
Michal Pasternak, Morten Welinder, Olivier Andrieu,
|
||||
Owen Taylor, Padraig O'Briain, Sam Stevenson, Scott Tsai,
|
||||
Soeren Sandmann, Sven Neumann]
|
||||
* Updated translations (bg,it,nl,tk,wa,zh_CN)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.0 to GTK+ 2.4.1
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.4.1. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.4.4. GTK+ is a multi-platform toolkit for
|
||||
creating graphical user interfaces. Offering a complete set of widgets,
|
||||
GTK+ is suitable for projects ranging from small one-off projects to
|
||||
complete application suites.
|
||||
|
||||
+3
-3
@@ -12,10 +12,10 @@ AC_PREREQ(2.54)
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [4])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_micro_version], [4])
|
||||
m4_define([gtk_version],
|
||||
[gtk_major_version.gtk_minor_version.gtk_micro_version])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_interface_age], [4])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
# This is the X.Y used in -lgtk-FOO-X.Y
|
||||
@@ -401,7 +401,7 @@ fi
|
||||
# sure that both po/ and po-properties/ have .po files that correspond
|
||||
# to your language. If you only add one to po/, the build will break
|
||||
# in po-properties/.
|
||||
ALL_LINGUAS="af am ar az be bg bn br ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms ne nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@ije sr@Latn sv ta th tr uk uz uz@Latn vi wa yi zh_CN zh_TW"
|
||||
ALL_LINGUAS="af am ar az be bg bn br ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms ne nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@ije sr@Latn sv ta th tk tr uk uz uz@Latn vi wa yi zh_CN zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <demos.h>
|
||||
|
||||
static GtkTextBuffer *info_buffer;
|
||||
static GtkTextBuffer *source_buffer;
|
||||
|
||||
static gchar *current_file = NULL;
|
||||
|
||||
enum {
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
ITALIC_COLUMN,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
gboolean
|
||||
read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
flockfile (stream);
|
||||
|
||||
g_string_truncate (str, 0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = getc_unlocked (stream);
|
||||
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
else
|
||||
n_read++;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
int next_c = getc_unlocked (stream);
|
||||
|
||||
if (!(next_c == EOF ||
|
||||
(c == '\r' && next_c == '\n') ||
|
||||
(c == '\n' && next_c == '\r')))
|
||||
ungetc (next_c, stream);
|
||||
|
||||
goto done;
|
||||
}
|
||||
default:
|
||||
g_string_append_c (str, c);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
funlockfile (stream);
|
||||
|
||||
return n_read > 0;
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const gchar *filename)
|
||||
{
|
||||
FILE *file;
|
||||
GtkTextIter start, end;
|
||||
GString *buffer = g_string_new (NULL);
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
|
||||
if (current_file && !strcmp (current_file, filename))
|
||||
return;
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (filename);
|
||||
|
||||
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (info_buffer, &start, &end);
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
|
||||
file = fopen (filename, "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
{
|
||||
gchar *p = buffer->str;
|
||||
gchar *q;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
/* Reading title */
|
||||
while (*p == '/' || *p == '*' || isspace (*p))
|
||||
p++;
|
||||
q = p + strlen (p);
|
||||
while (q > p && isspace (*(q - 1)))
|
||||
q--;
|
||||
|
||||
if (q > p)
|
||||
{
|
||||
int len_chars = g_utf8_pointer_to_offset (p, q);
|
||||
|
||||
end = start;
|
||||
|
||||
g_assert (strlen (p) >= q - p);
|
||||
gtk_text_buffer_insert (info_buffer, &end, p, q - p);
|
||||
start = end;
|
||||
|
||||
gtk_text_iter_backward_chars (&start, len_chars);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "title", &start, &end);
|
||||
|
||||
start = end;
|
||||
|
||||
state++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
/* Reading body of info section */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p == '*' && *(p + 1) == '/')
|
||||
{
|
||||
gtk_text_buffer_get_iter_at_offset (source_buffer, &start, 0);
|
||||
state++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
while (*p == '*' || isspace (*p))
|
||||
p++;
|
||||
|
||||
len = strlen (p);
|
||||
while (isspace (*(p + len - 1)))
|
||||
len--;
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
if (in_para)
|
||||
gtk_text_buffer_insert (info_buffer, &start, " ", 1);
|
||||
|
||||
g_assert (strlen (p) >= len);
|
||||
gtk_text_buffer_insert (info_buffer, &start, p, len);
|
||||
in_para = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
in_para = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* Skipping blank lines */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
p = buffer->str;
|
||||
state++;
|
||||
/* Fall through */
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "source", &start, &end);
|
||||
}
|
||||
|
||||
gboolean
|
||||
button_press_event_cb (GtkTreeView *tree_view,
|
||||
GdkEventButton *event,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
if (event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
GtkTreePath *path = NULL;
|
||||
|
||||
gtk_tree_view_get_path_at_pos (tree_view,
|
||||
event->window,
|
||||
event->x,
|
||||
event->y,
|
||||
&path,
|
||||
NULL);
|
||||
|
||||
if (path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean italic;
|
||||
GVoidFunc func;
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_store_get (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
(func) ();
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
gtk_signal_emit_stop_by_name (GTK_OBJECT (tree_view),
|
||||
"button_press_event");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GValue value = {0, };
|
||||
|
||||
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get_value (model, &iter,
|
||||
FILENAME_COLUMN,
|
||||
&value);
|
||||
load_file (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_text (GtkTextBuffer **buffer,
|
||||
gboolean is_source)
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
text_view = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
|
||||
*buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
font_desc = pango_font_description_from_string ("Courier 10");
|
||||
gtk_widget_modify_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
}
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), !is_source);
|
||||
|
||||
return scrolled_window;
|
||||
}
|
||||
|
||||
/* Technically a list, but if we do go to 80 demos, we may want to move to a tree */
|
||||
static GtkWidget *
|
||||
create_tree (void)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkCellRenderer *cell;
|
||||
GtkWidget *tree_view;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeStore *model;
|
||||
GtkTreeIter iter;
|
||||
gint i;
|
||||
|
||||
model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
|
||||
gtk_tree_selection_set_type (GTK_TREE_SELECTION (selection),
|
||||
GTK_TREE_SELECTION_SINGLE);
|
||||
gtk_widget_set_usize (tree_view, 200, -1);
|
||||
|
||||
for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
|
||||
{
|
||||
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
TITLE_COLUMN, testgtk_demos[i].title,
|
||||
FILENAME_COLUMN, testgtk_demos[i].filename,
|
||||
FUNC_COLUMN, testgtk_demos[i].func,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
}
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Widget",
|
||||
cell,
|
||||
"text", TITLE_COLUMN,
|
||||
"italic", ITALIC_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
|
||||
GTK_TREE_VIEW_COLUMN (column));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", selection_cb, model);
|
||||
gtk_signal_connect (GTK_OBJECT (tree_view), "button_press_event", GTK_SIGNAL_FUNC (button_press_event_cb), model);
|
||||
|
||||
return tree_view;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *tree;
|
||||
GtkTextTag *tag;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
tree = create_tree ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), tree, FALSE, FALSE, 0);
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&info_buffer, FALSE),
|
||||
gtk_label_new ("Info"));
|
||||
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&source_buffer, TRUE),
|
||||
gtk_label_new ("Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "source");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
load_file (testgtk_demos[0].filename);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
+4
-2
@@ -16,8 +16,9 @@ Without those packages make distcheck will *not* pass.
|
||||
0) Blow away your gtk+ directory, check a new version out
|
||||
1) autogen and build it, make sure to enable docs.
|
||||
2) Update NEWS based on the various ChangeLog files
|
||||
3) Update version in configure.in, increase micro and interface age by 1.
|
||||
(Note that this is critical, a slip-up here will cause the soname to change).
|
||||
3) Verify that the version in configure.in has been bumped after the last
|
||||
release. (Note that this is critical, a slip-up here will cause the soname
|
||||
to change).
|
||||
4) Add === Released 2.x.y === at the top of all ChangeLog files
|
||||
5) make distcheck
|
||||
6) Fix broken stuff found by 5) repeat
|
||||
@@ -34,3 +35,4 @@ create a new message in the same form, replacing version numbers, commentary
|
||||
at the top about "what this release is about" and the Summary of changes.
|
||||
12) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
gtk-devel-list. Set reply-to to gnome-hackers.
|
||||
13) Bump the version number in configure.in.
|
||||
|
||||
@@ -429,7 +429,7 @@ in which they need to be installed:</para>
|
||||
|
||||
<itemizedlist spacing=compact>
|
||||
<listitem><simpara> pkg-config
|
||||
(<ulink url="http://www.freedesktop.org/software/pkgconfig/">
|
||||
(<ulink url="http://www.freedesktop.org/software/pkgconfig">
|
||||
pkg-config Site</ulink>)</simpara>
|
||||
</listitem>
|
||||
|
||||
|
||||
@@ -1,3 +1,65 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
Sat Jul 3 23:44:45 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtksocket.sgml:
|
||||
* gtk/tmpl/gtkicontheme.sgml:
|
||||
* gtk/building.sgml:
|
||||
* gdk/tmpl/windows.sgml: Fix links to www.freedesktop.org.
|
||||
(#145210, Billy Biggs)
|
||||
|
||||
Tue Jun 22 21:54:24 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/composite.dia:
|
||||
* gdk-pixbuf/composite.png: Flip the y axes in the diagrams.
|
||||
|
||||
Sun Jun 20 00:17:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/composite.png: Add a figure which tries
|
||||
to expain pixbuf compositing.
|
||||
|
||||
* gdk-pixbuf/composite.dia:
|
||||
* gdk-pixbuf/apple-red-1a.png:
|
||||
* gdk-pixbuf/apple-red-2c.png:
|
||||
* gdk-pixbuf/gnome-gmush-1.png: Sources for composite.png.
|
||||
|
||||
* gdk-pixbuf/Makefile.am (HTML_IMAGES): Add composite.png.
|
||||
|
||||
Fri Jun 18 21:23:08 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtktreemodelfilter.sgml: Fix the docs for
|
||||
GtkTreeModelFilterVisibleFunc. (#144583, Olivier Andrieu)
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Mon May 31 00:18:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtktable.sgml: Document the default attach
|
||||
options for gtk_table_attach_defaults(). (#143391,
|
||||
Steve Chaplin)
|
||||
|
||||
Fri May 28 14:35:53 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkcontainer.sgml: Fix docs for
|
||||
gtk_container_border_width(). (#143309, Doug Quale)
|
||||
|
||||
Fri May 7 01:36:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-csource.xml: Add an "Environment"
|
||||
section. (Jens Elkner)
|
||||
|
||||
Fri May 7 01:23:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkicontheme.sgml: Fix example. (Steffen Röcker)
|
||||
|
||||
2004-05-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkuimanager.sgml: Fixes to the DTD.
|
||||
|
||||
@@ -57,7 +57,7 @@ content_files = \
|
||||
gdk-pixbuf-query-loaders.xml
|
||||
|
||||
# Images to copy into HTML directory
|
||||
HTML_IMAGES =
|
||||
HTML_IMAGES = composite.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS=
|
||||
@@ -65,7 +65,12 @@ FIXXREF_OPTIONS=
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
# Other files to distribute
|
||||
EXTRA_DIST += version.xml.in
|
||||
EXTRA_DIST += version.xml.in \
|
||||
composite.png \
|
||||
composite.dia \
|
||||
apple-red-1a.png \
|
||||
apple-red-2c.png \
|
||||
gnome-gmush-1.png
|
||||
|
||||
########################################################################
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -155,7 +155,7 @@ ratio.
|
||||
Defines the reference point of a window and the meaning of coordinates
|
||||
passed to gtk_window_move(). See gtk_window_move() and the "implementation
|
||||
notes" section of the
|
||||
<ulink url="http://www.freedesktop.org/standards/wm-spec.html">extended
|
||||
<ulink url="http://www.freedesktop.org/standards/wm-spec">extended
|
||||
window manager hints</ulink> specification for more details.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ How to compile GTK+ itself
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink
|
||||
url="http://www.freedesktop.org/software/pkgconfig/">pkg-config</ulink>
|
||||
url="http://www.freedesktop.org/software/pkgconfig">pkg-config</ulink>
|
||||
is a tool for tracking the compilation flags needed for
|
||||
libraries that are used by the GTK+ libraries. (For each
|
||||
library, a small <literal>.pc</literal> text file is installed in a standard
|
||||
|
||||
@@ -118,6 +118,8 @@ a widget used to choose from a list of items.
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -168,10 +168,10 @@ changes, use gtk_widget_child_notify().
|
||||
|
||||
<!-- ##### MACRO gtk_container_border_width ##### -->
|
||||
<para>
|
||||
Does the same as gtk_container_get_border_width().
|
||||
Does the same as gtk_container_set_border_width().
|
||||
</para>
|
||||
|
||||
@Deprecated: Use gtk_container_get_border_width() instead.
|
||||
@Deprecated: Use gtk_container_set_border_width() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_add ##### -->
|
||||
|
||||
@@ -170,8 +170,10 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index:
|
||||
@index_:
|
||||
@text:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_insert_action_markup ##### -->
|
||||
@@ -180,8 +182,10 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index:
|
||||
@index_:
|
||||
@markup:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_delete_action ##### -->
|
||||
@@ -190,6 +194,8 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ providing a filename is to allow different icons to be used
|
||||
depending on what <firstterm>icon theme</firstterm> is selecetd
|
||||
by the user. The operation of icon themes on Linux and Unix
|
||||
follows the <ulink
|
||||
url="http://www.freedesktop.org/standards/icon-theme-spec.html">Icon
|
||||
url="http://www.freedesktop.org/standards/icon-theme-spec">Icon
|
||||
Theme Specification</ulink>. There is a default icon theme,
|
||||
named <literal>hicolor</literal> where applications should install
|
||||
their icons, but more additional application themes can be
|
||||
@@ -80,7 +80,8 @@ icon_theme = gtk_icon_theme_get_default ();
|
||||
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
||||
"my-icon-name", /* icon name */
|
||||
48, /* size */
|
||||
0, /* flags */);
|
||||
0, /* flags */
|
||||
&error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
g_warning ("Couldn't load icon: %s", error->message);
|
||||
|
||||
@@ -64,7 +64,7 @@ is running.
|
||||
|
||||
<para>
|
||||
The communication between a #GtkSocket and a #GtkPlug follows the
|
||||
<ulink url="http://www.freedesktop.org/standards/xembed.html">XEmbed</ulink>
|
||||
<ulink url="http://www.freedesktop.org/standards/xembed-spec">XEmbed</ulink>
|
||||
protocol. This protocol has also been implemented in other toolkits, e.g.
|
||||
<application>Qt</application>, allowing the same level of integration
|
||||
when embedding a <application>Qt</application> widget in GTK or vice versa.</para>
|
||||
@@ -85,7 +85,7 @@ as between a #GtkPlug and a #GtkSocket.</para>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><ulink url="http://www.freedesktop.org/standards/xembed.html">XEmbed</ulink></term>
|
||||
<term><ulink url="http://www.freedesktop.org/standards/xembed-spec">XEmbed</ulink></term>
|
||||
<listitem><para>the XEmbed Protocol Specification.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ and row numbers of the table. (Columns and rows are indexed from zero).
|
||||
|
||||
<!-- ##### FUNCTION gtk_table_attach_defaults ##### -->
|
||||
<para>
|
||||
As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.
|
||||
As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the #GtkAttachOptions are <literal>GTK_EXPAND | GTK_FILL</literal>, and the padding is set to 0.
|
||||
</para>
|
||||
|
||||
@table: The table to add a new child widget to.
|
||||
|
||||
@@ -244,6 +244,8 @@ to a #GtkToolbar.
|
||||
|
||||
@toolbar:
|
||||
@tool_item:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,9 @@ The GtkTreeModelFilter struct contains only private fields.
|
||||
A function which decides whether the row indicated by @iter is visible.
|
||||
</para>
|
||||
|
||||
@model: the #GtkTreeModelFilter
|
||||
@iter: a #GtkTreeIter pointing to the row whose visibility is determined
|
||||
@model: the child model of the #GtkTreeModelFilter
|
||||
@iter: a #GtkTreeIter pointing to the row in @model whose visibility
|
||||
is determined
|
||||
@data: user data given to gtk_tree_model_filter_set_visible_func()
|
||||
@Returns: Whether the row indicated by @iter is visible.
|
||||
|
||||
|
||||
@@ -271,6 +271,11 @@ GtkButton
|
||||
|
||||
=====================
|
||||
|
||||
NOTE: Due to a bug that is basically unfixable in a sufficiently compatible
|
||||
NOTE: way, the button gives the space requested for focus_width and
|
||||
NOTE: focus_padding to the child (in addition to the space requested by
|
||||
NOTE: the child), if the button is !CAN_FOCUS.
|
||||
|
||||
Style properties
|
||||
|
||||
GtkWidget::interior_focus = TRUE
|
||||
|
||||
@@ -1,3 +1,60 @@
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-features.h.in: Fix the build.
|
||||
|
||||
2004-07-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk-pixbuf-features.h.in
|
||||
* gdk-pixbuf.c: Mark the version variables for proper import and
|
||||
export from Windows DLLs. Thanks to Laurent Sansonetti for
|
||||
reporting the problem.
|
||||
|
||||
Sat Jul 3 00:41:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* pixops/pixops.c (bilinear_box_make_weights): Correct the
|
||||
math to calculate bilinear weights. (#112412, Brian Cameron)
|
||||
|
||||
Sun Jun 20 00:16:00 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-scale.c (gdk_pixbuf_composite): Add a figure which
|
||||
explains pixbuf compositing.
|
||||
|
||||
2004-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-tiff.c: Make the tiff loader work with both
|
||||
libtiff 3.5.7 and libtiff 3.6.1. (#135541, Marco Ghirlanda)
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Sat Jun 5 00:59:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-animation.c:
|
||||
* gdk-pixbuf-io.c: Convert filenames to UTF-8 when embedding
|
||||
them in error messages. (#143654, Sven Neumann)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Sun May 16 22:55:49 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-pnm.c (pnm_read_next_value): Don't read integers
|
||||
partially. (#142584, Kouichirou Hiratsuka)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* pixops/timescale.c:
|
||||
* pixops/pixops.c:
|
||||
* pixops/pixops.h:
|
||||
* gdk-pixbuf-scale.c: _-prefix the nonstatic pixops_...
|
||||
functions. (#142233, Morten Welinder)
|
||||
|
||||
2004-04-30 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.1 ===
|
||||
|
||||
@@ -135,28 +135,36 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
FILE *f;
|
||||
guchar buffer [128];
|
||||
GdkPixbufModule *image_module;
|
||||
gchar *utf8_filename;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = fread (&buffer, 1, sizeof (buffer), f);
|
||||
|
||||
if (size == 0) {
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Image file '%s' contains no data"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
|
||||
fclose (f);
|
||||
return NULL;
|
||||
@@ -192,11 +200,14 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
||||
image_module->module_name);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
|
||||
if (pixbuf == NULL)
|
||||
@@ -220,11 +231,14 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
||||
image_module->module_name);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load animation '%s': reason not known, probably a corrupt animation file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
|
||||
@@ -6,7 +6,34 @@
|
||||
#define GDK_PIXBUF_MICRO (@GDK_PIXBUF_MICRO@)
|
||||
#define GDK_PIXBUF_VERSION "@GDK_PIXBUF_VERSION@"
|
||||
|
||||
extern const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
|
||||
extern const char *gdk_pixbuf_version;
|
||||
/* We prefix variable declarations so they can
|
||||
* properly get exported/imported from Windows DLLs.
|
||||
*/
|
||||
#ifndef GDK_PIXBUF_VAR
|
||||
# ifdef G_PLATFORM_WIN32
|
||||
# ifdef GDK_PIXBUF_STATIC_COMPILATION
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# else /* !GDK_PIXBUF_STATIC_COMPILATION */
|
||||
# ifdef GDK_PIXBUF_COMPILATION
|
||||
# ifdef DLL_EXPORT
|
||||
# define GDK_PIXBUF_VAR __declspec(dllexport)
|
||||
# else /* !DLL_EXPORT */
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# endif /* !DLL_EXPORT */
|
||||
# else /* !GDK_PIXBUF_COMPILATION */
|
||||
# define GDK_PIXBUF_VAR extern __declspec(dllimport)
|
||||
# endif /* !GDK_PIXBUF_COMPILATION */
|
||||
# endif /* !GDK_PIXBUF_STATIC_COMPILATION */
|
||||
# else /* !G_PLATFORM_WIN32 */
|
||||
# ifndef GDK_PIXBUF_COMPILATION
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# else
|
||||
# define GDK_PIXBUF_VAR
|
||||
# endif /* !GDK_PIXBUF_COMPILATION */
|
||||
# endif /* !G_PLATFORM_WIN32 */
|
||||
#endif /* GDK_PIXBUF_VAR */
|
||||
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
|
||||
GDK_PIXBUF_VAR const char *gdk_pixbuf_version;
|
||||
|
||||
#endif
|
||||
|
||||
+62
-23
@@ -637,6 +637,8 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
|
||||
|
||||
gint score, best = 0;
|
||||
GdkPixbufModule *selected = NULL;
|
||||
gchar *utf8_filename = NULL;
|
||||
|
||||
for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) {
|
||||
GdkPixbufModule *module = (GdkPixbufModule *)modules->data;
|
||||
score = format_check (module, buffer, size);
|
||||
@@ -651,18 +653,24 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
|
||||
return selected;
|
||||
|
||||
if (filename)
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Couldn't recognize the image file format for file '%s'"),
|
||||
filename);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (utf8_filename) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Couldn't recognize the image file format for file '%s'"),
|
||||
utf8_filename);
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
else
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unrecognized image file format"));
|
||||
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -763,22 +771,28 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = fread (&buffer, 1, sizeof (buffer), f);
|
||||
if (size == 0) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Image file '%s' contains no data"),
|
||||
filename);
|
||||
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
@@ -800,33 +814,41 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
fclose (f);
|
||||
|
||||
if (pixbuf == NULL && error != NULL && *error == NULL) {
|
||||
|
||||
/* I don't trust these crufty longjmp()'ing image libs
|
||||
* to maintain proper error invariants, and I don't
|
||||
* want user code to segfault as a result. We need to maintain
|
||||
* the invariastable/gdk-pixbuf/nt that error gets set if NULL is returned.
|
||||
* the invariant that error gets set if NULL is returned.
|
||||
*/
|
||||
|
||||
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.", image_module->module_name);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
} else if (error != NULL && *error != NULL) {
|
||||
|
||||
/* Add the filename to the error message */
|
||||
GError *e = *error;
|
||||
gchar *old;
|
||||
|
||||
gchar *old;
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
old = e->message;
|
||||
|
||||
e->message = g_strdup_printf (_("Failed to load image '%s': %s"),
|
||||
filename, old);
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
old);
|
||||
|
||||
g_free (utf8_filename);
|
||||
g_free (old);
|
||||
}
|
||||
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
@@ -896,11 +918,15 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -908,7 +934,7 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
|
||||
info.width = width;
|
||||
info.height = height;
|
||||
|
||||
|
||||
g_signal_connect (loader, "size-prepared", G_CALLBACK (size_prepared_cb), &info);
|
||||
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
@@ -932,12 +958,17 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
|
||||
|
||||
if (!pixbuf) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (loader);
|
||||
g_set_error (error,
|
||||
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1405,11 +1436,15 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
||||
f = fopen (filename, "wb");
|
||||
|
||||
if (f == NULL) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open '%s' for writing: %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1426,11 +1461,15 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
||||
}
|
||||
|
||||
if (fclose (f) < 0) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to close '%s' while writing image, all data may not have been saved: %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,13 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
|
||||
pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type);
|
||||
_pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,9 +97,20 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
* @overall_alpha: overall alpha for source image (0..255)
|
||||
*
|
||||
* Creates a transformation of the source image @src by scaling by
|
||||
* @scale_x and @scale_y then translating by @offset_x and @offset_y,
|
||||
* then composites the rectangle (@dest_x, @dest_y, @dest_width,
|
||||
* @dest_height) of the resulting image onto the destination image.
|
||||
* @scale_x and @scale_y then translating by @offset_x and @offset_y.
|
||||
* This gives an image in the coordinates of the destination pixbuf.
|
||||
* The rectangle (@dest_x, @dest_y, @dest_width, @dest_height)
|
||||
* is then composited onto the corresponding rectangle of the
|
||||
* original destination image.
|
||||
*
|
||||
* When the destination rectangle contains parts not in the source
|
||||
* image, the data at the edges of the source image is replicated
|
||||
* to infinity.
|
||||
*
|
||||
* <figure id="pixbuf-composite-diagram">
|
||||
* <title>Compositing of pixbufs</title>
|
||||
* <graphic fileref="composite.png" format="PNG"/>
|
||||
* </figure>
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
@@ -123,13 +134,13 @@ gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha);
|
||||
_pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,14 +202,14 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
|
||||
pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha, check_x, check_y,
|
||||
check_size, color1, color2);
|
||||
_pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha, check_x, check_y,
|
||||
check_size, color1, color2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define GDK_PIXBUF_COMPILATION
|
||||
#include "gdk-pixbuf.h"
|
||||
#include "gdk-pixbuf-private.h"
|
||||
|
||||
@@ -518,11 +519,11 @@ gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf)
|
||||
|
||||
|
||||
/* General initialization hooks */
|
||||
const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
|
||||
const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
|
||||
const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
|
||||
|
||||
const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
|
||||
GDK_PIXBUF_VAR const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
|
||||
|
||||
/* Error quark */
|
||||
GQuark
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ pnm_read_next_value (PnmIOBuffer *inbuf, guint *value, GError **error)
|
||||
*word = '\0';
|
||||
|
||||
/* hmmm, there must be more data to this 'word' */
|
||||
if (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128))
|
||||
if (p == inend || (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128)))
|
||||
return PNM_SUSPEND;
|
||||
|
||||
/* get the value */
|
||||
|
||||
+88
-67
@@ -145,34 +145,14 @@ static void free_buffer (guchar *pixels, gpointer data)
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
static tileContigRoutine tiff_put_contig;
|
||||
static tileSeparateRoutine tiff_put_separate;
|
||||
|
||||
/* We're lucky that TIFFRGBAImage uses the same RGBA packing
|
||||
as gdk-pixbuf, thus we can simple reuse the default libtiff
|
||||
put routines, only adjusting the coordinate system.
|
||||
*/
|
||||
static void
|
||||
put_contig (TIFFRGBAImage *img, uint32 *raster,
|
||||
uint32 x, uint32 y, uint32 w, uint32 h,
|
||||
int32 fromskew, int32 toskew, unsigned char *cp)
|
||||
static gboolean tifflibversion (int *major, int *minor, int *revision)
|
||||
{
|
||||
uint32 *data = raster - y * img->width - x;
|
||||
if (sscanf (TIFFGetVersion(),
|
||||
"LIBTIFF, Version %d.%d.%d",
|
||||
major, minor, revision) < 3)
|
||||
return FALSE;
|
||||
|
||||
tiff_put_contig (img, data + img->width * (img->height - 1 - y) + x,
|
||||
x, y, w, h, fromskew, -toskew - 2*(int32)w, cp);
|
||||
}
|
||||
|
||||
static void
|
||||
put_separate (TIFFRGBAImage *img, uint32 *raster,
|
||||
uint32 x, uint32 y, uint32 w, uint32 h,
|
||||
int32 fromskew, int32 toskew,
|
||||
unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a)
|
||||
{
|
||||
uint32 *data = raster - y * img->width - x;
|
||||
|
||||
tiff_put_separate (img, data + img->width * (img->height - 1 - y) + x,
|
||||
x, y, w, h, fromskew, -toskew - 2*w, r, g, b, a);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
@@ -181,8 +161,9 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
guchar *pixels = NULL;
|
||||
gint width, height, rowstride, bytes;
|
||||
GdkPixbuf *pixbuf;
|
||||
TIFFRGBAImage img;
|
||||
gchar emsg[1024];
|
||||
#if TIFFLIB_VERSION >= 20031226
|
||||
gint major, minor, revision;
|
||||
#endif
|
||||
|
||||
/* We're called with the lock held. */
|
||||
|
||||
@@ -263,49 +244,89 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
if (context)
|
||||
(* context->prepare_func) (pixbuf, NULL, context->user_data);
|
||||
G_LOCK (tiff_loader);
|
||||
|
||||
if (!TIFFRGBAImageBegin (&img, tiff, 1, emsg) || global_error) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (img.put.any == NULL) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Unsupported TIFF variant"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (img.isContig) {
|
||||
tiff_put_contig = img.put.contig;
|
||||
img.put.contig = put_contig;
|
||||
}
|
||||
else {
|
||||
tiff_put_separate = img.put.separate;
|
||||
img.put.separate = put_separate;
|
||||
}
|
||||
|
||||
TIFFRGBAImageGet (&img, (uint32 *)pixels, width, height);
|
||||
TIFFRGBAImageEnd (&img);
|
||||
#if TIFFLIB_VERSION >= 20031226
|
||||
if (tifflibversion(&major, &minor, &revision) && major == 3 &&
|
||||
(minor > 6 || (minor == 6 && revision > 0))) {
|
||||
if (!TIFFReadRGBAImageOriented (tiff, width, height, (uint32 *)pixels, ORIENTATION_TOPLEFT, 1) || global_error)
|
||||
{
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* Turns out that the packing used by TIFFRGBAImage depends on the host byte order... */
|
||||
while (pixels < pixbuf->pixels + bytes) {
|
||||
uint32 pixel = *(uint32 *)pixels;
|
||||
int r = TIFFGetR(pixel);
|
||||
int g = TIFFGetG(pixel);
|
||||
int b = TIFFGetB(pixel);
|
||||
int a = TIFFGetA(pixel);
|
||||
*pixels++ = r;
|
||||
*pixels++ = g;
|
||||
*pixels++ = b;
|
||||
*pixels++ = a;
|
||||
}
|
||||
/* Turns out that the packing used by TIFFRGBAImage depends on
|
||||
* the host byte order...
|
||||
*/
|
||||
while (pixels < pixbuf->pixels + bytes) {
|
||||
uint32 pixel = *(uint32 *)pixels;
|
||||
int r = TIFFGetR(pixel);
|
||||
int g = TIFFGetG(pixel);
|
||||
int b = TIFFGetB(pixel);
|
||||
int a = TIFFGetA(pixel);
|
||||
*pixels++ = r;
|
||||
*pixels++ = g;
|
||||
*pixels++ = b;
|
||||
*pixels++ = a;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
uint32 *rast, *tmp_rast;
|
||||
gint x, y;
|
||||
guchar *tmppix;
|
||||
|
||||
/* Yes, it needs to be _TIFFMalloc... */
|
||||
rast = (uint32 *) _TIFFmalloc (width * height * sizeof (uint32));
|
||||
if (!rast) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
_("Insufficient memory to open TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (!TIFFReadRGBAImage (tiff, width, height, rast, 1) || global_error) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
_TIFFfree (rast);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
|
||||
g_assert (pixels);
|
||||
|
||||
tmppix = pixels;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
/* Unexplainable...are tiffs backwards? */
|
||||
/* Also looking at the GIMP plugin, this
|
||||
* whole reading thing can be a bit more
|
||||
* robust.
|
||||
*/
|
||||
tmp_rast = rast + ((height - y - 1) * width);
|
||||
for (x = 0; x < width; x++) {
|
||||
tmppix[0] = TIFFGetR (*tmp_rast);
|
||||
tmppix[1] = TIFFGetG (*tmp_rast);
|
||||
tmppix[2] = TIFFGetB (*tmp_rast);
|
||||
tmppix[3] = TIFFGetA (*tmp_rast);
|
||||
tmp_rast++;
|
||||
tmppix += 4;
|
||||
}
|
||||
}
|
||||
|
||||
_TIFFfree (rast);
|
||||
}
|
||||
|
||||
G_UNLOCK (tiff_loader);
|
||||
if (context)
|
||||
|
||||
+68
-68
@@ -1320,7 +1320,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
w = linear_box_half (0.5 + i - a, 0.5 + i - x);
|
||||
w += linear_box_half (1.5 + x - i, 1.5 + a - i);
|
||||
w += linear_box_half (0.5 + x - i, 0.5 + a - i);
|
||||
|
||||
*(pixel_weights++) = w * scale;
|
||||
}
|
||||
@@ -1357,29 +1357,29 @@ make_weights (PixopsFilter *filter,
|
||||
}
|
||||
|
||||
void
|
||||
pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2)
|
||||
_pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
@@ -1396,10 +1396,10 @@ pixops_composite_color (guchar *dest_buf,
|
||||
|
||||
if (!src_has_alpha && overall_alpha == 255)
|
||||
{
|
||||
pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
_pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1435,7 +1435,7 @@ pixops_composite_color (guchar *dest_buf,
|
||||
}
|
||||
|
||||
/**
|
||||
* pixops_composite:
|
||||
* _pixops_composite:
|
||||
* @dest_buf: pointer to location to store result
|
||||
* @render_x0: x0 of region of scaled source to store into @dest_buf
|
||||
* @render_y0: y0 of region of scaled source to store into @dest_buf
|
||||
@@ -1459,24 +1459,24 @@ pixops_composite_color (guchar *dest_buf,
|
||||
* of the result into the destination buffer.
|
||||
**/
|
||||
void
|
||||
pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha)
|
||||
_pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
@@ -1493,10 +1493,10 @@ pixops_composite (guchar *dest_buf,
|
||||
|
||||
if (!src_has_alpha && overall_alpha == 255)
|
||||
{
|
||||
pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
_pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1536,23 +1536,23 @@ pixops_composite (guchar *dest_buf,
|
||||
}
|
||||
|
||||
void
|
||||
pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type)
|
||||
_pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
|
||||
+42
-42
@@ -18,24 +18,24 @@ typedef enum {
|
||||
* render_x, render_y, render_width, render_height in the new
|
||||
* coordinate system into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha);
|
||||
void _pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha);
|
||||
|
||||
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
||||
* and composite the portion corresponding to
|
||||
@@ -43,36 +43,36 @@ void pixops_composite (guchar *dest_buf,
|
||||
* coordinate system against a checkboard with checks of size check_size
|
||||
* of the colors color1 and color2 into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2);
|
||||
void _pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2);
|
||||
|
||||
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
||||
* and composite the portion corresponding to
|
||||
* render_x, render_y, render_width, render_height in the new
|
||||
* coordinate system into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_scale (guchar *dest_buf,
|
||||
void _pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
|
||||
@@ -182,10 +182,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level);
|
||||
_pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level);
|
||||
}
|
||||
scale_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" scale\t\t", ITERS, dest_height * dest_width);
|
||||
@@ -194,10 +194,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_composite (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255);
|
||||
_pixops_composite (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255);
|
||||
}
|
||||
composite_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" composite\t\t", ITERS, dest_height * dest_width);
|
||||
@@ -205,10 +205,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_composite_color (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255, 0, 0, 16, 0xaaaaaa, 0x555555);
|
||||
_pixops_composite_color (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255, 0, 0, 16, 0xaaaaaa, 0x555555);
|
||||
}
|
||||
composite_color_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" composite color\t", ITERS, dest_height * dest_width);
|
||||
|
||||
+21
-21
@@ -40,27 +40,27 @@ static void gdk_display_dispose (GObject *object);
|
||||
static void gdk_display_finalize (GObject *object);
|
||||
|
||||
|
||||
void singlehead_get_pointer (GdkDisplay *display,
|
||||
static void singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
static GdkWindow* singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -558,7 +558,7 @@ gdk_display_set_pointer_hooks (GdkDisplay *display,
|
||||
return (GdkDisplayPointerHooks *)result;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
@@ -573,7 +573,7 @@ singlehead_get_pointer (GdkDisplay *display,
|
||||
singlehead_current_pointer_hooks->get_pointer (root_window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
@@ -583,7 +583,7 @@ singlehead_window_get_pointer (GdkDisplay *display,
|
||||
return singlehead_current_pointer_hooks->get_pointer (window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
@@ -594,7 +594,7 @@ singlehead_window_at_pointer (GdkDisplay *display,
|
||||
win_x, win_y);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
@@ -604,7 +604,7 @@ singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
|
||||
+3
-1
@@ -130,7 +130,9 @@ typedef enum
|
||||
GDK_BUTTON3_MASK = 1 << 10,
|
||||
GDK_BUTTON4_MASK = 1 << 11,
|
||||
GDK_BUTTON5_MASK = 1 << 12,
|
||||
/* The next few modifiers are used by XKB, so we skip to the end
|
||||
/* The next few modifiers are used by XKB, so we skip to the end.
|
||||
* Bits 16 - 28 are currently unused, but will eventually
|
||||
* be used for "virtual modifiers". Bit 29 is used internally.
|
||||
*/
|
||||
GDK_RELEASE_MASK = 1 << 30,
|
||||
GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff
|
||||
|
||||
@@ -65,7 +65,7 @@ typedef enum {
|
||||
#ifdef OLE2_DND
|
||||
|
||||
#define PRINT_GUID(guid) \
|
||||
g_print ("guid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
g_print ("guid = %.08lx-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) guid)[0], \
|
||||
((gushort *) guid)[2], \
|
||||
((gushort *) guid)[3], \
|
||||
@@ -88,6 +88,9 @@ static int nformats;
|
||||
* this is used on both source and destination sides.
|
||||
*/
|
||||
struct _GdkDragContextPrivateWin32 {
|
||||
#ifdef OLE2_DND
|
||||
gint ref_count;
|
||||
#endif
|
||||
guint16 last_x; /* Coordinates from last event */
|
||||
guint16 last_y;
|
||||
HWND dest_xid;
|
||||
@@ -139,6 +142,9 @@ gdk_drag_context_init (GdkDragContext *dragcontext)
|
||||
GdkDragContextPrivateWin32 *private = g_new0 (GdkDragContextPrivateWin32, 1);
|
||||
|
||||
dragcontext->windowing_data = private;
|
||||
#ifdef OLE2_DND
|
||||
private->ref_count = 1;
|
||||
#endif
|
||||
|
||||
contexts = g_list_prepend (contexts, dragcontext);
|
||||
}
|
||||
@@ -668,7 +674,7 @@ ienumformatetc_next (LPENUMFORMATETC This,
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
int i, n;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_next %p %d %d\n", This, en->ix, celt));
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_next %p %d %ld\n", This, en->ix, celt));
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < celt; i++)
|
||||
@@ -694,7 +700,7 @@ ienumformatetc_skip (LPENUMFORMATETC This,
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_skip %p %d %d\n", This, en->ix, celt));
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_skip %p %d %ld\n", This, en->ix, celt));
|
||||
en->ix += celt;
|
||||
|
||||
return S_OK;
|
||||
@@ -1244,7 +1250,6 @@ gdk_drag_begin (GdkWindow *window,
|
||||
HRESULT hResult;
|
||||
DWORD dwEffect;
|
||||
HGLOBAL global;
|
||||
FORMATETC format;
|
||||
STGMEDIUM medium;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
@@ -1285,7 +1290,7 @@ gdk_drag_begin (GdkWindow *window,
|
||||
(hResult == DRAGDROP_S_DROP ? "DRAGDROP_S_DROP" :
|
||||
(hResult == DRAGDROP_S_CANCEL ? "DRAGDROP_S_CANCEL" :
|
||||
(hResult == E_UNEXPECTED ? "E_UNEXPECTED" :
|
||||
g_strdup_printf ("%#.8x", hResult))))));
|
||||
g_strdup_printf ("%#.8lx", hResult))))));
|
||||
|
||||
dobj->ido.lpVtbl->Release (&dobj->ido);
|
||||
ctx->ids.lpVtbl->Release (&ctx->ids);
|
||||
@@ -1362,8 +1367,8 @@ gdk_drag_find_window_for_screen (GdkDragContext *context,
|
||||
{
|
||||
find_window_enum_arg a;
|
||||
|
||||
a.x = x_root;
|
||||
a.y = y_root;
|
||||
a.x = x_root - _gdk_offset_x;
|
||||
a.y = y_root - _gdk_offset_y;
|
||||
a.ignore = drag_window ? GDK_WINDOW_HWND (drag_window) : NULL;
|
||||
a.result = NULL;
|
||||
|
||||
|
||||
@@ -1032,7 +1032,7 @@ gdk_win32_draw_text (GdkDrawable *drawable,
|
||||
{
|
||||
const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_FONT;
|
||||
wchar_t *wcstr, wc;
|
||||
gint wlen;
|
||||
glong wlen;
|
||||
gdk_draw_text_arg arg;
|
||||
|
||||
if (text_length == 0)
|
||||
@@ -1058,15 +1058,11 @@ gdk_win32_draw_text (GdkDrawable *drawable,
|
||||
}
|
||||
else
|
||||
{
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
if ((wlen = _gdk_utf8_to_ucs2 (wcstr, text, text_length, text_length)) == -1)
|
||||
g_warning ("gdk_win32_draw_text: _gdk_utf8_to_ucs2 failed");
|
||||
else
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_draw_text_handler, &arg);
|
||||
wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_draw_text_handler, &arg);
|
||||
g_free (wcstr);
|
||||
}
|
||||
|
||||
|
||||
gdk_win32_hdc_release (drawable, gc, mask);
|
||||
}
|
||||
|
||||
|
||||
+48
-41
@@ -533,13 +533,13 @@ gdk_pointer_grab (GdkWindow *window,
|
||||
hcursor = NULL;
|
||||
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
|
||||
WIN32_API_FAILED ("CopyCursor");
|
||||
#if 0
|
||||
|
||||
return_val = _gdk_input_grab_pointer (window,
|
||||
owner_events,
|
||||
event_mask,
|
||||
confine_to,
|
||||
time);
|
||||
#endif
|
||||
|
||||
if (return_val == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -615,9 +615,8 @@ gdk_display_pointer_ungrab (GdkDisplay *display,
|
||||
GDK_NOTE (EVENTS, g_print ("%sgdk_display_pointer_ungrab%s",
|
||||
(debug_indent > 0 ? "\n" : ""),
|
||||
(debug_indent == 0 ? "\n" : "")));
|
||||
#if 0
|
||||
|
||||
_gdk_input_ungrab_pointer (time);
|
||||
#endif
|
||||
|
||||
if (GetCapture () != NULL)
|
||||
ReleaseCapture ();
|
||||
@@ -1557,6 +1556,9 @@ translate_mouse_coords (GdkWindow *window1,
|
||||
msg->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
}
|
||||
|
||||
/* The check_extended flag controls whether to check if the windows want
|
||||
* events from extended input devices and if the message should be skipped
|
||||
* because an extended input device is active */
|
||||
static gboolean
|
||||
propagate (GdkWindow **window,
|
||||
MSG *msg,
|
||||
@@ -1564,13 +1566,24 @@ propagate (GdkWindow **window,
|
||||
gboolean grab_owner_events,
|
||||
gint grab_mask,
|
||||
gboolean (*doesnt_want_it) (gint mask,
|
||||
MSG *msg))
|
||||
MSG *msg),
|
||||
gboolean check_extended)
|
||||
{
|
||||
gboolean in_propagation = FALSE;
|
||||
|
||||
if (grab_window != NULL && !grab_owner_events)
|
||||
{
|
||||
/* Event source is grabbed with owner_events FALSE */
|
||||
|
||||
/* See if the event should be ignored because an extended input device
|
||||
* is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) grab_window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (grab_mask, msg))
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (grabber doesn't want it)"));
|
||||
@@ -1585,7 +1598,16 @@ propagate (GdkWindow **window,
|
||||
}
|
||||
while (TRUE)
|
||||
{
|
||||
if ((*doesnt_want_it) (((GdkWindowObject *) *window)->event_mask, msg))
|
||||
/* See if the event should be ignored because an extended input device
|
||||
* is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) *window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (((GdkWindowObject *) *window)->event_mask, msg))
|
||||
{
|
||||
/* Owner doesn't want it, propagate to parent. */
|
||||
GdkWindow *parent = gdk_window_get_parent (*window);
|
||||
@@ -1595,6 +1617,16 @@ propagate (GdkWindow **window,
|
||||
if (grab_window != NULL)
|
||||
{
|
||||
/* Event source is grabbed with owner_events TRUE */
|
||||
|
||||
/* See if the event should be ignored because an extended
|
||||
* input device is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) grab_window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (grab_mask, msg))
|
||||
{
|
||||
/* Grabber doesn't want it either */
|
||||
@@ -2168,16 +2200,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
assign_object (&window, new_window);
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_scroll))
|
||||
doesnt_want_scroll, TRUE))
|
||||
goto done;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2319,7 +2344,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_key))
|
||||
doesnt_want_key, FALSE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2401,7 +2426,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_char))
|
||||
doesnt_want_char, FALSE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2479,16 +2504,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_press))
|
||||
doesnt_want_button_press, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2568,16 +2586,18 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_release))
|
||||
doesnt_want_button_release, TRUE))
|
||||
{
|
||||
}
|
||||
else if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2640,16 +2660,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_motion))
|
||||
doesnt_want_button_motion, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2747,16 +2760,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
assign_object (&window, new_window);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_scroll))
|
||||
doesnt_want_scroll, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -3301,6 +3307,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
event->any.window = window;
|
||||
g_object_ref (window);
|
||||
if (_gdk_input_other_event (event, msg, window))
|
||||
append_event (display, event);
|
||||
else
|
||||
|
||||
@@ -1592,8 +1592,8 @@ gdk_text_extents (GdkFont *font,
|
||||
gint *descent)
|
||||
{
|
||||
gdk_text_size_arg arg;
|
||||
gint wlen;
|
||||
wchar_t *wcstr;
|
||||
glong wlen;
|
||||
wchar_t *wcstr, wc;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
@@ -1617,22 +1617,18 @@ gdk_text_extents (GdkFont *font,
|
||||
|
||||
arg.total.cx = arg.total.cy = 0;
|
||||
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
if (text_length == 1)
|
||||
{
|
||||
wcstr[0] = (guchar) text[0];
|
||||
_gdk_wchar_text_handle (font, wcstr, 1, gdk_text_size_handler, &arg);
|
||||
wc = (guchar) text[0];
|
||||
_gdk_wchar_text_handle (font, &wc, 1, gdk_text_size_handler, &arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((wlen = _gdk_utf8_to_ucs2 (wcstr, text, text_length, text_length)) == -1)
|
||||
g_warning ("gdk_text_extents: _gdk_utf8_to_ucs2 failed");
|
||||
else
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
|
||||
wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
|
||||
g_free (wcstr);
|
||||
}
|
||||
|
||||
g_free (wcstr);
|
||||
|
||||
/* XXX This is quite bogus */
|
||||
if (lbearing)
|
||||
*lbearing = 0;
|
||||
|
||||
@@ -51,8 +51,8 @@ WORD _cf_rtf;
|
||||
WORD _cf_utf8_string;
|
||||
|
||||
GdkAtom _utf8_string;
|
||||
GdkAtom _compound_text;
|
||||
GdkAtom _text_uri_list;
|
||||
GdkAtom _targets;
|
||||
|
||||
GdkAtom _local_dnd;
|
||||
GdkAtom _gdk_win32_dropfiles;
|
||||
|
||||
+21
-307
@@ -1,6 +1,6 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
* Copyright (C) 1998-2002 Tor Lillqvist
|
||||
* Copyright (C) 1998-2004 Tor Lillqvist
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -58,321 +58,35 @@ gdk_set_locale (void)
|
||||
return g_win32_getlocale ();
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_wcstombs
|
||||
*
|
||||
* Returns a multi-byte string converted from the specified array
|
||||
* of wide characters. The string is newly allocated. The array of
|
||||
* wide characters must be null-terminated. If the conversion is
|
||||
* failed, it returns NULL.
|
||||
*
|
||||
* On Win32, we always use UTF-8.
|
||||
*/
|
||||
gchar *
|
||||
gdk_wcstombs (const GdkWChar *src)
|
||||
{
|
||||
gint len;
|
||||
const GdkWChar *wcp;
|
||||
guchar *mbstr, *bp;
|
||||
gchar *utf8;
|
||||
gchar *retval;
|
||||
const gchar *charset;
|
||||
|
||||
wcp = src;
|
||||
len = 0;
|
||||
while (*wcp)
|
||||
{
|
||||
const GdkWChar c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
len += 1;
|
||||
else if (c < 0x800)
|
||||
len += 2;
|
||||
else if (c < 0x10000)
|
||||
len += 3;
|
||||
else if (c < 0x200000)
|
||||
len += 4;
|
||||
else if (c < 0x4000000)
|
||||
len += 5;
|
||||
else
|
||||
len += 6;
|
||||
}
|
||||
|
||||
mbstr = g_malloc (len + 1);
|
||||
|
||||
wcp = src;
|
||||
bp = mbstr;
|
||||
while (*wcp)
|
||||
{
|
||||
int first;
|
||||
GdkWChar c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
first = 0;
|
||||
len = 1;
|
||||
}
|
||||
else if (c < 0x800)
|
||||
{
|
||||
first = 0xc0;
|
||||
len = 2;
|
||||
}
|
||||
else if (c < 0x10000)
|
||||
{
|
||||
first = 0xe0;
|
||||
len = 3;
|
||||
}
|
||||
else if (c < 0x200000)
|
||||
{
|
||||
first = 0xf0;
|
||||
len = 4;
|
||||
}
|
||||
else if (c < 0x4000000)
|
||||
{
|
||||
first = 0xf8;
|
||||
len = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = 0xfc;
|
||||
len = 6;
|
||||
}
|
||||
|
||||
/* Woo-hoo! */
|
||||
switch (len)
|
||||
{
|
||||
case 6: bp[5] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 5: bp[4] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 4: bp[3] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 3: bp[2] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 2: bp[1] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 1: bp[0] = c | first;
|
||||
}
|
||||
|
||||
bp += len;
|
||||
}
|
||||
*bp = 0;
|
||||
return mbstr;
|
||||
g_get_charset (&charset);
|
||||
return g_convert (src, -1, charset, "UCS-4LE", NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* A vesion that converts from wchar_t strings to UTF-8 */
|
||||
|
||||
gchar *
|
||||
_gdk_ucs2_to_utf8 (const wchar_t *src,
|
||||
gint src_len)
|
||||
{
|
||||
gint len;
|
||||
const wchar_t *wcp;
|
||||
guchar *mbstr, *bp;
|
||||
|
||||
wcp = src;
|
||||
len = 0;
|
||||
while (wcp < src + src_len)
|
||||
{
|
||||
const wchar_t c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
len += 1;
|
||||
else if (c < 0x800)
|
||||
len += 2;
|
||||
else
|
||||
len += 3;
|
||||
}
|
||||
|
||||
mbstr = g_malloc (len + 1);
|
||||
|
||||
wcp = src;
|
||||
bp = mbstr;
|
||||
while (wcp < src + src_len)
|
||||
{
|
||||
int first;
|
||||
wchar_t c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
first = 0;
|
||||
len = 1;
|
||||
}
|
||||
else if (c < 0x800)
|
||||
{
|
||||
first = 0xc0;
|
||||
len = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = 0xe0;
|
||||
len = 3;
|
||||
}
|
||||
|
||||
/* Woo-hoo! */
|
||||
switch (len)
|
||||
{
|
||||
case 3: bp[2] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 2: bp[1] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 1: bp[0] = c | first;
|
||||
}
|
||||
|
||||
bp += len;
|
||||
}
|
||||
*bp = 0;
|
||||
|
||||
return mbstr;
|
||||
}
|
||||
|
||||
/* Convert from UTF-8 to GdkWChar */
|
||||
|
||||
gint
|
||||
_gdk_utf8_to_wcs (GdkWChar *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max)
|
||||
{
|
||||
guchar *cp, *end;
|
||||
gint n;
|
||||
|
||||
cp = (guchar *) src;
|
||||
end = cp + src_len;
|
||||
n = 0;
|
||||
while (cp != end && dest != dest + dest_max)
|
||||
{
|
||||
gint i, mask = 0, len;
|
||||
guchar c = *cp;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
len = 1;
|
||||
mask = 0x7f;
|
||||
}
|
||||
else if ((c & 0xe0) == 0xc0)
|
||||
{
|
||||
len = 2;
|
||||
mask = 0x1f;
|
||||
}
|
||||
else if ((c & 0xf0) == 0xe0)
|
||||
{
|
||||
len = 3;
|
||||
mask = 0x0f;
|
||||
}
|
||||
else if ((c & 0xf8) == 0xf0)
|
||||
{
|
||||
len = 4;
|
||||
mask = 0x07;
|
||||
}
|
||||
else if ((c & 0xfc) == 0xf8)
|
||||
{
|
||||
len = 5;
|
||||
mask = 0x03;
|
||||
}
|
||||
else if ((c & 0xfc) == 0xfc)
|
||||
{
|
||||
len = 6;
|
||||
mask = 0x01;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (cp + len > end)
|
||||
return -1;
|
||||
|
||||
*dest = (cp[0] & mask);
|
||||
for (i = 1; i < len; i++)
|
||||
{
|
||||
if ((cp[i] & 0xc0) != 0x80)
|
||||
return -1;
|
||||
*dest <<= 6;
|
||||
*dest |= (cp[i] & 0x3f);
|
||||
}
|
||||
if (*dest == -1)
|
||||
return -1;
|
||||
|
||||
cp += len;
|
||||
dest++;
|
||||
n++;
|
||||
}
|
||||
if (cp != end)
|
||||
return -1;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_mbstowcs
|
||||
*
|
||||
* Converts the specified string into GDK wide characters, and,
|
||||
* returns the number of wide characters written. The string 'src'
|
||||
* must be null-terminated. If the conversion is failed, it returns
|
||||
* -1.
|
||||
*
|
||||
* On Win32, the string is assumed to be in UTF-8. Also note that
|
||||
* GdkWChar is 32 bits, while wchar_t, and the wide characters the
|
||||
* Windows API uses, are 16 bits!
|
||||
*/
|
||||
|
||||
gint
|
||||
gdk_mbstowcs (GdkWChar *dest,
|
||||
const gchar *src,
|
||||
gint dest_max)
|
||||
{
|
||||
return _gdk_utf8_to_wcs (dest, src, strlen (src), dest_max);
|
||||
}
|
||||
|
||||
|
||||
/* A version that converts to a wchar_t string */
|
||||
|
||||
gint
|
||||
_gdk_utf8_to_ucs2 (wchar_t *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max)
|
||||
{
|
||||
wchar_t *wcp;
|
||||
guchar *cp, *end;
|
||||
gint n;
|
||||
|
||||
wcp = dest;
|
||||
cp = (guchar *) src;
|
||||
end = cp + src_len;
|
||||
n = 0;
|
||||
while (cp != end && wcp != dest + dest_max)
|
||||
{
|
||||
gint i, mask = 0, len;
|
||||
guchar c = *cp;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
len = 1;
|
||||
mask = 0x7f;
|
||||
}
|
||||
else if ((c & 0xe0) == 0xc0)
|
||||
{
|
||||
len = 2;
|
||||
mask = 0x1f;
|
||||
}
|
||||
else if ((c & 0xf0) == 0xe0)
|
||||
{
|
||||
len = 3;
|
||||
mask = 0x0f;
|
||||
}
|
||||
else /* Other lengths are not possible with 16-bit wchar_t! */
|
||||
return -1;
|
||||
|
||||
if (cp + len > end)
|
||||
return -1;
|
||||
|
||||
*wcp = (cp[0] & mask);
|
||||
for (i = 1; i < len; i++)
|
||||
{
|
||||
if ((cp[i] & 0xc0) != 0x80)
|
||||
return -1;
|
||||
*wcp <<= 6;
|
||||
*wcp |= (cp[i] & 0x3f);
|
||||
}
|
||||
if (*wcp == 0xFFFF)
|
||||
return -1;
|
||||
|
||||
cp += len;
|
||||
wcp++;
|
||||
n++;
|
||||
}
|
||||
if (cp != end)
|
||||
return -1;
|
||||
|
||||
return n;
|
||||
gint retval;
|
||||
gsize nwritten;
|
||||
gint n_ucs4;
|
||||
gunichar *ucs4;
|
||||
const gchar *charset;
|
||||
|
||||
g_get_charset (&charset);
|
||||
ucs4 = g_convert (src, -1, "UCS-4LE", charset, NULL, &nwritten, NULL);
|
||||
n_ucs4 = nwritten * sizeof (GdkWChar);
|
||||
|
||||
retval = MIN (dest_max, n_ucs4);
|
||||
memmove (dest, ucs4, retval * sizeof (GdkWChar));
|
||||
g_free (ucs4);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
+125
-49
@@ -77,6 +77,16 @@ static GdkWindow *wintab_window;
|
||||
|
||||
#endif /* HAVE_WINTAB */
|
||||
|
||||
#ifdef HAVE_SOME_XINPUT
|
||||
|
||||
static GdkWindow *x_grab_window = NULL; /* Window that currently holds
|
||||
* the extended inputs grab
|
||||
*/
|
||||
static GdkEventMask x_grab_mask;
|
||||
static gboolean x_grab_owner_events;
|
||||
|
||||
#endif /* HAVE_SOME_XINPUT */
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
|
||||
static GdkDevicePrivate *
|
||||
@@ -109,7 +119,6 @@ print_lc(LOGCONTEXT *lc)
|
||||
if (lc->lcOptions & CXO_MARGIN) g_print (" CXO_MARGIN");
|
||||
if (lc->lcOptions & CXO_MGNINSIDE) g_print (" CXO_MGNINSIDE");
|
||||
if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES");
|
||||
if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES");
|
||||
g_print ("\n");
|
||||
g_print ("lcStatus =");
|
||||
if (lc->lcStatus & CXS_DISABLED) g_print (" CXS_DISABLED");
|
||||
@@ -346,6 +355,20 @@ gdk_input_wintab_init (void)
|
||||
GDK_NOTE (INPUT, (g_print("context for device %d after WTOpen:\n", devix),
|
||||
print_lc(&lc)));
|
||||
#endif
|
||||
/* Increase packet queue size to reduce the risk of lost packets */
|
||||
/* According to the specs, if the function fails we must try again */
|
||||
/* with a smaller queue size */
|
||||
GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n"));
|
||||
for (i = 128; i >= 1; i >>= 1)
|
||||
{
|
||||
if (WTQueueSizeSet(*hctx, i))
|
||||
{
|
||||
GDK_NOTE (INPUT, g_print("Queue size set to %d\n", i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!i)
|
||||
GDK_NOTE (INPUT, g_print("Whoops, no queue size could be set\n"));
|
||||
for (cursorix = firstcsr; cursorix < firstcsr + ncsrtypes; cursorix++)
|
||||
{
|
||||
active = FALSE;
|
||||
@@ -399,7 +422,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = axis_x.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_X;
|
||||
gdkdev->info.axes[k].min = axis_x.axMin;
|
||||
gdkdev->info.axes[k].min = axis_x.axMax;
|
||||
gdkdev->info.axes[k].max = axis_x.axMax;
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_Y)
|
||||
@@ -412,7 +435,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = axis_y.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_Y;
|
||||
gdkdev->info.axes[k].min = axis_y.axMin;
|
||||
gdkdev->info.axes[k].min = axis_y.axMax;
|
||||
gdkdev->info.axes[k].max = axis_y.axMax;
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_NORMAL_PRESSURE)
|
||||
@@ -424,8 +447,9 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].xmax_value =
|
||||
gdkdev->axes[k].max_value = axis_npressure.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_PRESSURE;
|
||||
gdkdev->info.axes[k].min = axis_npressure.axMin;
|
||||
gdkdev->info.axes[k].min = axis_npressure.axMax;
|
||||
/* GIMP seems to expect values in the range 0-1 */
|
||||
gdkdev->info.axes[k].min = 0.0; /*axis_npressure.axMin;*/
|
||||
gdkdev->info.axes[k].max = 1.0; /*axis_npressure.axMax;*/
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_ORIENTATION)
|
||||
@@ -447,7 +471,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = 1000;
|
||||
gdkdev->info.axes[k].use = axis;
|
||||
gdkdev->info.axes[k].min = -1000;
|
||||
gdkdev->info.axes[k].min = 1000;
|
||||
gdkdev->info.axes[k].max = 1000;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
@@ -670,6 +694,31 @@ _gdk_input_enter_event (GdkWindow *window)
|
||||
input_window->root_y = root_y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currently active keyboard modifiers (ignoring the mouse buttons)
|
||||
* We could use gdk_window_get_pointer but that function does a lot of other
|
||||
* expensive things besides getting the modifiers. This code is somewhat based
|
||||
* on build_pointer_event_state from gdkevents-win32.c
|
||||
*/
|
||||
static guint
|
||||
get_modifier_key_state (void)
|
||||
{
|
||||
guint state;
|
||||
|
||||
state = 0;
|
||||
/* High-order bit is up/down, low order bit is toggled/untoggled */
|
||||
if (GetKeyState (VK_CONTROL) < 0)
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (GetKeyState (VK_SHIFT) < 0)
|
||||
state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
state |= GDK_LOCK_MASK;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_input_other_event (GdkEvent *event,
|
||||
MSG *msg,
|
||||
@@ -680,11 +729,11 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
GdkWindow *current_window;
|
||||
#endif
|
||||
GdkDisplay *display;
|
||||
GdkWindowObject *obj;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *obj, *grab_obj;
|
||||
GdkInputWindow *input_window;
|
||||
GdkDevicePrivate *gdkdev = NULL;
|
||||
GdkEventMask masktest;
|
||||
guint key_state;
|
||||
POINT pt;
|
||||
|
||||
PACKET packet;
|
||||
@@ -727,12 +776,11 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
}
|
||||
|
||||
obj = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
|
||||
|
||||
switch (msg->message)
|
||||
{
|
||||
case WT_PACKET:
|
||||
if (window == _gdk_parent_root)
|
||||
if (window == _gdk_parent_root && x_grab_window == NULL)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...is root\n"));
|
||||
return FALSE;
|
||||
@@ -791,17 +839,46 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK;
|
||||
}
|
||||
|
||||
/* See if input is grabbed */
|
||||
/* FIXME: x_grab_owner_events should probably be handled somehow */
|
||||
if (x_grab_window != NULL)
|
||||
{
|
||||
grab_obj = GDK_WINDOW_OBJECT (x_grab_window);
|
||||
if (!GDK_WINDOW_IMPL_WIN32 (grab_obj->impl)->extension_events_selected
|
||||
|| !(grab_obj->extension_events & masktest)
|
||||
|| !(x_grab_mask && masktest))
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("...grabber doesn't want it\n"));
|
||||
return FALSE;
|
||||
}
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...to grabber\n"));
|
||||
|
||||
g_object_ref(x_grab_window);
|
||||
g_object_unref(window);
|
||||
window = x_grab_window;
|
||||
obj = grab_obj;
|
||||
}
|
||||
/* Now we can check if the window wants the event, and
|
||||
* propagate if necessary.
|
||||
*/
|
||||
dijkstra:
|
||||
if (!impl->extension_events_selected
|
||||
if (!GDK_WINDOW_IMPL_WIN32 (obj->impl)->extension_events_selected
|
||||
|| !(obj->extension_events & masktest))
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...not selected\n"));
|
||||
|
||||
if (obj->parent == GDK_WINDOW_OBJECT (_gdk_parent_root))
|
||||
return FALSE;
|
||||
|
||||
/* It is not good to propagate the extended events up to the parent
|
||||
* if this window wants normal (not extended) motion/button events */
|
||||
if (obj->event_mask & masktest)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("...wants ordinary event, ignoring this\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
@@ -827,7 +904,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
|
||||
event->any.window = window;
|
||||
|
||||
key_state = get_modifier_key_state ();
|
||||
if (event->any.type == GDK_BUTTON_PRESS
|
||||
|| event->any.type == GDK_BUTTON_RELEASE)
|
||||
{
|
||||
@@ -841,6 +918,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
#endif
|
||||
#endif
|
||||
event->button.axes = g_new(gdouble, gdkdev->info.num_axes);
|
||||
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
event->button.axes,
|
||||
@@ -850,7 +929,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->button.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB button %s:%d %g,%g\n",
|
||||
(event->button.type == GDK_BUTTON_PRESS ?
|
||||
@@ -864,6 +944,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.device = &gdkdev->info;
|
||||
|
||||
event->motion.axes = g_new(gdouble, gdkdev->info.num_axes);
|
||||
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
event->motion.axes,
|
||||
@@ -873,7 +955,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->motion.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB motion: %g,%g\n",
|
||||
@@ -885,7 +968,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
*/
|
||||
if ((gdkdev->pktdata & PK_NORMAL_PRESSURE
|
||||
&& (event->motion.state & GDK_BUTTON1_MASK)
|
||||
&& packet.pkNormalPressure <= MAX (0, gdkdev->npbtnmarks[0] - 2))
|
||||
&& packet.pkNormalPressure <= MAX (0, (gint) gdkdev->npbtnmarks[0] - 2))
|
||||
|| (gdkdev->pktdata & PK_NORMAL_PRESSURE
|
||||
&& !(event->motion.state & GDK_BUTTON1_MASK)
|
||||
&& packet.pkNormalPressure > gdkdev->npbtnmarks[1] + 2))
|
||||
@@ -904,7 +987,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event2->button.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
event2->button.button = 1;
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB synthesized button %s: %d %g,%gg\n",
|
||||
@@ -1008,6 +1092,11 @@ _gdk_input_grab_pointer (GdkWindow *window,
|
||||
if (new_window)
|
||||
{
|
||||
new_window->grabbed = TRUE;
|
||||
x_grab_window = window;
|
||||
x_grab_mask = event_mask;
|
||||
x_grab_owner_events = owner_events;
|
||||
|
||||
/* FIXME: Do we need to handle confine_to and time? */
|
||||
|
||||
tmp_list = _gdk_input_devices;
|
||||
while (tmp_list)
|
||||
@@ -1037,6 +1126,7 @@ _gdk_input_grab_pointer (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
x_grab_window = NULL;
|
||||
tmp_list = _gdk_input_devices;
|
||||
while (tmp_list)
|
||||
{
|
||||
@@ -1094,6 +1184,7 @@ _gdk_input_ungrab_pointer (guint32 time)
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
x_grab_window = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1134,42 +1225,27 @@ gdk_device_get_state (GdkDevice *device,
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GdkInputWindow *input_window;
|
||||
|
||||
if (mask)
|
||||
gdk_window_get_pointer (window, NULL, NULL, mask);
|
||||
|
||||
gdkdev = (GdkDevicePrivate *)device;
|
||||
/* For now just use the last known button and axis state of the device.
|
||||
* Since graphical tablets send an insane amount of motion events each
|
||||
* second, the info should be fairly up to date */
|
||||
if (mask)
|
||||
{
|
||||
gdk_window_get_pointer (window, NULL, NULL, mask);
|
||||
*mask &= 0xFF; /* Mask away core pointer buttons */
|
||||
*mask |= ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
}
|
||||
input_window = _gdk_input_window_find (window);
|
||||
g_return_if_fail (input_window != NULL);
|
||||
|
||||
#if 0 /* FIXME */
|
||||
state = XQueryDeviceState (gdk_display, gdkdev->xdevice);
|
||||
input_class = state->data;
|
||||
for (i = 0; i < state->num_classes; i++)
|
||||
{
|
||||
switch (input_class->class)
|
||||
{
|
||||
case ValuatorClass:
|
||||
if (axes)
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
axes, NULL, NULL);
|
||||
break;
|
||||
|
||||
case ButtonClass:
|
||||
if (mask)
|
||||
{
|
||||
*mask &= 0xFF;
|
||||
if (((XButtonState *)input_class)->num_buttons > 0)
|
||||
*mask |= ((XButtonState *)input_class)->buttons[0] << 7;
|
||||
/* GDK_BUTTON1_MASK = 1 << 8, and button n is stored
|
||||
* in bit 1<<(n%8) in byte n/8. n = 1,2,... */
|
||||
}
|
||||
break;
|
||||
}
|
||||
input_class = (XInputClass *)(((char *)input_class)+input_class->length);
|
||||
}
|
||||
XFreeDeviceState (state);
|
||||
#endif
|
||||
/* For some reason, input_window is sometimes NULL when I use The GIMP 2
|
||||
* (bug #141543?). Avoid crashing if debugging is disabled. */
|
||||
if (axes && gdkdev->last_axis_data && input_window)
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
axes, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@ _gdk_windowing_init (gint *argc,
|
||||
_cf_utf8_string = RegisterClipboardFormat ("UTF8_STRING");
|
||||
|
||||
_utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
|
||||
_compound_text = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
|
||||
_text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
|
||||
_targets = gdk_atom_intern ("TARGETS", FALSE);
|
||||
|
||||
_local_dnd = gdk_atom_intern ("LocalDndSelection", FALSE);
|
||||
_gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
||||
|
||||
@@ -363,24 +363,10 @@ void _gdk_win32_adjust_client_rect (GdkWindow *window,
|
||||
void _gdk_win32_get_adjusted_client_rect (GdkWindow *window,
|
||||
RECT *RECT);
|
||||
|
||||
void _gdk_selection_property_store (GdkWindow *owner,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
guchar *data,
|
||||
gint length);
|
||||
|
||||
void _gdk_selection_property_delete (GdkWindow *);
|
||||
|
||||
void _gdk_dropfiles_store (gchar *data);
|
||||
|
||||
gint _gdk_utf8_to_ucs2 (wchar_t *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max);
|
||||
|
||||
gchar *_gdk_ucs2_to_utf8 (const wchar_t *src,
|
||||
gint src_len);
|
||||
|
||||
void _gdk_wchar_text_handle (GdkFont *font,
|
||||
const wchar_t *wcstr,
|
||||
int wclen,
|
||||
@@ -491,6 +477,7 @@ extern WORD _cf_utf8_string;
|
||||
extern GdkAtom _utf8_string;
|
||||
extern GdkAtom _compound_text;
|
||||
extern GdkAtom _text_uri_list;
|
||||
extern GdkAtom _targets;
|
||||
|
||||
/* DND selections */
|
||||
extern GdkAtom _local_dnd;
|
||||
|
||||
@@ -198,12 +198,10 @@ find_common_locale (const guchar *data,
|
||||
* bytes for each Unicode char should be enough, Windows code pages
|
||||
* are either single- or double-byte.
|
||||
*/
|
||||
*bufp = g_malloc ((nchars+1) * 2);
|
||||
wcs = g_new (wchar_t, nchars+1);
|
||||
*bufp = g_malloc ((nchars+1)*2);
|
||||
|
||||
/* Convert to Windows wide chars into temp buf */
|
||||
_gdk_utf8_to_ucs2 (wcs, data, nelements, nchars);
|
||||
wcs[nchars] = 0;
|
||||
wcs = g_utf8_to_utf16 (data, nelements, NULL, NULL, NULL);
|
||||
|
||||
/* For each code page that is the default for an installed locale: */
|
||||
for (i = 0; i < G_N_ELEMENTS (locales); i++)
|
||||
@@ -254,7 +252,8 @@ gdk_property_change (GdkWindow *window,
|
||||
gchar *prop_name, *type_name;
|
||||
guchar *ucptr, *buf = NULL;
|
||||
wchar_t *wcptr;
|
||||
enum { PLAIN_ASCII, UNICODE_TEXT, SINGLE_LOCALE, RICH_TEXT } method;
|
||||
glong wclen;
|
||||
enum { SYSTEM_CODEPAGE, UNICODE_TEXT, SINGLE_LOCALE, RICH_TEXT } method;
|
||||
gboolean ok = TRUE;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
@@ -279,7 +278,8 @@ gdk_property_change (GdkWindow *window,
|
||||
g_free (type_name)));
|
||||
|
||||
if (property == _gdk_selection_property
|
||||
&& type == GDK_TARGET_STRING
|
||||
&& ((type == GDK_TARGET_STRING && GetACP () == 1252) ||
|
||||
type == _utf8_string)
|
||||
&& format == 8
|
||||
&& mode == GDK_PROP_MODE_REPLACE)
|
||||
{
|
||||
@@ -289,22 +289,31 @@ gdk_property_change (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
if (type == _utf8_string)
|
||||
{
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
}
|
||||
else /* if (type == GDK_TARGET_STRING) */
|
||||
{
|
||||
/* Check that no 0200..0240 chars present, as they
|
||||
* differ between ISO-8859-1 and CP1252.
|
||||
*/
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200 && data[i] < 0240)
|
||||
break;
|
||||
}
|
||||
nchars = g_utf8_strlen (data, nelements);
|
||||
|
||||
if (i == nelements)
|
||||
nchars = nelements;
|
||||
else
|
||||
nchars = g_utf8_strlen (data, nelements);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...nchars:%d\n", nchars));
|
||||
|
||||
if (i == nelements)
|
||||
{
|
||||
/* If only ASCII, use CF_TEXT and the data as such. */
|
||||
method = PLAIN_ASCII;
|
||||
/* If UTF-8 and only ASCII, or if STRING (ISO-8859-1) and
|
||||
* system codepage is CP1252, use CF_TEXT and the data as
|
||||
* such.
|
||||
*/
|
||||
method = SYSTEM_CODEPAGE;
|
||||
size = nelements;
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] == '\n')
|
||||
@@ -314,9 +323,15 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
else if (IS_WIN_NT ())
|
||||
{
|
||||
/* On NT, use CF_UNICODETEXT if any non-ASCII char present */
|
||||
/* On NT, use CF_UNICODETEXT if any non-system codepage char
|
||||
* present.
|
||||
*/
|
||||
method = UNICODE_TEXT;
|
||||
size = (nchars + 1) * 2;
|
||||
|
||||
wcptr = g_utf8_to_utf16 (data, nelements, NULL, &wclen, NULL);
|
||||
|
||||
wclen++; /* Terminating 0 */
|
||||
size = wclen * 2;
|
||||
GDK_NOTE (DND, g_print ("...as Unicode\n"));
|
||||
}
|
||||
else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size))
|
||||
@@ -347,7 +362,7 @@ gdk_property_change (GdkWindow *window,
|
||||
rtf = g_string_append_c (rtf, *p);
|
||||
p++;
|
||||
}
|
||||
else if (*p < 0200)
|
||||
else if (*p < 0200 && *p >= ' ')
|
||||
{
|
||||
rtf = g_string_append_c (rtf, *p);
|
||||
p++;
|
||||
@@ -388,7 +403,7 @@ gdk_property_change (GdkWindow *window,
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case PLAIN_ASCII:
|
||||
case SYSTEM_CODEPAGE:
|
||||
cf = CF_TEXT;
|
||||
for (i = 0; i < nelements; i++)
|
||||
{
|
||||
@@ -401,10 +416,8 @@ gdk_property_change (GdkWindow *window,
|
||||
|
||||
case UNICODE_TEXT:
|
||||
cf = CF_UNICODETEXT;
|
||||
wcptr = (wchar_t *) ucptr;
|
||||
if (_gdk_utf8_to_ucs2 (wcptr, data, nelements, nchars) == -1)
|
||||
g_warning ("_gdk_utf8_to_ucs2() failed");
|
||||
wcptr[nchars] = 0;
|
||||
memmove (ucptr, wcptr, size);
|
||||
g_free (wcptr);
|
||||
break;
|
||||
|
||||
case SINGLE_LOCALE:
|
||||
|
||||
+230
-226
@@ -41,7 +41,7 @@
|
||||
|
||||
typedef struct {
|
||||
guchar *data;
|
||||
gint length;
|
||||
gsize length;
|
||||
gint format;
|
||||
GdkAtom type;
|
||||
} GdkSelProp;
|
||||
@@ -62,7 +62,73 @@ _gdk_win32_selection_init (void)
|
||||
sel_owner_table = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
/* The specifications for COMPOUND_TEXT and STRING specify that C0 and
|
||||
* C1 are not allowed except for \n and \t, however the X conversions
|
||||
* routines for COMPOUND_TEXT only enforce this in one direction,
|
||||
* causing cut-and-paste of \r and \r\n separated text to fail.
|
||||
* This routine strips out all non-allowed C0 and C1 characters
|
||||
* from the input string and also canonicalizes \r, and \r\n to \n
|
||||
*/
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src,
|
||||
gint length)
|
||||
{
|
||||
GString *result = g_string_sized_new (length + 1);
|
||||
const gchar *p = src;
|
||||
const gchar *endp = src + length;
|
||||
|
||||
while (p < endp)
|
||||
{
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch = g_utf8_get_char (p);
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
|
||||
{
|
||||
buflen = g_unichar_to_utf8 (ch, buf);
|
||||
g_string_append_len (result, buf, buflen);
|
||||
}
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
}
|
||||
g_string_append_c (result, '\0');
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
_gdk_utf8_to_string_target_internal (const gchar *str,
|
||||
gint length)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
gchar *tmp_str = sanitize_utf8 (str, length);
|
||||
gchar *result = g_convert_with_fallback (tmp_str, -1,
|
||||
"ISO-8859-1", "UTF-8",
|
||||
NULL, NULL, NULL, &error);
|
||||
if (!result)
|
||||
{
|
||||
g_warning ("Error converting from UTF-8 to STRING: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_free (tmp_str);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_selection_property_store (GdkWindow *owner,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
@@ -78,8 +144,27 @@ _gdk_selection_property_store (GdkWindow *owner,
|
||||
g_hash_table_remove (sel_prop_table, GDK_WINDOW_HWND (owner));
|
||||
}
|
||||
prop = g_new (GdkSelProp, 1);
|
||||
prop->data = data;
|
||||
prop->length = length;
|
||||
|
||||
if (type == GDK_TARGET_STRING)
|
||||
{
|
||||
/* We know that data is UTF-8 */
|
||||
prop->data = _gdk_utf8_to_string_target_internal (data, length);
|
||||
g_free (data);
|
||||
|
||||
if (!prop->data)
|
||||
{
|
||||
g_free (prop);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
prop->length = strlen (prop->data + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
prop->data = data;
|
||||
prop->length = length;
|
||||
}
|
||||
prop->format = format;
|
||||
prop->type = type;
|
||||
g_hash_table_insert (sel_prop_table, GDK_WINDOW_HWND (owner), prop);
|
||||
@@ -120,7 +205,8 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
GdkEvent tmp_event;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
g_return_val_if_fail (selection != GDK_NONE, FALSE);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
@@ -176,7 +262,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
tmp_event.selection.window = owner;
|
||||
tmp_event.selection.send_event = FALSE;
|
||||
tmp_event.selection.selection = selection;
|
||||
tmp_event.selection.target = GDK_TARGET_STRING;
|
||||
tmp_event.selection.target = _utf8_string;
|
||||
tmp_event.selection.property = _gdk_selection_property;
|
||||
tmp_event.selection.requestor = (guint32) hwnd;
|
||||
tmp_event.selection.time = time;
|
||||
@@ -194,12 +280,13 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
|
||||
GdkWindow *window;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
g_return_val_if_fail (selection != GDK_NONE, NULL);
|
||||
|
||||
/* Return NULL for CLIPBOARD, because otherwise cut&paste
|
||||
* inside the same application doesn't work. We must pretend to gtk
|
||||
* that we don't have the selection, so that we always fetch it from
|
||||
* the Windows clipboard. See also comments in
|
||||
/* Return NULL for CLIPBOARD, because otherwise cut&paste inside the
|
||||
* same application doesn't work. We must pretend to gtk that we
|
||||
* don't have the selection, so that we always fetch it from the
|
||||
* Windows clipboard. See also comments in
|
||||
* gdk_selection_send_notify().
|
||||
*/
|
||||
if (selection == GDK_SELECTION_CLIPBOARD)
|
||||
@@ -247,8 +334,11 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
HGLOBAL hdata;
|
||||
GdkAtom property = _gdk_selection_property;
|
||||
gchar *sel_name, *tgt_name;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (selection != GDK_NONE);
|
||||
g_return_if_fail (requestor != NULL);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (requestor))
|
||||
return;
|
||||
|
||||
@@ -262,8 +352,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name)));
|
||||
|
||||
if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
target == gdk_atom_intern ("TARGETS", FALSE))
|
||||
if (selection == GDK_SELECTION_CLIPBOARD && target == _targets)
|
||||
{
|
||||
/* He wants to know what formats are on the clipboard. If there
|
||||
* is some kind of text, tell him so.
|
||||
@@ -276,7 +365,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
IsClipboardFormatAvailable (CF_TEXT))
|
||||
{
|
||||
GdkAtom *data = g_new (GdkAtom, 1);
|
||||
*data = GDK_TARGET_STRING;
|
||||
*data = _utf8_string;
|
||||
_gdk_selection_property_store (requestor, GDK_SELECTION_TYPE_ATOM,
|
||||
32, (guchar *) data, 1 * sizeof (GdkAtom));
|
||||
}
|
||||
@@ -286,36 +375,36 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
API_CALL (CloseClipboard, ());
|
||||
}
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
(target == _compound_text ||
|
||||
target == GDK_TARGET_STRING))
|
||||
(target == GDK_TARGET_STRING ||
|
||||
target == _utf8_string))
|
||||
{
|
||||
/* Converting the CLIPBOARD selection means he wants the
|
||||
* contents of the clipboard. Get the clipboard data,
|
||||
* and store it for later.
|
||||
* contents of the clipboard. Get the clipboard data, and store
|
||||
* it for later.
|
||||
*/
|
||||
if (!API_CALL (OpenClipboard, (GDK_WINDOW_HWND (requestor))))
|
||||
return;
|
||||
|
||||
/* Try various formats. First the simplest, CF_UNICODETEXT. */
|
||||
if ((hdata = GetClipboardData (CF_UNICODETEXT)) != NULL)
|
||||
if (IS_WIN_NT () && (hdata = GetClipboardData (CF_UNICODETEXT)) != NULL)
|
||||
{
|
||||
wchar_t *ptr, *wcs, *p, *q;
|
||||
guchar *data;
|
||||
gint length, wclen;
|
||||
glong length, wclen;
|
||||
|
||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...CF_UNICODETEXT: %d bytes\n",
|
||||
GDK_NOTE (DND, g_print ("...CF_UNICODETEXT: %ld bytes\n",
|
||||
length));
|
||||
|
||||
/* Strip out \r */
|
||||
wcs = g_new (wchar_t, (length + 1) * 2);
|
||||
wcs = g_new (wchar_t, length / 2 + 1);
|
||||
p = ptr;
|
||||
q = wcs;
|
||||
wclen = 0;
|
||||
while (*p)
|
||||
while (p < ptr + length / 2)
|
||||
{
|
||||
if (*p != '\r')
|
||||
{
|
||||
@@ -325,11 +414,16 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
p++;
|
||||
}
|
||||
|
||||
data = _gdk_ucs2_to_utf8 (wcs, wclen);
|
||||
data = g_utf16_to_utf8 (wcs, wclen, NULL, NULL, &error);
|
||||
g_free (wcs);
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -347,7 +441,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
length, ptr));
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
g_strdup (ptr), strlen (ptr) + 1);
|
||||
g_memdup (ptr, length), length);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -361,13 +455,13 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
UINT cp = CP_ACP;
|
||||
wchar_t *wcs, *wcs2, *p, *q;
|
||||
guchar *ptr, *data;
|
||||
gint length, wclen;
|
||||
glong length, wclen, wclen2;
|
||||
|
||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...CF_TEXT: %d bytes: %.10s\n",
|
||||
GDK_NOTE (DND, g_print ("...CF_TEXT: %ld bytes: %.10s\n",
|
||||
length, ptr));
|
||||
|
||||
if ((hlcid = GetClipboardData (CF_LOCALE)) != NULL)
|
||||
@@ -385,30 +479,33 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
|
||||
wcs = g_new (wchar_t, length + 1);
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, -1,
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, length,
|
||||
wcs, length + 1);
|
||||
|
||||
/* Strip out \r */
|
||||
wcs2 = g_new (wchar_t, wclen);
|
||||
p = wcs;
|
||||
q = wcs2;
|
||||
wclen = 0;
|
||||
while (*p)
|
||||
wclen2 = 0;
|
||||
while (p < wcs + wclen)
|
||||
{
|
||||
if (*p != '\r')
|
||||
{
|
||||
*q++ = *p;
|
||||
wclen++;
|
||||
wclen2++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
g_free (wcs);
|
||||
|
||||
data = _gdk_ucs2_to_utf8 (wcs2, wclen);
|
||||
data = g_utf16_to_utf8 (wcs2, wclen2, NULL, &length, &error);
|
||||
g_free (wcs2);
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
|
||||
if (!data)
|
||||
g_error_free (error);
|
||||
else
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, length + 1);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -498,16 +595,16 @@ _gdk_selection_property_delete (GdkWindow *window)
|
||||
|
||||
void
|
||||
gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
GdkEvent tmp_event;
|
||||
gchar *sel_name, *tgt_name, *prop_name;
|
||||
|
||||
g_return_if_fail (display == gdk_display_get_default ());
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
@@ -522,12 +619,13 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
g_free (tgt_name),
|
||||
g_free (prop_name)));
|
||||
|
||||
/* Send ourselves a selection clear message so that gtk thinks we don't
|
||||
* have the selection, and will claim it anew when needed, and
|
||||
/* Send ourselves a selection clear message so that gtk thinks we
|
||||
* don't have the selection, and will claim it anew when needed, and
|
||||
* we thus get a chance to store data in the Windows clipboard.
|
||||
* Otherwise, if a gtkeditable does a copy to CLIPBOARD several times
|
||||
* only the first one actually gets copied to the Windows clipboard,
|
||||
* as only the first one causes a call to gdk_property_change().
|
||||
* Otherwise, if a gtkeditable does a copy to CLIPBOARD several
|
||||
* times only the first one actually gets copied to the Windows
|
||||
* clipboard, as only the first one causes a call to
|
||||
* gdk_property_change().
|
||||
*
|
||||
* Hmm, there is something fishy with this. Cut and paste inside the
|
||||
* same app didn't work, the gtkeditable immediately forgot the
|
||||
@@ -548,19 +646,25 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
gdk_event_put (&tmp_event);
|
||||
}
|
||||
|
||||
/* Simplistic implementations of text list and compound text functions */
|
||||
|
||||
/* It's hard to say whether implementing this actually is of any use
|
||||
* on the Win32 platform? gtk calls only
|
||||
* gdk_text_property_to_utf8_list_for_display().
|
||||
*/
|
||||
gint
|
||||
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar *enc_name;
|
||||
gchar *result;
|
||||
const gchar *charset;
|
||||
const gchar *source_charset = NULL;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
GDK_NOTE (DND, (enc_name = gdk_atom_name (encoding),
|
||||
g_print ("gdk_text_property_to_text_list: %s %d %.20s %d\n",
|
||||
@@ -570,8 +674,25 @@ gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
if (!list)
|
||||
return 0;
|
||||
|
||||
if (encoding == GDK_TARGET_STRING)
|
||||
source_charset = "ISO-8859-1";
|
||||
else if (encoding == _utf8_string)
|
||||
source_charset = "UTF-8";
|
||||
else
|
||||
source_charset = gdk_atom_name (encoding);
|
||||
|
||||
g_get_charset (&charset);
|
||||
|
||||
result = g_convert (text, length, charset, source_charset,
|
||||
NULL, NULL, &error);
|
||||
if (!result)
|
||||
{
|
||||
g_error_free (error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*list = g_new (gchar *, 1);
|
||||
**list = g_strdup (text);
|
||||
**list = result;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -585,47 +706,6 @@ gdk_free_text_list (gchar **list)
|
||||
g_free (list);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_string_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
g_return_val_if_fail (str != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_string_to_compound_text: %.20s\n", str));
|
||||
|
||||
if (encoding)
|
||||
*encoding = _compound_text;
|
||||
|
||||
if (format)
|
||||
*format = 8;
|
||||
|
||||
if (ctext)
|
||||
*ctext = g_strdup (str);
|
||||
|
||||
if (length)
|
||||
*length = strlen (str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
g_free (ctext);
|
||||
}
|
||||
|
||||
/* These are lifted from gdkselection-x11.c, just to get GTK+ to build.
|
||||
* These functions probably don't make much sense at all in Windows.
|
||||
*/
|
||||
|
||||
/* FIXME */
|
||||
|
||||
static gint
|
||||
make_list (const gchar *text,
|
||||
gint length,
|
||||
@@ -705,7 +785,7 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
{
|
||||
g_return_val_if_fail (text != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
if (encoding == GDK_TARGET_STRING)
|
||||
{
|
||||
@@ -717,164 +797,88 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar **local_list;
|
||||
gint local_count;
|
||||
gint i;
|
||||
const gchar *charset = NULL;
|
||||
gboolean need_conversion = g_get_charset (&charset);
|
||||
gint count = 0;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Probably COMPOUND text, we fall back to Xlib routines
|
||||
*/
|
||||
local_count = gdk_text_property_to_text_list (encoding,
|
||||
format,
|
||||
text,
|
||||
length,
|
||||
&local_list);
|
||||
if (list)
|
||||
*list = g_new (gchar *, local_count + 1);
|
||||
|
||||
for (i=0; i<local_count; i++)
|
||||
{
|
||||
/* list contains stuff in our default encoding
|
||||
*/
|
||||
if (need_conversion)
|
||||
{
|
||||
gchar *utf = g_convert (local_list[i], -1,
|
||||
"UTF-8", charset,
|
||||
NULL, NULL, &error);
|
||||
if (utf)
|
||||
{
|
||||
if (list)
|
||||
(*list)[count++] = utf;
|
||||
else
|
||||
g_free (utf);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Error converting to UTF-8 from '%s': %s",
|
||||
charset, error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list)
|
||||
(*list)[count++] = g_strdup (local_list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_free_text_list (local_list);
|
||||
(*list)[count] = NULL;
|
||||
g_warning ("gdk_text_property_to_utf8_list_for_display: encoding %s not handled\n", gdk_atom_name (encoding));
|
||||
|
||||
return count;
|
||||
if (list)
|
||||
*list = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* The specifications for COMPOUND_TEXT and STRING specify that C0 and
|
||||
* C1 are not allowed except for \n and \t, however the X conversions
|
||||
* routines for COMPOUND_TEXT only enforce this in one direction,
|
||||
* causing cut-and-paste of \r and \r\n separated text to fail.
|
||||
* This routine strips out all non-allowed C0 and C1 characters
|
||||
* from the input string and also canonicalizes \r, and \r\n to \n
|
||||
*/
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src)
|
||||
gint
|
||||
gdk_string_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
gint len = strlen (src);
|
||||
GString *result = g_string_sized_new (len);
|
||||
const gchar *p = src;
|
||||
g_return_val_if_fail (str != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
GDK_NOTE (DND, g_print ("gdk_string_to_compound_text_for_display: %.20s\n", str));
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch = g_utf8_get_char (p);
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
|
||||
{
|
||||
buflen = g_unichar_to_utf8 (ch, buf);
|
||||
g_string_append_len (result, buf, buflen);
|
||||
}
|
||||
/* Always fail on Win32. No COMPOUND_TEXT support. */
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
}
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
if (format)
|
||||
*format = 0;
|
||||
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_utf8_to_string_target (const gchar *str)
|
||||
{
|
||||
return sanitize_utf8 (str);
|
||||
return _gdk_utf8_to_string_target_internal (str, strlen (str));
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
|
||||
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
gboolean need_conversion;
|
||||
const gchar *charset;
|
||||
gchar *locale_str, *tmp_str;
|
||||
GError *error = NULL;
|
||||
gboolean result;
|
||||
|
||||
g_return_val_if_fail (str != NULL, FALSE);
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
|
||||
need_conversion = !g_get_charset (&charset);
|
||||
GDK_NOTE (DND, g_print ("gdk_utf8_to_compound_text_for_display: %.20s\n", str));
|
||||
|
||||
tmp_str = sanitize_utf8 (str);
|
||||
/* Always fail on Win32. No COMPOUND_TEXT support. */
|
||||
|
||||
if (need_conversion)
|
||||
{
|
||||
locale_str = g_convert_with_fallback (tmp_str, -1,
|
||||
charset, "UTF-8",
|
||||
NULL, NULL, NULL, &error);
|
||||
g_free (tmp_str);
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
|
||||
if (!locale_str)
|
||||
{
|
||||
g_warning ("Error converting from UTF-8 to '%s': %s",
|
||||
charset, error->message);
|
||||
g_error_free (error);
|
||||
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
if (format)
|
||||
*format = GPOINTER_TO_UINT (GDK_ATOM_TO_POINTER (GDK_NONE));
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
locale_str = tmp_str;
|
||||
|
||||
result = gdk_string_to_compound_text (locale_str,
|
||||
encoding, format, ctext, length);
|
||||
if (format)
|
||||
*format = 0;
|
||||
|
||||
g_free (locale_str);
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
|
||||
return result;
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
/* As we never generate anything claimed to be COMPOUND_TEXT, this
|
||||
* should never be called. Or if it is called, ctext should be the
|
||||
* NULL returned for conversions to COMPOUND_TEXT above.
|
||||
*/
|
||||
g_return_if_fail (ctext == NULL);
|
||||
}
|
||||
|
||||
+23
-15
@@ -305,16 +305,14 @@ gdk_cursor_get_display (GdkCursor *cursor)
|
||||
#ifdef HAVE_XCURSOR
|
||||
|
||||
static XcursorImage*
|
||||
create_cursor_image (GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
create_cursor_image (GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
guint width, height, rowstride, n_channels;
|
||||
guchar *pixels, *src;
|
||||
XcursorImage *xcimage;
|
||||
XcursorPixel *dest;
|
||||
guchar a;
|
||||
gint i, j;
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf);
|
||||
height = gdk_pixbuf_get_height (pixbuf);
|
||||
@@ -324,27 +322,37 @@ create_cursor_image (GdkPixbuf *pixbuf,
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
|
||||
xcimage = XcursorImageCreate (width, height);
|
||||
|
||||
|
||||
xcimage->xhot = x;
|
||||
xcimage->yhot = y;
|
||||
|
||||
dest = xcimage->pixels;
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
if (n_channels == 3)
|
||||
{
|
||||
src = pixels + j * rowstride;
|
||||
for (i = 0; i < width; i++)
|
||||
{
|
||||
if (n_channels == 3)
|
||||
a = 0xff;
|
||||
else
|
||||
a = src[3];
|
||||
|
||||
*dest = (a << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
gint i, j;
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
src = pixels + j * rowstride;
|
||||
for (i = 0; i < width; i++)
|
||||
{
|
||||
*dest = (0xff << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
}
|
||||
|
||||
src += n_channels;
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_x11_convert_to_format (pixels, rowstride,
|
||||
(guchar *) dest, 4 * width,
|
||||
GDK_X11_FORMAT_ARGB,
|
||||
(G_BYTE_ORDER == G_BIG_ENDIAN) ?
|
||||
GDK_MSB_FIRST : GDK_LSB_FIRST,
|
||||
width, height);
|
||||
}
|
||||
|
||||
return xcimage;
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
|
||||
}
|
||||
}
|
||||
|
||||
char*
|
||||
static char*
|
||||
escape_for_xmessage (const char *str)
|
||||
{
|
||||
GString *retval;
|
||||
|
||||
@@ -2193,7 +2193,10 @@ xdnd_send_xevent (GdkDragContext *context,
|
||||
temp_event.any.window = window;
|
||||
|
||||
if ((*xdnd_filters[i].func) (event_send, &temp_event, NULL) == GDK_FILTER_TRANSLATE)
|
||||
gdk_event_put (&temp_event);
|
||||
{
|
||||
gdk_event_put (&temp_event);
|
||||
g_object_unref (temp_event.dnd.context);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+31
-37
@@ -921,14 +921,8 @@ gdk_x11_drawable_get_xid (GdkDrawable *drawable)
|
||||
* what's the fastest depending on the available picture formats,
|
||||
* whether we can used shared pixmaps, etc.
|
||||
*/
|
||||
typedef enum {
|
||||
FORMAT_NONE,
|
||||
FORMAT_EXACT_MASK,
|
||||
FORMAT_ARGB_MASK,
|
||||
FORMAT_ARGB
|
||||
} FormatType;
|
||||
|
||||
static FormatType
|
||||
static GdkX11FormatType
|
||||
select_format (GdkDisplay *display,
|
||||
XRenderPictFormat **format,
|
||||
XRenderPictFormat **mask)
|
||||
@@ -937,7 +931,7 @@ select_format (GdkDisplay *display,
|
||||
XRenderPictFormat pf;
|
||||
|
||||
if (!_gdk_x11_have_render (display))
|
||||
return FORMAT_NONE;
|
||||
return GDK_X11_FORMAT_NONE;
|
||||
|
||||
/* Look for a 32-bit xRGB and Axxx formats that exactly match the
|
||||
* in memory data format. We can use them as pixmap and mask
|
||||
@@ -993,7 +987,7 @@ select_format (GdkDisplay *display,
|
||||
0);
|
||||
|
||||
if (*format && *mask)
|
||||
return FORMAT_EXACT_MASK;
|
||||
return GDK_X11_FORMAT_EXACT_MASK;
|
||||
|
||||
/* OK, that failed, now look for xRGB and Axxx formats in
|
||||
* RENDER's preferred order
|
||||
@@ -1023,7 +1017,7 @@ select_format (GdkDisplay *display,
|
||||
0);
|
||||
|
||||
if (*format && *mask)
|
||||
return FORMAT_ARGB_MASK;
|
||||
return GDK_X11_FORMAT_ARGB_MASK;
|
||||
|
||||
/* Finally, if neither of the above worked, fall back to
|
||||
* looking for combined ARGB -- we'll premultiply ourselves.
|
||||
@@ -1048,9 +1042,9 @@ select_format (GdkDisplay *display,
|
||||
*mask = NULL;
|
||||
|
||||
if (*format)
|
||||
return FORMAT_ARGB;
|
||||
return GDK_X11_FORMAT_ARGB;
|
||||
|
||||
return FORMAT_NONE;
|
||||
return GDK_X11_FORMAT_NONE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1081,15 +1075,15 @@ list_formats (XRenderPictFormat *pf)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height)
|
||||
void
|
||||
_gdk_x11_convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
GdkX11FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
gint i;
|
||||
|
||||
@@ -1097,14 +1091,14 @@ convert_to_format (guchar *src_buf,
|
||||
{
|
||||
switch (dest_format)
|
||||
{
|
||||
case FORMAT_EXACT_MASK:
|
||||
case GDK_X11_FORMAT_EXACT_MASK:
|
||||
{
|
||||
memcpy (dest_buf + i * dest_rowstride,
|
||||
src_buf + i * src_rowstride,
|
||||
width * 4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_ARGB_MASK:
|
||||
case GDK_X11_FORMAT_ARGB_MASK:
|
||||
{
|
||||
guchar *row = src_buf + i * src_rowstride;
|
||||
if (((gsize)row & 3) != 0)
|
||||
@@ -1182,7 +1176,7 @@ convert_to_format (guchar *src_buf,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FORMAT_ARGB:
|
||||
case GDK_X11_FORMAT_ARGB:
|
||||
{
|
||||
guchar *p = (src_buf + i * src_rowstride);
|
||||
guchar *q = (dest_buf + i * dest_rowstride);
|
||||
@@ -1218,7 +1212,7 @@ convert_to_format (guchar *src_buf,
|
||||
#undef MULT
|
||||
break;
|
||||
}
|
||||
case FORMAT_NONE:
|
||||
case GDK_X11_FORMAT_NONE:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
@@ -1228,7 +1222,7 @@ convert_to_format (guchar *src_buf,
|
||||
static void
|
||||
draw_with_images (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
FormatType format_type,
|
||||
GdkX11FormatType format_type,
|
||||
XRenderPictFormat *format,
|
||||
XRenderPictFormat *mask_format,
|
||||
guchar *src_rgb,
|
||||
@@ -1273,10 +1267,10 @@ draw_with_images (GdkDrawable *drawable,
|
||||
|
||||
image = _gdk_image_get_scratch (screen, width1, height1, 32, &xs0, &ys0);
|
||||
|
||||
convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
_gdk_x11_convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
|
||||
gdk_draw_image (pix, pix_gc,
|
||||
image, xs0, ys0, x0, y0, width1, height1);
|
||||
@@ -1352,7 +1346,7 @@ get_shm_pixmap_for_image (Display *xdisplay,
|
||||
static gboolean
|
||||
draw_with_pixmaps (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
FormatType format_type,
|
||||
GdkX11FormatType format_type,
|
||||
XRenderPictFormat *format,
|
||||
XRenderPictFormat *mask_format,
|
||||
guchar *src_rgb,
|
||||
@@ -1386,10 +1380,10 @@ draw_with_pixmaps (GdkDrawable *drawable,
|
||||
if (!get_shm_pixmap_for_image (xdisplay, image, format, mask_format, &pix, &pict, &mask))
|
||||
return FALSE;
|
||||
|
||||
convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
_gdk_x11_convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
|
||||
XRenderComposite (xdisplay, PictOpOver, pict, mask, dest_pict,
|
||||
xs0, ys0, xs0, ys0, x0 + dest_x, y0 + dest_y,
|
||||
@@ -1415,7 +1409,7 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
|
||||
gint x_dither,
|
||||
gint y_dither)
|
||||
{
|
||||
FormatType format_type;
|
||||
GdkX11FormatType format_type;
|
||||
XRenderPictFormat *format, *mask_format;
|
||||
gint rowstride;
|
||||
#ifdef USE_SHM
|
||||
@@ -1425,7 +1419,7 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
|
||||
format_type = select_format (gdk_drawable_get_display (drawable),
|
||||
&format, &mask_format);
|
||||
|
||||
if (format_type == FORMAT_NONE ||
|
||||
if (format_type == GDK_X11_FORMAT_NONE ||
|
||||
!gdk_pixbuf_get_has_alpha (pixbuf) ||
|
||||
gdk_drawable_get_depth (drawable) == 1 ||
|
||||
(dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24) ||
|
||||
|
||||
@@ -41,6 +41,14 @@ extern "C" {
|
||||
/* Drawable implementation for X11
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_X11_FORMAT_NONE,
|
||||
GDK_X11_FORMAT_EXACT_MASK,
|
||||
GDK_X11_FORMAT_ARGB_MASK,
|
||||
GDK_X11_FORMAT_ARGB
|
||||
} GdkX11FormatType;
|
||||
|
||||
typedef struct _GdkDrawableImplX11 GdkDrawableImplX11;
|
||||
typedef struct _GdkDrawableImplX11Class GdkDrawableImplX11Class;
|
||||
|
||||
@@ -73,6 +81,15 @@ struct _GdkDrawableImplX11Class
|
||||
|
||||
GType _gdk_drawable_impl_x11_get_type (void);
|
||||
|
||||
void _gdk_x11_convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
GdkX11FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -783,14 +783,14 @@ get_real_window (GdkDisplay *display,
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const char notify_modes[][18] = {
|
||||
static const char notify_modes[][19] = {
|
||||
"NotifyNormal",
|
||||
"NotifyGrab",
|
||||
"NotifyUngrab",
|
||||
"NotifyWhileGrabbed"
|
||||
};
|
||||
|
||||
static const char notify_details[][22] = {
|
||||
static const char notify_details[][23] = {
|
||||
"NotifyAncestor",
|
||||
"NotifyVirtual",
|
||||
"NotifyInferior",
|
||||
|
||||
@@ -866,7 +866,7 @@ gdk_window_postmove (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
expose_serial_predicate (Display *xdisplay,
|
||||
XEvent *xev,
|
||||
XPointer arg)
|
||||
|
||||
+22
-8
@@ -206,12 +206,26 @@ gdk_keymap_get_for_display (GdkDisplay *display)
|
||||
}
|
||||
|
||||
/* Find the index of the group/level pair within the keysyms for a key.
|
||||
* We round up the number of keysyms per keycode to the next even number,
|
||||
* otherwise we lose a whole group of keys
|
||||
*/
|
||||
#define KEYSYM_INDEX(keymap_impl, group, level) \
|
||||
(2 * ((group) % (keymap_impl->keysyms_per_keycode / 2)) + (level))
|
||||
(2 * ((group) % (int)((keymap_impl->keysyms_per_keycode + 1) / 2)) + (level))
|
||||
#define KEYSYM_IS_KEYPAD(s) (((s) >= 0xff80 && (s) <= 0xffbd) || \
|
||||
((s) >= 0x11000000 && (s) <= 0x1100ffff))
|
||||
|
||||
static int
|
||||
get_symbol (const KeySym *syms, GdkKeymapX11 *keymap_x11, int group, int level)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = KEYSYM_INDEX(keymap_x11, group, level);
|
||||
if (index > keymap_x11->keysyms_per_keycode)
|
||||
return NoSymbol;
|
||||
|
||||
return syms[index];
|
||||
}
|
||||
|
||||
static void
|
||||
update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
{
|
||||
@@ -256,7 +270,7 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
/* Check both groups */
|
||||
for (i = 0 ; i < 2 ; i++)
|
||||
{
|
||||
if (syms[KEYSYM_INDEX (keymap_x11, i, 0)] == GDK_Tab)
|
||||
if (get_symbol (syms, keymap_x11, i, 0) == GDK_Tab)
|
||||
syms[KEYSYM_INDEX (keymap_x11, i, 1)] = GDK_ISO_Left_Tab;
|
||||
}
|
||||
|
||||
@@ -264,12 +278,12 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
* If there is one keysym and the key symbol has upper and lower
|
||||
* case variants fudge the keymap
|
||||
*/
|
||||
if (syms[KEYSYM_INDEX (keymap_x11, 0, 1)] == 0)
|
||||
if (get_symbol (syms, keymap_x11, 0, 1) == 0)
|
||||
{
|
||||
guint lower;
|
||||
guint upper;
|
||||
|
||||
gdk_keyval_convert_case (syms[KEYSYM_INDEX (keymap_x11, 0, 0)], &lower, &upper);
|
||||
gdk_keyval_convert_case (get_symbol (syms, keymap_x11, 0, 0), &lower, &upper);
|
||||
if (lower != upper)
|
||||
{
|
||||
syms[KEYSYM_INDEX (keymap_x11, 0, 0)] = lower;
|
||||
@@ -380,9 +394,9 @@ get_keymap (GdkKeymapX11 *keymap_x11)
|
||||
|
||||
#define GET_EFFECTIVE_KEYMAP(keymap) get_effective_keymap ((keymap), G_STRFUNC)
|
||||
|
||||
GdkKeymap *
|
||||
static GdkKeymap *
|
||||
get_effective_keymap (GdkKeymap *keymap,
|
||||
const char *function)
|
||||
const char *function)
|
||||
{
|
||||
if (!keymap)
|
||||
{
|
||||
@@ -845,7 +859,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
{
|
||||
const KeySym *map = get_keymap (keymap_x11);
|
||||
const KeySym *syms = map + (key->keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
|
||||
return syms [KEYSYM_INDEX (keymap_x11, key->group, key->level)];
|
||||
return get_symbol (syms, keymap_x11, key->group, key->level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -995,7 +1009,7 @@ translate_keysym (GdkKeymapX11 *keymap_x11,
|
||||
const KeySym *map = get_keymap (keymap_x11);
|
||||
const KeySym *syms = map + (hardware_keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
|
||||
|
||||
#define SYM(k,g,l) syms[KEYSYM_INDEX (k,g,l)]
|
||||
#define SYM(k,g,l) get_symbol (syms, k,g,l)
|
||||
|
||||
GdkModifierType shift_modifiers;
|
||||
gint shift_level;
|
||||
|
||||
+18
-3
@@ -1099,6 +1099,20 @@ set_initial_hints (GdkWindow *window)
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_ABOVE)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_ABOVE");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_BELOW)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_BELOW");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_STICKY)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
@@ -3335,6 +3349,7 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayX11 *display_x11;
|
||||
glong timestamp_long = (glong)timestamp;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -3348,10 +3363,10 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
(guchar *)×tamp, 1);
|
||||
(guchar *)×tamp_long, 1);
|
||||
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
display_x11->user_time = timestamp;
|
||||
if (timestamp_long != GDK_CURRENT_TIME)
|
||||
display_x11->user_time = timestamp_long;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+80
-79
@@ -79,7 +79,8 @@ get_unescaped_char (const char **str,
|
||||
static gboolean
|
||||
gtk_fnmatch_intern (const char *pattern,
|
||||
const char *string,
|
||||
gboolean component_start)
|
||||
gboolean component_start,
|
||||
gboolean no_leading_period)
|
||||
{
|
||||
const char *p = pattern, *n = string;
|
||||
|
||||
@@ -97,7 +98,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
return FALSE;
|
||||
else if (nc == G_DIR_SEPARATOR)
|
||||
return FALSE;
|
||||
else if (nc == '.' && component_start)
|
||||
else if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
break;
|
||||
case '\\':
|
||||
@@ -107,7 +108,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
return FALSE;
|
||||
break;
|
||||
case '*':
|
||||
if (nc == '.' && component_start)
|
||||
if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
|
||||
{
|
||||
@@ -148,7 +149,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
for (p = last_p; nc != '\0';)
|
||||
{
|
||||
if ((c == '[' || nc == c) &&
|
||||
gtk_fnmatch_intern (p, last_n, component_start))
|
||||
gtk_fnmatch_intern (p, last_n, component_start, no_leading_period))
|
||||
return TRUE;
|
||||
|
||||
component_start = (nc == G_DIR_SEPARATOR);
|
||||
@@ -168,7 +169,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
if (nc == '\0' || nc == G_DIR_SEPARATOR)
|
||||
return FALSE;
|
||||
|
||||
if (nc == '.' && component_start)
|
||||
if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
|
||||
not = (*p == '!' || *p == '^');
|
||||
@@ -245,116 +246,116 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
*
|
||||
* FNM_FILE_NAME - always set
|
||||
* FNM_LEADING_DIR - never set
|
||||
* FNM_PERIOD - always set
|
||||
* FNM_NOESCAPE - set only on windows
|
||||
* FNM_CASEFOLD - set only on windows
|
||||
*/
|
||||
gboolean
|
||||
_gtk_fnmatch (const char *pattern,
|
||||
const char *string)
|
||||
const char *string,
|
||||
gboolean no_leading_period)
|
||||
{
|
||||
return gtk_fnmatch_intern (pattern, string, TRUE);
|
||||
return gtk_fnmatch_intern (pattern, string, TRUE, no_leading_period);
|
||||
}
|
||||
|
||||
#undef FNMATCH_TEST_CASES
|
||||
#ifdef FNMATCH_TEST_CASES
|
||||
|
||||
#define TEST(pat, str, result) \
|
||||
g_assert (_gtk_fnmatch ((pat), (str)) == result)
|
||||
#define TEST(pat, str, no_leading_period, result) \
|
||||
g_assert (_gtk_fnmatch ((pat), (str), (no_leading_period)) == result)
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
TEST ("[a-]", "-", TRUE);
|
||||
TEST ("[a-]", "-", TRUE, TRUE);
|
||||
|
||||
TEST ("a", "a", TRUE);
|
||||
TEST ("a", "b", FALSE);
|
||||
TEST ("a", "a", TRUE, TRUE);
|
||||
TEST ("a", "b", TRUE, FALSE);
|
||||
|
||||
/* Test what ? matches */
|
||||
TEST ("?", "a", TRUE);
|
||||
TEST ("?", ".", FALSE);
|
||||
TEST ("a?", "a.", TRUE);
|
||||
TEST ("a/?", "a/b", TRUE);
|
||||
TEST ("a/?", "a/.", FALSE);
|
||||
TEST ("?", "/", FALSE);
|
||||
TEST ("?", "a", TRUE, TRUE);
|
||||
TEST ("?", ".", TRUE, FALSE);
|
||||
TEST ("a?", "a.", TRUE, TRUE);
|
||||
TEST ("a/?", "a/b", TRUE, TRUE);
|
||||
TEST ("a/?", "a/.", TRUE, FALSE);
|
||||
TEST ("?", "/", TRUE, FALSE);
|
||||
|
||||
/* Test what * matches */
|
||||
TEST ("*", "a", TRUE);
|
||||
TEST ("*", ".", FALSE);
|
||||
TEST ("a*", "a.", TRUE);
|
||||
TEST ("a/*", "a/b", TRUE);
|
||||
TEST ("a/*", "a/.", FALSE);
|
||||
TEST ("*", "/", FALSE);
|
||||
TEST ("*", "a", TRUE, TRUE);
|
||||
TEST ("*", ".", TRUE, FALSE);
|
||||
TEST ("a*", "a.", TRUE, TRUE);
|
||||
TEST ("a/*", "a/b", TRUE, TRUE);
|
||||
TEST ("a/*", "a/.", TRUE, FALSE);
|
||||
TEST ("*", "/", TRUE, FALSE);
|
||||
|
||||
/* Range tests */
|
||||
TEST ("[ab]", "a", TRUE);
|
||||
TEST ("[ab]", "c", FALSE);
|
||||
TEST ("[^ab]", "a", FALSE);
|
||||
TEST ("[!ab]", "a", FALSE);
|
||||
TEST ("[^ab]", "c", TRUE);
|
||||
TEST ("[!ab]", "c", TRUE);
|
||||
TEST ("[a-c]", "b", TRUE);
|
||||
TEST ("[a-c]", "d", FALSE);
|
||||
TEST ("[a-]", "-", TRUE);
|
||||
TEST ("[]]", "]", TRUE);
|
||||
TEST ("[^]]", "a", TRUE);
|
||||
TEST ("[!]]", "a", TRUE);
|
||||
TEST ("[ab]", "a", TRUE, TRUE);
|
||||
TEST ("[ab]", "c", TRUE, FALSE);
|
||||
TEST ("[^ab]", "a", TRUE, FALSE);
|
||||
TEST ("[!ab]", "a", TRUE, FALSE);
|
||||
TEST ("[^ab]", "c", TRUE, TRUE);
|
||||
TEST ("[!ab]", "c", TRUE, TRUE);
|
||||
TEST ("[a-c]", "b", TRUE, TRUE);
|
||||
TEST ("[a-c]", "d", TRUE, FALSE);
|
||||
TEST ("[a-]", "-", TRUE, TRUE);
|
||||
TEST ("[]]", "]", TRUE, TRUE);
|
||||
TEST ("[^]]", "a", TRUE, TRUE);
|
||||
TEST ("[!]]", "a", TRUE, TRUE);
|
||||
|
||||
/* Various unclosed ranges */
|
||||
TEST ("[ab", "a", FALSE);
|
||||
TEST ("[a-", "a", FALSE);
|
||||
TEST ("[ab", "c", FALSE);
|
||||
TEST ("[a-", "c", FALSE);
|
||||
TEST ("[^]", "a", FALSE);
|
||||
TEST ("[ab", "a", TRUE, FALSE);
|
||||
TEST ("[a-", "a", TRUE, FALSE);
|
||||
TEST ("[ab", "c", TRUE, FALSE);
|
||||
TEST ("[a-", "c", TRUE, FALSE);
|
||||
TEST ("[^]", "a", TRUE, FALSE);
|
||||
|
||||
/* Ranges and special no-wildcard matches */
|
||||
TEST ("[.]", ".", FALSE);
|
||||
TEST ("a[.]", "a.", TRUE);
|
||||
TEST ("a/[.]", "a/.", FALSE);
|
||||
TEST ("[/]", "/", FALSE);
|
||||
TEST ("[^/]", "a", TRUE);
|
||||
TEST ("[.]", ".", TRUE, FALSE);
|
||||
TEST ("a[.]", "a.", TRUE, TRUE);
|
||||
TEST ("a/[.]", "a/.", TRUE, FALSE);
|
||||
TEST ("[/]", "/", TRUE, FALSE);
|
||||
TEST ("[^/]", "a", TRUE, TRUE);
|
||||
|
||||
/* Basic tests of * (and combinations of * and ?) */
|
||||
TEST ("a*b", "ab", TRUE);
|
||||
TEST ("a*b", "axb", TRUE);
|
||||
TEST ("a*b", "axxb", TRUE);
|
||||
TEST ("a**b", "ab", TRUE);
|
||||
TEST ("a**b", "axb", TRUE);
|
||||
TEST ("a**b", "axxb", TRUE);
|
||||
TEST ("a*?*b", "ab", FALSE);
|
||||
TEST ("a*?*b", "axb", TRUE);
|
||||
TEST ("a*?*b", "axxb", TRUE);
|
||||
TEST ("a*b", "ab", TRUE, TRUE);
|
||||
TEST ("a*b", "axb", TRUE, TRUE);
|
||||
TEST ("a*b", "axxb", TRUE, TRUE);
|
||||
TEST ("a**b", "ab", TRUE, TRUE);
|
||||
TEST ("a**b", "axb", TRUE, TRUE);
|
||||
TEST ("a**b", "axxb", TRUE, TRUE);
|
||||
TEST ("a*?*b", "ab", TRUE, FALSE);
|
||||
TEST ("a*?*b", "axb", TRUE, TRUE);
|
||||
TEST ("a*?*b", "axxb", TRUE, TRUE);
|
||||
|
||||
/* Test of *[range] */
|
||||
TEST ("a*[cd]", "ac", TRUE);
|
||||
TEST ("a*[cd]", "axc", TRUE);
|
||||
TEST ("a*[cd]", "axx", FALSE);
|
||||
TEST ("a*[cd]", "ac", TRUE, TRUE);
|
||||
TEST ("a*[cd]", "axc", TRUE, TRUE);
|
||||
TEST ("a*[cd]", "axx", TRUE, FALSE);
|
||||
|
||||
TEST ("a/[.]", "a/.", FALSE);
|
||||
TEST ("a*[.]", "a/.", FALSE);
|
||||
TEST ("a/[.]", "a/.", TRUE, FALSE);
|
||||
TEST ("a*[.]", "a/.", TRUE, FALSE);
|
||||
|
||||
/* Test of UTF-8 */
|
||||
|
||||
TEST ("ä", "ä", TRUE); /* TEST ("ä", "ä", TRUE); */
|
||||
TEST ("?", "ä", TRUE); /* TEST ("?", "ä", TRUE); */
|
||||
TEST ("*ö", "äö", TRUE); /* TEST ("*ö", "äö", TRUE); */
|
||||
TEST ("*ö", "ääö", TRUE); /* TEST ("*ö", "ääö", TRUE); */
|
||||
TEST ("[ä]", "ä", TRUE); /* TEST ("[ä]", "ä", TRUE); */
|
||||
TEST ("[ä-ö]", "é", TRUE); /* TEST ("[ä-ö]", "é", TRUE); */
|
||||
TEST ("[ä-ö]", "a", FALSE); /* TEST ("[ä-ö]", "a", FALSE); */
|
||||
TEST ("ä", "ä", TRUE, TRUE); /* TEST ("ä", "ä", TRUE); */
|
||||
TEST ("?", "ä", TRUE, TRUE); /* TEST ("?", "ä", TRUE); */
|
||||
TEST ("*ö", "äö", TRUE, TRUE); /* TEST ("*ö", "äö", TRUE); */
|
||||
TEST ("*ö", "ääö", TRUE, TRUE); /* TEST ("*ö", "ääö", TRUE); */
|
||||
TEST ("[ä]", "ä", TRUE, TRUE); /* TEST ("[ä]", "ä", TRUE); */
|
||||
TEST ("[ä-ö]", "é", TRUE, TRUE); /* TEST ("[ä-ö]", "é", TRUE); */
|
||||
TEST ("[ä-ö]", "a", TRUE, FALSE); /* TEST ("[ä-ö]", "a", FALSE); */
|
||||
|
||||
#ifdef DO_ESCAPE
|
||||
/* Tests of escaping */
|
||||
TEST ("\\\\", "\\", TRUE);
|
||||
TEST ("\\?", "?", TRUE);
|
||||
TEST ("\\?", "a", FALSE);
|
||||
TEST ("\\*", "*", TRUE);
|
||||
TEST ("\\*", "a", FALSE);
|
||||
TEST ("\\[a-b]", "[a-b]", TRUE);
|
||||
TEST ("[\\\\]", "\\", TRUE);
|
||||
TEST ("[\\^a]", "a", TRUE);
|
||||
TEST ("[a\\-c]", "b", FALSE);
|
||||
TEST ("[a\\-c]", "-", TRUE);
|
||||
TEST ("[a\\]", "a", FALSE);
|
||||
TEST ("\\\\", "\\", TRUE, TRUE);
|
||||
TEST ("\\?", "?", TRUE, TRUE);
|
||||
TEST ("\\?", "a", TRUE, FALSE);
|
||||
TEST ("\\*", "*", TRUE, TRUE);
|
||||
TEST ("\\*", "a", TRUE, FALSE);
|
||||
TEST ("\\[a-b]", "[a-b]", TRUE, TRUE);
|
||||
TEST ("[\\\\]", "\\", TRUE, TRUE);
|
||||
TEST ("[\\^a]", "a", TRUE, TRUE);
|
||||
TEST ("[a\\-c]", "b", TRUE, FALSE);
|
||||
TEST ("[a\\-c]", "-", TRUE, TRUE);
|
||||
TEST ("[a\\]", "a", TRUE, FALSE);
|
||||
#endif /* DO_ESCAPE */
|
||||
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ _gtk_accel_path_is_valid (const gchar *accel_path)
|
||||
accel_path[1] == '<' || accel_path[1] == '>' || !accel_path[1])
|
||||
return FALSE;
|
||||
p = strchr (accel_path, '>');
|
||||
if (!p || p[1] != '/')
|
||||
if (!p || p[1] != 0 && p[1] != '/')
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+12
-7
@@ -553,13 +553,13 @@ gtk_action_group_add_action (GtkActionGroup *action_group,
|
||||
* @action_group: the action group
|
||||
* @action: the action to add
|
||||
* @accelerator: the accelerator for the action, in
|
||||
* the format understood by gtk_accelerator_parse(), or %NULL to use the
|
||||
* stock accelerator
|
||||
* the format understood by gtk_accelerator_parse(), or "" for no accelerator, or
|
||||
* %NULL to use the stock accelerator
|
||||
*
|
||||
* Adds an action object to the action group and sets up the accelerator.
|
||||
*
|
||||
* If @accelerator is %NULL, attempts to use the accelerator associated
|
||||
* with the stock_id of the action.
|
||||
* with the stock_id of the action.
|
||||
*
|
||||
* Accel paths are set to
|
||||
* <literal><Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.
|
||||
@@ -585,10 +585,15 @@ gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
|
||||
|
||||
if (accelerator)
|
||||
{
|
||||
gtk_accelerator_parse (accelerator, &accel_key, &accel_mods);
|
||||
if (accel_key == 0)
|
||||
g_warning ("Unable to parse accelerator '%s' for action '%s'",
|
||||
accelerator, name);
|
||||
if (accelerator[0] == 0)
|
||||
accel_key = 0;
|
||||
else
|
||||
{
|
||||
gtk_accelerator_parse (accelerator, &accel_key, &accel_mods);
|
||||
if (accel_key == 0)
|
||||
g_warning ("Unable to parse accelerator '%s' for action '%s'",
|
||||
accelerator, name);
|
||||
}
|
||||
}
|
||||
else if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
|
||||
{
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
#include "gtkarrow.h"
|
||||
#include "gtkintl.h"
|
||||
|
||||
#define MIN_ARROW_SIZE 11
|
||||
#define MIN_ARROW_SIZE 15
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
||||
+16
-2
@@ -884,11 +884,10 @@ gtk_button_size_request (GtkWidget *widget,
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkBorder default_border;
|
||||
gboolean interior_focus;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
|
||||
gtk_button_get_props (button, &default_border, NULL, &interior_focus);
|
||||
gtk_button_get_props (button, &default_border, NULL, NULL);
|
||||
gtk_widget_style_get (GTK_WIDGET (widget),
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
@@ -930,8 +929,15 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
|
||||
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
|
||||
GtkBorder default_border;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
|
||||
gtk_button_get_props (button, &default_border, NULL, NULL);
|
||||
gtk_widget_style_get (GTK_WIDGET (widget),
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
@@ -960,6 +966,14 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
child_allocation.height = MAX (1, child_allocation.height - default_border.top - default_border.bottom);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_CAN_FOCUS (button))
|
||||
{
|
||||
child_allocation.x += focus_width + focus_pad;
|
||||
child_allocation.y += focus_width + focus_pad;
|
||||
child_allocation.width = MAX (1, child_allocation.width - (focus_width + focus_pad) * 2);
|
||||
child_allocation.height = MAX (1, child_allocation.height - (focus_width + focus_pad) * 2);
|
||||
}
|
||||
|
||||
if (button->depressed)
|
||||
{
|
||||
gint child_displacement_x;
|
||||
|
||||
+10
-7
@@ -1021,11 +1021,11 @@ gtk_calendar_main_button (GtkWidget *widget,
|
||||
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
||||
gtk_widget_grab_focus (widget);
|
||||
|
||||
gtk_calendar_select_and_focus_day (calendar, day);
|
||||
|
||||
private_data->in_drag = 1;
|
||||
private_data->drag_start_x = x;
|
||||
private_data->drag_start_y = y;
|
||||
|
||||
gtk_calendar_select_and_focus_day (calendar, day);
|
||||
}
|
||||
else if (event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
@@ -2747,10 +2747,10 @@ gtk_calendar_button_press (GtkWidget *widget,
|
||||
/* only call the action on single click, not double */
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
arrow_action (calendar, arrow);
|
||||
|
||||
if (event->button == 1)
|
||||
start_spinning (widget, arrow);
|
||||
|
||||
arrow_action (calendar, arrow);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -3066,7 +3066,10 @@ gtk_calendar_state_changed (GtkWidget *widget,
|
||||
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
|
||||
|
||||
if (!GTK_WIDGET_IS_SENSITIVE (widget))
|
||||
stop_spinning (widget);
|
||||
{
|
||||
private_data->in_drag = 0;
|
||||
stop_spinning (widget);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
if (GTK_WIDGET_IS_SENSITIVE (widget))
|
||||
@@ -3368,7 +3371,7 @@ gtk_calendar_drag_data_get (GtkWidget *widget,
|
||||
gchar str[128];
|
||||
gsize len;
|
||||
|
||||
date = g_date_new_dmy (calendar->selected_day, calendar->month, calendar->year);
|
||||
date = g_date_new_dmy (calendar->selected_day, calendar->month + 1, calendar->year);
|
||||
len = g_date_strftime (str, 127, "%x", date);
|
||||
gtk_selection_data_set_text (selection_data, str, len);
|
||||
|
||||
@@ -3529,7 +3532,7 @@ gtk_calendar_drag_data_received (GtkWidget *widget,
|
||||
g_object_freeze_notify (G_OBJECT (calendar));
|
||||
if (!(calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
||||
&& (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING))
|
||||
gtk_calendar_select_month (calendar, month, year);
|
||||
gtk_calendar_select_month (calendar, month - 1, year);
|
||||
gtk_calendar_select_day (calendar, day);
|
||||
g_object_thaw_notify (G_OBJECT (calendar));
|
||||
}
|
||||
|
||||
+122
-64
@@ -34,6 +34,7 @@
|
||||
#include "gtkmenu.h"
|
||||
#include "gtktogglebutton.h"
|
||||
#include "gtktreeselection.h"
|
||||
#include "gtktreeprivate.h"
|
||||
#include "gtkvseparator.h"
|
||||
#include "gtkwindow.h"
|
||||
|
||||
@@ -114,8 +115,9 @@ struct _GtkComboBoxPrivate
|
||||
* cell_view -> GtkCellView, regular child
|
||||
* cell_view_frame -> NULL
|
||||
* button -> GtkToggleButton set_parent to combo
|
||||
* arrow -> GtkArrow set_parent to button
|
||||
* separator -> GtkVSepator set_parent to button
|
||||
* box -> child of button
|
||||
* arrow -> child of box
|
||||
* separator -> child of box
|
||||
* popup_widget -> GtkMenu
|
||||
* popup_window -> NULL
|
||||
* popup_frame -> NULL
|
||||
@@ -126,6 +128,7 @@ struct _GtkComboBoxPrivate
|
||||
* cell_view -> NULL
|
||||
* cell_view_frame -> NULL
|
||||
* button -> GtkToggleButton set_parent to combo
|
||||
* box -> NULL
|
||||
* arrow -> GtkArrow, child of button
|
||||
* separator -> NULL
|
||||
* popup_widget -> GtkMenu
|
||||
@@ -138,6 +141,7 @@ struct _GtkComboBoxPrivate
|
||||
* cell_view -> GtkCellView, regular child
|
||||
* cell_view_frame -> GtkFrame, set parent to combo
|
||||
* button -> GtkToggleButton, set_parent to combo
|
||||
* box -> NULL
|
||||
* arrow -> GtkArrow, child of button
|
||||
* separator -> NULL
|
||||
* popup_widget -> tree_view
|
||||
@@ -150,6 +154,7 @@ struct _GtkComboBoxPrivate
|
||||
* cell_view -> NULL
|
||||
* cell_view_frame -> NULL
|
||||
* button -> GtkToggleButton, set_parent to combo
|
||||
* box -> NULL
|
||||
* arrow -> GtkArrow, child of button
|
||||
* separator -> NULL
|
||||
* popup_widget -> tree_view
|
||||
@@ -337,9 +342,6 @@ static void gtk_combo_box_menu_row_changed (GtkTreeModel *model,
|
||||
static gboolean gtk_combo_box_menu_key_press (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data);
|
||||
static void gtk_combo_box_menu_state_changed (GtkWidget *widget,
|
||||
GtkStateType previous,
|
||||
gpointer data);
|
||||
|
||||
/* cell layout */
|
||||
static void gtk_combo_box_cell_layout_pack_start (GtkCellLayout *layout,
|
||||
@@ -499,9 +501,9 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
|
||||
g_param_spec_int ("active",
|
||||
P_("Active item"),
|
||||
P_("The item which is currently active"),
|
||||
0,
|
||||
-1,
|
||||
G_MAXINT,
|
||||
0,
|
||||
-1,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
gtk_widget_class_install_style_property (widget_class,
|
||||
@@ -913,31 +915,53 @@ gtk_combo_box_menu_position_below (GtkMenu *menu,
|
||||
gint *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
|
||||
gint sx, sy;
|
||||
GtkWidget *child;
|
||||
GtkRequisition req;
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
|
||||
GdkScreen *screen;
|
||||
gint monitor_num;
|
||||
GdkRectangle monitor;
|
||||
|
||||
/* FIXME: is using the size request here broken? */
|
||||
child = GTK_BIN (combo_box)->child;
|
||||
|
||||
gdk_window_get_origin (child->window, &sx, &sy);
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (child))
|
||||
{
|
||||
sx += child->allocation.x;
|
||||
sy += child->allocation.y;
|
||||
}
|
||||
|
||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
||||
|
||||
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (combo_box)) == GTK_TEXT_DIR_LTR)
|
||||
*x = sx;
|
||||
else
|
||||
*x = sx + child->allocation.width - req.width;
|
||||
*y = sy + child->allocation.height;
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (child))
|
||||
{
|
||||
*x += child->allocation.x;
|
||||
*y += child->allocation.y;
|
||||
}
|
||||
|
||||
*push_in = TRUE;
|
||||
*y = sy;
|
||||
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (combo_box));
|
||||
monitor_num = gdk_screen_get_monitor_at_window (screen,
|
||||
GTK_WIDGET (combo_box)->window);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
if (*x < monitor.x)
|
||||
*x = monitor.x;
|
||||
else if (*x + req.width > monitor.x + monitor.width)
|
||||
*x = monitor.x + monitor.width - req.width;
|
||||
|
||||
if (monitor.y + monitor.height - *y - child->allocation.height >= req.height)
|
||||
*y += child->allocation.height;
|
||||
else if (*y - monitor.y >= req.height)
|
||||
*y -= req.height;
|
||||
else if (monitor.y + monitor.height - *y - child->allocation.height > *y - monitor.y)
|
||||
*y += child->allocation.height;
|
||||
else
|
||||
*y -= req.height;
|
||||
|
||||
*push_in = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1115,6 +1139,17 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
|
||||
gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget),
|
||||
combo_box->priv->active_item);
|
||||
|
||||
if (combo_box->priv->wrap_width == 0)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
width = GTK_WIDGET (combo_box)->allocation.width;
|
||||
gtk_widget_size_request (combo_box->priv->popup_widget, &requisition);
|
||||
|
||||
gtk_widget_set_size_request (combo_box->priv->popup_widget,
|
||||
MAX (width, requisition.width), -1);
|
||||
}
|
||||
|
||||
gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget),
|
||||
NULL, NULL,
|
||||
gtk_combo_box_menu_position, combo_box,
|
||||
@@ -1213,7 +1248,8 @@ gtk_combo_box_remeasure (GtkComboBox *combo_box)
|
||||
GtkTreePath *path;
|
||||
gint padding = 0;
|
||||
|
||||
if (!gtk_tree_model_get_iter_first (combo_box->priv->model, &iter))
|
||||
if (!combo_box->priv->model ||
|
||||
!gtk_tree_model_get_iter_first (combo_box->priv->model, &iter))
|
||||
return;
|
||||
|
||||
combo_box->priv->width = 0;
|
||||
@@ -1488,6 +1524,9 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box)
|
||||
g_object_unref (G_OBJECT (combo_box->priv->model));
|
||||
combo_box->priv->model = NULL;
|
||||
}
|
||||
|
||||
if (combo_box->priv->cell_view)
|
||||
gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (combo_box->priv->cell_view), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1502,12 +1541,6 @@ gtk_combo_box_forall (GtkContainer *container,
|
||||
{
|
||||
if (combo_box->priv->button)
|
||||
(* callback) (combo_box->priv->button, callback_data);
|
||||
if (combo_box->priv->box)
|
||||
(* callback) (combo_box->priv->box, callback_data);
|
||||
if (combo_box->priv->separator)
|
||||
(* callback) (combo_box->priv->separator, callback_data);
|
||||
if (combo_box->priv->arrow)
|
||||
(* callback) (combo_box->priv->arrow, callback_data);
|
||||
if (combo_box->priv->cell_view_frame)
|
||||
(* callback) (combo_box->priv->cell_view_frame, callback_data);
|
||||
}
|
||||
@@ -1653,9 +1686,6 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
|
||||
g_signal_connect (combo_box->priv->button, "button_press_event",
|
||||
G_CALLBACK (gtk_combo_box_menu_button_press),
|
||||
combo_box);
|
||||
g_signal_connect (combo_box->priv->button, "state_changed",
|
||||
G_CALLBACK (gtk_combo_box_menu_state_changed),
|
||||
combo_box);
|
||||
|
||||
/* create our funky menu */
|
||||
menu = gtk_menu_new ();
|
||||
@@ -1714,10 +1744,6 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
|
||||
G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL,
|
||||
gtk_combo_box_menu_button_press, NULL);
|
||||
g_signal_handlers_disconnect_matched (combo_box->priv->button,
|
||||
G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL,
|
||||
gtk_combo_box_menu_state_changed, NULL);
|
||||
|
||||
/* unparent will remove our latest ref */
|
||||
gtk_widget_unparent (combo_box->priv->button);
|
||||
@@ -1736,13 +1762,13 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
|
||||
|
||||
static void
|
||||
gtk_combo_box_item_get_size (GtkComboBox *combo_box,
|
||||
gint index,
|
||||
gint index_,
|
||||
gint *cols,
|
||||
gint *rows)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_tree_model_iter_nth_child (combo_box->priv->model, &iter, NULL, index);
|
||||
gtk_tree_model_iter_nth_child (combo_box->priv->model, &iter, NULL, index_);
|
||||
|
||||
if (cols)
|
||||
{
|
||||
@@ -1890,6 +1916,18 @@ gtk_combo_box_menu_button_press (GtkWidget *widget,
|
||||
gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget),
|
||||
combo_box->priv->active_item);
|
||||
|
||||
if (combo_box->priv->wrap_width == 0)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
gint width;
|
||||
|
||||
width = GTK_WIDGET (combo_box)->allocation.width;
|
||||
gtk_widget_size_request (combo_box->priv->popup_widget, &requisition);
|
||||
|
||||
gtk_widget_set_size_request (combo_box->priv->popup_widget,
|
||||
MAX (width, requisition.width), -1);
|
||||
}
|
||||
|
||||
gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget),
|
||||
NULL, NULL,
|
||||
gtk_combo_box_menu_position, combo_box,
|
||||
@@ -1901,22 +1939,6 @@ gtk_combo_box_menu_button_press (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_menu_state_changed (GtkWidget *widget,
|
||||
GtkStateType previous,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
|
||||
|
||||
if (combo_box->priv->cell_view)
|
||||
{
|
||||
gtk_widget_set_state (combo_box->priv->cell_view,
|
||||
GTK_WIDGET_STATE (widget));
|
||||
|
||||
gtk_widget_queue_draw (combo_box->priv->cell_view);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_menu_item_activate (GtkWidget *item,
|
||||
gpointer user_data)
|
||||
@@ -2147,14 +2169,27 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
|
||||
gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view),
|
||||
>K_WIDGET (combo_box)->style->base[GTK_WIDGET_STATE (combo_box)]);
|
||||
|
||||
gtk_widget_show (combo_box->priv->cell_view_frame);
|
||||
combo_box->priv->box = gtk_event_box_new ();
|
||||
gtk_event_box_set_visible_window (GTK_EVENT_BOX (combo_box->priv->box),
|
||||
FALSE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (combo_box->priv->cell_view_frame),
|
||||
combo_box->priv->box);
|
||||
|
||||
gtk_widget_show_all (combo_box->priv->cell_view_frame);
|
||||
|
||||
g_signal_connect (combo_box->priv->box, "button_press_event",
|
||||
G_CALLBACK (gtk_combo_box_list_button_pressed),
|
||||
combo_box);
|
||||
}
|
||||
|
||||
combo_box->priv->tree_view = gtk_tree_view_new ();
|
||||
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (combo_box->priv->tree_view));
|
||||
gtk_tree_selection_set_mode (sel, GTK_SELECTION_SINGLE);
|
||||
gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (combo_box->priv->tree_view),
|
||||
FALSE);
|
||||
_gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (combo_box->priv->tree_view),
|
||||
TRUE);
|
||||
if (combo_box->priv->model)
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (combo_box->priv->tree_view),
|
||||
combo_box->priv->model);
|
||||
@@ -2226,6 +2261,12 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
|
||||
0, 0, NULL,
|
||||
gtk_combo_box_list_button_pressed,
|
||||
NULL);
|
||||
if (combo_box->priv->box)
|
||||
g_signal_handlers_disconnect_matched (combo_box->priv->box,
|
||||
G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL,
|
||||
gtk_combo_box_list_button_pressed,
|
||||
NULL);
|
||||
|
||||
/* destroy things (unparent will kill the latest ref from us)
|
||||
* last unref on button will destroy the arrow
|
||||
@@ -2245,6 +2286,7 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
|
||||
{
|
||||
gtk_widget_unparent (combo_box->priv->cell_view_frame);
|
||||
combo_box->priv->cell_view_frame = NULL;
|
||||
combo_box->priv->box = NULL;
|
||||
}
|
||||
|
||||
gtk_widget_destroy (combo_box->priv->tree_view);
|
||||
@@ -2280,7 +2322,7 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget,
|
||||
if (ewidget == combo_box->priv->tree_view)
|
||||
return TRUE;
|
||||
|
||||
if ((ewidget != combo_box->priv->button) ||
|
||||
if ((ewidget != combo_box->priv->button && ewidget != combo_box->priv->box) ||
|
||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (combo_box->priv->button)))
|
||||
return FALSE;
|
||||
|
||||
@@ -2359,10 +2401,13 @@ gtk_combo_box_key_press (GtkWidget *widget,
|
||||
{
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
|
||||
guint state = event->state & gtk_accelerator_get_default_mod_mask ();
|
||||
gint items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
|
||||
gint items = 0;
|
||||
gint index = gtk_combo_box_get_active (combo_box);
|
||||
gint new_index;
|
||||
|
||||
if (combo_box->priv->model)
|
||||
items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
|
||||
|
||||
if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) &&
|
||||
state == GDK_MOD1_MASK)
|
||||
{
|
||||
@@ -2396,8 +2441,9 @@ gtk_combo_box_key_press (GtkWidget *widget,
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_combo_box_set_active (combo_box, CLAMP (new_index, 0, items - 1));
|
||||
|
||||
if (items > 0)
|
||||
gtk_combo_box_set_active (combo_box, CLAMP (new_index, 0, items - 1));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2445,12 +2491,16 @@ gtk_combo_box_list_key_press (GtkWidget *widget,
|
||||
if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter ||
|
||||
event->keyval == GDK_space || event->keyval == GDK_KP_Space)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean ret = FALSE;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model = NULL;
|
||||
GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (combo_box->priv->tree_view));
|
||||
|
||||
ret = gtk_tree_selection_get_selected (sel, &model, &iter);
|
||||
if (combo_box->priv->model)
|
||||
{
|
||||
GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (combo_box->priv->tree_view));
|
||||
|
||||
ret = gtk_tree_selection_get_selected (sel, &model, &iter);
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
@@ -3035,7 +3085,7 @@ gtk_combo_box_get_active (GtkComboBox *combo_box)
|
||||
/**
|
||||
* gtk_combo_box_set_active:
|
||||
* @combo_box: A #GtkComboBox.
|
||||
* @index: An index in the model passed during construction, or -1 to have
|
||||
* @index_: An index in the model passed during construction, or -1 to have
|
||||
* no active item.
|
||||
*
|
||||
* Sets the active item of @combo_box to be the item at @index.
|
||||
@@ -3044,16 +3094,16 @@ gtk_combo_box_get_active (GtkComboBox *combo_box)
|
||||
*/
|
||||
void
|
||||
gtk_combo_box_set_active (GtkComboBox *combo_box,
|
||||
gint index)
|
||||
gint index_)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
/* -1 means "no item selected" */
|
||||
g_return_if_fail (index >= -1);
|
||||
g_return_if_fail (index_ >= -1);
|
||||
|
||||
if (combo_box->priv->active_item == index)
|
||||
if (combo_box->priv->active_item == index_)
|
||||
return;
|
||||
|
||||
gtk_combo_box_set_active_internal (combo_box, index);
|
||||
gtk_combo_box_set_active_internal (combo_box, index_);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3169,6 +3219,7 @@ gtk_combo_box_set_active_iter (GtkComboBox *combo_box,
|
||||
*
|
||||
* Sets the model used by @combo_box to be @model. Will unset a
|
||||
* previously set model (if applicable).
|
||||
* If @model is %NULL, then it will unset the model.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -3177,6 +3228,13 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
|
||||
if (!model)
|
||||
{
|
||||
gtk_combo_box_unset_model (combo_box);
|
||||
return;
|
||||
}
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_MODEL (model));
|
||||
|
||||
if (model == combo_box->priv->model)
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ void gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
|
||||
/* get/set active item */
|
||||
gint gtk_combo_box_get_active (GtkComboBox *combo_box);
|
||||
void gtk_combo_box_set_active (GtkComboBox *combo_box,
|
||||
gint index);
|
||||
gint index_);
|
||||
gboolean gtk_combo_box_get_active_iter (GtkComboBox *combo_box,
|
||||
GtkTreeIter *iter);
|
||||
void gtk_combo_box_set_active_iter (GtkComboBox *combo_box,
|
||||
|
||||
+100
-15
@@ -133,6 +133,7 @@ static void gtk_entry_get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_entry_finalize (GObject *object);
|
||||
static void gtk_entry_destroy (GtkObject *object);
|
||||
|
||||
/* GtkWidget methods
|
||||
*/
|
||||
@@ -405,9 +406,11 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkObjectClass *gtk_object_class;
|
||||
GtkBindingSet *binding_set;
|
||||
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
gtk_object_class = (GtkObjectClass *)class;
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
gobject_class->finalize = gtk_entry_finalize;
|
||||
@@ -442,6 +445,8 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
|
||||
widget_class->popup_menu = gtk_entry_popup_menu;
|
||||
|
||||
gtk_object_class->destroy = gtk_entry_destroy;
|
||||
|
||||
class->move_cursor = gtk_entry_move_cursor;
|
||||
class->insert_at_cursor = gtk_entry_insert_at_cursor;
|
||||
class->delete_from_cursor = gtk_entry_delete_from_cursor;
|
||||
@@ -971,6 +976,36 @@ gtk_entry_init (GtkEntry *entry)
|
||||
G_CALLBACK (gtk_entry_delete_surrounding_cb), entry);
|
||||
}
|
||||
|
||||
/*
|
||||
* Overwrite a memory that might contain sensitive information.
|
||||
*/
|
||||
static void
|
||||
trash_area (gchar *area, gsize len)
|
||||
{
|
||||
volatile gchar *varea = (volatile gchar *)area;
|
||||
while (len-- > 0)
|
||||
*varea++ = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_destroy (GtkObject *object)
|
||||
{
|
||||
GtkEntry *entry = GTK_ENTRY (object);
|
||||
|
||||
entry->n_bytes = 0;
|
||||
entry->current_pos = entry->selection_bound = entry->text_length = 0;
|
||||
gtk_entry_reset_im_context (entry);
|
||||
gtk_entry_reset_layout (entry);
|
||||
|
||||
if (!entry->visible)
|
||||
{
|
||||
/* We want to trash the text here because the entry might be leaked. */
|
||||
trash_area (entry->text, strlen (entry->text));
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_finalize (GObject *object)
|
||||
{
|
||||
@@ -992,8 +1027,12 @@ gtk_entry_finalize (GObject *object)
|
||||
entry->text_size = 0;
|
||||
|
||||
if (entry->text)
|
||||
g_free (entry->text);
|
||||
entry->text = NULL;
|
||||
{
|
||||
if (!entry->visible)
|
||||
trash_area (entry->text, strlen (entry->text));
|
||||
g_free (entry->text);
|
||||
entry->text = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@@ -1822,9 +1861,12 @@ gtk_entry_insert_text (GtkEditable *editable,
|
||||
|
||||
text[new_text_length] = '\0';
|
||||
strncpy (text, new_text, new_text_length);
|
||||
|
||||
|
||||
g_signal_emit_by_name (editable, "insert_text", text, new_text_length, position);
|
||||
|
||||
if (!entry->visible)
|
||||
trash_area (text, new_text_length);
|
||||
|
||||
if (new_text_length > 63)
|
||||
g_free (text);
|
||||
|
||||
@@ -2024,6 +2066,8 @@ gtk_entry_real_insert_text (GtkEditable *editable,
|
||||
|
||||
if (new_text_length + entry->n_bytes + 1 > entry->text_size)
|
||||
{
|
||||
gsize prev_size = entry->text_size;
|
||||
|
||||
while (new_text_length + entry->n_bytes + 1 > entry->text_size)
|
||||
{
|
||||
if (entry->text_size == 0)
|
||||
@@ -2047,7 +2091,17 @@ gtk_entry_real_insert_text (GtkEditable *editable,
|
||||
}
|
||||
}
|
||||
|
||||
entry->text = g_realloc (entry->text, entry->text_size);
|
||||
if (entry->visible)
|
||||
entry->text = g_realloc (entry->text, entry->text_size);
|
||||
else
|
||||
{
|
||||
/* Same thing, just slower and without leaving stuff in memory. */
|
||||
gchar *et_new = g_malloc (entry->text_size);
|
||||
memcpy (et_new, entry->text, MIN (prev_size, entry->text_size));
|
||||
trash_area (entry->text, prev_size);
|
||||
g_free (entry->text);
|
||||
entry->text = et_new;
|
||||
}
|
||||
}
|
||||
|
||||
index = g_utf8_offset_to_pointer (entry->text, *position) - entry->text;
|
||||
@@ -2097,6 +2151,13 @@ gtk_entry_real_delete_text (GtkEditable *editable,
|
||||
g_memmove (entry->text + start_index, entry->text + end_index, entry->n_bytes + 1 - end_index);
|
||||
entry->text_length -= (end_pos - start_pos);
|
||||
entry->n_bytes -= (end_index - start_index);
|
||||
|
||||
/* In password-mode, make sure we don't leave anything sensitive after
|
||||
* the terminating zero. Note, that the terminating zero already trashed
|
||||
* one byte.
|
||||
*/
|
||||
if (!entry->visible)
|
||||
trash_area (entry->text + entry->n_bytes + 1, end_index - start_index - 1);
|
||||
|
||||
current_pos = entry->current_pos;
|
||||
if (current_pos > start_pos)
|
||||
@@ -2706,7 +2767,12 @@ gtk_entry_create_layout (GtkEntry *entry,
|
||||
{
|
||||
PangoDirection pango_dir;
|
||||
|
||||
pango_dir = pango_find_base_dir (entry->text, entry->n_bytes);
|
||||
if (entry->visible)
|
||||
pango_dir = pango_find_base_dir (entry->text, entry->n_bytes);
|
||||
|
||||
else
|
||||
pango_dir = PANGO_DIRECTION_NEUTRAL;
|
||||
|
||||
if (pango_dir == PANGO_DIRECTION_NEUTRAL)
|
||||
{
|
||||
if (GTK_WIDGET_HAS_FOCUS (widget))
|
||||
@@ -3226,13 +3292,13 @@ gtk_entry_move_visually (GtkEntry *entry,
|
||||
count++;
|
||||
}
|
||||
|
||||
if (new_index < 0 || new_index == G_MAXINT)
|
||||
break;
|
||||
|
||||
index = new_index;
|
||||
if (new_index < 0)
|
||||
index = 0;
|
||||
else if (new_index != G_MAXINT)
|
||||
index = new_index;
|
||||
|
||||
while (new_trailing--)
|
||||
index = g_utf8_next_char (text + new_index) - text;
|
||||
index = g_utf8_next_char (text + index) - text;
|
||||
}
|
||||
|
||||
return g_utf8_pointer_to_offset (text, text + index);
|
||||
@@ -3418,6 +3484,14 @@ paste_received (GtkClipboard *clipboard,
|
||||
if (text)
|
||||
{
|
||||
gint pos, start, end;
|
||||
GtkEntryCompletion *completion = gtk_entry_get_completion (entry);
|
||||
|
||||
if (completion)
|
||||
{
|
||||
g_signal_handler_block (entry, completion->priv->changed_id);
|
||||
if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
|
||||
_gtk_entry_completion_popdown (completion);
|
||||
}
|
||||
|
||||
if (gtk_editable_get_selection_bounds (editable, &start, &end))
|
||||
gtk_editable_delete_text (editable, start, end);
|
||||
@@ -3425,6 +3499,9 @@ paste_received (GtkClipboard *clipboard,
|
||||
pos = entry->current_pos;
|
||||
gtk_editable_insert_text (editable, text, -1, &pos);
|
||||
gtk_editable_set_position (editable, pos);
|
||||
|
||||
if (completion)
|
||||
g_signal_handler_unblock (entry, completion->priv->changed_id);
|
||||
}
|
||||
|
||||
g_object_unref (entry);
|
||||
@@ -4139,18 +4216,26 @@ popup_position_func (GtkMenu *menu,
|
||||
GtkWidget *widget = GTK_WIDGET (entry);
|
||||
GdkScreen *screen = gtk_widget_get_screen (widget);
|
||||
GtkRequisition req;
|
||||
gint monitor_num;
|
||||
GdkRectangle monitor;
|
||||
|
||||
g_return_if_fail (GTK_WIDGET_REALIZED (entry));
|
||||
|
||||
gdk_window_get_origin (widget->window, x, y);
|
||||
|
||||
gdk_window_get_origin (widget->window, x, y);
|
||||
|
||||
gtk_widget_size_request (entry->popup_menu, &req);
|
||||
|
||||
*x += widget->allocation.width / 2;
|
||||
*y += widget->allocation.height;
|
||||
|
||||
*x = CLAMP (*x, 0, MAX (0, gdk_screen_get_width (screen) - req.width));
|
||||
*y = CLAMP (*y, 0, MAX (0, gdk_screen_get_height (screen) - req.height));
|
||||
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
|
||||
gtk_menu_set_monitor (menu, monitor_num);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
*x = CLAMP (*x, monitor.x, monitor.x + MAX (0, monitor.width - req.width));
|
||||
*y = CLAMP (*y, monitor.y, monitor.y + MAX (0, monitor.height - req.height));
|
||||
|
||||
*push_in = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -4632,7 +4717,7 @@ gtk_entry_completion_timeout (gpointer data)
|
||||
|
||||
completion->priv->completion_timeout = 0;
|
||||
|
||||
if (strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)))
|
||||
if (g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1)
|
||||
>= completion->priv->minimum_key_length)
|
||||
{
|
||||
gint matches;
|
||||
|
||||
+73
-27
@@ -34,6 +34,7 @@
|
||||
#include "gtkmain.h"
|
||||
#include "gtksignal.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtktreeprivate.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -108,7 +109,12 @@ static gboolean gtk_entry_completion_action_button_press (GtkWidget
|
||||
gpointer user_data);
|
||||
static void gtk_entry_completion_selection_changed (GtkTreeSelection *selection,
|
||||
gpointer data);
|
||||
|
||||
static gboolean gtk_entry_completion_list_enter_notify (GtkWidget *widget,
|
||||
GdkEventCrossing *event,
|
||||
gpointer data);
|
||||
static gboolean gtk_entry_completion_list_motion_notify (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data);
|
||||
static void gtk_entry_completion_insert_action (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
const gchar *string,
|
||||
@@ -270,7 +276,14 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
|
||||
g_signal_connect (priv->tree_view, "button_press_event",
|
||||
G_CALLBACK (gtk_entry_completion_list_button_press),
|
||||
completion);
|
||||
g_signal_connect (priv->tree_view, "enter_notify_event",
|
||||
G_CALLBACK (gtk_entry_completion_list_enter_notify),
|
||||
completion);
|
||||
g_signal_connect (priv->tree_view, "motion_notify_event",
|
||||
G_CALLBACK (gtk_entry_completion_list_motion_notify),
|
||||
completion);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE);
|
||||
_gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->tree_view), TRUE);
|
||||
|
||||
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
|
||||
gtk_tree_selection_set_mode (sel, GTK_SELECTION_SINGLE);
|
||||
@@ -301,7 +314,14 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
|
||||
g_signal_connect (priv->action_view, "button_press_event",
|
||||
G_CALLBACK (gtk_entry_completion_action_button_press),
|
||||
completion);
|
||||
g_signal_connect (priv->action_view, "enter_notify_event",
|
||||
G_CALLBACK (gtk_entry_completion_list_enter_notify),
|
||||
completion);
|
||||
g_signal_connect (priv->action_view, "motion_notify_event",
|
||||
G_CALLBACK (gtk_entry_completion_list_motion_notify),
|
||||
completion);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->action_view), FALSE);
|
||||
_gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->action_view), TRUE);
|
||||
|
||||
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->action_view));
|
||||
gtk_tree_selection_set_mode (sel, GTK_SELECTION_SINGLE);
|
||||
@@ -790,6 +810,7 @@ gtk_entry_completion_get_entry (GtkEntryCompletion *completion)
|
||||
*
|
||||
* Sets the model for a #GtkEntryCompletion. If @completion already has
|
||||
* a model set, it will remove it before setting the new model.
|
||||
* If @model is %NULL, then it will unset the model.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -798,7 +819,7 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
|
||||
g_return_if_fail (GTK_IS_TREE_MODEL (model));
|
||||
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
|
||||
|
||||
/* code will unref the old filter model (if any) */
|
||||
completion->priv->filter_model =
|
||||
@@ -960,10 +981,10 @@ gtk_entry_completion_insert_action (GtkEntryCompletion *completion,
|
||||
/**
|
||||
* gtk_entry_completion_insert_action_text:
|
||||
* @completion: A #GtkEntryCompletion.
|
||||
* @index: The index of the item to insert.
|
||||
* @index_: The index of the item to insert.
|
||||
* @text: Text of the item to insert.
|
||||
*
|
||||
* Inserts an action in @completion's action item list at position @index
|
||||
* Inserts an action in @completion's action item list at position @index_
|
||||
* with text @text. If you want the action item to have markup, use
|
||||
* gtk_entry_completion_insert_action_markup().
|
||||
*
|
||||
@@ -971,57 +992,57 @@ gtk_entry_completion_insert_action (GtkEntryCompletion *completion,
|
||||
*/
|
||||
void
|
||||
gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
gint index_,
|
||||
const gchar *text)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
gtk_entry_completion_insert_action (completion, index, text, FALSE);
|
||||
gtk_entry_completion_insert_action (completion, index_, text, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_completion_insert_action_markup:
|
||||
* @completion: A #GtkEntryCompletion.
|
||||
* @index: The index of the item to insert.
|
||||
* @index_: The index of the item to insert.
|
||||
* @markup: Markup of the item to insert.
|
||||
*
|
||||
* Inserts an action in @completion's action item list at position @index
|
||||
* Inserts an action in @completion's action item list at position @index_
|
||||
* with markup @markup.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
void
|
||||
gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
gint index_,
|
||||
const gchar *markup)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
|
||||
g_return_if_fail (markup != NULL);
|
||||
|
||||
gtk_entry_completion_insert_action (completion, index, markup, TRUE);
|
||||
gtk_entry_completion_insert_action (completion, index_, markup, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_completion_delete_action:
|
||||
* @completion: A #GtkEntryCompletion.
|
||||
* @index: The index of the item to Delete.
|
||||
* @index_: The index of the item to Delete.
|
||||
*
|
||||
* Deletes the action at @index from @completion's action list.
|
||||
* Deletes the action at @index_ from @completion's action list.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
void
|
||||
gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
|
||||
gint index)
|
||||
gint index_)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
|
||||
g_return_if_fail (index >= 0);
|
||||
g_return_if_fail (index_ >= 0);
|
||||
|
||||
gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (completion->priv->actions),
|
||||
&iter, NULL, index);
|
||||
&iter, NULL, index_);
|
||||
gtk_list_store_remove (completion->priv->actions, &iter);
|
||||
}
|
||||
|
||||
@@ -1093,6 +1114,29 @@ get_borders (GtkEntry *entry,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_entry_completion_list_enter_notify (GtkWidget *widget,
|
||||
GdkEventCrossing *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
|
||||
|
||||
return completion->priv->ignore_enter;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_entry_completion_list_motion_notify (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
|
||||
|
||||
completion->priv->ignore_enter = FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* some nasty size requisition */
|
||||
gboolean
|
||||
_gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
@@ -1105,7 +1149,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
GtkRequisition popup_req;
|
||||
GtkTreePath *path;
|
||||
gboolean above;
|
||||
|
||||
gint width;
|
||||
|
||||
gdk_window_get_origin (completion->priv->entry->window, &x, &y);
|
||||
get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
|
||||
|
||||
@@ -1124,9 +1169,14 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
else
|
||||
gtk_widget_show (completion->priv->scrolled_window);
|
||||
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (completion->priv->entry));
|
||||
monitor_num = gdk_screen_get_monitor_at_window (screen,
|
||||
GTK_WIDGET (completion->priv->entry)->window);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
width = MIN (completion->priv->entry->allocation.width, monitor.width);
|
||||
gtk_widget_set_size_request (completion->priv->tree_view,
|
||||
completion->priv->entry->allocation.width - 2 * x_border,
|
||||
items * height);
|
||||
width - 2 * x_border, items * height);
|
||||
|
||||
/* default on no match */
|
||||
completion->priv->current_selected = -1;
|
||||
@@ -1142,18 +1192,12 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
&height);
|
||||
|
||||
gtk_widget_set_size_request (completion->priv->action_view,
|
||||
completion->priv->entry->allocation.width - 2 * x_border,
|
||||
items * height);
|
||||
width - 2 * x_border, items * height);
|
||||
}
|
||||
else
|
||||
gtk_widget_hide (completion->priv->action_view);
|
||||
|
||||
gtk_widget_size_request (completion->priv->popup_window, &popup_req);
|
||||
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (completion->priv->entry));
|
||||
monitor_num = gdk_screen_get_monitor_at_window (screen,
|
||||
GTK_WIDGET (completion->priv->entry)->window);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
if (x < monitor.x)
|
||||
x = monitor.x;
|
||||
@@ -1193,8 +1237,8 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
|
||||
return;
|
||||
|
||||
completion->priv->may_wrap = TRUE;
|
||||
|
||||
completion->priv->ignore_enter = TRUE;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
|
||||
renderers = gtk_tree_view_column_get_cell_renderers (column);
|
||||
gtk_widget_ensure_style (completion->priv->tree_view);
|
||||
@@ -1220,6 +1264,8 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
void
|
||||
_gtk_entry_completion_popdown (GtkEntryCompletion *completion)
|
||||
{
|
||||
completion->priv->ignore_enter = FALSE;
|
||||
|
||||
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
||||
gtk_grab_remove (completion->priv->popup_window);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ struct _GtkEntryCompletionClass
|
||||
GtkTreeModel *model,
|
||||
GtkTreeIter *iter);
|
||||
void (* action_activated) (GtkEntryCompletion *completion,
|
||||
gint index);
|
||||
gint index_);
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved0) (void);
|
||||
@@ -91,13 +91,13 @@ gint gtk_entry_completion_get_minimum_key_length (GtkEntryComplet
|
||||
void gtk_entry_completion_complete (GtkEntryCompletion *completion);
|
||||
|
||||
void gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
gint index_,
|
||||
const gchar *text);
|
||||
void gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
gint index_,
|
||||
const gchar *markup);
|
||||
void gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
|
||||
gint index);
|
||||
gint index_);
|
||||
|
||||
/* convenience */
|
||||
void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
|
||||
|
||||
@@ -58,7 +58,7 @@ struct _GtkEntryCompletionPrivate
|
||||
gulong key_press_id;
|
||||
gulong key_release_id;
|
||||
|
||||
gboolean may_wrap;
|
||||
gboolean ignore_enter;
|
||||
};
|
||||
|
||||
gboolean _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion);
|
||||
|
||||
+9
-2
@@ -614,9 +614,16 @@ gtk_expander_size_allocate (GtkWidget *widget,
|
||||
|
||||
ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
|
||||
|
||||
label_allocation.x = widget->allocation.x + border_width + focus_width + focus_pad;
|
||||
if (ltr)
|
||||
label_allocation.x += expander_size + 2 * expander_spacing;
|
||||
label_allocation.x = (widget->allocation.x +
|
||||
border_width + focus_width + focus_pad +
|
||||
expander_size + 2 * expander_spacing);
|
||||
else
|
||||
label_allocation.x = (widget->allocation.x + widget->allocation.width -
|
||||
(label_requisition.width +
|
||||
border_width + focus_width + focus_pad +
|
||||
expander_size + 2 * expander_spacing));
|
||||
|
||||
label_allocation.y = widget->allocation.y + border_width + focus_width + focus_pad;
|
||||
|
||||
label_allocation.width = MIN (label_requisition.width,
|
||||
|
||||
@@ -1641,7 +1641,7 @@ gtk_file_chooser_remove_shortcut_folder (GtkFileChooser *chooser,
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Queries the list of shortcut folders in the file chooser, as set by
|
||||
* gtk_file_chooser_set_shortcut_folders().
|
||||
* gtk_file_chooser_add_shortcut_folder().
|
||||
*
|
||||
* Return value: A list of folder filenames, or %NULL if there are no shortcut
|
||||
* folders. Free the returned list with g_slist_free(), and the filenames with
|
||||
@@ -1760,7 +1760,7 @@ gtk_file_chooser_remove_shortcut_folder_uri (GtkFileChooser *chooser,
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Queries the list of shortcut folders in the file chooser, as set by
|
||||
* gtk_file_chooser_set_shortcut_folder_uris().
|
||||
* gtk_file_chooser_add_shortcut_folder_uri().
|
||||
*
|
||||
* Return value: A list of folder URIs, or %NULL if there are no shortcut
|
||||
* folders. Free the returned list with g_slist_free(), and the URIs with
|
||||
|
||||
+177
-59
@@ -148,6 +148,9 @@ struct _GtkFileChooserDefault
|
||||
GtkTreeViewColumn *list_name_column;
|
||||
GtkCellRenderer *list_name_renderer;
|
||||
|
||||
GSource *edited_idle;
|
||||
char *edited_new_text;
|
||||
|
||||
guint settings_signal_id;
|
||||
int icon_size;
|
||||
|
||||
@@ -654,6 +657,8 @@ gtk_file_chooser_default_finalize (GObject *object)
|
||||
|
||||
g_free (impl->preview_display_name);
|
||||
|
||||
g_free (impl->edited_new_text);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -780,12 +785,26 @@ change_folder_and_display_error (GtkFileChooserDefault *impl,
|
||||
{
|
||||
GError *error;
|
||||
gboolean result;
|
||||
GtkFilePath *path_copy;
|
||||
|
||||
/* We copy the path because of this case:
|
||||
*
|
||||
* list_row_activated()
|
||||
* fetches path from model; path belongs to the model (*)
|
||||
* calls change_folder_and_display_error()
|
||||
* calls _gtk_file_chooser_set_current_folder_path()
|
||||
* changing folders fails, sets model to NULL, thus freeing the path in (*)
|
||||
*/
|
||||
|
||||
path_copy = gtk_file_path_copy (path);
|
||||
|
||||
error = NULL;
|
||||
result = _gtk_file_chooser_set_current_folder_path (GTK_FILE_CHOOSER (impl), path, &error);
|
||||
result = _gtk_file_chooser_set_current_folder_path (GTK_FILE_CHOOSER (impl), path_copy, &error);
|
||||
|
||||
if (!result)
|
||||
error_changing_folder_dialog (impl, path, error);
|
||||
error_changing_folder_dialog (impl, path_copy, error);
|
||||
|
||||
gtk_file_path_free (path_copy);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1468,6 +1487,9 @@ new_folder_button_clicked (GtkButton *button,
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath *path;
|
||||
|
||||
if (!impl->browse_files_model)
|
||||
return; /* FIXME: this sucks. Disable the New Folder button or something. */
|
||||
|
||||
_gtk_file_system_model_add_editable (impl->browse_files_model, &iter);
|
||||
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL (impl->browse_files_model), &iter);
|
||||
@@ -1482,6 +1504,69 @@ new_folder_button_clicked (GtkButton *button,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
/* Idle handler for creating a new folder after editing its name cell, or for
|
||||
* canceling the editing.
|
||||
*/
|
||||
static gboolean
|
||||
edited_idle_cb (GtkFileChooserDefault *impl)
|
||||
{
|
||||
g_source_destroy (impl->edited_idle);
|
||||
impl->edited_idle = NULL;
|
||||
|
||||
_gtk_file_system_model_remove_editable (impl->browse_files_model);
|
||||
g_object_set (impl->list_name_renderer, "editable", FALSE, NULL);
|
||||
|
||||
if (impl->edited_new_text) /* not cancelled? */
|
||||
{
|
||||
GError *error;
|
||||
GtkFilePath *file_path;
|
||||
|
||||
error = NULL;
|
||||
file_path = gtk_file_system_make_path (impl->file_system, impl->current_folder, impl->edited_new_text,
|
||||
&error);
|
||||
if (file_path)
|
||||
{
|
||||
error = NULL;
|
||||
if (gtk_file_system_create_folder (impl->file_system, file_path, &error))
|
||||
change_folder_and_display_error (impl, file_path);
|
||||
else
|
||||
error_dialog (impl,
|
||||
_("Could not create folder %s:\n%s"),
|
||||
file_path, error);
|
||||
|
||||
gtk_file_path_free (file_path);
|
||||
}
|
||||
else
|
||||
error_building_filename_dialog (impl, impl->current_folder, impl->edited_new_text, error);
|
||||
|
||||
g_free (impl->edited_new_text);
|
||||
impl->edited_new_text = NULL;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_edited_idle (GtkFileChooserDefault *impl,
|
||||
const gchar *new_text)
|
||||
{
|
||||
/* We create the folder in an idle handler so that we don't modify the tree
|
||||
* just now.
|
||||
*/
|
||||
|
||||
g_assert (!impl->edited_idle);
|
||||
g_assert (!impl->edited_new_text);
|
||||
|
||||
impl->edited_idle = g_idle_source_new ();
|
||||
g_source_set_closure (impl->edited_idle,
|
||||
g_cclosure_new_object (G_CALLBACK (edited_idle_cb),
|
||||
G_OBJECT (impl)));
|
||||
g_source_attach (impl->edited_idle, NULL);
|
||||
|
||||
if (new_text)
|
||||
impl->edited_new_text = g_strdup (new_text);
|
||||
}
|
||||
|
||||
/* Callback used from the text cell renderer when the new folder is named */
|
||||
static void
|
||||
renderer_edited_cb (GtkCellRendererText *cell_renderer_text,
|
||||
@@ -1489,31 +1574,7 @@ renderer_edited_cb (GtkCellRendererText *cell_renderer_text,
|
||||
const gchar *new_text,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
GError *error;
|
||||
GtkFilePath *file_path;
|
||||
|
||||
_gtk_file_system_model_remove_editable (impl->browse_files_model);
|
||||
g_object_set (impl->list_name_renderer, "editable", FALSE, NULL);
|
||||
|
||||
error = NULL;
|
||||
file_path = gtk_file_system_make_path (impl->file_system, impl->current_folder, new_text, &error);
|
||||
if (!file_path)
|
||||
{
|
||||
error_building_filename_dialog (impl, impl->current_folder, new_text, error);
|
||||
return;
|
||||
}
|
||||
|
||||
error = NULL;
|
||||
if (!gtk_file_system_create_folder (impl->file_system, file_path, &error))
|
||||
{
|
||||
error_dialog (impl,
|
||||
_("Could not create folder %s:\n%s"),
|
||||
file_path, error);
|
||||
}
|
||||
|
||||
gtk_file_path_free (file_path);
|
||||
|
||||
/* FIXME: scroll to the new folder and select it */
|
||||
queue_edited_idle (impl, new_text);
|
||||
}
|
||||
|
||||
/* Callback used from the text cell renderer when the new folder edition gets
|
||||
@@ -1523,8 +1584,7 @@ static void
|
||||
renderer_editing_canceled_cb (GtkCellRendererText *cell_renderer_text,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
_gtk_file_system_model_remove_editable (impl->browse_files_model);
|
||||
g_object_set (impl->list_name_renderer, "editable", FALSE, NULL);
|
||||
queue_edited_idle (impl, NULL);
|
||||
}
|
||||
|
||||
/* Creates the widgets for the filter combo box */
|
||||
@@ -1835,10 +1895,8 @@ selection_check (GtkFileChooserDefault *impl,
|
||||
static void
|
||||
bookmarks_check_add_sensitivity (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
gboolean active;
|
||||
|
||||
/* Check selection */
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
|
||||
|
||||
@@ -2608,10 +2666,12 @@ trap_activate_cb (GtkWidget *widget,
|
||||
&& widget != window->default_widget
|
||||
&& !(widget == window->focus_widget &&
|
||||
(!window->default_widget || !GTK_WIDGET_SENSITIVE (window->default_widget))))
|
||||
gtk_window_activate_default (window);
|
||||
|
||||
return TRUE;
|
||||
{
|
||||
gtk_window_activate_default (window);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2668,28 +2728,57 @@ file_list_build_popup_menu (GtkFileChooserDefault *impl)
|
||||
G_CALLBACK (show_hidden_toggled_cb), impl);
|
||||
}
|
||||
|
||||
static void
|
||||
popup_position_func (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (user_data);
|
||||
GdkScreen *screen = gtk_widget_get_screen (widget);
|
||||
GtkRequisition req;
|
||||
gint monitor_num;
|
||||
GdkRectangle monitor;
|
||||
|
||||
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
|
||||
|
||||
gdk_window_get_origin (widget->window, x, y);
|
||||
|
||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
||||
|
||||
*x += (widget->allocation.width - req.width) / 2;
|
||||
*y += (widget->allocation.height - req.height) / 2;
|
||||
|
||||
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
|
||||
gtk_menu_set_monitor (menu, monitor_num);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
*x = CLAMP (*x, monitor.x, monitor.x + MAX (0, monitor.width - req.width));
|
||||
*y = CLAMP (*y, monitor.y, monitor.y + MAX (0, monitor.height - req.height));
|
||||
|
||||
*push_in = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
file_list_popup_menu (GtkFileChooserDefault *impl,
|
||||
GdkEventButton *event)
|
||||
{
|
||||
int button;
|
||||
guint32 timestamp;
|
||||
|
||||
file_list_build_popup_menu (impl);
|
||||
if (event)
|
||||
{
|
||||
button = event->button;
|
||||
timestamp = event->time;
|
||||
}
|
||||
gtk_menu_popup (GTK_MENU (impl->browse_files_popup_menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
else
|
||||
{
|
||||
button = 0;
|
||||
timestamp = GDK_CURRENT_TIME;
|
||||
gtk_menu_popup (GTK_MENU (impl->browse_files_popup_menu),
|
||||
NULL, NULL,
|
||||
popup_position_func, impl->browse_files_tree_view,
|
||||
0, GDK_CURRENT_TIME);
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL (impl->browse_files_popup_menu),
|
||||
FALSE);
|
||||
}
|
||||
|
||||
file_list_build_popup_menu (impl);
|
||||
gtk_menu_popup (GTK_MENU (impl->browse_files_popup_menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
button, timestamp);
|
||||
}
|
||||
|
||||
/* Callback used for the GtkWidget::popup-menu signal of the file list */
|
||||
@@ -3405,7 +3494,9 @@ gtk_file_chooser_default_set_property (GObject *object,
|
||||
if (show_hidden != impl->show_hidden)
|
||||
{
|
||||
impl->show_hidden = show_hidden;
|
||||
_gtk_file_system_model_set_show_hidden (impl->browse_files_model, show_hidden);
|
||||
|
||||
if (impl->browse_files_model)
|
||||
_gtk_file_system_model_set_show_hidden (impl->browse_files_model, show_hidden);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3647,6 +3738,8 @@ list_model_filter_func (GtkFileSystemModel *model,
|
||||
static void
|
||||
install_list_model_filter (GtkFileChooserDefault *impl)
|
||||
{
|
||||
g_assert (impl->browse_files_model != NULL);
|
||||
|
||||
if (impl->current_filter)
|
||||
_gtk_file_system_model_set_filter (impl->browse_files_model,
|
||||
list_model_filter_func,
|
||||
@@ -3766,20 +3859,32 @@ browse_files_model_finished_loading_cb (GtkFileSystemModel *model,
|
||||
}
|
||||
|
||||
/* Gets rid of the old list model and creates a new one for the current folder */
|
||||
static void
|
||||
set_list_model (GtkFileChooserDefault *impl)
|
||||
static gboolean
|
||||
set_list_model (GtkFileChooserDefault *impl,
|
||||
GError **error)
|
||||
{
|
||||
if (impl->browse_files_model)
|
||||
{
|
||||
g_object_unref (impl->browse_files_model);
|
||||
impl->browse_files_model = NULL;
|
||||
|
||||
g_object_unref (impl->sort_model);
|
||||
impl->sort_model = NULL;
|
||||
}
|
||||
|
||||
set_busy_cursor (impl, TRUE);
|
||||
|
||||
impl->browse_files_model = _gtk_file_system_model_new (impl->file_system,
|
||||
impl->current_folder, 0,
|
||||
GTK_FILE_INFO_ALL);
|
||||
GTK_FILE_INFO_ALL,
|
||||
error);
|
||||
if (!impl->browse_files_model)
|
||||
{
|
||||
set_busy_cursor (impl, FALSE);
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_signal_connect (impl->browse_files_model, "finished-loading",
|
||||
G_CALLBACK (browse_files_model_finished_loading_cb), impl);
|
||||
|
||||
@@ -3815,6 +3920,8 @@ set_list_model (GtkFileChooserDefault *impl)
|
||||
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (impl->browse_files_tree_view));
|
||||
gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->browse_files_tree_view),
|
||||
GTK_FILE_SYSTEM_MODEL_DISPLAY_NAME);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3851,6 +3958,7 @@ gtk_file_chooser_default_set_current_folder (GtkFileChooser *chooser,
|
||||
GError **error)
|
||||
{
|
||||
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
|
||||
gboolean result;
|
||||
|
||||
if (impl->local_only &&
|
||||
!gtk_file_system_path_is_local (impl->file_system, path))
|
||||
@@ -3889,8 +3997,11 @@ gtk_file_chooser_default_set_current_folder (GtkFileChooser *chooser,
|
||||
impl->changing_folder = FALSE;
|
||||
}
|
||||
|
||||
/* Create a new list model */
|
||||
set_list_model (impl);
|
||||
/* Create a new list model. This is slightly evil; we store the result value
|
||||
* but perform more actions rather than returning immediately even if it
|
||||
* generates an error.
|
||||
*/
|
||||
result = set_list_model (impl, error);
|
||||
|
||||
/* Refresh controls */
|
||||
|
||||
@@ -3903,7 +4014,7 @@ gtk_file_chooser_default_set_current_folder (GtkFileChooser *chooser,
|
||||
|
||||
g_signal_emit_by_name (impl, "selection-changed", 0);
|
||||
|
||||
return TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
static GtkFilePath *
|
||||
@@ -4024,6 +4135,9 @@ gtk_file_chooser_default_unselect_path (GtkFileChooser *chooser,
|
||||
{
|
||||
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
|
||||
|
||||
if (!impl->browse_files_model)
|
||||
return;
|
||||
|
||||
_gtk_file_system_model_path_do (impl->browse_files_model, path,
|
||||
unselect_func, impl);
|
||||
}
|
||||
@@ -4643,7 +4757,8 @@ set_current_filter (GtkFileChooserDefault *impl,
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (impl->filter_combo),
|
||||
filter_index);
|
||||
|
||||
install_list_model_filter (impl);
|
||||
if (impl->browse_files_model)
|
||||
install_list_model_filter (impl);
|
||||
|
||||
g_object_notify (G_OBJECT (impl), "filter");
|
||||
}
|
||||
@@ -4667,7 +4782,7 @@ check_preview_change (GtkFileChooserDefault *impl)
|
||||
const GtkFileInfo *new_info;
|
||||
|
||||
gtk_tree_view_get_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), &cursor_path, NULL);
|
||||
if (cursor_path)
|
||||
if (cursor_path && impl->sort_model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter child_iter;
|
||||
@@ -5281,7 +5396,8 @@ location_popup_handler (GtkFileChooserDefault *impl)
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
gboolean refocus;
|
||||
char *title;
|
||||
const char *title;
|
||||
const char *accept_stock;
|
||||
|
||||
/* Create dialog */
|
||||
|
||||
@@ -5291,19 +5407,21 @@ location_popup_handler (GtkFileChooserDefault *impl)
|
||||
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||
{
|
||||
title = _("Open Location");
|
||||
accept_stock = GTK_STOCK_OPEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
||||
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
|
||||
title = _("Save in Location");
|
||||
accept_stock = GTK_STOCK_SAVE;
|
||||
}
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons (title,
|
||||
toplevel,
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||
accept_stock, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (dialog), 300, -1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
|
||||
@@ -145,8 +145,8 @@ _gtk_file_chooser_delegate_iface_init (GtkFileChooserIface *iface)
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_set_delegate:
|
||||
* @receiver: a GOobject implementing #GtkFileChooser
|
||||
* @delegate: another GObject implementing #GtkFileChooser
|
||||
* @receiver: a #GObject implementing #GtkFileChooser
|
||||
* @delegate: another #GObject implementing #GtkFileChooser
|
||||
*
|
||||
* Establishes that calls on @receiver for #GtkFileChooser
|
||||
* methods should be delegated to @delegate, and that
|
||||
@@ -162,7 +162,6 @@ _gtk_file_chooser_set_delegate (GtkFileChooser *receiver,
|
||||
g_return_if_fail (GTK_IS_FILE_CHOOSER (delegate));
|
||||
|
||||
g_object_set_data (G_OBJECT (receiver), "gtk-file-chooser-delegate", delegate);
|
||||
|
||||
g_signal_connect (delegate, "notify",
|
||||
G_CALLBACK (delegate_notify), receiver);
|
||||
g_signal_connect (delegate, "current-folder-changed",
|
||||
@@ -294,11 +293,12 @@ delegate_notify (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
gpointer data)
|
||||
{
|
||||
if (pspec->param_id >= GTK_FILE_CHOOSER_PROP_FIRST &&
|
||||
pspec->param_id <= GTK_FILE_CHOOSER_PROP_LAST)
|
||||
{
|
||||
g_object_notify (data, pspec->name);
|
||||
}
|
||||
gpointer iface;
|
||||
|
||||
iface = g_type_interface_peek (g_type_class_peek (G_OBJECT_TYPE (object)),
|
||||
gtk_file_chooser_get_type ());
|
||||
if (g_object_interface_find_property (iface, pspec->name))
|
||||
g_object_notify (data, pspec->name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ gtk_file_filter_filter (GtkFileFilter *filter,
|
||||
break;
|
||||
case FILTER_RULE_PATTERN:
|
||||
if (filter_info->display_name != NULL &&
|
||||
_gtk_fnmatch (rule->u.pattern, filter_info->display_name))
|
||||
_gtk_fnmatch (rule->u.pattern, filter_info->display_name, FALSE))
|
||||
return TRUE;
|
||||
break;
|
||||
case FILTER_RULE_CUSTOM:
|
||||
|
||||
+3
-3
@@ -3694,7 +3694,7 @@ find_completion_dir (gchar *text_to_complete,
|
||||
for (i = 0; i < dir->sent->entry_count; i += 1)
|
||||
{
|
||||
if (dir->sent->entries[i].is_dir &&
|
||||
_gtk_fnmatch (pat_buf, dir->sent->entries[i].entry_name))
|
||||
_gtk_fnmatch (pat_buf, dir->sent->entries[i].entry_name, TRUE))
|
||||
{
|
||||
if (found)
|
||||
{
|
||||
@@ -3844,7 +3844,7 @@ attempt_file_completion (CompletionState *cmpl_state)
|
||||
{
|
||||
if (dir->sent->entries[dir->cmpl_index].is_dir)
|
||||
{
|
||||
if (_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name))
|
||||
if (_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, TRUE))
|
||||
{
|
||||
CompletionDir* new_dir;
|
||||
|
||||
@@ -3892,7 +3892,7 @@ attempt_file_completion (CompletionState *cmpl_state)
|
||||
append_completion_text (dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state);
|
||||
|
||||
cmpl_state->the_completion.is_a_completion =
|
||||
_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name);
|
||||
_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, TRUE);
|
||||
|
||||
cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir;
|
||||
if (dir->sent->entries[dir->cmpl_index].is_dir)
|
||||
|
||||
+48
-159
@@ -161,11 +161,6 @@ static void file_model_node_clear (GtkFileSystemModel *mode
|
||||
static FileModelNode * file_model_node_get_children (GtkFileSystemModel *model,
|
||||
FileModelNode *node);
|
||||
|
||||
#if 0
|
||||
static void roots_changed_callback (GtkFileSystem *file_system,
|
||||
GtkFileSystemModel *model);
|
||||
#endif
|
||||
|
||||
static void deleted_callback (GtkFileFolder *folder,
|
||||
FileModelNode *node);
|
||||
static void files_added_callback (GtkFileFolder *folder,
|
||||
@@ -722,26 +717,48 @@ queue_finished_loading (GtkFileSystemModel *model)
|
||||
* that is desired about the files. This will
|
||||
* determine what information is returned by
|
||||
* _gtk_file_system_model_get_info().
|
||||
* @error: location to store error, or %NULL.
|
||||
*
|
||||
* Creates a new #GtkFileSystemModel object. The #GtkFileSystemModel
|
||||
* object wraps a #GtkFileSystem interface as a #GtkTreeModel.
|
||||
* Using the @root_path and @max_depth parameters, the tree model
|
||||
* can be restricted to a subportion of the entire file system.
|
||||
*
|
||||
* Return value: the newly created #GtkFileSystemModel object.
|
||||
* Return value: the newly created #GtkFileSystemModel object, or NULL if there
|
||||
* was an error.
|
||||
**/
|
||||
GtkFileSystemModel *
|
||||
_gtk_file_system_model_new (GtkFileSystem *file_system,
|
||||
const GtkFilePath *root_path,
|
||||
gint max_depth,
|
||||
GtkFileInfoType types)
|
||||
GtkFileInfoType types,
|
||||
GError **error)
|
||||
{
|
||||
GtkFileSystemModel *model;
|
||||
GSList *roots = NULL;
|
||||
GtkFileFolder *root_folder;
|
||||
GSList *roots;
|
||||
GSList *tmp_list;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_SYSTEM (file_system), NULL);
|
||||
g_return_val_if_fail (root_path != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
/* First, try to load the folder */
|
||||
|
||||
types |= GTK_FILE_INFO_IS_FOLDER | GTK_FILE_INFO_IS_HIDDEN;
|
||||
|
||||
root_folder = gtk_file_system_get_folder (file_system, root_path, types, error);
|
||||
|
||||
if (!root_folder)
|
||||
return NULL;
|
||||
|
||||
if (!gtk_file_folder_list_children (root_folder, &roots, error))
|
||||
{
|
||||
g_object_unref (root_folder);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Then, actually create the model and the root nodes */
|
||||
|
||||
model = g_object_new (GTK_TYPE_FILE_SYSTEM_MODEL, NULL);
|
||||
model->file_system = g_object_ref (file_system);
|
||||
@@ -749,48 +766,25 @@ _gtk_file_system_model_new (GtkFileSystem *file_system,
|
||||
model->max_depth = G_MAXUSHORT;
|
||||
else
|
||||
model->max_depth = MIN (max_depth, G_MAXUSHORT);
|
||||
model->types = types | GTK_FILE_INFO_IS_FOLDER | GTK_FILE_INFO_IS_HIDDEN;
|
||||
|
||||
if (root_path)
|
||||
{
|
||||
GSList *child_paths;
|
||||
model->types = types;
|
||||
model->root_folder = root_folder;
|
||||
model->root_path = gtk_file_path_copy (root_path);
|
||||
|
||||
model->root_path = gtk_file_path_copy (root_path);
|
||||
model->root_folder = gtk_file_system_get_folder (file_system, root_path,
|
||||
model->types,
|
||||
NULL); /* NULL-GError */
|
||||
|
||||
if (model->root_folder)
|
||||
{
|
||||
if (gtk_file_folder_list_children (model->root_folder,
|
||||
&child_paths,
|
||||
NULL)) /* NULL-GError */
|
||||
roots = child_paths;
|
||||
|
||||
if (gtk_file_folder_is_finished_loading (model->root_folder))
|
||||
queue_finished_loading (model); /* done in an idle because we are being created */
|
||||
else
|
||||
g_signal_connect_object (model->root_folder, "finished-loading",
|
||||
G_CALLBACK (root_folder_finished_loading_cb), model, 0);
|
||||
|
||||
g_signal_connect_object (model->root_folder, "deleted",
|
||||
G_CALLBACK (root_deleted_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-added",
|
||||
G_CALLBACK (root_files_added_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-changed",
|
||||
G_CALLBACK (root_files_changed_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-removed",
|
||||
G_CALLBACK (root_files_removed_callback), model, 0);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
if (gtk_file_folder_is_finished_loading (model->root_folder))
|
||||
queue_finished_loading (model); /* done in an idle because we are being created */
|
||||
else
|
||||
{
|
||||
roots = gtk_file_system_list_roots (file_system);
|
||||
g_signal_connect_object (file_system, "roots-changed",
|
||||
G_CALLBACK (roots_changed_callback), model, 0);
|
||||
}
|
||||
#endif
|
||||
g_signal_connect_object (model->root_folder, "finished-loading",
|
||||
G_CALLBACK (root_folder_finished_loading_cb), model, 0);
|
||||
|
||||
g_signal_connect_object (model->root_folder, "deleted",
|
||||
G_CALLBACK (root_deleted_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-added",
|
||||
G_CALLBACK (root_files_added_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-changed",
|
||||
G_CALLBACK (root_files_changed_callback), model, 0);
|
||||
g_signal_connect_object (model->root_folder, "files-removed",
|
||||
G_CALLBACK (root_files_removed_callback), model, 0);
|
||||
|
||||
roots = gtk_file_paths_sort (roots);
|
||||
|
||||
@@ -805,7 +799,7 @@ _gtk_file_system_model_new (GtkFileSystem *file_system,
|
||||
}
|
||||
g_slist_free (roots);
|
||||
|
||||
model->roots = (FileModelNode *)g_slist_reverse ((GSList *)model->roots);
|
||||
model->roots = (FileModelNode *) g_slist_reverse ((GSList *)model->roots);
|
||||
|
||||
return model;
|
||||
}
|
||||
@@ -1195,8 +1189,6 @@ _gtk_file_system_model_add_editable (GtkFileSystemModel *model, GtkTreeIter *ite
|
||||
node->next = model->roots;
|
||||
model->roots = node;
|
||||
|
||||
file_model_node_ref (node);
|
||||
|
||||
path = gtk_tree_path_new ();
|
||||
gtk_tree_path_append_index (path, 0);
|
||||
iter->user_data = node;
|
||||
@@ -1218,13 +1210,15 @@ void
|
||||
_gtk_file_system_model_remove_editable (GtkFileSystemModel *model)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
FileModelNode *node;
|
||||
|
||||
g_return_if_fail (model->has_editable);
|
||||
|
||||
model->has_editable = FALSE;
|
||||
file_model_node_unref (model, model->roots);
|
||||
|
||||
node = model->roots;
|
||||
model->roots = model->roots->next;
|
||||
file_model_node_free (node);
|
||||
|
||||
path = gtk_tree_path_new ();
|
||||
gtk_tree_path_append_index (path, 0);
|
||||
@@ -1277,15 +1271,8 @@ file_model_node_get_info (GtkFileSystemModel *model,
|
||||
node->path,
|
||||
NULL); /* NULL-GError */
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
node->info = gtk_file_system_get_root_info (model->file_system,
|
||||
node->path,
|
||||
model->types,
|
||||
NULL); /* NULL-GError */
|
||||
}
|
||||
#endif
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
return node->info;
|
||||
@@ -1607,6 +1594,7 @@ do_files_added (GtkFileSystemModel *model,
|
||||
if (new->is_visible)
|
||||
{
|
||||
iter.user_data = new;
|
||||
gtk_file_path_free (path);
|
||||
path = gtk_tree_model_get_path (tree_model, &iter);
|
||||
gtk_tree_model_row_inserted (tree_model, path, &iter);
|
||||
|
||||
@@ -1777,7 +1765,7 @@ do_files_removed (GtkFileSystemModel *model,
|
||||
if (children->is_visible)
|
||||
n_visible--;
|
||||
|
||||
if (n_visible == 0)
|
||||
if (parent_node && n_visible == 0)
|
||||
{
|
||||
FileModelNode *dummy = file_model_node_new (model, NULL);
|
||||
dummy->is_visible = TRUE;
|
||||
@@ -1821,105 +1809,6 @@ do_files_removed (GtkFileSystemModel *model,
|
||||
g_slist_free (sorted_paths);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
roots_changed_callback (GtkFileSystem *file_system,
|
||||
GtkFileSystemModel *model)
|
||||
{
|
||||
GtkTreeModel *tree_model = GTK_TREE_MODEL (model);
|
||||
GSList *new_roots;
|
||||
GSList *tmp_list;
|
||||
FileModelNode *children;
|
||||
FileModelNode *prev = NULL;
|
||||
GtkTreePath *path;
|
||||
|
||||
new_roots = gtk_file_system_list_roots (file_system);
|
||||
new_roots = gtk_file_paths_sort (new_roots);
|
||||
|
||||
children = model->roots;
|
||||
tmp_list = new_roots;
|
||||
path = gtk_tree_path_new ();
|
||||
gtk_tree_path_down (path);
|
||||
|
||||
while (children || tmp_list)
|
||||
{
|
||||
FileModelNode *next = NULL;
|
||||
int cmp;
|
||||
|
||||
if (tmp_list && children)
|
||||
cmp = gtk_file_path_compare (children->path, tmp_list->data);
|
||||
else if (children)
|
||||
cmp = -1;
|
||||
else
|
||||
cmp = 1;
|
||||
|
||||
if (cmp < 0)
|
||||
{
|
||||
next = children->next;
|
||||
|
||||
if (prev)
|
||||
prev->next = children->next;
|
||||
else
|
||||
model->roots = children->next;
|
||||
|
||||
if (children->is_visible)
|
||||
gtk_tree_model_row_deleted (tree_model, path);
|
||||
|
||||
file_model_node_free (children);
|
||||
}
|
||||
else if (cmp == 0)
|
||||
{
|
||||
/* Already there
|
||||
*/
|
||||
next = children->next;
|
||||
prev = children;
|
||||
if (children->is_visible)
|
||||
gtk_tree_path_next (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
FileModelNode *node = file_model_node_new (model, tmp_list->data);
|
||||
node->is_visible = file_model_node_is_visible (model, node);
|
||||
node->next = children;
|
||||
node->depth = 0;
|
||||
|
||||
if (prev)
|
||||
prev->next = node;
|
||||
else
|
||||
model->roots = node;
|
||||
|
||||
if (node->is_visible)
|
||||
{
|
||||
iter.user_data = node;
|
||||
gtk_tree_model_row_inserted (tree_model, path, &iter);
|
||||
|
||||
if (gtk_file_system_model_iter_has_child (tree_model, &iter))
|
||||
gtk_tree_model_row_has_child_toggled (tree_model, path, &iter);
|
||||
|
||||
gtk_tree_path_next (path);
|
||||
}
|
||||
|
||||
prev = node;
|
||||
}
|
||||
|
||||
if (cmp <= 0)
|
||||
{
|
||||
children = next;
|
||||
}
|
||||
|
||||
if (cmp >= 0)
|
||||
{
|
||||
gtk_file_path_free (tmp_list->data);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_free (new_roots);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
deleted_callback (GtkFileFolder *folder,
|
||||
FileModelNode *node)
|
||||
|
||||
@@ -44,7 +44,8 @@ typedef enum {
|
||||
GtkFileSystemModel *_gtk_file_system_model_new (GtkFileSystem *file_system,
|
||||
const GtkFilePath *root_path,
|
||||
gint max_depth,
|
||||
GtkFileInfoType types);
|
||||
GtkFileInfoType types,
|
||||
GError **error);
|
||||
const GtkFileInfo * _gtk_file_system_model_get_info (GtkFileSystemModel *model,
|
||||
GtkTreeIter *iter);
|
||||
const GtkFilePath * _gtk_file_system_model_get_path (GtkFileSystemModel *model,
|
||||
|
||||
+201
-103
@@ -24,6 +24,7 @@
|
||||
#include "gtkfilesystemunix.h"
|
||||
#include "gtkicontheme.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkstock.h"
|
||||
|
||||
#define XDG_PREFIX _gtk_xdg
|
||||
#include "xdgmime/xdgmime.h"
|
||||
@@ -63,9 +64,9 @@ struct _GtkFileSystemUnix
|
||||
/* Icon type, supplemented by MIME type
|
||||
*/
|
||||
typedef enum {
|
||||
ICON_UNDECIDED,
|
||||
ICON_NONE,
|
||||
ICON_REGULAR, /* Use mime type for icon */
|
||||
ICON_UNDECIDED, /* Only used while we have not yet computed the icon in a struct stat_info_entry */
|
||||
ICON_NONE, /* "Could not compute the icon type" */
|
||||
ICON_REGULAR, /* Use mime type for icon */
|
||||
ICON_BLOCK_DEVICE,
|
||||
ICON_BROKEN_SYMBOLIC_LINK,
|
||||
ICON_CHARACTER_DEVICE,
|
||||
@@ -694,6 +695,45 @@ get_cached_icon (GtkWidget *widget,
|
||||
return element->pixbuf ? g_object_ref (element->pixbuf) : NULL;
|
||||
}
|
||||
|
||||
/* Renders a fallback icon from the stock system */
|
||||
static GdkPixbuf *
|
||||
get_fallback_icon (GtkWidget *widget,
|
||||
IconType icon_type,
|
||||
GError **error)
|
||||
{
|
||||
const char *stock_name;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
switch (icon_type)
|
||||
{
|
||||
case ICON_BLOCK_DEVICE:
|
||||
stock_name = GTK_STOCK_HARDDISK;
|
||||
break;
|
||||
|
||||
case ICON_DIRECTORY:
|
||||
stock_name = "gtk-directory"; /* GTK_STOCK_DIRECTORY is defined in gtkstock.h until GTK+ 2.6 */
|
||||
break;
|
||||
|
||||
case ICON_EXECUTABLE:
|
||||
stock_name = GTK_STOCK_EXECUTE;
|
||||
break;
|
||||
|
||||
default:
|
||||
stock_name = "gtk-file"; /* GTK_STOCK_FILE is defined in gtkstock.h until GTK+ 2.6 */
|
||||
break;
|
||||
}
|
||||
|
||||
pixbuf = gtk_widget_render_icon (widget, stock_name, GTK_ICON_SIZE_SMALL_TOOLBAR, NULL);
|
||||
if (!pixbuf)
|
||||
g_set_error (error,
|
||||
GTK_FILE_SYSTEM_ERROR,
|
||||
GTK_FILE_SYSTEM_ERROR_FAILED,
|
||||
_("Could not get a stock icon for %s"),
|
||||
stock_name);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
gtk_file_system_unix_volume_render_icon (GtkFileSystem *file_system,
|
||||
GtkFileSystemVolume *volume,
|
||||
@@ -701,8 +741,16 @@ gtk_file_system_unix_volume_render_icon (GtkFileSystem *file_system,
|
||||
gint pixel_size,
|
||||
GError **error)
|
||||
{
|
||||
/* FIXME: set the GError if we can't load the icon */
|
||||
return get_cached_icon (widget, "gnome-fs-blockdev", pixel_size);
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
pixbuf = get_cached_icon (widget, "gnome-fs-blockdev", pixel_size);
|
||||
if (pixbuf)
|
||||
return pixbuf;
|
||||
|
||||
pixbuf = get_fallback_icon (widget, ICON_BLOCK_DEVICE, error);
|
||||
g_assert (pixbuf != NULL);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -1018,22 +1066,32 @@ static GtkFilePath *
|
||||
gtk_file_system_unix_uri_to_path (GtkFileSystem *file_system,
|
||||
const gchar *uri)
|
||||
{
|
||||
GtkFilePath *path;
|
||||
gchar *filename = g_filename_from_uri (uri, NULL, NULL);
|
||||
|
||||
if (filename)
|
||||
return gtk_file_path_new_steal (filename);
|
||||
{
|
||||
path = filename_to_path (filename);
|
||||
g_free (filename);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
path = NULL;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static GtkFilePath *
|
||||
gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system,
|
||||
const gchar *filename)
|
||||
{
|
||||
return gtk_file_path_new_dup (filename);
|
||||
return filename_to_path (filename);
|
||||
}
|
||||
|
||||
/* Returns the name of the icon to be used for a path which is known to be a
|
||||
* directory. This can vary for Home, Desktop, etc.
|
||||
*/
|
||||
static const char *
|
||||
get_icon_for_directory (const char *path)
|
||||
get_icon_name_for_directory (const char *path)
|
||||
{
|
||||
static char *desktop_path = NULL;
|
||||
|
||||
@@ -1051,33 +1109,33 @@ get_icon_for_directory (const char *path)
|
||||
return "gnome-fs-directory";
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
|
||||
const GtkFilePath *path,
|
||||
GtkWidget *widget,
|
||||
gint pixel_size,
|
||||
GError **error)
|
||||
/* Computes our internal icon type based on a path name; also returns the MIME
|
||||
* type in case we come up with ICON_REGULAR.
|
||||
*/
|
||||
static IconType
|
||||
get_icon_type_from_path (GtkFileSystemUnix *system_unix,
|
||||
const GtkFilePath *path,
|
||||
const char **mime_type)
|
||||
{
|
||||
const char *filename;
|
||||
IconType icon_type;
|
||||
const char *mime_type = NULL;
|
||||
char *dirname;
|
||||
GtkFileSystemUnix *system_unix;
|
||||
GtkFileFolderUnix *folder_unix;
|
||||
IconType icon_type;
|
||||
|
||||
system_unix = GTK_FILE_SYSTEM_UNIX (file_system);
|
||||
filename = gtk_file_path_get_string (path);
|
||||
dirname = g_path_get_dirname (filename);
|
||||
folder_unix = g_hash_table_lookup (system_unix->folder_hash, dirname);
|
||||
g_free (dirname);
|
||||
|
||||
*mime_type = NULL;
|
||||
|
||||
if (folder_unix)
|
||||
{
|
||||
char *basename;
|
||||
struct stat_info_entry *entry;
|
||||
|
||||
if (!fill_in_stats (folder_unix, error))
|
||||
return NULL;
|
||||
if (!fill_in_stats (folder_unix, NULL))
|
||||
return ICON_NONE;
|
||||
|
||||
basename = g_path_get_basename (filename);
|
||||
entry = g_hash_table_lookup (folder_unix->stat_info, basename);
|
||||
@@ -1085,12 +1143,15 @@ gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
|
||||
if (entry)
|
||||
{
|
||||
if (entry->icon_type == ICON_UNDECIDED)
|
||||
entry->icon_type = get_icon_type_from_stat (&entry->statbuf);
|
||||
{
|
||||
entry->icon_type = get_icon_type_from_stat (&entry->statbuf);
|
||||
g_assert (entry->icon_type != ICON_UNDECIDED);
|
||||
}
|
||||
icon_type = entry->icon_type;
|
||||
if (icon_type == ICON_REGULAR)
|
||||
{
|
||||
(void)fill_in_mime_type (folder_unix, NULL);
|
||||
mime_type = entry->mime_type;
|
||||
*mime_type = entry->mime_type;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1098,87 +1159,132 @@ gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
g_print ("No folder open for %s\n", filename);
|
||||
#endif
|
||||
|
||||
icon_type = get_icon_type (filename, error);
|
||||
icon_type = get_icon_type (filename, NULL);
|
||||
if (icon_type == ICON_REGULAR)
|
||||
mime_type = xdg_mime_get_mime_type_for_file (filename);
|
||||
*mime_type = xdg_mime_get_mime_type_for_file (filename);
|
||||
}
|
||||
|
||||
return icon_type;
|
||||
}
|
||||
|
||||
/* FIXME: this function should not return NULL without setting the GError; we
|
||||
* should perhaps provide a "never fails" generic stock icon for when all else
|
||||
* fails.
|
||||
*/
|
||||
/* Renders an icon for a non-ICON_REGULAR file */
|
||||
static GdkPixbuf *
|
||||
get_special_icon (IconType icon_type,
|
||||
const GtkFilePath *path,
|
||||
GtkWidget *widget,
|
||||
gint pixel_size)
|
||||
{
|
||||
const char *name;
|
||||
|
||||
if (icon_type == ICON_NONE)
|
||||
return NULL;
|
||||
g_assert (icon_type != ICON_REGULAR);
|
||||
|
||||
if (icon_type != ICON_REGULAR)
|
||||
switch (icon_type)
|
||||
{
|
||||
const char *name;
|
||||
case ICON_BLOCK_DEVICE:
|
||||
name = "gnome-fs-blockdev";
|
||||
break;
|
||||
case ICON_BROKEN_SYMBOLIC_LINK:
|
||||
name = "gnome-fs-symlink";
|
||||
break;
|
||||
case ICON_CHARACTER_DEVICE:
|
||||
name = "gnome-fs-chardev";
|
||||
break;
|
||||
case ICON_DIRECTORY: {
|
||||
const char *filename;
|
||||
|
||||
switch (icon_type)
|
||||
{
|
||||
case ICON_BLOCK_DEVICE:
|
||||
name = "gnome-fs-blockdev";
|
||||
break;
|
||||
case ICON_BROKEN_SYMBOLIC_LINK:
|
||||
name = "gnome-fs-symlink";
|
||||
break;
|
||||
case ICON_CHARACTER_DEVICE:
|
||||
name = "gnome-fs-chardev";
|
||||
break;
|
||||
case ICON_DIRECTORY:
|
||||
name = get_icon_for_directory (filename);
|
||||
break;
|
||||
case ICON_EXECUTABLE:
|
||||
name ="gnome-fs-executable";
|
||||
break;
|
||||
case ICON_FIFO:
|
||||
name = "gnome-fs-fifo";
|
||||
break;
|
||||
case ICON_SOCKET:
|
||||
name = "gnome-fs-socket";
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return get_cached_icon (widget, name, pixel_size);
|
||||
filename = gtk_file_path_get_string (path);
|
||||
name = get_icon_name_for_directory (filename);
|
||||
break;
|
||||
}
|
||||
case ICON_EXECUTABLE:
|
||||
name ="gnome-fs-executable";
|
||||
break;
|
||||
case ICON_FIFO:
|
||||
name = "gnome-fs-fifo";
|
||||
break;
|
||||
case ICON_SOCKET:
|
||||
name = "gnome-fs-socket";
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mime_type)
|
||||
{
|
||||
const char *separator;
|
||||
GString *icon_name;
|
||||
GdkPixbuf *pixbuf;
|
||||
return get_cached_icon (widget, name, pixel_size);
|
||||
}
|
||||
|
||||
separator = strchr (mime_type, '/');
|
||||
if (!separator)
|
||||
return NULL;
|
||||
static GdkPixbuf *
|
||||
get_icon_for_mime_type (GtkWidget *widget,
|
||||
const char *mime_type,
|
||||
gint pixel_size)
|
||||
{
|
||||
const char *separator;
|
||||
GString *icon_name;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
icon_name = g_string_new ("gnome-mime-");
|
||||
g_string_append_len (icon_name, mime_type, separator - mime_type);
|
||||
g_string_append_c (icon_name, '-');
|
||||
g_string_append (icon_name, separator + 1);
|
||||
pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
|
||||
g_string_free (icon_name, TRUE);
|
||||
if (pixbuf)
|
||||
return pixbuf;
|
||||
separator = strchr (mime_type, '/');
|
||||
if (!separator)
|
||||
return NULL; /* maybe we should return a GError with "invalid MIME-type" */
|
||||
|
||||
icon_name = g_string_new ("gnome-mime-");
|
||||
g_string_append_len (icon_name, mime_type, separator - mime_type);
|
||||
pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
|
||||
g_string_free (icon_name, TRUE);
|
||||
if (pixbuf)
|
||||
return pixbuf;
|
||||
}
|
||||
icon_name = g_string_new ("gnome-mime-");
|
||||
g_string_append_len (icon_name, mime_type, separator - mime_type);
|
||||
g_string_append_c (icon_name, '-');
|
||||
g_string_append (icon_name, separator + 1);
|
||||
pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
|
||||
g_string_free (icon_name, TRUE);
|
||||
if (pixbuf)
|
||||
return pixbuf;
|
||||
|
||||
return get_cached_icon (widget, "gnome-fs-regular", pixel_size);
|
||||
icon_name = g_string_new ("gnome-mime-");
|
||||
g_string_append_len (icon_name, mime_type, separator - mime_type);
|
||||
pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
|
||||
g_string_free (icon_name, TRUE);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
|
||||
const GtkFilePath *path,
|
||||
GtkWidget *widget,
|
||||
gint pixel_size,
|
||||
GError **error)
|
||||
{
|
||||
GtkFileSystemUnix *system_unix;
|
||||
IconType icon_type;
|
||||
const char *mime_type;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
system_unix = GTK_FILE_SYSTEM_UNIX (file_system);
|
||||
|
||||
icon_type = get_icon_type_from_path (system_unix, path, &mime_type);
|
||||
|
||||
switch (icon_type) {
|
||||
case ICON_NONE:
|
||||
goto fallback;
|
||||
|
||||
case ICON_REGULAR:
|
||||
pixbuf = get_icon_for_mime_type (widget, mime_type, pixel_size);
|
||||
break;
|
||||
|
||||
default:
|
||||
pixbuf = get_special_icon (icon_type, path, widget, pixel_size);
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
goto out;
|
||||
|
||||
fallback:
|
||||
|
||||
pixbuf = get_cached_icon (widget, "gnome-fs-regular", pixel_size);
|
||||
if (pixbuf)
|
||||
goto out;
|
||||
|
||||
pixbuf = get_fallback_icon (widget, icon_type, error);
|
||||
|
||||
out:
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1725,18 +1831,7 @@ fill_in_names (GtkFileFolderUnix *folder_unix, GError **error)
|
||||
(GDestroyNotify)free_stat_info_entry);
|
||||
dir = g_dir_open (folder_unix->filename, 0, error);
|
||||
if (!dir)
|
||||
{
|
||||
int save_errno = errno;
|
||||
gchar *filename_utf8 = g_filename_to_utf8 (folder_unix->filename, -1, NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GTK_FILE_SYSTEM_ERROR,
|
||||
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
|
||||
_("error getting information for '%s': %s"),
|
||||
filename_utf8 ? filename_utf8 : "???",
|
||||
g_strerror (save_errno));
|
||||
g_free (filename_utf8);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
@@ -1833,7 +1928,10 @@ fill_in_mime_type (GtkFileFolderUnix *folder_unix, GError **error)
|
||||
static GtkFilePath *
|
||||
filename_to_path (const char *filename)
|
||||
{
|
||||
return gtk_file_path_new_dup (filename);
|
||||
char *tmp;
|
||||
|
||||
tmp = remove_trailing_slash (filename);
|
||||
return gtk_file_path_new_steal (tmp);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
+66
-27
@@ -1,6 +1,7 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* gtkfilesystemwin32.c: Default implementation of GtkFileSystem for Windows
|
||||
* Copyright (C) 2003, Red Hat, Inc.
|
||||
* Copyright (C) 2004, Hans Breuer
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -933,53 +934,91 @@ extract_icon (const char* filename)
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
WORD iicon;
|
||||
HICON hicon;
|
||||
char filename_copy[MAX_PATH];
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return NULL;
|
||||
|
||||
hicon = ExtractAssociatedIcon (GetModuleHandle (NULL), filename, &iicon);
|
||||
/* the ugly ExtractAssociatedIcon modifies filename in place - at least on win98 */
|
||||
strcpy(filename_copy, filename);
|
||||
hicon = ExtractAssociatedIcon (GetModuleHandle (NULL), filename_copy, &iicon);
|
||||
if (hicon > (HICON)1)
|
||||
{
|
||||
ICONINFO ii;
|
||||
|
||||
if (GetIconInfo (hicon, &ii))
|
||||
{
|
||||
SIZE size;
|
||||
GdkPixmap *pixmap;
|
||||
GdkGC *gc;
|
||||
HDC hdc;
|
||||
struct
|
||||
{
|
||||
BITMAPINFOHEADER bi;
|
||||
RGBQUAD colors[2];
|
||||
} bmi;
|
||||
HDC hdc;
|
||||
|
||||
if (!GetBitmapDimensionEx (ii.hbmColor, &size))
|
||||
g_warning ("GetBitmapDimensionEx failed.");
|
||||
memset (&bmi, 0, sizeof (bmi));
|
||||
bmi.bi.biSize = sizeof (bmi.bi);
|
||||
hdc = CreateCompatibleDC (NULL);
|
||||
|
||||
if (size.cx < 1) size.cx = 32;
|
||||
if (size.cy < 1) size.cy = 32;
|
||||
|
||||
pixmap = gdk_pixmap_new (NULL, size.cx, size.cy,
|
||||
gdk_screen_get_system_visual (gdk_screen_get_default ())->depth);
|
||||
gc = gdk_gc_new (pixmap);
|
||||
hdc = gdk_win32_hdc_get (GDK_DRAWABLE (pixmap), gc, 0);
|
||||
if (GetDIBits (hdc, ii.hbmColor, 0, 1, NULL, (BITMAPINFO *)&bmi, DIB_RGB_COLORS))
|
||||
{
|
||||
gchar *pixels, *bits;
|
||||
gint rowstride, x, y, w = bmi.bi.biWidth, h = bmi.bi.biHeight;
|
||||
|
||||
if (!DrawIcon (hdc, 0, 0, hicon))
|
||||
g_warning ("DrawIcon failed");
|
||||
bmi.bi.biBitCount = 24;
|
||||
bmi.bi.biCompression = BI_RGB;
|
||||
bmi.bi.biHeight = -h;
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, w, h);
|
||||
bits = g_malloc (4 * w * h);
|
||||
|
||||
gdk_win32_hdc_release (GDK_DRAWABLE (pixmap), gc, 0);
|
||||
/* color data */
|
||||
if (!GetDIBits (hdc, ii.hbmColor, 0, h, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS))
|
||||
g_warning(G_STRLOC ": Failed to get dibits");
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_drawable (
|
||||
NULL, pixmap,
|
||||
gdk_screen_get_system_colormap (gdk_screen_get_default ()),
|
||||
0, 0, 0, 0, size.cx, size.cy);
|
||||
g_object_unref (pixmap);
|
||||
g_object_unref (gc);
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
for (x = 0; x < w; x++)
|
||||
{
|
||||
pixels[2] = bits[(x+y*w) * 3];
|
||||
pixels[1] = bits[(x+y*w) * 3 + 1];
|
||||
pixels[0] = bits[(x+y*w) * 3 + 2];
|
||||
pixels += 4;
|
||||
}
|
||||
pixels += (w * 4 - rowstride);
|
||||
}
|
||||
/* transparency */
|
||||
if (!GetDIBits (hdc, ii.hbmMask, 0, h, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS))
|
||||
g_warning(G_STRLOC ": Failed to get dibits");
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
for (x = 0; x < w; x++)
|
||||
{
|
||||
pixels[3] = 255 - bits[(x + y * w) * 3];
|
||||
pixels += 4;
|
||||
}
|
||||
pixels += (w * 4 - rowstride);
|
||||
}
|
||||
|
||||
/* release temporary resources */
|
||||
g_free (bits);
|
||||
if (!DeleteObject (ii.hbmColor) || !DeleteObject (ii.hbmMask))
|
||||
g_warning(G_STRLOC ": Leaking Icon Bitmaps ?");
|
||||
}
|
||||
else
|
||||
g_warning(G_STRLOC ": GetDIBits () failed, %s", g_win32_error_message (GetLastError ()));
|
||||
|
||||
DeleteDC (hdc);
|
||||
}
|
||||
else
|
||||
g_print ("GetIconInfo failed: %s\n", g_win32_error_message (GetLastError ()));
|
||||
g_warning(G_STRLOC ": GetIconInfo failed: %s\n", g_win32_error_message (GetLastError ()));
|
||||
|
||||
if (!DestroyIcon (hicon))
|
||||
g_warning ("DestroyIcon failed");
|
||||
g_warning(G_STRLOC ": DestroyIcon failed");
|
||||
}
|
||||
else
|
||||
g_print ("ExtractAssociatedIcon failed: %s\n", g_win32_error_message (GetLastError ()));
|
||||
g_print ("ExtractAssociatedIcon(%s) failed: %s\n", filename, g_win32_error_message (GetLastError ()));
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
@@ -1048,7 +1087,7 @@ gtk_file_system_win32_render_icon (GtkFileSystem *file_system,
|
||||
case DRIVE_CDROM :
|
||||
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_CDROM);
|
||||
break;
|
||||
case DRIVE_FIXED : /* need a hard disk icon */
|
||||
case DRIVE_FIXED :
|
||||
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_HARDDISK);
|
||||
break;
|
||||
default :
|
||||
|
||||
+2
-1
@@ -878,9 +878,10 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
|
||||
gint n_families, n_faces, i;
|
||||
|
||||
n_families = 0;
|
||||
n_faces = 0;
|
||||
pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (font_button)),
|
||||
&families, &n_families);
|
||||
n_faces = 0;
|
||||
faces = NULL;
|
||||
for (i = 0; i < n_families; i++)
|
||||
{
|
||||
const gchar *name = pango_font_family_get_name (families[i]);
|
||||
|
||||
+43
-2
@@ -279,6 +279,28 @@ static void gtk_font_selection_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
/* Handles key press events on the lists, so that we can trap Enter to
|
||||
* activate the default button on our own.
|
||||
*/
|
||||
static gboolean
|
||||
list_row_activated (GtkWidget *widget)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget)));
|
||||
if (!GTK_WIDGET_TOPLEVEL (window))
|
||||
window = NULL;
|
||||
|
||||
if (window
|
||||
&& widget != window->default_widget
|
||||
&& !(widget == window->focus_widget &&
|
||||
(!window->default_widget || !GTK_WIDGET_SENSITIVE (window->default_widget))))
|
||||
{
|
||||
gtk_window_activate_default (window);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
@@ -359,6 +381,9 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
fontsel->family_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
g_object_unref (model);
|
||||
|
||||
g_signal_connect (fontsel->family_list, "row-activated",
|
||||
G_CALLBACK (list_row_activated), fontsel);
|
||||
|
||||
column = gtk_tree_view_column_new_with_attributes ("Family",
|
||||
gtk_cell_renderer_text_new (),
|
||||
"text", FAMILY_NAME_COLUMN,
|
||||
@@ -392,6 +417,8 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
G_TYPE_STRING); /* FACE_NAME_COLUMN */
|
||||
fontsel->face_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
g_object_unref (model);
|
||||
g_signal_connect (fontsel->face_list, "row-activated",
|
||||
G_CALLBACK (list_row_activated), fontsel);
|
||||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (style_label), fontsel->face_list);
|
||||
|
||||
@@ -425,6 +452,8 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
model = gtk_list_store_new (1, G_TYPE_INT);
|
||||
fontsel->size_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
g_object_unref (model);
|
||||
g_signal_connect (fontsel->size_list, "row-activated",
|
||||
G_CALLBACK (list_row_activated), fontsel);
|
||||
|
||||
column = gtk_tree_view_column_new_with_attributes ("Size",
|
||||
gtk_cell_renderer_text_new (),
|
||||
@@ -958,7 +987,10 @@ gtk_font_selection_size_activate (GtkWidget *w,
|
||||
text = gtk_entry_get_text (GTK_ENTRY (fontsel->size_entry));
|
||||
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
|
||||
gtk_font_selection_set_size (fontsel, new_size);
|
||||
if (fontsel->size != new_size)
|
||||
gtk_font_selection_set_size (fontsel, new_size);
|
||||
else
|
||||
list_row_activated (w);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -966,7 +998,16 @@ gtk_font_selection_size_focus_out (GtkWidget *w,
|
||||
GdkEventFocus *event,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_font_selection_size_activate (w, data);
|
||||
GtkFontSelection *fontsel;
|
||||
gint new_size;
|
||||
const gchar *text;
|
||||
|
||||
fontsel = GTK_FONT_SELECTION (data);
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (fontsel->size_entry));
|
||||
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
|
||||
gtk_font_selection_set_size (fontsel, new_size);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+1
-4
@@ -164,13 +164,10 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
|
||||
xthickness = widget->style->xthickness;
|
||||
ythickness = widget->style->ythickness;
|
||||
|
||||
digit_height = PANGO_PIXELS (ink_rect.height) + 2;
|
||||
digit_offset = ink_rect.y;
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, "012456789");
|
||||
pango_layout_get_extents (layout, &ink_rect, &logical_rect);
|
||||
|
||||
digit_height = PANGO_PIXELS (ink_rect.height) + 1;
|
||||
digit_height = PANGO_PIXELS (ink_rect.height) + 2;
|
||||
digit_offset = ink_rect.y;
|
||||
|
||||
width = widget->allocation.width;
|
||||
|
||||
+20
-8
@@ -695,6 +695,14 @@ get_default_icons (GtkIconFactory *factory)
|
||||
16, stock_up_arrow_16,
|
||||
24, stock_up_arrow_24);
|
||||
|
||||
add_icon2 (factory, "gtk-file",
|
||||
16, stock_file_16,
|
||||
24, stock_file_24);
|
||||
|
||||
add_icon2 (factory, "gtk-directory",
|
||||
16, stock_directory_16,
|
||||
24, stock_directory_24);
|
||||
|
||||
/* Generic size only */
|
||||
|
||||
add_icon (factory, GTK_STOCK_CLEAR, 24, stock_clear_24);
|
||||
@@ -1595,7 +1603,7 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
|
||||
|
||||
if (widget && gtk_widget_has_screen (widget))
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
else if (style->colormap)
|
||||
else if (style && style->colormap)
|
||||
screen = gdk_colormap_get_screen (style->colormap);
|
||||
else
|
||||
{
|
||||
@@ -1768,7 +1776,7 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set,
|
||||
GdkPixbuf *icon;
|
||||
|
||||
g_return_val_if_fail (icon_set != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (style == NULL || GTK_IS_STYLE (style), NULL);
|
||||
|
||||
if (icon_set->sources == NULL)
|
||||
return render_fallback_image (style, direction, state, size, widget, detail);
|
||||
@@ -2091,7 +2099,8 @@ icon_source_clear (GtkIconSource *source)
|
||||
case GTK_ICON_SOURCE_FILENAME:
|
||||
g_free (source->source.filename);
|
||||
source->source.filename = NULL;
|
||||
g_free (source->filename_pixbuf);
|
||||
if (source->filename_pixbuf)
|
||||
g_object_unref (source->filename_pixbuf);
|
||||
source->filename_pixbuf = NULL;
|
||||
break;
|
||||
case GTK_ICON_SOURCE_PIXBUF:
|
||||
@@ -2613,6 +2622,7 @@ add_to_cache (GtkIconSet *icon_set,
|
||||
|
||||
icon = g_new (CachedIcon, 1);
|
||||
icon_set->cache = g_slist_prepend (icon_set->cache, icon);
|
||||
icon_set->cache_size++;
|
||||
|
||||
icon->style = style;
|
||||
icon->direction = direction;
|
||||
@@ -2654,10 +2664,14 @@ static void
|
||||
clear_cache (GtkIconSet *icon_set,
|
||||
gboolean style_detach)
|
||||
{
|
||||
GSList *tmp_list;
|
||||
GSList *cache, *tmp_list;
|
||||
GtkStyle *last_style = NULL;
|
||||
|
||||
tmp_list = icon_set->cache;
|
||||
cache = icon_set->cache;
|
||||
icon_set->cache = NULL;
|
||||
icon_set->cache_size = 0;
|
||||
|
||||
tmp_list = cache;
|
||||
while (tmp_list != NULL)
|
||||
{
|
||||
CachedIcon *icon = tmp_list->data;
|
||||
@@ -2681,9 +2695,7 @@ clear_cache (GtkIconSet *icon_set,
|
||||
tmp_list = g_slist_next (tmp_list);
|
||||
}
|
||||
|
||||
g_slist_free (icon_set->cache);
|
||||
icon_set->cache = NULL;
|
||||
icon_set->cache_size = 0;
|
||||
g_slist_free (cache);
|
||||
}
|
||||
|
||||
static GSList*
|
||||
|
||||
+1
-1
@@ -1935,7 +1935,7 @@ theme_subdir_load (GtkIconTheme *icon_theme,
|
||||
|
||||
scan_directory (icon_theme->priv, dir, full_dir);
|
||||
|
||||
theme->dirs = g_list_append (theme->dirs, dir);
|
||||
theme->dirs = g_list_prepend (theme->dirs, dir);
|
||||
}
|
||||
else
|
||||
g_free (full_dir);
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
|
||||
#define GTK_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_THEME, GtkIconThemeClass))
|
||||
#define GTK_IS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_THEME))
|
||||
#define GTK_IS_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_THEME))
|
||||
#define GTK_ICON_THEME_GET_CLASS(obj) (G_TYPE_CHECK_GET_CLASS ((obj), GTK_TYPE_ICON_THEME, GtkIconThemeClass))
|
||||
#define GTK_ICON_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_THEME, GtkIconThemeClass))
|
||||
|
||||
typedef struct _GtkIconInfo GtkIconInfo;
|
||||
typedef struct _GtkIconTheme GtkIconTheme;
|
||||
|
||||
-2484
File diff suppressed because it is too large
Load Diff
@@ -1,151 +0,0 @@
|
||||
/* eggiconlist.h
|
||||
* Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __EGG_ICON_LIST_H__
|
||||
#define __EGG_ICON_LIST_H__
|
||||
|
||||
#include <gtk/gtkcontainer.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define EGG_TYPE_ICON_LIST (egg_icon_list_get_type ())
|
||||
#define EGG_ICON_LIST(obj) (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST, EggIconList))
|
||||
#define EGG_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_ICON_LIST, EggIconListClass))
|
||||
#define EGG_IS_ICON_LIST(obj) (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST))
|
||||
#define EGG_IS_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST))
|
||||
#define EGG_ICON_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass))
|
||||
|
||||
#define EGG_TYPE_ICON_LIST_ITEM (egg_icon_list_item_get_type ())
|
||||
|
||||
typedef struct _EggIconList EggIconList;
|
||||
typedef struct _EggIconListClass EggIconListClass;
|
||||
typedef struct _EggIconListPrivate EggIconListPrivate;
|
||||
typedef struct _EggIconListItem EggIconListItem;
|
||||
|
||||
typedef void (* EggIconListForeachFunc) (EggIconList *icon_list,
|
||||
EggIconListItem *item,
|
||||
gpointer data);
|
||||
typedef gint (* EggIconListItemCompareFunc) (EggIconList *icon_list,
|
||||
EggIconListItem *a,
|
||||
EggIconListItem *b,
|
||||
gpointer user_data);
|
||||
|
||||
struct _EggIconList
|
||||
{
|
||||
GtkContainer parent;
|
||||
|
||||
EggIconListPrivate *priv;
|
||||
};
|
||||
|
||||
struct _EggIconListClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
|
||||
void (* set_scroll_adjustments) (EggIconList *icon_list,
|
||||
GtkAdjustment *hadjustment,
|
||||
GtkAdjustment *vadjustment);
|
||||
|
||||
void (* item_activated) (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void (* selection_changed) (EggIconList *icon_list);
|
||||
void (* item_added) (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void (* item_removed) (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void (* item_changed) (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
/* Key binding signals */
|
||||
void (* select_all) (EggIconList *icon_list);
|
||||
void (* unselect_all) (EggIconList *icon_list);
|
||||
void (* select_cursor_item) (EggIconList *icon_list);
|
||||
void (* toggle_cursor_item) (EggIconList *icon_list);
|
||||
};
|
||||
|
||||
GType egg_icon_list_get_type (void);
|
||||
GType egg_icon_list_item_get_type (void);
|
||||
GtkWidget *egg_icon_list_new (void);
|
||||
|
||||
EggIconListItem * egg_icon_list_item_new (GdkPixbuf *icon,
|
||||
const gchar *label);
|
||||
void egg_icon_list_item_ref (EggIconListItem *item);
|
||||
void egg_icon_list_item_unref (EggIconListItem *item);
|
||||
void egg_icon_list_item_set_data (EggIconListItem *item,
|
||||
gpointer data);
|
||||
void egg_icon_list_item_set_data_full (EggIconListItem *item,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_notify);
|
||||
gpointer egg_icon_list_item_get_data (EggIconListItem *item);
|
||||
void egg_icon_list_item_set_label (EggIconListItem *item,
|
||||
const char *label);
|
||||
G_CONST_RETURN gchar *egg_icon_list_item_get_label (EggIconListItem *item);
|
||||
void egg_icon_list_item_set_icon (EggIconListItem *item,
|
||||
GdkPixbuf *icon);
|
||||
GdkPixbuf * egg_icon_list_item_get_icon (EggIconListItem *item);
|
||||
void egg_icon_list_append_item (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_prepend_item (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_insert_item_before (EggIconList *icon_list,
|
||||
EggIconListItem *sibling,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_insert_item_after (EggIconList *icon_list,
|
||||
EggIconListItem *sibling,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_remove_item (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_clear (EggIconList *icon_list);
|
||||
EggIconListItem * egg_icon_list_get_item_at_pos (EggIconList *icon_list,
|
||||
gint x,
|
||||
gint y);
|
||||
gint egg_icon_list_get_item_count (EggIconList *icon_list);
|
||||
void egg_icon_list_foreach (EggIconList *icon_list,
|
||||
EggIconListForeachFunc func,
|
||||
gpointer data);
|
||||
GList * egg_icon_list_get_selected (EggIconList *icon_list);
|
||||
void egg_icon_list_selected_foreach (EggIconList *icon_list,
|
||||
EggIconListForeachFunc func,
|
||||
gpointer data);
|
||||
void egg_icon_list_set_selection_mode (EggIconList *icon_list,
|
||||
GtkSelectionMode mode);
|
||||
GtkSelectionMode egg_icon_list_get_selection_mode (EggIconList *icon_list);
|
||||
void egg_icon_list_select_item (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
void egg_icon_list_unselect_item (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
gboolean egg_icon_list_item_is_selected (EggIconListItem *item);
|
||||
void egg_icon_list_select_all (EggIconList *icon_list);
|
||||
void egg_icon_list_unselect_all (EggIconList *icon_list);
|
||||
void egg_icon_list_set_sorted (EggIconList *icon_list,
|
||||
gboolean sorted);
|
||||
gboolean egg_icon_list_get_sorted (EggIconList *icon_list);
|
||||
void egg_icon_list_set_sort_func (EggIconList *icon_list,
|
||||
EggIconListItemCompareFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_notify);
|
||||
void egg_icon_list_set_sort_order (EggIconList *icon_list,
|
||||
GtkSortType order);
|
||||
GtkSortType egg_icon_list_get_sort_order (EggIconList *icon_list);
|
||||
void egg_icon_list_item_activated (EggIconList *icon_list,
|
||||
EggIconListItem *item);
|
||||
|
||||
/* For accessibility */
|
||||
GList *egg_icon_list_get_items (EggIconList *icon_list);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __EGG_ICON_LIST_H__ */
|
||||
+48
-8
@@ -402,7 +402,7 @@ gtk_image_get_property (GObject *object,
|
||||
* @mask: a #GdkBitmap, or %NULL
|
||||
*
|
||||
* Creates a #GtkImage widget displaying @pixmap with a @mask.
|
||||
* A #GdkImage is a server-side image buffer in the pixel format of the
|
||||
* A #GdkPixmap is a server-side image buffer in the pixel format of the
|
||||
* current display. The #GtkImage does not assume a reference to the
|
||||
* pixmap or mask; you still need to unref them if you own references.
|
||||
* #GtkImage will add its own reference rather than adopting yours.
|
||||
@@ -1207,6 +1207,44 @@ animation_timeout (gpointer data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Like gdk_rectangle_intersect (dest, src, dest), but make
|
||||
* sure that the origin of dest is moved by an "even" offset.
|
||||
* If necessary grow the intersection by one row or column
|
||||
* to achieve this.
|
||||
*
|
||||
* This is necessary since we can't pass alignment information
|
||||
* for the pixelation pattern down to gdk_pixbuf_saturate_and_pixelate(),
|
||||
* thus we have to makesure that the subimages are properly aligned.
|
||||
*/
|
||||
static gboolean
|
||||
rectangle_intersect_even (GdkRectangle *src,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
gboolean isect;
|
||||
gint x, y;
|
||||
|
||||
x = dest->x;
|
||||
y = dest->y;
|
||||
isect = gdk_rectangle_intersect (dest, src, dest);
|
||||
|
||||
if ((dest->x - x + dest->y - y) % 2 != 0)
|
||||
{
|
||||
if (dest->x > x)
|
||||
{
|
||||
dest->x--;
|
||||
dest->width++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest->y--;
|
||||
dest->height++;
|
||||
}
|
||||
}
|
||||
|
||||
return isect;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_image_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
@@ -1221,7 +1259,7 @@ gtk_image_expose (GtkWidget *widget,
|
||||
GtkMisc *misc;
|
||||
GdkRectangle area, image_bound;
|
||||
gfloat xalign;
|
||||
gint x, y;
|
||||
gint x, y, mask_x, mask_y;
|
||||
GdkBitmap *mask;
|
||||
GdkPixbuf *pixbuf;
|
||||
gboolean needs_state_transform;
|
||||
@@ -1253,6 +1291,8 @@ gtk_image_expose (GtkWidget *widget,
|
||||
y = floor (widget->allocation.y + misc->ypad
|
||||
+ ((widget->allocation.height - widget->requisition.height) * misc->yalign)
|
||||
+ 0.5);
|
||||
mask_x = x;
|
||||
mask_y = y;
|
||||
|
||||
image_bound.x = x;
|
||||
image_bound.y = y;
|
||||
@@ -1270,8 +1310,7 @@ gtk_image_expose (GtkWidget *widget,
|
||||
gdk_drawable_get_size (image->data.pixmap.pixmap,
|
||||
&image_bound.width,
|
||||
&image_bound.height);
|
||||
|
||||
if (gdk_rectangle_intersect (&image_bound, &area, &image_bound) &&
|
||||
if (rectangle_intersect_even (&area, &image_bound) &&
|
||||
needs_state_transform)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_get_from_drawable (NULL,
|
||||
@@ -1293,7 +1332,7 @@ gtk_image_expose (GtkWidget *widget,
|
||||
image_bound.width = image->data.image.image->width;
|
||||
image_bound.height = image->data.image.image->height;
|
||||
|
||||
if (gdk_rectangle_intersect (&image_bound, &area, &image_bound) &&
|
||||
if (rectangle_intersect_even (&area, &image_bound) &&
|
||||
needs_state_transform)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_get_from_image (NULL,
|
||||
@@ -1312,8 +1351,9 @@ gtk_image_expose (GtkWidget *widget,
|
||||
case GTK_IMAGE_PIXBUF:
|
||||
image_bound.width = gdk_pixbuf_get_width (image->data.pixbuf.pixbuf);
|
||||
image_bound.height = gdk_pixbuf_get_height (image->data.pixbuf.pixbuf);
|
||||
|
||||
|
||||
if (gdk_rectangle_intersect (&image_bound, &area, &image_bound) &&
|
||||
if (rectangle_intersect_even (&area, &image_bound) &&
|
||||
needs_state_transform)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_subpixbuf (image->data.pixbuf.pixbuf,
|
||||
@@ -1398,10 +1438,10 @@ gtk_image_expose (GtkWidget *widget,
|
||||
if (mask)
|
||||
{
|
||||
gdk_gc_set_clip_mask (widget->style->black_gc, mask);
|
||||
gdk_gc_set_clip_origin (widget->style->black_gc, x, y);
|
||||
gdk_gc_set_clip_origin (widget->style->black_gc, mask_x, mask_y);
|
||||
}
|
||||
|
||||
if (gdk_rectangle_intersect (&image_bound, &area, &image_bound))
|
||||
if (rectangle_intersect_even (&area, &image_bound))
|
||||
{
|
||||
if (pixbuf)
|
||||
{
|
||||
|
||||
+18
-13
@@ -220,16 +220,19 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
|
||||
|
||||
if (image_menu_item->image && show_image (image_menu_item))
|
||||
{
|
||||
guint image_width = image_menu_item->image->requisition.width;
|
||||
GtkRequisition image_requisition;
|
||||
|
||||
if (image_width > 0)
|
||||
gtk_widget_get_child_requisition (image_menu_item->image,
|
||||
&image_requisition);
|
||||
|
||||
if (image_requisition.width > 0)
|
||||
{
|
||||
guint toggle_spacing;
|
||||
gtk_widget_style_get (GTK_WIDGET (menu_item),
|
||||
"toggle_spacing", &toggle_spacing,
|
||||
NULL);
|
||||
|
||||
*requisition = image_width + toggle_spacing;
|
||||
|
||||
*requisition = image_requisition.width + toggle_spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +284,8 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
|
||||
if (image_menu_item->image && show_image (image_menu_item))
|
||||
{
|
||||
gint width, height, x, y, offset;
|
||||
gint x, y, offset;
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
guint horizontal_padding, toggle_spacing;
|
||||
|
||||
@@ -293,9 +297,10 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
/* Man this is lame hardcoding action, but I can't
|
||||
* come up with a solution that's really better.
|
||||
*/
|
||||
|
||||
width = image_menu_item->image->requisition.width;
|
||||
height = image_menu_item->image->requisition.height;
|
||||
|
||||
gtk_widget_get_child_requisition (image_menu_item->image,
|
||||
&child_requisition);
|
||||
|
||||
offset = GTK_CONTAINER (image_menu_item)->border_width +
|
||||
widget->style->xthickness;
|
||||
|
||||
@@ -303,20 +308,20 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
x = offset + horizontal_padding +
|
||||
(GTK_MENU_ITEM (image_menu_item)->toggle_size -
|
||||
toggle_spacing - width) / 2;
|
||||
toggle_spacing - child_requisition.width) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = widget->allocation.width - offset - horizontal_padding -
|
||||
GTK_MENU_ITEM (image_menu_item)->toggle_size + toggle_spacing +
|
||||
(GTK_MENU_ITEM (image_menu_item)->toggle_size -
|
||||
toggle_spacing - width) / 2;
|
||||
toggle_spacing - child_requisition.width) / 2;
|
||||
}
|
||||
|
||||
y = (widget->allocation.height - height) / 2;
|
||||
y = (widget->allocation.height - child_requisition.height) / 2;
|
||||
|
||||
child_allocation.width = width;
|
||||
child_allocation.height = height;
|
||||
child_allocation.width = child_requisition.width;
|
||||
child_allocation.height = child_requisition.height;
|
||||
child_allocation.x = widget->allocation.x + MAX (x, 0);
|
||||
child_allocation.y = widget->allocation.y + MAX (y, 0);
|
||||
|
||||
|
||||
+1
-1
@@ -1420,7 +1420,7 @@ gtk_label_ensure_layout (GtkLabel *label)
|
||||
|
||||
widget = GTK_WIDGET (label);
|
||||
|
||||
rtl = gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL;
|
||||
rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
||||
rwidth = label->misc.xpad * 2;
|
||||
rheight = label->misc.ypad * 2;
|
||||
|
||||
|
||||
+4
-4
@@ -656,7 +656,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_parse_args:
|
||||
* gtk_parse_args:
|
||||
* @argc: a pointer to the number of command line arguments.
|
||||
* @argv: a pointer to the array of command line arguments.
|
||||
*
|
||||
@@ -664,7 +664,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
|
||||
* attributes of GTK+, but does not actually open a connection
|
||||
* to a display. (See gdk_display_open(), gdk_get_display_arg_name())
|
||||
*
|
||||
* Any arguments used by GTK or GDK are removed from the array and
|
||||
* Any arguments used by GTK+ or GDK are removed from the array and
|
||||
* @argc and @argv are updated accordingly.
|
||||
*
|
||||
* You shouldn't call this function explicitely if you are using
|
||||
@@ -1682,8 +1682,8 @@ gtk_grab_notify_foreach (GtkWidget *child,
|
||||
if (was_grabbed != is_grabbed)
|
||||
{
|
||||
g_object_ref (child);
|
||||
|
||||
g_signal_emit_by_name (child, "grab_notify", was_grabbed);
|
||||
|
||||
_gtk_widget_grab_notify (child, was_grabbed);
|
||||
|
||||
if (GTK_IS_CONTAINER (child))
|
||||
gtk_container_foreach (GTK_CONTAINER (child), gtk_grab_notify_foreach, info);
|
||||
|
||||
+18
-4
@@ -1722,6 +1722,13 @@ gtk_menu_get_toplevel (GtkWidget *menu)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
tearoff_window_destroyed (GtkWidget *widget,
|
||||
GtkMenu *menu)
|
||||
{
|
||||
gtk_menu_set_tearoff_state (menu, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_menu_set_tearoff_state (GtkMenu *menu,
|
||||
gboolean torn_off)
|
||||
@@ -1755,7 +1762,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
|
||||
GDK_WINDOW_TYPE_HINT_MENU);
|
||||
gtk_window_set_mnemonic_modifier (GTK_WINDOW (menu->tearoff_window), 0);
|
||||
g_signal_connect (menu->tearoff_window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &menu->tearoff_window);
|
||||
G_CALLBACK (tearoff_window_destroyed), menu);
|
||||
g_signal_connect (menu->tearoff_window, "event",
|
||||
G_CALLBACK (gtk_menu_window_event), menu);
|
||||
|
||||
@@ -2511,9 +2518,13 @@ get_accel_path (GtkWidget *menu_item,
|
||||
g_object_get (label,
|
||||
"accel_closure", &accel_closure,
|
||||
NULL);
|
||||
accel_group = gtk_accel_group_from_accel_closure (accel_closure);
|
||||
|
||||
*locked = accel_group->lock_count > 0;
|
||||
|
||||
if (accel_closure)
|
||||
{
|
||||
accel_group = gtk_accel_group_from_accel_closure (accel_closure);
|
||||
|
||||
*locked = accel_group->lock_count > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3262,6 +3273,9 @@ gtk_menu_position (GtkMenu *menu)
|
||||
if (menu->position_func)
|
||||
{
|
||||
(* menu->position_func) (menu, &x, &y, &push_in, menu->position_func_data);
|
||||
if (private->monitor_num < 0)
|
||||
private->monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
|
||||
|
||||
gdk_screen_get_monitor_geometry (screen, private->monitor_num, &monitor);
|
||||
}
|
||||
else
|
||||
|
||||
+3
-2
@@ -502,7 +502,7 @@ gtk_menu_item_size_request (GtkWidget *widget,
|
||||
g_return_if_fail (requisition != NULL);
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
"horizontal padding", &horizontal_padding,
|
||||
"horizontal_padding", &horizontal_padding,
|
||||
NULL);
|
||||
|
||||
bin = GTK_BIN (widget);
|
||||
@@ -962,7 +962,8 @@ gtk_menu_item_select_timeout (gpointer data)
|
||||
|
||||
parent = GTK_WIDGET (menu_item)->parent;
|
||||
|
||||
if (parent && GTK_IS_MENU_SHELL (parent) && GTK_MENU_SHELL (parent)->active)
|
||||
if ((GTK_IS_MENU_SHELL (parent) && GTK_MENU_SHELL (parent)->active) ||
|
||||
(GTK_IS_MENU (parent) && GTK_MENU (parent)->torn_off))
|
||||
{
|
||||
gtk_menu_item_popup_submenu (data);
|
||||
if (menu_item->timer_from_keypress && menu_item->submenu)
|
||||
|
||||
+16
-24
@@ -454,9 +454,10 @@ gtk_menu_shell_button_press (GtkWidget *widget,
|
||||
(menu_item != menu_shell->active_menu_item))
|
||||
{
|
||||
if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
|
||||
g_object_set_data (G_OBJECT (menu_shell),
|
||||
"gtk-menushell-just-activated",
|
||||
GUINT_TO_POINTER (1));
|
||||
{
|
||||
menu_shell->activate_time = event->time;
|
||||
}
|
||||
|
||||
gtk_menu_shell_select_item (menu_shell, menu_item);
|
||||
}
|
||||
}
|
||||
@@ -488,8 +489,6 @@ gtk_menu_shell_button_release (GtkWidget *widget,
|
||||
menu_shell = GTK_MENU_SHELL (widget);
|
||||
if (menu_shell->active)
|
||||
{
|
||||
gboolean deactivate_immediately = FALSE;
|
||||
|
||||
if (menu_shell->button && (event->button != menu_shell->button))
|
||||
{
|
||||
menu_shell->button = 0;
|
||||
@@ -502,23 +501,8 @@ gtk_menu_shell_button_release (GtkWidget *widget,
|
||||
|
||||
deactivate = TRUE;
|
||||
|
||||
if (menu_item
|
||||
&& GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
|
||||
{
|
||||
if (g_object_get_data (G_OBJECT (menu_shell), "gtk-menushell-just-activated"))
|
||||
g_object_set_data (G_OBJECT (menu_shell), "gtk-menushell-just-activated", NULL);
|
||||
else
|
||||
deactivate_immediately = TRUE;
|
||||
}
|
||||
|
||||
if ((event->time - menu_shell->activate_time) > MENU_SHELL_TIMEOUT)
|
||||
{
|
||||
if (deactivate_immediately)
|
||||
{
|
||||
gtk_menu_shell_deactivate (menu_shell);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (menu_item && (menu_shell->active_menu_item == menu_item) &&
|
||||
_gtk_menu_item_is_selectable (menu_item))
|
||||
{
|
||||
@@ -528,8 +512,12 @@ gtk_menu_shell_button_release (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (menu_item && !_gtk_menu_item_is_selectable (menu_item))
|
||||
deactivate = FALSE;
|
||||
else if (menu_item &&
|
||||
!_gtk_menu_item_is_selectable (menu_item) &&
|
||||
GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement != GTK_TOP_BOTTOM)
|
||||
{
|
||||
deactivate = FALSE;
|
||||
}
|
||||
else if (menu_shell->parent_menu_shell)
|
||||
{
|
||||
menu_shell->active = TRUE;
|
||||
@@ -539,8 +527,11 @@ gtk_menu_shell_button_release (GtkWidget *widget,
|
||||
|
||||
/* If we ended up on an item with a submenu, leave the menu up.
|
||||
*/
|
||||
if (menu_item && (menu_shell->active_menu_item == menu_item))
|
||||
deactivate = FALSE;
|
||||
if (menu_item && (menu_shell->active_menu_item == menu_item) &&
|
||||
GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement != GTK_TOP_BOTTOM)
|
||||
{
|
||||
deactivate = FALSE;
|
||||
}
|
||||
}
|
||||
else /* a very fast press-release */
|
||||
{
|
||||
@@ -745,6 +736,7 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell)
|
||||
{
|
||||
menu_shell->button = 0;
|
||||
menu_shell->active = FALSE;
|
||||
menu_shell->activate_time = 0;
|
||||
|
||||
if (menu_shell->active_menu_item)
|
||||
{
|
||||
|
||||
+2
-1
@@ -100,7 +100,8 @@ const gchar *_gtk_get_data_prefix ();
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
gboolean _gtk_fnmatch (const char *pattern,
|
||||
const char *string);
|
||||
const char *string,
|
||||
gboolean no_leading_period);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user