~ubuntu-branches/debian/stretch/glade/stretch

« back to all changes in this revision

Viewing changes to gladeui/glade-widget-adaptor.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Emilio Pozuelo Monfort, Andreas Henriksson
  • Date: 2014-05-23 13:00:17 UTC
  • mfrom: (1.3.2)
  • Revision ID: package-import@ubuntu.com-20140523130017-7sp231ghdz55szde
Tags: 3.18.3-1
[ Emilio Pozuelo Monfort ]
* debian/rules:
  + Pass -c4 to dpkg-gensymbols so we know when new symbols are added.
* debian/libgladeui-2-6.symbols:
  + Add missing symbols.

[ Andreas Henriksson ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
#define DEFAULT_ICON_NAME "widget-gtk-frame"
57
57
 
58
 
#define GLADE_WIDGET_ADAPTOR_GET_PRIVATE(o)  \
59
 
        (G_TYPE_INSTANCE_GET_PRIVATE ((o), GLADE_TYPE_WIDGET_ADAPTOR, GladeWidgetAdaptorPrivate))
60
 
 
61
58
struct _GladeWidgetAdaptorPrivate
62
59
{
63
60
  GType        type;                /* GType of the widget */
149
146
 * no reason for it since the autogenerated class for GtWidget is GladeGtkWidgetAdaptor
150
147
 * TODO: rename GladeWidgetAdaptor to GladeGObjectAdator or GladeObjectAdator
151
148
 */
152
 
G_DEFINE_TYPE (GladeWidgetAdaptor, glade_widget_adaptor, G_TYPE_OBJECT);
 
149
G_DEFINE_TYPE_WITH_PRIVATE (GladeWidgetAdaptor, glade_widget_adaptor, G_TYPE_OBJECT);
153
150
 
154
151
/*******************************************************************************
155
152
                              Helper functions
230
227
}
231
228
 
232
229
static gboolean
233
 
glade_widget_adaptor_hash_find (gpointer key, gpointer value,
 
230
glade_widget_adaptor_hash_find (gpointer key,
 
231
                                gpointer value, 
234
232
                                gpointer user_data)
235
233
{
236
234
  GladeWidgetAdaptor *adaptor = value;
259
257
    }
260
258
}
261
259
 
 
260
static GladeInternalChild *
 
261
gwa_internal_child_find (GList *list, const gchar *name)
 
262
{
 
263
  GList *l;
 
264
 
 
265
  for (l = list; l; l = g_list_next (l))
 
266
    {
 
267
      GladeInternalChild *data = l->data;
 
268
 
 
269
      if (strcmp (data->name, name) == 0)
 
270
        return data;
 
271
      
 
272
      if (data->children)
 
273
        {
 
274
          GladeInternalChild *child;
 
275
          if ((child = gwa_internal_child_find (data->children, name)))
 
276
            return child;
 
277
        }
 
278
    }
 
279
  
 
280
  return NULL;
 
281
}
 
282
 
262
283
/*******************************************************************************
263
284
                     Base Object Implementation detail
264
285
 *******************************************************************************/
398
419
 
399
420
static void
400
421
gwa_setup_introspected_props_from_pspecs (GladeWidgetAdaptor *adaptor,
401
 
                                          GParamSpec **specs,
402
 
                                          gint n_specs, gboolean is_packing)
 
422
                                          GParamSpec        **specs,
 
423
                                          gint                n_specs,
 
424
                                          gboolean            is_packing)
403
425
{
404
426
  GladeWidgetAdaptor *parent_adaptor = gwa_get_parent_adaptor (adaptor);
405
427
  GladePropertyClass *property_class;
433
455
 
434
456
static void
435
457
gwa_setup_properties (GladeWidgetAdaptor *adaptor,
436
 
                      GObjectClass *object_class, gboolean is_packing)
 
458
                      GObjectClass       *object_class,
 
459
                      gboolean            is_packing)
437
460
{
438
461
  GParamSpec **specs = NULL;
439
462
  guint n_specs = 0;
583
606
}
584
607
 
585
608
static GObject *
586
 
glade_widget_adaptor_constructor (GType type,
587
 
                                  guint n_construct_properties,
588
 
                                  GObjectConstructParam * construct_properties)
 
609
glade_widget_adaptor_constructor (GType                  type,
 
610
                                  guint                  n_construct_properties,
 
611
                                  GObjectConstructParam *construct_properties)
589
612
{
590
613
  GladeWidgetAdaptor *adaptor, *parent_adaptor;
591
614
  GObject *ret_obj;
672
695
}
673
696
 
674
697
static void
675
 
gwa_packing_default_free (GladePackingDefault * def)
 
698
gwa_packing_default_free (GladePackingDefault *def)
676
699
{
677
700
  g_free (def->id);
678
701
  g_free (def->value);
679
702
}
680
703
 
681
704
static void
682
 
gwa_child_packing_free (GladeChildPacking * packing)
 
705
gwa_child_packing_free (GladeChildPacking *packing)
683
706
{
684
707
  g_free (packing->parent_name);
685
708
 
779
802
}
780
803
 
781
804
static void
782
 
glade_widget_adaptor_real_set_property (GObject *object,
783
 
                                        guint prop_id,
 
805
glade_widget_adaptor_real_set_property (GObject      *object,
 
806
                                        guint         prop_id,
784
807
                                        const GValue *value,
785
 
                                        GParamSpec *pspec)
 
808
                                        GParamSpec   *pspec)
786
809
{
787
810
  GladeWidgetAdaptor *adaptor;
788
811
 
834
857
}
835
858
 
836
859
static void
837
 
glade_widget_adaptor_real_get_property (GObject *object,
838
 
                                        guint prop_id,
839
 
                                        GValue *value,
 
860
glade_widget_adaptor_real_get_property (GObject    *object,
 
861
                                        guint       prop_id,
 
862
                                        GValue     *value,
840
863
                                        GParamSpec *pspec)
841
864
{
842
865
 
884
907
 *******************************************************************************/
885
908
static GladeWidget *
886
909
glade_widget_adaptor_object_create_widget (GladeWidgetAdaptor *adaptor,
887
 
                                           const gchar *first_property_name,
888
 
                                           va_list var_args)
 
910
                                           const gchar        *first_property_name,
 
911
                                           va_list             var_args)
889
912
{
890
913
  return GLADE_WIDGET (g_object_new_valist (GLADE_TYPE_WIDGET,
891
914
                                            first_property_name, var_args));
893
916
 
894
917
static GObject *
895
918
glade_widget_adaptor_object_construct_object (GladeWidgetAdaptor *adaptor,
896
 
                                              guint n_parameters,
897
 
                                              GParameter *parameters)
 
919
                                              guint               n_parameters,
 
920
                                              GParameter         *parameters)
898
921
{
899
922
  return g_object_newv (adaptor->priv->type, n_parameters, parameters);
900
923
}
909
932
 
910
933
static GObject *
911
934
glade_widget_adaptor_object_get_internal_child (GladeWidgetAdaptor *adaptor,
912
 
                                                GObject *object,
913
 
                                                const gchar *name)
 
935
                                                GObject            *object,
 
936
                                                const gchar        *name)
914
937
{
915
938
  static GtkBuilder *builder = NULL;
916
939
  
939
962
 
940
963
static void
941
964
glade_widget_adaptor_object_set_property (GladeWidgetAdaptor *adaptor,
942
 
                                          GObject *object,
943
 
                                          const gchar *property_name,
944
 
                                          const GValue *value)
 
965
                                          GObject            *object,
 
966
                                          const gchar        *property_name,
 
967
                                          const GValue       *value)
945
968
{
946
969
  g_object_set_property (object, property_name, value);
947
970
}
948
971
 
949
972
static void
950
973
glade_widget_adaptor_object_get_property (GladeWidgetAdaptor *adaptor,
951
 
                                          GObject *object,
952
 
                                          const gchar *property_name,
953
 
                                          GValue *value)
 
974
                                          GObject            *object,
 
975
                                          const gchar        *property_name,
 
976
                                          GValue             *value)
