gimp r27065 - in trunk: . app/widgets
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27065 - in trunk: . app/widgets
- Date: Fri, 26 Sep 2008 18:21:36 +0000 (UTC)
Author: mitch
Date: Fri Sep 26 18:21:36 2008
New Revision: 27065
URL: http://svn.gnome.org/viewvc/gimp?rev=27065&view=rev
Log:
2008-09-26 Michael Natterer <mitch gimp org>
* app/widgets/gimpnavigationview.c: reorder functions and add
static prototypes.
Modified:
trunk/ChangeLog
trunk/app/widgets/gimpnavigationview.c
Modified: trunk/app/widgets/gimpnavigationview.c
==============================================================================
--- trunk/app/widgets/gimpnavigationview.c (original)
+++ trunk/app/widgets/gimpnavigationview.c Fri Sep 26 18:21:36 2008
@@ -90,6 +90,12 @@
static void gimp_navigation_view_transform (GimpNavigationView *nav_view);
static void gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
cairo_t *cr);
+static void gimp_navigation_view_move_to (GimpNavigationView *nav_view,
+ gint tx,
+ gint ty);
+static void gimp_navigation_view_get_ratio (GimpNavigationView *nav_view,
+ gdouble *ratiox,
+ gdouble *ratioy);
G_DEFINE_TYPE (GimpNavigationView, gimp_navigation_view, GIMP_TYPE_VIEW)
@@ -201,43 +207,6 @@
return TRUE;
}
-static void
-gimp_navigation_view_get_ratio (const GimpNavigationView *nav_view,
- gdouble *ratiox,
- gdouble *ratioy)
-{
- GimpView *view = GIMP_VIEW (nav_view);
- GimpImage *image;
-
- image = GIMP_IMAGE (view->renderer->viewable);
-
- *ratiox = (gdouble) view->renderer->width /
- (gdouble) gimp_image_get_width (image);
- *ratioy = (gdouble) view->renderer->height /
- (gdouble) gimp_image_get_height (image);
-}
-
-static void
-gimp_navigation_view_move_to (GimpNavigationView *nav_view,
- gint tx,
- gint ty)
-{
- GimpView *view = GIMP_VIEW (nav_view);
- gdouble ratiox, ratioy;
- gdouble x, y;
-
- if (! view->renderer->viewable)
- return;
-
- gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
-
- x = tx / ratiox;
- y = ty / ratioy;
-
- g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
- x, y, nav_view->width, nav_view->height);
-}
-
void
gimp_navigation_view_grab_pointer (GimpNavigationView *nav_view)
{
@@ -465,6 +434,64 @@
return FALSE;
}
+
+/* public functions */
+
+void
+gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GimpView *view;
+
+ g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
+
+ view = GIMP_VIEW (nav_view);
+
+ g_return_if_fail (view->renderer->viewable);
+
+ nav_view->x = x;
+ nav_view->y = y;
+ nav_view->width = MAX (1.0, width);
+ nav_view->height = MAX (1.0, height);
+
+ gimp_navigation_view_transform (nav_view);
+
+ /* Marker changed, redraw */
+ gtk_widget_queue_draw (GTK_WIDGET (view));
+}
+
+void
+gimp_navigation_view_set_motion_offset (GimpNavigationView *view,
+ gint motion_offset_x,
+ gint motion_offset_y)
+{
+ g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+ view->motion_offset_x = motion_offset_x;
+ view->motion_offset_y = motion_offset_y;
+}
+
+void
+gimp_navigation_view_get_local_marker (GimpNavigationView *view,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height)
+{
+ g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+ if (x) *x = view->p_x;
+ if (y) *y = view->p_y;
+ if (width) *width = view->p_width;
+ if (height) *height = view->p_height;
+}
+
+
+/* private functions */
+
static void
gimp_navigation_view_transform (GimpNavigationView *nav_view)
{
@@ -511,54 +538,39 @@
}
}
-void
-gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
+static void
+gimp_navigation_view_move_to (GimpNavigationView *nav_view,
+ gint tx,
+ gint ty)
{
- GimpView *view;
-
- g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
-
- view = GIMP_VIEW (nav_view);
+ GimpView *view = GIMP_VIEW (nav_view);
+ gdouble ratiox, ratioy;
+ gdouble x, y;
- g_return_if_fail (view->renderer->viewable);
+ if (! view->renderer->viewable)
+ return;
- nav_view->x = x;
- nav_view->y = y;
- nav_view->width = MAX (1.0, width);
- nav_view->height = MAX (1.0, height);
+ gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
- gimp_navigation_view_transform (nav_view);
+ x = tx / ratiox;
+ y = ty / ratioy;
- /* Marker changed, redraw */
- gtk_widget_queue_draw (GTK_WIDGET (view));
+ g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
+ x, y, nav_view->width, nav_view->height);
}
-void
-gimp_navigation_view_set_motion_offset (GimpNavigationView *view,
- gint motion_offset_x,
- gint motion_offset_y)
+static void
+gimp_navigation_view_get_ratio (GimpNavigationView *nav_view,
+ gdouble *ratiox,
+ gdouble *ratioy)
{
- g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
-
- view->motion_offset_x = motion_offset_x;
- view->motion_offset_y = motion_offset_y;
-}
+ GimpView *view = GIMP_VIEW (nav_view);
+ GimpImage *image;
-void
-gimp_navigation_view_get_local_marker (GimpNavigationView *view,
- gint *x,
- gint *y,
- gint *width,
- gint *height)
-{
- g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+ image = GIMP_IMAGE (view->renderer->viewable);
- if (x) *x = view->p_x;
- if (y) *y = view->p_y;
- if (width) *width = view->p_width;
- if (height) *height = view->p_height;
+ *ratiox = (gdouble) view->renderer->width /
+ (gdouble) gimp_image_get_width (image);
+ *ratioy = (gdouble) view->renderer->height /
+ (gdouble) gimp_image_get_height (image);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]