2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-07-12 19:41:19 +08:00
|
|
|
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (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
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
2006-02-07 20:47:50 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2006-02-07 19:07:47 +08:00
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
#include "core-types.h"
|
|
|
|
|
|
|
|
#include "gimp.h"
|
|
|
|
#include "gimp-gui.h"
|
|
|
|
#include "gimpcontainer.h"
|
|
|
|
#include "gimpcontext.h"
|
|
|
|
#include "gimpimage.h"
|
2004-08-11 02:47:21 +08:00
|
|
|
#include "gimpprogress.h"
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2006-02-07 19:07:47 +08:00
|
|
|
#include "about.h"
|
2004-12-25 03:11:30 +08:00
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_gui_init (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2006-09-10 00:36:15 +08:00
|
|
|
gimp->gui.ungrab = NULL;
|
2005-03-25 00:08:04 +08:00
|
|
|
gimp->gui.threads_enter = NULL;
|
|
|
|
gimp->gui.threads_leave = NULL;
|
|
|
|
gimp->gui.set_busy = NULL;
|
|
|
|
gimp->gui.unset_busy = NULL;
|
2006-08-09 02:18:40 +08:00
|
|
|
gimp->gui.show_message = NULL;
|
2005-03-25 00:08:04 +08:00
|
|
|
gimp->gui.help = NULL;
|
|
|
|
gimp->gui.get_program_class = NULL;
|
|
|
|
gimp->gui.get_display_name = NULL;
|
2008-03-28 00:30:29 +08:00
|
|
|
gimp->gui.get_user_time = NULL;
|
2005-03-25 00:08:04 +08:00
|
|
|
gimp->gui.get_theme_dir = NULL;
|
|
|
|
gimp->gui.display_get_by_id = NULL;
|
|
|
|
gimp->gui.display_get_id = NULL;
|
2005-09-06 04:47:12 +08:00
|
|
|
gimp->gui.display_get_window = NULL;
|
2005-03-25 00:08:04 +08:00
|
|
|
gimp->gui.display_create = NULL;
|
|
|
|
gimp->gui.display_delete = NULL;
|
|
|
|
gimp->gui.displays_reconnect = NULL;
|
|
|
|
gimp->gui.progress_new = NULL;
|
|
|
|
gimp->gui.progress_free = NULL;
|
|
|
|
gimp->gui.pdb_dialog_set = NULL;
|
|
|
|
gimp->gui.pdb_dialog_close = NULL;
|
drop own recently used files code in favour of GtkRecentManager:
* app/core/gimp-gui.c (gimp_recent_list_add_uri), app/core/gimp-gui.h,
app/gui/gui-vtable.c (gui_recent_list_add_uri): add
{gimp,gui}_recent_list_add_uri(), gui_recent_list_add_uri() dispatches to
GtkRecentManager
* app/dialogs/file-save-dialog.c (file_save_dialog_save_image),
app/actions/file-commands.c (file_save_cmd_callback),
app/widgets/gimpdnd-xds.c (gimp_dnd_xds_save_image): pass Gimp instance to
file_save() calls
* app/file/file-open.c (file_open_with_proc_and_display,
file_open_layers), app/file/file-save.c (file_save), app/file/file-save.h:
pass Gimp instance to gimp_recent_list_add_uri() calls
* app/file/gimprecentitem.c, app/file/gimprecentitem.h,
app/file/gimprecentlist.c, app/file/gimprecentlist.h: removed
* app/file/Makefile.am: drop reference to removed files
svn path=/trunk/; revision=23526
2007-09-13 22:19:30 +08:00
|
|
|
gimp->gui.recent_list_add_uri = NULL;
|
2008-03-24 19:11:15 +08:00
|
|
|
gimp->gui.recent_list_load = NULL;
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
|
2006-09-10 00:36:15 +08:00
|
|
|
void
|
|
|
|
gimp_gui_ungrab (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
if (gimp->gui.ungrab)
|
|
|
|
gimp->gui.ungrab (gimp);
|
|
|
|
}
|
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
void
|
|
|
|
gimp_threads_enter (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
if (gimp->gui.threads_enter)
|
|
|
|
gimp->gui.threads_enter (gimp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_threads_leave (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
if (gimp->gui.threads_leave)
|
|
|
|
gimp->gui.threads_leave (gimp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_set_busy (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
/* FIXME: gimp_busy HACK */
|
|
|
|
gimp->busy++;
|
|
|
|
|
|
|
|
if (gimp->busy == 1)
|
|
|
|
{
|
|
|
|
if (gimp->gui.set_busy)
|
|
|
|
gimp->gui.set_busy (gimp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gimp_idle_unset_busy (gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp = data;
|
|
|
|
|
|
|
|
gimp_unset_busy (gimp);
|
|
|
|
|
|
|
|
gimp->busy_idle_id = 0;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_set_busy_until_idle (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
if (! gimp->busy_idle_id)
|
|
|
|
{
|
|
|
|
gimp_set_busy (gimp);
|
|
|
|
|
|
|
|
gimp->busy_idle_id = g_idle_add_full (G_PRIORITY_HIGH,
|
2006-04-12 20:49:29 +08:00
|
|
|
gimp_idle_unset_busy, gimp,
|
|
|
|
NULL);
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_unset_busy (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (gimp->busy > 0);
|
|
|
|
|
|
|
|
/* FIXME: gimp_busy HACK */
|
|
|
|
gimp->busy--;
|
|
|
|
|
|
|
|
if (gimp->busy == 0)
|
|
|
|
{
|
|
|
|
if (gimp->gui.unset_busy)
|
|
|
|
gimp->gui.unset_busy (gimp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-10-09 16:17:22 +08:00
|
|
|
gimp_show_message (Gimp *gimp,
|
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *domain,
|
|
|
|
const gchar *message)
|
2004-07-12 19:41:19 +08:00
|
|
|
{
|
2006-10-09 16:17:22 +08:00
|
|
|
const gchar *desc = "Message";
|
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2006-10-09 16:17:22 +08:00
|
|
|
g_return_if_fail (handler == NULL || G_IS_OBJECT (handler));
|
2006-07-19 14:50:34 +08:00
|
|
|
g_return_if_fail (message != NULL);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2004-08-26 01:58:52 +08:00
|
|
|
if (! domain)
|
2006-02-07 19:07:47 +08:00
|
|
|
domain = GIMP_ACRONYM;
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2006-10-09 16:17:22 +08:00
|
|
|
if (! gimp->console_messages)
|
2006-07-19 14:50:34 +08:00
|
|
|
{
|
2006-10-09 16:17:22 +08:00
|
|
|
if (gimp->gui.show_message)
|
|
|
|
{
|
|
|
|
gimp->gui.show_message (gimp, handler,
|
|
|
|
severity, domain, message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (GIMP_IS_PROGRESS (handler) &&
|
|
|
|
gimp_progress_message (GIMP_PROGRESS (handler), gimp,
|
|
|
|
severity, domain, message))
|
|
|
|
{
|
|
|
|
/* message has been handled by GimpProgress */
|
|
|
|
return;
|
|
|
|
}
|
2006-07-19 14:50:34 +08:00
|
|
|
}
|
2006-10-09 16:17:22 +08:00
|
|
|
|
|
|
|
gimp_enum_get_value (GIMP_TYPE_MESSAGE_SEVERITY, severity,
|
|
|
|
NULL, NULL, &desc, NULL);
|
|
|
|
g_printerr ("%s-%s: %s\n\n", domain, desc, message);
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-06-10 17:54:54 +08:00
|
|
|
gimp_help (Gimp *gimp,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const gchar *help_domain,
|
|
|
|
const gchar *help_id)
|
2004-07-12 19:41:19 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2008-06-10 17:54:54 +08:00
|
|
|
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
if (gimp->gui.help)
|
2008-06-10 17:54:54 +08:00
|
|
|
gimp->gui.help (gimp, progress, help_domain, help_id);
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const gchar *
|
|
|
|
gimp_get_program_class (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->gui.get_program_class)
|
|
|
|
return gimp->gui.get_program_class (gimp);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
gimp_get_display_name (Gimp *gimp,
|
2006-03-29 01:55:52 +08:00
|
|
|
gint display_ID,
|
2004-07-12 19:41:19 +08:00
|
|
|
gint *monitor_number)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (monitor_number != NULL, NULL);
|
|
|
|
|
|
|
|
if (gimp->gui.get_display_name)
|
2006-03-29 01:55:52 +08:00
|
|
|
return gimp->gui.get_display_name (gimp, display_ID, monitor_number);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
*monitor_number = 0;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-03-28 00:30:29 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_user_time:
|
|
|
|
* @gimp:
|
|
|
|
*
|
|
|
|
* Returns the timestamp of the last user interaction. The timestamp is
|
|
|
|
* taken from events caused by user interaction such as key presses or
|
|
|
|
* pointer movements. See gdk_x11_display_get_user_time().
|
|
|
|
*
|
|
|
|
* Return value: the timestamp of the last user interaction
|
|
|
|
*/
|
|
|
|
guint32
|
|
|
|
gimp_get_user_time (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), 0);
|
|
|
|
|
|
|
|
if (gimp->gui.get_user_time)
|
|
|
|
return gimp->gui.get_user_time (gimp);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
const gchar *
|
|
|
|
gimp_get_theme_dir (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->gui.get_theme_dir)
|
|
|
|
return gimp->gui.get_theme_dir (gimp);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-03-25 18:50:42 +08:00
|
|
|
GimpObject *
|
|
|
|
gimp_get_empty_display (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->gui.get_empty_display)
|
|
|
|
return gimp->gui.get_empty_display (gimp);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
GimpObject *
|
|
|
|
gimp_get_display_by_ID (Gimp *gimp,
|
|
|
|
gint ID)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->gui.display_get_by_id)
|
|
|
|
return gimp->gui.display_get_by_id (gimp, ID);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gimp_get_display_ID (Gimp *gimp,
|
|
|
|
GimpObject *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), -1);
|
|
|
|
g_return_val_if_fail (GIMP_IS_OBJECT (display), -1);
|
|
|
|
|
|
|
|
if (gimp->gui.display_get_id)
|
|
|
|
return gimp->gui.display_get_id (display);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-09-06 04:47:12 +08:00
|
|
|
guint32
|
|
|
|
gimp_get_display_window (Gimp *gimp,
|
|
|
|
GimpObject *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), -1);
|
|
|
|
g_return_val_if_fail (GIMP_IS_OBJECT (display), -1);
|
|
|
|
|
|
|
|
if (gimp->gui.display_get_window)
|
|
|
|
return gimp->gui.display_get_window (display);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
GimpObject *
|
|
|
|
gimp_create_display (Gimp *gimp,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image,
|
2004-07-12 19:41:19 +08:00
|
|
|
GimpUnit unit,
|
|
|
|
gdouble scale)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
2008-03-19 05:22:21 +08:00
|
|
|
g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), NULL);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
if (gimp->gui.display_create)
|
2008-03-19 05:22:21 +08:00
|
|
|
return gimp->gui.display_create (gimp, image, unit, scale);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2006-05-10 03:15:49 +08:00
|
|
|
return NULL;
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_delete_display (Gimp *gimp,
|
|
|
|
GimpObject *display)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (GIMP_IS_OBJECT (display));
|
|
|
|
|
|
|
|
if (gimp->gui.display_delete)
|
|
|
|
gimp->gui.display_delete (display);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_reconnect_displays (Gimp *gimp,
|
|
|
|
GimpImage *old_image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (old_image));
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (new_image));
|
|
|
|
|
|
|
|
if (gimp->gui.displays_reconnect)
|
|
|
|
gimp->gui.displays_reconnect (gimp, old_image, new_image);
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpProgress *
|
2006-03-24 05:56:13 +08:00
|
|
|
gimp_new_progress (Gimp *gimp,
|
|
|
|
GimpObject *display)
|
2004-07-12 19:41:19 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
2006-03-24 05:56:13 +08:00
|
|
|
g_return_val_if_fail (display == NULL || GIMP_IS_OBJECT (display), NULL);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (gimp->gui.progress_new)
|
2006-03-24 05:56:13 +08:00
|
|
|
return gimp->gui.progress_new (gimp, display);
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-08-11 02:47:21 +08:00
|
|
|
gimp_free_progress (Gimp *gimp,
|
|
|
|
GimpProgress *progress)
|
2004-07-12 19:41:19 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2004-08-11 02:47:21 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PROGRESS (progress));
|
2004-07-12 19:41:19 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (gimp->gui.progress_free)
|
|
|
|
gimp->gui.progress_free (gimp, progress);
|
2004-07-12 19:41:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_pdb_dialog_new (Gimp *gimp,
|
|
|
|
GimpContext *context,
|
2006-09-22 17:24:41 +08:00
|
|
|
GimpProgress *progress,
|
2004-07-12 19:41:19 +08:00
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
2006-09-22 17:24:41 +08:00
|
|
|
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
|
2004-07-12 19:41:19 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
|
|
|
g_return_val_if_fail (title != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (callback_name != NULL, FALSE);
|
|
|
|
|
|
|
|
if (gimp->gui.pdb_dialog_new)
|
|
|
|
{
|
2006-09-22 17:24:41 +08:00
|
|
|
va_list args;
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
va_start (args, object_name);
|
|
|
|
|
2006-09-22 17:24:41 +08:00
|
|
|
retval = gimp->gui.pdb_dialog_new (gimp, context, progress,
|
|
|
|
container, title,
|
2004-07-12 19:41:19 +08:00
|
|
|
callback_name, object_name,
|
|
|
|
args);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_pdb_dialog_set (Gimp *gimp,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
|
|
|
g_return_val_if_fail (callback_name != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (object_name != NULL, FALSE);
|
|
|
|
|
|
|
|
if (gimp->gui.pdb_dialog_set)
|
|
|
|
{
|
2006-09-22 17:24:41 +08:00
|
|
|
va_list args;
|
2004-07-12 19:41:19 +08:00
|
|
|
|
|
|
|
va_start (args, object_name);
|
|
|
|
|
|
|
|
retval = gimp->gui.pdb_dialog_set (gimp, container, callback_name,
|
|
|
|
object_name, args);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_pdb_dialog_close (Gimp *gimp,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
|
|
|
g_return_val_if_fail (callback_name != NULL, FALSE);
|
|
|
|
|
|
|
|
if (gimp->gui.pdb_dialog_close)
|
|
|
|
return gimp->gui.pdb_dialog_close (gimp, container, callback_name);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
drop own recently used files code in favour of GtkRecentManager:
* app/core/gimp-gui.c (gimp_recent_list_add_uri), app/core/gimp-gui.h,
app/gui/gui-vtable.c (gui_recent_list_add_uri): add
{gimp,gui}_recent_list_add_uri(), gui_recent_list_add_uri() dispatches to
GtkRecentManager
* app/dialogs/file-save-dialog.c (file_save_dialog_save_image),
app/actions/file-commands.c (file_save_cmd_callback),
app/widgets/gimpdnd-xds.c (gimp_dnd_xds_save_image): pass Gimp instance to
file_save() calls
* app/file/file-open.c (file_open_with_proc_and_display,
file_open_layers), app/file/file-save.c (file_save), app/file/file-save.h:
pass Gimp instance to gimp_recent_list_add_uri() calls
* app/file/gimprecentitem.c, app/file/gimprecentitem.h,
app/file/gimprecentlist.c, app/file/gimprecentlist.h: removed
* app/file/Makefile.am: drop reference to removed files
svn path=/trunk/; revision=23526
2007-09-13 22:19:30 +08:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_recent_list_add_uri (Gimp *gimp,
|
|
|
|
const gchar *uri,
|
|
|
|
const gchar *mime_type)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (uri != NULL, FALSE);
|
|
|
|
|
|
|
|
if (gimp->gui.recent_list_add_uri)
|
|
|
|
return gimp->gui.recent_list_add_uri (gimp, uri, mime_type);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-03-24 19:11:15 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
gimp_recent_list_load (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
if (gimp->gui.recent_list_load)
|
|
|
|
gimp->gui.recent_list_load (gimp);
|
|
|
|
}
|