~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimptexttool.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * GimpTextTool
28
28
 
29
29
#include <gtk/gtk.h>
30
30
 
31
 
#include "libgimpbase/gimpbase.h"
 
31
#include "libgimpconfig/gimpconfig.h"
32
32
#include "libgimpwidgets/gimpwidgets.h"
33
33
 
34
34
#include "tools-types.h"
39
39
#include "core/gimpimage-undo.h"
40
40
#include "core/gimpimage-undo-push.h"
41
41
#include "core/gimplayer-floating-sel.h"
 
42
#include "core/gimplist.h"
42
43
#include "core/gimptoolinfo.h"
43
 
#include "core/gimpundo.h"
44
44
#include "core/gimpundostack.h"
45
45
 
46
 
#include "config/gimpconfig.h"
47
 
#include "config/gimpconfig-utils.h"
48
 
 
49
46
#include "text/gimptext.h"
50
47
#include "text/gimptext-vectors.h"
51
48
#include "text/gimptextlayer.h"
52
49
#include "text/gimptextundo.h"
53
50
 
 
51
#include "vectors/gimpvectors-warp.h"
 
52
 
54
53
#include "widgets/gimpdialogfactory.h"
55
54
#include "widgets/gimphelp-ids.h"
56
55
#include "widgets/gimptexteditor.h"
71
70
 
72
71
/*  local function prototypes  */
73
72
 
74
 
static void      gimp_text_tool_class_init     (GimpTextToolClass *klass);
75
 
static void      gimp_text_tool_init           (GimpTextTool      *tool);
76
73
static GObject * gimp_text_tool_constructor    (GType              type,
77
74
                                                guint              n_params,
78
75
                                                GObjectConstructParam *params);
81
78
 
82
79
static void      gimp_text_tool_control        (GimpTool          *tool,
83
80
                                                GimpToolAction     action,
84
 
                                                GimpDisplay       *gdisp);
 
81
                                                GimpDisplay       *display);
85
82
static void      gimp_text_tool_button_press   (GimpTool          *tool,
86
83
                                                GimpCoords        *coords,
87
84
                                                guint32            time,
88
85
                                                GdkModifierType    state,
89
 
                                                GimpDisplay       *gdisp);
 
86
                                                GimpDisplay       *display);
90
87
static void      gimp_text_tool_cursor_update  (GimpTool          *tool,
91
88
                                                GimpCoords        *coords,
92
89
                                                GdkModifierType    state,
93
 
                                                GimpDisplay       *gdisp);
 
90
                                                GimpDisplay       *display);
94
91
 
95
92
static void      gimp_text_tool_connect        (GimpTextTool      *text_tool,
96
93
                                                GimpTextLayer     *layer,
108
105
static void      gimp_text_tool_apply          (GimpTextTool      *text_tool);
109
106
 
110
107
static void      gimp_text_tool_create_vectors (GimpTextTool      *text_tool);
 
108
static void      gimp_text_tool_create_vectors_warped
 
109
                                               (GimpTextTool      *text_tool);
111
110
static void      gimp_text_tool_create_layer   (GimpTextTool      *text_tool,
112
111
                                                GimpText          *text);
113
112
 
125
124
                                                gboolean           confirm);
126
125
 
127
126
 
128
 
/*  local variables  */
129
 
 
130
 
static GimpToolClass *parent_class = NULL;
131
 
 
132
 
 
133
 
/*  public functions  */
 
127
G_DEFINE_TYPE (GimpTextTool, gimp_text_tool, GIMP_TYPE_TOOL)
 
128
 
 
129
#define parent_class gimp_text_tool_parent_class
 
130
 
134
131
 
