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/ui-window.c | 80 ---------------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 ui/ui-window.c (limited to 'ui/ui-window.c') 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)); -} -- cgit v1.1