Clip the retrieved image data to the screen, using a server grab to avoid

2001-06-28  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
	image data to the screen, using a server grab to avoid race
	conditions.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
	check for NULL return from gtk_image_new_from_stock(), it never
	returns NULL.
	(gtk_item_factory_create_item): fix bug where we parsed the stock
	ID as an inline pixbuf

	* gtk/gtktext.c (gtk_text_key_press): numeric keypad support

	* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
	support

	* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support

	* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad

	* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad

	* gtk/gtkimcontextsimple.c
	(gtk_im_context_simple_filter_keypress): keypad

	* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad

	* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes

	* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support

	* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
	should be binding-setted)

	* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes

	* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes

	* gtk/gtkcalendar.c: numeric keypad fixes

	* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
	support

	* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
	screwup

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	clip the render area to the drawable's clip region in advance,
	so we don't get data from the server that we don't need.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	check return value of gdk_pixbuf_get_from_drawable(), fall back
	to bilevel alpha if we can't get the pixbuf to composite against.

	* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap

	* gdk/gdkimage.c (gdk_image_get_colormap): add
	gdk_image_set_colormap, gdk_image_get_colormap

	* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
	take a region of the image, instead of converting the entire
	image.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
	keybinding signal. Add default bindings for it. Add default
	handler for show_help that shows the tooltip for the widget.

	* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
	"close" keybinding signal, remove key press handler.

	* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
	it's not our usual practice to leave a deprecated function around
	with a runtime warning, plus we don't want it to appear in docs,
	plus if we make them yellow no one will want to change them
	anyhow.
This commit is contained in:
Havoc Pennington 2001-06-29 01:59:02 +00:00 committed by Havoc Pennington
parent 00f85bf815
commit 0bee26c7ba
59 changed files with 1874 additions and 408 deletions

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,86 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() ->

View File

@ -1,3 +1,7 @@
2001-05-19 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf-xlibrgb.c: docs
2001-06-04 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-xlibrgb.c (xlib_rgb_init): remove C++ comment,

View File

@ -460,18 +460,36 @@ xlib_rgb_colorcube_222 (void)
}
}
/**
* xlib_rgb_set_verbose:
* @verbose: %True to be verbose
*
* Enables/disables debug spew.
**/
void
xlib_rgb_set_verbose (Bool verbose)
{
xlib_rgb_verbose = verbose;
}
/**
* xlib_rgb_set_install:
* @install: %True to install a colormap
*
* Sets whether we install an RGB colormap.
**/
void
xlib_rgb_set_install (Bool install)
{
xlib_rgb_install_cmap = install;
}
/**
* xlib_rgb_set_min_colors:
* @min_colors: minimum colors to use
*
* Sets the minimum number of colors in the color cube.
**/
void
xlib_rgb_set_min_colors (int min_colors)
{
@ -1020,7 +1038,7 @@ xlib_rgb_gc_set_foreground (GC gc, guint32 rgb)
}
/**
* xlib_rgb_gc_set_foreground:
* xlib_rgb_gc_set_background:
* @gc: A graphic context.
* @rgb: 32-bit representation of an RGB value, specified as 0x00RRGGBB.
*

View File

@ -383,3 +383,11 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0:
gtk_container_child_setv => gtk_container_child_get_property
gtk_container_add_with_args => gtk_container_add_with_properties
gtk_container_addv => gtk_container_add / gtk_container_child_set_property
* gdk_image_get() (or rather its replacement,
gdk_drawable_get_image()) now handles errors properly by returning
NULL, previously it would crash. Also, a window being offscreen is
no longer considered an error; instead, the area being contains
undefined contents for the offscreen areas. In most cases, code
using gdk_image_get() should really be ported to
gdk_pixbuf_get_from_drawable().

View File

@ -1,3 +1,11 @@
2001-05-19 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf/tmpl/initialization_versions.sgml: docs
* gdk-pixbuf/tmpl/gdk-pixbuf.sgml: docs
* gdk-pixbuf/tmpl/gdk-pixbuf-xlib-init.sgml: docs
Sun Apr 15 15:04:12 2001 Owen Taylor <otaylor@redhat.com>
* gtk/tmpl/gtkdnd.sgml: Move some of the function docs to the

View File

@ -17,22 +17,28 @@ Information that describes an image.
<!-- ##### ENUM GdkPixbufError ##### -->
<para>
An error code in the #GDK_PIXBUF_ERROR domain. Many &gdk-pixbuf;
operations can cause errors in this domain, or in the #G_FILE_ERROR
domain.
</para>
@GDK_PIXBUF_ERROR_HEADER_CORRUPT:
@GDK_PIXBUF_ERROR_PIXEL_CORRUPT:
@GDK_PIXBUF_ERROR_UNKNOWN_FORMAT:
@GDK_PIXBUF_ERROR_CORRUPT_IMAGE:
@GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY:
@GDK_PIXBUF_ERROR_BAD_OPTION_VALUE:
@GDK_PIXBUF_ERROR_UNKNOWN_TYPE:
@GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION:
@GDK_PIXBUF_ERROR_FAILED:
@GDK_PIXBUF_ERROR_CORRUPT_IMAGE: An image file was broken somehow.
@GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY: Not enough memory.
@GDK_PIXBUF_ERROR_BAD_OPTION_VALUE: An option passed to
gdk_pixbuf_save() had a bad value.
@GDK_PIXBUF_ERROR_UNKNOWN_TYPE: Unknown image type.
@GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION: Don't know how to perform the
given operation on the type of image at hand.
@GDK_PIXBUF_ERROR_FAILED: Generic failure code, something went wrong.
<!-- ##### MACRO GDK_PIXBUF_ERROR ##### -->
<para>
Error domain used for pixbuf operations. Indicates that the error code
will be in the #GdkPixbufError enumeration. See #GError for
information on error domains and error codes.
</para>

View File

@ -3,10 +3,12 @@ Initialization and Versions
<!-- ##### SECTION Short_Description ##### -->
Library version numbers.
<!-- ##### SECTION Long_Description ##### -->
<para>
These macros and variables let you check the version of &gdk-pixbuf;
you're linking against.
</para>
<!-- ##### SECTION See_Also ##### -->
@ -16,34 +18,40 @@ Initialization and Versions
<!-- ##### VARIABLE gdk_pixbuf_version ##### -->
<para>
Contains the full version of the &gdk-pixbuf; library as a string.
This is the version currently in use by a running program.
</para>
<!-- ##### MACRO GDK_PIXBUF_VERSION ##### -->
<para>
Contains the full version of the &gdk-pixbuf; header as a string.
This is the version being compiled against; contrast with
#gdk_pixbuf_version.
</para>
<!-- ##### MACRO GDK_PIXBUF_MAJOR ##### -->
<para>
Major version of &gdk-pixbuf; library, that is the first "0" in
"0.8.0" for example.
</para>
<!-- ##### MACRO GDK_PIXBUF_MINOR ##### -->
<para>
Minor version of &gdk-pixbuf; library, that is the "8" in
"0.8.0" for example.
</para>
<!-- ##### MACRO GDK_PIXBUF_MICRO ##### -->
<para>
Micro version of &gdk-pixbuf; library, that is the last "0" in
"0.8.0" for example.
</para>

View File

@ -71,6 +71,7 @@ The #GdkImage struct contains information on the image and the pixel data.
@bpl: the number of bytes per line of the image.
@bits_per_pixel:
@mem: the pixel data.
@colormap:
@windowing_data:
<!-- ##### FUNCTION gdk_image_new ##### -->

View File

@ -273,6 +273,13 @@ directly, but into the vbox and action_area, as described above.
@setting:
<!-- ##### SIGNAL GtkDialog::close ##### -->
<para>
</para>
@dialog: the object which received the signal.
<!-- ##### SIGNAL GtkDialog::response ##### -->
<para>
Emitted when an action widget is clicked, the dialog receives a delete event, or

View File

@ -495,7 +495,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:

View File

@ -143,17 +143,6 @@ Adds a tooltip containing the message @tip_text to the specified #GtkWidget.
@tip_private: a string of any further information that may be useful if the user gets stuck.
<!-- ##### FUNCTION gtk_tooltips_set_colors ##### -->
<para>
This function is unimplemented because tooltip colors are instead
determined by the theme.
</para>
@tooltips: a #GtkTooltip
@background: a #GdkColor that your tooltip text will be shown in.
@foreground: a #GdkColor that your tooltip backgrounds will be shown in.
<!-- ##### FUNCTION gtk_tooltips_data_get ##### -->
<para>
Retrieves any #GtkTooltipsData previously associated with the given widget.

View File

@ -1529,6 +1529,14 @@ GtkWidget
@event:
@Returns:
<!-- ##### SIGNAL GtkWidget::event-after ##### -->
<para>
</para>
@widget: the object which received the signal.
@event:
<!-- ##### SIGNAL GtkWidget::expose-event ##### -->
<para>
@ -1789,6 +1797,14 @@ a widget changes from un-anchored to anchored or vice-versa.
@widget: the object which received the signal.
<!-- ##### SIGNAL GtkWidget::show-help ##### -->
<para>
</para>
@widget: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkWidget::size-allocate ##### -->
<para>

View File

@ -1,3 +1,10 @@
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk-pixdata.c: <string.h>
* gdk-pixbuf-io.c (get_libdir): fix typo in dll name (aren't we
also leaking memory here from g_strdup_printf?)
Tue Jun 26 09:48:02 2001 Tim Janik <timj@gtk.org>
* Makefile.am (noinst_PROGRAMS): get rid of make-inline-pixbuf

View File

@ -239,7 +239,7 @@ get_libdir (void)
if (libdir == NULL)
libdir = g_win32_get_package_installation_subdirectory
(GETTEXT_PACKAGE,
g_strdup_printf ("gdk_pixbug-%d.%d.dll",
g_strdup_printf ("gdk_pixbuf-%d.%d.dll",
GDK_PIXBUF_MAJOR, GDK_PIXBUF_MINOR),
"loaders");

View File

@ -20,6 +20,7 @@
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-i18n.h"
#include <string.h>
/* --- functions --- */