954
977
{
955
978
  g_object_get_property (object, property_name, value);
956
979
}
957
980
 
958
981
static void
959
982
glade_widget_adaptor_object_action_activate (GladeWidgetAdaptor *adaptor,
960
 
                                             GObject *object,
961
 
                                             const gchar *action_id)
 
983
                                             GObject            *object,
 
984
                                             const gchar        *action_id)
962
985
{
963
986
  g_message ("No action_activate() support in adaptor %s for action '%s'",
964
987
             adaptor->priv->name, action_id);
966
989
 
967
990
static void
968
991
glade_widget_adaptor_object_child_action_activate (GladeWidgetAdaptor *adaptor,
969
 
                                                   GObject *container,
970
 
                                                   GObject *object,
971
 
                                                   const gchar *action_id)
 
992
                                                   GObject            *container,
 
993
                                                   GObject            *object,
 
994
                                                   const gchar        *action_id)
972
995
{
973
996
  g_message ("No child_action_activate() support in adaptor %s for action '%s'",
974
997
             adaptor->priv->name, action_id);
976
999
 
977
1000
static void
978
1001
glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor,
979
 
                                         GladeWidget *widget,
980
 
                                         GladeXmlNode *node)
 
1002
                                         GladeWidget        *widget,
 
1003
                                         GladeXmlNode       *node)
981
1004
{
982
1005
  GladeXmlNode *iter_node;
983
1006
  GladeSignal *signal;
1050
1073
 
1051
1074
static void
1052
1075
glade_widget_adaptor_object_write_widget (GladeWidgetAdaptor *adaptor,
1053
 
                                          GladeWidget *widget,
1054
 
                                          GladeXmlContext *context,
1055
 
                                          GladeXmlNode *node)
 
1076
                                          GladeWidget        *widget,
 
1077
                                          GladeXmlContext    *context,
 
1078
                                          GladeXmlNode       *node)
1056
1079
{
1057
1080
  GList *props;
1058
1081
 
1070
1093
 
1071
1094
static void
1072
1095
glade_widget_adaptor_object_write_widget_after (GladeWidgetAdaptor *adaptor,
1073
 
                                                GladeWidget *widget,
1074
 
                                                GladeXmlContext *context,
1075
 
                                                GladeXmlNode *node)
 
1096
                                                GladeWidget        *widget,
 
1097
                                                GladeXmlContext    *context,
 
1098
                                                GladeXmlNode       *node)
1076
1099
{
1077
1100
 
1078
1101
}
1079
1102
 
1080
1103
static void
1081
1104
glade_widget_adaptor_object_read_child (GladeWidgetAdaptor *adaptor,
1082
 
                                        GladeWidget *widget,
1083
 
                                        GladeXmlNode *node)
 
1105
                                        GladeWidget        *widget,
 
1106
                                        GladeXmlNode       *node)
1084
1107
{
1085
1108
  GladeXmlNode *widget_node, *packing_node, *iter_node;
1086
1109
  GladeWidget *child_widget;
1156
1179
 
1157
1180
static void
1158
1181
glade_widget_adaptor_object_write_child (GladeWidgetAdaptor *adaptor,
1159
 
                                         GladeWidget *widget,
1160
 
                                         GladeXmlContext *context,
1161
 
                                         GladeXmlNode *node)
 
1182
                                         GladeWidget        *widget,
 
1183
                                         GladeXmlContext    *context,
 
1184
                                         GladeXmlNode       *node)
1162
1185
{
1163
1186
  GladeXmlNode *child_node, *packing_node;
1164
1187
  GList *props;
1260
1283
static GladeEditorProperty *
1261
1284
glade_widget_adaptor_object_create_eprop (GladeWidgetAdaptor *adaptor,
1262
1285
                                          GladePropertyClass *klass,
1263
 
                                          gboolean use_command)
 
1286
                                          gboolean            use_command)
1264
1287
{
1265
1288
  GladeEditorProperty *eprop;
1266
1289
  GParamSpec          *pspec;
1289
1312
static gchar *
1290
1313
glade_widget_adaptor_object_string_from_value (GladeWidgetAdaptor *adaptor,
1291
1314
                                               GladePropertyClass *klass,
1292
 
                                               const GValue *value)
 
1315
                                               const GValue       *value)
1293
1316
{
1294
1317
  return glade_property_class_make_string_from_gvalue (klass, value);
1295
1318
}
1301
1324
  return (GladeEditable *) glade_editor_table_new (adaptor, type);
1302
1325
}
1303
1326
 
 
1327
static void
 
1328
glade_internal_child_append (GladeWidgetAdaptor *adaptor,
 
1329
                             GObject            *object,
 
1330
                             GList              *list,
 
1331
                             GList             **children)
 
1332
{
 
1333
  GList *l;
 
1334
 
 
1335
  for (l = list; l; l = g_list_next (l))
 
1336
    {
 
1337
      GladeInternalChild *internal = l->data;
 
1338
      GObject *child;
 
1339
        
 
1340
      child = glade_widget_adaptor_get_internal_child (adaptor,
 
1341
                                                       object,
 
1342
                                                       internal->name);
 
1343
      if (child)
 
1344
        *children = g_list_prepend (*children, child);
 
1345
    }
 
1346
}
 
1347
 
1304
1348
static GList *
1305
1349
glade_widget_adaptor_object_get_children (GladeWidgetAdaptor *adaptor,
1306
1350
                                          GObject *object)
1307
1351
{
1308
 
  GList *list = adaptor->priv->internal_children;
1309
 
  GList *l, *children = NULL;
1310
 
  
1311
 
  for (l = list; l; l = g_list_next (l))
 
1352
  GladeWidget *gwidget = glade_widget_get_from_gobject (object);
 
1353
  GList *children = NULL;
 
1354
  const gchar *name;
 
1355
 
 
1356
  if (gwidget && (name = glade_widget_get_internal (gwidget)))
1312
1357
    {
1313
 
      GladeInternalChild *internal = l->data;
1314
 
      GObject *child;
1315
 
        
1316
 
      child = glade_widget_adaptor_get_internal_child (adaptor,
1317
 
                                                       object,
1318
 
                                                       internal->name);
1319
 
      if (child)
1320
 
        children = g_list_prepend (children, child);
 
1358
      GladeWidget *parent = gwidget;
 
1359
 
 
1360
      /* Get non internal parent */
 
1361
      while ((parent = glade_widget_get_parent (parent)) &&
 
1362
             glade_widget_get_internal (parent));
 
1363
 
 
1364
      if (parent)
 
1365
        {
 
1366
          GladeWidgetAdaptor *padaptor = glade_widget_get_adaptor (parent);
 
1367
          GladeInternalChild *internal;
 
1368
 
 
1369
          internal = gwa_internal_child_find (padaptor->priv->internal_children,
 
1370
                                              name);
 
1371
 
 
1372
          if (internal && internal->children)
 
1373
            glade_internal_child_append (padaptor, glade_widget_get_object (parent),
 
1374
                                         internal->children, &children);
 
1375
        }
 
1376
 
 
1377
      return children;
1321
1378
    }
1322
1379
 
 
1380
  glade_internal_child_append (adaptor, object,
 
1381
                               adaptor->priv->internal_children,
 
1382
                               &children);
 
1383
 
1323
1384
  return children;
1324
1385
}
1325
1386
 
