[maemo-commits] [maemo-commits] r11114 - in projects/haf/trunk/hildon-desktop: . libhildonwm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Apr 17 18:15:34 EEST 2007
- Previous message: [maemo-commits] r11113 - in projects/haf/trunk/hildon-1: . src
- Next message: [maemo-commits] r11115 - in projects/haf/trunk/hildon-theme-test: . debian wallpaper
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: moimart
Date: 2007-04-17 18:15:32 +0300 (Tue, 17 Apr 2007)
New Revision: 11114
Modified:
projects/haf/trunk/hildon-desktop/ChangeLog
projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.c
projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.h
projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h
Log:
* libhildonwm/hd-keys.[ch]:
- Added new actions as stubs.
* libhildonwm/hd-wm.[ch]:
- Implemented switching among windows from the same application.
* ChangeLog updated.
Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog 2007-04-17 14:14:16 UTC (rev 11113)
+++ projects/haf/trunk/hildon-desktop/ChangeLog 2007-04-17 15:15:32 UTC (rev 11114)
@@ -1,3 +1,10 @@
+2007-04-17 Moises Martinez <moises.martinez at nokia.com>
+
+ * libhildonwm/hd-keys.[ch]:
+ - Added new actions as stubs.
+ * libhildonwm/hd-wm.[ch]:
+ - Implemented switching among windows from the same application.
+
2007-04-17 Lucas Rocha <lucas.rocha at nokia.com>
* debian/control: build dependency on hildon-1 or hildon-libs to be
Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.c 2007-04-17 14:14:16 UTC (rev 11113)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.c 2007-04-17 15:15:32 UTC (rev 11114)
@@ -123,6 +123,15 @@
}
static void
+hd_keys_switch_window (HDKeysConfig *keys,
+ gpointer *user_data)
+{
+ HDWM *hdwm = hd_wm_get_singleton ();
+
+ hd_wm_switch_instance_current_window (hdwm,GPOINTER_TO_INT (user_data));
+}
+
+static void
hd_keys_action_minimize (HDKeysConfig *keys,
gpointer *user_data)
{
@@ -219,10 +228,18 @@
hd_keys_action_send_key, (gpointer)XK_F7 },
{ HD_KEYS_GCONF_PATH "/zoom_out", HD_KEY_ACTION_ZOOM_OUT,
hd_keys_action_send_key, (gpointer)XK_F8 },
+ { HD_KEYS_GCONF_PATH "/switch_window_prev", HD_KEY_ACTION_SWITCH_WINDOW_PREV,
+ hd_keys_switch_window, GINT_TO_POINTER (FALSE) },
+ { HD_KEYS_GCONF_PATH "/switch_window_next", HD_KEY_ACTION_SWITCH_WINDOW_NEXT,
+ hd_keys_switch_window, GINT_TO_POINTER (TRUE) },
+ /*{ HD_KEYS_GCONF_PATH "/launch_application", HD_KEY_ACTION_APPLICATION,
+ hd_keys_launch_application, NULL },*/
{ NULL, 0, NULL, NULL }
};
+
+
static gboolean
hd_keys_keysym_needs_shift (KeySym keysym)
{
Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.h 2007-04-17 14:14:16 UTC (rev 11113)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-keys.h 2007-04-17 15:15:32 UTC (rev 11114)
@@ -54,6 +54,9 @@
HD_KEY_ACTION_FULLSCREEN,
HD_KEY_ACTION_ZOOM_IN,
HD_KEY_ACTION_ZOOM_OUT,
+ HD_KEY_ACTION_SWITCH_WINDOW_PREV,
+ HD_KEY_ACTION_SWITCH_WINDOW_NEXT,
+ HD_KEY_ACTION_APPLICATION
}
HDKeyAction;
Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c 2007-04-17 14:14:16 UTC (rev 11113)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c 2007-04-17 15:15:32 UTC (rev 11114)
@@ -3139,3 +3139,78 @@
XFree (work_area_data);
}
}
+
+void
+hd_wm_switch_application_window (HDWM *hdwm,
+ HDWMWatchableApp *app,
+ gboolean to_next)
+{
+ HDEntryInfo *app_info;
+
+ g_return_if_fail (app != NULL);
+
+ app_info = hd_wm_watchable_app_get_info (app);
+
+ hd_wm_switch_info_window (hdwm,app_info,to_next);
+}
+
+void
+hd_wm_switch_info_window (HDWM *hdwm, HDEntryInfo *app_info, gboolean to_next)
+{
+ HDEntryInfo *info = NULL;
+ HDWMWatchedWindow *window;
+ const GList *list = NULL, *iter, *next_entry, *prev_entry;
+
+ g_return_if_fail (app_info != NULL);
+
+ if (app_info == hdwm->priv->home_info)
+ return;
+
+ list = hd_entry_info_get_children (app_info);
+
+ for (iter = list; iter != NULL; iter = g_list_next (iter))
+ {
+ window = hd_entry_info_get_window ((HDEntryInfo *)iter->data);
+
+ if (window == hdwm->priv->active_window)
+ {
+ info = NULL;
+
+ if (to_next)
+ {
+ next_entry = iter->next;
+ prev_entry = iter->prev;
+ }
+ else
+ {
+ next_entry = iter->prev;
+ prev_entry = iter->next;
+ }
+
+ if (next_entry)
+ info = (HDEntryInfo *) next_entry->data;
+ else
+ if (prev_entry)
+ info = (HDEntryInfo *) prev_entry->data;
+
+ if (info)
+ {
+ hd_wm_top_item (info);
+ g_signal_emit_by_name (hdwm,"entry_info_stack_changed",info);
+ break;
+ }
+ }
+ }
+}
+
+void
+hd_wm_switch_instance_current_window (HDWM *hdwm, gboolean to_next)
+{
+ if (!hdwm->priv->active_window)
+ return;
+
+ hd_wm_switch_info_window
+ (hdwm,
+ hd_entry_info_get_parent (hd_wm_watched_window_peek_info (hdwm->priv->active_window)),
+ to_next);
+}
Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h 2007-04-17 14:14:16 UTC (rev 11113)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h 2007-04-17 15:15:32 UTC (rev 11114)
@@ -286,6 +286,15 @@
hd_wm_activate_service (const gchar *service_name,
const gchar *launch_parameters);
+void
+hd_wm_switch_application_window (HDWM *hdwm, HDWMWatchableApp *app, gboolean to_next);
+
+void
+hd_wm_switch_info_window (HDWM *hdwm, HDEntryInfo *entry_info, gboolean to_next);
+
+void
+hd_wm_switch_instance_current_window (HDWM *hdwm, gboolean to_next);
+
/*
* These are simple getters/setters that replace direct use of global
* hnwm->something. In order to ensure that we do not incure performance
@@ -293,7 +302,6 @@
* 'extern inline'; this ensures that these functions will always be inlined.
*/
-
extern inline Atom
hd_wm_get_atom(gint indx);
- Previous message: [maemo-commits] r11113 - in projects/haf/trunk/hildon-1: . src
- Next message: [maemo-commits] r11115 - in projects/haf/trunk/hildon-theme-test: . debian wallpaper
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
