summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-11 20:53:30 +0000
committerDavid Robillard <d@drobilla.net>2014-01-11 20:53:30 +0000
commitafdb578607526ca82cf03ec04cb4f410f11692c1 (patch)
treeb5cbce762b65e89a0cde5a815bd870b0fb87e298 /src
parent438d2c4aadd439b995af75a4b6589e32adf3fbb4 (diff)
downloadganv-afdb578607526ca82cf03ec04cb4f410f11692c1.tar.gz
ganv-afdb578607526ca82cf03ec04cb4f410f11692c1.tar.bz2
ganv-afdb578607526ca82cf03ec04cb4f410f11692c1.zip
Make some functions private.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5301 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/canvas-base.c26
-rw-r--r--src/ganv-private.h10
-rw-r--r--src/item.c5
-rw-r--r--src/widget.c1
4 files changed, 14 insertions, 28 deletions
diff --git a/src/canvas-base.c b/src/canvas-base.c
index 89a3e4e..9691bff 100644
--- a/src/canvas-base.c
+++ b/src/canvas-base.c
@@ -1365,7 +1365,7 @@ ganv_canvas_base_set_pixels_per_unit(GanvCanvasBase* canvas, double n)
int anchor_x, anchor_y;
g_return_if_fail(GANV_IS_CANVAS_BASE(canvas));
- g_return_if_fail(n > GANV_CANVAS_BASE_EPSILON);
+ g_return_if_fail(n > 1e-10);
if (canvas->center_scroll_region) {
anchor_x = GTK_WIDGET(canvas)->allocation.width / 2;
@@ -1445,30 +1445,6 @@ ganv_canvas_base_get_scroll_offsets(GanvCanvasBase* canvas, int* cx, int* cy)
}
/**
- * ganv_canvas_base_update_now:
- * @canvas: A canvas.
- *
- * Forces an immediate update and redraw of a canvas. If the canvas does not
- * have any pending update or redraw requests, then no action is taken. This is
- * typically only used by applications that need explicit control of when the
- * display is updated, like games. It is not needed by normal applications.
- */
-void
-ganv_canvas_base_update_now(GanvCanvasBase* canvas)
-{
- g_return_if_fail(GANV_IS_CANVAS_BASE(canvas));
-
- if (!(canvas->need_update || canvas->need_redraw)) {
- g_assert(canvas->idle_id == 0);
- g_assert(canvas->redraw_region == NULL);
- return;
- }
-
- remove_idle(canvas);
- do_update(canvas);
-}
-
-/**
* ganv_canvas_base_get_item_at:
* @canvas: A canvas.
* @x: X position in world coordinates.
diff --git a/src/ganv-private.h b/src/ganv-private.h
index d70f00c..227c46b 100644
--- a/src/ganv-private.h
+++ b/src/ganv-private.h
@@ -22,8 +22,9 @@ extern "C" {
#include <cairo.h>
-#include "ganv/types.h"
+#include "ganv/canvas-base.h"
#include "ganv/text.h"
+#include "ganv/types.h"
extern guint signal_moved;
@@ -217,6 +218,13 @@ ganv_canvas_base_request_update(GanvCanvasBase* canvas);
int
ganv_canvas_base_emit_event(GanvCanvasBase* canvas, GdkEvent* event);
+/* For use only by item type implementations. Request that the canvas
+ * eventually redraw the specified region, specified in canvas pixel
+ * coordinates. The region contains (x1, y1) but not (x2, y2).
+ */
+void
+ganv_canvas_base_request_redraw(GanvCanvasBase* canvas,
+ int x1, int y1, int x2, int y2);
/* Edge */
diff --git a/src/item.c b/src/item.c
index 6fcd110..05295bb 100644
--- a/src/item.c
+++ b/src/item.c
@@ -664,8 +664,9 @@ ganv_item_default_bounds(GanvItem* item, double* x1, double* y1, double* x2, dou
* @x2: Rightmost edge of the bounding box (return value).
* @y2: Lower edge of the bounding box (return value).
*
- * Queries the bounding box of a canvas item. The bounds are returned in the
- * coordinate system of the item's parent.
+ * Queries the bounding box of a canvas item. The bounding box may not be
+ * exactly tight, but the canvas items will do the best they can. The bounds
+ * are returned in the coordinate system of the item's parent.
**/
void
ganv_item_get_bounds(GanvItem* item, double* x1, double* y1, double* x2, double* y2)
diff --git a/src/widget.c b/src/widget.c
index d6c7a0b..afbf56c 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -21,6 +21,7 @@
#include <gtk/gtksignal.h>
+#include "ganv/canvas-base.h"
#include "ganv/widget.h"
#include "./gettext.h"