~shnatsel/+junk/cairo-compmgr

« back to all changes in this revision

Viewing changes to plugins/automate/ccm-story-board.c

  • Committer: Sergey "Shnatsel" Davidoff
  • Date: 2012-03-04 22:53:22 UTC
  • Revision ID: shnatsel@gmail.com-20120304225322-q2hz82j51yxv1qqw
fixed up build dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ccm-story-board.c generated by valac, the Vala compiler
 
2
 * generated from ccm-story-board.vala, do not modify */
 
3
 
 
4
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 
5
/*
 
6
 * cairo-compmgr
 
7
 * Copyright (C) Nicolas Bruguier 2008 <gandalfn@club-internet.fr>
 
8
 * 
 
9
 * cairo-compmgr is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Lesser General Public
 
11
 * License as published by the Free Software Foundation; either
 
12
 * version 2.1 of the License, or (at your option) any later version.
 
13
 * 
 
14
 * cairo-compmgr is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * Lesser General Public License for more details.
 
18
 * 
 
19
 * You should have received a copy of the GNU Lesser General Public
 
20
 * License along with cairo-compmgr.  If not, write to:
 
21
 *      The Free Software Foundation, Inc.,
 
22
 *      51 Franklin Street, Fifth Floor
 
23
 *      Boston, MA  02110-1301, USA.
 
24
 */
 
25
 
 
26
#include <glib.h>
 
27
#include <glib-object.h>
 
28
#include <ccm.h>
 
29
#include <ccm-screen.h>
 
30
#include <stdlib.h>
 
31
#include <string.h>
 
32
#include <ccm-window.h>
 
33
#include <ccm-window-plugin.h>
 
34
#include <ccm-display.h>
 
35
#include <X11/Xlib.h>
 
36
#include <X11/Xatom.h>
 
37
#include <X11/Xutil.h>
 
38
#include <X11/Xregion.h>
 
39
#include <float.h>
 
40
#include <math.h>
 
41
#include <ccm-debug.h>
 
42
 
 
43
 
 
44
#define CCM_TYPE_STORY_BOARD (ccm_story_board_get_type ())
 
45
#define CCM_STORY_BOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_STORY_BOARD, CCMStoryBoard))
 
46
#define CCM_STORY_BOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_STORY_BOARD, CCMStoryBoardClass))
 
47
#define CCM_IS_STORY_BOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_STORY_BOARD))
 
48
#define CCM_IS_STORY_BOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_STORY_BOARD))
 
49
#define CCM_STORY_BOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_STORY_BOARD, CCMStoryBoardClass))
 
50
 
 
51
typedef struct _CCMStoryBoard CCMStoryBoard;
 
52
typedef struct _CCMStoryBoardClass CCMStoryBoardClass;
 
53
typedef struct _CCMStoryBoardPrivate CCMStoryBoardPrivate;
 
54
 
 
55
#define CCM_TYPE_ACTION (ccm_action_get_type ())
 
56
#define CCM_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_ACTION, CCMAction))
 
57
#define CCM_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_ACTION, CCMActionClass))
 
58
#define CCM_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_ACTION))
 
59
#define CCM_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_ACTION))
 
60
#define CCM_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_ACTION, CCMActionClass))
 
61
 
 
62
typedef struct _CCMAction CCMAction;
 
63
typedef struct _CCMActionClass CCMActionClass;
 
64
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
65
#define _g_free0(var) (var = (g_free (var), NULL))
 
66
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
 
67
#define __g_list_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_list_free_g_object_unref (var), NULL)))
 
68
 
 
69
#define CCM_TYPE_ACTION_POINTER (ccm_action_pointer_get_type ())
 
70
#define CCM_ACTION_POINTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_ACTION_POINTER, CCMActionPointer))
 
71
#define CCM_ACTION_POINTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_ACTION_POINTER, CCMActionPointerClass))
 
72
#define CCM_IS_ACTION_POINTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_ACTION_POINTER))
 
73
#define CCM_IS_ACTION_POINTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_ACTION_POINTER))
 
74
#define CCM_ACTION_POINTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_ACTION_POINTER, CCMActionPointerClass))
 
75
 
 
76
typedef struct _CCMActionPointer CCMActionPointer;
 
77
typedef struct _CCMActionPointerClass CCMActionPointerClass;
 
78
 
 
79
#define CCM_TYPE_ACTION_POINTER_MOTION (ccm_action_pointer_motion_get_type ())
 
80
#define CCM_ACTION_POINTER_MOTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_ACTION_POINTER_MOTION, CCMActionPointerMotion))
 
81
#define CCM_ACTION_POINTER_MOTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_ACTION_POINTER_MOTION, CCMActionPointerMotionClass))
 
82
#define CCM_IS_ACTION_POINTER_MOTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_ACTION_POINTER_MOTION))
 
83
#define CCM_IS_ACTION_POINTER_MOTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_ACTION_POINTER_MOTION))
 
84
#define CCM_ACTION_POINTER_MOTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_ACTION_POINTER_MOTION, CCMActionPointerMotionClass))
 
85
 
 
86
typedef struct _CCMActionPointerMotion CCMActionPointerMotion;
 
87
typedef struct _CCMActionPointerMotionClass CCMActionPointerMotionClass;
 
88
 
 
89
#define CCM_TYPE_ACTION_POINTER_PRESS (ccm_action_pointer_press_get_type ())
 
90
#define CCM_ACTION_POINTER_PRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_ACTION_POINTER_PRESS, CCMActionPointerPress))
 
91
#define CCM_ACTION_POINTER_PRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_ACTION_POINTER_PRESS, CCMActionPointerPressClass))
 
92
#define CCM_IS_ACTION_POINTER_PRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_ACTION_POINTER_PRESS))
 
93
#define CCM_IS_ACTION_POINTER_PRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_ACTION_POINTER_PRESS))
 
94
#define CCM_ACTION_POINTER_PRESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_ACTION_POINTER_PRESS, CCMActionPointerPressClass))
 
95
 
 
96
typedef struct _CCMActionPointerPress CCMActionPointerPress;
 
97
typedef struct _CCMActionPointerPressClass CCMActionPointerPressClass;
 
98
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
99
 
 
100
#define CCM_TYPE_ACTION_POINTER_RELEASE (ccm_action_pointer_release_get_type ())
 
101
#define CCM_ACTION_POINTER_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCM_TYPE_ACTION_POINTER_RELEASE, CCMActionPointerRelease))
 
102
#define CCM_ACTION_POINTER_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCM_TYPE_ACTION_POINTER_RELEASE, CCMActionPointerReleaseClass))
 
103
#define CCM_IS_ACTION_POINTER_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCM_TYPE_ACTION_POINTER_RELEASE))
 
104
#define CCM_IS_ACTION_POINTER_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCM_TYPE_ACTION_POINTER_RELEASE))
 
105
#define CCM_ACTION_POINTER_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCM_TYPE_ACTION_POINTER_RELEASE, CCMActionPointerReleaseClass))
 
106
 
 
107
typedef struct _CCMActionPointerRelease CCMActionPointerRelease;
 
108
typedef struct _CCMActionPointerReleaseClass CCMActionPointerReleaseClass;
 
109
 
 
110
struct _CCMStoryBoard {
 
111
        GObject parent_instance;
 
112
        CCMStoryBoardPrivate * priv;
 
113
};
 
114
 
 
115
struct _CCMStoryBoardClass {
 
116
        GObjectClass parent_class;
 
117
};
 
118
 
 
119
struct _CCMStoryBoardPrivate {
 
120
        gboolean _hint_motion;
 
121
        CCMScreen* screen;
 
122
        char* name;
 
123
        GList* ignore;
 
124
        GList* actions;
 
125
        GTimeVal time;
 
126
};
 
127
 
 
128
typedef enum  {
 
129
        CCM_ACTION_ERROR_WINDOW_IGNORE,
 
130
        CCM_ACTION_ERROR_WINDOW_NOT_FOUND
 
131
} CCMActionError;
 
132
#define CCM_ACTION_ERROR ccm_action_error_quark ()
 
133
 
 
134
static gpointer ccm_story_board_parent_class = NULL;
 
135
static GType ccm_story_board_type_id = 0;
 
136
 
 
137
GType ccm_story_board_get_type (void);
 
138
GType ccm_story_board_register_type (GTypeModule * module);
 
139
GType ccm_action_get_type (void);
 
