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:

committed by
Sven Neumann

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>
|
2006-09-04 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/display/gimpdisplayshell-selection.[ch]: some cleanup. Made
|
* 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,
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MARCHING_ANTS_SPEED,
|
||||||
"marching-ants-speed",
|
"marching-ants-speed",
|
||||||
MARCHING_ANTS_SPEED_BLURB,
|
MARCHING_ANTS_SPEED_BLURB,
|
||||||
50, G_MAXINT, 300,
|
10, 1000, 100,
|
||||||
GIMP_PARAM_STATIC_STRINGS);
|
GIMP_PARAM_STATIC_STRINGS);
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESIZE_WINDOWS_ON_ZOOM,
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESIZE_WINDOWS_ON_ZOOM,
|
||||||
"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));
|
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:"),
|
_("Marching _ants speed:"),
|
||||||
GTK_TABLE (table), 0, size_group);
|
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);
|
g_object_set (options, "show-selection", show, NULL);
|
||||||
|
|
||||||
if (shell->select)
|
gimp_display_shell_selection_set_hidden (shell, ! show);
|
||||||
gimp_display_shell_selection_set_hidden (shell->select, ! show);
|
|
||||||
|
|
||||||
SET_ACTIVE (shell->menubar_manager, "view-show-selection", 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);
|
g_object_set (options, "show-layer-boundary", show, NULL);
|
||||||
|
|
||||||
if (shell->select)
|
gimp_display_shell_selection_layer_set_hidden (shell, ! show);
|
||||||
gimp_display_shell_selection_layer_set_hidden (shell->select, ! show);
|
|
||||||
|
|
||||||
SET_ACTIVE (shell->menubar_manager, "view-show-layer-boundary", 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);
|
gimp_display_shell_draw_cursor (shell);
|
||||||
|
|
||||||
/* restart (and recalculate) the selection boundaries */
|
/* 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);
|
gimp_display_shell_resume (shell);
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ gimp_display_shell_selection_control_handler (GimpImage *image,
|
|||||||
GimpSelectionControl control,
|
GimpSelectionControl control,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
gimp_display_shell_selection_visibility (shell, control);
|
gimp_display_shell_selection_control (shell, control);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -647,8 +647,8 @@ gimp_display_shell_ants_speed_notify_handler (GObject *config,
|
|||||||
GParamSpec *param_spec,
|
GParamSpec *param_spec,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE);
|
gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
|
||||||
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
|
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -41,7 +41,8 @@
|
|||||||
#undef VERBOSE
|
#undef VERBOSE
|
||||||
|
|
||||||
#define INITIAL_DELAY 15 /* in milleseconds */
|
#define INITIAL_DELAY 15 /* in milleseconds */
|
||||||
#define USE_DRAWPOINTS 1
|
#define MAX_POINTS_INC 2048
|
||||||
|
#define USE_DRAWPOINTS TRUE
|
||||||
|
|
||||||
|
|
||||||
struct _Selection
|
struct _Selection
|
||||||
@ -66,82 +67,153 @@ struct _Selection
|
|||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void selection_add_point (GdkPoint *points[8],
|
static void selection_start (Selection *select);
|
||||||
gint max_npoints[8],
|
|
||||||
gint npoints[8],
|
static void selection_pause (Selection *select);
|
||||||
gint x,
|
static void selection_resume (Selection *select);
|
||||||
gint y);
|
|
||||||
static void selection_render_points (Selection *select);
|
static void selection_hide (Selection *select);
|
||||||
static void selection_draw (Selection *select);
|
static void selection_layer_hide (Selection *select);
|
||||||
static void selection_transform_segs (Selection *select,
|
|
||||||
const BoundSeg *src_segs,
|
static void selection_add_point (GdkPoint *points[8],
|
||||||
GdkSegment *dest_segs,
|
gint max_npoints[8],
|
||||||
gint num_segs);
|
gint npoints[8],
|
||||||
static void selection_generate_segs (Selection *select);
|
gint x,
|
||||||
static void selection_free_segs (Selection *select);
|
gint y);
|
||||||
static gboolean selection_start_marching (Selection *select);
|
static void selection_render_points (Selection *select);
|
||||||
static gboolean selection_march_ants (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 */
|
/* public functions */
|
||||||
|
|
||||||
Selection *
|
void
|
||||||
gimp_display_shell_selection_new (GimpDisplayShell *shell)
|
gimp_display_shell_selection_init (GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
Selection *new;
|
Selection *select;
|
||||||
gint i;
|
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;
|
select->shell = shell;
|
||||||
new->recalc = TRUE;
|
select->recalc = TRUE;
|
||||||
new->hidden = ! gimp_display_shell_get_show_selection (shell);
|
select->hidden = ! gimp_display_shell_get_show_selection (shell);
|
||||||
new->layer_hidden = ! gimp_display_shell_get_show_layer (shell);
|
select->layer_hidden = ! gimp_display_shell_get_show_layer (shell);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
new->points_in[i] = NULL;
|
select->points_in[i] = NULL;
|
||||||
|
|
||||||
return new;
|
shell->selection = select;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_selection_free (Selection *select)
|
gimp_display_shell_selection_free (GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
if (select->timeout_id)
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
g_source_remove (select->timeout_id);
|
|
||||||
|
|
||||||
selection_free_segs (select);
|
if (shell->selection)
|
||||||
|
|
||||||
g_free (select);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_display_shell_selection_pause (Selection *select)
|
|
||||||
{
|
|
||||||
if (select->timeout_id)
|
|
||||||
{
|
{
|
||||||
g_source_remove (select->timeout_id);
|
Selection *select = shell->selection;
|
||||||
select->timeout_id = 0;
|
|
||||||
|
if (select->timeout_id)
|
||||||
|
g_source_remove (select->timeout_id);
|
||||||
|
|
||||||
|
selection_free_segs (select);
|
||||||
|
|
||||||
|
g_free (select);
|
||||||
|
|
||||||
|
shell->selection = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
select->paused++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_selection_resume (Selection *select)
|
gimp_display_shell_selection_control (GimpDisplayShell *shell,
|
||||||
|
GimpSelectionControl control)
|
||||||
{
|
{
|
||||||
if (select->paused == 1)
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
select->timeout_id = g_timeout_add (INITIAL_DELAY,
|
|
||||||
(GSourceFunc) selection_start_marching,
|
|
||||||
select);
|
|
||||||
|
|
||||||
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
|
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;
|
select->recalc = TRUE;
|
||||||
|
|
||||||
@ -157,8 +229,31 @@ gimp_display_shell_selection_start (Selection *select)
|
|||||||
select);
|
select);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gimp_display_shell_selection_invis (Selection *select)
|
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;
|
gint x1, y1, x2, y2;
|
||||||
|
|
||||||
@ -176,13 +271,12 @@ gimp_display_shell_selection_invis (Selection *select)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_display_shell_selection_start (select);
|
selection_start (select);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
void
|
selection_layer_hide (Selection *select)
|
||||||
gimp_display_shell_selection_layer_invis (Selection *select)
|
|
||||||
{
|
{
|
||||||
gint x1, y1;
|
gint x1, y1;
|
||||||
gint x2, y2;
|
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
|
static void
|
||||||
selection_add_point (GdkPoint *points[8],
|
selection_add_point (GdkPoint *points[8],
|
||||||
gint max_npoints[8],
|
gint max_npoints[8],
|
||||||
@ -448,7 +506,6 @@ selection_draw (Selection *select)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
selection_transform_segs (Selection *select,
|
selection_transform_segs (Selection *select,
|
||||||
const BoundSeg *src_segs,
|
const BoundSeg *src_segs,
|
||||||
@ -492,7 +549,6 @@ selection_transform_segs (Selection *select,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
selection_generate_segs (Selection *select)
|
selection_generate_segs (Selection *select)
|
||||||
{
|
{
|
||||||
@ -553,7 +609,6 @@ selection_generate_segs (Selection *select)
|
|||||||
g_free (segs_layer);
|
g_free (segs_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
selection_free_segs (Selection *select)
|
selection_free_segs (Selection *select)
|
||||||
{
|
{
|
||||||
@ -585,7 +640,6 @@ selection_free_segs (Selection *select)
|
|||||||
select->num_segs_layer = 0;
|
select->num_segs_layer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
selection_start_marching (Selection *select)
|
selection_start_marching (Selection *select)
|
||||||
{
|
{
|
||||||
@ -626,7 +680,6 @@ selection_start_marching (Selection *select)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
selection_march_ants (Selection *select)
|
selection_march_ants (Selection *select)
|
||||||
{
|
{
|
||||||
|
@ -20,21 +20,16 @@
|
|||||||
#define __GIMP_DISPLAY_SHELL_SELECTION_H__
|
#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_set_hidden (GimpDisplayShell *shell,
|
||||||
void gimp_display_shell_selection_resume (Selection *select);
|
gboolean hidden);
|
||||||
|
void gimp_display_shell_selection_layer_set_hidden (GimpDisplayShell *shell,
|
||||||
void gimp_display_shell_selection_start (Selection *select);
|
gboolean hidden);
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DISPLAY_SHELL_SELECTION_H__ */
|
#endif /* __GIMP_DISPLAY_SHELL_SELECTION_H__ */
|
||||||
|
@ -226,7 +226,7 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
|||||||
shell->snap_to_canvas = FALSE;
|
shell->snap_to_canvas = FALSE;
|
||||||
shell->snap_to_vectors = FALSE;
|
shell->snap_to_vectors = FALSE;
|
||||||
|
|
||||||
shell->select = NULL;
|
shell->selection = NULL;
|
||||||
|
|
||||||
shell->canvas = NULL;
|
shell->canvas = NULL;
|
||||||
shell->grid_gc = NULL;
|
shell->grid_gc = NULL;
|
||||||
@ -401,11 +401,7 @@ gimp_display_shell_destroy (GtkObject *object)
|
|||||||
|
|
||||||
shell->popup_manager = NULL;
|
shell->popup_manager = NULL;
|
||||||
|
|
||||||
if (shell->select)
|
gimp_display_shell_selection_free (shell);
|
||||||
{
|
|
||||||
gimp_display_shell_selection_free (shell->select);
|
|
||||||
shell->select = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shell->filter_stack)
|
if (shell->filter_stack)
|
||||||
gimp_display_shell_filter_set (shell, NULL);
|
gimp_display_shell_filter_set (shell, NULL);
|
||||||
@ -845,7 +841,7 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||||||
|
|
||||||
shell->canvas = gimp_canvas_new ();
|
shell->canvas = gimp_canvas_new ();
|
||||||
|
|
||||||
shell->select = gimp_display_shell_selection_new (shell);
|
gimp_display_shell_selection_init (shell);
|
||||||
|
|
||||||
/* the horizontal ruler */
|
/* the horizontal ruler */
|
||||||
shell->hrule = gtk_hruler_new ();
|
shell->hrule = gtk_hruler_new ();
|
||||||
@ -1359,12 +1355,6 @@ gimp_display_shell_flush (GimpDisplayShell *shell,
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (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);
|
gimp_display_shell_title_update (shell);
|
||||||
|
|
||||||
if (now)
|
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:
|
* gimp_display_shell_set_highlight:
|
||||||
* @shell: a #GimpDisplayShell
|
* @shell: a #GimpDisplayShell
|
||||||
|
@ -94,7 +94,7 @@ struct _GimpDisplayShell
|
|||||||
gboolean snap_to_canvas; /* should the canvas be snapped to? */
|
gboolean snap_to_canvas; /* should the canvas be snapped to? */
|
||||||
gboolean snap_to_vectors; /* should the active path be snapped */
|
gboolean snap_to_vectors; /* should the active path be snapped */
|
||||||
|
|
||||||
Selection *select; /* Selection object */
|
Selection *selection; /* Selection (marching ants) */
|
||||||
|
|
||||||
GtkWidget *canvas; /* GimpCanvas widget */
|
GtkWidget *canvas; /* GimpCanvas widget */
|
||||||
GdkGC *grid_gc; /* GC for grid drawing */
|
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,
|
GtkWidget * gimp_display_shell_new (GimpDisplay *display,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gdouble scale,
|
gdouble scale,
|
||||||
GimpMenuFactory *menu_factory,
|
GimpMenuFactory *menu_factory,
|
||||||
GimpUIManager *popup_manager);
|
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_scaled (GimpDisplayShell *shell);
|
||||||
void gimp_display_shell_scrolled (GimpDisplayShell *shell);
|
void gimp_display_shell_scrolled (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_display_shell_set_unit (GimpDisplayShell *shell,
|
void gimp_display_shell_set_unit (GimpDisplayShell *shell,
|
||||||
GimpUnit unit);
|
GimpUnit unit);
|
||||||
GimpUnit gimp_display_shell_get_unit (GimpDisplayShell *shell);
|
GimpUnit gimp_display_shell_get_unit (GimpDisplayShell *shell);
|
||||||
|
|
||||||
gboolean gimp_display_shell_snap_coords (GimpDisplayShell *shell,
|
gboolean gimp_display_shell_snap_coords (GimpDisplayShell *shell,
|
||||||
GimpCoords *coords,
|
GimpCoords *coords,
|
||||||
GimpCoords *snapped_coords,
|
GimpCoords *snapped_coords,
|
||||||
gint snap_offset_x,
|
gint snap_offset_x,
|
||||||
gint snap_offset_y,
|
gint snap_offset_y,
|
||||||
gint snap_width,
|
gint snap_width,
|
||||||
gint snap_height);
|
gint snap_height);
|
||||||
|
|
||||||
gboolean gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
gboolean gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
||||||
gint *x1,
|
gint *x1,
|
||||||
gint *y1,
|
gint *y1,
|
||||||
gint *x2,
|
gint *x2,
|
||||||
gint *y2);
|
gint *y2);
|
||||||
|
|
||||||
void gimp_display_shell_expose_area (GimpDisplayShell *shell,
|
void gimp_display_shell_expose_area (GimpDisplayShell *shell,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint w,
|
gint w,
|
||||||
gint h);
|
gint h);
|
||||||
void gimp_display_shell_expose_guide (GimpDisplayShell *shell,
|
void gimp_display_shell_expose_guide (GimpDisplayShell *shell,
|
||||||
GimpGuide *guide);
|
GimpGuide *guide);
|
||||||
void gimp_display_shell_expose_sample_point (GimpDisplayShell *shell,
|
void gimp_display_shell_expose_sample_point (GimpDisplayShell *shell,
|
||||||
GimpSamplePoint *sample_point);
|
GimpSamplePoint *sample_point);
|
||||||
void gimp_display_shell_expose_full (GimpDisplayShell *shell);
|
void gimp_display_shell_expose_full (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_display_shell_flush (GimpDisplayShell *shell,
|
void gimp_display_shell_flush (GimpDisplayShell *shell,
|
||||||
gboolean now);
|
gboolean now);
|
||||||
|
|
||||||
void gimp_display_shell_pause (GimpDisplayShell *shell);
|
void gimp_display_shell_pause (GimpDisplayShell *shell);
|
||||||
void gimp_display_shell_resume (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,
|
void gimp_display_shell_set_highlight (GimpDisplayShell *shell,
|
||||||
GimpSelectionControl control);
|
const GdkRectangle *highlight);
|
||||||
void gimp_display_shell_set_highlight (GimpDisplayShell *shell,
|
void gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
||||||
const GdkRectangle *highlight);
|
GimpDrawable *mask,
|
||||||
void gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
GimpChannelType color);
|
||||||
GimpDrawable *mask,
|
|
||||||
GimpChannelType color);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DISPLAY_SHELL_H__ */
|
#endif /* __GIMP_DISPLAY_SHELL_H__ */
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "display/gimpdisplayshell.h"
|
#include "display/gimpdisplayshell.h"
|
||||||
#include "display/gimpdisplayshell-appearance.h"
|
#include "display/gimpdisplayshell-appearance.h"
|
||||||
#include "display/gimpdisplayshell-draw.h"
|
#include "display/gimpdisplayshell-draw.h"
|
||||||
|
#include "display/gimpdisplayshell-selection.h"
|
||||||
#include "display/gimpdisplayshell-transform.h"
|
#include "display/gimpdisplayshell-transform.h"
|
||||||
|
|
||||||
#include "gimpcoloroptions.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_x = color_tool->sample_point->x;
|
||||||
color_tool->sample_point_y = color_tool->sample_point->y;
|
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);
|
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_x = -1;
|
||||||
color_tool->sample_point_y = -1;
|
color_tool->sample_point_y = -1;
|
||||||
|
|
||||||
gimp_display_shell_selection_visibility (shell,
|
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||||
GIMP_SELECTION_RESUME);
|
|
||||||
return;
|
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);
|
gimp_image_flush (display->image);
|
||||||
|
|
||||||
if (color_tool->sample_point)
|
if (color_tool->sample_point)
|
||||||
@ -793,8 +793,8 @@ gimp_color_tool_start_sample_point (GimpTool *tool,
|
|||||||
|
|
||||||
color_tool = GIMP_COLOR_TOOL (tool);
|
color_tool = GIMP_COLOR_TOOL (tool);
|
||||||
|
|
||||||
gimp_display_shell_selection_visibility (GIMP_DISPLAY_SHELL (display->shell),
|
gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell),
|
||||||
GIMP_SELECTION_PAUSE);
|
GIMP_SELECTION_PAUSE);
|
||||||
|
|
||||||
tool->display = display;
|
tool->display = display;
|
||||||
gimp_tool_control_activate (tool->control);
|
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));
|
tool_manager_push_tool (display->image->gimp, GIMP_TOOL (edit_select));
|
||||||
|
|
||||||
/* pause the current selection */
|
/* 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 */
|
/* initialize the statusbar display */
|
||||||
gimp_tool_push_status_coords (GIMP_TOOL (edit_select), 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;
|
GimpItem *active_item;
|
||||||
|
|
||||||
/* resume the current selection */
|
/* 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);
|
gimp_tool_pop_status (tool, display);
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "display/gimpdisplayshell.h"
|
#include "display/gimpdisplayshell.h"
|
||||||
#include "display/gimpdisplayshell-appearance.h"
|
#include "display/gimpdisplayshell-appearance.h"
|
||||||
#include "display/gimpdisplayshell-draw.h"
|
#include "display/gimpdisplayshell-draw.h"
|
||||||
|
#include "display/gimpdisplayshell-selection.h"
|
||||||
#include "display/gimpdisplayshell-transform.h"
|
#include "display/gimpdisplayshell-transform.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.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_set_scroll_lock (tool->control, TRUE);
|
||||||
gimp_tool_control_activate (tool->control);
|
gimp_tool_control_activate (tool->control);
|
||||||
|
|
||||||
gimp_display_shell_selection_visibility (shell,
|
gimp_display_shell_selection_control (shell,
|
||||||
GIMP_SELECTION_PAUSE);
|
GIMP_SELECTION_PAUSE);
|
||||||
|
|
||||||
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
|
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_position = -1;
|
||||||
move->guide_orientation = GIMP_ORIENTATION_UNKNOWN;
|
move->guide_orientation = GIMP_ORIENTATION_UNKNOWN;
|
||||||
|
|
||||||
gimp_display_shell_selection_visibility (shell,
|
gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME);
|
||||||
GIMP_SELECTION_RESUME);
|
|
||||||
return;
|
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);
|
gimp_image_flush (display->image);
|
||||||
|
|
||||||
if (move->guide)
|
if (move->guide)
|
||||||
@ -799,8 +799,8 @@ gimp_move_tool_start_guide (GimpMoveTool *move,
|
|||||||
{
|
{
|
||||||
GimpTool *tool = GIMP_TOOL (move);
|
GimpTool *tool = GIMP_TOOL (move);
|
||||||
|
|
||||||
gimp_display_shell_selection_visibility (GIMP_DISPLAY_SHELL (display->shell),
|
gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell),
|
||||||
GIMP_SELECTION_PAUSE);
|
GIMP_SELECTION_PAUSE);
|
||||||
|
|
||||||
tool->display = display;
|
tool->display = display;
|
||||||
gimp_tool_control_activate (tool->control);
|
gimp_tool_control_activate (tool->control);
|
||||||
|
Reference in New Issue
Block a user