~ubuntu-branches/ubuntu/karmic/mergeant/karmic

« back to all changes in this revision

Viewing changes to libmergeant/mg-work-layout.c

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo R. Montesino
  • Date: 2007-11-29 08:44:48 UTC
  • mfrom: (2.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20071129084448-6aon73d22bv6hzfw
Tags: 0.67-3
* Re-enable installation of the mime files in mergeant.install
* mergeant.dirs: create usr/share/mime/packages to make dh_installmime add
  the update-mime-database code snippets

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* mg-work-layout.c
2
 
 *
3
 
 * Copyright (C) 2004 Vivien Malerba
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License as
7
 
 * published by the Free Software Foundation; either version 2 of the
8
 
 * License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
 
 * USA
19
 
 */
20
 
 
21
 
#include <string.h>
22
 
#include "mg-work-layout.h"
23
 
#include "mg-work-widget.h"
24
 
#include "mg-custom-layout.h"
25
 
#include "mg-referer.h"
26
 
#include "mg-target.h"
27
 
#include "mg-db-table.h"
28
 
#include "mg-work-grid.h"
29
 
#include "mg-work-form.h"
30
 
#include "mg-work-matrix.h"
31
 
#include "mg-qfield.h"
32
 
 
33
 
static void mg_work_layout_class_init (MgWorkLayoutClass * class);
34
 
static void mg_work_layout_init (MgWorkLayout * wid);
35
 
static void mg_work_layout_dispose (GObject   * object);
36
 
 
37
 
static void mg_work_layout_set_property (GObject              *object,
38
 
                                       guint                 param_id,
39
 
                                       const GValue         *value,
40
 
                                       GParamSpec           *pspec);
41
 
static void mg_work_layout_get_property (GObject              *object,
42
 
                                       guint                 param_id,
43
 
                                       GValue               *value,
44
 
                                       GParamSpec           *pspec);
45
 
 
46
 
static void mg_work_layout_initialize (MgWorkLayout *form);
47
 
 
48
 
static void nullified_custom_layout_cb (MgCustomLayout *layout, MgWorkLayout *form);
49
 
 
50
 
/* MgWorkWidget interface */
51
 
static void            mg_work_layout_widget_init         (MgWorkWidgetIface *iface);
52
 
static void            mg_work_layout_run                 (MgWorkWidget *iface, guint mode);
53
 
static void            mg_work_layout_show_global_actions (MgWorkWidget *iface, gboolean show_actions);
54
 
static MgParameter    *mg_work_layout_get_param_for_field (MgWorkWidget *iface, MgQfield *field, const gchar *field_name, 
55
 
                                                           gboolean in_exec_context);
56
 
static MgContext      *mg_work_layout_get_exec_context    (MgWorkWidget *iface);
57
 
 
58
 
struct _MgWorkLayoutPrivate {
59
 
        MgCustomLayout  *layout;
60
 
 
61
 
        /* global context */
62
 
        MgContext       *exec_context; /* garbage of parameters not dependant on each others */
63
 
 
64
 
        /* sub layouts */
65
 
        GSList          *work_widgets; /* list of MgWorkLayout widgets */
66
 
 
67
 
        /* glade layout */
68
 
        GladeXML        *glade_instance;
69
 
};
70
 
 
71
 
/* get a pointer to the parents to be able to call their destructor */
72
 
static GObjectClass *parent_class = NULL;
73
 
 
74
 
/* properties */
75
 
enum
76
 
{
77
 
        PROP_0,
78
 
};
79
 
 
80
 
guint
81
 
mg_work_layout_get_type (void)
82
 
{
83
 
        static GType type = 0;
84
 
 
85
 
        if (!type) {
86
 
                static const GTypeInfo info = {
87
 
                        sizeof (MgWorkLayoutClass),
88
 
                        (GBaseInitFunc) NULL,
89
 
                        (GBaseFinalizeFunc) NULL,
90
 
                        (GClassInitFunc) mg_work_layout_class_init,
91
 
                        NULL,
92
 
                        NULL,
93
 
                        sizeof (MgWorkLayout),
94
 
                        0,
95
 
                        (GInstanceInitFunc) mg_work_layout_init
96
 
                };              
97
 
                
98
 
                static const GInterfaceInfo work_widget_info = {
99
 
                        (GInterfaceInitFunc) mg_work_layout_widget_init,
100
 
                        NULL,
101
 
                        NULL
102
 
                };
103
 
                
104
 
                type = g_type_register_static (GTK_TYPE_VBOX, "MgWorkLayout", &info, 0);
105
 
                g_type_add_interface_static (type, MG_WORK_WIDGET_TYPE, &work_widget_info);
106
 
        }
107
 
 
108
 
        return type;
109
 
}
110
 
 
111
 
static void
112
 
mg_work_layout_widget_init (MgWorkWidgetIface *iface)
113
 
{
114
 
        iface->run = mg_work_layout_run;
115
 
        iface->set_mode = NULL;
116
 
        iface->set_entry_editable = NULL;
117
 
        iface->show_entry_actions = NULL;
118
 
        iface->show_global_actions = mg_work_layout_show_global_actions;
119
 
        iface->get_param_for_field = mg_work_layout_get_param_for_field;
120
 
        iface->has_been_changed = NULL;
121
 
        iface->get_exec_context = mg_work_layout_get_exec_context;
122
 
        iface->get_actions_group = NULL;
123
 
}
124
 
 
125
 
 
126
 
static void
127
 
mg_work_layout_class_init (MgWorkLayoutClass * class)
128
 
{
129
 
        GObjectClass   *object_class = G_OBJECT_CLASS (class);
130
 
        
131
 
        parent_class = g_type_class_peek_parent (class);
132
 
        object_class->dispose = mg_work_layout_dispose;
133
 
        
134
 
        /* Properties */
135
 
        object_class->set_property = mg_work_layout_set_property;
136
 
        object_class->get_property = mg_work_layout_get_property;
137
 
}
138
 
 
139
 
static void
140
 
mg_work_layout_init (MgWorkLayout * wid)
141
 
{
142
 
        wid->priv = g_new0 (MgWorkLayoutPrivate, 1);
143
 
}
144
 
 
145
 
/**
146
 
 * mg_work_layout_new
147
 
 * @layout: a #MgWorkLayout object
148
 
 *
149
 
 * Creates a new #MgWorkLayout widget.
150
 
 *
151
 
 * Returns: the new widget
152
 
 */
153
 
GtkWidget *
154
 
mg_work_layout_new (MgCustomLayout *layout)
155
 
{
156
 
        GObject *obj;
157
 
        MgWorkLayout *wl;
158
 
 
159
 
        g_return_val_if_fail (layout && IS_MG_CUSTOM_LAYOUT (layout), NULL);
160
 
 
161
 
        obj = g_object_new (MG_WORK_LAYOUT_TYPE, NULL);
162
 
        wl = MG_WORK_LAYOUT (obj);
163
 
 
164
 
        wl->priv->layout = layout;
165
 
        g_object_ref (layout);
166
 
        g_signal_connect (G_OBJECT (wl->priv->layout), "nullified",
167
 
                          G_CALLBACK (nullified_custom_layout_cb), wl);
168
 
 
169
 
        mg_work_layout_initialize (wl);
170
 
 
171
 
        return GTK_WIDGET (obj);
172
 
}
173
 
 
174
 
static void
175
 
nullified_custom_layout_cb (MgCustomLayout *layout, MgWorkLayout *wl)
176
 
{
177
 
        g_signal_handlers_disconnect_by_func (G_OBJECT (layout),
178
 
                                              G_CALLBACK (nullified_custom_layout_cb), wl);
179
 
        
180
 
        g_object_unref (G_OBJECT (wl->priv->layout));
181
 
        wl->priv->layout = NULL;
182
 
}
183
 
 
184
 
static void
185
 
mg_work_layout_dispose (GObject *object)
186
 
{
187
 
        MgWorkLayout *wl;
188
 
 
189
 
        g_return_if_fail (object != NULL);
190
 
        g_return_if_fail (IS_MG_WORK_LAYOUT (object));
191
 
        wl = MG_WORK_LAYOUT (object);
192
 
 
193
 
        if (wl->priv) {
194
 
                /* core */
195
 
                if (wl->priv->layout)
196
 
                        nullified_custom_layout_cb (wl->priv->layout, wl);
197
 
 
198
 
                if (wl->priv->exec_context)
199
 
                        g_object_unref (wl->priv->exec_context);
200
 
 
201
 
                g_slist_free (wl->priv->work_widgets);
202
 
 
203
 
                if (wl->priv->glade_instance)
204
 
                        g_object_unref (wl->priv->glade_instance);
205
 
 
206
 
                /* the private area itself */
207
 
                g_free (wl->priv);
208
 
                wl->priv = NULL;
209
 
        }
210
 
 
211
 
        /* for the parent class */
212
 
        parent_class->dispose (object);
213
 
}
214
 
 
215
 
static void
216
 
mg_work_layout_set_property (GObject              *object,
217
 
                             guint                 param_id,
218
 
                             const GValue         *value,
219
 
                             GParamSpec           *pspec)
220
 
{
221
 
        MgWorkLayout *wl;
222
 
 
223
 
        wl = MG_WORK_LAYOUT (object);
224
 
        if (wl->priv) {
225
 
                switch (param_id) {
226
 
                default:
227
 
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
228
 
                        break;
229
 
                }
230
 
        }
231
 
}
232
 
 
233
 
static void
234
 
mg_work_layout_get_property (GObject              *object,
235
 
                             guint                 param_id,
236
 
                             GValue               *value,
237
 
                             GParamSpec           *pspec)
238
 
{
239
 
        MgWorkLayout *wl;
240
 
 
241
 
        wl = MG_WORK_LAYOUT (object);
242
 
        if (wl->priv) {
243
 
                switch (param_id) {
244
 
                default:
245
 
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
246
 
                        break;
247
 
                }
248
 
        }       
249
 
}
250
 
 
251
 
 
252
 
 
253
 
/*
254
 
 * Real initialization
255
 
 */
256
 
static void init_work_form_grid (MgWorkLayout *wl);
257
 
static void init_work_matrix (MgWorkLayout *wl);
258
 
static void init_super_layout (MgWorkLayout *wl);
259
 
static void 
260
 
mg_work_layout_initialize (MgWorkLayout *wl)
261
 
{
262
 
        if (! mg_referer_activate (MG_REFERER (wl->priv->layout))) {
263
 
                GtkWidget *wid = gtk_label_new (_("missing required objects!"));
264
 
                gtk_box_pack_start (GTK_BOX (wl), wid, TRUE, TRUE, 0);
265
 
                gtk_widget_show (wid);
266
 
        }
267
 
        else {
268
 
                switch (mg_custom_layout_get_layout_type (wl->priv->layout)) {
269
 
                case MG_CUSTOM_LAYOUT_LAYOUT:
270
 
                        init_super_layout (wl);
271
 
                        break;
272
 
                case MG_CUSTOM_LAYOUT_GRID:
273
 
                case MG_CUSTOM_LAYOUT_FORM:
274
 
                        init_work_form_grid (wl);
275
 
                        break;
276
 
                case MG_CUSTOM_LAYOUT_MATRIX:
277
 
                        init_work_matrix (wl);
278
 
                        break;
279
 
                }
280
 
        }
281
 
}
282
 
 
283
 
static void
284
 
init_work_form_grid (MgWorkLayout *wl)
285
 
{
286
 
        GtkWidget *wid, *root;
287
 
        MgCustomLayout *cl = wl->priv->layout;
288
 
        GladeXML *glade;
289
 
        GHashTable *hash = NULL;
290
 
        GError *error = NULL;
291
 
        MgCustomLayoutData *cldata;
292
 
        MgTarget *target = NULL;
293
 
        gboolean err = FALSE;
294
 
 
295
 
        glade = mg_custom_layout_get_glade_instance (cl, &root, &hash, &error);
296
 
        wl->priv->glade_instance = glade;
297
 
        if (error) {
298
 
                g_warning ("Error building GladeXML file: %s", error->message);
299
 
                g_error_free (error);
300
 
                error = NULL;
301
 
        }
302
 
        
303
 
        cldata = mg_custom_layout_get_data (cl, &error);
304
 
        if (error) {
305
 
                g_warning ("Error using MgCustomLayout: %s", error->message);
306
 
                g_error_free (error);
307
 
                error = NULL;
308
 
        }
309
 
        
310
 
        /* testing */
311
 
        if (!cldata->contents.work_iface.query ||
312
 
            ! mg_query_is_select_query (cldata->contents.work_iface.query))
313
 
                err = TRUE;
314
 
 
315
 
        if (!err) {
316
 
                target = (MgTarget *) cldata->contents.work_iface.modified;
317
 
                if (!IS_MG_TARGET (target) ||
318
 
                    (mg_target_get_query (target) != cldata->contents.work_iface.query)) 
319
 
                        target = NULL;
320
 
        }
321
 
 
322
 
        if (! err) {
323
 
                /* actual widget creation */
324
 
                if (cldata->type == MG_CUSTOM_LAYOUT_GRID) 
325
 
                        wid = mg_work_grid_new (cldata->contents.work_iface.query, target);
326
 
                else 
327
 
                        wid = mg_work_form_new_in_layout (cldata->contents.work_iface.query, target, root, hash);
328
 
                wl->priv->work_widgets = g_slist_prepend (wl->priv->work_widgets, wid);
329
 
                mg_work_widget_set_mode (MG_WORK_WIDGET (wid), cldata->contents.work_iface.mode);
330
 
                g_object_set (G_OBJECT (wid), "title_visible", FALSE, NULL);
331
 
        }
332
 
        else 
333
 
                wid = gtk_label_new (_("Error creating widget"));
334
 
        
335
 
        gtk_box_pack_start (GTK_BOX (wl), wid, TRUE, TRUE, 0);
336
 
        gtk_widget_show (wid);
337
 
        if (hash)
338
 
                g_hash_table_destroy (hash);
339
 
        g_free (cldata);
340
 
}
341
 
 
342
 
static void
343
 
init_work_matrix (MgWorkLayout *wl)
344
 
{
345
 
        GtkWidget *wid;
346
 
        MgConf *conf = mg_base_get_conf (MG_BASE (wl->priv->layout));
347
 
        MgCustomLayout *cl = wl->priv->layout;
348
 
        MgCustomLayoutData *cldata;
349
 
        MgTarget *target;
350
 
        MgDbTable *table;
351
 
        gboolean err = FALSE;
352
 
        GError *error = NULL;
353
 
        
354
 
        cldata = mg_custom_layout_get_data (cl, &error);
355
 
        if (error) {
356
 
                g_warning ("Error using MgCustomLayout: %s", error->message);
357
 
                g_error_free (error);
358
 
                error = NULL;
359
 
        }
360
 
 
361
 
        
362
 
        /* tests */
363
 
        table = (MgDbTable *) cldata->contents.work_iface.modified;
364
 
        if (!IS_MG_DB_TABLE (table))
365
 
                err = TRUE;
366
 
 
367
 
        if (!cldata->contents.work_iface.query ||
368
 
            ! mg_query_is_select_query (cldata->contents.work_iface.query))
369
 
                err = TRUE;
370
 
 
371
 
        if (!cldata->contents.work_iface.query_extra ||
372
 
            ! mg_query_is_select_query (cldata->contents.work_iface.query_extra))
373
 
                err = TRUE;
374
 
 
375
 
 
376
 
        if (!err) {
377
 
                target = cldata->contents.work_iface.rows_target;
378
 
                if (!IS_MG_TARGET (target) ||
379
 
                    (mg_target_get_query (target) != cldata->contents.work_iface.query)) 
380
 
                        err = TRUE;
381
 
        }
382
 
 
383
 
        if (!err) {
384
 
                target = cldata->contents.work_iface.cols_target;
385
 
                if (!IS_MG_TARGET (target) ||
386
 
                    (mg_target_get_query (target) != cldata->contents.work_iface.query_extra)) 
387
 
                        err = TRUE;
388
 
        }
389
 
            
390
 
        /* actual widget creation */
391
 
        if (!err) {
392
 
                wid = mg_work_matrix_new (conf,
393
 
                                          cldata->contents.work_iface.query,
394
 
                                          cldata->contents.work_iface.rows_target,
395
 
                                          cldata->contents.work_iface.query_extra,
396
 
                                          cldata->contents.work_iface.cols_target,
397
 
                                          (MgDbTable *) cldata->contents.work_iface.modified,
398
 
                                          NULL);
399
 
                mg_work_matrix_set_view_type (MG_WORK_MATRIX (wid), cldata->contents.work_iface.view_type);
400
 
                wl->priv->work_widgets = g_slist_prepend (wl->priv->work_widgets, wid);
401
 
                mg_work_widget_set_mode (MG_WORK_WIDGET (wid), cldata->contents.work_iface.mode);
402
 
                g_object_set (G_OBJECT (wid), "title_visible", FALSE, NULL);
403
 
        }
404
 
        else
405
 
                wid = gtk_label_new (_("Error creating widget"));
406
 
 
407
 
        gtk_box_pack_start (GTK_BOX (wl), wid, TRUE, TRUE, 0);
408
 
        gtk_widget_show (wid);
409
 
        g_free (cldata);
410
 
}
411
 
 
412
 
static MgWorkLayout *
413
 
find_by_custom_layout (MgWorkLayout *super_layout, MgCustomLayout *cl)
414
 
{
415
 
        MgWorkLayout *retval = NULL;
416
 
        GSList *list = super_layout->priv->work_widgets;
417
 
        while (list && !retval) {
418
 
                if (MG_WORK_LAYOUT (list->data)->priv->layout == cl)
419
 
                        retval = MG_WORK_LAYOUT (list->data);
420
 
                else
421
 
                        list = g_slist_next (list);
422
 
        }
423
 
 
424
 
        return retval;
425
 
}
426
 
 
427
 
static void
428
 
init_super_layout (MgWorkLayout *wl)
429
 
{
430
 
        GtkWidget *wid, *box, *root;
431
 
        MgCustomLayout *cl = wl->priv->layout;
432
 
        GladeXML *glade;
433
 
        GHashTable *hash = NULL;
434
 
        GError *error = NULL;
435
 
        MgCustomLayoutData *cldata;
436
 
        GSList *list;
437
 
 
438
 
        glade = mg_custom_layout_get_glade_instance (cl, &root, &hash, &error);
439
 
        wl->priv->glade_instance = glade;
440
 
        if (error) {
441
 
                g_warning ("Error building GladeXML file: %s", error->message);
442
 
                g_error_free (error);
443
 
                error = NULL;
444
 
        }
445
 
 
446
 
        if (!root) {
447
 
                /* If there is no Glade layout, or if there was an error, then we use
448
 
                   a table layout */
449
 
                TO_IMPLEMENT;
450
 
        }
451
 
        
452
 
        cldata = mg_custom_layout_get_data (cl, &error);
453
 
        if (error) {
454
 
                g_warning ("Error using MgCustomLayout: %s", error->message);
455
 
                g_error_free (error);
456
 
                error = NULL;
457
 
        }
458
 
        
459
 
        /* actual widget creation */
460
 
        list = cldata->contents.layout.children;
461
 
        while (list) {
462
 
                wid = mg_work_layout_new (MG_CUSTOM_LAYOUT (list->data));
463
 
 
464
 
                if (hash) {
465
 
                        box = g_hash_table_lookup (hash, list->data);
466
 
                        gtk_box_pack_start (GTK_BOX (box), wid, TRUE, TRUE, 0);
467
 
                        gtk_widget_show (wid);
468
 
                        if (! g_object_get_data (G_OBJECT (box), "show_actions")) 
469
 
                                mg_work_widget_alldata_show_actions (MG_WORK_WIDGET (wid), FALSE);
470
 
                }
471
 
                else {
472
 
                        TO_IMPLEMENT;
473
 
                }
474
 
 
475
 
                wl->priv->work_widgets = g_slist_prepend (wl->priv->work_widgets, wid);
476
 
                list = g_slist_next (list);
477
 
        }
478
 
 
479
 
        list = cldata->contents.layout.connects;
480
 
        while (list) {
481
 
                MgCustomLayoutConnect *lc = (MgCustomLayoutConnect*) list->data;
482
 
                MgWorkWidget *src, *dest;
483
 
                MgParameter *param_src, *param_dest;
484
 
                MgWorkLayout *tmp;
485
 
 
486
 
                tmp = find_by_custom_layout (wl, lc->src_layout);
487
 
                g_assert (tmp->priv && (g_slist_length (tmp->priv->work_widgets) == 1));
488
 
                src = MG_WORK_WIDGET (tmp->priv->work_widgets->data);
489
 
 
490
 
                tmp = find_by_custom_layout (wl, lc->dest_layout);
491
 
                g_assert (tmp->priv && (g_slist_length (tmp->priv->work_widgets) == 1));
492
 
                dest = MG_WORK_WIDGET (tmp->priv->work_widgets->data);
493
 
 
494
 
                param_src = mg_work_widget_get_param_for_field_data (src, MG_QFIELD (lc->src_field));
495
 
                if (!param_src) 
496
 
                        g_warning (_("Cannot find a parameter for source field connection"));
497
 
                param_dest = mg_work_widget_get_param_for_field_exec (dest, MG_QFIELD (lc->dest_field));
498
 
                if (!param_dest) 
499
 
                        g_warning (_("Cannot find a parameter for destination field connection"));
500
 
                
501
 
                if (param_src && param_dest)
502
 
                        mg_parameter_bind_to_param (param_dest, param_src);
503
 
                
504
 
                list = g_slist_next (list);
505
 
        }
506
 
        
507
 
        gtk_box_pack_start (GTK_BOX (wl), root, TRUE, TRUE, 0);
508
 
        gtk_widget_show (root);
509
 
        if (hash)
510
 
                g_hash_table_destroy (hash);
511
 
        g_free (cldata);
512
 
}
513
 
 
514
 
/**
515
 
 * mg_work_layout_lookup_widget
516
 
 * @layout: a #MgWorkLayout widget
517
 
 * @widget_name: a string
518
 
 *
519
 
 * Retreives the #GtkWidget which name is @widget_name, if @layout
520
 
 * uses a Glade file as layout.
521
 
 *
522
 
 * Returns: the requested #GtkWidget, or %NULL if not found
523
 
 */
524
 
GtkWidget *
525
 
mg_work_layout_lookup_widget (MgWorkLayout *layout, const gchar *widget_name)
526
 
{
527
 
        GtkWidget *retval = NULL;
528
 
 
529
 
        g_return_val_if_fail (layout && IS_MG_WORK_LAYOUT (layout), NULL);
530
 
        g_return_val_if_fail (layout->priv, NULL);
531
 
 
532
 
        if (layout->priv->glade_instance)
533
 
                retval = glade_xml_get_widget (layout->priv->glade_instance, widget_name);
534
 
 
535
 
        return retval;
536
 
}
537
 
 
538
 
/*
539
 
 * MgWorkWidget interface implementation
540
 
 */
541
 
static void
542
 
mg_work_layout_run (MgWorkWidget *iface, guint mode)
543
 
{
544
 
        GSList *list;
545
 
        MgWorkLayout *wl;
546
 
 
547
 
        g_return_if_fail (iface && IS_MG_WORK_LAYOUT (iface));
548
 
        wl = MG_WORK_LAYOUT (iface);
549
 
        g_return_if_fail (wl->priv);
550
 
 
551
 
        list = wl->priv->work_widgets;
552
 
        while (list) {
553
 
                mg_work_widget_run (MG_WORK_WIDGET (list->data), 0); /* don't change previous mode */
554
 
                list = g_slist_next (list);
555
 
        }
556
 
}
557
 
 
558
 
static void
559
 
mg_work_layout_show_global_actions (MgWorkWidget *iface, gboolean show_actions)
560
 
{
561
 
        GSList *list;
562
 
        MgWorkLayout *wl;
563
 
 
564
 
        g_return_if_fail (iface && IS_MG_WORK_LAYOUT (iface));
565
 
        wl = MG_WORK_LAYOUT (iface);
566
 
        g_return_if_fail (wl->priv);
567
 
 
568
 
        list = wl->priv->work_widgets;
569
 
        while (list) {
570
 
                mg_work_widget_alldata_show_actions (MG_WORK_WIDGET (list->data), show_actions);
571
 
                list = g_slist_next (list);
572
 
        }
573
 
}
574
 
 
575
 
static MgParameter *
576
 
mg_work_layout_get_param_for_field (MgWorkWidget *iface, MgQfield *field, const gchar *field_name, gboolean in_exec_context)
577
 
{
578
 
        MgWorkLayout *wl;
579
 
        MgParameter *param = NULL;
580
 
 
581
 
        g_return_val_if_fail (iface && IS_MG_WORK_LAYOUT (iface), NULL);
582
 
        wl = MG_WORK_LAYOUT (iface);
583
 
        g_return_val_if_fail (wl->priv, NULL);
584
 
        g_return_val_if_fail (field || (field_name && *field_name), NULL);
585
 
        
586
 
        TO_IMPLEMENT;
587
 
        return param;
588
 
}
589
 
 
590
 
 
591
 
static MgContext *
592
 
mg_work_layout_get_exec_context (MgWorkWidget *iface)
593
 
{
594
 
        MgWorkLayout *wl;
595
 
 
596
 
        g_return_val_if_fail (iface && IS_MG_WORK_LAYOUT (iface), NULL);
597
 
        wl = MG_WORK_LAYOUT (iface);
598
 
        g_return_val_if_fail (wl->priv, NULL);
599
 
        
600
 
        return wl->priv->exec_context;
601
 
}