140
GType ccm_action_register_type (GTypeModule * module);
 
141
#define CCM_STORY_BOARD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CCM_TYPE_STORY_BOARD, CCMStoryBoardPrivate))
 
142
enum  {
 
143
        CCM_STORY_BOARD_DUMMY_PROPERTY,
 
144
        CCM_STORY_BOARD_HINT_MOTION
 
145
};
 
146
static void _g_list_free_g_object_unref (GList* self);
 
147
void ccm_story_board_set_hint_motion (CCMStoryBoard* self, gboolean value);
 
148
static void ccm_story_board_on_event (CCMStoryBoard* self, CCMDisplay* display, XEvent* event);
 
149
static void _ccm_story_board_on_event_ccm_display_event (CCMDisplay* _sender, XEvent* event, gpointer self);
 
150
CCMStoryBoard* ccm_story_board_new (CCMScreen* screen, const char* name, GList* ignore);
 
151
CCMStoryBoard* ccm_story_board_construct (GType object_type, CCMScreen* screen, const char* name, GList* ignore);
 
152
gboolean ccm_story_board_get_hint_motion (CCMStoryBoard* self);
 
153
GType ccm_action_pointer_get_type (void);
 
154
GType ccm_action_pointer_register_type (GTypeModule * module);
 
155
GType ccm_action_pointer_motion_get_type (void);
 
156
GType ccm_action_pointer_motion_register_type (GTypeModule * module);
 
157
void ccm_action_pointer_motion_set_event (CCMActionPointerMotion* self, XEvent* value);
 
158
void ccm_action_set_time (CCMAction* self, glong value);
 
159
CCMActionPointerMotion* ccm_action_pointer_motion_new (CCMScreen* screen, XEvent* event, glong time);
 
160
CCMActionPointerMotion* ccm_action_pointer_motion_construct (GType object_type, CCMScreen* screen, XEvent* event, glong time);
 
161
GQuark ccm_action_error_quark (void);
 
162
CCMActionPointerPress* ccm_action_pointer_press_new (CCMScreen* screen, XEvent* event, glong time, GList* ignore, GError** error);
 
163
CCMActionPointerPress* ccm_action_pointer_press_construct (GType object_type, CCMScreen* screen, XEvent* event, glong time, GList* ignore, GError** error);
 
164
GType ccm_action_pointer_press_get_type (void);
 
165
GType ccm_action_pointer_press_register_type (GTypeModule * module);
 
166
CCMActionPointerRelease* ccm_action_pointer_release_new (CCMScreen* screen, XEvent* event, glong time, GList* ignore, GError** error);
 
167
CCMActionPointerRelease* ccm_action_pointer_release_construct (GType object_type, CCMScreen* screen, XEvent* event, glong time, GList* ignore, GError** error);
 
168
GType ccm_action_pointer_release_get_type (void);
 
169
GType ccm_action_pointer_release_register_type (GTypeModule * module);
 
170
char* ccm_action_to_string (CCMAction* self, const char* format);
 
171
char* ccm_story_board_to_string (CCMStoryBoard* self, const char* format);
 
172
static void ccm_story_board_finalize (GObject* obj);
 
173
static void ccm_story_board_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 
174
static void ccm_story_board_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
 
175
 
 
176
 
 
177
 
 
178
static void _g_list_free_g_object_unref (GList* self) {
 
179
        g_list_foreach (self, (GFunc) g_object_unref, NULL);
 
180
        g_list_free (self);
 
181
}
 
182
 
 
183
 
 
184
static gpointer _g_object_ref0 (gpointer self) {
 
185
        return self ? g_object_ref (self) : NULL;
 
186
}
 
187
 
 
188
 
 
189
static void _ccm_story_board_on_event_ccm_display_event (CCMDisplay* _sender, XEvent* event, gpointer self) {
 
190
        ccm_story_board_on_event (self, _sender, event);
 
191
}
 