View File

@ -597,6 +597,10 @@ gdk_draw_glyphs (GdkDrawable *drawable,
* If the X server or other windowing system backend is on the local
* machine, this function may use shared memory to avoid copying
* the image data.
*
* If the source drawable is a #GdkWindow and partially offscreen
* or obscured, then the obscured portions of the returned image
* will contain undefined data.
*
* Return value: a #GdkImage containing the contents of @drawable
**/
@ -611,6 +615,7 @@ gdk_drawable_get_image (GdkDrawable *drawable,
gint composite_x_offset = 0;
gint composite_y_offset = 0;
GdkImage *retval;
GdkColormap *cmap;
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (x >= 0, NULL);
@ -639,6 +644,11 @@ gdk_drawable_get_image (GdkDrawable *drawable,
g_object_unref (G_OBJECT (composite));
cmap = gdk_drawable_get_colormap (drawable);
if (retval && cmap)
gdk_image_set_colormap (retval, cmap);
return retval;
}

View File

@ -44,6 +44,21 @@ gdk_image_unref (GdkImage *image)
g_object_unref (G_OBJECT (image));
}
/**
* gdk_image_get:
* @window: a #GdkWindow
* @x: x coordinate in @window
* @y: y coordinate in @window
* @width: width of area in @window
* @height: height of area in @window
*
* This is a deprecated wrapper for gdk_drawable_get_image();
* gdk_drawable_get_image() should be used instead. Or even better: in
* most cases gdk_pixbuf_get_from_drawable() is the most convenient
* choice.
*
* Return value: a new #GdkImage or %NULL
**/
GdkImage*
gdk_image_get (GdkWindow *window,
gint x,
@ -59,3 +74,51 @@ gdk_image_get (GdkWindow *window,
return gdk_drawable_get_image (window, x, y, width, height);
}
/**
* gdk_image_set_colormap:
* @image: a #GdkImage
* @colormap: a #GdkColormap
*
* Sets the colormap for the image to the given colormap. Normally
* there's no need to use this function, images are created with the
* correct colormap if you get the image from a drawable. If you
* create the image from scratch, use the colormap of the drawable you
* intend to render the image to.
**/
void
gdk_image_set_colormap (GdkImage *image,
GdkColormap *colormap)
{
g_return_if_fail (GDK_IS_IMAGE (image));
g_return_if_fail (GDK_IS_COLORMAP (colormap));
if (image->colormap != colormap)
{
if (image->colormap)
g_object_unref (G_OBJECT (image->colormap));
image->colormap = colormap;
g_object_ref (G_OBJECT (image->colormap));
}
}
/**
* gdk_image_get_colormap:
* @image: a #GdkImage
*
* Retrieves the colormap for a given image, if it exists. An image
* will have a colormap if the drawable from which it was created has
* a colormap, or if a colormap was set explicitely with
* gdk_image_set_colormap().
*
* Return value: colormap for the image
**/
GdkColormap *
gdk_image_get_colormap (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), NULL);
return image->colormap;
}

