Add priority column
authorTravis Reitter <treitter@torizo.(none)>
Sat, 19 Sep 2009 06:55:38 +0000 (23:55 -0700)
committerTravis Reitter <treitter@gmail.com>
Fri, 4 Dec 2009 06:01:12 +0000 (22:01 -0800)
src/milk-list-store.c
src/milk-list-store.h
src/milk-task-model.h [new file with mode: 0644]

index 0fdf7af..69c5c10 100644 (file)
@@ -64,6 +64,9 @@ milk_list_store_get_column_type (GtkTreeModel *model,
                                  gint          column)
 {
         switch (column) {
+                case MILK_LIST_STORE_COLUMN_PRIORITY:
+                        return G_TYPE_UINT;
+
                 case MILK_LIST_STORE_COLUMN_TASK:
                         /* FIXME: define the MilkTask class */
                         return MILK_TYPE_TASK;
index c6f73b6..9dd0ca4 100644 (file)
@@ -49,6 +49,7 @@ typedef struct _MilkListStoreClass MilkListStoreClass;
 typedef struct _MilkListStorePrivate MilkListStorePrivate;
 
 typedef enum {
+        MILK_LIST_STORE_COLUMN_PRIORITY,
         MILK_LIST_STORE_COLUMN_TASK,
         MILK_LIST_STORE_COLUMN_LAST,
 } OssoABookListStoreColumn;
diff --git a/src/milk-task-model.h b/src/milk-task-model.h
new file mode 100644 (file)
index 0000000..f86c8de
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors: Travis Reitter <treitter@gmail.com>
+ */
+
+#ifndef _MILK_TASK_MODEL_H
+#define _MILK_TASK_MODEL_H
+
+G_BEGIN_DECLS
+
+#define MILK_TYPE_TASK_MODEL milk_task_model_get_type()
+
+#define MILK_TASK_MODEL(obj) \
+                (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                MILK_TYPE_TASK_MODEL, MilkTaskModel))
+
+#define MILK_TASK_MODEL_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                MILK_TYPE_TASK_MODEL, MilkTaskModelClass))
+
+#define MILK_IS_TASK_MODEL(obj) \
+                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                MILK_TYPE_TASK_MODEL))
+
+#define MILK_IS_TASK_MODEL_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                MILK_TYPE_TASK_MODEL))
+
+#define MILK_TASK_MODEL_GET_CLASS(obj) \
+                (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                MILK_TYPE_TASK_MODEL, MilkTaskModelClass))
+
+typedef struct _MilkTaskModel MilkTaskModel;
+typedef struct _MilkTaskModelClass MilkTaskModelClass;
+typedef struct _MilkTaskModelPrivate MilkTaskModelPrivate;
+
+typedef enum {
+        MILK_TASK_MODEL_COLUMN_TASK,
+        MILK_TASK_MODEL_N_COLUMNS
+} MilkTaskModelColumn;
+
+struct _MilkTaskModel
+{
+        GObject parent;
+        MilkTaskModelPrivate *priv;
+};
+
+struct _MilkTaskModelClass
+{
+        GObjectClass parent_class;
+};
+
+GType milk_task_model_get_type (void);
+
+
+MilkTaskModel* milk_task_model_new ();
+
+#endif /* _MILK_TASK_MODEL_H */