could hildon-desktop support multiple configurations?



Hi, Moises & Lucas,
 
This is Horace again.
 
I have a question on hildon-desktop that is there any possibility for hildon-desktop to support multiple desktop configurations, like supporting both maemo rotated "L" layout and moblin single marquee panel layout? It might be better and more flexible for developers to build up hildon-desktop with single source base.
 
If you have any suggestions or ideas on this, please share with me.
 
Currently I have a prototype for this that an option "--enable-umeconfig" is added to control what kind of desktop.conf need to be installed. With this disabled, maemo rotated "L" layout is installed by default; while with it enabled, moblin single marquee panel layout. Also I created another option "--enable-maemogtk" to switch on/off the MAEMO specified GTK interface that are not available to me.
 
The patch file is pasted below and it is based on latest hildon-desktop 0.0.34. Please help to take a look to see if the idea is ok.
 
Any comments are welcome.
 
Thanks,
Horace
 
----------------------------------------------------------
diff -Nur trunk/configure.ac hildon-desktop-patch1/configure.ac
--- trunk/configure.ac 2007-09-04 13:45:00.000000000 +0800
+++ hildon-desktop-patch1/configure.ac 2007-09-05 16:44:09.000000000 +0800
@@ -42,6 +42,14 @@
        [AC_HELP_STRING([--enable-instrumenting],[Compile with instrumentation flags (default=no)])],
        [hildon_use_instrumenting=yes],[hildon_use_instrumenting=no])
 
+AC_ARG_ENABLE(maemogtk,
+              [AC_HELP_STRING([--enable-maemogtk],[Compile with maemo specified gtk flags (default=no)])],
+              [hildon_use_maemo_gtk=yes],[hildon_use_maemo_gtk=no])
+
+AC_ARG_ENABLE(umeconfig,
+              [AC_HELP_STRING([--enable-umeconfig],[Compile for UME platform release (default=no)])],
+              [hildon_use_ume_config=yes],[hildon_use_ume_config=no])
+
 if test "x${hildon_use_timestamping}" = "xyes"
 then
     CFLAGS="$CFLAGS -DHILDON_USE_TIMESTAMPING"
@@ -54,6 +62,18 @@
     CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format-extra-args"
 fi
 
