diff --git a/editor/Makefile.am b/editor/Makefile.am index 767be10ece..d1b3bb859f 100644 --- a/editor/Makefile.am +++ b/editor/Makefile.am @@ -1,6 +1,6 @@ LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la -LDFLAGS = $(shell gnome-config --libs gnomeui) -INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir)/gst \ +LDFLAGS = $(shell gnome-config --libs gnomeui) $(shell libglade-config --libs gnome) +INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir)/gst $(shell libglade-config --cflags gnome) \ $(shell gnome-config --cflags gnomeui) @@ -8,11 +8,16 @@ lib_LTLIBRARIES = libgsteditor.la libgsteditor_la_SOURCES = \ gsteditor.c \ + gsteditorproject.c \ + gsteditorprojectview.c \ gsteditorelement.c \ gsteditorbin.c \ gsteditorcanvas.c \ gsteditorpad.c \ gsteditorconnection.c \ + gsteditorimage.c \ + gsteditorpalette.c \ + gsteditorproperty.c \ gstelementselect.c \ gsteditorcreate.c @@ -27,7 +32,13 @@ gsteditor_LDFLAGS = libgsteditor.la noinst_HEADERS = \ + gsteditorproject.h \ gstelementselect.h \ + gsteditorpalette.h \ + gsteditorproperty.h \ + gsteditorimage.h \ gsteditorcreate.h +CFLAGS = -O2 -Wall + EXTRA_DIST = editor.glade editorelement.glade diff --git a/editor/editor.c b/editor/editor.c index 45602fa69b..487a9c26fc 100644 --- a/editor/editor.c +++ b/editor/editor.c @@ -18,33 +18,32 @@ */ -#include -#include -#include - +#include #include #include "gsteditor.h" - +#include "gsteditorproject.h" #include "config.h" extern gboolean _gst_plugin_spew; int main(int argc,char *argv[]) { - GtkWidget *appwindow; - GstEditor *editor; + GstEditorProject *project; + + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); + textdomain (PACKAGE); _gst_plugin_spew = TRUE; gst_init(&argc,&argv); gst_plugin_load_all(); gst_plugin_load("gstelements"); gnome_init("GST Graph Editor",VERSION,argc,argv); + glade_init(); + glade_gnome_init(); - appwindow = gnome_app_new("gst-editor","GST Graph Editor"); - editor = gst_editor_new("pipeline"); - gtk_widget_set_usize(GTK_WIDGET(editor),250,250); - gnome_app_set_contents(GNOME_APP(appwindow),GTK_WIDGET(editor)); - gtk_widget_show_all(appwindow); + + project = gst_editor_project_new(); + gst_editor_project_view_new(project); gtk_main(); diff --git a/editor/editor.glade b/editor/editor.glade index 2f4c60acf8..d0afe2a522 100644 --- a/editor/editor.glade +++ b/editor/editor.glade @@ -3,72 +3,1363 @@ project1 + project1 pixmaps C True True - False gladesrc.c gladesrc.h gladesig.c gladesig.h + True + editor.ts - GtkWindow - editor_window - GST Editor + GnomeApp + main_project_window + 50 + 50 + 300 + 200 + Project Window GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE + False False True False + True + + + GnomeDock + GnomeApp:dock + dock1 + True + + 0 + True + True + + + + GnomeDockItem + dockitem1 + 2 + GNOME_DOCK_TOP + 0 + 0 + 0 + False + True + False + True + False + GTK_SHADOW_OUT + + + GtkMenuBar + menubar1 + GTK_SHADOW_NONE + + + GtkMenuItem + file1 + GNOMEUIINFO_MENU_FILE_TREE + + + GtkMenu + file1_menu + + + GtkPixmapMenuItem + new_file1 + + activate + on_new_file1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_NEW_ITEM + + + + + GtkPixmapMenuItem + open1 + + activate + on_open1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_OPEN_ITEM + + + + GtkPixmapMenuItem + save1 + + activate + on_save1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_SAVE_ITEM + + + + GtkPixmapMenuItem + save_as1 + + activate + on_save_as1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_SAVE_AS_ITEM + + + + GtkMenuItem + separator1 + False + + + + GtkPixmapMenuItem + project_options1 + + activate + on_project_options1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + + False + GNOME_STOCK_MENU_PROP + + + + GtkMenuItem + separator3 + False + + + + GtkPixmapMenuItem + exit1 + + activate + on_exit1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_EXIT_ITEM + + + + + + GtkMenuItem + edit1 + GNOMEUIINFO_MENU_EDIT_TREE + + + GtkMenu + edit1_menu + + + GtkPixmapMenuItem + cut1 + + activate + on_cut1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_CUT_ITEM + + + + GtkPixmapMenuItem + copy1 + + activate + on_copy1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_COPY_ITEM + + + + GtkPixmapMenuItem + paste1 + + activate + on_paste1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_PASTE_ITEM + + + + GtkPixmapMenuItem + clear1 + + activate + on_clear1_activate + Fri, 29 Sep 2000 17:15:00 GMT + + GNOMEUIINFO_MENU_CLEAR_ITEM + + + + + + GtkMenuItem + view1 + GNOMEUIINFO_MENU_VIEW_TREE + + + GtkMenu + view1_menu + + + GtkMenuItem + show_palette1 + + activate + on_show_palette1_activate + Fri, 29 Sep 2000 17:26:54 GMT + + + False + + + + GtkMenuItem + show_property_editor1 + + activate + on_show_property_editor1_activate + Fri, 29 Sep 2000 17:28:02 GMT + + + False + + + + GtkMenuItem + show_element_tree1 + + activate + on_show_element_tree1_activate + Fri, 29 Sep 2000 17:28:23 GMT + + + False + + + + + + GtkMenuItem + settings1 + GNOMEUIINFO_MENU_SETTINGS_TREE + + + GtkMenu + settings1_menu + + + GtkPixmapMenuItem + preferences2 + + activate + on_preferences2_activate + Fri, 29 Sep 2000 17:22:35 GMT + + GNOMEUIINFO_MENU_PREFERENCES_ITEM + + + + + + GtkMenuItem + help1 + GNOMEUIINFO_MENU_HELP_TREE + + + GtkMenu + help1_menu + + + GtkPixmapMenuItem + about + + activate + on_about_activate + Fri, 29 Sep 2000 18:33:22 GMT + + GNOMEUIINFO_MENU_ABOUT_ITEM + + + + + + + + GnomeDockItem + dockitem2 + 1 + GNOME_DOCK_TOP + 1 + 0 + 0 + False + True + False + False + False + GTK_SHADOW_OUT + + + GtkAlignment + alignment1 + 0.5 + 0.5 + 1 + 1 + + + GtkToolbar + toolbar1 + 1 + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + 16 + GTK_TOOLBAR_SPACE_LINE + GTK_RELIEF_NONE + True + + + GtkButton + Toolbar:button + button2 + Open File + + GNOME_STOCK_PIXMAP_OPEN + + + + GtkButton + Toolbar:button + button3 + Save File + + GNOME_STOCK_PIXMAP_SAVE + + + + GtkButton + Toolbar:button + button4 + + GNOME_STOCK_PIXMAP_PREFERENCES + + True + + + + + + + + GtkScrolledWindow + GnomeDock:contents + scrolledwindow1 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCList + clist1 + True + 1 + 80 + GTK_SELECTION_SINGLE + False + GTK_SHADOW_IN + + + Placeholder + CList:title + + + + + + + GnomeAppBar + GnomeApp:appbar + appbar1 + True + True + + 0 + True + True + + + + + + GtkWindow + palette_window + 50 + 400 + 150 + 300 + Palette + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False GtkVBox - vbox3 + palette_vbox False 0 - - Custom - canvas_custom - - 0 - True - True - - create_canvas - 0 - 0 - - GtkHBox - hbox3 + hbox6 + 4 + False + 4 0 - True + False True - False - 0 - GtkButton - create_button + GtkToggleButton + togglebutton1 + True + + False 0 False False - True - + + + + GtkLabel + lb_selector + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + True + True + + + + + + GtkButton + button7 + True + + + 0 + False + False + + + + + GtkButton + button8 + True + + + 0 + False + False + + + + + GtkButton + button9 + True + + + 0 + False + False + + + + + Placeholder + + + + + + GtkWindow + property_window + 500 + 30 + 340 + 400 + Properties + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False + + + GtkNotebook + notebook1 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + + GtkScrolledWindow + scrolledwindow3 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkViewport + viewport1 + 7 + GTK_SHADOW_NONE + + + GtkVBox + property_vbox + False + 0 + + + Placeholder + + + + Placeholder + + + + Placeholder + + + + + + + GtkLabel + Notebook:tab + nb_element + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox3 + False + 0 + + + GtkScrolledWindow + scrolledwindow4 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + clist2 + True + 5 + 160,139,80,53,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + signal + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label5 + + GTK_JUSTIFY_CENTER + False + 7.45058e-09 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label6 + + GTK_JUSTIFY_CENTER + False + 7.45058e-09 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label7 + + GTK_JUSTIFY_CENTER + False + 7.45058e-09 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label8 + + GTK_JUSTIFY_CENTER + False + 7.45058e-09 + 0.5 + 0 + 0 + + + + + + GtkTable + table1 + 4 + 5 + 2 + False + 0 + 0 + + 0 + False + False + + + + GtkHBox + hbox4 + False + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + GtkEntry + entry3 + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + bt_pick_signal + True + + clicked + on_bt_pick_signal_clicked + Fri, 29 Sep 2000 18:23:18 GMT + + + + 0 + False + False + GTK_PACK_END + + + + + + GtkLabel + label12 + 100 + + GTK_JUSTIFY_CENTER + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + + GtkLabel + label11 + 100 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + + + GtkLabel + label10 + 100 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + + GtkToggleButton + tg_after + True + + False + + 1 + 2 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + + GtkEntry + entry2 + True + True + True + 0 + + + 1 + 2 + 3 + 4 + 0 + 0 + True + True + False + False + True + False + + + + + GtkEntry + entry1 + True + True + True + 0 + + + 1 + 2 + 2 + 3 + 0 + 0 + True + True + False + False + True + False + + + + + GtkCombo + combo1 + False + True + False + True + False + + + 1 + 2 + 1 + 2 + 0 + 0 + True + True + False + False + True + False + + + + GtkEntry + GtkCombo:entry + combo-entry1 + True + True + True + 0 + + + + + + GtkLabel + label13 + 100 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + + GtkLabel + lb_signal + 100 + + GTK_JUSTIFY_RIGHT + False + 0 + 0.52 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + + + GtkHBox + hbox3 + True + 0 + + 0 + False + True + + + + GtkButton + bt_add + 5 + True + + + 0 + False + True + + + + + GtkButton + bt_update + 4 + True + + + 0 + False + True + + + + + GtkButton + bt_delete + 4 + True + + + 0 + False + True + + + + + GtkButton + bt_clear + 4 + True + + + 0 + False + True + + + + + + + GtkLabel + Notebook:tab + nb_signals + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GnomeAbout + about_dialog + False + True + Copyright 2000 + Wim Taymans <wim.taymans@chello.be> + + An editor for GStreamer pipelines. + + + + GtkWindow + element_tree + False + Element Tree + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False + + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCTree + ctree1 + True + 1 + 80 + GTK_SELECTION_SINGLE + False + GTK_SHADOW_IN + + + Placeholder + CTree:title + + GtkWindow + select_signal + False + Select Signal + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_MOUSE + True + True + True + False + + + GtkScrolledWindow + scrolledwindow5 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCList + clist3 + True + 1 + 80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_NONE + + + GtkLabel + CList:title + lb_signals + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GnomePropertyBox + propertybox1 + False + Editor Properties + GTK_WIN_POS_NONE + False + True + True + False + + + GtkNotebook + GnomePropertyBox:notebook + notebook2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + Placeholder + + + + GtkLabel + Notebook:tab + label16 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + Placeholder + + + + GtkLabel + Notebook:tab + label17 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + Placeholder + + + + GtkLabel + Notebook:tab + label18 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkFileSelection + fileselection1 + 10 + False + Select File + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GtkButton + FileSel:ok_button + ok_button1 + True + True + + + + + GtkButton + FileSel:cancel_button + cancel_button1 + True + True + + + + + + GnomeDialog + dialog1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button10 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button11 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button12 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + Placeholder + + + + diff --git a/editor/editor.ts b/editor/editor.ts new file mode 100644 index 0000000000..00bb898389 --- /dev/null +++ b/editor/editor.ts @@ -0,0 +1,54 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Project Window"); +gchar *s = N_("_New File"); +gchar *s = N_("_Project Options"); +gchar *s = N_("Show _Palette"); +gchar *s = N_("Show Property _Editor"); +gchar *s = N_("Show Element _Tree"); +gchar *s = N_("Open File"); +gchar *s = N_("Open"); +gchar *s = N_("Save File"); +gchar *s = N_("Save"); +gchar *s = N_("Options"); +gchar *s = N_("Palette"); +gchar *s = N_("Select"); +gchar *s = N_("Selector"); +gchar *s = N_("GStreamer Core"); +gchar *s = N_("Standard Elements"); +gchar *s = N_("Tree select..."); +gchar *s = N_("Properties"); +gchar *s = N_("Element"); +gchar *s = N_("Signal"); +gchar *s = N_("Handler"); +gchar *s = N_("Data"); +gchar *s = N_("After"); +gchar *s = N_("Object"); +gchar *s = N_("..."); +gchar *s = N_("Object:"); +gchar *s = N_("Data:"); +gchar *s = N_("Handler:"); +gchar *s = N_("No"); +gchar *s = N_("After:"); +gchar *s = N_("Signal:"); +gchar *s = N_("Add"); +gchar *s = N_("Update"); +gchar *s = N_("Delete"); +gchar *s = N_("Clear"); +gchar *s = N_("Signals"); +gchar *s = N_("Copyright 2000"); +gchar *s = N_("An editor for GStreamer pipelines."); +gchar *s = N_("Element Tree"); +gchar *s = N_("Select Signal"); +gchar *s = N_("Signals"); +gchar *s = N_("Editor Properties"); +gchar *s = N_("label16"); +gchar *s = N_("label17"); +gchar *s = N_("label18"); +gchar *s = N_("Select File"); +gchar *s = N_("OK"); +gchar *s = N_("Cancel"); diff --git a/editor/gsteditor.c b/editor/gsteditor.c index 238ecda51e..da77ac7388 100644 --- a/editor/gsteditor.c +++ b/editor/gsteditor.c @@ -26,6 +26,7 @@ /* signals and args */ enum { + NAME_CHANGED, LAST_SIGNAL }; @@ -41,6 +42,7 @@ static void gst_editor_set_arg(GtkObject *object,GtkArg *arg,guint id); static void gst_editor_get_arg(GtkObject *object,GtkArg *arg,guint id); static GtkFrame *parent_class = NULL; +static guint gst_editor_signals[LAST_SIGNAL] = { 0 }; GtkType gst_editor_get_type(void) { static GtkType editor_type = 0; @@ -56,7 +58,7 @@ GtkType gst_editor_get_type(void) { NULL, (GtkClassInitFunc)NULL, }; - editor_type = gtk_type_unique(gtk_frame_get_type(),&editor_info); + editor_type = gtk_type_unique(gtk_window_get_type(),&editor_info); } return editor_type; } @@ -66,37 +68,29 @@ static void gst_editor_class_init(GstEditorClass *klass) { object_class = (GtkObjectClass*)klass; - parent_class = gtk_type_class(gtk_frame_get_type()); + parent_class = gtk_type_class(gtk_window_get_type()); gtk_object_add_arg_type("GstEditor::name",GTK_TYPE_STRING, GTK_ARG_READWRITE,ARG_NAME); + gst_editor_signals[NAME_CHANGED] = + gtk_signal_new("name_changed",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorClass,name_changed), + gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, + GST_TYPE_EDITOR); + + gtk_object_class_add_signals(object_class,gst_editor_signals,LAST_SIGNAL); + object_class->set_arg = gst_editor_set_arg; object_class->get_arg = gst_editor_get_arg; } static void gst_editor_init(GstEditor *editor) { - /* create the pipeline */ - editor->pipeline = gst_pipeline_new("pipeline"); - g_return_if_fail(editor->pipeline != NULL); - - /* create the editor canvas */ - editor->canvas = gst_editor_canvas_new(GST_BIN(editor->pipeline),NULL); - - /* create the scrolled window */ - editor->scrollwindow = gtk_scrolled_window_new(NULL,NULL); - - /* get the canvas widget */ - editor->canvaswidget = gst_editor_canvas_get_canvas(editor->canvas); - - /* add the canvas to the scrolled window */ - gtk_container_add(GTK_CONTAINER(editor->scrollwindow), - editor->canvaswidget); - - /* add the scrolled window to the canvas */ - gtk_container_add(GTK_CONTAINER(editor),editor->scrollwindow); } +static void on_name_changed(GstEditorElement *element, gpointer data) { + gtk_signal_emit(GTK_OBJECT(element),gst_editor_signals[NAME_CHANGED], NULL); +} /** * gst_editor_new: * name: name of editor frame @@ -105,22 +99,52 @@ static void gst_editor_init(GstEditor *editor) { * * Returns: Freshly created GstEditor widget. */ -GstEditor *gst_editor_new(gchar *name) { +GstEditor *gst_editor_new(GstElement *element) { GstEditor *editor; + g_return_val_if_fail(element != NULL, NULL); + editor = gtk_type_new(gst_editor_get_type()); - gtk_object_set(GTK_OBJECT(editor),"name",name,NULL); + editor->element = element; + + /* create the editor canvas */ + editor->canvas = gst_editor_canvas_new(GST_BIN(editor->element),NULL); + + gtk_signal_connect_object(GTK_OBJECT(editor->canvas), "name_changed", on_name_changed, GTK_OBJECT(editor)); + /* create the scrolled window */ + editor->scrollwindow = gtk_scrolled_window_new(NULL,NULL); + + /* get the canvas widget */ + editor->canvaswidget = gst_editor_canvas_get_canvas(editor->canvas); + + /* add the canvas to the scrolled window */ + /*gtk_container_add(GTK_CONTAINER(editor->scrollwindow), + editor->canvaswidget); + */ + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(editor->scrollwindow), + editor->canvaswidget); + + /* add the scrolled window to the canvas */ + gtk_container_add(GTK_CONTAINER(editor),editor->scrollwindow); + + gtk_widget_set_usize(GTK_WIDGET(editor),400,400); + + gtk_widget_show_all(GTK_WIDGET(editor)); return editor; } +char *gst_editor_get_name(GstEditor *editor) { + return gst_element_get_name(GST_ELEMENT(editor->element)); +} + static void gst_editor_set_arg(GtkObject *object,GtkArg *arg,guint id) { GstEditor *editor = GST_EDITOR(object); switch (id) { case ARG_NAME: gtk_object_set(GTK_OBJECT(editor),"label",GTK_VALUE_STRING(*arg),NULL); - gst_element_set_name(GST_ELEMENT(editor->pipeline), + gst_element_set_name(GST_ELEMENT(editor->element), GTK_VALUE_STRING(*arg)); break; default: @@ -135,7 +159,7 @@ static void gst_editor_get_arg(GtkObject *object,GtkArg *arg,guint id) { switch (id) { case ARG_NAME: GTK_VALUE_STRING(*arg) = - gst_element_get_name(GST_ELEMENT(editor->pipeline)); + gst_element_get_name(GST_ELEMENT(editor->element)); break; default: arg->type = GTK_TYPE_INVALID; diff --git a/editor/gsteditor.h b/editor/gsteditor.h index 2603abb1e7..d10cabcf98 100644 --- a/editor/gsteditor.h +++ b/editor/gsteditor.h @@ -49,14 +49,14 @@ typedef struct _GstEditorConnectionClass GstEditorConnectionClass; #define GST_IS_EDITOR(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR)) #define GST_IS_EDITOR_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR)) struct _GstEditor { - GtkFrame frame; + GtkWindow window; - /* the actual pipeline to be associated with this thing */ - GstElement *pipeline; + /* the actual element to be associated with this thing */ + GstElement *element; /* the editor canvas */ GstEditorCanvas *canvas; @@ -67,13 +67,16 @@ struct _GstEditor { }; struct _GstEditorClass { - GnomeCanvasClass parent_class; + GtkWindowClass parent_class; + + void (*name_changed) (GstEditor *editor); }; GtkType gst_editor_get_type(); -GstEditor *gst_editor_new(gchar *name); +GstEditor *gst_editor_new(GstElement *element); +char *gst_editor_get_name(GstEditor *editor); #define GST_EDITOR_SET_OBJECT(item,object) \ @@ -92,7 +95,7 @@ GstEditor *gst_editor_new(gchar *name); #define GST_IS_EDITOR_ELEMENT(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_ELEMENT)) #define GST_IS_EDITOR_ELEMENT_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_ELEMENT))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_ELEMENT)) #define GST_EDITOR_ELEMENT_PARENT(obj) (GST_EDITOR_ELEMENT(obj)->parent) #define GST_EDITOR_ELEMENT_GROUP(obj) (GST_EDITOR_ELEMENT(obj)->group) @@ -121,8 +124,6 @@ struct _GstEditorElement { gdouble width,height; // size GnomeCanvasItem *border,*title,*resizebox; // easy ones GnomeCanvasItem *statebox[4],*statetext[4]; // GST_STATE_* - GnomeCanvasItem *playbox,*playtext; // playstate - gboolean states[5]; // visual states gdouble insidewidth,insideheight; // minimum space inside gdouble minwidth,minheight; // minimum size @@ -148,6 +149,7 @@ struct _GstEditorElement { struct _GstEditorElementClass { GnomeCanvasGroupClass parent_class; + void (*name_changed) (GstEditorElement *element); void (*realize) (GstEditorElement *element); gint (*event) (GnomeCanvasItem *item,GdkEvent *event, GstEditorElement *element); @@ -167,6 +169,9 @@ void gst_editor_element_construct(GstEditorElement *element, void gst_editor_element_repack(GstEditorElement *element); GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element, GstPad *pad); +void gst_editor_element_set_name(GstEditorElement *element, + const gchar *name); +const gchar *gst_editor_element_get_name(GstEditorElement *element); #define GST_TYPE_EDITOR_BIN \ @@ -178,7 +183,7 @@ GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element, #define GST_IS_EDITOR_BIN(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_BIN)) #define GST_IS_EDITOR_BIN_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_BIN))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_BIN)) struct _GstEditorBin { GstEditorElement element; @@ -216,7 +221,7 @@ GstEditorBin *gst_editor_bin_new(GstEditorBin *parent,GstBin *bin, #define GST_IS_EDITOR_CANVAS(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CANVAS)) #define GST_IS_EDITOR_CANVAS_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_CANVAS))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_CANVAS)) struct _GstEditorCanvas { @@ -248,7 +253,7 @@ void gst_editor_bin_add(GstEditorBin *parent,GstEditorElement *element); #define GST_IS_EDITOR_PAD(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD)) #define GST_IS_EDITOR_PAD_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PAD))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PAD)) struct _GstEditorPad { GtkObject object; @@ -314,7 +319,7 @@ void gst_editor_pad_repack(GstEditorPad *pad); #define GST_IS_EDITOR_CONNECTION(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CONNECTION)) #define GST_IS_EDITOR_CONNECTION_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_CONNECTION))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_CONNECTION)) struct _GstEditorConnection { GtkObject object; diff --git a/editor/gsteditorcanvas.c b/editor/gsteditorcanvas.c index 76b4600e7a..ec93b5ff4f 100644 --- a/editor/gsteditorcanvas.c +++ b/editor/gsteditorcanvas.c @@ -90,6 +90,7 @@ static void gst_editor_canvas_init(GstEditorCanvas *editorcanvas) { GstEditorCanvas *gst_editor_canvas_new(GstBin *bin, const gchar *first_arg_name,...) { GstEditorCanvas *editorcanvas; + GstEditorBin *bin2; va_list args; g_return_if_fail(bin != NULL); @@ -97,6 +98,7 @@ GstEditorCanvas *gst_editor_canvas_new(GstBin *bin, editorcanvas = GST_EDITOR_CANVAS(gtk_type_new(GST_TYPE_EDITOR_CANVAS)); GST_EDITOR_ELEMENT(editorcanvas)->element = GST_ELEMENT(bin); + GST_EDITOR_ELEMENT(editorcanvas)->parent = editorcanvas; va_start(args,first_arg_name); gst_editor_element_construct(GST_EDITOR_ELEMENT(editorcanvas),NULL, @@ -123,10 +125,9 @@ static void gst_editor_canvas_realize(GstEditorElement *element) { element->group = gnome_canvas_root(canvas->canvas); - gnome_canvas_item_new(element->group,gnome_canvas_rect_get_type(), - "width_units",1.0,"fill_color","white", - "outline_color","black", - "x1",-2.0,"y1",-2.0,"x2",2.0,"y2",2.0,NULL); + if (GST_EDITOR_ELEMENT_CLASS(parent_class)->realize) { + GST_EDITOR_ELEMENT_CLASS(parent_class)->realize(element); + } } static void gst_editor_canvas_set_arg(GtkObject *object,GtkArg *arg,guint id) { @@ -207,8 +208,8 @@ static gint gst_editor_canvas_event(GnomeCanvasItem *item, GstEditorBin *bin = GST_EDITOR_BIN(element); GstEditorCanvas *canvas = GST_EDITOR_CANVAS(element); -// g_print("canvas got event %d at %.2fx%.2f\n",event->type, -// event->button.x,event->button.y); + //g_print("canvas got event %d at %.2fx%.2f\n",event->type, + // event->button.x,event->button.y); switch (event->type) { case GDK_BUTTON_RELEASE: diff --git a/editor/gsteditorelement.c b/editor/gsteditorelement.c index 6bad772774..cf1d5399a6 100644 --- a/editor/gsteditorelement.c +++ b/editor/gsteditorelement.c @@ -24,6 +24,8 @@ #include #include "gsteditor.h" +#include "gsteditorproject.h" +#include "gsteditorproperty.h" /* class functions */ static void gst_editor_element_class_init(GstEditorElementClass *klass); @@ -60,8 +62,14 @@ static void gst_editor_element_move(GstEditorElement *element, gdouble dx,gdouble dy); -static gchar *_gst_editor_element_states[] = { "C","R","D","P" }; +static gchar *_gst_editor_element_states[] = { "S","R","P","F" }; +static GstElementState _gst_element_states[] = { + GST_STATE_NULL, + GST_STATE_READY, + GST_STATE_PLAYING, + GST_STATE_PAUSED, +}; enum { ARG_0, @@ -77,6 +85,7 @@ enum { }; enum { + NAME_CHANGED, LAST_SIGNAL }; @@ -109,6 +118,14 @@ static void gst_editor_element_class_init(GstEditorElementClass *klass) { parent_class = gtk_type_class(gtk_object_get_type()); + gst_editor_element_signals[NAME_CHANGED] = + gtk_signal_new("name_changed",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorElementClass,name_changed), + gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, + GST_TYPE_EDITOR_ELEMENT); + + gtk_object_class_add_signals(object_class,gst_editor_element_signals,LAST_SIGNAL); + gtk_object_add_arg_type("GstEditorElement::x",GTK_TYPE_DOUBLE, GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT_ONLY, ARG_X); @@ -148,10 +165,10 @@ GstEditorElement *gst_editor_element_new(GstEditorBin *parent, GstEditorElement *editorelement; va_list args; - g_return_if_fail(parent != NULL); - g_return_if_fail(GST_IS_EDITOR_BIN(parent)); - g_return_if_fail(element != NULL); - g_return_if_fail(GST_IS_ELEMENT(element)); + g_return_val_if_fail(parent != NULL, NULL); + g_return_val_if_fail(GST_IS_EDITOR_BIN(parent), NULL); + g_return_val_if_fail(element != NULL, NULL); + g_return_val_if_fail(GST_IS_ELEMENT(element), NULL); editorelement = GST_EDITOR_ELEMENT(gtk_type_new(GST_TYPE_EDITOR_ELEMENT)); editorelement->element = element; @@ -163,6 +180,22 @@ GstEditorElement *gst_editor_element_new(GstEditorBin *parent, return editorelement; } +void gst_editor_element_set_name(GstEditorElement *element, + const gchar *name) { + g_return_if_fail(GST_IS_EDITOR_ELEMENT(element)); + g_return_if_fail(name != NULL); + + gst_element_set_name(element->element, (gchar *)name); + gnome_canvas_item_set(element->title, "text", name, NULL); + gtk_signal_emit(GTK_OBJECT(element),gst_editor_element_signals[NAME_CHANGED], element); +} + +const gchar *gst_editor_element_get_name(GstEditorElement *element) { + g_return_val_if_fail(GST_IS_EDITOR_ELEMENT(element), NULL); + + return gst_element_get_name(element->element); +} + void gst_editor_element_construct(GstEditorElement *element, GstEditorBin *parent, const gchar *first_arg_name, @@ -199,7 +232,6 @@ void gst_editor_element_construct(GstEditorElement *element, static void gst_editor_element_set_arg(GtkObject *object,GtkArg *arg,guint id) { GstEditorElement *element; - gdouble dx,dy,newwidth,newheight; /* get the major types of this object */ element = GST_EDITOR_ELEMENT(object); @@ -358,6 +390,7 @@ static void gst_editor_element_realize(GstEditorElement *element) { "x1",0.0,"y1",0.0,"x2",0.0,"y2",0.0, NULL); g_return_if_fail(element->statebox[i] != NULL); + GST_EDITOR_SET_OBJECT(element->statebox[i],element); gtk_signal_connect(GTK_OBJECT(element->statebox[i]),"event", GTK_SIGNAL_FUNC(gst_editor_element_state_event), @@ -374,29 +407,6 @@ static void gst_editor_element_realize(GstEditorElement *element) { GTK_SIGNAL_FUNC(gst_editor_element_state_event), GINT_TO_POINTER(i)); } - /* and the play box (FIXME: should be icons, not text */ - element->playbox = gnome_canvas_item_new(element->group, - gnome_canvas_rect_get_type(), - "width_units",1.0,"fill_color","white","outline_color","black", - "x1",0.0,"y1",0.0,"x2",0.0,"y2",0.0, - NULL); - g_return_if_fail(element->playbox != NULL); - GST_EDITOR_SET_OBJECT(element->playbox,element); - gtk_signal_connect(GTK_OBJECT(element->playbox),"event", - GTK_SIGNAL_FUNC(gst_editor_element_state_event), - GINT_TO_POINTER(4)); - element->playtext = gnome_canvas_item_new(element->group, - gnome_canvas_text_get_type(), - "text","P", - "x",0.0,"y",0.0,"anchor",GTK_ANCHOR_NORTH_WEST, - "font","-*-*-*-*-*-*-6-*-*-*-*-*-*-*", - NULL); - g_return_if_fail(element->playtext != NULL); - GST_EDITOR_SET_OBJECT(element->playtext,element); - gtk_signal_connect(GTK_OBJECT(element->playtext),"event", - GTK_SIGNAL_FUNC(gst_editor_element_state_event), - GINT_TO_POINTER(4)); - // get all the pads pads = gst_element_get_pad_list(element->element); while (pads) { @@ -445,6 +455,7 @@ static void gst_editor_element_resize(GstEditorElement *element) { "text_width") + 2.0; itemheight = gst_util_get_double_arg(GTK_OBJECT(element->title), "text_height") + 2.0; + element->titlewidth = itemwidth; element->titleheight = itemheight; element->minwidth = MAX(element->minwidth,itemwidth); @@ -455,10 +466,10 @@ static void gst_editor_element_resize(GstEditorElement *element) { element->statewidth = 0.0;element->stateheight = 0.0; for (i=0;i<4;i++) { g_return_if_fail(element->statetext[i] != NULL); - itemwidth = gst_util_get_double_arg(GTK_OBJECT(element->statetext[i]), - "text_width") - 2.0; - itemwidth = gst_util_get_double_arg(GTK_OBJECT(element->statetext[i]), - "text_height"); + + itemwidth = 16.0; + itemheight = 16.0; + element->statewidth = MAX(element->statewidth,itemwidth); element->stateheight = MAX(element->stateheight,itemheight); } @@ -512,11 +523,8 @@ static void gst_editor_element_resize(GstEditorElement *element) { void gst_editor_element_repack(GstEditorElement *element) { GList *pads; - GstPad *pad; GstEditorPad *editorpad; - gdouble sinkwidth,sinkheight; gint sinks; - gdouble srcwidth,srcheight; gint srcs; gdouble x1,y1,x2,y2; gint i; @@ -560,23 +568,13 @@ void gst_editor_element_repack(GstEditorElement *element) { "x1",x1+(element->statewidth*i), "y1",y2-element->stateheight, "x2",x1+(element->statewidth*(i+1)),"y2",y2,NULL); - g_return_if_fail(element->statetext[i] != NULL); + g_return_if_fail(element->statetext[i] != NULL); gtk_object_set(GTK_OBJECT(element->statetext[i]), "x",x1+(element->statewidth*i)+2.0, "y",y2-element->stateheight+1.0, "anchor",GTK_ANCHOR_NORTH_WEST,NULL); } - // and the playstate box - g_return_if_fail(element->playbox != NULL); - gtk_object_set(GTK_OBJECT(element->playbox), - "x1",x1+(element->statewidth*4), - "y1",y2-element->stateheight, - "x2",x1+(element->statewidth*5),"y2",y2,NULL); - g_return_if_fail(element->playtext != NULL); - gtk_object_set(GTK_OBJECT(element->playtext), - "x",x1+(element->statewidth*4)+2.0, - "y",y2-element->stateheight+1.0, - "anchor",GTK_ANCHOR_NORTH_WEST,NULL); + gst_editor_element_sync_state(element); // now we try to place all the pads sinks = element->sinks; @@ -636,7 +634,14 @@ GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element, static gint gst_editor_element_group_event(GnomeCanvasItem *item, GdkEvent *event, GstEditorElement *element) { -// g_print("in group_event, type %d\n",event->type); + switch(event->type) { + case GDK_BUTTON_PRESS: + gst_editor_property_show(gst_editor_property_get(), element); + break; + default: + break; + } + if (GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(element)->klass)->event) return (GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(element)->klass)->event)( item,event,element); @@ -646,7 +651,7 @@ static gint gst_editor_element_group_event(GnomeCanvasItem *item, static gint gst_editor_element_event(GnomeCanvasItem *item,GdkEvent *event, GstEditorElement *element) { - gdouble item_x,item_y,dx,dy; + gdouble dx,dy; GdkCursor *fleur; // g_print("element in event, type %d\n",event->type); @@ -792,8 +797,7 @@ static gint gst_editor_element_state_event(GnomeCanvasItem *item, return TRUE; break; case GDK_BUTTON_RELEASE: - if (id < 5) { - element->states[id] = !element->states[id]; + if (id < 4) { gst_editor_element_set_state(element,id,TRUE); } else g_warning("Uh, shouldn't have gotten here, unknown state\n"); @@ -811,89 +815,38 @@ static gint gst_editor_element_state_event(GnomeCanvasItem *item, static void gst_editor_element_set_state(GstEditorElement *element, gint id,gboolean set) { gboolean stateset = TRUE; /* if we have no element, set anyway */ - if (element->states[id]) { - /* set the object state */ - if (set && element->element) - stateset = gst_element_set_state(element->element,(1 << id)); - /* change the display */ - if (stateset) { - if (id < 4) { - gtk_object_set(GTK_OBJECT(element->statebox[id]), - "fill_color","black",NULL); - gtk_object_set(GTK_OBJECT(element->statetext[id]), - "fill_color","white",NULL); - } else if (id == 4) { - gtk_object_set(GTK_OBJECT(element->playbox), - "fill_color","black",NULL); - gtk_object_set(GTK_OBJECT(element->playtext), - "fill_color","white",NULL); - } - } else { - g_print("error setting state %d\n",id); - element->states[id] = !element->states[id]; - } - } else { - if (set && element->element) - stateset = gst_element_set_state(element->element,~(1 << id)); - if (stateset) { - if (id < 4) { - gtk_object_set(GTK_OBJECT(element->statebox[id]), - "fill_color","white",NULL); - gtk_object_set(GTK_OBJECT(element->statetext[id]), - "fill_color","black",NULL); - } else if (id == 4) { - gtk_object_set(GTK_OBJECT(element->playbox), - "fill_color","white",NULL); - gtk_object_set(GTK_OBJECT(element->playtext), - "fill_color","black",NULL); - } - } else { - g_print("error unsetting state %d\n",id); - element->states[id] = !element->states[id]; - } - } + //g_print("element set state %d\n", id); + if (element->element) + stateset = gst_element_set_state(element->element,_gst_element_states[id]); } static void gst_editor_element_state_change(GstElement *element, gint state, GstEditorElement *editorelement) { - gint id; - g_return_if_fail(editorelement != NULL); -// g_print("gst_editor_element_state_change got state 0x%08x\n",state); - // if it's an unset -#ifdef OLD - if (state & GST_STATE_MAX) { - state = ~state; - for (id=0;id<(sizeof(state)*8)-1;id++) { - if (state & 1) { - editorelement->states[id] = FALSE; - break; - } - state /= 2; - } - } else { - for (id=0;id<(sizeof(state)*8)-1;id++) { - if (state & 1) { - editorelement->states[id] = TRUE; - break; - } - state /= 2; - } - } -#endif - gst_editor_element_set_state(editorelement,id,FALSE); + //g_print("gst_editor_element_state_change got state 0x%08x\n",state); + gst_editor_element_sync_state(editorelement); } static void gst_editor_element_sync_state(GstEditorElement *element) { gint id; + GstElementState state = GST_STATE(element->element); -// g_print("syncronizing state\n"); - for (id=0;id<5;id++) { - element->states[id] = GST_FLAG_IS_SET(element->element,1<statebox[id]), + "fill_color","black",NULL); + gtk_object_set(GTK_OBJECT(element->statetext[id]), + "fill_color","white",NULL); + } + else { + gtk_object_set(GTK_OBJECT(element->statebox[id]), + "fill_color","white",NULL); + gtk_object_set(GTK_OBJECT(element->statetext[id]), + "fill_color","black",NULL); + } } } diff --git a/editor/gsteditorimage.c b/editor/gsteditorimage.c new file mode 100644 index 0000000000..998e976dce --- /dev/null +++ b/editor/gsteditorimage.c @@ -0,0 +1,72 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include "gsteditorimage.h" + +GHashTable *_gst_editor_images; + +static char *_gst_editor_image_name[] = { + "pixmaps/bin.xpm", + "pixmaps/pipeline.xpm", + "pixmaps/thread.xpm", + "pixmaps/element.xpm", + "pixmaps/sink.xpm", + "pixmaps/src.xpm", + "pixmaps/connection.xpm", + "pixmaps/filter.xpm", + "pixmaps/tee.xpm", +}; + +struct _image_entry { + GstEditorImageType type; + GtkType (*gtktype) (void); +}; + +#define TYPES_SIZE 4 +struct _image_entry _image_types[TYPES_SIZE] = { + {GST_EDITOR_IMAGE_BIN, gst_bin_get_type }, + {GST_EDITOR_IMAGE_THREAD, gst_thread_get_type }, + {GST_EDITOR_IMAGE_PIPELINE, gst_pipeline_get_type }, + {GST_EDITOR_IMAGE_TEE, gst_tee_get_type }, +}; + +GstEditorImage *gst_editor_image_get(GstEditorImageType type) { + + GstEditorImage *new = g_new0(GstEditorImage, 1); + + new->pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, gdk_colormap_get_system(), &new->bitmap, NULL, + _gst_editor_image_name[type]); + + return new; +} + +GstEditorImage *gst_editor_image_get_for_type(GtkType type) { + + gint i; + for (i=0; i Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef __GST_EDITOR_IMAGE_H__ +#define __GST_EDITOR_IMAGE_H__ + +#include + +typedef enum +{ + GST_EDITOR_IMAGE_BIN, + GST_EDITOR_IMAGE_PIPELINE, + GST_EDITOR_IMAGE_THREAD, + + GST_EDITOR_IMAGE_ELEMENT, + GST_EDITOR_IMAGE_SINK, + GST_EDITOR_IMAGE_SOURCE, + GST_EDITOR_IMAGE_CONNECTION, + GST_EDITOR_IMAGE_FILTER, + GST_EDITOR_IMAGE_TEE, +} GstEditorImageType; + +typedef struct _GstEditorImage GstEditorImage; + +struct _GstEditorImage { + GdkPixmap *pixmap; + GdkBitmap *bitmap; +}; + + +GstEditorImage *gst_editor_image_get(GstEditorImageType type); +GstEditorImage *gst_editor_image_get_for_type(GtkType type); + + +#endif /* __GST_EDITOR_IMAGE_H__ */ diff --git a/editor/gsteditorpad.h b/editor/gsteditorpad.h index ed3f8ef82d..b69f285ed5 100644 --- a/editor/gsteditorpad.h +++ b/editor/gsteditorpad.h @@ -32,7 +32,7 @@ #define GST_IS_EDITOR_PAD(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD)) #define GST_IS_EDITOR_PAD_CLASS(obj) \ - (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PAD))) + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PAD)) typedef struct _GstEditorPad GstEditorPad; typedef struct _GstEditorPadClass GstEditorPadClass; diff --git a/editor/gsteditorpalette.c b/editor/gsteditorpalette.c new file mode 100644 index 0000000000..827e9242cc --- /dev/null +++ b/editor/gsteditorpalette.c @@ -0,0 +1,242 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include "gsteditorpalette.h" +#include "gsteditorimage.h" + +/* class functions */ +static void gst_editor_palette_class_init(GstEditorPaletteClass *klass); +static void gst_editor_palette_init(GstEditorPalette *palette); +static void gst_editor_palette_set_arg(GtkObject *object,GtkArg *arg,guint id); +static void gst_editor_palette_get_arg(GtkObject *object,GtkArg *arg,guint id); + +static void gst_editor_palette_make(GstEditorPalette *palette); + +struct _palette_entry { + gchar *tooltip; + GtkType (*type) (void); +}; + +#define CORE_ELEMENT_SIZE 4 +struct _palette_entry _palette_contents_core[CORE_ELEMENT_SIZE] = { + {"Bin", gst_bin_get_type }, + {"Thread", gst_thread_get_type }, + {"Pipeline", gst_pipeline_get_type }, + {"Tee", gst_tee_get_type }, +}; + +enum { + ARG_0, +}; + +enum { + SIGNAL_ELEMENT_SELECTED, + SIGNAL_IN_SELECTION_MODE, + LAST_SIGNAL +}; + +static GtkObjectClass *parent_class; +static guint gst_editor_palette_signals[LAST_SIGNAL] = { 0 }; + +GtkType gst_editor_palette_get_type() { + static GtkType palette_type = 0; + + if (!palette_type) { + static const GtkTypeInfo palette_info = { + "GstEditorPalette", + sizeof(GstEditorPalette), + sizeof(GstEditorPaletteClass), + (GtkClassInitFunc)gst_editor_palette_class_init, + (GtkObjectInitFunc)gst_editor_palette_init, + NULL, + NULL, + (GtkClassInitFunc)NULL, + }; + palette_type = gtk_type_unique(gtk_object_get_type(),&palette_info); + } + return palette_type; +} + +static void gst_editor_palette_class_init(GstEditorPaletteClass *klass) { + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*)klass; + + parent_class = gtk_type_class(gtk_object_get_type()); + + gst_editor_palette_signals[SIGNAL_ELEMENT_SELECTED] = + gtk_signal_new("element_selected",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorPaletteClass,element_selected), + gtk_marshal_NONE__INT,GTK_TYPE_NONE,1, + GTK_TYPE_INT); + + gst_editor_palette_signals[SIGNAL_IN_SELECTION_MODE] = + gtk_signal_new("in_selection_mode",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorPaletteClass,in_selection_mode), + gtk_marshal_NONE__INT,GTK_TYPE_NONE,1, + GTK_TYPE_INT); + + gtk_object_class_add_signals(object_class,gst_editor_palette_signals,LAST_SIGNAL); + + object_class->set_arg = gst_editor_palette_set_arg; + object_class->get_arg = gst_editor_palette_get_arg; +} + +static void gst_editor_palette_init(GstEditorPalette *palette) { + palette->tooltips = gtk_tooltips_new(); +} + +typedef struct { + GstEditorPalette *palette; + GModule *symbols; +} connect_struct; + +/* we need more control here so... */ +static void gst_editor_palette_connect_func (const gchar *handler_name, + GtkObject *object, + const gchar *signal_name, + const gchar *signal_data, + GtkObject *connect_object, + gboolean after, + gpointer user_data) +{ + GtkSignalFunc func; + connect_struct *data = (connect_struct *)user_data; + + if (!g_module_symbol(data->symbols, handler_name, (gpointer *)&func)) + g_warning("gsteditorpalette: could not find signal handler '%s'.", handler_name); + else { + if (after) + gtk_signal_connect_after(object, signal_name, func, (gpointer) data->palette); + else + gtk_signal_connect(object, signal_name, func, (gpointer) data->palette); + } +} + +GstEditorPalette *gst_editor_palette_new() { + GstEditorPalette *palette; + GtkWidget *palette_window; + connect_struct data; + GModule *symbols; + + palette = GST_EDITOR_PALETTE(gtk_type_new(GST_TYPE_EDITOR_PALETTE)); + + symbols = g_module_open(NULL, 0); + + data.palette = palette; + data.symbols = symbols; + + palette->xml = glade_xml_new("editor.glade", "palette_window"); + glade_xml_signal_autoconnect_full (palette->xml, gst_editor_palette_connect_func, &data); + + palette_window = glade_xml_get_widget(palette->xml, "palette_window"); + gtk_widget_show(palette_window); + + palette->table = gtk_table_new(1, 4, TRUE); + + gst_editor_palette_make(palette); + + return palette; +} + +typedef struct { + GstEditorPalette *palette; + struct _palette_entry *entry; +} _signal_data; + +static void gst_editor_palette_element_clicked(GtkButton *button, _signal_data *data) { + gtk_signal_emit(GTK_OBJECT(data->palette),gst_editor_palette_signals[SIGNAL_ELEMENT_SELECTED], data->entry->type()); +} + +static void gst_editor_palette_make(GstEditorPalette *palette) { + GtkWidget *button; + GstEditorImage *editimage; + GtkWidget *image; + GtkWidget *vbox; + gint i, x, y; + _signal_data *data; + + x=0; + y=0; + + vbox = glade_xml_get_widget(palette->xml, "palette_vbox"); + gtk_box_pack_start(GTK_BOX(vbox), palette->table, FALSE, TRUE, 0); + + for (i=0; ipixmap, editimage->bitmap); + gtk_container_add(GTK_CONTAINER(button), image); + gtk_widget_show(image); + + gtk_table_attach(GTK_TABLE(palette->table), button, x, x+1, y, y+1, 0, 0, 0, 0); + gtk_widget_show(palette->table); + + data = g_new0(_signal_data, 1); + + data->palette = palette; + data->entry = &_palette_contents_core[i]; + + gtk_signal_connect(GTK_OBJECT(button), "clicked", gst_editor_palette_element_clicked, data); + + gtk_tooltips_set_tip(palette->tooltips, button, _palette_contents_core[i].tooltip, NULL); + + gtk_widget_show(button); + + x++; + if (x==4) { + x=0; + y++; + } + } +} + +static void gst_editor_palette_set_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorPalette *palette; + + /* get the major types of this object */ + palette = GST_EDITOR_PALETTE(object); + + switch (id) { + default: + g_warning("gsteditorpalette: unknown arg!"); + break; + } +} + +static void gst_editor_palette_get_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorPalette *palette; + + /* get the major types of this object */ + palette = GST_EDITOR_PALETTE(object); + + switch (id) { + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + + + diff --git a/editor/gsteditorpalette.h b/editor/gsteditorpalette.h new file mode 100644 index 0000000000..3ae2ad8e07 --- /dev/null +++ b/editor/gsteditorpalette.h @@ -0,0 +1,63 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef __GST_EDITOR_PALETTE_H__ +#define __GST_EDITOR_PALETTE_H__ + +#include +#include +#include "gsteditor.h" + +#define GST_TYPE_EDITOR_PALETTE \ + (gst_editor_palette_get_type()) +#define GST_EDITOR_PALETTE(obj) \ + (GTK_CHECK_CAST((obj),GST_TYPE_EDITOR_PALETTE,GstEditorPalette)) +#define GST_EDITOR_PALETTE_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EDITOR_PALETTE,GstEditorPalette)) +#define GST_IS_EDITOR_PALETTE(obj) \ + (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PALETTE)) +#define GST_IS_EDITOR_PALETTE_CLASS(obj) \ + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PALETTE)) + +typedef struct _GstEditorPalette GstEditorPalette; +typedef struct _GstEditorPaletteClass GstEditorPaletteClass; + +struct _GstEditorPalette { + GtkObject object; + + GladeXML *xml; + GtkWidget *table; + GtkTooltips *tooltips; +}; + +struct _GstEditorPaletteClass { + GtkObjectClass parent_class; + + void (*element_selected) (GstEditorPalette *palette, + GstEditorElement *element); + void (*in_selection_mode) (GstEditorPalette *palette, + GstEditorElement *element); +}; + +GtkType gst_editor_palette_get_type(); +GstEditorPalette *gst_editor_palette_new(); + + +#endif /* __GST_EDITOR_PALETTE_H__ */ diff --git a/editor/gsteditorproject.c b/editor/gsteditorproject.c new file mode 100644 index 0000000000..c687ec0b78 --- /dev/null +++ b/editor/gsteditorproject.c @@ -0,0 +1,160 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include +#include "gsteditorproject.h" +#include "gsteditorpalette.h" +#include "gsteditorproperty.h" +#include "gsteditorimage.h" + +/* class functions */ +static void gst_editor_project_class_init(GstEditorProjectClass *klass); +static void gst_editor_project_init(GstEditorProject *project); +static void gst_editor_project_set_arg(GtkObject *object,GtkArg *arg,guint id); +static void gst_editor_project_get_arg(GtkObject *object,GtkArg *arg,guint id); + +enum { + ARG_0, +}; + +enum { + ELEMENT_ADDED, + ELEMENT_REMOVED, + ELEMENT_CHANGED, + LAST_SIGNAL +}; + +static GtkObjectClass *parent_class; +static guint gst_editor_project_signals[LAST_SIGNAL] = { 0 }; + +GtkType gst_editor_project_get_type() { + static GtkType project_type = 0; + + if (!project_type) { + static const GtkTypeInfo project_info = { + "GstEditorProject", + sizeof(GstEditorProject), + sizeof(GstEditorProjectClass), + (GtkClassInitFunc)gst_editor_project_class_init, + (GtkObjectInitFunc)gst_editor_project_init, + NULL, + NULL, + (GtkClassInitFunc)NULL, + }; + project_type = gtk_type_unique(gtk_object_get_type(),&project_info); + } + return project_type; +} + +static void gst_editor_project_class_init(GstEditorProjectClass *klass) { + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*)klass; + + parent_class = gtk_type_class(gtk_object_get_type()); + + gst_editor_project_signals[ELEMENT_ADDED] = + gtk_signal_new("element_added",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_added), + gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, + GST_TYPE_ELEMENT); + + gst_editor_project_signals[ELEMENT_REMOVED] = + gtk_signal_new("element_removed",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_removed), + gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, + GST_TYPE_ELEMENT); + + gst_editor_project_signals[ELEMENT_CHANGED] = + gtk_signal_new("element_changed",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_changed), + gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, + GST_TYPE_ELEMENT); + + gtk_object_class_add_signals(object_class,gst_editor_project_signals,LAST_SIGNAL); + + object_class->set_arg = gst_editor_project_set_arg; + object_class->get_arg = gst_editor_project_get_arg; +} + +static void gst_editor_project_init(GstEditorProject *project) { + project->toplevelelements = NULL; +} + +GstEditorProject *gst_editor_project_new() { + GstEditorProject *editorproject; + + editorproject = GST_EDITOR_PROJECT(gtk_type_new(GST_TYPE_EDITOR_PROJECT)); + + return editorproject; +} + +GstEditorProject *gst_editor_project_new_from_file(const guchar *fname) { + GstEditorProject *editorproject; + + editorproject = gst_editor_project_new(); + + return editorproject; +} + +void gst_editor_project_add_toplevel_element(GstEditorProject *project, GstElement *element) { + + g_return_if_fail(project != NULL); + g_return_if_fail(GST_IS_EDITOR_PROJECT(project)); + g_return_if_fail(element != NULL); + g_return_if_fail(GST_IS_ELEMENT(element)); + + project->toplevelelements = g_list_append(project->toplevelelements, element); + + gst_element_set_name(element, "new_element"); + + gtk_signal_emit(GTK_OBJECT(project),gst_editor_project_signals[ELEMENT_ADDED], element); +} + +static void gst_editor_project_set_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProject *project; + + /* get the major types of this object */ + project = GST_EDITOR_PROJECT(object); + + switch (id) { + default: + g_warning("gsteditorproject: unknown arg!"); + break; + } +} + +static void gst_editor_project_get_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProject *project; + + /* get the major types of this object */ + project = GST_EDITOR_PROJECT(object); + + switch (id) { + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + + diff --git a/editor/gsteditorproject.h b/editor/gsteditorproject.h new file mode 100644 index 0000000000..ed6623bd79 --- /dev/null +++ b/editor/gsteditorproject.h @@ -0,0 +1,94 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef __GST_EDITOR_PROJECT_H__ +#define __GST_EDITOR_PROJECT_H__ + +#include +#include "gsteditor.h" +#include "gsteditorproperty.h" + +#define GST_TYPE_EDITOR_PROJECT \ + (gst_editor_project_get_type()) +#define GST_EDITOR_PROJECT(obj) \ + (GTK_CHECK_CAST((obj),GST_TYPE_EDITOR_PROJECT,GstEditorProject)) +#define GST_EDITOR_PROJECT_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EDITOR_PROJECT,GstEditorProject)) +#define GST_IS_EDITOR_PROJECT(obj) \ + (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PROJECT)) +#define GST_IS_EDITOR_PROJECT_CLASS(obj) \ + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PROJECT)) + +typedef struct _GstEditorProject GstEditorProject; +typedef struct _GstEditorProjectClass GstEditorProjectClass; + +struct _GstEditorProject { + GtkObject object; + + GList *toplevelelements; +}; + +struct _GstEditorProjectClass { + GtkObjectClass parent_class; + + void (*element_added) (GstEditorProject *project, + GstEditorElement *element); + void (*element_removed) (GstEditorProject *project, + GstEditorElement *element); + void (*element_changed) (GstEditorProject *project, + GstEditorElement *element); +}; + +GtkType gst_editor_project_get_type(); +GstEditorProject *gst_editor_project_new(); +GstEditorProject *gst_editor_project_new_from_file(const guchar *fname); +void gst_editor_project_add_toplevel_element(GstEditorProject *project, GstElement *element); + + +#define GST_TYPE_EDITOR_PROJECT_VIEW \ + (gst_editor_project_view_get_type()) +#define GST_EDITOR_PROJECT_VIEW(obj) \ + (GTK_CHECK_CAST((obj),GST_TYPE_EDITOR_PROJECT_VIEW,GstEditorProjectView)) +#define GST_EDITOR_PROJECT_VIEW_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EDITOR_PROJECT_VIEW,GstEditorProjectView)) +#define GST_IS_EDITOR_PROJECT_VIEW(obj) \ + (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PROJECT_VIEW)) +#define GST_IS_EDITOR_PROJECT_VIEW_CLASS(obj) \ + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PROJECT_VIEW)) + +typedef struct _GstEditorProjectView GstEditorProjectView; +typedef struct _GstEditorProjectViewClass GstEditorProjectViewClass; + +struct _GstEditorProjectView { + GtkObject object; + + GladeXML *xml; + GtkWidget *list; + GstEditorProject *project; +}; + +struct _GstEditorProjectViewClass { + GtkObjectClass parent_class; +}; + +GtkType gst_editor_project_view_get_type(); +GstEditorProjectView *gst_editor_project_view_new(GstEditorProject *project); + +#endif /* __GST_EDITOR_PROJECT_H__ */ diff --git a/editor/gsteditorprojectview.c b/editor/gsteditorprojectview.c new file mode 100644 index 0000000000..af052ed2dd --- /dev/null +++ b/editor/gsteditorprojectview.c @@ -0,0 +1,211 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include +#include "gsteditorproject.h" +#include "gsteditorpalette.h" +#include "gsteditorproperty.h" +#include "gsteditorimage.h" + +/* class functions */ +static void gst_editor_project_view_class_init(GstEditorProjectViewClass *klass); +static void gst_editor_project_view_init(GstEditorProjectView *project_view); +static void gst_editor_project_view_set_arg(GtkObject *object,GtkArg *arg,guint id); +static void gst_editor_project_view_get_arg(GtkObject *object,GtkArg *arg,guint id); + +enum { + ARG_0, +}; + +enum { + LAST_SIGNAL +}; + +static GtkObjectClass *parent_class; +//static guint gst_editor_project_view_signals[LAST_SIGNAL] = { 0 }; + +GtkType gst_editor_project_view_get_type() { + static GtkType project_view_type = 0; + + if (!project_view_type) { + static const GtkTypeInfo project_view_info = { + "GstEditorProjectView", + sizeof(GstEditorProjectView), + sizeof(GstEditorProjectViewClass), + (GtkClassInitFunc)gst_editor_project_view_class_init, + (GtkObjectInitFunc)gst_editor_project_view_init, + NULL, + NULL, + (GtkClassInitFunc)NULL, + }; + project_view_type = gtk_type_unique(gtk_object_get_type(),&project_view_info); + } + return project_view_type; +} + +static void gst_editor_project_view_class_init(GstEditorProjectViewClass *klass) { + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*)klass; + + parent_class = gtk_type_class(gtk_object_get_type()); + + object_class->set_arg = gst_editor_project_view_set_arg; + object_class->get_arg = gst_editor_project_view_get_arg; +} + +static void gst_editor_project_view_init(GstEditorProjectView *project) { +} + +typedef struct { + GstEditorProject *project; + GModule *symbols; +} connect_struct; + +/* we need more control here so... */ +static void gst_editor_project_connect_func (const gchar *handler_name, + GtkObject *object, + const gchar *signal_name, + const gchar *signal_data, + GtkObject *connect_object, + gboolean after, + gpointer user_data) +{ + GtkSignalFunc func; + connect_struct *data = (connect_struct *)user_data; + + if (!g_module_symbol(data->symbols, handler_name, (gpointer *)&func)) + g_warning("GstEditorProject: could not find signal handler '%s'.", handler_name); + else { + if (after) + gtk_signal_connect_after(object, signal_name, func, (gpointer) data->project); + else + gtk_signal_connect(object, signal_name, func, (gpointer) data->project); + } +} + +static void gst_editor_project_element_selected(GstEditorProjectView *view, GtkType type, GstEditorPalette *palette) { + GstElement *element; + + element = gtk_type_new(type); + + g_return_if_fail(element != NULL); + g_return_if_fail(GST_IS_ELEMENT(element)); + + gst_editor_project_add_toplevel_element(view->project, element); +} + +static void on_name_change(GstEditorProjectView *view, GstEditorElement *element, GstEditor *editor) { + gint row; + gchar *text; + guint8 spacing; + GdkPixmap *pixmap; + GdkBitmap *mask; + + row = gtk_clist_find_row_from_data(GTK_CLIST(view->list), editor); + + gtk_clist_get_pixtext(GTK_CLIST(view->list), row, 0, &text, &spacing, &pixmap, &mask); + gtk_clist_set_pixtext(GTK_CLIST(view->list), row, 0, gst_editor_get_name(editor), + spacing, pixmap, mask); +} + +static void view_on_element_added(GstEditorProjectView *view, GstElement *element) { + gchar *name; + gint row; + GstEditorImage *image; + GstEditor *editor; + + image = gst_editor_image_get_for_type(GTK_OBJECT_TYPE(element)); + name = gst_element_get_name(element); + row = gtk_clist_append(GTK_CLIST(view->list), &name); + editor = gst_editor_new(element); + + gtk_signal_connect_object(GTK_OBJECT(editor), "name_changed", on_name_change, GTK_OBJECT(view)); + gtk_clist_set_row_data(GTK_CLIST(view->list), row, editor); + gtk_clist_set_pixtext(GTK_CLIST(view->list), row, 0, name, 3, image->pixmap, image->bitmap); +} + +GstEditorProjectView *gst_editor_project_view_new(GstEditorProject *project) { + GstEditorProjectView *view; + GtkWidget *main_window; + connect_struct data; + GModule *symbols; + GstEditorPalette *palette; + + view = GST_EDITOR_PROJECT_VIEW(gtk_type_new(GST_TYPE_EDITOR_PROJECT_VIEW)); + + view->project = project; + + symbols = g_module_open(NULL, 0); + + data.project = project; + data.symbols = symbols; + + view->xml = glade_xml_new("editor.glade", "main_project_window"); + glade_xml_signal_autoconnect_full (view->xml, gst_editor_project_connect_func, &data); + + gtk_signal_connect_object(GTK_OBJECT(project), "element_added", view_on_element_added, GTK_OBJECT(view)); + + main_window = glade_xml_get_widget(view->xml, "main_project_window"); + gtk_widget_show(main_window); + + palette = gst_editor_palette_new(); + gtk_signal_connect_object(GTK_OBJECT(palette), "element_selected", gst_editor_project_element_selected, GTK_OBJECT(view)); + + view->list = glade_xml_get_widget(view->xml, "clist1"); + gtk_clist_set_row_height(GTK_CLIST(view->list), 21); + + gst_editor_property_get(); + + return view; +} + +static void gst_editor_project_view_set_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProjectView *project_view; + + /* get the major types of this object */ + project_view = GST_EDITOR_PROJECT_VIEW(object); + + switch (id) { + default: + g_warning("gsteditorproject_view: unknown arg!"); + break; + } +} + +static void gst_editor_project_view_get_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProjectView *project_view; + + /* get the major types of this object */ + project_view = GST_EDITOR_PROJECT_VIEW(object); + + switch (id) { + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + + + + diff --git a/editor/gsteditorproperty.c b/editor/gsteditorproperty.c new file mode 100644 index 0000000000..28ce43b910 --- /dev/null +++ b/editor/gsteditorproperty.c @@ -0,0 +1,294 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include "gsteditorproperty.h" +#include "gsteditorimage.h" + +/* class functions */ +static void gst_editor_property_class_init(GstEditorPropertyClass *klass); +static void gst_editor_property_init(GstEditorProperty *property); +static void gst_editor_property_set_arg(GtkObject *object,GtkArg *arg,guint id); +static void gst_editor_property_get_arg(GtkObject *object,GtkArg *arg,guint id); + +enum { + ARG_0, +}; + +enum { + SIGNAL_ELEMENT_SELECTED, + SIGNAL_IN_SELECTION_MODE, + LAST_SIGNAL +}; + +static GtkObjectClass *parent_class; +static guint gst_editor_property_signals[LAST_SIGNAL] = { 0 }; + +static GstEditorProperty *_the_property = NULL; + +GtkType gst_editor_property_get_type() { + static GtkType property_type = 0; + + if (!property_type) { + static const GtkTypeInfo property_info = { + "GstEditorProperty", + sizeof(GstEditorProperty), + sizeof(GstEditorPropertyClass), + (GtkClassInitFunc)gst_editor_property_class_init, + (GtkObjectInitFunc)gst_editor_property_init, + NULL, + NULL, + (GtkClassInitFunc)NULL, + }; + property_type = gtk_type_unique(gtk_object_get_type(),&property_info); + } + return property_type; +} + +static void gst_editor_property_class_init(GstEditorPropertyClass *klass) { + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*)klass; + + parent_class = gtk_type_class(gtk_object_get_type()); + + gst_editor_property_signals[SIGNAL_ELEMENT_SELECTED] = + gtk_signal_new("element_selected",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorPropertyClass,element_selected), + gtk_marshal_NONE__INT,GTK_TYPE_NONE,1, + GTK_TYPE_INT); + + gst_editor_property_signals[SIGNAL_IN_SELECTION_MODE] = + gtk_signal_new("in_selection_mode",GTK_RUN_FIRST,object_class->type, + GTK_SIGNAL_OFFSET(GstEditorPropertyClass,in_selection_mode), + gtk_marshal_NONE__INT,GTK_TYPE_NONE,1, + GTK_TYPE_INT); + + gtk_object_class_add_signals(object_class,gst_editor_property_signals,LAST_SIGNAL); + + object_class->set_arg = gst_editor_property_set_arg; + object_class->get_arg = gst_editor_property_get_arg; +} + +static void gst_editor_property_init(GstEditorProperty *property) { + + property->panels = g_hash_table_new(NULL, NULL); + property->current = NULL; +} + +typedef struct { + GstEditorProperty *property; + GModule *symbols; +} connect_struct; + +/* we need more control here so... */ +static void gst_editor_property_connect_func (const gchar *handler_name, + GtkObject *object, + const gchar *signal_name, + const gchar *signal_data, + GtkObject *connect_object, + gboolean after, + gpointer user_data) +{ + GtkSignalFunc func; + connect_struct *data = (connect_struct *)user_data; + + if (!g_module_symbol(data->symbols, handler_name, (gpointer *)&func)) + g_warning("gsteditorproperty: could not find signal handler '%s'.", handler_name); + else { + if (after) + gtk_signal_connect_after(object, signal_name, func, (gpointer) data->property); + else + gtk_signal_connect(object, signal_name, func, (gpointer) data->property); + } +} + +static GstEditorProperty *gst_editor_property_new() { + GstEditorProperty *property; + GtkWidget *property_window; + connect_struct data; + GModule *symbols; + + property = GST_EDITOR_PROPERTY(gtk_type_new(GST_TYPE_EDITOR_PROPERTY)); + + symbols = g_module_open(NULL, 0); + + data.property = property; + data.symbols = symbols; + + property->xml = glade_xml_new("editor.glade", "property_window"); + glade_xml_signal_autoconnect_full (property->xml, gst_editor_property_connect_func, &data); + + property_window = glade_xml_get_widget(property->xml, "property_window"); + gtk_widget_show(property_window); + + return property; +} + +GstEditorProperty *gst_editor_property_get() { + if (!_the_property) { + _the_property = gst_editor_property_new(); + } + return _the_property; +} + +static void gst_editor_property_set_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProperty *property; + + /* get the major types of this object */ + property = GST_EDITOR_PROPERTY(object); + + switch (id) { + default: + g_warning("gsteditorproperty: unknown arg!"); + break; + } +} + +static void gst_editor_property_get_arg(GtkObject *object,GtkArg *arg,guint id) { + GstEditorProperty *property; + + /* get the major types of this object */ + property = GST_EDITOR_PROPERTY(object); + + switch (id) { + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void on_name_changed(GtkEntry *entry, GstEditorElement *element) { + gst_editor_element_set_name(element, gtk_entry_get_text(GTK_ENTRY(entry))); +} + +static gchar *make_readable_name(gchar *name) { + gchar *new; + gchar *colon; + gboolean inupper; + gint len, i; + + colon = strstr(name, "::"); + + if (colon) + new = g_strdup(&colon[2]); + else + new = g_strdup(name); + + new = g_strdelimit(new, G_STR_DELIMITERS, ' '); + + len = strlen(new); + inupper = TRUE; + for (i=0; ielement); + if (type != GTK_TYPE_INVALID) { + panel = (GtkWidget *)g_hash_table_lookup(property->panels, GINT_TO_POINTER(type)); + vbox = glade_xml_get_widget(property->xml, "property_vbox"); + + if (panel && property->current == (gpointer) panel) return; + + if (property->current) + gtk_container_remove(GTK_CONTAINER(vbox), GTK_WIDGET(property->current)); + + if (panel) { + gtk_box_pack_start(GTK_BOX(vbox), panel, FALSE, TRUE, 0); + property->current = (gpointer) panel; + } + else { + GtkArg *args; + guint32 *flags; + guint num_args, i; + gchar *text; + + table = gtk_table_new(1, 2, TRUE); + gtk_widget_show(table); + + label = gtk_label_new("Name:"); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_widget_show(label); + entry = gtk_entry_new(); + gtk_widget_show(entry); + gtk_entry_set_text(GTK_ENTRY(entry), gst_element_get_name(element->element)); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); + gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL|GTK_EXPAND, 0, 0, 0); + + gtk_signal_connect(GTK_OBJECT(entry), "changed", on_name_changed, element); + + args = gtk_object_query_args(type, &flags, &num_args); + for (i=0; ielement), 1, &args[i]); + + label = gtk_label_new(g_strconcat(make_readable_name(args[i].name), ":", NULL)); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_widget_show(label); + entry = gtk_entry_new(); + if (args[i].type == GTK_TYPE_STRING) { + text = GTK_VALUE_STRING(args[i]); + if (text) + gtk_entry_set_text(GTK_ENTRY(entry), GTK_VALUE_STRING(args[i])); + } + gtk_widget_show(entry); + + gtk_table_attach(GTK_TABLE(table), label, 0, 1, i+1, i+2, GTK_FILL, 0, 0, 0); + gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i+1, i+2, GTK_FILL|GTK_EXPAND, 0, 0, 0); + } + } + gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, TRUE, 0); + g_hash_table_insert(property->panels, GINT_TO_POINTER(type), table); + gtk_object_ref(GTK_OBJECT(table)); + property->current = (gpointer) table; + } + } +} + + + + + + + + + + + + + + + + + + diff --git a/editor/gsteditorproperty.h b/editor/gsteditorproperty.h new file mode 100644 index 0000000000..8fadde8b8c --- /dev/null +++ b/editor/gsteditorproperty.h @@ -0,0 +1,65 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef __GST_EDITOR_PROPERTY_H__ +#define __GST_EDITOR_PROPERTY_H__ + +#include +#include +#include "gsteditor.h" + +#define GST_TYPE_EDITOR_PROPERTY \ + (gst_editor_property_get_type()) +#define GST_EDITOR_PROPERTY(obj) \ + (GTK_CHECK_CAST((obj),GST_TYPE_EDITOR_PROPERTY,GstEditorProperty)) +#define GST_EDITOR_PROPERTY_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EDITOR_PROPERTY,GstEditorProperty)) +#define GST_IS_EDITOR_PROPERTY(obj) \ + (GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PROPERTY)) +#define GST_IS_EDITOR_PROPERTY_CLASS(obj) \ + (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR_PROPERTY)) + +typedef struct _GstEditorProperty GstEditorProperty; +typedef struct _GstEditorPropertyClass GstEditorPropertyClass; + +struct _GstEditorProperty { + GtkObject object; + + GladeXML *xml; + GHashTable *panels; + gpointer *current; +}; + +struct _GstEditorPropertyClass { + GtkObjectClass parent_class; + + void (*element_selected) (GstEditorProperty *property, + GstEditorElement *element); + void (*in_selection_mode) (GstEditorProperty *property, + GstEditorElement *element); +}; + +GtkType gst_editor_property_get_type(); +GstEditorProperty *gst_editor_property_get(); + +void gst_editor_property_show(GstEditorProperty *property, GstEditorElement *element); + + +#endif /* __GST_EDITOR_PROPERTY_H__ */ diff --git a/editor/pixmaps/bin.xpm b/editor/pixmaps/bin.xpm new file mode 100644 index 0000000000..de51f8740c --- /dev/null +++ b/editor/pixmaps/bin.xpm @@ -0,0 +1,140 @@ +/* XPM */ +static char * bin_xpm[] = { +"21 21 116 2", +" c None", +". c #7B7B7B", +"+ c #D6D6D6", +"@ c #E5E3DF", +"# c #CAC6BF", +"$ c #EBEAE7", +"% c #000000", +"& c #FFFFFF", +"* c #DBD8D4", +"= c #B4AEA5", +"- c #867C6D", +"; c #544C3F", +"> c #726755", +", c #796E5D", +"' c #A6A096", +") c #C8C4BC", +"! c #C1BFB9", +"~ c #867F6F", +"{ c #514238", +"] c #706757", +"^ c #5C5446", +"/ c #706A5F", +"( c #B8B6B1", +"_ c #E2E2E0", +": c #9A9178", +"< c #D2C398", +"[ c #AB9976", +"} c #907F68", +"| c #716150", +"1 c #685F51", +"2 c #706656", +"3 c #796F5D", +"4 c #817562", +"5 c #9B8C76", +"6 c #867B6A", +"7 c #645F55", +"8 c #AAA492", +"9 c #CEBF94", +"0 c #D4C494", +"a c #D3C494", +"b c #D4C396", +"c c #C9B48D", +"d c #7B6B55", +"e c #6E5F50", +"f c #8C7F6A", +"g c #9B8C75", +"h c #9C8C74", +"i c #9C8C73", +"j c #9A8A74", +"k c #D2D1CE", +"l c #A69E84", +"m c #D1C293", +"n c #D4C493", +"o c #C2B58B", +"p c #756C52", +"q c #544B39", +"r c #92846E", +"s c #92846F", +"t c #605749", +"u c #D9D7D0", +"v c #908970", +"w c #C8BA90", +"x c #D3C395", +"y c #797153", +"z c #827B62", +"A c #6E634F", +"B c #574E3F", +"C c #9B8B73", +"D c #988872", +"E c #685E4E", +"F c #443F35", +"G c #272621", +"H c #8B887E", +"I c #716A50", +"J c #867C5C", +"K c #A89C7A", +"L c #696249", +"M c #988F72", +"N c #84775F", +"O c #544C3D", +"P c #726959", +"Q c #49453B", +"R c #4E4A3F", +"S c #423E35", +"T c #AAA9A2", +"U c #9F987F", +"V c #857E63", +"W c #655E46", +"X c #92896B", +"Y c #AAA080", +"Z c #81735A", +"` c #7C725F", +" . c #47443B", +".. c #625C4E", +"+. c #897E6D", +"@. c #A29E98", +"#. c #C3C0BA", +"$. c #8D8777", +"%. c #A2987B", +"&. c #A99C7A", +"*. c #B4A885", +"=. c #7E7157", +"-. c #928570", +";. c #544F44", +">. c #6E675A", +",. c #7E786D", +"'. c #C3C1BB", +"). c #9D947D", +"!. c #AEA182", +"~. c #887A63", +"{. c #867A68", +"]. c #7E796F", +"^. c #AFADAA", +"/. c #BDB9AE", +"(. c #A09A91", +"_. c #CECBC8", +" ", +" ", +" ", +". . . . . . . . . . . . . . . . . . . ", +". + + + + + + + + + + @ # $ + + + + . % ", +". + . & . . & & * = - ; ; > , ' ) & . % ", +". + . . . . ! ~ { > > ; ; ; ; ] ^ / ( % ", +". + & & & _ : < [ } | > ; 1 2 3 4 5 6 7 ", +". + & & & 8 9 0 a b c d e f g h i i j 7 ", +". + & & k l m n n 0 o p q r i i i s t 7 ", +". + & & & u v w a x y z A B C D E F G % ", +". + & & & & H I J K L M N O P ; Q R S % ", +". + & & & & T U V W X Y Z ` . ...+.@.% ", +". + + + + + + #.$.%.&.*.=.-.;.>.,.@.. % ", +". + % + & + % % . '.).!.~.{.].^.& & . % ", +". + % % . + % % . + & /.(._.& & & & . % ", +". + % + & + % % . + & & & & & & & & . % ", +". . . . . . . . . . . . . . . . . . . % ", +" % % % % % % % % % % % % % % % % % % % ", +" ", +" "}; diff --git a/editor/pixmaps/element.xpm b/editor/pixmaps/element.xpm new file mode 100644 index 0000000000..7648707349 --- /dev/null +++ b/editor/pixmaps/element.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * element_xpm[] = { +"21 21 5 1", +" c None", +". c #7B7B7B", +"+ c #D6D6D6", +"@ c #000000", +"# c #FFFFFF", +" ", +" ", +" ", +"................... ", +".+++++++++++++++++.@ ", +".+.#..############.@ ", +".+.....###########.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+++++++++########.@ ", +".+@+#+@@.+########.@ ", +".+@@.+@@.+########.@ ", +".+@+#+@@.+########.@ ", +"...................@ ", +" @@@@@@@@@@@@@@@@@@@ ", +" ", +" "}; diff --git a/editor/pixmaps/pipeline.xpm b/editor/pixmaps/pipeline.xpm new file mode 100644 index 0000000000..566fe7defc --- /dev/null +++ b/editor/pixmaps/pipeline.xpm @@ -0,0 +1,118 @@ +/* XPM */ +static char * pipeline_xpm[] = { +"21 21 94 2", +" c None", +". c #7B7B7B", +"+ c #A8ABA5", +"@ c #D6D6D6", +"# c #CACBC9", +"$ c #424B3B", +"% c #819373", +"& c #606959", +"* c #000000", +"= c #FFFFFF", +"- c #C5C6C4", +"; c #475242", +"> c #99AF87", +", c #667855", +"' c #4C5641", +") c #A0A19E", +"! c #C8C7C5", +"~ c #4E5847", +"{ c #96AE85", +"] c #7B9369", +"^ c #58664B", +"/ c #373A32", +"( c #C1C2C0", +"_ c #3A382F", +": c #97AE86", +"< c #7E996B", +"[ c #5D6E4F", +"} c #31362C", +"| c #D1D2CF", +"1 c #C6C7C5", +"2 c #6A7261", +"3 c #757E68", +"4 c #8A9778", +"5 c #627651", +"6 c #607252", +"7 c #32382D", +"8 c #CCCCCA", +"9 c #7B8571", +"0 c #ADC29C", +"a c #A6BE95", +"b c #889B74", +"c c #586A47", +"d c #343B2D", +"e c #B8B8B8", +"f c #91948E", +"g c #A7BA96", +"h c #9EB78D", +"i c #8AA079", +"j c #6D8459", +"k c #5A6B4D", +"l c #7E7F7B", +"m c #606355", +"n c #889976", +"o c #768A65", +"p c #687D57", +"q c #697D57", +"r c #525A48", +"s c #CFCFCD", +"t c #7B8177", +"u c #93A685", +"v c #748C60", +"w c #5C6F4C", +"x c #697A5A", +"y c #4F5A44", +"z c #A1A39D", +"A c #878E83", +"B c #A0B094", +"C c #92AC80", +"D c #6B825A", +"E c #3E4934", +"F c #464940", +"G c #B1B1AE", +"H c #8C9385", +"I c #8A987D", +"J c #9AB188", +"K c #6C825A", +"L c #525E46", +"M c #6F726B", +"N c #A8A8A5", +"O c #7E8676", +"P c #91A282", +"Q c #5D6F4D", +"R c #556148", +"S c #666960", +"T c #B6B6B4", +"U c #45463E", +"V c #556049", +"W c #58644B", +"X c #65675E", +"Y c #E1E1E1", +"Z c #A9A9A6", +"` c #3C3D34", +" . c #5C5E56", +".. c #1F1F1F", +" ", +" ", +" ", +". . . . . . . . . . . . . . . + + + . ", +". @ @ @ @ @ @ @ @ @ @ @ @ @ # $ % & + * ", +". @ . = . . = = = = = = = - ; > , ' ) * ", +". @ . . . . . = = = = = ! ~ { ] ^ / + * ", +". @ = = = = = = = = = ( _ : < [ } | . * ", +". @ = = = = = = = 1 2 3 4 5 6 7 ( = . * ", +". @ = = = = = = 8 9 0 a b c d e = = . * ", +". @ = = = = = = f g h i j k l = = = . * ", +". @ = = = = = = m n o p q r s = = = . * ", +". @ = = = = = t u v w x y z = = = = . * ", +". @ @ @ @ @ A B C D E F G = = = = = . * ", +". @ * @ = H I J K L M = = = = = = = . * ", +". @ * * N O P Q R S = = = = = = = = . * ", +". @ * @ T U V W X Y = = = = = = = = . * ", +". . . . . Z ` .+ . . . . . . . . . . * ", +" * * * * * . ..* * * * * * * * * * * * ", +" ", +" "}; diff --git a/editor/pixmaps/selector.xpm b/editor/pixmaps/selector.xpm new file mode 100644 index 0000000000..4c39b4dd72 --- /dev/null +++ b/editor/pixmaps/selector.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static char *selector_xpm[] = { +/* columns rows colors chars-per-pixel */ +"21 21 3 1", +" c Gray0", +". c #b3cece", +"X c None", +/* pixels */ +"XXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXX", +"XXXXXX XXXXXXXXXXXXXX", +"XXXXXX XXXXXXXXXXXXX", +"XXXXXX XXXXXXXXXXXX", +"XXXXXX XXXXXXXXXXX", +"XXXXXX XXXXXXXXXX", +"XXXXXX XXXXXXXXX", +"XXXXXX XXXXXXXX", +"XXXXXX XXXXXXX", +"XXXXXX XXXXXX", +"XXXXXX XXXXXXXXX", +"XXXXXX X XXXXXXXXX", +"XXXXXX XXX XXXXXXXX", +"XXXXXXXXXX XXXXXXXX", +"XXXXXXXXXXX XXXXXXX", +"XXXXXXXXXXXX XXXXXXX", +"XXXXXXXXXXXX XXXXXX", +"XXXXXXXXXXXXX XXXXXXX", +"XXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXX" +}; diff --git a/editor/pixmaps/tee.xpm b/editor/pixmaps/tee.xpm new file mode 100644 index 0000000000..7648707349 --- /dev/null +++ b/editor/pixmaps/tee.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * element_xpm[] = { +"21 21 5 1", +" c None", +". c #7B7B7B", +"+ c #D6D6D6", +"@ c #000000", +"# c #FFFFFF", +" ", +" ", +" ", +"................... ", +".+++++++++++++++++.@ ", +".+.#..############.@ ", +".+.....###########.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+################.@ ", +".+++++++++########.@ ", +".+@+#+@@.+########.@ ", +".+@@.+@@.+########.@ ", +".+@+#+@@.+########.@ ", +"...................@ ", +" @@@@@@@@@@@@@@@@@@@ ", +" ", +" "}; diff --git a/editor/pixmaps/thread.xpm b/editor/pixmaps/thread.xpm new file mode 100644 index 0000000000..76af62651d --- /dev/null +++ b/editor/pixmaps/thread.xpm @@ -0,0 +1,110 @@ +/* XPM */ +static char * thread_xpm[] = { +"21 21 86 1", +" c None", +". c #7B7B7B", +"+ c #D6D6D6", +"@ c #FFFFFF", +"# c #CFCFCF", +"$ c #919195", +"% c #929195", +"& c #B2B2B3", +"* c #E7E7E7", +"= c #000000", +"- c #D8D8D9", +"; c #3A3941", +"> c #D0CDDC", +", c #C9C6D7", +"' c #AFACBD", +") c #898694", +"! c #BAB9BC", +"~ c #6D6D70", +"{ c #44414F", +"] c #A7A4B4", +"^ c #C5C2D4", +"/ c #BEBACE", +"( c #B6B2C8", +"_ c #8D899B", +": c #EFEFEF", +"< c #706E7C", +"[ c #787485", +"} c #6A6777", +"| c #898696", +"1 c #AFABC1", +"2 c #A8A3BC", +"3 c #89888E", +"4 c #B7B6B7", +"5 c #8E899F", +"6 c #BFBCCF", +"7 c #8F8C99", +"8 c #565363", +"9 c #464350", +"0 c #595765", +"a c #504D5A", +"b c #B8B8B9", +"c c #838288", +"d c #A7A2BA", +"e c #C8C4D6", +"f c #9692A7", +"g c #585465", +"h c #2D2B35", +"i c #2D2C31", +"j c #5F5C69", +"k c #AEAAC1", +"l c #C7C4D6", +"m c #B9B5CA", +"n c #948FA7", +"o c #5D596C", +"p c #4E4B5C", +"q c #9E9D9F", +"r c #A7A6A9", +"s c #9F9BAF", +"t c #BBB7CC", +"u c #A8A4BB", +"v c #5D5A6A", +"w c #575466", +"x c #39383E", +"y c #B9B9B9", +"z c #A7A6AA", +"A c #7D7A8C", +"B c #9691AA", +"C c #6E6980", +"D c #383643", +"E c #8C8C8D", +"F c #F5F5F5", +"G c #CCCCCD", +"H c #3D3C41", +"I c #67656D", +"J c #908F91", +"K c #838189", +"L c #4A4853", +"M c #706F76", +"N c #44414D", +"O c #18171B", +"P c #4A4851", +"Q c #5D5B68", +"R c #3A393D", +"S c #D7D7D8", +"T c #828282", +"U c #D3D3D3", +" ", +" ", +" ", +"................... ", +".++++++++++@#$%&*@+= ", +".+.@..@@@@@-;>,')!@= ", +".+.....@@@@~{]^/(_#= ", +".+@@@@@@@@:<[}|(123= ", +".+@@@@@@@@4567890ab= ", +".+@@@@@@@@cdeefghi:= ", +".+@@@@@@@@jklmnopq+= ", +".+@@@@@@@@rstuvwx:y= ", +".+@@@@@@@@@zABCDEFy= ", +".+++++++++@G9HIJFF.= ", +".+=+@+==.+-KLFFFF@.= ", +".+==.+==.+MNOFF@@@.= ", +".+=+@+==.+PQRF@@@@.= ", +".........+STUy.....= ", +" =================== ", +" ", +" "};