View File

@ -49,6 +49,8 @@ struct _GdkImage
guint16 bits_per_pixel; /* bits per pixel */
gpointer mem;
GdkColormap *colormap;
gpointer windowing_data;
};
@ -81,6 +83,11 @@ guint32 gdk_image_get_pixel (GdkImage *image,
gint x,
gint y);
void gdk_image_set_colormap (GdkImage *image,
GdkColormap *colormap);
GdkColormap* gdk_image_get_colormap (GdkImage *image);
#ifdef GDK_ENABLE_BROKEN
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
gpointer data,

File diff suppressed because it is too large Load Diff

View File

@ -267,7 +267,9 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf,
GdkGC *gc;
GdkPixbuf *composited = NULL;
gint dwidth, dheight;
GdkRegion *clip;
GdkRegion *drect;
GdkRectangle tmp_rect;
g_return_if_fail (pixbuf != NULL);
g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
@ -308,12 +310,70 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf,
if (width <= 0 || height <= 0)
return;
/* Clip to the clip region; this avoids getting more
* image data from the server than we need to.
*/
tmp_rect.x = dest_x;
tmp_rect.y = dest_y;
tmp_rect.width = width;
tmp_rect.height = height;
drect = gdk_region_rectangle (&tmp_rect);
clip = gdk_drawable_get_clip_region (drawable);
gdk_region_intersect (drect, clip);
gdk_region_get_clipbox (drect, &tmp_rect);
gdk_region_destroy (drect);
gdk_region_destroy (clip);
if (tmp_rect.width == 0 ||
tmp_rect.height == 0)
return;
/* Actually draw */
gc = gdk_gc_new (drawable);
if (pixbuf->has_alpha)
{
if (alpha_mode == GDK_PIXBUF_ALPHA_FULL)
{
GdkPixbuf *sub = NULL;
composited = gdk_pixbuf_get_from_drawable (NULL,
drawable,
NULL,
dest_x, dest_y,
0, 0,
width, height);
if (composited)
{
if (src_x != 0 || src_y != 0)
{
sub = gdk_pixbuf_new_subpixbuf (pixbuf, src_x, src_y,
width, height);
}
gdk_pixbuf_composite (sub ? sub : pixbuf,
composited,
0, 0,
width, height,
0, 0,
1.0, 1.0,
GDK_INTERP_BILINEAR,
255);
if (sub)
g_object_unref (G_OBJECT (sub));
}
else
alpha_mode = GDK_PIXBUF_ALPHA_BILEVEL; /* fall back */
}
if (alpha_mode == GDK_PIXBUF_ALPHA_BILEVEL)
{
bitmap = gdk_pixmap_new (NULL, width, height, 1);
@ -326,35 +386,6 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf,
gdk_gc_set_clip_mask (gc, bitmap);
gdk_gc_set_clip_origin (gc, dest_x, dest_y);
}
else if (alpha_mode == GDK_PIXBUF_ALPHA_FULL)
{
GdkPixbuf *sub = NULL;
composited = gdk_pixbuf_get_from_drawable (NULL,
drawable,
NULL,
dest_x, dest_y,
0, 0,
width, height);
if (src_x != 0 || src_y != 0)
{
sub = gdk_pixbuf_new_subpixbuf (pixbuf, src_x, src_y,
width, height);
}
gdk_pixbuf_composite (sub ? sub : pixbuf,
composited,
0, 0,
width, height,
0, 0,
1.0, 1.0,
GDK_INTERP_BILINEAR,
255);
if (sub)
g_object_unref (G_OBJECT (sub));
}
}
if (composited)

View File

@ -61,6 +61,16 @@ GdkPixbuf *gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
int width,
int height);
GdkPixbuf *gdk_pixbuf_get_from_image (GdkPixbuf *dest,
GdkImage *src,
GdkColormap *cmap,
int src_x,
int src_y,
int dest_x,
int dest_y,
int width,
int height);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1317,6 +1317,8 @@ gdk_window_get_clip_region (GdkDrawable *drawable)
GdkWindowPaint *paint = tmp_list->data;
gdk_region_union (paint_region, paint->region);
tmp_list = tmp_list->next;
}
gdk_region_intersect (result, paint_region);

View File

@ -930,7 +930,7 @@ motif_find_drag_window (gboolean create)
display = XOpenDisplay (gdk_display_name);
XSetCloseDownMode (display, RetainPermanent);
XGrabServer (display);
XGrabServer (display);
motif_drag_window = motif_lookup_drag_window (display);

View File

@ -381,8 +381,10 @@ _gdk_x11_get_image (GdkDrawable *drawable,
GdkImagePrivateX11 *private;
GdkDrawableImplX11 *impl;
GdkVisual *visual;
gboolean have_grab;
GdkRectangle window_rect;
XImage *ximage;
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_X11 (drawable), NULL);
visual = gdk_drawable_get_visual (drawable);
@ -399,31 +401,69 @@ _gdk_x11_get_image (GdkDrawable *drawable,
impl = GDK_DRAWABLE_IMPL_X11 (drawable);
ximage = XGetImage (impl->xdisplay,
impl->xid,
x, y, width, height,
AllPlanes, ZPixmap);
have_grab = FALSE;
window_rect.x = x;
window_rect.y = y;
window_rect.width = width;
window_rect.height = height;
if (GDK_IS_WINDOW (drawable))
{
GdkRectangle screen_rect;
have_grab = TRUE;
gdk_x11_grab_server ();
if (!ximage)
screen_rect.x = 0;
screen_rect.y = 0;
screen_rect.width = gdk_screen_width ();
screen_rect.height = gdk_screen_height ();
gdk_error_trap_push ();
gdk_window_get_geometry (GDK_WINDOW (drawable),
&window_rect.x,
&window_rect.y,
&window_rect.width,
&window_rect.height,
NULL);
if (gdk_error_trap_pop () ||
!gdk_rectangle_intersect (&window_rect, &screen_rect,
&window_rect))
{
gdk_x11_ungrab_server ();
return NULL;
}
}
image = gdk_image_new (GDK_IMAGE_FASTEST,
visual,
width, height);
if (image == NULL)
return NULL;
image = g_object_new (gdk_image_get_type (), NULL);
private = PRIVATE_DATA (image);
gdk_error_trap_push ();
private->xdisplay = gdk_display;
private->ximage = ximage;
ximage = XGetSubImage (impl->xdisplay,
impl->xid,
x, y, width, height,
AllPlanes, ZPixmap,
private->ximage,
x, y);
image->type = GDK_IMAGE_NORMAL;
image->visual = visual;
image->width = width;
image->height = height;
image->depth = private->ximage->depth;
if (have_grab)
gdk_x11_ungrab_server ();
if (gdk_error_trap_pop () || ximage == NULL)
{
g_object_unref (G_OBJECT (image));
return NULL;
}
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bits_per_pixel = private->ximage->bits_per_pixel;
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
image->byte_order = private->ximage->byte_order;
g_assert (ximage == private->ximage);
return image;
}

