~ubuntu-branches/ubuntu/vivid/glade-3/vivid

« back to all changes in this revision

Viewing changes to plugins/gtk+/glade-gtk.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-09-02 11:11:46 UTC
  • mfrom: (1.2.19)
  • Revision ID: package-import@ubuntu.com-20140902111146-iv8rv189p1bbs8fb
Tags: 3.8.5-0ubuntu1
* New upstream release (LP: #1343983)
* debian/rules:
  - Update for doc file renames
* debian/watch:
  - Package is now a .xz
* debian/patches/90_linking_doc_in_natty.patch:
* debian/patches/link-gmodule.patch:
  - Applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
}
232
232
 
233
233
/* ----------------------------- GtkWidget ------------------------------ */
234
 
gboolean
235
 
glade_gtk_widget_depends (GladeWidgetAdaptor *adaptor,
236
 
                          GladeWidget        *widget,
237
 
                          GladeWidget        *another)
238
 
{
239
 
        if (GTK_IS_ICON_FACTORY (another->object) ||
240
 
            GTK_IS_ACTION       (another->object) ||
241
 
            GTK_IS_ACTION_GROUP (another->object))
242
 
                return TRUE; 
243
 
 
244
 
        return GWA_GET_CLASS (G_TYPE_OBJECT)->depends (adaptor, widget, another);
245
 
}
246
234
 
247
235
#define GLADE_TAG_A11Y_A11Y         "accessibility"
248
236
#define GLADE_TAG_A11Y_ACTION_NAME  "action_name" /* We should make -/_ synonymous */
824
812
                               GladeXmlNode       *node)
825
813
{
826
814
        GladeProjectFormat  fmt;
 
815
        GObject *obj;
827
816
 
828
817
        fmt = glade_project_get_format (widget->project);
829
818
 
830
819
        if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET (fmt)))
831
820
                return;
832
821
 
 
822
        /* Make sure use-action-appearance and related-action properties are
 
823
         * ordered in a sane way */
 
824
        if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER &&
 
825
            (obj = glade_widget_get_object (widget)) &&
 
826
            GTK_IS_ACTIVATABLE (obj) &&
 
827
            gtk_activatable_get_related_action (GTK_ACTIVATABLE (obj)))
 
828
        {
 
829
                GladeProperty *prop =
 
830
                        glade_widget_get_property (widget, "use-action-appearance");
 
831
                if (prop)
 
832
                        glade_property_write (prop, context, node);
 
833
 
 
834
                prop = glade_widget_get_property (widget, "related-action");
 
835
                if (prop)
 
836
                        glade_property_write (prop, context, node);
 
837
        }
 
838
 
833
839
        /* First chain up and read in all the normal properties.. */
834
840
        GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
835
841
 
836
 
 
837
842
        /* in Libglade the order must be Properties, Atk, Signals, Accels. 
838
843
         * in builder it doesnt matter so long as signals are after properties
839
844
         * and before objects.
975
980
                               const gchar        *id,
976
981
                               const GValue       *value)
977
982
{
978
 
        /* FIXME: is this still needed with the new gtk+ tooltips? */
979
 
        if (!strcmp (id, "tooltip"))
980
 
        {
981
 
                id = "tooltip-text";
982
 
        }
983
 
 
984
983
        GWA_GET_CLASS (G_TYPE_OBJECT)->set_property (adaptor, object, id, value);
985
984
}
986
985
 
990
989
                               const gchar        *id,
991
990
                               GValue             *value)
992
991
{
993
 
        if (!strcmp (id, "tooltip"))
994
 
        {
995
 
                id = "tooltip-text";
996
 
        }
997
 
        
998
992
        GWA_GET_CLASS (G_TYPE_OBJECT)->get_property (adaptor, object, id, value);
999
993
}
1000
994
 
1021
1015
        return g_list_reverse (command_properties);
1022
1016
}
1023
1017
 
1024
 
 
1025
1018
void
1026
1019
glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
1027
1020
                                  GObject *object,
1028
1021
                                  const gchar *action_path)