192
 
 
193
 
 
194
CCMStoryBoard* ccm_story_board_construct (GType object_type, CCMScreen* screen, const char* name, GList* ignore) {
 
195
        CCMStoryBoard * self;
 
196
        CCMScreen* _tmp0_;
 
197
        char* _tmp1_;
 
198
        GList* _tmp2_;
 
199
        GTimeVal _tmp3_ = {0};
 
200
        GList* _tmp4_;
 
201
        CCMDisplay* display;
 
202
        g_return_val_if_fail (screen != NULL, NULL);
 
203
        g_return_val_if_fail (name != NULL, NULL);
 
204
        self = (CCMStoryBoard*) g_object_new (object_type, NULL);
 
205
        ccm_story_board_set_hint_motion (self, FALSE);
 
206
        self->priv->screen = (_tmp0_ = _g_object_ref0 (screen), _g_object_unref0 (self->priv->screen), _tmp0_);
 
207
        self->priv->name = (_tmp1_ = g_strdup (name), _g_free0 (self->priv->name), _tmp1_);
 
208
        self->priv->actions = (_tmp2_ = NULL, __g_list_free_g_object_unref0 (self->priv->actions), _tmp2_);
 
209
        self->priv->time = (g_get_current_time (&_tmp3_), _tmp3_);
 
210
        self->priv->ignore = (_tmp4_ = g_list_copy (ignore), _g_list_free0 (self->priv->ignore), _tmp4_);
 
211
        display = _g_object_ref0 (ccm_screen_get_display (screen));
 
212
        g_signal_connect_object (display, "event", (GCallback) _ccm_story_board_on_event_ccm_display_event, self, 0);
 
213
        _g_object_unref0 (display);
 
214
        return self;
 
215
}
 
216
 
 
217
 
 
218
CCMStoryBoard* ccm_story_board_new (CCMScreen* screen, const char* name, GList* ignore) {
 
219
        return ccm_story_board_construct (CCM_TYPE_STORY_BOARD, screen, name, ignore);
 
220
}
 
