2001-04-16 04:12:16 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* 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 <stdio.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-10-13 20:52:30 +08:00
|
|
|
#include "gui-types.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
#include "core/gimp.h"
|
2001-07-08 02:16:18 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
2001-07-05 23:34:26 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2001-08-06 04:34:10 +08:00
|
|
|
#include "core/gimpdatafiles.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimpimage.h"
|
2001-07-05 23:34:26 +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-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay-ops.h"
|
|
|
|
#include "display/gimpdisplay-render.h"
|
|
|
|
#include "display/gximage.h"
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
|
|
|
|
2001-04-27 23:31:50 +08:00
|
|
|
#include "brush-select.h"
|
2001-05-01 21:16:59 +08:00
|
|
|
#include "color-select.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "devices.h"
|
|
|
|
#include "dialogs.h"
|
2001-04-28 23:11:29 +08:00
|
|
|
#include "file-open-dialog.h"
|
|
|
|
#include "file-save-dialog.h"
|
2001-04-27 23:31:50 +08:00
|
|
|
#include "gradient-select.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "gui.h"
|
|
|
|
#include "menus.h"
|
2001-07-10 01:58:56 +08:00
|
|
|
#include "palette-select.h"
|
2001-07-08 02:16:18 +08:00
|
|
|
#include "palette-import-dialog.h"
|
2001-04-27 23:31:50 +08:00
|
|
|
#include "pattern-select.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "session.h"
|
2001-05-25 09:24:12 +08:00
|
|
|
#include "tool-options-dialog.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "toolbox.h"
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
#include "gimprc.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
|
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
#include "pixmaps/wilber2.xpm"
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
/* local function prototypes */
|
2001-04-16 04:12:16 +08:00
|
|
|
|
2001-09-26 01:44:03 +08:00
|
|
|
static void gui_set_busy (Gimp *gimp);
|
|
|
|
static void gui_unset_busy (Gimp *gimp);
|
|
|
|
static void gui_display_new (GimpImage *gimage);
|
|
|
|
|
|
|
|
static gint gui_rotate_the_shield_harmonics (GtkWidget *widget,
|
|
|
|
GdkEvent *eevent,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_really_quit_callback (GtkWidget *button,
|
|
|
|
gboolean quit,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void gui_display_changed (GimpContext *context,
|
|
|
|
GDisplay *display,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void gui_image_disconnect (GimpImage *gimage,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_mode_changed (GimpImage *gimage,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_colormap_changed (GimpImage *gimage,
|
|
|
|
gint ncol,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_name_changed (GimpImage *gimage,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_size_changed (GimpImage *gimage,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_alpha_changed (GimpImage *gimage,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_update (GimpImage *gimage,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h,
|
|
|
|
gpointer data);
|
|
|
|
static void gui_image_selection_control (GimpImage *gimage,
|
|
|
|
GimpSelectionControl control,
|
|
|
|
gpointer data);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
/* private variables */
|
|
|
|
|
2001-09-26 01:44:03 +08:00
|
|
|
static GQuark image_disconnect_handler_id = 0;
|
|
|
|
static GQuark image_mode_changed_handler_id = 0;
|
|
|
|
static GQuark image_colormap_changed_handler_id = 0;
|
|
|
|
static GQuark image_name_changed_handler_id = 0;
|
|
|
|
static GQuark image_size_changed_handler_id = 0;
|
|
|
|
static GQuark image_alpha_changed_handler_id = 0;
|
|
|
|
static GQuark image_update_handler_id = 0;
|
|
|
|
static GQuark image_selection_control_handler_id = 0;
|
2001-07-08 02:16:18 +08:00
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
static GHashTable *themes_hash = NULL;
|
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
/* public functions */
|
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
static void
|
|
|
|
gui_themes_dir_foreach_func (const gchar *filename,
|
|
|
|
gpointer loader_data)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
Gimp *gimp;
|
|
|
|
gchar *basename;
|
2001-08-06 04:34:10 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
gimp = (Gimp *) loader_data;
|
2001-08-06 04:34:10 +08:00
|
|
|
|
|
|
|
basename = g_path_get_basename (filename);
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
if (gimp->be_verbose)
|
2001-08-06 04:34:10 +08:00
|
|
|
g_print (_("adding theme \"%s\" (%s)\n"), basename, filename);
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
g_hash_table_insert (themes_hash,
|
2001-08-06 04:34:10 +08:00
|
|
|
basename,
|
|
|
|
g_strdup (filename));
|
|
|
|
}
|
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
void
|
2001-10-24 00:23:32 +08:00
|
|
|
gui_libs_init (Gimp *gimp,
|
|
|
|
gint *argc,
|
2001-08-04 22:10:58 +08:00
|
|
|
gchar ***argv)
|
|
|
|
{
|
2001-08-06 04:34:10 +08:00
|
|
|
gchar *theme_dir;
|
|
|
|
gchar *gtkrc;
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
gimp_stock_init ();
|
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
themes_hash = g_hash_table_new_full (g_str_hash,
|
|
|
|
g_str_equal,
|
|
|
|
g_free,
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
if (gimprc.theme_path)
|
|
|
|
{
|
|
|
|
gimp_datafiles_read_directories (gimprc.theme_path,
|
|
|
|
TYPE_DIRECTORY,
|
|
|
|
gui_themes_dir_foreach_func,
|
2001-10-25 21:30:01 +08:00
|
|
|
gimp);
|
2001-08-06 04:34:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gimprc.theme)
|
|
|
|
theme_dir = g_hash_table_lookup (themes_hash, gimprc.theme);
|
|
|
|
else
|
|
|
|
theme_dir = g_hash_table_lookup (themes_hash, "Default");
|
|
|
|
|
|
|
|
if (theme_dir)
|
|
|
|
{
|
2001-10-24 23:56:33 +08:00
|
|
|
gtkrc = g_build_filename (theme_dir, "gtkrc", NULL);
|
2001-08-06 04:34:10 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* get the hardcoded default theme gtkrc */
|
|
|
|
|
|
|
|
gtkrc = g_strdup (gimp_gtkrc ());
|
|
|
|
}
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
if (gimp->be_verbose)
|
2001-08-04 22:10:58 +08:00
|
|
|
g_print (_("parsing \"%s\"\n"), gtkrc);
|
|
|
|
|
|
|
|
gtk_rc_parse (gtkrc);
|
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
g_free (gtkrc);
|
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
/* parse the user gtkrc */
|
2001-08-06 04:34:10 +08:00
|
|
|
|
|
|
|
gtkrc = gimp_personal_rc_file ("gtkrc");
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
if (gimp->be_verbose)
|
2001-08-06 04:34:10 +08:00
|
|
|
g_print (_("parsing \"%s\"\n"), gtkrc);
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
gtk_rc_parse (gtkrc);
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2001-08-06 04:34:10 +08:00
|
|
|
g_free (gtkrc);
|
2001-08-04 22:10:58 +08:00
|
|
|
}
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
void
|
2001-07-05 23:34:26 +08:00
|
|
|
gui_init (Gimp *gimp)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp->create_display_func = gui_display_new;
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gimp->gui_set_busy_func = gui_set_busy;
|
|
|
|
gimp->gui_unset_busy_func = gui_unset_busy;
|
|
|
|
|
2001-08-12 05:10:44 +08:00
|
|
|
image_disconnect_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "disconnect",
|
|
|
|
G_CALLBACK (gui_image_disconnect),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
2001-07-15 22:32:44 +08:00
|
|
|
image_mode_changed_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "mode_changed",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_mode_changed),
|
2001-07-15 22:32:44 +08:00
|
|
|
gimp);
|
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
image_colormap_changed_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "colormap_changed",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_colormap_changed),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
|
|
|
image_name_changed_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "name_changed",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_name_changed),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
|
|
|
image_size_changed_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "size_changed",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_size_changed),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
|
|
|
image_alpha_changed_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "alpha_changed",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_alpha_changed),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
2001-07-08 06:49:01 +08:00
|
|
|
image_update_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "update",
|
2001-08-01 07:28:56 +08:00
|
|
|
G_CALLBACK (gui_image_update),
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp);
|
|
|
|
|
2001-09-26 01:44:03 +08:00
|
|
|
image_selection_control_handler_id =
|
|
|
|
gimp_container_add_handler (gimp->images, "selection_control",
|
|
|
|
G_CALLBACK (gui_image_selection_control),
|
|
|
|
gimp);
|
|
|
|
|
2001-08-01 07:28:56 +08:00
|
|
|
g_signal_connect (G_OBJECT (gimp_get_user_context (gimp)), "display_changed",
|
|
|
|
G_CALLBACK (gui_display_changed),
|
|
|
|
gimp);
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
/* make sure the monitor resolution is valid */
|
|
|
|
if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION ||
|
|
|
|
gimprc.monitor_yres < GIMP_MIN_RESOLUTION)
|
|
|
|
{
|
|
|
|
gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres);
|
|
|
|
gimprc.using_xserver_resolution = TRUE;
|
|
|
|
}
|
|
|
|
|
2001-05-01 21:16:59 +08:00
|
|
|
/* tooltips */
|
|
|
|
gimp_help_init ();
|
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
if (! gimprc.show_tool_tips)
|
2001-05-01 21:16:59 +08:00
|
|
|
gimp_help_disable_tooltips ();
|
|
|
|
|
2001-10-24 00:23:32 +08:00
|
|
|
menus_init (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
|
2001-10-24 00:23:32 +08:00
|
|
|
gximage_init ();
|
|
|
|
render_setup (gimprc.transparency_type, gimprc.transparency_size);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2001-10-24 00:23:32 +08:00
|
|
|
dialogs_init (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
|
2001-10-24 00:23:32 +08:00
|
|
|
devices_init ();
|
|
|
|
session_init (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-25 21:30:01 +08:00
|
|
|
gui_restore (Gimp *gimp,
|
|
|
|
gboolean restore_session)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
file_open_dialog_menu_init ();
|
|
|
|
file_save_dialog_menu_init ();
|
|
|
|
|
|
|
|
menus_restore (gimp);
|
|
|
|
|
|
|
|
gimp_dialog_factory_dialog_new (global_dialog_factory, "gimp:toolbox");
|
|
|
|
|
2001-05-01 21:16:59 +08:00
|
|
|
color_select_init ();
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
devices_restore ();
|
2001-10-22 20:13:44 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
if (gimprc.always_restore_session || restore_session)
|
2001-10-24 00:23:32 +08:00
|
|
|
session_restore (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
}
|
|
|
|
|
2001-05-01 21:16:59 +08:00
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
gui_post_init (Gimp *gimp)
|
2001-05-01 21:16:59 +08:00
|
|
|
{
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_tips)
|
2001-05-01 21:16:59 +08:00
|
|
|
{
|
|
|
|
gimp_dialog_factory_dialog_new (global_dialog_factory, "gimp:tips-dialog");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
gui_shutdown (Gimp *gimp)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
session_save (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
device_status_free ();
|
2001-04-27 23:31:50 +08:00
|
|
|
|
|
|
|
brush_dialog_free ();
|
|
|
|
pattern_dialog_free ();
|
|
|
|
palette_dialog_free ();
|
|
|
|
gradient_dialog_free ();
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
|
|
|
|
gdisplays_delete ();
|
2001-04-16 04:12:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
gui_exit (Gimp *gimp)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
2001-10-24 00:23:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
menus_exit (gimp);
|
2001-04-16 04:12:16 +08:00
|
|
|
gximage_free ();
|
|
|
|
render_free ();
|
2001-04-18 00:00:27 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
dialogs_exit (gimp);
|
2001-04-18 00:00:27 +08:00
|
|
|
|
|
|
|
/* handle this in the dialog factory: */
|
|
|
|
tool_options_dialog_free ();
|
2001-10-25 21:30:01 +08:00
|
|
|
toolbox_free (gimp);
|
2001-05-01 21:16:59 +08:00
|
|
|
|
|
|
|
gimp_help_free ();
|
2001-07-08 02:16:18 +08:00
|
|
|
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_container_remove_handler (gimp->images, image_disconnect_handler_id);
|
2001-07-15 22:32:44 +08:00
|
|
|
gimp_container_remove_handler (gimp->images, image_mode_changed_handler_id);
|
2001-07-08 02:16:18 +08:00
|
|
|
gimp_container_remove_handler (gimp->images, image_colormap_changed_handler_id);
|
|
|
|
gimp_container_remove_handler (gimp->images, image_name_changed_handler_id);
|
|
|
|
gimp_container_remove_handler (gimp->images, image_size_changed_handler_id);
|
|
|
|
gimp_container_remove_handler (gimp->images, image_alpha_changed_handler_id);
|
2001-07-08 06:49:01 +08:00
|
|
|
gimp_container_remove_handler (gimp->images, image_update_handler_id);
|
2001-09-26 01:44:03 +08:00
|
|
|
gimp_container_remove_handler (gimp->images, image_selection_control_handler_id);
|
2001-07-08 02:16:18 +08:00
|
|
|
|
2001-09-26 01:44:03 +08:00
|
|
|
image_disconnect_handler_id = 0;
|
|
|
|
image_mode_changed_handler_id = 0;
|
|
|
|
image_colormap_changed_handler_id = 0;
|
|
|
|
image_name_changed_handler_id = 0;
|
|
|
|
image_size_changed_handler_id = 0;
|
|
|
|
image_alpha_changed_handler_id = 0;
|
|
|
|
image_update_handler_id = 0;
|
|
|
|
image_selection_control_handler_id = 0;
|
2001-08-06 04:34:10 +08:00
|
|
|
|
|
|
|
if (themes_hash)
|
|
|
|
{
|
|
|
|
g_hash_table_destroy (themes_hash);
|
|
|
|
themes_hash = NULL;
|
|
|
|
}
|
2001-04-16 04:12:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-25 21:30:01 +08:00
|
|
|
gui_really_quit_dialog (GCallback quit_func)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
|
|
|
|
menus_set_sensitive ("<Toolbox>/File/Quit", FALSE);
|
|
|
|
menus_set_sensitive ("<Image>/File/Quit", FALSE);
|
|
|
|
|
|
|
|
dialog = gimp_query_boolean_box (_("Really Quit?"),
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/really_quit.html",
|
|
|
|
TRUE,
|
|
|
|
_("Some files unsaved.\n\nQuit the GIMP?"),
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_QUIT, GTK_STOCK_CANCEL,
|
2001-04-16 04:12:16 +08:00
|
|
|
NULL, NULL,
|
2001-07-05 23:34:26 +08:00
|
|
|
gui_really_quit_callback,
|
2001-10-25 21:30:01 +08:00
|
|
|
quit_func);
|
2001-04-16 04:12:16 +08:00
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
gboolean double_speed = FALSE;
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
static void
|
2001-07-05 23:34:26 +08:00
|
|
|
gui_display_new (GimpImage *gimage)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
|
|
|
gdisp = gdisplay_new (gimage, 0x0101);
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_context_set_display (gimp_get_user_context (gimage->gimp), gdisp);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
if (double_speed)
|
2001-08-15 00:33:28 +08:00
|
|
|
g_signal_connect_after (G_OBJECT (gdisp->canvas), "expose_event",
|
|
|
|
G_CALLBACK (gui_rotate_the_shield_harmonics),
|
|
|
|
NULL);
|
2001-07-05 23:34:26 +08:00
|
|
|
}
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
static void
|
|
|
|
gui_set_busy (Gimp *gimp)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
gdisplays_set_busy ();
|
2001-07-20 18:07:51 +08:00
|
|
|
gimp_dialog_factories_idle ();
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gui_unset_busy (Gimp *gimp)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
gdisplays_unset_busy ();
|
2001-07-20 18:07:51 +08:00
|
|
|
gimp_dialog_factories_unidle ();
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
}
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
static gint
|
|
|
|
gui_rotate_the_shield_harmonics (GtkWidget *widget,
|
|
|
|
GdkEvent *eevent,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GdkPixmap *pixmap = NULL;
|
|
|
|
GdkBitmap *mask = NULL;
|
|
|
|
gint width = 0;
|
|
|
|
gint height = 0;
|
|
|
|
|
2001-08-01 07:28:56 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (G_OBJECT (widget),
|
|
|
|
gui_rotate_the_shield_harmonics,
|
|
|
|
data);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
pixmap = gdk_pixmap_create_from_xpm_d (widget->window,
|
|
|
|
&mask,
|
|
|
|
NULL,
|
|
|
|
wilber2_xpm);
|
|
|
|
|
2001-08-31 22:01:47 +08:00
|
|
|
gdk_drawable_get_size (pixmap, &width, &height);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
if (widget->allocation.width >= width &&
|
|
|
|
widget->allocation.height >= height)
|
|
|
|
{
|
|
|
|
gint x, y;
|
|
|
|
|
|
|
|
x = (widget->allocation.width - width) / 2;
|
|
|
|
y = (widget->allocation.height - height) / 2;
|
|
|
|
|
|
|
|
gdk_gc_set_clip_mask (widget->style->black_gc, mask);
|
|
|
|
gdk_gc_set_clip_origin (widget->style->black_gc, x, y);
|
|
|
|
|
2001-08-31 22:01:47 +08:00
|
|
|
gdk_draw_drawable (widget->window,
|
|
|
|
widget->style->black_gc,
|
|
|
|
pixmap, 0, 0,
|
|
|
|
x, y,
|
|
|
|
width, height);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
gdk_gc_set_clip_mask (widget->style->black_gc, NULL);
|
|
|
|
gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0);
|
|
|
|
}
|
|
|
|
|
2001-07-25 21:21:57 +08:00
|
|
|
gdk_drawable_unref (pixmap);
|
|
|
|
gdk_drawable_unref (mask);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gui_really_quit_callback (GtkWidget *button,
|
|
|
|
gboolean quit,
|
|
|
|
gpointer data)
|
2001-04-16 04:12:16 +08:00
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
GCallback quit_func;
|
|
|
|
|
|
|
|
quit_func = G_CALLBACK (data);
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (quit)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
(* quit_func) ();
|
2001-04-16 04:12:16 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
menus_set_sensitive ("<Toolbox>/File/Quit", TRUE);
|
|
|
|
menus_set_sensitive ("<Image>/File/Quit", TRUE);
|
|
|
|
}
|
|
|
|
}
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
|
|
|
|
/* FIXME: this junk should mostly go to the display subsystem */
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
static void
|
|
|
|
gui_display_changed (GimpContext *context,
|
|
|
|
GDisplay *display,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2001-07-08 02:16:18 +08:00
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gdisplay_set_menu_sensitivity (display);
|
|
|
|
}
|
2001-07-08 02:16:18 +08:00
|
|
|
|
|
|
|
static void
|
2001-08-12 05:10:44 +08:00
|
|
|
gui_image_disconnect (GimpImage *gimage,
|
|
|
|
gpointer data)
|
2001-07-08 02:16:18 +08:00
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
/* check if this is the last image */
|
|
|
|
if (gimp_container_num_children (gimp->images) == 1)
|
|
|
|
{
|
2001-07-20 18:07:51 +08:00
|
|
|
gimp_dialog_factory_dialog_raise (global_dialog_factory, "gimp:toolbox");
|
2001-07-08 02:16:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-15 22:32:44 +08:00
|
|
|
static void
|
|
|
|
gui_image_mode_changed (GimpImage *gimage,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
gimp_image_invalidate_layer_previews (gimage);
|
|
|
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
|
|
|
|
gdisplays_update_title (gimage);
|
|
|
|
gdisplays_update_full (gimage);
|
|
|
|
}
|
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
static void
|
|
|
|
gui_image_colormap_changed (GimpImage *gimage,
|
|
|
|
gint ncol,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
if (gimp_image_base_type (gimage) == INDEXED)
|
|
|
|
gdisplays_update_full (gimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gui_image_name_changed (GimpImage *gimage,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
gdisplays_update_title (gimage);
|
|
|
|
|
|
|
|
palette_import_image_renamed (gimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gui_image_size_changed (GimpImage *gimage,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
/* shrink wrap and update all views */
|
|
|
|
gdisplays_resize_cursor_label (gimage);
|
|
|
|
gdisplays_update_full (gimage);
|
|
|
|
gdisplays_shrink_wrap (gimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gui_image_alpha_changed (GimpImage *gimage,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
gdisplays_update_title (gimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-07-08 06:49:01 +08:00
|
|
|
gui_image_update (GimpImage *gimage,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h,
|
|
|
|
gpointer data)
|
2001-07-08 02:16:18 +08:00
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
gdisplays_update_area (gimage, x, y, w, h);
|
|
|
|
}
|
2001-09-26 01:44:03 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gui_image_selection_control (GimpImage *gimage,
|
|
|
|
GimpSelectionControl control,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
gimp = (Gimp *) data;
|
|
|
|
|
|
|
|
gdisplays_selection_visibility (gimage, control);
|
|
|
|
}
|