1029
1022
{
1030
1023
        GladeWidget *gwidget = glade_widget_get_from_gobject (object), *gparent;
1031
 
        GList       this_widget = { 0, }, that_widget = { 0, };
1032
 
        GtkWidget   *parent = gtk_widget_get_parent (GTK_WIDGET (object));
 
1024
        GList this_widget = { 0, }, that_widget = { 0,};
 
1025
        GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (object));
 
1026
        GladeProject *project;
1033
1027
 
1034
1028
        if (parent)
1035
1029
                gparent = glade_widget_get_from_gobject (parent);
1036
1030
        else
1037
1031
                gparent = NULL;
1038
1032
 
 
1033
        project = glade_widget_get_project (gwidget);
 
1034
 
1039
1035
        if (strcmp (action_path, "edit_separate") == 0)
1040
1036
        {
1041
 
                GtkWidget *dialog = 
1042
 
                        glade_editor_dialog_for_widget (gwidget);
 
1037
                GtkWidget *dialog = glade_editor_dialog_for_widget (gwidget);
1043
1038
                gtk_widget_show_all (dialog);
1044
1039
        }
1045
1040
        else if (strcmp (action_path, "remove_parent") == 0)
1046
1041
        {
1047
1042
                GladeWidget *new_gparent;
 
1043
                GladeProperty *property;
1048
1044
 
1049
1045
                g_return_if_fail (gparent);
1050
 
                new_gparent = gparent->parent;
1051
 
                
1052
 
                glade_command_push_group (_("Removing parent of %s"), 
1053
 
                                          gwidget->name);
1054
 
 
1055
 
                /* Remove "this" widget */
 
1046
 
 
1047
                property = glade_widget_get_parentless_widget_ref (gparent);
 
1048
                new_gparent = glade_widget_get_parent (gparent);
 
1049
 
 
1050
                glade_command_push_group (_("Removing parent of %s"), glade_widget_get_name (gwidget));
 
1051
 
 
1052
                /* Remove "this" widget, If the parent we're removing is a parentless 
 
1053
                 * widget reference, the reference will be implicitly broken by the 'cut' command */
1056
1054
                this_widget.data = gwidget;
1057
 
                glade_command_cut (&this_widget);
1058
 
                
 
1055
                glade_command_delete (&this_widget);
 
1056
 
1059
1057
                /* Delete the parent */
1060
1058
                that_widget.data = gparent;
1061
1059
                glade_command_delete (&that_widget);
1062
1060
 
1063
 
                /* Add "this" widget to the new parent */
1064
 
                glade_command_paste(&this_widget, new_gparent, NULL);
1065
 
                
 
1061
                /* Add "this" widget to the new parent, if there is no new parent this will re-add
 
1062
                 * the widget to the project at the toplevel without a parent
 
1063
                 */
 
1064
                glade_command_add (&this_widget, new_gparent, NULL, project, FALSE);
 
1065
 
 
1066
                /* If the parent had a parentless widget reference, undoably add the child
 
1067
                 * as the new parentless widget reference here */
 
1068
                if (property)
 
1069
                        glade_command_set_property (property, glade_widget_get_object (gwidget));
 
1070
 
1066
1071
                glade_command_pop_group ();
1067
1072
        }
1068
1073
        else if (strncmp (action_path, "add_parent/", 11) == 0)
