/usr/include/ags/widget/ags_cartesian.h is in libags-gui-dev 1.4.24-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 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 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | /* GSequencer - Advanced GTK Sequencer
* Copyright (C) 2005-2015 Joël Krähemann
*
* This file is part of GSequencer.
*
* GSequencer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GSequencer 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GSequencer. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AGS_CARTESIAN_H__
#define __AGS_CARTESIAN_H__
#include <glib.h>
#include <glib-object.h>
#include <cairo.h>
#include <gtk/gtk.h>
#define AGS_TYPE_CARTESIAN (ags_cartesian_get_type())
#define AGS_CARTESIAN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_CARTESIAN, AgsCartesian))
#define AGS_CARTESIAN_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_CARTESIAN, AgsCartesianClass))
#define AGS_IS_CARTESIAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_CARTESIAN))
#define AGS_IS_CARTESIAN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), AGS_TYPE_CARTESIAN))
#define AGS_CARTESIAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_CARTESIAN, AgsCartesianClass))
#define AGS_PLOT(ptr) ((AgsPlot *)(ptr))
#define AGS_CARTESIAN_STEP_CONVERSION_FUNC(current, is_abscissae, data) ((AgsCartesianStepConversionFunc)(current, is_abscissae, data))
#define AGS_CARTESIAN_TRANSLATE_FUNCT(x, y, ret_x, ret_y, data) ((AgsCartesianTranslateFunc)(x, y, ret_x, ret_y, data))
#define AGS_CARTESIAN_SCALE_FUNC(value, data) ((AgsCartesianScaleFunc)(value, data))
#define AGS_CARTESIAN_LABEL_FUNC(value, data) ((AgsCartesianLabelFunc)(value, data))
#define AGS_CARTESIAN_DEFAULT_X_MARGIN (24.0)
#define AGS_CARTESIAN_DEFAULT_Y_MARGIN (24.0)
#define AGS_CARTESIAN_DEFAULT_X_STEP_WIDTH (10.0)
#define AGS_CARTESIAN_DEFAULT_Y_STEP_HEIGHT (10.0)
#define AGS_CARTESIAN_DEFAULT_X_SCALE_STEP_WIDTH (10.0)
#define AGS_CARTESIAN_DEFAULT_Y_SCALE_STEP_HEIGHT (10.0)
#define AGS_CARTESIAN_DEFAULT_X_STEP (1.0)
#define AGS_CARTESIAN_DEFAULT_Y_STEP (1.0)
#define AGS_CARTESIAN_DEFAULT_X_START (-60.0)
#define AGS_CARTESIAN_DEFAULT_X_END (199.0)
#define AGS_CARTESIAN_DEFAULT_Y_START (-70.0)
#define AGS_CARTESIAN_DEFAULT_Y_END (99.0)
#define AGS_CARTESIAN_DEFAULT_X_LABEL_START (10.0)
#define AGS_CARTESIAN_DEFAULT_X_LABEL_STEP_WIDTH (50.0)
#define AGS_CARTESIAN_DEFAULT_Y_LABEL_START (20.0)
#define AGS_CARTESIAN_DEFAULT_Y_LABEL_STEP_HEIGHT (50.0)
typedef struct _AgsCartesian AgsCartesian;
typedef struct _AgsCartesianClass AgsCartesianClass;
typedef struct _AgsPlot AgsPlot;
typedef gdouble (*AgsCartesianStepConversionFunc)(gdouble current,
gboolean is_abscissae,
gpointer data);
typedef void (*AgsCartesianTranslateFunc)(gdouble x,
gdouble y,
gdouble *ret_x,
gdouble *ret_y,
gpointer data);
typedef gdouble (*AgsCartesianScaleFunc)(gdouble value,
gpointer data);
typedef gchar* (*AgsCartesianLabelFunc)(gdouble value,
gpointer data);
typedef enum{
AGS_CARTESIAN_ABSCISSAE = 1,
AGS_CARTESIAN_ORDINATE = 1 << 1,
AGS_CARTESIAN_X_SCALE = 1 << 2,
AGS_CARTESIAN_Y_SCALE = 1 << 3,
AGS_CARTESIAN_X_UNIT = 1 << 4,
AGS_CARTESIAN_Y_UNIT = 1 << 5,
AGS_CARTESIAN_X_LABEL = 1 << 6,
AGS_CARTESIAN_Y_LABEL = 1 << 7,
}AgsCartesianFlags;
typedef enum{
AGS_PLOT_FILL_REPLACE = 1,
//TODO:JK: implement me AGS_PLOT_FILL_ADDITIVE = 1 << 1,
}AgsPlotFillFlags;
struct _AgsCartesian
{
GtkWidget widget;
guint flags;
gdouble x_margin;
gdouble y_margin;
gdouble center;
gdouble line_width;
gdouble point_radius;
gdouble font_size;
gdouble x_step_width;
gdouble y_step_height;
gdouble x_scale_step_width;
gdouble y_scale_step_height;
gdouble x_step;
gdouble y_step;
gdouble x_start;
gdouble x_end;
gdouble y_start;
gdouble y_end;
gdouble x_unit_x0;
gdouble x_unit_y0;
gdouble x_unit_size;
gchar *x_unit;
gdouble y_unit_x0;
gdouble y_unit_y0;
gdouble y_unit_size;
gchar *y_unit;
gdouble x_label_start;
gdouble x_label_step_width;
gchar **x_label;
gdouble y_label_start;
gdouble y_label_step_height;
gchar **y_label;
gdouble (*step_conversion_func)(gdouble current,
gboolean is_abscissae,
gpointer data);
void (*translate_func)(gdouble x,
gdouble y,
gdouble *ret_x,
gdouble *ret_y,
gpointer data);
gdouble (*x_small_scale_func)(gdouble value,
gpointer data);
gdouble (*x_big_scale_func)(gdouble value,
gpointer data);
gdouble (*y_small_scale_func)(gdouble value,
gpointer data);
gdouble (*y_big_scale_func)(gdouble value,
gpointer data);
gchar* (*x_label_func)(gdouble value,
gpointer data);
gchar* (*y_label_func)(gdouble value,
gpointer data);
gpointer x_step_data;
gdouble x_step_factor;
gpointer y_step_data;
gdouble y_step_factor;
gpointer translate_data;
gdouble x_translate_point;
gdouble y_translate_point;
gpointer x_scale_data;
gdouble x_small_scale_factor;
gdouble x_big_scale_factor;
gpointer y_scale_data;
gdouble y_small_scale_factor;
gdouble y_big_scale_factor;
gpointer x_label_data;
gdouble x_label_factor;
gdouble x_label_precision;
gpointer y_label_data;
gdouble y_label_factor;
gdouble y_label_precision;
cairo_surface_t *surface;
GList *plot;
};
struct _AgsCartesianClass
{
GtkWidgetClass widget;
};
struct _AgsPlot
{
guint fill_flags;
guint n_points;
gboolean join_points;
gdouble **point;
gdouble **point_color;
gchar **point_label;
guint n_bitmaps;
unsigned char **bitmap;
gdouble **bitmap_color;
guint n_pixmaps;
gdouble ***pixmap;
};
GType ags_cartesian_get_type(void);
/* plot data */
AgsPlot* ags_plot_alloc(guint n_points, guint n_bitmaps, guint n_pixmaps);
void ags_plot_free(AgsPlot *plot);
void ags_cartesian_add_plot(AgsCartesian *cartesian,
AgsPlot *plot);
void ags_cartesian_remove_plot(AgsCartesian *cartesian,
AgsPlot *plot);
/* predefined linear system */
gdouble ags_cartesian_linear_step_conversion_func(gdouble current,
gboolean is_abscissae,
gpointer data);
void ags_cartesian_linear_translate_func(gdouble x,
gdouble y,
gdouble *ret_x,
gdouble *ret_y,
gpointer data);
gdouble ags_cartesian_linear_x_small_scale_func(gdouble value,
gpointer data);
gdouble ags_cartesian_linear_x_big_scale_func(gdouble value,
gpointer data);
gdouble ags_cartesian_linear_y_small_scale_func(gdouble value,
gpointer data);
gdouble ags_cartesian_linear_y_big_scale_func(gdouble value,
gpointer data);
gchar* ags_cartesian_linear_x_label_func(gdouble value,
gpointer data);
gchar* ags_cartesian_linear_y_label_func(gdouble value,
gpointer data);
/* label functions */
void ags_cartesian_reallocate_label(AgsCartesian *cartesian,
gboolean do_x_label);
void ags_cartesian_fill_label(AgsCartesian *cartesian,
gboolean do_x_label);
AgsCartesian* ags_cartesian_new();
#endif /*__AGS_CARTESIAN_H__*/
|