-
Notifications
You must be signed in to change notification settings - Fork 0
/
pocaxis.h
104 lines (90 loc) · 3.67 KB
/
pocaxis.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* This file is part of PocPlot.
*
* PocPlot is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* PocPlot 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with PocPlot; if not, see
* <https://www.gnu.org/licenses/>.
*
* Copyright 2020 Brian Stafford
*/
#ifndef _pocaxis_h
#define _pocaxis_h
#if !defined(__poc_h_inside__) && !defined(__poc_compile__)
# error "only <poc.h> can be included directly"
#endif
#include <gtk/gtk.h>
#include "poctypes.h"
G_BEGIN_DECLS
#define POC_TYPE_AXIS poc_axis_get_type ()
G_DECLARE_DERIVABLE_TYPE (PocAxis, poc_axis, POC, AXIS, GObject)
struct _PocAxisClass
{
/*< private >*/
GObjectClass parent_class;
gpointer dummy1;
gpointer dummy2;
gpointer dummy3;
gpointer dummy4;
};
PocAxis * poc_axis_new (void);
void poc_axis_set_axis_mode (PocAxis *self, PocAxisMode axis_mode);
PocAxisMode poc_axis_get_axis_mode (PocAxis *self);
void poc_axis_set_lower_bound (PocAxis *self, gdouble bound);
gdouble poc_axis_get_lower_bound (PocAxis *self);
void poc_axis_set_upper_bound (PocAxis *self, gdouble bound);
gdouble poc_axis_get_upper_bound (PocAxis *self);
void poc_axis_set_adjustment (PocAxis *self, GtkAdjustment *adjustment);
GtkAdjustment * poc_axis_get_adjustment (PocAxis *self);
void poc_axis_set_major_interval (PocAxis *self, gdouble interval);
gdouble poc_axis_get_major_interval (PocAxis *self);
void poc_axis_set_auto_interval (PocAxis *self, gboolean enabled);
gboolean poc_axis_get_auto_interval (PocAxis *self);
void poc_axis_set_minor_divisions (PocAxis *self, guint divisions);
guint poc_axis_get_minor_divisions (PocAxis *self);
void poc_axis_set_tick_size (PocAxis *self, gfloat size);
gfloat poc_axis_get_tick_size (PocAxis *self);
void poc_axis_set_label_size (PocAxis *self, gfloat size);
gfloat poc_axis_get_label_size (PocAxis *self);
void poc_axis_set_major_grid (PocAxis *self, PocLineStyle major_grid);
PocLineStyle poc_axis_get_major_grid (PocAxis *self);
void poc_axis_set_minor_grid (PocAxis *self, PocLineStyle minor_grid);
PocLineStyle poc_axis_get_minor_grid (PocAxis *self);
void poc_axis_set_legend (PocAxis *self, const gchar *legend);
const gchar * poc_axis_get_legend (PocAxis *self);
void poc_axis_set_legend_size (PocAxis *self, gfloat size);
gfloat poc_axis_get_legend_size (PocAxis *self);
void poc_axis_notify_update (PocAxis *self);
void poc_axis_draw_axis (PocAxis *self, cairo_t *cr,
GtkOrientation orientation,
GtkPackType pack,
guint width, guint height,
GtkStyleContext *style);
void poc_axis_draw_grid (PocAxis *self, cairo_t *cr,
GtkOrientation orientation,
guint width, guint height,
GtkStyleContext *style);
gdouble poc_axis_size (PocAxis *self);
/* convenience access to bounds */
void poc_axis_configure (PocAxis *self,
PocAxisMode axis_mode,
gdouble lower_bound,
gdouble upper_bound);
void poc_axis_get_range (PocAxis *self,
gdouble *lower_bound,
gdouble *upper_bound);
void poc_axis_get_display_range (PocAxis *self,
gdouble *lower_bound,
gdouble *upper_bound);
double poc_axis_linear_project (PocAxis *self, gdouble value, gint norm);
double poc_axis_project (PocAxis *self, gdouble value, gint norm);
G_END_DECLS
#endif