135
132
void
136
133
gimp_text_tool_register (GimpToolRegisterCallback  callback,
142
139
                GIMP_CONTEXT_FOREGROUND_MASK | GIMP_CONTEXT_FONT_MASK,
143
140
                "gimp-text-tool",
144
141
                _("Text"),
145
 
                _("Add text to the image"),
 
142
                _("Text Tool: Create or edit text layers"),
146
143
                N_("Te_xt"), "T",
147
144
                NULL, GIMP_HELP_TOOL_TEXT,
148
145
                GIMP_STOCK_TOOL_TEXT,
149
146
                data);
150
147
}
151
148
 
152
 
GType
153
 
gimp_text_tool_get_type (void)
154
 
{
155
 
  static GType tool_type = 0;
156
 
 
157
 
  if (! tool_type)
158
 
    {
159
 
      static const GTypeInfo tool_info =
160
 
      {
161
 
        sizeof (GimpTextToolClass),
162
 
        (GBaseInitFunc) NULL,
163
 
        (GBaseFinalizeFunc) NULL,
164
 
        (GClassInitFunc) gimp_text_tool_class_init,
165
 
        NULL,           /* class_finalize */
166
 
        NULL,           /* class_data     */
167
 
        sizeof (GimpTextTool),
168
 
        0,              /* n_preallocs    */
169
 
        (GInstanceInitFunc) gimp_text_tool_init,
170
 
      };
171
 
 
172
 
      tool_type = g_type_register_static (GIMP_TYPE_TOOL,
173
 
                                          "GimpTextTool",
174
 
                                          &tool_info, 0);
175
 
    }
176
 
 
177
 
  return tool_type;
178
 
}
179
 
 
180
 
 
181
 
/*  private functions  */
182
 
 
183
149
static void
184
150
gimp_text_tool_class_init (GimpTextToolClass *klass)
185
151
{
186
152
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
187
153
  GimpToolClass *tool_class   = GIMP_TOOL_CLASS (klass);
188
154
 
189
 
  parent_class = g_type_class_peek_parent (klass);
190
 
 
191
155
  object_class->constructor = gimp_text_tool_constructor;
192
156
  object_class->dispose     = gimp_text_tool_dispose;
193
157
  object_class->finalize    = gimp_text_tool_finalize;
212
176
  text_tool->image   = NULL;
213
177
 
214
178
  gimp_tool_control_set_scroll_lock (tool->control, TRUE);
215
 
  gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_TEXT);
 
179
  gimp_tool_control_set_tool_cursor (tool->control,
 
180
                                     GIMP_TOOL_CURSOR_TEXT);
 
181
  gimp_tool_control_set_action_object_1 (tool->control,
 
182
                                         "context/context-font-select-set");
216
183
}
217
184
 
218
185
static GObject *
227
194
  object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
228
195
 
229
196
  text_tool = GIMP_TEXT_TOOL (object);
230
 
  options = GIMP_TEXT_OPTIONS (GIMP_TOOL (text_tool)->tool_info->tool_options);
 
197
  options   = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
231
198
 
232
199
  text_tool->proxy = g_object_new (GIMP_TYPE_TEXT, NULL);
233
200
 
266
233
 
267
234
static void
268
235
gimp_text_tool_control (GimpTool       *tool,
269
 
                        GimpToolAction  action,
270
 
                        GimpDisplay    *gdisp)
 
236
                        GimpToolAction  action,
 
237
                        GimpDisplay    *display)
271
238
{
272
239
  GimpTextTool *text_tool = GIMP_TEXT_TOOL (tool);
273
240
 
274
241
  switch (action)
275
242
    {
276
 
    case PAUSE:
277
 
    case RESUME:
 
243
    case GIMP_TOOL_ACTION_PAUSE:
 
244
    case GIMP_TOOL_ACTION_RESUME:
278
245
      break;
279
246
 
280
 
    case HALT:
 
247
    case GIMP_TOOL_ACTION_HALT:
281
248
      gimp_text_tool_set_drawable (text_tool, NULL, FALSE);
282
249
      break;
283
250
    }
284
251
 
285
 
  GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
 
252
  GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
286
253
}
287
254
 
