Code

two picking optimizations: 1 use our canvas' viewbox so that invisible segments can...
[inkscape.git] / src / display / sp-canvas.h
index 905c9272f8538d9557a50647ac7ab2b4e53cad23..bc5f835f12c1757f9539031b8737d28d9ea80811 100644 (file)
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
-#include <stdint.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# ifdef HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+
 #include <glib/gtypes.h>
 #include <gdk/gdkevents.h>
 #include <gdk/gdkgc.h>
@@ -41,6 +52,7 @@ struct SPCanvasBuf{
     guchar *buf;
     int buf_rowstride;
     NRRectL rect;
+    NRRectL visible_rect;
     /// Background color, given as 0xrrggbb
     guint32 bg_color;
     // If empty, ignore contents of buffer and use a solid area of bg_color
@@ -144,13 +156,30 @@ struct SPCanvas {
     unsigned int need_update : 1;
     unsigned int need_redraw : 1;
     unsigned int need_repick : 1;
+
+    NRRectL redraw_aborted;
+    long redraw_count;
+    glong slowest_buffer;
+    
+    int forced_redraw_count;
+    int forced_redraw_limit;
     
     /* For use by internal pick_current_item() function */
     unsigned int left_grabbed_item : 1;
     /* For use by internal pick_current_item() function */
     unsigned int in_repick : 1;
 
+    // In most tools Inkscape only generates enter and leave events
+    // on the current item, but no other enter events if a mouse button
+    // is depressed -- see function pick_current_item().  Some tools
+    // may wish the canvas to generate to all enter events, (e.g., the
+    // connector tool).  If so, they may temporarily set this flag to
+    // 'true'.
+    bool gen_all_enter_events;
+    
     int rendermode;
+
+    bool is_scrolling;
     
     NR::Rect getViewbox() const;
 };
@@ -159,10 +188,12 @@ GtkWidget *sp_canvas_new_aa();
 
 SPCanvasGroup *sp_canvas_root(SPCanvas *canvas);
 
-void sp_canvas_scroll_to(SPCanvas *canvas, double cx, double cy, unsigned int clear);
+void sp_canvas_scroll_to(SPCanvas *canvas, double cx, double cy, unsigned int clear, bool is_scrolling = false);
 void sp_canvas_update_now(SPCanvas *canvas);
 
 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_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);