1330
1391
static void
1331
1392
glade_widget_adaptor_init (GladeWidgetAdaptor *adaptor)
1332
1393
{
1333
 
  adaptor->priv = GLADE_WIDGET_ADAPTOR_GET_PRIVATE (adaptor);
 
1394
  adaptor->priv = glade_widget_adaptor_get_instance_private (adaptor);
1334
1395
 
1335
1396
}
1336
1397
 
1448
1509
       g_param_spec_pointer
1449
1510
       ("cursor", _("Cursor"),
1450
1511
        _("A cursor for inserting widgets in the UI"), G_PARAM_READABLE));
1451
 
 
1452
 
  g_type_class_add_private (adaptor_class, sizeof (GladeWidgetAdaptorPrivate));
1453
1512
}
1454
1513
 
1455
1514
/*******************************************************************************
1482
1541
 
1483
1542
static void
1484
1543
gwa_extend_with_node_load_sym (GladeWidgetAdaptorClass *klass,
1485
 
                               GladeXmlNode *node, GModule *module)
 
1544
                               GladeXmlNode            *node,
 
1545
                               GModule                 *module)
1486
1546
{
1487
1547
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
1488
1548
  gpointer symbol;
1623
1683
 
1624
1684
static void
1625
1685
gwa_derived_class_init (GladeWidgetAdaptorClass *adaptor_class,
1626
 
                        GWADerivedClassData *data)
 
1686
                        GWADerivedClassData     *data)
1627
1687
{
1628
1688
  GladeXmlNode *node = data->node;
1629
1689
  GModule *module = data->module;
1852
1912
 
1853
1913
static GladeChildPacking *
1854
1914
glade_widget_adaptor_get_child_packing (GladeWidgetAdaptor *child_adaptor,
1855
 
                                        const gchar *parent_name)
 
1915
                                        const gchar        *parent_name)
1856
1916
{
1857
1917
  GList *l;
1858
1918
 
1871
1931
 
1872
1932
static void
1873
1933
gwa_set_packing_defaults_from_node (GladeWidgetAdaptor *adaptor,
1874
 
                                    GladeXmlNode *node)
 
1934
                                    GladeXmlNode       *node)
1875
1935
{
1876
1936
  GladeXmlNode *child;
1877
1937
 
1949
2009
 
1950
2010
static void
1951
2011
gwa_update_properties_from_node (GladeWidgetAdaptor *adaptor,
1952
 
                                 GladeXmlNode *node,
1953
 
                                 GModule *module,
1954
 
                                 GList **properties,
1955
 
                                 const gchar *domain,
1956
 
                                 gboolean is_packing)
 
2012
                                 GladeXmlNode       *node,
 
2013
                                 GModule            *module,
 
2014
                                 GList             **properties,
 
2015
                                 const gchar        *domain,
 
2016
                                 gboolean            is_packing)
1957
2017
{
1958
2018
  GladeXmlNode *child;
1959
2019
 
2151
2211
 
2152
2212
static void
2153
2213
gwa_update_properties_from_type (GladeWidgetAdaptor *adaptor,
2154
 
                                 GType type,
2155
 
                                 GList **properties,
2156
 
                                 gboolean is_packing)
 
2214
                                 GType               type,
 
2215
                                 GList             **properties,
 
2216
                                 gboolean            is_packing)
2157
2217
{
2158
2218
  gpointer object_class = g_type_class_ref (type);
2159
2219
  GParamSpec **specs = NULL, *spec;
2216
2276
 
2217
2277
static void
2218
2278
gwa_action_update_from_node (GladeWidgetAdaptor *adaptor,
2219
 
                             gboolean is_packing,
2220
 
                             GladeXmlNode *node,
2221
 
                             const gchar *domain,
2222
 
                             gchar *group_path)
 
2279
                             gboolean            is_packing,
 
2280
                             GladeXmlNode       *node,
 
2281
                             const gchar        *domain,
 
2282
                             gchar              *group_path)
2223
2283
{
2224
2284
  GladeXmlNode *child;
2225
2285
  gchar *id, *label, *stock, *action_path;
2307
2367
    }
2308
2368
}
2309
2369
 
2310
 
static GladeInternalChild *
2311
 
gwa_internal_child_find (GList *list, gchar *name)
2312
 
{
2313
 
  GList *l;
2314
 
 
2315
 
  for (l = list; l; l = g_list_next (l))
2316
 
    {
2317
 
      GladeInternalChild *data = l->data;
2318
 
 
2319
 
      if (strcmp (data->name, name) == 0)
2320
 
        return data;
2321
 
      
2322
 
      if (data->children)
2323
 
        {
2324
 
          GladeInternalChild *child;
2325
 
          if ((child = gwa_internal_child_find (data->children, name)))
2326
 
            return child;
2327
 
        }
2328
 
    }
2329
 
  
2330
 
  return NULL;
2331
 
}
2332
 
 
2333
2370
static GList *
2334
 
gwa_internal_children_update_from_node (GList *internal_children, GladeXmlNode *node)
 
2371
gwa_internal_children_update_from_node (GList        *internal_children,
 
2372
                                        GladeXmlNode *node)
2335
2373
{
2336
2374
  GList *retval = internal_children;
2337
2375
  GladeXmlNode *child, *children;
2365
2403
 
2366
2404
static gboolean
2367
2405
gwa_extend_with_node (GladeWidgetAdaptor *adaptor,
2368
 
                      GladeXmlNode *node,
2369
 
                      GModule *module,
2370
 
                      const gchar *domain)
 
2406
                      GladeXmlNode       *node,
 
2407
                      GModule            *module,
 
2408
                      const gchar        *domain)
2371
2409
{
2372
2410
  GladeXmlNode *child;
2373
2411
  gchar *child_type;
2423
2461
 */