View File

@ -193,7 +193,7 @@ gdk_window_impl_x11_get_colormap (GdkDrawable *drawable)
drawable_impl->colormap == NULL)
{
XWindowAttributes window_attributes;
XGetWindowAttributes (drawable_impl->xdisplay,
drawable_impl->xid,
&window_attributes);
@ -2278,7 +2278,7 @@ gdk_window_set_override_redirect (GdkWindow *window,
* gdk_window_set_icon_list:
* @window: The #GdkWindow toplevel window to set the icon of.
* @pixbufs: A list of pixbufs, of different sizes.
* @Returns: TRUE if the icons were set, false otherwise
* @Returns: %TRUE if the icons were set, false otherwise
*
* Sets a list of icons for the window. One of these will be used
* to represent the window when it has been iconified. The icon is
@ -3841,4 +3841,3 @@ gdk_window_begin_move_drag (GdkWindow *window,
else
emulate_move_drag (window, button, root_x, root_y, timestamp);
}

View File

@ -176,6 +176,9 @@ void gdk_x11_ungrab_server (void);
/* returns TRUE if we support the given WM spec feature */
gboolean gdk_net_wm_supports (GdkAtom property);
void gdk_x11_grab_server (void);
void gdk_x11_ungrab_server (void);
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))

View File

@ -2648,6 +2648,7 @@ gtk_calendar_key_press (GtkWidget *widget,
switch (event->keyval)
{
case GDK_KP_Left:
case GDK_Left:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
@ -2670,6 +2671,7 @@ gtk_calendar_key_press (GtkWidget *widget,
calendar->focus_col);
}
break;
case GDK_KP_Right:
case GDK_Right:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
@ -2692,6 +2694,7 @@ gtk_calendar_key_press (GtkWidget *widget,
calendar->focus_col);
}
break;
case GDK_KP_Up:
case GDK_Up:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
@ -2709,6 +2712,7 @@ gtk_calendar_key_press (GtkWidget *widget,
calendar->focus_col);
}
break;
case GDK_KP_Down:
case GDK_Down:
return_val = TRUE;
if (event->state & GDK_CONTROL_MASK)
@ -2726,6 +2730,7 @@ gtk_calendar_key_press (GtkWidget *widget,
calendar->focus_col);
}
break;
case GDK_KP_Space:
case GDK_space:
row = calendar->focus_row;
col = calendar->focus_col;

View File

@ -733,80 +733,157 @@ gtk_clist_class_init (GtkCListClass *klass)
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"abort_column_resize", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);

View File

@ -955,7 +955,10 @@ palette_activate (GtkWidget *widget,
gpointer data)
{
/* should have a drawing area subclass with an activate signal */
if ((event->keyval == ' ') || (event->keyval == GDK_Return))
if ((event->keyval == GDK_space) ||
(event->keyval == GDK_Return) ||
(event->keyval == GDK_KP_Enter) ||
(event->keyval == GDK_KP_Space))
{
if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), "color_set")) != 0)
{

View File

@ -176,7 +176,10 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com
GList *li;
/* completion */
if ((event->keyval == GDK_Tab) && (event->state & GDK_MOD1_MASK))
if ((event->keyval == GDK_Tab ||
event->keyval == GDK_ISO_Left_Tab ||
event->keyval == GDK_KP_Tab) &&
(event->state & GDK_MOD1_MASK))
{
GtkEditable *editable = GTK_EDITABLE (entry);
GCompletion * cmpl;

View File

@ -474,36 +474,45 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set,
'+', GDK_SHIFT_MASK,
GDK_plus, GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
'+', 0,
GDK_plus, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
'+', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
GDK_plus, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'+', GDK_CONTROL_MASK,
GDK_plus, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'-', 0,
GDK_minus, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
gtk_binding_entry_add_signal (binding_set,
'-', GDK_CONTROL_MASK,
GDK_minus, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE);
@ -517,22 +526,39 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'=', 0,
GDK_equal, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
'=', GDK_SHIFT_MASK,
GDK_KP_Equal, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_equal, GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Equal, GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_asterisk, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
GDK_asterisk, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE);
}
static void

View File

