2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-06-26 20:09:43 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-06-26 20:09:43 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-06-26 20:09:43 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-06-26 20:09:43 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2001-06-26 20:09:43 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2007-03-09 21:00:01 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "actions-types.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2010-02-02 04:55:18 +08:00
|
|
|
#include "config/gimpdisplayoptions.h"
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
2001-10-17 19:33:43 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpcontext.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "core/gimpimage.h"
|
2009-08-25 04:38:16 +08:00
|
|
|
#include "core/gimpgrouplayer.h"
|
2008-10-12 03:17:42 +08:00
|
|
|
#include "core/gimpprojection.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-10-13 20:52:30 +08:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-11-01 05:20:09 +08:00
|
|
|
#include "display/gimpdisplayshell.h"
|
2003-03-12 00:49:36 +08:00
|
|
|
#include "display/gimpdisplayshell-appearance.h"
|
2003-11-22 06:52:36 +08:00
|
|
|
#include "display/gimpdisplayshell-filter-dialog.h"
|
2001-11-02 17:31:21 +08:00
|
|
|
#include "display/gimpdisplayshell-scale.h"
|
2008-08-16 19:51:10 +08:00
|
|
|
#include "display/gimpdisplayshell-scale-dialog.h"
|
2008-08-10 15:40:03 +08:00
|
|
|
#include "display/gimpdisplayshell-scroll.h"
|
2009-09-23 20:52:33 +08:00
|
|
|
#include "display/gimpimagewindow.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
#include "widgets/gimpactiongroup.h"
|
2004-09-24 04:41:40 +08:00
|
|
|
#include "widgets/gimpcolordialog.h"
|
2004-02-01 04:23:53 +08:00
|
|
|
#include "widgets/gimpdock.h"
|
2002-03-20 23:32:35 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2004-04-29 20:52:29 +08:00
|
|
|
#include "widgets/gimpuimanager.h"
|
2002-03-20 23:32:35 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs/dialogs.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
|
2004-05-03 22:03:51 +08:00
|
|
|
#include "actions.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "view-commands.h"
|
|
|
|
|
2004-06-23 00:31:27 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-06-23 00:31:27 +08:00
|
|
|
|
|
|
|
#define SET_ACTIVE(manager,action_name,active) \
|
2004-04-29 20:52:29 +08:00
|
|
|
{ GimpActionGroup *group = \
|
2004-06-23 00:31:27 +08:00
|
|
|
gimp_ui_manager_get_action_group (manager, "view"); \
|
2004-04-29 20:52:29 +08:00
|
|
|
gimp_action_group_set_action_active (group, action_name, active); }
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
#define IS_ACTIVE_DISPLAY(display) \
|
|
|
|
((display) == \
|
2009-10-05 02:05:28 +08:00
|
|
|
gimp_context_get_display (gimp_get_user_context ((display)->gimp)))
|
2003-11-11 21:09:50 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-09-24 04:41:40 +08:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2005-01-29 03:48:31 +08:00
|
|
|
static void view_padding_color_dialog_update (GimpColorDialog *dialog,
|
|
|
|
const GimpRGB *color,
|
|
|
|
GimpColorDialogState state,
|
|
|
|
GimpDisplayShell *shell);
|
2004-09-24 04:41:40 +08:00
|
|
|
|
|
|
|
|
2004-05-03 22:46:29 +08:00
|
|
|
/* public functions */
|
|
|
|
|
2004-05-05 19:40:20 +08:00
|
|
|
void
|
2005-09-25 03:34:46 +08:00
|
|
|
view_new_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2004-05-05 19:40:20 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-06-02 06:04:20 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-05-05 19:40:20 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2004-06-02 06:04:20 +08:00
|
|
|
|
2009-10-05 02:05:28 +08:00
|
|
|
gimp_create_display (display->gimp,
|
2009-10-07 01:20:44 +08:00
|
|
|
gimp_display_get_image (display),
|
2005-09-26 01:03:03 +08:00
|
|
|
shell->unit, gimp_zoom_model_get_factor (shell->zoom));
|
2004-05-05 19:40:20 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-10-07 08:35:04 +08:00
|
|
|
view_zoom_fit_in_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
gimp_display_shell_scale_fit_in (gimp_display_get_shell (display));
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-12-16 10:06:15 +08:00
|
|
|
view_zoom_fill_cmd_callback (GtkAction *action,
|
2004-10-07 08:35:04 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
gimp_display_shell_scale_fill (gimp_display_get_shell (display));
|
2007-02-07 16:13:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_zoom_revert_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GimpDisplay *display;
|
|
|
|
return_if_no_display (display, data);
|
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
gimp_display_shell_scale_revert (gimp_display_get_shell (display));
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2001-11-02 17:31:21 +08:00
|
|
|
void
|
2004-10-07 08:35:04 +08:00
|
|
|
view_zoom_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
2004-06-20 20:09:03 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-10-07 08:35:04 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-06-20 20:09:03 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2004-06-20 20:09:03 +08:00
|
|
|
|
2004-10-07 08:35:04 +08:00
|
|
|
switch ((GimpActionSelectType) value)
|
|
|
|
{
|
|
|
|
case GIMP_ACTION_SELECT_FIRST:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_OUT_MAX,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ACTION_SELECT_LAST:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_IN_MAX,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ACTION_SELECT_PREVIOUS:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_OUT,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ACTION_SELECT_NEXT:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_IN,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ACTION_SELECT_SKIP_PREVIOUS:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_OUT_MORE,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ACTION_SELECT_SKIP_NEXT:
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_IN_MORE,
|
|
|
|
0.0,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2004-10-07 08:35:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2005-09-26 01:03:03 +08:00
|
|
|
{
|
|
|
|
gdouble scale = gimp_zoom_model_get_factor (shell->zoom);
|
|
|
|
|
|
|
|
scale = action_select_value ((GimpActionSelectType) value,
|
|
|
|
scale,
|
2008-06-01 04:05:03 +08:00
|
|
|
0.0, 512.0, 1.0,
|
2006-10-16 00:51:30 +08:00
|
|
|
1.0 / 8.0, 1.0, 16.0, 0.0,
|
2005-09-26 01:03:03 +08:00
|
|
|
FALSE);
|
|
|
|
|
|
|
|
/* min = 1.0 / 256, max = 256.0 */
|
|
|
|
/* scale = min * (max / min)**(i/n), i = 0..n */
|
|
|
|
scale = pow (65536.0, scale / 512.0) / 256.0;
|
|
|
|
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_TO,
|
|
|
|
scale,
|
|
|
|
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
2005-09-26 01:03:03 +08:00
|
|
|
break;
|
|
|
|
}
|
2004-10-07 08:35:04 +08:00
|
|
|
}
|
2001-11-02 17:31:21 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-10-07 08:35:04 +08:00
|
|
|
view_zoom_explicit_cmd_callback (GtkAction *action,
|
|
|
|
GtkAction *current,
|
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-03-13 01:18:25 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gint value;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-03-13 01:18:25 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
|
2003-04-04 16:32:51 +08:00
|
|
|
|
2004-06-07 22:04:50 +08:00
|
|
|
if (value != 0 /* not Other... */)
|
2004-04-29 20:52:29 +08:00
|
|
|
{
|
2005-09-26 01:03:03 +08:00
|
|
|
if (fabs (value - gimp_zoom_model_get_factor (shell->zoom)) > 0.0001)
|
2008-10-02 22:53:35 +08:00
|
|
|
gimp_display_shell_scale (shell,
|
|
|
|
GIMP_ZOOM_TO,
|
|
|
|
(gdouble) value / 10000,
|
2008-11-15 18:24:56 +08:00
|
|
|
GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS);
|
2004-04-29 20:52:29 +08:00
|
|
|
}
|
2003-04-04 16:32:51 +08:00
|
|
|
}
|
|
|
|
|
2004-06-07 22:04:50 +08:00
|
|
|
void
|
|
|
|
view_zoom_other_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-06-07 22:04:50 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-06-07 22:04:50 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2004-06-07 22:04:50 +08:00
|
|
|
|
|
|
|
/* check if we are activated by the user or from
|
|
|
|
* view_actions_set_zoom()
|
|
|
|
*/
|
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) &&
|
2005-09-26 01:03:03 +08:00
|
|
|
shell->other_scale != gimp_zoom_model_get_factor (shell->zoom))
|
2004-06-07 22:04:50 +08:00
|
|
|
{
|
|
|
|
gimp_display_shell_scale_dialog (shell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_dot_for_dot_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-01-11 01:55:53 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-01-11 01:55:53 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
if (active != shell->dot_for_dot)
|
2003-01-11 01:55:53 +08:00
|
|
|
{
|
2009-09-30 02:32:26 +08:00
|
|
|
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
2009-09-23 22:58:03 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
gimp_display_shell_scale_set_dot_for_dot (shell, active);
|
2003-01-11 01:55:53 +08:00
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
if (window)
|
2009-09-30 03:44:43 +08:00
|
|
|
SET_ACTIVE (gimp_image_window_get_ui_manager (window),
|
2009-09-30 02:32:26 +08:00
|
|
|
"view-dot-for-dot", shell->dot_for_dot);
|
2003-11-11 21:09:50 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
if (IS_ACTIVE_DISPLAY (display))
|
2004-06-23 00:31:27 +08:00
|
|
|
SET_ACTIVE (shell->popup_manager, "view-dot-for-dot",
|
2004-04-29 20:52:29 +08:00
|
|
|
shell->dot_for_dot);
|
2003-01-11 01:55:53 +08:00
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2004-07-07 09:15:41 +08:00
|
|
|
void
|
|
|
|
view_scroll_horizontal_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-07-07 09:15:41 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
gdouble offset;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-07-07 09:15:41 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2004-07-07 09:15:41 +08:00
|
|
|
|
|
|
|
offset = action_select_value ((GimpActionSelectType) value,
|
2009-10-09 17:19:14 +08:00
|
|
|
gtk_adjustment_get_value (shell->hsbdata),
|
|
|
|
gtk_adjustment_get_lower (shell->hsbdata),
|
|
|
|
gtk_adjustment_get_upper (shell->hsbdata) -
|
|
|
|
gtk_adjustment_get_page_size (shell->hsbdata),
|
|
|
|
gtk_adjustment_get_lower (shell->hsbdata),
|
2006-10-16 00:51:30 +08:00
|
|
|
1,
|
2009-10-09 17:19:14 +08:00
|
|
|
gtk_adjustment_get_step_increment (shell->hsbdata),
|
|
|
|
gtk_adjustment_get_page_increment (shell->hsbdata),
|
2006-10-16 00:51:30 +08:00
|
|
|
0,
|
2004-07-07 09:15:41 +08:00
|
|
|
FALSE);
|
2009-10-09 17:19:14 +08:00
|
|
|
|
2004-07-07 09:15:41 +08:00
|
|
|
gtk_adjustment_set_value (shell->hsbdata, offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_scroll_vertical_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-07-07 09:15:41 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
gdouble offset;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-07-07 09:15:41 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2004-07-07 09:15:41 +08:00
|
|
|
|
|
|
|
offset = action_select_value ((GimpActionSelectType) value,
|
2009-10-09 17:19:14 +08:00
|
|
|
gtk_adjustment_get_value (shell->vsbdata),
|
|
|
|
gtk_adjustment_get_lower (shell->vsbdata),
|
|
|
|
gtk_adjustment_get_upper (shell->vsbdata) -
|
|
|
|
gtk_adjustment_get_page_size (shell->vsbdata),
|
|
|
|
gtk_adjustment_get_lower (shell->vsbdata),
|
2006-10-16 00:51:30 +08:00
|
|
|
1,
|
2009-10-09 17:19:14 +08:00
|
|
|
gtk_adjustment_get_step_increment (shell->vsbdata),
|
|
|
|
gtk_adjustment_get_page_increment (shell->vsbdata),
|
2006-10-16 00:51:30 +08:00
|
|
|
0,
|
2004-07-07 09:15:41 +08:00
|
|
|
FALSE);
|
2009-10-09 17:19:14 +08:00
|
|
|
|
2004-07-07 09:15:41 +08:00
|
|
|
gtk_adjustment_set_value (shell->vsbdata, offset);
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_navigation_window_cmd_callback (GtkAction *action,
|
2002-03-20 23:32:35 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2001-11-01 05:20:09 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2010-02-20 16:26:57 +08:00
|
|
|
gimp_dialog_factory_dialog_raise (global_dialog_factory,
|
2009-10-06 01:58:03 +08:00
|
|
|
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
2002-05-08 00:23:14 +08:00
|
|
|
"gimp-navigation-view", -1);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2002-03-20 23:32:35 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_display_filters_cmd_callback (GtkAction *action,
|
2002-03-20 23:32:35 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2002-03-20 23:32:35 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2002-03-20 23:32:35 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2002-03-20 23:32:35 +08:00
|
|
|
|
2003-11-22 06:52:36 +08:00
|
|
|
if (! shell->filters_dialog)
|
|
|
|
{
|
|
|
|
shell->filters_dialog = gimp_display_shell_filter_dialog_new (shell);
|
|
|
|
|
|
|
|
g_signal_connect (shell->filters_dialog, "destroy",
|
|
|
|
G_CALLBACK (gtk_widget_destroyed),
|
|
|
|
&shell->filters_dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (shell->filters_dialog));
|
2002-03-20 23:32:35 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_selection_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2001-11-11 07:03:22 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2001-11-11 07:03:22 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_selection (shell, active);
|
2001-11-16 23:08:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_layer_boundary_cmd_callback (GtkAction *action,
|
2001-11-16 23:08:59 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2001-11-16 23:08:59 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-11-16 23:08:59 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2001-11-16 23:08:59 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_layer (shell, active);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2002-12-14 22:13:54 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_menubar_cmd_callback (GtkAction *action,
|
2002-12-14 22:13:54 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2002-12-14 22:13:54 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2002-12-14 22:13:54 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2002-12-14 22:13:54 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_menubar (shell, active);
|
2002-12-14 22:13:54 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_rulers_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-03-12 00:49:36 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_rulers (shell, active);
|
2003-03-12 00:49:36 +08:00
|
|
|
}
|
2002-12-11 00:38:16 +08:00
|
|
|
|
2003-03-12 00:49:36 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_scrollbars_cmd_callback (GtkAction *action,
|
2003-03-12 00:49:36 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-03-12 00:49:36 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2002-12-14 22:13:54 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-03-12 00:49:36 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_scrollbars (shell, active);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_statusbar_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2001-11-01 05:20:09 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_statusbar (shell, active);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_toggle_guides_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-03-20 19:31:33 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-03-20 19:31:33 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_show_guides (shell, active);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2005-03-05 00:34:59 +08:00
|
|
|
void
|
2005-03-05 08:10:40 +08:00
|
|
|
view_toggle_grid_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2005-03-05 00:34:59 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2005-03-05 00:34:59 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2005-03-05 00:34:59 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2005-03-05 00:34:59 +08:00
|
|
|
|
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
2005-03-05 08:10:40 +08:00
|
|
|
gimp_display_shell_set_show_grid (shell, active);
|
2005-03-05 00:34:59 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2005-03-05 08:10:40 +08:00
|
|
|
view_toggle_sample_points_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-01-11 01:55:53 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2002-12-14 22:13:54 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2003-01-11 01:55:53 +08:00
|
|
|
|
2005-03-05 08:10:40 +08:00
|
|
|
gimp_display_shell_set_show_sample_points (shell, active);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2003-06-24 03:34:48 +08:00
|
|
|
void
|
2005-01-04 00:55:24 +08:00
|
|
|
view_snap_to_guides_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-06-24 03:34:48 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2005-01-04 00:55:24 +08:00
|
|
|
gimp_display_shell_set_snap_to_guides (shell, active);
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_snap_to_grid_cmd_callback (GtkAction *action,
|
2003-06-24 03:34:48 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-06-24 03:34:48 +08:00
|
|
|
GimpDisplayShell *shell;
|
2004-04-29 20:52:29 +08:00
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2003-11-11 21:09:50 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
gimp_display_shell_set_snap_to_grid (shell, active);
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
|
2005-01-04 00:19:10 +08:00
|
|
|
void
|
|
|
|
view_snap_to_canvas_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2005-01-04 00:19:10 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2005-01-04 00:19:10 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2005-01-04 00:19:10 +08:00
|
|
|
|
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_snap_to_canvas (shell, active);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_snap_to_vectors_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2005-01-04 00:19:10 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
gboolean active;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2005-01-04 00:19:10 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2005-01-04 00:19:10 +08:00
|
|
|
|
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
|
|
|
gimp_display_shell_set_snap_to_vectors (shell, active);
|
|
|
|
}
|
|
|
|
|
2004-06-23 00:31:27 +08:00
|
|
|
void
|
|
|
|
view_padding_color_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2009-09-30 02:32:26 +08:00
|
|
|
GimpImageWindow *window;
|
2004-06-23 00:31:27 +08:00
|
|
|
GimpDisplayShell *shell;
|
|
|
|
GimpDisplayOptions *options;
|
|
|
|
gboolean fullscreen;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-06-23 00:31:27 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2009-09-30 02:32:26 +08:00
|
|
|
window = gimp_display_shell_get_window (shell);
|
2009-09-23 20:52:33 +08:00
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
if (window)
|
|
|
|
fullscreen = gimp_image_window_get_fullscreen (window);
|
|
|
|
else
|
|
|
|
fullscreen = FALSE;
|
2004-06-23 00:31:27 +08:00
|
|
|
|
|
|
|
if (fullscreen)
|
|
|
|
options = shell->fullscreen_options;
|
|
|
|
else
|
|
|
|
options = shell->options;
|
|
|
|
|
|
|
|
switch ((GimpCanvasPaddingMode) value)
|
|
|
|
{
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_DEFAULT:
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK:
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_DARK_CHECK:
|
2004-09-13 23:15:23 +08:00
|
|
|
g_object_set_data (G_OBJECT (shell), "padding-color-dialog", NULL);
|
2004-06-23 00:31:27 +08:00
|
|
|
|
|
|
|
options->padding_mode_set = TRUE;
|
|
|
|
|
|
|
|
gimp_display_shell_set_padding (shell, (GimpCanvasPaddingMode) value,
|
|
|
|
&options->padding_color);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_CUSTOM:
|
|
|
|
{
|
2004-09-24 04:41:40 +08:00
|
|
|
GtkWidget *color_dialog;
|
2004-06-23 00:31:27 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
color_dialog = g_object_get_data (G_OBJECT (shell),
|
2004-09-24 04:41:40 +08:00
|
|
|
"padding-color-dialog");
|
2004-06-23 00:31:27 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
if (! color_dialog)
|
2004-06-23 00:31:27 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image = gimp_display_get_image (display);
|
2009-10-06 01:58:03 +08:00
|
|
|
GimpDisplayShell *shell = gimp_display_get_shell (display);
|
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
color_dialog =
|
2009-10-07 01:20:44 +08:00
|
|
|
gimp_color_dialog_new (GIMP_VIEWABLE (image),
|
2006-09-01 19:26:54 +08:00
|
|
|
action_data_get_context (data),
|
|
|
|
_("Set Canvas Padding Color"),
|
|
|
|
GTK_STOCK_SELECT_COLOR,
|
|
|
|
_("Set Custom Canvas Padding Color"),
|
2009-10-06 01:58:03 +08:00
|
|
|
GTK_WIDGET (shell),
|
2006-09-01 19:26:54 +08:00
|
|
|
NULL, NULL,
|
|
|
|
&options->padding_color,
|
|
|
|
FALSE, FALSE);
|
2004-09-24 04:41:40 +08:00
|
|
|
|
|
|
|
g_signal_connect (color_dialog, "update",
|
|
|
|
G_CALLBACK (view_padding_color_dialog_update),
|
2009-10-06 01:58:03 +08:00
|
|
|
shell);
|
2004-09-24 04:41:40 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (shell), "padding-color-dialog",
|
|
|
|
color_dialog,
|
2004-09-24 04:41:40 +08:00
|
|
|
(GDestroyNotify) gtk_widget_destroy);
|
2004-06-23 00:31:27 +08:00
|
|
|
}
|
|
|
|
|
2004-09-24 04:41:40 +08:00
|
|
|
gtk_window_present (GTK_WINDOW (color_dialog));
|
2004-06-23 00:31:27 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_RESET:
|
2004-09-13 23:15:23 +08:00
|
|
|
g_object_set_data (G_OBJECT (shell), "padding-color-dialog", NULL);
|
2004-06-23 00:31:27 +08:00
|
|
|
|
|
|
|
{
|
|
|
|
GimpDisplayOptions *default_options;
|
|
|
|
|
|
|
|
options->padding_mode_set = FALSE;
|
|
|
|
|
|
|
|
if (fullscreen)
|
2008-03-19 05:22:21 +08:00
|
|
|
default_options = display->config->default_fullscreen_view;
|
2004-06-23 00:31:27 +08:00
|
|
|
else
|
2008-03-19 05:22:21 +08:00
|
|
|
default_options = display->config->default_view;
|
2004-06-23 00:31:27 +08:00
|
|
|
|
|
|
|
gimp_display_shell_set_padding (shell,
|
|
|
|
default_options->padding_mode,
|
|
|
|
&default_options->padding_color);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_shrink_wrap_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2008-08-10 15:40:03 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2008-08-10 15:40:03 +08:00
|
|
|
|
|
|
|
gimp_display_shell_scale_shrink_wrap (shell,
|
2008-03-23 23:16:44 +08:00
|
|
|
FALSE);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
2003-11-10 08:24:33 +08:00
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
view_fullscreen_cmd_callback (GtkAction *action,
|
2004-10-07 18:12:26 +08:00
|
|
|
gpointer data)
|
2003-11-10 08:24:33 +08:00
|
|
|
{
|
2009-09-30 02:32:26 +08:00
|
|
|
GimpDisplay *display;
|
|
|
|
GimpDisplayShell *shell;
|
|
|
|
GimpImageWindow *window;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-11-10 08:24:33 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2009-09-30 02:32:26 +08:00
|
|
|
window = gimp_display_shell_get_window (shell);
|
2003-11-10 08:24:33 +08:00
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
if (window)
|
|
|
|
{
|
|
|
|
gboolean active;
|
|
|
|
|
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2004-04-29 20:52:29 +08:00
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
gimp_image_window_set_fullscreen (window, active);
|
|
|
|
}
|
2003-11-10 08:24:33 +08:00
|
|
|
}
|
|
|
|
|
2008-10-12 03:17:42 +08:00
|
|
|
void
|
|
|
|
view_use_gegl_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GimpImage *image;
|
|
|
|
GimpDisplay *display;
|
|
|
|
GimpDisplayShell *shell;
|
2009-08-25 04:38:16 +08:00
|
|
|
GList *layers;
|
|
|
|
GList *list;
|
2008-10-13 03:01:22 +08:00
|
|
|
gboolean active;
|
2008-10-12 03:17:42 +08:00
|
|
|
return_if_no_image (image, data);
|
|
|
|
return_if_no_display (display, data);
|
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
shell = gimp_display_get_shell (display);
|
2008-10-12 03:17:42 +08:00
|
|
|
|
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
gimp_image_get_projection (image)->use_gegl = active;
|
2009-08-25 04:38:16 +08:00
|
|
|
|
|
|
|
layers = gimp_image_get_layer_list (image);
|
|
|
|
|
|
|
|
for (list = layers; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpLayer *layer = list->data;
|
|
|
|
|
|
|
|
if (GIMP_IS_GROUP_LAYER (layer))
|
|
|
|
GIMP_GROUP_LAYER (layer)->projection->use_gegl = active;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (layers);
|
|
|
|
|
2009-09-03 07:03:29 +08:00
|
|
|
gimp_image_invalidate (image, 0, 0,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
2008-10-13 03:01:22 +08:00
|
|
|
gimp_image_flush (image);
|
2008-10-12 03:17:42 +08:00
|
|
|
}
|
|
|
|
|
2004-09-24 04:41:40 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static void
|
|
|
|
view_padding_color_dialog_update (GimpColorDialog *dialog,
|
|
|
|
const GimpRGB *color,
|
|
|
|
GimpColorDialogState state,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2009-09-30 02:32:26 +08:00
|
|
|
GimpImageWindow *window;
|
2004-09-24 04:41:40 +08:00
|
|
|
GimpDisplayOptions *options;
|
|
|
|
gboolean fullscreen;
|
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
window = gimp_display_shell_get_window (shell);
|
2009-09-23 20:52:33 +08:00
|
|
|
|
2009-09-30 02:32:26 +08:00
|
|
|
if (window)
|
|
|
|
fullscreen = gimp_image_window_get_fullscreen (window);
|
|
|
|
else
|
|
|
|
fullscreen = FALSE;
|
2004-09-24 04:41:40 +08:00
|
|
|
|
|
|
|
if (fullscreen)
|
|
|
|
options = shell->fullscreen_options;
|
|
|
|
else
|
|
|
|
options = shell->options;
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GIMP_COLOR_DIALOG_OK:
|
|
|
|
options->padding_mode_set = TRUE;
|
|
|
|
|
|
|
|
gimp_display_shell_set_padding (shell, GIMP_CANVAS_PADDING_MODE_CUSTOM,
|
|
|
|
color);
|
|
|
|
/* fallthru */
|
|
|
|
|
|
|
|
case GIMP_COLOR_DIALOG_CANCEL:
|
|
|
|
g_object_set_data (G_OBJECT (shell), "padding-color-dialog", NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|