| 1 |
#ifndef _GSM_GRAPH_H_ |
| 2 |
#define _GSM_GRAPH_H_ |
| 3 |
|
| 4 |
|
| 5 |
z> |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#pragma once |
| 24 |
|
| 25 |
#include <gtk/gtk.h> |
| 26 |
|
| 27 |
G_BEGIN_DECLS |
| 28 |
|
| 29 |
#define GSM_TYPE_GRAPH (gsm_graph_get_type ()) |
| 30 |
#define GSM_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_GRAPH, GsmGraph)) |
| 31 |
#define GSM_IS_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_GRAPH)) |
| 32 |
|
| 33 |
typedef struct _GsmGraph GsmGraph; |
| 34 |
typedef struct _GsmGraphClass GsmGraphClass; |
| 35 |
typedef struct _GsmGraphPrivate GsmGraphPrivate; |
| 36 |
|
| 37 |
struct _GsmGraph |
| 38 |
{ |
| 39 |
GtkDrawingArea parent_instance; |
| 40 |
}; |
| 41 |
|
| 42 |
struct _GsmGraphPrivate |
| 43 |
{ |
| 44 |
gboolean draw; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
guint render_counter; |
| 49 |
guint frames_per_unit; |
| 50 |
guint redraw_timeout; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
double fontsize; |
| 56 |
|
| 57 |
guint speed; |
| 58 |
|
| 59 |
gboolean logarithmic_scale; |
| 60 |
|
| 61 |
guint num_points; |
| 62 |
|
| 63 |
gboolean stacked; |
| 64 |
|
| 65 |
gboolean smooth; |
| 66 |
|
| 67 |
guint64 max_value; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
double rmargin; |
| 73 |
|
| 74 |
cairo_surface_t *background; |
| 75 |
guint indent; |
| 76 |
|
| 77 |
|
| 78 |
GSourceFunc data_function; |
| 79 |
|
| 80 |
gpointer update_data; |
| 81 |
}; |
| 82 |
|
| 83 |
struct _GsmGraphClass |
| 84 |
{ |
| 85 |
GtkDrawingAreaClass parent_class; |
| 86 |
|
| 87 |
void (* css_changed) (GsmGraph *graph); |
| 88 |
}; |
| 89 |
|
| 90 |
GType gsm_graph_get_type (void); |
| 91 |
GsmGraph * gsm_graph_new (void); |
| 92 |
|
| 93 |
void gsm_graph_dispose (GObject*); |
| 94 |
void gsm_graph_finalize (GObject*); |
| 95 |
|
| 96 |
void gsm_graph_start (GsmGraph*); |
| 97 |
void gsm_graph_stop (GsmGraph*); |
| 98 |
void gsm_graph_force_refresh (GsmGraph*); |
| 99 |
|
| 100 |
|
| 101 |
void gsm_graph_set_logarithmic_scale (GsmGraph*, gboolean); |
| 102 |
void gsm_graph_set_smooth_chart (GsmGraph*, gboolean); |
| 103 |
void gsm_graph_set_stacked_chart (GsmGraph*, gboolean); |
| 104 |
void gsm_graph_set_speed (GsmGraph*, guint); |
| 105 |
void gsm_graph_set_data_function (GsmGraph*, GSourceFunc, gpointer); |
| 106 |
void gsm_graph_set_font_size (GsmGraph*, double); |
| 107 |
void gsm_graph_set_num_points (GsmGraph*, guint); |
| 108 |
void gsm_graph_set_max_value (GsmGraph*, guint64); |
| 109 |
|
| 110 |
|
| 111 |
void gsm_graph_clear_background (GsmGraph*); |
| 112 |
void gsm_graph_set_background (GsmGraph*, cairo_surface_t*); |
| 113 |
void gsm_graph_set_frames_per_unit (GsmGraph*, guint); |
| 114 |
|
| 115 |
|
| 116 |
gboolean gsm_graph_is_logarithmic_scale (GsmGraph*); |
| 117 |
guint gsm_graph_get_speed (GsmGraph*); |
| 118 |
double gsm_graph_get_font_size (GsmGraph*); |
| 119 |
gboolean gsm_graph_is_started (GsmGraph*); |
| 120 |
gboolean gsm_graph_is_smooth_chart (GsmGraph*); |
| 121 |
gboolean gsm_graph_is_stacked_chart (GsmGraph*); |
| 122 |
guint gsm_graph_get_num_points (GsmGraph*); |
| 123 |
guint64 gsm_graph_get_max_value (GsmGraph*); |
| 124 |
|
| 125 |
|
| 126 |
gboolean gsm_graph_is_background_set (GsmGraph*); |
| 127 |
cairo_surface_t * gsm_graph_get_background (GsmGraph*); |
| 128 |
guint gsm_graph_get_frames_per_unit (GsmGraph*); |
| 129 |
guint gsm_graph_get_render_counter (GsmGraph*); |
| 130 |
guint gsm_graph_get_indent (GsmGraph*); |
| 131 |
double gsm_graph_get_right_margin (GsmGraph*); |
| 132 |
guint gsm_graph_get_num_bars (GsmGraph*, gint); |
| 133 |
|
| 134 |
|
| 135 |
G_END_DECLS |
| 136 |
|
| 137 |
#endif |