-enum { PROP_PERCENTAGE = 1, PROP_THEME, PROP_SNAPSHOT, };
-
-static gpointer parent_class = NULL;
-
-static void custom_list_init(CustomList *cellprogress);
-static void custom_list_class_init(CustomListClass *klass);
-static void custom_list_get_property(GObject *object, guint param_id, GValue *value, GParamSpec *pspec);
-static void custom_list_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec);
-static void custom_list_finalize(GObject *gobject);
-
-
-// These functions are the heart of our custom cell renderer
-static void custom_list_get_size(GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height);
-static void custom_list_render(GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, guint flags);
-
-
-
-// register our type with the GObject type system if we haven't done so yet.
-// Everything else is done in the callbacks.
-GType custom_list_get_type()
-{
- static GType type = 0;
-
- if (type)
- return type;
-
- if (1) {
- static const GTypeInfo cell_info =
- {
- sizeof (CustomListClass),
- NULL,
- NULL,
- (GClassInitFunc)custom_list_class_init,
- NULL,
- NULL,
- sizeof (CustomList),
- 0,
- (GInstanceInitFunc)custom_list_init,
- };
-
- // Derive from GtkCellRenderer
- type = g_type_register_static(GTK_TYPE_CELL_RENDERER, "CustomList", &cell_info, 0);
- }
-
- return type;
-}
-
-
-// klass initialisation
-// - override the parent's functions that we need to implement.
-// - declare our property
-// - If you want cells that are editable, you need to override 'activate' and 'start_editing'.
-static void custom_list_class_init(CustomListClass *klass)
-{
- GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass);
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-printf("custom_list_class_init : deb\n");
- parent_class = g_type_class_peek_parent (klass);
-
- cell_class->render = custom_list_render;
- cell_class->get_size = custom_list_get_size;
- object_class->get_property = custom_list_get_property;
- object_class->set_property = custom_list_set_property;
- object_class->finalize = custom_list_finalize;
-
- // Install our very own properties
- g_object_class_install_property(object_class, PROP_PERCENTAGE, g_param_spec_double("percentage", "Percentage", "The fractional progress to display", 0.0, 1.0, 0.0, G_PARAM_READWRITE));
- g_object_class_install_property(object_class, PROP_THEME, g_param_spec_string("theme", "Theme", "Theme file name", NULL, G_PARAM_READWRITE));
- g_object_class_install_property(object_class, PROP_SNAPSHOT, g_param_spec_string("snapshot", "Snapshot", "Snapshot file name", NULL, G_PARAM_READWRITE));
-}
-
-
-// CustomList renderer initialisation
-static void custom_list_init(CustomList *custom_list)
-{
- printf("custom_list_init : deb\n");
- // set some default properties of the parent (GtkCellRenderer).
- GTK_CELL_RENDERER(custom_list)->mode = GTK_CELL_RENDERER_MODE_INERT;
- GTK_CELL_RENDERER(custom_list)->xpad = 2;
- GTK_CELL_RENDERER(custom_list)->ypad = 2;
-}