mirror of https://github.com/GNOME/gimp.git
app/widgets/gimpnavigationpreview.c renamed these files to ...
* app/widgets/gimpnavigationpreview.c * app/widgets/gimpnavigationpreview.h: renamed these files to ... * app/widgets/gimpnavigationview.c * app/widgets/gimpnavigationview.h: to these. And renamed the GimpNavigationPreview type to GimpNavigationView. Hopefully, this is the last change in file names for the Preview->View renaming process. * app/display/gimpnavigationeditor.c * app/widgets/Makefile.am * app/widgets/widgets-types.h: Changed accordingly.
This commit is contained in:
parent
c27a5a30a6
commit
ec4cc4f897
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2004-08-27 DindinX <david@dindinx.org>
|
||||||
|
|
||||||
|
* app/widgets/gimpnavigationpreview.c
|
||||||
|
* app/widgets/gimpnavigationpreview.h: renamed these files to ...
|
||||||
|
|
||||||
|
* app/widgets/gimpnavigationview.c
|
||||||
|
* app/widgets/gimpnavigationview.h: to these.
|
||||||
|
And renamed the GimpNavigationPreview type to GimpNavigationView.
|
||||||
|
|
||||||
|
Hopefully, this is the last change in file names for the Preview->View
|
||||||
|
renaming process.
|
||||||
|
|
||||||
|
* app/display/gimpnavigationeditor.c
|
||||||
|
|
||||||
|
* app/widgets/Makefile.am
|
||||||
|
* app/widgets/widgets-types.h: Changed accordingly.
|
||||||
|
|
||||||
2004-08-26 Michael Natterer <mitch@gimp.org>
|
2004-08-26 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpitem.[ch]: removed "gboolean use_default_values"
|
* app/core/gimpitem.[ch]: removed "gboolean use_default_values"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#include "widgets/gimpdocked.h"
|
#include "widgets/gimpdocked.h"
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimpnavigationpreview.h"
|
#include "widgets/gimpnavigationview.h"
|
||||||
#include "widgets/gimpviewrenderer.h"
|
#include "widgets/gimpviewrenderer.h"
|
||||||
|
|
||||||
#include "gimpdisplay.h"
|
#include "gimpdisplay.h"
|
||||||
|
@ -69,15 +69,15 @@ static GtkWidget * gimp_navigation_editor_new_private (GimpDisplayShell *sh
|
||||||
static gboolean gimp_navigation_editor_button_release (GtkWidget *widget,
|
static gboolean gimp_navigation_editor_button_release (GtkWidget *widget,
|
||||||
GdkEventButton *bevent,
|
GdkEventButton *bevent,
|
||||||
GimpDisplayShell *shell);
|
GimpDisplayShell *shell);
|
||||||
static void gimp_navigation_editor_marker_changed (GimpNavigationPreview *preview,
|
static void gimp_navigation_editor_marker_changed (GimpNavigationView *view,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
GimpNavigationEditor *editor);
|
GimpNavigationEditor *editor);
|
||||||
static void gimp_navigation_editor_zoom (GimpNavigationPreview *preview,
|
static void gimp_navigation_editor_zoom (GimpNavigationView *view,
|
||||||
GimpZoomType direction,
|
GimpZoomType direction,
|
||||||
GimpNavigationEditor *editor);
|
GimpNavigationEditor *editor);
|
||||||
static void gimp_navigation_editor_scroll (GimpNavigationPreview *preview,
|
static void gimp_navigation_editor_scroll (GimpNavigationView *view,
|
||||||
GdkScrollDirection direction,
|
GdkScrollDirection direction,
|
||||||
GimpNavigationEditor *editor);
|
GimpNavigationEditor *editor);
|
||||||
|
|
||||||
static void gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
|
static void gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
|
||||||
|
@ -170,7 +170,7 @@ gimp_navigation_editor_init (GimpNavigationEditor *editor)
|
||||||
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
editor->view = gimp_view_new_by_types (GIMP_TYPE_NAVIGATION_PREVIEW,
|
editor->view = gimp_view_new_by_types (GIMP_TYPE_NAVIGATION_VIEW,
|
||||||
GIMP_TYPE_IMAGE,
|
GIMP_TYPE_IMAGE,
|
||||||
GIMP_PREVIEW_SIZE_MEDIUM, 0, TRUE);
|
GIMP_PREVIEW_SIZE_MEDIUM, 0, TRUE);
|
||||||
gtk_container_add (GTK_CONTAINER (frame), editor->view);
|
gtk_container_add (GTK_CONTAINER (frame), editor->view);
|
||||||
|
@ -320,11 +320,11 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
|
||||||
gint click_x,
|
gint click_x,
|
||||||
gint click_y)
|
gint click_y)
|
||||||
{
|
{
|
||||||
GimpNavigationEditor *editor;
|
GimpNavigationEditor *editor;
|
||||||
GimpNavigationPreview *preview;
|
GimpNavigationView *view;
|
||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
gint x_org, y_org;
|
gint x_org, y_org;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||||
|
@ -363,7 +363,7 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
|
||||||
|
|
||||||
gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
|
gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
|
||||||
|
|
||||||
preview = GIMP_NAVIGATION_PREVIEW (editor->view);
|
view = GIMP_NAVIGATION_VIEW (editor->view);
|
||||||
|
|
||||||
/* decide where to put the popup */
|
/* decide where to put the popup */
|
||||||
gdk_window_get_origin (widget->window, &x_org, &y_org);
|
gdk_window_get_origin (widget->window, &x_org, &y_org);
|
||||||
|
@ -371,13 +371,13 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
|
||||||
#define BORDER_PEN_WIDTH 3
|
#define BORDER_PEN_WIDTH 3
|
||||||
|
|
||||||
x = (x_org + click_x -
|
x = (x_org + click_x -
|
||||||
preview->p_x -
|
view->p_x -
|
||||||
0.5 * (preview->p_width - BORDER_PEN_WIDTH) -
|
0.5 * (view->p_width - BORDER_PEN_WIDTH) -
|
||||||
2 * widget->style->xthickness);
|
2 * widget->style->xthickness);
|
||||||
|
|
||||||
y = (y_org + click_y -
|
y = (y_org + click_y -
|
||||||
preview->p_y -
|
view->p_y -
|
||||||
0.5 * (preview->p_height - BORDER_PEN_WIDTH) -
|
0.5 * (view->p_height - BORDER_PEN_WIDTH) -
|
||||||
2 * widget->style->ythickness);
|
2 * widget->style->ythickness);
|
||||||
|
|
||||||
/* If the popup doesn't fit into the screen, we have a problem.
|
/* If the popup doesn't fit into the screen, we have a problem.
|
||||||
|
@ -391,10 +391,10 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
x = CLAMP (x, 0, (gdk_screen_get_width (screen) -
|
x = CLAMP (x, 0, (gdk_screen_get_width (screen) -
|
||||||
GIMP_VIEW (preview)->renderer->width -
|
GIMP_VIEW (view)->renderer->width -
|
||||||
4 * widget->style->xthickness));
|
4 * widget->style->xthickness));
|
||||||
y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
|
y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
|
||||||
GIMP_VIEW (preview)->renderer->height -
|
GIMP_VIEW (view)->renderer->height -
|
||||||
4 * widget->style->ythickness));
|
4 * widget->style->ythickness));
|
||||||
|
|
||||||
gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
|
gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
|
||||||
|
@ -403,12 +403,12 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
|
||||||
gdk_flush ();
|
gdk_flush ();
|
||||||
|
|
||||||
/* fill in then grab pointer */
|
/* fill in then grab pointer */
|
||||||
preview->motion_offset_x = 0.5 * (preview->p_width - BORDER_PEN_WIDTH);
|
view->motion_offset_x = 0.5 * (view->p_width - BORDER_PEN_WIDTH);
|
||||||
preview->motion_offset_y = 0.5 * (preview->p_height - BORDER_PEN_WIDTH);
|
view->motion_offset_y = 0.5 * (view->p_height - BORDER_PEN_WIDTH);
|
||||||
|
|
||||||
#undef BORDER_PEN_WIDTH
|
#undef BORDER_PEN_WIDTH
|
||||||
|
|
||||||
gimp_navigation_preview_grab_pointer (preview);
|
gimp_navigation_view_grab_pointer (view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -550,10 +550,10 @@ gimp_navigation_editor_button_release (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_editor_marker_changed (GimpNavigationPreview *preview,
|
gimp_navigation_editor_marker_changed (GimpNavigationView *view,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
GimpNavigationEditor *editor)
|
GimpNavigationEditor *editor)
|
||||||
{
|
{
|
||||||
if (editor->shell)
|
if (editor->shell)
|
||||||
{
|
{
|
||||||
|
@ -573,9 +573,9 @@ gimp_navigation_editor_marker_changed (GimpNavigationPreview *preview,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_editor_zoom (GimpNavigationPreview *preview,
|
gimp_navigation_editor_zoom (GimpNavigationView *view,
|
||||||
GimpZoomType direction,
|
GimpZoomType direction,
|
||||||
GimpNavigationEditor *editor)
|
GimpNavigationEditor *editor)
|
||||||
{
|
{
|
||||||
g_return_if_fail (direction != GIMP_ZOOM_TO);
|
g_return_if_fail (direction != GIMP_ZOOM_TO);
|
||||||
|
|
||||||
|
@ -586,9 +586,9 @@ gimp_navigation_editor_zoom (GimpNavigationPreview *preview,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_editor_scroll (GimpNavigationPreview *preview,
|
gimp_navigation_editor_scroll (GimpNavigationView *view,
|
||||||
GdkScrollDirection direction,
|
GdkScrollDirection direction,
|
||||||
GimpNavigationEditor *editor)
|
GimpNavigationEditor *editor)
|
||||||
{
|
{
|
||||||
if (editor->shell)
|
if (editor->shell)
|
||||||
{
|
{
|
||||||
|
@ -754,9 +754,9 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
|
||||||
gimp_view_renderer_set_dot_for_dot (renderer,
|
gimp_view_renderer_set_dot_for_dot (renderer,
|
||||||
editor->shell->dot_for_dot);
|
editor->shell->dot_for_dot);
|
||||||
|
|
||||||
gimp_navigation_preview_set_marker (GIMP_NAVIGATION_PREVIEW (editor->view),
|
gimp_navigation_view_set_marker (GIMP_NAVIGATION_VIEW (editor->view),
|
||||||
editor->shell->offset_x / xratio,
|
editor->shell->offset_x / xratio,
|
||||||
editor->shell->offset_y / yratio,
|
editor->shell->offset_y / yratio,
|
||||||
editor->shell->disp_width / xratio,
|
editor->shell->disp_width / xratio,
|
||||||
editor->shell->disp_height / yratio);
|
editor->shell->disp_height / yratio);
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,8 +174,8 @@ libappwidgets_a_sources = \
|
||||||
gimpmenufactory.h \
|
gimpmenufactory.h \
|
||||||
gimpmessagebox.c \
|
gimpmessagebox.c \
|
||||||
gimpmessagebox.h \
|
gimpmessagebox.h \
|
||||||
gimpnavigationpreview.c \
|
gimpnavigationview.c \
|
||||||
gimpnavigationpreview.h \
|
gimpnavigationview.h \
|
||||||
gimppaletteeditor.c \
|
gimppaletteeditor.c \
|
||||||
gimppaletteeditor.h \
|
gimppaletteeditor.h \
|
||||||
gimppaletteselect.c \
|
gimppaletteselect.c \
|
||||||
|
|
|
@ -1,629 +0,0 @@
|
||||||
/* The GIMP -- an image manipulation program
|
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
||||||
*
|
|
||||||
* GimpNavigationPreview Widget
|
|
||||||
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
|
||||||
*
|
|
||||||
* partly based on app/nav_window
|
|
||||||
* Copyright (C) 1999 Andy Thomas <alt@gimp.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include <gdk/gdkkeysyms.h>
|
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
|
||||||
|
|
||||||
#include "widgets-types.h"
|
|
||||||
|
|
||||||
#include "core/gimpimage.h"
|
|
||||||
#include "core/gimpmarshal.h"
|
|
||||||
|
|
||||||
#include "gimpnavigationpreview.h"
|
|
||||||
#include "gimpviewrenderer.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define BORDER_PEN_WIDTH 3
|
|
||||||
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
MARKER_CHANGED,
|
|
||||||
ZOOM,
|
|
||||||
SCROLL,
|
|
||||||
LAST_SIGNAL
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static void gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass);
|
|
||||||
static void gimp_navigation_preview_init (GimpNavigationPreview *preview);
|
|
||||||
|
|
||||||
static void gimp_navigation_preview_realize (GtkWidget *widget);
|
|
||||||
static void gimp_navigation_preview_unrealize (GtkWidget *widget);
|
|
||||||
static void gimp_navigation_preview_size_allocate (GtkWidget *widget,
|
|
||||||
GtkAllocation *allocation);
|
|
||||||
static gboolean gimp_navigation_preview_expose (GtkWidget *widget,
|
|
||||||
GdkEventExpose *eevent);
|
|
||||||
static gboolean gimp_navigation_preview_button_press (GtkWidget *widget,
|
|
||||||
GdkEventButton *bevent);
|
|
||||||
static gboolean gimp_navigation_preview_button_release (GtkWidget *widget,
|
|
||||||
GdkEventButton *bevent);
|
|
||||||
static gboolean gimp_navigation_preview_scroll (GtkWidget *widget,
|
|
||||||
GdkEventScroll *sevent);
|
|
||||||
static gboolean gimp_navigation_preview_motion_notify (GtkWidget *widget,
|
|
||||||
GdkEventMotion *mevent);
|
|
||||||
static gboolean gimp_navigation_preview_key_press (GtkWidget *widget,
|
|
||||||
GdkEventKey *kevent);
|
|
||||||
|
|
||||||
static void gimp_navigation_preview_transform (GimpNavigationPreview *nav_preview);
|
|
||||||
static void gimp_navigation_preview_draw_marker (GimpNavigationPreview *nav_preview,
|
|
||||||
GdkRectangle *area);
|
|
||||||
|
|
||||||
|
|
||||||
static guint preview_signals[LAST_SIGNAL] = { 0 };
|
|
||||||
|
|
||||||
static GimpViewClass *parent_class = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
GType
|
|
||||||
gimp_navigation_preview_get_type (void)
|
|
||||||
{
|
|
||||||
static GType preview_type = 0;
|
|
||||||
|
|
||||||
if (! preview_type)
|
|
||||||
{
|
|
||||||
static const GTypeInfo preview_info =
|
|
||||||
{
|
|
||||||
sizeof (GimpNavigationPreviewClass),
|
|
||||||
NULL, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
(GClassInitFunc) gimp_navigation_preview_class_init,
|
|
||||||
NULL, /* class_finalize */
|
|
||||||
NULL, /* class_data */
|
|
||||||
sizeof (GimpNavigationPreview),
|
|
||||||
0, /* n_preallocs */
|
|
||||||
(GInstanceInitFunc) gimp_navigation_preview_init,
|
|
||||||
};
|
|
||||||
|
|
||||||
preview_type = g_type_register_static (GIMP_TYPE_VIEW,
|
|
||||||
"GimpNavigationPreview",
|
|
||||||
&preview_info, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return preview_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass)
|
|
||||||
{
|
|
||||||
GtkWidgetClass *widget_class;
|
|
||||||
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
|
||||||
|
|
||||||
preview_signals[MARKER_CHANGED] =
|
|
||||||
g_signal_new ("marker_changed",
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, marker_changed),
|
|
||||||
NULL, NULL,
|
|
||||||
gimp_marshal_VOID__DOUBLE_DOUBLE,
|
|
||||||
G_TYPE_NONE, 2,
|
|
||||||
G_TYPE_DOUBLE,
|
|
||||||
G_TYPE_DOUBLE);
|
|
||||||
|
|
||||||
preview_signals[ZOOM] =
|
|
||||||
g_signal_new ("zoom",
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, zoom),
|
|
||||||
NULL, NULL,
|
|
||||||
gimp_marshal_VOID__ENUM,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
GIMP_TYPE_ZOOM_TYPE);
|
|
||||||
|
|
||||||
preview_signals[SCROLL] =
|
|
||||||
g_signal_new ("scroll",
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, scroll),
|
|
||||||
NULL, NULL,
|
|
||||||
gimp_marshal_VOID__ENUM,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
GDK_TYPE_SCROLL_DIRECTION);
|
|
||||||
|
|
||||||
widget_class->realize = gimp_navigation_preview_realize;
|
|
||||||
widget_class->unrealize = gimp_navigation_preview_unrealize;
|
|
||||||
widget_class->size_allocate = gimp_navigation_preview_size_allocate;
|
|
||||||
widget_class->expose_event = gimp_navigation_preview_expose;
|
|
||||||
widget_class->button_press_event = gimp_navigation_preview_button_press;
|
|
||||||
widget_class->button_release_event = gimp_navigation_preview_button_release;
|
|
||||||
widget_class->scroll_event = gimp_navigation_preview_scroll;
|
|
||||||
widget_class->motion_notify_event = gimp_navigation_preview_motion_notify;
|
|
||||||
widget_class->key_press_event = gimp_navigation_preview_key_press;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_init (GimpNavigationPreview *preview)
|
|
||||||
{
|
|
||||||
GTK_WIDGET_SET_FLAGS (preview, GTK_CAN_FOCUS);
|
|
||||||
|
|
||||||
gtk_widget_add_events (GTK_WIDGET (preview), (GDK_POINTER_MOTION_MASK |
|
|
||||||
GDK_KEY_PRESS_MASK));
|
|
||||||
|
|
||||||
preview->x = 0.0;
|
|
||||||
preview->y = 0.0;
|
|
||||||
preview->width = 0.0;
|
|
||||||
preview->height = 0.0;
|
|
||||||
|
|
||||||
preview->p_x = 0;
|
|
||||||
preview->p_y = 0;
|
|
||||||
preview->p_width = 0;
|
|
||||||
preview->p_height = 0;
|
|
||||||
|
|
||||||
preview->motion_offset_x = 0;
|
|
||||||
preview->motion_offset_y = 0;
|
|
||||||
preview->has_grab = FALSE;
|
|
||||||
|
|
||||||
preview->gc = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_realize (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->realize)
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->realize (widget);
|
|
||||||
|
|
||||||
nav_preview->gc = gdk_gc_new (widget->window);
|
|
||||||
|
|
||||||
gdk_gc_set_function (nav_preview->gc, GDK_INVERT);
|
|
||||||
gdk_gc_set_line_attributes (nav_preview->gc,
|
|
||||||
BORDER_PEN_WIDTH,
|
|
||||||
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_unrealize (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
if (nav_preview->gc)
|
|
||||||
{
|
|
||||||
g_object_unref (nav_preview->gc);
|
|
||||||
nav_preview->gc = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_size_allocate (GtkWidget *widget,
|
|
||||||
GtkAllocation *allocation)
|
|
||||||
{
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
|
|
||||||
|
|
||||||
if (GIMP_VIEW (widget)->renderer->viewable)
|
|
||||||
gimp_navigation_preview_transform (GIMP_NAVIGATION_PREVIEW (widget));
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_expose (GtkWidget *widget,
|
|
||||||
GdkEventExpose *eevent)
|
|
||||||
{
|
|
||||||
if (GTK_WIDGET_DRAWABLE (widget))
|
|
||||||
{
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
|
|
||||||
|
|
||||||
gimp_navigation_preview_draw_marker (GIMP_NAVIGATION_PREVIEW (widget),
|
|
||||||
&eevent->area);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
|
|
||||||
gint tx,
|
|
||||||
gint ty)
|
|
||||||
{
|
|
||||||
GimpView *view;
|
|
||||||
GimpImage *gimage;
|
|
||||||
gdouble ratiox, ratioy;
|
|
||||||
gdouble x, y;
|
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
|
||||||
|
|
||||||
if (! view->renderer->viewable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
tx = CLAMP (tx, 0, view->renderer->width - nav_preview->p_width);
|
|
||||||
ty = CLAMP (ty, 0, view->renderer->height - nav_preview->p_height);
|
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
|
||||||
|
|
||||||
/* transform to image coordinates */
|
|
||||||
if (view->renderer->width != nav_preview->p_width)
|
|
||||||
ratiox = ((gimage->width - nav_preview->width + 1.0) /
|
|
||||||
(view->renderer->width - nav_preview->p_width));
|
|
||||||
else
|
|
||||||
ratiox = 1.0;
|
|
||||||
|
|
||||||
if (view->renderer->height != nav_preview->p_height)
|
|
||||||
ratioy = ((gimage->height - nav_preview->height + 1.0) /
|
|
||||||
(view->renderer->height - nav_preview->p_height));
|
|
||||||
else
|
|
||||||
ratioy = 1.0;
|
|
||||||
|
|
||||||
x = tx * ratiox;
|
|
||||||
y = ty * ratioy;
|
|
||||||
|
|
||||||
g_signal_emit (view, preview_signals[MARKER_CHANGED], 0, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GdkDisplay *display;
|
|
||||||
GdkCursor *cursor;
|
|
||||||
GdkWindow *window;
|
|
||||||
|
|
||||||
widget = GTK_WIDGET (nav_preview);
|
|
||||||
|
|
||||||
nav_preview->has_grab = TRUE;
|
|
||||||
|
|
||||||
gtk_grab_add (widget);
|
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
|
||||||
|
|
||||||
window = GIMP_VIEW (nav_preview)->event_window;
|
|
||||||
|
|
||||||
gdk_pointer_grab (window, TRUE,
|
|
||||||
GDK_BUTTON_RELEASE_MASK |
|
|
||||||
GDK_POINTER_MOTION_HINT_MASK |
|
|
||||||
GDK_BUTTON_MOTION_MASK |
|
|
||||||
GDK_EXTENSION_EVENTS_ALL,
|
|
||||||
window, cursor, GDK_CURRENT_TIME);
|
|
||||||
|
|
||||||
gdk_cursor_unref (cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_button_press (GtkWidget *widget,
|
|
||||||
GdkEventButton *bevent)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview;
|
|
||||||
gint tx, ty;
|
|
||||||
GdkDisplay *display;
|
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
tx = bevent->x;
|
|
||||||
ty = bevent->y;
|
|
||||||
|
|
||||||
switch (bevent->button)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
if (! (tx > nav_preview->p_x &&
|
|
||||||
tx < (nav_preview->p_x + nav_preview->p_width) &&
|
|
||||||
ty > nav_preview->p_y &&
|
|
||||||
ty < (nav_preview->p_y + nav_preview->p_height)))
|
|
||||||
{
|
|
||||||
GdkCursor *cursor;
|
|
||||||
|
|
||||||
nav_preview->motion_offset_x = nav_preview->p_width / 2;
|
|
||||||
nav_preview->motion_offset_y = nav_preview->p_height / 2;
|
|
||||||
|
|
||||||
tx -= nav_preview->motion_offset_x;
|
|
||||||
ty -= nav_preview->motion_offset_y;
|
|
||||||
|
|
||||||
gimp_navigation_preview_move_to (nav_preview, tx, ty);
|
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
|
||||||
gdk_window_set_cursor (GIMP_VIEW (widget)->event_window, cursor);
|
|
||||||
gdk_cursor_unref (cursor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nav_preview->motion_offset_x = tx - nav_preview->p_x;
|
|
||||||
nav_preview->motion_offset_y = ty - nav_preview->p_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_navigation_preview_grab_pointer (nav_preview);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_button_release (GtkWidget *widget,
|
|
||||||
GdkEventButton *bevent)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview;
|
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
switch (bevent->button)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
nav_preview->has_grab = FALSE;
|
|
||||||
|
|
||||||
gtk_grab_remove (widget);
|
|
||||||
gdk_display_pointer_ungrab (gtk_widget_get_display (widget),
|
|
||||||
GDK_CURRENT_TIME);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_scroll (GtkWidget *widget,
|
|
||||||
GdkEventScroll *sevent)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview;
|
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
if (sevent->state & GDK_SHIFT_MASK)
|
|
||||||
{
|
|
||||||
if (sevent->direction == GDK_SCROLL_UP)
|
|
||||||
{
|
|
||||||
g_signal_emit (widget, preview_signals[ZOOM], 0, GIMP_ZOOM_IN);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_signal_emit (widget, preview_signals[ZOOM], 0, GIMP_ZOOM_OUT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GdkScrollDirection direction;
|
|
||||||
|
|
||||||
if (sevent->state & GDK_CONTROL_MASK)
|
|
||||||
{
|
|
||||||
if (sevent->direction == GDK_SCROLL_UP)
|
|
||||||
direction = GDK_SCROLL_LEFT;
|
|
||||||
else
|
|
||||||
direction = GDK_SCROLL_RIGHT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
direction = sevent->direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_signal_emit (widget, preview_signals[SCROLL], 0, direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_motion_notify (GtkWidget *widget,
|
|
||||||
GdkEventMotion *mevent)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview;
|
|
||||||
GimpView *view;
|
|
||||||
gint tx, ty;
|
|
||||||
GdkModifierType mask;
|
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
view = GIMP_VIEW (widget);
|
|
||||||
|
|
||||||
if (! nav_preview->has_grab)
|
|
||||||
{
|
|
||||||
GdkCursor *cursor;
|
|
||||||
GdkDisplay *display;
|
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
|
||||||
|
|
||||||
if (nav_preview->p_x == 0 &&
|
|
||||||
nav_preview->p_y == 0 &&
|
|
||||||
nav_preview->p_width == view->renderer->width &&
|
|
||||||
nav_preview->p_height == view->renderer->height)
|
|
||||||
{
|
|
||||||
gdk_window_set_cursor (view->event_window, NULL);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else if (mevent->x >= nav_preview->p_x &&
|
|
||||||
mevent->y >= nav_preview->p_y &&
|
|
||||||
mevent->x < nav_preview->p_x + nav_preview->p_width &&
|
|
||||||
mevent->y < nav_preview->p_y + nav_preview->p_height)
|
|
||||||
{
|
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
|
|
||||||
}
|
|
||||||
|
|
||||||
gdk_window_set_cursor (view->event_window, cursor);
|
|
||||||
gdk_cursor_unref (cursor);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gdk_window_get_pointer (view->event_window, &tx, &ty, &mask);
|
|
||||||
|
|
||||||
tx -= nav_preview->motion_offset_x;
|
|
||||||
ty -= nav_preview->motion_offset_y;
|
|
||||||
|
|
||||||
gimp_navigation_preview_move_to (nav_preview, tx, ty);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_navigation_preview_key_press (GtkWidget *widget,
|
|
||||||
GdkEventKey *kevent)
|
|
||||||
{
|
|
||||||
GimpNavigationPreview *nav_preview;
|
|
||||||
gint scroll_x = 0;
|
|
||||||
gint scroll_y = 0;
|
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
|
||||||
|
|
||||||
switch (kevent->keyval)
|
|
||||||
{
|
|
||||||
case GDK_Up:
|
|
||||||
scroll_y = -1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GDK_Left:
|
|
||||||
scroll_x = -1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GDK_Right:
|
|
||||||
scroll_x = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GDK_Down:
|
|
||||||
scroll_y = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scroll_x || scroll_y)
|
|
||||||
{
|
|
||||||
gimp_navigation_preview_move_to (nav_preview,
|
|
||||||
nav_preview->p_x + scroll_x,
|
|
||||||
nav_preview->p_y + scroll_y);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_transform (GimpNavigationPreview *nav_preview)
|
|
||||||
{
|
|
||||||
GimpView *view;
|
|
||||||
GimpImage *gimage;
|
|
||||||
gdouble ratiox, ratioy;
|
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
|
||||||
|
|
||||||
ratiox = ((gdouble) view->renderer->width / (gdouble) gimage->width);
|
|
||||||
ratioy = ((gdouble) view->renderer->height / (gdouble) gimage->height);
|
|
||||||
|
|
||||||
nav_preview->p_x = RINT (nav_preview->x * ratiox);
|
|
||||||
nav_preview->p_y = RINT (nav_preview->y * ratioy);
|
|
||||||
|
|
||||||
nav_preview->p_width = RINT (nav_preview->width * ratiox);
|
|
||||||
nav_preview->p_height = RINT (nav_preview->height * ratioy);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_navigation_preview_draw_marker (GimpNavigationPreview *nav_preview,
|
|
||||||
GdkRectangle *area)
|
|
||||||
{
|
|
||||||
GimpView *view;
|
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
|
||||||
|
|
||||||
if (view->renderer->viewable &&
|
|
||||||
nav_preview->width &&
|
|
||||||
nav_preview->height)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
|
||||||
|
|
||||||
if (nav_preview->x > 0 ||
|
|
||||||
nav_preview->y > 0 ||
|
|
||||||
nav_preview->width < gimage->width ||
|
|
||||||
nav_preview->height < gimage->height)
|
|
||||||
{
|
|
||||||
GtkWidget *widget = GTK_WIDGET (view);
|
|
||||||
|
|
||||||
if (area)
|
|
||||||
gdk_gc_set_clip_rectangle (nav_preview->gc, area);
|
|
||||||
|
|
||||||
gdk_draw_rectangle (widget->window, nav_preview->gc,
|
|
||||||
FALSE,
|
|
||||||
widget->allocation.x + nav_preview->p_x + 1,
|
|
||||||
widget->allocation.y + nav_preview->p_y + 1,
|
|
||||||
MAX (1, nav_preview->p_width - BORDER_PEN_WIDTH),
|
|
||||||
MAX (1, nav_preview->p_height - BORDER_PEN_WIDTH));
|
|
||||||
|
|
||||||
if (area)
|
|
||||||
gdk_gc_set_clip_rectangle (nav_preview->gc, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_navigation_preview_set_marker (GimpNavigationPreview *nav_preview,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y,
|
|
||||||
gdouble width,
|
|
||||||
gdouble height)
|
|
||||||
{
|
|
||||||
GimpView *view;
|
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_NAVIGATION_PREVIEW (nav_preview));
|
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
|
||||||
|
|
||||||
g_return_if_fail (view->renderer->viewable);
|
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
|
||||||
|
|
||||||
/* remove old marker */
|
|
||||||
if (GTK_WIDGET_DRAWABLE (view))
|
|
||||||
gimp_navigation_preview_draw_marker (nav_preview, NULL);
|
|
||||||
|
|
||||||
nav_preview->x = CLAMP (x, 0.0, gimage->width - 1.0);
|
|
||||||
nav_preview->y = CLAMP (y, 0.0, gimage->height - 1.0);
|
|
||||||
|
|
||||||
if (width < 0.0)
|
|
||||||
width = gimage->width;
|
|
||||||
|
|
||||||
if (height < 0.0)
|
|
||||||
height = gimage->height;
|
|
||||||
|
|
||||||
nav_preview->width = CLAMP (width, 1.0, gimage->width - nav_preview->x);
|
|
||||||
nav_preview->height = CLAMP (height, 1.0, gimage->height - nav_preview->y);
|
|
||||||
|
|
||||||
gimp_navigation_preview_transform (nav_preview);
|
|
||||||
|
|
||||||
/* draw new marker */
|
|
||||||
if (GTK_WIDGET_DRAWABLE (view))
|
|
||||||
gimp_navigation_preview_draw_marker (nav_preview, NULL);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
/* The GIMP -- an image manipulation program
|
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
||||||
*
|
|
||||||
* GimpNavigationPreview Widget
|
|
||||||
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
|
||||||
*
|
|
||||||
* partly based on app/nav_window
|
|
||||||
* Copyright (C) 1999 Andy Thomas <alt@gimp.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GIMP_NAVIGATION_PREVIEW_H__
|
|
||||||
#define __GIMP_NAVIGATION_PREVIEW_H__
|
|
||||||
|
|
||||||
#include "gimpview.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_NAVIGATION_PREVIEW (gimp_navigation_preview_get_type ())
|
|
||||||
#define GIMP_NAVIGATION_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreview))
|
|
||||||
#define GIMP_NAVIGATION_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreviewClass))
|
|
||||||
#define GIMP_IS_NAVIGATION_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_NAVIGATION_PREVIEW))
|
|
||||||
#define GIMP_IS_NAVIGATION_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_NAVIGATION_PREVIEW))
|
|
||||||
#define GIMP_NAVIGATION_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreviewClass))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GimpNavigationPreviewClass GimpNavigationPreviewClass;
|
|
||||||
|
|
||||||
struct _GimpNavigationPreview
|
|
||||||
{
|
|
||||||
GimpView parent_instance;
|
|
||||||
|
|
||||||
/* values in image coordinates */
|
|
||||||
gdouble x;
|
|
||||||
gdouble y;
|
|
||||||
gdouble width;
|
|
||||||
gdouble height;
|
|
||||||
|
|
||||||
/* values in preview coordinates */
|
|
||||||
gint p_x;
|
|
||||||
gint p_y;
|
|
||||||
gint p_width;
|
|
||||||
gint p_height;
|
|
||||||
|
|
||||||
gint motion_offset_x;
|
|
||||||
gint motion_offset_y;
|
|
||||||
gboolean has_grab;
|
|
||||||
|
|
||||||
GdkGC *gc;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GimpNavigationPreviewClass
|
|
||||||
{
|
|
||||||
GimpViewClass parent_class;
|
|
||||||
|
|
||||||
void (* marker_changed) (GimpNavigationPreview *preview,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y);
|
|
||||||
void (* zoom) (GimpNavigationPreview *preview,
|
|
||||||
GimpZoomType direction);
|
|
||||||
void (* scroll) (GimpNavigationPreview *preview,
|
|
||||||
GdkScrollDirection direction);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
GType gimp_navigation_preview_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
void gimp_navigation_preview_set_marker (GimpNavigationPreview *preview,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y,
|
|
||||||
gdouble width,
|
|
||||||
gdouble height);
|
|
||||||
void gimp_navigation_preview_grab_pointer (GimpNavigationPreview *preview);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_NAVIGATION_PREVIEW_H__ */
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* The GIMP -- an image manipulation program
|
/* The GIMP -- an image manipulation program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* GimpNavigationPreview Widget
|
* GimpNavigationView Widget
|
||||||
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
||||||
*
|
*
|
||||||
* partly based on app/nav_window
|
* partly based on app/nav_window
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpmarshal.h"
|
#include "core/gimpmarshal.h"
|
||||||
|
|
||||||
#include "gimpnavigationpreview.h"
|
#include "gimpnavigationview.h"
|
||||||
#include "gimpviewrenderer.h"
|
#include "gimpviewrenderer.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,66 +50,66 @@ enum
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass);
|
static void gimp_navigation_view_class_init (GimpNavigationViewClass *klass);
|
||||||
static void gimp_navigation_preview_init (GimpNavigationPreview *preview);
|
static void gimp_navigation_view_init (GimpNavigationView *view);
|
||||||
|
|
||||||
static void gimp_navigation_preview_realize (GtkWidget *widget);
|
static void gimp_navigation_view_realize (GtkWidget *widget);
|
||||||
static void gimp_navigation_preview_unrealize (GtkWidget *widget);
|
static void gimp_navigation_view_unrealize (GtkWidget *widget);
|
||||||
static void gimp_navigation_preview_size_allocate (GtkWidget *widget,
|
static void gimp_navigation_view_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation);
|
GtkAllocation *allocation);
|
||||||
static gboolean gimp_navigation_preview_expose (GtkWidget *widget,
|
static gboolean gimp_navigation_view_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *eevent);
|
GdkEventExpose *eevent);
|
||||||
static gboolean gimp_navigation_preview_button_press (GtkWidget *widget,
|
static gboolean gimp_navigation_view_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent);
|
GdkEventButton *bevent);
|
||||||
static gboolean gimp_navigation_preview_button_release (GtkWidget *widget,
|
static gboolean gimp_navigation_view_button_release (GtkWidget *widget,
|
||||||
GdkEventButton *bevent);
|
GdkEventButton *bevent);
|
||||||
static gboolean gimp_navigation_preview_scroll (GtkWidget *widget,
|
static gboolean gimp_navigation_view_scroll (GtkWidget *widget,
|
||||||
GdkEventScroll *sevent);
|
GdkEventScroll *sevent);
|
||||||
static gboolean gimp_navigation_preview_motion_notify (GtkWidget *widget,
|
static gboolean gimp_navigation_view_motion_notify (GtkWidget *widget,
|
||||||
GdkEventMotion *mevent);
|
GdkEventMotion *mevent);
|
||||||
static gboolean gimp_navigation_preview_key_press (GtkWidget *widget,
|
static gboolean gimp_navigation_view_key_press (GtkWidget *widget,
|
||||||
GdkEventKey *kevent);
|
GdkEventKey *kevent);
|
||||||
|
|
||||||
static void gimp_navigation_preview_transform (GimpNavigationPreview *nav_preview);
|
static void gimp_navigation_view_transform (GimpNavigationView *nav_view);
|
||||||
static void gimp_navigation_preview_draw_marker (GimpNavigationPreview *nav_preview,
|
static void gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
|
||||||
GdkRectangle *area);
|
GdkRectangle *area);
|
||||||
|
|
||||||
|
|
||||||
static guint preview_signals[LAST_SIGNAL] = { 0 };
|
static guint view_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
static GimpViewClass *parent_class = NULL;
|
static GimpViewClass *parent_class = NULL;
|
||||||
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gimp_navigation_preview_get_type (void)
|
gimp_navigation_view_get_type (void)
|
||||||
{
|
{
|
||||||
static GType preview_type = 0;
|
static GType view_type = 0;
|
||||||
|
|
||||||
if (! preview_type)
|
if (! view_type)
|
||||||
{
|
{
|
||||||
static const GTypeInfo preview_info =
|
static const GTypeInfo view_info =
|
||||||
{
|
{
|
||||||
sizeof (GimpNavigationPreviewClass),
|
sizeof (GimpNavigationViewClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) gimp_navigation_preview_class_init,
|
(GClassInitFunc) gimp_navigation_view_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (GimpNavigationPreview),
|
sizeof (GimpNavigationView),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) gimp_navigation_preview_init,
|
(GInstanceInitFunc) gimp_navigation_view_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
preview_type = g_type_register_static (GIMP_TYPE_VIEW,
|
view_type = g_type_register_static (GIMP_TYPE_VIEW,
|
||||||
"GimpNavigationPreview",
|
"GimpNavigationView",
|
||||||
&preview_info, 0);
|
&view_info, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return preview_type;
|
return view_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass)
|
gimp_navigation_view_class_init (GimpNavigationViewClass *klass)
|
||||||
{
|
{
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class;
|
||||||
|
|
||||||
|
@ -117,98 +117,98 @@ gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass)
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
preview_signals[MARKER_CHANGED] =
|
view_signals[MARKER_CHANGED] =
|
||||||
g_signal_new ("marker_changed",
|
g_signal_new ("marker_changed",
|
||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, marker_changed),
|
G_STRUCT_OFFSET (GimpNavigationViewClass, marker_changed),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
gimp_marshal_VOID__DOUBLE_DOUBLE,
|
gimp_marshal_VOID__DOUBLE_DOUBLE,
|
||||||
G_TYPE_NONE, 2,
|
G_TYPE_NONE, 2,
|
||||||
G_TYPE_DOUBLE,
|
G_TYPE_DOUBLE,
|
||||||
G_TYPE_DOUBLE);
|
G_TYPE_DOUBLE);
|
||||||
|
|
||||||
preview_signals[ZOOM] =
|
view_signals[ZOOM] =
|
||||||
g_signal_new ("zoom",
|
g_signal_new ("zoom",
|
||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, zoom),
|
G_STRUCT_OFFSET (GimpNavigationViewClass, zoom),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
gimp_marshal_VOID__ENUM,
|
gimp_marshal_VOID__ENUM,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
GIMP_TYPE_ZOOM_TYPE);
|
GIMP_TYPE_ZOOM_TYPE);
|
||||||
|
|
||||||
preview_signals[SCROLL] =
|
view_signals[SCROLL] =
|
||||||
g_signal_new ("scroll",
|
g_signal_new ("scroll",
|
||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GimpNavigationPreviewClass, scroll),
|
G_STRUCT_OFFSET (GimpNavigationViewClass, scroll),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
gimp_marshal_VOID__ENUM,
|
gimp_marshal_VOID__ENUM,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
GDK_TYPE_SCROLL_DIRECTION);
|
GDK_TYPE_SCROLL_DIRECTION);
|
||||||
|
|
||||||
widget_class->realize = gimp_navigation_preview_realize;
|
widget_class->realize = gimp_navigation_view_realize;
|
||||||
widget_class->unrealize = gimp_navigation_preview_unrealize;
|
widget_class->unrealize = gimp_navigation_view_unrealize;
|
||||||
widget_class->size_allocate = gimp_navigation_preview_size_allocate;
|
widget_class->size_allocate = gimp_navigation_view_size_allocate;
|
||||||
widget_class->expose_event = gimp_navigation_preview_expose;
|
widget_class->expose_event = gimp_navigation_view_expose;
|
||||||
widget_class->button_press_event = gimp_navigation_preview_button_press;
|
widget_class->button_press_event = gimp_navigation_view_button_press;
|
||||||
widget_class->button_release_event = gimp_navigation_preview_button_release;
|
widget_class->button_release_event = gimp_navigation_view_button_release;
|
||||||
widget_class->scroll_event = gimp_navigation_preview_scroll;
|
widget_class->scroll_event = gimp_navigation_view_scroll;
|
||||||
widget_class->motion_notify_event = gimp_navigation_preview_motion_notify;
|
widget_class->motion_notify_event = gimp_navigation_view_motion_notify;
|
||||||
widget_class->key_press_event = gimp_navigation_preview_key_press;
|
widget_class->key_press_event = gimp_navigation_view_key_press;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_init (GimpNavigationPreview *preview)
|
gimp_navigation_view_init (GimpNavigationView *view)
|
||||||
{
|
{
|
||||||
GTK_WIDGET_SET_FLAGS (preview, GTK_CAN_FOCUS);
|
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS);
|
||||||
|
|
||||||
gtk_widget_add_events (GTK_WIDGET (preview), (GDK_POINTER_MOTION_MASK |
|
gtk_widget_add_events (GTK_WIDGET (view), (GDK_POINTER_MOTION_MASK |
|
||||||
GDK_KEY_PRESS_MASK));
|
GDK_KEY_PRESS_MASK));
|
||||||
|
|
||||||
preview->x = 0.0;
|
view->x = 0.0;
|
||||||
preview->y = 0.0;
|
view->y = 0.0;
|
||||||
preview->width = 0.0;
|
view->width = 0.0;
|
||||||
preview->height = 0.0;
|
view->height = 0.0;
|
||||||
|
|
||||||
preview->p_x = 0;
|
view->p_x = 0;
|
||||||
preview->p_y = 0;
|
view->p_y = 0;
|
||||||
preview->p_width = 0;
|
view->p_width = 0;
|
||||||
preview->p_height = 0;
|
view->p_height = 0;
|
||||||
|
|
||||||
preview->motion_offset_x = 0;
|
view->motion_offset_x = 0;
|
||||||
preview->motion_offset_y = 0;
|
view->motion_offset_y = 0;
|
||||||
preview->has_grab = FALSE;
|
view->has_grab = FALSE;
|
||||||
|
|
||||||
preview->gc = NULL;
|
view->gc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_realize (GtkWidget *widget)
|
gimp_navigation_view_realize (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->realize)
|
if (GTK_WIDGET_CLASS (parent_class)->realize)
|
||||||
GTK_WIDGET_CLASS (parent_class)->realize (widget);
|
GTK_WIDGET_CLASS (parent_class)->realize (widget);
|
||||||
|
|
||||||
nav_preview->gc = gdk_gc_new (widget->window);
|
nav_view->gc = gdk_gc_new (widget->window);
|
||||||
|
|
||||||
gdk_gc_set_function (nav_preview->gc, GDK_INVERT);
|
gdk_gc_set_function (nav_view->gc, GDK_INVERT);
|
||||||
gdk_gc_set_line_attributes (nav_preview->gc,
|
gdk_gc_set_line_attributes (nav_view->gc,
|
||||||
BORDER_PEN_WIDTH,
|
BORDER_PEN_WIDTH,
|
||||||
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
|
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_unrealize (GtkWidget *widget)
|
gimp_navigation_view_unrealize (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
if (nav_preview->gc)
|
if (nav_view->gc)
|
||||||
{
|
{
|
||||||
g_object_unref (nav_preview->gc);
|
g_object_unref (nav_view->gc);
|
||||||
nav_preview->gc = NULL;
|
nav_view->gc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
||||||
|
@ -216,89 +216,89 @@ gimp_navigation_preview_unrealize (GtkWidget *widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_size_allocate (GtkWidget *widget,
|
gimp_navigation_view_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation)
|
GtkAllocation *allocation)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
|
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
|
||||||
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
|
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
|
||||||
|
|
||||||
if (GIMP_VIEW (widget)->renderer->viewable)
|
if (GIMP_VIEW (widget)->renderer->viewable)
|
||||||
gimp_navigation_preview_transform (GIMP_NAVIGATION_PREVIEW (widget));
|
gimp_navigation_view_transform (GIMP_NAVIGATION_VIEW (widget));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_expose (GtkWidget *widget,
|
gimp_navigation_view_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *eevent)
|
GdkEventExpose *eevent)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_DRAWABLE (widget))
|
if (GTK_WIDGET_DRAWABLE (widget))
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
|
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
|
||||||
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
|
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
|
||||||
|
|
||||||
gimp_navigation_preview_draw_marker (GIMP_NAVIGATION_PREVIEW (widget),
|
gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget),
|
||||||
&eevent->area);
|
&eevent->area);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
|
gimp_navigation_view_move_to (GimpNavigationView *nav_view,
|
||||||
gint tx,
|
gint tx,
|
||||||
gint ty)
|
gint ty)
|
||||||
{
|
{
|
||||||
GimpView *view;
|
GimpView *view;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
gdouble ratiox, ratioy;
|
gdouble ratiox, ratioy;
|
||||||
gdouble x, y;
|
gdouble x, y;
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
view = GIMP_VIEW (nav_view);
|
||||||
|
|
||||||
if (! view->renderer->viewable)
|
if (! view->renderer->viewable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tx = CLAMP (tx, 0, view->renderer->width - nav_preview->p_width);
|
tx = CLAMP (tx, 0, view->renderer->width - nav_view->p_width);
|
||||||
ty = CLAMP (ty, 0, view->renderer->height - nav_preview->p_height);
|
ty = CLAMP (ty, 0, view->renderer->height - nav_view->p_height);
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
gimage = GIMP_IMAGE (view->renderer->viewable);
|
||||||
|
|
||||||
/* transform to image coordinates */
|
/* transform to image coordinates */
|
||||||
if (view->renderer->width != nav_preview->p_width)
|
if (view->renderer->width != nav_view->p_width)
|
||||||
ratiox = ((gimage->width - nav_preview->width + 1.0) /
|
ratiox = ((gimage->width - nav_view->width + 1.0) /
|
||||||
(view->renderer->width - nav_preview->p_width));
|
(view->renderer->width - nav_view->p_width));
|
||||||
else
|
else
|
||||||
ratiox = 1.0;
|
ratiox = 1.0;
|
||||||
|
|
||||||
if (view->renderer->height != nav_preview->p_height)
|
if (view->renderer->height != nav_view->p_height)
|
||||||
ratioy = ((gimage->height - nav_preview->height + 1.0) /
|
ratioy = ((gimage->height - nav_view->height + 1.0) /
|
||||||
(view->renderer->height - nav_preview->p_height));
|
(view->renderer->height - nav_view->p_height));
|
||||||
else
|
else
|
||||||
ratioy = 1.0;
|
ratioy = 1.0;
|
||||||
|
|
||||||
x = tx * ratiox;
|
x = tx * ratiox;
|
||||||
y = ty * ratioy;
|
y = ty * ratioy;
|
||||||
|
|
||||||
g_signal_emit (view, preview_signals[MARKER_CHANGED], 0, x, y);
|
g_signal_emit (view, view_signals[MARKER_CHANGED], 0, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
|
gimp_navigation_view_grab_pointer (GimpNavigationView *nav_view)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkCursor *cursor;
|
GdkCursor *cursor;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
|
|
||||||
widget = GTK_WIDGET (nav_preview);
|
widget = GTK_WIDGET (nav_view);
|
||||||
|
|
||||||
nav_preview->has_grab = TRUE;
|
nav_view->has_grab = TRUE;
|
||||||
|
|
||||||
gtk_grab_add (widget);
|
gtk_grab_add (widget);
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
display = gtk_widget_get_display (widget);
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
||||||
|
|
||||||
window = GIMP_VIEW (nav_preview)->event_window;
|
window = GIMP_VIEW (nav_view)->event_window;
|
||||||
|
|
||||||
gdk_pointer_grab (window, TRUE,
|
gdk_pointer_grab (window, TRUE,
|
||||||
GDK_BUTTON_RELEASE_MASK |
|
GDK_BUTTON_RELEASE_MASK |
|
||||||
|
@ -311,14 +311,14 @@ gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_button_press (GtkWidget *widget,
|
gimp_navigation_view_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent)
|
GdkEventButton *bevent)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview;
|
GimpNavigationView *nav_view;
|
||||||
gint tx, ty;
|
gint tx, ty;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
tx = bevent->x;
|
tx = bevent->x;
|
||||||
ty = bevent->y;
|
ty = bevent->y;
|
||||||
|
@ -326,20 +326,20 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
|
||||||
switch (bevent->button)
|
switch (bevent->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (! (tx > nav_preview->p_x &&
|
if (! (tx > nav_view->p_x &&
|
||||||
tx < (nav_preview->p_x + nav_preview->p_width) &&
|
tx < (nav_view->p_x + nav_view->p_width) &&
|
||||||
ty > nav_preview->p_y &&
|
ty > nav_view->p_y &&
|
||||||
ty < (nav_preview->p_y + nav_preview->p_height)))
|
ty < (nav_view->p_y + nav_view->p_height)))
|
||||||
{
|
{
|
||||||
GdkCursor *cursor;
|
GdkCursor *cursor;
|
||||||
|
|
||||||
nav_preview->motion_offset_x = nav_preview->p_width / 2;
|
nav_view->motion_offset_x = nav_view->p_width / 2;
|
||||||
nav_preview->motion_offset_y = nav_preview->p_height / 2;
|
nav_view->motion_offset_y = nav_view->p_height / 2;
|
||||||
|
|
||||||
tx -= nav_preview->motion_offset_x;
|
tx -= nav_view->motion_offset_x;
|
||||||
ty -= nav_preview->motion_offset_y;
|
ty -= nav_view->motion_offset_y;
|
||||||
|
|
||||||
gimp_navigation_preview_move_to (nav_preview, tx, ty);
|
gimp_navigation_view_move_to (nav_view, tx, ty);
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
display = gtk_widget_get_display (widget);
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
||||||
|
@ -348,11 +348,11 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nav_preview->motion_offset_x = tx - nav_preview->p_x;
|
nav_view->motion_offset_x = tx - nav_view->p_x;
|
||||||
nav_preview->motion_offset_y = ty - nav_preview->p_y;
|
nav_view->motion_offset_y = ty - nav_view->p_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_navigation_preview_grab_pointer (nav_preview);
|
gimp_navigation_view_grab_pointer (nav_view);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -363,17 +363,17 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_button_release (GtkWidget *widget,
|
gimp_navigation_view_button_release (GtkWidget *widget,
|
||||||
GdkEventButton *bevent)
|
GdkEventButton *bevent)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview;
|
GimpNavigationView *nav_view;
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
switch (bevent->button)
|
switch (bevent->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
nav_preview->has_grab = FALSE;
|
nav_view->has_grab = FALSE;
|
||||||
|
|
||||||
gtk_grab_remove (widget);
|
gtk_grab_remove (widget);
|
||||||
gdk_display_pointer_ungrab (gtk_widget_get_display (widget),
|
gdk_display_pointer_ungrab (gtk_widget_get_display (widget),
|
||||||
|
@ -388,22 +388,22 @@ gimp_navigation_preview_button_release (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_scroll (GtkWidget *widget,
|
gimp_navigation_view_scroll (GtkWidget *widget,
|
||||||
GdkEventScroll *sevent)
|
GdkEventScroll *sevent)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview;
|
GimpNavigationView *nav_view;
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
if (sevent->state & GDK_SHIFT_MASK)
|
if (sevent->state & GDK_SHIFT_MASK)
|
||||||
{
|
{
|
||||||
if (sevent->direction == GDK_SCROLL_UP)
|
if (sevent->direction == GDK_SCROLL_UP)
|
||||||
{
|
{
|
||||||
g_signal_emit (widget, preview_signals[ZOOM], 0, GIMP_ZOOM_IN);
|
g_signal_emit (widget, view_signals[ZOOM], 0, GIMP_ZOOM_IN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_signal_emit (widget, preview_signals[ZOOM], 0, GIMP_ZOOM_OUT);
|
g_signal_emit (widget, view_signals[ZOOM], 0, GIMP_ZOOM_OUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -422,43 +422,43 @@ gimp_navigation_preview_scroll (GtkWidget *widget,
|
||||||
direction = sevent->direction;
|
direction = sevent->direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_emit (widget, preview_signals[SCROLL], 0, direction);
|
g_signal_emit (widget, view_signals[SCROLL], 0, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_motion_notify (GtkWidget *widget,
|
gimp_navigation_view_motion_notify (GtkWidget *widget,
|
||||||
GdkEventMotion *mevent)
|
GdkEventMotion *mevent)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview;
|
GimpNavigationView *nav_view;
|
||||||
GimpView *view;
|
GimpView *view;
|
||||||
gint tx, ty;
|
gint tx, ty;
|
||||||
GdkModifierType mask;
|
GdkModifierType mask;
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
view = GIMP_VIEW (widget);
|
view = GIMP_VIEW (widget);
|
||||||
|
|
||||||
if (! nav_preview->has_grab)
|
if (! nav_view->has_grab)
|
||||||
{
|
{
|
||||||
GdkCursor *cursor;
|
GdkCursor *cursor;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
|
||||||
display = gtk_widget_get_display (widget);
|
display = gtk_widget_get_display (widget);
|
||||||
|
|
||||||
if (nav_preview->p_x == 0 &&
|
if (nav_view->p_x == 0 &&
|
||||||
nav_preview->p_y == 0 &&
|
nav_view->p_y == 0 &&
|
||||||
nav_preview->p_width == view->renderer->width &&
|
nav_view->p_width == view->renderer->width &&
|
||||||
nav_preview->p_height == view->renderer->height)
|
nav_view->p_height == view->renderer->height)
|
||||||
{
|
{
|
||||||
gdk_window_set_cursor (view->event_window, NULL);
|
gdk_window_set_cursor (view->event_window, NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else if (mevent->x >= nav_preview->p_x &&
|
else if (mevent->x >= nav_view->p_x &&
|
||||||
mevent->y >= nav_preview->p_y &&
|
mevent->y >= nav_view->p_y &&
|
||||||
mevent->x < nav_preview->p_x + nav_preview->p_width &&
|
mevent->x < nav_view->p_x + nav_view->p_width &&
|
||||||
mevent->y < nav_preview->p_y + nav_preview->p_height)
|
mevent->y < nav_view->p_y + nav_view->p_height)
|
||||||
{
|
{
|
||||||
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
|
||||||
}
|
}
|
||||||
|
@ -475,23 +475,23 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
|
||||||
|
|
||||||
gdk_window_get_pointer (view->event_window, &tx, &ty, &mask);
|
gdk_window_get_pointer (view->event_window, &tx, &ty, &mask);
|
||||||
|
|
||||||
tx -= nav_preview->motion_offset_x;
|
tx -= nav_view->motion_offset_x;
|
||||||
ty -= nav_preview->motion_offset_y;
|
ty -= nav_view->motion_offset_y;
|
||||||
|
|
||||||
gimp_navigation_preview_move_to (nav_preview, tx, ty);
|
gimp_navigation_view_move_to (nav_view, tx, ty);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_navigation_preview_key_press (GtkWidget *widget,
|
gimp_navigation_view_key_press (GtkWidget *widget,
|
||||||
GdkEventKey *kevent)
|
GdkEventKey *kevent)
|
||||||
{
|
{
|
||||||
GimpNavigationPreview *nav_preview;
|
GimpNavigationView *nav_view;
|
||||||
gint scroll_x = 0;
|
gint scroll_x = 0;
|
||||||
gint scroll_y = 0;
|
gint scroll_y = 0;
|
||||||
|
|
||||||
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
|
nav_view = GIMP_NAVIGATION_VIEW (widget);
|
||||||
|
|
||||||
switch (kevent->keyval)
|
switch (kevent->keyval)
|
||||||
{
|
{
|
||||||
|
@ -517,9 +517,9 @@ gimp_navigation_preview_key_press (GtkWidget *widget,
|
||||||
|
|
||||||
if (scroll_x || scroll_y)
|
if (scroll_x || scroll_y)
|
||||||
{
|
{
|
||||||
gimp_navigation_preview_move_to (nav_preview,
|
gimp_navigation_view_move_to (nav_view,
|
||||||
nav_preview->p_x + scroll_x,
|
nav_view->p_x + scroll_x,
|
||||||
nav_preview->p_y + scroll_y);
|
nav_view->p_y + scroll_y);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,78 +527,78 @@ gimp_navigation_preview_key_press (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_transform (GimpNavigationPreview *nav_preview)
|
gimp_navigation_view_transform (GimpNavigationView *nav_view)
|
||||||
{
|
{
|
||||||
GimpView *view;
|
GimpView *view;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
gdouble ratiox, ratioy;
|
gdouble ratiox, ratioy;
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
view = GIMP_VIEW (nav_view);
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
gimage = GIMP_IMAGE (view->renderer->viewable);
|
||||||
|
|
||||||
ratiox = ((gdouble) view->renderer->width / (gdouble) gimage->width);
|
ratiox = ((gdouble) view->renderer->width / (gdouble) gimage->width);
|
||||||
ratioy = ((gdouble) view->renderer->height / (gdouble) gimage->height);
|
ratioy = ((gdouble) view->renderer->height / (gdouble) gimage->height);
|
||||||
|
|
||||||
nav_preview->p_x = RINT (nav_preview->x * ratiox);
|
nav_view->p_x = RINT (nav_view->x * ratiox);
|
||||||
nav_preview->p_y = RINT (nav_preview->y * ratioy);
|
nav_view->p_y = RINT (nav_view->y * ratioy);
|
||||||
|
|
||||||
nav_preview->p_width = RINT (nav_preview->width * ratiox);
|
nav_view->p_width = RINT (nav_view->width * ratiox);
|
||||||
nav_preview->p_height = RINT (nav_preview->height * ratioy);
|
nav_view->p_height = RINT (nav_view->height * ratioy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_navigation_preview_draw_marker (GimpNavigationPreview *nav_preview,
|
gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
|
||||||
GdkRectangle *area)
|
GdkRectangle *area)
|
||||||
{
|
{
|
||||||
GimpView *view;
|
GimpView *view;
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
view = GIMP_VIEW (nav_view);
|
||||||
|
|
||||||
if (view->renderer->viewable &&
|
if (view->renderer->viewable &&
|
||||||
nav_preview->width &&
|
nav_view->width &&
|
||||||
nav_preview->height)
|
nav_view->height)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (view->renderer->viewable);
|
gimage = GIMP_IMAGE (view->renderer->viewable);
|
||||||
|
|
||||||
if (nav_preview->x > 0 ||
|
if (nav_view->x > 0 ||
|
||||||
nav_preview->y > 0 ||
|
nav_view->y > 0 ||
|
||||||
nav_preview->width < gimage->width ||
|
nav_view->width < gimage->width ||
|
||||||
nav_preview->height < gimage->height)
|
nav_view->height < gimage->height)
|
||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET (view);
|
GtkWidget *widget = GTK_WIDGET (view);
|
||||||
|
|
||||||
if (area)
|
if (area)
|
||||||
gdk_gc_set_clip_rectangle (nav_preview->gc, area);
|
gdk_gc_set_clip_rectangle (nav_view->gc, area);
|
||||||
|
|
||||||
gdk_draw_rectangle (widget->window, nav_preview->gc,
|
gdk_draw_rectangle (widget->window, nav_view->gc,
|
||||||
FALSE,
|
FALSE,
|
||||||
widget->allocation.x + nav_preview->p_x + 1,
|
widget->allocation.x + nav_view->p_x + 1,
|
||||||
widget->allocation.y + nav_preview->p_y + 1,
|
widget->allocation.y + nav_view->p_y + 1,
|
||||||
MAX (1, nav_preview->p_width - BORDER_PEN_WIDTH),
|
MAX (1, nav_view->p_width - BORDER_PEN_WIDTH),
|
||||||
MAX (1, nav_preview->p_height - BORDER_PEN_WIDTH));
|
MAX (1, nav_view->p_height - BORDER_PEN_WIDTH));
|
||||||
|
|
||||||
if (area)
|
if (area)
|
||||||
gdk_gc_set_clip_rectangle (nav_preview->gc, NULL);
|
gdk_gc_set_clip_rectangle (nav_view->gc, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_navigation_preview_set_marker (GimpNavigationPreview *nav_preview,
|
gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height)
|
gdouble height)
|
||||||
{
|
{
|
||||||
GimpView *view;
|
GimpView *view;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_NAVIGATION_PREVIEW (nav_preview));
|
g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
|
||||||
|
|
||||||
view = GIMP_VIEW (nav_preview);
|
view = GIMP_VIEW (nav_view);
|
||||||
|
|
||||||
g_return_if_fail (view->renderer->viewable);
|
g_return_if_fail (view->renderer->viewable);
|
||||||
|
|
||||||
|
@ -606,10 +606,10 @@ gimp_navigation_preview_set_marker (GimpNavigationPreview *nav_preview,
|
||||||
|
|
||||||
/* remove old marker */
|
/* remove old marker */
|
||||||
if (GTK_WIDGET_DRAWABLE (view))
|
if (GTK_WIDGET_DRAWABLE (view))
|
||||||
gimp_navigation_preview_draw_marker (nav_preview, NULL);
|
gimp_navigation_view_draw_marker (nav_view, NULL);
|
||||||
|
|
||||||
nav_preview->x = CLAMP (x, 0.0, gimage->width - 1.0);
|
nav_view->x = CLAMP (x, 0.0, gimage->width - 1.0);
|
||||||
nav_preview->y = CLAMP (y, 0.0, gimage->height - 1.0);
|
nav_view->y = CLAMP (y, 0.0, gimage->height - 1.0);
|
||||||
|
|
||||||
if (width < 0.0)
|
if (width < 0.0)
|
||||||
width = gimage->width;
|
width = gimage->width;
|
||||||
|
@ -617,13 +617,13 @@ gimp_navigation_preview_set_marker (GimpNavigationPreview *nav_preview,
|
||||||
if (height < 0.0)
|
if (height < 0.0)
|
||||||
height = gimage->height;
|
height = gimage->height;
|
||||||
|
|
||||||
nav_preview->width = CLAMP (width, 1.0, gimage->width - nav_preview->x);
|
nav_view->width = CLAMP (width, 1.0, gimage->width - nav_view->x);
|
||||||
nav_preview->height = CLAMP (height, 1.0, gimage->height - nav_preview->y);
|
nav_view->height = CLAMP (height, 1.0, gimage->height - nav_view->y);
|
||||||
|
|
||||||
gimp_navigation_preview_transform (nav_preview);
|
gimp_navigation_view_transform (nav_view);
|
||||||
|
|
||||||
/* draw new marker */
|
/* draw new marker */
|
||||||
if (GTK_WIDGET_DRAWABLE (view))
|
if (GTK_WIDGET_DRAWABLE (view))
|
||||||
gimp_navigation_preview_draw_marker (nav_preview, NULL);
|
gimp_navigation_view_draw_marker (nav_view, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* The GIMP -- an image manipulation program
|
/* The GIMP -- an image manipulation program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* GimpNavigationPreview Widget
|
* GimpNavigationView Widget
|
||||||
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
* Copyright (C) 2001-2002 Michael Natterer <mitch@gimp.org>
|
||||||
*
|
*
|
||||||
* partly based on app/nav_window
|
* partly based on app/nav_window
|
||||||
|
@ -22,23 +22,23 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GIMP_NAVIGATION_PREVIEW_H__
|
#ifndef __GIMP_NAVIGATION_VIEW_H__
|
||||||
#define __GIMP_NAVIGATION_PREVIEW_H__
|
#define __GIMP_NAVIGATION_VIEW_H__
|
||||||
|
|
||||||
#include "gimpview.h"
|
#include "gimpview.h"
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_NAVIGATION_PREVIEW (gimp_navigation_preview_get_type ())
|
#define GIMP_TYPE_NAVIGATION_VIEW (gimp_navigation_view_get_type ())
|
||||||
#define GIMP_NAVIGATION_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreview))
|
#define GIMP_NAVIGATION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_NAVIGATION_VIEW, GimpNavigationView))
|
||||||
#define GIMP_NAVIGATION_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreviewClass))
|
#define GIMP_NAVIGATION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_NAVIGATION_VIEW, GimpNavigationViewClass))
|
||||||
#define GIMP_IS_NAVIGATION_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_NAVIGATION_PREVIEW))
|
#define GIMP_IS_NAVIGATION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_NAVIGATION_VIEW))
|
||||||
#define GIMP_IS_NAVIGATION_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_NAVIGATION_PREVIEW))
|
#define GIMP_IS_NAVIGATION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_NAVIGATION_VIEW))
|
||||||
#define GIMP_NAVIGATION_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_NAVIGATION_PREVIEW, GimpNavigationPreviewClass))
|
#define GIMP_NAVIGATION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_NAVIGATION_VIEW, GimpNavigationViewClass))
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GimpNavigationPreviewClass GimpNavigationPreviewClass;
|
typedef struct _GimpNavigationViewClass GimpNavigationViewClass;
|
||||||
|
|
||||||
struct _GimpNavigationPreview
|
struct _GimpNavigationView
|
||||||
{
|
{
|
||||||
GimpView parent_instance;
|
GimpView parent_instance;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ struct _GimpNavigationPreview
|
||||||
gdouble width;
|
gdouble width;
|
||||||
gdouble height;
|
gdouble height;
|
||||||
|
|
||||||
/* values in preview coordinates */
|
/* values in view coordinates */
|
||||||
gint p_x;
|
gint p_x;
|
||||||
gint p_y;
|
gint p_y;
|
||||||
gint p_width;
|
gint p_width;
|
||||||
|
@ -61,28 +61,28 @@ struct _GimpNavigationPreview
|
||||||
GdkGC *gc;
|
GdkGC *gc;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpNavigationPreviewClass
|
struct _GimpNavigationViewClass
|
||||||
{
|
{
|
||||||
GimpViewClass parent_class;
|
GimpViewClass parent_class;
|
||||||
|
|
||||||
void (* marker_changed) (GimpNavigationPreview *preview,
|
void (* marker_changed) (GimpNavigationView *view,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y);
|
gdouble y);
|
||||||
void (* zoom) (GimpNavigationPreview *preview,
|
void (* zoom) (GimpNavigationView *view,
|
||||||
GimpZoomType direction);
|
GimpZoomType direction);
|
||||||
void (* scroll) (GimpNavigationPreview *preview,
|
void (* scroll) (GimpNavigationView *view,
|
||||||
GdkScrollDirection direction);
|
GdkScrollDirection direction);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType gimp_navigation_preview_get_type (void) G_GNUC_CONST;
|
GType gimp_navigation_view_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
void gimp_navigation_preview_set_marker (GimpNavigationPreview *preview,
|
void gimp_navigation_view_set_marker (GimpNavigationView *view,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height);
|
gdouble height);
|
||||||
void gimp_navigation_preview_grab_pointer (GimpNavigationPreview *preview);
|
void gimp_navigation_view_grab_pointer (GimpNavigationView *view);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_NAVIGATION_PREVIEW_H__ */
|
#endif /* __GIMP_NAVIGATION_VIEW_H__ */
|
||||||
|
|
|
@ -165,7 +165,7 @@ typedef struct _GimpThumbBox GimpThumbBox;
|
||||||
/* views */
|
/* views */
|
||||||
|
|
||||||
typedef struct _GimpView GimpView;
|
typedef struct _GimpView GimpView;
|
||||||
typedef struct _GimpNavigationPreview GimpNavigationPreview;
|
typedef struct _GimpNavigationView GimpNavigationView;
|
||||||
|
|
||||||
|
|
||||||
/* view renderers */
|
/* view renderers */
|
||||||
|
|
Loading…
Reference in New Issue