Commit 266771b1 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Added glade-widget-adaptor.[ch], removed glade-widget-class.[ch].


	Added glade-widget-adaptor.[ch], removed glade-widget-class.[ch].

	Modified most sources to cope with the major api change.
parent 8fddd5af
2006-10-18 Tristan Van Berkom <tvb@gnome.org>
* src/Makefile.am src/glade-app.c src/glade-base-editor.c
src/glade-catalog.c src/glade-catalog.h src/glade-clipboard-view.c
src/glade-clipboard.c src/glade-command.c src/glade-command.h
src/glade-cursor.c src/glade-editor-property.c
src/glade-editor.c src/glade-editor.h src/glade-fixed.c
src/glade-fixed.h src/glade-gnome.c src/glade-gtk.c
src/glade-palette-item.c src/glade-palette-item.h
src/glade-palette.c src/glade-palette.h
src/glade-placeholder.c src/glade-popup.c
src/glade-project-view.c src/glade-project.c
src/glade-property-class.c src/glade-property.c
src/glade-property.h src/glade-signal-editor.c
src/glade-signal-editor.h src/glade-signal.h src/glade-utils.c
src/glade-widget.c src/glade-widget.h src/glade.h src/main.c
widgets/bonobo.xml.in widgets/gnome.xml.in widgets/gtk+.xml.in:
Added glade-widget-adaptor.[ch], removed glade-widget-class.[ch].
Modified most sources to cope with the major api change.
2006-10-18 Vincent Geddes <vincent.geddes@gmail.com>
* Makefile.am: Update icon theme cache on uninstall.
......
......@@ -52,13 +52,13 @@ libgladegtkinclude_HEADERS = glade-gtk.h
# The glade-3 core library
libgladeui_1_la_SOURCES = \
glade-widget-adaptor.c \
glade-debug.c \
glade-project.c \
glade-parameter.c \
glade-placeholder.c \
glade-custom.c \
glade-project-view.c \
glade-widget-class.c \
glade-xml-utils.c \
glade-palette.c \
glade-palette-item.c \
......@@ -116,7 +116,7 @@ libgladeuiinclude_HEADERS = \
glade-palette-expander.h \
glade-cursor.h \
glade-widget.h \
glade-widget-class.h \
glade-widget-adaptor.h \
glade-property.h \
glade-property-class.h \
glade-popup.h \
......
......@@ -35,7 +35,6 @@
#include "glade-clipboard.h"
#include "glade-clipboard-view.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
#include "glade-property.h"
#include "glade-property-class.h"
#include "glade-project.h"
......@@ -264,19 +263,19 @@ glade_app_update_ui_default (GladeApp *app)
static void
on_palette_button_clicked (GladePalette *palette, GladeApp *app)
{
GladeWidgetClass *class;
GladeWidget *widget;
GladeWidgetAdaptor *adaptor;
GladeWidget *widget;
g_return_if_fail (GLADE_IS_PALETTE (palette));
class = glade_palette_get_current_item_class (palette);
adaptor = glade_palette_get_current_item (palette);
/* class may be NULL if the selector was pressed */
if (class && class->toplevel)
if (adaptor && GWA_IS_TOPLEVEL (adaptor))
{
widget = glade_command_create (class, NULL, NULL, app->priv->active_project);
widget = glade_command_create (adaptor, NULL, NULL, app->priv->active_project);
/* if this is a top level widget set the accel group */
if (app->priv->accel_group && GTK_IS_WINDOW (widget->object))
if (widget && app->priv->accel_group && GTK_IS_WINDOW (widget->object))
{
gtk_window_add_accel_group (GTK_WINDOW (widget->object),
app->priv->accel_group);
......
......@@ -211,8 +211,8 @@ glade_base_editor_fill_store_real (GladeBaseEditor *e,
GList *children, *l;
GtkTreeIter iter;
children = l = glade_widget_class_container_get_children (gwidget->widget_class,
G_OBJECT (widget));
children = l = glade_widget_adaptor_get_children (gwidget->adaptor,
G_OBJECT (widget));
while (l)
{
......@@ -1057,12 +1057,12 @@ glade_base_editor_change_type (GladeBaseEditor *editor,
GType type)
{
GladeBaseEditorPrivate *e = editor->priv;
GladeWidgetClass *klass = glade_widget_class_get_by_type (type);
GladeWidget *parent, *gchild_new;
GList list = {0, }, *children, *l;
GObject *child, *child_new;
GtkTreeIter iter;
gchar *name, *class_name;
GladeWidgetAdaptor *adaptor = glade_widget_adaptor_get_by_type (type);
GladeWidget *parent, *gchild_new;
GList list = {0, }, *children, *l;
GObject *child, *child_new;
GtkTreeIter iter;
gchar *name, *class_name;
if (glade_base_editor_get_type_info (editor, NULL, type,
GLADE_BASE_EDITOR_NAME, &class_name,
......@@ -1075,11 +1075,11 @@ glade_base_editor_change_type (GladeBaseEditor *editor,
glade_base_editor_find_child (editor, gchild, &iter);
/* Create new widget */
gchild_new = glade_command_create (klass, parent, NULL, e->project);
gchild_new = glade_command_create (adaptor, parent, NULL, e->project);
child_new = glade_widget_get_object (gchild_new);
/* Cut and Paste childrens */
if ((children = glade_widget_class_container_get_children (klass, child)))
if ((children = glade_widget_adaptor_get_children (adaptor, child)))
{
GList *gchildren = NULL;
......@@ -1151,7 +1151,7 @@ glade_base_editor_build_child (GladeBaseEditor *editor,
GladeWidget *gparent,
GType type)
{
return glade_command_create (glade_widget_class_get_by_type (type),
return glade_command_create (glade_widget_adaptor_get_by_type (type),
gparent, NULL,
glade_widget_get_project (gparent));
}
......
......@@ -35,7 +35,7 @@
#include "glade.h"
#include "glade-catalog.h"
#include "glade-widget-class.h"
#include "glade-widget-adaptor.h"
typedef void (*GladeCatalogInitFunc) (void);
......@@ -57,7 +57,7 @@ struct _GladeCatalog
*/
GList *widget_groups; /* List of widget groups (palette) */
GList *widget_classes; /* List of widget classes (all) */
GList *adaptors; /* List of widget class adaptors (all) */
GladeXmlContext *context;/* Xml context is stored after open
* before classes are loaded */
......@@ -75,7 +75,7 @@ struct _GladeWidgetGroup
gboolean expanded; /* Whether group is expanded in the palette */
GList *widget_classes; /* List of classes in the palette */
GList *adaptors; /* List of class adaptors in the palette */
};
static void catalog_load (GladeCatalog *catalog);
......@@ -263,20 +263,19 @@ catalog_load_classes (GladeCatalog *catalog, GladeXmlNode *widgets_node)
node = glade_xml_node_get_children (widgets_node);
for (; node; node = glade_xml_node_next (node))
{
const gchar *node_name;
GladeWidgetClass *widget_class;
const gchar *node_name;
GladeWidgetAdaptor *adaptor;
node_name = glade_xml_node_get_name (node);
if (strcmp (node_name, GLADE_TAG_GLADE_WIDGET_CLASS) != 0)
continue;
widget_class = glade_widget_class_new
adaptor = glade_widget_adaptor_from_catalog
(node, catalog->name, catalog->library,
catalog->domain ? catalog->domain : catalog->library,
catalog->book);
catalog->widget_classes = g_list_prepend (catalog->widget_classes,
widget_class);
catalog->adaptors = g_list_prepend (catalog->adaptors, adaptor);
}
return TRUE;
......@@ -319,38 +318,37 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
catalog->domain : catalog->library,
group->title);
group->widget_classes = NULL;
group->adaptors = NULL;
node = glade_xml_node_get_children (group_node);
for (; node; node = glade_xml_node_next (node))
{
const gchar *node_name;
GladeWidgetClass *widget_class;
gchar *name;
const gchar *node_name;
GladeWidgetAdaptor *adaptor;
gchar *name;
node_name = glade_xml_node_get_name (node);
if (strcmp (node_name, GLADE_TAG_GLADE_WIDGET_CLASS_REF) == 0)
{
name = glade_xml_get_property_string (node, GLADE_TAG_NAME);
if (!name)
if ((name =
glade_xml_get_property_string (node, GLADE_TAG_NAME)) == NULL)
{
g_warning ("Couldn't find required property on %s",
GLADE_TAG_GLADE_WIDGET_CLASS);
continue;
}
widget_class = glade_widget_class_get_by_name (name);
if (!widget_class)
if ((adaptor = glade_widget_adaptor_get_by_name (name)) == NULL)
{
g_warning ("Tried to include undefined widget class '%s' in a widget group", name);
g_warning ("Tried to include undefined widget "
"class '%s' in a widget group", name);
g_free (name);
continue;
}
g_free (name);
group->widget_classes = g_list_prepend (group->widget_classes,
widget_class);
group->adaptors = g_list_prepend (group->adaptors, adaptor);
}
else if (strcmp (node_name, GLADE_TAG_DEFAULT_PALETTE_STATE) == 0)
......@@ -361,7 +359,7 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
}
}
group->widget_classes = g_list_reverse (group->widget_classes);
group->adaptors = g_list_reverse (group->adaptors);
catalog->widget_groups = g_list_prepend (catalog->widget_groups,
group);
......@@ -378,7 +376,7 @@ widget_group_free (GladeWidgetGroup *group)
g_free (group->title);
/* The actual widget classes will be free elsewhere */
g_list_free (group->widget_classes);
g_list_free (group->adaptors);
}
GList *
......@@ -459,11 +457,11 @@ glade_catalog_get_widget_groups (GladeCatalog *catalog)
}
GList *
glade_catalog_get_widget_classes (GladeCatalog *catalog)
glade_catalog_get_adaptors (GladeCatalog *catalog)
{
g_return_val_if_fail (catalog != NULL, NULL);
return catalog->widget_classes;
return catalog->adaptors;
}
void
......@@ -478,10 +476,10 @@ glade_catalog_free (GladeCatalog *catalog)
if (catalog->book)
g_free (catalog->book);
for (list = catalog->widget_classes; list; list = list->next)
glade_widget_class_free (GLADE_WIDGET_CLASS (list->data));
for (list = catalog->adaptors; list; list = list->next)
g_object_unref (list->data);
g_list_free (catalog->widget_classes);
g_list_free (catalog->adaptors);
for (list = catalog->widget_groups; list; list = list->next)
widget_group_free (GLADE_WIDGET_GROUP (list->data));
......@@ -516,11 +514,11 @@ glade_widget_group_get_expanded (GladeWidgetGroup *group)
}
GList *
glade_widget_group_get_widget_classes (GladeWidgetGroup *group)
glade_widget_group_get_adaptors (GladeWidgetGroup *group)
{
g_return_val_if_fail (group != NULL, NULL);
return group->widget_classes;
return group->adaptors;
}
gboolean
......
......@@ -41,7 +41,7 @@ const gchar * glade_catalog_get_name (GladeCatalog *catalog);
LIBGLADEUI_API
GList * glade_catalog_get_widget_groups (GladeCatalog *catalog);
LIBGLADEUI_API
GList * glade_catalog_get_widget_classes (GladeCatalog *catalog);
GList * glade_catalog_get_adaptors (GladeCatalog *catalog);
LIBGLADEUI_API
void glade_catalog_free (GladeCatalog *catalog);
......@@ -53,7 +53,7 @@ const gchar * glade_widget_group_get_title (GladeWidgetGroup *group);
LIBGLADEUI_API
gboolean glade_widget_group_get_expanded (GladeWidgetGroup *group);
LIBGLADEUI_API
GList * glade_widget_group_get_widget_classes (GladeWidgetGroup *group);
GList * glade_widget_group_get_adaptors (GladeWidgetGroup *group);
LIBGLADEUI_API
void glade_widget_group_free (GladeWidgetGroup *group);
......
......@@ -32,7 +32,7 @@
#include "glade-clipboard.h"
#include "glade-clipboard-view.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
#include "glade-widget-adaptor.h"
#include "glade-popup.h"
......@@ -130,24 +130,28 @@ glade_clipboard_view_cell_function (GtkTreeViewColumn *tree_column,
GtkTreeIter *iter,
gpointer data)
{
gboolean is_icon = GPOINTER_TO_INT (data);
gboolean is_icon = GPOINTER_TO_INT (data);
GladeWidget *widget;
GdkPixbuf *pixbuf = NULL;
gtk_tree_model_get (tree_model, iter, 0, &widget, -1);
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (widget->name != NULL);
g_return_if_fail (widget->widget_class != NULL);
g_return_if_fail (widget->widget_class->small_icon != NULL);
g_object_get (widget->adaptor, "small-icon", &pixbuf, NULL);
g_return_if_fail (pixbuf != NULL);
if (is_icon)
g_object_set (G_OBJECT (cell),
"pixbuf", widget->widget_class->small_icon,
"pixbuf", pixbuf,
NULL);
else
g_object_set (G_OBJECT (cell),
"text", widget->name,
NULL);
g_object_unref (pixbuf);
}
static gint
......
......@@ -27,7 +27,6 @@
#include "glade-clipboard-view.h"
#include "glade-clipboard.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
#include "glade-placeholder.h"
#include "glade-project.h"
......
......@@ -31,7 +31,6 @@
#include "glade-project.h"
#include "glade-xml-utils.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
#include "glade-palette.h"
#include "glade-command.h"
#include "glade-property.h"
......@@ -1139,28 +1138,28 @@ glade_command_delete (GList *widgets)
/**
* glade_command_create:
* @class: the class of the widget (GtkWindow or GtkButton)
* @adaptor: A #GladeWidgetAdaptor
* @placeholder: the placeholder which will be substituted by the widget
* @project: the project his widget belongs to.
*
* Creates a new widget of @class and put in place of the @placeholder
* Creates a new widget using @adaptor and put in place of the @placeholder
* in the @project
*
* Returns the newly created widget.
*/
GladeWidget *
glade_command_create (GladeWidgetClass *class,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project)
glade_command_create (GladeWidgetAdaptor *adaptor,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project)
{
GladeCommandCreateDelete *me;
CommandData *cdata;
GladeWidget *widget;
g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
if (class->toplevel == FALSE)
if (GWA_IS_TOPLEVEL (adaptor) == FALSE)
g_return_val_if_fail (GLADE_IS_WIDGET (parent), NULL);
me = g_object_new (GLADE_COMMAND_CREATE_DELETE_TYPE, NULL);
......@@ -1173,10 +1172,10 @@ glade_command_create (GladeWidgetClass *class,
me->widgets = g_list_append (me->widgets, cdata);
widget = glade_widget_class_create_widget (class, TRUE,
"parent", parent,
"project", project,
NULL);
widget = glade_widget_adaptor_create_widget (adaptor, TRUE,
"parent", parent,
"project", project,
NULL);
/* widget may be null, e.g. the user clicked cancel on a query */
if ((cdata->widget = widget) == NULL)
......@@ -1675,8 +1674,8 @@ glade_command_cut_copy_paste_common (GList *widgets,
glade_command_placeholder_connect
(cdata, GLADE_PLACEHOLDER (child));
}
else if ((children = glade_widget_class_container_get_children
(cdata->parent->widget_class, cdata->parent->object)) != NULL)
else if ((children = glade_widget_adaptor_get_children
(cdata->parent->adaptor, cdata->parent->object)) != NULL)
{
for (l = children; l && l->data; l = l->next)
{
......
......@@ -96,12 +96,12 @@ void glade_command_set_name (GladeWidget *glade_widget, con
/************************ create/delete ******************************/
LIBGLADEUI_API
void glade_command_delete (GList *widgets);
void glade_command_delete (GList *widgets);
LIBGLADEUI_API
GladeWidget *glade_command_create (GladeWidgetClass *class,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project);
GladeWidget *glade_command_create (GladeWidgetAdaptor *adaptor,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project);
/************************ cut/copy/paste ******************************/
LIBGLADEUI_API
......
......@@ -24,7 +24,7 @@
#include "glade-app.h"
#include "glade-palette.h"
#include "glade-cursor.h"
#include "glade-widget-class.h"
#include "glade-widget-adaptor.h"
#include <glib.h>
#include <glib/gi18n.h>
......@@ -94,8 +94,8 @@ set_cursor (GdkCursor *gdk_cursor)
void
glade_cursor_set (GdkWindow *window, GladeCursorType type)
{
GladeWidgetClass *widget_class;
GdkCursor *the_cursor = NULL;
GladeWidgetAdaptor *adaptor;
GdkCursor *the_cursor = NULL;
g_return_if_fail (cursor != NULL);
switch (type) {
......@@ -104,20 +104,17 @@ glade_cursor_set (GdkWindow *window, GladeCursorType type)
gdk_window_set_cursor (window, cursor->selector);
break;
case GLADE_CURSOR_ADD_WIDGET:
widget_class = glade_palette_get_current_item_class (glade_app_get_palette ());
if (widget_class != NULL)
if ((adaptor =
glade_palette_get_current_item (glade_app_get_palette ())) != NULL)
{
if (widget_class->cursor != NULL)
the_cursor = widget_class->cursor;
else
g_object_get (adaptor, "cursor", &the_cursor, NULL);
if (the_cursor == NULL)
the_cursor = cursor->add_widget;
}
else
{
the_cursor = cursor->add_widget;
}
break;
case GLADE_CURSOR_RESIZE_TOP_LEFT:
the_cursor = cursor->resize_top_left;
......
......@@ -241,17 +241,20 @@ static void
glade_editor_property_info_clicked_cb (GtkWidget *info,
GladeEditorProperty *eprop)
{
GladeWidgetClass *wclass;
gchar *search;
GladeWidgetAdaptor *adaptor;
gchar *search, *book;
wclass = glade_widget_class_from_pclass (eprop->class);
search = g_strdup_printf ("The %s property", eprop->class->id);
adaptor = glade_widget_adaptor_from_pclass (eprop->class);
search = g_strdup_printf ("The %s property", eprop->class->id);
g_object_get (adaptor, "book", &book, NULL);
g_signal_emit (G_OBJECT (eprop),
glade_editor_property_signals[GTK_DOC_SEARCH],
0, wclass->book,
0, book,
g_type_name (eprop->class->pspec->owner_type), search);
g_free (book);
g_free (search);
}
......@@ -2123,7 +2126,7 @@ glade_eprop_object_populate_view_real (GladeEditorProperty *eprop,
(GLADE_PARAM_SPEC_OBJECTS(eprop->class->pspec)));
good_type =
glade_util_class_implements_interface
(widget->widget_class->type,
(widget->adaptor->type,
glade_param_spec_objects_get_type
(GLADE_PARAM_SPEC_OBJECTS(eprop->class->pspec)));
}
......@@ -2132,7 +2135,7 @@ glade_eprop_object_populate_view_real (GladeEditorProperty *eprop,
has_decendant = glade_widget_has_decendant
(widget, eprop->class->pspec->value_type);
good_type = g_type_is_a (widget->widget_class->type,
good_type = g_type_is_a (widget->adaptor->type,
eprop->class->pspec->value_type);
}
......@@ -2146,7 +2149,7 @@ glade_eprop_object_populate_view_real (GladeEditorProperty *eprop,
OBJ_COLUMN_WIDGET_NAME,
glade_eprop_object_name (widget->name, model, parent_iter),
OBJ_COLUMN_WIDGET_CLASS,
widget->widget_class->palette_name,
widget->adaptor->title,
/* Selectable if its a compatible type and
* its not itself.
*/
......@@ -2158,8 +2161,8 @@ glade_eprop_object_populate_view_real (GladeEditorProperty *eprop,
}
if (has_decendant &&
(children = glade_widget_class_container_get_children
(widget->widget_class, widget->object)) != NULL)
(children = glade_widget_adaptor_get_children
(widget->adaptor, widget->object)) != NULL)
{
GtkTreeIter *copy = NULL;
......@@ -2339,8 +2342,8 @@ glade_eprop_object_view (GladeEditorProperty *eprop,
static gchar *
glade_eprop_object_dialog_title (GladeEditorProperty *eprop)
{
GladeWidgetClass *klass;
const gchar *format =
GladeWidgetAdaptor *adaptor;
const gchar *format =
GLADE_IS_PARAM_SPEC_OBJECTS (eprop->class->pspec) ?
_("Choose %s implementors") : _("Choose a %s in this project");
......@@ -2348,10 +2351,10 @@ glade_eprop_object_dialog_title (GladeEditorProperty *eprop)
return g_strdup_printf (format, g_type_name
(glade_param_spec_objects_get_type
(GLADE_PARAM_SPEC_OBJECTS (eprop->class->pspec))));
else if ((klass =
glade_widget_class_get_by_type
else if ((adaptor =
glade_widget_adaptor_get_by_type
(eprop->class->pspec->value_type)) != NULL)
return g_strdup_printf (format, klass->palette_name);
return g_strdup_printf (format, adaptor->title);
/* Fallback on type name (which would look like "GtkButton"
* instead of "Button" and maybe not translated).
......@@ -3098,21 +3101,21 @@ static void
glade_eprop_accel_populate_view (GladeEditorProperty *eprop,
GtkTreeView *view)
{
GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
GladeSignalClass *sclass;
GladeWidgetClass *wclass = glade_widget_class_from_pclass (eprop->class);
GtkTreeStore *model = (GtkTreeStore *)gtk_tree_view_get_model (view);
GtkTreeIter iter;
GladeEpropIterTab *parent_tab;
GladeAccelInfo *info;
GList *list, *l, *found, *accelerators;
gchar *name;
GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
GladeSignalClass *sclass;
GladeWidgetAdaptor *adaptor = glade_widget_adaptor_from_pclass (eprop->class);
GtkTreeStore *model = (GtkTreeStore *)gtk_tree_view_get_model (view);
GtkTreeIter iter;
GladeEpropIterTab *parent_tab;
GladeAccelInfo *info;
GList *list, *l, *found, *accelerators;
gchar *name;
accelerators = g_value_get_boxed (eprop->property->value);
/* First make parent iters...
*/
for (list = wclass->signals; list; list = list->next)
for (list = adaptor->signals; list; list = list->next)
{
sclass = list->data;
......@@ -3143,7 +3146,7 @@ glade_eprop_accel_populate_view (GladeEditorProperty *eprop,
/* Now we populate...
*/
for (list = wclass->signals; list; list = list->next)
for (list = adaptor->signals; list; list = list->next)
{
sclass = list->data;
......@@ -3795,14 +3798,17 @@ glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
void
glade_editor_property_show_info (GladeEditorProperty *eprop)
{
GladeWidgetClass *wclass;
GladeWidgetAdaptor *adaptor;
gchar *book;
g_return_if_fail (GLADE_IS_EDITOR_PROPERTY (eprop));
wclass = glade_widget_class_from_pclass (eprop->class);
adaptor = glade_widget_adaptor_from_pclass (eprop->class);
g_object_get (adaptor, "book", &book, NULL);
if (eprop->class->virtual == FALSE &&
wclass->book != NULL)
book != NULL)
gtk_widget_show (eprop->info);
else
{
......@@ -3813,6 +3819,7 @@ glade_editor_property_show_info (GladeEditorProperty *eprop)
gtk_widget_set_sensitive (eprop->info, FALSE);
}
g_free (book);
eprop->show_info = TRUE;
g_object_notify (G_OBJECT (eprop), "show-info");
}
......
......@@ -31,7 +31,7 @@
#include "glade.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
#include "glade-widget-adaptor.h"
#include "glade-editor.h"
#include "glade-signal-editor.h"
#include "glade-parameter.h"
......@@ -254,11 +254,16 @@ static void
glade_editor_on_docs_click (GtkButton *button,
GladeEditor *editor)
{
gchar *book;
if (editor->loaded_widget)
{
g_object_get (editor->loaded_widget->adaptor, "book", &book, NULL);
g_signal_emit (G_OBJECT (editor),
glade_editor_signals[GTK_DOC_SEARCH],
0, editor->loaded_widget->widget_class->book,
editor->loaded_widget->widget_class->name, NULL);
0, book, editor->loaded_widget->adaptor->name, NULL);
g_free (book);
}
}
......@@ -508,7 +513,7 @@ glade_editor_table_append_class_field (GladeEditorTable *table)
gtk_widget_show (label);
class_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (class_entry), table->glade_widget_class->name);
gtk_entry_set_text (GTK_ENTRY (class_entry), table->adaptor->name);
gtk_editable_set_editable (GTK_EDITABLE (class_entry), FALSE);
gtk_widget_show (class_entry);
......@@ -538,11 +543,11 @@ glade_editor_property_class_comp (gconstpointer a, gconstpointer b)
}
static GList *
glade_editor_widget_class_get_sorted_properties (GladeWidgetClass *class)
glade_editor_get_sorted_properties (GladeWidgetAdaptor *adaptor)
{
GList *l, *a = NULL, *b = NULL;
for (l = class->properties; l && l->data; l = g_list_next (l))
for (l = adaptor->properties; l && l->data; l = g_list_next (l))
{
GladePropertyClass *class = l->data;
......@@ -559,15 +564,15 @@ glade_editor_widget_class_get_sorted_properties (GladeWidgetClass *class)
}
static gboolean
glade_editor_table_append_items (GladeEditorTable *table,
GladeWidgetClass *class,
GladeEditorTableType type)
glade_editor_table_append_items (GladeEditorTable *table,
GladeWidgetAdaptor *adaptor,
GladeEditorTableType type)
{
GladeEditorProperty *property;
GladePropertyClass *property_class;
GList *list, *sorted_list;
sorted_list = glade_editor_widget_class_get_sorted_properties (class);
sorted_list = glade_editor_get_sorted_properties (adaptor);
for (list = sorted_list; list != NULL; list = list->next)
{
......@@ -622,18 +627,18 @@ glade_editor_table_free (GladeEditorTable *etable)
}
static GladeEditorTable *
glade_editor_table_create (GladeEditor *editor,
GladeWidgetClass