1069
1074
        {
1070
1075
                GType new_type = 0;
1071
 
                
1072
 
                if (strcmp (action_path + 11, "alignment") == 0)
1073
 
                        new_type = GTK_TYPE_ALIGNMENT;
1074
 
                else if (strcmp (action_path + 11, "viewport") == 0)
1075
 
                        new_type = GTK_TYPE_VIEWPORT;
1076
 
                else if (strcmp (action_path + 11, "eventbox") == 0)
1077
 
                        new_type = GTK_TYPE_EVENT_BOX;
1078
 
                else if (strcmp (action_path + 11, "frame") == 0)
1079
 
                        new_type = GTK_TYPE_FRAME;
1080
 
                else if (strcmp (action_path + 11, "aspect_frame") == 0)
1081
 
                        new_type = GTK_TYPE_ASPECT_FRAME;
1082
 
                else if (strcmp (action_path + 11, "scrolled_window") == 0)
1083
 
                        new_type = GTK_TYPE_SCROLLED_WINDOW;
1084
 
                else if (strcmp (action_path + 11, "expander") == 0)
1085
 
                        new_type = GTK_TYPE_EXPANDER;
1086
 
                else if (strcmp (action_path + 11, "table") == 0)
1087
 
                        new_type = GTK_TYPE_TABLE;
1088
 
                else if (strcmp (action_path + 11, "hbox") == 0)
1089
 
                        new_type = GTK_TYPE_HBOX;
1090
 
                else if (strcmp (action_path + 11, "vbox") == 0)
1091
 
                        new_type = GTK_TYPE_VBOX;
1092
 
                else if (strcmp (action_path + 11, "hpaned") == 0)
1093
 
                        new_type = GTK_TYPE_HPANED;
1094
 
                else if (strcmp (action_path + 11, "vpaned") == 0)
1095
 
                        new_type = GTK_TYPE_VPANED;
1096
 
 
1097
 
                
1098
 
                if (new_type)
1099
 
                {
1100
 
                        GladeWidgetAdaptor *adaptor = glade_widget_adaptor_get_by_type (new_type);
1101
 
                        GList              *saved_props, *prop_cmds;
1102
 
                        GladeProject       *project;
1103
 
 
1104
 
                        /* Dont add non-scrollable widgets to scrolled windows... */
1105
 
                        if (gparent &&
1106
 
                            glade_util_check_and_warn_scrollable (gparent, adaptor, glade_app_get_window()))
1107
 
                                return;
1108
 
                        
1109
 
                        glade_command_push_group (_("Adding parent %s for %s"), 
1110
 
                                                  adaptor->title, gwidget->name);
1111
 
 
1112
 
                        /* Record packing properties */
1113
 
                        saved_props = glade_widget_dup_properties (gwidget, gwidget->packing_properties, FALSE, FALSE, FALSE);
1114
 
                        
1115
 
                        /* Remove "this" widget */
1116
 
                        this_widget.data = gwidget;
1117
 
                        glade_command_cut (&this_widget);
1118
 
 
1119
 
                        if (gparent)
1120
 
                                project = glade_widget_get_project (gparent);
1121
 
                        else
1122
 
                                project = glade_app_get_project ();
1123
 
                        
1124
 
                        /* Create new widget and put it where the placeholder was */
1125
 
                        if ((that_widget.data =
1126
 
                             glade_command_create (adaptor, gparent, NULL, project)) != NULL)
1127
 
                        {
1128
 
                        
1129
 
                                /* Remove the alignment that we added in the frame's post_create... */
1130
 
                                if (new_type == GTK_TYPE_FRAME)
1131
 
                                {
1132
 
                                        GObject     *frame = glade_widget_get_object (that_widget.data);
1133
 
                                        GladeWidget *galign = glade_widget_get_from_gobject (gtk_bin_get_child (GTK_BIN (frame)));
1134
 
                                        GList        to_delete = { 0, };
1135
 
                                        
1136
 
                                        to_delete.data = galign;
1137
 
                                        glade_command_delete (&to_delete);
1138
 
                                }
1139
 
                                
1140
 
                                /* Create heavy-duty glade-command properties stuff */
1141
 
                                prop_cmds = create_command_property_list (that_widget.data, saved_props);
1142
 
                                g_list_foreach (saved_props, (GFunc)g_object_unref, NULL);
1143
 
                                g_list_free (saved_props);
1144
 
                                
1145
 
                                /* Apply the properties in an undoable way */
1146
 
                                if (prop_cmds)
1147
 
                                        glade_command_set_properties_list (glade_widget_get_project (gparent), prop_cmds);
1148
 
                                
1149
 
                                /* Add "this" widget to the new parent */
1150
 
                                glade_command_paste(&this_widget, GLADE_WIDGET (that_widget.data), NULL);
1151
 
                        }
1152
 
                        else
1153
 
                                /* Create parent was cancelled, paste back to parent */
1154
 
                                glade_command_paste(&this_widget, gparent, NULL);
1155
 
 
1156
 
                        glade_command_pop_group ();
1157
 
                }
1158
 
        }
1159
 
        else if (strcmp (action_path, "sizegroup_add") == 0)
1160
 
        {
1161
 
                /* Ignore dummy */
1162
 
        }
1163
 
        else
