From ae3a780491b700be0258b1c2243c86cf10729fcc Mon Sep 17 00:00:00 2001 From: Bradley Smith Date: Sun, 3 Aug 2008 16:22:59 +0100 Subject: Add Gtk interface. Using a Vte for guile input. Signed-off-by: Bradley Smith --- ui/Makefile.am | 23 ---- ui/design.glade | 317 ------------------------------------------------- ui/main.c | 34 ------ ui/ui-arena.c | 45 ------- ui/ui-arena.h | 58 --------- ui/ui-cmdwin.c | 45 ------- ui/ui-cmdwin.h | 58 --------- ui/ui-window-private.h | 32 ----- ui/ui-window.c | 80 ------------- ui/ui-window.h | 58 --------- 10 files changed, 750 deletions(-) delete mode 100644 ui/Makefile.am delete mode 100644 ui/design.glade delete mode 100644 ui/main.c delete mode 100644 ui/ui-arena.c delete mode 100644 ui/ui-arena.h delete mode 100644 ui/ui-cmdwin.c delete mode 100644 ui/ui-cmdwin.h delete mode 100644 ui/ui-window-private.h delete mode 100644 ui/ui-window.c delete mode 100644 ui/ui-window.h (limited to 'ui') diff --git a/ui/Makefile.am b/ui/Makefile.am deleted file mode 100644 index cf01f1b..0000000 --- a/ui/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -## Copyright (C) 2008 Bradley Smith -## -## src/Makefile.am -## -## GNU Robots is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## GNU Robots 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 General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with GNU Robots. If not, see . - -bin_PROGRAMS = uitest - -INCLUDES = $(GTK_CFLAGS) -I$(top_builddir)/ui/ - -uitest_SOURCES = main.c ui-window.c ui-arena.c ui-cmdwin.c -uitest_LDFLAGS = $(GTK_LIBS) diff --git a/ui/design.glade b/ui/design.glade deleted file mode 100644 index b8d6fba..0000000 --- a/ui/design.glade +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - True - 2 - 2 - - - True - - - True - - - True - _File - True - - - True - - - True - gtk-new - True - True - - - - - True - gtk-open - True - True - - - - - True - gtk-save - True - True - - - - - True - gtk-save-as - True - True - - - - - True - - - - - True - gtk-quit - True - True - - - - - - - - - True - _Edit - True - - - True - - - True - gtk-cut - True - True - - - - - True - gtk-copy - True - True - - - - - True - gtk-paste - True - True - - - - - True - gtk-delete - True - True - - - - - - - - - True - _View - True - - - - - True - _Help - True - - - True - - - True - gtk-about - True - True - - - - - - - - - False - - - - - True - - - True - gtk-open - - - False - - - - - False - 1 - - - - - True - True - - - True - GDK_EXTENSION_EVENTS_ALL - 3 - 3 - - - True - GDK_EXTENSION_EVENTS_ALL - gtk-missing-image - 6 - - - - - False - True - - - - - True - - - True - 11 - - - True - - - True - True - True - GTK_RELIEF_NONE - False - 0 - - - True - gtk-media-play - - - - - False - - - - - True - True - True - GTK_RELIEF_NONE - False - 0 - - - True - gtk-media-next - - - - - False - 1 - - - - - False - - - - - True - 2 - - - True - 1 - Speed - GTK_JUSTIFY_RIGHT - - - False - - - - - True - True - 0 0 100 1 10 10 - GTK_POS_RIGHT - - - 1 - - - - - 1 - - - - - False - - - - - True - Commands/Interaction - - - 1 - - - - - False - True - - - - - 2 - - - - - True - 2 - - - False - 3 - - - - - - - - diff --git a/ui/main.c b/ui/main.c deleted file mode 100644 index da7e94c..0000000 --- a/ui/main.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots UI Test, main.c. - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#include - -#include "ui-window.h" - -int main(int argc, char* argv[]) -{ - GtkWidget* window; - - gtk_init(&argc, &argv); - - window = ui_window_new(); - - gtk_main(); - - return 0; -} diff --git a/ui/ui-arena.c b/ui/ui-arena.c deleted file mode 100644 index 06c7bcc..0000000 --- a/ui/ui-arena.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots, ui-arena.c - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#include "ui-arena.h" - -struct _UIArenaPrivate -{ - int dummy; -}; - -#define UI_ARENA_GET_PRIVATE(obj) \ - G_TYPE_INSTANCE_GET_PRIVATE(obj, UI_TYPE_ARENA, UIArenaPrivate) - -G_DEFINE_TYPE(UIArena, ui_arena, GTK_TYPE_DRAWING_AREA) - -GtkWidget *ui_arena_new(void) -{ - return GTK_WIDGET(g_object_new(UI_TYPE_ARENA, NULL)); -} - -static void ui_arena_init(UIArena *arena) -{ - gtk_widget_set_size_request(GTK_WIDGET(arena), 40*16,18*16); -} - -static void ui_arena_class_init(UIArenaClass *klass) -{ - g_type_class_add_private(G_OBJECT_CLASS(klass), - sizeof(UIArenaPrivate)); -} diff --git a/ui/ui-arena.h b/ui/ui-arena.h deleted file mode 100644 index 5277f54..0000000 --- a/ui/ui-arena.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots, ui-arena.h - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#ifndef __UI_ARENA_H__ -#define __UI_ARENA_H__ - -#include - -G_BEGIN_DECLS - -#define UI_TYPE_ARENA \ - ui_arena_get_type() -#define UI_ARENA(obj) \ - G_TYPE_CHECK_INSTANCE_CAST(obj, UI_TYPE_ARENA, UIArena) -#define UI_ARENA_CLASS(klass) \ - G_TYPE_CHECK_CLASS_CAST(klass, UI_ARENA_TYPE, UIArenaClass) -#define IS_UI_ARENA(obj) \ - G_TYPE_CHECK_INSTANCE_TYPE(obj, UI_TYPE_ARENA) -#define IS_UI_ARENA_CLASS(klass) \ - G_TYPE_CHECK_CLASS_TYPE(klass, UI_TYPE_ARENA) - -typedef struct _UIArena UIArena; -typedef struct _UIArenaClass UIArenaClass; -typedef struct _UIArenaPrivate UIArenaPrivate; - -struct _UIArena -{ - GtkDrawingArea widget; - UIArenaPrivate* priv; -}; - -struct _UIArenaClass -{ - GtkDrawingAreaClass parent_class; -}; - -GType ui_arena_get_type(void) G_GNUC_CONST; - -GtkWidget *ui_arena_new(void); - -G_END_DECLS - -#endif diff --git a/ui/ui-cmdwin.c b/ui/ui-cmdwin.c deleted file mode 100644 index b743687..0000000 --- a/ui/ui-cmdwin.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots, ui-cmdwin.c - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#include "ui-cmdwin.h" - -struct _UICmdWinPrivate -{ - int dummy; -}; - -#define UI_CMDWIN_GET_PRIVATE(obj) \ - G_TYPE_INSTANCE_GET_PRIVATE(obj, UI_TYPE_CMDWIN, UICmdWinPrivate) - -G_DEFINE_TYPE(UICmdWin, ui_cmdwin, GTK_TYPE_VBOX) - -GtkWidget *ui_cmdwin_new(void) -{ - return GTK_WIDGET(g_object_new(UI_TYPE_CMDWIN, NULL)); -} - -static void ui_cmdwin_init(UICmdWin *cmdwin) -{ - gtk_widget_set_size_request(GTK_WIDGET(cmdwin), 40*16,200); -} - -static void ui_cmdwin_class_init(UICmdWinClass *klass) -{ - g_type_class_add_private(G_OBJECT_CLASS(klass), - sizeof(UICmdWinPrivate)); -} diff --git a/ui/ui-cmdwin.h b/ui/ui-cmdwin.h deleted file mode 100644 index c3bcf8a..0000000 --- a/ui/ui-cmdwin.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots, ui-cmdwin.h - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#ifndef __UI_CMDWIN_H__ -#define __UI_CMDWIN_H__ - -#include - -G_BEGIN_DECLS - -#define UI_TYPE_CMDWIN \ - ui_cmdwin_get_type() -#define UI_CMDWIN(obj) \ - G_TYPE_CHECK_INSTANCE_CAST(obj, UI_TYPE_CMDWIN, UICmdWin) -#define UI_CMDWIN_CLASS(klass) \ - G_TYPE_CHECK_CLASS_CAST(klass, UI_CMDWIN_TYPE, UICmdWinClass) -#define IS_UI_CMDWIN(obj) \ - G_TYPE_CHECK_INSTANCE_TYPE(obj, UI_TYPE_CMDWIN) -#define IS_UI_CMDWIN_CLASS(klass) \ - G_TYPE_CHECK_CLASS_TYPE(klass, UI_TYPE_CMDWIN) - -typedef struct _UICmdWin UICmdWin; -typedef struct _UICmdWinClass UICmdWinClass; -typedef struct _UICmdWinPrivate UICmdWinPrivate; - -struct _UICmdWin -{ - GtkVBox widget; - UICmdWinPrivate* priv; -}; - -struct _UICmdWinClass -{ - GtkVBoxClass parent_class; -}; - -GType ui_cmdwin_get_type(void) G_GNUC_CONST; - -GtkWidget *ui_cmdwin_new(void); - -G_END_DECLS - -#endif diff --git a/ui/ui-window-private.h b/ui/ui-window-private.h deleted file mode 100644 index cfb8b63..0000000 --- a/ui/ui-window-private.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots UI Test, ui-window-private.h. - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#ifndef __UI_WINDOW_PRIVATE_H__ -#define __UI_WINDOW_PRIVATE_H__ - -G_BEGIN_DECLS - -struct _UIWindowPrivate -{ - GtkWidget *cmdwin; - GtkWidget *arena; -}; - -G_END_DECLS - -#endif /* __UI_WINDOW_PRIVATE_H__ */ diff --git a/ui/ui-window.c b/ui/ui-window.c deleted file mode 100644 index 27c49e9..0000000 --- a/ui/ui-window.c +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots UI Test, ui-window.c. - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#include "ui-window.h" -#include "ui-window-private.h" - -#include "ui-cmdwin.h" -#include "ui-arena.h" - -#include - -#define UI_WINDOW_GET_PRIVATE(obj) \ - G_TYPE_INSTANCE_GET_PRIVATE(obj, UI_TYPE_WINDOW, UIWindowPrivate) - -G_DEFINE_TYPE(UIWindow, ui_window, GTK_TYPE_WINDOW) - -static void on_ui_window_destroy(GtkWidget *widget, gpointer data); - -GtkWidget *ui_window_new(void) -{ - return GTK_WIDGET(g_object_new(UI_TYPE_WINDOW, NULL)); -} - -static void on_ui_window_destroy(GtkWidget *widget, gpointer data) -{ - gtk_widget_hide(widget); - gtk_main_quit(); -} - -static void ui_window_init(UIWindow *window) -{ - GtkWidget *vbox; - GtkWidget *vpaned; - - window->priv = UI_WINDOW_GET_PRIVATE(window); - - vbox = gtk_vbox_new(FALSE, 0); - vpaned = gtk_vpaned_new(); - window->priv->cmdwin = ui_cmdwin_new(); - window->priv->arena = ui_arena_new(); - - gtk_paned_add1(GTK_PANED(vpaned), window->priv->arena); - gtk_paned_add2(GTK_PANED(vpaned), window->priv->cmdwin); - - /* TODO: Add menu first etc */ - gtk_box_pack_start(GTK_BOX(vbox), vpaned, TRUE, TRUE, 0); - - gtk_container_add(GTK_CONTAINER(window), vbox); - - g_signal_connect(G_OBJECT(window), "destroy", - G_CALLBACK(on_ui_window_destroy), NULL); - - gtk_window_set_title(GTK_WINDOW(window), "UI Test"); - gtk_widget_show(window->priv->cmdwin); - gtk_widget_show(window->priv->arena); - gtk_widget_show(vpaned); - gtk_widget_show(vbox); - gtk_widget_show(GTK_WIDGET(window)); -} - -static void ui_window_class_init(UIWindowClass *klass) -{ - g_type_class_add_private(G_OBJECT_CLASS(klass), - sizeof(UIWindowPrivate)); -} diff --git a/ui/ui-window.h b/ui/ui-window.h deleted file mode 100644 index 450223b..0000000 --- a/ui/ui-window.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2008 Bradley Smith - * - * GNU Robots UI Test, ui-window.h. - * - * GNU Robots is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Robots 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Robots. If not, see . - */ - -#ifndef __UI_WINDOW_H__ -#define __UI_WINDOW_H__ - -#include - -G_BEGIN_DECLS - -#define UI_TYPE_WINDOW \ - ui_window_get_type() -#define UI_WINDOW(obj) \ - G_TYPE_CHECK_INSTANCE_CAST(obj, UI_TYPE_WINDOW, UIWindow) -#define UI_WINDOW_CLASS(klass) \ - G_TYPE_CHECK_CLASS_CAST(klass, UI_WINDOW_TYPE, UIWindowClass) -#define IS_UI_WINDOW(obj) \ - G_TYPE_CHECK_INSTANCE_TYPE(obj, UI_TYPE_WINDOW) -#define IS_UI_WINDOW_CLASS(klass) \ - G_TYPE_CHECK_CLASS_TYPE(klass, UI_TYPE_WINDOW) - -typedef struct _UIWindow UIWindow; -typedef struct _UIWindowClass UIWindowClass; -typedef struct _UIWindowPrivate UIWindowPrivate; - -struct _UIWindow -{ - GtkWindow widget; - UIWindowPrivate* priv; -}; - -struct _UIWindowClass -{ - GtkWindowClass parent_class; -}; - -GType ui_window_get_type(void) G_GNUC_CONST; - -GtkWidget *ui_window_new(void); - -G_END_DECLS - -#endif /* __UI_WINDOW_H__ */ -- cgit v1.1