]> Pileus Git - aweather/commitdiff
Example plugin in GObject plugin format
authorAndy Spencer <andy753421@gmail.com>
Sun, 24 May 2009 06:55:40 +0000 (06:55 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 24 May 2009 06:55:40 +0000 (06:55 +0000)
12 files changed:
src/Makefile.am
src/aweather-gui.c
src/aweather-gui.h
src/aweather-plugin.c
src/aweather-plugin.h
src/aweather-view.c
src/location.h
src/main.c
src/plugin-example.c
src/plugin-example.h
src/plugin-radar.h
src/plugin-ridge.h

index fad1033ba25d59d4110d92276b9cfb4eebdcf179..705df0e19f69ca36897d94b0ad98b5c0246f2ffe 100644 (file)
@@ -5,15 +5,16 @@ bin_PROGRAMS  = aweather wsr88ddec
 BUILT_SOURCES = marshal.c marshal.h
 
 aweather_SOURCES  = main.c \
-       marshal.c        marshal.h        \
-       aweather-gui.c   aweather-gui.h   \
-       aweather-view.c  aweather-view.h  \
-       data.c           data.h           \
-       location.c       location.h       \
-       plugin-radar.c   plugin-radar.h   \
-       plugin-radar-colormap.c           \
-       plugin-ridge.c   plugin-ridge.h   \
-       plugin-example.c plugin-example.h
+       marshal.c         marshal.h         \
+       aweather-gui.c    aweather-gui.h    \
+       aweather-view.c   aweather-view.h   \
+       aweather-plugin.c aweather-plugin.h \
+       data.c            data.h            \
+       location.c        location.h        \
+       plugin-radar.c    plugin-radar.h    \
+       plugin-radar-colormap.c             \
+       plugin-ridge.c    plugin-ridge.h    \
+       plugin-example.c  plugin-example.h
 aweather_CPPFLAGS = $(RSL_CFLAGS) $(GTK_CFLAGS) -DDATADIR="\"$(datadir)\"" 
 
 wsr88ddec         = wsr88ddec.c
index 02b33e1c82b6c44c7cff934c7f5595ee6eafc80e..7adecf0c054cd6510b70c478dd491d6eeddeecb2 100644 (file)
 
 #include "aweather-gui.h"
 #include "aweather-view.h"
+#include "aweather-plugin.h"
 #include "location.h"
 
+/****************
+ * GObject code *
+ ****************/
+G_DEFINE_TYPE(AWeatherGui, aweather_gui, G_TYPE_OBJECT);
+static void aweather_gui_init(AWeatherGui *gui)
+{
+       gui->plugins = NULL;
+       //g_message("aweather_gui_init");
+}
+static GObject *aweather_gui_constructor(GType gtype, guint n_properties,
+               GObjectConstructParam *properties)
+{
+       //g_message("aweather_gui_constructor");
+       GObjectClass *parent_class = G_OBJECT_CLASS(aweather_gui_parent_class);
+       return  parent_class->constructor(gtype, n_properties, properties);
+}
+static void aweather_gui_dispose (GObject *gobject)
+{
+       //g_message("aweather_gui_dispose");
+       AWeatherGui *gui = AWEATHER_GUI(gobject);
+       g_object_unref(gui->view   );
+       g_object_unref(gui->builder);
+       g_object_unref(gui->window );
+       g_object_unref(gui->tabs   );
+       g_object_unref(gui->drawing);
+       G_OBJECT_CLASS(aweather_gui_parent_class)->dispose(gobject);
+}
+static void aweather_gui_finalize(GObject *gobject)
+{
+       //g_message("aweather_gui_finalize");
+       G_OBJECT_CLASS(aweather_gui_parent_class)->finalize(gobject);
+}
+static void aweather_gui_class_init(AWeatherGuiClass *klass)
+{
+       //g_message("aweather_gui_class_init");
+       GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+       gobject_class->constructor  = aweather_gui_constructor;
+       gobject_class->dispose      = aweather_gui_dispose;
+       gobject_class->finalize     = aweather_gui_finalize;
+}
+
 /*************
- * callbacks *
+ * Callbacks *
  *************/
 gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, AWeatherGui *gui)
 {
@@ -148,8 +190,8 @@ gboolean on_configure(GtkWidget *da, GdkEventConfigure *event, AWeatherGui *gui)
        double rad  = atan((height/2)/500);
        double deg  = (rad*180)/M_PI;
 
-       /* TODO: set clipping plane properly */
-       gluPerspective(deg*2, width/height, -z-20, -z+20);
+       //gluPerspective(deg*2, width/height, -z-20, -z+20);
+       gluPerspective(deg*2, width/height, 1, 500*1000);
 
        aweather_gui_gl_end(gui);
        return FALSE;
@@ -157,7 +199,7 @@ gboolean on_configure(GtkWidget *da, GdkEventConfigure *event, AWeatherGui *gui)
 
 gboolean on_expose_begin(GtkWidget *da, GdkEventExpose *event, AWeatherGui *gui)
 {
-       g_message("aweather:espose_begin");
+       g_message("aweather:expose_begin");
        aweather_gui_gl_begin(gui);
 
        double x, y, z;
@@ -170,11 +212,17 @@ gboolean on_expose_begin(GtkWidget *da, GdkEventExpose *event, AWeatherGui *gui)
 
        //glRotatef(-45, 1, 0, 0);
 
+       /* Expose plugins */
+       for (GList *cur = gui->plugins; cur; cur = cur->next) {
+               AWeatherPlugin *plugin = AWEATHER_PLUGIN(cur->data);
+               aweather_plugin_expose(plugin);
+       }
+
        return FALSE;
 }
 gboolean on_expose_end(GtkWidget *da, GdkEventExpose *event, AWeatherGui *gui)
 {
-       g_message("aweather:espose_end\n");
+       g_message("aweather:expose_end\n");
        aweather_gui_gl_end(gui);
        aweather_gui_gl_flush(gui);
        return FALSE;
@@ -331,53 +379,10 @@ static void opengl_setup(AWeatherGui *gui)
 }
 
 
-/****************
- * GObject code *
- ****************/
-G_DEFINE_TYPE(AWeatherGui, aweather_gui, G_TYPE_OBJECT);
-
-/* Constructor / destructors */
-static void aweather_gui_init(AWeatherGui *gui)
-{
-       //g_message("aweather_gui_init");
-}
-
-static GObject *aweather_gui_constructor(GType gtype, guint n_properties,
-               GObjectConstructParam *properties)
-{
-       //g_message("aweather_gui_constructor");
-       GObjectClass *parent_class = G_OBJECT_CLASS(aweather_gui_parent_class);
-       return  parent_class->constructor(gtype, n_properties, properties);
-}
-
-static void aweather_gui_dispose (GObject *gobject)
-{
-       //g_message("aweather_gui_dispose");
-       AWeatherGui *gui = AWEATHER_GUI(gobject);
-       g_object_unref(gui->view   );
-       g_object_unref(gui->builder);
-       g_object_unref(gui->window );
-       g_object_unref(gui->tabs   );
-       g_object_unref(gui->drawing);
-       G_OBJECT_CLASS(aweather_gui_parent_class)->dispose(gobject);
-}
-
-static void aweather_gui_finalize(GObject *gobject)
-{
-       //g_message("aweather_gui_finalize");
-       G_OBJECT_CLASS(aweather_gui_parent_class)->finalize(gobject);
-}
-
-static void aweather_gui_class_init(AWeatherGuiClass *klass)
-{
-       //g_message("aweather_gui_class_init");
-       GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-       gobject_class->constructor  = aweather_gui_constructor;
-       gobject_class->dispose      = aweather_gui_dispose;
-       gobject_class->finalize     = aweather_gui_finalize;
-}
 
-/* Methods */
+/***********
+ * Methods *
+ ***********/
 AWeatherGui *aweather_gui_new()
 {
        //g_message("aweather_gui_new");
@@ -396,7 +401,7 @@ AWeatherGui *aweather_gui_new()
 
 
        /* Load components */
-       aweather_view_set_location(gui->view, 0, 0, -500*1000);
+       aweather_view_set_location(gui->view, 0, 0, -300*1000);
        g_signal_connect(gui->view, "location-changed", G_CALLBACK(on_location_changed), gui);
        site_setup(gui);
        time_setup(gui);
@@ -421,6 +426,11 @@ GtkWidget *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name)
                g_error("Failed to get widget `%s'", name);
        return GTK_WIDGET(widget);
 }