288
255
static void
289
256
gimp_text_tool_button_press (GimpTool        *tool,
290
 
                             GimpCoords      *coords,
291
 
                             guint32          time,
292
 
                             GdkModifierType  state,
293
 
                             GimpDisplay     *gdisp)
 
257
                             GimpCoords      *coords,
 
258
                             guint32          time,
 
259
                             GdkModifierType  state,
 
260
                             GimpDisplay     *display)
294
261
{
295
262
  GimpTextTool *text_tool = GIMP_TEXT_TOOL (tool);
296
263
  GimpText     *text      = text_tool->text;
297
264
  GimpDrawable *drawable;
298
265
 
299
 
  gimp_tool_control_activate (tool->control);
300
 
  tool->gdisp = gdisp;
 
266
  GIMP_TOOL_CLASS (parent_class)->button_press (tool, coords, time, state,
 
267
                                                display);
301
268
 
302
269
  text_tool->x1 = coords->x;
303
270
  text_tool->y1 = coords->y;
304
271
 
305
 
  drawable = gimp_image_active_drawable (gdisp->gimage);
 
272
  drawable = gimp_image_active_drawable (display->image);
306
273
 
307
274
  gimp_text_tool_set_drawable (text_tool, drawable, FALSE);
308
275
 
335
302
 
336
303
static void
337
304
gimp_text_tool_cursor_update (GimpTool        *tool,
338
 
                              GimpCoords      *coords,
339
 
                              GdkModifierType  state,
340
 
                              GimpDisplay     *gdisp)
 
305
                              GimpCoords      *coords,
 
306
                              GdkModifierType  state,
 
307
                              GimpDisplay     *display)
341
308
{
342
309
  /* FIXME: should do something fancy here... */
343
310
 
344
 
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
 
311
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
345
312
}
346
313
 
347
314
static void
358
325
 
359
326
  if (text_tool->text != text)