1164
 
                GWA_GET_CLASS (G_TYPE_OBJECT)->action_activate (adaptor,
1165
 
                                                                object,
1166
 
                                                                action_path);
 
1076
                GladeProperty *property;
 
1077
 
 
1078
      if (strcmp (action_path + 11, "alignment") == 0)
 
1079
        new_type = GTK_TYPE_ALIGNMENT;
 
1080
      else if (strcmp (action_path + 11, "viewport") == 0)
 
1081
        new_type = GTK_TYPE_VIEWPORT;
 
1082
      else if (strcmp (action_path + 11, "eventbox") == 0)
 
1083
        new_type = GTK_TYPE_EVENT_BOX;
 
1084
      else if (strcmp (action_path + 11, "frame") == 0)
 
1085
        new_type = GTK_TYPE_FRAME;
 
1086
      else if (strcmp (action_path + 11, "aspect_frame") == 0)
 
1087
        new_type = GTK_TYPE_ASPECT_FRAME;
 
1088
      else if (strcmp (action_path + 11, "scrolled_window") == 0)
 
1089
        new_type = GTK_TYPE_SCROLLED_WINDOW;
 
1090
      else if (strcmp (action_path + 11, "expander") == 0)
 
1091
        new_type = GTK_TYPE_EXPANDER;
 
1092
      else if (strcmp (action_path + 11, "table") == 0)
 
1093
        new_type = GTK_TYPE_TABLE;
 
1094
      else if (strcmp (action_path + 11, "hbox") == 0)
 
1095
        new_type = GTK_TYPE_HBOX;
 
1096
      else if (strcmp (action_path + 11, "vbox") == 0)
 
1097
        new_type = GTK_TYPE_VBOX;
 
1098
      else if (strcmp (action_path + 11, "hpaned") == 0)
 
1099
        new_type = GTK_TYPE_HPANED;
 
1100
      else if (strcmp (action_path + 11, "vpaned") == 0)
 
1101
        new_type = GTK_TYPE_VPANED;
 
1102
 
 
1103
      if (new_type)
 
1104
        {
 
1105
          GladeWidgetAdaptor *adaptor =
 
1106
              glade_widget_adaptor_get_by_type (new_type);
 
1107
          GList *saved_props, *prop_cmds;
 
1108
          GladeWidget *gnew_parent;
 
1109
 
 
1110
          /* Dont add non-scrollable widgets to scrolled windows... */
 
1111
          if (gparent &&
 
1112
              glade_util_check_and_warn_scrollable (gparent, adaptor,
 
1113
                                                    glade_app_get_window ()))
 
1114
            return;
 
1115
 
 
1116
          glade_command_push_group (_("Adding parent %s for %s"),
 
1117
                                    adaptor->title, 
 
1118
                                    glade_widget_get_name (gwidget));
 
1119
 
 
1120
          /* Record packing properties */
 
1121
          saved_props =
 
1122
            glade_widget_dup_properties (gwidget, gwidget->packing_properties,
 
1123
                                         FALSE, FALSE, FALSE);
 
1124
 
 
1125
 
 
1126
          property = glade_widget_get_parentless_widget_ref (gwidget);
 
1127
 
 
1128
          /* Remove "this" widget, If the parent we're removing is a parentless 
 
1129
           * widget reference, the reference will be implicitly broken by the 'cut' command */
 
1130
          this_widget.data = gwidget;
 
1131
          glade_command_delete (&this_widget);
 
1132
 
 
1133
          /* Create new widget and put it where the placeholder was */
 
1134
          if ((gnew_parent =
 
1135
               glade_command_create (adaptor, gparent, NULL, project)) != NULL)
 
1136
            {
 
1137
              /* Now we created the new parent, if gwidget had a parentless widget reference...
 
1138
               * set that reference to the new parent instead */
 
1139
              if (property)
 
1140
                glade_command_set_property (property, glade_widget_get_object (gnew_parent));
 
1141
 
 
1142
              /* Remove the alignment that we added in the frame's post_create... */
 
1143
              if (new_type == GTK_TYPE_FRAME)
 
1144
                {
 
1145
                  GObject *frame = glade_widget_get_object (gnew_parent);
 
1146
                  GladeWidget *galign =
 
1147
                      glade_widget_get_from_gobject (gtk_bin_get_child (GTK_BIN (frame)));
 
1148
                  GList to_delete = { 0, };
 
1149
 
 
1150
                  to_delete.data = galign;
 
1151
                  glade_command_delete (&to_delete);
 
1152
                }
 
1153
 
 
1154
              /* Create heavy-duty glade-command properties stuff */
 
1155
              prop_cmds =
 
1156
                  create_command_property_list (gnew_parent, saved_props);
 
1157
              g_list_foreach (saved_props, (GFunc) g_object_unref, NULL);
 
1158
              g_list_free (saved_props);
 
1159
 
 
1160
              /* Apply the properties in an undoable way */
 
1161
              if (prop_cmds)
 
1162
                glade_command_set_properties_list 
 
1163
                  (glade_widget_get_project (gparent), prop_cmds);
 
1164
 
 
1165
              /* Add "this" widget to the new parent */
 
1166
              glade_command_add (&this_widget, gnew_parent, NULL, project, FALSE);
 
1167
            }
 
1168
          else
 
1169
            {
 
1170
              /* Create parent was cancelled, paste back to parent */
 
1171
              glade_command_add (&this_widget, gparent, NULL, project, FALSE);
 
1172
 
 
1173
              /* Restore any parentless widget reference if there was one */
 
1174
              if (property)
 
1175
                glade_command_set_property (property, glade_widget_get_object (gwidget));
 
1176
            }
 
1177
 
 
1178
          glade_command_pop_group ();
 
1179
        }
 
