gtkdatabox  1.0.0
About: GtkDatabox is a Gtk+-widget for live display of large amounts of fluctuating numerical data.
  Fossies Dox: gtkdatabox-1.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gtkdatabox.c File Reference
#include <gtkdatabox.h>
#include <gtkdatabox_marshal.h>
#include <gtkdatabox_ruler.h>
#include <gtk/gtk.h>
#include <math.h>
Include dependency graph for gtkdatabox.c:

Go to the source code of this file.

Data Structures

struct  _GtkDataboxPrivate
 

Typedefs

typedef struct _GtkDataboxPrivate GtkDataboxPrivate
 

Enumerations

enum  {
  ZOOMED_SIGNAL , SELECTION_STARTED_SIGNAL , SELECTION_CHANGED_SIGNAL , SELECTION_FINALIZED_SIGNAL ,
  SELECTION_CANCELED_SIGNAL , LAST_SIGNAL
}
 
enum  {
  ENABLE_SELECTION = 1 , ENABLE_ZOOM , ADJUSTMENT_X , ADJUSTMENT_Y ,
  RULER_X , RULER_Y , SCALE_TYPE_X , SCALE_TYPE_Y ,
  BOX_SHADOW , LAST_PROPERTY
}
 

Functions

static gint gtk_databox_button_press (GtkWidget *widget, GdkEventButton *event)
 
static gint gtk_databox_scroll_event (GtkWidget *widget, GdkEventScroll *event)
 
static gint gtk_databox_button_release (GtkWidget *widget, GdkEventButton *event)
 
static gint gtk_databox_motion_notify (GtkWidget *widget, GdkEventMotion *event)
 
static void gtk_databox_realize (GtkWidget *widget)
 
static void gtk_databox_unrealize (GtkWidget *widget)
 
static void gtk_databox_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 
static gint gtk_databox_draw (GtkWidget *widget, cairo_t *cr)
 
static void gtk_databox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void gtk_databox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
static gfloat gtk_databox_get_offset_x (GtkDatabox *box)
 
static gfloat gtk_databox_get_page_size_x (GtkDatabox *box)
 
static gfloat gtk_databox_get_offset_y (GtkDatabox *box)
 
static gfloat gtk_databox_get_page_size_y (GtkDatabox *box)
 
static void gtk_databox_calculate_visible_limits (GtkDatabox *box)
 
static void gtk_databox_create_backing_surface (GtkDatabox *box)
 
static void gtk_databox_calculate_selection_values (GtkDatabox *box)
 
static void gtk_databox_selection_cancel (GtkDatabox *box)
 
static void gtk_databox_zoomed (GtkDatabox *box)
 
static void gtk_databox_draw_selection (GtkDatabox *box, gboolean clear)
 
static void gtk_databox_adjustment_value_changed (GtkDatabox *box)
 
static void gtk_databox_ruler_update (GtkDatabox *box)
 
static void gtk_databox_class_init (GtkDataboxClass *class)
 
static void gtk_databox_init (GtkDatabox *box)
 
GtkWidget * gtk_databox_new (void)
 
GList * gtk_databox_get_graphs (GtkDatabox *box)
 
void gtk_databox_set_enable_selection (GtkDatabox *box, gboolean enable)
 
void gtk_databox_set_enable_zoom (GtkDatabox *box, gboolean enable)
 
void gtk_databox_set_adjustment_x (GtkDatabox *box, GtkAdjustment *adj)
 
void gtk_databox_set_adjustment_y (GtkDatabox *box, GtkAdjustment *adj)
 
void gtk_databox_set_ruler_x (GtkDatabox *box, GtkDataboxRuler *ruler)
 
void gtk_databox_set_ruler_y (GtkDatabox *box, GtkDataboxRuler *ruler)
 
void gtk_databox_set_scale_type_x (GtkDatabox *box, GtkDataboxScaleType scale_type)
 
void gtk_databox_set_scale_type_y (GtkDatabox *box, GtkDataboxScaleType scale_type)
 
void gtk_databox_set_box_shadow (GtkDatabox *box, GtkShadowType which_shadow)
 
gboolean gtk_databox_get_enable_selection (GtkDatabox *box)
 
gboolean gtk_databox_get_enable_zoom (GtkDatabox *box)
 
GtkAdjustment * gtk_databox_get_adjustment_x (GtkDatabox *box)
 
GtkAdjustment * gtk_databox_get_adjustment_y (GtkDatabox *box)
 
GtkDataboxRulergtk_databox_get_ruler_x (GtkDatabox *box)
 
GtkDataboxRulergtk_databox_get_ruler_y (GtkDatabox *box)
 
GtkDataboxScaleType gtk_databox_get_scale_type_x (GtkDatabox *box)
 
GtkDataboxScaleType gtk_databox_get_scale_type_y (GtkDatabox *box)
 
GtkShadowType gtk_databox_get_box_shadow (GtkDatabox *box)
 
void gtk_databox_set_bg_color (GtkDatabox *box, gchar *bg_color)
 
static void gtk_databox_calculate_translation_factors (GtkDatabox *box)
 
cairo_surface_t * gtk_databox_get_backing_surface (GtkDatabox *box)
 
void gtk_databox_zoom_to_selection (GtkDatabox *box)
 
void gtk_databox_zoom_out (GtkDatabox *box)
 
void gtk_databox_zoom_home (GtkDatabox *box)
 
gint gtk_databox_auto_rescale (GtkDatabox *box, gfloat border)
 
gint gtk_databox_calculate_extrema (GtkDatabox *box, gfloat *min_x, gfloat *max_x, gfloat *min_y, gfloat *max_y)
 
