
2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
118 lines
3.1 KiB
C
118 lines
3.1 KiB
C
/* 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 <gtk/gtk.h>
|
|
|
|
#include "tools/tools-types.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "tools/gimptool.h"
|
|
#include "tools/tool_manager.h"
|
|
|
|
#include "gdisplay.h"
|
|
|
|
|
|
#define return_if_no_display(gdisp) \
|
|
gdisp = gdisplay_active (); \
|
|
if (!gdisp) return
|
|
|
|
|
|
void
|
|
tools_default_colors_cmd_callback (GtkWidget *widget,
|
|
gpointer data)
|
|
{
|
|
gimp_context_set_default_colors (gimp_context_get_user ());
|
|
}
|
|
|
|
void
|
|
tools_swap_colors_cmd_callback (GtkWidget *widget,
|
|
gpointer data)
|
|
{
|
|
gimp_context_swap_colors (gimp_context_get_user ());
|
|
}
|
|
|
|
void
|
|
tools_swap_contexts_cmd_callback (GtkWidget *widget,
|
|
gpointer data)
|
|
{
|
|
static GimpContext *swap_context = NULL;
|
|
static GimpContext *temp_context = NULL;
|
|
|
|
if (! swap_context)
|
|
{
|
|
swap_context = gimp_context_new ("Swap Context",
|
|
gimp_context_get_user ());
|
|
temp_context = gimp_context_new ("Temp Context", NULL);
|
|
}
|
|
|
|
gimp_context_copy_args (gimp_context_get_user (),
|
|
temp_context,
|
|
GIMP_CONTEXT_ALL_ARGS_MASK);
|
|
gimp_context_copy_args (swap_context,
|
|
gimp_context_get_user (),
|
|
GIMP_CONTEXT_ALL_ARGS_MASK);
|
|
gimp_context_copy_args (temp_context,
|
|
swap_context,
|
|
GIMP_CONTEXT_ALL_ARGS_MASK);
|
|
}
|
|
|
|
void
|
|
tools_select_cmd_callback (GtkWidget *widget,
|
|
gpointer data,
|
|
guint action)
|
|
{
|
|
GtkType tool_type;
|
|
GimpToolInfo *tool_info;
|
|
GDisplay *gdisp;
|
|
|
|
tool_type = (GtkType) action;
|
|
|
|
tool_info = tool_manager_get_info_by_type (tool_type);
|
|
gdisp = gdisplay_active ();
|
|
|
|
gimp_context_set_tool (gimp_context_get_user (), tool_info);
|
|
|
|
#ifdef __GNUC__
|
|
#warning FIXME (let the tool manager to this stuff)
|
|
#endif
|
|
|
|
/* Paranoia */
|
|
active_tool->drawable = NULL;
|
|
|
|
/* Complete the initialisation by doing the same stuff
|
|
* tools_initialize() does after it did what tools_select() does
|
|
*/
|
|
if (GIMP_TOOL_CLASS (GTK_OBJECT (active_tool)->klass)->initialize)
|
|
{
|
|
gimp_tool_initialize (active_tool, gdisp);
|
|
|
|
active_tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
|
}
|
|
|
|
/* setting the tool->gdisp here is a HACK to allow the tools'
|
|
* dialog windows being hidden if the tool was selected from
|
|
* a tear-off-menu and there was no mouse click in the display
|
|
* before deleting it
|
|
*/
|
|
active_tool->gdisp = gdisp;
|
|
}
|