+void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin)
+{
+       g_message("registering plugin");
+       gui->plugins = g_list_append(gui->plugins, plugin);
+}
 void aweather_gui_gl_redraw(AWeatherGui *gui)
 {
        g_message("redraw");
@@ -456,4 +466,3 @@ void aweather_gui_gl_flush(AWeatherGui *gui)
                glFlush();
        gdk_gl_drawable_gl_end(gldrawable);
 }
-//void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
index 70e03a6885e1d9a867e5b102e4c372dd8b55162a..91e53d24bdabfb629b470682f18a1473ba4700f1 100644 (file)
@@ -21,6 +21,7 @@
 #include <gtk/gtk.h>
 #include <glib-object.h>
 #include "aweather-view.h"
+#include "aweather-plugin.h"
 
 /* Type macros */
 #define AWEATHER_TYPE_GUI            (aweather_gui_get_type())
@@ -42,6 +43,7 @@ struct _AWeatherGui {
        GtkWindow      *window;
        GtkNotebook    *tabs;
        GtkDrawingArea *drawing;
+       GList          *plugins;
 };
 
 struct _AWeatherGuiClass {
@@ -56,11 +58,10 @@ GType aweather_gui_get_type(void);
 AWeatherGui    *aweather_gui_new();
 AWeatherView   *aweather_gui_get_view(AWeatherGui *gui);
 GtkWidget      *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name);
