Skip to content

Commit 87c02ec

Browse files
committed
Added pointer passing functions
1 parent d08bbbc commit 87c02ec

13 files changed

+292
-167
lines changed
File renamed without changes.
File renamed without changes.

gtk2plot/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ libgtkplot_@PLOT_API_VERSION@_la_SOURCES= \
1010
gtkplotpolar.c
1111
libgtkplot_@PLOT_API_VERSION@_la_LDFLAGS= \
1212
@lt_enable_auto_import@ \
13+
-no-undefined \
1314
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
1415
$(PLOT_LIBS)
1516
gtkplotincludedir=$(includedir)/gtkplot-$(PLOT_API_VERSION)

gtk2plot/gtkplotlinear.c

+33-1
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ static void draw(GtkWidget *widget, cairo_t *cr)
14091409
cairo_move_to(cr, tnn, ya);
14101410
cairo_line_to(cr, tnn, ya-NT);
14111411
}
1412-
cairo_stroke(cr);lr3=2;}
1412+
cairo_stroke(cr);
14131413
to=tn;
14141414
for (j=(tz+1); j<(priv->ticks.xj); j++)
14151415
{
@@ -4174,6 +4174,38 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
41744174
return FALSE;
41754175
}
41764176

4177+
void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl)
4178+
{
4179+
if (plot->xlab) g_free(plot->xlab);
4180+
if (plot->ylab) g_free(plot->ylab);
4181+
{(plot->xlab)=g_strdup(xl); (plot->ylab)=g_strdup(yl);}
4182+
}
4183+
4184+
void gtk_plot_linear_set_font(GtkPlotLinear *plot, PangoFontDescription *lf, PangoFontDescription *af)
4185+
{
4186+
if (plot->afont) pango_font_description_free(plot->afont);
4187+
if (plot->lfont) pango_font_description_free(plot->lfont);
4188+
{(plot->afont)=pango_font_description_copy(af); (plot->lfont)=pango_font_description_copy(lf);}
4189+
}
4190+
4191+
void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz)
4192+
{
4193+
if (plot->xdata) g_array_free((plot->xdata), FALSE);
4194+
if (plot->ydata) g_array_free((plot->ydata), FALSE);
4195+
if (plot->ind) g_array_free((plot->ind), FALSE);
4196+
if (plot->sizes) g_array_free((plot->sizes), FALSE);
4197+
{(plot->xdata)=xd; (plot->ydata)=yd; (plot->ind)=nd; (plot->sizes)=sz;}
4198+
}
4199+
4200+
void gtk_plot_linear_set_colour(GtkPlotLinear *plot, GArray *rd, GArray *gr, GArray *bl, GArray *al)
4201+
{
4202+
if (plot->rd) g_array_free((plot->rd), FALSE);
4203+
if (plot->gr) g_array_free((plot->gr), FALSE);
4204+
if (plot->bl) g_array_free((plot->bl), FALSE);
4205+
if (plot->al) g_array_free((plot->al), FALSE);
4206+
{(plot->rd)=rd; (plot->gr)=gr; (plot->bl)=bl; (plot->al)=al;}
4207+
}
4208+
41774209
static void gtk_plot_linear_finalise(GtkPlotLinear *plot)
41784210
{
41794211
GtkPlotLinearPrivate *priv;

gtk2plot/gtkplotlinear.h

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
gboolean gtk_plot_linear_print_eps(GtkWidget *widget, gchar *fout);
7373
gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout);
7474
gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout);
75+
void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl);
76+
void gtk_plot_linear_set_font(GtkPlotLinear *plot, PangoFontDescription *lf, PangoFontDescription *af);
77+
void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz);
78+
void gtk_plot_linear_set_colour(GtkPlotLinear *plot, GArray *rd, GArray *gr, GArray *bl, GArray *al);
7579
GtkWidget *gtk_plot_linear_new(void);
7680
G_END_DECLS
7781
#endif

gtk2plot/gtkplotpolar.c

+32
Original file line numberDiff line numberDiff line change
@@ -5532,6 +5532,38 @@ static gboolean gtk_plot_polar_button_release(GtkWidget *widget, GdkEventButton
55325532
return FALSE;
55335533
}
55345534

5535+
void gtk_plot_polar_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl)
5536+
{
5537+
if (plot->rlab) g_free(plot->rlab);
5538+
if (plot->thlab) g_free(plot->thlab);
5539+
{(plot->rlab)=g_strdup(rl); (plot->thlab)=g_strdup(tl);}
5540+
}
5541+
5542+
void gtk_plot_polar_set_font(GtkPlotPolar *plot, PangoFontDescription *lf, PangoFontDescription *af)
5543+
{
5544+
if (plot->afont) pango_font_description_free(plot->afont);
5545+
if (plot->lfont) pango_font_description_free(plot->lfont);
5546+
{(plot->afont)=pango_font_description_copy(af); (plot->lfont)=pango_font_description_copy(lf);}
5547+
}
5548+
5549+
void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz)
5550+
{
5551+
if (plot->rdata) g_array_free((plot->rdata), FALSE);
5552+
if (plot->thdata) g_array_free((plot->thdata), FALSE);
5553+
if (plot->ind) g_array_free((plot->ind), FALSE);
5554+
if (plot->sizes) g_array_free((plot->sizes), FALSE);
5555+
{(plot->rdata)=rd; (plot->thdata)=td; (plot->ind)=nd; (plot->sizes)=sz;}
5556+
}
5557+
5558+
void gtk_plot_polar_set_colour(GtkPlotPolar *plot, GArray *rd, GArray *gr, GArray *bl, GArray *al)
5559+
{
5560+
if (plot->rd) g_array_free((plot->rd), FALSE);
5561+
if (plot->gr) g_array_free((plot->gr), FALSE);
5562+
if (plot->bl) g_array_free((plot->bl), FALSE);
5563+
if (plot->al) g_array_free((plot->al), FALSE);
5564+
{(plot->rd)=rd; (plot->gr)=gr; (plot->bl)=bl; (plot->al)=al;}
5565+
}
5566+
55355567
static void gtk_plot_polar_finalise(GtkPlotPolar *plot)
55365568
{
55375569
GtkPlotPolarPrivate *priv;

gtk2plot/gtkplotpolar.h

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
gboolean gtk_plot_polar_print_eps(GtkWidget *widget, gchar *fout);
7676
gboolean gtk_plot_polar_print_png(GtkWidget *widget, gchar *fout);
7777
gboolean gtk_plot_polar_print_svg(GtkWidget *widget, gchar *fout);
78+
void gtk_plot_linear_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl);
79+
void gtk_plot_linear_set_font(GtkPlotPolar *plot, PangoFontDescription *lf, PangoFontDescription *af);
80+
void gtk_plot_linear_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz);
81+
void gtk_plot_linear_set_colour(GtkPlotPolar *plot, GArray *rd, GArray *gr, GArray *bl, GArray *al);
7882
GtkWidget *gtk_plot_polar_new(void);
7983
G_END_DECLS
8084
#endif

0 commit comments

Comments
 (0)