GLeaker

GLeaker Commit Details

Date:2013-10-04 11:52:22 (6 years 9 months ago)
Author:Nicola Fontana
Branch:master
Commit:6d7300d7072d70a7bd68dcea16d8c24e642579b0
Parents: bafdbd106dab05792762b9c70869f906a59a1440
Message:Add libgoffice chart

Added a bare plot to the first page (named "Leak detection") of the
GtkNotebook.
Changes:
Msrc/gleaker.c (6 diffs)

File differences

src/gleaker.c
1818
1919
2020
21
2122
2223
2324
......
8788
8889
8990
90
91
9192
9293
9394
......
216217
217218
218219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
219253
220254
221255
......
238272
239273
240274
275
276
277
278
279
241280
242281
243282
......
253292
254293
255294
295
256296
257297
258298
......
280320
281321
282322
323
283324
284325
285326
#include <gtk/gtk.h>
#include <goffice/goffice.h>
#include <stdlib.h>
#include "config.h"
g_return_val_if_fail(GTK_IS_BUILDER(builder), NULL);
g_return_val_if_fail(name != NULL, NULL);
object = gtk_builder_get_object(builder, "wndMain");
object = gtk_builder_get_object(builder, name);
if (object == NULL) {
g_critical(_("Widget '%s' not found in gleaker.ui"), name);
return NULL;
variable); \
}G_STMT_END
static void
add_sample_data(GogSeries *series)
{
GOData *data;
gdouble values[] = {
2, 6, 4, 8, 5, 1, 7, 3,
};
/* Set some sample data to series */
data = go_data_vector_val_new(values, G_N_ELEMENTS(values), NULL);
gog_series_set_dim(series, 1, data, NULL);
}
static GtkWidget *
graph_new(const gchar *title)
{
GtkWidget *widget;
GogChart *chart;
GogPlot *plot;
GogSeries *series;
widget = go_graph_widget_new(NULL);
chart = go_graph_widget_get_chart(GO_GRAPH_WIDGET(widget));
plot = gog_plot_new_by_name("GogLinePlot");
series = gog_plot_new_series(plot);
gog_object_add_by_name(GOG_OBJECT(chart), "Plot", GOG_OBJECT(plot));
gog_series_lines_use_markers(GOG_SERIES_LINES(series), FALSE);
add_sample_data(series);
return widget;
}
static GtkWidget *
get_main_window(GtkBuilder *builder)
{
SETUP_FLAG (& setup->until_end, "ckbUntilEnd");
SETUP_VALUE(& setup->drain_delay, "adjDrainDelay");
/* Add leak detection graph */
gtk_box_pack_end(GTK_BOX(get_widget(builder, "bxLeak")),
graph_new("Leak detection"),
TRUE, TRUE, 0);
/* Connect signals */
g_signal_connect(window, "delete-event",
G_CALLBACK(gtk_main_quit), NULL);
return 1;
libgoffice_init();
go_plugins_init(NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE);
return 0;
}
static void
gleaker_shutdown(void)
{
go_plugins_shutdown();
libgoffice_shutdown();
}

Archive Download the corresponding diff file

Branches