2006-12-09 13:33:38 -08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-04-14 08:21:45 -07:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
|
*
|
2009-01-17 14:28:01 -08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-04-14 08:21:45 -07:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 14:28:01 -08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-04-14 08:21:45 -07: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
|
2018-07-11 14:47:19 -07:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-04-14 08:21:45 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
2013-11-01 14:28:18 -07:00
|
|
|
#include <gegl.h>
|
2001-04-14 08:21:45 -07:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
2003-11-09 16:24:33 -08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
2004-04-20 06:25:55 -07:00
|
|
|
#include "actions-types.h"
|
2001-04-14 08:21:45 -07:00
|
|
|
|
2011-07-03 11:55:03 -07:00
|
|
|
#include "core/gimp.h"
|
|
|
|
|
|
2001-04-14 09:37:28 -07:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2014-05-01 18:01:23 -07:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2012-01-30 14:33:21 -08:00
|
|
|
#include "widgets/gimpwindowstrategy.h"
|
2011-07-03 11:55:03 -07:00
|
|
|
|
2004-05-03 07:46:29 -07:00
|
|
|
#include "actions.h"
|
|
|
|
|
#include "dialogs-commands.h"
|
2004-04-29 05:52:29 -07:00
|
|
|
|
|
|
|
|
|
2003-06-06 05:16:13 -07:00
|
|
|
/* public functions */
|
|
|
|
|
|
2001-04-17 09:00:27 -07:00
|
|
|
void
|
2004-04-29 05:52:29 -07:00
|
|
|
dialogs_create_toplevel_cmd_callback (GtkAction *action,
|
|
|
|
|
const gchar *value,
|
2006-04-12 05:49:29 -07:00
|
|
|
gpointer data)
|
2001-04-17 09:00:27 -07:00
|
|
|
{
|
2004-04-29 05:52:29 -07:00
|
|
|
GtkWidget *widget;
|
|
|
|
|
return_if_no_widget (widget, data);
|
2001-06-29 12:25:03 -07:00
|
|
|
|
2004-04-29 05:52:29 -07:00
|
|
|
if (value)
|
2010-02-28 14:20:57 -08:00
|
|
|
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
|
2004-04-29 05:52:29 -07:00
|
|
|
gtk_widget_get_screen (widget),
|
2014-05-01 18:01:23 -07:00
|
|
|
gimp_widget_get_monitor (widget),
|
2010-05-16 03:19:18 -07:00
|
|
|
NULL /*ui_manager*/,
|
2004-08-31 15:41:15 -07:00
|
|
|
value, -1, TRUE);
|
2001-04-17 09:00:27 -07:00
|
|
|
}
|
|
|
|
|
|
2001-07-15 07:32:44 -07:00
|
|
|
void
|
2004-04-29 05:52:29 -07:00
|
|
|
dialogs_create_dockable_cmd_callback (GtkAction *action,
|
|
|
|
|
const gchar *value,
|
2006-04-12 05:49:29 -07:00
|
|
|
gpointer data)
|
2001-07-15 07:32:44 -07:00
|
|
|
{
|
2011-07-03 11:55:03 -07:00
|
|
|
Gimp *gimp;
|
2004-04-29 05:52:29 -07:00
|
|
|
GtkWidget *widget;
|
2011-07-03 11:55:03 -07:00
|
|
|
return_if_no_gimp (gimp, data);
|
2004-04-29 05:52:29 -07:00
|
|
|
return_if_no_widget (widget, data);
|
2003-09-30 08:48:14 -07:00
|
|
|
|
2004-04-29 05:52:29 -07:00
|
|
|
if (value)
|
2012-01-30 13:59:09 -08:00
|
|
|
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
|
|
|
|
|
gimp,
|
|
|
|
|
gimp_dialog_factory_get_singleton (),
|
|
|
|
|
gtk_widget_get_screen (widget),
|
2014-05-01 18:01:23 -07:00
|
|
|
gimp_widget_get_monitor (widget),
|
2012-01-30 13:59:09 -08:00
|
|
|
value);
|
2001-07-15 07:32:44 -07:00
|
|
|
}
|