[glade3] * Whole tree updated to remove all notion of project conversions and dual project formats, no mo
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * Whole tree updated to remove all notion of project conversions and dual project formats, no mo
- Date: Wed, 29 Dec 2010 16:09:51 +0000 (UTC)
commit ecabb8754542fa993a6812ff33f4b29e804da136
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 30 01:15:19 2010 +0900
* Whole tree updated to remove all notion of project conversions and dual project formats,
no more libglade.
ChangeLog | 3 +
gladeui/glade-catalog.c | 73 ---
gladeui/glade-catalog.h | 21 -
gladeui/glade-command.c | 281 +---------
gladeui/glade-command.h | 4 -
gladeui/glade-editor-property.c | 536 ++----------------
gladeui/glade-editor-property.h | 4 -
gladeui/glade-palette.c | 5 +-
gladeui/glade-popup.c | 33 +-
gladeui/glade-project.c | 395 +-------------
gladeui/glade-project.h | 8 +-
gladeui/glade-property-class.c | 102 +---
gladeui/glade-property-class.h | 16 +-
gladeui/glade-property.c | 105 +---
gladeui/glade-property.h | 7 -
gladeui/glade-signal-editor.c | 9 -
gladeui/glade-signal.c | 5 -
gladeui/glade-signal.h | 1 -
gladeui/glade-utils.c | 78 +---
gladeui/glade-utils.h | 3 +-
gladeui/glade-widget-adaptor.c | 40 +--
gladeui/glade-widget-adaptor.h | 18 +-
gladeui/glade-widget.c | 106 +---
gladeui/glade-xml-utils.h | 32 +-
plugins/gtk+/Makefile.am | 2 +-
plugins/gtk+/glade-convert.c | 914 ------------------------------
plugins/gtk+/glade-gtk.c | 931 +++----------------------------
plugins/gtk+/glade-image-item-editor.c | 13 +-
plugins/gtk+/glade-model-data.c | 5 +-
plugins/gtk+/glade-tool-button-editor.c | 54 +--
plugins/gtk+/glade-tool-button-editor.h | 2 -
plugins/gtk+/gtk+.xml.in | 176 ++-----
src/glade-window.c | 4 -
33 files changed, 290 insertions(+), 3696 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a1bf346..89e2ff8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
* gladeui/glade-design-view.c: Made loading progress bar nicer looking and ellipsizing.
+ * Whole tree updated to remove all notion of project conversions and dual project formats,
+ no more libglade.
+
2010-12-28 Tristan Van Berkom <tristanvb openismus com>
* gladeui/Makefile.am, gladeui/glade.h, gladeui/glade-clipboard.c, gladeui/glade-app.[ch],
diff --git a/gladeui/glade-catalog.c b/gladeui/glade-catalog.c
index fecbd3e..09a6c3b 100644
--- a/gladeui/glade-catalog.c
+++ b/gladeui/glade-catalog.c
@@ -40,9 +40,6 @@ struct _GladeCatalog
GList *targetable_versions; /* list of suitable version targets */
- gboolean libglade_supported; /* whether this catalog supports libglade */
- gboolean builder_supported; /* whether this catalog supports gtkbuilder */
-
gchar *library; /* Library name for backend support */
gchar *name; /* Symbolic catalog name */
@@ -70,8 +67,6 @@ struct _GladeCatalog
gchar *init_function_name;/* Catalog's init function name */
GladeCatalogInitFunc init_function;
-
- GladeProjectConvertFunc project_convert_function; /* pointer to module's project converter */
};
struct _GladeWidgetGroup
@@ -143,8 +138,6 @@ catalog_allocate (void)
catalog->adaptors = NULL;
catalog->widget_groups = NULL;
- catalog->libglade_supported = FALSE;
- catalog->builder_supported = TRUE;
return catalog;
}
@@ -156,7 +149,6 @@ catalog_open (const gchar *filename)
GladeXmlContext *context;
GladeXmlDoc *doc;
GladeXmlNode *root;
- gchar *str;
/* get the context & root node of the catalog file */
context = glade_xml_context_new_from_path (filename,
@@ -215,22 +207,6 @@ catalog_open (const gchar *filename)
if (!catalog->domain)
catalog->domain = g_strdup (catalog->library);
-
- if ((str = glade_xml_get_property_string (root, GLADE_TAG_SUPPORTS)) != NULL)
- {
- gchar **split = g_strsplit (str, ",", 0);
- gint i;
-
- catalog->builder_supported = FALSE;
-
- for (i = 0; split[i]; i++)
- {
- if (!strcmp (split[i], GLADE_TAG_LIBGLADE))
- catalog->libglade_supported = TRUE;
- else if (!strcmp (split[i], GLADE_TAG_GTKBUILDER))
- catalog->builder_supported = TRUE;
- }
- }
/* catalog->icon_prefix defaults to catalog->name */
if (!catalog->icon_prefix)
@@ -240,11 +216,6 @@ catalog_open (const gchar *filename)
catalog_get_function (catalog, catalog->init_function_name,
(gpointer) &catalog->init_function);
- if ((str = glade_xml_get_value_string (root, GLADE_TAG_PROJECT_CONVERT_FUNCTION)) != NULL)
- {
- catalog_get_function (catalog, str, (gpointer) &catalog->project_convert_function);
- }
-
return catalog;
}
@@ -638,23 +609,6 @@ glade_catalog_get_icon_prefix (GladeCatalog *catalog)
return catalog->icon_prefix;
}
-gboolean
-glade_catalog_supports_libglade (GladeCatalog *catalog)
-{
- g_return_val_if_fail (GLADE_IS_CATALOG (catalog), FALSE);
-
- return catalog->libglade_supported;
-}
-
-gboolean
-glade_catalog_supports_gtkbuilder (GladeCatalog *catalog)
-{
- g_return_val_if_fail (GLADE_IS_CATALOG (catalog), FALSE);
-
- return catalog->builder_supported;
-}
-
-
guint16
glade_catalog_get_major_version (GladeCatalog *catalog)
{
@@ -814,30 +768,3 @@ widget_group_destroy (GladeWidgetGroup *group)
g_slice_free (GladeWidgetGroup, group);
}
-
-
-
-/**
- * glade_catalog_convert_project:
- * @catalog: A #GladeCatalog
- * @project: The #GladeProject to convert
- * @new_format: The format to convert @project to
- *
- * Do any data changes needed to the project for the new
- * format in an undoable way.
- *
- * Returns: FALSE if any errors occurred during the conversion.
- */
-gboolean
-glade_catalog_convert_project (GladeCatalog *catalog,
- GladeProject *project,
- GladeProjectFormat new_format)
-{
- g_return_val_if_fail (GLADE_IS_CATALOG (catalog), FALSE);
- g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE);
-
- if (catalog->project_convert_function)
- return catalog->project_convert_function (project, new_format);
-
- return TRUE;
-}
diff --git a/gladeui/glade-catalog.h b/gladeui/glade-catalog.h
index dcff262..6c812fc 100644
--- a/gladeui/glade-catalog.h
+++ b/gladeui/glade-catalog.h
@@ -47,22 +47,6 @@ typedef struct _GladeWidgetGroup GladeWidgetGroup;
*/
typedef void (*GladeCatalogInitFunc) (const gchar *name);
-/**
- * GladeProjectConvertFunc:
- * @project: A #GladeProject
- * @new_format: The format to convert @project to
- *
- * Generally format transperency is implemented at load/save time,
- * but if some objects need to be setup differently, or some new
- * objects created (like real GtkAdjustment objects for old inline
- * property values) this is the place to do those things, be careful
- * to use the GladeCommand api because conversions are undoable.
- *
- * Returns: FALSE if any errors occurred during the conversion.
- */
-typedef gboolean (*GladeProjectConvertFunc) (GladeProject *project,
- GladeProjectFormat new_format);
-
typedef struct {
gint major;
@@ -99,11 +83,6 @@ gboolean glade_widget_group_get_expanded (GladeWidgetGroup *group);
const GList *glade_widget_group_get_adaptors (GladeWidgetGroup *group);
-gboolean glade_catalog_convert_project (GladeCatalog *catalog,
- GladeProject *project,
- GladeProjectFormat new_format);
-
-
gboolean glade_catalog_supports_libglade (GladeCatalog *catalog);
gboolean glade_catalog_supports_gtkbuilder (GladeCatalog *catalog);
diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
index 45f7860..ab0636c 100644
--- a/gladeui/glade-command.c
+++ b/gladeui/glade-command.c
@@ -484,19 +484,11 @@ glade_command_set_property_unifies (GladeCommand *this_cmd, GladeCommand *other_
for (list = cmd1->sdata; list; list = list->next)
{
- GladeProject *project;
- GladeProjectFormat fmt = GLADE_PROJECT_FORMAT_GTKBUILDER;
pdata1 = list->data;
-
- if (pdata1->property->widget)
- {
- project = glade_widget_get_project (pdata1->property->widget);
- fmt = glade_project_get_format (project);
- }
if (glade_property_class_compare (pdata1->property->klass,
pdata1->old_value,
- pdata1->new_value, fmt))
+ pdata1->new_value))
return FALSE;
}
return TRUE;
@@ -585,8 +577,7 @@ glade_command_set_property_collapse (GladeCommand *this_cmd, GladeCommand *other
#define MAX_UNDO_MENU_ITEM_VALUE_LEN 10
static gchar *
-glade_command_set_property_description (GladeCommandSetProperty *me,
- GladeProjectFormat fmt)
+glade_command_set_property_description (GladeCommandSetProperty *me)
{
GCSetPropData *sdata;
gchar *description = NULL;
@@ -601,7 +592,7 @@ glade_command_set_property_description (GladeCommandSetProperty *me,
sdata = me->sdata->data;
value_name = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (sdata->property->klass->handle),
- sdata->property->klass, sdata->new_value, fmt);
+ sdata->property->klass, sdata->new_value);
g_assert (sdata->property->klass->name);
g_assert (sdata->property->widget->name);
@@ -649,8 +640,7 @@ glade_command_set_properties_list (GladeProject *project, GList *props)
me->sdata = props;
cmd->description =
- glade_command_set_property_description
- (me, glade_project_get_format (project));
+ glade_command_set_property_description (me);
multiple = g_list_length (me->sdata) > 1;
@@ -2134,11 +2124,9 @@ typedef struct {
GladeCommand parent;
GladeProperty *property;
gboolean translatable;
- gboolean has_context;
gchar *context;
gchar *comment;
gboolean old_translatable;
- gboolean old_has_context;
gchar *old_context;
gchar *old_comment;
} GladeCommandSetI18n;
@@ -2156,7 +2144,6 @@ glade_command_set_i18n_execute(GladeCommand *cmd)
{
GladeCommandSetI18n *me = (GladeCommandSetI18n *)cmd;
gboolean temp_translatable;
- gboolean temp_has_context;
gchar *temp_context;
gchar *temp_comment;
@@ -2166,21 +2153,17 @@ glade_command_set_i18n_execute(GladeCommand *cmd)
/* set the new values in the property */
glade_property_i18n_set_translatable(me->property, me->translatable);
- glade_property_i18n_set_has_context(me->property, me->has_context);
glade_property_i18n_set_context(me->property, me->context);
glade_property_i18n_set_comment(me->property, me->comment);
/* swap the current values with the old values to prepare for undo */
temp_translatable = me->translatable;
- temp_has_context = me->has_context;
temp_context = me->context;
temp_comment = me->comment;
me->translatable = me->old_translatable;
- me->has_context = me->old_has_context;
me->context = me->old_context;
me->comment = me->old_comment;
me->old_translatable = temp_translatable;
- me->old_has_context = temp_has_context;
me->old_context = temp_context;
me->old_comment = temp_comment;
@@ -2239,7 +2222,6 @@ glade_command_set_i18n_collapse (GladeCommand *this_cmd, GladeCommand *other_cmd
/* adjust this command to contain, as its old values, the other command's current values */
this->old_translatable = other->old_translatable;
- this->old_has_context = other->old_has_context;
g_free (this->old_context);
g_free (this->old_comment);
this->old_context = other->old_context;
@@ -2254,7 +2236,6 @@ glade_command_set_i18n_collapse (GladeCommand *this_cmd, GladeCommand *other_cmd
* glade_command_set_i18n:
* @property: a #GladeProperty
* @translatable: a #gboolean
- * @has_context: a #gboolean
* @context: a #const gchar *
* @comment: a #const gchar *
*
@@ -2263,7 +2244,6 @@ glade_command_set_i18n_collapse (GladeCommand *this_cmd, GladeCommand *other_cmd
void
glade_command_set_i18n (GladeProperty *property,
gboolean translatable,
- gboolean has_context,
const gchar *context,
const gchar *comment)
{
@@ -2273,22 +2253,17 @@ glade_command_set_i18n (GladeProperty *property,
/* check that something changed before continuing with the command */
if (translatable == property->i18n_translatable &&
- has_context == property->i18n_has_context &&
- /* XXX add context string shit herex */
-
- ((comment == NULL && property->i18n_comment == NULL) ||
- (comment && property->i18n_comment && !strcmp(property->i18n_comment, comment))))
+ !g_strcmp0 (property->i18n_context, context) &&
+ !g_strcmp0 (property->i18n_comment, comment))
return;
/* load up the command */
me = g_object_new(GLADE_COMMAND_SET_I18N_TYPE, NULL);
me->property = property;
me->translatable = translatable;
- me->has_context = has_context;
me->context = g_strdup(context);
me->comment = g_strdup(comment);
me->old_translatable = property->i18n_translatable;
- me->old_has_context = property->i18n_has_context;
me->old_context = g_strdup(property->i18n_context);
me->old_comment = g_strdup(property->i18n_comment);
GLADE_COMMAND(me)->description = g_strdup_printf(_("Setting i18n metadata"));;
@@ -2307,250 +2282,6 @@ glade_command_set_i18n (GladeProperty *property,
}
-
-
-/******************************************************************************
- *
- * set project format
- *
- * This command sets the format on the project.
- *
- *****************************************************************************/
-
-typedef struct {
- GladeCommand parent;
- GladeProject *project;
- GladeProjectFormat format;
- GladeProjectFormat old_format;
-} GladeCommandSetFormat;
-
-
-GLADE_MAKE_COMMAND (GladeCommandSetFormat, glade_command_set_format);
-#define GLADE_COMMAND_SET_FORMAT_TYPE (glade_command_set_format_get_type ())
-#define GLADE_COMMAND_SET_FORMAT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GLADE_COMMAND_SET_FORMAT_TYPE, GladeCommandSetFormat))
-#define GLADE_COMMAND_SET_FORMAT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GLADE_COMMAND_SET_FORMAT_TYPE, GladeCommandSetFormatClass))
-#define GLADE_IS_COMMAND_SET_FORMAT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GLADE_COMMAND_SET_FORMAT_TYPE))
-#define GLADE_IS_COMMAND_SET_FORMAT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GLADE_COMMAND_SET_FORMAT_TYPE))
-
-static gboolean
-glade_command_set_format_execute(GladeCommand *cmd)
-{
- GladeCommandSetFormat *me = (GladeCommandSetFormat *)cmd;
- GladeProjectFormat fmt;
-
- /* sanity check */
- g_return_val_if_fail (me != NULL, TRUE);
- g_return_val_if_fail (me->project != NULL, TRUE);
-
- /* set the new format */
- glade_project_set_format (me->project, me->format);
-
- /* swap the current values with the old values to prepare for undo */
- fmt = me->format;
- me->format = me->old_format;
- me->old_format = fmt;
-
- return TRUE;
-}
-
-static gboolean
-glade_command_set_format_undo(GladeCommand *cmd)
-{
- return glade_command_set_format_execute(cmd);
-}
-
-static void
-glade_command_set_format_finalize(GObject *obj)
-{
-/* GladeCommandSetFormat *me; */
-
- g_return_if_fail(GLADE_IS_COMMAND_SET_FORMAT(obj));
-
- glade_command_finalize(obj);
-}
-
-static gboolean
-glade_command_set_format_unifies (GladeCommand *this_cmd, GladeCommand *other_cmd)
-{
-/* GladeCommandSetFormat *cmd1; */
-/* GladeCommandSetFormat *cmd2; */
-
- return FALSE;
-}
-
-static void
-glade_command_set_format_collapse (GladeCommand *this_cmd, GladeCommand *other_cmd)
-{
- /* this command is the one that will be used for an undo of the sequence of like commands */
- //GladeCommandSetFormat *this = GLADE_COMMAND_SET_FORMAT (this_cmd);
-
- /* the other command contains the values that will be used for a redo */
- //GladeCommandSetFormat *other = GLADE_COMMAND_SET_FORMAT (other_cmd);
-
- g_return_if_fail (GLADE_IS_COMMAND_SET_FORMAT (this_cmd) && GLADE_IS_COMMAND_SET_FORMAT (other_cmd));
-
- /* no unify/collapse */
-}
-
-
-static void
-glade_command_convert_cleanup_props (GList *properties,
- GladeProjectFormat fmt)
-{
- GladeProperty *property;
- GList *list;
-
- for (list = properties; list; list = list->next)
- {
- property = list->data;
-
- if (glade_property_original_default (property))
- continue;
-
- /* Reset any unsupported properties to thier defaults */
- if ((fmt == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- property->klass->libglade_only) ||
- (fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- property->klass->libglade_unsupported))
- {
- GValue value = { 0, };
-
- glade_property_get_default (property, &value);
- glade_command_set_property (property, &value);
- g_value_unset (&value);
- }
- }
-}
-
-
-static gint
-find_format_rejected_object (GObject *object, gpointer fmtptr)
-{
- GladeWidget *widget = glade_widget_get_from_gobject (object);
- GladeProjectFormat fmt = GPOINTER_TO_INT (fmtptr);
-
- if ((fmt == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- GWA_LIBGLADE_ONLY (widget->adaptor)) ||
- /* If going in libglade format... */
- (fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- /* ... and widget is unsupported by libglade */
- (GWA_LIBGLADE_UNSUPPORTED (widget->adaptor) ||
- /* ... and widget is a non GtkWidget object */
- !GTK_IS_WIDGET (widget->object) ||
- /* ... and its a non-window toplevel */
- (!widget->parent && g_strcmp0 (widget->adaptor->name, "GtkWindow") && !widget->internal))))
- return 0;
-
- return -1;
-}
-
-
-static void
-glade_command_convert_cleanup (GladeProject *project,
- GladeProjectFormat fmt)
-{
- GladeWidget *widget;
- const GList *objects, *list;
- GList *l;
-
- /* List safely delete widgets */
- while ((l = g_list_find_custom ((GList *)glade_project_get_objects (project), GINT_TO_POINTER (fmt),
- (GCompareFunc)find_format_rejected_object)) != NULL)
- {
- GList delete = { 0, };
- widget = glade_widget_get_from_gobject (l->data);
- delete.data = widget;
- glade_command_delete (&delete);
- }
-
- /* Deal with properties of remaining widgets */
- objects = glade_project_get_objects (project);
- for (list = objects; list; list = list->next)
- {
- widget = glade_widget_get_from_gobject (list->data);
- glade_command_convert_cleanup_props (widget->properties, fmt);
- glade_command_convert_cleanup_props (widget->packing_properties, fmt);
- }
-}
-
-
-/**
- * glade_command_set_project_format:
- * @project: a #GladeProject
- * @fmt: the #GladeProjectFormat
- *
- * Sets the format of the project.
- */
-void
-glade_command_set_project_format (GladeProject *project,
- GladeProjectFormat fmt)
-{
- GladeCommandSetFormat *me;
- GList *req_libs, *list;
- gchar *cat_name;
- GladeCatalog *catalog;
-
- g_return_if_fail (GLADE_IS_PROJECT (project));
-
- if (glade_project_get_format (project) != fmt)
- {
- gchar *prj_name = glade_project_get_name (project);
- glade_command_push_group (_("Converting %s to %s format"),
- prj_name,
- fmt == GLADE_PROJECT_FORMAT_LIBGLADE ? "libglade" : "Gtk+ Builder");
- g_free (prj_name);
-
- /* load up the command */
- me = g_object_new(GLADE_COMMAND_SET_FORMAT_TYPE, NULL);
- me->project = project;
- me->format = fmt;
- me->old_format = glade_project_get_format (project);
-
- GLADE_COMMAND(me)->description = g_strdup_printf("dummy string");
-
- glade_command_check_group(GLADE_COMMAND(me));
-
- if ((req_libs = glade_project_required_libs (project)) != NULL)
- {
- for (list = req_libs; list; list = list->next)
- {
- cat_name = list->data;
- catalog = glade_app_get_catalog (cat_name);
-
- glade_catalog_convert_project (catalog, project, fmt);
-
- g_free (cat_name);
- }
- g_list_free (req_libs);
- }
-
- glade_command_convert_cleanup (project, fmt);
-
- /* execute the command and push it on the stack if successful
- * this sets the actual format
- */
- if (glade_command_set_format_execute(GLADE_COMMAND(me)))
- {
- glade_project_push_undo(glade_app_get_project(), GLADE_COMMAND(me));
- }
- else
- {
- g_object_unref(G_OBJECT(me));
- }
-
- /* Emit "convert-finished" signal after setting the actual format */
- g_signal_emit_by_name (project, "convert-finished");
-
- glade_command_pop_group ();
-
- glade_editor_refresh (glade_app_get_editor ());
-
- glade_project_verify_project_for_ui (project);
- }
-}
-
-
-
/******************************************************************************
*
* set project naming policy
diff --git a/gladeui/glade-command.h b/gladeui/glade-command.h
index 405589e..e4c67e5 100644
--- a/gladeui/glade-command.h
+++ b/gladeui/glade-command.h
@@ -87,9 +87,6 @@ void glade_command_collapse (GladeCommand *command,
/************************** project *********************************/
-void glade_command_set_project_format (GladeProject *project,
- GladeProjectFormat fmt);
-
void glade_command_set_project_naming_policy (GladeProject *project,
GladeNamingPolicy policy);
@@ -160,7 +157,6 @@ void glade_command_change_signal (GladeWidget *glade_widget,
void glade_command_set_i18n (GladeProperty *property,
gboolean translatable,
- gboolean has_context,
const gchar *context,
const gchar *comment);
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index dea25c4..f9334a7 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -85,22 +85,16 @@ static void
glade_editor_property_commit_common (GladeEditorProperty *eprop,
GValue *value)
{
- GladeProject *project;
- GladeProjectFormat fmt;
-
if (eprop->use_command == FALSE)
glade_property_set_value (eprop->property, value);
else
glade_command_set_property_value (eprop->property, value);
- project = glade_widget_get_project (eprop->property->widget);
- fmt = glade_project_get_format (project);
-
/* If the value was denied by a verify function, we'll have to
* reload the real value.
*/
if (glade_property_class_compare (eprop->property->klass,
- eprop->property->value, value, fmt) != 0)
+ eprop->property->value, value) != 0)
GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)->load (eprop, eprop->property);
else
/* publish a value change to those interested */
@@ -1157,7 +1151,6 @@ glade_eprop_color_finalize (GObject *object)
static void
glade_eprop_color_load (GladeEditorProperty *eprop, GladeProperty *property)
{
- GladeProjectFormat fmt;
GladeEPropColor *eprop_color = GLADE_EPROP_COLOR (eprop);
GdkColor *color;
gchar *text;
@@ -1167,11 +1160,9 @@ glade_eprop_color_load (GladeEditorProperty *eprop, GladeProperty *property)
if (property)
{
- fmt = glade_project_get_format (property->widget->project);
-
if ((text = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
- eprop->klass, property->value, fmt)) != NULL)
+ eprop->klass, property->value)) != NULL)
{
gtk_entry_set_text (GTK_ENTRY (eprop_color->entry), text);
g_free (text);
@@ -1475,7 +1466,6 @@ glade_eprop_text_finalize (GObject *object)
static void
glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
{
- GladeProjectFormat fmt;
GladeEPropText *eprop_text = GLADE_EPROP_TEXT (eprop);
/* Chain up first */
@@ -1483,8 +1473,6 @@ glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
if (property == NULL) return;
- fmt = glade_project_get_format (property->widget->project);
-
if (GTK_IS_COMBO_BOX (eprop_text->text_entry))
{
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (eprop_text->text_entry)))
@@ -1529,7 +1517,7 @@ glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
{
gchar *text = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, property->value, fmt);
+ property->klass, property->value);
gtk_text_buffer_set_text (buffer, text ? text : "", -1);
g_free (text);
}
@@ -1621,11 +1609,9 @@ glade_eprop_text_buffer_changed (GtkTextBuffer *buffer,
/**
* glade_editor_property_show_i18n_dialog:
* @parent: The parent widget for the dialog.
- * @fmt: the #GladeProjectFormat
* @text: A read/write pointer to the text property
* @context: A read/write pointer to the translation context
* @comment: A read/write pointer to the translator comment
- * @has_context: A read/write pointer to the context setting (libglade only)
* @translatable: A read/write pointer to the translatable setting]
*
* Runs a dialog and updates the provided values.
@@ -1634,11 +1620,9 @@ glade_eprop_text_buffer_changed (GtkTextBuffer *buffer,
*/
gboolean
glade_editor_property_show_i18n_dialog (GtkWidget *parent,
- GladeProjectFormat fmt,
gchar **text,
gchar **context,
gchar **comment,
- gboolean *has_context,
gboolean *translatable)
{
GtkWidget *dialog;
@@ -1648,11 +1632,11 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
GtkWidget *alignment;
GtkWidget *text_view, *comment_view, *context_view;
GtkTextBuffer *text_buffer, *comment_buffer, *context_buffer = NULL;
- GtkWidget *translatable_button, *context_button;
+ GtkWidget *translatable_button;
GtkWidget *content_area, *action_area;
gint res;
- g_return_val_if_fail (text && context && comment && translatable && has_context, FALSE);
+ g_return_val_if_fail (text && context && comment && translatable, FALSE);
dialog = gtk_dialog_new_with_buttons (_("Edit Text"),
parent ? GTK_WINDOW (gtk_widget_get_toplevel (parent)) : NULL,
@@ -1727,53 +1711,42 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
gtk_widget_set_tooltip_text (translatable_button,
_("Whether this property is translatable"));
- /* Has Context */
- context_button = gtk_check_button_new_with_mnemonic (_("_Has context prefix"));
- gtk_box_pack_start (GTK_BOX (hbox), context_button, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (context_button), *has_context);
- gtk_widget_set_tooltip_text (context_button,
- _("Whether the translatable string has a context prefix"));
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- gtk_widget_show (context_button);
/* Context. */
- if (fmt != GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 0, 0, 0);
- gtk_widget_show (alignment);
-
- label = gtk_label_new_with_mnemonic (_("Conte_xt for translation:"));
- gtk_widget_show (label);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_container_add (GTK_CONTAINER (alignment), label);
- gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
- gtk_widget_set_tooltip_text (alignment,
- "XXX Some explanation about translation context please ???");
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_show (sw);
- gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
-
- context_view = gtk_text_view_new ();
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (context_view), GTK_WRAP_WORD);
- gtk_widget_show (context_view);
-
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), context_view);
-
- gtk_container_add (GTK_CONTAINER (sw), context_view);
-
- context_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (context_view));
+ alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 0, 0, 0);
+ gtk_widget_show (alignment);
+
+ label = gtk_label_new_with_mnemonic (_("Conte_xt for translation:"));
+ gtk_widget_show (label);
+ gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+ gtk_container_add (GTK_CONTAINER (alignment), label);
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_set_tooltip_text (alignment,
+ "XXX Some explanation about translation context please ???");
- if (*context)
- {
- gtk_text_buffer_set_text (context_buffer,
- *context,
- -1);
- }
+ sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (sw);
+ gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
+
+ context_view = gtk_text_view_new ();
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (context_view), GTK_WRAP_WORD);
+ gtk_widget_show (context_view);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), context_view);
+
+ gtk_container_add (GTK_CONTAINER (sw), context_view);
+
+ context_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (context_view));
+
+ if (*context)
+ {
+ gtk_text_buffer_set_text (context_buffer,
+ *context,
+ -1);
}
/* Comments. */
@@ -1821,7 +1794,6 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
/* get the new values for translatable, has_context, and comment */
*translatable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (translatable_button));
- *has_context = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (context_button));
/* Comment */
gtk_text_buffer_get_bounds (comment_buffer, &start, &end);
@@ -1842,15 +1814,12 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
}
/* Context */
- if (fmt != GLADE_PROJECT_FORMAT_LIBGLADE)
+ gtk_text_buffer_get_bounds (context_buffer, &start, &end);
+ *context = gtk_text_buffer_get_text (context_buffer, &start, &end, TRUE);
+ if (*context[0] == '\0')
{
- gtk_text_buffer_get_bounds (context_buffer, &start, &end);
- *context = gtk_text_buffer_get_text (context_buffer, &start, &end, TRUE);
- if (*context[0] == '\0')
- {
- g_free (*context);
- *context = NULL;
- }
+ g_free (*context);
+ *context = NULL;
}
gtk_widget_destroy (dialog);
@@ -1865,21 +1834,14 @@ static void
glade_eprop_text_show_i18n_dialog (GtkWidget *entry,
GladeEditorProperty *eprop)
{
- GladeProject *project;
- GladeProjectFormat fmt;
gchar *text = g_value_dup_string (eprop->property->value);
gchar *context = g_strdup (glade_property_i18n_get_context (eprop->property));
gchar *comment = g_strdup (glade_property_i18n_get_comment (eprop->property));
gboolean translatable = glade_property_i18n_get_translatable (eprop->property);
- gboolean has_context = glade_property_i18n_get_has_context (eprop->property);
-
- project = eprop->property->widget->project;
- fmt = glade_project_get_format (project);
- if (glade_editor_property_show_i18n_dialog (entry, fmt, &text, &context, &comment,
- &has_context, &translatable))
+ if (glade_editor_property_show_i18n_dialog (entry, &text, &context, &comment, &translatable))
{
- glade_command_set_i18n (eprop->property, translatable, has_context, context, comment);
+ glade_command_set_i18n (eprop->property, translatable, context, comment);
glade_eprop_text_changed_common (eprop, text, eprop->use_command);
glade_editor_property_load (eprop, eprop->property);
@@ -1947,13 +1909,9 @@ static void
glade_eprop_text_show_resource_dialog (GtkWidget *entry,
GladeEditorProperty *eprop)
{
- GladeProject *project;
- GladeProjectFormat fmt;
+ GladeProject *project = eprop->property->widget->project;
gchar *text = NULL;
- project = eprop->property->widget->project;
- fmt = glade_project_get_format (project);
-
if (glade_editor_property_show_resource_dialog (project, entry, &text))
{
glade_eprop_text_changed_common (eprop, text, eprop->use_command);
@@ -2817,15 +2775,12 @@ glade_eprop_object_show_dialog (GtkWidget *dialog_button,
project = glade_widget_get_project (eprop->property->widget);
parent = gtk_widget_get_toplevel (GTK_WIDGET (eprop));
- if (glade_project_get_format (project) != GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- if (eprop->property->klass->create_type)
- create_adaptor = glade_widget_adaptor_get_by_name (eprop->property->klass->create_type);
- if (!create_adaptor &&
- G_TYPE_IS_INSTANTIATABLE (eprop->klass->pspec->value_type) &&
- !G_TYPE_IS_ABSTRACT (eprop->klass->pspec->value_type))
- create_adaptor = glade_widget_adaptor_get_by_type (eprop->klass->pspec->value_type);
- }
+ if (eprop->property->klass->create_type)
+ create_adaptor = glade_widget_adaptor_get_by_name (eprop->property->klass->create_type);
+ if (!create_adaptor &&
+ G_TYPE_IS_INSTANTIATABLE (eprop->klass->pspec->value_type) &&
+ !G_TYPE_IS_ABSTRACT (eprop->klass->pspec->value_type))
+ create_adaptor = glade_widget_adaptor_get_by_type (eprop->klass->pspec->value_type);
if (create_adaptor)
{
@@ -3024,7 +2979,6 @@ glade_eprop_object_show_dialog (GtkWidget *dialog_button,
static void
glade_eprop_object_load (GladeEditorProperty *eprop, GladeProperty *property)
{
- GladeProjectFormat fmt;
GladeEPropObject *eprop_object = GLADE_EPROP_OBJECT (eprop);
gchar *obj_name;
@@ -3033,11 +2987,9 @@ glade_eprop_object_load (GladeEditorProperty *eprop, GladeProperty *property)
if (property == NULL) return;
- fmt = glade_project_get_format (property->widget->project);
-
if ((obj_name = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
- eprop->klass, property->value, fmt)) != NULL)
+ eprop->klass, property->value)) != NULL)
{
gtk_entry_set_text (GTK_ENTRY (eprop_object->entry), obj_name);
g_free (obj_name);
@@ -3098,7 +3050,6 @@ glade_eprop_objects_finalize (GObject *object)
static void
glade_eprop_objects_load (GladeEditorProperty *eprop, GladeProperty *property)
{
- GladeProjectFormat fmt;
GladeEPropObjects *eprop_objects = GLADE_EPROP_OBJECTS (eprop);
gchar *obj_name;
@@ -3107,11 +3058,9 @@ glade_eprop_objects_load (GladeEditorProperty *eprop, GladeProperty *property)
if (property == NULL) return;
- fmt = glade_project_get_format (property->widget->project);
-
if ((obj_name = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
- eprop->klass, property->value, fmt)) != NULL)
+ eprop->klass, property->value)) != NULL)
{
gtk_entry_set_text (GTK_ENTRY (eprop_objects->entry), obj_name);
g_free (obj_name);
@@ -3272,383 +3221,6 @@ glade_eprop_objects_create_input (GladeEditorProperty *eprop)
return hbox;
}
-
-/*******************************************************************************
- GladeEditorPropertyAdjustmentClass
- *******************************************************************************/
-typedef struct {
- GladeEditorProperty parent_instance;
-
- GtkWidget *notebook;
-
- GtkWidget *libglade;
- GtkWidget *entry;
-
- GtkWidget *value, *lower, *upper, *step_increment, *page_increment, *page_size;
- GtkAdjustment *value_adj;
- struct
- {
- gulong value, lower, upper, step_increment, page_increment, page_size;
- }ids;
-} GladeEPropAdjustment;
-
-GLADE_MAKE_EPROP (GladeEPropAdjustment, glade_eprop_adjustment)
-#define GLADE_EPROP_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_ADJUSTMENT, GladeEPropAdjustment))
-#define GLADE_EPROP_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_ADJUSTMENT, GladeEPropAdjustmentClass))
-#define GLADE_IS_EPROP_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_ADJUSTMENT))
-#define GLADE_IS_EPROP_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_ADJUSTMENT))
-#define GLADE_EPROP_ADJUSTMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_EPROP_ADJUSTMENT, GladeEPropAdjustmentClass))
-
-static void
-glade_eprop_adjustment_finalize (GObject *object)
-{
- /* Chain up */
- G_OBJECT_CLASS (editor_property_class)->finalize (object);
-}
-
-typedef struct _EPropAdjIdle EPropAdjIdleData;
-
-struct _EPropAdjIdle
-{
- GladeEditorProperty *eprop;
- gdouble value;
-};
-
-static gboolean
-glade_eprop_adj_set_value_idle (gpointer p)
-{
- EPropAdjIdleData *data = (EPropAdjIdleData *) p;
- GladeEPropAdjustment *eprop_adj = GLADE_EPROP_ADJUSTMENT (data->eprop);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->value), data->value);
-
- g_free (p);
-
- return FALSE;
-}
-
-static void
-glade_eprop_adj_value_changed (GtkAdjustment *adj, GladeEditorProperty *eprop)
-{
- EPropAdjIdleData *data;
-
- g_signal_handlers_disconnect_by_func (adj, glade_eprop_adj_value_changed, eprop);
-
- /* Don`t do anything if the loaded property is not the same */
- if (adj != g_value_get_object (eprop->property->value)) return;
-
- data = g_new (EPropAdjIdleData, 1);
-
- data->eprop = eprop;
- data->value = gtk_adjustment_get_value (adj);
-
- /* Update GladeEPropAdjustment value spinbutton in an idle funtion */
- g_idle_add (glade_eprop_adj_set_value_idle, data);
-
- /* Set adjustment to the old value */
- gtk_adjustment_set_value (adj, gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- GLADE_EPROP_ADJUSTMENT (eprop)->value)));
-}
-
-static void
-glade_eprop_adjustment_load (GladeEditorProperty *eprop, GladeProperty *property)
-{
- GladeEPropAdjustment *eprop_adj = GLADE_EPROP_ADJUSTMENT (eprop);
- GladeProjectFormat fmt;
- GObject *object;
- GtkAdjustment *adj = NULL;
-
- /* Chain up first */
- editor_property_class->load (eprop, property);
-
- if (property == NULL) return;
-
- fmt = glade_project_get_format (property->widget->project);
-
- gtk_widget_hide (eprop_adj->libglade);
-
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- object = g_value_get_object (property->value);
-
- if (object)
- {
- adj = GTK_ADJUSTMENT (object);
-
- /* Keep track of external adjustment changes */
- g_signal_connect (object, "value-changed",
- G_CALLBACK (glade_eprop_adj_value_changed),
- eprop);
-
- /* Update adjustment's values */
- gtk_adjustment_set_value (eprop_adj->value_adj, gtk_adjustment_get_value (adj));
- gtk_adjustment_set_lower (eprop_adj->value_adj, gtk_adjustment_get_lower (adj));
- gtk_adjustment_set_upper (eprop_adj->value_adj, gtk_adjustment_get_upper (adj));
- gtk_adjustment_set_step_increment (eprop_adj->value_adj, gtk_adjustment_get_step_increment (adj));
- gtk_adjustment_set_page_increment (eprop_adj->value_adj, gtk_adjustment_get_page_increment (adj));
- gtk_adjustment_set_page_size (eprop_adj->value_adj, gtk_adjustment_get_page_size (adj));
- }
- else
- {
- gtk_adjustment_set_value (eprop_adj->value_adj, 0.0);
- gtk_adjustment_set_lower (eprop_adj->value_adj, 0.0);
- gtk_adjustment_set_upper (eprop_adj->value_adj, 100.0);
- gtk_adjustment_set_step_increment (eprop_adj->value_adj, 1);
- gtk_adjustment_set_page_increment (eprop_adj->value_adj, 10);
- gtk_adjustment_set_page_size (eprop_adj->value_adj, 0);
- }
-
- /* Block Handlers */
- g_signal_handler_block (eprop_adj->value, eprop_adj->ids.value);
- g_signal_handler_block (eprop_adj->lower, eprop_adj->ids.lower);
- g_signal_handler_block (eprop_adj->upper, eprop_adj->ids.upper);
- g_signal_handler_block (eprop_adj->step_increment, eprop_adj->ids.step_increment);
- g_signal_handler_block (eprop_adj->page_increment, eprop_adj->ids.page_increment);
- g_signal_handler_block (eprop_adj->page_size, eprop_adj->ids.page_size);
-
- /* Update spinbuttons values */
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->value),
- gtk_adjustment_get_value (eprop_adj->value_adj));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->lower),
- gtk_adjustment_get_lower (eprop_adj->value_adj));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->upper),
- gtk_adjustment_get_upper (eprop_adj->value_adj));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->step_increment),
- gtk_adjustment_get_step_increment (eprop_adj->value_adj));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_increment),
- gtk_adjustment_get_page_increment (eprop_adj->value_adj));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_size),
- gtk_adjustment_get_page_size (eprop_adj->value_adj));
-
- /* Unblock Handlers */
- g_signal_handler_unblock (eprop_adj->value, eprop_adj->ids.value);
- g_signal_handler_unblock (eprop_adj->lower, eprop_adj->ids.lower);
- g_signal_handler_unblock (eprop_adj->upper, eprop_adj->ids.upper);
- g_signal_handler_unblock (eprop_adj->step_increment, eprop_adj->ids.step_increment);
- g_signal_handler_unblock (eprop_adj->page_increment, eprop_adj->ids.page_increment);
- g_signal_handler_unblock (eprop_adj->page_size, eprop_adj->ids.page_size);
-
- gtk_widget_show (eprop_adj->libglade);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (eprop_adj->notebook), 0);
- }
- else
- {
- gchar *obj_name;
-
- fmt = glade_project_get_format (property->widget->project);
-
- if ((obj_name = glade_widget_adaptor_string_from_value
- (GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
- eprop->klass, property->value, fmt)) != NULL)
- {
- gtk_entry_set_text (GTK_ENTRY (eprop_adj->entry), obj_name);
- g_free (obj_name);
- }
- else
- gtk_entry_set_text (GTK_ENTRY (eprop_adj->entry), "");
-
- gtk_notebook_set_current_page (GTK_NOTEBOOK (eprop_adj->notebook), 1);
- }
-
- gtk_widget_queue_resize (eprop_adj->notebook);
-}
-
-static GtkAdjustment *
-glade_eprop_adjustment_dup_adj (GladeEditorProperty *eprop)
-{
- GtkAdjustment *adj;
- GObject *object;
-
- object = g_value_get_object (eprop->property->value);
- if (object == NULL)
- return GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0,
- 1.0, 10.0, 10.0));
-
- adj = GTK_ADJUSTMENT (object);
-
- return GTK_ADJUSTMENT (gtk_adjustment_new (gtk_adjustment_get_value (adj),
- gtk_adjustment_get_lower (adj),
- gtk_adjustment_get_upper (adj),
- gtk_adjustment_get_step_increment (adj),
- gtk_adjustment_get_page_increment (adj),
- gtk_adjustment_get_page_size (adj)));
-}
-
-static void
-glade_eprop_adjustment_prop_changed_common (GladeEditorProperty *eprop,
- GtkAdjustment *adjustment)
-{
- GValue value = {0, };
-
- g_value_init (&value, GTK_TYPE_ADJUSTMENT);
-
- if (gtk_adjustment_get_value (adjustment) == 0.00 &&
- gtk_adjustment_get_lower (adjustment) == 0.00 &&
- gtk_adjustment_get_upper (adjustment) == 100.00 &&
- gtk_adjustment_get_step_increment (adjustment) == 1.00 &&
- gtk_adjustment_get_page_increment (adjustment) == 10.00 &&
- gtk_adjustment_get_page_size (adjustment) == 10.00)
- {
- g_value_set_object (&value, NULL);
- }
- else
- g_value_set_object (&value, G_OBJECT (adjustment));
-
- glade_editor_property_commit_no_callback (eprop, &value);
-
- g_value_unset (&value);
-}
-
-#define GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC(p) \
-static void \
-glade_eprop_adjustment_ ## p ## _changed (GtkSpinButton *spin, \
- GladeEditorProperty *eprop) \
-{ \
- GtkAdjustment *adj = glade_eprop_adjustment_dup_adj (eprop); \
- if (adj == NULL) return; \
- gtk_adjustment_set_ ## p (adj, gtk_spin_button_get_value (spin)); \
- glade_eprop_adjustment_prop_changed_common (eprop, adj); \
-}
-
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (value)
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (lower)
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (upper)
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (step_increment)
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (page_increment)
-GLADE_EPROP_ADJUSTMENT_DEFINE_VALUE_CHANGED_FUNC (page_size)
-
-#define GLADE_EPROP_ADJUSTMENT_CONNECT(object, prop) \
-g_signal_connect (object, "value_changed", \
-G_CALLBACK (glade_eprop_adjustment_ ## prop ## _changed), eprop);
-
-static void
-glade_eprop_adjustment_table_add_label (GtkTable *table,
- gint pos,
- gchar *label,
- gchar *tip)
-{
- GtkWidget *widget;
-
- widget = gtk_label_new (label);
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0);
-
- gtk_widget_set_tooltip_text (widget, tip);
-
- gtk_table_attach_defaults (table, widget, 0, 1, pos, pos + 1);
-}
-
-static GtkWidget *
-glade_eprop_adjustment_create_input_libglade (GladeEditorProperty *eprop)
-{
- GladeEPropAdjustment *eprop_adj = GLADE_EPROP_ADJUSTMENT (eprop);
- GtkWidget *widget;
- GtkTable *table;
-
- eprop_adj->value = gtk_spin_button_new_with_range (-G_MAXDOUBLE, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->value), 2);
- eprop_adj->ids.value = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->value, value);
- eprop_adj->value_adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (eprop_adj->value));
-
- eprop_adj->lower = gtk_spin_button_new_with_range (-G_MAXDOUBLE, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->lower), 2);
- eprop_adj->ids.lower = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->lower, lower);
-
- eprop_adj->upper = gtk_spin_button_new_with_range (-G_MAXDOUBLE, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->upper), 2);
- eprop_adj->ids.upper = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->upper, upper);
-
- eprop_adj->step_increment = gtk_spin_button_new_with_range (0, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->step_increment), 2);
- eprop_adj->ids.step_increment = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->step_increment, step_increment);
-
- eprop_adj->page_increment = gtk_spin_button_new_with_range (0, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->page_increment), 2);
- eprop_adj->ids.page_increment = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->page_increment, page_increment);
-
- eprop_adj->page_size = gtk_spin_button_new_with_range (0, G_MAXDOUBLE, 1);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON (eprop_adj->page_size), 2);
- eprop_adj->ids.page_size = GLADE_EPROP_ADJUSTMENT_CONNECT (eprop_adj->page_size, page_size);
-
- /* Eprop */
- widget = gtk_table_new (6, 2, FALSE);
- table = GTK_TABLE (widget);
- gtk_table_set_col_spacings (table, 4);
-
- glade_eprop_adjustment_table_add_label (table, 0, _("Value:"),
- _("The current value"));
-
- glade_eprop_adjustment_table_add_label (table, 1, _("Lower:"),
- _("The minimum value"));
-
- glade_eprop_adjustment_table_add_label (table, 2, _("Upper:"),
- _("The maximum value"));
-
- glade_eprop_adjustment_table_add_label (table, 3, _("Step inc:"),
- _("The increment to use to make minor changes to the value"));
-
- glade_eprop_adjustment_table_add_label (table, 4, _("Page inc:"),
- _("The increment to use to make major changes to the value"));
-
- glade_eprop_adjustment_table_add_label (table, 5, _("Page size:"),
- _("The page size (in a GtkScrollbar this is the size of the area which is currently visible)"));
-
- gtk_table_attach_defaults (table, eprop_adj->value, 1, 2, 0, 1);
- gtk_table_attach_defaults (table, eprop_adj->lower, 1, 2, 1, 2);
- gtk_table_attach_defaults (table, eprop_adj->upper, 1, 2, 2, 3);
- gtk_table_attach_defaults (table, eprop_adj->step_increment, 1, 2, 3, 4);
- gtk_table_attach_defaults (table, eprop_adj->page_increment, 1, 2, 4, 5);
- gtk_table_attach_defaults (table, eprop_adj->page_size, 1, 2, 5, 6);
-
- gtk_widget_show_all (widget);
-
- return widget;
-}
-
-static GtkWidget *
-glade_eprop_adjustment_create_input_builder (GladeEditorProperty *eprop)
-{
- GladeEPropAdjustment *eprop_adj = GLADE_EPROP_ADJUSTMENT (eprop);
- GtkWidget *hbox;
- GtkWidget *button;
-
- hbox = gtk_hbox_new (FALSE, 0);
- eprop_adj->entry = gtk_entry_new ();
- gtk_editable_set_editable (GTK_EDITABLE (eprop_adj->entry), FALSE);
- gtk_widget_show (eprop_adj->entry);
- gtk_box_pack_start (GTK_BOX (hbox), eprop_adj->entry, TRUE, TRUE, 0);
-
- button = gtk_button_new_with_label ("...");
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (glade_eprop_object_show_dialog),
- eprop);
- return hbox;
-}
-
-static GtkWidget *
-glade_eprop_adjustment_create_input (GladeEditorProperty *eprop)
-{
- GladeEPropAdjustment *eprop_adj = GLADE_EPROP_ADJUSTMENT (eprop);
- GtkWidget *builder;
-
- eprop_adj->libglade = glade_eprop_adjustment_create_input_libglade (eprop);
- builder = glade_eprop_adjustment_create_input_builder (eprop);
-
- gtk_widget_show (eprop_adj->libglade);
- gtk_widget_show (builder);
-
- eprop_adj->notebook = gtk_notebook_new ();
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (eprop_adj->notebook), FALSE);
- gtk_notebook_set_show_border (GTK_NOTEBOOK (eprop_adj->notebook), FALSE);
-
- gtk_notebook_append_page (GTK_NOTEBOOK (eprop_adj->notebook), eprop_adj->libglade, NULL);
- gtk_notebook_append_page (GTK_NOTEBOOK (eprop_adj->notebook), builder, NULL);
- return eprop_adj->notebook;
-}
-
-
/*******************************************************************************
API
*******************************************************************************/
diff --git a/gladeui/glade-editor-property.h b/gladeui/glade-editor-property.h
index 7f961cf..fd2baf2 100644
--- a/gladeui/glade-editor-property.h
+++ b/gladeui/glade-editor-property.h
@@ -148,11 +148,9 @@ void glade_editor_property_commit_no_callback (GladeEditorProper
GValue *value);
gboolean glade_editor_property_show_i18n_dialog (GtkWidget *parent,
- GladeProjectFormat fmt,
gchar **text,
gchar **context,
gchar **comment,
- gboolean *has_context,
gboolean *translatable);
gboolean glade_editor_property_show_resource_dialog (GladeProject *project,
GtkWidget *parent,
@@ -176,7 +174,6 @@ gboolean glade_editor_property_show_object_dialog (GladeProject
#define GLADE_TYPE_EPROP_UNICHAR (glade_eprop_unichar_get_type())
#define GLADE_TYPE_EPROP_OBJECT (glade_eprop_object_get_type())
#define GLADE_TYPE_EPROP_OBJECTS (glade_eprop_objects_get_type())
-#define GLADE_TYPE_EPROP_ADJUSTMENT (glade_eprop_adjustment_get_type())
GType glade_eprop_numeric_get_type (void) G_GNUC_CONST;
GType glade_eprop_enum_get_type (void) G_GNUC_CONST;
GType glade_eprop_flags_get_type (void) G_GNUC_CONST;
@@ -187,7 +184,6 @@ GType glade_eprop_bool_get_type (void) G_GNUC_CONST;
GType glade_eprop_unichar_get_type (void) G_GNUC_CONST;
GType glade_eprop_object_get_type (void) G_GNUC_CONST;
GType glade_eprop_objects_get_type (void) G_GNUC_CONST;
-GType glade_eprop_adjustment_get_type (void) G_GNUC_CONST;
G_END_DECLS
diff --git a/gladeui/glade-palette.c b/gladeui/glade-palette.c
index 05f1e09..629ccc5 100644
--- a/gladeui/glade-palette.c
+++ b/gladeui/glade-palette.c
@@ -508,10 +508,7 @@ glade_palette_item_refresh (GtkWidget *item)
glade_project_verify_widget_adaptor (project, adaptor, &support)) != NULL)
{
/* set sensitivity */
- gtk_widget_set_sensitive (GTK_WIDGET (item),
- !(support & (GLADE_SUPPORT_LIBGLADE_UNSUPPORTED |
- GLADE_SUPPORT_LIBGLADE_ONLY |
- GLADE_SUPPORT_MISMATCH)));
+ gtk_widget_set_sensitive (GTK_WIDGET (item), !(support & GLADE_SUPPORT_MISMATCH));
if (support & GLADE_SUPPORT_DEPRECATED)
/* XXX Todo, draw a cross overlaying the widget icon */
diff --git a/gladeui/glade-popup.c b/gladeui/glade-popup.c
index f6c33ab..002dc6a 100644
--- a/gladeui/glade-popup.c
+++ b/gladeui/glade-popup.c
@@ -436,24 +436,15 @@ glade_popup_create_menu (GladeWidget *widget,
GladePlaceholder *placeholder,
gboolean packing)
{
- GladeProjectFormat fmt;
GladeWidgetAdaptor *current_item;
- GladeProject *project;
GtkWidget *popup_menu;
GtkWidget *separator;
- GList *list;
- gboolean sensitive, non_window;
+ gboolean sensitive;
GladePlaceholder *tmp_placeholder;
gchar *book;
sensitive = (current_item = glade_palette_get_current_item (glade_app_get_palette ())) != NULL;
- /* Resolve project format first... */
- project = widget ? glade_widget_get_project (widget) :
- placeholder ? glade_placeholder_get_project (placeholder) : glade_app_get_project ();
- fmt = glade_project_get_format (project);
-
-
popup_menu = gtk_menu_new ();
if (current_item)
@@ -478,8 +469,7 @@ glade_popup_create_menu (GladeWidget *widget,
}
glade_popup_append_item (popup_menu, NULL, _("Add widget as _toplevel"), NULL,
- fmt != GLADE_PROJECT_FORMAT_LIBGLADE,
- glade_popup_root_add_cb, NULL);
+ TRUE, glade_popup_root_add_cb, NULL);
separator = gtk_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), separator);
@@ -497,15 +487,6 @@ glade_popup_create_menu (GladeWidget *widget,
/* paste is placholder specific when the popup is on a placeholder */
sensitive = glade_clipboard_get_has_selection (glade_app_get_clipboard ());
- non_window = FALSE;
-
- for (list = glade_app_get_clipboard ()->selection; list; list = list->next)
- {
- GladeWidget *gwidget = GLADE_WIDGET (list->data);
- if (!GTK_IS_WIDGET (gwidget->object) ||
- !gtk_widget_get_has_window (GTK_WIDGET (gwidget->object)))
- non_window = TRUE;
- }
if (placeholder)
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, NULL, sensitive,
@@ -514,13 +495,10 @@ glade_popup_create_menu (GladeWidget *widget,
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, NULL, sensitive,
glade_popup_paste_cb, widget);
else
- /* No toplevel non-GtkWindow pastes in libglade */
- glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, NULL,
- sensitive && !(non_window && (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)),
+ glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, NULL, sensitive,
glade_popup_paste_cb, NULL);
-
glade_popup_append_item (popup_menu, GTK_STOCK_DELETE, NULL, NULL, (widget != NULL),
glade_popup_delete_cb, widget);
@@ -692,7 +670,6 @@ void
glade_popup_palette_pop (GladeWidgetAdaptor *adaptor,
GdkEventButton *event)
{
- GladeProjectFormat fmt;
GladeProject *project;
GtkWidget *popup_menu;
gchar *book = NULL;
@@ -704,11 +681,9 @@ glade_popup_palette_pop (GladeWidgetAdaptor *adaptor,
popup_menu = gtk_menu_new ();
project = glade_app_get_project ();
- fmt = glade_project_get_format (project);
glade_popup_append_item (popup_menu, NULL, _("Add widget as _toplevel"), NULL,
- (fmt != GLADE_PROJECT_FORMAT_LIBGLADE),
- glade_popup_root_add_cb, adaptor);
+ TRUE, glade_popup_root_add_cb, adaptor);
g_object_get (adaptor, "book", &book, NULL);
if (book && glade_util_have_devhelp ())
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index d2095cd..404b7e4 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -63,7 +63,6 @@ enum
CHANGED,
PARSE_BEGAN,
PARSE_FINISHED,
- CONVERT_FINISHED,
TARGETS_CHANGED,
LOAD_PROGRESS,
LAST_SIGNAL
@@ -76,7 +75,6 @@ enum
PROP_HAS_SELECTION,
PROP_PATH,
PROP_READ_ONLY,
- PROP_FORMAT,
PROP_PREVIEWABLE
};
@@ -134,8 +132,6 @@ struct _GladeProjectPrivate
time_t mtime; /* last UTC modification time of file, or 0 if it could not be read */
- GladeProjectFormat format; /* file format */
-
GHashTable *target_versions_major; /* target versions by catalog */
GHashTable *target_versions_minor; /* target versions by catalog */
@@ -147,8 +143,6 @@ struct _GladeProjectPrivate
/* Control on the preferences dialog to update buttons etc when properties change */
GtkWidget *prefs_dialog;
- GtkWidget *glade_radio;
- GtkWidget *builder_radio;
GtkWidget *project_wide_radio;
GtkWidget *toplevel_contextual_radio;
GHashTable *target_radios;
@@ -214,10 +208,6 @@ static GladeWidget *search_ancestry_by_name (GladeWidget *
static GtkWidget *glade_project_build_prefs_dialog (GladeProject *project);
-static void format_libglade_button_toggled (GtkWidget *widget,
- GladeProject *project);
-static void format_builder_button_toggled (GtkWidget *widget,
- GladeProject *project);
static void policy_project_wide_button_clicked (GtkWidget *widget,
GladeProject *project);
static void policy_toplevel_contextual_button_clicked (GtkWidget *widget,
@@ -381,9 +371,6 @@ glade_project_get_property (GObject *object,
case PROP_READ_ONLY:
g_value_set_boolean (value, project->priv->readonly);
break;
- case PROP_FORMAT:
- g_value_set_int (value, project->priv->format);
- break;
case PROP_PREVIEWABLE:
g_value_set_boolean (value, project->priv->previewable);
break;
@@ -713,8 +700,6 @@ glade_project_init (GladeProject *project)
priv->stamp = g_random_int ();
} while (priv->stamp == 0);
- priv->format = GLADE_PROJECT_FORMAT_GTKBUILDER;
-
priv->target_versions_major = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
@@ -905,27 +890,6 @@ glade_project_class_init (GladeProjectClass *klass)
G_TYPE_NONE,
0);
- /**
- * GladeProject::convert-finished:
- * @gladeproject: the #GladeProject which received the signal.
- *
- * Emitted when @gladeproject format conversion has finished.
- *
- * NOTE: Some properties are internally handled differently
- * when the project is in a said format, this signal is fired after
- * the new format is in effect to allow the backend access to both
- * before and after.
- */
- glade_project_signals[CONVERT_FINISHED] =
- g_signal_new ("convert-finished",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GladeProjectClass, parse_finished),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-
/**
* GladeProject::targets-changed:
* @gladeproject: the #GladeProject which received the signal.
@@ -990,16 +954,6 @@ glade_project_class_init (GladeProjectClass *klass)
G_PARAM_READABLE));
g_object_class_install_property (object_class,
- PROP_FORMAT,
- g_param_spec_int ("format",
- _("Format"),
- _("The project file format"),
- GLADE_PROJECT_FORMAT_LIBGLADE,
- GLADE_PROJECT_FORMAT_GTKBUILDER,
- GLADE_PROJECT_FORMAT_GTKBUILDER,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class,
PROP_PREVIEWABLE,
g_param_spec_boolean ("previewable",
_("Previewable"),
@@ -1050,8 +1004,7 @@ glade_project_fix_object_props (GladeProject *project)
{
property = GLADE_PROPERTY (ll->data);
- if (glade_property_class_is_object (property->klass,
- project->priv->format) &&
+ if (glade_property_class_is_object (property->klass) &&
(txt = g_object_get_data (G_OBJECT (property),
"glade-loaded-object")) != NULL)
{
@@ -1265,7 +1218,7 @@ update_project_for_resource_path (GladeProject *project)
gchar *string;
string = glade_property_class_make_string_from_gvalue
- (property->klass, property->value, project->priv->format);
+ (property->klass, property->value);
value = glade_property_class_make_gvalue_from_string
(property->klass, string, project, widget);
@@ -1368,17 +1321,9 @@ glade_project_introspect_signal_versions (const gchar *signal_name,
static void
glade_project_introspect_gtk_version (GladeProject *project)
{
- GladeProjectFormat fmt;
GladeWidget *widget;
GList *list, *l;
- gint target_major = 2, target_minor = 0;
-
- fmt = glade_project_get_format (project);
-
- if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER)
- target_minor = 12;
- else
- target_minor = 6;
+ gint target_major = 2, target_minor = 12;
for (list = project->priv->objects; list; list = list->next)
{
@@ -1459,8 +1404,7 @@ glade_project_count_xml_objects (GladeProject *project, GladeXmlNode *root, gint
for (node = glade_xml_node_get_children (root);
node; node = glade_xml_node_next (node))
{
- if (glade_xml_node_verify_silent
- (node, GLADE_XML_TAG_WIDGET (project->priv->format)))
+ if (glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET))
count = glade_project_count_xml_objects (project, node, ++count);
else if (glade_xml_node_verify_silent (node, GLADE_XML_TAG_CHILD))
count = glade_project_count_xml_objects (project, node, count);
@@ -1528,14 +1472,9 @@ glade_project_load_internal (GladeProject *project)
doc = glade_xml_context_get_doc (context);
root = glade_xml_doc_get_root (doc);
- if (glade_xml_node_verify_silent (root, GLADE_XML_TAG_LIBGLADE_PROJECT))
- glade_project_set_format (project, GLADE_PROJECT_FORMAT_LIBGLADE);
- else if (glade_xml_node_verify_silent (root, GLADE_XML_TAG_BUILDER_PROJECT))
- glade_project_set_format (project, GLADE_PROJECT_FORMAT_GTKBUILDER);
- else
+ if (!glade_xml_node_verify_silent (root, GLADE_XML_TAG_PROJECT))
{
- g_warning ("Couldnt determine project format, skipping %s",
- project->priv->path);
+ g_warning ("Couldnt recognize GtkBuilder xml, skipping %s", project->priv->path);
glade_xml_context_free (context);
project->priv->loading = FALSE;
return FALSE;
@@ -1568,8 +1507,7 @@ glade_project_load_internal (GladeProject *project)
node; node = glade_xml_node_next (node))
{
/* Skip "requires" tags */
- if (!glade_xml_node_verify_silent
- (node, GLADE_XML_TAG_WIDGET (project->priv->format)))
+ if (!glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET))
continue;
if ((widget = glade_widget_read (project, NULL, node, NULL)) != NULL)
@@ -1748,14 +1686,11 @@ glade_project_write_required_libs (GladeProject *project,
GladeXmlContext *context,
GladeXmlNode *root)
{
- GladeProjectFormat fmt;
GladeXmlNode *req_node;
GList *required, *list;
gint major, minor;
gchar *version;
- fmt = glade_project_get_format (project);
-
if ((required = glade_project_required_libs (project)) != NULL)
{
for (list = required; list; list = list->next)
@@ -1766,49 +1701,31 @@ glade_project_write_required_libs (GladeProject *project,
version = g_strdup_printf ("%d.%d", major, minor);
/* Write the standard requires tag */
- if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER ||
- (fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- strcmp ("gtk+", (gchar *)list->data)))
+ if (GLADE_GTKBUILDER_HAS_VERSIONING (major, minor))
{
- if (GLADE_GTKBUILDER_HAS_VERSIONING (major, minor))
- {
- req_node = glade_xml_node_new (context, GLADE_XML_TAG_REQUIRES);
- glade_xml_node_append_child (root, req_node);
- glade_xml_node_set_property_string (req_node,
- GLADE_XML_TAG_LIB,
- (gchar *)list->data);
- }
- else
- {
- gchar *comment =
- g_strdup_printf (" interface-requires %s %s ",
- (gchar *)list->data, version);
- req_node = glade_xml_node_new_comment (context, comment);
- glade_xml_node_append_child (root, req_node);
- g_free (comment);
- }
-
- if (fmt != GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_xml_node_set_property_string
- (req_node, GLADE_XML_TAG_VERSION, version);
+ req_node = glade_xml_node_new (context, GLADE_XML_TAG_REQUIRES);
+ glade_xml_node_append_child (root, req_node);
+ glade_xml_node_set_property_string (req_node,
+ GLADE_XML_TAG_LIB,
+ (gchar *)list->data);
}
-
- /* Add extra metadata for libglade */
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
+ else
{
- gchar *comment = g_strdup_printf (" interface-requires %s %s ",
- (gchar *)list->data, version);
+ gchar *comment =
+ g_strdup_printf (" interface-requires %s %s ",
+ (gchar *)list->data, version);
req_node = glade_xml_node_new_comment (context, comment);
glade_xml_node_append_child (root, req_node);
g_free (comment);
}
+
+ glade_xml_node_set_property_string (req_node, GLADE_XML_TAG_VERSION, version);
g_free (version);
}
g_list_foreach (required, (GFunc)g_free, NULL);
g_list_free (required);
}
-
}
static void
@@ -1868,7 +1785,7 @@ glade_project_write (GladeProject *project)
doc = glade_xml_doc_new ();
context = glade_xml_context_new (doc, NULL);
- root = glade_xml_node_new (context, GLADE_XML_TAG_PROJECT (project->priv->format));
+ root = glade_xml_node_new (context, GLADE_XML_TAG_PROJECT);
glade_xml_doc_set_root (doc, root);
glade_project_update_comment (project);
@@ -2098,26 +2015,6 @@ glade_project_preview (GladeProject *project, GladeWidget *gwidget)
/* translators: reffers to a widget '[%s]' introduced in toolkit version '%s %d.%d' */
#define WIDGET_VERSION_CONFLICT_FMT _("[%s] Object class '%s' was introduced in %s %d.%d\n")
-/* translators: reffers to a widget in toolkit version '%s %d.%d' and a project targeting toolkit version '%s %d.%d' */
-#define WIDGET_BUILDER_VERSION_CONFLICT_MSGFMT _("This widget was made available in GtkBuilder format in %s %d.%d " \
- "while project targets %s %d.%d")
-
-/* translators: reffers to a widget '[%s]' introduced in toolkit version '%s %d.%d' */
-#define WIDGET_BUILDER_VERSION_CONFLICT_FMT _("[%s] Object class '%s' was made available in GtkBuilder format " \
- "in %s %d.%d\n")
-
-#define WIDGET_LIBGLADE_ONLY_MSG _("This widget is only supported in libglade format")
-
-/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */
-#define WIDGET_LIBGLADE_ONLY_FMT _("[%s] Object class '%s' from %s %d.%d " \
- "is only supported in libglade format\n")
-
-#define WIDGET_LIBGLADE_UNSUPPORTED_MSG _("This widget is not supported in libglade format")
-
-/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */
-#define WIDGET_LIBGLADE_UNSUPPORTED_FMT _("[%s] Object class '%s' from %s %d.%d " \
- "is not supported in libglade format\n")
-
#define WIDGET_DEPRECATED_MSG _("This widget is deprecated")
/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */
@@ -2128,24 +2025,6 @@ glade_project_preview (GladeProject *project, GladeWidget *gwidget)
* you can only comment about the line directly following, forcing you to write
* ugly messy code with comments in line breaks inside function calls).
*/
-#define PROP_LIBGLADE_UNSUPPORTED_MSG _("This property is not supported in libglade format")
-
-/* translators: reffers to a property '%s' of widget '[%s]' */
-#define PROP_LIBGLADE_UNSUPPORTED_FMT _("[%s] Property '%s' of object class '%s' is not " \
- "supported in libglade format\n")
-/* translators: reffers to a property '%s' of widget '[%s]' */
-#define PACK_PROP_LIBGLADE_UNSUPPORTED_FMT _("[%s] Packing property '%s' of object class '%s' is not " \
- "supported in libglade format\n")
-
-#define PROP_LIBGLADE_ONLY_MSG _("This property is only supported in libglade format")
-
-/* translators: reffers to a property '%s' of widget '[%s]' */
-#define PROP_LIBGLADE_ONLY_FMT _("[%s] Property '%s' of object class '%s' is only " \
- "supported in libglade format\n")
-
-/* translators: reffers to a property '%s' of widget '[%s]' */
-#define PACK_PROP_LIBGLADE_ONLY_FMT _("[%s] Packing property '%s' of object class '%s' is only " \
- "supported in libglade format\n")
/* translators: reffers to a property in toolkit version '%s %d.%d'
* and a project targeting toolkit version '%s %d.%d' */
@@ -2158,18 +2037,6 @@ glade_project_preview (GladeProject *project, GladeWidget *gwidget)
#define PACK_PROP_VERSION_CONFLICT_FMT _("[%s] Packing property '%s' of object class '%s' " \
"was introduced in %s %d.%d\n")
-/* translators: reffers to a property in toolkit version '%s %d.%d' and a project targeting toolkit version '%s %d.%d' */
-#define PROP_BUILDER_VERSION_CONFLICT_MSGFMT _("This property was made available in GtkBuilder format in %s %d.%d " \
- "while project targets %s %d.%d")
-
-/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */
-#define PROP_BUILDER_VERSION_CONFLICT_FMT _("[%s] Property '%s' of object class '%s' was " \
- "made available in GtkBuilder format in %s %d.%d\n")
-
-/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */
-#define PACK_PROP_BUILDER_VERSION_CONFLICT_FMT _("[%s] Packing property '%s' of object class '%s' " \
- "was made available in GtkBuilder format in %s %d.%d\n")
-
/* translators: reffers to a signal '%s' of widget '[%s]' in toolkit version '%s %d.%d' */
#define SIGNAL_VERSION_CONFLICT_FMT _("[%s] Signal '%s' of object class '%s' was introduced in %s %d.%d\n")
@@ -2199,37 +2066,7 @@ glade_project_verify_property (GladeProject *project,
&target_major,
&target_minor);
- if (project->priv->format == GLADE_PROJECT_FORMAT_LIBGLADE &&
- property->klass->libglade_unsupported)
- {
- if (forwidget)
- glade_property_set_support_warning
- (property, TRUE, PROP_LIBGLADE_UNSUPPORTED_MSG);
- else
- g_string_append_printf (string,
- property->klass->packing ?
- PACK_PROP_LIBGLADE_UNSUPPORTED_FMT :
- PROP_LIBGLADE_UNSUPPORTED_FMT,
- path_name,
- property->klass->name,
- adaptor->title);
- }
- else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- property->klass->libglade_only)
- {
- if (forwidget)
- glade_property_set_support_warning
- (property, TRUE, PROP_LIBGLADE_ONLY_MSG);
- else
- g_string_append_printf (string,
- property->klass->packing ?
- PACK_PROP_LIBGLADE_ONLY_FMT :
- PROP_LIBGLADE_ONLY_FMT,
- path_name,
- property->klass->name,
- adaptor->title);
- }
- else if (!GPC_VERSION_CHECK (property->klass, target_major, target_minor))
+ if (!GPC_VERSION_CHECK (property->klass, target_major, target_minor))
{
if (forwidget)
{
@@ -2254,32 +2091,6 @@ glade_project_verify_property (GladeProject *project,
property->klass->version_since_major,
property->klass->version_since_minor);
}
- else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- !GPC_BUILDER_VERSION_CHECK (property->klass, target_major, target_minor))
- {
- if (forwidget)
- {
- tooltip = g_strdup_printf (PROP_BUILDER_VERSION_CONFLICT_MSGFMT,
- catalog,
- property->klass->builder_since_major,
- property->klass->builder_since_minor,
- catalog,
- target_major, target_minor);
-
- glade_property_set_support_warning (property, FALSE, tooltip);
- g_free (tooltip);
- }
- else
- g_string_append_printf (string,
- property->klass->packing ?
- PACK_PROP_BUILDER_VERSION_CONFLICT_FMT :
- PROP_BUILDER_VERSION_CONFLICT_FMT,
- path_name,
- property->klass->name,
- adaptor->title, catalog,
- property->klass->builder_since_major,
- property->klass->builder_since_minor);
- }
else if (forwidget)
glade_property_set_support_warning (property, FALSE, NULL);
@@ -2546,64 +2357,6 @@ glade_project_verify_adaptor (GladeProject *project,
support_mask |= GLADE_SUPPORT_MISMATCH;
}
- else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- (target_major < GWA_BUILDER_SINCE_MAJOR (adaptor_iter) ||
- (target_major == GWA_BUILDER_SINCE_MAJOR (adaptor_iter) &&
- target_minor < GWA_BUILDER_SINCE_MINOR (adaptor_iter))))
- {
- if (forwidget)
- g_string_append_printf (string,
- WIDGET_BUILDER_VERSION_CONFLICT_MSGFMT,
- catalog,
- GWA_BUILDER_SINCE_MAJOR (adaptor_iter),
- GWA_BUILDER_SINCE_MINOR (adaptor_iter),
- catalog, target_major, target_minor);
- else
- g_string_append_printf (string,
- WIDGET_BUILDER_VERSION_CONFLICT_FMT,
- path_name, adaptor_iter->title, catalog,
- GWA_BUILDER_SINCE_MAJOR (adaptor_iter),
- GWA_BUILDER_SINCE_MINOR (adaptor_iter));
-
- support_mask |= GLADE_SUPPORT_MISMATCH;
- }
-
- /* Now accumulate some more messages...
- */
- if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- GWA_LIBGLADE_ONLY (adaptor_iter))
- {
- if (forwidget)
- {
- if (string->len)
- g_string_append (string, "\n");
- g_string_append_printf (string, WIDGET_LIBGLADE_ONLY_MSG);
- }
- else
- g_string_append_printf (string,
- WIDGET_LIBGLADE_ONLY_FMT,
- path_name, adaptor_iter->title, catalog,
- target_major, target_minor);
-
- support_mask |= GLADE_SUPPORT_LIBGLADE_ONLY;
- }
- else if (project->priv->format == GLADE_PROJECT_FORMAT_LIBGLADE &&
- GWA_LIBGLADE_UNSUPPORTED (adaptor_iter))
- {
- if (forwidget)
- {
- if (string->len)
- g_string_append (string, "\n");
-
- g_string_append_printf (string, WIDGET_LIBGLADE_UNSUPPORTED_MSG);
- }
- else
- g_string_append_printf (string, WIDGET_LIBGLADE_UNSUPPORTED_FMT,
- path_name, adaptor_iter->title, catalog,
- target_major, target_minor);
-
- support_mask |= GLADE_SUPPORT_LIBGLADE_UNSUPPORTED;
- }
if (!saving && GWA_DEPRECATED (adaptor_iter))
{
@@ -4017,68 +3770,6 @@ glade_project_get_naming_policy (GladeProject *project)
return project->priv->naming_policy;
}
-
-/**
- * glade_project_set_format:
- * @project: a #GladeProject
- * @format: the #GladeProjectFormat
- *
- * Sets @project format to @format, used internally to set the actual format
- * state; note that conversions should be done through the glade-command api.
- */
-void
-glade_project_set_format (GladeProject *project, GladeProjectFormat format)
-{
- g_return_if_fail (GLADE_IS_PROJECT (project));
-
- if (project->priv->format != format)
- {
- project->priv->format = format;
- g_object_notify (G_OBJECT (project), "format");
- glade_project_verify_project_for_ui (project);
-
- /* Update the toggle button in the prefs dialog here: */
- g_signal_handlers_block_by_func (project->priv->glade_radio,
- G_CALLBACK (format_libglade_button_toggled), project);
- g_signal_handlers_block_by_func (project->priv->builder_radio,
- G_CALLBACK (format_builder_button_toggled), project);
-
- if (format == GLADE_PROJECT_FORMAT_GTKBUILDER)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (project->priv->builder_radio), TRUE);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (project->priv->glade_radio), TRUE);
-
- g_signal_handlers_unblock_by_func (project->priv->glade_radio,
- G_CALLBACK (format_libglade_button_toggled), project);
- g_signal_handlers_unblock_by_func (project->priv->builder_radio,
- G_CALLBACK (format_builder_button_toggled), project);
-
- }
-}
-
-GladeProjectFormat
-glade_project_get_format (GladeProject *project)
-{
- g_return_val_if_fail (GLADE_IS_PROJECT (project), -1);
-
- return project->priv->format;
-}
-
-
-static void
-format_libglade_button_toggled (GtkWidget *widget,
- GladeProject *project)
-{
- glade_command_set_project_format (project, GLADE_PROJECT_FORMAT_LIBGLADE);
-}
-
-static void
-format_builder_button_toggled (GtkWidget *widget,
- GladeProject *project)
-{
- glade_command_set_project_format (project, GLADE_PROJECT_FORMAT_GTKBUILDER);
-}
-
static gint
count_objects_with_name (GladeProject *project,
const gchar *name)
@@ -4297,50 +3988,6 @@ glade_project_build_prefs_box (GladeProject *project)
gtk_container_add (GTK_CONTAINER (main_alignment), main_box);
gtk_container_add (GTK_CONTAINER (main_frame), main_alignment);
-
- /* Project format */
- string = g_strdup_printf ("<b>%s</b>", _("Project file format:"));
- frame = gtk_frame_new (NULL);
- hbox = gtk_hbox_new (FALSE, 0);
- alignment = gtk_alignment_new (0.5F, 0.5F, 0.8F, 0.8F);
-
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 8, 0, 12, 0);
-
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
-
- label = gtk_label_new (string);
- g_free (string);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-
- project->priv->glade_radio = gtk_radio_button_new_with_label (NULL, "Libglade");
- project->priv->builder_radio = gtk_radio_button_new_with_label_from_widget
- (GTK_RADIO_BUTTON (project->priv->glade_radio), "GtkBuilder");
-
- gtk_size_group_add_widget (sizegroup1, project->priv->builder_radio);
- gtk_size_group_add_widget (sizegroup2, project->priv->glade_radio);
-
- gtk_frame_set_label_widget (GTK_FRAME (frame), label);
- gtk_container_add (GTK_CONTAINER (alignment), hbox);
- gtk_container_add (GTK_CONTAINER (frame), alignment);
-
- gtk_box_pack_start (GTK_BOX (hbox), project->priv->builder_radio, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (hbox), project->priv->glade_radio, TRUE, TRUE, 2);
-
- gtk_box_pack_start (GTK_BOX (main_box), frame, TRUE, TRUE, 2);
-
-
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (project->priv->builder_radio), TRUE);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (project->priv->glade_radio), TRUE);
-
- g_signal_connect (G_OBJECT (project->priv->glade_radio), "toggled",
- G_CALLBACK (format_libglade_button_toggled), project);
-
- g_signal_connect (G_OBJECT (project->priv->builder_radio), "toggled",
- G_CALLBACK (format_builder_button_toggled), project);
-
-
/* Naming policy format */
string = g_strdup_printf ("<b>%s</b>", _("Object names are unique:"));
frame = gtk_frame_new (NULL);
diff --git a/gladeui/glade-project.h b/gladeui/glade-project.h
index 99f20b8..41b03e0 100644
--- a/gladeui/glade-project.h
+++ b/gladeui/glade-project.h
@@ -24,9 +24,7 @@ typedef enum
{
GLADE_SUPPORT_OK = 0,
GLADE_SUPPORT_DEPRECATED = (0x01 << 0),
- GLADE_SUPPORT_MISMATCH = (0x01 << 1),
- GLADE_SUPPORT_LIBGLADE_UNSUPPORTED = (0x01 << 2),
- GLADE_SUPPORT_LIBGLADE_ONLY = (0x01 << 3)
+ GLADE_SUPPORT_MISMATCH = (0x01 << 1)
} GladeSupportMask;
/**
@@ -188,10 +186,6 @@ gboolean glade_project_get_modified (GladeProject *project);
gboolean glade_project_get_previewable (GladeProject *project);
-void glade_project_set_format (GladeProject *project, GladeProjectFormat format);
-
-GladeProjectFormat glade_project_get_format (GladeProject *project);
-
void glade_project_preferences (GladeProject *project);
void glade_project_verify_properties (GladeWidget *widget);
diff --git a/gladeui/glade-property-class.c b/gladeui/glade-property-class.c
index e0fa9aa..44863f6 100644
--- a/gladeui/glade-property-class.c
+++ b/gladeui/glade-property-class.c
@@ -98,17 +98,12 @@ glade_property_class_new (gpointer handle)
property_class->virt = TRUE;
property_class->transfer_on_paste = FALSE;
property_class->weight = -1.0;
- property_class->libglade_only = FALSE;
- property_class->libglade_unsupported = FALSE;
property_class->parentless_widget = FALSE;
/* Initialize them to the base version */
property_class->version_since_major = GWA_VERSION_SINCE_MAJOR (handle);
property_class->version_since_minor = GWA_VERSION_SINCE_MINOR (handle);
- property_class->builder_since_major = GWA_BUILDER_SINCE_MAJOR (handle);
- property_class->builder_since_minor = GWA_BUILDER_SINCE_MINOR (handle);
-
return property_class;
}
@@ -272,8 +267,7 @@ glade_property_class_make_string_from_flags (GladePropertyClass *klass, guint fv
static gchar *
glade_property_class_make_string_from_object (GladePropertyClass *property_class,
- GObject *object,
- GladeProjectFormat fmt)
+ GObject *object)
{
GladeWidget *gwidget;
gchar *string = NULL, *filename;
@@ -285,38 +279,6 @@ glade_property_class_make_string_from_object (GladePropertyClass *property_class
if ((filename = g_object_get_data (object, "GladeFileName")) != NULL)
string = g_strdup (filename);
}
- else if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- property_class->pspec->value_type == GTK_TYPE_ADJUSTMENT)
- {
- GtkAdjustment *adj = GTK_ADJUSTMENT (object);
- GString *str = g_string_sized_new (G_ASCII_DTOSTR_BUF_SIZE * 6 + 6);
- gchar buff[G_ASCII_DTOSTR_BUF_SIZE];
-
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_value (adj));
- g_string_append (str, buff);
-
- g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_lower (adj));
- g_string_append (str, buff);
-
- g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_upper (adj));
- g_string_append (str, buff);
-
- g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_step_increment (adj));
- g_string_append (str, buff);
-
- g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_page_increment (adj));
- g_string_append (str, buff);
-
- g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_page_size (adj));
- g_string_append (str, buff);
-
- string = g_string_free (str, FALSE);
- }
else if ((gwidget = glade_widget_get_from_gobject (object)) != NULL)
string = g_strdup (gwidget->name);
else
@@ -328,8 +290,7 @@ glade_property_class_make_string_from_object (GladePropertyClass *property_class
static gchar *
glade_property_class_make_string_from_objects (GladePropertyClass *property_class,
- GList *objects,
- GladeProjectFormat fmt)
+ GList *objects)
{
GObject *object;
GList *list;
@@ -339,8 +300,7 @@ glade_property_class_make_string_from_objects (GladePropertyClass *property_clas
{
object = list->data;
- obj_str = glade_property_class_make_string_from_object
- (property_class, object, fmt);
+ obj_str = glade_property_class_make_string_from_object (property_class, object);
if (string == NULL)
string = obj_str;
@@ -358,14 +318,12 @@ glade_property_class_make_string_from_objects (GladePropertyClass *property_clas
* glade_property_class_make_string_from_gvalue:
* @property_class: A #GladePropertyClass
* @value: A #GValue
- * @fmt: The #GladeProjectFormat the string should conform to
*
* Returns: A newly allocated string representation of @value
*/
gchar *
glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
gchar *string = NULL, **strv, str[G_ASCII_DTOSTR_BUF_SIZE];
GObject *object;
@@ -463,14 +421,12 @@ glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class
else if (G_IS_PARAM_SPEC_OBJECT(property_class->pspec))
{
object = g_value_get_object (value);
- string = glade_property_class_make_string_from_object
- (property_class, object, fmt);
+ string = glade_property_class_make_string_from_object (property_class, object);
}
else if (GLADE_IS_PARAM_SPEC_OBJECTS (property_class->pspec))
{
objects = g_value_get_boxed (value);
- string = glade_property_class_make_string_from_objects
- (property_class, objects, fmt);
+ string = glade_property_class_make_string_from_objects (property_class, objects);
}
else
g_critical ("Unsupported pspec type %s (value -> string)",
@@ -627,21 +583,6 @@ glade_property_class_make_object_from_string (GladePropertyClass *property_class
g_free (fullpath);
}
- if (project && glade_project_get_format (project) == GLADE_PROJECT_FORMAT_LIBGLADE &&
- property_class->pspec->value_type == GTK_TYPE_ADJUSTMENT)
- {
- gdouble value, lower, upper, step_increment, page_increment, page_size;
- gchar *pstring = (gchar*) string;
-
- value = g_ascii_strtod (pstring, &pstring);
- lower = g_ascii_strtod (pstring, &pstring);
- upper = g_ascii_strtod (pstring, &pstring);
- step_increment = g_ascii_strtod (pstring, &pstring);
- page_increment = g_ascii_strtod (pstring, &pstring);
- page_size = g_ascii_strtod (pstring, &pstring);
-
- object = G_OBJECT (gtk_adjustment_new (value, lower, upper, step_increment, page_increment, page_size));
- }
else if (project)
{
GladeWidget *gwidget;
@@ -1064,23 +1005,18 @@ glade_property_class_is_visible (GladePropertyClass *klass)
/**
* glade_property_class_is_object:
* @property_class: A #GladePropertyClass
- * @fmt: the #GladeProjectFormat
- *
*
* Returns: whether or not this is an object property
* that refers to another object in this project.
*/
gboolean
-glade_property_class_is_object (GladePropertyClass *klass,
- GladeProjectFormat fmt)
+glade_property_class_is_object (GladePropertyClass *klass)
{
g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), FALSE);
return (GLADE_IS_PARAM_SPEC_OBJECTS (klass->pspec) ||
(G_IS_PARAM_SPEC_OBJECT(klass->pspec) &&
- klass->pspec->value_type != GDK_TYPE_PIXBUF &&
- !(fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- klass->pspec->value_type == GTK_TYPE_ADJUSTMENT)));
+ klass->pspec->value_type != GDK_TYPE_PIXBUF));
}
/**
@@ -1582,16 +1518,6 @@ glade_property_class_update_from_node (GladeXmlNode *node,
/* Visible lines */
glade_xml_get_value_int (node, GLADE_TAG_VISIBLE_LINES, &klass->visible_lines);
- glade_xml_get_property_version
- (node, GLADE_TAG_VERSION_SINCE,
- &klass->version_since_major,
- &klass->version_since_minor);
-
- glade_xml_get_property_version
- (node, GLADE_TAG_BUILDER_SINCE,
- &klass->builder_since_major,
- &klass->builder_since_minor);
-
/* Get the Parameters */
if ((child = glade_xml_search_child (node, GLADE_TAG_PARAMETERS)) != NULL)
klass->parameters = glade_parameter_list_new_from_node (klass->parameters, child);
@@ -1613,10 +1539,6 @@ glade_property_class_update_from_node (GladeXmlNode *node,
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);
klass->parentless_widget = glade_xml_get_property_boolean (node, GLADE_TAG_PARENTLESS_WIDGET, klass->parentless_widget);
- klass->libglade_only = glade_xml_get_property_boolean (node, GLADE_TAG_LIBGLADE_ONLY, klass->libglade_only);
- klass->libglade_unsupported =
- glade_xml_get_property_boolean (node, GLADE_TAG_LIBGLADE_UNSUPPORTED,
- klass->libglade_unsupported);
if ((buf = glade_xml_get_property_string
@@ -1700,7 +1622,6 @@ glade_property_class_void_value (GladePropertyClass *klass,
* @klass: a #GladePropertyClass
* @value1: a GValue of correct type for @klass
* @value2: a GValue of correct type for @klass
- * @fmt: the #GladeProjectFormat to use
*
* Compares value1 with value2 according to @klass.
*
@@ -1710,8 +1631,7 @@ glade_property_class_void_value (GladePropertyClass *klass,
gint
glade_property_class_compare (GladePropertyClass *klass,
const GValue *value1,
- const GValue *value2,
- GladeProjectFormat fmt)
+ const GValue *value2)
{
gint retval;
@@ -1727,8 +1647,8 @@ glade_property_class_compare (GladePropertyClass *klass,
*
* NOTE: We could add a pclass option to use the string compare vs. boxed compare...
*/
- val1 = glade_widget_adaptor_string_from_value (klass->handle, klass, value1, fmt);
- val2 = glade_widget_adaptor_string_from_value (klass->handle, klass, value2, fmt);
+ val1 = glade_widget_adaptor_string_from_value (klass->handle, klass, value1);
+ val2 = glade_widget_adaptor_string_from_value (klass->handle, klass, value2);
if (val1 && val2)
retval = strcmp (val1, val2);
diff --git a/gladeui/glade-property-class.h b/gladeui/glade-property-class.h
index cedeceb..7b0e509 100644
--- a/gladeui/glade-property-class.h
+++ b/gladeui/glade-property-class.h
@@ -79,9 +79,6 @@ struct _GladePropertyClass
guint16 version_since_major; /* Version in which this property was */
guint16 version_since_minor; /* introduced. */
- guint16 builder_since_major; /* Version in which this property became */
- guint16 builder_since_minor; /* available in GtkBuilder format */
-
GParamSpec *pspec; /* The Parameter Specification for this property.
*/
@@ -118,10 +115,6 @@ struct _GladePropertyClass
* lines should be visible in the editor.
*/
- /* For catalogs that support libglade: */
- guint libglade_only : 1; /* Mark special libglade virtual properties */
- guint libglade_unsupported : 1;/* Mark properties that are not available in libglade */
-
guint virt : 1; /* Whether this is a virtual property with its pspec supplied
* via the catalog (or hard code-paths); or FALSE if its a real
* GObject introspected property
@@ -233,8 +226,7 @@ void glade_property_class_free (GladePropertyC
gboolean glade_property_class_is_visible (GladePropertyClass *property_class);
-gboolean glade_property_class_is_object (GladePropertyClass *property_class,
- GladeProjectFormat fmt);
+gboolean glade_property_class_is_object (GladePropertyClass *property_class);
GValue *glade_property_class_make_gvalue_from_string (GladePropertyClass *property_class,
const gchar *string,
@@ -242,8 +234,7 @@ GValue *glade_property_class_make_gvalue_from_string (GladePropertyC
GladeWidget *widget);
gchar *glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class,
- const GValue *value,
- GladeProjectFormat fmt);
+ const GValue *value);
GValue *glade_property_class_make_gvalue_from_vl (GladePropertyClass *property_class,
va_list vl);
@@ -275,8 +266,7 @@ gboolean glade_property_class_void_value (GladePropertyC
gint glade_property_class_compare (GladePropertyClass *klass,
const GValue *value1,
- const GValue *value2,
- GladeProjectFormat fmt);
+ const GValue *value2);
GValue *glade_property_class_get_default_from_spec (GParamSpec *spec);
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 7bb0c17..c4ca681 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -71,7 +71,6 @@ enum
PROP_ENABLED,
PROP_SENSITIVE,
PROP_I18N_TRANSLATABLE,
- PROP_I18N_HAS_CONTEXT,
PROP_I18N_CONTEXT,
PROP_I18N_COMMENT,
PROP_STATE
@@ -91,7 +90,6 @@ glade_property_dup_impl (GladeProperty *template_prop, GladeWidget *widget)
property = g_object_new (GLADE_TYPE_PROPERTY,
"class", template_prop->klass,
"i18n-translatable", template_prop->i18n_translatable,
- "i18n-has-context", template_prop->i18n_has_context,
"i18n-context", template_prop->i18n_context,
"i18n-comment", template_prop->i18n_comment,
NULL);
@@ -123,16 +121,7 @@ static gboolean
glade_property_equals_value_impl (GladeProperty *property,
const GValue *value)
{
- GladeProject *project;
- GladeProjectFormat fmt = GLADE_PROJECT_FORMAT_GTKBUILDER;
-
- if (property->widget)
- {
- project = glade_widget_get_project (property->widget);
- fmt = glade_project_get_format (project);
- }
-
- return !glade_property_class_compare (property->klass, property->value, value, fmt);
+ return !glade_property_class_compare (property->klass, property->value, value);
}
@@ -252,12 +241,10 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
gchar *str1 = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, property->value,
- GLADE_PROJECT_FORMAT_GTKBUILDER);
+ property->klass, property->value);
gchar *str2 = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, value,
- GLADE_PROJECT_FORMAT_GTKBUILDER);
+ property->klass, value);
g_print ("from %s to %s\n", str1, str2);
g_free (str1);
g_free (str2);
@@ -289,8 +276,7 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
/* Add/Remove references from widget ref stacks here
* (before assigning the value)
*/
- if (property->widget && changed && glade_property_class_is_object
- (property->klass, glade_project_get_format (project)))
+ if (property->widget && changed && glade_property_class_is_object (property->klass))
glade_property_update_prop_refs (property, property->value, value);
@@ -435,9 +421,6 @@ glade_property_set_real_property (GObject *object,
case PROP_I18N_TRANSLATABLE:
glade_property_i18n_set_translatable (property, g_value_get_boolean (value));
break;
- case PROP_I18N_HAS_CONTEXT:
- glade_property_i18n_set_has_context (property, g_value_get_boolean (value));
- break;
case PROP_I18N_CONTEXT:
glade_property_i18n_set_context (property, g_value_get_string (value));
break;
@@ -472,9 +455,6 @@ glade_property_get_real_property (GObject *object,
case PROP_I18N_TRANSLATABLE:
g_value_set_boolean (value, glade_property_i18n_get_translatable (property));
break;
- case PROP_I18N_HAS_CONTEXT:
- g_value_set_boolean (value, glade_property_i18n_get_has_context (property));
- break;
case PROP_I18N_CONTEXT:
g_value_set_string (value, glade_property_i18n_get_context (property));
break;
@@ -518,7 +498,6 @@ glade_property_init (GladeProperty *property)
property->enabled = TRUE;
property->sensitive = TRUE;
property->i18n_translatable = TRUE;
- property->i18n_has_context = FALSE;
property->i18n_comment = NULL;
property->sync_tolerance = 1;
}
@@ -591,13 +570,6 @@ glade_property_klass_init (GladePropertyKlass *prop_class)
TRUE, G_PARAM_READWRITE));
g_object_class_install_property
- (object_class, PROP_I18N_HAS_CONTEXT,
- g_param_spec_boolean
- ("i18n-has-context", _("Has Context"),
- _("Whether the translatable string has a context prefix"),
- FALSE, G_PARAM_READWRITE));
-
- g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_int
("state", _("Visual State"),
@@ -1016,25 +988,22 @@ glade_property_read (GladeProperty *property,
GladeProject *project,
GladeXmlNode *prop)
{
- GladeProjectFormat fmt;
GValue *gvalue = NULL;
gchar /* *id, *name, */ *value;
- gint translatable = FALSE, has_context = FALSE;
+ gint translatable = FALSE;
gchar *comment = NULL, *context = NULL;
g_return_if_fail (GLADE_IS_PROPERTY (property));
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (prop != NULL);
- fmt = glade_project_get_format (project);
-
if (!glade_xml_node_verify (prop, GLADE_XML_TAG_PROPERTY))
return;
if (!(value = glade_xml_get_content (prop)))
return;
- if (glade_property_class_is_object (property->klass, fmt))
+ if (glade_property_class_is_object (property->klass))
{
/* we must synchronize this directly after loading this project
* (i.e. lookup the actual objects after they've been parsed and
@@ -1061,28 +1030,14 @@ glade_property_read (GladeProperty *property,
property->enabled = TRUE;
}
- translatable = glade_xml_get_property_boolean
- (prop, GLADE_TAG_TRANSLATABLE, FALSE);
- comment = glade_xml_get_property_string
- (prop, GLADE_TAG_COMMENT);
-
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- has_context = glade_xml_get_property_boolean
- (prop, GLADE_TAG_HAS_CONTEXT, FALSE);
- else
- context = glade_xml_get_property_string
- (prop, GLADE_TAG_CONTEXT);
+ translatable = glade_xml_get_property_boolean (prop, GLADE_TAG_TRANSLATABLE, FALSE);
+ comment = glade_xml_get_property_string (prop, GLADE_TAG_COMMENT);
+ context = glade_xml_get_property_string (prop, GLADE_TAG_CONTEXT);
glade_property_i18n_set_translatable (property, translatable);
glade_property_i18n_set_comment (property, comment);
-
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_property_i18n_set_has_context
- (property, has_context);
- else
- glade_property_i18n_set_context
- (property, context);
-
+ glade_property_i18n_set_context (property, context);
+
g_free (comment);
g_free (context);
g_free (value);
@@ -1102,7 +1057,6 @@ glade_property_write (GladeProperty *property,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop_node;
GladeProject *project;
gchar *name, *value, *tmp;
@@ -1112,18 +1066,9 @@ glade_property_write (GladeProperty *property,
project = property->widget->project;
- fmt = glade_project_get_format(project);
-
/* This code should work the same for <packing> and <widget> */
if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_PACKING) ||
- glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET (fmt))))
- return;
-
- /* Dont write unsupported properties */
- if ((fmt == GLADE_PROJECT_FORMAT_GTKBUILDER &&
- property->klass->libglade_only) ||
- (fmt == GLADE_PROJECT_FORMAT_LIBGLADE &&
- property->klass->libglade_unsupported))
+ glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET)))
return;
g_assert (property->klass->orig_def);
@@ -1142,8 +1087,7 @@ glade_property_write (GladeProperty *property,
/* convert the value of this property to a string */
if (!(value = glade_widget_adaptor_string_from_value
- (GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, property->value, fmt)))
+ (GLADE_WIDGET_ADAPTOR (property->klass->handle), property->klass, property->value)))
/* make sure we keep the empty string, also... upcomming
* funcs that may not like NULL.
*/
@@ -1172,12 +1116,7 @@ glade_property_write (GladeProperty *property,
GLADE_TAG_TRANSLATABLE,
GLADE_XML_TAG_I18N_TRUE);
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE && property->i18n_has_context)
- glade_xml_node_set_property_string (prop_node,
- GLADE_TAG_HAS_CONTEXT,
- GLADE_XML_TAG_I18N_TRUE);
-
- if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER && property->i18n_context)
+ if (property->i18n_context)
glade_xml_node_set_property_string (prop_node,
GLADE_TAG_CONTEXT,
property->i18n_context);
@@ -1330,22 +1269,6 @@ glade_property_i18n_get_translatable (GladeProperty *property)
}
void
-glade_property_i18n_set_has_context (GladeProperty *property,
- gboolean has_context)
-{
- g_return_if_fail (GLADE_IS_PROPERTY (property));
- property->i18n_has_context = has_context;
- g_object_notify (G_OBJECT (property), "i18n-has-context");
-}
-
-gboolean
-glade_property_i18n_get_has_context (GladeProperty *property)
-{
- g_return_val_if_fail (GLADE_IS_PROPERTY (property), FALSE);
- return property->i18n_has_context;
-}
-
-void
glade_property_set_sensitive (GladeProperty *property,
gboolean sensitive,
const gchar *reason)
diff --git a/gladeui/glade-property.h b/gladeui/glade-property.h
index f8fd63d..9364963 100644
--- a/gladeui/glade-property.h
+++ b/gladeui/glade-property.h
@@ -79,7 +79,6 @@ struct _GladeProperty
/* Used only for translatable strings. */
guint i18n_translatable : 1;
- guint i18n_has_context : 1;
gchar *i18n_context;
gchar *i18n_comment;
@@ -207,12 +206,6 @@ void glade_property_i18n_set_translatable (GladeProperty
gboolean glade_property_i18n_get_translatable (GladeProperty *property);
-void glade_property_i18n_set_has_context (GladeProperty *property,
- gboolean has_context);
-
-gboolean glade_property_i18n_get_has_context (GladeProperty *property);
-
-
void glade_property_push_superuser (void);
void glade_property_pop_superuser (void);
diff --git a/gladeui/glade-signal-editor.c b/gladeui/glade-signal-editor.c
index d75ce4b..83c07c9 100644
--- a/gladeui/glade-signal-editor.c
+++ b/gladeui/glade-signal-editor.c
@@ -107,7 +107,6 @@ struct _GladeSignalEditorPrivate
GtkTreeViewColumn *handler_column;
GtkTreeViewColumn *userdata_column;
- GtkTreeViewColumn *swapped_column_ptr;
IsVoidFunc is_void_handler;
IsVoidFunc is_void_userdata;
@@ -1049,9 +1048,6 @@ glade_signal_editor_construct_signals_list (GladeSignalEditor *editor)
gtk_tree_view_append_column (view, column);
- /* - No need for a ref here - */
- priv->swapped_column_ptr = column;
-
/************************ after column ************************/
renderer = gtk_cell_renderer_toggle_new ();
@@ -1216,11 +1212,6 @@ glade_signal_editor_load_widget (GladeSignalEditor *editor,
gtk_tree_store_clear (priv->model);
- if (glade_project_get_format (glade_widget_get_project (widget)) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- gtk_tree_view_column_set_visible (priv->swapped_column_ptr, TRUE);
- else
- gtk_tree_view_column_set_visible (priv->swapped_column_ptr, FALSE);
-
/* Loop over every signal type
*/
for (list = priv->adaptor->signals; list; list = list->next)
diff --git a/gladeui/glade-signal.c b/gladeui/glade-signal.c
index d3849f6..a6fb008 100644
--- a/gladeui/glade-signal.c
+++ b/gladeui/glade-signal.c
@@ -133,7 +133,6 @@ glade_signal_clone (const GladeSignal *signal)
/**
* glade_signal_write:
* @signal: The #GladeSignal
- * @fmt: The #GladeProjectFormat to write the signal for
* @context: A #GladeXmlContext
* @node: A #GladeXmlNode
*
@@ -141,7 +140,6 @@ glade_signal_clone (const GladeSignal *signal)
*/
void
glade_signal_write (GladeSignal *signal,
- GladeProjectFormat fmt,
GladeXmlContext *context,
GladeXmlNode *node)
{
@@ -154,9 +152,6 @@ glade_signal_write (GladeSignal *signal,
name = g_strdup (signal->name);
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_util_replace (name, '-', '_');
-
/* Now dump the node values... */
signal_node = glade_xml_node_new (context, GLADE_XML_TAG_SIGNAL);
glade_xml_node_append_child (node, signal_node);
diff --git a/gladeui/glade-signal.h b/gladeui/glade-signal.h
index a60a463..0fed81a 100644
--- a/gladeui/glade-signal.h
+++ b/gladeui/glade-signal.h
@@ -38,7 +38,6 @@ gboolean glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2);
GladeSignal *glade_signal_read (GladeXmlNode *node);
void glade_signal_write (GladeSignal *signal,
- GladeProjectFormat fmt,
GladeXmlContext *context,
GladeXmlNode *node);
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index 16883f6..1396a9d 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -443,70 +443,6 @@ glade_util_hide_window (GtkWindow *window)
gtk_window_move(window, x, y);
}
-
-static void
-format_libglade_button_clicked (GtkWidget *widget,
- GladeProject *project)
-{
- glade_project_set_format (project, GLADE_PROJECT_FORMAT_LIBGLADE);
-}
-
-static void
-format_builder_button_clicked (GtkWidget *widget,
- GladeProject *project)
-{
- glade_project_set_format (project, GLADE_PROJECT_FORMAT_GTKBUILDER);
-}
-
-static void
-add_format_options (GtkDialog *dialog,
- GladeProject *project)
-{
- GtkWidget *vbox, *frame;
- GtkWidget *glade_radio, *builder_radio;
- GtkWidget *label, *alignment;
- gchar *string = g_strdup_printf ("<b>%s</b>", _("File format"));
-
- frame = gtk_frame_new (NULL);
- vbox = gtk_vbox_new (FALSE, 0);
- alignment = gtk_alignment_new (0.5F, 0.5F, 1.0F, 1.0F);
-
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 2, 0, 12, 0);
-
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
-
- label = gtk_label_new (string);
- g_free (string);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-
- glade_radio = gtk_radio_button_new_with_label (NULL, "Libglade");
- builder_radio = gtk_radio_button_new_with_label_from_widget
- (GTK_RADIO_BUTTON (glade_radio), "GtkBuilder");
-
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (builder_radio), TRUE);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (glade_radio), TRUE);
-
- g_signal_connect (G_OBJECT (glade_radio), "clicked",
- G_CALLBACK (format_libglade_button_clicked), project);
-
- g_signal_connect (G_OBJECT (builder_radio), "clicked",
- G_CALLBACK (format_builder_button_clicked), project);
-
- gtk_box_pack_start (GTK_BOX (vbox), builder_radio, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (vbox), glade_radio, TRUE, TRUE, 2);
-
- gtk_frame_set_label_widget (GTK_FRAME (frame), label);
- gtk_container_add (GTK_CONTAINER (alignment), vbox);
- gtk_container_add (GTK_CONTAINER (frame), alignment);
-
- gtk_widget_show_all (frame);
-
- gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (dialog)), frame, FALSE, TRUE, 2);
-}
-
-
/**
* glade_util_file_dialog_new:
* @title: dialog title
@@ -539,10 +475,6 @@ glade_util_file_dialog_new (const gchar *title,
GTK_STOCK_OPEN : GTK_STOCK_SAVE,
GTK_RESPONSE_OK,
NULL);
-
-
- if (action == GLADE_FILE_DIALOG_ACTION_SAVE)
- add_format_options (GTK_DIALOG (file_dialog), project);
file_filter = gtk_file_filter_new ();
gtk_file_filter_add_pattern (file_filter, "*");
@@ -1720,7 +1652,7 @@ glade_utils_enum_string_from_value_real (GType enum_type, gint value, gboolean d
g_value_init (&gvalue, enum_type);
g_value_set_enum (&gvalue, value);
- string = glade_utils_string_from_value (&gvalue, GLADE_PROJECT_FORMAT_GTKBUILDER);
+ string = glade_utils_string_from_value (&gvalue);
g_value_unset (&gvalue);
if (displayable && string)
@@ -1778,7 +1710,7 @@ glade_utils_flags_string_from_value_real (GType flags_type, gint value, gboolean
g_value_init (&gvalue, flags_type);
g_value_set_flags (&gvalue, value);
- string = glade_utils_string_from_value (&gvalue, GLADE_PROJECT_FORMAT_GTKBUILDER);
+ string = glade_utils_string_from_value (&gvalue);
g_value_unset (&gvalue);
if (displayable && string)
@@ -1949,7 +1881,6 @@ glade_utils_value_from_string (GType type,
/**
* glade_utils_string_from_value:
* @value: a #GValue to convert
- * @fmt: the #GladeProjectFormat to honor
*
* Serializes #GValue into a string
* (using glade conversion routines)
@@ -1957,15 +1888,14 @@ glade_utils_value_from_string (GType type,
* Returns: A newly allocated string
*/
gchar *
-glade_utils_string_from_value (const GValue *value,
- GladeProjectFormat fmt)
+glade_utils_string_from_value (const GValue *value)
{
GladePropertyClass *pclass;
g_return_val_if_fail (value != NULL, NULL);
if ((pclass = pclass_from_gtype (G_VALUE_TYPE (value))) != NULL)
- return glade_property_class_make_string_from_gvalue (pclass, value, fmt);
+ return glade_property_class_make_string_from_gvalue (pclass, value);
return NULL;
}
diff --git a/gladeui/glade-utils.h b/gladeui/glade-utils.h
index 4769230..70f48d4 100644
--- a/gladeui/glade-utils.h
+++ b/gladeui/glade-utils.h
@@ -145,8 +145,7 @@ GValue *glade_utils_value_from_string (GType type,
GladeProject *project,
GladeWidget *widget);
-gchar *glade_utils_string_from_value (const GValue *value,
- GladeProjectFormat fmt);
+gchar *glade_utils_string_from_value (const GValue *value);
GtkListStore *glade_utils_liststore_from_enum_type (GType enum_type, gboolean include_empty);
diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c
index e296891..7166a15 100644
--- a/gladeui/glade-widget-adaptor.c
+++ b/gladeui/glade-widget-adaptor.c
@@ -394,7 +394,7 @@ gwa_clone_parent_properties (GladeWidgetAdaptor *adaptor, gboolean is_packing)
parent_adaptor->priv->catalog))
{
pclass->version_since_major = 0;
- pclass->builder_since_major = 0;
+ pclass->version_since_minor = 0;
}
properties = g_list_prepend (properties, pclass);
}
@@ -611,9 +611,6 @@ glade_widget_adaptor_constructor (GType type,
{
GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->version_since_major =
GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->version_since_minor = 0;
-
- GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->builder_since_major =
- GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->builder_since_minor = 0;
}
/* Copy parent actions */
@@ -964,8 +961,7 @@ glade_widget_adaptor_object_read_child (GladeWidgetAdaptor *adaptor,
(node, GLADE_XML_TAG_INTERNAL_CHILD);
if ((widget_node =
- glade_xml_search_child
- (node, GLADE_XML_TAG_WIDGET(glade_project_get_format(widget->project)))) != NULL)
+ glade_xml_search_child (node, GLADE_XML_TAG_WIDGET)) != NULL)
{
child_widget =
glade_widget_read (widget->project,
@@ -1110,8 +1106,6 @@ glade_widget_adaptor_get_eprop_type (GParamSpec *pspec)
{
if (pspec->value_type == GDK_TYPE_PIXBUF)
type = GLADE_TYPE_EPROP_TEXT;
- else if (pspec->value_type == GTK_TYPE_ADJUSTMENT)
- type = GLADE_TYPE_EPROP_ADJUSTMENT;
else
type = GLADE_TYPE_EPROP_OBJECT;
}
@@ -1151,10 +1145,9 @@ glade_widget_adaptor_object_create_eprop (GladeWidgetAdaptor *adaptor,
static gchar *
glade_widget_adaptor_object_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
- return glade_property_class_make_string_from_gvalue (klass, value, fmt);
+ return glade_property_class_make_string_from_gvalue (klass, value);
}
static GladeEditable *
@@ -1519,11 +1512,6 @@ gwa_derived_class_init (GladeWidgetAdaptorClass *adaptor_class,
if (module) gwa_extend_with_node_load_sym (adaptor_class, node, module);
glade_xml_get_property_version
- (node, GLADE_TAG_BUILDER_SINCE,
- &adaptor_class->builder_since_major,
- &adaptor_class->builder_since_minor);
-
- glade_xml_get_property_version
(node, GLADE_TAG_VERSION_SINCE,
&adaptor_class->version_since_major,
&adaptor_class->version_since_minor);
@@ -1532,14 +1520,6 @@ gwa_derived_class_init (GladeWidgetAdaptorClass *adaptor_class,
glade_xml_get_property_boolean
(node, GLADE_TAG_DEPRECATED, adaptor_class->deprecated);
- adaptor_class->libglade_unsupported =
- glade_xml_get_property_boolean
- (node, GLADE_TAG_LIBGLADE_UNSUPPORTED, adaptor_class->libglade_unsupported);
-
- adaptor_class->libglade_only =
- glade_xml_get_property_boolean
- (node, GLADE_TAG_LIBGLADE_ONLY, adaptor_class->libglade_only);
-
adaptor_class->fixed =
glade_xml_get_property_boolean
(node, GLADE_TAG_FIXED, adaptor_class->fixed);
@@ -2484,11 +2464,6 @@ glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
gwa_extend_with_node (adaptor, class_node, module, glade_catalog_get_domain (catalog));
- if (!glade_catalog_supports_libglade (catalog))
- GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->libglade_unsupported = TRUE;
- if (!glade_catalog_supports_gtkbuilder (catalog))
- GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->libglade_only = TRUE;
-
/* Set default weight on properties */
for (parent_type = adaptor->type;
parent_type != 0;
@@ -3866,7 +3841,6 @@ glade_widget_adaptor_create_eprop_by_name (GladeWidgetAdaptor *adaptor,
* @adaptor: A #GladeWidgetAdaptor
* @klass: The #GladePropertyClass
* @value: The #GValue to convert to a string
- * @fmt: The #GladeProjectFormat the string should conform to
*
* For normal properties this is used to serialize
* property values, for custom properties its still
@@ -3877,15 +3851,13 @@ glade_widget_adaptor_create_eprop_by_name (GladeWidgetAdaptor *adaptor,
gchar *
glade_widget_adaptor_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), NULL);
g_return_val_if_fail (value != NULL, NULL);
- return GLADE_WIDGET_ADAPTOR_GET_CLASS
- (adaptor)->string_from_value (adaptor, klass, value, fmt);
+ return GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->string_from_value (adaptor, klass, value);
}
diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h
index d9bd5af..76f4b3a 100644
--- a/gladeui/glade-widget-adaptor.h
+++ b/gladeui/glade-widget-adaptor.h
@@ -560,7 +560,6 @@ typedef GladeEditorProperty *(* GladeCreateEPropFunc) (GladeWidgetAdaptor *adapt
* @adaptor: A #GladeWidgetAdaptor
* @klass: The #GladePropertyClass
* @value: The #GValue to convert to a string
- * @fmt: The #GladeProjectFormat the string should conform to
*
* For normal properties this is used to serialize
* property values, for custom properties (only when new pspecs are
@@ -571,8 +570,7 @@ typedef GladeEditorProperty *(* GladeCreateEPropFunc) (GladeWidgetAdaptor *adapt
*/
typedef gchar *(* GladeStringFromValueFunc) (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt);
+ const GValue *value);
@@ -673,20 +671,9 @@ struct _GladeWidgetAdaptorClass
guint16 version_since_major; /* Version in which this widget was */
guint16 version_since_minor; /* introduced. */
- guint16 builder_since_major; /* Version in which this widget became */
- guint16 builder_since_minor; /* available in GtkBuilder format */
-
-
guint deprecated : 1; /* If this widget is currently
* deprecated
*/
- guint libglade_unsupported : 1; /* If this widget is not supported
- * by libglade
- */
- guint libglade_only : 1; /* If this widget is only supported
- * by libglade
- */
-
guint fixed : 1; /* If this is a Container, use free-form
* placement with drag/resize/paste at mouse...
*/
@@ -975,8 +962,7 @@ GladeEditorProperty *glade_widget_adaptor_create_eprop_by_name (GladeWidgetAdapt
gchar *glade_widget_adaptor_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt);
+ const GValue *value);
GladeEditable *glade_widget_adaptor_create_editable (GladeWidgetAdaptor *adaptor,
GladeEditorPageType type);
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index b39a56f..5699399 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -844,8 +844,7 @@ static void
reset_object_property (GladeProperty *property,
GladeProject *project)
{
- if (glade_property_class_is_object (property->klass,
- glade_project_get_format (project)))
+ if (glade_property_class_is_object (property->klass))
glade_property_reset (property);
}
@@ -3027,8 +3026,7 @@ glade_widget_property_string (GladeWidget *widget,
if ((property = glade_widget_get_property (widget, id_property)) != NULL)
ret_string = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, value ? value : property->value,
- glade_project_get_format (widget->project));
+ property->klass, value ? value : property->value);
return ret_string;
}
@@ -3058,8 +3056,7 @@ glade_widget_pack_property_string (GladeWidget *widget,
if ((property = glade_widget_get_pack_property (widget, id_property)) != NULL)
ret_string = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, value ? value : property->value,
- glade_project_get_format (widget->project));
+ property->klass, value ? value : property->value);
return ret_string;
}
@@ -3633,7 +3630,7 @@ glade_widget_write_special_child_prop (GladeWidget *parent,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeXmlNode *prop_node, *packing_node;
+ GladeXmlNode *packing_node;
gchar *buff, *special_child_type;
buff = g_object_get_data (object, "special-child-type");
@@ -3643,27 +3640,9 @@ glade_widget_write_special_child_prop (GladeWidget *parent,
if (special_child_type && buff)
{
- switch (glade_project_get_format (parent->project))
- {
- case GLADE_PROJECT_FORMAT_LIBGLADE:
- prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);
- glade_xml_node_append_child (packing_node, prop_node);
-
- /* Name and value */
- glade_xml_node_set_property_string (prop_node,
- GLADE_XML_TAG_NAME,
- special_child_type);
- glade_xml_set_content (prop_node, buff);
- break;
- case GLADE_PROJECT_FORMAT_GTKBUILDER:
- glade_xml_node_set_property_string (node,
- GLADE_XML_TAG_TYPE,
- buff);
- break;
- default:
- g_assert_not_reached ();
- }
-
+ glade_xml_node_set_property_string (node,
+ GLADE_XML_TAG_TYPE,
+ buff);
}
g_free (special_child_type);
}
@@ -3674,8 +3653,7 @@ glade_widget_set_child_type_from_node (GladeWidget *parent,
GObject *child,
GladeXmlNode *node)
{
- GladeXmlNode *packing_node, *prop;
- gchar *special_child_type, *name, *value;
+ gchar *special_child_type, *value;
if (!glade_xml_node_verify (node, GLADE_XML_TAG_CHILD))
return;
@@ -3684,55 +3662,14 @@ glade_widget_set_child_type_from_node (GladeWidget *parent,
if (!special_child_type)
return;
- switch (glade_project_get_format (parent->project))
+ /* all child types here are depicted by the "type" property */
+ if ((value =
+ glade_xml_get_property_string (node, GLADE_XML_TAG_TYPE)))
{
- case GLADE_PROJECT_FORMAT_LIBGLADE:
- if ((packing_node =
- glade_xml_search_child (node, GLADE_XML_TAG_PACKING)) != NULL)
- {
- for (prop = glade_xml_node_get_children (packing_node);
- prop; prop = glade_xml_node_next (prop))
- {
- if (!(name =
- glade_xml_get_property_string_required
- (prop, GLADE_XML_TAG_NAME, NULL)))
- continue;
-
- if (!(value = glade_xml_get_content (prop)))
- {
- /* XXX should be glade_xml_get_content_required()... */
- g_free (name);
- continue;
- }
-
- if (!strcmp (name, special_child_type))
- {
- g_object_set_data_full (child,
- "special-child-type",
- g_strdup (value),
- g_free);
- g_free (name);
- g_free (value);
- break;
- }
- g_free (name);
- g_free (value);
- }
- }
- break;
- case GLADE_PROJECT_FORMAT_GTKBUILDER:
- /* all child types here are depicted by the "type" property */
- if ((value =
- glade_xml_get_property_string (node, GLADE_XML_TAG_TYPE)))
- {
- g_object_set_data_full (child,
- "special-child-type",
- value,
- g_free);
- }
- break;
- default:
- g_assert_not_reached ();
+ g_object_set_data_full (child,
+ "special-child-type",
+ value,
+ g_free);
}
g_free (special_child_type);
}
@@ -3778,8 +3715,7 @@ glade_widget_read (GladeProject *project,
glade_widget_push_superuser ();
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return NULL;
if ((klass =
@@ -3913,7 +3849,6 @@ glade_widget_write_placeholder (GladeWidget *parent,
typedef struct {
GladeXmlContext *context;
GladeXmlNode *node;
- GladeProjectFormat fmt;
} WriteSignalsInfo;
static void
@@ -3931,7 +3866,6 @@ glade_widget_adaptor_write_signals (gpointer key,
{
GladeSignal *signal = g_ptr_array_index (signals, i);
glade_signal_write (signal,
- info->fmt,
info->context,
info->node);
}
@@ -3946,7 +3880,6 @@ glade_widget_write_signals (GladeWidget *widget,
info.context = context;
info.node = node;
- info.fmt = glade_project_get_format (widget->project);
g_hash_table_foreach (widget->signals,
glade_widget_adaptor_write_signals,
@@ -3970,9 +3903,8 @@ glade_widget_write (GladeWidget *widget,
{
GladeXmlNode *widget_node;
GList *l, *list;
- GladeProjectFormat fmt = glade_project_get_format (widget->project);
- widget_node = glade_xml_node_new (context, GLADE_XML_TAG_WIDGET (fmt));
+ widget_node = glade_xml_node_new (context, GLADE_XML_TAG_WIDGET);
glade_xml_node_append_child (node, widget_node);
/* Set class and id */
@@ -3987,10 +3919,8 @@ glade_widget_write (GladeWidget *widget,
glade_widget_adaptor_write_widget (widget->adaptor, widget, context, widget_node);
/* Write the signals strictly after all properties and before children
- * when in builder format
*/
- if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER)
- glade_widget_write_signals (widget, context, widget_node);
+ glade_widget_write_signals (widget, context, widget_node);
/* Write the children */
if ((list =
diff --git a/gladeui/glade-xml-utils.h b/gladeui/glade-xml-utils.h
index 9fda0c8..6e89a2b 100644
--- a/gladeui/glade-xml-utils.h
+++ b/gladeui/glade-xml-utils.h
@@ -25,31 +25,12 @@ typedef struct _GladeWidget GladeWidget;
typedef struct _GladeProperty GladeProperty;
typedef struct _GladeProject GladeProject;
-
-/* We define this here only because our headers need
- * a good sorting
- */
-typedef enum
-{
- GLADE_PROJECT_FORMAT_LIBGLADE,
- GLADE_PROJECT_FORMAT_GTKBUILDER
-} GladeProjectFormat;
-
-
typedef enum {
GLADE_POLICY_PROJECT_WIDE = 0, /* widget names are unique throughout the project */
GLADE_POLICY_TOPLEVEL_CONTEXTUAL /* toplevel names are unique, and widgets inside a toplevel */
} GladeNamingPolicy;
-#define GLADE_XML_TAG_PROJECT(type) \
- ((type == GLADE_PROJECT_FORMAT_LIBGLADE) ? \
- GLADE_XML_TAG_LIBGLADE_PROJECT : GLADE_XML_TAG_BUILDER_PROJECT)
-
-#define GLADE_XML_TAG_WIDGET(type) \
- ((type == GLADE_PROJECT_FORMAT_LIBGLADE) ? \
- GLADE_XML_TAG_LIBGLADE_WIDGET : GLADE_XML_TAG_BUILDER_WIDGET)
-
#define GLADE_GTKBUILDER_VERSIONING_BASE_MAJOR 2
#define GLADE_GTKBUILDER_VERSIONING_BASE_MINOR 14
#define GLADE_GTKBUILDER_HAS_VERSIONING(maj, min) \
@@ -58,10 +39,8 @@ typedef enum {
/* Used for catalog tags and attributes */
-#define GLADE_XML_TAG_LIBGLADE_PROJECT "glade-interface"
-#define GLADE_XML_TAG_BUILDER_PROJECT "interface"
-#define GLADE_XML_TAG_LIBGLADE_WIDGET "widget"
-#define GLADE_XML_TAG_BUILDER_WIDGET "object"
+#define GLADE_XML_TAG_PROJECT "interface"
+#define GLADE_XML_TAG_WIDGET "object"
#define GLADE_XML_TAG_VERSION "version"
#define GLADE_XML_TAG_REQUIRES "requires"
@@ -94,12 +73,6 @@ typedef enum {
#define GLADE_TAG_BUILDER_SINCE "gtkbuilder-since"
#define GLADE_TAG_DEPRECATED "deprecated"
-#define GLADE_TAG_LIBGLADE_ONLY "libglade-only"
-#define GLADE_TAG_LIBGLADE_UNSUPPORTED "libglade-unsupported"
-#define GLADE_TAG_SUPPORTS "supports"
-#define GLADE_TAG_GTKBUILDER "gtkbuilder"
-#define GLADE_TAG_LIBGLADE "libglade"
-
#define GLADE_TAG_GLADE_CATALOG "glade-catalog"
#define GLADE_TAG_GLADE_WIDGET_CLASSES "glade-widget-classes"
#define GLADE_TAG_GLADE_WIDGET_CLASS "glade-widget-class"
@@ -118,7 +91,6 @@ typedef enum {
#define GLADE_TAG_CONSTRUCT_ONLY "construct-only"
#define GLADE_TAG_NEEDS_SYNC "needs-sync"
#define GLADE_TAG_DEFAULT_PALETTE_STATE "default-palette-state"
-#define GLADE_TAG_PROJECT_CONVERT_FUNCTION "project-convert-function"
#define GLADE_TAG_REPLACE_CHILD_FUNCTION "replace-child-function"
#define GLADE_TAG_CONSTRUCT_OBJECT_FUNCTION "construct-object-function"
#define GLADE_TAG_DEEP_POST_CREATE_FUNCTION "deep-post-create-function"
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index ba9711b..2ca0fc1 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -20,7 +20,7 @@ libgladegtk_la_CPPFLAGS = \
libgladegtk_la_CFLAGS = $(AM_CFLAGS)
-libgladegtk_la_SOURCES = glade-gtk.c glade-accels.c glade-attributes.c glade-convert.c fixed-bg.xpm \
+libgladegtk_la_SOURCES = glade-gtk.c glade-accels.c glade-attributes.c fixed-bg.xpm \
glade-column-types.c glade-model-data.c glade-text-button.c \
glade-icon-sources.c glade-button-editor.c glade-tool-button-editor.c glade-image-editor.c \
glade-image-item-editor.c glade-icon-factory-editor.c glade-store-editor.c glade-label-editor.c \
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 59617f3..14d67bd 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -63,136 +63,6 @@
#define RESPID_INSENSITIVE_MSG _("This property is only for use in dialog action buttons")
#define ACTION_APPEARANCE_MSG _("This property is set to be controlled by an Action")
/* -------------------------------- ParamSpecs ------------------------------ */
-/*
-GtkImageMenuItem GnomeUI "stock_item" property special case:
-
-"stock_item" property is added by glade2 gnome support and makes reference to
-GNOMEUIINFO_MENU_* macros. This set-function maps these properties to
-existing non deprecated gtk ones.
-*/
-typedef enum {
- GNOMEUIINFO_MENU_NONE,
- /* The 'File' menu */
- GNOMEUIINFO_MENU_NEW_ITEM,
- GNOMEUIINFO_MENU_NEW_SUBTREE,
- GNOMEUIINFO_MENU_OPEN_ITEM,
- GNOMEUIINFO_MENU_SAVE_ITEM,
- GNOMEUIINFO_MENU_SAVE_AS_ITEM,
- GNOMEUIINFO_MENU_REVERT_ITEM,
- GNOMEUIINFO_MENU_PRINT_ITEM,
- GNOMEUIINFO_MENU_PRINT_SETUP_ITEM,
- GNOMEUIINFO_MENU_CLOSE_ITEM,
- GNOMEUIINFO_MENU_EXIT_ITEM,
- GNOMEUIINFO_MENU_QUIT_ITEM,
- /* The "Edit" menu */
- GNOMEUIINFO_MENU_CUT_ITEM,
- GNOMEUIINFO_MENU_COPY_ITEM,
- GNOMEUIINFO_MENU_PASTE_ITEM,
- GNOMEUIINFO_MENU_SELECT_ALL_ITEM,
- GNOMEUIINFO_MENU_CLEAR_ITEM,
- GNOMEUIINFO_MENU_UNDO_ITEM,
- GNOMEUIINFO_MENU_REDO_ITEM,
- GNOMEUIINFO_MENU_FIND_ITEM,
- GNOMEUIINFO_MENU_FIND_AGAIN_ITEM,
- GNOMEUIINFO_MENU_REPLACE_ITEM,
- GNOMEUIINFO_MENU_PROPERTIES_ITEM,
- /* The Settings menu */
- GNOMEUIINFO_MENU_PREFERENCES_ITEM,
- /* The Windows menu */
- GNOMEUIINFO_MENU_NEW_WINDOW_ITEM,
- GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM,
- /* And the "Help" menu */
- GNOMEUIINFO_MENU_ABOUT_ITEM,
- /* The "Game" menu */
- GNOMEUIINFO_MENU_NEW_GAME_ITEM,
- GNOMEUIINFO_MENU_PAUSE_GAME_ITEM,
- GNOMEUIINFO_MENU_RESTART_GAME_ITEM,
- GNOMEUIINFO_MENU_UNDO_MOVE_ITEM,
- GNOMEUIINFO_MENU_REDO_MOVE_ITEM,
- GNOMEUIINFO_MENU_HINT_ITEM,
- GNOMEUIINFO_MENU_SCORES_ITEM,
- GNOMEUIINFO_MENU_END_GAME_ITEM,
- /* Some standard menus */
- GNOMEUIINFO_MENU_FILE_TREE,
- GNOMEUIINFO_MENU_EDIT_TREE,
- GNOMEUIINFO_MENU_VIEW_TREE,
- GNOMEUIINFO_MENU_SETTINGS_TREE,
- GNOMEUIINFO_MENU_FILES_TREE,
- GNOMEUIINFO_MENU_WINDOWS_TREE,
- GNOMEUIINFO_MENU_HELP_TREE,
- GNOMEUIINFO_MENU_GAME_TREE
-} GladeGtkGnomeUIInfoEnum;
-
-static GType
-glade_gtk_gnome_ui_info_get_type (void)
-{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { GNOMEUIINFO_MENU_NONE, "GNOMEUIINFO_MENU_NONE", NULL},
- /* The 'File' menu */
- { GNOMEUIINFO_MENU_NEW_ITEM, "GNOMEUIINFO_MENU_NEW_ITEM", "gtk-new"},
- { GNOMEUIINFO_MENU_OPEN_ITEM, "GNOMEUIINFO_MENU_OPEN_ITEM", "gtk-open"},
- { GNOMEUIINFO_MENU_SAVE_ITEM, "GNOMEUIINFO_MENU_SAVE_ITEM", "gtk-save"},
- { GNOMEUIINFO_MENU_SAVE_AS_ITEM, "GNOMEUIINFO_MENU_SAVE_AS_ITEM", "gtk-save-as"},
- { GNOMEUIINFO_MENU_REVERT_ITEM, "GNOMEUIINFO_MENU_REVERT_ITEM", "gtk-revert-to-saved"},
- { GNOMEUIINFO_MENU_PRINT_ITEM, "GNOMEUIINFO_MENU_PRINT_ITEM", "gtk-print"},
- { GNOMEUIINFO_MENU_PRINT_SETUP_ITEM, "GNOMEUIINFO_MENU_PRINT_SETUP_ITEM", NULL},
- { GNOMEUIINFO_MENU_CLOSE_ITEM, "GNOMEUIINFO_MENU_CLOSE_ITEM", "gtk-close"},
- { GNOMEUIINFO_MENU_EXIT_ITEM, "GNOMEUIINFO_MENU_EXIT_ITEM", "gtk-quit"},
- { GNOMEUIINFO_MENU_QUIT_ITEM, "GNOMEUIINFO_MENU_QUIT_ITEM", "gtk-quit"},
- /* The "Edit" menu */
- { GNOMEUIINFO_MENU_CUT_ITEM, "GNOMEUIINFO_MENU_CUT_ITEM", "gtk-cut"},
- { GNOMEUIINFO_MENU_COPY_ITEM, "GNOMEUIINFO_MENU_COPY_ITEM", "gtk-copy"},
- { GNOMEUIINFO_MENU_PASTE_ITEM, "GNOMEUIINFO_MENU_PASTE_ITEM", "gtk-paste"},
- { GNOMEUIINFO_MENU_SELECT_ALL_ITEM, "GNOMEUIINFO_MENU_SELECT_ALL_ITEM", NULL},
- { GNOMEUIINFO_MENU_CLEAR_ITEM, "GNOMEUIINFO_MENU_CLEAR_ITEM", "gtk-clear"},
- { GNOMEUIINFO_MENU_UNDO_ITEM, "GNOMEUIINFO_MENU_UNDO_ITEM", "gtk-undo"},
- { GNOMEUIINFO_MENU_REDO_ITEM, "GNOMEUIINFO_MENU_REDO_ITEM", "gtk-redo"},
- { GNOMEUIINFO_MENU_FIND_ITEM, "GNOMEUIINFO_MENU_FIND_ITEM", "gtk-find"},
- { GNOMEUIINFO_MENU_FIND_AGAIN_ITEM, "GNOMEUIINFO_MENU_FIND_AGAIN_ITEM", NULL},
- { GNOMEUIINFO_MENU_REPLACE_ITEM, "GNOMEUIINFO_MENU_REPLACE_ITEM", "gtk-find-and-replace"},
- { GNOMEUIINFO_MENU_PROPERTIES_ITEM, "GNOMEUIINFO_MENU_PROPERTIES_ITEM", "gtk-properties"},
- /* The Settings menu */
- { GNOMEUIINFO_MENU_PREFERENCES_ITEM, "GNOMEUIINFO_MENU_PREFERENCES_ITEM", "gtk-preferences"},
- /* The Windows menu */
- { GNOMEUIINFO_MENU_NEW_WINDOW_ITEM, "GNOMEUIINFO_MENU_NEW_WINDOW_ITEM", NULL},
- { GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM, "GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM", NULL},
- /* And the "Help" menu */
- { GNOMEUIINFO_MENU_ABOUT_ITEM, "GNOMEUIINFO_MENU_ABOUT_ITEM", "gtk-about"},
- /* The "Game" menu */
- { GNOMEUIINFO_MENU_NEW_GAME_ITEM, "GNOMEUIINFO_MENU_NEW_GAME_ITEM", NULL},
- { GNOMEUIINFO_MENU_PAUSE_GAME_ITEM, "GNOMEUIINFO_MENU_PAUSE_GAME_ITEM", NULL},
- { GNOMEUIINFO_MENU_RESTART_GAME_ITEM, "GNOMEUIINFO_MENU_RESTART_GAME_ITEM", NULL},
- { GNOMEUIINFO_MENU_UNDO_MOVE_ITEM, "GNOMEUIINFO_MENU_UNDO_MOVE_ITEM", NULL},
- { GNOMEUIINFO_MENU_REDO_MOVE_ITEM, "GNOMEUIINFO_MENU_REDO_MOVE_ITEM", NULL},
- { GNOMEUIINFO_MENU_HINT_ITEM, "GNOMEUIINFO_MENU_HINT_ITEM", NULL},
- { GNOMEUIINFO_MENU_SCORES_ITEM, "GNOMEUIINFO_MENU_SCORES_ITEM", NULL},
- { GNOMEUIINFO_MENU_END_GAME_ITEM, "GNOMEUIINFO_MENU_END_GAME_ITEM", NULL},
- /* Some standard menus */
- { GNOMEUIINFO_MENU_FILE_TREE, "GNOMEUIINFO_MENU_FILE_TREE", NULL},
- { GNOMEUIINFO_MENU_EDIT_TREE, "GNOMEUIINFO_MENU_EDIT_TREE", NULL},
- { GNOMEUIINFO_MENU_VIEW_TREE, "GNOMEUIINFO_MENU_VIEW_TREE", NULL},
- { GNOMEUIINFO_MENU_SETTINGS_TREE, "GNOMEUIINFO_MENU_SETTINGS_TREE", NULL},
- { GNOMEUIINFO_MENU_FILES_TREE, "GNOMEUIINFO_MENU_FILES_TREE", NULL},
- { GNOMEUIINFO_MENU_WINDOWS_TREE, "GNOMEUIINFO_MENU_WINDOWS_TREE", NULL},
- { GNOMEUIINFO_MENU_HELP_TREE, "GNOMEUIINFO_MENU_HELP_TREE", NULL},
- { GNOMEUIINFO_MENU_GAME_TREE, "GNOMEUIINFO_MENU_GAME_TREE", NULL},
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("GladeGtkGnomeUIInfo", values);
- }
- return etype;
-}
-
-GParamSpec *
-glade_gtk_gnome_ui_info_spec (void)
-{
- return g_param_spec_enum ("gnomeuiinfo", _("GnomeUIInfo"),
- _("Choose the GnomeUIInfo stock item"),
- glade_gtk_gnome_ui_info_get_type (),
- 0, G_PARAM_READWRITE);
-}
/* Fake GtkImage::icon-size since its an int pspec in the image */
GParamSpec *
@@ -253,25 +123,9 @@ glade_gtk_widget_depends (GladeWidgetAdaptor *adaptor,
#define GLADE_TAG_ATTRIBUTES "attributes"
#define GLADE_TAG_ATTRIBUTE "attribute"
-
-#define GLADE_TAG_A11Y_LIBGLADE_RELATION "atkrelation"
-#define GLADE_TAG_A11Y_LIBGLADE_ACTION "atkaction"
-#define GLADE_TAG_A11Y_LIBGLADE_PROPERTY "atkproperty"
-#define GLADE_TAG_A11Y_GTKBUILDER_RELATION "relation"
-#define GLADE_TAG_A11Y_GTKBUILDER_ACTION "action"
-#define GLADE_TAG_A11Y_GTKBUILDER_PROPERTY "property"
-
-#define GLADE_TAG_A11Y_PROPERTY(type) \
- ((type == GLADE_PROJECT_FORMAT_LIBGLADE) ? \
- GLADE_TAG_A11Y_LIBGLADE_PROPERTY : GLADE_TAG_A11Y_GTKBUILDER_PROPERTY)
-
-#define GLADE_TAG_A11Y_ACTION(type) \
- ((type == GLADE_PROJECT_FORMAT_LIBGLADE) ? \
- GLADE_TAG_A11Y_LIBGLADE_ACTION : GLADE_TAG_A11Y_GTKBUILDER_ACTION)
-
-#define GLADE_TAG_A11Y_RELATION(type) \
- ((type == GLADE_PROJECT_FORMAT_LIBGLADE) ? \
- GLADE_TAG_A11Y_LIBGLADE_RELATION : GLADE_TAG_A11Y_GTKBUILDER_RELATION)
+#define GLADE_TAG_A11Y_RELATION "relation"
+#define GLADE_TAG_A11Y_ACTION "action"
+#define GLADE_TAG_A11Y_PROPERTY "property"
static const gchar *atk_relations_list[] = {
@@ -332,22 +186,19 @@ static void
glade_gtk_parse_atk_props (GladeWidget *widget,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop;
GladeProperty *property;
GValue *gvalue;
gchar *value, *name, *id, *comment;
- gint translatable, has_context;
+ gint translatable;
gboolean is_action;
- fmt = glade_project_get_format (widget->project);
-
for (prop = glade_xml_node_get_children (node);
prop; prop = glade_xml_node_next (prop))
{
- if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_PROPERTY (fmt)))
+ if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_PROPERTY))
is_action = FALSE;
- else if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_ACTION (fmt)))
+ else if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_ACTION))
is_action = TRUE;
else
continue;
@@ -400,18 +251,14 @@ glade_gtk_parse_atk_props (GladeWidget *widget,
g_value_unset (gvalue);
g_free (gvalue);
- /* Deal with i18n... */
+ /* Deal with i18n... ... XXX Do i18n context !!! */
translatable = glade_xml_get_property_boolean
(prop, GLADE_TAG_TRANSLATABLE, FALSE);
- has_context = glade_xml_get_property_boolean
- (prop, GLADE_TAG_HAS_CONTEXT, FALSE);
comment = glade_xml_get_property_string
(prop, GLADE_TAG_COMMENT);
glade_property_i18n_set_translatable
(property, translatable);
- glade_property_i18n_set_has_context
- (property, has_context);
glade_property_i18n_set_comment
(property, comment);
@@ -441,8 +288,7 @@ glade_gtk_parse_atk_props_gtkbuilder (GladeWidget *widget,
{
if (!strcmp (internal, GLADE_TAG_A11Y_INTERNAL_NAME) &&
(object_node =
- glade_xml_search_child_required
- (child, GLADE_XML_TAG_BUILDER_WIDGET)))
+ glade_xml_search_child_required (child, GLADE_XML_TAG_WIDGET)))
glade_gtk_parse_atk_props (widget, object_node);
g_free (internal);
@@ -455,17 +301,14 @@ static void
glade_gtk_parse_atk_relation (GladeProperty *property,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop;
gchar *type, *target, *id, *tmp;
gchar *string = NULL;
- fmt = glade_project_get_format (property->widget->project);
-
for (prop = glade_xml_node_get_children (node);
prop; prop = glade_xml_node_next (prop))
{
- if (!glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_RELATION (fmt)))
+ if (!glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_RELATION))
continue;
if (!(type =
@@ -522,8 +365,7 @@ glade_gtk_widget_read_atk_props (GladeWidget *widget,
GladeProperty *property;
gint i;
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- glade_gtk_parse_atk_props_gtkbuilder (widget, node);
+ glade_gtk_parse_atk_props_gtkbuilder (widget, node);
if ((atk_node =
glade_xml_search_child (node, GLADE_TAG_A11Y_A11Y)) != NULL)
@@ -550,8 +392,7 @@ glade_gtk_widget_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -570,16 +411,13 @@ glade_gtk_widget_write_atk_property (GladeProperty *property,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop_node;
gchar *value;
-
- fmt = glade_project_get_format (property->widget->project);
glade_property_get (property, &value);
if (value && value[0])
{
- prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_PROPERTY (fmt));
+ prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_PROPERTY);
glade_xml_node_append_child (node, prop_node);
glade_xml_node_set_property_string (prop_node,
@@ -588,17 +426,12 @@ glade_gtk_widget_write_atk_property (GladeProperty *property,
glade_xml_set_content (prop_node, value);
+ /* XXX Do context !!! */
if (property->i18n_translatable)
glade_xml_node_set_property_string (prop_node,
GLADE_TAG_TRANSLATABLE,
GLADE_XML_TAG_I18N_TRUE);
- if (property->i18n_has_context)
- glade_xml_node_set_property_string (prop_node,
- GLADE_TAG_HAS_CONTEXT,
- GLADE_XML_TAG_I18N_TRUE);
-
-
if (property->i18n_comment)
glade_xml_node_set_property_string (prop_node,
GLADE_TAG_COMMENT,
@@ -607,23 +440,9 @@ glade_gtk_widget_write_atk_property (GladeProperty *property,
}
static void
-glade_gtk_widget_write_atk_properties_libglade (GladeWidget *widget,
- GladeXmlContext *context,
- GladeXmlNode *node)
-{
- GladeProperty *name_prop, *desc_prop;
-
- name_prop = glade_widget_get_property (widget, "AtkObject::accessible-name");
- desc_prop = glade_widget_get_property (widget, "AtkObject::accessible-description");
-
- glade_gtk_widget_write_atk_property (name_prop, context, node);
- glade_gtk_widget_write_atk_property (desc_prop, context, node);
-}
-
-static void
-glade_gtk_widget_write_atk_properties_gtkbuilder (GladeWidget *widget,
- GladeXmlContext *context,
- GladeXmlNode *node)
+glade_gtk_widget_write_atk_properties (GladeWidget *widget,
+ GladeXmlContext *context,
+ GladeXmlNode *node)
{
GladeXmlNode *child_node, *object_node;
GladeProperty *name_prop, *desc_prop;
@@ -644,7 +463,7 @@ glade_gtk_widget_write_atk_properties_gtkbuilder (GladeWidget *widget,
GLADE_XML_TAG_INTERNAL_CHILD,
GLADE_TAG_A11Y_INTERNAL_NAME);
- object_node = glade_xml_node_new (context, GLADE_XML_TAG_BUILDER_WIDGET);
+ object_node = glade_xml_node_new (context, GLADE_XML_TAG_WIDGET);
glade_xml_node_append_child (child_node, object_node);
glade_xml_node_set_property_string (object_node,
@@ -670,23 +489,20 @@ glade_gtk_widget_write_atk_relation (GladeProperty *property,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop_node;
gchar *value, **split;
gint i;
-
- fmt = glade_project_get_format (property->widget->project);
if ((value = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
- property->klass, property->value, fmt)) != NULL)
+ property->klass, property->value)) != NULL)
{
if ((split = g_strsplit (value, GPC_OBJECT_DELIMITER, 0)) != NULL)
{
for (i = 0; split[i] != NULL; i++)
{
prop_node = glade_xml_node_new (context,
- GLADE_TAG_A11Y_RELATION (fmt));
+ GLADE_TAG_A11Y_RELATION);
glade_xml_node_append_child (node, prop_node);
glade_xml_node_set_property_string (prop_node,
@@ -726,17 +542,14 @@ glade_gtk_widget_write_atk_action (GladeProperty *property,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *prop_node;
gchar *value = NULL;
-
- fmt = glade_project_get_format (property->widget->project);
glade_property_get (property, &value);
if (value && value[0])
{
- prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_ACTION (fmt));
+ prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_ACTION);
glade_xml_node_append_child (node, prop_node);
glade_xml_node_set_property_string (prop_node,
@@ -770,16 +583,10 @@ glade_gtk_widget_write_atk_props (GladeWidget *widget,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
GladeXmlNode *atk_node;
- fmt = glade_project_get_format (widget->project);
-
atk_node = glade_xml_node_new (context, GLADE_TAG_A11Y_A11Y);
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_gtk_widget_write_atk_properties_libglade (widget, context, atk_node);
-
glade_gtk_widget_write_atk_relations (widget, context, atk_node);
glade_gtk_widget_write_atk_actions (widget, context, atk_node);
@@ -788,8 +595,7 @@ glade_gtk_widget_write_atk_props (GladeWidget *widget,
else
glade_xml_node_append_child (node, atk_node);
- if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER)
- glade_gtk_widget_write_atk_properties_gtkbuilder (widget, context, node);
+ glade_gtk_widget_write_atk_properties (widget, context, node);
}
static void
@@ -822,31 +628,15 @@ glade_gtk_widget_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProjectFormat fmt;
-
- fmt = glade_project_get_format (widget->project);
-
- if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET (fmt)))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
-
- /* in Libglade the order must be Properties, Atk, Signals, Accels.
- * in builder it doesnt matter so long as signals are after properties
- * and before objects.
- */
- if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- glade_gtk_widget_write_atk_props (widget, context, node);
- glade_widget_write_signals (widget, context, node);
- glade_gtk_write_accels (widget, context, node, TRUE);
- } else {
- /* The core takes care of signals in GtkBuilder format */
- glade_gtk_write_accels (widget, context, node, TRUE);
- glade_gtk_widget_write_atk_props (widget, context, node);
- }
+ /* The core takes care of signals */
+ glade_gtk_write_accels (widget, context, node, TRUE);
+ glade_gtk_widget_write_atk_props (widget, context, node);
}
@@ -874,8 +664,7 @@ glade_gtk_widget_create_eprop (GladeWidgetAdaptor *adaptor,
gchar *
glade_gtk_widget_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
if (klass->pspec->value_type == GLADE_TYPE_ACCEL_GLIST)
return glade_accels_make_string (g_value_get_boxed (value));
@@ -883,8 +672,7 @@ glade_gtk_widget_string_from_value (GladeWidgetAdaptor *adaptor,
return GWA_GET_CLASS
(G_TYPE_OBJECT)->string_from_value (adaptor,
klass,
- value,
- fmt);
+ value);
}
static void
@@ -905,39 +693,6 @@ widget_parent_changed (GtkWidget *widget,
glade_widget_set_action_sensitive (gwidget, "remove_parent", FALSE);
}
-
-static void
-widget_format_changed (GladeProject *project,
- GParamSpec *pspec,
- GladeWidget *gwidget)
-{
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_widget_set_action_sensitive (gwidget, "sizegroup_add", FALSE);
- else
- glade_widget_set_action_sensitive (gwidget, "sizegroup_add", TRUE);
-}
-
-static void
-widget_project_changed (GladeWidget *gwidget,
- GParamSpec *pspec,
- gpointer userdata)
-{
- GladeProject
- *project = glade_widget_get_project (gwidget),
- *old_project = g_object_get_data (G_OBJECT (gwidget), "widget-project-ptr");
-
- if (old_project)
- g_signal_handlers_disconnect_by_func (G_OBJECT (old_project),
- G_CALLBACK (widget_format_changed),
- gwidget);
-
- if (project)
- g_signal_connect (G_OBJECT (project), "notify::format",
- G_CALLBACK (widget_format_changed), gwidget);
-
- g_object_set_data (G_OBJECT (gwidget), "widget-project-ptr", project);
-}
-
void
glade_gtk_widget_deep_post_create (GladeWidgetAdaptor *adaptor,
GObject *widget,
@@ -961,10 +716,6 @@ glade_gtk_widget_deep_post_create (GladeWidgetAdaptor *adaptor,
g_signal_connect (G_OBJECT (widget), "notify::parent",
G_CALLBACK (widget_parent_changed), adaptor);
- g_signal_connect (G_OBJECT (gwidget), "notify::project",
- G_CALLBACK (widget_project_changed), NULL);
-
- widget_project_changed (gwidget, NULL, NULL);
}
@@ -3475,12 +3226,9 @@ write_special_child_label_item (GladeWidgetAdaptor *adaptor,
gchar *special_child_type = NULL;
GObject *child;
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- {
- child = widget->object;
- if (child)
- special_child_type = g_object_get_data (child, "special-child-type");
- }
+ child = widget->object;
+ if (child)
+ special_child_type = g_object_get_data (child, "special-child-type");
if (special_child_type && !strcmp (special_child_type, "label_item"))
{
@@ -4890,8 +4638,7 @@ glade_gtk_entry_read_widget (GladeWidgetAdaptor *adaptor,
{
GladeProperty *property;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -5115,8 +4862,7 @@ glade_gtk_window_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -5162,8 +4908,7 @@ glade_gtk_window_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -5510,15 +5255,9 @@ glade_gtk_dialog_read_child (GladeWidgetAdaptor *adaptor,
GladeXmlNode *node)
{
GladeXmlNode *widgets_node;
- GladeProject *project;
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->read_child (adaptor, widget, node);
- project = widget->project;
-
- if (glade_project_get_format (project) != GLADE_PROJECT_FORMAT_GTKBUILDER)
- return;
-
node = glade_xml_node_get_parent (node);
if ((widgets_node = glade_xml_search_child (node, GLADE_TAG_ACTION_WIDGETS)) != NULL)
@@ -5551,8 +5290,7 @@ glade_gtk_dialog_write_responses (GladeWidget *widget,
widget_node = glade_xml_node_new (context, GLADE_TAG_ACTION_WIDGET);
glade_xml_node_append_child (node, widget_node);
- str = glade_property_class_make_string_from_gvalue (property->klass, property->value,
- GLADE_PROJECT_FORMAT_GTKBUILDER);
+ str = glade_property_class_make_string_from_gvalue (property->klass, property->value);
glade_xml_node_set_property_string (widget_node, GLADE_TAG_RESPONSE, str);
glade_xml_set_content (widget_node, action_widget->name);
@@ -5579,8 +5317,7 @@ glade_gtk_dialog_write_child (GladeWidgetAdaptor *adaptor,
parent = widget->parent;
project = widget->project;
- if (parent && GTK_IS_DIALOG (parent->object) &&
- glade_project_get_format (project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
+ if (parent && GTK_IS_DIALOG (parent->object))
{
widgets_node = glade_xml_node_new (context, GLADE_TAG_ACTION_WIDGETS);
@@ -6027,8 +5764,7 @@ glade_gtk_button_read_widget (GladeWidgetAdaptor *adaptor,
gboolean use_stock;
gchar *label = NULL;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -6049,13 +5785,11 @@ glade_gtk_button_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- GladeProject *project = widget->project;
GladeProperty *prop;
gboolean use_stock;
gchar *stock = NULL;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* Do not save GtkColorButton and GtkFontButton label property */
@@ -6077,11 +5811,6 @@ glade_gtk_button_write_widget (GladeWidgetAdaptor *adaptor,
g_object_unref (G_OBJECT (prop));
}
- prop = glade_widget_get_property (widget, "response-id");
- if (glade_property_get_enabled (prop) &&
- glade_project_get_format (project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_property_write (prop, context, node);
-
/* Write out other normal properties and any other class derived custom properties after ... */
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->write_widget (adaptor, widget, context, node);
}
@@ -6095,8 +5824,7 @@ glade_gtk_image_read_widget (GladeWidgetAdaptor *adaptor,
{
GladeProperty *property;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -6133,8 +5861,7 @@ glade_gtk_image_write_widget (GladeWidgetAdaptor *adaptor,
GtkIconSize icon_size;
gchar *value;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and write all the normal properties (including "use-stock")... */
@@ -6302,24 +6029,6 @@ glade_gtk_menu_constructor (GType type,
return ret_obj;
}
-void
-glade_gtk_menu_read_widget (GladeWidgetAdaptor *adaptor,
- GladeWidget *widget,
- GladeXmlNode *node)
-{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
- return;
-
- /* First chain up and read in all the normal properties.. */
- GWA_GET_CLASS (GTK_TYPE_WIDGET)->read_widget (adaptor, widget, node);
-
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_LIBGLADE &&
- widget->parent && GTK_IS_MENU_ITEM (widget->parent->object))
- g_object_set_data (widget->object, "special-child-type", "submenu");
-}
-
-
/* ----------------------------- GtkMenuShell ------------------------------ */
void
glade_gtk_menu_shell_add_child (GladeWidgetAdaptor *adaptor,
@@ -6666,12 +6375,6 @@ glade_gtk_menu_shell_tool_item_child_selected (GladeBaseEditor *editor,
glade_base_editor_add_label (editor, _("Properties"));
- if (glade_project_get_format (gchild->project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- glade_base_editor_add_properties (editor, gchild, FALSE, "tooltip", NULL);
- else
- glade_base_editor_add_properties (editor, gchild, FALSE, "tooltip-text", NULL);
-
-
if (type != GTK_TYPE_IMAGE_MENU_ITEM)
glade_base_editor_add_properties (editor, gchild, FALSE, "label", "tooltip", NULL);
@@ -6924,51 +6627,6 @@ glade_gtk_menu_item_set_property (GladeWidgetAdaptor *adaptor,
id, value);
}
-static gboolean
-write_special_child_submenu_item (GladeWidgetAdaptor *adaptor,
- GladeWidget *widget,
- GladeXmlContext *context,
- GladeXmlNode *node,
- GladeWriteWidgetFunc write_func)
-{
- gchar *special_child_type = NULL;
- GObject *child;
-
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- child = widget->object;
- if (child)
- special_child_type = g_object_get_data (child, "special-child-type");
- }
-
- if (special_child_type && !strcmp (special_child_type, "submenu"))
- {
- g_object_set_data (child, "special-child-type", NULL);
- write_func (adaptor, widget, context, node);
- g_object_set_data (child, "special-child-type", "submenu");
- return TRUE;
- }
- else
- return FALSE;
-}
-
-void
-glade_gtk_menu_item_write_child (GladeWidgetAdaptor *adaptor,
- GladeWidget *widget,
- GladeXmlContext *context,
- GladeXmlNode *node)
-{
-
- if (!write_special_child_submenu_item (adaptor, widget, context, node,
- GWA_GET_CLASS(GTK_TYPE_CONTAINER)->write_child))
- /* Chain Up */
- GWA_GET_CLASS
- (GTK_TYPE_CONTAINER)->write_child (adaptor,
- widget,
- context,
- node);
-}
-
/* ----------------------------- GtkImageMenuItem ------------------------------ */
GList *
@@ -6984,10 +6642,6 @@ glade_gtk_image_menu_item_get_children (GladeWidgetAdaptor *adaptor,
if ((child = gtk_menu_item_get_submenu (GTK_MENU_ITEM (object))))
list = g_list_append (list, child);
- if (glade_project_get_format (gitem->project) == GLADE_PROJECT_FORMAT_LIBGLADE &&
- (child = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (object))))
- list = g_list_append (list, child);
-
return list;
}
@@ -7115,140 +6769,6 @@ glade_gtk_image_menu_item_set_property (GladeWidgetAdaptor *adaptor,
id, value);
}
-static GladeWidget *
-glade_gtk_image_menu_item_create_image (GladeWidget *gitem)
-{
- GladeWidget *gimage;
-
- gimage = glade_widget_adaptor_create_widget
- (glade_widget_adaptor_get_by_type (GTK_TYPE_IMAGE), FALSE,
- "parent", gitem,
- "project", glade_widget_get_project (gitem),
- NULL);
-
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (gitem->object),
- GTK_WIDGET (gimage->object));
-
- glade_widget_lock (gitem, gimage);
-
- return gimage;
-}
-
-static void
-glade_gtk_image_menu_item_fix_stock_item (GladeWidget *widget)
-{
- GladeWidget *gimage;
- GEnumClass *eclass;
- GEnumValue *eval;
- gint val = GNOMEUIINFO_MENU_NONE;
- gchar *label = NULL, *icon = NULL;
-
- glade_widget_property_get (widget, "stock-item", &val);
- if (val == GNOMEUIINFO_MENU_NONE) return;
-
- /* Get the GEnumValue ... */
- eclass = g_type_class_ref (glade_gtk_gnome_ui_info_get_type ());
- if ((eval = g_enum_get_value (eclass, val)) == NULL)
- {
- g_type_class_unref (eclass);
- return;
- }
- g_type_class_unref (eclass);
-
- /* set use-underline */
- glade_widget_property_set (widget, "use-underline", TRUE);
-
- if (eval->value_nick)
- {
- glade_widget_property_set (widget, "use-stock", TRUE);
- glade_widget_property_set (widget, "label", eval->value_nick);
- return;
- }
-
- switch (val)
- {
- case GNOMEUIINFO_MENU_PRINT_SETUP_ITEM:
- icon = "gtk-print";
- label = _("Print S_etup");
- break;
- case GNOMEUIINFO_MENU_FIND_AGAIN_ITEM:
- icon = "gtk-find";
- label = _("Find Ne_xt");
- break;
- case GNOMEUIINFO_MENU_UNDO_MOVE_ITEM:
- icon = "gtk-undo";
- label = _("_Undo Move");
- break;
- case GNOMEUIINFO_MENU_REDO_MOVE_ITEM:
- icon = "gtk-redo";
- label = _("_Redo Move");
- break;
- case GNOMEUIINFO_MENU_SELECT_ALL_ITEM:
- label = _("Select _All");
- break;
- case GNOMEUIINFO_MENU_NEW_GAME_ITEM:
- label = _("_New Game");
- break;
- case GNOMEUIINFO_MENU_PAUSE_GAME_ITEM:
- label = _("_Pause game");
- break;
- case GNOMEUIINFO_MENU_RESTART_GAME_ITEM:
- label = _("_Restart Game");
- break;
- case GNOMEUIINFO_MENU_HINT_ITEM:
- label = _("_Hint");
- break;
- case GNOMEUIINFO_MENU_SCORES_ITEM:
- label = _("_Scores...");
- break;
- case GNOMEUIINFO_MENU_END_GAME_ITEM:
- label = _("_End Game");
- break;
- case GNOMEUIINFO_MENU_NEW_WINDOW_ITEM:
- label = _("Create New _Window");
- break;
- case GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM:
- label = _("_Close This Window");
- break;
- case GNOMEUIINFO_MENU_FILE_TREE:
- label = _("_File");
- break;
- case GNOMEUIINFO_MENU_EDIT_TREE:
- label = _("_Edit");
- break;
- case GNOMEUIINFO_MENU_VIEW_TREE:
- label = _("_View");
- break;
- case GNOMEUIINFO_MENU_SETTINGS_TREE:
- label = _("_Settings");
- break;
- case GNOMEUIINFO_MENU_FILES_TREE:
- label = _("Fi_les");
- break;
- case GNOMEUIINFO_MENU_WINDOWS_TREE:
- label = _("_Windows");
- break;
- case GNOMEUIINFO_MENU_HELP_TREE:
- label = _("_Help");
- break;
- case GNOMEUIINFO_MENU_GAME_TREE:
- label = _("_Game");
- break;
- default:
- return;
- break;
- }
-
- if (icon)
- {
- gimage = glade_gtk_image_menu_item_create_image (widget);
- glade_widget_property_set (gimage, "stock", icon);
- glade_widget_property_set (gimage, "icon-size", GTK_ICON_SIZE_MENU);
- }
-
- glade_widget_property_set (widget, "label", label);
-}
-
static void
glade_gtk_image_menu_item_parse_finished (GladeProject *project,
GladeWidget *widget)
@@ -7270,16 +6790,12 @@ glade_gtk_image_menu_item_read_widget (GladeWidgetAdaptor *adaptor,
gboolean use_stock;
gchar *label = NULL;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
GWA_GET_CLASS (GTK_TYPE_MENU_ITEM)->read_widget (adaptor, widget, node);
- /* This will read legacy "stock-item" properties and make them usable */
- glade_gtk_image_menu_item_fix_stock_item (widget);
-
glade_widget_property_get (widget, "use-stock", &use_stock);
if (use_stock)
{
@@ -7297,10 +6813,9 @@ glade_gtk_image_menu_item_read_widget (GladeWidgetAdaptor *adaptor,
/* Run this after the load so that image is resolved. */
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- g_signal_connect (G_OBJECT (widget->project), "parse-finished",
- G_CALLBACK (glade_gtk_image_menu_item_parse_finished),
- widget);
+ g_signal_connect (G_OBJECT (widget->project), "parse-finished",
+ G_CALLBACK (glade_gtk_image_menu_item_parse_finished),
+ widget);
}
@@ -7314,8 +6829,7 @@ glade_gtk_image_menu_item_write_widget (GladeWidgetAdaptor *adaptor,
gboolean use_stock;
gchar *stock;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* Make a copy of the GladeProperty, override its value if use-stock is TRUE */
@@ -7336,71 +6850,6 @@ glade_gtk_image_menu_item_write_widget (GladeWidgetAdaptor *adaptor,
}
-
-/* Read in the internal "image" widgets as normal "locked" widgets...
- */
-void
-glade_gtk_image_menu_item_read_child (GladeWidgetAdaptor *adaptor,
- GladeWidget *widget,
- GladeXmlNode *node)
-{
- GladeXmlNode *widget_node;
- GladeWidget *child_widget;
- gchar *internal_name;
-
- if (!glade_xml_node_verify (node, GLADE_XML_TAG_CHILD))
- return;
-
- internal_name =
- glade_xml_get_property_string
- (node, GLADE_XML_TAG_INTERNAL_CHILD);
-
- if ((widget_node =
- glade_xml_search_child
- (node, GLADE_XML_TAG_WIDGET(glade_project_get_format(widget->project)))) != NULL)
- {
- /* Menu item children have no packing to take care of, just
- * need to treat images a little different. */
- if ((child_widget = glade_widget_read (widget->project,
- widget, widget_node,
- NULL)) != NULL)
- {
- if (GTK_IS_IMAGE (child_widget->object) &&
- internal_name && strcmp (internal_name, "image") == 0)
- glade_widget_lock (widget, child_widget);
-
- glade_widget_add_child (widget, child_widget, FALSE);
- }
- }
- g_free (internal_name);
-}
-
-void
-glade_gtk_image_menu_item_write_child (GladeWidgetAdaptor *adaptor,
- GladeWidget *widget,
- GladeXmlContext *context,
- GladeXmlNode *node)
-{
- GladeXmlNode *child_node;
-
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_GTKBUILDER ||
- !GTK_IS_IMAGE (widget->object))
- {
- GWA_GET_CLASS (GTK_TYPE_MENU_ITEM)->write_child (adaptor, widget, context, node);
- return;
- }
-
- child_node = glade_xml_node_new (context, GLADE_XML_TAG_CHILD);
- glade_xml_node_append_child (node, child_node);
-
- /* Set fake internal child here */
- glade_xml_node_set_property_string (child_node, GLADE_XML_TAG_INTERNAL_CHILD, "image");
-
- /* Write out the widget (no packing properties) */
- glade_widget_write (widget, context, child_node);
-}
-
-
/* We need write_widget to write child images as internal, in builder, they are
* attached as a property
*/
@@ -7827,7 +7276,6 @@ glade_gtk_tool_button_set_image_mode (GObject *object, const GValue *value)
glade_widget_property_set_sensitive (gbutton, "stock-id", FALSE, NOT_SELECTED_MSG);
glade_widget_property_set_sensitive (gbutton, "icon-name", FALSE, NOT_SELECTED_MSG);
- glade_widget_property_set_sensitive (gbutton, "icon", FALSE, NOT_SELECTED_MSG);
glade_widget_property_set_sensitive (gbutton, "icon-widget", FALSE, NOT_SELECTED_MSG);
switch (g_value_get_int (value))
@@ -7838,9 +7286,6 @@ glade_gtk_tool_button_set_image_mode (GObject *object, const GValue *value)
case GLADE_TB_MODE_ICON:
glade_widget_property_set_sensitive (gbutton, "icon-name", TRUE, NULL);
break;
- case GLADE_TB_MODE_FILENAME:
- glade_widget_property_set_sensitive (gbutton, "icon", TRUE, NULL);
- break;
case GLADE_TB_MODE_CUSTOM:
glade_widget_property_set_sensitive (gbutton, "icon-widget", TRUE, NULL);
break;
@@ -7895,25 +7340,6 @@ glade_gtk_tool_button_set_stock_id (GObject *object, const GValue *value)
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (object), stock_id);
}
-/* legacy libglade property */
-static void
-glade_gtk_tool_button_set_icon (GObject *object, const GValue *value)
-{
- GladeWidget *gbutton;
- GObject *pixbuf;
- GtkWidget *image = NULL;
-
- g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
- gbutton = glade_widget_get_from_gobject (object);
-
- if ((pixbuf = g_value_get_object (value)))
- {
- image = gtk_image_new_from_pixbuf (GDK_PIXBUF (pixbuf));
- gtk_widget_show (image);
- }
- gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (object), image);
-}
-
static void
glade_gtk_tool_button_set_icon_name (GObject *object, const GValue *value)
{
@@ -7938,8 +7364,6 @@ glade_gtk_tool_button_set_property (GladeWidgetAdaptor *adaptor,
glade_gtk_tool_button_set_image_mode (object, value);
else if (!strcmp (id, "icon-name"))
glade_gtk_tool_button_set_icon_name (object, value);
- else if (!strcmp (id, "icon"))
- glade_gtk_tool_button_set_icon (object, value);
else if (!strcmp (id, "stock-id"))
glade_gtk_tool_button_set_stock_id (object, value);
else if (!strcmp (id, "label"))
@@ -7958,12 +7382,10 @@ glade_gtk_tool_button_parse_finished (GladeProject *project,
{
gchar *stock_str = NULL, *icon_name = NULL;
gint stock_id = 0;
- GdkPixbuf *pixbuf = NULL;
GtkWidget *label_widget = NULL, *image_widget = NULL;
glade_widget_property_get (widget, "stock-id", &stock_str);
glade_widget_property_get (widget, "icon-name", &icon_name);
- glade_widget_property_get (widget, "icon", &pixbuf);
glade_widget_property_get (widget, "icon-widget", &image_widget);
glade_widget_property_get (widget, "label-widget", &label_widget);
@@ -7974,8 +7396,6 @@ glade_gtk_tool_button_parse_finished (GladeProject *project,
if (image_widget)
glade_widget_property_set (widget, "image-mode", GLADE_TB_MODE_CUSTOM);
- else if (pixbuf)
- glade_widget_property_set (widget, "image-mode", GLADE_TB_MODE_FILENAME);
else if (icon_name)
glade_widget_property_set (widget, "image-mode", GLADE_TB_MODE_ICON);
else if (stock_str)
@@ -7997,8 +7417,7 @@ glade_gtk_tool_button_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -8402,8 +7821,7 @@ glade_gtk_label_read_widget (GladeWidgetAdaptor *adaptor,
GladeXmlNode *node)
{
GladeProperty *prop;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -8480,8 +7898,7 @@ glade_gtk_label_write_widget (GladeWidgetAdaptor *adaptor,
{
GladeXmlNode *attrs_node;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -8501,8 +7918,7 @@ glade_gtk_label_write_widget (GladeWidgetAdaptor *adaptor,
gchar *
glade_gtk_label_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
if (klass->pspec->value_type == GLADE_TYPE_ATTR_GLIST)
{
@@ -8527,8 +7943,7 @@ glade_gtk_label_string_from_value (GladeWidgetAdaptor *adaptor,
return GWA_GET_CLASS
(GTK_TYPE_WIDGET)->string_from_value (adaptor,
klass,
- value,
- fmt);
+ value);
}
@@ -8700,32 +8115,6 @@ glade_gtk_text_buffer_set_property (GladeWidgetAdaptor *adaptor,
}
/* ----------------------------- GtkTextView ------------------------------ */
-static void
-glade_gtk_text_view_changed (GtkTextBuffer *buffer, GladeWidget *gtext)
-{
- const gchar *text_prop = NULL;
- GladeProject *project;
- GladeProperty *prop;
- gchar *text = NULL;
-
- if (buffer)
- g_object_get (buffer, "text", &text, NULL);
-
- project = glade_widget_get_project (gtext);
-
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- if ((prop = glade_widget_get_property (gtext, "text")))
- {
- glade_property_get (prop, &text_prop);
-
- if (text_prop == NULL || text == NULL || strcmp (text, text_prop))
- glade_command_set_property (prop, text);
- }
- }
- g_free (text);
-}
-
static gboolean
glade_gtk_text_view_stop_double_click (GtkWidget *widget,
GdkEventButton *event,
@@ -8741,165 +8130,58 @@ glade_gtk_text_view_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
- GtkTextBuffer *buffy;
GladeWidget *gtext;
- GladeProject *project;
gtext = glade_widget_get_from_gobject (object);
-
+
/* This makes gtk_text_view_set_buffer() stop complaing */
gtk_drag_dest_set (GTK_WIDGET (object), 0, NULL, 0, 0);
- project = glade_widget_get_project (gtext);
-
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
- buffy = gtk_text_buffer_new (NULL);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (object), buffy);
- g_signal_connect (buffy, "changed",
- G_CALLBACK (glade_gtk_text_view_changed),
- gtext);
-
- g_object_unref (G_OBJECT (buffy));
- }
-
- /* Glade3 hangs when a TextView gets a double click. So we stop them */
+ /* Glade hangs when a TextView gets a double click. So we stop them */
g_signal_connect (object, "button-press-event",
G_CALLBACK (glade_gtk_text_view_stop_double_click),
NULL);
}
-static void
-glade_gtk_text_view_set_buffer (GObject *object, const GValue *value)
-{
- GtkTextBuffer *buffy;
- GladeWidget *gtext;
-
- gtext = glade_widget_get_from_gobject (object);
-
- if ((buffy = g_value_get_object (value)) == NULL) return;
-
- g_signal_handlers_block_by_func (buffy, glade_gtk_text_view_changed, gtext);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (object), buffy);
- g_signal_handlers_unblock_by_func (buffy, glade_gtk_text_view_changed, gtext);
-}
-
-static void
-glade_gtk_text_view_set_text (GObject *object, const GValue *value)
-{
- GtkTextBuffer *buffy;
- GladeWidget *gtext;
- const gchar *text;
- GladeProject *project;
-
- gtext = glade_widget_get_from_gobject (object);
-
- project = glade_widget_get_project (gtext);
- if (glade_project_get_format (project) != GLADE_PROJECT_FORMAT_LIBGLADE)
- return;
-
- buffy = gtk_text_view_get_buffer (GTK_TEXT_VIEW (object));
- if (buffy == NULL) return;
-
- if ((text = g_value_get_string (value)) == NULL) return;
-
- g_signal_handlers_block_by_func (buffy, glade_gtk_text_view_changed, gtext);
- gtk_text_buffer_set_text (buffy, text, -1);
- g_signal_handlers_unblock_by_func (buffy, glade_gtk_text_view_changed, gtext);
-}
-
void
glade_gtk_text_view_set_property (GladeWidgetAdaptor *adaptor,
- GObject *object,
- const gchar *id,
+ GObject *object,
+ const gchar *property_name,
const GValue *value)
{
- if (!strcmp (id, "text"))
- glade_gtk_text_view_set_text (object, value);
- else if (!strcmp (id, "buffer"))
- glade_gtk_text_view_set_buffer (object, value);
- else
- GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
- object,
- id, value);
-}
-
-
-/* ----------------------------- GtkComboBox ------------------------------ */
-static void
-combo_ensure_model (GObject *combo)
-{
- GtkListStore *store;
-
- if (!gtk_combo_box_get_model (GTK_COMBO_BOX (combo)))
+ if (strcmp (property_name, "buffer") == 0)
{
- /* Add store */
- store = gtk_list_store_new (1, G_TYPE_STRING);
- gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store));
- g_object_unref (store);
+ if (!g_value_get_object (value))
+ return;
}
+
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ property_name,
+ value);
}
+/* ----------------------------- GtkComboBox ------------------------------ */
void
glade_gtk_combo_box_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
- GtkCellRenderer *cell;
GladeWidget *widget = glade_widget_get_from_gobject (object);
- if (glade_project_get_format (widget->project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- {
-
- combo_ensure_model (object);
-
- /* Add cell renderer */
- cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (object), cell, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell,
- "text", 0, NULL);
- }
-
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (object)))
glade_widget_adaptor_create_internal
(widget, G_OBJECT (gtk_bin_get_child (GTK_BIN (object))),
"entry", "comboboxentry", FALSE, reason);
}
-static void
-glade_gtk_combo_box_set_items (GObject *object, const GValue *value)
-{
- GtkComboBox *combo = GTK_COMBO_BOX (object);
- GladeWidget *widget = glade_widget_get_from_gobject (object);
- gchar **split;
- gint i;
-
- if (glade_project_get_format (widget->project) != GLADE_PROJECT_FORMAT_LIBGLADE)
- return;
-
- combo_ensure_model (object);
-
- /* Empty the combo box */
- gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo)));
-
- /* Refill the combo box */
- split = g_value_get_boxed (value);
-
- if (split)
- for (i = 0; split[i] != NULL; i++)
- if (split[i][0] != '\0')
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), split[i]);
-}
-
void
glade_gtk_combo_box_set_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
{
- if (!strcmp (id, "items"))
- glade_gtk_combo_box_set_items (object, value);
- else if (!strcmp (id, "entry-text-column"))
+ if (!strcmp (id, "entry-text-column"))
{
/* Avoid warnings */
if (g_value_get_int (value) >= 0)
@@ -9417,8 +8699,7 @@ glade_gtk_size_group_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -9464,8 +8745,7 @@ glade_gtk_size_group_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -9644,8 +8924,7 @@ glade_gtk_icon_factory_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in any normal properties.. */
@@ -9747,8 +9026,7 @@ glade_gtk_icon_factory_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and write all the normal properties.. */
@@ -9853,8 +9131,7 @@ serialize_icon_sources (gchar *icon_name,
gchar *
glade_gtk_icon_factory_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
GString *string;
@@ -9873,8 +9150,7 @@ glade_gtk_icon_factory_string_from_value (GladeWidgetAdaptor *adaptor,
return GWA_GET_CLASS
(G_TYPE_OBJECT)->string_from_value (adaptor,
klass,
- value,
- fmt);
+ value);
}
@@ -10240,8 +9516,7 @@ glade_gtk_store_create_editable (GladeWidgetAdaptor *adaptor,
gchar *
glade_gtk_store_string_from_value (GladeWidgetAdaptor *adaptor,
GladePropertyClass *klass,
- const GValue *value,
- GladeProjectFormat fmt)
+ const GValue *value)
{
GString *string;
@@ -10283,7 +9558,7 @@ glade_gtk_store_string_from_value (GladeWidgetAdaptor *adaptor,
G_VALUE_TYPE (&data->value) == G_TYPE_INVALID)
str = g_strdup ("(virtual)");
else if (G_VALUE_TYPE (&data->value) != G_TYPE_POINTER)
- str = glade_utils_string_from_value (&data->value, fmt);
+ str = glade_utils_string_from_value (&data->value);
else
str = g_strdup ("(null)");
@@ -10310,8 +9585,7 @@ glade_gtk_store_string_from_value (GladeWidgetAdaptor *adaptor,
return GWA_GET_CLASS
(G_TYPE_OBJECT)->string_from_value (adaptor,
klass,
- value,
- fmt);
+ value);
}
static void
@@ -10390,8 +9664,7 @@ glade_gtk_store_write_data (GladeWidget *widget,
G_VALUE_TYPE (&data->value) == G_TYPE_POINTER)
continue;
- string = glade_utils_string_from_value (&data->value,
- glade_project_get_format (widget->project));
+ string = glade_utils_string_from_value (&data->value);
/* XXX Log error: data col j exceeds columns on row i */
if (!g_list_nth (columns, colnum))
@@ -10437,8 +9710,7 @@ glade_gtk_store_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and write all the normal properties.. */
@@ -10624,8 +9896,7 @@ glade_gtk_store_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the normal properties.. */
@@ -10664,37 +9935,6 @@ glade_gtk_cell_renderer_action_activate (GladeWidgetAdaptor *adaptor,
action_path);
}
-
-static void
-renderer_format_changed (GladeProject *project,
- GParamSpec *pspec,
- GladeWidget *gwidget)
-{
- if (glade_project_get_format (project) == GLADE_PROJECT_FORMAT_GTKBUILDER)
- g_idle_add ((GSourceFunc)glade_gtk_cell_renderer_sync_attributes, gwidget->object);
-}
-
-static void
-renderer_project_changed (GladeWidget *gwidget,
- GParamSpec *pspec,
- gpointer userdata)
-{
- GladeProject
- *project = glade_widget_get_project (gwidget),
- *old_project = g_object_get_data (G_OBJECT (gwidget), "renderer-project-ptr");
-
- if (old_project)
- g_signal_handlers_disconnect_by_func (G_OBJECT (old_project),
- G_CALLBACK (renderer_format_changed),
- gwidget);
-
- if (project)
- g_signal_connect (G_OBJECT (project), "notify::format",
- G_CALLBACK (renderer_format_changed), gwidget);
-
- g_object_set_data (G_OBJECT (gwidget), "renderer-project-ptr", project);
-}
-
void
glade_gtk_cell_renderer_deep_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
@@ -10718,11 +9958,7 @@ glade_gtk_cell_renderer_deep_post_create (GladeWidgetAdaptor *adaptor,
}
}
- g_signal_connect (G_OBJECT (widget), "notify::project",
- G_CALLBACK (renderer_project_changed), NULL);
-
- renderer_project_changed (widget, NULL, NULL);
-
+ g_idle_add ((GSourceFunc)glade_gtk_cell_renderer_sync_attributes, widget->object);
}
GladeEditorProperty *
@@ -10892,8 +10128,7 @@ glade_gtk_cell_renderer_write_widget (GladeWidgetAdaptor *adaptor,
GladeXmlContext *context,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* Write our normal properties, then chain up to write any other normal properties,
@@ -10946,8 +10181,7 @@ glade_gtk_cell_renderer_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* First chain up and read in all the properties... */
@@ -11122,8 +10356,7 @@ glade_gtk_cell_layout_read_child (GladeWidgetAdaptor *adaptor,
internal_name = glade_xml_get_property_string (node, GLADE_XML_TAG_INTERNAL_CHILD);
if ((widget_node =
- glade_xml_search_child
- (node, GLADE_XML_TAG_WIDGET(glade_project_get_format(widget->project)))) != NULL)
+ glade_xml_search_child (node, GLADE_XML_TAG_WIDGET)) != NULL)
{
if (internal_name)
@@ -11606,8 +10839,7 @@ glade_gtk_adjustment_write_widget (GladeWidgetAdaptor *adaptor,
{
GladeProperty *prop;
- if (!glade_xml_node_verify
- (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
+ if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
return;
/* Ensure proper order of adjustment properties by writing them here. */
@@ -11721,8 +10953,7 @@ glade_gtk_action_group_read_child (GladeWidgetAdaptor *adaptor,
return;
if ((widget_node =
- glade_xml_search_child
- (node, GLADE_XML_TAG_WIDGET(glade_project_get_format(widget->project)))) != NULL)
+ glade_xml_search_child (node, GLADE_XML_TAG_WIDGET)) != NULL)
{
if ((child_widget = glade_widget_read (widget->project,
widget, widget_node,
diff --git a/plugins/gtk+/glade-image-item-editor.c b/plugins/gtk+/glade-image-item-editor.c
index 0bbc8ca..531437f 100644
--- a/plugins/gtk+/glade-image-item-editor.c
+++ b/plugins/gtk+/glade-image-item-editor.c
@@ -280,17 +280,10 @@ custom_toggled (GtkWidget *widget,
property = glade_widget_get_property (loaded, "image");
- if (glade_project_get_format (loaded->project) == GLADE_PROJECT_FORMAT_LIBGLADE)
- image = glade_command_create (glade_widget_adaptor_get_by_type (GTK_TYPE_IMAGE),
- item_editor->loaded_widget, NULL,
- glade_widget_get_project (loaded));
- else
- {
- image = glade_command_create (glade_widget_adaptor_get_by_type (GTK_TYPE_IMAGE),
- NULL, NULL, glade_widget_get_project (loaded));
+ image = glade_command_create (glade_widget_adaptor_get_by_type (GTK_TYPE_IMAGE),
+ NULL, NULL, glade_widget_get_project (loaded));
- glade_command_set_property (property, image->object);
- }
+ glade_command_set_property (property, image->object);
/* Make sure nobody deletes this... */
glade_command_lock_widget (loaded, image);
diff --git a/plugins/gtk+/glade-model-data.c b/plugins/gtk+/glade-model-data.c
index 96a81ca..993c31d 100644
--- a/plugins/gtk+/glade-model-data.c
+++ b/plugins/gtk+/glade-model-data.c
@@ -676,7 +676,6 @@ value_i18n_activate (GladeCellRendererIcon *cell,
GNode *data_tree = NULL;
GladeModelData *data;
gchar *new_text;
- gboolean has_context_dummy;
if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (eprop_data->store), &iter, path))
return;
@@ -699,11 +698,9 @@ value_i18n_activate (GladeCellRendererIcon *cell,
new_text = g_value_dup_string (&data->value);
if (glade_editor_property_show_i18n_dialog (NULL,
- GLADE_PROJECT_FORMAT_GTKBUILDER,
&new_text,
&data->i18n_context,
&data->i18n_comment,
- &has_context_dummy,
&data->i18n_translatable))
{
g_value_set_string (&data->value, new_text);
@@ -793,7 +790,7 @@ enum_flags_format_cell_data (GtkCellLayout *cell_layout,
gtk_tree_model_get_value (tree_model, iter,
NUM_COLUMNS + colnum, &value);
- string = glade_utils_string_from_value (&value, GLADE_PROJECT_FORMAT_GTKBUILDER);
+ string = glade_utils_string_from_value (&value);
g_object_set (cell, "text", string && string[0] ?
glade_get_displayable_value (G_VALUE_TYPE (&value), string) : "", NULL);
diff --git a/plugins/gtk+/glade-tool-button-editor.c b/plugins/gtk+/glade-tool-button-editor.c
index 49c41fa..fa71a53 100644
--- a/plugins/gtk+/glade-tool-button-editor.c
+++ b/plugins/gtk+/glade-tool-button-editor.c
@@ -145,9 +145,6 @@ glade_tool_button_editor_load (GladeEditable *editable,
case GLADE_TB_MODE_ICON:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_editor->icon_radio), TRUE);
break;
- case GLADE_TB_MODE_FILENAME:
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_editor->file_radio), TRUE);
- break;
case GLADE_TB_MODE_CUSTOM:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_editor->custom_radio), TRUE);
break;
@@ -306,40 +303,6 @@ icon_toggled (GtkWidget *widget,
}
static void
-file_toggled (GtkWidget *widget,
- GladeToolButtonEditor *button_editor)
-{
- GladeProperty *property;
-
- if (button_editor->loading || !button_editor->loaded_widget)
- return;
-
- if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_editor->file_radio)))
- return;
-
- button_editor->modifying = TRUE;
-
- glade_command_push_group (_("Setting %s to use an image from the icon theme"), button_editor->loaded_widget->name);
-
- property = glade_widget_get_property (button_editor->loaded_widget, "stock-id");
- glade_command_set_property (property, NULL);
- property = glade_widget_get_property (button_editor->loaded_widget, "icon-name");
- glade_command_set_property (property, NULL);
- property = glade_widget_get_property (button_editor->loaded_widget, "icon-widget");
- glade_command_set_property (property, NULL);
- property = glade_widget_get_property (button_editor->loaded_widget, "image-mode");
- glade_command_set_property (property, GLADE_TB_MODE_FILENAME);
-
- glade_command_pop_group ();
-
- button_editor->modifying = FALSE;
-
- /* reload buttons and sensitivity and stuff... */
- glade_editable_load (GLADE_EDITABLE (button_editor),
- button_editor->loaded_widget);
-}
-
-static void
custom_toggled (GtkWidget *widget,
GladeToolButtonEditor *button_editor)
{
@@ -524,17 +487,6 @@ glade_tool_button_editor_new (GladeWidgetAdaptor *adaptor,
table_attach (table, GTK_WIDGET (eprop), 1, 1);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
- /* Filename... */
- eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "icon", FALSE, TRUE);
- hbox = gtk_hbox_new (FALSE, 0);
- button_editor->file_radio = gtk_radio_button_new_from_widget
- (GTK_RADIO_BUTTON (button_editor->stock_radio));
- gtk_box_pack_start (GTK_BOX (hbox), button_editor->file_radio, FALSE, FALSE, 2);
- gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
- table_attach (table, hbox, 0, 2);
- table_attach (table, GTK_WIDGET (eprop), 1, 2);
- button_editor->properties = g_list_prepend (button_editor->properties, eprop);
-
/* Custom embedded image widget... */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "icon-widget", FALSE, TRUE);
hbox = gtk_hbox_new (FALSE, 0);
@@ -542,8 +494,8 @@ glade_tool_button_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (button_editor->stock_radio));
gtk_box_pack_start (GTK_BOX (hbox), button_editor->custom_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
- table_attach (table, hbox, 0, 3);
- table_attach (table, GTK_WIDGET (eprop), 1, 3);
+ table_attach (table, hbox, 0, 2);
+ table_attach (table, GTK_WIDGET (eprop), 1, 2);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
/* Connect radio button signals... */
@@ -555,8 +507,6 @@ glade_tool_button_editor_new (GladeWidgetAdaptor *adaptor,
G_CALLBACK (stock_toggled), button_editor);
g_signal_connect (G_OBJECT (button_editor->icon_radio), "toggled",
G_CALLBACK (icon_toggled), button_editor);
- g_signal_connect (G_OBJECT (button_editor->file_radio), "toggled",
- G_CALLBACK (file_toggled), button_editor);
g_signal_connect (G_OBJECT (button_editor->custom_radio), "toggled",
G_CALLBACK (custom_toggled), button_editor);
diff --git a/plugins/gtk+/glade-tool-button-editor.h b/plugins/gtk+/glade-tool-button-editor.h
index aa29cb4..21bc122 100644
--- a/plugins/gtk+/glade-tool-button-editor.h
+++ b/plugins/gtk+/glade-tool-button-editor.h
@@ -39,7 +39,6 @@ typedef struct _GladeToolButtonEditorClass GladeToolButtonEditorClass;
typedef enum {
GLADE_TB_MODE_STOCK = 0, /* default */
GLADE_TB_MODE_ICON,
- GLADE_TB_MODE_FILENAME,
GLADE_TB_MODE_CUSTOM
} GladeToolButtonImageMode;
@@ -60,7 +59,6 @@ struct _GladeToolButtonEditor
GtkWidget *image_table;
GtkWidget *stock_radio; /* Create the image from stock-id */
GtkWidget *icon_radio; /* Create the image with the icon theme */
- GtkWidget *file_radio; /* Create the image from filename (libglade only) */
GtkWidget *custom_radio; /* Set a widget to be used in the image position */
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 79226da..15ce5f1 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1,12 +1,10 @@
<glade-catalog name="gtk+"
version="2.20"
targetable="2.18,2.16,2.14,2.12,2.10,2.8"
- supports="libglade,gtkbuilder"
icon-prefix="gtk"
library="gladegtk"
domain="glade3"
book="gtk">
- <project-convert-function>glade_gtk_project_convert</project-convert-function>
<glade-widget-classes>
<glade-widget-class name="GtkWidget" _title="Widget" default-width="100" default-height="60">
@@ -51,26 +49,15 @@
</actions>
<properties>
- <!-- Disable tooltip-text & tooltip-markup in libglade since we do
- conversions of the "tooltip" fake property -->
- <property id="tooltip-text" since="2.12" weight="4.2" translatable="True" libglade-unsupported="True">
+ <property id="tooltip-text" since="2.12" weight="4.2" translatable="True" >
<visible-lines>2</visible-lines>
</property>
- <property id="tooltip-markup" since="2.12" weight="4.1" libglade-unsupported="True"/>
+ <property id="tooltip-markup" since="2.12" weight="4.1"/>
<property id="visible" default="True" common="True" ignore="True"/>
<property id="width-request" common="True" optional="True" optional-default="False" default="0"/>
<property id="height-request" common="True" optional="True" optional-default="False" default="0"/>
<property id="no-show-all" weight="4.6" ignore="True"/>
- <property common="True" id="tooltip" _name="Tooltip" default="" translatable="True" weight="4.5"
- libglade-only="True">
- <parameter-spec>
- <type>GParamString</type>
- </parameter-spec>
- <_tooltip>A tooltip text for this widget</_tooltip>
- <visible-lines>2</visible-lines>
- </property>
-
<property common="True" id="extension-events">
<displayable-values>
<value id="GDK_EXTENSION_EVENTS_NONE" _name="None"/>
@@ -428,7 +415,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkMenuShell" _title="Menu Shell" use-placeholders="False" gtkbuilder-since="2.16">
+ <glade-widget-class name="GtkMenuShell" _title="Menu Shell" use-placeholders="False" since="2.16">
<post-create-function>empty</post-create-function>
<add-child-function>glade_gtk_menu_shell_add_child</add-child-function>
<remove-child-function>glade_gtk_menu_shell_remove_child</remove-child-function>
@@ -452,7 +439,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item" use-placeholders="False"
- gtkbuilder-since="2.16">
+ since="2.16">
<constructor-function>glade_gtk_menu_item_constructor</constructor-function>
<post-create-function>glade_gtk_menu_item_post_create</post-create-function>
<get-children-function>glade_gtk_menu_item_get_children</get-children-function>
@@ -460,7 +447,6 @@ embedded in another object</_tooltip>
<add-child-function>glade_gtk_menu_item_add_child</add-child-function>
<remove-child-function>glade_gtk_menu_item_remove_child</remove-child-function>
<action-activate-function>glade_gtk_menu_item_action_activate</action-activate-function>
- <write-child-function>glade_gtk_menu_item_write_child</write-child-function>
<create-editable-function>glade_gtk_activatable_create_editable</create-editable-function>
<special-child-type>submenu</special-child-type>
@@ -471,8 +457,8 @@ embedded in another object</_tooltip>
<property id="accel-path" since="2.14"/>
<property id="right-justified" since="2.14"/>
<property id="width-chars" since="2.14"/>
- <property id="label" _name="Label" translatable="True" gtkbuilder-since="2.16"/>
- <property id="use-underline" _name="Use Underline" gtkbuilder-since="2.16"/>
+ <property id="label" _name="Label" translatable="True" since="2.16"/>
+ <property id="use-underline" _name="Use Underline" since="2.16"/>
<!-- GtkActivatable -->
<property id="related-action" _name="Related Action" custom-layout="True" since="2.16"/>
@@ -494,15 +480,13 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkImageMenuItem" generic-name="imagemenuitem" _title="Image Menu Item">
<read-widget-function>glade_gtk_image_menu_item_read_widget</read-widget-function>
<write-widget-function>glade_gtk_image_menu_item_write_widget</write-widget-function>
- <read-child-function>glade_gtk_image_menu_item_read_child</read-child-function>
- <write-child-function>glade_gtk_image_menu_item_write_child</write-child-function>
<set-property-function>glade_gtk_image_menu_item_set_property</set-property-function>
<get-children-function>glade_gtk_image_menu_item_get_children</get-children-function>
<add-child-function>glade_gtk_image_menu_item_add_child</add-child-function>
<remove-child-function>glade_gtk_image_menu_item_remove_child</remove-child-function>
<create-editable-function>glade_gtk_image_menu_item_create_editable</create-editable-function>
<properties>
- <property id="use-stock" default="True" visible="False" save-always="True" gtkbuilder-since="2.16"/>
+ <property id="use-stock" default="True" visible="False" save-always="True" since="2.16"/>
<property id="stock" stock="True" _name="Stock Item" save="False" custom-layout="True">
<parameter-spec>
<type>GParamString</type>
@@ -512,16 +496,8 @@ embedded in another object</_tooltip>
<!-- We save the label manually with the stock value if use_stock is set. -->
<property id="label" save="False" custom-layout="True"/>
<property id="use-underline" custom-layout="True"/>
- <property id="image" libglade-unsupported="True" parentless-widget="True" visible="False"/>
- <property id="accel-group" _name="Accel Group" custom-layout="True" since="2.16" libglade-unsupported="True"/>
- <!--
- This property is added by glade2 gnome support and makes reference to
- GNOMEUIINFO_MENU_* macros. The read-widget-funcion maps these properties to
- existing non deprecated gtk ones at load time.
- -->
- <property id="stock-item" ignore="True" visible="False" save="False">
- <spec>glade_gtk_gnome_ui_info_spec</spec>
- </property>
+ <property id="image" parentless-widget="True" visible="False"/>
+ <property id="accel-group" _name="Accel Group" custom-layout="True" since="2.16" />
</properties>
</glade-widget-class>
@@ -665,18 +641,9 @@ embedded in another object</_tooltip>
<_tooltip>The stock icon displayed on the item (choose an item from GTK+ stock or from an icon factory)</_tooltip>
</property>
<property id="label" translatable="True" default="toolbutton" custom-layout="True"/>
- <property id="label-widget" parentless-widget="True" libglade-unsupported="True"
- create-type="GtkLabel" custom-layout="True"/>
+ <property id="label-widget" parentless-widget="True" create-type="GtkLabel" custom-layout="True"/>
<property id="icon-name" themed-icon="True" custom-layout="True"/>
- <property id="icon" libglade-only="True" _name="Icon" custom-layout="True">
- <parameter-spec>
- <type>GParamObject</type>
- <value-type>GdkPixbuf</value-type>
- </parameter-spec>
- <_tooltip>A file name, full or relative path to load an icon for this toolbutton</_tooltip>
- </property>
- <property id="icon-widget" parentless-widget="True" libglade-unsupported="True"
- create-type="GtkImage" custom-layout="True"/>
+ <property id="icon-widget" parentless-widget="True" create-type="GtkImage" custom-layout="True"/>
</properties>
</glade-widget-class>
@@ -748,7 +715,7 @@ embedded in another object</_tooltip>
<visible-lines>2</visible-lines>
</property>
<property id="glade-attributes" _name="Attributes" save="False" custom-layout="True"
- libglade-unsupported="True" gtkbuilder-since="2.16">
+ since="2.16">
<parameter-spec>
<type>GParamBoxed</type>
<value-type>GladeAttrGList</value-type>
@@ -815,7 +782,7 @@ embedded in another object</_tooltip>
<properties>
<property id="can-focus" save-always="True"/>
<property id="text" translatable="True" custom-layout="True"/>
- <property id="buffer" libglade-unsupported="True" create-type="GtkEntryBuffer" since="2.18" custom-layout="True"/>
+ <property id="buffer" create-type="GtkEntryBuffer" since="2.18" custom-layout="True"/>
<property id="inner-border" since="2.10"/>
<property id="truncate-multiline" since="2.10"/>
@@ -881,14 +848,6 @@ embedded in another object</_tooltip>
<set-property-function>glade_gtk_text_view_set_property</set-property-function>
<properties>
- <!-- Text of the textview -->
- <property id="text" _name="Text" translatable="True" libglade-only="True">
- <parameter-spec>
- <type>GParamString</type>
- </parameter-spec>
- <_tooltip>Set the text in the view's text buffer</_tooltip>
- <visible-lines>2</visible-lines>
- </property>
<property id="im-module" disabled="True"/>
<property id="wrap-mode">
<displayable-values>
@@ -898,7 +857,6 @@ embedded in another object</_tooltip>
<value id="GTK_WRAP_WORD_CHAR" _name="Word Character"/>
</displayable-values>
</property>
- <property id="buffer" libglade-unsupported="True"/>
</properties>
</glade-widget-class>
@@ -912,8 +870,7 @@ embedded in another object</_tooltip>
<properties>
<property id="can-focus" save-always="True"/>
<property id="receives-default" save-always="True"/>
- <property id="image" parentless-widget="True" create-type="GtkImage"
- libglade-unsupported="True" custom-layout="True"/>
+ <property id="image" parentless-widget="True" create-type="GtkImage" custom-layout="True"/>
<property id="use-stock" visible="False" custom-layout="True"/>
<property id="label" default="button" translatable="True" custom-layout="True" save="False">
<visible-lines>2</visible-lines>
@@ -1032,7 +989,7 @@ embedded in another object</_tooltip>
<properties>
<property id="title" translatable="True"/>
<property id="size" disabled="True"/>
- <property id="dialog" parentless-widget="True" create-type="GtkFileChooserDialog" libglade-unsupported="True"/>
+ <property id="dialog" parentless-widget="True" create-type="GtkFileChooserDialog" />
<property id="focus-on-click" since="2.10"/>
<property id="action">
<displayable-values>
@@ -1042,9 +999,6 @@ embedded in another object</_tooltip>
<value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" _name="Create Folder"/>
</displayable-values>
</property>
- <property id="extra-widget" parentless-widget="True" libglade-unsupported="True"/>
- <property id="preview-widget" parentless-widget="True" libglade-unsupported="True"/>
- <property id="filter" libglade-unsupported="True"/>
<property id="create-folders" since="2.18"/>
<property id="select-multiple" disabled="True"/>
</properties>
@@ -1073,9 +1027,8 @@ embedded in another object</_tooltip>
<post-create-function>glade_gtk_file_chooser_widget_post_create</post-create-function>
<properties>
<property id="size" default="1" query="False" />
- <property id="extra-widget" parentless-widget="True" libglade-unsupported="True"/>
- <property id="preview-widget" parentless-widget="True" libglade-unsupported="True"/>
- <property id="filter" libglade-unsupported="True"/>
+ <property id="extra-widget" parentless-widget="True" />
+ <property id="preview-widget" parentless-widget="True" />
<property id="create-folders" since="2.18"/>
</properties>
@@ -1135,19 +1088,12 @@ embedded in another object</_tooltip>
<signal id="popup" since="2.12"/>
</signals>
<properties>
- <property id="model" libglade-unsupported="True" create-type="GtkListStore"/>
+ <property id="model" create-type="GtkListStore"/>
<property id="popup-shown" since="2.10"/>
<property id="tearoff-title" since="2.10"/>
<property id="active" ignore="True"/>
<property id="column-span-column" ignore="True"/>
<property id="row-span-column" ignore="True"/>
- <property id="items" _name="Items" translatable="True" libglade-only="True">
- <parameter-spec>
- <type>GParamBoxed</type>
- <value-type>GStrv</value-type>
- </parameter-spec>
- <_tooltip>The items in this combo box</_tooltip>
- </property>
<property id="button-sensitivity">
<displayable-values>
<value id="GTK_SENSITIVITY_AUTO" _name="Automatic"/>
@@ -1427,8 +1373,6 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkMenu" generic-name="menu" _title="Popup Menu" toplevel="True">
<constructor-function>glade_gtk_menu_constructor</constructor-function>
- <!-- Set special-child-type at load time for libglade projects -->
- <read-widget-function>glade_gtk_menu_read_widget</read-widget-function>
<!-- We do not want glade_gtk_container_post_create be executed -->
<post-create-function>empty</post-create-function>
<actions>
@@ -1781,7 +1725,7 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkRecentChooserDialog" generic-name="recentchooserdialog" _title="Recent Chooser Dialog"/>
<!-- Objects -->
- <glade-widget-class name="GtkSizeGroup" generic-name="sizegroup" _title="Size Group" libglade-unsupported="True" toplevel="True">
+ <glade-widget-class name="GtkSizeGroup" generic-name="sizegroup" _title="Size Group" toplevel="True">
<depends-function>glade_gtk_size_group_depends</depends-function>
<read-widget-function>glade_gtk_size_group_read_widget</read-widget-function>
<write-widget-function>glade_gtk_size_group_write_widget</write-widget-function>
@@ -1806,11 +1750,11 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkWindowGroup" generic-name="windowgroup"
- _title="Window Group" libglade-unsupported="True" toplevel="True"/>
+ _title="Window Group" toplevel="True"/>
<glade-widget-class name="GtkAccelGroup" generic-name="accelgroup"
- _title="Accel Group" libglade-unsupported="True" toplevel="True"/>
+ _title="Accel Group" toplevel="True"/>
<glade-widget-class name="GtkAdjustment" generic-name="adjustment"
- _title="Adjustment" libglade-unsupported="True" toplevel="True">
+ _title="Adjustment" toplevel="True">
<write-widget-function>glade_gtk_adjustment_write_widget</write-widget-function>
<properties>
<property id="value" default="0.0" save="False"/>
@@ -1822,8 +1766,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkAction" generic-name="action" _title="Action"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkAction" generic-name="action" _title="Action">
<post-create-function>glade_gtk_action_post_create</post-create-function>
<create-editor-property-function>glade_gtk_widget_create_eprop</create-editor-property-function>
<string-from-value-function>glade_gtk_widget_string_from_value</string-from-value-function>
@@ -1850,15 +1793,12 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkToggleAction" generic-name="toggleaction" _title="Toggle Action"
- libglade-unsupported="True"/>
- <glade-widget-class name="GtkRadioAction" generic-name="radioaction" _title="Radio Action"
- libglade-unsupported="True"/>
- <glade-widget-class name="GtkRecentAction" generic-name="recentaction" _title="Recent Action"
- libglade-unsupported="True" since="2.12"/>
+ <glade-widget-class name="GtkToggleAction" generic-name="toggleaction" _title="Toggle Action" />
+ <glade-widget-class name="GtkRadioAction" generic-name="radioaction" _title="Radio Action" />
+ <glade-widget-class name="GtkRecentAction" generic-name="recentaction" _title="Recent Action" since="2.12"/>
<glade-widget-class name="GtkActionGroup" generic-name="actiongroup" _title="Action Group"
- libglade-unsupported="True" toplevel="True" use-placeholders="False">
+ toplevel="True" use-placeholders="False">
<add-child-function>glade_gtk_action_group_add_child</add-child-function>
<remove-child-function>glade_gtk_action_group_remove_child</remove-child-function>
<get-children-function>glade_gtk_action_group_get_children</get-children-function>
@@ -1868,10 +1808,10 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkEntryCompletion" generic-name="entrycompletion" _title="Entry Completion"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
<glade-widget-class name="GtkIconFactory" generic-name="iconfactory" _title="Icon Factory"
- libglade-unsupported="True" toplevel="True">
+ toplevel="True">
<post-create-function>glade_gtk_icon_factory_post_create</post-create-function>
<read-widget-function>glade_gtk_icon_factory_read_widget</read-widget-function>
<write-widget-function>glade_gtk_icon_factory_write_widget</write-widget-function>
@@ -1891,7 +1831,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkListStore" generic-name="liststore" _title="List Store"
- libglade-unsupported="True" toplevel="True">
+ toplevel="True">
<post-create-function>glade_gtk_store_post_create</post-create-function>
<set-property-function>glade_gtk_store_set_property</set-property-function>
<create-editor-property-function>glade_gtk_store_create_eprop</create-editor-property-function>
@@ -1918,7 +1858,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkTreeStore" generic-name="treestore" _title="Tree Store"
- libglade-unsupported="True" toplevel="True">
+ toplevel="True">
<set-property-function>glade_gtk_store_set_property</set-property-function>
<create-editor-property-function>glade_gtk_store_create_eprop</create-editor-property-function>
<create-editable-function>glade_gtk_store_create_editable</create-editable-function>
@@ -1944,11 +1884,11 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkTreeModelFilter" generic-name="treemodelfilter" _title="Tree Model Filter"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
<glade-widget-class name="GtkTreeModelSort" generic-name="treemodelsort" _title="Tree Model Sort"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
<glade-widget-class name="GtkTreeSelection" generic-name="treeselection" _title="Tree Selection"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
<glade-widget-class name="GtkTreeView" generic-name="treeview" _title="Tree View">
@@ -1977,9 +1917,7 @@ embedded in another object</_tooltip>
<value id="GTK_TREE_VIEW_GRID_LINES_BOTH" _name="Horizontal and Vertical"/>
</displayable-values>
</property>
- <property id="hadjustment" libglade-unsupported="True"/>
- <property id="vadjustment" libglade-unsupported="True"/>
- <property id="model" create-type="GtkListStore" query="True" libglade-unsupported="True"/>
+ <property id="model" create-type="GtkListStore" query="True" />
</properties>
<packing-properties>
@@ -1991,8 +1929,7 @@ embedded in another object</_tooltip>
</packing-properties>
</glade-widget-class>
- <glade-widget-class name="GtkTreeViewColumn" generic-name="treeviewcolumn" _title="Tree View Column"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkTreeViewColumn" generic-name="treeviewcolumn" _title="Tree View Column">
<add-child-function>glade_gtk_cell_layout_add_child</add-child-function>
<remove-child-function>glade_gtk_cell_layout_remove_child</remove-child-function>
<get-children-function>glade_gtk_cell_layout_get_children</get-children-function>
@@ -2048,7 +1985,7 @@ embedded in another object</_tooltip>
<property id="markup-column" disabled="True"/>
<property id="pixbuf-column" disabled="True"/>
<property id="reorderable" ignore="True"/>
- <property id="model" create-type="GtkListStore" query="True" libglade-unsupported="True"/>
+ <property id="model" create-type="GtkListStore" query="True" />
</properties>
<packing-properties>
@@ -2222,8 +2159,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererText" generic-name="cellrenderertext" _title="Text Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererText" generic-name="cellrenderertext" _title="Text Renderer" >
<properties>
<property id="editable-set" disabled="True"/>
<property id="ellipsize-set" disabled="True"/>
@@ -2679,8 +2615,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererAccel" generic-name="cellrendereraccel" _title="Accelerator Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererAccel" generic-name="cellrendereraccel" _title="Accelerator Renderer" >
<properties>
<property id="accel-key" save="False" custom-layout="True"/>
<property id="attr-accel-key" _name="Data column" save="False" default="-1" custom-layout="True">
@@ -2766,8 +2701,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererCombo" generic-name="cellrenderercombo" _title="Combo Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererCombo" generic-name="cellrenderercombo" _title="Combo Renderer" >
<signals>
<signal id="changed" since="2.14"/>
@@ -2819,8 +2753,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererSpin" generic-name="cellrendererspin" _title="Spin Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererSpin" generic-name="cellrendererspin" _title="Spin Renderer" >
<properties>
<property id="adjustment" save="False" custom-layout="True"/>
<property id="attr-adjustment" _name="Adjustment column" save="False" default="-1" custom-layout="True">
@@ -2866,8 +2799,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererPixbuf" generic-name="cellrendererpixbuf" _title="Pixbuf Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererPixbuf" generic-name="cellrendererpixbuf" _title="Pixbuf Renderer">
<properties>
<property id="gicon" disabled="True"/>
@@ -2988,8 +2920,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererProgress" generic-name="cellrendererprogress" _title="Progress Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererProgress" generic-name="cellrendererprogress" _title="Progress Renderer" >
<properties>
<property id="orientation" save="False" custom-layout="True"/>
<property id="attr-orientation" _name="Orientation column" save="False" default="-1" custom-layout="True">
@@ -3079,8 +3010,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererSpinner" generic-name="cellrendererspinner" _title="Spinner Renderer"
- libglade-unsupported="True" since="2.20">
+ <glade-widget-class name="GtkCellRendererSpinner" generic-name="cellrendererspinner" _title="Spinner Renderer" since="2.20">
<properties>
<property id="active" save="False" custom-layout="True"/>
<property id="attr-active" _name="Active column" save="False" default="-1" custom-layout="True">
@@ -3127,8 +3057,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkCellRendererToggle" generic-name="cellrenderertoggle" _title="Toggle Renderer"
- libglade-unsupported="True">
+ <glade-widget-class name="GtkCellRendererToggle" generic-name="cellrenderertoggle" _title="Toggle Renderer">
<properties>
<property id="activatable" save="False" custom-layout="True"/>
<property id="attr-activatable" _name="Activatable column" save="False" default="-1" custom-layout="True">
@@ -3203,8 +3132,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
- <glade-widget-class name="GtkStatusIcon" generic-name="statusicon" _title="Status Icon"
- libglade-unsupported="True" toplevel="True">
+ <glade-widget-class name="GtkStatusIcon" generic-name="statusicon" _title="Status Icon" toplevel="True">
<properties>
<property id="gicon" disabled="True" since="2.14"/>
<property id="title" since="2.18" translatable="True"/>
@@ -3213,8 +3141,7 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkTextBuffer" generic-name="textbuffer" _title="Text Buffer"
- libglade-unsupported="True" toplevel="True">
+ <glade-widget-class name="GtkTextBuffer" generic-name="textbuffer" _title="Text Buffer" toplevel="True">
<post-create-function>glade_gtk_text_buffer_post_create</post-create-function>
<set-property-function>glade_gtk_text_buffer_set_property</set-property-function>
<signals>
@@ -3229,7 +3156,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkEntryBuffer" generic-name="entrybuffer" _title="Entry Buffer"
- libglade-unsupported="True" toplevel="True" since="2.18">
+ toplevel="True" since="2.18">
<post-create-function>glade_gtk_entry_buffer_post_create</post-create-function>
<set-property-function>glade_gtk_entry_buffer_set_property</set-property-function>
<properties>
@@ -3240,8 +3167,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
- <glade-widget-class name="GtkTextTag" generic-name="texttag" _title="Text Tag"
- libglade-unsupported="True" toplevel="True">
+ <glade-widget-class name="GtkTextTag" generic-name="texttag" _title="Text Tag" toplevel="True">
<properties>
<property id="direction">
<displayable-values>
@@ -3254,10 +3180,10 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkTextTagTable" generic-name="texttagtable" _title="Text Tag Table"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
<glade-widget-class name="GtkFileFilter" generic-name="filefilter" _title="File Filter"
- libglade-unsupported="True" toplevel="True"/>
+ toplevel="True"/>
</glade-widget-classes>
diff --git a/src/glade-window.c b/src/glade-window.c
index fe832f9..a825372 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -550,7 +550,6 @@ refresh_notebook_tab_for_project (GladeWindow *window, GladeProject *project)
if (project == glade_design_view_get_project (GLADE_DESIGN_VIEW (view)))
{
- GladeProjectFormat fmt = glade_project_get_format (project);
gchar *path, *deps;
tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (window->priv->notebook), view);
@@ -572,12 +571,9 @@ refresh_notebook_tab_for_project (GladeWindow *window, GladeProject *project)
deps = glade_project_display_dependencies (project);
str = g_markup_printf_escaped (" <b>%s</b> %s \n"
" %s \n"
- " <b>%s</b> %s \n"
" <b>%s</b> %s ",
_("Name:"), path,
glade_project_get_readonly (project) ? READONLY_INDICATOR : "",
- _("Format:"),
- fmt == GLADE_PROJECT_FORMAT_GTKBUILDER ? "GtkBuilder" : "Libglade",
_("Requires:"), deps);
gtk_widget_set_tooltip_markup (eventbox, str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]