360
327
    {
361
 
      GimpTextOptions *options;
362
 
      GtkWidget       *button;
363
 
 
364
 
      options = GIMP_TEXT_OPTIONS (tool->tool_info->tool_options);
365
 
      button = g_object_get_data (G_OBJECT (options), "gimp-text-to-vectors");
 
328
      GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (tool);
366
329
 
367
330
      if (text_tool->text)
368
331
        {
373
336
          if (text_tool->pending)
374
337
            gimp_text_tool_apply (text_tool);
375
338
 
376
 
          if (button)
 
339
          if (options->to_vectors_button)
377
340
            {
378
 
              gtk_widget_set_sensitive (button, FALSE);
379
 
              g_signal_handlers_disconnect_by_func (button,
 
341
              gtk_widget_set_sensitive (options->to_vectors_button, FALSE);
 
342
              g_signal_handlers_disconnect_by_func (options->to_vectors_button,
380
343
                                                    gimp_text_tool_create_vectors,
381
344
                                                    text_tool);
382
345
            }
383
346
 
 
347
          if (options->along_vectors_button)
 
348
            {
 
349
              gtk_widget_set_sensitive (options->along_vectors_button,
 
350
                                        FALSE);
 
351
              g_signal_handlers_disconnect_by_func (options->along_vectors_button,
 
352
                                                    gimp_text_tool_create_vectors_warped,
 
353
                                                    text_tool);
 
354
            }
 
355
 
384
356
          g_object_unref (text_tool->text);
385
357
          text_tool->text = NULL;
386
358
 
393
365
 
394
366
      if (text)
395
367
        {
396
 
          gimp_config_sync (GIMP_CONFIG (text),
397
 
                            GIMP_CONFIG (text_tool->proxy), 0);
 
368
          gimp_config_sync (G_OBJECT (text), G_OBJECT (text_tool->proxy), 0);
398
369
 
399
370
          text_tool->text = g_object_ref (text);
400
371
 
402
373
                            G_CALLBACK (gimp_text_tool_text_notify),
403
374
                            text_tool);
404
375
 
405
 
          if (button)
 
376
          if (options->to_vectors_button)
406
377
            {
407
 
              g_signal_connect_swapped (button, "clicked",
 
378
              g_signal_connect_swapped (options->to_vectors_button, "clicked",
408
379
                                        G_CALLBACK (gimp_text_tool_create_vectors),
409
380
                                        text_tool);
410
 
              gtk_widget_set_sensitive (button, TRUE);
 
381
              gtk_widget_set_sensitive (options->to_vectors_button, TRUE);
 
382
            }
 
383
 
 
384
          if (options->along_vectors_button)
 
385
            {
 
386
              g_signal_connect_swapped (options->along_vectors_button, "clicked",
 
387
                                        G_CALLBACK (gimp_text_tool_create_vectors_warped),
 
388
                                        text_tool);
 
389
              gtk_widget_set_sensitive (options->along_vectors_button, TRUE);
411
390
            }
412
391
 
413
392
          if (text_tool->editor)
562
541
 
563
542
          if (text_undo->pspec == pspec)
564
543
            {
565
 
              guint now = time (NULL);
 
544
              if (gimp_undo_get_age (undo) < TEXT_UNDO_TIMEOUT)
 
545
                {
 
546
                  GimpTool *tool = GIMP_TOOL (text_tool);
566
547
 
567
 
              if (now >= undo->time &&
568
 
                  now - undo->time < TEXT_UNDO_TIMEOUT)
569
 
                {
570
548
                  push_undo = FALSE;
571
 
                  undo->time = now;
572
 
                  gimp_undo_refresh_preview (undo);
 
549
                  gimp_undo_reset_age (undo);
 
550
                  gimp_undo_refresh_preview (undo,
 
551
                                             GIMP_CONTEXT (gimp_tool_get_options (tool)));
573
552
                }
574
553
            }
575
554
        }
659
638
}
660
639
 
661
640
static void
 
641
gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool)
 
642
{
 
643
  GimpVectors   *vectors0;
 
644
  GimpVectors   *vectors;
 
645
  GimpText      *text      = text_tool->text;
 
646
  gdouble        box_height;
 
647
 
 
648
  if (! text || ! text_tool->image || ! text_tool->layer)
 
649
    return;
 
650
 
 
651
  box_height = gimp_item_height (GIMP_ITEM (text_tool->layer));
 
652
 
 
653
  vectors0 = gimp_image_get_active_vectors (text_tool->image);
 
654
  if (! vectors0)
 
655
    return;
 
656
 
 
657
  vectors = gimp_text_vectors_new (text_tool->image, text_tool->text);
 
658
 
 
659
  gimp_vectors_warp_vectors (vectors0, vectors, 0.5 * box_height);
 
660
 
 
661
  gimp_image_add_vectors (text_tool->image, vectors, -1);
 
662
  gimp_image_set_active_vectors (text_tool->image, vectors);
 
663
  gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE);
 
664
 
 
665
  gimp_image_flush (text_tool->image);
 
666
}
 
667
 
 
668
static void
662
669
gimp_text_tool_create_layer (GimpTextTool *text_tool,
663
670
                             GimpText     *text)
664
671
{
685
692
      text = gimp_config_duplicate (GIMP_CONFIG (text_tool->proxy));
686
693
    }
687
694
 
688
 
  image = tool->gdisp->gimage;
 
695
  image = tool->display->image;
689
696
  layer = gimp_text_layer_new (image, text);
690
697
 
691
698
  g_object_unref (text);
726
733
static void
727
734
gimp_text_tool_editor (GimpTextTool *text_tool)
728
735
{
729
 
  GimpTextOptions   *options;
 
736
  GimpTextOptions   *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
730
737
  GimpDialogFactory *dialog_factory;
 
738
  GtkWindow         *parent  = NULL;
731
739
 
732
740
  if (text_tool->editor)
733
741
    {
735
743
      return;
736
744
    }
737
745
 
738
 
  options = GIMP_TEXT_OPTIONS (GIMP_TOOL (text_tool)->tool_info->tool_options);
739
 
 
740
746
  dialog_factory = gimp_dialog_factory_from_name ("toplevel");
741
747
 
742
 
  text_tool->editor = gimp_text_options_editor_new (options,
 
748
  if (GIMP_TOOL (text_tool)->display)
 
749
    parent = GTK_WINDOW (GIMP_TOOL (text_tool)->display->shell);
 
750
 
 
751
  text_tool->editor = gimp_text_options_editor_new (parent, options,
743
752
                                                    dialog_factory->menu_factory,
744
753
                                                    _("GIMP Text Editor"));
745
754
 
746
755
  g_object_add_weak_pointer (G_OBJECT (text_tool->editor),
747
 
                             (gpointer *) &text_tool->editor);
 
756
                             (gpointer) &text_tool->editor);
748
757
 
749
758
  gimp_dialog_factory_add_foreign (dialog_factory,
750
759
                                   "gimp-text-tool-dialog",
754
763
    gimp_text_editor_set_text (GIMP_TEXT_EDITOR (text_tool->editor),
755
764
                               text_tool->text->text, -1);
756
765
 
757
 
  g_signal_connect_object (text_tool->editor, "text_changed",
 
766
  g_signal_connect_object (text_tool->editor, "text-changed",
758
767
                           G_CALLBACK (gimp_text_tool_text_changed),
759
768
                           text_tool, 0);
760
769
 
851
860
    }
852
861
 
853
862
  dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (text_tool->layer),
 
863
                                     GIMP_CONTEXT (gimp_tool_get_options (tool)),
854
864
                                     _("Confirm Text Editing"),
855
865
                                     "gimp-text-tool-confirm",
856
866
                                     GIMP_STOCK_TEXT_LAYER,
857
867
                                     _("Confirm Text Editing"),
858
 
                                     tool->gdisp->shell,
 
868
                                     tool->display->shell,
859
869
                                     gimp_standard_help_func,
860
870
                                     tool->tool_info->help_id,
 
871
 
861
872
                                     GTK_STOCK_NEW,    RESPONSE_NEW,
862
873
                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
863
 
                                     GIMP_STOCK_EDIT,  GTK_RESPONSE_OK,
 
874
                                     GTK_STOCK_EDIT,   GTK_RESPONSE_OK,
 
875
 
864
876
                                     NULL);
865
877
 
 
878
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
879
                                           RESPONSE_NEW,
 
880
                                           GTK_RESPONSE_OK,
 
881
                                           GTK_RESPONSE_CANCEL,
 
882
                                           -1);
 
883
 
866
884
  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
867
885
 
868
886
  g_signal_connect (dialog, "response",
918
936
                                            text_tool);
919
937
 
920
938
      g_object_remove_weak_pointer (G_OBJECT (text_tool->image),
921
 
                                    (gpointer *) &text_tool->image);
 
939
                                    (gpointer) &text_tool->image);
