inspector: Drop unused properties

The individual pages no longer need the object tree
to show object details, this works with the window
now.
This commit is contained in:
Matthias Clasen 2020-07-07 00:53:55 -04:00
parent 0b38a0663d
commit fe5b364675
6 changed files with 1 additions and 184 deletions

View File

@ -19,10 +19,10 @@
#include <glib/gi18n-lib.h>
#include "controllers.h"
#include "object-tree.h"
#include "gtkbinlayout.h"
#include "gtkdropdown.h"
#include "gtkbox.h"
#include "gtkcustomsorter.h"
#include "gtkflattenlistmodel.h"
#include "gtkframe.h"
@ -46,7 +46,6 @@ struct _GtkInspectorControllers
GtkWidget *listbox;
GtkPropertyLookupListModel *model;
GtkSizeGroup *sizegroup;
GtkInspectorObjectTree *object_tree;
};
struct _GtkInspectorControllersClass
@ -54,12 +53,6 @@ struct _GtkInspectorControllersClass
GtkWidgetClass parent_class;
};
enum
{
PROP_0,
PROP_OBJECT_TREE
};
G_DEFINE_TYPE (GtkInspectorControllers, gtk_inspector_controllers, GTK_TYPE_WIDGET)
static void
@ -270,46 +263,6 @@ gtk_inspector_controllers_set_object (GtkInspectorControllers *self,
g_object_unref (map_model);
}
static void
gtk_inspector_controllers_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
GtkInspectorControllers *self = GTK_INSPECTOR_CONTROLLERS (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
g_value_take_object (value, self->object_tree);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
gtk_inspector_controllers_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GtkInspectorControllers *self = GTK_INSPECTOR_CONTROLLERS (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
self->object_tree = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
gtk_inspector_controllers_dispose (GObject *object)
{
@ -326,14 +279,8 @@ gtk_inspector_controllers_class_init (GtkInspectorControllersClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gtk_inspector_controllers_get_property;
object_class->set_property = gtk_inspector_controllers_set_property;
object_class->dispose= gtk_inspector_controllers_dispose;
g_object_class_install_property (object_class, PROP_OBJECT_TREE,
g_param_spec_object ("object-tree", "Widget Tree", "Widget tree",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}

View File

@ -20,8 +20,6 @@
#include "list-data.h"
#include "object-tree.h"
#include "gtkcolumnview.h"
#include "gtktogglebutton.h"
#include "gtklabel.h"
@ -38,7 +36,6 @@ struct _GtkInspectorListData
{
GtkWidget parent_instance;
GtkInspectorObjectTree *object_tree;
GListModel *object;
GtkColumnView *view;
GtkWidget *items_label;
@ -49,12 +46,6 @@ struct _GtkInspectorListDataClass
GtkWidgetClass parent_class;
};
enum
{
PROP_0,
PROP_OBJECT_TREE,
};
G_DEFINE_TYPE (GtkInspectorListData, gtk_inspector_list_data, GTK_TYPE_WIDGET)
static void
@ -195,46 +186,6 @@ unbind_props (GtkSignalListItemFactory *factory,
g_signal_handlers_disconnect_by_func (gtk_list_item_get_child (item), object_properties, item);
}
static void
get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
g_value_take_object (value, sl->object_tree);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
sl->object_tree = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
finalize (GObject *object)
{
@ -252,12 +203,6 @@ gtk_inspector_list_data_class_init (GtkInspectorListDataClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = finalize;
object_class->get_property = get_property;
object_class->set_property = set_property;
g_object_class_install_property (object_class, PROP_OBJECT_TREE,
g_param_spec_object ("object-tree", "Object Tree", "Object tree",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/list-data.ui");
gtk_widget_class_bind_template_child (widget_class, GtkInspectorListData, view);

View File

@ -20,7 +20,6 @@
#include "misc-info.h"
#include "window.h"
#include "object-tree.h"
#include "type-info.h"
#include "gtktypebuiltins.h"
@ -35,8 +34,6 @@
struct _GtkInspectorMiscInfoPrivate {
GtkInspectorObjectTree *object_tree;
GObject *object;
GtkWidget *swin;
@ -91,12 +88,6 @@ struct _GtkInspectorMiscInfoPrivate {
gint64 last_frame;
};
enum
{
PROP_0,
PROP_OBJECT_TREE
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorMiscInfo, gtk_inspector_misc_info, GTK_TYPE_WIDGET)
static gchar *
@ -531,46 +522,6 @@ unmap (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_inspector_misc_info_parent_class)->unmap (widget);
}
static void
get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
GtkInspectorMiscInfo *sl = GTK_INSPECTOR_MISC_INFO (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
g_value_take_object (value, sl->priv->object_tree);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GtkInspectorMiscInfo *sl = GTK_INSPECTOR_MISC_INFO (object);
switch (param_id)
{
case PROP_OBJECT_TREE:
sl->priv->object_tree = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
dispose (GObject *o)
{
@ -587,17 +538,11 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;
widget_class->map = map;
widget_class->unmap = unmap;
g_object_class_install_property (object_class, PROP_OBJECT_TREE,
g_param_spec_object ("object-tree", "Object Tree", "Object tree",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/misc-info.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, swin);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, address);

View File

@ -21,7 +21,6 @@
#include "prop-editor.h"
#include "strv-editor.h"
#include "object-tree.h"
#include "prop-list.h"
#include "gtkactionable.h"

View File

@ -27,7 +27,6 @@
#include "prop-list.h"
#include "prop-editor.h"
#include "object-tree.h"
#include "gtkcelllayout.h"
#include "gtktreeview.h"
@ -50,7 +49,6 @@
enum
{
PROP_0,
PROP_OBJECT_TREE,
PROP_SEARCH_ENTRY
};
@ -58,7 +56,6 @@ struct _GtkInspectorPropListPrivate
{
GObject *object;
gulong notify_handler_id;
GtkInspectorObjectTree *object_tree;
GtkWidget *search_entry;
GtkWidget *search_stack;
GtkWidget *list;
@ -157,10 +154,6 @@ get_property (GObject *object,
switch (param_id)
{
case PROP_OBJECT_TREE:
g_value_take_object (value, pl->priv->object_tree);
break;
case PROP_SEARCH_ENTRY:
g_value_take_object (value, pl->priv->search_entry);
break;
@ -181,10 +174,6 @@ set_property (GObject *object,
switch (param_id)
{
case PROP_OBJECT_TREE:
pl->priv->object_tree = g_value_get_object (value);
break;
case PROP_SEARCH_ENTRY:
pl->priv->search_entry = g_value_get_object (value);
break;
@ -437,10 +426,6 @@ gtk_inspector_prop_list_class_init (GtkInspectorPropListClass *klass)
widget_class->root = root;
widget_class->unroot = unroot;
g_object_class_install_property (object_class, PROP_OBJECT_TREE,
g_param_spec_object ("object-tree", "Object Tree", "Object tree",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_SEARCH_ENTRY,
g_param_spec_object ("search-entry", "Search Entry", "Search Entry",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));

View File

@ -401,7 +401,6 @@
<property name="title" translatable="yes">Miscellaneous</property>
<property name="child">
<object class="GtkInspectorMiscInfo" id="misc_info">
<property name="object-tree">object_tree</property>
</object>
</property>
</object>
@ -412,7 +411,6 @@
<property name="title" translatable="yes">Properties</property>
<property name="child">
<object class="GtkInspectorPropList" id="prop_list">
<property name="object-tree">object_tree</property>
<property name="search-entry">prop_search_entry</property>
</object>
</property>
@ -424,7 +422,6 @@
<property name="title" translatable="yes">Layout</property>
<property name="child">
<object class="GtkInspectorPropList" id="layout_prop_list">
<property name="object-tree">object_tree</property>
<property name="search-entry">layout_prop_search_entry</property>
</object>
</property>
@ -465,7 +462,6 @@
<property name="title" translatable="yes">Data</property>
<property name="child">
<object class="GtkInspectorListData" id="list_data">
<property name="object-tree">object_tree</property>
</object>
</property>
</object>