void gtk_databox_set_total_limits (GtkDatabox *box, gfloat left, gfloat right, gfloat top, gfloat bottom)
 
void gtk_databox_set_visible_limits (GtkDatabox *box, gfloat left, gfloat right, gfloat top, gfloat bottom)
 
void gtk_databox_get_total_limits (GtkDatabox *box, gfloat *left, gfloat *right, gfloat *top, gfloat *bottom)
 
void gtk_databox_get_visible_limits (GtkDatabox *box, gfloat *left, gfloat *right, gfloat *top, gfloat *bottom)
 
gint gtk_databox_graph_add (GtkDatabox *box, GtkDataboxGraph *graph)
 
gint gtk_databox_graph_add_front (GtkDatabox *box, GtkDataboxGraph *graph)
 
gint gtk_databox_graph_remove (GtkDatabox *box, GtkDataboxGraph *graph)
 
gint gtk_databox_graph_remove_all (GtkDatabox *box)
 
gint16 gtk_databox_value_to_pixel_x (GtkDatabox *box, gfloat value)
 
gint16 gtk_databox_value_to_pixel_y (GtkDatabox *box, gfloat value)
 
void gtk_databox_values_to_xpixels (GtkDatabox *box, gint16 *pixels, void *values, GType vtype, guint maxlen, guint start, guint stride, guint len)
 
void gtk_databox_values_to_ypixels (GtkDatabox *box, gint16 *pixels, void *values, GType vtype, guint maxlen, guint start, guint stride, guint len)
 
gfloat gtk_databox_pixel_to_value_x (GtkDatabox *box, gint16 pixel)
 
gfloat gtk_databox_pixel_to_value_y (GtkDatabox *box, gint16 pixel)
 
void gtk_databox_create_box_with_scrollbars_and_rulers (GtkWidget **p_box, GtkWidget **p_grid, gboolean scrollbar_x, gboolean scrollbar_y, gboolean ruler_x, gboolean ruler_y)
 
void gtk_databox_create_box_with_scrollbars_and_rulers_positioned (GtkWidget **p_box, GtkWidget **p_grid, gboolean scrollbar_x, gboolean scrollbar_y, gboolean ruler_x, gboolean ruler_y, gboolean ruler_x_top, gboolean ruler_y_left)
 

Variables

static gint gtk_databox_signals [LAST_SIGNAL] = { 0 }
 

Typedef Documentation

◆ GtkDataboxPrivate

Definition at line 85 of file gtkdatabox.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ZOOMED_SIGNAL 
SELECTION_STARTED_SIGNAL 
SELECTION_CHANGED_SIGNAL 
SELECTION_FINALIZED_SIGNAL 
SELECTION_CANCELED_SIGNAL 
LAST_SIGNAL 

Definition at line 75 of file gtkdatabox.c.

◆ anonymous enum

anonymous enum
Enumerator
ENABLE_SELECTION 
ENABLE_ZOOM 
ADJUSTMENT_X 
ADJUSTMENT_Y 
RULER_X 
RULER_Y 
SCALE_TYPE_X 
SCALE_TYPE_Y 
BOX_SHADOW 
LAST_PROPERTY 

Definition at line 89 of file gtkdatabox.c.

Function Documentation

◆ gtk_databox_adjustment_value_changed()

static void gtk_databox_adjustment_value_changed ( GtkDatabox box)
static

◆ gtk_databox_auto_rescale()

gint gtk_databox_auto_rescale ( GtkDatabox box,
gfloat  border 
)

gtk_databox_auto_rescale: @box: A GtkDatabox widget @border: Relative border width (e.g. 0.1 means that the border on each side is 10% of the data area).

This function is similar to gtk_databox_set_total_limits(). It sets the total limits to match the data extrema (see gtk_databox_calculate_extrema()). If you do not like data pixels exactly at the widget's border, you can add modify the limits using the border parameter: The limits are extended by @border*(max-min) if max!=min. If max==min, they are extended by @border*max (otherwise the data could not be scaled to the pixel realm).

After calling this function, x values grow from left to right, y values grow from bottom to top.

Return value: 0 on success, -1 if @box is no GtkDatabox widget, -2 if no datasets are available

Definition at line 1700 of file gtkdatabox.c.

References GTK_DATABOX, gtk_databox_calculate_extrema(), and gtk_databox_set_total_limits().

◆ gtk_databox_button_press()

◆ gtk_databox_button_release()

static gint gtk_databox_button_release ( GtkWidget *  widget,
GdkEventButton *  event 
)
static

◆ gtk_databox_calculate_extrema()

gint gtk_databox_calculate_extrema ( GtkDatabox box,
gfloat *  min_x,
gfloat *  max_x,
gfloat *  min_y,
gfloat *  max_y 
)

gtk_databox_calculate_extrema: @box: A GtkDatabox widget @min_x: Will be filled with the lowest x value of all datasets @max_x: Will be filled with the highest x value of all datasets @min_y: Will be filled with the lowest y value of all datasets @max_y: Will be filled with the highest y value of all datasets

Determines the minimum and maximum x and y values of all GtkDataboxGraph objects which have been added to the GtkDatabox widget via gtk_databox_graph_add().

Return value: 0 on success, -1 if @box is no GtkDatabox widget, -2 if no datasets are available

Definition at line 1745 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, GTK_DATABOX_GRAPH, gtk_databox_graph_calculate_extrema(), and GTK_IS_DATABOX.

Referenced by gtk_databox_auto_rescale().

◆ gtk_databox_calculate_selection_values()

◆ gtk_databox_calculate_translation_factors()

◆ gtk_databox_calculate_visible_limits()

