1997-11-25 06:05:25 +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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2002-10-13 16:45:00 +08:00
|
|
|
#include <stdio.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdlib.h>
|
2002-10-15 06:07:39 +08:00
|
|
|
#include <string.h>
|
2002-10-12 01:42:26 +08:00
|
|
|
#include <errno.h>
|
1999-05-05 06:18:13 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-01-19 07:12:26 +08:00
|
|
|
|
2003-02-05 16:45:26 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "core/gimp.h"
|
2003-01-31 17:22:42 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
2003-02-13 19:23:50 +08:00
|
|
|
#include "core/gimpimage-undo.h"
|
2001-11-21 07:00:47 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
#include "config/gimpconfig.h"
|
|
|
|
#include "config/gimpconfig-utils.h"
|
|
|
|
|
2003-01-30 06:20:09 +08:00
|
|
|
#include "text/gimptext.h"
|
2003-01-31 17:22:42 +08:00
|
|
|
#include "text/gimptextlayer.h"
|
2003-01-30 06:20:09 +08:00
|
|
|
|
2001-08-11 23:35:16 +08:00
|
|
|
#include "widgets/gimpfontselection.h"
|
2003-02-02 05:50:21 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
|
|
|
#include "widgets/gimptexteditor.h"
|
2002-10-09 23:42:38 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2001-05-26 00:04:54 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
#include "gimptextoptions.h"
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "gimptexttool.h"
|
2001-01-23 21:01:48 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2001-08-12 01:24:47 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2003-02-21 00:11:23 +08:00
|
|
|
static void gimp_text_tool_class_init (GimpTextToolClass *klass);
|
|
|
|
static void gimp_text_tool_init (GimpTextTool *tool);
|
|
|
|
|
|
|
|
static void text_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void text_tool_button_press (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void text_tool_button_release (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void text_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
|
|
|
|
static void gimp_text_tool_connect (GimpTextTool *tool,
|
|
|
|
GimpText *text);
|
|
|
|
|
|
|
|
static void text_tool_create_layer (GimpTextTool *text_tool);
|
|
|
|
|
|
|
|
static void text_tool_editor (GimpTextTool *text_tool);
|
|
|
|
static void text_tool_buffer_changed (GtkTextBuffer *buffer,
|
|
|
|
GimpTextTool *text_tool);
|
2003-02-02 05:50:21 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
|
|
|
|
/* local variables */
|
2001-02-25 05:06:48 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
static GimpToolClass *parent_class = NULL;
|
1998-10-07 16:59:11 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
/* public functions */
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-02-25 05:06:48 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_text_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
2001-02-25 05:06:48 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_TEXT_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_TEXT_OPTIONS,
|
|
|
|
gimp_text_options_gui,
|
2001-11-21 07:00:47 +08:00
|
|
|
FALSE,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-text-tool",
|
2002-11-01 07:06:09 +08:00
|
|
|
_("Text"),
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Add text to the image"),
|
|
|
|
N_("/Tools/Text"), "T",
|
|
|
|
NULL, "tools/text.html",
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_TEXT,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-02-25 05:06:48 +08:00
|
|
|
}
|
|
|
|
|
2001-08-11 23:35:16 +08:00
|
|
|
GType
|
2001-02-25 05:06:48 +08:00
|
|
|
gimp_text_tool_get_type (void)
|
|
|
|
{
|
2001-08-11 23:35:16 +08:00
|
|
|
static GType tool_type = 0;
|
2001-02-25 05:06:48 +08:00
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-11 23:35:16 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-02-25 05:06:48 +08:00
|
|
|
{
|
2001-08-11 23:35:16 +08:00
|
|
|
sizeof (GimpTextToolClass),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_text_tool_class_init,
|
2001-08-14 22:53:55 +08:00
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
2001-02-25 05:06:48 +08:00
|
|
|
sizeof (GimpTextTool),
|
2001-08-11 23:35:16 +08:00
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_text_tool_init,
|
2001-02-25 05:06:48 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_TOOL,
|
|
|
|
"GimpTextTool",
|
2001-08-11 23:35:16 +08:00
|
|
|
&tool_info, 0);
|
2001-02-25 05:06:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
static void
|
2001-02-25 05:06:48 +08:00
|
|
|
gimp_text_tool_class_init (GimpTextToolClass *klass)
|
1999-04-09 06:25:54 +08:00
|
|
|
{
|
2001-08-11 23:35:16 +08:00
|
|
|
GimpToolClass *tool_class;
|
2001-02-25 05:06:48 +08:00
|
|
|
|
2001-08-11 23:35:16 +08:00
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
2001-02-25 05:06:48 +08:00
|
|
|
|
2001-08-11 23:35:16 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2001-02-25 05:06:48 +08:00
|
|
|
tool_class->control = text_tool_control;
|
|
|
|
tool_class->button_press = text_tool_button_press;
|
|
|
|
tool_class->button_release = text_tool_button_release;
|
|
|
|
tool_class->cursor_update = text_tool_cursor_update;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_text_tool_init (GimpTextTool *text_tool)
|
|
|
|
{
|
2002-10-11 02:37:12 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (text_tool);
|
2003-02-01 02:57:10 +08:00
|
|
|
|
|
|
|
text_tool->text = NULL;
|
|
|
|
|
2002-05-03 05:03:27 +08:00
|
|
|
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TEXT_TOOL_CURSOR);
|
2001-02-25 05:06:48 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2002-02-19 01:00:09 +08:00
|
|
|
text_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-02-25 05:06:48 +08:00
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case PAUSE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RESUME:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HALT:
|
2002-10-12 01:42:26 +08:00
|
|
|
if (GIMP_TEXT_TOOL (tool)->editor)
|
|
|
|
gtk_widget_destroy (GIMP_TEXT_TOOL (tool)->editor);
|
2003-02-01 02:57:10 +08:00
|
|
|
|
|
|
|
gimp_text_tool_connect (GIMP_TEXT_TOOL (tool), NULL);
|
2001-02-25 05:06:48 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2001-11-21 07:00:47 +08:00
|
|
|
|
|
|
|
GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
|
2001-02-25 05:06:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-09 03:14:51 +08:00
|
|
|
text_tool_button_press (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
2001-02-25 05:06:48 +08:00
|
|
|
{
|
|
|
|
GimpTextTool *text_tool;
|
2003-02-01 02:57:10 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
GimpText *text = NULL;
|
2001-02-25 05:06:48 +08:00
|
|
|
|
|
|
|
text_tool = GIMP_TEXT_TOOL (tool);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
text_tool->gdisp = gdisp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-03 19:31:08 +08:00
|
|
|
gimp_tool_control_activate (tool->control);
|
2000-12-31 12:07:42 +08:00
|
|
|
tool->gdisp = gdisp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
text_tool->click_x = coords->x;
|
|
|
|
text_tool->click_y = coords->y;
|
2001-08-12 02:41:47 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
drawable = gimp_image_active_drawable (gdisp->gimage);
|
|
|
|
|
|
|
|
if (drawable && GIMP_IS_TEXT_LAYER (drawable))
|
|
|
|
{
|
|
|
|
coords->x -= drawable->offset_x;
|
|
|
|
coords->y -= drawable->offset_y;
|
|
|
|
|
|
|
|
if (coords->x > 0 && coords->x < drawable->width &&
|
|
|
|
coords->y > 0 && coords->y < drawable->height)
|
|
|
|
{
|
|
|
|
text = gimp_text_layer_get_text (GIMP_TEXT_LAYER (drawable));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-02-21 00:11:23 +08:00
|
|
|
gimp_text_tool_connect (GIMP_TEXT_TOOL (tool), text);
|
|
|
|
|
2003-02-21 01:05:10 +08:00
|
|
|
text_tool_editor (text_tool);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-09 03:14:51 +08:00
|
|
|
text_tool_button_release (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-02-02 05:50:21 +08:00
|
|
|
/* gimp_tool_control_halt (tool->control); */
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-09 03:14:51 +08:00
|
|
|
text_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-02-05 01:43:01 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-02-01 02:57:10 +08:00
|
|
|
text_tool_create_layer (GimpTextTool *text_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-02-05 22:39:40 +08:00
|
|
|
GimpTextOptions *options;
|
|
|
|
GimpImage *gimage;
|
|
|
|
GimpText *text;
|
|
|
|
GimpLayer *layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
g_return_if_fail (text_tool->text == NULL);
|
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
options = GIMP_TEXT_OPTIONS (GIMP_TOOL (text_tool)->tool_info->tool_options);
|
2002-10-11 02:37:12 +08:00
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
gimage = text_tool->gdisp->gimage;
|
2002-10-11 02:37:12 +08:00
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
text = GIMP_TEXT (gimp_config_duplicate (G_OBJECT (options->text)));
|
2003-01-31 17:22:42 +08:00
|
|
|
|
|
|
|
layer = gimp_text_layer_new (gimage, text);
|
2001-08-14 21:49:21 +08:00
|
|
|
|
2002-10-11 01:07:46 +08:00
|
|
|
g_object_unref (text);
|
|
|
|
|
|
|
|
if (!layer)
|
|
|
|
return;
|
2001-08-14 21:49:21 +08:00
|
|
|
|
2003-02-21 00:11:23 +08:00
|
|
|
gimp_text_tool_connect (text_tool, text);
|
|
|
|
|
2003-02-13 19:23:50 +08:00
|
|
|
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TEXT,
|
|
|
|
_("Add Text Layer"));
|
1998-02-22 18:45:12 +08:00
|
|
|
|
2002-10-11 01:07:46 +08:00
|
|
|
GIMP_DRAWABLE (layer)->offset_x = text_tool->click_x;
|
|
|
|
GIMP_DRAWABLE (layer)->offset_y = text_tool->click_y;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
gimp_image_add_layer (gimage, layer, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-02-13 19:23:50 +08:00
|
|
|
gimp_image_undo_group_end (gimage);
|
2002-10-11 01:07:46 +08:00
|
|
|
|
|
|
|
gimp_image_flush (gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
static void
|
|
|
|
gimp_text_tool_connect (GimpTextTool *tool,
|
|
|
|
GimpText *text)
|
|
|
|
{
|
2003-02-05 22:39:40 +08:00
|
|
|
GimpTextOptions *options;
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
if (tool->text == text)
|
|
|
|
return;
|
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
options = GIMP_TEXT_OPTIONS (GIMP_TOOL (tool)->tool_info->tool_options);
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
if (tool->text)
|
|
|
|
{
|
2003-02-10 22:13:55 +08:00
|
|
|
gimp_config_disconnect (G_OBJECT (options->text),
|
|
|
|
G_OBJECT (tool->text));
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-02-01 02:57:10 +08:00
|
|
|
g_object_unref (tool->text);
|
|
|
|
tool->text = NULL;
|
2003-02-21 01:05:10 +08:00
|
|
|
|
|
|
|
g_object_set (G_OBJECT (options->text),
|
|
|
|
"text", NULL,
|
|
|
|
NULL);
|
2003-02-01 02:57:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (text)
|
2003-02-02 05:50:21 +08:00
|
|
|
{
|
|
|
|
tool->text = g_object_ref (text);
|
|
|
|
|
|
|
|
gimp_config_copy_properties (G_OBJECT (tool->text),
|
|
|
|
G_OBJECT (options->text));
|
|
|
|
|
2003-02-10 22:13:55 +08:00
|
|
|
gimp_config_connect (G_OBJECT (options->text),
|
|
|
|
G_OBJECT (tool->text));
|
2003-02-02 05:50:21 +08:00
|
|
|
}
|
2003-02-01 02:57:10 +08:00
|
|
|
}
|
|
|
|
|
2002-10-11 02:37:12 +08:00
|
|
|
static void
|
2002-10-12 01:42:26 +08:00
|
|
|
text_tool_editor (GimpTextTool *text_tool)
|
2002-10-11 02:37:12 +08:00
|
|
|
{
|
2003-02-05 22:39:40 +08:00
|
|
|
GimpTextOptions *options;
|
2002-10-11 02:37:12 +08:00
|
|
|
|
|
|
|
if (text_tool->editor)
|
|
|
|
{
|
2002-10-25 09:11:24 +08:00
|
|
|
gtk_window_present (GTK_WINDOW (text_tool->editor));
|
2002-10-11 02:37:12 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-02-05 22:39:40 +08:00
|
|
|
options = GIMP_TEXT_OPTIONS (GIMP_TOOL (text_tool)->tool_info->tool_options);
|
2002-10-11 02:37:12 +08:00
|
|
|
|
2003-02-21 00:11:23 +08:00
|
|
|
text_tool->editor = gimp_text_editor_new (_("GIMP Text Editor"),
|
|
|
|
options->buffer);
|
2002-10-12 01:42:26 +08:00
|
|
|
|
2002-10-11 02:37:12 +08:00
|
|
|
g_object_add_weak_pointer (G_OBJECT (text_tool->editor),
|
2003-02-02 05:50:21 +08:00
|
|
|
(gpointer *) &text_tool->editor);
|
2002-10-11 02:37:12 +08:00
|
|
|
|
|
|
|
gtk_widget_show (text_tool->editor);
|
2003-02-21 01:05:10 +08:00
|
|
|
|
|
|
|
if (! text_tool->text)
|
|
|
|
{
|
|
|
|
GClosure *closure;
|
|
|
|
|
|
|
|
closure = g_cclosure_new (G_CALLBACK (text_tool_buffer_changed),
|
|
|
|
text_tool, NULL);
|
|
|
|
g_object_watch_closure (G_OBJECT (text_tool->editor), closure);
|
|
|
|
g_signal_connect_closure (options->buffer, "changed", closure, FALSE);
|
|
|
|
}
|
2002-10-11 02:37:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-02-21 00:11:23 +08:00
|
|
|
text_tool_buffer_changed (GtkTextBuffer *buffer,
|
|
|
|
GimpTextTool *text_tool)
|
2002-10-11 02:37:12 +08:00
|
|
|
{
|
2003-02-21 00:11:23 +08:00
|
|
|
if (! text_tool->text)
|
|
|
|
text_tool_create_layer (text_tool);
|
2002-10-12 01:42:26 +08:00
|
|
|
}
|