1180
    }
 
1181
  else if (strcmp (action_path, "sizegroup_add") == 0)
 
1182
    {
 
1183
      /* Ignore dummy */
 
1184
    }
 
1185
  else
 
1186
    GWA_GET_CLASS (G_TYPE_OBJECT)->action_activate (adaptor,
 
1187
                                                    object, action_path);
1167
1188
}
1168
1189
 
1169
 
static GList *list_sizegroups (GladeWidget *gwidget)
 
1190
static GList *
 
1191
list_sizegroups (GladeWidget *gwidget)
1170
1192
{
1171
1193
        GladeProject *project = glade_widget_get_project (gwidget);
1172
1194
        GList *groups = NULL;
2737
2759
        return ret;
2738
2760
}
2739
2761
 
 
2762
#define TABLE_OCCUPIED(occmap, n_columns, col, row) \
 
2763
    (occmap)[row * n_columns + col]
 
2764
 
 
2765
static void
 
2766
glade_gtk_table_build_occupation_maps(GtkTable *table, guint n_columns, guint n_rows,
 
2767
                                      gchar **child_map, gpointer **placeholder_map)
 
2768
{
 
2769
    guint i, j;
 
2770
    GList *list, *children = gtk_container_get_children (GTK_CONTAINER (table));
 
2771
 
 
2772
    *child_map = g_malloc0(n_columns * n_rows * sizeof(gchar));  /* gchar is smaller than gboolean */
 
2773
    *placeholder_map = g_malloc0(n_columns * n_rows * sizeof(gpointer));
 
2774
 
 
2775
    for (list = children; list && list->data; list = list->next)
 
2776
    {
 
2777
        GtkTableChild child;
 
2778
 
 
2779
        glade_gtk_table_get_child_attachments (GTK_WIDGET (table),
 
2780
                                               GTK_WIDGET (list->data), &child);
 
2781
 
 
2782
        if (GLADE_IS_PLACEHOLDER(list->data))
 
2783
        {
 
2784
            /* assumption: placeholders are always attached to exactly 1 cell */
 
2785
            TABLE_OCCUPIED(*placeholder_map, n_columns, child.left_attach, child.top_attach) = list->data;
 
2786
        }
 
2787
        else
 
2788
        {
 
2789
            for (i = child.left_attach; i < child.right_attach && i < n_columns; i++)
 
2790
            {
 
2791
                for (j = child.top_attach; j < child.bottom_attach && j < n_rows; j++)
 
2792
                {
 
2793
                    TABLE_OCCUPIED(*child_map, n_columns, i, j) = 1;
 
2794
                }
 
2795
            }
 
2796
        }
 
2797
    }
 
2798
    g_list_free (children);
 
2799
}
 
