2008-05-11 00:21:37 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* 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
|
2008-05-11 00:21:37 +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
|
2008-05-11 00:21:37 +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/>.
|
2008-05-11 00:21:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "actions-types.h"
|
|
|
|
|
2009-09-27 00:17:27 +08:00
|
|
|
#include "config/gimpdisplayconfig.h"
|
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
2008-05-17 00:06:42 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
|
2008-05-11 00:21:37 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2008-05-17 00:06:42 +08:00
|
|
|
#include "widgets/gimpsessioninfo.h"
|
2010-02-20 23:55:35 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2008-05-11 00:21:37 +08:00
|
|
|
|
|
|
|
#include "display/gimpdisplay.h"
|
2009-09-27 00:17:27 +08:00
|
|
|
#include "display/gimpdisplayshell.h"
|
2008-05-11 00:21:37 +08:00
|
|
|
|
|
|
|
#include "dialogs/dialogs.h"
|
|
|
|
|
2009-09-27 00:17:27 +08:00
|
|
|
#include "actions.h"
|
2008-05-11 00:21:37 +08:00
|
|
|
#include "windows-commands.h"
|
|
|
|
|
|
|
|
|
2010-02-21 05:52:21 +08:00
|
|
|
void
|
|
|
|
windows_hide_docks_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2010-02-24 03:21:08 +08:00
|
|
|
Gimp *gimp = NULL;
|
|
|
|
return_if_no_gimp (gimp, data);
|
|
|
|
|
|
|
|
if (GIMP_GUI_CONFIG (gimp->config)->hide_docks == active)
|
|
|
|
return;
|
2010-02-21 05:52:21 +08:00
|
|
|
|
2010-02-24 03:21:08 +08:00
|
|
|
g_object_set (gimp->config,
|
|
|
|
"hide-docks", active,
|
|
|
|
NULL);
|
2010-02-21 05:52:21 +08:00
|
|
|
}
|
|
|
|
|
2009-09-27 00:17:27 +08:00
|
|
|
void
|
|
|
|
windows_use_single_window_mode_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
|
|
|
Gimp *gimp = NULL;
|
|
|
|
return_if_no_gimp (gimp, data);
|
|
|
|
|
|
|
|
if (GIMP_GUI_CONFIG (gimp->config)->single_window_mode == active)
|
|
|
|
return;
|
|
|
|
|
|
|
|
g_object_set (gimp->config,
|
|
|
|
"single-window-mode", active,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2008-05-11 00:21:37 +08:00
|
|
|
void
|
|
|
|
windows_show_display_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2009-09-30 02:32:26 +08:00
|
|
|
GimpDisplay *display = g_object_get_data (G_OBJECT (action), "display");
|
2008-05-11 00:21:37 +08:00
|
|
|
|
2009-10-05 01:56:39 +08:00
|
|
|
gimp_display_shell_present (gimp_display_get_shell (display));
|
2008-05-11 00:21:37 +08:00
|
|
|
}
|
|
|
|
|
2008-05-11 16:15:00 +08:00
|
|
|
void
|
|
|
|
windows_show_dock_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2009-09-26 19:11:42 +08:00
|
|
|
GtkWindow *dock_window = g_object_get_data (G_OBJECT (action), "dock-window");
|
2008-05-11 16:15:00 +08:00
|
|
|
|
2009-09-26 19:11:42 +08:00
|
|
|
gtk_window_present (dock_window);
|
2008-05-11 16:15:00 +08:00
|
|
|
}
|
|
|
|
|
2008-05-17 00:06:42 +08:00
|
|
|
void
|
|
|
|
windows_open_recent_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GimpSessionInfo *info = g_object_get_data (G_OBJECT (action), "info");
|
|
|
|
|
|
|
|
g_object_ref (info);
|
|
|
|
gimp_container_remove (global_recent_docks, GIMP_OBJECT (info));
|
|
|
|
|
2010-03-01 06:20:57 +08:00
|
|
|
gimp_dialog_factory_add_session_info (gimp_dialog_factory_get_singleton (), info);
|
2008-05-17 00:06:42 +08:00
|
|
|
|
2010-03-01 06:20:57 +08:00
|
|
|
gimp_session_info_restore (info, gimp_dialog_factory_get_singleton ());
|
2008-05-17 00:06:42 +08:00
|
|
|
gimp_session_info_clear_info (info);
|
|
|
|
}
|