/usr/include/gtkextra-3.0/gtkextra/gtkplotcanvas.h is in libgtkextra-dev 3.3.3-1.
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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | /* gtkplotcanvas - gtkplot canvas widget for gtk+
* Copyright 1999-2001 Adrian E. Feiguin <feiguin@ifir.edu.ar>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_PLOT_CANVAS_H__
#define __GTK_PLOT_CANVAS_H__
#include <gdk/gdk.h>
#include "gtkplot.h"
#include "gtkplotpc.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* GtkPlotCanvasFlags:
* @GTK_PLOT_CANVAS_CAN_SELECT: Select region
* @GTK_PLOT_CANVAS_CAN_SELECT_ITEM: Select items
* @GTK_PLOT_CANVAS_CAN_DND: DnD items
*
* Selection and DND mode of #GtkPlotCanvas
*
**/
typedef enum
{
GTK_PLOT_CANVAS_CAN_SELECT = 1 << 0,
GTK_PLOT_CANVAS_CAN_SELECT_ITEM = 1 << 1,
GTK_PLOT_CANVAS_CAN_DND = 1 << 2,
} GtkPlotCanvasFlags;
/* canvas actions */
typedef enum
{
GTK_PLOT_CANVAS_ACTION_INACTIVE,
GTK_PLOT_CANVAS_ACTION_SELECTION,
GTK_PLOT_CANVAS_ACTION_DRAG,
GTK_PLOT_CANVAS_ACTION_RESIZE,
} GtkPlotCanvasAction;
#ifndef DISABLE_DEPRECATED
/**
* GtkPlotCanvasFlag:
* @GTK_PLOT_CANVAS_FROZEN: Child is frozen
* @GTK_PLOT_CANVAS_CAN_MOVE: Child can be moved
* @GTK_PLOT_CANVAS_CAN_RESIZE: Child can be resized
*
* Deprecated, Used for GtkPlotCanvasChild. Use
* #GtkPlotCanvasChildFlags instead.
*
* Deprecated: 3.1.6: use #GtkPlotCanvasChildFlags
**/
typedef enum
{
GTK_PLOT_CANVAS_FROZEN = 0,
GTK_PLOT_CANVAS_CAN_MOVE = 1 << 0,
GTK_PLOT_CANVAS_CAN_RESIZE = 1 << 1,
} GtkPlotCanvasFlag;
#endif
/**
* GtkPlotCanvasChildFlags:
* @GTK_PLOT_CANVAS_CHILD_FROZEN: Child is frozen
* @GTK_PLOT_CANVAS_CHILD_CAN_MOVE: Child can be moved
* @GTK_PLOT_CANVAS_CHILD_CAN_RESIZE: Child can be resized
*
* move/resize-mode of #GtkPlotCanvasChild
*
**/
typedef enum
{
GTK_PLOT_CANVAS_CHILD_FROZEN = 0,
GTK_PLOT_CANVAS_CHILD_CAN_MOVE = 1 << 0,
GTK_PLOT_CANVAS_CHILD_CAN_RESIZE = 1 << 1,
} GtkPlotCanvasChildFlags;
typedef enum
{
GTK_PLOT_CANVAS_SELECT_NONE,
GTK_PLOT_CANVAS_SELECT_MARKERS,
GTK_PLOT_CANVAS_SELECT_TARGET,
} GtkPlotCanvasSelection;
typedef enum
{
GTK_PLOT_CANVAS_SELECT_CLICK_1,
GTK_PLOT_CANVAS_SELECT_CLICK_2,
} GtkPlotCanvasSelectionMode;
typedef enum
{
GTK_PLOT_CANVAS_OUT,
GTK_PLOT_CANVAS_IN,
GTK_PLOT_CANVAS_LEFT,
GTK_PLOT_CANVAS_RIGHT,
GTK_PLOT_CANVAS_TOP,
GTK_PLOT_CANVAS_BOTTOM,
GTK_PLOT_CANVAS_TOP_LEFT,
GTK_PLOT_CANVAS_TOP_RIGHT,
GTK_PLOT_CANVAS_BOTTOM_LEFT,
GTK_PLOT_CANVAS_BOTTOM_RIGHT,
} GtkPlotCanvasPos;
#define GTK_PLOT_CANVAS_DND_FLAGS (GTK_PLOT_CANVAS_CAN_SELECT_ITEM | \
GTK_PLOT_CANVAS_CAN_DND )
#define GTK_PLOT_CANVAS(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gtk_plot_canvas_get_type (), GtkPlotCanvas)
#define GTK_PLOT_CANVAS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gtk_plot_canvas_get_type(), GtkPlotCanvasClass)
#define GTK_IS_PLOT_CANVAS(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gtk_plot_canvas_get_type ())
#define G_TYPE_PLOT_CANVAS (gtk_plot_canvas_get_type ())
/* Public flags, for compatibility */
#define GTK_PLOT_CANVAS_FLAGS(canvas) gtk_plot_canvas_flags(canvas)
#define GTK_PLOT_CANVAS_SET_FLAGS(canvas, flags) \
gtk_plot_canvas_set_flags(canvas, flags)
#define GTK_PLOT_CANVAS_UNSET_FLAGS(canvas, flags) \
gtk_plot_canvas_unset_flags(canvas,flags)
#define GTK_PLOT_CANVAS_CAN_DND_POINT(canvas) (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_DND_POINT)
#define GTK_PLOT_CANVAS_CAN_DND(canvas) (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_DND)
#define GTK_PLOT_CANVAS_CAN_SELECT_POINT(canvas) (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT_POINT)
#define GTK_PLOT_CANVAS_CAN_SELECT_ITEM(canvas) (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT_ITEM)
#define GTK_PLOT_CANVAS_CAN_SELECT(canvas) (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT)
#define GTK_PLOT_CANVAS_CHILD(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gtk_plot_canvas_child_get_type (), GtkPlotCanvasChild)
#define GTK_PLOT_CANVAS_CHILD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gtk_plot_canvas_child_get_type(), GtkPlotCanvasChildClass)
#define GTK_IS_PLOT_CANVAS_CHILD(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gtk_plot_canvas_child_get_type ())
#define G_TYPE_PLOT_CANVAS_CHILD (gtk_plot_canvas_child_get_type ())
typedef struct _GtkPlotCanvas GtkPlotCanvas;
typedef struct _GtkPlotCanvasClass GtkPlotCanvasClass;
typedef struct _GtkPlotCanvasChild GtkPlotCanvasChild;
typedef struct _GtkPlotCanvasChildClass GtkPlotCanvasChildClass;
/**
* GtkPlotCanvasChild:
*
* The GtkPlotCanvasChild struct contains only private data.
* It should only be accessed through the functions described below.
*/
struct _GtkPlotCanvasChild
{
GtkObject object;
GtkPlotCanvas *parent;
gdouble rx1, rx2, ry1, ry2;
gint min_width, min_height;
GtkAllocation allocation;
GtkAllocation drag_area;
guint state;
GtkPlotCanvasChildFlags flags;
GtkPlotCanvasSelection selection;
GtkPlotCanvasSelectionMode mode;
};
struct _GtkPlotCanvasChildClass
{
GtkObjectClass parent_class;
void (*draw) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child);
void (*draw_selection) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child, GtkAllocation allocation);
void (*size_allocate) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child);
void (*move) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child,
gdouble x, gdouble y);
void (*move_resize) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child,
gdouble x1, gdouble y1, gdouble x2, gdouble y2);
GtkPlotCanvasPos (*button_press) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
gint x, gint y);
void (*button_release) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
void (*unselect) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child);
void (*set_magnification) (GtkPlotCanvas *canvas, GtkPlotCanvasChild *child, gdouble m);
};
/**
* GtkPlotCanvas:
*
* The GtkPlotCanvas struct contains only private data.
* It should only be accessed through the functions described below.
*/
struct _GtkPlotCanvas
{
GtkFixed fixed;
GtkPlotCanvasFlags flags;
guint state;
guint freeze_count;
gint pixmap_width, pixmap_height;
gint width, height;
gdouble magnification;
gboolean show_grid;
gdouble grid_step;
GtkPlotLine grid;
GtkPlotCanvasAction action;
GdkPixmap *pixmap;
GdkColor background;
gboolean transparent;
gdouble active_x, active_y;
GtkPlotCanvasChild *active_item;
GtkPlotCanvasPos drag_point;
gint drag_x, drag_y;
gint pointer_x, pointer_y;
GtkAllocation drag_area;
GList *childs;
GdkCursor *cursor;
GtkPlotPC *pc;
};
struct _GtkPlotCanvasClass
{
GtkLayoutClass parent_class;
gboolean (*select_item) (GtkPlotCanvas *canvas,
GdkEventButton *event,
GtkPlotCanvasChild *item);
gboolean (*move_item) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *item,
gdouble new_x, gdouble new_y);
gboolean (*resize_item) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *item,
gdouble new_width, gdouble new_height);
void (*add_item) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *item);
gboolean (*delete_item) (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *item);
void (*select_region) (GtkPlotCanvas *canvas,
gdouble xmin, gdouble ymin,
gdouble xmax, gdouble ymax);
void (*changed) (GtkPlotCanvas *canvas);
};
GType gtk_plot_canvas_get_type (void);
GType gtk_plot_canvas_child_get_type (void);
GtkWidget* gtk_plot_canvas_new (gint width, gint height,
gdouble magnification);
void gtk_plot_canvas_construct (GtkPlotCanvas *canvas,
gint width, gint height,
gdouble magnification);
void gtk_plot_canvas_set_pc (GtkPlotCanvas *canvas,
GtkPlotPC *pc);
GtkPlotCanvasFlags gtk_plot_canvas_flags(GtkPlotCanvas *canvas);
void gtk_plot_canvas_set_flags(GtkPlotCanvas *canvas, GtkPlotCanvasFlags flags);
void gtk_plot_canvas_unset_flags(GtkPlotCanvas *canvas, GtkPlotCanvasFlags flags);
void gtk_plot_canvas_paint (GtkPlotCanvas *canvas);
void gtk_plot_canvas_refresh (GtkPlotCanvas *canvas);
void gtk_plot_canvas_freeze (GtkPlotCanvas *canvas);
void gtk_plot_canvas_thaw (GtkPlotCanvas *canvas);
void gtk_plot_canvas_grid_set_visible(GtkPlotCanvas *canvas,
gboolean visible);
void gtk_plot_canvas_grid_set_step (GtkPlotCanvas *canvas,
gdouble step);
void gtk_plot_canvas_grid_set_attributes(GtkPlotCanvas *canvas,
GtkPlotLineStyle style,
gint width,
const GdkColor *color);
void gtk_plot_canvas_cancel_action (GtkPlotCanvas *plot_canvas);
void gtk_plot_canvas_unselect (GtkPlotCanvas *plot_canvas);
GtkPlotCanvasChild *
gtk_plot_canvas_get_active_item (GtkPlotCanvas *canvas);
void gtk_plot_canvas_set_size (GtkPlotCanvas *canvas,
gint width, gint height);
void gtk_plot_canvas_set_magnification (GtkPlotCanvas *canvas,
gdouble magnification);
void gtk_plot_canvas_set_transparent (GtkPlotCanvas *canvas,
gboolean transparent);
gboolean gtk_plot_canvas_transparent (GtkPlotCanvas *canvas);
void gtk_plot_canvas_set_background (GtkPlotCanvas *canvas,
const GdkColor *bg_color);
void gtk_plot_canvas_get_pixel (GtkPlotCanvas *canvas,
gdouble px, gdouble py,
gint *x, gint *y);
void gtk_plot_canvas_get_position (GtkPlotCanvas *plot_canvas,
gint x, gint y,
gdouble *px, gdouble *py);
void gtk_plot_canvas_put_child (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
gdouble x1, gdouble y1,
gdouble x2, gdouble y2);
void gtk_plot_canvas_remove_child (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
void gtk_plot_canvas_child_move (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
gdouble x1, gdouble y1);
void gtk_plot_canvas_child_move_resize
(GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
gdouble x1, gdouble y1,
gdouble x2, gdouble y2);
void gtk_plot_canvas_child_set_selection
(GtkPlotCanvasChild *child,
GtkPlotCanvasSelection selection);
void gtk_plot_canvas_child_set_selection_mode
(GtkPlotCanvasChild *child,
GtkPlotCanvasSelectionMode mode);
gboolean gtk_plot_canvas_child_get_position
(GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
double *x1, double *y1,
double *x2, double *y2);
void gtk_plot_canvas_set_line_attributes
(GtkPlotCanvas *canvas,
GtkPlotLine line);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_PLOT_CANVAS_H__ */
|