221
 
 
222
 
 
223
static void ccm_story_board_on_event (CCMStoryBoard* self, CCMDisplay* display, XEvent* event) {
 
224
        GError * _inner_error_;
 
225
        GTimeVal _tmp0_ = {0};
 
226
        GTimeVal current;
 
227
        glong diff;
 
228
        g_return_if_fail (self != NULL);
 
229
        g_return_if_fail (display != NULL);
 
230
        _inner_error_ = NULL;
 
231
        current = (g_get_current_time (&_tmp0_), _tmp0_);
 
232
        diff = ((current.tv_sec * 1000000) + current.tv_usec) - ((self->priv->time.tv_sec * 1000000) + self->priv->time.tv_usec);
 
233
        if ((*event).type == MotionNotify) {
 
234
                CCMAction* _tmp1_;
 
235
                CCMAction* action;
 
236
                gboolean insert;
 
237
                gboolean _tmp2_ = FALSE;
 
238
                _tmp1_ = NULL;
 
239
                if (g_list_last (self->priv->actions) != NULL) {
 
240
                        _tmp1_ = (CCMAction*) g_list_last (self->priv->actions)->data;
 
241
                } else {
 
242
                        _tmp1_ = NULL;
 
243
                }
 
244
                action = _g_object_ref0 (_tmp1_);
 
245
                insert = TRUE;
 
246
                if (self->priv->_hint_motion) {
 
247
                        _tmp2_ = action != NULL;
 
248
                } else {
 
249
                        _tmp2_ = FALSE;
 
250
                }
 
251
                if (_tmp2_) {
 
252
                        if (CCM_IS_ACTION_POINTER_MOTION (action)) {
 
253
                                ccm_action_pointer_motion_set_event (CCM_ACTION_POINTER_MOTION (action), event);
 
254
                                ccm_action_set_time ((CCMAction*) CCM_ACTION_POINTER_MOTION (action), (glong) ((gint) (((double) diff) / ((double) 1000))));
 
255
                                insert = FALSE;
 
256
                        }
 
257
                }
 
258
                if (insert) {
 
259
                        CCMAction* _tmp3_;
 
260
                        action = (_tmp3_ = (CCMAction*) ccm_action_pointer_motion_new (self->priv->screen, event, diff), _g_object_unref0 (action), _tmp3_);
 
261
                        self->priv->actions = g_list_append (self->priv->actions, _g_object_ref0 (action));
 
262
                }
 
263
                _g_object_unref0 (action);
 
264
        } else {
 
265
                if ((*event).type == ButtonPress) {
 
266
                        {
 
267
                                CCMActionPointerPress* action;
 
268
                                action = ccm_action_pointer_press_new (self->priv->screen, event, diff, self->priv->ignore, &_inner_error_);
 
269
                                if (_inner_error_ != NULL) {
 
270
                                        if (_inner_error_->domain == CCM_ACTION_ERROR) {
 
271
                                                goto __catch0_ccm_action_error;
 
272
                                        }
 
273
                                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
274
                                        g_clear_error (&_inner_error_);
 
275
                                        return;
 
276
                                }
 
277
                                self->priv->actions = g_list_append (self->priv->actions, _g_object_ref0 ((CCMAction*) action));
 
278
                                _g_object_unref0 (action);
 
279
                        }
 
280
                        goto __finally0;
 
281
                        __catch0_ccm_action_error:
 
282
                        {
 
283
                                GError * ex;
 
284
                                ex = _inner_error_;
 
285
                                _inner_error_ = NULL;
 
286
                                {
 
287
                                        ccm_debug (ex->message, NULL);
 
288
                                        _g_error_free0 (ex);
 
289
                                }
 
290
                        }
 
291
                        __finally0:
 
292
                        if (_inner_error_ != NULL) {
 
293
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
294
                                g_clear_error (&_inner_error_);
 
295
                                return;
 
296
                        }
 
297
                } else {
 
298
                        if ((*event).type == ButtonRelease) {
 
299
                                {
 
300
                                        CCMActionPointerRelease* action;
 
301
                                        action = ccm_action_pointer_release_new (self->priv->screen, event, diff, self->priv->ignore, &_inner_error_);
 
302
                                        if (_inner_error_ != NULL) {
 
303
                                                if (_inner_error_->domain == CCM_ACTION_ERROR) {
 
304
                                                        goto __catch1_ccm_action_error;
 
305
                                                }
 
306
                                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
307
                                                g_clear_error (&_inner_error_);
 
308
                                                return;
 
309
                                        }
 
310
                                        self->priv->actions = g_list_append (self->priv->actions, _g_object_ref0 ((CCMAction*) action));
 
311
                                        _g_object_unref0 (action);
 
312
                                }
 
313
                                goto __finally1;
 
314
                                __catch1_ccm_action_error:
 
315
                                {
 
316
                                        GError * ex;
 
317
                                        ex = _inner_error_;
 
318
                                        _inner_error_ = NULL;
 
319
                                        {
 
320
                                                ccm_debug (ex->message, NULL);
 
321
                                                _g_error_free0 (ex);
 
322
                                        }
 
323
                                }
 
324
                                __finally1:
 
325
                                if (_inner_error_ != NULL) {
 
326
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
327
                                        g_clear_error (&_inner_error_);
 
328
                                        return;
 
329
                                }
 
330
                        }
 
331
                }
 
332
        }
 
333
        self->priv->time = current;
 
334
}
 
335
 
 
336
 
 
337
char* ccm_story_board_to_string (CCMStoryBoard* self, const char* format) {
 
338
        char* result;
 
339
        char* val;
 
340
        char* _tmp4_;
 
341
        g_return_val_if_fail (self != NULL, NULL);
 
342
        g_return_val_if_fail (format != NULL, NULL);
 
343
        val = g_strdup ("<story-board>\n");
 
344
        {
 
345
                GList* action_collection;
 
346
                GList* action_it;
 
347
                action_collection = self->priv->actions;
 
348
                for (action_it = action_collection; action_it != NULL; action_it = action_it->next) {
 
349
                        CCMAction* action;
 
350
                        action = _g_object_ref0 ((CCMAction*) action_it->data);
 
351
                        {
 
352
                                char* _tmp3_;
 
353
                                char* _tmp2_;
 
354
                                char* _tmp1_;
 
355
                                char* _tmp0_;
 
356
                                val = (_tmp3_ = g_strconcat (val, _tmp2_ = g_strconcat (_tmp1_ = g_strconcat ("  ", _tmp0_ = ccm_action_to_string (action, "%ccma"), NULL), "\n", NULL), NULL), _g_free0 (val), _tmp3_);
 
357
                                _g_free0 (_tmp2_);
 
358
                                _g_free0 (_tmp1_);
 
359
                                _g_free0 (_tmp0_);
 
360
                                _g_object_unref0 (action);
 
361
                        }
 
362
                }
 
363
        }
 
364
        val = (_tmp4_ = g_strconcat (val, "</story-board>\n", NULL), _g_free0 (val), _tmp4_);
 
365
        result = val;
 
366
        return result;
 
367
}
 
