From: Andy W. <wi...@us...> - 2002-08-14 21:39:48
|
CVS Root: /cvsroot/gstreamer Module: gst-editor Changes by: wingo Date: Wed Aug 14 2002 14:39:46 PDT Log message: add utility palette. it includes: * a tab with the debug-ui from gst-launch-gui * a tab with a quick element selector Modified files: libs/gst/editor : Makefile.am gsteditor.c gsteditorcanvas.c gsteditorcanvas.h gsteditorpalette.c gsteditorpalette.h src : editor.glade2 Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/Makefile.am.diff?r1=1.13&r2=1.14 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditor.c.diff?r1=1.26&r2=1.27 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorcanvas.c.diff?r1=1.14&r2=1.15 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorcanvas.h.diff?r1=1.5&r2=1.6 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorpalette.c.diff?r1=1.8&r2=1.9 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorpalette.h.diff?r1=1.4&r2=1.5 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/src/editor.glade2.diff?r1=1.10&r2=1.11 ====Begin Diffs==== Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 8 Aug 2002 21:42:10 -0000 1.13 +++ Makefile.am 14 Aug 2002 21:39:34 -0000 1.14 @@ -10,15 +10,20 @@ gsteditorimage.c \ gsteditoritem.c \ gsteditorpad.c \ + gsteditorpalette.c \ gsteditorproperty.c \ gst-helper.c \ stockicons.c libgsteditor_la_CFLAGS = -DDATADIR="\"$(pkgdatadir)/\"" $(GST_EDITOR_CFLAGS) -libgsteditor_la_LDFLAGS = $(GST_EDITOR_LIBS) ../element-ui/libgstelementui.la ../element-browser/libgstelementbrowser.la +libgsteditor_la_LDFLAGS = $(GST_EDITOR_LIBS) \ + ../element-ui/libgstelementui.la \ + ../element-browser/libgstelementbrowser.la \ + ../debug-ui/libgstdebugui.la noinst_HEADERS = \ gsteditorproperty.h \ + gsteditorpalette.h \ gsteditorimage.h \ gst-helper.h \ gsteditor-marshal.h \ Index: gsteditor.c =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditor.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gsteditor.c 9 Aug 2002 19:43:05 -0000 1.26 +++ gsteditor.c 14 Aug 2002 21:39:34 -0000 1.27 @@ -153,7 +153,7 @@ g_signal_connect (editor->window, "delete-event", G_CALLBACK (on_delete_event), editor); g_signal_connect (editor->canvas, "notify", G_CALLBACK (on_canvas_notify), editor); g_object_notify (G_OBJECT (editor->canvas), "properties-visible"); -// g_object_notify (G_OBJECT (editor->canvas), "palette-visible")); + g_object_notify (G_OBJECT (editor->canvas), "palette-visible"); } static void @@ -567,14 +567,20 @@ { gboolean b; - g_object_get (editor->canvas, "properties-visible", &b, NULL); - g_object_set (editor->canvas, "properties-visible", !b, NULL); + g_object_get (widget, "active", &b, NULL); + g_object_set (editor->canvas, "properties-visible", b, NULL); } void gst_editor_show_utility_palette (GtkWidget *widget, GstEditor *editor) { - g_message ("this is a theoretical feature ;)"); + gboolean b; + + g_object_get (widget, "active", &b, NULL); + + g_message ("show utility palette: %d", b); + + g_object_set (editor->canvas, "palette-visible", b, NULL); } void @@ -650,6 +656,12 @@ g_object_get_property (object, param->name, &v); g_object_set_property (G_OBJECT (glade_xml_get_widget (editor->xml, "view-element-inspector")), "active", &v); + } else if (strcmp (param->name, "palette-visible") == 0) { + g_message ("canvas property notify"); + g_value_init (&v, param->value_type); + g_object_get_property (object, param->name, &v); + g_object_set_property (G_OBJECT (glade_xml_get_widget (editor->xml, "view-utility-palette")), + "active", &v); } else if (strcmp (param->name, "status") == 0) { g_object_get (object, "status", &status, NULL); gnome_appbar_set_status (GNOME_APPBAR (GNOME_APP (editor->window)->statusbar), @@ -657,5 +669,4 @@ g_free (status); } } - Index: gsteditorcanvas.c =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditorcanvas.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gsteditorcanvas.c 8 Aug 2002 21:42:10 -0000 1.14 +++ gsteditorcanvas.c 14 Aug 2002 21:39:34 -0000 1.15 @@ -23,6 +23,7 @@ #include <gst/editor/editor.h> #include "gsteditorproperty.h" +#include "gsteditorpalette.h" /* signals and args */ enum { @@ -34,6 +35,7 @@ PROP_BIN, PROP_SELECTION, PROP_PROPERTIES_VISIBLE, + PROP_PALETTE_VISIBLE, PROP_STATUS }; @@ -48,6 +50,7 @@ static void gst_editor_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void on_property_destroyed (GstEditorCanvas *canvas, gpointer stale_pointer); +static void on_palette_destroyed (GstEditorCanvas *canvas, gpointer stale_pointer); static GnomeCanvasClass *parent_class = NULL; @@ -99,6 +102,9 @@ g_object_class_install_property (object_class, PROP_PROPERTIES_VISIBLE, g_param_spec_boolean ("properties-visible", "properties-visible", "properties-visible", TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_object_class_install_property (object_class, PROP_PALETTE_VISIBLE, + g_param_spec_boolean ("palette-visible", "palette-visible", "palette-visible", + TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_STATUS, g_param_spec_string ("status", "status", "status", "Ready.", G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); @@ -189,6 +195,24 @@ break; + case PROP_PALETTE_VISIBLE: + b = g_value_get_boolean (value); + g_message ("palette visible: %s", b ? "TRUE" : "FALSE"); + + if (b) { + if (!canvas->palette) { + g_message ("making new palette"); + canvas->palette = g_object_new (gst_editor_palette_get_type (), "canvas", canvas, NULL); + g_object_weak_ref (G_OBJECT (canvas->palette), (GWeakNotify)on_palette_destroyed, canvas); + } + } else if (!b && canvas->palette) { + g_message ("destroying palette"); + g_object_unref (G_OBJECT (canvas->palette)); + /* the weak ref takes care of setting canvas->palette = NULL */ + } + + break; + case PROP_STATUS: status = g_value_get_string (value); @@ -224,6 +248,10 @@ g_value_set_boolean (value, canvas->property_window ? TRUE : FALSE); break; + case PROP_PALETTE_VISIBLE: + g_value_set_boolean (value, canvas->palette ? TRUE : FALSE); + break; + case PROP_STATUS: g_value_set_string (value, g_strdup (canvas->status)); break; @@ -241,6 +269,8 @@ if (canvas->property_window) g_object_unref (G_OBJECT (canvas->property_window)); + if (canvas->palette) + g_object_unref (G_OBJECT (canvas->palette)); } static void @@ -249,4 +279,14 @@ g_return_if_fail (GST_IS_EDITOR_CANVAS (canvas)); canvas->property_window = NULL; +} + +static void +on_palette_destroyed (GstEditorCanvas *canvas, gpointer stale_pointer) +{ + g_return_if_fail (GST_IS_EDITOR_CANVAS (canvas)); + + g_message ("palette destroyed"); + + canvas->palette = NULL; } Index: gsteditorcanvas.h =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditorcanvas.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gsteditorcanvas.h 8 Aug 2002 21:42:10 -0000 1.5 +++ gsteditorcanvas.h 14 Aug 2002 21:39:34 -0000 1.6 @@ -41,6 +41,7 @@ GstEditorBin *bin; GstEditorElement *selection; GtkWidget *property_window; + GtkWidget *palette; gchar *status; }; Index: editor.glade2 =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/src/editor.glade2,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- editor.glade2 8 Aug 2002 23:06:58 -0000 1.10 +++ editor.glade2 14 Aug 2002 21:39:34 -0000 1.11 @@ -159,7 +159,7 @@ <property name="use_underline">True</property> <child internal-child="image"> - <widget class="GtkImage" id="image17"> + <widget class="GtkImage" id="image23"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -294,7 +294,7 @@ <signal name="activate" handler="gst_editor_on_add" last_modification_time="Thu, 08 Aug 2002 23:28:59 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image18"> + <widget class="GtkImage" id="image24"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -315,7 +315,7 @@ <signal name="activate" handler="gst_editor_on_remove" last_modification_time="Thu, 08 Aug 2002 23:28:59 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image19"> + <widget class="GtkImage" id="image25"> <property name="visible">True</property> <property name="stock">gtk-remove</property> <property name="icon_size">1</property> @@ -351,11 +351,11 @@ </child> <child> - <widget class="GtkCheckMenuItem" id="utiity_palette1"> + <widget class="GtkCheckMenuItem" id="view-utility-palette"> <property name="visible">True</property> <property name="label" translatable="yes">Utiity _Palette</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <signal name="activate" handler="gst_editor_show_utility_palette" last_modification_time="Thu, 08 Aug 2002 05:59:20 GMT"/> </widget> </child> @@ -381,7 +381,7 @@ <accelerator key="F1" modifiers="0" signal="activate"/> <child internal-child="image"> - <widget class="GtkImage" id="image20"> + <widget class="GtkImage" id="image26"> <property name="visible">True</property> <property name="stock">gtk-help</property> <property name="icon_size">1</property> @@ -579,6 +579,152 @@ <property name="expand">True</property> <property name="fill">True</property> </packing> + </child> +</widget> + +<widget class="GtkWindow" id="utility_palette"> + <property name="visible">True</property> + <property name="title" translatable="yes">Utility Palette</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="default_width">200</property> + <property name="default_height">400</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + + <child> + <widget class="GtkNotebook" id="notebook2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="tab_hborder">2</property> + <property name="tab_vborder">2</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkVBox" id="vbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkVBox" id="element-browser-vbox"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator1"> + <property name="visible">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + + <child> + <widget class="GtkButton" id="button13"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <signal name="clicked" handler="gst_editor_palette_element_tree_add" last_modification_time="Wed, 14 Aug 2002 22:12:19 GMT"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Quick Launch</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="debug-vbox"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="label" translatable="yes">Debug</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> </child> </widget> |