[maemo-commits] [maemo-commits] r14492 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Oct 17 23:30:28 EEST 2007
Author: elmarco
Date: 2007-10-17 23:30:17 +0300 (Wed, 17 Oct 2007)
New Revision: 14492

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.c
   projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.h
Log:
2007-10-17  Marc-Andre Lureau  <marc-andre.lureau at nokia.com>

        * libhildondesktop/tasknavigator-item.[ch]: document
        TaskNavigatorItem (mark public fields as private).


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-17 20:02:17 UTC (rev 14491)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-17 20:30:17 UTC (rev 14492)
@@ -1,5 +1,10 @@
 2007-10-17  Marc-Andre Lureau  <marc-andre.lureau at nokia.com>
 
+	* libhildondesktop/tasknavigator-item.[ch]: document
+	TaskNavigatorItem (mark public fields as private).
+
+2007-10-17  Marc-Andre Lureau  <marc-andre.lureau at nokia.com>
+
 	* doc/hildon-desktop-docs.sgml: add package version number.
 	* libhildondesktop/hildon-desktop-panel-item.[ch]: add
 	HildonDesktopPanelItem documentation.

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.c	2007-10-17 20:02:17 UTC (rev 14491)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.c	2007-10-17 20:30:17 UTC (rev 14492)
@@ -24,100 +24,17 @@
 
 #include "tasknavigator-item.h"
 
-enum
-{
-  TN_PROP_0,
-  TN_PROP_DUMMY
-};
+G_DEFINE_TYPE (TaskNavigatorItem, tasknavigator_item, HILDON_DESKTOP_TYPE_PANEL_ITEM)
 
+/* FIXME: change tasknavigator to task_navigator or TaskNavigator to Tasknavigator */
 
-/* static declarations */
-
-static void tasknavigator_item_class_init      (TaskNavigatorItemClass *item_class);
-static void tasknavigator_item_init            (TaskNavigatorItem *item);
-static void tasknavigator_item_get_property    (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void tasknavigator_item_set_property    (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-/*
-static void tasknavigator_finalize		   (GObject *object);
-static void tasknavigator_destroy		   (GtkObject *object);*/
-
-/*static DesktopItem *parent_class;*/
-
-GType tasknavigator_item_get_type (void)
+static void
+tasknavigator_item_class_init (TaskNavigatorItemClass *klass)
 {
-    static GType tn_item_type = 0;
-
-    if (!tn_item_type)
-    {
-        static const GTypeInfo tn_item_info =
-        {
-            sizeof (TaskNavigatorItemClass),
-            NULL, /* base_init */
-            NULL, /* base_finalize */
-            (GClassInitFunc) tasknavigator_item_class_init,
-            NULL, /* class_finalize */
-            NULL, /* class_data */
-            sizeof (TaskNavigatorItem),
-            0,    /* n_preallocs */
-            (GInstanceInitFunc) tasknavigator_item_init,
-        };
-        tn_item_type = g_type_register_static (HILDON_DESKTOP_TYPE_PANEL_ITEM,
-                                               "TaskNavigatorItem",
-                                               &tn_item_info,
-                                               0);
-    }
-    
-    return tn_item_type;
 }
 
-static void 
-tasknavigator_item_class_init (TaskNavigatorItemClass *item_class)
+static void
+tasknavigator_item_init (TaskNavigatorItem *self)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (item_class);
-  
-  object_class->get_property  = tasknavigator_item_get_property;
-  object_class->set_property  = tasknavigator_item_set_property;
-
-  /*
-  g_object_class_install_property (object_class,
-                                   SB_PROP_MANDATORY,
-                                   g_param_spec_boolean("mandatory",
-					   		"mandatory",
-                                                        "mandaa plugin that cant'be destroyed",
-                                                        FALSE,
-                                                        G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
-*/
+  self->menu   = NULL;
 }
-
-static void 
-tasknavigator_item_init (TaskNavigatorItem *item)
-{
-  item->menu   = NULL;
-}
-
-static void 
-tasknavigator_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
-  /*TaskNavigatorItem *item = TASKNAVIGATOR_ITEM (object);*/
-
-  switch (prop_id)
-  {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }	
-}
-
-static void 
-tasknavigator_item_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
-  /*TaskNavigatorItem *sbitem = TASKNAVIGATOR_ITEM (object);*/
-
-  switch (prop_id)
-  {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.h	2007-10-17 20:02:17 UTC (rev 14491)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/tasknavigator-item.h	2007-10-17 20:30:17 UTC (rev 14492)
@@ -39,22 +39,27 @@
 #define TASKNAVIGATOR_IS_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TASKNAVIGATOR_TYPE_ITEM))
 
 
-typedef struct _TaskNavigatorItem TaskNavigatorItem; 
+typedef struct _TaskNavigatorItem TaskNavigatorItem;
 typedef struct _TaskNavigatorItemClass TaskNavigatorItemClass;
 
+/**
+ * TaskNavigatorItem:
+ *
+ * A task navigator item must inherit from this base class.
+ **/
 struct _TaskNavigatorItem
 {
     HildonDesktopPanelItem parent;
 
+    /*< private >*/
     GtkMenu	    *menu;
-    
+
     gboolean mandatory;
 };
 
 struct _TaskNavigatorItemClass
 {
     HildonDesktopPanelItemClass parent_class;
-
 };
 
 GType tasknavigator_item_get_type (void);


More information about the maemo-commits mailing list