Commit 72e543f0 authored by Tristan Van Berkom's avatar Tristan Van Berkom

- Reimplemented GtkImage from ground up. - Reimplemented stock on


	* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: 
	- Reimplemented GtkImage from ground up.
	- Reimplemented stock on GtkButton.
	- Made toolbutton editables show up in the toolbar editor

	* gladeui/glade-base-editor.[ch]: Added glade_base_editor_add_editable()

	* plugins/gtk+/glade-button-editor.c, plugins/gtk+/glade-tool-bar-editor.c:
	Implement new Editable vfunc set_show_name()

	* gladeui/glade-editor-table.c, gladeui/glade-editable.c, gladeui/glade-editor.c:
	Added new vfunc set_show_name()

	* plugins/gtk+/Makefile.am, plugins/gtk+/glade-image-editor.[ch]: New editor
	widget for GtkImage

	* gladeui/glade-property-class.[ch]: string props can now be "stock" or "stock-icon"

	* gladeui/glade-widget-adaptor.c: No more stock enum eprops

	* gladeui/glade-editor-property.c: Handle string types with "stock" or "stock-icon"


svn path=/trunk/; revision=2004
parent 70d528b5
2008-10-27 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c:
- Reimplemented GtkImage from ground up.
- Reimplemented stock on GtkButton.
- Made toolbutton editables show up in the toolbar editor
* gladeui/glade-base-editor.[ch]: Added glade_base_editor_add_editable()
* plugins/gtk+/glade-button-editor.c, plugins/gtk+/glade-tool-bar-editor.c:
Implement new Editable vfunc set_show_name()
* gladeui/glade-editor-table.c, gladeui/glade-editable.c, gladeui/glade-editor.c:
Added new vfunc set_show_name()
* plugins/gtk+/Makefile.am, plugins/gtk+/glade-image-editor.[ch]: New editor
widget for GtkImage
* gladeui/glade-property-class.[ch]: string props can now be "stock" or "stock-icon"
* gladeui/glade-widget-adaptor.c: No more stock enum eprops
* gladeui/glade-editor-property.c: Handle string types with "stock" or "stock-icon"
2008-10-26 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/Makefile.am, plugins/gtk+/glade-tool-button-editor.[ch]:
......
......@@ -1477,11 +1477,18 @@ glade_base_editor_init (GladeBaseEditor *editor)
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* ScrolledWindow */
scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scroll);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
/* Tables */
e->table = gtk_table_new (1, 2, FALSE);
gtk_widget_show (e->table);
gtk_table_set_row_spacings (GTK_TABLE (e->table), 4);
gtk_box_pack_start (GTK_BOX (vbox), e->table, FALSE, TRUE, 0);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), e->table);
/* Signal Editor */
e->signal_editor = glade_signal_editor_new (NULL);
......@@ -1688,6 +1695,44 @@ glade_base_editor_add_properties (GladeBaseEditor *editor,
va_end (args);
}
/**
* glade_base_editor_add_editable:
* @editor: a #GladeBaseEditor
* @gchild: the #GladeWidget
*
* Add @gchild general page editor
*
* NOTE: This function is intended to be used in "child-selected" callbacks
*/
void
glade_base_editor_add_editable (GladeBaseEditor *editor,
GladeWidget *gchild)
{
GladeEditorProperty *eprop;
GladeEditable *editable;
va_list args;
gchar *property;
gint row;
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
g_return_if_fail (GLADE_IS_WIDGET (gchild));
editable = (GtkWidget *)glade_widget_adaptor_create_editable (gchild->adaptor, GLADE_PAGE_GENERAL);
glade_editable_set_show_name (editable, FALSE);
glade_editable_load (editable, gchild);
gtk_widget_show (GTK_WIDGET (editable));
row = editor->priv->row;
gtk_table_attach (GTK_TABLE (editor->priv->table), GTK_WIDGET (editable), 0, 2, row, row + 1,
GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 0);
editor->priv->row++;
}
/**
* glade_base_editor_add_label:
* @editor: a #GladeBaseEditor
......
......@@ -65,6 +65,9 @@ GladeBaseEditor *glade_base_editor_new (GObject *containe
gboolean tree_like,
...);
void glade_base_editor_add_editable (GladeBaseEditor *editor,
GladeWidget *gchild);
void glade_base_editor_add_default_properties (GladeBaseEditor *editor,
GladeWidget *gchild);
......
......@@ -31,6 +31,7 @@
#include <glib/gi18n-lib.h>
#include <string.h>
#include "glade-builtins.h"
#include "glade-displayable-values.h"
struct _GladeParamSpecObjects {
......@@ -53,7 +54,7 @@ typedef struct _GladeStockItem {
* Auto-generate the enum type for stock properties *
************************************************************/
/* Hard-coded list of stock images from gtk+ that are not stock "items" */
/* Hard-coded list of stock images (and displayable translations) from gtk+ that are not stock "items" */
static const gchar *builtin_stock_images[] =
{
"gtk-dialog-authentication", /* GTK_STOCK_DIALOG_AUTHENTICATION */
......@@ -65,6 +66,17 @@ static const gchar *builtin_stock_images[] =
"gtk-missing-image" /* GTK_STOCK_MISSING_IMAGE */
};
static const gchar *builtin_stock_displayables[] =
{
N_("Authentication"), /* GTK_STOCK_DIALOG_AUTHENTICATION */
N_("DnD"), /* GTK_STOCK_DND */
N_("DnD Multiple"), /* GTK_STOCK_DND_MULTIPLE */
N_("Color Picker"), /* GTK_STOCK_COLOR_PICKER */
N_("Directory"), /* GTK_STOCK_DIRECTORY */
N_("File"), /* GTK_STOCK_FILE */
N_("Missing Image") /* GTK_STOCK_MISSING_IMAGE */
};
static GSList *stock_prefixs = NULL;
static gboolean stock_prefixs_done = FALSE;
......@@ -82,7 +94,6 @@ glade_standard_stock_append_prefix (const gchar *prefix)
stock_prefixs = g_slist_append (stock_prefixs, g_strdup (prefix));
}
static GladeStockItem *
new_from_values (const gchar *name, const gchar *nick, gint value)
{
......@@ -98,6 +109,7 @@ new_from_values (const gchar *name, const gchar *nick, gint value)
new_gsi->value_nick = g_strdup (nick);
new_gsi->value = value;
clean_name = g_strdup (name);
len = strlen (clean_name);
......@@ -110,7 +122,7 @@ new_from_values (const gchar *name, const gchar *nick, gint value)
i++;
}
new_gsi->clean_name = g_utf8_collate_key (clean_name, i - 1);
new_gsi->clean_name = g_utf8_collate_key (clean_name, i - j);
g_free (clean_name);
......@@ -134,7 +146,7 @@ list_stock_items (gboolean include_images)
GtkStockItem item;
GSList *l = NULL, *stock_list = NULL, *p = NULL;
gchar *stock_id = NULL, *prefix = NULL;
gint stock_enum = 1, i = 0;
gint stock_enum = 0, i = 0;
GEnumValue value;
GArray *values = NULL;
GladeStockItem *gsi;
......@@ -144,13 +156,7 @@ list_stock_items (gboolean include_images)
stock_list = g_slist_reverse (gtk_stock_list_ids ());
values = g_array_sized_new (TRUE, TRUE, sizeof (GEnumValue),
g_slist_length (stock_list) + 1);
/* Add first "no stock" element which is sorted alone ! */
gsi = new_from_values ("None", "glade-none", 0);
gsi_list = g_slist_insert_sorted (gsi_list, gsi, (GCompareFunc) compare_two_gsi);
gsi_list_list = g_slist_append (gsi_list_list, gsi_list);
gsi_list = NULL;
g_slist_length (stock_list));
/* We want gtk+ stock items to appear first */
if ((stock_prefixs && strcmp (stock_prefixs->data, "gtk-")) ||
......@@ -209,18 +215,39 @@ list_stock_items (gboolean include_images)
g_slist_free (gsi_list_list);
/* Add the trailing end marker */
value.value = 0;
value.value_name = NULL;
value.value_nick = NULL;
values = g_array_append_val (values, value);
stock_prefixs_done = TRUE;
g_slist_free (stock_list);
return values;
}
static gchar *
clean_stock_name (const gchar *name)
{
gchar *clean_name, *str;
size_t len = 0;
guint i = 0;
guint j = 0;
g_assert (name && name[0]);
str = g_strdup (name);
len = strlen (str);
while (i+j <= len)
{
if (str[i+j] == '_')
j++;
str[i] = str[i+j];
i++;
}
clean_name = g_strndup (str, i - j);
g_free (str);
return clean_name;
}
GType
glade_standard_stock_get_type (void)
{
......@@ -228,9 +255,23 @@ glade_standard_stock_get_type (void)
if (etype == 0) {
GArray *values = list_stock_items (FALSE);
gint i, n_values = values->len;
GEnumValue *enum_values = (GEnumValue *)values->data;
GtkStockItem item;
etype = g_enum_register_static ("GladeStock",
(GEnumValue *)g_array_free (values, FALSE));
/* Register displayable by GType, i.e. after the types been created. */
for (i = 0; i < n_values; i++)
{
if (gtk_stock_lookup (enum_values[i].value_nick, &item))
{
gchar *clean_name = clean_stock_name (item.label);
glade_register_translated_value (etype, enum_values[i].value_nick, clean_name);
g_free (clean_name);
}
}
}
return etype;
}
......@@ -243,9 +284,33 @@ glade_standard_stock_image_get_type (void)
if (etype == 0) {
GArray *values = list_stock_items (TRUE);
gint i, n_values = values->len;
GEnumValue *enum_values = (GEnumValue *)values->data;
GtkStockItem item;
etype = g_enum_register_static ("GladeStockImage",
(GEnumValue *)g_array_free (values, FALSE));
/* Register displayable by GType, i.e. after the types been created. */
for (i = 0; i < n_values; i++)
{
if (gtk_stock_lookup (enum_values[i].value_nick, &item))
{
gchar *clean_name = clean_stock_name (item.label);
/* These are translated, we just cut out the mnemonic underscores */
glade_register_translated_value (etype, enum_values[i].value_nick, clean_name);
g_free (clean_name);
}
}
for (i = 0; i < G_N_ELEMENTS (builtin_stock_images); i++)
{
/* these ones are translated from glade3 */
glade_register_displayable_value (etype,
builtin_stock_images[i], GETTEXT_PACKAGE,
builtin_stock_displayables[i]);
}
}
return etype;
}
......
......@@ -65,6 +65,24 @@ glade_register_displayable_value (GType type,
gpointer klass;
GList *values;
g_return_if_fail (value && value[0]);
g_return_if_fail (domain && domain[0]);
g_return_if_fail (string && string[0]);
glade_register_translated_value (type, value, dgettext (domain, string));
}
void
glade_register_translated_value (GType type,
const gchar *value,
const gchar *string)
{
ValueTab *tab;
gpointer klass;
GList *values;
g_return_if_fail (value && value[0]);
g_return_if_fail (string && string[0]);
klass = g_type_class_ref (type);
g_return_if_fail (klass != NULL);
......@@ -73,7 +91,7 @@ glade_register_displayable_value (GType type,
tab = g_new0 (ValueTab, 1);
tab->value = g_strdup (value);
tab->string = g_strdup (dgettext (domain, string));
tab->string = g_strdup (string);
if ((values =
g_hash_table_lookup (values_hash, klass)) != NULL)
......@@ -119,6 +137,8 @@ glade_get_displayable_value (GType type,
GList *values, *tab_iter;
gchar *displayable = NULL;
g_return_val_if_fail (value && value[0], NULL);
if (!values_hash)
return NULL;
......@@ -147,9 +167,11 @@ glade_get_value_from_displayable (GType type,
GList *values, *tab_iter;
gchar *value = NULL;
g_return_val_if_fail (displayable && displayable[0], NULL);
if (!values_hash)
return NULL;
klass = g_type_class_ref (type);
g_return_val_if_fail (klass != NULL, NULL);
......
......@@ -12,6 +12,10 @@ void glade_register_displayable_value (GType type,
const gchar *domain,
const gchar *string);
void glade_register_translated_value (GType type,
const gchar *value,
const gchar *string);
gboolean glade_type_has_displayable_values (GType type);
G_CONST_RETURN
......
......@@ -62,6 +62,9 @@ glade_editable_get_type (void)
* @editable: A #GladeEditable
* @widget: the #GladeWidget to load
*
* Loads @widget property values into @editable
* (the editable will watch the widgets properties
* until its loaded with another widget or %NULL)
*/
void
glade_editable_load (GladeEditable *editable,
......@@ -79,3 +82,28 @@ glade_editable_load (GladeEditable *editable,
g_critical ("No GladeEditable::load() support on type %s",
G_OBJECT_TYPE_NAME (editable));
}
/**
* glade_editable_set_show_name:
* @editable: A #GladeEditable
* @show_name: Whether or not to show the name entry
*
* This only applies for the general page in the property
* editor, editables that embed the #GladeEditorTable implementation
* for the general page should use this to forward the message
* to its embedded editable.
*/
void
glade_editable_set_show_name (GladeEditable *editable,
gboolean show_name)
{
GladeEditableIface *iface;
g_return_if_fail (GLADE_IS_EDITABLE (editable));
iface = GLADE_EDITABLE_GET_IFACE (editable);
if (iface->set_show_name)
iface->set_show_name (editable, show_name);
}
......@@ -32,14 +32,18 @@ struct _GladeEditableIface
GTypeInterface g_iface;
/* virtual table */
void (* load) (GladeEditable *editable,
GladeWidget *widget);
void (* load) (GladeEditable *editable,
GladeWidget *widget);
void (* set_show_name) (GladeEditable *editable,
gboolean show_name);
};
GType glade_editable_get_type (void) G_GNUC_CONST;
void glade_editable_load (GladeEditable *editable,
GladeWidget *widget);
GType glade_editable_get_type (void) G_GNUC_CONST;
void glade_editable_load (GladeEditable *editable,
GladeWidget *widget);
void glade_editable_set_show_name (GladeEditable *editable,
gboolean show_name);
G_END_DECLS
......
......@@ -846,22 +846,6 @@ glade_editor_create_input_enum_item (GladeEditorProperty *eprop,
return menu_item;
}
static GtkWidget *
glade_editor_create_input_stock_item (GladeEditorProperty *eprop,
const gchar *id,
gint value)
{
GtkWidget *menu_item = gtk_image_menu_item_new_from_stock (id, NULL);
g_signal_connect (G_OBJECT (menu_item), "activate",
G_CALLBACK (glade_eprop_enum_changed),
eprop);
g_object_set_data (G_OBJECT (menu_item), GLADE_ENUM_DATA_TAG, GINT_TO_POINTER(value));
return menu_item;
}
static GtkWidget *
glade_eprop_enum_create_input (GladeEditorProperty *eprop)
{
......@@ -869,13 +853,10 @@ glade_eprop_enum_create_input (GladeEditorProperty *eprop)
GtkWidget *menu_item, *menu;
GladePropertyClass *klass;
GEnumClass *eclass;
gboolean stock;
guint i;
klass = eprop->klass;
eclass = g_type_class_ref (klass->pspec->value_type);
stock = (klass->pspec->value_type == GLADE_TYPE_STOCK) ||
(klass->pspec->value_type == GLADE_TYPE_STOCK_IMAGE);
menu = gtk_menu_new ();
......@@ -886,14 +867,8 @@ glade_eprop_enum_create_input (GladeEditorProperty *eprop)
eclass->values[i].value_nick);
if (value_name == NULL) value_name = eclass->values[i].value_nick;
if (stock && strcmp (eclass->values[i].value_nick, "glade-none"))
menu_item = glade_editor_create_input_stock_item
(eprop,
eclass->values[i].value_nick,
eclass->values[i].value);
else
menu_item = glade_editor_create_input_enum_item
(eprop, value_name, eclass->values[i].value);
menu_item = glade_editor_create_input_enum_item
(eprop, value_name, eclass->values[i].value);
gtk_widget_show (menu_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
......@@ -1525,6 +1500,7 @@ typedef struct {
GladeEditorProperty parent_instance;
GtkWidget *text_entry;
GtkTreeModel *store;
} GladeEPropText;
GLADE_MAKE_EPROP (GladeEPropText, glade_eprop_text)
......@@ -1554,7 +1530,25 @@ glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
fmt = glade_project_get_format (property->widget->project);
if (GTK_IS_ENTRY (eprop_text->text_entry))
if (GTK_IS_COMBO_BOX (eprop_text->text_entry))
{
if (GTK_IS_COMBO_BOX_ENTRY (eprop_text->text_entry))
{
const gchar *text = g_value_get_string (property->value);
if (!text) text = "";
gtk_entry_set_text (GTK_ENTRY (GTK_BIN (eprop_text->text_entry)->child), text);
}
else
{
const gchar *text = g_value_get_string (property->value);
gint value = text ?
glade_utils_enum_value_from_string (GLADE_TYPE_STOCK, text) : 0;
/* Set active iter... */
gtk_combo_box_set_active (GTK_COMBO_BOX (eprop_text->text_entry), value);
}
}
else if (GTK_IS_ENTRY (eprop_text->text_entry))
{
GtkEntry *entry = GTK_ENTRY (eprop_text->text_entry);
const gchar *text = NULL;
......@@ -1941,6 +1935,70 @@ glade_eprop_text_show_i18n_dialog (GtkWidget *entry,
}
}
enum {
COMBO_COLUMN_TEXT = 0,
COMBO_COLUMN_PIXBUF,
COMBO_LAST_COLUMN
};
static GtkListStore *
glade_eprop_text_create_store (GType enum_type)
{
GtkListStore *store;
GtkTreeIter iter;
GEnumClass *eclass;
guint i;
eclass = g_type_class_ref (enum_type);
store = gtk_list_store_new (COMBO_LAST_COLUMN,
G_TYPE_STRING,
G_TYPE_STRING);
for (i = 0; i < eclass->n_values; i++)
{
const gchar *displayable = glade_get_displayable_value (enum_type, eclass->values[i].value_nick);
if (!displayable)
displayable = eclass->values[i].value_nick;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COMBO_COLUMN_TEXT, displayable,
COMBO_COLUMN_PIXBUF, eclass->values[i].value_nick,
-1);
}
g_type_class_unref (eclass);
return store;
}
static void
eprop_text_stock_changed (GtkComboBox *combo,
GladeEditorProperty *eprop)
{
GladeEPropText *eprop_text = GLADE_EPROP_TEXT (eprop);
GtkTreeIter iter;
gchar *text = NULL;
const gchar *str;
if (eprop->loading) return;
if (gtk_combo_box_get_active_iter (combo, &iter))
{
gtk_tree_model_get (GTK_TREE_MODEL (eprop_text->store), &iter,
COMBO_COLUMN_PIXBUF, &text,
-1);
glade_eprop_text_changed_common (eprop, text, eprop->use_command);
g_free (text);
}
else if (GTK_IS_COMBO_BOX_ENTRY (combo))
{
str = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (combo)->child));
glade_eprop_text_changed_common (eprop, str, eprop->use_command);
}
}
static GtkWidget *
glade_eprop_text_create_input (GladeEditorProperty *eprop)
{
......@@ -1952,7 +2010,40 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
hbox = gtk_hbox_new (FALSE, 0);
if (klass->visible_lines > 1 ||
if (klass->stock || klass->stock_icon)
{
GtkCellRenderer *renderer;
GtkWidget *combo = gtk_combo_box_entry_new ();
eprop_text->store = (GtkTreeModel *)
glade_eprop_text_create_store (klass->stock ? GLADE_TYPE_STOCK :
GLADE_TYPE_STOCK_IMAGE);
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (eprop_text->store));
/* let the comboboxentry prepend its intrusive cell first... */
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo),
COMBO_COLUMN_TEXT);
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (combo), renderer, 0);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"stock-id", COMBO_COLUMN_PIXBUF,
NULL);
if (klass->stock)
gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), FALSE);
gtk_widget_show (combo);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (combo), "changed",
G_CALLBACK (eprop_text_stock_changed), eprop);
eprop_text->text_entry = combo;
}
else if (klass->visible_lines > 1 ||
klass->pspec->value_type == G_TYPE_STRV ||
klass->pspec->value_type == G_TYPE_VALUE_ARRAY)
{
......@@ -3368,6 +3459,8 @@ glade_eprop_adjustment_create_input (GladeEditorProperty *eprop)
* @property: A #GladeProperty
*
* Loads @property values into @eprop and connects.
* (the editor property will watch the property's value
* until its loaded with another property or %NULL)
*/
void
glade_editor_property_load (GladeEditorProperty *eprop,
......
......@@ -158,10 +158,29 @@ glade_editor_table_load (GladeEditable *editable,
table->loading = FALSE;
}
static void
glade_editor_table_set_show_name (GladeEditable *editable,
gboolean show_name)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (editable);
if (show_name)
{
gtk_widget_show (table->name_label);
gtk_widget_show (table->name_entry);
}
else
{
gtk_widget_hide (table->name_label);
gtk_widget_hide (table->name_entry);
}
}
static void
glade_editor_table_editable_init (GladeEditableIface *iface)
{
iface->load = glade_editor_table_load;
iface->set_show_name = glade_editor_table_set_show_name;
}
static void
......@@ -297,18 +316,17 @@ widget_name_edited (GtkWidget *editable, GladeEditorTable *table)
static void
append_name_field (GladeEditorTable *table)
{
GtkWidget *label;
gchar *text = _("The Object's name");
/* Name */
label = gtk_label_new (_("Name:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show (label);
table->name_label = gtk_label_new (_("Name:"));
gtk_misc_set_alignment (GTK_MISC (table->name_label), 0.0, 0.5);
gtk_widget_show (table->name_label);
table->name_entry = gtk_entry_new ();
gtk_widget_show (table->name_entry);
gtk_widget_set_tooltip_text (label, text);
gtk_widget_set_tooltip_text (table->name_label, text);
gtk_widget_set_tooltip_text (table->name_entry, text);
g_signal_connect (G_OBJECT (table->name_entry), "activate",
......@@ -316,7 +334,7 @@ append_name_field (GladeEditorTable *table)
g_signal_connect (G_OBJECT (table->name_entry), "changed",
G_CALLBACK (widget_name_edited), table);
glade_editor_table_attach (table, label, 0, table->rows);
glade_editor_table_attach (table, table->name_label, 0, table->rows);
glade_editor_table_attach (table, table->name_entry, 1, table->rows);
table->rows++;
......
......@@ -49,6 +49,7 @@ struct _GladeEditorTable
GladeWidget *loaded_widget; /* A pointer to the currently loaded GladeWidget
*/
GtkWidget *name_label; /* A pointer to the "Name:" label (for show/hide) */
GtkWidget *name_entry; /* A pointer to the gtk_entry that holds
* the name of the widget. This is the
* first item _pack'ed to the table_widget.
......
......@@ -91,6 +91,8 @@ glade_property_class_new (gpointer handle)
property_class->ignore = FALSE;
property_class->needs_sync = FALSE;
property_class->themed_icon = FALSE;
property_class->stock = FALSE;
property_class->stock_icon = FALSE;
property_class->translatable = FALSE;
property_class->virt = TRUE;
property_class->transfer_on_paste = FALSE;
......@@ -1416,6 +1418,8 @@ glade_property_class_update_from_node (GladeXmlNode *node,
klass->ignore = glade_xml_get_property_boolean (node, GLADE_TAG_IGNORE, klass->ignore);
klass->needs_sync = glade_xml_get_property_boolean (node, GLADE_TAG_NEEDS_SYNC, klass->needs_sync);
klass->themed_icon = glade_xml_get_property_boolean (node, GLADE_TAG_THEMED_ICON, klass->themed_icon);
klass->stock = glade_xml_get_property_boolean (node, GLADE_TAG_STOCK, klass->stock);
klass->stock_icon = glade_xml_get_property_boolean (node, GLADE_TAG_STOCK_ICON, klass->stock_icon);
klass->weight = glade_xml_get_property_double (node, GLADE_TAG_WEIGHT, klass->weight);
klass->transfer_on_paste = glade_xml_get_property_boolean (node, GLADE_TAG_TRANSFER_ON_PASTE, klass->transfer_on_paste);
klass->save_always = glade_xml_get_property_boolean (node, GLADE_TAG_SAVE_ALWAYS, klass->save_always);
......
......@@ -163,6 +163,11 @@ struct _GladePropertyClass
* property class definition if proper editing tools are to
* be used.
*/
gboolean stock_icon; /* String properties can also denote stock icons, including
* icons from icon factories...
*/
gboolean stock; /* ... or a narrower list of "items" from gtk builtin stock items.
*/
gboolean transfer_on_paste; /* If this is a packing prop,
* wether we should transfer it on paste.
......
......@@ -1944,6 +1944,8 @@ glade_utils_enum_value_from_string (GType enum_type, const gchar *strval)
const gchar *displayable;
GValue *gvalue;