-SUBDIRS = data src
+SUBDIRS = src data docs
test: all
LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \
#!/bin/sh
+gtkdocize
aclocal
autoheader
automake -a -c
# Check for required programs
AC_PROG_CC
PKG_PROG_PKG_CONFIG
+GTK_DOC_CHECK(1.9)
# Check for required packages
-PKG_CHECK_MODULES(GTK, gtk+-2.0 gmodule-export-2.0 gtkglext-1.0)
+PKG_CHECK_MODULES(GTK, gtk+-2.0 gtkglext-1.0 gmodule-export-2.0 gobject-2.0)
PKG_CHECK_MODULES(CURL, libcurl)
# Define odd RSL install location
# Output
AC_CONFIG_FILES([
Makefile
- data/Makefile
src/Makefile
+ data/Makefile
+ docs/Makefile
+ docs/api/Makefile
])
AC_OUTPUT
--- /dev/null
+SUBDIRS = api
+
+maintainer-clean-local:
+ rm -f Makefile.in
--- /dev/null
+AM_CPPFLAGS=$(GTK_CFLAGS)
+GTKDOC_LIBS=$(GTK_LIBS) $(RSL_LIBS) $(CURL_LIBS) \
+ ../../src/aweather-gui.o \
+ ../../src/aweather-view.o \
+ ../../src/location.o \
+ ../../src/opengl.o \
+ ../../src/plugin-example.o \
+ ../../src/plugin-radar.o \
+ ../../src/plugin-ridge.o
+DOC_MODULE=aweather
+DOC_SOURCE_DIR=../../src/
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+include $(top_srcdir)/gtk-doc.make
+maintainer-clean-local:
+ rm -f Makefile.in aweather-docs.sgml aweather-overrides.txt aweather.types
+ rm -rf html/ tmpl/
AM_LDFLAGS = -Wl,--export-dynamic
bin_PROGRAMS = aweather
-aweather_SOURCES = \
- aweather.c aweather.h \
+aweather_SOURCES = main.c \
+ aweather-gui.c aweather-gui.h \
+ aweather-view.c aweather-view.h \
location.c location.h \
opengl.c opengl.h \
plugin-radar.c plugin-radar.h \
test: all
LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \
./aweather
+
+debug: all
+ LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \
+ gdb ./aweather
--- /dev/null
+#include <config.h>
+#include <gtk/gtk.h>
+#include <gtk/gtkgl.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "aweather-gui.h"
+#include "aweather-view.h"
+
+/****************
+ * 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");
+ /* Default values */
+ gui->view = NULL;
+ gui->builder = NULL;
+ gui->window = NULL;
+ gui->tabs = NULL;
+ gui->drawing = NULL;
+}
+
+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 */
+AWeatherGui *aweather_gui_new()
+{
+ g_message("aweather_gui_new");
+ GError *error = NULL;
+
+ AWeatherGui *gui = g_object_new(AWEATHER_TYPE_GUI, NULL);
+
+ gui->builder = gtk_builder_new();
+ if (!gtk_builder_add_from_file(gui->builder, DATADIR "/aweather/aweather.xml", &error))
+ g_error("Failed to create gtk builder: %s", error->message);
+ gui->view = aweather_view_new();
+ gui->window = GTK_WINDOW (gtk_builder_get_object(gui->builder, "window"));
+ gui->tabs = GTK_NOTEBOOK (gtk_builder_get_object(gui->builder, "tabs"));
+ gui->drawing = GTK_DRAWING_AREA(gtk_builder_get_object(gui->builder, "drawing"));
+ gtk_builder_connect_signals(gui->builder, NULL);
+ return gui;
+}
+AWeatherView *aweather_gui_get_view(AWeatherGui *gui)
+{
+ return gui->view;
+}
+GtkBuilder *aweather_gui_get_builder(AWeatherGui *gui)
+{
+ return gui->builder;
+}
+GtkWindow *aweather_gui_get_window(AWeatherGui *gui)
+{
+ return gui->window;
+}
+GtkNotebook *aweather_gui_get_tabs(AWeatherGui *gui)
+{
+ return gui->tabs;
+}
+GtkDrawingArea *aweather_gui_get_drawing(AWeatherGui *gui)
+{
+ return gui->drawing;
+}
+
+//void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
+
+/************************
+ * GtkBuilder callbacks *
+ ************************/
+gboolean on_window_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+ if (event->keyval == GDK_q)
+ gtk_main_quit();
+ return TRUE;
+}
+
+void on_site_changed() {
+ g_message("site changed");
+}
--- /dev/null
+#ifndef __AWEATHER_GUI_H__
+#define __AWEATHER_GUI_H__
+
+#include <gtk/gtk.h>
+#include <glib-object.h>
+#include "aweather-view.h"
+
+/* Type macros */
+#define AWEATHER_TYPE_GUI (aweather_gui_get_type())
+#define AWEATHER_GUI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AWEATHER_TYPE_GUI, AWeatherGui))
+#define AWEATHER_IS_GUI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AWEATHER_TYPE_GUI))
+#define AWEATHER_GUI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AWEATHER_TYPE_GUI, AWeatherGuiClass))
+#define AWEATHER_IS_GUI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AWEATHER_TYPE_GUI))
+#define AWEATHER_GUI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AWEATHER_TYPE_GUI, AWeatherGuiClass))
+
+typedef struct _AWeatherGui AWeatherGui;
+typedef struct _AWeatherGuiClass AWeatherGuiClass;
+
+struct _AWeatherGui {
+ GObject parent_instance;
+
+ /* instance members */
+ AWeatherView *view;
+ GtkBuilder *builder;
+ GtkWindow *window;
+ GtkNotebook *tabs;
+ GtkDrawingArea *drawing;
+};
+
+struct _AWeatherGuiClass {
+ GObjectClass parent_class;
+
+ /* class members */
+};
+
+GType aweather_gui_get_type(void);
+
+/* Methods */
+AWeatherGui *aweather_gui_new();
+AWeatherView *aweather_gui_get_view(AWeatherGui *gui);
+GtkBuilder *aweather_gui_get_builder(AWeatherGui *gui);
+GtkWindow *aweather_gui_get_window(AWeatherGui *gui);
+GtkNotebook *aweather_gui_get_tabs(AWeatherGui *gui);
+GtkDrawingArea *aweather_gui_get_drawing(AWeatherGui *gui);
+
+//void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin);
+
+#endif
--- /dev/null
+#include <glib.h>
+
+#include "aweather-view.h"
+
+G_DEFINE_TYPE(AWeatherView, aweather_view, G_TYPE_OBJECT);
+
+enum {
+ PROP_0,
+ PROP_TIME,
+ PROP_LOCATION,
+};
+
+enum {
+ SIG_TIME_CHANGED,
+ SIG_LOCATION_CHANGED,
+ NUM_SIGNALS,
+};
+
+static guint signals[NUM_SIGNALS];
+
+/* Constructor / destructors */
+static void aweather_view_init(AWeatherView *self)
+{
+ g_message("aweather_view_init");
+ /* Default values */
+ self->time = 0;
+ self->location = g_strdup("IND");
+}
+
+static GObject *aweather_view_constructor(GType gtype, guint n_properties,
+ GObjectConstructParam *properties)
+{
+ g_message("aweather_view_constructor");
+ GObjectClass *parent_class = G_OBJECT_CLASS(aweather_view_parent_class);
+ return parent_class->constructor(gtype, n_properties, properties);
+}
+
+static void aweather_view_dispose (GObject *gobject)
+{
+ g_message("aweather_view_dispose");
+ /* Drop references to other GObjects */
+ G_OBJECT_CLASS(aweather_view_parent_class)->dispose(gobject);
+}
+
+static void aweather_view_finalize(GObject *gobject)
+{
+ g_message("aweather_view_finalize");
+ AWeatherView *self = AWEATHER_VIEW(gobject);
+ g_free(self->location);
+ G_OBJECT_CLASS(aweather_view_parent_class)->finalize(gobject);
+}
+
+static void aweather_view_set_property(GObject *object, guint property_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ g_message("aweather_view_set_property");
+ AWeatherView *self = AWEATHER_VIEW(object);
+ switch (property_id) {
+ case PROP_TIME: aweather_view_set_time (self, g_value_get_int (value)); break;
+ case PROP_LOCATION: aweather_view_set_location(self, g_value_get_string(value)); break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
+ }
+}
+
+static void aweather_view_get_property(GObject *object, guint property_id,
+ GValue *value, GParamSpec *pspec)
+{
+ g_message("aweather_view_get_property");
+ AWeatherView *self = AWEATHER_VIEW(object);
+ switch (property_id) {
+ case PROP_TIME: g_value_set_int (value, aweather_view_get_time (self)); break;
+ case PROP_LOCATION: g_value_set_string(value, aweather_view_get_location(self)); break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
+ }
+}
+
+static void aweather_view_class_init(AWeatherViewClass *klass)
+{
+ g_message("aweather_view_class_init");
+ GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+ gobject_class->constructor = aweather_view_constructor;
+ gobject_class->dispose = aweather_view_dispose;
+ gobject_class->finalize = aweather_view_finalize;
+ gobject_class->get_property = aweather_view_get_property;
+ gobject_class->set_property = aweather_view_set_property;
+ g_object_class_install_property(gobject_class, PROP_TIME,
+ g_param_spec_int(
+ "time",
+ "time of the current frame",
+ "(format unknown)",
+ G_MININT32, G_MAXINT32, 0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property(gobject_class, PROP_LOCATION,
+ g_param_spec_pointer(
+ "location",
+ "location seen by the viewport",
+ "Location of the viewport. Currently this is the name of the radar site.",
+ G_PARAM_READWRITE));
+ signals[SIG_TIME_CHANGED] = g_signal_new(
+ "time-changed",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT);
+ signals[SIG_LOCATION_CHANGED] = g_signal_new(
+ "location-changed",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_GSTRING);
+
+}
+
+/* Methods */
+AWeatherView *aweather_view_new()
+{
+ g_message("aweather_view_new");
+ return g_object_new(AWEATHER_TYPE_VIEW, NULL);
+}
+
+void aweather_view_set_time(AWeatherView *view, int time)
+{
+ g_message("aweather_view_set_time");
+ view->time = time;
+ g_signal_emit(view, signals[SIG_TIME_CHANGED], 0, time);
+}
+
+int aweather_view_get_time(AWeatherView *view)
+{
+ g_message("aweather_view_get_time");
+ return view->time;
+}
+
+void aweather_view_set_location(AWeatherView *view, const gchar *location)
+{
+ g_message("aweather_view_set_location");
+ g_free(view->location);
+ view->location = g_strdup(location);
+ g_signal_emit(view, signals[SIG_LOCATION_CHANGED], 0, view->location);
+}
+
+gchar *aweather_view_get_location(AWeatherView *view)
+{
+ g_message("aweather_view_get_location");
+ return view->location;
+}
--- /dev/null
+#ifndef __AWEATHER_VIEW_H__
+#define __AWEATHER_VIEW_H__
+
+#include <glib-object.h>
+
+/* Type macros */
+#define AWEATHER_TYPE_VIEW (aweather_view_get_type())
+#define AWEATHER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AWEATHER_TYPE_VIEW, AWeatherView))
+#define AWEATHER_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AWEATHER_TYPE_VIEW))
+#define AWEATHER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AWEATHER_TYPE_VIEW, AWeatherViewClass))
+#define AWEATHER_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AWEATHER_TYPE_VIEW))
+#define AWEATHER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AWEATHER_TYPE_VIEW, AWeatherViewClass))
+
+typedef struct _AWeatherView AWeatherView;
+typedef struct _AWeatherViewClass AWeatherViewClass;
+
+struct _AWeatherView {
+ GObject parent_instance;
+
+ /* instance members */
+ gint time;
+ gchar *location;
+};
+
+struct _AWeatherViewClass {
+ GObjectClass parent_class;
+
+ /* class members */
+};
+
+GType aweather_view_get_type(void);
+
+/* Methods */
+AWeatherView *aweather_view_new();
+void aweather_view_set_time(AWeatherView *view, gint time);
+gint aweather_view_get_time(AWeatherView *view);
+
+void aweather_view_set_location(AWeatherView *view, const gchar *location);
+gchar *aweather_view_get_location(AWeatherView *view);
+
+#endif
#include <config.h>
#include <gtk/gtk.h>
#include <gtk/gtkgl.h>
-#include <gdk/gdkkeysyms.h>
+#include "aweather-gui.h"
#include "location.h"
#include "opengl.h"
#include "plugin-radar.h"
#include "plugin-ridge.h"
#include "plugin-example.h"
-/************************
- * GtkBuilder callbacks *
- ************************/
-gboolean on_window_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
-{
- if (event->keyval == GDK_q)
- gtk_main_quit();
- return TRUE;
-}
-
-void on_site_changed() {
- g_message("site changed");
-}
-
/*****************
* Setup helpers *
*****************/
g_object_set(cell, "sensitive", sensitive, NULL);
}
-static void site_setup(GtkBuilder *builder)
+static void site_setup(AWeatherGui *gui)
{
GtkTreeIter state, city;
GtkTreeStore *store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
}
}
+ GtkBuilder *builder = aweather_gui_get_builder(gui);
GtkWidget *combo = GTK_WIDGET(gtk_builder_get_object(builder, "site"));
GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
//gtk_box_pack_start(GTK_BOX(selectors), loc_sel, FALSE, FALSE, 0);
}
-static void time_setup(GtkBuilder *builder)
+static void time_setup(AWeatherGui *gui)
{
- GtkWidget *view = GTK_WIDGET(gtk_builder_get_object(builder, "time"));
- GtkCellRenderer *rend = gtk_cell_renderer_text_new();
- GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes(
+ GtkBuilder *builder = aweather_gui_get_builder(gui);
+ GtkWidget *view = GTK_WIDGET(gtk_builder_get_object(builder, "time"));
+ GtkCellRenderer *rend = gtk_cell_renderer_text_new();
+ GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes(
"Time", rend, 0, "text", NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
gtk_init(&argc, &argv);
gtk_gl_init(&argc, &argv);
- GError *error = NULL;
- GtkBuilder *builder = gtk_builder_new();
- if (!gtk_builder_add_from_file(builder, DATADIR "/aweather/aweather.xml", &error))
- g_error("Failed to create gtk builder: %s", error->message);
- gtk_builder_connect_signals(builder, NULL);
-
- GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
- GtkWidget *drawing = GTK_WIDGET(gtk_builder_get_object(builder, "drawing"));
- GtkWidget *tabs = GTK_WIDGET(gtk_builder_get_object(builder, "tabs"));
-
- /* Set up darwing area */
- GdkGLConfig *glconfig = gdk_gl_config_new_by_mode(
- GDK_GL_MODE_RGBA | GDK_GL_MODE_DEPTH |
- GDK_GL_MODE_DOUBLE | GDK_GL_MODE_ALPHA);
- if (!glconfig)
- g_error("Failed to create glconfig");
- if (!gtk_widget_set_gl_capability(drawing, glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE))
- g_error("GL lacks required capabilities");
+ /* Set up AWeather */
+ AWeatherGui *gui = aweather_gui_new();
/* Load components */
- site_setup(builder);
- time_setup(builder);
- opengl_init(GTK_DRAWING_AREA(drawing), GTK_NOTEBOOK(tabs));
+ site_setup(gui);
+ time_setup(gui);
+ opengl_init(gui);
/* Load plugins */
- radar_init (GTK_DRAWING_AREA(drawing), GTK_NOTEBOOK(tabs));
- ridge_init (GTK_DRAWING_AREA(drawing), GTK_NOTEBOOK(tabs));
- example_init(GTK_DRAWING_AREA(drawing), GTK_NOTEBOOK(tabs));
+ radar_init (gui);
+ ridge_init (gui);
+ example_init(gui);
- gtk_widget_show_all(window);
+ gtk_widget_show_all(GTK_WIDGET(aweather_gui_get_window(gui)));
gtk_main();
return 0;
#include <GL/gl.h>
#include <GL/glu.h>
+#include "aweather-gui.h"
+
static gboolean expose_start(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
{
g_message("opengl:expose_start");
}
static gboolean configure_start(GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
{
+ g_message("opengl:configure_start");
GdkGLContext *glcontext = gtk_widget_get_gl_context(da);
GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(da);
}
static gboolean configure_end(GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
{
+ g_message("opengl:configure_end");
GdkGLDrawable *gldrawable = gdk_gl_drawable_get_current();
gdk_gl_drawable_gl_end(gldrawable);
return FALSE;
}
-gboolean opengl_init(GtkDrawingArea *drawing, GtkNotebook *config)
+gboolean opengl_init(AWeatherGui *gui)
{
+ GtkDrawingArea *drawing = aweather_gui_get_drawing(gui);
+
+ GdkGLConfig *glconfig = gdk_gl_config_new_by_mode(
+ GDK_GL_MODE_RGBA | GDK_GL_MODE_DEPTH |
+ GDK_GL_MODE_DOUBLE | GDK_GL_MODE_ALPHA);
+ if (!glconfig)
+ g_error("Failed to create glconfig");
+ if (!gtk_widget_set_gl_capability(GTK_WIDGET(drawing), glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE))
+ g_error("GL lacks required capabilities");
+
/* Set up OpenGL Stuff */
g_signal_connect (drawing, "configure-event", G_CALLBACK(configure_start), NULL);
g_signal_connect_after(drawing, "configure-event", G_CALLBACK(configure_end), NULL);
#ifndef OPENGL_H
#define OPENGL_H
-gboolean opengl_init(GtkDrawingArea *drawing, GtkNotebook *config);
+gboolean opengl_init(AWeatherGui *gui);
#endif
#include <gtk/gtkgl.h>
#include <GL/gl.h>
+#include "aweather-gui.h"
+
static GtkWidget *rotate_button;
static float ang = 30.;
static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
{
- glPushMatrix();
glDisable(GL_TEXTURE_2D);
- glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity();
+ glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity();
+ //glOrtho(-1,1,-1,1,-10,10);
+
glTranslatef(0.5, -0.5, -2);
float light_ambient[] = {0.1f, 0.1f, 0.0f};
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
- glPopMatrix();
+ glMatrixMode(GL_PROJECTION); glPopMatrix();
+ glMatrixMode(GL_MODELVIEW ); glPopMatrix();
return FALSE;
}
return TRUE;
}
-gboolean example_init(GtkDrawingArea *drawing, GtkNotebook *config)
+gboolean example_init(AWeatherGui *gui)
{
+ GtkDrawingArea *drawing = aweather_gui_get_drawing(gui);
+ GtkNotebook *config = aweather_gui_get_tabs(gui);
+
/* Add configuration tab */
GtkWidget *label = gtk_label_new("example");
rotate_button = gtk_toggle_button_new_with_label("Rotate");
#ifndef EXAMPLE_H
#define EXAMPLE_H
-gboolean example_init(GtkDrawingArea *drawing, GtkNotebook *config);
+gboolean example_init(AWeatherGui *gui);
#endif
#include <config.h>
#include <gtk/gtk.h>
+#include <gtk/gtkgl.h>
#include <GL/gl.h>
#include <math.h>
#include "rsl.h"
+#include "aweather-gui.h"
#include "plugin-radar.h"
GtkWidget *drawing;
/* Load the default sweep */
static gboolean configure(GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
{
+ g_message("radar:configure");
Sweep *first = (Sweep*)user_data;
if (cur_sweep == NULL)
load_sweep(first);
//glEnd();
/* Print the color table */
- //glDisable(GL_TEXTURE_2D);
- //glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity();
- //glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity();
- //glBegin(GL_QUADS);
- //int i;
- //for (i = 0; i < nred; i++) {
- // glColor4ub(red[i], green[i], blue[i], get_alpha(i));
- // glVertex3f(-1.0, (float)((i ) - nred/2)/(nred/2), 0.0); // bot left
- // glVertex3f(-1.0, (float)((i+1) - nred/2)/(nred/2), 0.0); // top left
- // glVertex3f(-0.9, (float)((i+1) - nred/2)/(nred/2), 0.0); // top right
- // glVertex3f(-0.9, (float)((i ) - nred/2)/(nred/2), 0.0); // bot right
- //}
- //glEnd();
- //glMatrixMode(GL_PROJECTION); glPopMatrix();
- //glMatrixMode(GL_MODELVIEW ); glPopMatrix();
+ glDisable(GL_TEXTURE_2D);
+ glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity();
+ glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity();
+ glBegin(GL_QUADS);
+ int i;
+ for (i = 0; i < nred; i++) {
+ glColor4ub(red[i], green[i], blue[i], get_alpha(i));
+ glVertex3f(-1.0, (float)((i ) - nred/2)/(nred/2), 0.0); // bot left
+ glVertex3f(-1.0, (float)((i+1) - nred/2)/(nred/2), 0.0); // top left
+ glVertex3f(-0.9, (float)((i+1) - nred/2)/(nred/2), 0.0); // top right
+ glVertex3f(-0.9, (float)((i ) - nred/2)/(nred/2), 0.0); // bot right
+ }
+ glEnd();
+ glMatrixMode(GL_PROJECTION); glPopMatrix();
+ glMatrixMode(GL_MODELVIEW ); glPopMatrix();
return FALSE;
}
-gboolean radar_init(GtkDrawingArea *_drawing, GtkNotebook *config)
+gboolean radar_init(AWeatherGui *gui)
{
- drawing = GTK_WIDGET(_drawing);
+ drawing = GTK_WIDGET(aweather_gui_get_drawing(gui));
+ GtkNotebook *config = aweather_gui_get_tabs(gui);
/* Parse hard coded file.. */
RSL_read_these_sweeps("all", NULL);
#ifndef RADAR_H
#define RADAR_H
-gboolean radar_init(GtkDrawingArea *drawing, GtkNotebook *config);
+gboolean radar_init(AWeatherGui *gui);
#endif
#include <stdio.h>
+#include "aweather-gui.h"
+
enum {
LAYER_TOPO,
LAYER_COUNTY,
return FALSE;
}
-gboolean ridge_init(GtkDrawingArea *drawing, GtkNotebook *config)
+gboolean ridge_init(AWeatherGui *gui)
{
+ GtkDrawingArea *drawing = aweather_gui_get_drawing(gui);
+
/* Set up OpenGL Stuff */
g_signal_connect(drawing, "expose-event", G_CALLBACK(expose), NULL);
g_signal_connect(drawing, "configure-event", G_CALLBACK(configure), NULL);
#ifndef RIDGE_H
#define RIDGE_H
-gboolean ridge_init(GtkDrawingArea *drawing, GtkNotebook *config);
+gboolean ridge_init(AWeatherGui *gui);
#endif