[maemo-commits] [maemo-commits] r9558 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . data src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Feb 2 13:05:23 EET 2007
Author: lucasr
Date: 2007-02-02 13:05:21 +0200 (Fri, 02 Feb 2007)
New Revision: 9558

Added:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.h
Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/Makefile.am
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window.c
Log:
2007-02-02  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hd-panel-window-dialog.[ch]: HildonDesktopPanelWindowDialog
	desktop specific implementation with theming.
	* src/hd-desktop.c: make desktop use HDPanelWindowDialog.
	* src/Makefile.am: added src/hd-panel-window-dialog.[ch] to the build.


Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-02-02 11:05:21 UTC (rev 9558)
@@ -1,5 +1,12 @@
 2007-02-02  Lucas Rocha  <lucas.rocha at nokia.com>
 
+	* src/hd-panel-window-dialog.[ch]: HildonDesktopPanelWindowDialog
+	desktop specific implementation with theming.
+	* src/hd-desktop.c: make desktop use HDPanelWindowDialog.
+	* src/Makefile.am: added src/hd-panel-window-dialog.[ch] to the build.
+
+2007-02-02  Lucas Rocha  <lucas.rocha at nokia.com>
+
 	* src/hd-panel-window.c: added theme code for panel itself in addition
 	the plugin's.
 	* libhildondesktop/hildon-desktop-panel-window.[ch]: added

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf	2007-02-02 11:05:21 UTC (rev 9558)
@@ -15,9 +15,9 @@
 
 [Statusbar]
 X-Type=panel_expandable
-X-Position-X=400
+X-Position-X=423
 X-Position-Y=0
-X-Size-Width=200
+X-Size-Width=270
 X-Size-Height=50
 X-Orientation=top
 X-Config-File=statusbar.conf

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/Makefile.am
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/Makefile.am	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/Makefile.am	2007-02-02 11:05:21 UTC (rev 9558)
@@ -88,6 +88,8 @@
 	hd-select-plugins-dialog.h  \
 	hd-panel-window.c           \
 	hd-panel-window.h           \
+	hd-panel-window-dialog.c    \
+	hd-panel-window-dialog.h    \
 	hd-config.h                 \
 	main.c
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2007-02-02 11:05:21 UTC (rev 9558)
@@ -38,7 +38,6 @@
 
 #include <hildon-base-lib/hildon-base-dnotify.h>
 #include <libhildondesktop/hildon-desktop-window.h>
-#include <libhildondesktop/hildon-desktop-panel-window-dialog.h>
 
 #include "hd-desktop.h"
 #include "hd-select-plugins-dialog.h"
@@ -46,6 +45,7 @@
 #include "hd-plugin-manager.h"
 #include "hd-home-window.h"
 #include "hd-panel-window.h"
+#include "hd-panel-window-dialog.h"
 
 #define HD_DESKTOP_GET_PRIVATE(object) \
         (G_TYPE_INSTANCE_GET_PRIVATE ((object), HD_TYPE_DESKTOP, HDDesktopPrivate))
