[Gpredict-svn] SF.net SVN: gpredict: [30] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2008-03-30 10:37:51
|
Revision: 30 http://gpredict.svn.sourceforge.net/gpredict/?rev=30&view=rev Author: csete Date: 2008-03-30 03:37:53 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Added new files. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/gtk-freq-ctrl.c trunk/win32/Makefile Added Paths: ----------- trunk/src/gtk-rot-ctrl.c trunk/src/gtk-rot-ctrl.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/ChangeLog 2008-03-30 10:37:53 UTC (rev 30) @@ -1,6 +1,7 @@ 2008-03-30; Alexandru Csete <oz...@gm...> * src/gtk-freq-ctrl.c, gtk-freq-ctrl.h: + * src/gtk-rot-ctrl.c, gtk-rot-ctrl.h: Added files. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/src/Makefile.am 2008-03-30 10:37:53 UTC (rev 30) @@ -40,6 +40,7 @@ gtk-polar-plot.c gtk-polar-plot.h \ gtk-polar-view.c gtk-polar-view.h \ gtk-polar-view-popup.c gtk-polar-view-popup.h \ + gtk-rot-ctrl.c gtk-rot-ctrl.h \ gtk-sat-data.c gtk-sat-data.h \ gtk-sat-list.c gtk-sat-list.h \ gtk-sat-list-col-sel.c gtk-sat-list-col-sel.h \ Modified: trunk/src/gtk-freq-ctrl.c =================================================================== --- trunk/src/gtk-freq-ctrl.c 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/src/gtk-freq-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) @@ -45,7 +45,9 @@ static void gtk_freq_ctrl_init (GtkFreqCtrl *list); static void gtk_freq_ctrl_destroy (GtkObject *object); +static void gtk_freq_ctrl_update (GtkFreqCtrl *ctrl); + static GtkHBoxClass *parent_class = NULL; @@ -100,7 +102,7 @@ static void -gtk_freq_ctrl_init (GtkFreqCtrl *list) +gtk_freq_ctrl_init (GtkFreqCtrl *ctrl) { @@ -114,7 +116,10 @@ - +/** \brief Create a new Frequency control widget. + * \return A new frequency control widget. + * + */ GtkWidget * gtk_freq_ctrl_new () { @@ -132,3 +137,43 @@ } +/** \brief Set the value of the frequency control widget. + * \param[in] ctrl THe frequency control widget. + * \param[in] val The new value. + * + */ +void +gtk_freq_ctrl_set_value (GtkFreqCtrl *ctrl, gdouble val) +{ + /* set the new value */ + ctrl->value = val; + + /* update the display */ + gtk_freq_ctrl_update (ctrl); +} + + +/** \brief Get the current value of the frequency control widget. + * \param[in] ctrl The frequency control widget. + * \return The current value. + * + * Hint: For reading the value you can also access ctrl->value. + * + */ +gdouble +gtk_freq_ctrl_get_value (GtkFreqCtrl *ctrl) +{ + return ctrl->value; +} + + + +/** \brief Update frequency display widget. + * \param[in] ctrl The frequency control widget. + * + */ +static void +gtk_freq_ctrl_update (GtkFreqCtrl *ctrl) +{ + +} Added: trunk/src/gtk-rot-ctrl.c =================================================================== --- trunk/src/gtk-rot-ctrl.c (rev 0) +++ trunk/src/gtk-rot-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) @@ -0,0 +1,181 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, visit http://www.fsf.org/ +*/ +/** \brief ROTOR control. + * + * More info... + * + * \bug This should be a generic widget, not just rotor specific + * + */ +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include "gtk-rot-ctrl.h" +#ifdef HAVE_CONFIG_H +# include <build-config.h> +#endif + + + +static void gtk_rot_ctrl_class_init (GtkRotCtrlClass *class); +static void gtk_rot_ctrl_init (GtkRotCtrl *list); +static void gtk_rot_ctrl_destroy (GtkObject *object); + +static void gtk_rot_ctrl_update (GtkRotCtrl *ctrl); + + +static GtkHBoxClass *parent_class = NULL; + + +GType +gtk_rot_ctrl_get_type () +{ + static GType gtk_rot_ctrl_type = 0; + + if (!gtk_rot_ctrl_type) { + + static const GTypeInfo gtk_rot_ctrl_info = { + sizeof (GtkRotCtrlClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_rot_ctrl_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkRotCtrl), + 5, /* n_preallocs */ + (GInstanceInitFunc) gtk_rot_ctrl_init, + }; + + gtk_rot_ctrl_type = g_type_register_static (GTK_TYPE_VBOX, + "GtkRotCtrl", + >k_rot_ctrl_info, + 0); + } + + return gtk_rot_ctrl_type; +} + + +static void +gtk_rot_ctrl_class_init (GtkRotCtrlClass *class) +{ + GObjectClass *gobject_class; + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + gobject_class = G_OBJECT_CLASS (class); + object_class = (GtkObjectClass*) class; + widget_class = (GtkWidgetClass*) class; + container_class = (GtkContainerClass*) class; + + parent_class = g_type_class_peek_parent (class); + + object_class->destroy = gtk_rot_ctrl_destroy; + +} + + + +static void +gtk_rot_ctrl_init (GtkRotCtrl *ctrl) +{ + + +} + +static void +gtk_rot_ctrl_destroy (GtkObject *object) +{ + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + + + +/** \brief Create a new rotor control widget. + * \param[in] min The lower limit in decimal degrees. + * \param[in] max The upper limit in decimal degrees. + * \return A new rotor control widget. + * + */ +GtkWidget * +gtk_rot_ctrl_new (gfloat min, gfloat max) +{ + GtkWidget *widget; + GtkWidget *table; + + + widget = g_object_new (GTK_TYPE_ROT_CTRL, NULL); + + + + gtk_widget_show_all (widget); + + return widget; +} + + +/** \brief Set the value of the rotor control widget. + * \param[in] ctrl The rotor control widget. + * \param[in] val The new value. + * + */ +void +gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val) +{ + /* set the new value */ + ctrl->value = val; + + /* update the display */ + gtk_rot_ctrl_update (ctrl); +} + + +/** \brief Get the current value of the rotor control widget. + * \param[in] ctrl The rotor control widget. + * \return The current value. + * + * Hint: For reading the value you can also access ctrl->value. + * + */ +gfloat +gtk_rot_ctrl_get_value (GtkRotCtrl *ctrl) +{ + return ctrl->value; +} + + + +/** \brief Update rotor display widget. + * \param[in] ctrl The rottor control widget. + * + */ +static void +gtk_rot_ctrl_update (GtkRotCtrl *ctrl) +{ + +} Added: trunk/src/gtk-rot-ctrl.h =================================================================== --- trunk/src/gtk-rot-ctrl.h (rev 0) +++ trunk/src/gtk-rot-ctrl.h 2008-03-30 10:37:53 UTC (rev 30) @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, visit http://www.fsf.org/ +*/ +#ifndef __GTK_ROT_CTRL_H__ +#define __GTK_ROT_CTRL_H__ 1 + +#include <glib.h> +#include <glib/gi18n.h> +#include <gtk/gtk.h> + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + + +#define GTK_TYPE_ROT_CTRL (gtk_rot_ctrl_get_type ()) +#define GTK_ROT_CTRL(obj) GTK_CHECK_CAST (obj,\ + gtk_rot_ctrl_get_type (),\ + GtkRotCtrl) + +#define GTK_ROT_CTRL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass,\ + gtk_rot_ctrl_get_type (),\ + GtkRotCtrlClass) + +#define IS_GTK_ROT_CTRL(obj) GTK_CHECK_TYPE (obj, gtk_rot_ctrl_get_type ()) + + +typedef struct _gtk_rot_ctrl GtkRotCtrl; +typedef struct _GtkRotCtrlClass GtkRotCtrlClass; + + + +struct _gtk_rot_ctrl +{ + GtkVBox vbox; + + gfloat value; +}; + +struct _GtkRotCtrlClass +{ + GtkVBoxClass parent_class; +}; + + + +GtkType gtk_rot_ctrl_get_type (void); +GtkWidget* gtk_rot_ctrl_new (gfloat min, gfloat max); +void gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val); +gfloat gtk_rot_ctrl_get_value (GtkRotCtrl *ctrl); + + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTK_ROT_CTRL_H__ */ Modified: trunk/win32/Makefile =================================================================== --- trunk/win32/Makefile 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/win32/Makefile 2008-03-30 10:37:53 UTC (rev 30) @@ -90,6 +90,7 @@ gtk-polar-plot.c \ gtk-polar-view.c \ gtk-polar-view-popup.c \ + gtk-rot-ctrl.c \ gtk-sat-data.c \ gtk-sat-list.c \ gtk-sat-list-col-sel.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |