mirror of https://github.com/GNOME/gimp.git
hide the internal API.
2006-09-04 Sven Neumann <sven@gimp.org> * app/display/gimpdisplayshell-selection.[ch]: hide the internal API. * app/display/gimpdisplayshell-appearance.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell.[ch] * app/tools/gimpcolortool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpmovetool.c: changed accordingly. * app/config/gimpdisplayconfig.c * app/dialogs/preferences-dialog.c: increased the default marching ants speed.
This commit is contained in:
parent
969d40caf1
commit
3b92ec7406
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2006-09-04 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/display/gimpdisplayshell-selection.[ch]: hide the internal API.
|
||||
|
||||
* app/display/gimpdisplayshell-appearance.c
|
||||
* app/display/gimpdisplayshell-callbacks.c
|
||||
* app/display/gimpdisplayshell-handlers.c
|
||||
* app/display/gimpdisplayshell.[ch]
|
||||
* app/tools/gimpcolortool.c
|
||||
* app/tools/gimpeditselectiontool.c
|
||||
* app/tools/gimpmovetool.c: changed accordingly.
|
||||
|
||||
* app/config/gimpdisplayconfig.c
|
||||
* app/dialogs/preferences-dialog.c: increased the default marching
|
||||
ants speed.
|
||||
|
||||
2006-09-04 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/display/gimpdisplayshell-selection.[ch]: some cleanup. Made
|
||||
|
|
|
@ -118,7 +118,7 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
|||
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MARCHING_ANTS_SPEED,
|
||||
"marching-ants-speed",
|
||||
MARCHING_ANTS_SPEED_BLURB,
|
||||
50, G_MAXINT, 300,
|
||||
10, 1000, 100,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESIZE_WINDOWS_ON_ZOOM,
|
||||
"resize-windows-on-zoom",
|
||||
|
|
|
@ -1951,7 +1951,7 @@ prefs_dialog_new (Gimp *gimp,
|
|||
|
||||
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
||||
|
||||
prefs_spin_button_add (object, "marching-ants-speed", 10.0, 100.0, 0,
|
||||
prefs_spin_button_add (object, "marching-ants-speed", 1.0, 10.0, 0,
|
||||
_("Marching _ants speed:"),
|
||||
GTK_TABLE (table), 0, size_group);
|
||||
|
||||
|
|
|
@ -265,8 +265,7 @@ gimp_display_shell_set_show_selection (GimpDisplayShell *shell,
|
|||
|
||||
g_object_set (options, "show-selection", show, NULL);
|
||||
|
||||
if (shell->select)
|
||||
gimp_display_shell_selection_set_hidden (shell->select, ! show);
|
||||
gimp_display_shell_selection_set_hidden (shell, ! show);
|
||||
|
||||
SET_ACTIVE (shell->menubar_manager, "view-show-selection", show);
|
||||
|
||||
|
@ -294,8 +293,7 @@ gimp_display_shell_set_show_layer (GimpDisplayShell *shell,
|
|||
|
||||
g_object_set (options, "show-layer-boundary", show, NULL);
|
||||
|
||||
if (shell->select)
|
||||
gimp_display_shell_selection_layer_set_hidden (shell->select, ! show);
|
||||
gimp_display_shell_selection_layer_set_hidden (shell, ! show);
|
||||
|
||||
SET_ACTIVE (shell->menubar_manager, "view-show-layer-boundary", show);
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ gimp_display_shell_canvas_expose (GtkWidget *widget,
|
|||
gimp_display_shell_draw_cursor (shell);
|
||||
|
||||
/* restart (and recalculate) the selection boundaries */
|
||||
gimp_display_shell_selection_start (shell->select);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_ON);
|
||||
|
||||
gimp_display_shell_resume (shell);
|
||||
|
||||
|
|
|
@ -399,7 +399,7 @@ gimp_display_shell_selection_control_handler (GimpImage *image,
|
|||
GimpSelectionControl control,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
gimp_display_shell_selection_visibility (shell, control);
|
||||
gimp_display_shell_selection_control (shell, control);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -647,8 +647,8 @@ gimp_display_shell_ants_speed_notify_handler (GObject *config,
|
|||
GParamSpec *param_spec,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
#undef VERBOSE
|
||||
|
||||
#define INITIAL_DELAY 15 /* in milleseconds */
|
||||
#define USE_DRAWPOINTS 1
|
||||
#define MAX_POINTS_INC 2048
|
||||
#define USE_DRAWPOINTS TRUE
|
||||
|
||||
|
||||
struct _Selection
|
||||
|
@ -66,82 +67,153 @@ struct _Selection
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void selection_add_point (GdkPoint *points[8],
|
||||
gint max_npoints[8],
|
||||
gint npoints[8],
|
||||
gint x,
|
||||
gint y);
|
||||
static void selection_render_points (Selection *select);
|
||||
static void selection_draw (Selection *select);
|
||||
static void selection_transform_segs (Selection *select,
|
||||
const BoundSeg *src_segs,
|
||||
GdkSegment *dest_segs,
|
||||
gint num_segs);
|
||||
static void selection_generate_segs (Selection *select);
|
||||
static void selection_free_segs (Selection *select);
|
||||
static gboolean selection_start_marching (Selection *select);
|
||||
static gboolean selection_march_ants (Selection *select);
|
||||
static void selection_start (Selection *select);
|
||||
|
||||
static void selection_pause (Selection *select);
|
||||
static void selection_resume (Selection *select);
|
||||
|
||||
static void selection_hide (Selection *select);
|
||||
static void selection_layer_hide (Selection *select);
|
||||
|
||||
static void selection_add_point (GdkPoint *points[8],
|
||||
gint max_npoints[8],
|
||||
gint npoints[8],
|
||||
gint x,
|
||||
gint y);
|
||||
static void selection_render_points (Selection *select);
|
||||
static void selection_draw (Selection *select);
|
||||
static void selection_transform_segs (Selection *select,
|
||||
const BoundSeg *src_segs,
|
||||
GdkSegment *dest_segs,
|
||||
gint num_segs);
|
||||
static void selection_generate_segs (Selection *select);
|
||||
static void selection_free_segs (Selection *select);
|
||||
static gboolean selection_start_marching (Selection *select);
|
||||
static gboolean selection_march_ants (Selection *select);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
Selection *
|
||||
gimp_display_shell_selection_new (GimpDisplayShell *shell)
|
||||
void
|
||||
gimp_display_shell_selection_init (GimpDisplayShell *shell)
|
||||
{
|
||||
Selection *new;
|
||||
Selection *select;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (shell->selection == NULL);
|
||||
|
||||
new = g_new0 (Selection, 1);
|
||||
select = g_new0 (Selection, 1);
|
||||
|
||||
new->shell = shell;
|
||||
new->recalc = TRUE;
|
||||
new->hidden = ! gimp_display_shell_get_show_selection (shell);
|
||||
new->layer_hidden = ! gimp_display_shell_get_show_layer (shell);
|
||||
select->shell = shell;
|
||||
select->recalc = TRUE;
|
||||
select->hidden = ! gimp_display_shell_get_show_selection (shell);
|
||||
select->layer_hidden = ! gimp_display_shell_get_show_layer (shell);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
new->points_in[i] = NULL;
|
||||
select->points_in[i] = NULL;
|
||||
|
||||
return new;
|
||||
shell->selection = select;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_free (Selection *select)
|
||||
gimp_display_shell_selection_free (GimpDisplayShell *shell)
|
||||
{
|
||||
if (select->timeout_id)
|
||||
g_source_remove (select->timeout_id);
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
selection_free_segs (select);
|
||||
|
||||
g_free (select);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_pause (Selection *select)
|
||||
{
|
||||
if (select->timeout_id)
|
||||
if (shell->selection)
|
||||
{
|
||||
g_source_remove (select->timeout_id);
|
||||
select->timeout_id = 0;
|
||||
Selection *select = shell->selection;
|
||||
|
||||
if (select->timeout_id)
|
||||
g_source_remove (select->timeout_id);
|
||||
|
||||
selection_free_segs (select);
|
||||
|
||||
g_free (select);
|
||||
|
||||
shell->selection = NULL;
|
||||
}
|
||||
|
||||
select->paused++;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_resume (Selection *select)
|
||||
gimp_display_shell_selection_control (GimpDisplayShell *shell,
|
||||
GimpSelectionControl control)
|
||||
{
|
||||
if (select->paused == 1)
|
||||
select->timeout_id = g_timeout_add (INITIAL_DELAY,
|
||||
(GSourceFunc) selection_start_marching,
|
||||
select);
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
select->paused--;
|
||||
if (shell->selection)
|
||||
{
|
||||
switch (control)
|
||||
{
|
||||
case GIMP_SELECTION_OFF:
|
||||
selection_hide (shell->selection);
|
||||
break;
|
||||
case GIMP_SELECTION_LAYER_OFF:
|
||||
selection_layer_hide (shell->selection);
|
||||
break;
|
||||
case GIMP_SELECTION_ON:
|
||||
selection_start (shell->selection);
|
||||
break;
|
||||
case GIMP_SELECTION_PAUSE:
|
||||
selection_pause (shell->selection);
|
||||
break;
|
||||
case GIMP_SELECTION_RESUME:
|
||||
selection_resume (shell->selection);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_start (Selection *select)
|
||||
gimp_display_shell_selection_set_hidden (GimpDisplayShell *shell,
|
||||
gboolean hidden)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (shell->selection)
|
||||
{
|
||||
Selection *select = shell->selection;
|
||||
|
||||
if (hidden != select->hidden)
|
||||
{
|
||||
selection_hide (select);
|
||||
selection_layer_hide (select);
|
||||
|
||||
select->hidden = hidden;
|
||||
|
||||
selection_start (select);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_layer_set_hidden (GimpDisplayShell *shell,
|
||||
gboolean hidden)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (shell->selection)
|
||||
{
|
||||
Selection *select = shell->selection;
|
||||
|
||||
if (hidden != select->layer_hidden)
|
||||
{
|
||||
selection_hide (select);
|
||||
selection_layer_hide (select);
|
||||
|
||||
select->layer_hidden = hidden;
|
||||
|
||||
selection_start (select);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
selection_start (Selection *select)
|
||||
{
|
||||
select->recalc = TRUE;
|
||||
|
||||
|
@ -157,8 +229,31 @@ gimp_display_shell_selection_start (Selection *select)
|
|||
select);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_invis (Selection *select)
|
||||
static void
|
||||
selection_pause (Selection *select)
|
||||
{
|
||||
if (select->timeout_id)
|
||||
{
|
||||
g_source_remove (select->timeout_id);
|
||||
select->timeout_id = 0;
|
||||
}
|
||||
|
||||
select->paused++;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_resume (Selection *select)
|
||||
{
|
||||
if (select->paused == 1)
|
||||
select->timeout_id = g_timeout_add (INITIAL_DELAY,
|
||||
(GSourceFunc) selection_start_marching,
|
||||
select);
|
||||
|
||||
select->paused--;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_hide (Selection *select)
|
||||
{
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
|
@ -176,13 +271,12 @@ gimp_display_shell_selection_invis (Selection *select)
|
|||
}
|
||||
else
|
||||
{
|
||||
gimp_display_shell_selection_start (select);
|
||||
selection_start (select);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_layer_invis (Selection *select)
|
||||
static void
|
||||
selection_layer_hide (Selection *select)
|
||||
{
|
||||
gint x1, y1;
|
||||
gint x2, y2;
|
||||
|
@ -219,42 +313,6 @@ gimp_display_shell_selection_layer_invis (Selection *select)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_set_hidden (Selection *select,
|
||||
gboolean hidden)
|
||||
{
|
||||
if (hidden != select->hidden)
|
||||
{
|
||||
gimp_display_shell_selection_invis (select);
|
||||
gimp_display_shell_selection_layer_invis (select);
|
||||
|
||||
select->hidden = hidden;
|
||||
|
||||
gimp_display_shell_selection_start (select);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_layer_set_hidden (Selection *select,
|
||||
gboolean hidden)
|
||||
{
|
||||
if (hidden != select->layer_hidden)
|
||||
{
|
||||
gimp_display_shell_selection_invis (select);
|
||||
gimp_display_shell_selection_layer_invis (select);
|
||||
|
||||
select->layer_hidden = hidden;
|
||||
|
||||
gimp_display_shell_selection_start (select);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
#define MAX_POINTS_INC 2048
|
||||
|
||||
static void
|
||||
selection_add_point (GdkPoint *points[8],
|
||||
gint max_npoints[8],
|
||||
|
@ -448,7 +506,6 @@ selection_draw (Selection *select)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
selection_transform_segs (Selection *select,
|
||||
const BoundSeg *src_segs,
|
||||
|
@ -492,7 +549,6 @@ selection_transform_segs (Selection *select,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
selection_generate_segs (Selection *select)
|
||||
{
|
||||
|
@ -553,7 +609,6 @@ selection_generate_segs (Selection *select)
|
|||
g_free (segs_layer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
selection_free_segs (Selection *select)
|
||||
{
|
||||
|
@ -585,7 +640,6 @@ selection_free_segs (Selection *select)
|
|||
select->num_segs_layer = 0;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
selection_start_marching (Selection *select)
|
||||
{
|
||||
|
@ -626,7 +680,6 @@ selection_start_marching (Selection *select)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
selection_march_ants (Selection *select)
|
||||
{
|
||||
|
|
|
@ -20,21 +20,16 @@
|
|||
#define __GIMP_DISPLAY_SHELL_SELECTION_H__
|
||||
|
||||
|
||||
Selection * gimp_display_shell_selection_new (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_selection_init (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_selection_free (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_selection_free (Selection *select);
|
||||
void gimp_display_shell_selection_control (GimpDisplayShell *shell,
|
||||
GimpSelectionControl control);
|
||||
|
||||
void gimp_display_shell_selection_pause (Selection *select);
|
||||
void gimp_display_shell_selection_resume (Selection *select);
|
||||
|
||||
void gimp_display_shell_selection_start (Selection *select);
|
||||
void gimp_display_shell_selection_invis (Selection *select);
|
||||
void gimp_display_shell_selection_layer_invis (Selection *select);
|
||||
|
||||
void gimp_display_shell_selection_set_hidden (Selection *select,
|
||||
gboolean hidden);
|
||||
void gimp_display_shell_selection_layer_set_hidden (Selection *select,
|
||||
gboolean hidden);
|
||||
void gimp_display_shell_selection_set_hidden (GimpDisplayShell *shell,
|
||||
gboolean hidden);
|
||||
void gimp_display_shell_selection_layer_set_hidden (GimpDisplayShell *shell,
|
||||
gboolean hidden);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_SELECTION_H__ */
|
||||
|
|
|
@ -226,7 +226,7 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
|||
shell->snap_to_canvas = FALSE;
|
||||
shell->snap_to_vectors = FALSE;
|
||||
|
||||
shell->select = NULL;
|
||||
shell->selection = NULL;
|
||||
|
||||
shell->canvas = NULL;
|
||||
shell->grid_gc = NULL;
|
||||
|
@ -401,11 +401,7 @@ gimp_display_shell_destroy (GtkObject *object)
|
|||
|
||||
shell->popup_manager = NULL;
|
||||
|
||||
if (shell->select)
|
||||
{
|
||||
gimp_display_shell_selection_free (shell->select);
|
||||
shell->select = NULL;
|
||||
}
|
||||
gimp_display_shell_selection_free (shell);
|
||||
|
||||
if (shell->filter_stack)
|
||||
gimp_display_shell_filter_set (shell, NULL);
|
||||
|
@ -845,7 +841,7 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||
|
||||
shell->canvas = gimp_canvas_new ();
|
||||
|
||||
shell->select = gimp_display_shell_selection_new (shell);
|
||||
gimp_display_shell_selection_init (shell);
|
||||
|
||||
/* the horizontal ruler */
|
||||
shell->hrule = gtk_hruler_new ();
|
||||
|
@ -1359,12 +1355,6 @@ gimp_display_shell_flush (GimpDisplayShell *shell,
|
|||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (! shell->select)
|
||||
{
|
||||
g_warning ("%s: called unrealized", G_STRFUNC);
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_display_shell_title_update (shell);
|
||||
|
||||
if (now)
|
||||
|
@ -1545,35 +1535,6 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
|
||||
GimpSelectionControl control)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (shell->select)
|
||||
{
|
||||
switch (control)
|
||||
{
|
||||
case GIMP_SELECTION_OFF:
|
||||
gimp_display_shell_selection_invis (shell->select);
|
||||
break;
|
||||
case GIMP_SELECTION_LAYER_OFF:
|
||||
gimp_display_shell_selection_layer_invis (shell->select);
|
||||
break;
|
||||
case GIMP_SELECTION_ON:
|
||||
gimp_display_shell_selection_start (shell->select);
|
||||
break;
|
||||
case GIMP_SELECTION_PAUSE:
|
||||
gimp_display_shell_selection_pause (shell->select);
|
||||
break;
|
||||
case GIMP_SELECTION_RESUME:
|
||||
gimp_display_shell_selection_resume (shell->select);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_display_shell_set_highlight:
|
||||
* @shell: a #GimpDisplayShell
|
||||
|
|
|
@ -94,7 +94,7 @@ struct _GimpDisplayShell
|
|||
gboolean snap_to_canvas; /* should the canvas be snapped to? */
|
||||
gboolean snap_to_vectors; /* should the active path be snapped */
|
||||
|
||||
Selection *select; /* Selection object */
|
||||
Selection *selection; /* Selection (marching ants) */
|
||||
|
||||
GtkWidget *canvas; /* GimpCanvas widget */
|
||||
GdkGC *grid_gc; /* GC for grid drawing */
|
||||
|
@ -184,65 +184,63 @@ struct _GimpDisplayShellClass
|
|||
};
|
||||
|
||||
|
||||
GType gimp_display_shell_get_type (void) G_GNUC_CONST;
|
||||
GType gimp_display_shell_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_display_shell_new (GimpDisplay *display,
|
||||
GimpUnit unit,
|
||||
gdouble scale,
|
||||
GimpMenuFactory *menu_factory,
|
||||
GimpUIManager *popup_manager);
|
||||
GtkWidget * gimp_display_shell_new (GimpDisplay *display,
|
||||
GimpUnit unit,
|
||||
gdouble scale,
|
||||
GimpMenuFactory *menu_factory,
|
||||
GimpUIManager *popup_manager);
|
||||
|
||||
void gimp_display_shell_reconnect (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_reconnect (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_scaled (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_scrolled (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_scaled (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_scrolled (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_unit (GimpDisplayShell *shell,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_display_shell_get_unit (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_set_unit (GimpDisplayShell *shell,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_display_shell_get_unit (GimpDisplayShell *shell);
|
||||
|
||||
gboolean gimp_display_shell_snap_coords (GimpDisplayShell *shell,
|
||||
GimpCoords *coords,
|
||||
GimpCoords *snapped_coords,
|
||||
gint snap_offset_x,
|
||||
gint snap_offset_y,
|
||||
gint snap_width,
|
||||
gint snap_height);
|
||||
gboolean gimp_display_shell_snap_coords (GimpDisplayShell *shell,
|
||||
GimpCoords *coords,
|
||||
GimpCoords *snapped_coords,
|
||||
gint snap_offset_x,
|
||||
gint snap_offset_y,
|
||||
gint snap_width,
|
||||
gint snap_height);
|
||||
|
||||
gboolean gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
gboolean gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
|
||||
void gimp_display_shell_expose_area (GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h);
|
||||
void gimp_display_shell_expose_guide (GimpDisplayShell *shell,
|
||||
GimpGuide *guide);
|
||||
void gimp_display_shell_expose_sample_point (GimpDisplayShell *shell,
|
||||
GimpSamplePoint *sample_point);
|
||||
void gimp_display_shell_expose_full (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_expose_area (GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h);
|
||||
void gimp_display_shell_expose_guide (GimpDisplayShell *shell,
|
||||
GimpGuide *guide);
|
||||
void gimp_display_shell_expose_sample_point (GimpDisplayShell *shell,
|
||||
GimpSamplePoint *sample_point);
|
||||
void gimp_display_shell_expose_full (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_flush (GimpDisplayShell *shell,
|
||||
gboolean now);
|
||||
void gimp_display_shell_flush (GimpDisplayShell *shell,
|
||||
gboolean now);
|
||||
|
||||
void gimp_display_shell_pause (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_resume (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_pause (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_resume (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_update_icon (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_update_icon (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_shrink_wrap (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_shrink_wrap (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
|
||||
GimpSelectionControl control);
|
||||
void gimp_display_shell_set_highlight (GimpDisplayShell *shell,
|
||||
const GdkRectangle *highlight);
|
||||
void gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
||||
GimpDrawable *mask,
|
||||
GimpChannelType color);
|
||||
void gimp_display_shell_set_highlight (GimpDisplayShell *shell,
|
||||
const GdkRectangle *highlight);
|
||||
void gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
||||
GimpDrawable *mask,
|
||||
GimpChannelType color);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_H__ */
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpdisplayshell-appearance.h"
|
||||
#include "display/gimpdisplayshell-draw.h"
|
||||
#include "display/gimpdisplayshell-selection.h"
|
||||
#include "display/gimpdisplayshell-transform.h"
|
||||
|
||||
#include "gimpcoloroptions.h"
|
||||
|
@ -244,7 +245,7 @@ gimp_color_tool_button_press (GimpTool *tool,
|
|||
color_tool->sample_point_x = color_tool->sample_point->x;
|
||||
color_tool->sample_point_y = color_tool->sample_point->y;
|
||||
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
|
||||
|
||||
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
|
||||
|
||||
|
@ -300,8 +301,7 @@ gimp_color_tool_button_release (GimpTool *tool,
|
|||
color_tool->sample_point_x = -1;
|
||||
color_tool->sample_point_y = -1;
|
||||
|
||||
gimp_display_shell_selection_visibility (shell,
|
||||
GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ gimp_color_tool_button_release (GimpTool *tool,
|
|||
}
|
||||
}
|
||||
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_image_flush (display->image);
|
||||
|
||||
if (color_tool->sample_point)
|
||||
|
@ -793,8 +793,8 @@ gimp_color_tool_start_sample_point (GimpTool *tool,
|
|||
|
||||
color_tool = GIMP_COLOR_TOOL (tool);
|
||||
|
||||
gimp_display_shell_selection_visibility (GIMP_DISPLAY_SHELL (display->shell),
|
||||
GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell),
|
||||
GIMP_SELECTION_PAUSE);
|
||||
|
||||
tool->display = display;
|
||||
gimp_tool_control_activate (tool->control);
|
||||
|
|
|
@ -432,7 +432,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
|
|||
tool_manager_push_tool (display->image->gimp, GIMP_TOOL (edit_select));
|
||||
|
||||
/* pause the current selection */
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
|
||||
|
||||
/* initialize the statusbar display */
|
||||
gimp_tool_push_status_coords (GIMP_TOOL (edit_select), display,
|
||||
|
@ -454,7 +454,7 @@ gimp_edit_selection_tool_button_release (GimpTool *tool,
|
|||
GimpItem *active_item;
|
||||
|
||||
/* resume the current selection */
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
|
||||
gimp_tool_pop_status (tool, display);
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpdisplayshell-appearance.h"
|
||||
#include "display/gimpdisplayshell-draw.h"
|
||||
#include "display/gimpdisplayshell-selection.h"
|
||||
#include "display/gimpdisplayshell-transform.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
@ -258,8 +259,8 @@ gimp_move_tool_button_press (GimpTool *tool,
|
|||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_activate (tool->control);
|
||||
|
||||
gimp_display_shell_selection_visibility (shell,
|
||||
GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (shell,
|
||||
GIMP_SELECTION_PAUSE);
|
||||
|
||||
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
|
||||
|
||||
|
@ -364,8 +365,7 @@ gimp_move_tool_button_release (GimpTool *tool,
|
|||
move->guide_position = -1;
|
||||
move->guide_orientation = GIMP_ORIENTATION_UNKNOWN;
|
||||
|
||||
gimp_display_shell_selection_visibility (shell,
|
||||
GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ gimp_move_tool_button_release (GimpTool *tool,
|
|||
}
|
||||
}
|
||||
|
||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||
gimp_image_flush (display->image);
|
||||
|
||||
if (move->guide)
|
||||
|
@ -799,8 +799,8 @@ gimp_move_tool_start_guide (GimpMoveTool *move,
|
|||
{
|
||||
GimpTool *tool = GIMP_TOOL (move);
|
||||
|
||||
gimp_display_shell_selection_visibility (GIMP_DISPLAY_SHELL (display->shell),
|
||||
GIMP_SELECTION_PAUSE);
|
||||
gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell),
|
||||
GIMP_SELECTION_PAUSE);
|
||||
|
||||
tool->display = display;
|
||||
gimp_tool_control_activate (tool->control);
|
||||
|
|
Loading…
Reference in New Issue