◆ gtk_databox_class_init()

static void gtk_databox_class_init ( GtkDataboxClass class)
static

gtk_databox_get_type

Determines the #GType of the GtkDatabox widget type.

Return value: The #GType of the GtkDatabox widget type.

GtkDatabox:enable-selection:

Defines whether the user can select rectangular areas with the mouse (#TRUE) or not (#FALSE).

GtkDatabox:enable-zoom:

Defines whether the user can use the mouse to zoom in or out (#TRUE) or not (#FALSE).

GtkDatabox:adjustment_x:

The #GtkAdjustment associated with the horizontal scrollbar. The GtkDatabox widget creates a GtkAdjustment itself. Normally there is no need for you to create another GtkAdjustment. You could simply use the one you get via gtk_databox_get_adjustment_x().

GtkDatabox:adjustment_y:

The #GtkAdjustment associated with the vertical scrollbar. The GtkDatabox widget creates a GtkAdjustment itself. Normally there is no need for you to create another GtkAdjustment. You could simply use the one you get via gtk_databox_get_adjustment_y().

GtkDatabox:ruler_x:

The horizontal GtkDataboxRuler (or NULL).

GtkDatabox:ruler_y:

The vertical GtkDataboxRuler (or NULL).

GtkDatabox:scale_type_x:

The horizontal scale type (linear or lograrithmic).

GtkDatabox:scale_type_y:

The vertical scale type (linear or lograrithmic).

GtkDatabox::zoomed: @box: The GtkDatabox widget which zoomed in or out.

This signal is emitted each time the zoom of the widget is changed, see for example gtk_databox_zoom_to_selection(), gtk_databox_set_visible_limits().

GtkDatabox::selection-started: @box: The GtkDatabox widget in which the selection has been started. @selection_values: The corners of the selection rectangle.

This signal is emitted when the mouse is firstmoved with the left button pressed after the mouse-down (and the GtkDatabox:enable-selection property is set). The corners of the selection rectangle are stored in @selection_values.

@see_also: #GtkDatabox::selection-changed

GtkDatabox::selection-changed: @box: The GtkDatabox widget in which the selection was changed. @selection_values: The corners of the selection rectangle.

This signal is emitted when the mouse is moved with the left button pressed (and the GtkDatabox:enable-selection property is set). The corners of the selection rectangle are stored in @selection_values.

GtkDatabox::selection-finalized: @box: The GtkDatabox widget in which the selection has been stopped. @selection_values: The corners of the selection rectangle.

This signal is emitted when the left mouse button is released after a selection was started before.

@see_also: #GtkDatabox::selection-changed

GtkDatabox::selection-canceled: @box: The GtkDatabox widget which zoomed in or out.

This signal is emitted after a right click outside a selection rectangle.

Definition at line 166 of file gtkdatabox.c.

References ADJUSTMENT_X, ADJUSTMENT_Y, BOX_SHADOW, ENABLE_SELECTION, ENABLE_ZOOM, gtk_databox_button_press(), gtk_databox_button_release(), gtk_databox_draw(), gtk_databox_get_property(), gtk_databox_marshal_VOID__POINTER, gtk_databox_marshal_VOID__VOID, gtk_databox_motion_notify(), gtk_databox_realize(), GTK_DATABOX_SCALE_LINEAR, gtk_databox_scale_type_get_type(), gtk_databox_scroll_event(), gtk_databox_set_property(), gtk_databox_signals, gtk_databox_size_allocate(), GTK_DATABOX_TYPE_RULER, gtk_databox_unrealize(), RULER_X, RULER_Y, SCALE_TYPE_X, SCALE_TYPE_Y, SELECTION_CANCELED_SIGNAL, SELECTION_CHANGED_SIGNAL, SELECTION_FINALIZED_SIGNAL, SELECTION_STARTED_SIGNAL, and ZOOMED_SIGNAL.

◆ gtk_databox_create_backing_surface()

static void gtk_databox_create_backing_surface ( GtkDatabox box)
static

◆ gtk_databox_create_box_with_scrollbars_and_rulers()

void gtk_databox_create_box_with_scrollbars_and_rulers ( GtkWidget **  p_box,
GtkWidget **  p_grid,
gboolean  scrollbar_x,
gboolean  scrollbar_y,
gboolean  ruler_x,
gboolean  ruler_y 
)

gtk_databox_create_box_with_scrollbars_and_rulers: @p_box: Will contain a pointer to a GtkDatabox widget @p_grid: Will contain a pointer to a #GtkGrid widget @scrollbar_x: Whether to attach a horizontal scrollbar @scrollbar_y: Whether to attach a vertical scrollbar @ruler_x: Whether to attach a horizontal ruler @ruler_y: Whether to attach a vertical ruler

This is a convenience function which creates a GtkDatabox widget in a GtkGrid widget optionally accompanied by scrollbars and rulers. You only have to fill in the data (gtk_databox_graph_add()) and adjust the limits (gtk_databox_set_total_limits() or gtk_databox_auto_rescale()).

This function produces the default databox with rulers at the top left and scroll bars at the bottom right.

Return value: #GtkGrid in the @p_grid object pointer.

@see_also: gtk_databox_new(), gtk_databox_set_adjustment_x(), gtk_databox_set_adjustment_y(), gtk_databox_set_ruler_x(), gtk_databox_set_ruler_y()

Definition at line 2443 of file gtkdatabox.c.

References gtk_databox_create_box_with_scrollbars_and_rulers_positioned().

◆ gtk_databox_create_box_with_scrollbars_and_rulers_positioned()

void gtk_databox_create_box_with_scrollbars_and_rulers_positioned ( GtkWidget **  p_box,
GtkWidget **  p_grid,
gboolean  scrollbar_x,
gboolean  scrollbar_y,
gboolean  ruler_x,
gboolean  ruler_y,
gboolean  ruler_x_top,
gboolean  ruler_y_left 
)

gtk_databox_create_box_with_scrollbars_and_rulers_positioned: @p_box: Will contain a pointer to a GtkDatabox widget @p_grid: Will contain a pointer to a #GtkGrid widget @scrollbar_x: Whether to attach a horizontal scrollbar @scrollbar_y: Whether to attach a vertical scrollbar @ruler_x: Whether to attach a horizontal ruler @ruler_y: Whether to attach a vertical ruler @ruler_x_top: Whether to put the ruler_x up the top @ruler_y_left: Whether to put the ruler_y on the left

This is a convenience function which creates a GtkDatabox widget in a GtkGrid widget optionally accompanied by scrollbars and rulers. You only have to fill in the data (gtk_databox_graph_add()) and adjust the limits (gtk_databox_set_total_limits() or gtk_databox_auto_rescale()).

This function produces the default databox with rulers at the top left and scroll bars at the bottom right.

Return value: #GtkGrid in the @p_grid object pointer.

@see_also: gtk_databox_new(), gtk_databox_set_adjustment_x(), gtk_databox_set_adjustment_y(), gtk_databox_set_ruler_x(), gtk_databox_set_ruler_y(), gtk_databox_create_box_with_scrollbars_and_rulers()

Definition at line 2477 of file gtkdatabox.c.

References GTK_DATABOX, gtk_databox_new(), GTK_DATABOX_RULER, gtk_databox_ruler_new(), gtk_databox_ruler_set_invert_edge(), gtk_databox_ruler_set_scale_type(), gtk_databox_set_adjustment_x(), gtk_databox_set_adjustment_y(), gtk_databox_set_ruler_x(), gtk_databox_set_ruler_y(), _GtkDataboxPrivate::scale_type_x, and _GtkDataboxPrivate::scale_type_y.

Referenced by gtk_databox_create_box_with_scrollbars_and_rulers().

◆ gtk_databox_draw()

◆ gtk_databox_draw_selection()

static void gtk_databox_draw_selection ( GtkDatabox box,
gboolean  clear 
)
static

◆ gtk_databox_get_adjustment_x()

GtkAdjustment* gtk_databox_get_adjustment_x ( GtkDatabox box)

gtk_databox_get_adjustment_x @box: A GtkDatabox widget.

Getter function for the GtkDatabox:adjustment-x property.

Return value: The GtkDatabox:adjustment-x property value.

Definition at line 1018 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_x, and GTK_IS_DATABOX.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_adjustment_y()

GtkAdjustment* gtk_databox_get_adjustment_y ( GtkDatabox box)

gtk_databox_get_adjustment_y @box: A GtkDatabox widget.

Getter function for the GtkDatabox:adjustment-y property.

Return value: The GtkDatabox:adjustment-y property value.

Definition at line 1034 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_y, and GTK_IS_DATABOX.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_backing_surface()

cairo_surface_t* gtk_databox_get_backing_surface ( GtkDatabox box)

gtk_databox_get_backing_surface: @box: A GtkDatabox widget

This function returns the surface which is used by @box and its GtkDataboxGraph objects for drawing operations before copying the result to the screen.

The function is typically called by the GtkDataboxGraph objects.

Return value: Backing surface

Definition at line 1229 of file gtkdatabox.c.

References _GtkDataboxPrivate::backing_surface, and GTK_IS_DATABOX.

Referenced by gtk_databox_graph_real_create_gc().

◆ gtk_databox_get_box_shadow()

GtkShadowType gtk_databox_get_box_shadow ( GtkDatabox box)

gtk_databox_get_box_shadow: @box: a GtkDatabox widget

Gets the type of shadow being rendered to the @box (GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT).

Return value: The currently used shadow type of the @box, -1 on failure.

Definition at line 1111 of file gtkdatabox.c.

References _GtkDataboxPrivate::box_shadow, and GTK_IS_DATABOX.

◆ gtk_databox_get_enable_selection()

gboolean gtk_databox_get_enable_selection ( GtkDatabox box)

gtk_databox_get_enable_selection @box: A GtkDatabox widget.

Getter function for the GtkDatabox:enable-selection property.

Return value: The GtkDatabox:enable-selection property value.

Definition at line 986 of file gtkdatabox.c.

References _GtkDataboxPrivate::enable_selection, and GTK_IS_DATABOX.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_enable_zoom()

gboolean gtk_databox_get_enable_zoom ( GtkDatabox box)

gtk_databox_get_enable_zoom @box: A GtkDatabox widget.

Getter function for the GtkDatabox:enable-zoom property.

Return value: The GtkDatabox:enable-zoom property value.

Definition at line 1002 of file gtkdatabox.c.

References _GtkDataboxPrivate::enable_zoom, and GTK_IS_DATABOX.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_graphs()

GList* gtk_databox_get_graphs ( GtkDatabox box)

gtk_databox_get_graphs @box: A GtkDatabox widget

Return a list of graphs that were previously added to @box.

Return value: A #GList that contains all graphs

Definition at line 474 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, and GTK_IS_DATABOX.

◆ gtk_databox_get_offset_x()

◆ gtk_databox_get_offset_y()

◆ gtk_databox_get_page_size_x()

◆ gtk_databox_get_page_size_y()

◆ gtk_databox_get_property()

◆ gtk_databox_get_ruler_x()

GtkDataboxRuler* gtk_databox_get_ruler_x ( GtkDatabox box)

gtk_databox_get_ruler_x @box: A GtkDatabox widget.

Getter function for the GtkDatabox:ruler-x property.

Return value: The GtkDatabox:ruler-x property value.

Definition at line 1050 of file gtkdatabox.c.

References GTK_IS_DATABOX, and _GtkDataboxPrivate::ruler_x.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_ruler_y()

GtkDataboxRuler* gtk_databox_get_ruler_y ( GtkDatabox box)

gtk_databox_get_ruler_y @box: A GtkDatabox widget.

Getter function for the GtkDatabox:ruler-y property.

Return value: The GtkDatabox:ruler-y property value.

Definition at line 1066 of file gtkdatabox.c.

References GTK_IS_DATABOX, and _GtkDataboxPrivate::ruler_y.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_scale_type_x()

GtkDataboxScaleType gtk_databox_get_scale_type_x ( GtkDatabox box)

gtk_databox_get_scale_type_x @box: A GtkDatabox widget.

Getter function for the GtkDatabox:scale-type-x property.

Return value: The GtkDatabox:scale-type-x property value.

Definition at line 1082 of file gtkdatabox.c.

References _GtkDataboxPrivate::scale_type_x.

Referenced by gtk_databox_get_property().

◆ gtk_databox_get_scale_type_y()

GtkDataboxScaleType gtk_databox_get_scale_type_y ( GtkDatabox box)

gtk_databox_get_scale_type_y @box: A GtkDatabox widget.

Getter function for the GtkDatabox:scale-type-y property.

Return value: The GtkDatabox:scale-type-y property value.

Definition at line 1097 of file gtkdatabox.c.

References _GtkDataboxPrivate::scale_type_y.

Referenced by gtk_databox_bars_real_draw(), gtk_databox_get_property(), gtk_databox_offset_bars_real_draw(), and gtk_databox_regions_real_draw().

◆ gtk_databox_get_total_limits()

void gtk_databox_get_total_limits ( GtkDatabox box,
gfloat *  left,
gfloat *  right,
gfloat *  top,
gfloat *  bottom 
)

gtk_databox_get_total_limits: @box: A GtkDatabox widget @left: Space for total left value or #NULL @right: Space for total right value or #NULL @top: Space for total top value or #NULL @bottom: Space for total bottom value or #NULL

Gives the total limits (as set by gtk_databox_auto_rescale() or gtk_databox_set_total_limits()).

Definition at line 2033 of file gtkdatabox.c.

References GTK_IS_DATABOX, _GtkDataboxPrivate::total_bottom, _GtkDataboxPrivate::total_left, _GtkDataboxPrivate::total_right, and _GtkDataboxPrivate::total_top.

Referenced by gtk_databox_grid_real_draw().

◆ gtk_databox_get_visible_limits()

void gtk_databox_get_visible_limits ( GtkDatabox box,
gfloat *  left,
gfloat *  right,
gfloat *  top,
gfloat *  bottom 
)

gtk_databox_get_visible_limits: @box: A GtkDatabox widget @left: Space for visible left value or #NULL @right: Space for visible right value or #NULL @top: Space for visible top value or #NULL @bottom: Space for visible bottom value or #NULL

Gives the current visible limits. These differ from those given by gtk_databox_get_total_limits() if you zoomed into the data for instance by gtk_databox_zoom_to_selection() or gtk_databox_set_visible_limits() (these values can be changed by scrolling, of course).

Definition at line 2062 of file gtkdatabox.c.

References GTK_IS_DATABOX, _GtkDataboxPrivate::visible_bottom, _GtkDataboxPrivate::visible_left, _GtkDataboxPrivate::visible_right, and _GtkDataboxPrivate::visible_top.

◆ gtk_databox_graph_add()

gint gtk_databox_graph_add ( GtkDatabox box,
GtkDataboxGraph graph 
)

gtk_databox_graph_add: @box: A GtkDatabox widget @graph: A graph, e.g. a GtkDataboxPoints or a GtkDataboxGrid object

Adds the @graph to the @box. The next time the @box is re-drawn, the graph will be shown.

It might be becessary to modify the total_limits in order for the graph to be displayed properly (see gtk_databox_set_total_limits()).

Return value: 0 on success, -1 otherwise

Definition at line 2091 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, GTK_DATABOX_IS_GRAPH, and GTK_IS_DATABOX.

◆ gtk_databox_graph_add_front()

gint gtk_databox_graph_add_front ( GtkDatabox box,
GtkDataboxGraph graph 
)

gtk_databox_graph_add_front: @box: A GtkDatabox widget @graph: A graph, e.g. a GtkDataboxPoints or a GtkDataboxGrid object

Adds the @graph to the @box and will be plotted on top. The next time the @box is re-drawn, the graph will be shown.

It might be becessary to modify the total_limits in order for the graph to be displayed properly (see gtk_databox_set_total_limits()).

Return value: 0 on success, -1 otherwise

Definition at line 2113 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, GTK_DATABOX_IS_GRAPH, and GTK_IS_DATABOX.

◆ gtk_databox_graph_remove()

gint gtk_databox_graph_remove ( GtkDatabox box,
GtkDataboxGraph graph 
)

gtk_databox_graph_remove: @box: A GtkDatabox widget @graph: A graph, e.g. a GtkDataboxPoints or a GtkDataboxGrid object

Removes the @graph from the @box once. The next time the @box is re-drawn, the graph will not be shown (unless it was added more than once).

Return value: 0 on success, -1 otherwise

Definition at line 2135 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, GTK_DATABOX_IS_GRAPH, and GTK_IS_DATABOX.

◆ gtk_databox_graph_remove_all()

gint gtk_databox_graph_remove_all ( GtkDatabox box)

gtk_databox_graph_remove_all: @box: A GtkDatabox widget

Removes all graphs from the @box. The next time the @box is re-drawn, no graphs will be shown.

Return value: 0 on success, -1 otherwise

Definition at line 2158 of file gtkdatabox.c.

References _GtkDataboxPrivate::graphs, and GTK_IS_DATABOX.

◆ gtk_databox_init()

◆ gtk_databox_motion_notify()

◆ gtk_databox_new()

GtkWidget* gtk_databox_new ( void  )

gtk_databox_new

Creates a new GtkDatabox widget.

Return value: The new GtkDatabox widget.

Definition at line 461 of file gtkdatabox.c.

References GTK_TYPE_DATABOX.

Referenced by gtk_databox_create_box_with_scrollbars_and_rulers_positioned().

◆ gtk_databox_pixel_to_value_x()

gfloat gtk_databox_pixel_to_value_x ( GtkDatabox box,
gint16  pixel 
)

gtk_databox_pixel_to_value_x: @box: A GtkDatabox widget @pixel: A horizontal pixel coordinate

Calculates the x value which is represented by the horizontal @pixel coordinate. Pixel coordinates are relative to the top-left corner of the @box which is equivalent to (0,0).

Return value: x value

Definition at line 2374 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_x, _GtkDataboxPrivate::translation_factor_x, and _GtkDataboxPrivate::visible_left.

Referenced by gtk_databox_calculate_selection_values(), and gtk_databox_scroll_event().

◆ gtk_databox_pixel_to_value_y()

gfloat gtk_databox_pixel_to_value_y ( GtkDatabox box,
gint16  pixel 
)

gtk_databox_pixel_to_value_y: @box: A GtkDatabox widget @pixel: A vertical pixel coordinate

Calculates the y value which is represented by the vertical @pixel coordinate. Pixel coordinates are relative to the top-left corner of the @box which is equivalent to (0,0).

Return value: y value

Definition at line 2403 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_y, _GtkDataboxPrivate::translation_factor_y, and _GtkDataboxPrivate::visible_top.

Referenced by gtk_databox_calculate_selection_values(), and gtk_databox_scroll_event().

◆ gtk_databox_realize()

static void gtk_databox_realize ( GtkWidget *  widget)
static

Definition at line 630 of file gtkdatabox.c.

References GTK_DATABOX, and gtk_databox_create_backing_surface().

Referenced by gtk_databox_class_init().

◆ gtk_databox_ruler_update()

◆ gtk_databox_scroll_event()

◆ gtk_databox_selection_cancel()

◆ gtk_databox_set_adjustment_x()

void gtk_databox_set_adjustment_x ( GtkDatabox box,
GtkAdjustment *  adj 
)

gtk_databox_set_adjustment_x @box: A GtkDatabox widget @adj: A #GtkAdjustment object

Setter function for the GtkDatabox:adjustment-x property. Normally, it should not be required to use this function, see property documentation.

Definition at line 742 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_x, gtk_databox_adjustment_value_changed(), gtk_databox_get_offset_x(), gtk_databox_get_page_size_x(), GTK_IS_DATABOX, _GtkDataboxPrivate::total_left, and _GtkDataboxPrivate::total_right.

Referenced by gtk_databox_create_box_with_scrollbars_and_rulers_positioned(), gtk_databox_init(), and gtk_databox_set_property().

◆ gtk_databox_set_adjustment_y()

void gtk_databox_set_adjustment_y ( GtkDatabox box,
GtkAdjustment *  adj 
)

gtk_databox_set_adjustment_y @box: A GtkDatabox widget @adj: A #GtkAdjustment object

Setter function for the GtkDatabox:adjustment-y property. Normally, it should not be required to use this function, see property documentation.

Definition at line 796 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_y, gtk_databox_adjustment_value_changed(), gtk_databox_get_offset_y(), gtk_databox_get_page_size_y(), GTK_IS_DATABOX, _GtkDataboxPrivate::total_bottom, and _GtkDataboxPrivate::total_top.

Referenced by gtk_databox_create_box_with_scrollbars_and_rulers_positioned(), gtk_databox_init(), and gtk_databox_set_property().

◆ gtk_databox_set_bg_color()

void gtk_databox_set_bg_color ( GtkDatabox box,
gchar *  bg_color 
)

gtk_databox_set_bg_color: @box: a GtkDatabox widget @bg_color: a color name, as used in CSS (html color)

Convenience function to override the background color of @box, acording to @bg_color.

Definition at line 1127 of file gtkdatabox.c.

References _GtkDataboxPrivate::cssp, and GTK_IS_DATABOX.

◆ gtk_databox_set_box_shadow()

void gtk_databox_set_box_shadow ( GtkDatabox box,
GtkShadowType  which_shadow 
)

gtk_databox_set_box_shadow: @box: a GtkDatabox widget. @which_shadow: How to render the box shadow on the GtkDatabox edges.

Sets the shadow type when using gtk_paint_box. This will draw the desired edge shadow.

Definition at line 962 of file gtkdatabox.c.

References _GtkDataboxPrivate::box_shadow, and GTK_IS_DATABOX.

Referenced by gtk_databox_set_property().

◆ gtk_databox_set_enable_selection()

void gtk_databox_set_enable_selection ( GtkDatabox box,
gboolean  enable 
)

gtk_databox_set_enable_selection @box: A GtkDatabox widget @enable: Whether selection via mouse is enabled or not.

Setter function for the GtkDatabox:enable-selection property.

Definition at line 702 of file gtkdatabox.c.

References _GtkDataboxPrivate::enable_selection, gtk_databox_selection_cancel(), GTK_IS_DATABOX, and _GtkDataboxPrivate::selection_active.

Referenced by gtk_databox_set_property().

◆ gtk_databox_set_enable_zoom()

void gtk_databox_set_enable_zoom ( GtkDatabox box,
gboolean  enable 
)

gtk_databox_set_enable_zoom @box: A GtkDatabox widget @enable: Whether zoom via mouse is enabled or not.

Setter function for the GtkDatabox:enable-zoom property.

Definition at line 723 of file gtkdatabox.c.

References _GtkDataboxPrivate::enable_zoom, and GTK_IS_DATABOX.

Referenced by gtk_databox_set_property().

◆ gtk_databox_set_property()

◆ gtk_databox_set_ruler_x()

void gtk_databox_set_ruler_x ( GtkDatabox box,
GtkDataboxRuler ruler 
)

◆ gtk_databox_set_ruler_y()

void gtk_databox_set_ruler_y ( GtkDatabox box,
GtkDataboxRuler ruler 
)

◆ gtk_databox_set_scale_type_x()

void gtk_databox_set_scale_type_x ( GtkDatabox box,
GtkDataboxScaleType  scale_type 
)

gtk_databox_set_scale_type_x @box: A GtkDatabox widget @scale_type: An GtkDataboxScaleType (linear or logarithmic)

Setter function for the GtkDatabox:scale-type-x property.

Definition at line 923 of file gtkdatabox.c.

References gtk_databox_ruler_set_scale_type(), _GtkDataboxPrivate::ruler_x, and _GtkDataboxPrivate::scale_type_x.

Referenced by gtk_databox_set_property().

◆ gtk_databox_set_scale_type_y()

void gtk_databox_set_scale_type_y ( GtkDatabox box,
GtkDataboxScaleType  scale_type 
)

gtk_databox_set_scale_type_y @box: A GtkDatabox widget @scale_type: An GtkDataboxScaleType (linear or logarithmic)

Setter function for the GtkDatabox:scale-type-y property.

Definition at line 943 of file gtkdatabox.c.

References gtk_databox_ruler_set_scale_type(), _GtkDataboxPrivate::ruler_y, and _GtkDataboxPrivate::scale_type_y.

Referenced by gtk_databox_set_property().

◆ gtk_databox_set_total_limits()

void gtk_databox_set_total_limits ( GtkDatabox box,
gfloat  left,
gfloat  right,
gfloat  top,
gfloat  bottom 
)

gtk_databox_set_total_limits: @box: A GtkDatabox widget @left: Left total limit @right: Right total limit @top: Top total limit @bottom: Bottom total limit

This function is used to set the limits of the total display area of @box. This function can be used to invert the orientation of the displayed graphs, e.g. @top=-1000 and @bottom=0.

Side effect: The @box also internally calls gtk_databox_set_visible_limits() with the same values.

Definition at line 1876 of file gtkdatabox.c.

References gtk_databox_set_visible_limits(), GTK_IS_DATABOX, _GtkDataboxPrivate::total_bottom, _GtkDataboxPrivate::total_left, _GtkDataboxPrivate::total_right, and _GtkDataboxPrivate::total_top.

Referenced by gtk_databox_auto_rescale().

◆ gtk_databox_set_visible_limits()

void gtk_databox_set_visible_limits ( GtkDatabox box,
gfloat  left,
gfloat  right,
gfloat  top,
gfloat  bottom 
)

gtk_databox_set_visible_limits: @box: A GtkDatabox widget @left: Left visible limit @right: Right visible limit @top: Top visible limit @bottom: Bottom visible limit

This function is used to set the limits of the visible display area of @box. The visible display area can be section of the total area, i.e. the @box zooms in, showing only a part of the complete picture.

The orientation of the values have to be the same as in gtk_databox_set_total_limits() and the visible limits have to be within the total limits. The values will not be used otherwise.

Side effect: The @box emits #GtkDatabox::zoomed.

Definition at line 1912 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_x, _GtkDataboxPrivate::adj_y, gtk_databox_calculate_translation_factors(), gtk_databox_get_offset_x(), gtk_databox_get_offset_y(), gtk_databox_get_page_size_x(), gtk_databox_get_page_size_y(), gtk_databox_ruler_update(), gtk_databox_zoomed(), GTK_IS_DATABOX, _GtkDataboxPrivate::total_bottom, _GtkDataboxPrivate::total_left, _GtkDataboxPrivate::total_right, _GtkDataboxPrivate::total_top, _GtkDataboxPrivate::visible_bottom, _GtkDataboxPrivate::visible_left, _GtkDataboxPrivate::visible_right, and _GtkDataboxPrivate::visible_top.

Referenced by gtk_databox_set_total_limits(), and gtk_databox_zoom_home().

◆ gtk_databox_size_allocate()

static void gtk_databox_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation 
)
static

◆ gtk_databox_unrealize()

static void gtk_databox_unrealize ( GtkWidget *  widget)
static

◆ gtk_databox_value_to_pixel_x()

gint16 gtk_databox_value_to_pixel_x ( GtkDatabox box,
gfloat  value 
)

gtk_databox_value_to_pixel_x: @box: A GtkDatabox widget @value: An x value

Calculates the horizontal pixel coordinate which represents the x @value. Pixel coordinates are relative to the top-left corner of the @box which is equivalent to (0,0).

Return value: Pixel coordinate

Definition at line 2179 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_x, _GtkDataboxPrivate::translation_factor_x, and _GtkDataboxPrivate::visible_left.

Referenced by gtk_databox_grid_real_draw().

◆ gtk_databox_value_to_pixel_y()

gint16 gtk_databox_value_to_pixel_y ( GtkDatabox box,
gfloat  value 
)

gtk_databox_value_to_pixel_y: @box: A GtkDatabox widget @value: A y value

Calculates the vertical pixel coordinate which represents the y @value. Pixel coordinates are relative to the top-left corner of the @box which is equivalent to (0,0).

Return value: Pixel coordinate

Definition at line 2205 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_y, _GtkDataboxPrivate::translation_factor_y, and _GtkDataboxPrivate::visible_top.

Referenced by gtk_databox_grid_real_draw().

◆ gtk_databox_values_to_xpixels()

void gtk_databox_values_to_xpixels ( GtkDatabox box,
gint16 *  pixels,
void *  values,
GType  vtype,
guint  maxlen,
guint  start,
guint  stride,
guint  len 
)

gtk_databox_values_to_xpixels: @box: A GtkDatabox widget. @pixels: address to return pixel x coordinates. @values: An x values array. @vtype: GType of @values. @maxlen: maximum length of the arrays. @start: first value to compute. @stride: bytes per row of plotting. @len: how many values to compute.

Calculates the horizontal coordinates for @pixels which represents the x @values. Pixel coordinates are relative to the left corner of the @box which is equivalent to (0).

Return value: Pixel coordinates

Definition at line 2236 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_x, _GtkDataboxPrivate::translation_factor_x, and _GtkDataboxPrivate::visible_left.

Referenced by gtk_databox_bars_real_draw(), gtk_databox_lines_real_draw(), gtk_databox_markers_real_draw(), gtk_databox_offset_bars_real_draw(), gtk_databox_points_real_draw(), and gtk_databox_regions_real_draw().

◆ gtk_databox_values_to_ypixels()

void gtk_databox_values_to_ypixels ( GtkDatabox box,
gint16 *  pixels,
void *  values,
GType  vtype,
guint  maxlen,
guint  start,
guint  stride,
guint  len 
)

gtk_databox_values_to_ypixels: @box: A GtkDatabox widget @pixels: address to return pixel y coordinates. @values: an y values array. @vtype: GType of @values. @maxlen: maximum length of the arrays. @start: first value to compute. @stride: bytes per row of plotting. @len: how many values to compute.

Calculates the vertical coordinates for @pixels which represents the y @values. Pixel coordinates are relative to the top corner of the @box which is equivalent to (0).

Return value: Pixel coordinates

Definition at line 2308 of file gtkdatabox.c.

References GTK_DATABOX_SCALE_LINEAR, GTK_DATABOX_SCALE_LOG2, _GtkDataboxPrivate::scale_type_y, _GtkDataboxPrivate::translation_factor_y, and _GtkDataboxPrivate::visible_top.

Referenced by gtk_databox_bars_real_draw(), gtk_databox_lines_real_draw(), gtk_databox_markers_real_draw(), gtk_databox_offset_bars_real_draw(), gtk_databox_points_real_draw(), and gtk_databox_regions_real_draw().

◆ gtk_databox_zoom_home()

void gtk_databox_zoom_home ( GtkDatabox box)

gtk_databox_zoom_home: @box: A GtkDatabox widget

This is equivalent to shift right-clicking into the @box.

This function works, if the attribute #enable-zoom is set to #TRUE. It is equivalent to calling the gtk_databox_set_visible_limits() with the total limits.

Definition at line 1613 of file gtkdatabox.c.

References _GtkDataboxPrivate::enable_zoom, gtk_databox_set_visible_limits(), _GtkDataboxPrivate::total_bottom, _GtkDataboxPrivate::total_left, _GtkDataboxPrivate::total_right, and _GtkDataboxPrivate::total_top.

Referenced by gtk_databox_button_press().

◆ gtk_databox_zoom_out()

void gtk_databox_zoom_out ( GtkDatabox box)

gtk_databox_zoom_out: @box: A GtkDatabox widget

This is equivalent to right-clicking into the @box.

This function works, if the attribute #enable-zoom is set to #TRUE. Calling the function then zooms out by a factor of 2 in both dimensions (the maximum is defined by the total limits, see gtk_databox_set_total_limits()).

Side effect: The @box emits #GtkDatabox::zoomed.

Definition at line 1575 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_x, _GtkDataboxPrivate::adj_y, _GtkDataboxPrivate::enable_zoom, gtk_databox_calculate_visible_limits(), and gtk_databox_zoomed().

Referenced by gtk_databox_button_press(), and gtk_databox_scroll_event().

◆ gtk_databox_zoom_to_selection()

void gtk_databox_zoom_to_selection ( GtkDatabox box)

gtk_databox_zoom_to_selection: @box: A GtkDatabox widget

This is equivalent to left-clicking into the selected area.

This function works, if the attribute #enable-zoom is set to #TRUE. Calling the function then zooms to the area selected with the mouse.

Side effect: The @box emits #GtkDatabox::zoomed.

Definition at line 1492 of file gtkdatabox.c.

References _GtkDataboxPrivate::adj_x, _GtkDataboxPrivate::adj_y, _GtkDataboxPrivate::enable_zoom, gtk_databox_calculate_visible_limits(), gtk_databox_selection_cancel(), gtk_databox_zoomed(), GTK_IS_DATABOX, _GtkDataboxPrivate::marked, _GtkDataboxPrivate::select, and _GtkDataboxPrivate::zoom_limit.

Referenced by gtk_databox_button_press().

◆ gtk_databox_zoomed()

Variable Documentation

◆ gtk_databox_signals