2800
 
2740
2801
static void
2741
2802
glade_gtk_table_refresh_placeholders (GtkTable *table)
2742
2803
{
2743
 
        GList *list, *children;
2744
 
        guint n_columns, n_rows;
2745
 
        gint i, j;
 
2804
        guint n_columns, n_rows, i, j;
 
2805
        gchar *child_map;
 
2806
        gpointer *placeholder_map;
2746
2807
 
2747
2808
        g_object_get (table,
2748
2809
                      "n-columns", &n_columns,
2749
2810
                      "n-rows", &n_rows,
2750
2811
                      NULL);
2751
2812
 
2752
 
        children = gtk_container_get_children (GTK_CONTAINER (table));
2753
 
 
2754
 
        for (list = children; list && list->data; list = list->next)
2755
 
        {
2756
 
                if (GLADE_IS_PLACEHOLDER (list->data))
2757
 
                        gtk_container_remove (GTK_CONTAINER (table),
2758
 
                                              GTK_WIDGET (list->data));
2759
 
        }
2760
 
        g_list_free (children);
 
2813
        glade_gtk_table_build_occupation_maps(table, n_columns, n_rows,
 
2814
                                             &child_map, &placeholder_map);
2761
2815
 
2762
2816
        for (i = 0; i < n_columns; i++)
2763
 
                for (j = 0; j < n_rows; j++)
2764
 
                        if (glade_gtk_table_has_child (table, i, j) == FALSE)
2765
 
                        {
2766
 
                                gtk_table_attach_defaults (table,
2767
 
                                                           glade_placeholder_new (),
2768
 
                                                           i, i + 1, j, j + 1);
2769
 
                        }
 
2817
        {
 
2818
            for (j = 0; j < n_rows; j++)
 
2819
            {
 
2820
                gpointer placeholder = TABLE_OCCUPIED(placeholder_map, n_columns, i, j);
 
2821
 
 
2822
                if (TABLE_OCCUPIED(child_map, n_columns, i, j))
 
2823
                {
 
2824
                    if (placeholder)
 
2825
                    {
 
2826
                        gtk_container_remove (GTK_CONTAINER (table), 
 
2827
                                              GTK_WIDGET (placeholder));
 
2828
                    }
 
2829
                }
 
2830
                else
 
2831
                {
 
2832
                    if (!placeholder)
 
2833
                    {
 
2834
                        gtk_table_attach_defaults (table, 
 
2835
                                                   glade_placeholder_new (), 
 
2836
                                                   i, i + 1, j, j + 1);
 
2837
                    }
 
2838
                }
 
2839
            }
 
2840
        }
 
2841
        g_free(child_map);
 
2842
        g_free(placeholder_map);
2770
2843
        gtk_container_check_resize (GTK_CONTAINER (table));
2771
2844
}
2772
2845
 
4719
4792
 
4720
4793
/* -------------------------------- GtkEntry -------------------------------- */
4721
4794
 
4722
 
gboolean
4723
 
glade_gtk_entry_depends (GladeWidgetAdaptor *adaptor,
4724
 
                         GladeWidget        *widget,
4725
 
                         GladeWidget        *another)
4726
 
{
4727
 
        if (GTK_IS_ENTRY_BUFFER (another->object))
4728
 
                return TRUE; 
4729
 
 
4730
 
        return GWA_GET_CLASS (GTK_TYPE_WIDGET)->depends (adaptor, widget, another);
4731
 
}
4732
 
 
4733
4795
 
4734
4796
static void
4735
4797
glade_gtk_entry_changed (GtkEditable *editable, GladeWidget *gentry)
5952
6014
                                           const GValue       *value)