368
 
 
369
 
 
370
gboolean ccm_story_board_get_hint_motion (CCMStoryBoard* self) {
 
371
        gboolean result;
 
372
        g_return_val_if_fail (self != NULL, FALSE);
 
373
        result = self->priv->_hint_motion;
 
374
        return result;
 
375
}
 
376
 
 
377
 
 
378
void ccm_story_board_set_hint_motion (CCMStoryBoard* self, gboolean value) {
 
379
        g_return_if_fail (self != NULL);
 
380
        self->priv->_hint_motion = value;
 
381
        g_object_notify ((GObject *) self, "hint-motion");
 
382
}
 
383
 
 
384
 
 
385
static void ccm_story_board_class_init (CCMStoryBoardClass * klass) {
 
386
        ccm_story_board_parent_class = g_type_class_peek_parent (klass);
 
387
        g_type_class_add_private (klass, sizeof (CCMStoryBoardPrivate));
 
388
        G_OBJECT_CLASS (klass)->get_property = ccm_story_board_get_property;
 
389
        G_OBJECT_CLASS (klass)->set_property = ccm_story_board_set_property;
 
390
        G_OBJECT_CLASS (klass)->finalize = ccm_story_board_finalize;
 
391
        g_object_class_install_property (G_OBJECT_CLASS (klass), CCM_STORY_BOARD_HINT_MOTION, g_param_spec_boolean ("hint-motion", "hint-motion", "hint-motion", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
 
392
}
 
393
 
 
394
 
 
395
static void ccm_story_board_instance_init (CCMStoryBoard * self) {
 
396
        self->priv = CCM_STORY_BOARD_GET_PRIVATE (self);
 
397
}
 
398
 
 
399
 
 
400
static void ccm_story_board_finalize (GObject* obj) {
 
401
        CCMStoryBoard * self;
 
402
        self = CCM_STORY_BOARD (obj);
 
403
        _g_object_unref0 (self->priv->screen);
 
404
        _g_free0 (self->priv->name);
 
405
        _g_list_free0 (self->priv->ignore);
 
406
        __g_list_free_g_object_unref0 (self->priv->actions);
 
407
        G_OBJECT_CLASS (ccm_story_board_parent_class)->finalize (obj);
 
408
}
 
409
 
 
410
 
 
411
GType ccm_story_board_get_type (void) {
 
412
        return ccm_story_board_type_id;
 
413
}
 
414
 
 
415
 
 
416
GType ccm_story_board_register_type (GTypeModule * module) {
 
417
        static const GTypeInfo g_define_type_info = { sizeof (CCMStoryBoardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ccm_story_board_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CCMStoryBoard), 0, (GInstanceInitFunc) ccm_story_board_instance_init, NULL };
 
418
        ccm_story_board_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "CCMStoryBoard", &g_define_type_info, 0);
 
419
        return ccm_story_board_type_id;
 
420
}
 
421
 
 
422
 
 
423
static void ccm_story_board_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
 
424
        CCMStoryBoard * self;
 
425
        self = CCM_STORY_BOARD (object);
 
426
        switch (property_id) {
 
427
                case CCM_STORY_BOARD_HINT_MOTION:
 
428
                g_value_set_boolean (value, ccm_story_board_get_hint_motion (self));
 
429
                break;
 
430
                default:
 
431
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
432
                break;
 
433
        }
 
434
}
 
435
 
 
436
 
 
437
static void ccm_story_board_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
 
438
        CCMStoryBoard * self;
 
439
        self = CCM_STORY_BOARD (object);
 
440
        switch (property_id) {
 
441
                case CCM_STORY_BOARD_HINT_MOTION:
 
442
                ccm_story_board_set_hint_motion (self, g_value_get_boolean (value));
 
443
                break;
 
444
                default:
 
445
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
446
                break;
 
447
        }
 
448
}
 
449
 
 
450
 
 
451
 
 
452