+void            aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
 void            aweather_gui_gl_redraw(AWeatherGui *gui);
 void            aweather_gui_gl_begin(AWeatherGui *gui);
 void            aweather_gui_gl_end(AWeatherGui *gui);
 void            aweather_gui_gl_flush(AWeatherGui *gui);
 
-//void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
-
 #endif
index 8546f76bc8ab8cef4046503ca7d35b1fd2c555ba..87cf35cb1e59620e5ed45041d69bd42114239391 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <glib.h>
 
+#include "aweather-plugin.h"
+
+static void aweather_plugin_base_init(gpointer g_class)
+{
+       static gboolean is_initialized = FALSE;
+       if (!is_initialized) {
+               /* add properties and signals to the interface here */
+               is_initialized = TRUE;
+       }
+}
+
+GType aweather_plugin_get_type()
+{
+       static GType type = 0;
+       if (type == 0) {
+               static const GTypeInfo info = {
+                       sizeof(AWeatherPluginInterface),
+                       aweather_plugin_base_init,
+                       NULL,
+               };
+               type = g_type_register_static(G_TYPE_INTERFACE,
+                               "AWeatherPlugin", &info, 0);
+       }
+       return type;
+}
+
+void aweather_plugin_expose(AWeatherPlugin *self)
+{
+       g_return_if_fail(AWEATHER_IS_PLUGIN(self));
+       AWEATHER_PLUGIN_GET_INTERFACE(self)->expose(self);
+}
index 8546f76bc8ab8cef4046503ca7d35b1fd2c555ba..7112e64983f26ef781578935509c71ec3b6efd4d 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef __AWEATHER_PLUGIN_H__
+#define __AWEATHER_PLUGIN_H__
 
+#include <glib-object.h>
+
+#define AWEATHER_TYPE_PLUGIN                (aweather_plugin_get_type())
+#define AWEATHER_PLUGIN(obj)                (G_TYPE_CHECK_INSTANCE_CAST   ((obj),  AWEATHER_TYPE_PLUGIN, AWeatherPlugin))
+#define AWEATHER_IS_PLUGIN(obj)             (G_TYPE_CHECK_INSTANCE_TYPE   ((obj),  AWEATHER_TYPE_PLUGIN))
+#define AWEATHER_PLUGIN_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), AWEATHER_TYPE_PLUGIN, AWeatherPluginInterface))
+
+
+typedef struct _AWeatherPlugin          AWeatherPlugin;
+typedef struct _AWeatherPluginInterface AWeatherPluginInterface;
+
+struct _AWeatherPluginInterface
+{
+       GTypeInterface parent_iface;
+
+       /* Virtual functions */
+       void (*expose)(AWeatherPlugin *self);
+};
+
+GType aweather_plugin_get_type(void);
+
+void aweather_plugin_expose(AWeatherPlugin *self);
+
+#endif
index 8b7eade4b90b45da8036807d0c18e5780108ee27..7caaf9b9a3868fddff8039eead3304273e335a1f 100644 (file)
@@ -20,6 +20,9 @@
 #include "marshal.h"
 #include "aweather-view.h"
 
