diff options
author | Alberto Garcia <agarcia@igalia.com> | 2009-09-30 12:50:03 +0200 |
---|---|---|
committer | Alberto Garcia <agarcia@igalia.com> | 2009-10-15 11:53:06 +0200 |
commit | 89f916029d774160b4e55d5f97c57b61e4d378a3 (patch) | |
tree | f036d43f034d93c8a6167eca111f1936209a5d96 | |
parent | ec59e26097011486873d33302aa41407ca5df224 (diff) |
New API to enable/disable the zoom keys
Fixes: NB#141240 (New API: hildon_gtk_window_enable_zoom_keys())
-rw-r--r-- | doc/hildon-sections.txt | 1 | ||||
-rw-r--r-- | hildon/hildon-gtk.c | 32 | ||||
-rw-r--r-- | hildon/hildon-gtk.h | 5 |
3 files changed, 38 insertions, 0 deletions
diff --git a/doc/hildon-sections.txt b/doc/hildon-sections.txt index 7f09abb..2c7ffc1 100644 --- a/doc/hildon-sections.txt +++ b/doc/hildon-sections.txt @@ -1249,6 +1249,7 @@ hildon_gtk_window_set_do_not_disturb hildon_gtk_window_set_progress_indicator hildon_gtk_window_take_screenshot hildon_gtk_window_set_portrait_flags +hildon_gtk_window_enable_zoom_keys hildon_gtk_hscale_new hildon_gtk_vscale_new <SUBSECTION Standard> diff --git a/hildon/hildon-gtk.c b/hildon/hildon-gtk.c index 9fda66f..f67f830 100644 --- a/hildon/hildon-gtk.c +++ b/hildon/hildon-gtk.c @@ -344,6 +344,17 @@ do_set_do_not_disturb (GtkWindow *window, } static void +do_set_zoom_keys (GtkWindow *window, + gpointer zoomptr) +{ + gboolean zoomflag = GPOINTER_TO_INT (zoomptr); + hildon_gtk_window_set_clear_window_flag (window, "_HILDON_ZOOM_KEY_ATOM", + XA_INTEGER, zoomflag); + g_signal_handlers_disconnect_matched (window, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, do_set_zoom_keys, NULL); +} + +static void do_set_portrait_flags (GtkWindow *window, gpointer flagsptr) { @@ -420,6 +431,27 @@ hildon_gtk_window_set_portrait_flags (GtkWindow *window, } /** + * hildon_gtk_window_enable_zoom_keys: + * @window: a #GtkWindow + * @enable: %TRUE to let the window use the zoom keys + * + * Use this function with @enable set to %TRUE to make the window + * receive events from the zoom keys (#HILDON_HARDKEY_DECREASE and + * #HILDON_HARDKEY_INCREASE). + * + * If set to %FALSE, those keys will be reserved for the system to + * control things such as the volume level. + * + * Since: 2.2.2 + **/ +void +hildon_gtk_window_enable_zoom_keys (GtkWindow *window, + gboolean enable) +{ + hildon_gtk_window_set_flag (window, (HildonFlagFunc) do_set_zoom_keys, GUINT_TO_POINTER (enable)); +} + +/** * hildon_gtk_window_take_screenshot: * @window: a #GtkWindow * @take: %TRUE to take a screenshot, %FALSE to destroy the existing one. diff --git a/hildon/hildon-gtk.h b/hildon/hildon-gtk.h index 49b3d46..37efe4d 100644 --- a/hildon/hildon-gtk.h +++ b/hildon/hildon-gtk.h @@ -102,6 +102,11 @@ hildon_gtk_window_set_portrait_flags (GtkWindow *window, void hildon_gtk_window_take_screenshot (GtkWindow *window, gboolean take); + +void +hildon_gtk_window_enable_zoom_keys (GtkWindow *window, + gboolean enable); + GtkWidget* hildon_gtk_hscale_new (void); |