@ -33,11 +33,10 @@
#include "gdkkeysyms.h"
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkbindings.h"
static void gtk_dialog_class_init (GtkDialogClass *klass);
static void gtk_dialog_init (GtkDialog *dialog);
static gint gtk_dialog_key_press (GtkWidget *widget,
GdkEventKey *key);
static void gtk_dialog_add_buttons_valist (GtkDialog *dialog,
const gchar *first_button_text,
@ -58,6 +57,8 @@ static void gtk_dialog_get_property (GObject *object,
static void gtk_dialog_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gtk_dialog_close (GtkDialog *dialog);
enum {
PROP_0,
PROP_HAS_SEPARATOR
@ -65,6 +66,7 @@ enum {
enum {
RESPONSE,
CLOSE,
LAST_SIGNAL
};
@ -102,18 +104,20 @@ gtk_dialog_class_init (GtkDialogClass *class)
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkBindingSet *binding_set;
gobject_class = G_OBJECT_CLASS (class);
object_class = GTK_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = gtk_dialog_set_property;
gobject_class->get_property = gtk_dialog_get_property;
widget_class->key_press_event = gtk_dialog_key_press;
widget_class->style_set = gtk_dialog_style_set;
class->close = gtk_dialog_close;
g_object_class_install_property (gobject_class,
PROP_HAS_SEPARATOR,
@ -132,6 +136,14 @@ gtk_dialog_class_init (GtkDialogClass *class)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
dialog_signals[CLOSE] =
gtk_signal_new ("close",
GTK_RUN_LAST | GTK_RUN_ACTION,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkDialogClass, close),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("content_area_border",
_("Content area border"),
@ -157,6 +169,11 @@ gtk_dialog_class_init (GtkDialogClass *class)
G_MAXINT,
5,
G_PARAM_READABLE));
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"close", 0);
}
static void
@ -277,32 +294,6 @@ gtk_dialog_delete_event_handler (GtkWidget *widget,
return FALSE;
}
static gint
gtk_dialog_key_press (GtkWidget *widget,
GdkEventKey *key)
{
GdkEventAny event;
event.type = GDK_DELETE;
event.window = widget->window;
event.send_event = TRUE;
if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, key))
return TRUE;
if (key->keyval != GDK_Escape)
return FALSE;
/* Synthesize delete_event to close dialog. */
g_object_ref (G_OBJECT (event.window));
gtk_main_do_event ((GdkEvent*)&event);
g_object_unref (G_OBJECT (event.window));
return TRUE;
}
static void
gtk_dialog_style_set (GtkWidget *widget,
GtkStyle *prev_style)
@ -310,6 +301,27 @@ gtk_dialog_style_set (GtkWidget *widget,
update_spacings (GTK_DIALOG (widget));
}
static void
gtk_dialog_close (GtkDialog *dialog)
{
/* Synthesize delete_event to close dialog. */
GdkEventAny event;
GtkWidget *widget;
widget = GTK_WIDGET (dialog);
event.type = GDK_DELETE;
event.window = widget->window;
event.send_event = TRUE;
g_object_ref (G_OBJECT (event.window));
gtk_main_do_event ((GdkEvent*)&event);
g_object_unref (G_OBJECT (event.window));
}
GtkWidget*
gtk_dialog_new (void)
{

View File

@ -109,6 +109,10 @@ struct _GtkDialogClass
GtkWindowClass parent_class;
void (* response) (GtkDialog *dialog, gint response_id);
/* Keybinding signals */
void (* close) (GtkDialog *dialog);
};

View File

@ -698,10 +698,17 @@ gtk_entry_class_init (GtkEntryClass *class)
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_MOD1_MASK,
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_MOD1_MASK,
"insert_at_cursor", 1,
GTK_TYPE_STRING, " ");
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_MOD1_MASK,
"insert_at_cursor", 1,
GTK_TYPE_STRING, " ");
gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_MOD1_MASK,
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
@ -727,6 +734,8 @@ gtk_entry_class_init (GtkEntryClass *class)
/* Overwrite */
gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0,
"toggle_overwrite", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0,
"toggle_overwrite", 0);
}
static void

View File

@ -1416,7 +1416,9 @@ gtk_file_selection_key_press (GtkWidget *widget,
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->keyval == GDK_Tab)
if (event->keyval == GDK_Tab ||
event->keyval == GDK_ISO_Left_Tab ||
event->keyval == GDK_KP_Tab)
{
fs = GTK_FILE_SELECTION (user_data);
#ifdef G_WITH_CYGWIN

View File

@ -1154,7 +1154,9 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
if ((event->state & (ISO_14755_MOD_MASK)) == ISO_14755_MOD_MASK)
{
/* space ends the sequence, and we eat the space */
if (n_compose > 1 && event->keyval == GDK_space)
if (n_compose > 1 &&
(event->keyval == GDK_space ||
event->keyval == GDK_KP_Space))
{
gtk_im_context_simple_commit_char (context, context_simple->tentative_match);
context_simple->compose_buffer[0] = 0;

View File

@ -1250,8 +1250,8 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
if (type_id == quark_type_stock_item)
{
image = gtk_image_new_from_stock (entry->extra_data, GTK_ICON_SIZE_MENU);
if (image)
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image);
if (gtk_stock_lookup (entry->extra_data, &stock_item))
{

View File

@ -207,78 +207,152 @@ gtk_list_item_class_init (GtkListItemClass *class)
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);

View File

@ -32,6 +32,7 @@ BOOLEAN:BOOLEAN
ENUM:ENUM
INT:POINTER
NONE:BOOL
NONE:ENUM
NONE:INT
NONE:INT,INT
NONE:NONE

View File

@ -32,6 +32,7 @@ BOOLEAN:BOOLEAN
ENUM:ENUM
INT:POINTER
NONE:BOOL
NONE:ENUM
NONE:INT
NONE:INT,INT
NONE:NONE

View File

@ -186,21 +186,41 @@ gtk_menu_class_init (GtkMenuClass *class)
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PREV);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Up, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PREV);
gtk_binding_entry_add_signal (binding_set,
GDK_Down, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_NEXT);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Down, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_NEXT);
gtk_binding_entry_add_signal (binding_set,
GDK_Left, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PARENT);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Left, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PARENT);
gtk_binding_entry_add_signal (binding_set,
GDK_Right, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_CHILD);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Right, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_CHILD);
}
static gboolean

View File

@ -106,22 +106,42 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PREV);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Left, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PREV);
gtk_binding_entry_add_signal (binding_set,
GDK_Right, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_NEXT);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Right, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_NEXT);
gtk_binding_entry_add_signal (binding_set,
GDK_Up, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PARENT);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Up, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_PARENT);
gtk_binding_entry_add_signal (binding_set,
GDK_Down, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_CHILD);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Down, 0,
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_CHILD);
gtk_settings_install_property (gtk_settings_get_global (),
g_param_spec_string ("gtk-menu-bar-accel",
_("Menu bar accelerator"),

View File

@ -261,11 +261,21 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
"activate_current", 1,
GTK_TYPE_BOOL,
TRUE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Enter, 0,
"activate_current", 1,
GTK_TYPE_BOOL,
TRUE);
gtk_binding_entry_add_signal (binding_set,
GDK_space, 0,
"activate_current", 1,
GTK_TYPE_BOOL,
FALSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Space, 0,
"activate_current", 1,
GTK_TYPE_BOOL,
FALSE);
}
static GtkType

View File

