index 3b4c7743fc7eca96a568cfa9abe7d75de59470af..ca16f814ed179343cb57b3a354e2bd115b322484 100644 (file)
--- a/src/display/sp-canvas.h
+++ b/src/display/sp-canvas.h
-#ifndef __SP_CANVAS_H__
-#define __SP_CANVAS_H__
+#ifndef SEEN_SP_CANVAS_H
+#define SEEN_SP_CANVAS_H
/** \file
* SPCanvas, SPCanvasBuf, and SPCanvasItem.
/** \file
* SPCanvas, SPCanvasBuf, and SPCanvasItem.
#include <gtk/gtkobject.h>
#include <gtk/gtkwidget.h>
#include <gtk/gtkobject.h>
#include <gtk/gtkwidget.h>
+#include <glibmm/ustring.h>
+
#include <libnr/nr-matrix.h>
#include <libnr/nr-rect.h>
#include <libnr/nr-rect-l.h>
#include <libnr/nr-matrix.h>
#include <libnr/nr-rect.h>
#include <libnr/nr-rect-l.h>
+G_BEGIN_DECLS
+
struct SPCanvas;
struct SPCanvasGroup;
struct SPCanvas;
struct SPCanvasGroup;
+typedef struct _SPCanvasItemClass SPCanvasItemClass;
enum {
SP_CANVAS_UPDATE_REQUESTED = 1 << 0,
enum {
SP_CANVAS_UPDATE_REQUESTED = 1 << 0,
guint32 bg_color;
// If empty, ignore contents of buffer and use a solid area of bg_color
bool is_empty;
guint32 bg_color;
// If empty, ignore contents of buffer and use a solid area of bg_color
bool is_empty;
+ cairo_t *ct;
};
/**
};
/**
- * An SPCanvasItem refers to a SPCanvas and to its parent item; it has
+ * An SPCanvasItem refers to a SPCanvas and to its parent item; it has
* four coordinates, a bounding rectangle, and a transformation matrix.
*/
struct SPCanvasItem : public GtkObject {
SPCanvas *canvas;
SPCanvasItem *parent;
* four coordinates, a bounding rectangle, and a transformation matrix.
*/
struct SPCanvasItem : public GtkObject {
SPCanvas *canvas;
SPCanvasItem *parent;
-
+
double x1, y1, x2, y2;
NR::Rect bounds;
NR::Matrix xform;
double x1, y1, x2, y2;
NR::Rect bounds;
NR::Matrix xform;
/**
* The vtable of an SPCanvasItem.
*/
/**
* The vtable of an SPCanvasItem.
*/
-struct SPCanvasItemClass : public GtkObjectClass {
+struct _SPCanvasItemClass : public GtkObjectClass {
void (* update) (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags);
void (* update) (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags);
-
+
void (* render) (SPCanvasItem *item, SPCanvasBuf *buf);
double (* point) (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item);
void (* render) (SPCanvasItem *item, SPCanvasBuf *buf);
double (* point) (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item);
-
+
int (* event) (SPCanvasItem *item, GdkEvent *event);
};
SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...);
int (* event) (SPCanvasItem *item, GdkEvent *event);
};
SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...);
+G_END_DECLS
+
#define sp_canvas_item_set gtk_object_set
void sp_canvas_item_affine_absolute(SPCanvasItem *item, NR::Matrix const &aff);
#define sp_canvas_item_set gtk_object_set
void sp_canvas_item_affine_absolute(SPCanvasItem *item, NR::Matrix const &aff);
*/
struct SPCanvas {
GtkWidget widget;
*/
struct SPCanvas {
GtkWidget widget;
-
+
guint idle_id;
guint idle_id;
-
+
SPCanvasItem *root;
SPCanvasItem *root;
-
+
double dx0, dy0;
int x0, y0;
double dx0, dy0;
int x0, y0;
-
+
/* Area that needs redrawing, stored as a microtile array */
int tLeft,tTop,tRight,tBottom;
int tileH,tileV;
uint8_t *tiles;
/* Area that needs redrawing, stored as a microtile array */
int tLeft,tTop,tRight,tBottom;
int tileH,tileV;
uint8_t *tiles;
-
+
/* Last known modifier state, for deferred repick when a button is down */
int state;
/* Last known modifier state, for deferred repick when a button is down */
int state;
-
+
/* The item containing the mouse pointer, or NULL if none */
SPCanvasItem *current_item;
/* The item containing the mouse pointer, or NULL if none */
SPCanvasItem *current_item;
-
+
/* Item that is about to become current (used to track deletions and such) */
SPCanvasItem *new_current_item;
/* Item that is about to become current (used to track deletions and such) */
SPCanvasItem *new_current_item;
-
+
/* Item that holds a pointer grab, or NULL if none */
SPCanvasItem *grabbed_item;
/* Item that holds a pointer grab, or NULL if none */
SPCanvasItem *grabbed_item;
-
+
/* Event mask specified when grabbing an item */
guint grabbed_event_mask;
/* Event mask specified when grabbing an item */
guint grabbed_event_mask;
-
+
/* If non-NULL, the currently focused item */
SPCanvasItem *focused_item;
/* If non-NULL, the currently focused item */
SPCanvasItem *focused_item;
-
+
/* Event on which selection of current item is based */
GdkEvent pick_event;
/* Event on which selection of current item is based */
GdkEvent pick_event;
-
+
int close_enough;
int close_enough;
-
+
/* GC for temporary draw pixmap */
GdkGC *pixmap_gc;
/* GC for temporary draw pixmap */
GdkGC *pixmap_gc;
-
+
unsigned int need_update : 1;
unsigned int need_redraw : 1;
unsigned int need_repick : 1;
unsigned int need_update : 1;
unsigned int need_redraw : 1;
unsigned int need_repick : 1;
// connector tool). If so, they may temporarily set this flag to
// 'true'.
bool gen_all_enter_events;
// connector tool). If so, they may temporarily set this flag to
// 'true'.
bool gen_all_enter_events;
-
+
int rendermode;
int rendermode;
+#if ENABLE_LCMS
+ bool enable_cms_display_adj;
+ Glib::ustring* cms_key;
+#endif // ENABLE_LCMS
+
bool is_scrolling;
bool is_scrolling;
-
+
NR::Rect getViewbox() const;
NR::Rect getViewbox() const;
+ NR::IRect getViewboxIntegers() const;
};
GtkWidget *sp_canvas_new_aa();
};
GtkWidget *sp_canvas_new_aa();
@@ -191,15 +205,15 @@ void sp_canvas_request_redraw(SPCanvas *canvas, int x1, int y1, int x2, int y2);
void sp_canvas_force_full_redraw_after_interruptions(SPCanvas *canvas, unsigned int count);
void sp_canvas_end_forced_full_redraws(SPCanvas *canvas);
void sp_canvas_force_full_redraw_after_interruptions(SPCanvas *canvas, unsigned int count);
void sp_canvas_end_forced_full_redraws(SPCanvas *canvas);
+bool sp_canvas_world_pt_inside_window(SPCanvas const *canvas, NR::Point const &world);
+
void sp_canvas_window_to_world(SPCanvas const *canvas, double winx, double winy, double *worldx, double *worldy);
void sp_canvas_world_to_window(SPCanvas const *canvas, double worldx, double worldy, double *winx, double *winy);
NR::Point sp_canvas_window_to_world(SPCanvas const *canvas, NR::Point const win);
NR::Point sp_canvas_world_to_window(SPCanvas const *canvas, NR::Point const world);
void sp_canvas_window_to_world(SPCanvas const *canvas, double winx, double winy, double *worldx, double *worldy);
void sp_canvas_world_to_window(SPCanvas const *canvas, double worldx, double worldy, double *winx, double *winy);
NR::Point sp_canvas_window_to_world(SPCanvas const *canvas, NR::Point const win);
NR::Point sp_canvas_world_to_window(SPCanvas const *canvas, NR::Point const world);
-bool sp_canvas_world_pt_inside_window(SPCanvas const *canvas, NR::Point const &world);
-
-#endif
+#endif // SEEN_SP_CANVAS_H
/*
Local Variables:
/*
Local Variables: