From ccff3e952db3388e4fff51f3489d10f693635ead Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 6 May 2014 23:24:20 -0400 Subject: [PATCH] Rename parasite to gtkinspector This avoids namespace collisions with the original gtkparasite project, and adds the gtk prefix to all symbols and type names. --- gtk/gtkwindow.c | 24 +++-- modules/other/parasite/Makefile.am | 24 ++--- modules/other/parasite/button-path.c | 24 ++--- modules/other/parasite/button-path.h | 38 +++---- modules/other/parasite/button-path.ui | 2 +- modules/other/parasite/classes-list.c | 64 +++++------ modules/other/parasite/classes-list.h | 38 +++---- modules/other/parasite/classes-list.ui | 2 +- modules/other/parasite/css-editor.c | 82 +++++++------- modules/other/parasite/css-editor.h | 38 +++---- modules/other/parasite/css-editor.ui | 2 +- modules/other/parasite/inspect-button.c | 102 +++++++++--------- ....gresource.xml => inspector.gresource.xml} | 2 +- modules/other/parasite/module.c | 24 ++--- modules/other/parasite/object-hierarchy.c | 24 ++--- modules/other/parasite/object-hierarchy.h | 38 +++---- modules/other/parasite/object-hierarchy.ui | 2 +- modules/other/parasite/prop-list.c | 52 ++++----- modules/other/parasite/prop-list.h | 40 +++---- modules/other/parasite/prop-list.ui | 4 +- .../other/parasite/property-cell-renderer.c | 40 +++---- .../other/parasite/property-cell-renderer.h | 30 +++--- modules/other/parasite/python-hooks.c | 20 ++-- modules/other/parasite/python-hooks.h | 18 ++-- modules/other/parasite/python-shell.c | 98 ++++++++--------- modules/other/parasite/python-shell.h | 48 ++++----- modules/other/parasite/themes.c | 36 +++---- modules/other/parasite/themes.h | 34 +++--- modules/other/parasite/themes.ui | 2 +- modules/other/parasite/widget-tree.c | 58 +++++----- modules/other/parasite/widget-tree.h | 58 +++++----- modules/other/parasite/widget-tree.ui | 2 +- modules/other/parasite/window.c | 96 ++++++++--------- modules/other/parasite/window.h | 33 +++--- modules/other/parasite/window.ui | 22 ++-- 35 files changed, 612 insertions(+), 609 deletions(-) rename modules/other/parasite/{parasite.gresource.xml => inspector.gresource.xml} (88%) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 46150a6cdf..06036de7e9 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -12432,30 +12432,32 @@ static void gtk_window_toggle_debugging (GtkWindow *window) { static GType type = G_TYPE_NONE; - static GtkWidget *parasite_window = NULL; + static GtkWidget *inspector_window = NULL; -g_print ("toggle debugging\n"); + g_debug ("toggle debugging"); if (type == G_TYPE_NONE) { - _gtk_modules_load_module ("gtkparasite"); - type = g_type_from_name ("ParasiteWindow"); + _gtk_modules_load_module ("gtkinspector"); + type = g_type_from_name ("GtkInspectorWindow"); if (type == G_TYPE_INVALID) - g_warning ("Failed to load gtkparasite module, debugging not available."); + g_warning ("Failed to load GtkInspector module, debugging not available."); } if (!g_type_is_a (type, GTK_TYPE_WINDOW)) return; - if (parasite_window == NULL) + if (inspector_window == NULL) { - parasite_window = GTK_WIDGET (g_object_new (type, NULL)); - g_signal_connect (parasite_window, "delete-event", + g_debug ("creating a GtkInspector window"); + + inspector_window = GTK_WIDGET (g_object_new (type, NULL)); + g_signal_connect (inspector_window, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL); } - if (gtk_widget_is_visible (parasite_window)) - gtk_widget_hide (parasite_window); + if (gtk_widget_is_visible (inspector_window)) + gtk_widget_hide (inspector_window); else - gtk_window_present (GTK_WINDOW (parasite_window)); + gtk_window_present (GTK_WINDOW (inspector_window)); } diff --git a/modules/other/parasite/Makefile.am b/modules/other/parasite/Makefile.am index f0e7b97bbe..97dcd3273a 100644 --- a/modules/other/parasite/Makefile.am +++ b/modules/other/parasite/Makefile.am @@ -1,20 +1,20 @@ moduledir = $(libdir)/gtk-3.0/modules -module_LTLIBRARIES = libgtkparasite.la +module_LTLIBRARIES = libgtkinspector.la -resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/parasite.gresource.xml) -resources.h: parasite.gresource.xml - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/parasite.gresource.xml \ - --target=$@ --sourcedir=$(srcdir) --c-name parasite --generate-header --manual-register -resources.c: parasite.gresource.xml $(resource_files) - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/parasite.gresource.xml \ - --target=$@ --sourcedir=$(srcdir) --c-name parasite --generate-source --manual-register +resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/inspector.gresource.xml) +resources.h: inspector.gresource.xml + $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/inspector.gresource.xml \ + --target=$@ --sourcedir=$(srcdir) --c-name gtk_inspector --generate-header --manual-register +resources.c: inspector.gresource.xml $(resource_files) + $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/inspector.gresource.xml \ + --target=$@ --sourcedir=$(srcdir) --c-name gtk_inspector --generate-source --manual-register BUILT_SOURCES = \ resources.h \ resources.c -libgtkparasite_la_SOURCES = \ +libgtkinspector_la_SOURCES = \ resources.h \ resources.c \ inspect-button.c \ @@ -42,7 +42,7 @@ libgtkparasite_la_SOURCES = \ themes.h \ themes.c -libgtkparasite_la_CPPFLAGS = \ +libgtkinspector_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/gtk \ -I$(top_builddir)/gtk \ @@ -57,9 +57,9 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -libgtkparasite_la_LDFLAGS = -avoid-version -module $(no_undefined) +libgtkinspector_la_LDFLAGS = -avoid-version -module $(no_undefined) -libgtkparasite_la_LIBADD = \ +libgtkinspector_la_LIBADD = \ $(top_builddir)/gtk/libgtk-3.la \ $(GTK_DEP_LIBS) diff --git a/modules/other/parasite/button-path.c b/modules/other/parasite/button-path.c index 2840949886..339d4a16ad 100644 --- a/modules/other/parasite/button-path.c +++ b/modules/other/parasite/button-path.c @@ -22,40 +22,40 @@ #include "button-path.h" -struct _ParasiteButtonPathPrivate +struct _GtkInspectorButtonPathPrivate { GtkWidget *sw; GtkWidget *button_box; }; -G_DEFINE_TYPE_WITH_PRIVATE (ParasiteButtonPath, parasite_button_path, GTK_TYPE_BOX) +G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorButtonPath, gtk_inspector_button_path, GTK_TYPE_BOX) static void -parasite_button_path_init (ParasiteButtonPath *bp) +gtk_inspector_button_path_init (GtkInspectorButtonPath *bp) { - bp->priv = parasite_button_path_get_instance_private (bp); + bp->priv = gtk_inspector_button_path_get_instance_private (bp); gtk_widget_init_template (GTK_WIDGET (bp)); } static void -parasite_button_path_class_init (ParasiteButtonPathClass *klass) +gtk_inspector_button_path_class_init (GtkInspectorButtonPathClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/parasite/button-path.ui"); - gtk_widget_class_bind_template_child_private (widget_class, ParasiteButtonPath, sw); - gtk_widget_class_bind_template_child_private (widget_class, ParasiteButtonPath, button_box); + gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/button-path.ui"); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, sw); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, button_box); } GtkWidget * -parasite_button_path_new (void) +gtk_inspector_button_path_new (void) { - return GTK_WIDGET (g_object_new (PARASITE_TYPE_BUTTON_PATH, NULL)); + return GTK_WIDGET (g_object_new (GTK_TYPE_INSPECTOR_BUTTON_PATH, NULL)); } void -parasite_button_path_set_widget (ParasiteButtonPath *bp, - GtkWidget *widget) +gtk_inspector_button_path_set_widget (GtkInspectorButtonPath *bp, + GtkWidget *widget) { gchar *path, **words; gint i; diff --git a/modules/other/parasite/button-path.h b/modules/other/parasite/button-path.h index b6e3e79a2d..32f3d93442 100644 --- a/modules/other/parasite/button-path.h +++ b/modules/other/parasite/button-path.h @@ -19,44 +19,44 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef _GTKPARASITE_BUTTON_PATH_H_ -#define _GTKPARASITE_BUTTON_PATH_H_ +#ifndef _GTK_INSPECTOR_BUTTON_PATH_H_ +#define _GTK_INSPECTOR_BUTTON_PATH_H_ #include -#define PARASITE_TYPE_BUTTON_PATH (parasite_button_path_get_type()) -#define PARASITE_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PARASITE_TYPE_BUTTON_PATH, ParasiteButtonPath)) -#define PARASITE_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PARASITE_TYPE_BUTTON_PATH, ParasiteButtonPathClass)) -#define PARASITE_IS_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PARASITE_TYPE_BUTTON_PATH)) -#define PARASITE_IS_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PARASITE_TYPE_BUTTON_PATH)) -#define PARASITE_BUTTON_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PARASITE_TYPE_BUTTON_PATH, ParasiteButtonPathClass)) +#define GTK_TYPE_INSPECTOR_BUTTON_PATH (gtk_inspector_button_path_get_type()) +#define GTK_INSPECTOR_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPath)) +#define GTK_INSPECTOR_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass)) +#define GTK_INSPECTOR_IS_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH)) +#define GTK_INSPECTOR_IS_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH)) +#define GTK_INSPECTOR_BUTTON_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass)) -typedef struct _ParasiteButtonPathPrivate ParasiteButtonPathPrivate; +typedef struct _GtkInspectorButtonPathPrivate GtkInspectorButtonPathPrivate; -typedef struct _ParasiteButtonPath +typedef struct _GtkInspectorButtonPath { GtkBox parent; - ParasiteButtonPathPrivate *priv; -} ParasiteButtonPath; + GtkInspectorButtonPathPrivate *priv; +} GtkInspectorButtonPath; -typedef struct _ParasiteButtonPathClass +typedef struct _GtkInspectorButtonPathClass { GtkBoxClass parent; -} ParasiteButtonPathClass; +} GtkInspectorButtonPathClass; G_BEGIN_DECLS -GType parasite_button_path_get_type (void); -GtkWidget *parasite_button_path_new (void); -void parasite_button_path_set_widget (ParasiteButtonPath *bp, - GtkWidget *widget); +GType gtk_inspector_button_path_get_type (void); +GtkWidget *gtk_inspector_button_path_new (void); +void gtk_inspector_button_path_set_widget (GtkInspectorButtonPath *bp, + GtkWidget *widget); G_END_DECLS -#endif // _GTKPARASITE_BUTTON_PATH_H_ +#endif // _GTK_INSPECTOR_BUTTON_PATH_H_ // vim: set et sw=2 ts=2: diff --git a/modules/other/parasite/button-path.ui b/modules/other/parasite/button-path.ui index 2ab03a73bf..e4addfbe9b 100644 --- a/modules/other/parasite/button-path.ui +++ b/modules/other/parasite/button-path.ui @@ -1,6 +1,6 @@ -