5953
6015
{
5954
6016
        GladeWidget *gwidget = glade_widget_get_from_gobject (object);
 
6017
        gboolean sensitivity;
 
6018
        gchar *msg;
5955
6019
 
5956
6020
        if (!strcmp (id, "related-action"))
5957
 
        {
5958
 
                GtkAction *action = g_value_get_object (value);
5959
 
 
5960
 
                if (action)
5961
 
                {
5962
 
                        glade_widget_property_set_sensitive (gwidget, "visible", FALSE, ACTION_APPEARANCE_MSG);
5963
 
                        glade_widget_property_set_sensitive (gwidget, "sensitive", FALSE, ACTION_APPEARANCE_MSG);
5964
 
 
5965
 
                        glade_widget_property_set_sensitive (gwidget, "accel-group", FALSE, ACTION_APPEARANCE_MSG);
5966
 
                } else {
5967
 
                        glade_widget_property_set_sensitive (gwidget, "visible", TRUE, NULL);
5968
 
                        glade_widget_property_set_sensitive (gwidget, "sensitive", TRUE, NULL);
5969
 
                        
5970
 
                        glade_widget_property_set_sensitive (gwidget, "accel-group", TRUE, NULL);
5971
 
                }
5972
 
 
5973
 
        } 
 
6021
          {
 
6022
                  GtkAction *action = g_value_get_object (value);
 
6023
 
 
6024
                  if (action)
 
6025
                    {
 
6026
                            sensitivity = FALSE;
 
6027
                            msg = ACTION_APPEARANCE_MSG;
 
6028
                    }
 
6029
                  else
 
6030
                    {
 
6031
                            sensitivity = TRUE;
 
6032
                            msg = NULL;
 
6033
                    }
 
6034
 
 
6035
                  glade_widget_property_set_sensitive (gwidget, "visible", sensitivity, msg);
 
6036
                  glade_widget_property_set_sensitive (gwidget, "sensitive", sensitivity, msg);
 
6037
                  glade_widget_property_set_sensitive (gwidget, "accel-group", sensitivity, msg);
 
6038
                  glade_widget_property_set_sensitive (gwidget, "use-action-appearance", !sensitivity, sensitivity ? msg : NULL);
 
6039
          }
5974
6040
        else if (!strcmp (id, "use-action-appearance"))
5975
 
        {
5976
 
                gboolean use_appearance = g_value_get_boolean (value);
5977
 
                
 
6041
          {
 
6042
                  if (g_value_get_boolean (value))
 
6043
                    {
 
6044
                            sensitivity = FALSE;
 
6045
                            msg = ACTION_APPEARANCE_MSG;
 
6046
                    }
 
6047
                  else
 
6048
                    {
 
6049
                            sensitivity = TRUE;
 
6050
                            msg = NULL;
 
6051
                    }
5978
6052
 
5979
 
                if (use_appearance)
5980
 
                {
5981
 
                        glade_widget_property_set_sensitive (gwidget, "label", FALSE, ACTION_APPEARANCE_MSG);
5982
 
                        glade_widget_property_set_sensitive (gwidget, "use-underline", FALSE, ACTION_APPEARANCE_MSG);
5983
 
                        glade_widget_property_set_sensitive (gwidget, "stock", FALSE, ACTION_APPEARANCE_MSG);
5984
 
                        //glade_widget_property_set_sensitive (gwidget, "use-stock", FALSE, ACTION_APPEARANCE_MSG);
5985
 
                        glade_widget_property_set_sensitive (gwidget, "image", FALSE, ACTION_APPEARANCE_MSG);
5986
 
                        glade_widget_property_set_sensitive (gwidget, "custom-child", FALSE, ACTION_APPEARANCE_MSG);    
5987
 
                        glade_widget_property_set_sensitive (gwidget, "stock-id", FALSE, ACTION_APPEARANCE_MSG);
5988
 
                        glade_widget_property_set_sensitive (gwidget, "label-widget", FALSE, ACTION_APPEARANCE_MSG);
5989
 
                        glade_widget_property_set_sensitive (gwidget, "icon-name", FALSE, ACTION_APPEARANCE_MSG);
5990
 
                        glade_widget_property_set_sensitive (gwidget, "icon-widget", FALSE, ACTION_APPEARANCE_MSG);
5991
 
                        glade_widget_property_set_sensitive (gwidget, "icon", FALSE, ACTION_APPEARANCE_MSG);
5992
 
        } else {
5993
 
                        glade_widget_property_set_sensitive (gwidget, "label", TRUE, NULL);
5994
 
                        glade_widget_property_set_sensitive (gwidget, "use-underline", TRUE, NULL);
5995
 
                        glade_widget_property_set_sensitive (gwidget, "stock", TRUE, NULL);
5996
 
                        //glade_widget_property_set_sensitive (gwidget, "use-stock", TRUE, NULL);
5997
 
                        glade_widget_property_set_sensitive (gwidget, "image", TRUE, NULL);
5998
 
                        glade_widget_property_set_sensitive (gwidget, "custom-child", TRUE, NULL);      
5999
 
                        glade_widget_property_set_sensitive (gwidget, "stock-id", TRUE, NULL);
6000
 
                        glade_widget_property_set_sensitive (gwidget, "label-widget", TRUE, NULL);
6001
 
                        glade_widget_property_set_sensitive (gwidget, "icon-name", TRUE, NULL);
6002
 
                        glade_widget_property_set_sensitive (gwidget, "icon-widget", TRUE, NULL);
6003
 
                        glade_widget_property_set_sensitive (gwidget, "icon", TRUE, NULL);
6004
 
                }
6005
 
        }
 
6053
                  glade_widget_property_set_sensitive (gwidget, "label", sensitivity, msg);
 
6054
                  glade_widget_property_set_sensitive (gwidget, "use-underline", sensitivity, msg);
 
6055
                  glade_widget_property_set_sensitive (gwidget, "stock", sensitivity, msg);
 
6056
                  //glade_widget_property_set_sensitive (gwidget, "use-stock", sensitivity, msg);
 
6057
                  glade_widget_property_set_sensitive (gwidget, "image", sensitivity, msg);
 
6058
                  glade_widget_property_set_sensitive (gwidget, "custom-child", sensitivity, msg);
 
6059
                  glade_widget_property_set_sensitive (gwidget, "stock-id", sensitivity, msg);
 
6060
                  glade_widget_property_set_sensitive (gwidget, "label-widget", sensitivity, msg);
 
6061
                  glade_widget_property_set_sensitive (gwidget, "icon-name", sensitivity, msg);
 
6062
                  glade_widget_property_set_sensitive (gwidget, "icon-widget", sensitivity, msg);
 
6063
                  glade_widget_property_set_sensitive (gwidget, "icon", sensitivity, msg);
 
6064
          }
6006
6065
}
6007
6066
 