@ -474,6 +474,11 @@ gtk_notebook_class_init (GtkNotebookClass *class)
GDK_space, 0,
"select_page", 1,
G_TYPE_BOOLEAN, FALSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Space, 0,
"select_page", 1,
G_TYPE_BOOLEAN, FALSE);
gtk_binding_entry_add_signal (binding_set,
GDK_Home, 0,
"focus_tab", 1,

View File

@ -606,6 +606,7 @@ gtk_option_menu_key_press (GtkWidget *widget,
switch (event->keyval)
{
case GDK_KP_Space:
case GDK_space:
gtk_option_menu_remove_contents (option_menu);
gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL,

View File

@ -1154,7 +1154,8 @@ gtk_spin_button_key_press (GtkWidget *widget,
GtkSpinButton *spin;
gint key;
gboolean key_repeat = FALSE;
gboolean retval = FALSE;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@ -1164,100 +1165,112 @@ gtk_spin_button_key_press (GtkWidget *widget,
key_repeat = (event->time == spin->ev_time);
if (GTK_ENTRY (widget)->editable &&
(key == GDK_Up || key == GDK_Down ||
key == GDK_Page_Up || key == GDK_Page_Down))
gtk_spin_button_update (spin);
switch (key)
if (GTK_ENTRY (widget)->editable)
{
case GDK_Up:
switch (key)
{
case GDK_KP_Up:
case GDK_Up:
if (GTK_WIDGET_HAS_FOCUS (widget))
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget),
"key_press_event");
if (!key_repeat)
spin->timer_step = spin->adjustment->step_increment;
if (GTK_WIDGET_HAS_FOCUS (widget))
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget),
"key_press_event");
if (!key_repeat)
spin->timer_step = spin->adjustment->step_increment;
gtk_spin_button_real_spin (spin, spin->timer_step);
gtk_spin_button_real_spin (spin, spin->timer_step);
if (key_repeat)
{
if (spin->climb_rate > 0.0 && spin->timer_step
< spin->adjustment->page_increment)
{
if (spin->timer_calls < MAX_TIMER_CALLS)
spin->timer_calls++;
else
{
spin->timer_calls = 0;
spin->timer_step += spin->climb_rate;
}
}
}
return TRUE;
}
return FALSE;
if (key_repeat)
{
if (spin->climb_rate > 0.0 && spin->timer_step
< spin->adjustment->page_increment)
{
if (spin->timer_calls < MAX_TIMER_CALLS)
spin->timer_calls++;
else
{
spin->timer_calls = 0;
spin->timer_step += spin->climb_rate;
}
}
}
retval = TRUE;
}
break;
case GDK_Down:
case GDK_KP_Down:
case GDK_Down:
if (GTK_WIDGET_HAS_FOCUS (widget))
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget),
"key_press_event");
if (!key_repeat)
spin->timer_step = spin->adjustment->step_increment;
if (GTK_WIDGET_HAS_FOCUS (widget))
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget),
"key_press_event");
if (!key_repeat)
spin->timer_step = spin->adjustment->step_increment;
gtk_spin_button_real_spin (spin, -spin->timer_step);
gtk_spin_button_real_spin (spin, -spin->timer_step);
if (key_repeat)
{
if (spin->climb_rate > 0.0 && spin->timer_step
< spin->adjustment->page_increment)
{
if (spin->timer_calls < MAX_TIMER_CALLS)
spin->timer_calls++;
else
{
spin->timer_calls = 0;
spin->timer_step += spin->climb_rate;
}
}
}
return TRUE;
}
return FALSE;
if (key_repeat)
{
if (spin->climb_rate > 0.0 && spin->timer_step
< spin->adjustment->page_increment)
{
if (spin->timer_calls < MAX_TIMER_CALLS)
spin->timer_calls++;
else
{
spin->timer_calls = 0;
spin->timer_step += spin->climb_rate;
}
}
}
retval = TRUE;
}
break;
case GDK_Page_Up:
case GDK_KP_Page_Up:
case GDK_Page_Up:
if (event->state & GDK_CONTROL_MASK)
{
gdouble diff = spin->adjustment->upper - spin->adjustment->value;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, diff);
}
else
gtk_spin_button_real_spin (spin, spin->adjustment->page_increment);
return TRUE;
if (event->state & GDK_CONTROL_MASK)
{
gdouble diff = spin->adjustment->upper - spin->adjustment->value;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, diff);
}
else
gtk_spin_button_real_spin (spin, spin->adjustment->page_increment);
case GDK_Page_Down:
retval = TRUE;
break;
case GDK_KP_Page_Down:
case GDK_Page_Down:
if (event->state & GDK_CONTROL_MASK)
{
gdouble diff = spin->adjustment->value - spin->adjustment->lower;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, -diff);
}
else
gtk_spin_button_real_spin (spin, -spin->adjustment->page_increment);
return TRUE;
if (event->state & GDK_CONTROL_MASK)
{
gdouble diff = spin->adjustment->value - spin->adjustment->lower;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, -diff);
}
else
gtk_spin_button_real_spin (spin, -spin->adjustment->page_increment);
default:
break;
retval = TRUE;
break;
default:
break;
}
}
return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
if (retval)
{
gtk_spin_button_update (spin);
return TRUE;
}
else
return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
}
static gint

View File

@ -1947,23 +1947,30 @@ gtk_text_key_press (GtkWidget *widget,
{
switch (event->keyval)
{
case GDK_Home:
case GDK_Home:
case GDK_KP_Home:
if (event->state & GDK_CONTROL_MASK)
scroll_int (text, -text->vadj->value);
else
return_val = FALSE;
break;
case GDK_End:
case GDK_KP_End:
if (event->state & GDK_CONTROL_MASK)
scroll_int (text, +text->vadj->upper);
else
return_val = FALSE;
break;
case GDK_KP_Page_Up:
case GDK_Page_Up: scroll_int (text, -text->vadj->page_increment); break;
case GDK_KP_Page_Down:
case GDK_Page_Down: scroll_int (text, +text->vadj->page_increment); break;
case GDK_KP_Up:
case GDK_Up: scroll_int (text, -KEY_SCROLL_PIXELS); break;
case GDK_KP_Down:
case GDK_Down: scroll_int (text, +KEY_SCROLL_PIXELS); break;
case GDK_Return:
case GDK_KP_Enter:
if (event->state & GDK_CONTROL_MASK)
gtk_signal_emit_by_name (GTK_OBJECT (text), "activate");
else
@ -2047,6 +2054,7 @@ gtk_text_key_press (GtkWidget *widget,
case GDK_Clear:
gtk_text_delete_line (text);
break;
case GDK_KP_Insert:
case GDK_Insert:
if (event->state & GDK_SHIFT_MASK)
{
@ -2076,6 +2084,7 @@ gtk_text_key_press (GtkWidget *widget,
break;
case GDK_Tab:
case GDK_ISO_Left_Tab:
case GDK_KP_Tab:
position = text->point.index;
gtk_editable_insert_text (GTK_EDITABLE (old_editable), "\t", 1, &position);
break;

View File

@ -715,9 +715,15 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
add_move_binding (binding_set, GDK_Right, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
add_move_binding (binding_set, GDK_KP_Right, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
add_move_binding (binding_set, GDK_Left, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
add_move_binding (binding_set, GDK_KP_Left, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
add_move_binding (binding_set, GDK_f, GDK_CONTROL_MASK,
GTK_MOVEMENT_LOGICAL_POSITIONS, 1);
@ -727,16 +733,28 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK,
GTK_MOVEMENT_WORDS, 1);
add_move_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK,
GTK_MOVEMENT_WORDS, 1);
add_move_binding (binding_set, GDK_Left, GDK_CONTROL_MASK,
GTK_MOVEMENT_WORDS, -1);
add_move_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK,
GTK_MOVEMENT_WORDS, 1);
/* Eventually we want to move by display lines, not paragraphs */
add_move_binding (binding_set, GDK_Up, 0,
GTK_MOVEMENT_DISPLAY_LINES, -1);
add_move_binding (binding_set, GDK_KP_Up, 0,
GTK_MOVEMENT_DISPLAY_LINES, -1);
add_move_binding (binding_set, GDK_Down, 0,
GTK_MOVEMENT_DISPLAY_LINES, 1);
add_move_binding (binding_set, GDK_KP_Down, 0,
GTK_MOVEMENT_DISPLAY_LINES, 1);
add_move_binding (binding_set, GDK_p, GDK_CONTROL_MASK,
GTK_MOVEMENT_DISPLAY_LINES, -1);
@ -758,26 +776,45 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
add_move_binding (binding_set, GDK_Home, 0,
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
add_move_binding (binding_set, GDK_KP_Home, 0,
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
add_move_binding (binding_set, GDK_End, 0,
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
add_move_binding (binding_set, GDK_KP_End, 0,
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
add_move_binding (binding_set, GDK_Home, GDK_CONTROL_MASK,
GTK_MOVEMENT_BUFFER_ENDS, -1);
add_move_binding (binding_set, GDK_KP_Home, GDK_CONTROL_MASK,
GTK_MOVEMENT_BUFFER_ENDS, -1);
add_move_binding (binding_set, GDK_End, GDK_CONTROL_MASK,
GTK_MOVEMENT_BUFFER_ENDS, 1);
add_move_binding (binding_set, GDK_KP_End, GDK_CONTROL_MASK,
GTK_MOVEMENT_BUFFER_ENDS, 1);
add_move_binding (binding_set, GDK_Page_Up, 0,
GTK_MOVEMENT_PAGES, -1);
add_move_binding (binding_set, GDK_KP_Page_Up, 0,
GTK_MOVEMENT_PAGES, -1);
add_move_binding (binding_set, GDK_Page_Down, 0,
GTK_MOVEMENT_PAGES, 1);
add_move_binding (binding_set, GDK_KP_Page_Down, 0,
GTK_MOVEMENT_PAGES, 1);
/* Setting the cut/paste/copy anchor */
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"set_anchor", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK,
"set_anchor", 0);
/* Deleting text */
gtk_binding_entry_add_signal (binding_set, GDK_Delete, 0,
"delete_from_cursor", 2,
@ -833,10 +870,17 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_MOD1_MASK,
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_MOD1_MASK,
"insert_at_cursor", 1,
GTK_TYPE_STRING, " ");
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_MOD1_MASK,
"insert_at_cursor", 1,
GTK_TYPE_STRING, " ");
gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_MOD1_MASK,
"delete_from_cursor", 2,
GTK_TYPE_ENUM, GTK_DELETE_WHITESPACE,
@ -862,6 +906,8 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
/* Overwrite */
gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0,
"toggle_overwrite", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0,
"toggle_overwrite", 0);
}
void
@ -2168,7 +2214,7 @@ gtk_text_view_set_property (GObject *object,
case PROP_WRAP_MODE:
gtk_text_view_set_wrap_mode (text_view, g_value_get_enum (value));
break;
case PROP_JUSTIFICATION:
gtk_text_view_set_justification (text_view, g_value_get_enum (value));
break;
@ -3135,7 +3181,10 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
retval = TRUE;
}
/* Pass through Tab as literal tab, unless Control is held down */
else if (event->keyval == GDK_Tab && !(event->state & GDK_CONTROL_MASK))
else if ((event->keyval == GDK_Tab ||
event->keyval == GDK_KP_Tab ||
event->keyval == GDK_ISO_Left_Tab) &&
!(event->state & GDK_CONTROL_MASK))
{
gtk_text_buffer_insert_interactive_at_cursor (get_buffer (text_view), "\t", 1,
text_view->editable);
@ -3682,6 +3731,12 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
return;
#endif
if (text_view->layout == NULL)
return;
if (!text_view->cursor_visible)
return;
if (text_view->layout != NULL &&
text_view->cursor_visible &&
GTK_WIDGET_HAS_FOCUS (text_view))

View File

@ -285,17 +285,6 @@ gtk_tooltips_set_tip (GtkTooltips *tooltips,
}
}
void
gtk_tooltips_set_colors (GtkTooltips *tooltips,
GdkColor *background,
GdkColor *foreground)
{
g_return_if_fail (tooltips != NULL);
g_warning ("gtk_tooltips_set_colors is deprecated and does nothing.\n"
"The colors for tooltips are now taken from the style.");
}
static gint
gtk_tooltips_paint_window (GtkTooltips *tooltips)
{
@ -521,3 +510,25 @@ gtk_tooltips_widget_remove (GtkWidget *widget,
tooltipsdata);
gtk_tooltips_destroy_data (tooltipsdata);
}
void
_gtk_tooltips_show_tip (GtkWidget *widget)
{
/* Showing the tip from the keyboard */
/* FIXME this function is completely broken right now,
* popdown doesn't occur when it should.
*/
GtkTooltipsData *tooltipsdata;
tooltipsdata = gtk_tooltips_data_get (widget);
if (tooltipsdata == NULL)
return;
gtk_tooltips_set_active_widget (tooltipsdata->tooltips,
widget);
gtk_tooltips_timeout (tooltipsdata->tooltips);
}

View File

@ -66,6 +66,7 @@ struct _GtkTooltips
guint delay : 30;
guint enabled : 1;
guint have_grab : 1;
gint timer_tag;
gboolean use_sticky_delay;
GTimeVal last_popdown;
@ -87,13 +88,11 @@ void gtk_tooltips_set_tip (GtkTooltips *tooltips,
GtkWidget *widget,
const gchar *tip_text,
const gchar *tip_private);
void gtk_tooltips_set_colors (GtkTooltips *tooltips,
GdkColor *background,
GdkColor *foreground);
GtkTooltipsData* gtk_tooltips_data_get (GtkWidget *widget);
void gtk_tooltips_force_window (GtkTooltips *tooltips);
void _gtk_tooltips_show_tip (GtkWidget *widget);
#ifdef __cplusplus
}

View File

@ -47,6 +47,7 @@
#include "gdk/gdkkeysyms.h"
#include "gtkintl.h"
#include "gtkaccessible.h"
#include "gtktooltips.h"
#define WIDGET_CLASS(w) GTK_WIDGET_GET_CLASS (w)
#define INIT_PATH_SIZE (512)
@ -112,6 +113,7 @@ enum {
VISIBILITY_NOTIFY_EVENT,
WINDOW_STATE_EVENT,
POPUP_MENU,
SHOW_HELP,
LAST_SIGNAL
};
@ -176,7 +178,11 @@ static void gtk_widget_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_widget_direction_changed (GtkWidget *widget,
GtkTextDirection previous_direction);
static void gtk_widget_real_grab_focus (GtkWidget *focus_widget);
static void gtk_widget_real_show_help (GtkWidget *widget,
GtkWidgetHelpType help_type);
static void gtk_widget_dispatch_child_properties_changed (GtkWidget *object,
guint n_pspecs,
GParamSpec **pspecs);
@ -214,7 +220,6 @@ static AtkObject* gtk_widget_real_get_accessible (GtkWidget *widget);
static void gtk_widget_accessible_interface_init (AtkImplementorIface *iface);
static AtkObject* gtk_widget_ref_accessible (AtkImplementor *implementor);
/* --- variables --- */
static gpointer parent_class = NULL;
static guint widget_signals[LAST_SIGNAL] = { 0 };
@ -226,6 +231,7 @@ static GSList *style_stack = NULL;
static guint composite_child_stack = 0;
static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
static GParamSpecPool *style_property_spec_pool = NULL;
static GQuark quark_property_parser = 0;
static GQuark quark_aux_info = 0;
static GQuark quark_event_mask = 0;
@ -240,7 +246,6 @@ static GQuark quark_accessible_object = 0;
GParamSpecPool *_gtk_widget_child_property_pool = NULL;
GObjectNotifyContext *_gtk_widget_child_property_notify_context = NULL;
/* --- functions --- */
GtkType
gtk_widget_get_type (void)
@ -378,7 +383,12 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->drag_motion = NULL;
klass->drag_drop = NULL;
klass->drag_data_received = NULL;
klass->get_accessible = gtk_widget_real_get_accessible; /* Accessibility support */
klass->show_help = gtk_widget_real_show_help;
/* Accessibility support */
klass->get_accessible = gtk_widget_real_get_accessible;
klass->no_expose_event = NULL;
g_object_class_install_property (gobject_class,
@ -1021,6 +1031,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, popup_menu),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
widget_signals[SHOW_HELP] =
gtk_signal_new ("show_help",
GTK_RUN_LAST | GTK_RUN_ACTION,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkWidgetClass, show_help),
gtk_marshal_NONE__ENUM,
GTK_TYPE_NONE, 1, GTK_TYPE_WIDGET_HELP_TYPE);
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_F10, GDK_SHIFT_MASK,
@ -1028,6 +1045,24 @@ gtk_widget_class_init (GtkWidgetClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_Menu, 0,
"popup_menu", 0);
gtk_binding_entry_add_signal (binding_set, GDK_F1, GDK_CONTROL_MASK,
"show_help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GTK_WIDGET_HELP_TOOLTIP);
gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, GDK_CONTROL_MASK,
"show_help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GTK_WIDGET_HELP_TOOLTIP);
gtk_binding_entry_add_signal (binding_set, GDK_F1, GDK_SHIFT_MASK,
"show_help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GTK_WIDGET_HELP_WHATS_THIS);
gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, GDK_SHIFT_MASK,
"show_help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GTK_WIDGET_HELP_WHATS_THIS);
gtk_widget_class_install_style_property (klass,
g_param_spec_boolean ("interior_focus",
_("Interior Focus"),
@ -3094,6 +3129,14 @@ gtk_widget_real_grab_focus (GtkWidget *focus_widget)
}
}
static void
gtk_widget_real_show_help (GtkWidget *widget,
GtkWidgetHelpType help_type)
{
if (help_type == GTK_WIDGET_HELP_TOOLTIP)
_gtk_tooltips_show_tip (widget);
}
static gboolean
gtk_widget_real_focus (GtkWidget *widget,
GtkDirectionType direction)
@ -3110,7 +3153,6 @@ gtk_widget_real_focus (GtkWidget *widget,
return FALSE;
}
/**
* gtk_widget_is_focus:
* @widget: a #GtkWidget

View File

@ -78,6 +78,13 @@ typedef enum
GTK_DOUBLE_BUFFERED = 1 << 21
} GtkWidgetFlags;
/* Kinds of widget-specific help */
typedef enum
{
GTK_WIDGET_HELP_TOOLTIP,
GTK_WIDGET_HELP_WHATS_THIS
} GtkWidgetHelpType;
/* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
* Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
*/
@ -391,7 +398,14 @@ struct _GtkWidgetClass
/* Signals used only for keybindings */
void (* popup_menu) (GtkWidget *widget);
/* If a widget has multiple tooltips/whatsthis, it should show the
* one for the current focus location, or if that doesn't make
* sense, should cycle through them showing each tip alongside
* whatever piece of the widget it applies to.
*/
void (* show_help) (GtkWidget *widget,
GtkWidgetHelpType help_type);
/* accessibility support
*/

View File

@ -476,7 +476,9 @@ gtk_window_class_init (GtkWindowClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"activate_focus", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
"activate_focus", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
"activate_default", 0);
@ -514,6 +516,9 @@ gtk_window_class_init (GtkWindowClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_Tab, 0,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, 0,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Left_Tab, 0,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
@ -521,6 +526,9 @@ gtk_window_class_init (GtkWindowClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_SHIFT_MASK,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_SHIFT_MASK,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Left_Tab, GDK_SHIFT_MASK,
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);