Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Commits for new graphs

  • Loading branch information...
commit 623a4fc0cd4e66545dca22ae082dae6908304df0 1 parent ecd2cbe
Paul Childs authored
0  gtk2plot/gtkplotbar.c
View
No changes.
0  gtk2plot/gtkplotbar.h
View
No changes.
295 gtk2plot/gtkplotdonut.c
View
@@ -0,0 +1,295 @@
+/***************************************************************************
+ * gtkplotdonut.c
+ *
+ * A GTK+ widget that plots data on polar axes
+ * version 0.1.0
+ * Features:
+ * optimal visualisation of axes
+ * zoomable ranges
+ * signal emission for mouse movement
+ *
+ * Sat Dec 4 17:18:14 2013
+ * Copyright 2013 Paul Childs
+ * <pchilds@physics.org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library 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 Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#include <gtk/gtk.h>
+#include <math.h>
+#include <cairo-ps.h>
+#include <cairo-svg.h>
+#include "gtkplotdonut.h"
+
+#define GTK_PLOT_DONUT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_PLOT_TYPE_DONUT, GtkPlotDonutPrivate))
+#define DZE 0.00001 /* divide by zero threshold */
+#define NZE -0.00001 /* negative of this */
+#define FAC 0.25 /* floating point accuracy check for logarithms etc */
+#define FA2 0.1 /* floating point accuracy check for logarithms etc */
+#define MY_2PI 6.2831853071795864769252867665590057683943387987502
+#define BFL 10 /*buffer length for axes*/
+G_DEFINE_TYPE (GtkPlotDonut, gtk_plot_donut, GTK_TYPE_PLOT);
+enum {PROP_0, PROP_BRN};
+typedef struct _GtkPlotDonutPrivate GtkPlotDonutPrivate;
+struct _GtkPlotDonutPrivate {gdouble theta; gdouble rescale; gint flagr;};
+
+static void draw(GtkWidget *widget, cairo_t *cr)
+{
+ GtkPlotDonutPrivate *priv;
+ GtkPlotDonut *plot;
+ GtkPlot *plt;
+ gint ct, ft, j, k, lt, st, xw, yw;
+ gdouble cv, r, sv;
+ gchar lbl[BFL];
+ PangoLayout *lyt1, *lyt2;
+
+ xw=widget->allocation.width/2;
+ yw=widget->allocation.height/2;
+ plot=GTK_PLOT_DONUT(widget);
+ plt=GTK_PLOT(widget);
+ priv=GTK_PLOT_DONUT_GET_PRIVATE(plot);
+ cairo_set_line_width(cr, plot->linew);
+ if (plot->kdata && plot->vdata) /* plot data */
+ {
+ r = (fmax(xw,yw)-(plot->linew))/(plt->ind->len);
+ for (k=0; k<(plt->ind->len); k++)
+ {
+ ft=g_array_index((plt->ind), gint, k);
+ if (ft>=(plot->vdata->len)) continue;
+ st=g_array_index((plt->stride), gint, k);
+ lt=(g_array_index((plt->sizes), gint, k)*st)+ft;
+ if (lt>(plot->vdata->len)) lt=(plot->vdata->len);
+ {sv=0; cv=priv->theta;}
+ for (j=ft+st; j<lt; j+=st) sv+=g_array_index((plot->vdata), gdouble, j);
+ if (sv<DZE) continue;
+ sv=1/sv;
+ for (j=ft+st; j<lt; j+=st)
+ {
+ dv=g_array_index((plot->vdata), gdouble, j)*sv;
+ cairo_move_to(cr, xw+(r*cos(cv)), yw+(r*sin(cv)));
+ cairo_arc(cr, xw, yw, r*(gdouble)k, cv, cv+(dv*MY_2PI));
+ cairo_arc(cr, xw, yw, r*(gdouble)(k+1), cv+(dv*MY_2PI), cv);
+ cairo_set_source_rgba(cr, 0, 0, 0, 1);
+ cairo_stroke_preserve(cr);
+ ct=fmod(j,(plt->rd->len));
+ {vv=g_array_index((plt->rd), gdouble, ct); wv=g_array_index((plt->gr), gdouble, ct); xv=g_array_index((plt->bl), gdouble, ct); yv=g_array_index((plt->al), gdouble, ct);}
+ cairo_set_source_rgba(cr, vv, wv, xv, yv);
+ cairo_fill(cr);
+ if (dv<DV_CRIT)
+ {
+ cv+=(dv*MY_2PI);
+ continue;
+ }
+ cv+=(dv*G_PI);
+ if (((plot->flagd)&GTK_PLOT_DONUT_DISP_KEY)!=0)
+ {
+ if (((plot->flagd)&GTK_PLOT_DONUT_DISP_VAL)!=0) /* KEYs and VALUEs */
+ {
+ }
+ else /* KEYs only */
+ {
+ }
+ }
+ else if (((plot->flagd)&GTK_PLOT_DONUT_DISP_VAL)!=0) /* VALUEs only */
+ {
+ }
+ cv+=(dv*G_PI);
+ }
+ }
+ }
+}
+
+gboolean gtk_plot_donut_refresh(GtkWidget *widget, gdouble theta)
+{
+ GdkRegion *region;
+ GdkWindow *wdw;
+ GtkPlotDonutPrivate *priv;
+
+ priv=GTK_PLOT_POLAR_GET_PRIVATE(widget);
+ (priv->theta)=theta;
+ wdw=gtk_widget_get_window(widget);
+ if (!wdw) return;
+ region=gdk_drawable_get_clip_region(wdw);
+ gdk_window_invalidate_region(wdw, region, TRUE);
+ gdk_window_process_updates(wdw, TRUE);
+ gdk_region_destroy(region);
+ return FALSE;
+}
+
+gboolean gtk_plot_donut_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data)
+{
+ cairo_t* cr=gtk_print_context_get_cairo_context(context);
+ draw(GTK_WIDGET(data), cr);
+ return FALSE;
+}
+
+gboolean gtk_plot_donut_print_eps(GtkWidget *plot, gchar* fout)
+{
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
+ surface=cairo_ps_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
+ cairo_ps_surface_set_eps(surface, TRUE);
+ cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2);
+ cr=cairo_create(surface);
+ draw(plot, cr);
+ cairo_surface_show_page(surface);
+ cairo_destroy(cr);
+ cairo_surface_finish(surface);
+ cairo_surface_destroy(surface);
+ return FALSE;
+}
+
+gboolean gtk_plot_donut_print_png(GtkWidget *plot, gchar* fout)
+{
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
+ surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
+ cr=cairo_create(surface);
+ draw(plot, cr);
+ cairo_surface_write_to_png(surface, fout);
+ cairo_destroy(cr);
+ cairo_surface_destroy(surface);
+ return FALSE;
+}
+
+gboolean gtk_plot_donut_print_svg(GtkWidget *plot, gchar* fout)
+{
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
+ surface=cairo_svg_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
+ cr=cairo_create(surface);
+ draw(plot, cr);
+ cairo_destroy(cr);
+ cairo_surface_destroy(surface);
+ return FALSE;
+}
+
+static gboolean gtk_plot_donut_button_press(GtkWidget *widget, GdkEventButton *event)
+{
+ GtkPlotDonutPrivate *priv;
+ gdouble dy, dx;
+
+ priv=GTK_PLOT_DONUT_GET_PRIVATE(widget);
+ if ((priv->flagr)==0)
+ {
+ dy=(widget->allocation.height/2)-(event->y);
+ dx=(event->x)-(widget->allocation.width/2);
+ if ((dy*dy)+(dx*dx)<fmin(widget->allocation.width,widget->allocation.height)*fmin(widget->allocation.width,widget->allocation.height)/4)
+ {
+ (priv->rescale)=atan2(dy, dx);
+ (priv->flagr)=1;}
+ }
+ }
+ return FALSE;
+}
+
+static gboolean gtk_plot_donut_button_release(GtkWidget *widget, GdkEventButton *event)
+{
+ GtkPlotDonutPrivate *priv;
+ gdouble dy, dx;
+
+ priv=GTK_PLOT_DONUT_GET_PRIVATE(widget);
+ if ((priv->flagr)==1)
+ {
+ dy=(widget->allocation.height/2)-(event->y);
+ dx=(event->x)-(widget->allocation.width/2);
+ if (4*((dy*dy)+(dx*dx))<fmin(widget->allocation.width,widget->allocation.height)*fmin(widget->allocation.width,widget->allocation.height)) (priv->theta)+=atan2(dy, dx)-(priv->rescale);
+ (priv->flagr)=0;
+ }
+ return FALSE;
+}
+
+static void gtk_plot_donut_finalise(GtkPlotDonut *plot)
+{
+ if (plot->kdata) g_array_free((plot->kdata), TRUE);
+ if (plot->vdata) g_array_free((plot->vdata), FALSE);
+}
+
+void gtk_plot_donut_set_data(GtkPlotDonut *plot, GArray *kdata, GArray *vdata, GArray *nd, GArray *sz, GArray *st)
+{
+ gtk_plot_donut_finalise(plot);
+ {(plot->kdata)=g_array_ref(kdata); (plot->vdata)=g_array_ref(vdata);}
+ gtk_plot_set_indices(GTK_PLOT(plot), nd, sz, st);
+}
+
+static void gtk_plot_donut_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ switch (prop_id)
+ {
+ case PROP_THT: (GTK_PLOT_DONUT_GET_PRIVATE(object)->theta)=g_value_get_double(value);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void gtk_plot_donut_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ switch (prop_id)
+ {
+ case PROP_THT: g_value_set_double(value, (GTK_PLOT_DONUT_GET_PRIVATE(object)->theta));
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static gboolean gtk_plot_donut_expose(GtkWidget *widget, GdkEventExpose *event)
+{
+ cairo_t *cr;
+
+ cr=gdk_cairo_create(gtk_widget_get_window(widget));
+ cairo_rectangle(cr, (event->area.x), (event->area.y), (event->area.width), (event->area.height));
+ cairo_clip(cr);
+ draw(widget, cr);
+ cairo_destroy(cr);
+ return FALSE;
+}
+
+static void gtk_plot_donut_class_init(GtkPlotDonutClass *klass)
+{
+ GObjectClass *obj_klass;
+ GtkWidgetClass *widget_klass;
+
+ obj_klass=G_OBJECT_CLASS(klass);
+ g_type_class_add_private(obj_klass, sizeof(GtkPlotDonutPrivate));
+ (obj_klass->finalize)=(GObjectFinalizeFunc) gtk_plot_donut_finalise;
+ (obj_klass->set_property)=gtk_plot_donut_set_property;
+ (obj_klass->get_property)=gtk_plot_donut_get_property;
+ g_object_class_install_property(obj_klass, PROP_THT, g_param_spec_double("theta", "Rotation", "Rotation of the chart", -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE));
+ widget_klass=GTK_WIDGET_CLASS(klass);
+ (widget_klass->button_press_event)=gtk_plot_donut_button_press;
+ (widget_klass->button_release_event)=gtk_plot_donut_button_release;
+ (widget_klass->expose_event)=gtk_plot_donut_expose;
+}
+
+static void gtk_plot_donut_init(GtkPlotDonut *plot)
+{
+ GtkPlotDonutPrivate *priv;
+ gdouble val;
+
+ gtk_widget_add_events(GTK_WIDGET(plot), GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);
+ priv=GTK_PLOT_DONUT_GET_PRIVATE(plot);
+ {(priv->theta)=0; (priv->rescale)=0; (priv->flagr)=0}
+ {(plot->kdata)=NULL; (plot->vdata)=NULL;}
+ {(plot->flagd)=(GTK_PLOT_DONUT_DISP_KEY|GTK_PLOT_DONUT_DISP_VAL); (plot->linew)=2;}
+}
+
+GtkWidget *gtk_plot_donut_new(void) {return g_object_new(GTK_PLOT_TYPE_DONUT, NULL);}
64 gtk2plot/gtkplotdonut.h
View
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * gtkplotdonut.h
+ *
+ * A GTK+ widget that plots a pi/donut graph
+ *
+ * Sat Dec 4 17:18:14 2013
+ * Copyright 2013 Paul Childs
+ * <pchilds@physics.org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library 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 Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#ifndef __GTK_PLOT_DONUT_H__
+# define __GTK_PLOT_DONUT_H__
+# include <gtk/gtk.h>
+# include "gtkplot.h"
+ G_BEGIN_DECLS
+# define GTK_PLOT_TYPE_DONUT (gtk_plot_donut_get_type())
+# define GTK_PLOT_DONUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_PLOT_TYPE_DONUT, GtkPlotDonut))
+# define GTK_PLOT_IS_DONUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_PLOT_TYPE_DONUT))
+# define GTK_PLOT_DONUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_PLOT_DONUT, GtkPlotDonutClass))
+# define GTK_PLOT_IS_DONUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_PLOT_TYPE_DONUT))
+# define GTK_PLOT_GET_DONUT_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_PLOT_TYPE_DONUT, GtkPlotDonutClass))
+ typedef struct _GtkPlotDonut GtkPlotDonut;
+ typedef struct _GtkPlotDonutClass GtkPlotDonutClass;
+ typedef enum
+ {
+ GTK_PLOT_DONUT_DISP_KEY = 1 << 0,
+ GTK_PLOT_DONUT_DISP_VAL = 1 << 1
+ } GtkPlotDonutDisp;
+ struct _GtkPlotDonut
+ {
+ GtkPlot parent;
+ GArray *kdata, *vdata; /* key and value data */
+ guint linew; /* line width */
+ gint flagd;
+ };
+ struct _GtkPlotDonutClass
+ {
+ GtkPlotClass parent_class;
+ };
+ gboolean gtk_plot_donut_refresh(GtkWidget *widget, gdouble theta);
+ gboolean gtk_plot_donut_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
+ gboolean gtk_plot_donut_print_eps(GtkWidget *widget, gchar *fout);
+ gboolean gtk_plot_donut_print_png(GtkWidget *widget, gchar *fout);
+ gboolean gtk_plot_donut_print_svg(GtkWidget *widget, gchar *fout);
+ void gtk_plot_donut_set_data(GtkPlotDonut *plot, GArray *kdata, GArray *vdata, GArray *nd, GArray *sz, GArray *st);
+ GtkWidget *gtk_plot_donut_new(void);
+ G_END_DECLS
+#endif
185 gtk2plot/gtkplotlinear.c
View
@@ -88,11 +88,12 @@ static void drawz(GtkWidget *widget, cairo_t *cr)
{
gint xw;
gdouble dt;
- GtkAllocation alloc;
+// GtkAllocation alloc;
GtkPlotLinear *plot;
- gtk_widget_get_allocation(widget, &alloc);
- xw=alloc.width;
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=alloc.width;
+ xw=widget->allocation.width;
plot=GTK_PLOT_LINEAR(widget);
cairo_set_source_rgba(cr, 0, 0, 0, 1);
cairo_set_line_width(cr, 1);
@@ -164,7 +165,7 @@ static void draw(GtkWidget *widget, cairo_t *cr)
GtkPlotLinearPrivate *priv;
GtkPlotLinear *plot;
GtkPlot *plt;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gint dtt, ft, hg, j, k, lt, st, tf, to, tn, tnn, tx, tz, wd, xa, xl, xr, xr2, xt, xu, xv, xvn, xw, ya, yl, yr, yr2, yu, yv, yvn, yw;
gdouble av, delx, dely, dt, lr1, lr2, vv, wv, zv;
guint lr3;
@@ -177,9 +178,11 @@ static void draw(GtkWidget *widget, cairo_t *cr)
{mtr3.xx=0; mtr3.xy=-1; mtr3.yx=1; mtr3.yy=0; mtr3.x0=0; mtr3.y0=0;}
plot=GTK_PLOT_LINEAR(widget);
plt=GTK_PLOT(widget);
- gtk_widget_get_allocation(widget, &alloc);
- xw=alloc.width;
- yw=(alloc.height);
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=alloc.width;
+// yw=(alloc.height);
+ xw=widget->allocation.width;
+ yw=widget->allocation.height;
priv=GTK_PLOT_LINEAR_GET_PRIVATE(plot);
(priv->flaga)&=(GTK_PLOT_LINEAR_AXES_LT|GTK_PLOT_LINEAR_AXES_LR);
delx=((priv->bounds.xmax)-(priv->bounds.xmin))/(priv->ticks.xj);
@@ -3944,10 +3947,11 @@ gboolean gtk_plot_linear_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_ps_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_ps_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_ps_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cairo_ps_surface_set_eps(surface, TRUE);
cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2);
cr=cairo_create(surface);
@@ -3963,10 +3967,11 @@ gboolean gtk_plot_linear_print_png(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cr=cairo_create(surface);
draw(plot, cr);
cairo_surface_write_to_png(surface, fout);
@@ -3979,10 +3984,11 @@ gboolean gtk_plot_linear_print_svg(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_svg_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_svg_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_svg_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cr=cairo_create(surface);
draw(plot, cr);
cairo_destroy(cr);
@@ -4047,7 +4053,7 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
{
GtkPlotLinearPrivate *priv;
GtkPlotLinear *plot;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gint d, xw;
gdouble xn, xx, yn, yx, s;
@@ -4165,8 +4171,9 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
}
else if ((event->y)<=11)
{
- gtk_widget_get_allocation(widget, &alloc);
- xw=(alloc.width);
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=(alloc.width);
+ xw=(plot->alloc.width);
if ((event->x)>=xw-22)
{
if ((event->x)>=xw-11)
@@ -4220,56 +4227,26 @@ static void gtk_plot_linear_set_property(GObject *object, guint prop_id, const G
{
switch (prop_id)
{
- case PROP_BXN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin=g_value_get_double(value);
- break;
- }
- case PROP_BXX:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax=g_value_get_double(value);
- break;
- }
- case PROP_BYN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin=g_value_get_double(value);
- break;
- }
- case PROP_BYX:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax=g_value_get_double(value);
- break;
- }
- case PROP_XTJ:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj=g_value_get_uint(value);
- break;
- }
- case PROP_YTJ:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj=g_value_get_uint(value);
- break;
- }
- case PROP_XTN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn=g_value_get_uint(value);
- break;
- }
- case PROP_YTN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn=g_value_get_uint(value);
- break;
- }
- case PROP_FA:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga=g_value_get_uint(value);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BXN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin=g_value_get_double(value);
+ break;
+ case PROP_BXX: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax=g_value_get_double(value);
+ break;
+ case PROP_BYN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin=g_value_get_double(value);
+ break;
+ case PROP_BYX: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax=g_value_get_double(value);
+ break;
+ case PROP_XTJ: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj=g_value_get_uint(value);
+ break;
+ case PROP_YTJ: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj=g_value_get_uint(value);
+ break;
+ case PROP_XTN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn=g_value_get_uint(value);
+ break;
+ case PROP_YTN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn=g_value_get_uint(value);
+ break;
+ case PROP_FA: GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga=g_value_get_uint(value);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
@@ -4277,56 +4254,26 @@ static void gtk_plot_linear_get_property(GObject *object, guint prop_id, GValue
{
switch (prop_id)
{
- case PROP_BXN:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin);
- break;
- }
- case PROP_BXX:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax);
- break;
- }
- case PROP_BYN:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin);
- break;
- }
- case PROP_BYX:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax);
- break;
- }
- case PROP_XTJ:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj);
- break;
- }
- case PROP_YTJ:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj);
- break;
- }
- case PROP_XTN:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn);
- break;
- }
- case PROP_YTN:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn);
- break;
- }
- case PROP_FA:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BXN: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin);
+ break;
+ case PROP_BXX: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax);
+ break;
+ case PROP_BYN: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin);
+ break;
+ case PROP_BYX: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax);
+ break;
+ case PROP_XTJ: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj);
+ break;
+ case PROP_YTJ: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj);
+ break;
+ case PROP_XTN: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn);
+ break;
+ case PROP_YTN: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn);
+ break;
+ case PROP_FA: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
236 gtk2plot/gtkplotpolar.c
View
@@ -109,12 +109,13 @@ struct _GtkPlotPolarPrivate {struct xs bounds, rescale; struct pt centre; struct
static void drawz(GtkWidget *widget, cairo_t *cr)
{
GtkPlotPolar *plot;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gint xw;
gdouble dt;
- gtk_widget_get_allocation(widget, &alloc);
- xw=alloc.width;
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=alloc.width;
+ xw=widget->allocation.width;
plot=GTK_PLOT_POLAR(widget);
cairo_set_source_rgba(cr, 0, 0, 0, 1);
cairo_set_line_width(cr, 1);
@@ -177,7 +178,7 @@ static void draw(GtkWidget *widget, cairo_t *cr)
GtkPlotPolarPrivate *priv;
GtkPlotPolar *plot;
GtkPlot *plt;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gint ft, hg, j, j0, jl, k, kx, lt, st, wd, xt, xw, yw;
gdouble dtr, dtt, tt, thx, thn, dt, sx, csx, ssx, dr1, drs, drc, dz, rt, dwr, rl, ctx, ctn, stx, stn, r, th, rn, tn, x, y, vv, wv, xv, yv;
gchar lbl[BFL];
@@ -185,9 +186,11 @@ static void draw(GtkWidget *widget, cairo_t *cr)
PangoLayout *lyt;
cairo_matrix_t mtr;
- gtk_widget_get_allocation(widget, &alloc);
- xw=alloc.width;
- yw=alloc.height;
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=alloc.width;
+// yw=alloc.height;
+ xw=widget->allocation.width;
+ yw=widget->allocation.height;
plot=GTK_PLOT_POLAR(widget);
plt=GTK_PLOT(widget);
priv=GTK_PLOT_POLAR_GET_PRIVATE(plot);/* determine scale and fit for graph */
@@ -5312,10 +5315,11 @@ gboolean gtk_plot_polar_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_ps_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_ps_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_ps_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cairo_ps_surface_set_eps(surface, TRUE);
cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2);
cr=cairo_create(surface);
@@ -5331,10 +5335,11 @@ gboolean gtk_plot_polar_print_png(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cr=cairo_create(surface);
draw(plot, cr);
cairo_surface_write_to_png(surface, fout);
@@ -5347,10 +5352,11 @@ gboolean gtk_plot_polar_print_svg(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
cairo_surface_t *surface;
- GtkAllocation alloc;
+// GtkAllocation alloc;
- gtk_widget_get_allocation(plot, &alloc);
- surface=cairo_svg_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+// gtk_widget_get_allocation(plot, &alloc);
+// surface=cairo_svg_surface_create(fout, (gdouble) (alloc.width), (gdouble) (alloc.height));
+ surface=cairo_svg_surface_create(fout, (gdouble) (plot->allocation.width), (gdouble) (plot->allocation.height));
cr=cairo_create(surface);
draw(plot, cr);
cairo_destroy(cr);
@@ -5362,14 +5368,15 @@ static gboolean gtk_plot_polar_button_press(GtkWidget *widget, GdkEventButton *e
{
GtkPlotPolarPrivate *priv;
GtkPlotPolar *plot;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gdouble dy, dx, dt;
gint xw;
-
- gtk_widget_get_allocation(widget, &alloc);
+
priv=GTK_PLOT_POLAR_GET_PRIVATE(widget);
plot=GTK_PLOT_POLAR(widget);
- xw=(alloc.width);
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=(alloc.width);
+ xw=(widget->allocation.width);
if (((priv->flagr)==0)&&(((event->x)<xw-22)||((event->y)>11)))
{
(priv->rescale.rmax)=(priv->bounds.rmax);
@@ -5445,7 +5452,7 @@ static gboolean gtk_plot_polar_button_release(GtkWidget *widget, GdkEventButton
{
GtkPlotPolarPrivate *priv;
GtkPlotPolar *plot;
- GtkAllocation alloc;
+// GtkAllocation alloc;
gint xw;
gdouble dy, dx, dt, xn, xx, yn, yx, s;
@@ -5525,8 +5532,9 @@ static gboolean gtk_plot_polar_button_release(GtkWidget *widget, GdkEventButton
}
else if ((event->y)<=11)
{
- gtk_widget_get_allocation(widget, &alloc);
- xw=(alloc.width);
+// gtk_widget_get_allocation(widget, &alloc);
+// xw=(alloc.width);
+ xw=(widget->allocation.width);
if ((event->x)>=xw-22)
{
if ((event->x)>=xw-11) (plot->zmode)^=GTK_PLOT_POLAR_ZOOM_OUT;
@@ -5568,71 +5576,32 @@ static void gtk_plot_polar_set_property(GObject *object, guint prop_id, const GV
{
switch (prop_id)
{
- case PROP_BRN:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin)=g_value_get_double(value);
- break;
- }
- case PROP_BRX:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax)=g_value_get_double(value);
- break;
- }
- case PROP_BTN:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin)=g_value_get_double(value);
- break;
- }
- case PROP_BTX:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax)=g_value_get_double(value);
- break;
- }
- case PROP_CR:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r)=g_value_get_double(value);
- break;
- }
- case PROP_CT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th)=g_value_get_double(value);
- break;
- }
- case PROP_RT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r)=g_value_get_uint(value);
- break;
- }
- case PROP_ZIT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin)=g_value_get_uint(value);
- break;
- }
- case PROP_ZTM:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m)=g_value_get_uint(value);
- break;
- }
- case PROP_ZC:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc)=g_value_get_uint(value);
- break;
- }
- case PROP_RC:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs)=g_value_get_uint(value);
- break;
- }
- case PROP_TC:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs)=g_value_get_uint(value);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BRN: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin)=g_value_get_double(value);
+ break;
+ case PROP_BRX: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax)=g_value_get_double(value);
+ break;
+ case PROP_BTN: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin)=g_value_get_double(value);
+ break;
+ case PROP_BTX: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax)=g_value_get_double(value);
+ break;
+ case PROP_CR: (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r)=g_value_get_double(value);
+ break;
+ case PROP_CT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th)=g_value_get_double(value);
+ break;
+ case PROP_RT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r)=g_value_get_uint(value);
+ break;
+ case PROP_ZIT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin)=g_value_get_uint(value);
+ break;
+ case PROP_ZTM: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m)=g_value_get_uint(value);
+ break;
+ case PROP_ZC: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc)=g_value_get_uint(value);
+ break;
+ case PROP_RC: (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs)=g_value_get_uint(value);
+ break;
+ case PROP_TC: (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs)=g_value_get_uint(value);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
@@ -5640,71 +5609,32 @@ static void gtk_plot_polar_get_property(GObject *object, guint prop_id, GValue *
{
switch (prop_id)
{
- case PROP_BRN:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin));
- break;
- }
- case PROP_BRX:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax));
- break;
- }
- case PROP_BTN:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin));
- break;
- }
- case PROP_BTX:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax));
- break;
- }
- case PROP_CR:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r));
- break;
- }
- case PROP_CT:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th));
- break;
- }
- case PROP_RT:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r));
- break;
- }
- case PROP_ZIT:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin));
- break;
- }
- case PROP_ZTM:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m));
- break;
- }
- case PROP_ZC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc));
- break;
- }
- case PROP_RC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs));
- break;
- }
- case PROP_TC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs));
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BRN: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin));
+ break;
+ case PROP_BRX: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax));
+ break;
+ case PROP_BTN: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin));
+ break;
+ case PROP_BTX: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax));
+ break;
+ case PROP_CR: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r));
+ break;
+ case PROP_CT: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th));
+ break;
+ case PROP_RT: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r));
+ break;
+ case PROP_ZIT: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin));
+ break;
+ case PROP_ZTM: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m));
+ break;
+ case PROP_ZC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc));
+ break;
+ case PROP_RC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs));
+ break;
+ case PROP_TC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs));
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
163 gtk2plot/gtkplotsurf3.c
View
@@ -0,0 +1,163 @@
+/***************************************************************************
+ * gtkplotsurf3.c
+ *
+ * A GTK+ widget that plots data
+ * version 0.1.0
+ * Features:
+ * automatic wiggle insertion
+ * multiple plot capability
+ * optimal visualisation of axes
+ * zoomable ranges
+ * signal emission for mouse movement
+ *
+ * < Mon Jan 14 07:28:00 2014
+ * Copyright 2014 Paul Childs
+ * <pchilds@physics.org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library 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 Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#include <gtk/gtk.h>
+#include <math.h>
+#include <cairo-ps.h>
+#include <cairo-svg.h>
+#include "gtkplotsurf3.h"
+
+#define GTK_PLOT_SURF3_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_PLOT_TYPE_SURF3, GtkPlotSurf3Private))
+G_DEFINE_TYPE (GtkPlotSurf3, gtk_plot_surf3, GTK_TYPE_PLOT);
+enum {PROP_0, };
+enum {MOVED, LAST_SIGNAL};
+static guint gtk_plot_surf3_signals[LAST_SIGNAL]={0};
+typedef struct _GtkPlotSurf3Private GtkPlotSurf3Private;
+struct xs {gdouble xmin, ymin, xmax, ymax;};
+struct tk {guint xj, yj, xn, yn;};
+struct _GtkPlotSurf3Private {struct xs bounds, rescale; struct tk ticks, range; guint flaga, flagr;};
+
+static void drawz(GtkWidget *widget, cairo_t *cr) {
+ gint xw;
+ gdouble dt;
+ GtkPlotLinear *plot;
+
+ xw=widget->allocation.width;
+ plot=GTK_PLOT_LINEAR(widget);
+ cairo_set_source_rgba(cr, 0, 0, 0, 1);
+ cairo_set_line_width(cr, 1);
+ cairo_rectangle(cr, xw-21.5, 0.5, 10, 10);
+ cairo_rectangle(cr, xw-10.5, 0.5, 10, 10);
+ cairo_move_to(cr, xw-9, 5.5);
+ cairo_line_to(cr, xw-2, 5.5);
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_DRG)!=0) {
+ cairo_move_to(cr, xw-2.5, 4.5);
+ cairo_line_to(cr, xw-2, 5.5);
+ cairo_line_to(cr, xw-2.5, 6.5);
+ } else {
+ cairo_move_to(cr, xw-5.5, 2);
+ cairo_line_to(cr, xw-5.5, 9);
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_OUT)==0) {
+ cairo_move_to(cr, xw-6.5, 2.5);
+ cairo_line_to(cr, xw-5.5, 2);
+ cairo_line_to(cr, xw-4.5, 2.5);
+ cairo_move_to(cr, xw-2.5, 4.5);
+ cairo_line_to(cr, xw-2, 5.5);
+ cairo_line_to(cr, xw-2.5, 6.5);
+ cairo_move_to(cr, xw-6.5, 8.5);
+ cairo_line_to(cr, xw-5.5, 9);
+ cairo_line_to(cr, xw-4.5, 8.5);
+ cairo_move_to(cr, xw-8.5, 4.5);
+ cairo_line_to(cr, xw-9, 5.5);
+ cairo_line_to(cr, xw-8.5, 6.5);
+ } else {
+ cairo_move_to(cr, xw-7.5, 3.5);
+ cairo_line_to(cr, xw-3.5, 7.5);
+ cairo_move_to(cr, xw-7.5, 7.5);
+ cairo_line_to(cr, xw-3.5, 3.5);
+ }
+ }
+ cairo_stroke(cr);
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_SGL)==0) {
+ cairo_save(cr);
+ dt=1;
+ cairo_set_dash(cr, &dt, 1, 0);
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_VRT)!=0) {
+ cairo_move_to(cr, xw-20, 2.5);
+ cairo_line_to(cr, xw-13, 2.5);
+ cairo_move_to(cr, xw-20, 8.5);
+ cairo_line_to(cr, xw-13, 8.5);
+ cairo_stroke(cr);
+ } if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_HZT)!=0) {
+ cairo_move_to(cr, xw-19.5, 2);
+ cairo_line_to(cr, xw-19.5, 9);
+ cairo_move_to(cr, xw-13.5, 2);
+ cairo_line_to(cr, xw-13.5, 9);
+ cairo_stroke(cr);
+ }
+ cairo_restore(cr);
+ }
+}
+
+
+
+
+
+
+static void gtk_plot_surf3_class_init(GtkPlotSurf3Class *klass)
+{
+ GObjectClass *obj_klass;
+ GtkWidgetClass *widget_klass;
+
+ obj_klass=G_OBJECT_CLASS(klass);
+ g_type_class_add_private(obj_klass, sizeof(GtkPlotSurf3Private));
+ (obj_klass->finalize)=(GObjectFinalizeFunc) gtk_plot_linear_finalise;
+ (obj_klass->set_property)=gtk_plot_linear_set_property;
+ (obj_klass->get_property)=gtk_plot_linear_get_property;
+ g_object_class_install_property(obj_klass, PROP_BXN, g_param_spec_double("xmin", "Minimum x value", "Minimum value for the horizontal scale", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_BXX, g_param_spec_double("xmax", "Maximum x value", "Maximum value for the horizontal scale", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_BYN, g_param_spec_double("ymin", "Minimum y value", "Minimum value for the vertical scale", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_BYX, g_param_spec_double("ymax", "Maximum y value", "Maximum value for the vertical scale", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_XTJ, g_param_spec_uint("xbigticks", "Major x ticks-1", "Number of gaps between major ticks for the horizontal scale-1", 1, G_MAXINT, 4, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_YTJ, g_param_spec_uint("ybigticks", "Major y ticks-1", "Number of gaps between major ticks for the vertical scale-1", 1, G_MAXINT, 4, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_XTN, g_param_spec_uint("xsmallticks", "Minor x ticks+1", "Number of unlabelled tick divisions between major ticks for the horizontal scale+1", 1, G_MAXINT, 5, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_YTN, g_param_spec_uint("ysmallticks", "Minor y ticks+1", "Number of unlabelled ticks divisions between major ticks for the vertical scale+1", 1, G_MAXINT, 5, G_PARAM_READWRITE));
+ g_object_class_install_property(obj_klass, PROP_FA, g_param_spec_flags("aflag", "Axis Flags", "Flags for axes behaviour: 32 = Labels right, 16 = Labels above, 8 = Wiggle on top, 4 = Wiggle underneath, 2 = Wiggle on Right, 1 = Wiggle on left", G_TYPE_FLAGS, 0, G_PARAM_READWRITE));
+ widget_klass=GTK_WIDGET_CLASS(klass);
+ (widget_klass->button_press_event)=gtk_plot_surf3_button_press;
+ (widget_klass->motion_notify_event)=gtk_plot_surf3_motion_notify;
+ (widget_klass->button_release_event)=gtk_plot_surf3_button_release;
+ (widget_klass->expose_event)=gtk_plot_surf3_expose;
+ gtk_plot_surf3_signals[MOVED]=g_signal_new("moved", G_OBJECT_CLASS_TYPE(obj_klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GtkPlotSurf3Class, moved), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+}
+
+static void gtk_plot_surf3_init(GtkPlotSurf3 *plot)
+{
+ GtkPlotSurf3Private *priv;
+ gdouble val;
+
+ gtk_widget_add_events(GTK_WIDGET(plot), GDK_BUTTON_PRESS_MASK|GDK_POINTER_MOTION_MASK|GDK_BUTTON_RELEASE_MASK);
+ priv=GTK_PLOT_SURF3_GET_PRIVATE(plot);
+ {(priv->bounds.xmin)=0; (priv->bounds.xmax)=1; (priv->bounds.ymin)=0; (priv->bounds.ymax)=1;}
+ {(priv->ticks.xj)=4; (priv->ticks.yj)=4; (priv->ticks.xn)=5; (priv->ticks.yn)=5;}
+ {(priv->range.xj)=0; (priv->range.yj)=0; (priv->range.xn)=1; (priv->range.yn)=1;}
+ {(plot->xdp)=2; (plot->ydp)=2;}
+ {(priv->flaga)=0; (priv->flagr)=0;}
+ {(plot->xdata)=NULL; (plot->ydata)=NULL;}
+ {(plot->xlab)=g_strdup("Domain"); (plot->ylab)=g_strdup("Amplitude");}
+ {(plot->flagd)=GTK_PLOT_LINEAR_DISP_LIN; (plot->ptsize)=5; (plot->linew)=2;}
+ (plot->zmode)=(GTK_PLOT_LINEAR_ZOOM_VRT|GTK_PLOT_LINEAR_ZOOM_HZT);
+ {(plot->xps)=0; (plot->yps)=0;}
+}
+
+GtkWidget *gtk_plot_surf3_new(void) {return g_object_new(GTK_PLOT_TYPE_SURF3, NULL);}
78 gtk2plot/gtkplotsurf3.h
View
@@ -0,0 +1,78 @@
+/***************************************************************************
+ * gtkplotsurf3.h
+ *
+ * A GTK+ widget that plots data
+ *
+ * Mon Jan 14 07:28:00 2014
+ * Copyright 2014 Paul Childs
+ * <pchilds@physics.org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library 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 Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#ifndef __GTK_PLOT_SURF3_H__
+# define __GTK_PLOT_SURF3_H__
+# include <gtk/gtk.h>
+# include "gtkplot.h"
+ G_BEGIN_DECLS
+# define GTK_PLOT_TYPE_SURF3 (gtk_plot_surf3_get_type())
+# define GTK_PLOT_SURF3(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_PLOT_TYPE_SURF3, GtkPlotSurf3))
+# define GTK_PLOT_IS_SURF3(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_PLOT_TYPE_SURF3))
+# define GTK_PLOT_SURF3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_PLOT_SURF3, GtkPlotSurf3Class))
+# define GTK_PLOT_IS_SURF3_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_PLOT_TYPE_SURF3))
+# define GTK_PLOT_SURF3_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_PLOT_TYPE_SURF3, GtkPlotSurf3Class))
+ typedef struct _GtkPlotSurf3 GtkPlotSurf3;
+ typedef struct _GtkPlotSurf3Class GtkPlotSurf3Class;
+ typedef enum
+ {
+ GTK_PLOT_SURF3_ZOOM_OUT = 1 << 0,
+ GTK_PLOT_SURF3_ZOOM_DRG = 1 << 1,
+ GTK_PLOT_SURF3_ZOOM_PAN = 1 << 2,
+ GTK_PLOT_SURF3_ZOOM_VRT = 1 << 3,
+ GTK_PLOT_SURF3_ZOOM_SGL = 1 << 4
+ } GtkPlotSurf3Zoom;
+ typedef enum
+ {
+ GTK_PLOT_SURF3_DISP_FIL = 1 << 0
+ } GtkPlotSurf3Disp;
+ struct _GtkPlotSurf3
+ {
+ GtkPlot parent;
+ GArray *xdata, *ydata; /* x and y data sets */
+ gchar *xlab, *ylab; /* labels for the x and y axes */
+ guint ptsize, linew; /* radii of the points and line width of the plot line */
+ guint xdp, ydp; /* number of decimal points for axes */
+ gint zmode; /* zoom mode flags */
+ gdouble xps, yps; /* x and y position of mouse */
+ guint flagd; /* data display flags */
+ };
+ struct _GtkPlotSurf3Class
+ {
+ GtkPlotClass parent_class;
+ void (*moved) (GtkPlotSurf3 *plot);
+ };
+ gboolean gtk_plot_surf3_update_scale(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
+ gboolean gtk_plot_surf3_update_scale_pretty(GtkWidget *widget, gdouble xl, gdouble xu, gdouble yl, gdouble yu);
+ gboolean gtk_plot_surf3_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
+ gboolean gtk_plot_surf3_print_eps(GtkWidget *widget, gchar *fout);
+ gboolean gtk_plot_surf3_print_png(GtkWidget *widget, gchar *fout);
+ gboolean gtk_plot_surf3_print_svg(GtkWidget *widget, gchar *fout);
+ void gtk_plot_surf3_set_label(GtkPlotSurf3 *plot, gchar *xl, gchar *yl);
+ void gtk_plot_surf3_set_data(GtkPlotSurf3 *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz, GArray *st);
+ GtkWidget *gtk_plot_surf3_new(void);
+ G_END_DECLS
+#endif
0  gtk2plot/testplotbar.c
View
No changes.
0  gtk2plot/testplotdonut.c
View
No changes.
0  gtk2plot/testplotsurf3
View
No changes.
140 gtk3plot/gtkplotlinear.c
View
@@ -4192,56 +4192,26 @@ static void gtk_plot_linear_set_property(GObject *object, guint prop_id, const G
{;
switch (prop_id)
{
- case PROP_BXN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin=g_value_get_double(value);
- break;
- }
- case PROP_BXX:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax=g_value_get_double(value);
- break;
- }
- case PROP_BYN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin=g_value_get_double(value);
- break;
- }
- case PROP_BYX:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax=g_value_get_double(value);
- break;
- }
- case PROP_XTJ:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj=g_value_get_uint(value);
- break;
- }
- case PROP_YTJ:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj=g_value_get_uint(value);
- break;
- }
- case PROP_XTN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn=g_value_get_uint(value);
- break;
- }
- case PROP_YTN:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn=g_value_get_uint(value);
- break;
- }
- case PROP_FA:
- {
- GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga=g_value_get_uint(value);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BXN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin=g_value_get_double(value);
+ break;
+ case PROP_BXX: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax=g_value_get_double(value);
+ break;
+ case PROP_BYN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin=g_value_get_double(value);
+ break;
+ case PROP_BYX: GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax=g_value_get_double(value);
+ break;
+ case PROP_XTJ: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj=g_value_get_uint(value);
+ break;
+ case PROP_YTJ: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj=g_value_get_uint(value);
+ break;
+ case PROP_XTN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn=g_value_get_uint(value);
+ break;
+ case PROP_YTN: GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn=g_value_get_uint(value);
+ break;
+ case PROP_FA: GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga=g_value_get_uint(value);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
@@ -4249,56 +4219,26 @@ static void gtk_plot_linear_get_property(GObject *object, guint prop_id, GValue
{
switch (prop_id)
{
- case PROP_BXN:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin);
- break;
- }
- case PROP_BXX:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax);
- break;
- }
- case PROP_BYN:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin);
- break;
- }
- case PROP_BYX:
- {
- g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax);
- break;
- }
- case PROP_XTJ:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj);
- break;
- }
- case PROP_YTJ:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj);
- break;
- }
- case PROP_XTN:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn);
- break;
- }
- case PROP_YTN:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn);
- break;
- }
- case PROP_FA:
- {
- g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BXN: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmin);
+ break;
+ case PROP_BXX: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.xmax);
+ break;
+ case PROP_BYN: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymin);
+ break;
+ case PROP_BYX: g_value_set_double(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->bounds.ymax);
+ break;
+ case PROP_XTJ: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xj);
+ break;
+ case PROP_YTJ: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yj);
+ break;
+ case PROP_XTN: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.xn);
+ break;
+ case PROP_YTN: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->ticks.yn);
+ break;
+ case PROP_FA: g_value_set_uint(value, GTK_PLOT_LINEAR_GET_PRIVATE(object)->flaga);
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
178 gtk3plot/gtkplotpolar.c
View
@@ -5553,69 +5553,32 @@ static void gtk_plot_polar_set_property(GObject *object, guint prop_id, const GV
{
switch (prop_id)
{
- case PROP_BRN:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin)=g_value_get_double(value);
- break;
- }
- case PROP_BRX:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax)=g_value_get_double(value);
- break;
- }
- case PROP_BTN:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin)=g_value_get_double(value);
- break;
- }
- case PROP_BTX:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax)=g_value_get_double(value);
- break;
- }
- case PROP_CR:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r)=g_value_get_double(value);
- break;
- }
- case PROP_CT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th)=g_value_get_double(value);
- break;
- }
- case PROP_RT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r)=g_value_get_uint(value);
- break;
- }
- case PROP_ZIT:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin)=g_value_get_uint(value);
- break;
- }
- case PROP_ZTM:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m)=g_value_get_uint(value);
- break;
- }
- case PROP_ZC:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc)=g_value_get_uint(value);
- break;
- }
- case PROP_RC:
- {
- (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs)=g_value_get_uint(value);
- break;
- }
+ case PROP_BRN: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin)=g_value_get_double(value);
+ break;
+ case PROP_BRX: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax)=g_value_get_double(value);
+ break;
+ case PROP_BTN: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin)=g_value_get_double(value);
+ break;
+ case PROP_BTX: (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax)=g_value_get_double(value);
+ break;
+ case PROP_CR: (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r)=g_value_get_double(value);
+ break;
+ case PROP_CT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th)=g_value_get_double(value);
+ break;
+ case PROP_RT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r)=g_value_get_uint(value);
+ break;
+ case PROP_ZIT: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin)=g_value_get_uint(value);
+ break;
+ case PROP_ZTM: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m)=g_value_get_uint(value);
+ break;
+ case PROP_ZC: (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc)=g_value_get_uint(value);
+ break;
+ case PROP_RC: (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs)=g_value_get_uint(value);
+ break;
case PROP_TC: {(GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs)=g_value_get_uint(value);
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
@@ -5623,71 +5586,32 @@ static void gtk_plot_polar_get_property(GObject *object, guint prop_id, GValue *
{
switch (prop_id)
{
- case PROP_BRN:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin));
- break;
- }
- case PROP_BRX:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax));
- break;
- }
- case PROP_BTN:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin));
- break;
- }
- case PROP_BTX:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax));
- break;
- }
- case PROP_CR:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r));
- break;
- }
- case PROP_CT:
- {
- g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th));
- break;
- }
- case PROP_RT:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r));
- break;
- }
- case PROP_ZIT:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin));
- break;
- }
- case PROP_ZTM:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m));
- break;
- }
- case PROP_ZC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc));
- break;
- }
- case PROP_RC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs));
- break;
- }
- case PROP_TC:
- {
- g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs));
- break;
- }
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ case PROP_BRN: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmin));
+ break;
+ case PROP_BRX: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.rmax));
+ break;
+ case PROP_BTN: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmin));
+ break;
+ case PROP_BTX: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->bounds.thmax));
+ break;
+ case PROP_CR: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.r));
+ break;
+ case PROP_CT: g_value_set_double(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->centre.th));
+ break;
+ case PROP_RT: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.r));
+ break;
+ case PROP_ZIT: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zin));
+ break;
+ case PROP_ZTM: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.z2m));
+ break;
+ case PROP_ZC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->ticks.zc));
+ break;
+ case PROP_RC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->rcs));
+ break;
+ case PROP_TC: g_value_set_uint(value, (GTK_PLOT_POLAR_GET_PRIVATE(object)->thcs));
+ break;
+ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.