6008
6067
/* ----------------------------- GtkButton ------------------------------ */
6310
6369
                g_value_unset (&int_value);
6311
6370
        }
6312
6371
        else
6313
 
                GWA_GET_CLASS (GTK_TYPE_WIDGET)->set_property (adaptor, object,
 
6372
                GWA_GET_CLASS (GTK_TYPE_WIDGET)->get_property (adaptor, object,
6314
6373
                                                               id, value);
6315
6374
}
6316
6375
 
9990
10049
}
9991
10050
 
9992
10051
/*--------------------------- GtkSizeGroup ---------------------------------*/
9993
 
gboolean
9994
 
glade_gtk_size_group_depends (GladeWidgetAdaptor *adaptor,
9995
 
                              GladeWidget        *widget,
9996
 
                              GladeWidget        *another)
9997
 
{
9998
 
        if (GTK_IS_WIDGET (another->object))
9999
 
                return TRUE; 
10000
 
 
10001
 
        return GWA_GET_CLASS (G_TYPE_OBJECT)->depends (adaptor, widget, another);
10002
 
}
10003
10052
 
10004
10053
#define GLADE_TAG_SIZEGROUP_WIDGETS "widgets"
10005
10054
#define GLADE_TAG_SIZEGROUP_WIDGET  "widget"
12188
12237
        gtk_tree_view_remove_column (view, column);
12189
12238
}
12190
12239
 
12191
 
gboolean
12192
 
glade_gtk_treeview_depends (GladeWidgetAdaptor *adaptor,
12193
 
                            GladeWidget        *widget,
12194
 
                            GladeWidget        *another)
12195
 
{
12196
 
        if (GTK_IS_TREE_MODEL (another->object))
12197
 
                return TRUE; 
12198
 
 
12199
 
        return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->depends (adaptor, widget, another);
12200
 
}
12201
 
 
12202
12240
/*--------------------------- GtkAdjustment ---------------------------------*/
12203
12241
void
12204
12242
glade_gtk_adjustment_write_widget (GladeWidgetAdaptor *adaptor,