+if test "x${hildon_use_maemo_gtk}" = "xyes"
+then
+    AC_DEFINE(MAEMO_GTK_CHANGES, 1, [Define if we're using maemo specified gtk])
+fi
+AM_CONDITIONAL(MAEMO_GTK_CHANGES, test "x$hildon_use_maemo_gtk" = "xyes")
+
+if test "x${hildon_use_ume_config}" = "xyes"
+then
+    AC_DEFINE(UME, 1, [Define if we are building up for Ubuntu Mobile and Embedded])
+fi
+AM_CONDITIONAL(UME, test "x$hildon_use_ume_config" = "xyes")
+
 # D-BUS headers do not compile with -pedantic. Once they are fixed,
 #return the flag
 #CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wmissing-prototypes -Wmissing-declarations -Werror"
@@ -78,6 +98,7 @@
                   hildondesktoplibdir=`pkg-config osso-af-settings --variable=hildondesktoplibdir`
 
                   hildonnavigatordesktopentrydir=`pkg-config osso-af-settings --variable=tasknavigatordesktopentrydir`
+                  hildonmarqueedesktopentrydir=`pkg-config osso-af-settings --variable=marqueedesktopentrydir`
                   hildonhomedesktopentrydir=`pkg-config osso-af-settings --variable=homedesktopentrydir`
                   hildonstatusbardesktopentrydir=`pkg-config osso-af-settings --variable=statusbardesktopentrydir`
                  
@@ -92,6 +113,7 @@
                   hildondesktoplibdir="${libdir}/hildon-desktop"
                  
                   hildonnavigatordesktopentrydir="${datadir}/applications/hildon-navigator"
+                  hildonmarqueedesktopentrydir="${datadir}/applications/hildon-marquee"
                   hildonhomedesktopentrydir="${datadir}/applications/hildon-home"
                   hildonstatusbardesktopentrydir="${datadir}/applications/hildon-status-bar"
 
@@ -225,6 +247,11 @@
 AC_SUBST(hildonnavigatorlibdir)
 
 # Expand nested variables
+eval "hildonmarqueedesktopentrydir=$hildonmarqueedesktopentrydir"
+eval "hildonmarqueedesktopentrydir=$hildonmarqueedesktopentrydir"
+AC_SUBST(hildonmarqueedesktopentrydir)
+
+# Expand nested variables
 eval "hildonhomedesktopentrydir=$hildonhomedesktopentrydir"
 eval "hildonhomedesktopentrydir=$hildonhomedesktopentrydir"
 AC_SUBST(hildonhomedesktopentrydir)
@@ -279,9 +306,12 @@
 background-manager/background-manager-dbus.h
 data/Makefile
 data/desktop.conf
+data/desktop-ume.conf
 data/tasknavigator.conf
+data/marquee.conf
 data/statusbar.conf
 data/home.conf
+data/home-ume.conf
 data/app-switcher.desktop
 data/others-button.desktop
 data/applications-menu.desktop
diff -Nur trunk/data/desktop-ume.conf.in hildon-desktop-patch1/data/desktop-ume.conf.in
--- trunk/data/desktop-ume.conf.in 1970-01-01 08:00:00.000000000 +0800
+++ hildon-desktop-patch1/data/desktop-ume.conf.in 2007-09-05 16:45:31.000000000 +0800
@@ -0,0 +1,21 @@
+[Marquee]
+X-Type=panel_box
+X-Position-X=0
+X-Position-Y=0
+X-Size-Width=800
+X-Size-Height=52
+X-Orientation=top
+X-Is-Ordered=1
+X-Config-File=marquee.conf
+X-Plugin-Dir= hildonmarqueedesktopentrydir@
+
+[Home]
+X-Type=home
+X-Padding-Left=0
+X-Padding-Right=0
+X-Padding-Top=0
+X-Padding-Bottom=0
+X-Is-Ordered=0
+X-Load-New-Plugins=1
+X-Config-File=home-ume.conf
+X-Plugin-Dir= hildonhomedesktopentrydir@
diff -Nur trunk/data/home-layout-ume.conf hildon-desktop-patch1/data/home-layout-ume.conf
--- trunk/data/home-layout-ume.conf 1970-01-01 08:00:00.000000000 +0800
+++ hildon-desktop-patch1/data/home-layout-ume.conf 2007-09-05 16:47:01.000000000 +0800
@@ -0,0 +1,5 @@
+[/usr/share/applications/hildon-home/mobile-basic-home.desktop]
+X=0
+Y=0
+X-home-applet-width=1024
+X-home-applet-height=548
diff -Nur trunk/data/home-ume.conf.in hildon-desktop-patch1/data/home-ume.conf.in
--- trunk/data/home-ume.conf.in 1970-01-01 08:00:00.000000000 +0800
+++ hildon-desktop-patch1/data/home-ume.conf.in 2007-09-05 16:46:39.000000000 +0800
@@ -0,0 +1 @@
+[ hildonhomedesktopentrydir@/mobile-basic-home.desktop]
diff -Nur trunk/data/Makefile.am hildon-desktop-patch1/data/Makefile.am
--- trunk/data/Makefile.am 2007-09-04 13:45:00.000000000 +0800
+++ hildon-desktop-patch1/data/Makefile.am 2007-09-05 16:45:05.000000000 +0800
@@ -1,3 +1,14 @@
+if UME
+hildondesktopconf_DATA =           \
+        desktop-ume.conf           \
+        marquee.conf               \
+        statusbar.conf             \
+        home-ume.conf              \
+        home-layout-ume.conf
+
+hildonmarqueedesktopentry_DATA = \
+        applications-menu.desktop
+else
 hildondesktopconf_DATA =           \
  desktop.conf               \
  tasknavigator.conf         \
@@ -11,8 +22,6 @@
         applications-menu.desktop  \
  switcher-menu.desktop
 
-hildondesktopmenu_DATA = applications.menu
-
 hildondesktopstartup_SCRIPTS = \
         hildon-desktop.sh
 
@@ -20,5 +29,8 @@
 ossobackupdir = $(sysconfdir)/osso-backup/restore.d/always
 
 bin_SCRIPTS = install_sbapplet.sh
+endif
+
+hildondesktopmenu_DATA = applications.menu
 
 CLEANFILES = *~
diff -Nur trunk/data/marquee.conf.in hildon-desktop-patch1/data/marquee.conf.in
--- trunk/data/marquee.conf.in 1970-01-01 08:00:00.000000000 +0800
+++ hildon-desktop-patch1/data/marquee.conf.in 2007-09-05 16:46:06.000000000 +0800
@@ -0,0 +1,7 @@
+[ hildonmarqueedesktopentrydir@/applications-menu.desktop]
+[ hildonmarqueedesktopentrydir@/drop-down-menu.desktop]
+[ hildonmarqueedesktopentrydir@/nav-prev-app.desktop]
+[ hildonmarqueedesktopentrydir@/clock-plugin.desktop]
+[ hildonmarqueedesktopentrydir@/nav-next-app.desktop]
+[ hildonmarqueedesktopentrydir@/close-app.desktop]
+#[ hildonmarqueedesktopentrydir@/dummy-panel.desktop]
diff -Nur trunk/libhildondesktop/hildon-desktop-panel-expandable.c hildon-desktop-patch1/libhildondesktop/hildon-desktop-panel-expandable.c
--- trunk/libhildondesktop/hildon-desktop-panel-expandable.c 2007-09-04 13:45:00.000000000 +0800
+++ hildon-desktop-patch1/libhildondesktop/hildon-desktop-panel-expandable.c 2007-09-04 15:15:39.000000000 +0800
@@ -338,7 +338,7 @@
   gtk_window_set_type_hint (panel->priv->extension_window,
          GDK_WINDOW_TYPE_HINT_DIALOG);
 
-#ifdef MAEMO_CHANGES
+#ifdef MAEMO_GTK_CHANGES
   gtk_window_set_is_temporary (panel->priv->extension_window, TRUE);
 #endif
  
diff -Nur trunk/libhildondesktop/hildon-desktop-popup-window.c hildon-desktop-patch1/libhildondesktop/hildon-desktop-popup-window.c
--- trunk/libhildondesktop/hildon-desktop-popup-window.c 2007-09-04 13:45:00.000000000 +0800
+++ hildon-desktop-patch1/libhildondesktop/hildon-desktop-popup-window.c 2007-09-04 15:15:03.000000000 +0800
@@ -88,11 +88,11 @@
 static gboolean hildon_desktop_popup_window_visibility_notify (GtkWidget          *widget,
                                    GdkEventVisibility *event,
                             gpointer            data);
-
+#ifdef MAEMO_GTK_CHANGES
 static gboolean hildon_desktop_popup_window_pane_delete_event (GtkWidget *widget,
                 GdkEvent  *event,
               gpointer   data);
-
+#endif
 static gboolean hildon_desktop_popup_window_delete_event (GtkWidget *widget,
          GdkEvent  *event,
          gpointer   data);
@@ -256,7 +256,7 @@
                                                                                    params);
 
   popup = HILDON_DESKTOP_POPUP_WINDOW (object);
-#ifndef MAEMO_CHANGES
+#ifndef MAEMO_GTK_CHANGES
   GTK_WINDOW (popup)->type = GTK_WINDOW_POPUP;
 #else
   GTK_WINDOW (popup)->type = GTK_WINDOW_TOPLEVEL;
@@ -286,7 +286,7 @@
 
   for (i=0; i < popup->priv->n_extra_panes; i++)
   {  
-#ifndef MAEMO_CHANGES  
+#ifndef MAEMO_GTK_CHANGES  
     popup->priv->extra_panes[i] = gtk_window_new (GTK_WINDOW_POPUP);
 #else
     popup->priv->extra_panes[i] = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -691,7 +691,7 @@
 
   return FALSE;
 }
-
+#ifdef MAEMO_GTK_CHANGES
 static gboolean
 hildon_desktop_popup_window_pane_delete_event (GtkWidget *widget,
             GdkEvent *event,
@@ -699,7 +699,7 @@
 {
   return TRUE;
 }
-
+#endif
 static gboolean
 hildon_desktop_popup_window_delete_event (GtkWidget *widget,
        GdkEvent *event,
diff -Nur trunk/libhildonwm/hd-wm.c hildon-desktop-patch1/libhildonwm/hd-wm.c
--- trunk/libhildonwm/hd-wm.c 2007-09-04 13:45:01.000000000 +0800
+++ hildon-desktop-patch1/libhildonwm/hd-wm.c 2007-09-04 15:16:19.000000000 +0800
@@ -737,7 +737,7 @@
   if (g_str_equal (HOME_LONG_PRESS, member) && !hd_wm_modal_windows_present())
   {
     g_signal_emit_by_name (hdwm, "long-key-press");
-#ifdef MAEMO_CHANGES   
+#ifdef MAEMO_GTK_CHANGES   
     gdk_close_all_temporary_windows ();
 #endif   
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
diff -Nur trunk/src/hd-desktop.c hildon-desktop-patch1/src/hd-desktop.c
--- trunk/src/hd-desktop.c 2007-09-04 13:45:01.000000000 +0800
+++ hildon-desktop-patch1/src/hd-desktop.c 2007-09-05 16:48:39.000000000 +0800
@@ -60,8 +60,13 @@
 
 G_DEFINE_TYPE (HDDesktop, hd_desktop, G_TYPE_OBJECT);
 
+#ifdef UME
+#define HD_DESKTOP_CONFIG_FILE         "desktop-ume.conf"
+#define HD_DESKTOP_CONFIG_USER_PATH    ".osso/hildon-desktop/"
+#else
 #define HD_DESKTOP_CONFIG_FILE         "desktop.conf"
 #define HD_DESKTOP_CONFIG_USER_PATH    ".osso/hildon-desktop/"
+#endif
 
 #define _L10N(s) dgettext(GETTEXT_PACKAGE, s)
 
diff -Nur trunk/src/hd-home-window.c hildon-desktop-patch1/src/hd-home-window.c
--- trunk/src/hd-home-window.c 2007-09-04 13:45:01.000000000 +0800
+++ hildon-desktop-patch1/src/hd-home-window.c 2007-09-05 16:50:13.000000000 +0800
@@ -87,8 +87,13 @@
 #define HD_HOME_WINDOW_STYLE_NORTH_BORDER   "HildonHomeTitleBar"
 #define HD_HOME_WINDOW_STYLE_WEST_BORDER    "HildonHomeLeftEdge"
 
+#ifdef UME
+#define HH_AREA_GLOBAL_CONFIGURATION_FILE "/etc/hildon-desktop/home-layout.conf"
+#define HH_AREA_CONFIGURATION_FILE ""
+#else
 #define HH_AREA_CONFIGURATION_FILE        ".osso/hildon-desktop/home-layout.conf"
 #define HH_AREA_GLOBAL_CONFIGURATION_FILE "/etc/hildon-desktop/home-layout.conf"
+#endif
 
 #include "hd-home-window.h"
 
@@ -1131,6 +1136,7 @@
 static void
 hd_home_window_save_area_layout (HDHomeWindow *window)
 {
+#ifndef UME
   GtkWidget    *area = GTK_BIN (window)->child;
 
 #ifdef DEBUG
@@ -1156,6 +1162,7 @@
 
       g_free (filename);
     }
+#endif
 }
 
 static void
diff -Nur trunk/src/hd-switcher-menu.c hildon-desktop-patch1/src/hd-switcher-menu.c
--- trunk/src/hd-switcher-menu.c 2007-09-04 13:45:01.000000000 +0800
+++ hildon-desktop-patch1/src/hd-switcher-menu.c 2007-09-04 15:17:34.000000000 +0800
@@ -2102,8 +2102,9 @@
   }
   else
   {
+#ifdef MAEMO_GTK_CHANGES
     gtk_window_close_other_temporaries (GTK_WINDOW (switcher->priv->popup_window));
-
+#endif
     gtk_toggle_button_set_active
       (GTK_TOGGLE_BUTTON (switcher->priv->toggle_button), TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]