views: implemented :manager property

As explained before, this is only intended to keep a reference to the
GcalManager instance of the application.
Misc: fixed some documentation and whitespace issues
This commit is contained in:
Erick Pérez Castellanos
2014-12-04 17:10:42 -05:00
parent 8ba7f431fd
commit 3a151894be
6 changed files with 52 additions and 32 deletions
+14 -8
View File
@@ -42,6 +42,7 @@ typedef struct
/* property */
icaltimetype *date;
GcalManager *manager; /* weak reference */
gint clicked_cell;
@@ -52,7 +53,8 @@ typedef struct
enum
{
PROP_0,
PROP_DATE //active-date inherited property
PROP_DATE, //active-date inherited property
PROP_MANAGER //manager inherited property
};
static void gcal_view_interface_init (GcalViewIface *iface);
@@ -171,10 +173,9 @@ gcal_year_view_class_init (GcalYearViewClass *klass)
object_class->finalize = gcal_year_view_finalize;
g_object_class_override_property (object_class, PROP_DATE, "active-date");
g_object_class_override_property (object_class, PROP_MANAGER, "manager");
}
static void
gcal_year_view_init (GcalYearView *self)
{
@@ -238,6 +239,9 @@ gcal_year_view_set_property (GObject *object,
priv->date = g_value_dup_boxed (value);
break;
case PROP_MANAGER:
priv->manager = g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -1035,19 +1039,21 @@ static gboolean
gcal_year_view_will_add_event (GcalView *view,
GcalEventWidget *event)
{
;
/* FIXME: implement me !!! */
return FALSE;
}
/* Public API */
/**
* gcal_year_view_new:
* @manager: App singleton #GcalManager instance
*
* Create the year view
*
* Since: 0.1
* Return value: the new month view widget
* Returns: (transfer full):
**/
GtkWidget*
gcal_year_view_new (void)
gcal_year_view_new (GcalManager *manager)
{
return g_object_new (GCAL_TYPE_YEAR_VIEW, NULL);
return g_object_new (GCAL_TYPE_YEAR_VIEW, "manager", manager, NULL);
}