922
940
      text_tool->image = NULL;
923
941
    }
924
942
 
925
943
  if (image)
926
944
    {
927
 
      GimpToolOptions *options;
 
945
      GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
928
946
 
929
947
      text_tool->image = image;
930
948
      g_object_add_weak_pointer (G_OBJECT (text_tool->image),
931
 
                                 (gpointer *) &text_tool->image);
 
949
                                 (gpointer) &text_tool->image);
932
950
 
933
 
      g_signal_connect_object (text_tool->image, "active_layer_changed",
 
951
      g_signal_connect_object (text_tool->image, "active-layer-changed",
934
952
                               G_CALLBACK (gimp_text_tool_layer_changed),
935
953
                               text_tool, 0);
936
954
 
937
 
      options = GIMP_TOOL (text_tool)->tool_info->tool_options;
938
 
      gimp_size_entry_set_resolution (GIMP_TEXT_OPTIONS (options)->size_entry,
 
955
      gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (options->size_entry),
939
956
                                      0, image->yresolution, FALSE);
940
957
    }
941
958
}
955
972
 
956
973
  gimp_text_tool_set_image (text_tool, image);
957
974
 
958
 
  if (drawable && GIMP_IS_LAYER (drawable))
 
975
  if (GIMP_IS_TEXT_LAYER (drawable) && GIMP_TEXT_LAYER (drawable)->text)
