diff -ur orig/hildon-desktop-2.2.100/src/home/hd-home.c hildon-desktop-2.2.100/src/home/hd-home.c --- orig/hildon-desktop-2.2.100/src/home/hd-home.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/home/hd-home.c 2009-12-27 23:29:37.000000000 +0200 @@ -523,9 +523,23 @@ guint32 unicode; unsigned pretend_fn; + if (hd_render_manager_get_state()==HDRM_STATE_LAUNCHER) { + hd_render_manager_set_state(HDRM_STATE_HOME); +// hd_launcher_activate(0); + return; + } + if (STATE_NO_CALL_FROM_HOME (hd_render_manager_get_state ())) return; + if (xev->keycode==113) { + hd_home_view_container_scroll_to_previous (HD_HOME_VIEW_CONTAINER (priv->view_container), 20); + return ; + } + if (xev->keycode==114) { + hd_home_view_container_scroll_to_next (HD_HOME_VIEW_CONTAINER (priv->view_container), 20); + return ; + } /* g_debug ("%s, display: %p, keymap: %p", __FUNCTION__, display, keymap); */ pretend_fn = priv->fn_state != FN_STATE_NONE ? FN_MODIFIER : 0; diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.c hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.c --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.c 2009-12-27 21:30:00.000000000 +0200 @@ -921,3 +921,15 @@ { return TRUE; } + +void hd_launcher_grid_activate(ClutterActor *actor, int p) +{ + HdLauncherGridPrivate *priv = HD_LAUNCHER_GRID_GET_PRIVATE (actor); + GList *l; + l=priv->tiles; + while((p>0) && l) { + l=l->next; + p--; + } + if(l) hd_launcher_tile_activate(l->data); +} diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.h hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.h --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.h 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-grid.h 2009-12-27 20:34:14.000000000 +0200 @@ -74,6 +74,8 @@ float amount); void hd_launcher_grid_reset(HdLauncherGrid *grid); +void hd_launcher_grid_activate(ClutterActor *actor, int p); + /* Fixed sizes */ #define HD_LAUNCHER_GRID_MIN_HEIGHT \ (HD_LAUNCHER_PAGE_HEIGHT - HD_LAUNCHER_PAGE_YMARGIN) diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-item.c hildon-desktop-2.2.100/src/launcher/hd-launcher-item.c --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-item.c 2009-10-27 20:44:33.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-item.c 2009-12-27 12:35:30.000000000 +0200 @@ -354,38 +354,39 @@ if (!main_apps) { g_datalist_init (&main_apps); - +#if 0 /* Main application group. */ - g_datalist_set_data (&main_apps, "browser", (gpointer)1); - g_datalist_set_data (&main_apps, "mediaplayer", (gpointer)2); - g_datalist_set_data (&main_apps, "calendar", (gpointer)3); - g_datalist_set_data (&main_apps, "image-viewer", (gpointer)4); - g_datalist_set_data (&main_apps, "osso-addressbook", (gpointer)5); - g_datalist_set_data (&main_apps, "rtcom-call-ui", (gpointer)6); - g_datalist_set_data (&main_apps, "nokia-maps", (gpointer)7); - g_datalist_set_data (&main_apps, "camera-ui", (gpointer)8); - g_datalist_set_data (&main_apps, "modest", (gpointer)9); - g_datalist_set_data (&main_apps, "rtcom-messaging-ui", (gpointer)10); - g_datalist_set_data (&main_apps, "worldclock", (gpointer)11); - g_datalist_set_data (&main_apps, "osso_calculator", (gpointer)12); - g_datalist_set_data (&main_apps, "ovi", (gpointer)13); - g_datalist_set_data (&main_apps, "hildon-control-panel", (gpointer)14); + g_datalist_set_data (&main_apps, "browser", (gpointer)(0*1)); + g_datalist_set_data (&main_apps, "mediaplayer", (gpointer)(0*2)); + g_datalist_set_data (&main_apps, "calendar", (gpointer)(0*3)); + g_datalist_set_data (&main_apps, "image-viewer", (gpointer)(0*4)); + g_datalist_set_data (&main_apps, "osso-addressbook", (gpointer)(0*5)); + g_datalist_set_data (&main_apps, "rtcom-call-ui", (gpointer)(0*6)); + g_datalist_set_data (&main_apps, "nokia-maps", (gpointer)(0*7)); + g_datalist_set_data (&main_apps, "camera-ui", (gpointer)(0*8)); + g_datalist_set_data (&main_apps, "modest", (gpointer)(0*9)); + g_datalist_set_data (&main_apps, "rtcom-messaging-ui", (gpointer)(0*10)); + g_datalist_set_data (&main_apps, "worldclock", (gpointer)(0*11)); + g_datalist_set_data (&main_apps, "osso_calculator", (gpointer)(0*12)); + g_datalist_set_data (&main_apps, "ovi", (gpointer)(0*13)); + g_datalist_set_data (&main_apps, "hildon-control-panel", (gpointer)(0*14)); /* Applications subgroup. */ - g_datalist_set_data (&main_apps, "osso_notes", (gpointer)1); - g_datalist_set_data (&main_apps, "osso_pdfviewer", (gpointer)2); - g_datalist_set_data (&main_apps, "filemanager", (gpointer)3); - g_datalist_set_data (&main_apps, "osso_rss_feed_reader", (gpointer)4); - g_datalist_set_data (&main_apps, "osso_sketch", (gpointer)5); - g_datalist_set_data (&main_apps, "hildon-application-manager", (gpointer)6); - g_datalist_set_data (&main_apps, "maemoblocks", (gpointer)7); - g_datalist_set_data (&main_apps, "chess_startup", (gpointer)8); - g_datalist_set_data (&main_apps, "mahjong_startup", (gpointer)9); - g_datalist_set_data (&main_apps, "osso_lmarbles", (gpointer)10); - g_datalist_set_data (&main_apps, "osso-backup", (gpointer)11); - g_datalist_set_data (&main_apps, "tutorial-launcher", (gpointer)12); - g_datalist_set_data (&main_apps, "osso-xterm", (gpointer)13); - } + g_datalist_set_data (&main_apps, "osso_notes", (gpointer)(0*1)); + g_datalist_set_data (&main_apps, "osso_pdfviewer", (gpointer)(0*2)); + g_datalist_set_data (&main_apps, "filemanager", (gpointer)(0*3)); + g_datalist_set_data (&main_apps, "osso_rss_feed_reader", (gpointer)(0*4)); + g_datalist_set_data (&main_apps, "osso_sketch", (gpointer)(0*5)); + g_datalist_set_data (&main_apps, "hildon-application-manager", (gpointer)(0*6)); + g_datalist_set_data (&main_apps, "maemoblocks", (gpointer)(0*7)); + g_datalist_set_data (&main_apps, "chess_startup", (gpointer)(0*8)); + g_datalist_set_data (&main_apps, "mahjong_startup", (gpointer)(0*9)); + g_datalist_set_data (&main_apps, "osso_lmarbles", (gpointer)(0*10)); + g_datalist_set_data (&main_apps, "osso-backup", (gpointer)(0*11)); + g_datalist_set_data (&main_apps, "tutorial-launcher", (gpointer)(0*12)); + g_datalist_set_data (&main_apps, "osso-xterm", (gpointer)(0*13)); +#endif + } return (guint)g_datalist_get_data (&main_apps, id); } diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-page.c hildon-desktop-2.2.100/src/launcher/hd-launcher-page.c --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-page.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-page.c 2009-12-27 20:31:18.000000000 +0200 @@ -937,3 +937,9 @@ priv = HD_LAUNCHER_PAGE_GET_PRIVATE (page); return priv->drag_distance; } + +void +hd_launcher_page_activate(ClutterActor *actor, int p) { + HdLauncherPagePrivate *priv = HD_LAUNCHER_PAGE_GET_PRIVATE (hd_launcher_get ()); + hd_launcher_grid_activate(priv->grid, p); +} diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-page.h hildon-desktop-2.2.100/src/launcher/hd-launcher-page.h --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-page.h 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-page.h 2009-12-27 20:34:43.000000000 +0200 @@ -87,6 +87,8 @@ void hd_launcher_page_set_drag_distance(HdLauncherPage *page, float d); float hd_launcher_page_get_drag_distance(HdLauncherPage *page); +void hd_launcher_page_activate(ClutterActor *actor, int p); + /* Fixed sizes. * FIXME: These should come from getting the screen size */ diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.c hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.c --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.c 2009-12-27 20:22:28.000000000 +0200 @@ -604,3 +604,9 @@ hd_launcher_tile_set_glow(tile, FALSE); priv->is_pressed = FALSE; } + +void hd_launcher_tile_activate(ClutterActor *actor) +{ + hd_launcher_tile_button_press(actor); + hd_launcher_tile_button_release(actor); +} diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.h hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.h --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.h 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher-tile.h 2009-12-27 20:33:44.000000000 +0200 @@ -76,6 +76,8 @@ void hd_launcher_tile_reset(HdLauncherTile *tile); +void hd_launcher_tile_activate(ClutterActor *actor); + /* Fixed size */ #define HD_LAUNCHER_TILE_HEIGHT (100) #define HD_LAUNCHER_TILE_WIDTH (142) diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher.c hildon-desktop-2.2.100/src/launcher/hd-launcher.c --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher.c 2009-12-27 20:29:25.000000000 +0200 @@ -109,6 +109,9 @@ static gboolean hd_launcher_background_clicked (HdLauncher *self, ClutterButtonEvent *event, gpointer *data); +static gboolean hd_launcher_key_pressed (HdLauncher *self, + ClutterButtonEvent *event, + gpointer *data); static void hd_launcher_populate_tree_starting (HdLauncherTree *tree, gpointer data); static void hd_launcher_populate_tree_finished (HdLauncherTree *tree, @@ -212,6 +215,8 @@ G_CALLBACK(hd_launcher_captured_event_cb), 0); g_signal_connect (self, "button-release-event", G_CALLBACK(hd_launcher_background_clicked), 0); + g_signal_connect (self, "key-pressed-event", + G_CALLBACK(hd_launcher_key_pressed), 0); /* App launch transition */ priv->launch_image = 0; @@ -851,3 +856,22 @@ return TRUE; } + +static gboolean +hd_launcher_key_pressed (HdLauncher *self, + ClutterButtonEvent *event, + gpointer *data) +{ +// HdLauncherPrivate *priv = HD_LAUNCHER_GET_PRIVATE (hd_launcher_get ()); + + hd_launcher_back_button_clicked(0, 0, 0); + + return TRUE; +} + +void +hd_launcher_activate(int p) { + HdLauncherPrivate *priv = HD_LAUNCHER_GET_PRIVATE (hd_launcher_get ()); + hd_launcher_page_activate(priv->active_page, p); +} + diff -ur orig/hildon-desktop-2.2.100/src/launcher/hd-launcher.h hildon-desktop-2.2.100/src/launcher/hd-launcher.h --- orig/hildon-desktop-2.2.100/src/launcher/hd-launcher.h 2009-10-27 20:44:33.000000000 +0200 +++ hildon-desktop-2.2.100/src/launcher/hd-launcher.h 2009-12-27 20:35:31.000000000 +0200 @@ -94,6 +94,8 @@ void hd_launcher_stop_loading_transition (void); +void hd_launcher_activate(int p); + /* left/right/top/bottom margin that is clicked on to go back */ #define HD_LAUNCHER_LEFT_MARGIN (68) /* layout guide F */ #define HD_LAUNCHER_RIGHT_MARGIN (68) /* layout guide F */ diff -ur orig/hildon-desktop-2.2.100/src/main.c hildon-desktop-2.2.100/src/main.c --- orig/hildon-desktop-2.2.100/src/main.c 2009-10-27 20:44:33.000000000 +0200 +++ hildon-desktop-2.2.100/src/main.c 2009-12-26 12:57:31.000000000 +0200 @@ -48,6 +48,7 @@ #include "hd-wm.h" #include "hd-theme.h" #include "hd-util.h" +#include "hd-dbus.h" #include "hd-volume-profile.h" #include "launcher/hd-app-mgr.h" #include "home/hd-render-manager.h" @@ -61,6 +62,8 @@ KEY_ACTION_TOGGLE_NON_COMP_MODE, KEY_ACTION_TAKE_SCREENSHOT, KEY_ACTION_XTERMINAL, + KEY_ACTION_SEND_DBUS, + KEY_ACTION_HOME, }; #ifdef MBWM_DEB_VERSION @@ -215,6 +218,10 @@ /* printf(" ### KEY_ACTION_TOGGLE_SWITCHER ###\n"); */ hd_render_manager_set_state (HDRM_STATE_TASK_NAV); break; + case KEY_ACTION_HOME: + /* printf(" ### KEY_ACTION_HOMRE ###\n"); */ + hd_render_manager_set_state (HDRM_STATE_HOME); + break; case KEY_ACTION_TOGGLE_NON_COMP_MODE: /* printf(" ### KEY_ACTION_TOGGLE_NON_COMP_MODE ###\n"); */ if (hd_render_manager_get_state () == HDRM_STATE_NON_COMPOSITED) @@ -239,6 +246,19 @@ break; } } +static void +key_binding_func_key (MBWindowManager *wm, + MBWMKeyBinding *binding, + void *userdata) +{ + int action; + char s[32]; + + action = (int)(userdata); + sprintf(s,"%i",action); + + hd_dbus_send_event (s); +} static ClutterX11FilterReturn clutter_x11_event_filter (XEvent *xev, ClutterEvent *cev, gpointer data) @@ -558,6 +578,11 @@ NULL, (void*)KEY_ACTION_TOGGLE_SWITCHER); mb_wm_keys_binding_add_with_spec (wm, + "h", + key_binding_func, + NULL, + (void*)KEY_ACTION_HOME); + mb_wm_keys_binding_add_with_spec (wm, "x", key_binding_func, NULL, @@ -573,6 +598,137 @@ NULL, (void*)KEY_ACTION_TAKE_SCREENSHOT); + mb_wm_keys_binding_add_with_spec (wm, + "a", + key_binding_func_key, + NULL, + (void*)(192+1)); + mb_wm_keys_binding_add_with_spec (wm, + "b", + key_binding_func_key, + NULL, + (void*)(192+2)); + mb_wm_keys_binding_add_with_spec (wm, + "c", + key_binding_func_key, + NULL, + (void*)(192+3)); + mb_wm_keys_binding_add_with_spec (wm, + "d", + key_binding_func_key, + NULL, + (void*)(192+4)); + mb_wm_keys_binding_add_with_spec (wm, + "e", + key_binding_func_key, + NULL, + (void*)(192+5)); + mb_wm_keys_binding_add_with_spec (wm, + "f", + key_binding_func_key, + NULL, + (void*)(192+6)); + mb_wm_keys_binding_add_with_spec (wm, + "g", + key_binding_func_key, + NULL, + (void*)(192+7)); + mb_wm_keys_binding_add_with_spec (wm, + "i", + key_binding_func_key, + NULL, + (void*)(192+9)); + mb_wm_keys_binding_add_with_spec (wm, + "j", + key_binding_func_key, + NULL, + (void*)(192+10)); + mb_wm_keys_binding_add_with_spec (wm, + "k", + key_binding_func_key, + NULL, + (void*)(192+11)); + mb_wm_keys_binding_add_with_spec (wm, + "l", + key_binding_func_key, + NULL, + (void*)(192+12)); + mb_wm_keys_binding_add_with_spec (wm, + "m", + key_binding_func_key, + NULL, + (void*)(192+13)); + mb_wm_keys_binding_add_with_spec (wm, + "o", + key_binding_func_key, + NULL, + (void*)(192+15)); + mb_wm_keys_binding_add_with_spec (wm, + "q", + key_binding_func_key, + NULL, + (void*)(192+17)); + mb_wm_keys_binding_add_with_spec (wm, + "r", + key_binding_func_key, + NULL, + (void*)(192+18)); + mb_wm_keys_binding_add_with_spec (wm, + "s", + key_binding_func_key, + NULL, + (void*)(192+19)); + mb_wm_keys_binding_add_with_spec (wm, + "t", + key_binding_func_key, + NULL, + (void*)(192+20)); + mb_wm_keys_binding_add_with_spec (wm, + "u", + key_binding_func_key, + NULL, + (void*)(192+21)); + mb_wm_keys_binding_add_with_spec (wm, + "v", + key_binding_func_key, + NULL, + (void*)(192+22)); + mb_wm_keys_binding_add_with_spec (wm, + "w", + key_binding_func_key, + NULL, + (void*)(192+23)); + mb_wm_keys_binding_add_with_spec (wm, + "y", + key_binding_func_key, + NULL, + (void*)(192+25)); + mb_wm_keys_binding_add_with_spec (wm, + "z", + key_binding_func_key, + NULL, + (void*)(192+26)); + mb_wm_keys_binding_add_with_spec (wm, + "Space", + key_binding_func_key, + NULL, + (void*)(192+32)); + mb_wm_keys_binding_add_with_spec (wm, + "comma", + key_binding_func_key, + NULL, + (void*)(192+33)); + mb_wm_keys_binding_add_with_spec (wm, + "period", + key_binding_func_key, + NULL, + (void*)(192+34)); + mb_wm_keys_binding_add_with_spec (wm, + "return", + key_binding_func_key, + NULL, + (void*)(192+35)); + clutter_x11_add_filter (clutter_x11_event_filter, wm); app_mgr = hd_app_mgr_get (); diff -ur orig/hildon-desktop-2.2.100/src/util/hd-dbus.c hildon-desktop-2.2.100/src/util/hd-dbus.c --- orig/hildon-desktop-2.2.100/src/util/hd-dbus.c 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/util/hd-dbus.c 2009-12-24 22:32:28.000000000 +0200 @@ -47,6 +47,31 @@ hd_render_manager_set_state (HDRM_STATE_TASK_NAV); return DBUS_HANDLER_RESULT_HANDLED; } + else if (dbus_message_is_signal(msg, + TASKNAV_SIGNAL_INTERFACE, + "set_state")) + { + DBusMessageIter args; + int sigvalue; + + if ((dbus_message_iter_init(msg, &args)) && + (DBUS_TYPE_INT32 == dbus_message_iter_get_arg_type(&args))) { + dbus_message_iter_get_basic(&args, &sigvalue); + switch(sigvalue) { + case HDRM_STATE_HOME : + case HDRM_STATE_HOME_PORTRAIT: + case HDRM_STATE_APP: + case HDRM_STATE_APP_PORTRAIT: + case HDRM_STATE_TASK_NAV: + case HDRM_STATE_LAUNCHER: + case HDRM_STATE_NON_COMPOSITED: + case HDRM_STATE_NON_COMP_PORT: + hd_render_manager_set_state (sigvalue); + break; + } + return DBUS_HANDLER_RESULT_HANDLED; + } + } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } @@ -177,6 +202,37 @@ } } +void hd_dbus_send_event (char *value) +{ + DBusMessage *msg; + dbus_bool_t b; + DBusMessageIter args; + + if (sysbus_conn == NULL) { + g_warning ("%s: no D-Bus system bus connection", __func__); + return; + } + msg = dbus_message_new_signal("/com/nokia/hildon_desktop", "com.nokia.hildon_desktop", "KeyEvent"); + if (msg == NULL) { + g_warning ("%s: could not create message", __func__); + return; + } + + dbus_message_iter_init_append(msg, &args); + if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &value)) { + g_warning("Out Of Memory!"); + return; + } + + b = dbus_connection_send(sysbus_conn, msg, NULL); + if (!b) { + g_warning ("%s: dbus_connection_send() failed", __func__); + } else { + dbus_connection_flush(sysbus_conn); + } + dbus_message_unref(msg); +} + DBusConnection * hd_dbus_init (HdCompMgr * hmgr) { diff -ur orig/hildon-desktop-2.2.100/src/util/hd-dbus.h hildon-desktop-2.2.100/src/util/hd-dbus.h --- orig/hildon-desktop-2.2.100/src/util/hd-dbus.h 2009-10-27 20:44:34.000000000 +0200 +++ hildon-desktop-2.2.100/src/util/hd-dbus.h 2009-12-24 14:06:31.000000000 +0200 @@ -16,5 +16,5 @@ const gchar *interface, const gchar *method, const gchar *launch_param); - +void hd_dbus_send_event (char *value); #endif