2424
2462
static gchar *
2425
2463
create_icon_name_for_object_class (const gchar *class_name,
2426
 
                                   GType class_type,
 
2464
                                   GType        class_type,
2427
2465
                                   const gchar *icon_name,
2428
2466
                                   const gchar *icon_prefix,
2429
2467
                                   const gchar *generic_name)
2619
2657
GladeWidgetAdaptor *
2620
2658
glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
2621
2659
                                   GladeXmlNode *class_node,
2622
 
                                   GModule *module)
 
2660
                                   GModule      *module)
2623
2661
{
2624
2662
  GladeWidgetAdaptor *adaptor = NULL;
2625
2663
  gchar *name, *generic_name, *icon_name, *adaptor_icon_name, *adaptor_name,
2884
2922
 *          @internal_object of name @internal_name
2885
2923
 */
2886
2924
GladeWidget *
2887
 
glade_widget_adaptor_create_internal (GladeWidget *parent,
2888
 
                                      GObject *internal_object,
2889
 
                                      const gchar *internal_name,
2890
 
                                      const gchar *parent_name,
2891
 
                                      gboolean anarchist,
 
2925
glade_widget_adaptor_create_internal (GladeWidget      *parent,
 
2926
                                      GObject          *internal_object,
 
2927
                                      const gchar      *internal_name,
 
2928
                                      const gchar      *parent_name,
 
2929
                                      gboolean          anarchist,
2892
2930
                                      GladeCreateReason reason)
2893
2931
{
2894
2932
  GladeWidgetAdaptor *adaptor;
2937
2975
 * this macro returns the newly created #GladeWidget
2938
2976
 */
2939
2977
GladeWidget *
2940
 
glade_widget_adaptor_create_widget_real (gboolean query,
2941
 
                                         const gchar *first_property, ...)
 
2978
glade_widget_adaptor_create_widget_real (gboolean     query,
 
2979
                                         const gchar *first_property,
 
2980
                                         ...)
2942
2981
{
2943
2982
  GladeWidgetAdaptor *adaptor;
2944
2983
  GladeWidget *gwidget;
2989
3028
 
2990
3029
 
2991
3030
static void
2992
 
search_adaptor_by_name (GType *type,
2993
 
                        GladeWidgetAdaptor *adaptor,
 
3031
search_adaptor_by_name (GType                  *type,
 
3032
                        GladeWidgetAdaptor     *adaptor,
2994
3033
                        GladeAdaptorSearchPair *pair)
2995
3034
{
2996
3035
  if (!strcmp (adaptor->priv->name, pair->name))
3050
3089
 **/
3051
3090
GladeWidgetAdaptor *
3052
3091
glade_widget_adaptor_from_pspec (GladeWidgetAdaptor *adaptor,
3053
 
                                 GParamSpec *spec)
 
3092
                                 GParamSpec         *spec)
3054
3093
{
3055
3094
  GladeWidgetAdaptor *spec_adaptor;
3056
3095
  GType spec_type = spec->owner_type;
3085
3124
 */
3086
3125
GladePropertyClass *
3087
3126
glade_widget_adaptor_get_property_class (GladeWidgetAdaptor *adaptor,
3088
 
                                         const gchar *name)
 
3127
                                         const gchar        *name)
3089
3128
{
3090
3129
  GList *list;
3091
3130
  GladePropertyClass *pclass;
3111
3150
 */
3112
3151
GladePropertyClass *
3113
3152
glade_widget_adaptor_get_pack_property_class (GladeWidgetAdaptor *adaptor,
3114
 
                                              const gchar *name)
 
3153
                                              const gchar        *name)
3115
3154
{
3116
3155
  GList *list;
3117
3156
  GladePropertyClass *pclass;
3135
3174
 */
3136
3175
GParameter *
3137
3176
glade_widget_adaptor_default_params (GladeWidgetAdaptor *adaptor,
3138
 
                                     gboolean construct,
3139
 
                                     guint *n_params)
 
3177
                                     gboolean            construct,
 
3178
                                     guint              *n_params)
3140
3179
{
3141
3180
  GArray *params;
3142
3181
  GObjectClass *oclass;
3217
3256
 */
3218
3257
GObject *
3219
3258
glade_widget_adaptor_construct_object (GladeWidgetAdaptor *adaptor,
3220
 
                                       guint n_parameters,
3221
 
                                       GParameter *parameters)
 
3259
                                       guint               n_parameters,
 
3260
                                       GParameter         *parameters)
3222
3261
{
3223
3262
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
3224
3263
 
3245
3284
 
3246
3285
static void
3247
3286
gwa_internal_children_create (GladeWidgetAdaptor *adaptor,
3248
 
                              GObject *parent_object,
3249
 
                              GObject *object,
3250
 
                              GList *children,
3251
 
                              GladeCreateReason reason)
 
3287
                              GObject            *parent_object,
 
3288
                              GObject            *object,
 
3289
                              GList              *children,
 
3290
                              GladeCreateReason  reason)
3252
3291
{
3253
3292
  gchar *parent_name = adaptor->priv->generic_name;
3254
3293
  GladeWidget *gobject = glade_widget_get_from_gobject (object);
3288
3327
 */
3289
3328
void
3290
3329
glade_widget_adaptor_post_create (GladeWidgetAdaptor *adaptor,
3291
 
                                  GObject *object,
3292
 
                                  GladeCreateReason reason)
 
3330
                                  GObject            *object,
 
3331
                                  GladeCreateReason   reason)
3293
3332
{
3294
3333
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3295
3334
  g_return_if_fail (G_IS_OBJECT (object));
3325
3364
 */
3326
3365
GObject *
3327
3366
glade_widget_adaptor_get_internal_child (GladeWidgetAdaptor *adaptor,
3328
 
                                         GObject *object,
3329
 
                                         const gchar *internal_name)
 
3367
                                         GObject            *object,
 
3368
                                         const gchar        *internal_name)
3330
3369
{
3331
3370
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
3332
3371
  g_return_val_if_fail (G_IS_OBJECT (object), NULL);
3356
3395
 */
3357
3396
void
3358
3397
glade_widget_adaptor_set_property (GladeWidgetAdaptor *adaptor,
3359
 
                                   GObject *object,
3360
 
                                   const gchar *property_name,
3361
 
                                   const GValue *value)
 
3398
                                   GObject            *object,
 
3399
                                   const gchar        *property_name,
 
3400
                                   const GValue       *value)
3362
3401
{
3363
3402
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3364
3403
  g_return_if_fail (G_IS_OBJECT (object));
3383
3422
 */
3384
3423
void
3385
3424
glade_widget_adaptor_get_property (GladeWidgetAdaptor *adaptor,
3386
 
                                   GObject *object,
3387
 
                                   const gchar *property_name,
3388
 
                                   GValue *value)
 
3425
                                   GObject            *object,
 
3426
                                   const gchar        *property_name,
 
3427
                                   GValue             *value)
3389
3428
{
3390
3429
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3391
3430
  g_return_if_fail (G_IS_OBJECT (object));
3416
3455
 */
3417
3456
gboolean
3418
3457
glade_widget_adaptor_verify_property (GladeWidgetAdaptor *adaptor,
3419
 
                                      GObject *object,
3420
 
                                      const gchar *property_name,
3421
 
                                      const GValue *value)
 
3458
                                      GObject            *object,
 
3459
                                      const gchar        *property_name,
 
3460
                                      const GValue       *value)
3422
3461
{
3423
3462
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3424
3463
  g_return_val_if_fail (G_IS_OBJECT (object), FALSE);
3473
3512
 */
3474
3513
void
3475
3514
glade_widget_adaptor_add (GladeWidgetAdaptor *adaptor,
3476
 
                          GObject *container,
3477
 
                          GObject *child)
 
3515
                          GObject            *container,
 
3516
                          GObject            *child)
3478
3517
{
3479
3518
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3480
3519
  g_return_if_fail (G_IS_OBJECT (container));
3498
3537
 */
3499
3538
void
3500
3539
glade_widget_adaptor_remove (GladeWidgetAdaptor *adaptor,
3501
 
                             GObject *container,
3502
 
                             GObject *child)
 
3540
                             GObject            *container,
 
3541
                             GObject            *child)
3503
3542
{
3504
3543
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3505
3544
  g_return_if_fail (G_IS_OBJECT (container));
3524
3563
 */
3525
3564
GList *
3526
3565
glade_widget_adaptor_get_children (GladeWidgetAdaptor *adaptor,
3527
 
                                   GObject *container)
 
3566
                                   GObject            *container)
3528
3567
{
3529
3568
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
3530
3569
  g_return_val_if_fail (G_IS_OBJECT (container), NULL);
3544
3583
 */
3545
3584
gboolean
3546
3585
glade_widget_adaptor_has_child (GladeWidgetAdaptor *adaptor,
3547
 
                                GObject *container,
3548
 
                                GObject *child)
 
3586
                                GObject            *container,
 
3587
                                GObject            *child)
3549
3588
{
3550
3589
  GList *list, *children = NULL;
3551
3590
  gboolean found = FALSE;
3577
3616
 */
3578
3617
void
3579
3618
glade_widget_adaptor_child_set_property (GladeWidgetAdaptor *adaptor,
3580
 
                                         GObject *container,
3581
 
                                         GObject *child,
3582
 
                                         const gchar *property_name,
3583
 
                                         const GValue *value)
 
3619
                                         GObject            *container,
 
3620
                                         GObject            *child,
 
3621
                                         const gchar        *property_name,
 
3622
                                         const GValue       *value)
3584
3623
{
3585
3624
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3586
3625
  g_return_if_fail (G_IS_OBJECT (container));
3612
3651
 */
3613
3652
void
3614
3653
glade_widget_adaptor_child_get_property (GladeWidgetAdaptor *adaptor,
3615
 
                                         GObject *container,
3616
 
                                         GObject *child,
3617
 
                                         const gchar *property_name,
3618
 
                                         GValue *value)
 
3654
                                         GObject            *container,
 
3655
                                         GObject            *child,
 
3656
                                         const gchar        *property_name,
 
3657
                                         GValue             *value)
3619
3658
{
3620
3659
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3621
3660
  g_return_if_fail (G_IS_OBJECT (container));
3650
3689
 */
3651
3690
gboolean
3652
3691
glade_widget_adaptor_child_verify_property (GladeWidgetAdaptor *adaptor,
3653
 
                                            GObject *container,
3654
 
                                            GObject *child,
3655
 
                                            const gchar *property_name,
3656
 
                                            const GValue *value)
 
3692
                                            GObject            *container,
 
3693
                                            GObject            *child,
 
3694
                                            const gchar        *property_name,
 
3695
                                            const GValue       *value)
3657
3696
{
3658
3697
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3659
3698
  g_return_val_if_fail (G_IS_OBJECT (container), FALSE);
3685
3724
 */
3686
3725
void
3687
3726
glade_widget_adaptor_replace_child (GladeWidgetAdaptor *adaptor,
3688
 
                                    GObject *container,
3689
 
                                    GObject *old_obj,
3690
 
                                    GObject *new_obj)
 
3727
                                    GObject            *container,
 
3728
                                    GObject            *old_obj,
 
3729
                                    GObject            *new_obj)
3691
3730
{
3692
3731
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
3693
3732
  g_return_if_fail (G_IS_OBJECT (container));
3742
3781
G_CONST_RETURN gchar *
3743
3782
glade_widget_adaptor_get_packing_default (GladeWidgetAdaptor *child_adaptor,
3744
3783
                                          GladeWidgetAdaptor *container_adaptor,
3745
 
                                          const gchar *id)
 
3784
                                          const gchar        *id)
3746
3785
{
3747
3786
  GladeChildPacking *packing = NULL;
3748
3787
  GList *l;
3885
3924
 */
3886
3925
gboolean
3887
3926
glade_widget_adaptor_action_add (GladeWidgetAdaptor *adaptor,
3888
 
                                 const gchar *action_path,
3889
 
                                 const gchar *label,
3890
 
                                 const gchar *stock,
3891
 
                                 gboolean important)
 
3927
                                 const gchar        *action_path,
 
3928
                                 const gchar        *label,
 
3929
                                 const gchar        *stock,
 
3930
                                 gboolean            important)
3892
3931
{
3893
3932
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3894
3933
  g_return_val_if_fail (action_path != NULL, FALSE);
3913
3952
 */
3914
3953
gboolean
3915
3954
glade_widget_adaptor_pack_action_add (GladeWidgetAdaptor *adaptor,
3916
 
                                      const gchar *action_path,
3917
 
                                      const gchar *label,
3918
 
                                      const gchar *stock,
3919
 
                                      gboolean important)
 
3955
                                      const gchar        *action_path,
 
3956
                                      const gchar        *label,
 
3957
                                      const gchar        *stock,
 
3958
                                      gboolean            important)
3920
3959
{
3921
3960
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3922
3961
  g_return_val_if_fail (action_path != NULL, FALSE);
3959
3998
 */
3960
3999
gboolean
3961
4000
glade_widget_adaptor_action_remove (GladeWidgetAdaptor *adaptor,
3962
 
                                    const gchar *action_path)
 
4001
                                    const gchar        *action_path)
3963
4002
{
3964
4003
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3965
4004
  g_return_val_if_fail (action_path != NULL, FALSE);
3979
4018
 */
3980
4019
gboolean
3981
4020
glade_widget_adaptor_pack_action_remove (GladeWidgetAdaptor *adaptor,
3982
 
                                         const gchar *action_path)
 
4021
                                         const gchar        *action_path)
3983
4022
{
3984
4023
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), FALSE);
3985
4024
  g_return_val_if_fail (action_path != NULL, FALSE);
4050
4089
 */
4051
4090
void
4052
4091
glade_widget_adaptor_action_activate (GladeWidgetAdaptor *adaptor,
4053
 
                                      GObject *object,
4054
 
                                      const gchar *action_path)
 
4092
                                      GObject            *object,
 
4093
                                      const gchar        *action_path)
4055
4094
{
4056
4095
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4057
4096
  g_return_if_fail (G_IS_OBJECT (object));
4071
4110
 */
4072
4111
void
4073
4112
glade_widget_adaptor_child_action_activate (GladeWidgetAdaptor *adaptor,
4074
 
                                            GObject *container,
4075
 
                                            GObject *object,
4076
 
                                            const gchar *action_path)
 
4113
                                            GObject            *container,
 
4114
                                            GObject            *object,
 
4115
                                            const gchar        *action_path)
4077
4116
{
4078
4117
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4079
4118
  g_return_if_fail (G_IS_OBJECT (container));
4099
4138
 */
4100
4139
GtkWidget *
4101
4140
glade_widget_adaptor_action_submenu (GladeWidgetAdaptor *adaptor,
4102
 
                                     GObject *object,
4103
 
                                     const gchar *action_path)
 
4141
                                     GObject            *object,
 
4142
                                     const gchar        *action_path)
4104
4143
{
4105
4144
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
4106
4145
  g_return_val_if_fail (G_IS_OBJECT (object), NULL);
4131
4170
 */
4132
4171
gboolean
4133
4172
glade_widget_adaptor_depends (GladeWidgetAdaptor *adaptor,
4134
 
                              GladeWidget *widget,
4135
 
                              GladeWidget *another)
 
4173
                              GladeWidget        *widget,
 
4174
                              GladeWidget        *another)
4136
4175
{
4137
4176
  return FALSE;
4138
4177
}
4148
4187
 */
4149
4188
void
4150
4189
glade_widget_adaptor_read_widget (GladeWidgetAdaptor *adaptor,
4151
 
                                  GladeWidget *widget,
4152
 
                                  GladeXmlNode *node)
 
4190
                                  GladeWidget        *widget,
 
4191
                                  GladeXmlNode       *node)
4153
4192
{
4154
4193
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4155
4194
  g_return_if_fail (GLADE_IS_WIDGET (widget));
4171
4210
 */
4172
4211
void
4173
4212
glade_widget_adaptor_write_widget (GladeWidgetAdaptor *adaptor,
4174
 
                                   GladeWidget *widget,
4175
 
                                   GladeXmlContext *context,
4176
 
                                   GladeXmlNode *node)
 
4213
                                   GladeWidget        *widget,
 
4214
                                   GladeXmlContext    *context,
 
4215
                                   GladeXmlNode       *node)
4177
4216
{
4178
4217
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4179
4218
  g_return_if_fail (GLADE_IS_WIDGET (widget));
4196
4235
 */
4197
4236
void
4198
4237
glade_widget_adaptor_write_widget_after (GladeWidgetAdaptor *adaptor,
4199
 
                                         GladeWidget *widget,
4200
 
                                         GladeXmlContext *context,
4201
 
                                         GladeXmlNode *node)
 
4238
                                         GladeWidget        *widget,
 
4239
                                         GladeXmlContext    *context,
 
4240
                                         GladeXmlNode       *node)
4202
4241
{
4203
4242
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4204
4243
  g_return_if_fail (GLADE_IS_WIDGET (widget));
4221
4260
 */
4222
4261
void
4223
4262
glade_widget_adaptor_read_child (GladeWidgetAdaptor *adaptor,
4224
 
                                 GladeWidget *widget,
4225
 
                                 GladeXmlNode *node)
 
4263
                                 GladeWidget        *widget,
 
4264
                                 GladeXmlNode       *node)
4226
4265
{
4227
4266
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4228
4267
  g_return_if_fail (GLADE_IS_WIDGET (widget));
4245
4284
 */
4246
4285
void
4247
4286
glade_widget_adaptor_write_child (GladeWidgetAdaptor *adaptor,
4248
 
                                  GladeWidget *widget,
4249
 
                                  GladeXmlContext *context,
4250
 
                                  GladeXmlNode *node)
 
4287
                                  GladeWidget        *widget,
 
4288
                                  GladeXmlContext    *context,
 
4289
                                  GladeXmlNode       *node)
4251
4290
{
4252
4291
  g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
4253
4292
  g_return_if_fail (GLADE_IS_WIDGET (widget));
4272
4311
GladeEditorProperty *
4273
4312
glade_widget_adaptor_create_eprop (GladeWidgetAdaptor *adaptor,
4274
4313
                                   GladePropertyClass *klass,
4275
 
                                   gboolean use_command)
 
4314
                                   gboolean            use_command)
4276
4315
{
4277
4316
  GladeEditorProperty *eprop;
4278
4317
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
4304
4343
 */
4305
4344
GladeEditorProperty *
4306
4345
glade_widget_adaptor_create_eprop_by_name (GladeWidgetAdaptor *adaptor,
4307
 
                                           const gchar *property_id,
4308
 
                                           gboolean packing,
4309
 
                                           gboolean use_command)
 
4346
                                           const gchar        *property_id,
 
4347
                                           gboolean            packing,
 
4348
                                           gboolean            use_command)
4310
4349
{
4311
4350
  GladePropertyClass *klass;
4312
4351
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
4339
4378
gchar *
4340
4379
glade_widget_adaptor_string_from_value (GladeWidgetAdaptor *adaptor,
4341
4380
                                        GladePropertyClass *klass,
4342
 
                                        const GValue *value)
 
4381
                                        const GValue       *value)
4343
4382
{
4344
4383
  g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
4345
4384
  g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), NULL);
4362
4401
 */
4363
4402
GladeSignalClass *
4364
4403
glade_widget_adaptor_get_signal_class (GladeWidgetAdaptor *adaptor,
4365
 
                                       const gchar *name)
 
4404
                                       const gchar        *name)
4366
4405
{
4367
4406
  GList *list;
4368
4407
  GladeSignalClass *signal;