diff --git a/editor/Makefile b/editor/Makefile index ef0f056..4cc5fc2 100644 --- a/editor/Makefile +++ b/editor/Makefile @@ -2,6 +2,7 @@ CC=gcc CFLAGS=-Wall INCLUDES=-I/usr/include/GL LIBS=-lglut -lGLU -lGL -lm +GTKLIBS=`pkg-config --cflags --libs gtk+-2.0` -export-dynamic SRCDIR=src @@ -14,7 +15,11 @@ all: chmod +x ledcube-edit strip ledcube-edit +gui: + $(CC) $(CFLAGS) $(GTKLIBS) -o gui $(SRCDIR)/main_gui.c + clean: rm -f *.o + rm -f gui #rm -f ledcube-edit diff --git a/editor/src/main_gui.c b/editor/src/main_gui.c new file mode 100644 index 0000000..406f6c2 --- /dev/null +++ b/editor/src/main_gui.c @@ -0,0 +1,26 @@ +#include + +void on_window_destroy(GtkObject *object, gpointer userData) { + gtk_main_quit(); +} + +int main (int argc, char *argv[]) { + GtkBuilder *builder; + GtkWidget *window; + + gtk_set_locale(); + gtk_init(&argc, &argv); + + builder = gtk_builder_new(); + gtk_builder_add_from_file(builder, "src/main_gui.ui", NULL); + gtk_builder_connect_signals(builder, NULL); + window = GTK_WIDGET(gtk_builder_get_object(builder, "main_window")); + + g_object_unref(G_OBJECT(builder)); + + gtk_widget_show_all(window); + gtk_main(); + + return 0; +} + diff --git a/editor/src/main_gui.ui b/editor/src/main_gui.ui new file mode 100644 index 0000000..1e92e31 --- /dev/null +++ b/editor/src/main_gui.ui @@ -0,0 +1,111 @@ + + + + + + True + False + center-always + + + + True + + + True + + + True + both-horiz + + + True + 7 + + + True + + + + + False + True + + + + + True + Connect to cube + True + gtk-connect + + + False + True + + + + + True + + + False + True + + + + + True + toolbutton3 + True + gtk-add + + + False + True + + + + + True + toolbutton3 + True + gtk-delete + + + False + True + + + + + + + False + 0 + + + + + True + True + + + False + 1 + + + + + 500 + 500 + True + + + 2 + + + + + +