@@ -667,7 +667,7 @@
       else
       if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_EXPANDABLE))
       {
-        container = g_object_new (HILDON_DESKTOP_TYPE_PANEL_WINDOW_DIALOG,
+        container = g_object_new (HD_TYPE_PANEL_WINDOW_DIALOG,
                                  "x", x,
                                  "y", y,
                                  "width", width,

Added: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c	2007-02-02 11:05:21 UTC (rev 9558)
@@ -0,0 +1,146 @@
+/*
+ * This file is part of hildon-desktop
+ *
+ * Copyright (C) 2006, 2007 Nokia Corporation.
+ *
+ * Author:  Johan Bilien <johan.bilien at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#include "hd-panel-window-dialog.h"
+
+#define HD_PANEL_WINDOW_DIALOG_GET_PRIVATE(obj) \
+        (G_TYPE_INSTANCE_GET_PRIVATE ((obj), HD_TYPE_PANEL_WINDOW, HDPanelWindowDialogPrivate))
+
+G_DEFINE_TYPE (HDPanelWindowDialog, hd_panel_window_dialog, HILDON_DESKTOP_TYPE_PANEL_WINDOW_DIALOG);
+
+#undef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+
+#define HD_PANEL_WINDOW_DIALOG_NAME_TOP     "hildon-status-bar-panel-top"
+#define HD_PANEL_WINDOW_DIALOG_NAME_BOTTOM  "hildon-status-bar-panel-bottom"
+#define HD_PANEL_WINDOW_DIALOG_NAME_LEFT    "hildon-status-bar-panel-left"
+#define HD_PANEL_WINDOW_DIALOG_NAME_RIGHT   "hildon-status-bar-panel-right"
+#define HD_PANEL_WINDOW_DIALOG_BUTTON_NAME  "HildonStatusBarItem"
+
+#ifdef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+static void
+hd_panel_window_dialog_set_style (HDPanelWindowDialog *window, 
+                           HildonDesktopPanelWindowOrientation orientation)
+{
+  switch (orientation)
+  {
+    case HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_TOP:
+      gtk_widget_set_name (GTK_WIDGET (window), HD_PANEL_WINDOW_DIALOG_NAME_TOP);
+      break;
+
+    case HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_BOTTOM:
+      gtk_widget_set_name (GTK_WIDGET (window), HD_PANEL_WINDOW_DIALOG_NAME_BOTTOM);
+      break;
+
+    case HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_LEFT:
+      gtk_widget_set_name (GTK_WIDGET (window), HD_PANEL_WINDOW_DIALOG_NAME_LEFT);
+      break;
+
+    case HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_RIGHT:
+      gtk_widget_set_name (GTK_WIDGET (window), HD_PANEL_WINDOW_DIALOG_NAME_RIGHT);
+      break;
+
+    default:
+      gtk_widget_set_name (GTK_WIDGET (window), HD_PANEL_WINDOW_DIALOG_NAME_TOP);
+      break;
+  }
+}
+
+static void
+hd_panel_window_dialog_orientation_changed (HildonDesktopPanelWindow *window, 
+                                     HildonDesktopPanelWindowOrientation new_orientation)
+{
+  hd_panel_window_dialog_set_style (HD_PANEL_WINDOW_DIALOG (window), new_orientation);
+}
+#endif
+
+static void
+hd_panel_window_dialog_cadd (GtkContainer *container,
+		      GtkWidget *widget,
+		      gpointer user_data)
+{
+  gtk_widget_set_name (widget, HD_PANEL_WINDOW_DIALOG_BUTTON_NAME);
+  gtk_widget_set_name (GTK_BIN (widget)->child, HD_PANEL_WINDOW_DIALOG_BUTTON_NAME);
+}
+
+static GObject *
+hd_panel_window_dialog_constructor (GType gtype,
+                             guint n_params,
+                             GObjectConstructParam  *params)
+{
+  GObject *object;
+#ifdef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+  HildonDesktopPanelWindowOrientation orientation;
+#endif
+  
+  object = G_OBJECT_CLASS (hd_panel_window_dialog_parent_class)->constructor (gtype,
+                                                                       n_params,
+                                                                       params);
+
+  g_signal_connect (G_OBJECT (HILDON_DESKTOP_WINDOW (object)->container), 
+                    "add",
+                    G_CALLBACK (hd_panel_window_dialog_cadd),
+                    NULL);
+
+#ifdef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+  g_object_get (G_OBJECT (object), 
+                "orientation", &orientation,
+                NULL);
+  
+  hd_panel_window_dialog_set_style (HD_PANEL_WINDOW_DIALOG (object), orientation);
+#endif
+  
+  return object;
+}
+ 
+static void
+hd_panel_window_dialog_class_init (HDPanelWindowDialogClass *window_class)
+{
+  GObjectClass *object_class;
+  HildonDesktopPanelWindowClass *panel_window_class;
+  
+  object_class = G_OBJECT_CLASS (window_class);
+  panel_window_class = HILDON_DESKTOP_PANEL_WINDOW_CLASS (window_class);
+  
+  object_class->constructor = hd_panel_window_dialog_constructor;
+
+#ifdef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+  panel_window_class->orientation_changed = hd_panel_window_dialog_orientation_changed;
+#endif
+}
+
+static void
+hd_panel_window_dialog_init (HDPanelWindowDialog *window)
+{
+#ifndef HD_PANEL_WINDOW_DIALOG_NEW_THEME
+  gtk_widget_set_name (GTK_WIDGET (window), "HildonStatusBar");
+#endif
+}

Added: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.h
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.h	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.h	2007-02-02 11:05:21 UTC (rev 9558)
@@ -0,0 +1,58 @@
+/*
+ * This file is part of hildon-desktop
+ *
+ * Copyright (C) 2006 Nokia Corporation.
+ *
+ * Author:  Johan Bilien <johan.bilien at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __HD_PANEL_WINDOW_DIALOG_H__
+#define __HD_PANEL_WINDOW_DIALOG_H__
+
+#include <glib-object.h>
+#include <libhildondesktop/hildon-desktop-panel-window-dialog.h>
+
+G_BEGIN_DECLS
+
+typedef struct _HDPanelWindowDialog HDPanelWindowDialog;
+typedef struct _HDPanelWindowDialogClass HDPanelWindowDialogClass;
+typedef struct _HDPanelWindowDialogPrivate HDPanelWindowDialogPrivate;
+
+#define HD_TYPE_PANEL_WINDOW_DIALOG            (hd_panel_window_dialog_get_type ())
+#define HD_PANEL_WINDOW_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), HD_TYPE_PANEL_WINDOW_DIALOG, HDPanelWindowDialog))
+#define HD_PANEL_WINDOW_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  HD_TYPE_PANEL_WINDOW_DIALOG, HDPanelWindowDialogClass))
+#define HD_IS_PANEL_WINDOW_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HD_TYPE_PANEL_WINDOW_DIALOG))
+#define HD_IS_PANEL_WINDOW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  HD_TYPE_PANEL_WINDOW_DIALOG))
+#define HD_PANEL_WINDOW_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  HD_TYPE_PANEL_WINDOW_DIALOG, HDPanelWindowDialogClass))
+
+struct _HDPanelWindowDialog 
+{
+  HildonDesktopPanelWindowDialog parent;
+};
+
+struct _HDPanelWindowDialogClass
+{
+  HildonDesktopPanelWindowDialogClass parent_class;
+};
+
+GType  hd_panel_window_dialog_get_type  (void);
+
+G_END_DECLS
+
+#endif /*__HD_PANEL_WINDOW_DIALOG_H__*/

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window.c	2007-02-02 11:04:23 UTC (rev 9557)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window.c	2007-02-02 11:05:21 UTC (rev 9558)
@@ -147,5 +147,4 @@
 static void
 hd_panel_window_init (HDPanelWindow *window)
 {
-  hd_panel_window_set_style (window, HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_LEFT);
 }


More information about the maemo-commits mailing list