* Updated files. Now it compiles (though it crashes).
[scdataviz] / graphwidget.c
index 6be20f7..ed9cf4b 100644 (file)
@@ -5,20 +5,22 @@
 ** Login   <solarion@johnathan>
 ** 
 
-Copyright (C) 2008 Joseph Pingenot
 
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+    Copyright (C) 2008 Joseph Pingenot
 
-You should have received a copy of the GNU Lesser General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 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 Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 **Many thanks to Davyd Madeley for the excellent Cairo Widget Tutorial
 **  at http://gnomejournal.org/article/34/writing-a-widget-using-cairo-and-gtk28
@@ -27,7 +29,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ** Last update Sun May 12 01:17:25 2002 Speed Blue
 */
 
-#include "graphwidget.h"
+#include <graphwidget.h>
+#include <math.h>
 
 G_DEFINE_TYPE(GraphWidget, graph_widget, GTK_TYPE_DRAWING_AREA);
 
@@ -39,7 +42,8 @@ struct drawing_context {
 
 static void draw_point(gpointer data, gpointer user_data) {
   struct drawing_context *cxt = (struct drawing_context *) user_data;
-  cairo_arc(cxt->cr, ((*double)data)[0], ((*double)data)[1], cxt->radius, 0, 2*M_PI);
+  double *d = (double*)data;
+  cairo_arc(cxt->cr, d[0], d[1], cxt->radius, 0, 2*M_PI);
 }
 
 static void draw(GtkWidget *graph, cairo_t *cr) {
@@ -88,10 +92,10 @@ static void graph_widget_init(GraphWidget *graph) {
   graph->graph = graph_new();
 }
 
-GtkWidget *graph_widget_new() {
-  return = g_object_new(GRAPH_WIDGET_TYPE, NULL);
+GtkWidget *graph_widget_new(void) {
+  return g_object_new(GRAPH_WIDGET_TYPE, NULL);
 }
 
-Graph* get_graph(GraphWidget* gw) {
+Graph* graph_widget_get_graph(GraphWidget* gw) {
   return gw->graph;
 }