1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#ifndef _WALLS_MODEL_H_
#define _WALLS_MODEL_H_
#include <gtk/gtk.h>
#include <glib.h>
#include "db.h"
#define MODEL_TYPE_WALLS (walls_model_get_type())
#define WALLS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MODEL_TYPE_WALLS, WallsModel))
#define WALLS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MODEL_TYPE_WALLS, WallsModelClass))
#define MODEL_IS_WALLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MODEL_TYPE_WALLS))
#define MODEL_IS_WALLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MODEL_TYPE_WALLS))
#define WALLS_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MODEL_TYPE_WALLS, WallsModelClass))
enum {
WALLS_MODEL_TYPE_DIR = 0,
WALLS_MODEL_TYPE_WALL,
};
enum {
WALLS_MODEL_COL_NAME = 0,
WALLS_MODEL_COL_SIZE,
WALLS_MODEL_COL_WIDTH,
WALLS_MODEL_COL_HEIGHT,
WALLS_MODEL_N_COLUMNS,
};
typedef struct _WallsModelRecord WallsModelRecord;
typedef struct _WallsModel WallsModel;
typedef struct _WallsModelClass WallsModelClass;
struct _WallsModelRecord {
guint type;
union {
struct directory_t dir;
struct wallpaper_t wall;
};
WallsModelRecord *parent;
GArray *children;
guint pos;
};
struct _WallsModel {
GObject parent;
guint num_rows;
GArray *rows;
gint n_columns;
GType column_types[WALLS_MODEL_N_COLUMNS];
gint stamp;
};
struct _WallsModelClass {
GObjectClass parent_class;
};
GType walls_model_get_type();
WallsModel *walls_model_new();
void walls_model_get_dir_record(GtkTreeModel*, GtkTreeIter*, struct directory_t**);
void walls_model_get_wall_record(GtkTreeModel*, GtkTreeIter*, struct wallpaper_t**);
guint walls_model_get_record_type(GtkTreeModel*, GtkTreeIter*);
#endif
|