mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
Initial work for the new editor.
Original commit message from CVS: Initial work for the new editor.
This commit is contained in:
parent
4e7f031df7
commit
712d5d0a48
24 changed files with 3254 additions and 207 deletions
|
@ -1,6 +1,6 @@
|
||||||
LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la
|
LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la
|
||||||
LDFLAGS = $(shell gnome-config --libs gnomeui)
|
LDFLAGS = $(shell gnome-config --libs gnomeui) $(shell libglade-config --libs gnome)
|
||||||
INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir)/gst \
|
INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir)/gst $(shell libglade-config --cflags gnome) \
|
||||||
$(shell gnome-config --cflags gnomeui)
|
$(shell gnome-config --cflags gnomeui)
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,11 +8,16 @@ lib_LTLIBRARIES = libgsteditor.la
|
||||||
|
|
||||||
libgsteditor_la_SOURCES = \
|
libgsteditor_la_SOURCES = \
|
||||||
gsteditor.c \
|
gsteditor.c \
|
||||||
|
gsteditorproject.c \
|
||||||
|
gsteditorprojectview.c \
|
||||||
gsteditorelement.c \
|
gsteditorelement.c \
|
||||||
gsteditorbin.c \
|
gsteditorbin.c \
|
||||||
gsteditorcanvas.c \
|
gsteditorcanvas.c \
|
||||||
gsteditorpad.c \
|
gsteditorpad.c \
|
||||||
gsteditorconnection.c \
|
gsteditorconnection.c \
|
||||||
|
gsteditorimage.c \
|
||||||
|
gsteditorpalette.c \
|
||||||
|
gsteditorproperty.c \
|
||||||
gstelementselect.c \
|
gstelementselect.c \
|
||||||
gsteditorcreate.c
|
gsteditorcreate.c
|
||||||
|
|
||||||
|
@ -27,7 +32,13 @@ gsteditor_LDFLAGS = libgsteditor.la
|
||||||
|
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
|
gsteditorproject.h \
|
||||||
gstelementselect.h \
|
gstelementselect.h \
|
||||||
|
gsteditorpalette.h \
|
||||||
|
gsteditorproperty.h \
|
||||||
|
gsteditorimage.h \
|
||||||
gsteditorcreate.h
|
gsteditorcreate.h
|
||||||
|
|
||||||
|
CFLAGS = -O2 -Wall
|
||||||
|
|
||||||
EXTRA_DIST = editor.glade editorelement.glade
|
EXTRA_DIST = editor.glade editorelement.glade
|
||||||
|
|
|
@ -18,33 +18,32 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <glade/glade.h>
|
||||||
#include <gnome.h>
|
|
||||||
#include <libgnomeui/gnome-canvas.h>
|
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
#include "gsteditor.h"
|
#include "gsteditor.h"
|
||||||
|
#include "gsteditorproject.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
extern gboolean _gst_plugin_spew;
|
extern gboolean _gst_plugin_spew;
|
||||||
|
|
||||||
int main(int argc,char *argv[]) {
|
int main(int argc,char *argv[]) {
|
||||||
GtkWidget *appwindow;
|
GstEditorProject *project;
|
||||||
GstEditor *editor;
|
|
||||||
|
bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
|
||||||
|
textdomain (PACKAGE);
|
||||||
|
|
||||||
_gst_plugin_spew = TRUE;
|
_gst_plugin_spew = TRUE;
|
||||||
gst_init(&argc,&argv);
|
gst_init(&argc,&argv);
|
||||||
gst_plugin_load_all();
|
gst_plugin_load_all();
|
||||||
gst_plugin_load("gstelements");
|
gst_plugin_load("gstelements");
|
||||||
gnome_init("GST Graph Editor",VERSION,argc,argv);
|
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");
|
project = gst_editor_project_new();
|
||||||
gtk_widget_set_usize(GTK_WIDGET(editor),250,250);
|
gst_editor_project_view_new(project);
|
||||||
gnome_app_set_contents(GNOME_APP(appwindow),GTK_WIDGET(editor));
|
|
||||||
gtk_widget_show_all(appwindow);
|
|
||||||
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
|
|
1343
editor/editor.glade
1343
editor/editor.glade
File diff suppressed because it is too large
Load diff
54
editor/editor.ts
Normal file
54
editor/editor.ts
Normal file
|
@ -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");
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
/* signals and args */
|
/* signals and args */
|
||||||
enum {
|
enum {
|
||||||
|
NAME_CHANGED,
|
||||||
LAST_SIGNAL
|
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 void gst_editor_get_arg(GtkObject *object,GtkArg *arg,guint id);
|
||||||
|
|
||||||
static GtkFrame *parent_class = NULL;
|
static GtkFrame *parent_class = NULL;
|
||||||
|
static guint gst_editor_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
GtkType gst_editor_get_type(void) {
|
GtkType gst_editor_get_type(void) {
|
||||||
static GtkType editor_type = 0;
|
static GtkType editor_type = 0;
|
||||||
|
@ -56,7 +58,7 @@ GtkType gst_editor_get_type(void) {
|
||||||
NULL,
|
NULL,
|
||||||
(GtkClassInitFunc)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;
|
return editor_type;
|
||||||
}
|
}
|
||||||
|
@ -66,37 +68,29 @@ static void gst_editor_class_init(GstEditorClass *klass) {
|
||||||
|
|
||||||
object_class = (GtkObjectClass*)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_object_add_arg_type("GstEditor::name",GTK_TYPE_STRING,
|
||||||
GTK_ARG_READWRITE,ARG_NAME);
|
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->set_arg = gst_editor_set_arg;
|
||||||
object_class->get_arg = gst_editor_get_arg;
|
object_class->get_arg = gst_editor_get_arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_editor_init(GstEditor *editor) {
|
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:
|
* gst_editor_new:
|
||||||
* name: name of editor frame
|
* name: name of editor frame
|
||||||
|
@ -105,22 +99,52 @@ static void gst_editor_init(GstEditor *editor) {
|
||||||
*
|
*
|
||||||
* Returns: Freshly created GstEditor widget.
|
* Returns: Freshly created GstEditor widget.
|
||||||
*/
|
*/
|
||||||
GstEditor *gst_editor_new(gchar *name) {
|
GstEditor *gst_editor_new(GstElement *element) {
|
||||||
GstEditor *editor;
|
GstEditor *editor;
|
||||||
|
|
||||||
|
g_return_val_if_fail(element != NULL, NULL);
|
||||||
|
|
||||||
editor = gtk_type_new(gst_editor_get_type());
|
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;
|
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) {
|
static void gst_editor_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
||||||
GstEditor *editor = GST_EDITOR(object);
|
GstEditor *editor = GST_EDITOR(object);
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case ARG_NAME:
|
case ARG_NAME:
|
||||||
gtk_object_set(GTK_OBJECT(editor),"label",GTK_VALUE_STRING(*arg),NULL);
|
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));
|
GTK_VALUE_STRING(*arg));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -135,7 +159,7 @@ static void gst_editor_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case ARG_NAME:
|
case ARG_NAME:
|
||||||
GTK_VALUE_STRING(*arg) =
|
GTK_VALUE_STRING(*arg) =
|
||||||
gst_element_get_name(GST_ELEMENT(editor->pipeline));
|
gst_element_get_name(GST_ELEMENT(editor->element));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
arg->type = GTK_TYPE_INVALID;
|
arg->type = GTK_TYPE_INVALID;
|
||||||
|
|
|
@ -49,14 +49,14 @@ typedef struct _GstEditorConnectionClass GstEditorConnectionClass;
|
||||||
#define GST_IS_EDITOR(obj) \
|
#define GST_IS_EDITOR(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR))
|
||||||
#define GST_IS_EDITOR_CLASS(obj) \
|
#define GST_IS_EDITOR_CLASS(obj) \
|
||||||
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR)))
|
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EDITOR))
|
||||||
|
|
||||||
|
|
||||||
struct _GstEditor {
|
struct _GstEditor {
|
||||||
GtkFrame frame;
|
GtkWindow window;
|
||||||
|
|
||||||
/* the actual pipeline to be associated with this thing */
|
/* the actual element to be associated with this thing */
|
||||||
GstElement *pipeline;
|
GstElement *element;
|
||||||
|
|
||||||
/* the editor canvas */
|
/* the editor canvas */
|
||||||
GstEditorCanvas *canvas;
|
GstEditorCanvas *canvas;
|
||||||
|
@ -67,13 +67,16 @@ struct _GstEditor {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstEditorClass {
|
struct _GstEditorClass {
|
||||||
GnomeCanvasClass parent_class;
|
GtkWindowClass parent_class;
|
||||||
|
|
||||||
|
void (*name_changed) (GstEditor *editor);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GtkType gst_editor_get_type();
|
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) \
|
#define GST_EDITOR_SET_OBJECT(item,object) \
|
||||||
|
@ -92,7 +95,7 @@ GstEditor *gst_editor_new(gchar *name);
|
||||||
#define GST_IS_EDITOR_ELEMENT(obj) \
|
#define GST_IS_EDITOR_ELEMENT(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_ELEMENT))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_ELEMENT))
|
||||||
#define GST_IS_EDITOR_ELEMENT_CLASS(obj) \
|
#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_PARENT(obj) (GST_EDITOR_ELEMENT(obj)->parent)
|
||||||
#define GST_EDITOR_ELEMENT_GROUP(obj) (GST_EDITOR_ELEMENT(obj)->group)
|
#define GST_EDITOR_ELEMENT_GROUP(obj) (GST_EDITOR_ELEMENT(obj)->group)
|
||||||
|
@ -121,8 +124,6 @@ struct _GstEditorElement {
|
||||||
gdouble width,height; // size
|
gdouble width,height; // size
|
||||||
GnomeCanvasItem *border,*title,*resizebox; // easy ones
|
GnomeCanvasItem *border,*title,*resizebox; // easy ones
|
||||||
GnomeCanvasItem *statebox[4],*statetext[4]; // GST_STATE_*
|
GnomeCanvasItem *statebox[4],*statetext[4]; // GST_STATE_*
|
||||||
GnomeCanvasItem *playbox,*playtext; // playstate
|
|
||||||
gboolean states[5]; // visual states
|
|
||||||
|
|
||||||
gdouble insidewidth,insideheight; // minimum space inside
|
gdouble insidewidth,insideheight; // minimum space inside
|
||||||
gdouble minwidth,minheight; // minimum size
|
gdouble minwidth,minheight; // minimum size
|
||||||
|
@ -148,6 +149,7 @@ struct _GstEditorElement {
|
||||||
struct _GstEditorElementClass {
|
struct _GstEditorElementClass {
|
||||||
GnomeCanvasGroupClass parent_class;
|
GnomeCanvasGroupClass parent_class;
|
||||||
|
|
||||||
|
void (*name_changed) (GstEditorElement *element);
|
||||||
void (*realize) (GstEditorElement *element);
|
void (*realize) (GstEditorElement *element);
|
||||||
gint (*event) (GnomeCanvasItem *item,GdkEvent *event,
|
gint (*event) (GnomeCanvasItem *item,GdkEvent *event,
|
||||||
GstEditorElement *element);
|
GstEditorElement *element);
|
||||||
|
@ -167,6 +169,9 @@ void gst_editor_element_construct(GstEditorElement *element,
|
||||||
void gst_editor_element_repack(GstEditorElement *element);
|
void gst_editor_element_repack(GstEditorElement *element);
|
||||||
GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element,
|
GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element,
|
||||||
GstPad *pad);
|
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 \
|
#define GST_TYPE_EDITOR_BIN \
|
||||||
|
@ -178,7 +183,7 @@ GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element,
|
||||||
#define GST_IS_EDITOR_BIN(obj) \
|
#define GST_IS_EDITOR_BIN(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_BIN))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_BIN))
|
||||||
#define GST_IS_EDITOR_BIN_CLASS(obj) \
|
#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 {
|
struct _GstEditorBin {
|
||||||
GstEditorElement element;
|
GstEditorElement element;
|
||||||
|
@ -216,7 +221,7 @@ GstEditorBin *gst_editor_bin_new(GstEditorBin *parent,GstBin *bin,
|
||||||
#define GST_IS_EDITOR_CANVAS(obj) \
|
#define GST_IS_EDITOR_CANVAS(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CANVAS))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CANVAS))
|
||||||
#define GST_IS_EDITOR_CANVAS_CLASS(obj) \
|
#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 {
|
struct _GstEditorCanvas {
|
||||||
|
@ -248,7 +253,7 @@ void gst_editor_bin_add(GstEditorBin *parent,GstEditorElement *element);
|
||||||
#define GST_IS_EDITOR_PAD(obj) \
|
#define GST_IS_EDITOR_PAD(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD))
|
||||||
#define GST_IS_EDITOR_PAD_CLASS(obj) \
|
#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 {
|
struct _GstEditorPad {
|
||||||
GtkObject object;
|
GtkObject object;
|
||||||
|
@ -314,7 +319,7 @@ void gst_editor_pad_repack(GstEditorPad *pad);
|
||||||
#define GST_IS_EDITOR_CONNECTION(obj) \
|
#define GST_IS_EDITOR_CONNECTION(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CONNECTION))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_CONNECTION))
|
||||||
#define GST_IS_EDITOR_CONNECTION_CLASS(obj) \
|
#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 {
|
struct _GstEditorConnection {
|
||||||
GtkObject object;
|
GtkObject object;
|
||||||
|
|
|
@ -90,6 +90,7 @@ static void gst_editor_canvas_init(GstEditorCanvas *editorcanvas) {
|
||||||
GstEditorCanvas *gst_editor_canvas_new(GstBin *bin,
|
GstEditorCanvas *gst_editor_canvas_new(GstBin *bin,
|
||||||
const gchar *first_arg_name,...) {
|
const gchar *first_arg_name,...) {
|
||||||
GstEditorCanvas *editorcanvas;
|
GstEditorCanvas *editorcanvas;
|
||||||
|
GstEditorBin *bin2;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail(bin != NULL);
|
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));
|
editorcanvas = GST_EDITOR_CANVAS(gtk_type_new(GST_TYPE_EDITOR_CANVAS));
|
||||||
GST_EDITOR_ELEMENT(editorcanvas)->element = GST_ELEMENT(bin);
|
GST_EDITOR_ELEMENT(editorcanvas)->element = GST_ELEMENT(bin);
|
||||||
|
GST_EDITOR_ELEMENT(editorcanvas)->parent = editorcanvas;
|
||||||
|
|
||||||
va_start(args,first_arg_name);
|
va_start(args,first_arg_name);
|
||||||
gst_editor_element_construct(GST_EDITOR_ELEMENT(editorcanvas),NULL,
|
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);
|
element->group = gnome_canvas_root(canvas->canvas);
|
||||||
|
|
||||||
gnome_canvas_item_new(element->group,gnome_canvas_rect_get_type(),
|
if (GST_EDITOR_ELEMENT_CLASS(parent_class)->realize) {
|
||||||
"width_units",1.0,"fill_color","white",
|
GST_EDITOR_ELEMENT_CLASS(parent_class)->realize(element);
|
||||||
"outline_color","black",
|
}
|
||||||
"x1",-2.0,"y1",-2.0,"x2",2.0,"y2",2.0,NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_editor_canvas_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
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);
|
GstEditorBin *bin = GST_EDITOR_BIN(element);
|
||||||
GstEditorCanvas *canvas = GST_EDITOR_CANVAS(element);
|
GstEditorCanvas *canvas = GST_EDITOR_CANVAS(element);
|
||||||
|
|
||||||
// g_print("canvas got event %d at %.2fx%.2f\n",event->type,
|
//g_print("canvas got event %d at %.2fx%.2f\n",event->type,
|
||||||
// event->button.x,event->button.y);
|
// event->button.x,event->button.y);
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case GDK_BUTTON_RELEASE:
|
case GDK_BUTTON_RELEASE:
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include <gst/gstutils.h>
|
#include <gst/gstutils.h>
|
||||||
|
|
||||||
#include "gsteditor.h"
|
#include "gsteditor.h"
|
||||||
|
#include "gsteditorproject.h"
|
||||||
|
#include "gsteditorproperty.h"
|
||||||
|
|
||||||
/* class functions */
|
/* class functions */
|
||||||
static void gst_editor_element_class_init(GstEditorElementClass *klass);
|
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);
|
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 {
|
enum {
|
||||||
ARG_0,
|
ARG_0,
|
||||||
|
@ -77,6 +85,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
NAME_CHANGED,
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -109,6 +118,14 @@ static void gst_editor_element_class_init(GstEditorElementClass *klass) {
|
||||||
|
|
||||||
parent_class = gtk_type_class(gtk_object_get_type());
|
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_object_add_arg_type("GstEditorElement::x",GTK_TYPE_DOUBLE,
|
||||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT_ONLY,
|
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT_ONLY,
|
||||||
ARG_X);
|
ARG_X);
|
||||||
|
@ -148,10 +165,10 @@ GstEditorElement *gst_editor_element_new(GstEditorBin *parent,
|
||||||
GstEditorElement *editorelement;
|
GstEditorElement *editorelement;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail(parent != NULL);
|
g_return_val_if_fail(parent != NULL, NULL);
|
||||||
g_return_if_fail(GST_IS_EDITOR_BIN(parent));
|
g_return_val_if_fail(GST_IS_EDITOR_BIN(parent), NULL);
|
||||||
g_return_if_fail(element != NULL);
|
g_return_val_if_fail(element != NULL, NULL);
|
||||||
g_return_if_fail(GST_IS_ELEMENT(element));
|
g_return_val_if_fail(GST_IS_ELEMENT(element), NULL);
|
||||||
|
|
||||||
editorelement = GST_EDITOR_ELEMENT(gtk_type_new(GST_TYPE_EDITOR_ELEMENT));
|
editorelement = GST_EDITOR_ELEMENT(gtk_type_new(GST_TYPE_EDITOR_ELEMENT));
|
||||||
editorelement->element = element;
|
editorelement->element = element;
|
||||||
|
@ -163,6 +180,22 @@ GstEditorElement *gst_editor_element_new(GstEditorBin *parent,
|
||||||
return editorelement;
|
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,
|
void gst_editor_element_construct(GstEditorElement *element,
|
||||||
GstEditorBin *parent,
|
GstEditorBin *parent,
|
||||||
const gchar *first_arg_name,
|
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) {
|
static void gst_editor_element_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
||||||
GstEditorElement *element;
|
GstEditorElement *element;
|
||||||
gdouble dx,dy,newwidth,newheight;
|
|
||||||
|
|
||||||
/* get the major types of this object */
|
/* get the major types of this object */
|
||||||
element = GST_EDITOR_ELEMENT(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,
|
"x1",0.0,"y1",0.0,"x2",0.0,"y2",0.0,
|
||||||
NULL);
|
NULL);
|
||||||
g_return_if_fail(element->statebox[i] != NULL);
|
g_return_if_fail(element->statebox[i] != NULL);
|
||||||
|
|
||||||
GST_EDITOR_SET_OBJECT(element->statebox[i],element);
|
GST_EDITOR_SET_OBJECT(element->statebox[i],element);
|
||||||
gtk_signal_connect(GTK_OBJECT(element->statebox[i]),"event",
|
gtk_signal_connect(GTK_OBJECT(element->statebox[i]),"event",
|
||||||
GTK_SIGNAL_FUNC(gst_editor_element_state_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),
|
GTK_SIGNAL_FUNC(gst_editor_element_state_event),
|
||||||
GINT_TO_POINTER(i));
|
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
|
// get all the pads
|
||||||
pads = gst_element_get_pad_list(element->element);
|
pads = gst_element_get_pad_list(element->element);
|
||||||
while (pads) {
|
while (pads) {
|
||||||
|
@ -445,6 +455,7 @@ static void gst_editor_element_resize(GstEditorElement *element) {
|
||||||
"text_width") + 2.0;
|
"text_width") + 2.0;
|
||||||
itemheight = gst_util_get_double_arg(GTK_OBJECT(element->title),
|
itemheight = gst_util_get_double_arg(GTK_OBJECT(element->title),
|
||||||
"text_height") + 2.0;
|
"text_height") + 2.0;
|
||||||
|
|
||||||
element->titlewidth = itemwidth;
|
element->titlewidth = itemwidth;
|
||||||
element->titleheight = itemheight;
|
element->titleheight = itemheight;
|
||||||
element->minwidth = MAX(element->minwidth,itemwidth);
|
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;
|
element->statewidth = 0.0;element->stateheight = 0.0;
|
||||||
for (i=0;i<4;i++) {
|
for (i=0;i<4;i++) {
|
||||||
g_return_if_fail(element->statetext[i] != NULL);
|
g_return_if_fail(element->statetext[i] != NULL);
|
||||||
itemwidth = gst_util_get_double_arg(GTK_OBJECT(element->statetext[i]),
|
|
||||||
"text_width") - 2.0;
|
itemwidth = 16.0;
|
||||||
itemwidth = gst_util_get_double_arg(GTK_OBJECT(element->statetext[i]),
|
itemheight = 16.0;
|
||||||
"text_height");
|
|
||||||
element->statewidth = MAX(element->statewidth,itemwidth);
|
element->statewidth = MAX(element->statewidth,itemwidth);
|
||||||
element->stateheight = MAX(element->stateheight,itemheight);
|
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) {
|
void gst_editor_element_repack(GstEditorElement *element) {
|
||||||
GList *pads;
|
GList *pads;
|
||||||
GstPad *pad;
|
|
||||||
GstEditorPad *editorpad;
|
GstEditorPad *editorpad;
|
||||||
gdouble sinkwidth,sinkheight;
|
|
||||||
gint sinks;
|
gint sinks;
|
||||||
gdouble srcwidth,srcheight;
|
|
||||||
gint srcs;
|
gint srcs;
|
||||||
gdouble x1,y1,x2,y2;
|
gdouble x1,y1,x2,y2;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -560,23 +568,13 @@ void gst_editor_element_repack(GstEditorElement *element) {
|
||||||
"x1",x1+(element->statewidth*i),
|
"x1",x1+(element->statewidth*i),
|
||||||
"y1",y2-element->stateheight,
|
"y1",y2-element->stateheight,
|
||||||
"x2",x1+(element->statewidth*(i+1)),"y2",y2,NULL);
|
"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]),
|
gtk_object_set(GTK_OBJECT(element->statetext[i]),
|
||||||
"x",x1+(element->statewidth*i)+2.0,
|
"x",x1+(element->statewidth*i)+2.0,
|
||||||
"y",y2-element->stateheight+1.0,
|
"y",y2-element->stateheight+1.0,
|
||||||
"anchor",GTK_ANCHOR_NORTH_WEST,NULL);
|
"anchor",GTK_ANCHOR_NORTH_WEST,NULL);
|
||||||
}
|
}
|
||||||
// and the playstate box
|
gst_editor_element_sync_state(element);
|
||||||
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);
|
|
||||||
|
|
||||||
// now we try to place all the pads
|
// now we try to place all the pads
|
||||||
sinks = element->sinks;
|
sinks = element->sinks;
|
||||||
|
@ -636,7 +634,14 @@ GstEditorPad *gst_editor_element_add_pad(GstEditorElement *element,
|
||||||
static gint gst_editor_element_group_event(GnomeCanvasItem *item,
|
static gint gst_editor_element_group_event(GnomeCanvasItem *item,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
GstEditorElement *element) {
|
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)
|
if (GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(element)->klass)->event)
|
||||||
return (GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(element)->klass)->event)(
|
return (GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(element)->klass)->event)(
|
||||||
item,event,element);
|
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,
|
static gint gst_editor_element_event(GnomeCanvasItem *item,GdkEvent *event,
|
||||||
GstEditorElement *element) {
|
GstEditorElement *element) {
|
||||||
gdouble item_x,item_y,dx,dy;
|
gdouble dx,dy;
|
||||||
GdkCursor *fleur;
|
GdkCursor *fleur;
|
||||||
|
|
||||||
// g_print("element in event, type %d\n",event->type);
|
// 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;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case GDK_BUTTON_RELEASE:
|
case GDK_BUTTON_RELEASE:
|
||||||
if (id < 5) {
|
if (id < 4) {
|
||||||
element->states[id] = !element->states[id];
|
|
||||||
gst_editor_element_set_state(element,id,TRUE);
|
gst_editor_element_set_state(element,id,TRUE);
|
||||||
} else
|
} else
|
||||||
g_warning("Uh, shouldn't have gotten here, unknown state\n");
|
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,
|
static void gst_editor_element_set_state(GstEditorElement *element,
|
||||||
gint id,gboolean set) {
|
gint id,gboolean set) {
|
||||||
gboolean stateset = TRUE; /* if we have no element, set anyway */
|
gboolean stateset = TRUE; /* if we have no element, set anyway */
|
||||||
if (element->states[id]) {
|
//g_print("element set state %d\n", id);
|
||||||
/* set the object state */
|
if (element->element)
|
||||||
if (set && element->element)
|
stateset = gst_element_set_state(element->element,_gst_element_states[id]);
|
||||||
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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gst_editor_element_state_change(GstElement *element,
|
static void gst_editor_element_state_change(GstElement *element,
|
||||||
gint state,
|
gint state,
|
||||||
GstEditorElement *editorelement) {
|
GstEditorElement *editorelement) {
|
||||||
gint id;
|
|
||||||
|
|
||||||
g_return_if_fail(editorelement != NULL);
|
g_return_if_fail(editorelement != NULL);
|
||||||
|
|
||||||
// g_print("gst_editor_element_state_change got state 0x%08x\n",state);
|
//g_print("gst_editor_element_state_change got state 0x%08x\n",state);
|
||||||
// if it's an unset
|
gst_editor_element_sync_state(editorelement);
|
||||||
#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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_editor_element_sync_state(GstEditorElement *element) {
|
static void gst_editor_element_sync_state(GstEditorElement *element) {
|
||||||
gint id;
|
gint id;
|
||||||
|
GstElementState state = GST_STATE(element->element);
|
||||||
|
|
||||||
// g_print("syncronizing state\n");
|
for (id=0;id<4;id++) {
|
||||||
for (id=0;id<5;id++) {
|
if (_gst_element_states[id] == state) {
|
||||||
element->states[id] = GST_FLAG_IS_SET(element->element,1<<id);
|
gtk_object_set(GTK_OBJECT(element->statebox[id]),
|
||||||
gst_editor_element_set_state(element,id,FALSE);
|
"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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
72
editor/gsteditorimage.c
Normal file
72
editor/gsteditorimage.c
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gnome.h>
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#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<TYPES_SIZE; i++) {
|
||||||
|
if (_image_types[i].gtktype() == type) {
|
||||||
|
return gst_editor_image_get(_image_types[i].type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return gst_editor_image_get(GST_EDITOR_IMAGE_ELEMENT);
|
||||||
|
}
|
52
editor/gsteditorimage.h
Normal file
52
editor/gsteditorimage.h
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gst/gst.h>
|
||||||
|
|
||||||
|
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__ */
|
|
@ -32,7 +32,7 @@
|
||||||
#define GST_IS_EDITOR_PAD(obj) \
|
#define GST_IS_EDITOR_PAD(obj) \
|
||||||
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD))
|
(GTK_CHECK_TYPE((obj),GST_TYPE_EDITOR_PAD))
|
||||||
#define GST_IS_EDITOR_PAD_CLASS(obj) \
|
#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 _GstEditorPad GstEditorPad;
|
||||||
typedef struct _GstEditorPadClass GstEditorPadClass;
|
typedef struct _GstEditorPadClass GstEditorPadClass;
|
||||||
|
|
242
editor/gsteditorpalette.c
Normal file
242
editor/gsteditorpalette.c
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gnome.h>
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#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; i<CORE_ELEMENT_SIZE; i++) {
|
||||||
|
button = gtk_button_new();
|
||||||
|
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
|
||||||
|
editimage = gst_editor_image_get_for_type(_palette_contents_core[i].type());
|
||||||
|
image = gtk_pixmap_new(editimage->pixmap, 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
63
editor/gsteditorpalette.h
Normal file
63
editor/gsteditorpalette.h
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gst/gst.h>
|
||||||
|
#include <glade/glade.h>
|
||||||
|
#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__ */
|
160
editor/gsteditorproject.c
Normal file
160
editor/gsteditorproject.c
Normal file
|
@ -0,0 +1,160 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gnome.h>
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#include <glade/glade.h>
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
94
editor/gsteditorproject.h
Normal file
94
editor/gsteditorproject.h
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gst/gst.h>
|
||||||
|
#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__ */
|
211
editor/gsteditorprojectview.c
Normal file
211
editor/gsteditorprojectview.c
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gnome.h>
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#include <glade/glade.h>
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
294
editor/gsteditorproperty.c
Normal file
294
editor/gsteditorproperty.c
Normal file
|
@ -0,0 +1,294 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gnome.h>
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#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; i<len; i++) {
|
||||||
|
if (inupper) new[i] = toupper(new[i]);
|
||||||
|
inupper = FALSE;
|
||||||
|
if (new[i] == ' ')
|
||||||
|
inupper = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gst_editor_property_show(GstEditorProperty *property, GstEditorElement *element) {
|
||||||
|
GtkType type;
|
||||||
|
GtkWidget *table, *vbox;
|
||||||
|
GtkWidget *label, *entry, *panel = NULL;
|
||||||
|
|
||||||
|
type = GTK_OBJECT_TYPE(element->element);
|
||||||
|
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; i<num_args; i++) {
|
||||||
|
if (flags && GTK_ARG_READABLE) {
|
||||||
|
gtk_object_getv(GTK_OBJECT(element->element), 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
65
editor/gsteditorproperty.h
Normal file
65
editor/gsteditorproperty.h
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/* Gnome-Streamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
*
|
||||||
|
* 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 <gst/gst.h>
|
||||||
|
#include <glade/glade.h>
|
||||||
|
#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__ */
|
140
editor/pixmaps/bin.xpm
Normal file
140
editor/pixmaps/bin.xpm
Normal file
|
@ -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 ` . ...+.@.% ",
|
||||||
|
". + + + + + + #.$.%.&.*.=.-.;.>.,.@.. % ",
|
||||||
|
". + % + & + % % . '.).!.~.{.].^.& & . % ",
|
||||||
|
". + % % . + % % . + & /.(._.& & & & . % ",
|
||||||
|
". + % + & + % % . + & & & & & & & & . % ",
|
||||||
|
". . . . . . . . . . . . . . . . . . . % ",
|
||||||
|
" % % % % % % % % % % % % % % % % % % % ",
|
||||||
|
" ",
|
||||||
|
" "};
|
29
editor/pixmaps/element.xpm
Normal file
29
editor/pixmaps/element.xpm
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * element_xpm[] = {
|
||||||
|
"21 21 5 1",
|
||||||
|
" c None",
|
||||||
|
". c #7B7B7B",
|
||||||
|
"+ c #D6D6D6",
|
||||||
|
"@ c #000000",
|
||||||
|
"# c #FFFFFF",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
"................... ",
|
||||||
|
".+++++++++++++++++.@ ",
|
||||||
|
".+.#..############.@ ",
|
||||||
|
".+.....###########.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+++++++++########.@ ",
|
||||||
|
".+@+#+@@.+########.@ ",
|
||||||
|
".+@@.+@@.+########.@ ",
|
||||||
|
".+@+#+@@.+########.@ ",
|
||||||
|
"...................@ ",
|
||||||
|
" @@@@@@@@@@@@@@@@@@@ ",
|
||||||
|
" ",
|
||||||
|
" "};
|
118
editor/pixmaps/pipeline.xpm
Normal file
118
editor/pixmaps/pipeline.xpm
Normal file
|
@ -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 ` .+ . . . . . . . . . . * ",
|
||||||
|
" * * * * * . ..* * * * * * * * * * * * ",
|
||||||
|
" ",
|
||||||
|
" "};
|
30
editor/pixmaps/selector.xpm
Normal file
30
editor/pixmaps/selector.xpm
Normal file
|
@ -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"
|
||||||
|
};
|
29
editor/pixmaps/tee.xpm
Normal file
29
editor/pixmaps/tee.xpm
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * element_xpm[] = {
|
||||||
|
"21 21 5 1",
|
||||||
|
" c None",
|
||||||
|
". c #7B7B7B",
|
||||||
|
"+ c #D6D6D6",
|
||||||
|
"@ c #000000",
|
||||||
|
"# c #FFFFFF",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
"................... ",
|
||||||
|
".+++++++++++++++++.@ ",
|
||||||
|
".+.#..############.@ ",
|
||||||
|
".+.....###########.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+################.@ ",
|
||||||
|
".+++++++++########.@ ",
|
||||||
|
".+@+#+@@.+########.@ ",
|
||||||
|
".+@@.+@@.+########.@ ",
|
||||||
|
".+@+#+@@.+########.@ ",
|
||||||
|
"...................@ ",
|
||||||
|
" @@@@@@@@@@@@@@@@@@@ ",
|
||||||
|
" ",
|
||||||
|
" "};
|
110
editor/pixmaps/thread.xpm
Normal file
110
editor/pixmaps/thread.xpm
Normal file
|
@ -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.....= ",
|
||||||
|
" =================== ",
|
||||||
|
" ",
|
||||||
|
" "};
|
Loading…
Reference in a new issue