Compare commits

...

321 Commits

Author SHA1 Message Date
Matthias Clasen a0d84ec19a 2.4.9 2004-08-25 19:00:27 +00:00
Gustavo Maciel Dias Vieira 309bbf03c1 Some consistency fixes.
2004-08-25  Gustavo Maciel Dias Vieira  <gustavo@sagui.org>

        * pt_BR.po: Some consistency fixes.
2004-08-25 18:01:44 +00:00
Matthias Clasen e4d85fa378 2.4.8 2004-08-25 17:57:42 +00:00
Matthias Clasen 9f055423b7 Use get_file_info() rather than trying get_folder() and checking for an
2004-08-25  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (check_is_folder): Use get_file_info() rather
	than trying get_folder() and checking for an error directly because older
	versions of the gnome-vfs backend don't return an error
	immediately.  (#150852, Zack Cerza )
2004-08-25 16:01:03 +00:00
Matthias Clasen 882144878c Update for 2.4.8 2004-08-24 20:42:46 +00:00
Matthias Clasen ea8ea5d5cb Use the correct index, and compare correctly, reported by Tommi
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
	the correct index, and compare correctly, reported by Tommi Komulainen.
2004-08-24 20:23:32 +00:00
Matthias Clasen 4157993682 Use the correct index, reported by Tommi Komulainen.
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
	the correct index, reported by Tommi Komulainen.
2004-08-24 19:52:46 +00:00
Matthias Clasen 54b366f546 Handle action_group being NULL. (#150869, Tommi Komulainen)
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkaction.c (connect_proxy, disconnect_proxy): Handle
	action_group being NULL.  (#150869,  Tommi Komulainen)
2004-08-24 14:51:50 +00:00
Matthias Clasen 4e0ff51873 Actually free the temporary pixbuf data. 2004-08-24 14:45:01 +00:00
Matthias Clasen ba08829366 Use the correct index variable. (#150941, Tommi Komulainen)
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkimage.c (allocate_scratch_images): Use the correct
	index variable.  (#150941, Tommi Komulainen)
2004-08-24 14:31:38 +00:00
Matthias Clasen 85f59d66e1 Take header height and adjustment into account. (#136496, Pawek Salek)
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_node_queue_redraw): Take header
	height and adjustment into account.  (#136496, Pawek Salek)
2004-08-24 14:26:36 +00:00
Matthias Clasen 2f06d8ad44 Work around bugs in the runlength encoder by forcing rowstride * height to
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixdata.c (gdk_pixdata_from_pixbuf): Work around bugs in
	the runlength encoder by forcing rowstride * height to be
	divisible by bpp.  (#150882)
2004-08-24 13:55:19 +00:00
Matthias Clasen 03b6cf491d Make it compile. 2004-08-23 19:05:44 +00:00
Matthias Clasen 9573059b2d Add a user_time field.
2004-08-23  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a
	user_time field.

	* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update
	toplevel->user_time.
	(show_window_internal): Update the user time when re-mapping a
	toplevel window.  (#150502, Elijah Newren)

	* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
	EWMH additions to the _NET_ACTIVE_WINDOW client message
	format.  (#150668, Elijah Newren)
2004-08-23 16:57:45 +00:00
Matthias Clasen bf54ef87c6 Support the latest EWMH additions to the _NET_ACTIVE_WINDOW client message
2004-08-23  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
	EWMH additions to the _NET_ACTIVE_WINDOW client message
	format.  (#150668, Elijah Newren)
2004-08-23 15:13:14 +00:00
Matthias Clasen 64c73128d1 Make it compile. (#150761, Jon-Kare Hellan)
Mon Aug 23 00:51:20 2004  Matthias Clasen  <maclas@gmx.de>

	* pixops/pixops.c (pixops_scale_nearest): Make it
	compile.  (#150761, Jon-Kare Hellan)
2004-08-23 04:55:06 +00:00
Philip Langdale e56818a84f Two signals (gtk_action_sync_property and gtk_action_sync_sensitive) were
2004-08-22  Philip Langdale  <plangdale@vmware.com>

	* gtk/gtkaction.c (gtk_action_disconnect_proxy): Two signals
	(gtk_action_sync_property and gtk_action_sync_sensitive) were
	not being correctly disconnected, leading to actions continuing
	to affect disconnected proxies. (#150607)
2004-08-22 23:41:58 +00:00
Tor Lillqvist cd10630a0c Don't show TEMP windows in the Task Manager. Implement by calling
2004-08-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_new_internal,
	gdk_window_new, gdk_window_set_skip_taskbar_hint): Don't show TEMP
	windows in the Task Manager. Implement by calling
	gdk_window_set_skip_taskbar_hint(TRUE) on them. (#145481, Tim
	Evans)
2004-08-22 19:12:46 +00:00
Tor Lillqvist 6f75426b7d Report whole of (primary) monitor, including any taskbars. Excluding the
2004-08-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
	Report whole of (primary) monitor, including any taskbars.
	Excluding the taskbar area from the "root window" reported to GDK
	doesn't seem to be that useful although gdk/win32 had been doing it
	for a very long time. (#149013, see also #145467 and #148526)
2004-08-22 16:56:48 +00:00
Soeren Sandmann 5d5a62f8ef s/CYCLE_HANDLE_FOCUS/CYCLE_CHILD_FOCUS/
Sun Aug 22 15:46:56 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkpaned.c (gtk_paned_class_init):
	s/CYCLE_HANDLE_FOCUS/CYCLE_CHILD_FOCUS/

	* gtk/gtkfontbutton.c (gtk_font_button_class_init):
	s/PROP_SHOW_SIZE/PROP_SHOW_STYLE/

	Both pointed out by Tommi Komulainen.
2004-08-22 14:04:03 +00:00
Soeren Sandmann 93fed9bb4b Use PROP_MAX_POSITION, not PROP_MIN_POSITION for the max_position
Sun Aug 22 13:44:53 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkpaned.c (gtk_paned_class_init): Use PROP_MAX_POSITION,
	not PROP_MIN_POSITION for the max_position property. Fix pointet
	out by Tommi Komulainen.
2004-08-22 12:05:54 +00:00
Matthias Clasen 32dba76d50 Fix a mixup in the handling of dest_channels. (#111922, Christophe
Sun Aug 22 03:20:56 2004  Matthias Clasen  <maclas@gmx.de>

	* pixops/pixops.c (pixops_scale_nearest): Fix a mixup in the handling
	of dest_channels.  (#111922, Christophe Fergeau)
2004-08-22 07:25:14 +00:00
Matthias Clasen f48958e8a8 Fix #150406, reported by Fernando San Martín Woerner, patch by Gustavo
Sun Aug 22 00:08:44 2004  Matthias Clasen  <maclas@gmx.de>

	Fix #150406, reported by Fernando San Martín Woerner, patch
	by Gustavo Carneiro.

	* gtk/gtkentrycompletion.c
	(gtk_entry_completion_default_completion_func): Check that
	column is of type G_TYPE_STRING before proceeding.
2004-08-22 04:11:27 +00:00
Matthias Clasen 7a18b8a1d8 Don't use an uninitialized tree iter. (#150414, Torsten Schoenfeld)
Sat Aug 21 23:53:39 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreestore.c (gtk_tree_store_swap): Don't use an
	uninitialized tree iter.  (#150414, Torsten Schoenfeld)
2004-08-22 03:56:58 +00:00
Matthias Clasen 5e1613d2be Add bug reference 2004-08-22 03:33:29 +00:00
Matthias Clasen cb004a2e5a Fix macro definitions.
Sat Aug 21 23:29:54 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktoolitem.h (GTK_IS_TOOL_ITEM_CLASS):
	* gtk/gtktoolbutton.h (GTK_IS_TOOL_BUTTON_CLASS):
	* gtk/gtktoggleaction.h (GTK_IS_TOGGLE_ACTION_CLASS):
	* gtk/gtkseparatortoolitem.h (GTK_IS_SEPARATOR_TOOL_ITEM_CLASS):
	* gtk/gtkradiotoolbutton.h (GTK_IS_RADIO_TOOL_BUTTON_CLASS):
	* gtk/gtkradioaction.h (GTK_IS_RADIO_ACTION_CLASS):
	* gtk/gtkuimanager.h (GTK_IS_UI_MANAGER_CLASS):
	* gtk/gtkaction.h (GTK_IS_ACTION_CLASS): Fix macro definitions.

Mon Aug 16 01:30:12 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkbutton.c (gtk_button_set_focus_on_click): Fix typo in
	the docs.
2004-08-22 03:32:34 +00:00
Owen Taylor 65094784f2 Fix infinite loop that can occur for bad image data (#150601, Chris Evans,
Fri Aug 20 11:59:10 2004  Owen Taylor  <otaylor@redhat.com>

        * io-bmp.c: Fix infinite loop that can occur for bad
        image data (#150601, Chris Evans, Manish Singh)
2004-08-20 18:02:14 +00:00
Laurent Dhima 63f5bcbb87 Updated Albanian translation.
2004-08-20  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-08-20 16:56:11 +00:00
Ankitkumar Rameshchandra Patel 77090de17f ankit@redhat.com 20/08/2004 * Proofread gu.po 2004-08-20 10:55:57 +00:00
N Jayaradha ed0f6a27e8 yet to proof read 2004-08-19 10:47:33 +00:00
Manish Singh e82cce5275 Initialize height from fixed_height before we do anything, so it always
Wed Aug 18 16:18:00 2004  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (gtk_tree_view_row_inserted): Initialize height
        from fixed_height before we do anything, so it always has a valid
        value.
2004-08-18 23:17:02 +00:00
Pauli Virtanen 1df3a75ac4 Updated Finnish translation.
* fi.po: Updated Finnish translation.
2004-08-18 22:56:34 +00:00
Federico Mena Quintero 08e9728fa0 Fixes #149251:
2004-08-18  Federico Mena Quintero  <federico@ximian.com>

	Fixes #149251:

	* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
	SHORTCUTS_COL_DATA.  Add SHORTCUTS_COL_IS_VOLUME, to determine
	easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
	GtkFileSystemVolume.
	(shortcuts_model_create): Create a boolean column for
	SHORTCUTS_COL_IS_VOLUME.
	(shortcuts_reload_icons): Simplify with the use of the
	SHORTCUTS_COL_IS_VOLUME column.  Don't leak the pixbuf.
	(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
	(shortcuts_free_row_data): New helper function; frees the data
	columns for an iter.
	(shortcuts_remove_rows): Don't take a callback for freeing the
	data; free everything here instead.  Use
	shortcuts_free_row_data().
	(volume_remove_cb): Removed.
	(remove_bookmark_cb): Removed.
	(remove_row_cb): Make this a single generic function to delete
	rows.
	(shortcuts_add_volumes): Use remove_row_cb().
	(shortcuts_add_bookmarks): Likewise.
	(struct _GtkFileChooserDefault): Removed the
	shortcuts_current_folder_is_volume field.
	(shortcuts_add_current_folder): Oops, don't free the volume.
	(remove_current_folder_cb): Removed.
	(shortcut_find_position): Simplify through the use of the
	SHORTCUTS_COL_IS_VOLUME column.
	(remove_selected_bookmarks): Assert that we don't get a volume.
	(shortcuts_reorder): Likewise; also, plug a leak.
	(gtk_file_chooser_default_remove_shortcut_folder): Simplify
	through the use of shortcuts_remove_rows().
	(gtk_file_chooser_default_list_shortcut_folders): Assert that we
	don't get a volume.
	(shortcuts_activate_iter): Simplify.
	(home_folder_handler): Simplify by using
	shortcuts_activate_iter().
	(shortcuts_free): New function; frees all the data columns.
	(gtk_file_chooser_default_finalize): Unref the
	shortcuts_filter_model and the shortcuts model data first.
2004-08-18 15:27:00 +00:00
Laurent Dhima 965b411861 Updated Albanian translation.
2004-08-18  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-08-18 11:02:53 +00:00
Martin Willemoes Hansen 686f3dddad Updated Danish translation.
* da.po: Updated Danish translation.
2004-08-18 10:17:42 +00:00
Sami Pesonen b203410c34 Finnish translation updated (again) by Sami Pesonen <sampeson@iki.fi> 2004-08-17 21:52:29 +00:00
Sami Pesonen 262b27294b Finnish translation updated by Sami Pesonen <sampeson@iki.fi> 2004-08-17 21:24:32 +00:00
N Jayaradha cbf3179705 yet to complete 2004-08-17 14:11:47 +00:00
Amanpreet Singh Alam 3401ff3f62 check 2004-08-17 09:40:43 +00:00
Christian Rose fc27ee6273 Added "bs" to ALL_LINGUAS. Added Bosnian translations by Kenan
2004-08-16  Christian Rose  <menthos@menthos.com>

	* configure.in: Added "bs" to ALL_LINGUAS.
	* po/bs.po, po-properties/bs.po: Added Bosnian translations
	by Kenan Hadžiavdić <kenanh@frisurf.no>.
2004-08-16 17:31:33 +00:00
N Jayaradha 718e8073b4 yet to complete 2004-08-16 13:29:13 +00:00
N Jayaradha 57c4eb6f8d yet to proof read 2004-08-16 12:23:44 +00:00
Matthias Clasen cf19843f22 Count from the beginning of the line, not from the current position.
Mon Aug 16 01:03:08 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextiter.c (gtk_text_iter_set_visible_line_offset):
	(gtk_text_iter_set_visible_line_index): Count from the
	beginning of the line, not from the current position.  (#150101,
	Torsten Schoenfeld)
2004-08-16 05:07:12 +00:00
Tor Lillqvist 0a7ad8d681 Fix typo. The gtk.immodules file had never been included in my
2004-08-15  Tor Lillqvist  <tml@iki.fi>

	* gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been
	included in my zipfiles...!

	* gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of
	icon alpha channel (on Windows XP) and mask (older Windows
	versions). (#148641, Tim Evans)
2004-08-15 15:00:49 +00:00
Matthias Clasen 0b710f2617 Make the use of S_ISFIFO and S_ISSOCK conditional. (#150146, Gustavo
Sun Aug 15 02:31:55 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilesystemunix.c (get_icon_type_from_stat): Make
	the use of S_ISFIFO and S_ISSOCK conditional.  (#150146,
	Gustavo Carneiro)
2004-08-15 06:37:55 +00:00
Sami Pesonen 2a8625f46e Finnish translation updated by Sami Pesonen <sampeson@iki.fi> 2004-08-14 22:05:52 +00:00
Soeren Sandmann 496fe33399 Bump version number
Sat Aug 14 23:00:25 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* configure.in: Bump version number
2004-08-14 21:01:31 +00:00
Soeren Sandmann b34bef2341 === Released 2.4.7 ===
Sat Aug 14 19:15:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* === Released 2.4.7 ===

	* gtk/gtkfilechooserdefault.c (selection_check): Return the
	number of files selected, not just whether the selection is empty.
	Fixes #150099, fix pointed out by Tommi Komulainen.
2004-08-14 19:57:41 +00:00
Tor Lillqvist c1b7eeefee gtk/gtkfilechooserdefault.c (shortcuts_append_home,
2004-08-14  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkfilechooserdefault.c (shortcuts_append_home,
	shortcuts_append_desktop, set_local_only)
	* gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
	* gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
	Guard against g_get_home_dir() returning NULL. (#150007)
2004-08-14 16:44:07 +00:00
Matthias Clasen 4489472e1f Post-release version bump. 2004-08-13 19:40:35 +00:00
Matthias Clasen bd2f564550 2.4.6 2004-08-13 19:24:09 +00:00
Matthias Clasen 879386022f Don't install the settings_notify_cb from here, since it may be called
2004-08-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_style_set):
	Don't install the settings_notify_cb from here, since it
	may be called before the first screen_changed signal,
	confusing the logic in gtk_file_chooser_screen_changed().
	(#148803, Abel Daniel)
2004-08-13 18:03:41 +00:00
Matthias Clasen 3c084768ad Fix a warning. 2004-08-13 14:47:40 +00:00
Matthias Clasen 1e47f687ad Fix the build. 2004-08-13 14:40:57 +00:00
Matthias Clasen 67d71439c5 Updates. 2004-08-13 05:26:14 +00:00
Matthias Clasen 25d90b843d Make fixed height mode handle insertions. (135955, Michael Vogt, testcase
Fri Aug 13 01:06:56 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreeview.c (gtk_tree_view_row_inserted):
	Make fixed height mode handle insertions.  (135955,
	Michael Vogt, testcase by Tim-Philipp Müller, fix by
	Pawel Salek)
2004-08-13 05:11:09 +00:00
Matthias Clasen 25630a7b6c Fix #149547, Markus Lausser:
Thu Aug 12 23:52:12 2004  Matthias Clasen  <maclas@gmx.de>

	Fix #149547, Markus Lausser:

	* gtk/gtkcombobox.c (gtk_combo_box_size_allocate):
	* gtk/gtkcombobox.c (gtk_combo_box_size_request): Don't
	crash if size_request or size_allocate are called early.

	* gtk/gtkcombobox.c (gtk_combo_box_size_allocate): Protect
	against being allocated too small.
2004-08-13 03:53:19 +00:00
Matthias Clasen 30e654e71b Remove an accidentally added include.
Thu Aug 12 23:18:03 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkhandlebox.c: Remove an accidentally added include.
2004-08-13 03:18:34 +00:00
Matthias Clasen 81df15dbd4 Properly determine the number of colors in an OS/2 BMP file. (#150003,
Thu Aug 12 22:19:12 2004  Matthias Clasen  <maclas@gmx.de>

	* io-bmp.c (DecodeHeader): Properly determine the number of
	colors in an OS/2 BMP file.  (#150003, Jon-Kare Hellan)
2004-08-13 02:30:23 +00:00
Matthias Clasen f7c5f43a72 Fix the doc comment to generate valid XML.
2004-08-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkaction.c (gtk_action_new): Fix the doc comment to generate
	valid XML.
2004-08-12 14:51:02 +00:00
Matthias Clasen 963ceb9356 Remove C99-isms. (#149967, Vincent Noel)
2004-08-12  Matthias Clasen  <mclasen@redhat.com>

	* pixops/pixops.c: Remove C99-isms.  (#149967, Vincent Noel)
2004-08-12 14:15:47 +00:00
Kjartan Maraas 61e13c4c77 Add the file here too.
2004-08-12  Kjartan Maraas  <kmaraas@gnome.org>

	* nb.po: Add the file here too.
2004-08-12 08:39:30 +00:00
Matthias Clasen 82c31ad22b Fix a bug reference 2004-08-12 06:26:08 +00:00
Matthias Clasen f2a519b6b3 Temporarily park bug references here as well 2004-08-12 06:22:39 +00:00
Matthias Clasen f4adc0dba4 Updates 2004-08-12 06:21:36 +00:00
Matthias Clasen 4dc5a17c15 Link to information about allowed action names. (#149620, David Malcolm)
Thu Aug 12 00:02:29 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkaction.c (gtk_action_new): Link to information about
	allowed action names.  (#149620, David Malcolm)
2004-08-12 04:08:58 +00:00
Federico Mena Quintero d00889a3ed Merged from HEAD:
2004-08-11  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	Fix #149422, #143457:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_should_respond): Rewrite to take the
	current focus into account, the contents of the save entry, and
	the last focus for the shortcuts list.
	(switch_to_selected_folder): We don't need an assertion on the
	action here.
2004-08-12 03:06:52 +00:00
Matthias Clasen 025b50b977 Don't start a drag if the treeview is only a drag destination. (#149836,
Wed Aug 11 19:17:28 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreeview.c (gtk_tree_view_maybe_begin_dragging_row):
	Don't start a drag if the treeview is only a
	drag destination.  (#149836, Pawel Salek)
2004-08-11 23:18:59 +00:00
Kjartan Maraas 2b41c5d460 Added nb to ALL_LINGUAS.
2004-08-11  Kjartan Maraas  <kmaraas@gnome.org>

	* configure.in: Added nb to ALL_LINGUAS.
2004-08-11 16:58:57 +00:00
Kjartan Maraas 665ecdb8ec Added correctly named file.
2004-08-11  Kjartan Maraas  <kmaraas@gnome.org>

	* nb.po: Added correctly named file.
2004-08-11 16:54:40 +00:00
Matthias Clasen 02ec92b2ed Make scaling and compositing functions handle edge pixels consistently.
2004-08-11  Matthias Clasen  <mclasen@redhat.com>

	* pixops/pixops.c: Make scaling and compositing functions handle
	edge pixels consistently.  (#111922, Brian Cameron)
2004-08-11 14:50:58 +00:00
Ankitkumar Rameshchandra Patel b439c49898 ankit@redhat.com 09/08/04 2004-08-09 10:09:46 +00:00
Matthias Clasen f34d6dbbe9 Don't leak the file contents.
Mon Aug  9 00:28:34 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkicontheme.c (load_svg_at_size): Don't leak the
	file contents.
2004-08-09 04:30:45 +00:00
David Lodge 2020453616 Added Old English translation.
2004-08-09  David Lodge <dave@cirt.net>

        * ang.po: Added Old English translation.
2004-08-08 23:21:54 +00:00
Sanlig Badral aa5c0cb2d2 Updated Mongolian translation. 2004-08-08 22:25:56 +00:00
Tor Lillqvist 76900792f4 Don't hardcode mapping of VK_DECIMAL to GDK_KP_Decimal. Instead, let
2004-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkkeys-win32.c (update_keymap): Don't hardcode
	mapping of VK_DECIMAL to GDK_KP_Decimal. Instead, let ToAsciiEx()
	map it to what's printed on the keypad decimal key for the current
	input locale (keyboard layout). (#149404)
2004-08-07 23:31:52 +00:00
Tor Lillqvist 249b9c1218 WM_WINDOWPOSCHANGED): Add _gdk_offset_{x,y} to top-level window
2004-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (handle_configure_event,
	gdk_event_translate:WM_WINDOWPOSCHANGED): Add _gdk_offset_{x,y} to
	top-level window coordinates, not just in generated
	events. (#148526, Robert Ögren)
2004-08-07 21:45:19 +00:00
Tor Lillqvist afef1cc9db Merge from HEAD:
2004-08-07  Tor Lillqvist  <tml@iki.fi>

	Merge from HEAD:

	* gdk/win32/gdkwindow-win32.c (gdk_window_new): Backward
	compatibility for GDK_WINDOW_TEMP, GDK_INPUT_ONLY. (#148702, Hans
	Breuer)
2004-08-07 15:22:44 +00:00
Matthias Clasen a114bc7096 Fix a typo. 2004-08-07 13:18:12 +00:00
Matthias Clasen 8daf239a03 Make the column drag code a bit more robust (still scary, though).
Sat Aug  7 01:26:08 2004  Matthias Clasen  <maclas@gmx.de>

	Make the column drag code a bit more robust (still scary,
	though).  (#106992, Christian Biere)

	* gtk/gtktreeview.c (_gtk_tree_view_column_start_drag): Assert
	that cur_reorder is NULL here.

	* gtk/gtktreeview.c (gtk_tree_view_button_release_drag_column):
	Reset cur_reorder to NULL, and only hide drag_highlight_window
	if it exists.
2004-08-07 05:32:12 +00:00
Federico Mena Quintero 70076454c6 Merged from HEAD:
2004-08-06  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	Fix #144232:

	* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
	GtkFileChooserEntry for the file name, rather than a GtkEntry.
	(update_chooser_entry): Set the contents of the file chooser entry
	rather than the plain entry's.
	(gtk_file_chooser_default_set_current_folder): Set the new folder
	on the save entry.
	(gtk_file_chooser_default_set_current_name): Set the name on the
	file chooser entry.
	(check_save_entry): Use the file chooser entry rather than the
	plain entry.

	* gtk/gtkfilechooserentry.c
	(_gtk_file_chooser_entry_set_base_folder): Call
	gtk_file_chooser_entry_changed() so that we recompute the current
	folder based on the new base folder.
2004-08-06 19:59:36 +00:00
Matthias Clasen 8996a22718 Fix an off-by-one error. (#141809, Markku Vire)
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
	an off-by-one error.  (#141809, Markku Vire)
2004-08-06 17:40:04 +00:00
Danilo Šegan eb924984dc Updated Serbian translations. 2004-08-06 17:29:51 +00:00
Robert Ögren 21ce0b3f20 Set x_root and y_root in button and motion events from the tablet.
2004-07-28  Robert Ögren  <gtk@roboros.com>

	* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Set x_root
	and y_root in button and motion events from the tablet. (#148715)
2004-08-06 01:54:14 +00:00
Pablo Saratxaga 27129904a9 updated Breton and Walloon files 2004-08-05 20:22:24 +00:00
Ankitkumar Rameshchandra Patel f1fdab1574 ankit@redhat.com /05/08/04 2004-08-05 08:01:33 +00:00
Ankitkumar Rameshchandra Patel d0e1b8482b ankit@redhat.com /05/08/04 2004-08-05 06:16:48 +00:00
Matthias Clasen f36342b52d Make gtk_ui_manager_add_ui() accept paths with a leading "/ui". (#149077,
Tue Aug  3 20:03:33 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkuimanager.c (get_node): Make gtk_ui_manager_add_ui()
	accept paths with a leading "/ui".  (#149077, David Malcolm)
2004-08-04 00:06:48 +00:00
Matthias Clasen 79b790a09b Correct the return type of gtk_tree_model_filter_get_flags(). (#149195,
Tue Aug  3 18:38:40 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreemodelfilter.c: Correct the return type
	of gtk_tree_model_filter_get_flags().  (#149195, Morten Welinder)
2004-08-03 22:41:14 +00:00
Matthias Clasen cffa661b92 Fix #149191, reported by Morten Welinder:
Tue Aug  3 18:16:55 2004  Matthias Clasen  <maclas@gmx.de>

	Fix #149191, reported by Morten Welinder:

	* gtk/gtkmain.c: Include gtkclipboard.h,
	* gtk/gtkwidget.h: Declare _gtk_widget_grab_notify, not
	_gtk_widget_emit_grab_notify.
2004-08-03 22:22:03 +00:00
Laszlo Dvornik cdcbdeaf44 Updated Hungarian translation.
2004-08-03  Laszlo Dvornik  <dvornik@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-08-03 16:43:43 +00:00
Matthias Clasen cfeee35965 Optimize for the case that row_column and col_column are unset. (#148868,
* gtk/gtkcombobox.c (gtk_combo_box_relayout_item): Optimize
	for the case that row_column and col_column are unset.
	(#148868, Lorenzo Gil Sánchez)
2004-08-03 05:31:19 +00:00
Jordi Mallach 70e6af9504 Updated Catalan translation. 2004-08-02 11:46:08 +00:00
Matthias Clasen ed31e5a048 Don't steal the pointer grab from the context menu of the entry. (#148686,
Mon Aug  2 02:07:43 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_popdown):
	Don't steal the pointer grab from the context menu of the
	entry.  (#148686, Christian Persch)
2004-08-02 06:08:58 +00:00
Matthias Clasen 29e1292636 Add missing error traps. (#149011, Thomas Leonard)
Mon Aug  2 01:02:57 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed):
	(gdk_check_wm_desktop_changed): Add missing error
	traps.  (#149011, Thomas Leonard)
2004-08-02 05:03:59 +00:00
Matthias Clasen 3a8845dafc Use canonical signal names in doc comments, since gtk-doc won't pick up
Mon Aug  2 00:11:31 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkuimanager.c (gtk_ui_manager_class_init):
	* gtk/gtkactiongroup.c (gtk_action_group_class_init): Use
	canonical signal names in doc comments, since gtk-doc won't
	pick up signal docs with underscores.

Mon Aug  2 00:12:16 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentry.c (gtk_entry_class_init):
	(gtk_entry_get_alignment):
	(gtk_entry_set_alignment): Document the xalign property
	and its getter and setter as 2.4 additions.  (#148978,
	Axel Simon)
2004-08-02 04:17:26 +00:00
Matthias Clasen c7d2a3cfd3 Fix progressive loading of 8bit pcx files. (#148518, Magnus Bergman)
Sun Aug  1 23:57:06 2004  Matthias Clasen  <maclas@gmx.de>

	* io-pcx.c (pcx_increment_load_data_1): Fix progressive
	loading of 8bit pcx files. (#148518, Magnus Bergman)
2004-08-02 03:59:49 +00:00
Funda Wang 7dc629c56d Updated Simplified Chinese translation 2004-08-01 18:18:35 +00:00
Christophe Merlet a97f96b8d5 Updated French translation. 2004-08-01 12:08:41 +00:00
Matthias Clasen 4190964158 Use the canonical form of signal names after "notify::". Otherwise, no
Sat Jul 31 01:13:01 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwindow.c:
	* gtk/gtkentry.c:
	* gtk/gtkaction.c: Use the canonical form of signal names
	after "notify::". Otherwise, no notification arrives.
	GObject should have a warning for that, really.  (#148879,
	Lorenzo Gil Sánchez)
2004-07-31 05:15:17 +00:00
Matthias Clasen b4c44e4c42 Don't set both states at once. (#148789, Matthew Garret)
Sat Jul 31 00:42:08 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_keep_below):
	* gdk/x11/gdkwindow-x11.c (gdk_window_set_keep_above): Don't
	set both states at once.  (#148789, Matthew Garret)
2004-07-31 04:44:43 +00:00
Matthias Clasen f911da5e90 Fix the positioning of the popup.
Fri Jul 30 02:21:41 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
	Fix the positioning of the popup.
2004-07-30 13:48:39 +00:00
Federico Mena Quintero 3c1da10415 Merged from HEAD:
2004-07-28  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Store signal IDs in gulongs, not guints!
	(gtk_file_chooser_default_hierarchy_changed): We now monitor the
	focus widget on our toplevel to know which widget was last focused
	at the time our "should_respond" method gets called.
	(shortcuts_activate_selected): New helper function.
	(shortcuts_get_selected): New helper function.
	(remove_selected_bookmarks): Use shortcuts_get_selected().
	(bookmarks_check_remove_sensitivity): Likewise.
	(shortcuts_reorder): Likewise.
	(shortcuts_activate_iter): Renamed from shortcuts_activate_item().
	Activate by iter, not by item number.
	(save_folder_combo_changed_cb): Use shortcuts_activate_iter().
	(shortcuts_row_activated_cb): Likewise.
	(gtk_file_chooser_default_should_respond): If the last focused
	widget on the toplevel was the shortcuts list, activate the
	selected shortcut.
2004-07-29 21:01:03 +00:00
Kjartan Maraas 5233d0baf4 Updated Norwegian translation.
2004-07-29  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian translation.
2004-07-29 20:56:45 +00:00
Laurent Dhima bce254c912 Updated Albanian translation.
2004-07-29  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-07-29 15:56:55 +00:00
Laurent Dhima 09ab5502c2 Updated Albanian translation.
2004-07-28  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-07-28 17:10:25 +00:00
Matthias Clasen 361743d885 Make the fb backend compile against current freetype. (#148558, Nicolas
2004-07-28  Matthias Clasen  <mclasen@redhat.com>

	* gdk/linux-fb/gdkprivate-fb.h: Make the fb backend compile against
	current freetype.  (#148558, Nicolas Deves)

	* gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Fix
	prototype mismatch.  (#148589, Nicolas Deves)
2004-07-28 16:06:54 +00:00
Matthias Clasen 4585e13bb2 Warning fixes.
2004-07-28  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c: Warning fixes.
2004-07-28 15:35:17 +00:00
Dmitry Mastrukov 3e5714b31b ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2004-07-28 03:19:45 +00:00
Alexander Shopov f560ca2abf Updated Bulgarian translation by Rostislav "zbrox" Raykov
2004-07-27  Alexander Shopov  <ash@contact.bg>

	* Updated Bulgarian translation by
	Rostislav "zbrox" Raykov <zbrox@i-space.org>
2004-07-27 19:17:39 +00:00
Christian Rose 2888c662b4 Fix for #148437. Thanks to Robert Ögren for discovering the problem.
2004-07-26  Christian Rose  <menthos@menthos.com>

	* po/sv.po, po-properties/sv.po: Fix for #148437. Thanks to
	Robert Ögren for discovering the problem.
2004-07-26 06:10:59 +00:00
Changwoo Ryu a6148c464b Updated Korean translation 2004-07-25 20:12:24 +00:00
Francisco Javier F. Serrador 10eb81cc03 Updated Spanish translation.
2004-07-25  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-07-24 22:00:47 +00:00
Updated ja.po. T.Aihana e8a9c6d40c 2004-07-24 Updated ja.po. T.Aihana <aihana@gnome.gr.jp> 2004-07-24 15:26:41 +00:00
Matthias Clasen 0406f5c2f8 Don't iterate too far up. (#147965, Olivier Sessink)
Fri Jul 23 11:00:17 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextbtree.c (_gtk_text_line_previous_could_contain_tag):
	Don't iterate too far up. (#147965, Olivier Sessink)
2004-07-23 15:02:07 +00:00
Amanpreet Singh Alam deff88d90c up from main 2004-07-23 06:49:53 +00:00
Gustavo Maciel Dias Vieira 02defda7a2 Updated Brazilian Portuguese translation done by Afonso Celso Medina
2004-07-22  Gustavo Maciel Dias Vieira  <gustavo@sagui.org>

        * pt_BR.po: Updated Brazilian Portuguese translation done by
        Afonso Celso Medina <afmedina@uol.com.br>.
2004-07-22 15:06:06 +00:00
Matthias Clasen 591368e293 Add additional accessability relations. (#141804, Padraig O'Briain)
Thu Jul 22 01:21:28 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfontsel.c (gtk_font_selection_init): Add additional
	accessability relations.  (#141804,  Padraig O'Briain)
2004-07-22 05:27:30 +00:00
Dmitry Mastrukov b201a24ed2 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2004-07-22 05:12:39 +00:00
Matthias Clasen 816acf018f Don't leak the list store. (#148135, Crispin Flowerday)
Wed Jul 21 22:54:33 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text):
	Don't leak the list store.  (#148135, Crispin Flowerday)
2004-07-22 03:01:08 +00:00
Matthias Clasen 41045df10d Don't leak the list store. (#148134, Crispin Flowerday)
* gtk/gtkcombobox.c (gtk_combo_box_new_text): Don't leak the
	list store.  (#148134, Crispin Flowerday)
2004-07-22 02:48:00 +00:00
Matthias Clasen 52897dca78 Don't leak the menu. (#148110, Tommi Komulainen)
Wed Jul 21 22:35:47 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcellview.c (gtk_cell_view_finalize): Don't leak the
	menu.  (#148110, Tommi Komulainen)
2004-07-22 02:37:17 +00:00
Matthias Clasen 3787535900 Don't leak tree model and tree row reference. (#148125, Crispin Flowerday)
Wed Jul 21 22:24:10 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcellview.c (gtk_cell_view_finalize): Don't leak
	tree model and tree row reference.  (#148125, Crispin Flowerday)
2004-07-22 02:26:22 +00:00
Matthias Clasen 617c2261ae Don't leak models. (#148128, Tommi Komulainen)
Wed Jul 21 22:17:06 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/testcombo.c (main): Don't leak models.  (#148128,
	Tommi Komulainen)
2004-07-22 02:19:35 +00:00
Matthias Clasen f05ed3f6da Don't leak the adjustments. (#148089, Tommi Komulainen)
Wed Jul 21 21:26:08 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkviewport.c (viewport_set_adjustment): Don't leak
	the adjustments.  (#148089, Tommi Komulainen)
2004-07-22 01:28:47 +00:00
Matthias Clasen 56f933309d Don't leak the adjustments. (#148073, Tommi Komulainen)
Wed Jul 21 21:20:21 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreeview.c (gtk_tree_view_destroy): Don't leak
	the adjustments.  (#148073, Tommi Komulainen)
2004-07-22 01:21:53 +00:00
Matthias Clasen 4fe91ca0a9 Don't leak the arrow. (#148064, Tommi Komulainen)
Wed Jul 21 21:04:50 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktoolbar.c (gtk_toolbar_finalize): Don't leak the
	arrow.  (#148064, Tommi Komulainen)
2004-07-22 01:09:35 +00:00
Duarte Loreto a796b1f9bc Updated Portuguese translation.
2004-07-22  Duarte Loreto <happyguy_pt@hotmail.com>

	* pt.po: Updated Portuguese translation.
2004-07-21 23:57:41 +00:00
Christian Rose 4d6333f0bf Updated Uzbek translation by Mashrab Kuvatov
2004-07-21  Christian Rose  <menthos@menthos.com>

	* po/uz.po, po-properties/uz.po: Updated Uzbek translation
	by Mashrab Kuvatov <kmashrab@sat.physik.uni-bremen.de>.
2004-07-21 21:37:06 +00:00
Metin Amiroff 8900c03e11 Translation updated by Mətin Əmirov.
2004-07-21  Metin Amiroff  <metin@karegen.com>

	* az.po: Translation updated by Mətin Əmirov.
2004-07-21 16:16:40 +00:00
Guntupalli Karunakar 2b18858303 updated hindi translation 2004-07-21 13:10:05 +00:00
Matthias Clasen 6c2bc78064 Apply patches to unmaintained pieces of software. 2004-07-21 03:29:07 +00:00
Matthias Clasen cd592c2645 Remove trailing commas from enumerations. (#148035)
Tue Jul 20 22:26:29 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilechooserutils.h:
	* gtk/gtktoolbutton.c:
	* gtk/gtktoolbar.c:
	* gtk/gtkicontheme.c:
	* gtk/gtkcalendar.c:
	* demos/gtk-demo/ui_manager.c:
	* demos/gtk-demo/appwindow.c: Remove trailing commas
	from enumerations.  (#148035)
2004-07-21 02:53:42 +00:00
Matthias Clasen 6413017f03 Ref an sink all proxies, so that we can properly clean up floating proxies
2004-07-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node, free_node): Ref an sink
	all proxies, so that we can properly clean up floating proxies
	which the app didn't adopt.  (#147926, Tommi Komulainen)
2004-07-20 17:09:47 +00:00
Matthias Clasen a44db0c5c4 Set drag_pos before grabbing the focus, since we may reenter into
* gtk/gtktreeview.c (gtk_tree_view_button_press): Set drag_pos
	before grabbing the focus, since we may reenter into
	gtk_tree_view_motion_resize_column() which requires drag_pos
	to be set.  (#147913, Guilherme Salgado, patch by John Finlay)
2004-07-20 04:51:51 +00:00
Matthias Clasen 7266f9a800 Don't use uninitialized node pointer. (#147911, Peter Zelezny)
Mon Jul 19 23:51:50 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreeview.c (gtk_tree_view_enter_notify): Don't
	use uninitialized node pointer.  (#147911, Peter Zelezny)
2004-07-20 04:03:30 +00:00
Gareth Owen c1f8ca5929 Updated British English translation by James Ogley 2004-07-20 02:18:08 +00:00
Pawan Chitrakar 5446f039d2 Updated Nepali translation
2004-07-19  Pawan Chitrakar  <pawan@nplinux.org>

	* ne.po: Updated Nepali translation
2004-07-19 09:05:17 +00:00
Vincent van Adrighem 2b2719befc Translation updated by Tino Meinen.
2004-07-18  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Tino Meinen.
2004-07-18 13:05:53 +00:00
Pauli Virtanen 6fb41ab84b Updated Finnish translation.
2004-07-18  Pauli Virtanen  <pauli.virtanen@hut.fi>

	* fi.po: Updated Finnish translation.
2004-07-18 12:23:54 +00:00
Alessio Frusciante 06332e35e6 Updated Italian translation. 2004-07-17 15:20:07 +00:00
Alexander Winston a7343b31c3 Updated Canadian English translation.
2004-07-16  Alexander Winston  <alexander.winston@comcast.net>

	* en_CA.po: Updated Canadian English translation.
2004-07-16 17:06:33 +00:00
Christian Rose 4db49dde07 Updated Swedish translation.
2004-07-16  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2004-07-16 05:59:42 +00:00
Matthias Clasen ca55b116a8 Fix #60128, #58307, #144706:
Thu Jul 15 22:19:40 2004  Matthias Clasen  <maclas@gmx.de>

	Fix #60128, #58307, #144706:

	* gtk/gtkstyle.c (gtk_style_real_copy): Handle references
	to bg_pixmaps properly.
	(gtk_style_real_unrealize): Don't keep dangling references
	to the bg_pixmaps.
	(gtk_style_attach): Split the loop into two loops, first
	looking for a matching style, then for an empty one.
	(gtk_style_finalize):
	(gtk_style_duplicate): Add comments explaining the handling
	of style->styles.
2004-07-16 02:22:32 +00:00
Matthias Clasen 9171e7438f Install the timeout before changing the value, so that a ::value_changed
Thu Jul 15 20:31:28 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkspinbutton.c (start_spinning): Install the timeout
	before changing the value, so that a ::value_changed handler
	has a chance to remove it.  (#122427, Elke Meier)
2004-07-16 00:37:47 +00:00
Miloslav Trmac bdb5f882ab Updated Czech translation.
2004-07-15  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-07-15 17:04:30 +00:00
Matthias Clasen 323dffbc3b Don't reparent back to menu->toplevel if it is already gone because we're
2004-07-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Don't reparent
	back to menu->toplevel if it is already gone because we're
	shutting down.  (#147656, John Cupitt)
2004-07-15 16:57:53 +00:00
Laurent Dhima af554cb133 Updated Albanian translation.
2004-07-15  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-07-15 15:00:04 +00:00
Federico Mena Quintero 2e6649ba17 Merged from HEAD:
2004-07-14  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	Fix #126295:

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Draw a focus
	indicator along the edge of the bin_window when the tree is empty.
	(grab_focus_and_unset_draw_keyfocus): New helper function.
	(gtk_tree_view_button_press): Remove a bit of superfluous code.
	Use the helper function to save on duplicated code.
	(gtk_tree_view_button_press): Grab the focus if the tree is empty.
	(gtk_tree_view_focus): Allow focusing into an empty tree.
2004-07-15 01:39:00 +00:00
Changwoo Ryu 733d0c9154 Updated Korean translation.
* ko.po: Updated Korean translation.
2004-07-14 21:21:55 +00:00
Artur Flinta db9ce55567 Updated Polish translation by GNOME PL Team.
2004-07-14  Artur Flinta  <aflinta@cvs.gnome.org>

	* pl.po: Updated Polish translation by GNOME PL Team.
2004-07-14 18:17:56 +00:00
Federico Mena Quintero c214874a8c Merged from HEAD:
2004-07-14  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	Fix #144405, patch by Padraig O'Briain <padraig.obriain@sun.com>:

	* gtk/gtkfilechooserdefault.c (shortcuts_list_create): Set the
	accessible object name for the tree view.
	(create_file_list): Likewise.
2004-07-14 17:09:14 +00:00
Matthias Clasen 175146c46d Don't leak no_svg_filename. (#147399, Kjartan Maraas)
Tue Jul 13 21:53:08 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkicontheme.c (free_unthemed_icon): Don't leak
	no_svg_filename.  (#147399, Kjartan Maraas)
2004-07-14 01:57:34 +00:00
Sami Pesonen fd551b2522 Finnish translation updated by Sami Pesonen <sampeson@iki.fi> 2004-07-13 19:33:01 +00:00
Federico Mena Quintero e2d90b91c1 Merged from HEAD:
2004-07-13  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	* gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
	busy cursor while mounting the volume.  Also, ref the chooser
	while mounting, as we may re-enter.  Fixes #139376.
2004-07-13 18:26:47 +00:00
Alexander Winston f979c5c56e Updated Canadian English translation.
2004-07-13  Alexander Winston  <alexander.winston@comcast.net>

	* en_CA.po: Updated Canadian English translation.
2004-07-13 16:02:27 +00:00
Laszlo Dvornik a7ce2ab638 Updated Hungarian translation.
2004-07-13  Laszlo Dvornik  <dvornik@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-07-13 15:19:57 +00:00
Matthias Clasen 49639a9cd1 Fix compile errors. 2004-07-13 14:51:20 +00:00
Matthias Clasen 6f1882c24c Add gtk_parse_args 2004-07-13 14:27:07 +00:00
Matthias Clasen 2a98a16650 Don't crash if unrealized.
2004-07-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcombobox.c (gtk_combo_box_popdown): Don't
	crash if unrealized.
2004-07-13 13:54:40 +00:00
Christian Rose 6f3cb8b1e1 Updated Swedish translation.
2004-07-13  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2004-07-12 22:11:43 +00:00
Vincent van Adrighem fa57ef8aef Translation updated by Tino Meinen.
2004-07-12  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Tino Meinen.
2004-07-12 21:17:31 +00:00
Federico Mena Quintero 4ec3a1d6bd Merged from HEAD:
2004-07-12  Federico Mena Quintero  <federico@ximian.com>

	Merged from HEAD:

	* gtk/glossary.xml: Start of the GTK+ glossary.

	* gtk/Makefile.am (content_files): Added glossary.xml.

	* gtk/gtk-docs.sgml: Likewise.
2004-07-12 21:07:13 +00:00
Matthias Clasen f23bda0aad Apply the gtk-default-menu-item-style to cell view menu items as well.
* gtk/gtkrc.c (_gtk_rc_init): Apply the gtk-default-menu-item-style
	to cell view menu items as well.  (#147405, John Cupitt)
2004-07-12 16:22:50 +00:00
Matthias Clasen cb32f70d20 Pop down first. (#147399, John Cupitt)
* gtk/gtkcombobox.c (gtk_combo_box_destroy): Pop down
	first. (#147399, John Cupitt)
2004-07-12 14:47:52 +00:00
Francisco Javier F. Serrador 4e59943375 Updated Spanish translation.
2004-07-11  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-07-11 16:38:10 +00:00
Matthias Clasen aa36444d7b Make middle-button pasting work as expected inside the entry. (#116789,
Sat Jul 10 23:35:13 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentry.c (paste_received): Make middle-button pasting
	work as expected inside the entry.  (#116789, Scott Bronson)
2004-07-11 03:37:36 +00:00
Matthias Clasen 6c7d7624de Update clipboards. (#142805, Mikael Hallendal)
Sat Jul 10 22:13:53 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextbuffer.c (gtk_text_buffer_select_range): Update
	clipboards.  (#142805, Mikael Hallendal)
2004-07-11 02:19:41 +00:00
Miloslav Trmac 8c204e5162 Updated Czech translation.
2004-07-10  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-07-10 17:52:15 +00:00
Laurent Dhima cf41b53d71 Updated 2004-07-10 16:51:21 +00:00
Matthias Clasen 7608f14b65 Bump version number 2004-07-10 04:58:54 +00:00
Matthias Clasen 8291422086 2.4.4 2004-07-10 04:44:05 +00:00
Federico Mena Quintero 4a34b201cb Merged from HEAD:
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 21:16:39 +00:00
Matthias Clasen 1c575522c7 Use the requisition of the widget instead of relying on the style drawing
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 18:07:09 +00:00
Matthias Clasen 4d67d33f02 Updates 2004-07-09 16:16:05 +00:00
Matthias Clasen 7c02992921 Make GtkEntry work harder to protect passwords: (#143955, Morten Welinder)
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 15:11:25 +00:00
Matthias Clasen 50ff8e97f9 Fix some cases where style functions were not handling widget == NULL
2004-07-09  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkstyle.c: Fix some cases where style functions were
	not handling widget == NULL properly.  (#146282)
2004-07-09 14:39:17 +00:00
Matthias Clasen 7cd37d663b Add stock file and directory icons in sizes 16 and 24. Do not add the
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-09 02:17:57 +00:00
Federico Mena Quintero 06a15ebedb Merged from HEAD:
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-09 00:56:13 +00:00
Matthias Clasen 5bbe06755f Allow to restore the default search function. (#145365, John Finlay)
* gtk/gtktreeview.c (gtk_tree_view_set_search_equal_func): Allow
	to restore the default search function.  (#145365, John Finlay)
2004-07-08 21:19:08 +00:00
Matthias Clasen 154f5dad5b Don't leak references to the drag context. (#144324, Alex Larsson)
2004-07-08  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
	references to the drag context.  (#144324, Alex Larsson)
2004-07-08 20:34:25 +00:00
Matthias Clasen d9a12031a2 Stop editing when a new model is set. (#145566, Dmitry M. Shatrov)
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)
2004-07-08 04:34:20 +00:00
Matthias Clasen 304f9655f9 Make sure that subpixbufs are properly aligned for
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)
2004-07-08 03:47:49 +00:00
Matthias Clasen e9786ce85d Fix the build. 2004-07-07 15:33:59 +00:00
Matthias Clasen 96ad6fc4bf Remove conflict marker. 2004-07-07 03:02:36 +00:00
Matthias Clasen df8a418a8f Fix a 64bit alignment issue. (#144302, Sunil)
Tue Jul  6 22:58:00 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 03:02:01 +00:00
Tor Lillqvist 7cf485c594 gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
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.
2004-07-07 00:15:27 +00:00
Tor Lillqvist 0b9bdc7987 Also gdk-pixbuf.c was changed. 2004-07-06 22:32:11 +00:00
Tor Lillqvist 781d7b3364 Mark the version variables for proper import and export from Windows DLLs.
2004-07-06  Tor Lillqvist  <tml@iki.fi>

	* gdk-pixbuf-features.h.in: Mark the version variables for proper
	import and export from Windows DLLs. Thanks to Laurent Sansonetti
	for reporting the problem.
2004-07-06 22:26:14 +00:00
Gil Osher 1a12599fdb Updated Hebrew translation. Thanks to Ohad Lutzki.
* he.po: Updated Hebrew translation.
	Thanks to Ohad Lutzki.
2004-07-06 20:15:35 +00:00
Gil Osher f1331d8410 Updated Hebrew translation
Thanks to Ohad Lutzki
2004-07-06 20:14:46 +00:00
Jonathan Blandford 529fb0f44f Fix for #136496, Pawel Salek:
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 14:32:07 +00:00
Matthias Clasen ac680cad1e Make sure private->monitor_num is a valid monitor number before using it.
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)
2004-07-06 13:27:01 +00:00
Matthias Clasen 632ce3d3ae Improve positioning of keyboard-activated menus with Xinerama.
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.
2004-07-06 06:02:27 +00:00
Matthias Clasen cf098bba4b Only call GDK_THREADS_ENTER() / _LEAVE() when called from an idle handler.
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)
2004-07-06 04:33:26 +00:00
Matthias Clasen b4fa63e261 Use the less efficient g_object_interface_find_property () instead of the
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)
2004-07-06 04:08:18 +00:00
Laurent Dhima b5b88a69aa Updated Albanian translation.
2004-07-05  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-07-05 15:44:57 +00:00
Pawan Chitrakar 02f7f14cf2 Updated Nepali translation
2004-07-04  Pawan Chitrakar  <pawan@nplinux.org>

	* ne.po: Updated Nepali translation
2004-07-05 05:35:56 +00:00
Matthias Clasen b741e5d3a4 Fix off-by-one error. GDate month is one-based and GtkCalendar month is
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)
2004-07-04 05:31:30 +00:00
Matthias Clasen ad7adfb4e3 Don't crash if somebody tries to move a node after itself in a list of
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)
2004-07-04 05:12:32 +00:00
Matthias Clasen e782c03412 at 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)
2004-07-04 03:48:28 +00:00
Matthias Clasen 0fe0cbaf0c Reset current_width and current_height to 0 when ending the embedding.
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)
2004-07-03 06:15:49 +00:00
Matthias Clasen 8faf265c12 Let the cursor move to the right end of the entry text, even if it ends in
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)
2004-07-03 05:50:26 +00:00
Matthias Clasen faec05473d Correct the math to calculate bilinear weights. (#112412, Brian Cameron)
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)
2004-07-03 05:31:10 +00:00
Matthias Clasen e753dc2e5a Unset the displayed row when unsetting the model. (#138560, Christian
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)
2004-07-03 03:37:57 +00:00
Matthias Clasen b85ef7f732 Properly align mask and pixbuf if a subarea is exposed. (#135423, fix by
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-03 02:45:14 +00:00
J. Ali Harlow ebe22cd6d3 Merge from HEAD:
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
2004-07-02 04:00:51 +00:00
Laurent Dhima ef50ede3b6 Translation updated.
2004-06-28  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Translation updated.
2004-06-28 15:13:25 +00:00
Matthias Clasen 292b331f5b Handle _NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. (#144851, Billy Biggs)
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)
2004-06-26 05:17:40 +00:00
Matthias Clasen eb86193b07 Prevent unwanted recursion by resetting icon_set->cache before freeing the
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)
2004-06-26 05:08:59 +00:00
Matthias Clasen c518a56720 Accept a NULL style.
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.
2004-06-26 04:59:09 +00:00
Matthias Clasen 204d0e0003 * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
* gtk/gtkcombobox.c (gtk_combo_box_set_model):
Sat Jun 26 00:04:36 2004  Matthias Clasen  <maclas@gmx.de>
2004-06-26 04:07:05 +00:00
Matthias Clasen af19500ed3 Allow passing NULL to unset the model. (#137211, patch by Mariano
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)
2004-06-26 03:38:46 +00:00
Matthias Clasen f408e1f17f Avoid uninitialized use of &parent_iter. (#145007, John Finlay)
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-26 02:54:35 +00:00
Bastien Nocera c3e91c2604 reviewed by: Matthias Clasen <maclas@gmx.de>
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.
2004-06-25 15:13:07 +00:00
Matthias Clasen bcd4a8cdb3 Commit a forgotten fix. 2004-06-25 04:33:47 +00:00
Nguyen Thai Ngoc Duy a7df1508a6 update vi.po 2004-06-24 22:40:47 +00:00
Alexander Shopov 8dbbf8321b Fixed LTR translation
2004-06-24  Alexander Shopov  <ash@contact.bg>

	* bg.po: Fixed LTR translation
2004-06-24 08:17:43 +00:00
Matthias Clasen 3cc2f664cd Flip the y axes in the diagrams.
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.
2004-06-23 02:00:54 +00:00
Federico Mena Quintero 4fb311b311 Merged from HEAD:
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-23 00:32:16 +00:00
Federico Mena Quintero 96425d2e3c Merged from HEAD:
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 20:09:33 +00:00
Matthias Clasen 34121a9108 Accept "<WINDOWTYPE>" as a valid accel path. (#144427, Philip Kendall)
* gtk/gtkaccelmap.c (_gtk_accel_path_is_valid): Accept
	"<WINDOWTYPE>" as a valid accel path.  (#144427, Philip
	Kendall)
2004-06-22 15:56:04 +00:00
Matthias Clasen ce88affe29 Make sure this gets defined for all backends, so linux-fb has a chance of
* gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure
	this gets defined for all backends, so linux-fb has a
	chance of compiling.
2004-06-22 15:36:03 +00:00
Matthias Clasen af65cdb24e Typo fix. (#144750, Jeff Franks)
2004-06-22  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkicontheme.h (GTK_ICON_THEME_GET_CLASS): Typo
	fix.  (#144750, Jeff Franks)
2004-06-22 14:27:59 +00:00
Michael Natterer 5ca944a813 made convert_format() utility function public as
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-21 16:11:28 +00:00
Andras Timar 8f382907d7 Updated Hungarian translation.
2004-06-20  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-06-20 18:41:29 +00:00
Matthias Clasen 4915dc0ef8 Add a figure which tries to expain pixbuf compositing.
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.
2004-06-20 04:19:06 +00:00
Matthias Clasen 105deb1810 Fix the docs for GtkTreeModelFilterVisibleFunc. (#144583, Olivier Andrieu)
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-19 01:24:36 +00:00
Federico Mena Quintero 3a364cd602 Merge from HEAD:
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.
2004-06-16 21:39:54 +00:00
Matthias Clasen 0ed32754f4 Make the tiff loader work with both libtiff 3.5.7 and libtiff 3.6.1.
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-16 17:54:17 +00:00
Matthias Clasen f740c34dcb Make GtkComboBox work without model. (#144198, Mariano Suárez-Alvarez)
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-15 05:13:56 +00:00
Federico Mena Quintero c8a682947a Merge from HEAD:
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-12 00:51:30 +00:00
Matthias Clasen d004f2901e Post-release version bump 2004-06-11 14:37:42 +00:00
Matthias Clasen 569090f11e GTK+ 2.4.3 2004-06-11 13:48:57 +00:00
Matthias Clasen 32eed3d40a Typo fix. 2004-06-11 02:15:43 +00:00
Matthias Clasen 37c0651b95 Check whether priv->box is NULL before disconnecting from its signals. 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-11 01:18:34 +00:00
Federico Mena Quintero bb6dd7da57 Merge 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().
2004-06-11 00:47:51 +00:00
Andras Timar 2fb484d7cc Updated Hungarian translation.
2004-06-11  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-06-10 22:15:37 +00:00
Matthias Clasen d0c98af5f8 Start the drag before focusing the selected.day. Stop a beginning drag if
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.
2004-06-10 04:37:11 +00:00
Matthias Clasen bec6655a7c Start spinning before calling arrow_action(), so that a signal handler
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)
2004-06-10 04:08:06 +00:00
Matthias Clasen d436ab3def Typo fix. 2004-06-10 03:10:55 +00:00
Soeren Sandmann 6da13b2f0a Revert the "drag select" part of #141169. (#144011).
Thu Jun 10 00:22:51 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c: Revert the "drag select" part of
	#141169. (#144011).
2004-06-09 22:28:41 +00:00
Pawan Chitrakar 35f8965bed Update translation of nepali
2004-06-08  Pawan Chitrakar  <pawan@nplinux.org>

	* ne.po: Update translation of nepali
2004-06-08 13:23:24 +00:00
Matthias Clasen d516dac5b2 Handle priv->model being NULL. (#143856, Mariano Suárez-Alvarez)
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-08 03:10:29 +00:00
Federico Mena Quintero b55a0e4921 Merge from HEAD:
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.
2004-06-08 02:33:46 +00:00
Matthias Clasen 71d1467304 Add an ignore_enter flag and use it as in the menu code to avoid the
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)
2004-06-06 03:11:02 +00:00
Soeren Sandmann 41bf2931d2 Add a checkbox to queue an merge/unmerge. Patch from Matthias Clasen.
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-05 18:21:41 +00:00
Matthias Clasen aad633f661 Convert filenames to UTF-8 when embedding them in error messages.
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-05 05:10:29 +00:00
Matthias Clasen d29d5fd365 Add a note about the !CAN_FOCUS quirk in the button size allocation code.
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.
2004-06-04 16:52:51 +00:00
Matthias Clasen f3e0bab511 Give the space requested for drawing the focus indicator to the child in
2004-06-04  Matthias Clasen  <mclasen@redhat.com>

	* 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 16:47:19 +00:00
Matthias Clasen 34b133c8b9 Post-release version bump 2004-06-04 15:16:54 +00:00
Matthias Clasen 876528e16b 2.4.2 2004-06-04 15:06:26 +00:00
Matthias Clasen 5f1caa9779 Calculate the length of the entry contents in characters, not in bytes.
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.
2004-06-04 01:18:19 +00:00
Matthias Clasen 9f18204cc5 Fix the al lowed values and default value for the ::active property.
Thu Jun  3 20:51:23 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the al lowed
	values and default value for the ::active property.  (#143669,
	Olivier Andrieu)
2004-06-04 00:55:05 +00:00
Michael Natterer 798e56c1e9 Merged from HEAD:
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.
2004-06-03 19:23:29 +00:00
Soeren Sandmann 0c18fe881b Revert previous commit. It caused the problem of sticky right click menus
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.
2004-06-03 00:14:49 +00:00
Soeren Sandmann ce4015d2ec Fix the stay up algorithm for combo boxes to better handle the "click"
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 23:15:45 +00:00
Federico Mena Quintero 3ac2421694 Merged from HEAD:
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 19:22:26 +00:00
Matthias Clasen 9846287396 Don't close the dialog on focus out of the size entry. (#143505, David
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 18:21:59 +00:00
Federico Mena Quintero 5b9f86b96a Merged from HEAD:
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().
2004-06-02 17:47:40 +00:00
Matthias Clasen c1a4a4cd56 Remove leftover debug code.
Wed Jun  2 00:47:11 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkselection.c (_gtk_selection_request): Remove leftover
	debug code.
2004-06-02 04:47:38 +00:00
Matthias Clasen 516d2b85e5 Don't allow unless selection mode is multiple. (#142634, John Finlay)
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)
2004-06-02 04:18:18 +00:00
Matthias Clasen 24739f4261 Rename function parameters from index to index_ to prevent clash with BSD
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)
2004-06-02 03:15:36 +00:00
Matthias Clasen f6e4a6ae2b Handle accel_closure being NULL on an accel label. (#139641, Sam
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)
2004-06-02 02:44:44 +00:00
Matthias Clasen 3d7693a13c coding style fix. 2004-06-02 02:30:34 +00:00
Matthias Clasen 4f525073c6 Prevent icon lookup finding icons in the wrong prefix. (#143328, Mark
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)
2004-06-02 02:24:44 +00:00
Soeren Sandmann 9e4e9889da Make menus only stay up if you release within 500 milliseconds.
Wed Jun  2 00:39:58 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* 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 22:41:42 +00:00
Alexander Shopov fbbd38ddb1 Updated Bulgarian translation by Rostislav Raikov <zbrox@i-space.org>
2004-06-01  Alexander Shopov  <ash@contact.bg>

	* bg.po: Updated Bulgarian translation by
	Rostislav Raikov <zbrox@i-space.org>
2004-06-01 16:49:31 +00:00
Federico Mena Quintero 6e92d31415 Merged from HEAD:
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-06-01 16:35:41 +00:00
Federico Mena Quintero a075ca97ed Merged from HEAD:
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.
2004-05-31 18:30:18 +00:00
Matthias Clasen af177c8c1c Typo fix. 2004-05-31 06:39:14 +00:00
Matthias Clasen e0e5f1fd52 Make detached handleboxes work when their parent is minimized, porting the
Mon May 31 02:16:37 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-31 06:27:39 +00:00
Matthias Clasen 1594006ba2 Document the default attach options for gtk_table_attach_defaults().
Mon May 31 00:16:36 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/tmpl/gtktable.sgml: Document the default attach
	options for gtk_table_attach_defaults().  (#143391,
	Steve Chaplin)
2004-05-31 04:19:35 +00:00
Vincent van Adrighem 087ea955d9 Translation updated by Reinout van Schouwen.
2004-05-30  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Reinout van Schouwen.
2004-05-30 14:05:23 +00:00
Christian Rose 41e1167283 Added "tk" to ALL_LINGUAS. Added Turkmen translation by Gurban Mühemmet
2004-05-29  Christian Rose  <menthos@menthos.com>

	* configure.in: Added "tk" to ALL_LINGUAS.
	* po/tk.po, po-properties/tk.po: Added Turkmen translation by
	Gurban Mühemmet Tewekgeli <gmtavakkoli@yahoo.com>.
2004-05-29 12:09:34 +00:00
Matthias Clasen 0988088c47 Add informative messages for common problems. (#137974, Owen Taylor)
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)
2004-05-28 19:01:03 +00:00
Matthias Clasen 47a464fcb6 Fix some docs. 2004-05-28 18:36:21 +00:00
Matthias Clasen 78068978a0 Fix off-by-one errors. (#143337, Billy Biggs)
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)
2004-05-28 18:17:07 +00:00
Jonathan Blandford 7bdde1e104 Sync from upstream
Thu May 27 15:23:17 2004  Jonathan Blandford  <jrb@gnome.org>

        * Sync from upstream
2004-05-27 19:29:41 +00:00
Matthias Clasen f951eff62e Additions 2004-05-27 04:21:26 +00:00
Matthias Clasen 653190b0df Typo fix. 2004-05-27 04:13:45 +00:00
Robert Ögren 6caac23b8e Send key modifiers (shift, ctrl etc) in button and motion events from the
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-27 02:15:15 +00:00
Alessio Frusciante 2c2fdce82f Updated Italian translation. 2004-05-25 20:23:47 +00:00
Robert Ögren 205be12b37 Don't propagate mouse events to windows that want extended input events.
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-24 22:30:52 +00:00
Tor Lillqvist 245e344eff Remove duplicated line. (Spotted by Benoît Carpentier.)
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-22 04:40:12 +00:00
Matthias Clasen d9fb9d5963 Really commit the fixes which are already in the ChangeLog. 2004-05-20 03:30:48 +00:00
Matthias Clasen be8d1d14b7 Restrict the width of the popup to be no larger than the monitor.
2004-05-18  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)
2004-05-18 18:32:08 +00:00
Matthias Clasen 1322998cd6 Allocate space for the focus rectangle only if necessary. (#142668,
2004-05-17  Matthias Clasen  <mclasen@redhat.com>

	* 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)
2004-05-17 18:49:56 +00:00
Matthias Clasen 5d2c80e124 Remove two useless lines. (#142479, Morten Welinder)
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove two useless
	lines.  (#142479, Morten Welinder)
2004-05-17 03:16:19 +00:00
Matthias Clasen 0e7ede9036 Don't read integers partially. (#142584, Kouichirou Hiratsuka)
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-17 03:07:23 +00:00
Tor Lillqvist cd396b22ae Put back the ref_count field in the GdkDragContextPrivateWin32 struct (but
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-15 04:16:58 +00:00
Matthias Clasen a2e52bc8cc Merged from HEAD:
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 18:08:28 +00:00
Matthias Clasen fffd34a24d Add a comment about unused bits.
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-14 13:48:52 +00:00
Robert Ögren 39043b9dcc Add missing call to g_object_ref in Wintab code. (#138341)
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 23:36:11 +00:00
Matthias Clasen 5d21cd3b72 Revert the previous change to this function, clarify the docs instead.
2004-05-11  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-12 15:11:28 +00:00
Michael Natterer fccbe77810 Merged from HEAD:
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 19:16:38 +00:00
Matthias Clasen 79648eb953 Merged from HEAD:
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)
2004-05-11 13:50:11 +00:00
Matthias Clasen 458d964173 Make static.
2004-05-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkwindow.c (get_screen_icon_info):
	Make static.
2004-05-10 21:14:55 +00:00
Soeren Sandmann 1cf67fae1b Add prototype for _gtk_widget_grab_notify()
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 21:05:16 +00:00
Matthias Clasen 4635094c2f Forgotten Changelog 2004-05-10 20:50:55 +00:00
Matthias Clasen 809c1777a4 Make static.
2004-05-10  Matthias Clasen  <mclasen@redhat.com>

	* 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 20:49:35 +00:00
Matthias Clasen 61fddfc0ef _-prefix the nonstatic pixops_... functions. (#142233, Morten Welinder)
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-05-10 19:42:39 +00:00
Matthias Clasen d9808b04bb Merge from HEAD:
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 18:50:21 +00:00
Matthias Clasen 457e5acb0b Merge from HEAD:
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 15:47:13 +00:00
Matthias Clasen 37976d540d Make Return activate the default button. (#118921)
2004-05-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfontsel.c (list_row_activated): Make Return activate the
	default button.  (#118921)
2004-05-10 13:29:25 +00:00
Soeren Sandmann 4b38323296 New internal function that emits the grab notify signal.
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.
2004-05-10 13:19:04 +00:00
Matthias Clasen 4c9adc8d19 Merge from HEAD:
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.
2004-05-10 04:52:25 +00:00
Matthias Clasen 3c032484c1 Allow to suppress the stock accelerator by using "". (#142196, David A
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-10 01:11:49 +00:00
Hans Breuer 20016b1511 Merge from HEAD:
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
2004-05-09 22:46:57 +00:00
Funda Wang b95a071007 Updated Simplified Chinese translation 2004-05-09 17:08:18 +00:00
Matthias Clasen fa98ac6287 In list mode, accept the same mouse/wheel bindings on the cellview as on
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)
2004-05-09 05:59:53 +00:00
Matthias Clasen e3f5861fa0 Merge from HEAD:
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-09 05:33:12 +00:00
Matthias Clasen c5f53b623c Merged from HEAD:
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.
2004-05-07 15:29:18 +00:00
Matthias Clasen e6fbe340fa Fix example. (Steffen Röcker)
Fri May  7 01:23:03 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/tmpl/gtkicontheme.sgml: Fix example.  (Steffen Röcker)
2004-05-07 05:24:13 +00:00
Matthias Clasen 0f205e9172 Also popup the submenu for items in torn off menus. (#122051)
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-07 03:51:26 +00:00
Matthias Clasen f48cdf2100 Remove this no longer needed signal handler. (#141817, Paul Pogonyshev)
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 19:29:26 +00:00
Sven Neumann b834eee6c6 in RTL mode, position the title lable next to the arrow just as we do for
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 15:39:29 +00:00
Matthias Clasen 620c316530 Document the new policy of bumping version numbers after release.
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.
2004-05-06 13:37:39 +00:00
Matthias Clasen db0bc7fb3b Don't call g_free() on a pixbuf. (#141961, Crispin Flowerday)
Wed May  5 22:20:21 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-06 02:41:36 +00:00
Matthias Clasen bcf28d3444 Make the output parseable. (#141929, Sven Neumann)
2004-05-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (print_node): Make the output
	parseable.  (#141929, Sven Neumann)
2004-05-05 16:49:20 +00:00
Tor Lillqvist e69970bd65 Add multi-monitor offset. (#141842, John Ehresman)
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-05 02:29:36 +00:00
365 changed files with 62603 additions and 46335 deletions
+1574
View File
File diff suppressed because it is too large Load Diff
+1574
View File
File diff suppressed because it is too large Load Diff
+1574
View File
File diff suppressed because it is too large Load Diff
+1574
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -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.9.tar.gz | tar xvf - # unpack the sources
% cd gtk+-2.4.9 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
+158
View File
@@ -1,3 +1,161 @@
Overview of Changes from GTK+ 2.4.7 to GTK+ 2.4.8
=================================================
* GtkFileChooser
- Fix some memory leaks [Federico Mena Quintero]
- Make save mode work with old versions of the
gnome-vfs backend. [Zack Cerza]
* GtkEntryCompletion
- Warn if text column has wrong type [Fernando San Martin Woerner,
Gustavo Carneiro]
* GtkTreeView
- Fix a redraw problem in fixed height mode [Pawel Salek]
* GDK
- Complete the _NEW_WM_USER_TIME implementation [Elijah Newren]
- Update the _NET_ACTIVE_WINDOW implementation [Elijah]
* gdk-pixbuf
- Avoid infinite loops for bad BMPs [Chris Evans, Manish Singh]
- Fix a problem with GDK_INTERP_NEAREST scaling which caused
Nautilus thumbnails to be misdrawn [Christoph Fergeau]
- Avoid segfaults in gdk-pixbuf-csource [Matthias Clasen]
* Win32 bug fixes [Tim Evans, Tor Lillqvist]
* Other bug fixes [Gustavo, Torsten Schoenfeld, Manish, Tomislav Jonjic,
Soeren Sandmann, Tommi Komulainen, Philip Langdale, Jon-Kare Hellan]
* Documentation improvements [Matthias]
* Updated translations (bs,da,fi,sq)
Overview of Changes from GTK+ 2.4.6 to GTK+ 2.4.7
=================================================
* GtkFileChooser
- Fix for Open button not actually opening [Tommi Komulainen]
- Fix crash when g_get_home_dir() returns NULL [Tor Lillqvist]
Overview of Changes from GTK+ 2.4.4 to GTK+ 2.4.6
=================================================
* GtkFileChooser
- Set busy cursor while mounting [Federico Mena Quintero]
- Set accessible name [Padraig O'Briain]
- Improve activation on focus [Federico]
- Accept paths in entry [Federico]
* GtkTreeView
- Draw focus indicator for empty tree views [Federico]
- Make column dragging more robust [Matthias Clasen,
Christian Biere]
- Prevent DND on non-sources [Pawel Salek]
* GtkUIManager
- Accept paths with a leading / [David Malcolm]
* Gdk
- Fix handling of keep-above and keep-below
state [Matthew Garret]
- Add some missing error traps [Thomas Leonard]
* gdk-pixbuf
- Make incremental loading work for 8bit pcx
files [Magnus Bergman]
- Handle edge pixels consistently [Brian Cameron,
Matthias]
- Handle OS/2 BMPs [Jon-Kare Hellan]
* Bug fixes for Copy-Paste behaviour in text widgets
[Mikael Hallendal, Scott Bronson]
* Memory leak fixes in multiple widgets [Kjartan Maraas,
Tommi Komulainen, Crispin Flowerday, Matthias]
* Win32 fixes [Robert Ögren, Tor Lillqvist, Hans Breuer
* Other bug fixes [John Cupitt, Elke Meier, Matthias,
Peter Zelezny, Guilherme Salgado, John Finlay, Tommi,
Padaig, Olivier Sessink, Nicolas Deves, Lorenzo Gil
Sanchez, Christian Persch, Morten Welinder, Markku Vire,
Markus Lausser, Abel Daniel]
* Documentation improvements [Owen Taylor, Matthias, Axel
Simon, David, Federico, Mariano Suarez-Alvarez]
* Updated translations (ang,az,bg,br,ca,cs,en_CA,es,fi,fr,hi,hu,
it,ja,ko,mn,nb,nl,no,pl,pt,pt_BR,ru,sq,sr,sr@Latn,sr@ije,sv,uz,
wa,zh_CN)
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 -1
View File
@@ -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.9. 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
View File
@@ -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], [9])
m4_define([gtk_version],
[gtk_major_version.gtk_minor_version.gtk_micro_version])
m4_define([gtk_interface_age], [1])
m4_define([gtk_interface_age], [9])
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 bs 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 nb 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*)
+16
View File
@@ -1,3 +1,19 @@
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.9 ===
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.8 ===
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* === Released 2.4.7 ===
Tue Jul 20 23:27:12 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-xlibrgb.c: Include config.h first. (#148034)
Tue Mar 9 09:33:54 2004 Owen Taylor <otaylor@redhat.com>
* === Released 2.3.6 ===
+2 -2
View File
@@ -47,8 +47,6 @@
* Shawn T. Amundson <amundson@gtk.org>
*/
#include <math.h>
#if HAVE_CONFIG_H
# include <config.h>
# if STDC_HEADERS
@@ -61,6 +59,8 @@
# include <stdlib.h>
#endif
#include <math.h>
#define ENABLE_GRAYSCALE
/* include this before so that we can get endian definitions if
+1 -1
View File
@@ -132,7 +132,7 @@ static guint n_color_entries = G_N_ELEMENTS (color_entries);
enum {
SHAPE_SQUARE,
SHAPE_RECTANGLE,
SHAPE_OVAL,
SHAPE_OVAL
};
static GtkRadioActionEntry shape_entries[] = {
+1 -1
View File
@@ -89,7 +89,7 @@ static guint n_color_entries = G_N_ELEMENTS (color_entries);
enum {
SHAPE_SQUARE,
SHAPE_RECTANGLE,
SHAPE_OVAL,
SHAPE_OVAL
};
static GtkRadioActionEntry shape_entries[] = {
-392
View File
@@ -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
View File
@@ -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.
+1 -1
View File
@@ -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>
+107
View File
@@ -1,3 +1,110 @@
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.9 ===
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.8 ===
2004-08-24 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf/gdk-pixbuf-csource.xml: Document bugs of
the runlength encoder.
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* === Released 2.4.7 ===
2004-08-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.6 ===
Thu Aug 12 00:06:20 2004 Matthias Clasen <maclas@gmx.de>
* gtk/tmpl/gtkuimanager.sgml: Add some information about
allowed values for the name and action attributes.
2004-08-07 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkrc.sgml: Fix a typo. (#149470, Mariano
Suarez-Alvarez)
2004-07-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk-sections.txt: Add gtk_parse_args.
2004-07-12 Federico Mena Quintero <federico@ximian.com>
Merged from HEAD:
* gtk/glossary.xml: Start of the GTK+ glossary.
* gtk/Makefile.am (content_files): Added glossary.xml.
* gtk/gtk-docs.sgml: Likewise.
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.
+7 -2
View File
@@ -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

@@ -154,7 +154,9 @@ Gtk+ distribution, available from <ulink url="http://www.gtk.org">www.gtk.org</u
<refsect1><title>Bugs</title>
<para>
None known yet.
The runlength encoder gets out of sync with the pixel boundaries, since
it includes the rowstride padding in the encoded stream. Furthermore, it
generates pixbufs with suboptimal rowstride in some cases.
</para>
</refsect1>
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+1 -1
View File
@@ -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>
+1
View File
@@ -93,6 +93,7 @@ content_files = \
changes-2.0.sgml \
compiling.sgml \
framebuffer.sgml \
glossary.xml \
migrating-checklist.sgml \
migrating-GtkAction.sgml \
migrating-GtkComboBox.sgml \
+1 -1
View File
@@ -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
+307
View File
@@ -0,0 +1,307 @@
<glossary id="glossary">
<title>Glossary</title>
<glossentry id="allocation">
<glossterm>allocation</glossterm>
<glossdef>
<para>
The final size of a <glossterm
linkend="widget">widget</glossterm> within its <glossterm
linkend="parent">parent</glossterm>. For example, a widget
may request a minimum size of 20&times;20 pixels, but its
parent may decide to allocate 50&times;20 pixels for it
instead.
</para>
<glossseealso>
<glossterm linkend="requisition">requisition</glossterm>
</glossseealso>
</glossdef>
</glossentry>
<glossentry id="bin">
<glossterm>bin</glossterm>
<glossdef>
<para>
A <glossterm linkend="container">container</glossterm> that
can hold at most one child widget. The base class for bins is
<link linkend="GtkBin">GtkBin</link>.
</para>
<glossseealso>
<glossterm linkend="container">container</glossterm>
</glossseealso>
</glossdef>
</glossentry>
<glossentry id="child">
<glossterm>child</glossterm>
<glossdef>
<para>
A <glossterm linkend="container">container's</glossterm> child
is a <glossterm linkend="widget">widget</glossterm> contained
inside it.
</para>
</glossdef>
</glossentry>
<glossentry id="column">
<glossterm>column</glossterm>
<glossdef>
<para>
FIXME
</para>
<glossseealso>model column</glossseealso>
<glossseealso>view column</glossseealso>
</glossdef>
</glossentry>
<glossentry id="container">
<glossterm>container</glossterm>
<glossdef>
<para>
A <glossterm linkend="widget">widget</glossterm> that contains
other widgets; in that case, the container is the
<emphasis>parent</emphasis> of the <emphasis>child</emphasis>
widgets. Some containers don't draw anything on their own,
but rather just organize their children's <glossterm
linkend="geometry">geometry</glossterm>; for example, <link
linkend="GtkVBox">GtkVBox</link> lays out its children
vertically without painting anything on its own. Other
containers include decorative elements; for example, <link
linkend="GtkFrame">GtkFrame</link> contains the frame's child
and a label in addition to the shaded frame it draws. The
base class for containers is <link
linkend="GtkContainer">GtkContainer</link>.
</para>
<glossseealso>
<glossterm linkend="container">widget</glossterm>
<glossterm linkend="container">geometry</glossterm>
</glossseealso>
</glossdef>
</glossentry>
<glossentry id="display">
<glossterm>display</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="event">
<glossterm>event</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="geometry">
<glossterm>geometry</glossterm>
<glossdef>
<para>
A <glossterm linkend="widget">widget's</glossterm> position
and size. Within its parent, this is called the widget's
<glossterm linkend="allocation">allocation</glossterm>.
</para>
</glossdef>
</glossentry>
<glossentry id="mapping">
<glossterm>mapping</glossterm>
<glossdef>
<para>
This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it
actually shows the GdkWindows it created when it was
<glossterm linkend="realization">realized</glossterm>. When a
widget is mapped, it must turn on its
<constant>GTK_MAPPED</constant> <link
linkend="GtkWidgetFlags">flag</link>.
</para>
<para>
Note that due to the asynchronous nature of the X window
system, a widget's window may not appear on the screen
immediatly after one calls <link
linkend="gdk-window-show"><function>gdk_window_show()</function></link>:
you must wait for the corresponding map <glossterm
linkend="event">event</glossterm> to be received. You can do
this with the <link
linkend="GtkWidget-map-event"><methodname>GtkWidget::map-event</methodname>
signal</link>.
</para>
</glossdef>
</glossentry>
<glossentry id="model-column">
<glossterm>model column</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="no-window">
<glossterm>no-window widget</glossterm>
<glossdef>
<para>
A widget that does not have a GdkWindow of its own on which to
draw its contents, but rather shares its <glossterm
linkend="parent">parent's</glossterm>. Such a widget has the
<constant>GTK_NO_WINDOW</constant> <link
linkend="GtkWidgetFlags">flag</link> set, and can be tested
with the <link
linkend="gtk-widget-no-window-caps"><function>GTK_WIDGET_NO_WINDOW()</function></link>
macro.
</para>
</glossdef>
</glossentry>
<glossentry id="parent">
<glossterm>parent</glossterm>
<glossdef>
<para>
A <glossterm linkend="widget">widget's</glossterm> parent is
the <glossterm linkend="container">container</glossterm>
inside which it resides.
</para>
</glossdef>
</glossentry>
<glossentry id="realization">
<glossterm>realization</glossterm>
<glossdef>
<para>
This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it
creates its own GdkWindow, or otherwise associates itself with
its <glossterm linkend="parent">parent's</glossterm>
GdkWindow. If the widget has its own window, then it must
also attach a <glossterm linkend="style">style</glossterm> to
it. A widget becomes unrealized by destroying its associated
GdkWindow. When a widget is realized, it must turn on its
<constant>GTK_REALIZED</constant> <link
linkend="GtkWidgetFlags">flag</link>.
</para>
<para>
Widgets that don't own the GdkWindow on which they draw are
called <glossterm linkend="no-window">no-window
widgets</glossterm>. This can be tested with the <link
linkend="gtk-widget-no-window-caps"><function>GTK_WIDGET_NO_WINDOW()</function></link>
macro. Normally, these widgets draw on their parent's
GdkWindow.
</para>
<para>
Note that when a widget creates a window in its <link
linkend="gtkwidget-realize"><methodname>::realize()</methodname></link>
handler, it does not actually show the window. That is, the
window's structure is just created in memory. The widget
actually shows the window when it gets <glossterm
linkend="mapping">mapped</glossterm>.
</para>
</glossdef>
</glossentry>
<glossentry id="requisition">
<glossterm>requisition</glossterm>
<glossdef>
<para>
The size requisition of a <glossterm
linkend="widget">widget</glossterm> is the minimum amount of
space it requests from its <glossterm
linkend="parent">parent</glossterm>. Once the parent computes
the widget's final size, it gives it its <glossterm
linkend="allocation">size allocation</glossterm>.
</para>
<glossseealso>
<glossterm linkend="allocation">allocation</glossterm>
</glossseealso>
</glossdef>
</glossentry>
<glossentry id="screen">
<glossterm>screen</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="style">
<glossterm>style</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="toplevel">
<glossterm>toplevel</glossterm>
<glossdef>
<para>
A <glossterm linkend="widget">widget</glossterm> that does not
require a <glossterm linkend="parent">parent</glossterm>
container. The only toplevel widget in GTK+ is <link
linkend="GtkWindow">GtkWindow</link>.
</para>
<glossseealso>
<glossterm linkend="container">container</glossterm>
</glossseealso>
</glossdef>
</glossentry>
<glossentry id="unmap">
<glossterm>unmap</glossterm>
<glosssee><glossterm linkend="mapping">mapping</glossterm></glosssee>
</glossentry>
<glossentry id="unrealize">
<glossterm>unrealize</glossterm>
<glosssee><glossterm linkend="realization">realization</glossterm></glosssee>
</glossentry>
<glossentry id="view-column">
<glossterm>view column</glossterm>
<glossdef>
<para>
FIXME
</para>
</glossdef>
</glossentry>
<glossentry id="widget">
<glossterm>widget</glossterm>
<glossdef>
<para>
A control in a graphical user interface. Widgets can draw
themselves and process events from the mouse and keyboard.
Widget types include buttons, menus, text entry lines, and
lists. Widgets can be arranged into <glossterm
linkend="container">containers</glossterm>, and these take
care of assigning the <glossterm
linkend="geometry">geometry</glossterm> of the widgets: every
widget thus has a parent except those widgets which are
<glossterm linkend="toplevel">toplevels</glossterm>. The base
class for widgets is <link
linkend="GtkWidget">GtkWidget</link>.
</para>
<glossseealso>
<glossterm linkend="container">container</glossterm>
</glossseealso>
</glossdef>
</glossentry>
</glossary>
<!--
Local variables:
mode: sgml
sgml-parent-document: ("gtk-docs.sgml" "book" "glossary")
End:
-->
+3
View File
@@ -185,6 +185,7 @@
<!ENTITY gtk-migrating-GtkComboBox SYSTEM "migrating-GtkComboBox.sgml">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY gtk-query-immodules SYSTEM "gtk-query-immodules-2.0.xml">
<!ENTITY gtk-glossary SYSTEM "glossary.xml">
]>
<book id="index">
<bookinfo>
@@ -557,6 +558,8 @@ that is, GUI components such as <link linkend="GtkButton">GtkButton</link> or
&gtk-query-immodules;
</part>
&gtk-glossary;
<index/>
</book>
+1
View File
@@ -4496,6 +4496,7 @@ gtk_window_group_get_type
gtk_set_locale
gtk_disable_setlocale
gtk_get_default_language
gtk_parse_args
gtk_init
gtk_init_check
gtk_exit
+360
View File
@@ -1,3 +1,34 @@
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Long_Description ##### -->
<para>
The #GtkAboutDialog offers a simple way to display information about
a program like its logo, name, copyright, website and license. It is
also possible to give credits to the authors, documenters, translators
and artists who have worked on the program. An about dialog is typically
opened when the user selects the <literal>About</literal> option from
the <literal>Help</literal> menu. All parts of the dialog are optional.
</para>
<para>
About dialog often contain links and email addresses. #GtkAboutDialog
supports this by offering global hooks, which are called when the user
clicks on a link or email address, see gtk_about_dialog_set_email_hook()
and gtk_about_dialog_set_url_hook().
</para>
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:See_Also ##### -->
<para>
#GTK_STOCK_ABOUT
</para>
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Short_Description ##### -->
a widget displaying information about a program
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Title ##### -->
GtkAboutDialog
<!-- ##### SECTION ./tmpl/gtkarg.sgml:Long_Description ##### -->
<para>
All the functions in here are marked a Non-public.
@@ -101,6 +132,26 @@ Debugging
gtkenums.sgml
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Short_Description ##### -->
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Title ##### -->
GtkFileChooserButton
<!-- ##### SECTION ./tmpl/gtkmarshal.sgml:Long_Description ##### -->
<refsect2>
<title>What are Signal Marshallers?</title>
@@ -513,6 +564,24 @@ Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN
@b:
@Returns:
<!-- ##### STRUCT GtkAboutDialog ##### -->
<para>
The <structname>GtkAboutDialog</structname> struct contains
only private fields and should not be directly accessed.
</para>
@parent_instance:
<!-- ##### USER_FUNCTION GtkAboutDialogActivateLinkFunc ##### -->
<para>
The type of a function which is called when a URL or email
link is activated.
</para>
@about: the #GtkAboutDialog in which the link was activated
@link: the URL or email address to whiche the activated link points
@data:
<!-- ##### STRUCT GtkAccelEntry ##### -->
<para>
This is a private struct used by GTK+ internally, don't worry about it.
@@ -845,6 +914,12 @@ You may not attach these to signals created with the
</para>
<!-- ##### STRUCT GtkFileChooserButton ##### -->
<para>
</para>
<!-- ##### ENUM GtkFontFilterType ##### -->
<para>
A set of bit flags used to specify the filter being set
@@ -1460,6 +1535,225 @@ If the window shrinks automatically when widgets within it shrink.
</para>
<!-- ##### FUNCTION gtk_about_dialog_get_artists ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_authors ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_comments ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_copyright ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_documenters ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_license ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_logo ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_name ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_translator_credits ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_version ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_website ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_website_label ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_new ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_artists ##### -->
<para>
</para>
@about:
@artists:
<!-- ##### FUNCTION gtk_about_dialog_set_authors ##### -->
<para>
</para>
@about:
@authors:
<!-- ##### FUNCTION gtk_about_dialog_set_comments ##### -->
<para>
</para>
@about:
@comments:
<!-- ##### FUNCTION gtk_about_dialog_set_copyright ##### -->
<para>
</para>
@about:
@copyright:
<!-- ##### FUNCTION gtk_about_dialog_set_documenters ##### -->
<para>
</para>
@about:
@documenters:
<!-- ##### FUNCTION gtk_about_dialog_set_email_hook ##### -->
<para>
</para>
@func:
@data:
@destroy:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_license ##### -->
<para>
</para>
@about:
@license:
<!-- ##### FUNCTION gtk_about_dialog_set_logo ##### -->
<para>
</para>
@about:
@logo:
<!-- ##### FUNCTION gtk_about_dialog_set_name ##### -->
<para>
</para>
@about:
@name:
<!-- ##### FUNCTION gtk_about_dialog_set_translator_credits ##### -->
<para>
</para>
@about:
@translator_credits:
<!-- ##### FUNCTION gtk_about_dialog_set_url_hook ##### -->
<para>
</para>
@func:
@data:
@destroy:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_version ##### -->
<para>
</para>
@about:
@version:
<!-- ##### FUNCTION gtk_about_dialog_set_website ##### -->
<para>
</para>
@about:
@website:
<!-- ##### FUNCTION gtk_about_dialog_set_website_label ##### -->
<para>
</para>
@about:
@website_label:
<!-- ##### FUNCTION gtk_accel_group_add ##### -->
<para>
@@ -2100,6 +2394,63 @@ Claim or disclaim ownership of the PRIMARY X selection.
@claim: if %TRUE, claim the selection, otherwise, disclaim it.
@time: the timestamp for claiming the selection.
<!-- ##### FUNCTION gtk_file_chooser_button_get_active ##### -->
<para>
</para>
@button:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_button_get_title ##### -->
<para>
</para>
@button:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_button_new ##### -->
<para>
</para>
@title:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_backend ##### -->
<para>
</para>
@title:
@backend:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_dialog ##### -->
<para>
</para>
@dialog:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_button_set_active ##### -->
<para>
</para>
@button:
@is_active:
<!-- ##### FUNCTION gtk_file_chooser_button_set_title ##### -->
<para>
</para>
@button:
@title:
<!-- ##### FUNCTION gtk_file_chooser_get_folder_mode ##### -->
<para>
@@ -2761,6 +3112,15 @@ Internal function.
@Returns:
<!-- ##### FUNCTION gtk_show_about_dialog ##### -->
<para>
</para>
@parent:
@first_property_name:
@Varargs:
<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
<para>
Add an emission hook for a type of signal, for any object.
+2
View File
@@ -118,6 +118,8 @@ a widget used to choose from a list of items.
</para>
@combo_box:
@index_:
<!-- # Unused Parameters # -->
@index:
+2 -2
View File
@@ -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:
+3 -2
View File
@@ -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 */
&amp;error);
if (!pixbuf)
{
g_warning ("Couldn't load icon: &percnt;s", error->message);
+10
View File
@@ -104,6 +104,16 @@ functions such as g_signal_connect().
@Returns:
<!-- ##### FUNCTION gtk_parse_args ##### -->
<para>
</para>
@argc:
@argv:
@Returns:
<!-- ##### FUNCTION gtk_init ##### -->
<para>
</para>
+1 -1
View File
@@ -73,7 +73,7 @@ outermost to innermost. The difference is that in
the widget path, the name assigned by
gtk_widget_set_name() is used
if present, otherwise the class name of the widget, while
for the widget path, the class name is always used.
for the class path, the class name is always used.
</para>
<para>
So, if you have a #GtkEntry named
+2 -2
View File
@@ -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>
+1 -1
View File
@@ -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.
+2
View File
@@ -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.
+10 -3
View File
@@ -1,4 +1,5 @@
<!-- ##### SECTION Title ##### -->
GtkUIManager
<!-- ##### SECTION Short_Description ##### -->
@@ -51,9 +52,15 @@ There are some additional restrictions beyond those specified in the
DTD, e.g. every toolitem must have a toolbar in its anchestry and
every menuitem must have a menubar or popup in its anchestry. Since
a #GMarkup parser is used to parse the UI description, it must not only
be valid XML, but valid #GMarkup. If a name is not specified, it defaults
to the action. If an action is not specified either, the element name is
used.
be valid XML, but valid #GMarkup.
</para>
<para>
If a name is not specified, it defaults to the action. If an action is
not specified either, the element name is used. The name and action
attributes must not contain '/' characters after parsing (since that
would mess up path lookup) and must be usable as XML attributes when
enclosed in doublequotes, thus they must not '"' characters or references
to the &amp;quot; entity.
</para>
<example>
<title>A UI definition</title>
+5
View File
@@ -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
+121
View File
@@ -1,3 +1,124 @@
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.9 ===
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.8 ===
2004-08-24 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
the correct index, and compare correctly, reported by Tommi Komulainen.
* gdk-pixdata.c (gdk_pixdata_from_pixbuf): Work around bugs in
the runlength encoder by forcing rowstride * height to be
divisible by bpp. (#150882)
Mon Aug 23 00:51:20 2004 Matthias Clasen <maclas@gmx.de>
* pixops/pixops.c (pixops_scale_nearest): Make it
compile. (#150761, Jon-Kare Hellan)
Sun Aug 22 03:24:38 2004 Matthias Clasen <maclas@gmx.de>
* pixops/pixops.c (pixops_scale_nearest): Fix a mixup in
the handling of dest_channels. (#111922, Christophe Fergeau)
Fri Aug 20 11:59:10 2004 Owen Taylor <otaylor@redhat.com>
* io-bmp.c: Fix infinite loop that can occur for bad
image data (#150601, Chris Evans, Manish Singh)
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* === Released 2.4.7 ===
2004-08-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.4.6 ===
Thu Aug 12 22:19:12 2004 Matthias Clasen <maclas@gmx.de>
* io-bmp.c (DecodeHeader): Properly determine the number of
colors in an OS/2 BMP file. (#150003, Jon-Kare Hellan)
2004-08-12 Matthias Clasen <mclasen@redhat.com>
* pixops/pixops.c: Remove C99-isms. (#149967, Vincent Noel)
2004-08-11 Matthias Clasen <mclasen@redhat.com>
* pixops/pixops.c: Make scaling and compositing functions handle
edge pixels consistently. (#111922, Brian Cameron)
Sun Aug 1 23:57:06 2004 Matthias Clasen <maclas@gmx.de>
* io-pcx.c (pcx_increment_load_data_1): Fix progressive
loading of 8bit pcx files. (#148518, Magnus Bergman)
Tue Jul 20 22:23:26 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-io.h: Remove trailing commas from
enumerations. (#148035)
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 ===
+18 -4
View File
@@ -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);
+29 -2
View File
@@ -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
View File
@@ -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;
}
+1 -1
View File
@@ -123,7 +123,7 @@ gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
typedef enum /*< skip >*/
{
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0,
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0
} GdkPixbufFormatFlags;
struct _GdkPixbufFormat {
+2 -2
View File
@@ -599,11 +599,11 @@ gdk_pixbuf_loader_new_with_mime_type (const char *mime_type,
mimes = info->mime_types;
for (j = 0; mimes[j] != NULL; j++)
if (g_ascii_strcasecmp (mimes[i], mime_type)) {
if (g_ascii_strcasecmp (mimes[j], mime_type) == 0) {
image_type = info->name;
break;
}
}
}
g_slist_free (formats);
+36 -25
View File
@@ -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);
}
/**
+5 -4
View File
@@ -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
+28 -1
View File
@@ -289,6 +289,13 @@ rl_encode_rgbx (guint8 *bp, /* dest buffer */
return bp;
}
/* Used as the destroy notification function for gdk_pixbuf_new() */
static void
free_buffer (guchar *pixels, gpointer data)
{
g_free (pixels);
}
/**
* gdk_pixdata_from_pixbuf:
* @pixdata: a #GdkPixdata to fill.
@@ -327,16 +334,36 @@ gdk_pixdata_from_pixbuf (GdkPixdata *pixdata,
{
guint pad, n_bytes = rowstride * height;
guint8 *img_buffer_end, *data;
GdkPixbuf *buf = NULL;
if (n_bytes % bpp != 0)
{
rowstride = pixbuf->width * bpp;
n_bytes = rowstride * height;
data = g_malloc (n_bytes);
buf = gdk_pixbuf_new_from_data (data,
GDK_COLORSPACE_RGB,
pixbuf->has_alpha, 8,
pixbuf->width,
pixbuf->height,
rowstride,
free_buffer, NULL);
gdk_pixbuf_copy_area (pixbuf, 0, 0, pixbuf->width, pixbuf->height,
buf, 0, 0);
}
else
buf = (GdkPixbuf *)pixbuf;
pad = rowstride;
pad = MAX (pad, 130 + n_bytes / 127);
data = g_new (guint8, pad + n_bytes);
free_me = data;
img_buffer = data;
img_buffer_end = rl_encode_rgbx (img_buffer,
pixbuf->pixels, pixbuf->pixels + n_bytes,
buf->pixels, buf->pixels + n_bytes,
bpp);
length = img_buffer_end - img_buffer;
if (buf != pixbuf)
g_object_unref (buf);
}
else
{
+16 -2
View File
@@ -269,7 +269,11 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
return FALSE;
}
clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
if (State->Header.size == 12)
clrUsed = 1 << State->Header.depth;
else
clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
if (clrUsed != 0)
State->Header.n_colors = clrUsed;
else
@@ -872,8 +876,18 @@ DoCompressed(struct bmp_progressive_state *context, GError **error)
guchar c;
gint idx;
if (context->compr.y >= context->Header.height)
/* context->compr.y might be past the last line because we are
* on padding past the end of a valid data, or we might have hit
* out-of-bounds data. Either way we just eat-and-ignore the
* rest of the file. Doing the check only here and not when
* we change y below is fine since BufferSize is always 2 here
* and the BMP file format always starts new data on 16-bit
* boundaries.
*/
if (context->compr.y >= context->Header.height) {
context->BufferDone = 0;
return TRUE;
}
y = context->compr.y;
+1 -1
View File
@@ -353,7 +353,7 @@ pcx_increment_load_data_1(struct pcx_context *context)
}
if(context->updated_func)
context->updated_func(context->pixbuf, 0, context->current_line, context->width, 1, context->user_data);
context->updated_func(context->pixbuf, 0, 0, context->width, context->height, context->user_data);
context->current_line++;
+1 -1
View File
@@ -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
View File
@@ -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)
+142 -129
View File
@@ -71,36 +71,49 @@ pixops_scale_nearest (guchar *dest_buf,
double scale_x,
double scale_y)
{
int i, j;
int i;
int x;
int x_step = (1 << SCALE_SHIFT) / scale_x;
int y_step = (1 << SCALE_SHIFT) / scale_y;
int xmax, xstart, xstop, x_pos, y_pos;
const guchar *p;
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS) \
for (j=0; j < (render_x1 - render_x0); j++) \
{ \
const guchar *p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
\
dest[0] = p[0]; \
dest[1] = p[1]; \
dest[2] = p[2]; \
\
if (DEST_CHANNELS == 4) \
{ \
if (SRC_CHANNELS == 4) \
dest[3] = p[3]; \
else \
dest[3] = 0xff; \
} \
\
dest += DEST_CHANNELS; \
x += x_step; \
}
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS,ASSIGN_PIXEL) \
xmax = x + (render_x1 - render_x0) * x_step; \
xstart = MIN (0, xmax); \
xstop = MIN (src_width << SCALE_SHIFT, xmax); \
p = src + (CLAMP (x, xstart, xstop) >> SCALE_SHIFT) * SRC_CHANNELS; \
while (x < xstart) \
{ \
ASSIGN_PIXEL; \
dest += DEST_CHANNELS; \
x += x_step; \
} \
while (x < xstop) \
{ \
p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
ASSIGN_PIXEL; \
dest += DEST_CHANNELS; \
x += x_step; \
} \
x_pos = x >> SCALE_SHIFT; \
p = src + CLAMP (x_pos, 0, src_width - 1) * SRC_CHANNELS; \
while (x < xmax) \
{ \
ASSIGN_PIXEL; \
dest += DEST_CHANNELS; \
x += x_step; \
}
for (i = 0; i < (render_y1 - render_y0); i++)
{
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
guchar *dest = dest_buf + i * dest_rowstride;
const guchar *src;
guchar *dest;
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
y_pos = CLAMP (y_pos, 0, src_height - 1);
src = src_buf + y_pos * src_rowstride;
dest = dest_buf + i * dest_rowstride;
x = render_x0 * x_step + x_step / 2;
@@ -108,36 +121,26 @@ pixops_scale_nearest (guchar *dest_buf,
{
if (dest_channels == 3)
{
INNER_LOOP (3, 3);
INNER_LOOP (3, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
}
else
{
INNER_LOOP (3, 4);
INNER_LOOP (3, 4, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2];dest[3]=0xff);
}
}
else if (src_channels == 4)
{
if (dest_channels == 3)
{
INNER_LOOP (4, 3);
INNER_LOOP (4, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
}
else
{
for (j=0; j < (render_x1 - render_x0); j++)
{
const guchar *p = src + (x >> SCALE_SHIFT) * 4;
guint32 *p32;
p32 = (guint32 *) dest;
*p32 = *((guint32 *) p);
dest += 4;
x += x_step;
}
guint32 *p32;
INNER_LOOP(4, 4, p32=(guint32*)dest;*p32=*((guint32*)p));
}
}
}
#undef INNER_LOOP
}
static void
@@ -159,23 +162,27 @@ pixops_composite_nearest (guchar *dest_buf,
double scale_y,
int overall_alpha)
{
int i, j;
int i;
int x;
int x_step = (1 << SCALE_SHIFT) / scale_x;
int y_step = (1 << SCALE_SHIFT) / scale_y;
int xmax, xstart, xstop, x_pos, y_pos;
const guchar *p;
unsigned int a0;
for (i = 0; i < (render_y1 - render_y0); i++)
{
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
guchar *dest = dest_buf + i * dest_rowstride;
const guchar *src;
guchar *dest;
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
y_pos = CLAMP (y_pos, 0, src_height - 1);
src = src_buf + y_pos * src_rowstride;
dest = dest_buf + i * dest_rowstride;
x = render_x0 * x_step + x_step / 2;
for (j=0; j < (render_x1 - render_x0); j++)
{
const guchar *p = src + (x >> SCALE_SHIFT) * src_channels;
unsigned int a0;
INNER_LOOP(src_channels, dest_channels,
if (src_has_alpha)
a0 = (p[3] * overall_alpha) / 0xff;
else
@@ -218,9 +225,7 @@ pixops_composite_nearest (guchar *dest_buf,
}
break;
}
dest += dest_channels;
x += x_step;
}
);
}
}
@@ -254,14 +259,23 @@ pixops_composite_color_nearest (guchar *dest_buf,
int y_step = (1 << SCALE_SHIFT) / scale_y;
int r1, g1, b1, r2, g2, b2;
int check_shift = get_check_shift (check_size);
int xmax, xstart, xstop, x_pos, y_pos;
const guchar *p;
unsigned int a0;
for (i = 0; i < (render_y1 - render_y0); i++)
{
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step/2) >> SCALE_SHIFT) * src_rowstride;
guchar *dest = dest_buf + i * dest_rowstride;
const guchar *src;
guchar *dest;
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
y_pos = CLAMP (y_pos, 0, src_height - 1);
src = src_buf + y_pos * src_rowstride;
dest = dest_buf + i * dest_rowstride;
x = render_x0 * x_step + x_step / 2;
if (((i + check_y) >> check_shift) & 1)
{
r1 = (color2 & 0xff0000) >> 16;
@@ -283,12 +297,8 @@ pixops_composite_color_nearest (guchar *dest_buf,
b2 = color2 & 0xff;
}
for (j=0 ; j < (render_x1 - render_x0); j++)
{
const guchar *p = src + (x >> SCALE_SHIFT) * src_channels;
int a0;
int tmp;
j = 0;
INNER_LOOP(src_channels, dest_channels,
if (src_has_alpha)
a0 = (p[3] * overall_alpha + 0xff) >> 8;
else
@@ -316,6 +326,8 @@ pixops_composite_color_nearest (guchar *dest_buf,
dest[2] = p[2];
break;
default:
{
unsigned int tmp;
if (((j + check_x) >> check_shift) & 1)
{
tmp = ((int) p[0] - r2) * a0;
@@ -334,17 +346,18 @@ pixops_composite_color_nearest (guchar *dest_buf,
tmp = ((int) p[2] - b1) * a0;
dest[2] = b1 + ((tmp + (tmp >> 8) + 0x80) >> 8);
}
}
break;
}
if (dest_channels == 4)
dest[3] = 0xff;
dest += dest_channels;
x += x_step;
}
j++;
);
}
}
#undef INNER_LOOP
static void
composite_pixel (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
@@ -1312,7 +1325,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
dim->n = n;
dim->weights = pixel_weights;
for (offset =0 ; offset < SUBSAMPLE; offset++)
for (offset = 0; offset < SUBSAMPLE; offset++)
{
double x = (double)offset / SUBSAMPLE;
double a = x + 1 / scale;
@@ -1320,7 +1333,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 +1370,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 +1409,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 +1448,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 +1472,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 +1506,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 +1549,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
View File
@@ -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,
+12 -12
View File
@@ -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
View File
@@ -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)
+1 -1
View File
@@ -216,7 +216,7 @@ allocate_scratch_images (GdkScratchImageInfo *info,
gint j;
for (j = 0; j < i; j++)
g_object_unref (info->static_image[i]);
g_object_unref (info->static_image[j]);
return FALSE;
}
+3 -1
View File
@@ -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
+2 -1
View File
@@ -38,7 +38,8 @@
#include "gdkregion-generic.h"
#include <linux/fb.h>
#include <stdio.h>
#include <freetype/freetype.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#define GDK_TYPE_DRAWABLE_IMPL_FBDATA (gdk_drawable_impl_fb_get_type ())
#define GDK_DRAWABLE_IMPL_FBDATA(win) ((GdkDrawableFBData *)((GdkWindowObject *)(win))->impl)
+2 -2
View File
@@ -1440,8 +1440,8 @@ gdk_window_set_transient_for (GdkWindow *window,
}
void
gdk_window_set_background (const GdkWindow *window,
const GdkColor *color)
gdk_window_set_background (GdkWindow *window,
const GdkColor *color)
{
GdkWindowObject *private = (GdkWindowObject *)window;
+19 -29
View File
@@ -80,33 +80,20 @@ enum_monitor (HMONITOR hmonitor,
#define MONITORINFOF_PRIMARY 1
#endif
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY)
monitor->x = monitor_info.rcMonitor.left;
monitor->y = monitor_info.rcMonitor.top;
monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY &&
*index != 0)
{
/* For the primary monitor, use SPI_GETWORKAREA */
RECT rect;
SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
monitor->x = rect.left;
monitor->y = rect.top;
monitor->width = rect.right - rect.left;
monitor->height = rect.bottom - rect.top;
/* Put primary monitor at index 0, just in case somebody needs
* to know which one is the primary.
*/
if (*index != 0)
{
GdkRectangle temp = *monitor;
*monitor = _gdk_monitors[0];
_gdk_monitors[0] = temp;
}
}
else
{
monitor->x = monitor_info.rcMonitor.left;
monitor->y = monitor_info.rcMonitor.top;
monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
GdkRectangle temp = *monitor;
*monitor = _gdk_monitors[0];
_gdk_monitors[0] = temp;
}
(*index)++;
@@ -172,15 +159,18 @@ gdk_display_open (const gchar *display_name)
else
#endif /* HAVE_MONITOR_INFO */
{
RECT rect;
unsigned int width, height;
_gdk_num_monitors = 1;
_gdk_monitors = g_new (GdkRectangle, 1);
SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
_gdk_monitors[0].x = rect.left;
_gdk_monitors[0].y = rect.top;
_gdk_monitors[0].width = rect.right - rect.left;
_gdk_monitors[0].height = rect.bottom - rect.top;
width = GetSystemMetrics (SM_CXSCREEN);
height = GetSystemMetrics (SM_CYSCREEN);
_gdk_monitors[0].x = 0;
_gdk_monitors[0].y = 0;
_gdk_monitors[0].width = width;
_gdk_monitors[0].height = height;
_gdk_offset_x = 0;
_gdk_offset_y = 0;
}
+12 -7
View File
@@ -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;
+3 -7
View File
@@ -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);
}
+61 -58
View File
@@ -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 */
@@ -1691,8 +1723,12 @@ handle_configure_event (MSG *msg,
point.x = client_rect.left; /* always 0 */
point.y = client_rect.top;
/* top level windows need screen coords */
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
ClientToScreen (msg->hwnd, &point);
if (gdk_window_get_parent (window) == _gdk_parent_root)
{
ClientToScreen (msg->hwnd, &point);
point.x += _gdk_offset_x;
point.y += _gdk_offset_y;
}
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left;
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top;
@@ -1712,12 +1748,6 @@ handle_configure_event (MSG *msg,
event->configure.x = point.x;
event->configure.y = point.y;
if (gdk_window_get_parent (window) == _gdk_parent_root)
{
event->configure.x += _gdk_offset_x;
event->configure.y += _gdk_offset_y;
}
append_event (gdk_drawable_get_display (window), event);
}
}
@@ -2168,16 +2198,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 +2342,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 +2424,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 +2502,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 +2584,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 +2658,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 +2758,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))
@@ -2988,15 +2992,19 @@ gdk_event_translate (GdkDisplay *display,
point.x = client_rect.left; /* always 0 */
point.y = client_rect.top;
/* top level windows need screen coords */
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
ClientToScreen (msg->hwnd, &point);
if (gdk_window_get_parent (window) == _gdk_parent_root)
{
ClientToScreen (msg->hwnd, &point);
point.x += _gdk_offset_x;
point.y += _gdk_offset_y;
}
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left;
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top;
((GdkWindowObject *) window)->x = point.x;
((GdkWindowObject *) window)->y = point.y;
if (((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK)
{
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
@@ -3009,12 +3017,6 @@ gdk_event_translate (GdkDisplay *display,
event->configure.x = point.x;
event->configure.y = point.y;
if (gdk_window_get_parent (window) == _gdk_parent_root)
{
event->configure.x += _gdk_offset_x;
event->configure.y += _gdk_offset_y;
}
if (((GdkWindowObject *) window)->resize_count > 1)
((GdkWindowObject *) window)->resize_count -= 1;
@@ -3301,6 +3303,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
+7 -11
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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;
}
+139 -49
View File
@@ -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,16 +918,26 @@ _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,
&event->button.x,
&event->button.y);
/* Also calculate root coordinates. Note that input_window->root_x
is in Win32 screen coordinates. */
event->button.x_root = event->button.x + input_window->root_x
+ _gdk_offset_x;
event->button.y_root = event->button.y + input_window->root_y
+ _gdk_offset_y;
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,16 +951,26 @@ _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,
&event->motion.x,
&event->motion.y);
/* Also calculate root coordinates. Note that input_window->root_x
is in Win32 screen coordinates. */
event->motion.x_root = event->motion.x + input_window->root_x
+ _gdk_offset_x;
event->motion.y_root = event->motion.y + input_window->root_y
+ _gdk_offset_y;
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 +982,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 +1001,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 +1106,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 +1140,7 @@ _gdk_input_grab_pointer (GdkWindow *window,
}
else
{
x_grab_window = NULL;
tmp_list = _gdk_input_devices;
while (tmp_list)
{
@@ -1094,6 +1198,7 @@ _gdk_input_ungrab_pointer (guint32 time)
tmp_list = tmp_list->next;
}
}
x_grab_window = NULL;
#endif
}
@@ -1134,42 +1239,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);
}
}
-2
View File
@@ -203,8 +203,6 @@ update_keymap (void)
*ksymp = GDK_KP_Separator; break;
case VK_SUBTRACT:
*ksymp = GDK_KP_Subtract; break;
case VK_DECIMAL:
*ksymp = GDK_KP_Decimal; break;
case VK_DIVIDE:
*ksymp = GDK_KP_Divide; break;
case VK_F1:
+1 -1
View File
@@ -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);
+1 -14
View File
@@ -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;
+40 -27
View File
@@ -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
View File
@@ -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);
}
+30 -6
View File
@@ -448,10 +448,11 @@ RegisterGdkClass (GdkWindowType wtype)
return klass;
}
GdkWindow*
gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
static GdkWindow*
gdk_window_new_internal (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask,
gboolean from_set_skip_taskbar_hint)
{
HANDLE hparent;
ATOM klass = 0;
@@ -529,7 +530,19 @@ gdk_window_new (GdkWindow *parent,
impl->width = (attributes->width > 1) ? (attributes->width) : (1);
impl->height = (attributes->height > 1) ? (attributes->height) : (1);
impl->extension_events_selected = FALSE;
private->window_type = attributes->window_type;
if (attributes->wclass == GDK_INPUT_ONLY)
{
/* Backwards compatiblity - we've always ignored
* attributes->window_type for input-only windows
* before
*/
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT)
private->window_type = GDK_WINDOW_TEMP;
else
private->window_type = GDK_WINDOW_CHILD;
}
else
private->window_type = attributes->window_type;
if (attributes->wclass == GDK_INPUT_OUTPUT)
{
@@ -720,6 +733,9 @@ gdk_window_new (GdkWindow *parent,
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
#endif
if (!from_set_skip_taskbar_hint && private->window_type == GDK_WINDOW_TEMP)
gdk_window_set_skip_taskbar_hint (window, TRUE);
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) :
NULL));
@@ -727,6 +743,14 @@ gdk_window_new (GdkWindow *parent,
return window;
}
GdkWindow*
gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
{
return gdk_window_new_internal (parent, attributes, attributes_mask, FALSE);
}
GdkWindow *
gdk_window_foreign_new_for_display (GdkDisplay *display,
GdkNativeWindow anid)
@@ -3078,7 +3102,7 @@ gdk_window_set_skip_taskbar_hint (GdkWindow *window,
wa.wclass = GDK_INPUT_OUTPUT;
wa.width = wa.height = 1;
wa.event_mask = 0;
owner = gdk_window_new (NULL, &wa, 0);
owner = gdk_window_new_internal (NULL, &wa, 0, TRUE);
}
SetWindowLong (GDK_WINDOW_HWND (window), GWL_HWNDPARENT,
+23 -15
View File
@@ -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;
}
+1 -1
View File
@@ -813,7 +813,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
}
}
char*
static char*
escape_for_xmessage (const char *str)
{
GString *retval;
+4 -1
View File
@@ -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
View File
@@ -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) ||
+17
View File
@@ -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 */
+8 -2
View File
@@ -455,12 +455,15 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
{
gulong *desktop;
type = None;
gdk_error_trap_push ();
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
&bytes_after, (guchar **)&desktop);
gdk_error_trap_pop ();
if (type != None)
{
@@ -494,10 +497,13 @@ gdk_check_wm_state_changed (GdkWindow *window)
toplevel->have_maxhorz = FALSE;
toplevel->have_fullscreen = FALSE;
type = None;
gdk_error_trap_push ();
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
&bytes_after, (guchar **)&atoms);
gdk_error_trap_pop ();
if (type != None)
{
@@ -783,14 +789,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",
+1 -1
View File
@@ -866,7 +866,7 @@ gdk_window_postmove (GdkWindow *window,
}
}
Bool
static Bool
expose_serial_predicate (Display *xdisplay,
XEvent *xev,
XPointer arg)
+22 -8
View File
@@ -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;
+64 -14
View File
@@ -105,6 +105,14 @@ static gpointer parent_class = NULL;
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
/* Return whether time1 is considered later than time2 as far as xserver
* time is concerned. Accounts for wraparound.
*/
#define XSERVER_TIME_IS_LATER(time1, time2) \
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
)
GType
gdk_window_impl_x11_get_type (void)
{
@@ -1099,6 +1107,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,
@@ -1173,6 +1195,8 @@ show_window_internal (GdkWindow *window,
gboolean raise)
{
GdkWindowObject *private;
GdkDisplayX11 *display_x11;
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -1197,6 +1221,17 @@ show_window_internal (GdkWindow *window,
g_assert (GDK_WINDOW_IS_MAPPED (window));
if (WINDOW_IS_TOPLEVEL (window))
{
display_x11 = GDK_DISPLAY_X11 (gdk_drawable_get_display (window));
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel->user_time != 0 &&
display_x11->user_time != 0 &&
XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
_gdk_x11_window_set_user_time (window, display_x11->user_time);
}
if (impl->position_info.mapped)
XMapWindow (xdisplay, xwindow);
}
@@ -1708,9 +1743,9 @@ gdk_window_focus (GdkWindow *window,
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_ACTIVE_WINDOW");
xev.xclient.format = 32;
xev.xclient.data.l[0] = 0;
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[0] = 1; /* requestor type; we're an app */
xev.xclient.data.l[1] = timestamp;
xev.xclient.data.l[2] = None; /* currently active window */
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
@@ -3335,6 +3370,8 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
{
GdkDisplay *display;
GdkDisplayX11 *display_x11;
GdkToplevelX11 *toplevel;
glong timestamp_long = (glong)timestamp;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -3344,14 +3381,17 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
display = gdk_drawable_get_display (window);
display_x11 = GDK_DISPLAY_X11 (display);
toplevel = _gdk_x11_window_get_toplevel (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 *)&timestamp, 1);
(guchar *)&timestamp_long, 1);
if (timestamp != GDK_CURRENT_TIME)
display_x11->user_time = timestamp;
if (timestamp_long != GDK_CURRENT_TIME)
display_x11->user_time = timestamp_long;
toplevel->user_time = timestamp_long;
}
/**
@@ -3953,10 +3993,15 @@ gdk_window_set_keep_above (GdkWindow *window, gboolean setting)
return;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (setting, window,
gdk_atom_intern ("_NET_WM_STATE_ABOVE", setting),
setting ? gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE)
: GDK_NONE);
{
if (setting)
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE),
GDK_NONE);
gdk_wmspec_change_state (setting, window,
gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE),
GDK_NONE);
}
else
gdk_synthesize_window_state (window,
setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
@@ -3989,10 +4034,15 @@ gdk_window_set_keep_below (GdkWindow *window, gboolean setting)
return;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (setting, window,
gdk_atom_intern ("_NET_WM_STATE_BELOW", setting),
setting ? gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE)
: GDK_NONE);
{
if (setting)
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE),
GDK_NONE);
gdk_wmspec_change_state (setting, window,
gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE),
GDK_NONE);
}
else
gdk_synthesize_window_state (window,
setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
+3
View File
@@ -114,6 +114,9 @@ struct _GdkToplevelX11
GdkPixmap *icon_window;
GdkWindow *group_leader;
/* Time of most recent user interaction. */
gulong user_time;
/* We use an extra X window for toplevel windows that we XSetInputFocus()
* to in order to avoid getting keyboard events redirected to subwindows
* that might not even be part of this app
+1 -1
View File
@@ -14,7 +14,7 @@ zip $ZIP -@ <<EOF
COPYING.LIB-2
etc/gtk-2.0/gdk-pixbuf.loaders
etc/gtk-2.0/gtkrc
etc/gtk-2.0/gtk.immodues
etc/gtk-2.0/gtk.immodules
$DLLDIR/libgdk_pixbuf-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
$DLLDIR/libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
$DLLDIR/libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
+80 -79
View File
@@ -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
View File
@@ -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;
}
+17 -17
View File
@@ -339,6 +339,8 @@ gtk_action_init (GtkAction *action)
* Creates a new #GtkAction object. To add the action to a
* #GtkActionGroup and set the accelerator for the action,
* call gtk_action_group_add_action_with_accel().
* See <xref linkend="XML-UI"/> for information on allowed action
* names.
*
* Return value: a new #GtkAction
*
@@ -741,8 +743,6 @@ static void
connect_proxy (GtkAction *action,
GtkWidget *proxy)
{
GtkActionGroup *group = action->private_data->action_group;
g_object_ref (action);
g_object_set_data_full (G_OBJECT (proxy), "gtk-action", action,
g_object_unref);
@@ -822,7 +822,7 @@ connect_proxy (GtkAction *action,
}
gtk_image_set_from_stock (GTK_IMAGE (image),
action->private_data->stock_id, GTK_ICON_SIZE_MENU);
g_signal_connect_object (action, "notify::stock_id",
g_signal_connect_object (action, "notify::stock-id",
G_CALLBACK (gtk_action_sync_stock_id),
proxy, 0);
}
@@ -845,13 +845,13 @@ connect_proxy (GtkAction *action,
/* FIXME: we should set the tooltip here, but the current api
* doesn't allow it before the item is added to a toolbar.
*/
g_signal_connect_object (action, "notify::visible_horizontal",
g_signal_connect_object (action, "notify::visible-horizontal",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (action, "notify::visible_vertical",
g_signal_connect_object (action, "notify::visible-vertical",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (action, "notify::is_important",
g_signal_connect_object (action, "notify::is-important",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (action, "notify::tooltip",
@@ -873,10 +873,10 @@ connect_proxy (GtkAction *action,
/* FIXME: we should set the tooltip here, but the current api
* doesn't allow it before the item is added to a toolbar.
*/
g_signal_connect_object (action, "notify::short_label",
g_signal_connect_object (action, "notify::short-label",
G_CALLBACK (gtk_action_sync_short_label),
proxy, 0);
g_signal_connect_object (action, "notify::stock_id",
g_signal_connect_object (action, "notify::stock-id",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (proxy, "clicked",
@@ -893,7 +893,7 @@ connect_proxy (GtkAction *action,
"label", action->private_data->short_label,
"use_underline", TRUE,
NULL);
g_signal_connect_object (action, "notify::short_label",
g_signal_connect_object (action, "notify::short-label",
G_CALLBACK (gtk_action_sync_short_label),
proxy, 0);
@@ -902,15 +902,14 @@ connect_proxy (GtkAction *action,
G_CONNECT_SWAPPED);
}
_gtk_action_group_emit_connect_proxy (group, action, proxy);
if (action->private_data->action_group)
_gtk_action_group_emit_connect_proxy (action->private_data->action_group, action, proxy);
}
static void
disconnect_proxy (GtkAction *action,
GtkWidget *proxy)
{
GtkActionGroup *group = action->private_data->action_group;
g_object_set_data (G_OBJECT (proxy), "gtk-action", NULL);
/* remove proxy from list of proxies */
@@ -925,12 +924,12 @@ disconnect_proxy (GtkAction *action,
action);
/* disconnect handlers for notify::* signals */
g_signal_handlers_disconnect_by_func (proxy,
g_signal_handlers_disconnect_by_func (action,
G_CALLBACK (gtk_action_sync_sensitivity),
action);
g_signal_handlers_disconnect_by_func (proxy,
proxy);
g_signal_handlers_disconnect_by_func (action,
G_CALLBACK (gtk_action_sync_property),
action);
proxy);
g_signal_handlers_disconnect_by_func (action,
G_CALLBACK (gtk_action_sync_stock_id), proxy);
@@ -949,7 +948,8 @@ disconnect_proxy (GtkAction *action,
G_CALLBACK (gtk_action_create_menu_proxy),
action);
_gtk_action_group_emit_disconnect_proxy (group, action, proxy);
if (action->private_data->action_group)
_gtk_action_group_emit_disconnect_proxy (action->private_data->action_group, action, proxy);
}
void
+1 -1
View File
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
#define GTK_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION, GtkAction))
#define GTK_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACTION, GtkActionClass))
#define GTK_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION))
#define GTK_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GTK_TYPE_ACTION))
#define GTK_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACTION))
#define GTK_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_ACTION, GtkActionClass))
typedef struct _GtkAction GtkAction;
+14 -9
View File
@@ -202,7 +202,7 @@ gtk_action_group_class_init (GtkActionGroupClass *klass)
GTK_TYPE_ACTION, GTK_TYPE_WIDGET);
/**
* GtkActionGroup::pre_activate:
* GtkActionGroup::pre-activate:
* @action_group: the group
* @action: the action
*
@@ -223,7 +223,7 @@ gtk_action_group_class_init (GtkActionGroupClass *klass)
GTK_TYPE_ACTION);
/**
* GtkActionGroup::post_activate:
* GtkActionGroup::post-activate:
* @action_group: the group
* @action: the action
*
@@ -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>&lt;Actions&gt;/<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
View File
@@ -29,7 +29,7 @@
#include "gtkarrow.h"
#include "gtkintl.h"
#define MIN_ARROW_SIZE 11
#define MIN_ARROW_SIZE 15
enum {
PROP_0,
+17 -3
View File
@@ -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;
@@ -1405,7 +1419,7 @@ gtk_button_get_use_stock (GtkButton *button)
/**
* gtk_button_set_focus_on_click:
* @button: a #GtkButton
* @focus_on_click: whether the mouse grabs focus when clicked with the mouse
* @focus_on_click: whether the button grabs focus when clicked with the mouse
*
* Sets whether the button will grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
+12 -9
View File
@@ -599,13 +599,13 @@ gtk_calendar_class_init (GtkCalendarClass *class)
enum
{
TARGET_TEXT,
TARGET_TEXT
};
static const GtkTargetEntry target_table[] = {
{ "TEXT", 0, TARGET_TEXT },
{ "STRING", 0, TARGET_TEXT },
{ "UTF8_STRING", 0, TARGET_TEXT },
{ "UTF8_STRING", 0, TARGET_TEXT }
};
static void
@@ -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));
}
+9 -1
View File
@@ -294,7 +294,15 @@ gtk_cell_view_style_set (GtkWidget *widget,
static void
gtk_cell_view_finalize (GObject *object)
{
gtk_cell_view_cell_layout_clear (GTK_CELL_LAYOUT (object));
GtkCellView *cellview = GTK_CELL_VIEW (object);
gtk_cell_view_cell_layout_clear (GTK_CELL_LAYOUT (cellview));
if (cellview->priv->model)
g_object_unref (cellview->priv->model);
if (cellview->priv->displayed_row)
gtk_tree_row_reference_free (cellview->priv->displayed_row);
if (G_OBJECT_CLASS (parent_class)->finalize)
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
+193 -97
View File
@@ -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,
@@ -1168,6 +1203,9 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
{
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (combo_box)))
return;
if (GTK_IS_MENU (combo_box->priv->popup_widget))
{
gtk_menu_popdown (GTK_MENU (combo_box->priv->popup_widget));
@@ -1213,7 +1251,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;
@@ -1264,6 +1303,8 @@ gtk_combo_box_size_request (GtkWidget *widget,
gtk_combo_box_remeasure (combo_box);
bin_req.width = MAX (bin_req.width, combo_box->priv->width);
gtk_combo_box_check_appearance (combo_box);
if (!combo_box->priv->tree_view)
{
/* menu mode */
@@ -1342,6 +1383,8 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
gtk_combo_box_check_appearance (combo_box);
if (!combo_box->priv->tree_view)
{
if (combo_box->priv->cell_view)
@@ -1360,12 +1403,12 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.x = allocation->x + border_width + 1 + xthickness + 2;
child.y = allocation->y + border_width + 1 + ythickness + 2;
width = allocation->width - (border_width + 1 + xthickness * 2 + 4);
width = MAX(1, allocation->width - (border_width + 1 + xthickness * 2 + 4));
/* handle the children */
gtk_widget_size_request (combo_box->priv->arrow, &req);
child.width = req.width;
child.height = allocation->height - 2 * (child.y - allocation->y);
child.height = MAX(1, allocation->height - 2 * (child.y - allocation->y));
if (!is_rtl)
child.x += width - req.width;
gtk_widget_size_allocate (combo_box->priv->arrow, &child);
@@ -1380,14 +1423,14 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
if (is_rtl)
{
child.x += req.width;
child.width = allocation->x + allocation->width
- (border_width + 1 + xthickness + 2) - child.x;
child.width = MAX(1, allocation->x + allocation->width
- (border_width + 1 + xthickness + 2) - child.x);
}
else
{
child.width = child.x;
child.x = allocation->x + border_width + 1 + xthickness + 2;
child.width -= child.x;
child.width = MAX(1, child.width - child.x);
}
gtk_widget_size_allocate (GTK_BIN (widget)->child, &child);
@@ -1409,7 +1452,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
else
child.x = allocation->x;
child.y = allocation->y;
child.width = allocation->width - req.width;
child.width = MAX(1, allocation->width - req.width);
gtk_widget_size_allocate (GTK_BIN (widget)->child, &child);
}
}
@@ -1434,7 +1477,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
else
child.x = allocation->x;
child.y = allocation->y;
child.width = allocation->width - req.width;
child.width = MAX (1, allocation->width - req.width);
child.height = allocation->height;
if (combo_box->priv->cell_view_frame)
@@ -1451,9 +1494,11 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.width -= 2 * (
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);
child.width = MAX(1,child.width);
child.height -= 2 * (
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness);
child.height = MAX(1,child.height);
}
gtk_widget_size_allocate (GTK_BIN (combo_box)->child, &child);
@@ -1488,6 +1533,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 +1550,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 +1695,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 +1753,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 +1771,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)
{
@@ -1811,8 +1846,8 @@ gtk_combo_box_relayout_item (GtkComboBox *combo_box,
{
gint current_col = 0, current_row = 0;
gint rows, cols;
GList *list;
GtkWidget *item;
GList *list, *nth;
GtkWidget *item, *last;
GtkWidget *menu;
menu = combo_box->priv->popup_widget;
@@ -1820,26 +1855,49 @@ gtk_combo_box_relayout_item (GtkComboBox *combo_box,
return;
list = gtk_container_get_children (GTK_CONTAINER (menu));
item = g_list_nth_data (list, index);
nth = g_list_nth (list, index);
item = nth->data;
if (nth->prev)
last = nth->prev->data;
else
last = NULL;
g_list_free (list);
gtk_combo_box_item_get_size (combo_box, index, &cols, &rows);
/* look for a good spot */
while (1)
if (combo_box->priv->col_column == -1 &&
combo_box->priv->row_column == -1 &&
last)
{
gtk_container_child_get (GTK_CONTAINER (menu),
last,
"right_attach", &current_col,
"top_attach", &current_row,
NULL);
if (current_col + cols > combo_box->priv->wrap_width)
{
current_col = 0;
current_row++;
}
if (!menu_occupied (GTK_MENU (menu),
current_col, current_col + cols,
current_row, current_row + rows))
break;
current_col++;
{
current_col = 0;
current_row++;
}
}
else
{
/* look for a good spot */
while (1)
{
if (current_col + cols > combo_box->priv->wrap_width)
{
current_col = 0;
current_row++;
}
if (!menu_occupied (GTK_MENU (menu),
current_col, current_col + cols,
current_row, current_row + rows))
break;
current_col++;
}
}
/* set attach props */
@@ -1890,6 +1948,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 +1971,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 +2201,27 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view),
&GTK_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 +2293,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 +2318,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);
@@ -2257,10 +2331,14 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
static void
gtk_combo_box_list_remove_grabs (GtkComboBox *combo_box)
{
if (GTK_WIDGET_HAS_GRAB (combo_box->priv->tree_view))
gtk_grab_remove (combo_box->priv->tree_view);
if (combo_box->priv->tree_view &&
GTK_WIDGET_HAS_GRAB (combo_box->priv->tree_view))
{
gtk_grab_remove (combo_box->priv->tree_view);
}
if (GTK_WIDGET_HAS_GRAB (combo_box->priv->popup_window))
if (combo_box->priv->popup_window &&
GTK_WIDGET_HAS_GRAB (combo_box->priv->popup_window))
{
gtk_grab_remove (combo_box->priv->popup_window);
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
@@ -2280,7 +2358,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 +2437,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 +2477,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 +2527,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 +3121,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 +3130,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 +3255,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 +3264,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)
@@ -3267,8 +3361,8 @@ gtk_combo_box_new_text (void)
GtkListStore *store;
store = gtk_list_store_new (1, G_TYPE_STRING);
combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
g_object_unref (store);
cell = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), cell, TRUE);
@@ -3411,10 +3505,11 @@ gtk_combo_box_destroy (GtkObject *object)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (object);
gtk_combo_box_popdown (combo_box);
combo_box->priv->destroying = 1;
GTK_OBJECT_CLASS (parent_class)->destroy (object);
combo_box->priv->cell_view = NULL;
combo_box->priv->destroying = 0;
@@ -3427,7 +3522,11 @@ gtk_combo_box_finalize (GObject *object)
GSList *i;
if (GTK_IS_MENU (combo_box->priv->popup_widget))
gtk_combo_box_menu_destroy (combo_box);
{
gtk_combo_box_menu_destroy (combo_box);
gtk_menu_detach (GTK_MENU (combo_box->priv->popup_widget));
combo_box->priv->popup_widget = NULL;
}
if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view))
gtk_combo_box_list_destroy (combo_box);
@@ -3437,9 +3536,6 @@ gtk_combo_box_finalize (GObject *object)
gtk_combo_box_unset_model (combo_box);
if (combo_box->priv->model)
g_object_unref (combo_box->priv->model);
for (i = combo_box->priv->cells; i; i = i->next)
{
ComboCellInfo *info = (ComboCellInfo *)i->data;
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -363,8 +363,8 @@ gtk_combo_box_entry_new_text (void)
GtkListStore *store;
store = gtk_list_store_new (1, G_TYPE_STRING);
entry_box = gtk_combo_box_entry_new_with_model (GTK_TREE_MODEL (store), 0);
g_object_unref (store);
return entry_box;
}

Some files were not shown because too many files have changed in this diff Show More