+/****************
+ * GObject code *
+ ****************/
 G_DEFINE_TYPE(AWeatherView, aweather_view, G_TYPE_OBJECT);
 
 enum {
@@ -38,13 +41,12 @@ enum {
 
 static guint signals[NUM_SIGNALS];
 
-/* Constructor / destructors */
 static void aweather_view_init(AWeatherView *self)
 {
        //g_message("aweather_view_init");
        /* Default values */
-       self->time     = g_strdup(""); //g_strdup("LATEST");
-       self->site     = g_strdup(""); //g_strdup("IND");
+       self->time = g_strdup("");
+       self->site = g_strdup("");
 }
 
 static GObject *aweather_view_constructor(GType gtype, guint n_properties,
@@ -187,7 +189,9 @@ static void _aweather_view_emit_refresh(AWeatherView *view)
 }
 
 
-/* Methods */
+/***********
+ * Methods *
+ ***********/
 AWeatherView *aweather_view_new()
 {
        //g_message("aweather_view_new");
index e105de849ac5e1fa83cb77b4b82062e1cbb3299a..82cf38cc56395f61991b69fa906eb130e2591143 100644 (file)
@@ -15,8 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef SITE_H
-#define SITE_H
+#ifndef __SITE_H__
+#define __SITE_H__
 
 enum {
        LOCATION_CITY,
index cf13c87e1370f9bcf78b1c2df6f31f711e6433c1..773b0337059e327809ec7a7038e2c2c14b06d6bb 100644 (file)
@@ -38,8 +38,10 @@ int main(int argc, char *argv[])
 
        /* Load plugins */
        //example_init(gui);
-        ridge_init(gui);
-       radar_init(gui);
+        //ridge_init(gui);
+       //radar_init(gui);
+
+       aweather_gui_register_plugin(gui, AWEATHER_PLUGIN(aweather_example_new(gui)));
 
        gtk_widget_show_all(aweather_gui_get_widget(gui, "window"));
        gtk_main();
index 8b6361dcbcebc99f8ea3de7438dfc5ad4296e3ba..553dd3d6acb6aabe90ed74905e2d271e50461f8e 100644 (file)
 #include <GL/gl.h>
 
 #include "aweather-gui.h"
+#include "aweather-plugin.h"
+#include "plugin-example.h"
+
+/****************
+ * GObject code *
+ ****************/
+static void aweather_example_plugin_init(AWeatherPluginInterface *iface);
+static void aweather_example_expose(AWeatherPlugin *_example);
+G_DEFINE_TYPE_WITH_CODE(AWeatherExample, aweather_example, G_TYPE_OBJECT,
+               G_IMPLEMENT_INTERFACE(AWEATHER_TYPE_PLUGIN,
+                       aweather_example_plugin_init));
+static void aweather_example_class_init(AWeatherExampleClass *klass)
+{
+       GObjectClass *object_class = (GObjectClass*)klass;
+}
+static void aweather_example_plugin_init(AWeatherPluginInterface *iface)
+{
+       /* Add methods to the interface */
+       iface->expose = aweather_example_expose;
+}
+static void aweather_example_init(AWeatherExample *example)
+{
+       /* Set defaults */
+       example->gui      = NULL;
+       example->button   = NULL;
+       example->rotation = 30.0;
+}
+
+/***********
+ * Helpers *
+ ***********/
+static gboolean rotate(gpointer _example)
+{
+       AWeatherExample *example = _example;
+       if (gtk_toggle_button_get_active(example->button)) {
+               example->rotation += 1.0;
+               aweather_gui_gl_redraw(example->gui);
+       }
+       return TRUE;
+}
+
+/***********
+ * Methods *
+ ***********/
+AWeatherExample *aweather_example_new(AWeatherGui *gui)
+{
+       //g_message("aweather_view_new");
+       AWeatherExample *example = g_object_new(AWEATHER_TYPE_EXAMPLE, NULL);
+       example->gui = gui;
 
-static GtkWidget *rotate_button;
+       GtkWidget *drawing = aweather_gui_get_widget(gui, "drawing");
+       GtkWidget *config  = aweather_gui_get_widget(gui, "tabs");
 
-static float ang = 30.;
+       /* Add configuration tab */
+       GtkWidget *label = gtk_label_new("example");
+       example->button = GTK_TOGGLE_BUTTON(gtk_toggle_button_new_with_label("Rotate"));
+       gtk_notebook_append_page(GTK_NOTEBOOK(config), GTK_WIDGET(example->button), label);
 
-static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
+       /* Set up OpenGL Stuff */
+       //g_signal_connect(drawing, "expose-event", G_CALLBACK(expose), NULL);
+       g_timeout_add(1000/60, rotate, example);
+
+       return example;
+}
+
+static void aweather_example_expose(AWeatherPlugin *_example)
 {
+       AWeatherExample *example = AWEATHER_EXAMPLE(_example);
+       g_message("aweather_example_expose");
        glDisable(GL_TEXTURE_2D);
-       glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity();
        glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity();
-       //glOrtho(-1,1,-1,1,-10,10);
-
-       glTranslatef(0.5, -0.5, -2);
+       glOrtho(-1,1,-1,1,-10,10);
+       glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity();
 
        float light_ambient[]  = {0.1f, 0.1f, 0.0f};
        float light_diffuse[]  = {0.9f, 0.9f, 0.9f};
-       float light_position[] = {-20.0f, 40.0f, -40.0f, 1.0f};
+       float light_position[] = {-30.0f, 50.0f, 40.0f, 1.0f};
        glLightfv(GL_LIGHT0, GL_AMBIENT,  light_ambient);
        glLightfv(GL_LIGHT0, GL_DIFFUSE,  light_diffuse);
        glLightfv(GL_LIGHT0, GL_POSITION, light_position);
@@ -45,7 +105,8 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
        glEnable(GL_LIGHTING);
        glEnable(GL_COLOR_MATERIAL);
 
-       glRotatef(ang, 1, 0, 1);
+       glTranslatef(0.5, -0.5, -2);
+       glRotatef(example->rotation, 1, 0, 1);
        glColor4f(0.9, 0.9, 0.7, 1.0);
        gdk_gl_draw_teapot(TRUE, 0.25);
        gdk_gl_draw_cube(TRUE, 0.25);
@@ -57,36 +118,6 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
 
         glMatrixMode(GL_PROJECTION); glPopMatrix(); 
        glMatrixMode(GL_MODELVIEW ); glPopMatrix();
-       return FALSE;
-}
-
-static gboolean rotate(gpointer user_data)
-{
-       if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rotate_button)))
-               return TRUE;
-
-       GtkWidget *da = GTK_WIDGET (user_data);
-
-       ang++;
-
-       gdk_window_invalidate_rect(da->window, &da->allocation, FALSE);
-       gdk_window_process_updates(da->window, FALSE);
-
-       return TRUE;
+       return;
 }
 
-gboolean example_init(AWeatherGui *gui)
-{
-       GtkWidget *drawing = aweather_gui_get_widget(gui, "drawing");
-       GtkWidget *config  = aweather_gui_get_widget(gui, "tabs");
-
-       /* Add configuration tab */
-       GtkWidget *label = gtk_label_new("example");
-       rotate_button = gtk_toggle_button_new_with_label("Rotate");
-       gtk_notebook_append_page(GTK_NOTEBOOK(config), rotate_button, label);
-
-       /* Set up OpenGL Stuff */
-       g_signal_connect(drawing, "expose-event", G_CALLBACK(expose), NULL);
-       g_timeout_add(1000/60, rotate, drawing);
-       return TRUE;
-}
index 66c1cbf21306184ecdb34b3e4948151f5057beb4..5e52f6e53c44940f49a814b3ca26d1c490a1bcc4 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef EXAMPLE_H
-#define EXAMPLE_H
+#ifndef __EXAMPLE_H__
+#define __EXAMPLE_H__
 
-gboolean example_init(AWeatherGui *gui);
+#include <glib-object.h>
+
+#define AWEATHER_TYPE_EXAMPLE            (aweather_example_get_type ())
+#define AWEATHER_EXAMPLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),   AWEATHER_TYPE_EXAMPLE, AWeatherExample))
+#define AWEATHER_IS_EXAMPLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),   AWEATHER_TYPE_EXAMPLE))
+#define AWEATHER_EXAMPLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST   ((klass), AWEATHER_TYPE_EXAMPLE, AWeatherExampleClass))
+#define AWEATHER_IS_EXAMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE   ((klass), AWEATHER_TYPE_EXAMPLE))
+#define AWEATHER_EXAMPLE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),   AWEATHER_TYPE_EXAMPLE, AWeatherExampleClass))
+
+typedef struct _AWeatherExample        AWeatherExample;
+typedef struct _AWeatherExampleClass   AWeatherExampleClass;
+
+struct _AWeatherExample {
+       GObject parent_instance;
+
+       /* instance members */
+       AWeatherGui     *gui;
+       GtkToggleButton *button;
+       float            rotation;
+};
+
+struct _AWeatherExampleClass {
+       GObjectClass parent_class;
+};
+
+GType aweather_example_get_type (void);
+
+/* Methods */
+AWeatherExample *aweather_example_new(AWeatherGui *gui);
 
 #endif
index 7b787d8cd83d6afc3a0b35561aaa0f7c3b40db64..2bc422aac026402874201be0256a230358a22345 100644 (file)
@@ -15,8 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef RADAR_H
-#define RADAR_H
+#ifndef __RADAR_H__
+#define __RADAR_H__
 
 gboolean radar_init(AWeatherGui *gui);
 
index 00fed65cc8139031cf0e18b7851b2ffacbdeb138..9d5ca04bb3c4150d1c2437b2d1faf5147fcfff1f 100644 (file)
@@ -15,8 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef RIDGE_H
-#define RIDGE_H
+#ifndef __RIDGE_H__
+#define __RIDGE_H__
 
 gboolean ridge_init(AWeatherGui *gui);