959
976
    {
960
 
      if (GIMP_IS_TEXT_LAYER (drawable) && GIMP_TEXT_LAYER (drawable)->text)
 
977
      GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable);
 
978
 
 
979
      if (layer == text_tool->layer && layer->text == text_tool->text)
 
980
        return TRUE;
 
981
 
 
982
      if (layer->modified)
961
983
        {
962
 
          GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable);
963
 
 
964
 
          if (layer == text_tool->layer && layer->text == text_tool->text)
965
 
            return TRUE;
966
 
 
967
 
          if (layer->modified)
968
 
            {
969
 
              if (confirm)
970
 
                {
971
 
                  gimp_text_tool_connect (text_tool, layer, NULL);
972
 
                  gimp_text_tool_confirm_dialog (text_tool);
973
 
                  return TRUE;
974
 
                }
975
 
            }
976
 
          else
977
 
            {
978
 
              gimp_text_tool_connect (text_tool, layer, layer->text);
 
984
          if (confirm)
 
985
            {
 
986
              gimp_text_tool_connect (text_tool, layer, NULL);
 
987
              gimp_text_tool_confirm_dialog (text_tool);
979
988
              return TRUE;
980
989
            }
981
990
        }
 
991
      else
 
992
        {
 
993
          gimp_text_tool_connect (text_tool, layer, layer->text);
 
994
          return TRUE;
 
995
        }
982
996
    }
983
997
 
984
998
  gimp_text_tool_connect (text_tool, NULL, NULL);
995
1009
  g_return_if_fail (layer == NULL || GIMP_IS_LAYER (layer));
996
1010
 
997
1011
  if (gimp_text_tool_set_drawable (text_tool, GIMP_DRAWABLE (layer), TRUE))
998
 
    gimp_text_tool_editor (text_tool);
 
1012
    {
 
1013
      GimpTool    *tool = GIMP_TOOL (text_tool);
 
1014
      GimpItem    *item = GIMP_ITEM (layer);
 
1015
      GimpContext *context;
 
1016
      GimpDisplay *display;
 
1017
 
 
1018
      context = gimp_get_user_context (tool->tool_info->gimp);
 
1019
      display = gimp_context_get_display (context);
 
1020
 
 
1021
      if (! display || display->image != item->image)
 
1022
        {
 
1023
          GList *list;
 
1024
 
 
1025
          display = NULL;
 
1026
 
 
1027
          for (list = GIMP_LIST (tool->tool_info->gimp->displays)->list;
 
1028
               list;
 
1029
               list = g_list_next (list))
 
1030
            {
 
1031
              display = list->data;
 
1032
 
 
1033
              if (display->image == item->image)
 
1034
                {
 
1035
                  gimp_context_set_display (context, display);
 
1036
                  break;
 
1037
                }
 
1038
 
 
1039
              display = NULL;
 
1040
            }
 
1041
        }
 
1042
 
 
1043
      tool->display = display;
 
1044
 
 
1045
      if (tool->display)
 
1046
        {
 
1047
          tool->drawable = GIMP_DRAWABLE (layer);
 
1048
 
 
1049
          gimp_text_tool_editor (text_tool);
 
1050
        }
 
1051
    }
999
1052
}