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

« back to all changes in this revision

Viewing changes to app/dialogs/dialogs-constructors.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
 * This program is free software; you can redistribute it and/or modify
40
40
#include "widgets/gimpcontainergridview.h"
41
41
#include "widgets/gimpcontainertreeview.h"
42
42
#include "widgets/gimpcontainerview-utils.h"
 
43
#include "widgets/gimpcursorview.h"
43
44
#include "widgets/gimpdataeditor.h"
44
45
#include "widgets/gimpdevicestatus.h"
45
46
#include "widgets/gimpdialogfactory.h"
51
52
#include "widgets/gimpgradienteditor.h"
52
53
#include "widgets/gimphelp-ids.h"
53
54
#include "widgets/gimphistogrameditor.h"
54
 
#include "widgets/gimpimagedock.h"
55
55
#include "widgets/gimpimageview.h"
56
56
#include "widgets/gimplayertreeview.h"
 
57
#include "widgets/gimpmenudock.h"
57
58
#include "widgets/gimppaletteeditor.h"
58
59
#include "widgets/gimppatternfactoryview.h"
 
60
#include "widgets/gimpsamplepointeditor.h"
59
61
#include "widgets/gimpselectioneditor.h"
60
62
#include "widgets/gimptemplateview.h"
61
63
#include "widgets/gimptoolbox.h"
73
75
#include "file-open-location-dialog.h"
74
76
#include "file-save-dialog.h"
75
77
#include "image-new-dialog.h"
 
78
#include "keyboard-shortcuts-dialog.h"
76
79
#include "module-dialog.h"
 
80
#include "palette-import-dialog.h"
77
81
#include "preferences-dialog.h"
78
82
#include "quit-dialog.h"
79
83
#include "tips-dialog.h"
95
99
GtkWidget *
96
100
dialogs_image_new_new (GimpDialogFactory *factory,
97
101
                       GimpContext       *context,
98
 
                       gint               preview_size)
 
102
                       gint               view_size)
99
103
{
100
 
  return image_new_dialog_new (context->gimp);
 
104
  return image_new_dialog_new (context);
101
105
}
102
106
 
103
107
GtkWidget *
104
108
dialogs_file_open_new (GimpDialogFactory *factory,
105
109
                       GimpContext       *context,
106
 
                       gint               preview_size)
 
110
                       gint               view_size)
107
111
{
108
112
  return file_open_dialog_new (context->gimp);
109
113
}
111
115
GtkWidget *
112
116
dialogs_file_open_location_new (GimpDialogFactory *factory,
113
117
                                GimpContext       *context,
114
 
                                gint               preview_size)
 
118
                                gint               view_size)
115
119
{
116
120
  return file_open_location_dialog_new (context->gimp);
117
121
}
119
123
GtkWidget *
120
124
dialogs_file_save_new (GimpDialogFactory *factory,
121
125
                       GimpContext       *context,
122
 
                       gint               preview_size)
 
126
                       gint               view_size)
123
127
{
124
128
  return file_save_dialog_new (context->gimp);
125
129
}
126
130
 
127
131
GtkWidget *
128
132
dialogs_preferences_get (GimpDialogFactory *factory,
129
 
                         GimpContext       *context,
130
 
                         gint               preview_size)
 
133
                         GimpContext       *context,
 
134
                         gint               view_size)
131
135
{
132
136
  return preferences_dialog_create (context->gimp);
133
137
}
134
138
 
135
139
GtkWidget *
 
140
dialogs_keyboard_shortcuts_get (GimpDialogFactory *factory,
 
141
                                GimpContext       *context,
 
142
                                gint               view_size)
 
143
{
 
144
  return keyboard_shortcuts_dialog_new (context->gimp);
 
145
}
 
146
 
 
147
GtkWidget *
136
148
dialogs_module_get (GimpDialogFactory *factory,
137
149
                    GimpContext       *context,
138
 
                    gint               preview_size)
 
150
                    gint               view_size)
139
151
{
140
152
  return module_dialog_new (context->gimp);
141
153
}
142
154
 
143
155
GtkWidget *
 
156
dialogs_palette_import_get (GimpDialogFactory *factory,
 
157
                            GimpContext       *context,
 
158
                            gint               view_size)
 
159
{
 
160
  return palette_import_dialog_new (context);
 
161
}
 
162
 
 
163
GtkWidget *
144
164
dialogs_tips_get (GimpDialogFactory *factory,
145
 
                  GimpContext       *context,
146
 
                  gint               preview_size)
 
165
                  GimpContext       *context,
 
166
                  gint               view_size)
147
167
{
148
168
  return tips_dialog_create (context->gimp);
149
169
}
150
170
 
151
171
GtkWidget *
152
172
dialogs_about_get (GimpDialogFactory *factory,
153
 
                   GimpContext       *context,
154
 
                   gint               preview_size)
 
173
                   GimpContext       *context,
 
174
                   gint               view_size)
155
175
{
156
 
  return about_dialog_create ();
 
176
  return about_dialog_create (context);
157
177
}
158
178
 
159
179
GtkWidget *
160
180
dialogs_error_get (GimpDialogFactory *factory,
161
181
                   GimpContext       *context,
162
 
                   gint               preview_size)
163
 
{
164
 
  return gimp_error_dialog_new (_("GIMP Message"), GIMP_STOCK_WARNING);
 
182
                   gint               view_size)
 
183
{
 
184
  return gimp_error_dialog_new (_("GIMP Message"));
 
185
}
 
186
 
 
187
GtkWidget *
 
188
dialogs_close_all_get (GimpDialogFactory *factory,
 
189
                       GimpContext       *context,
 
190
                       gint               view_size)
 
191
{
 
192
  return close_all_dialog_new (context->gimp);
165
193
}
166
194
 
167
195
GtkWidget *
168
196
dialogs_quit_get (GimpDialogFactory *factory,
169
197
                  GimpContext       *context,
170
 
                  gint               preview_size)
 
198
                  gint               view_size)
171
199
{
172
200
  return quit_dialog_new (context->gimp);
173
201
}
179
207
 
180
208
GtkWidget *
181
209
dialogs_toolbox_get (GimpDialogFactory *factory,
182
 
                     GimpContext       *context,
183
 
                     gint               preview_size)
 
210
                     GimpContext       *context,
 
211
                     gint               view_size)
184
212
{
185
213
  /*  we pass "global_dock_factory", _not_ "global_toolbox_factory" to
186
214
   *  the toolbox constructor, because the global_toolbox_factory has no
187
215
   *  dockables registered
188
216
   */
189
 
  return gimp_toolbox_new (global_dock_factory, context->gimp);
 
217
  return gimp_toolbox_new (global_dock_factory, context);
190
218
}
191
219
 
192
220
GtkWidget *
193
221
dialogs_dock_new (GimpDialogFactory *factory,
194
 
                  GimpContext       *context,
195
 
                  gint               preview_size)
 
222
                  GimpContext       *context,
 
223
                  gint               view_size)
196
224
{
197
 
  return gimp_image_dock_new (factory,
198
 
                              context->gimp->images,
199
 
                              context->gimp->displays);
 
225
  return gimp_menu_dock_new (factory,
 
226
                             context->gimp->images,
 
227
                             context->gimp->displays);
200
228
}
201
229
 
202
230
 
210
238
dialogs_dockable_constructor (GimpDialogFactory      *factory,
211
239
                              GimpDialogFactoryEntry *entry,
212
240
                              GimpContext            *context,
213
 
                              gint                    preview_size)
 
241
                              gint                    view_size)
214
242
{
215
243
  GtkWidget *dockable = NULL;
216
244
  GtkWidget *widget;
217
245
 
218
 
  widget = entry->new_func (factory, context, preview_size);
 
246
  widget = entry->new_func (factory, context, view_size);
219
247
 
220
248
  if (widget)
221
249
    {
223
251
                                    entry->stock_id, entry->help_id);
224
252
      gtk_container_add (GTK_CONTAINER (dockable), widget);
225
253
      gtk_widget_show (widget);
 
254
 
 
255
      /* EEK */
 
256
      g_object_set_data (G_OBJECT (dockable), "gimp-dialog-identifier",
 
257
                         entry->identifier);
226
258
    }
227
259
 
228
260
  return dockable;
232
264
/*****  singleton dialogs  *****/
233
265
 
234
266
GtkWidget *
235
 
dialogs_tool_options_get (GimpDialogFactory *factory,
236
 
                          GimpContext       *context,
237
 
                          gint               preview_size)
 
267
dialogs_tool_options_new (GimpDialogFactory *factory,
 
268
                          GimpContext       *context,
 
269
                          gint               view_size)
238
270
{
239
271
  return gimp_tool_options_editor_new (context->gimp,
240
272
                                       factory->menu_factory);
241
273
}
242
274
 
243
275
GtkWidget *
244
 
dialogs_device_status_get (GimpDialogFactory *factory,
 
276
dialogs_device_status_new (GimpDialogFactory *factory,
245
277
                           GimpContext       *context,
246
 
                           gint               preview_size)
 
278
                           gint               view_size)
247
279
{
248
280
  return gimp_device_status_new (context->gimp);
249
281
}
250
282
 
251
283
GtkWidget *
252
 
dialogs_error_console_get (GimpDialogFactory *factory,
253
 
                           GimpContext       *context,
254
 
                           gint               preview_size)
 
284
dialogs_error_console_new (GimpDialogFactory *factory,
 
285
                           GimpContext       *context,
 
286
                           gint               view_size)
255
287
{
256
288
  return gimp_error_console_new (context->gimp,
257
289
                                 factory->menu_factory);
258
290
}
259
291
 
 
292
GtkWidget *
 
293
dialogs_cursor_view_new (GimpDialogFactory *factory,
 
294
                         GimpContext       *context,
 
295
                         gint               view_size)
 
296
{
 
297
  return gimp_cursor_view_new (factory->menu_factory);
 
298
}
 
299
 
260
300
 
261
301
/*****  list views  *****/
262
302
 
263
303
GtkWidget *
264
304
dialogs_image_list_view_new (GimpDialogFactory *factory,
265
 
                             GimpContext       *context,
266
 
                             gint               preview_size)
 
305
                             GimpContext       *context,
 
306
                             gint               view_size)
267
307
{
268
308
  return gimp_image_view_new (GIMP_VIEW_TYPE_LIST,
269
309
                              context->gimp->images,
270
310
                              context,
271
 
                              preview_size, 1,
 
311
                              view_size, 1,
272
312
                              factory->menu_factory);
273
313
}
274
314
 
275
315
GtkWidget *
276
316
dialogs_brush_list_view_new (GimpDialogFactory *factory,
277
 
                             GimpContext       *context,
278
 
                             gint               preview_size)
 
317
                             GimpContext       *context,
 
318
                             gint               view_size)
279
319
{
280
320
  return gimp_brush_factory_view_new (GIMP_VIEW_TYPE_LIST,
281
 
                                      context->gimp->brush_factory,
282
 
                                      context,
283
 
                                      TRUE,
284
 
                                      preview_size, 1,
 
321
                                      context->gimp->brush_factory,
 
322
                                      context,
 
323
                                      TRUE,
 
324
                                      view_size, 1,
285
325
                                      factory->menu_factory);
286
326
}
287
327
 
288
328
GtkWidget *
289
329
dialogs_pattern_list_view_new (GimpDialogFactory *factory,
290
 
                               GimpContext       *context,
291
 
                               gint               preview_size)
 
330
                               GimpContext       *context,
 
331
                               gint               view_size)
292
332
{
293
333
  return gimp_pattern_factory_view_new (GIMP_VIEW_TYPE_LIST,
294
334
                                        context->gimp->pattern_factory,
295
335
                                        context,
296
 
                                        preview_size, 1,
 
336
                                        view_size, 1,
297
337
                                        factory->menu_factory);
298
338
}
299
339
 
300
340
GtkWidget *
301
341
dialogs_gradient_list_view_new (GimpDialogFactory *factory,
302
 
                                GimpContext       *context,
303
 
                                gint               preview_size)
 
342
                                GimpContext       *context,
 
343
                                gint               view_size)
304
344
{
305
345
  return gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
306
346
                                     context->gimp->gradient_factory,
307
347
                                     context,
308
 
                                     preview_size, 1,
 
348
                                     view_size, 1,
309
349
                                     factory->menu_factory, "<Gradients>",
310
350
                                     "/gradients-popup",
311
351
                                     "gradients");
313
353
 
314
354
GtkWidget *
315
355
dialogs_palette_list_view_new (GimpDialogFactory *factory,
316
 
                               GimpContext       *context,
317
 
                               gint               preview_size)
 
356
                               GimpContext       *context,
 
357
                               gint               view_size)
318
358
{
319
359
  return gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
320
360
                                     context->gimp->palette_factory,
321
361
                                     context,
322
 
                                     preview_size, 1,
 
362
                                     view_size, 1,
323
363
                                     factory->menu_factory, "<Palettes>",
324
364
                                     "/palettes-popup",
325
365
                                     "palettes");
328
368
GtkWidget *
329
369
dialogs_font_list_view_new (GimpDialogFactory *factory,
330
370
                            GimpContext       *context,
331
 
                            gint               preview_size)
 
371
                            gint               view_size)
332
372
{
333
373
  return gimp_font_view_new (GIMP_VIEW_TYPE_LIST,
334
374
                             context->gimp->fonts,
335
375
                             context,
336
 
                             preview_size, 1,
 
376
                             view_size, 1,
337
377
                             factory->menu_factory);
338
378
}
339
379
 
340
380
GtkWidget *
341
381
dialogs_tool_list_view_new (GimpDialogFactory *factory,
342
 
                            GimpContext       *context,
343
 
                            gint               preview_size)
 
382
                            GimpContext       *context,
 
383
                            gint               view_size)
344
384
{
345
385
  return gimp_tool_view_new (GIMP_VIEW_TYPE_LIST,
346
386
                             context->gimp->tool_info_list,
347
387
                             context,
348
 
                             preview_size, 0,
 
388
                             view_size, 0,
349
389
                             factory->menu_factory);
350
390
}
351
391
 
352
392
GtkWidget *
353
393
dialogs_buffer_list_view_new (GimpDialogFactory *factory,
354
 
                              GimpContext       *context,
355
 
                              gint               preview_size)
 
394
                              GimpContext       *context,
 
395
                              gint               view_size)
356
396
{
357
397
  return gimp_buffer_view_new (GIMP_VIEW_TYPE_LIST,
358
 
                               context->gimp->named_buffers,
359
 
                               context,
360
 
                               preview_size, 1,
 
398
                               context->gimp->named_buffers,
 
399
                               context,
 
400
                               view_size, 1,
361
401
                               factory->menu_factory);
362
402
}
363
403
 
364
404
GtkWidget *
365
405
dialogs_document_list_view_new (GimpDialogFactory *factory,
366
406
                                GimpContext       *context,
367
 
                                gint               preview_size)
 
407
                                gint               view_size)
368
408
{
369
409
  return gimp_document_view_new (GIMP_VIEW_TYPE_LIST,
370
410
                                 context->gimp->documents,
371
411
                                 context,
372
 
                                 preview_size, 0,
 
412
                                 view_size, 0,
373
413
                                 factory->menu_factory);
374
414
}
375
415
 
376
416
GtkWidget *
377
417
dialogs_template_list_view_new (GimpDialogFactory *factory,
378
418
                                GimpContext       *context,
379
 
                                gint               preview_size)
 
419
                                gint               view_size)
380
420
{
381
421
  return gimp_template_view_new (GIMP_VIEW_TYPE_LIST,
382
422
                                 context->gimp->templates,
383
423
                                 context,
384
 
                                 preview_size, 0,
 
424
                                 view_size, 0,
385
425
                                 factory->menu_factory);
386
426
}
387
427
 
390
430
 
391
431
GtkWidget *
392
432
dialogs_image_grid_view_new (GimpDialogFactory *factory,
393
 
                             GimpContext       *context,
394
 
                             gint               preview_size)
 
433
                             GimpContext       *context,
 
434
                             gint               view_size)
395
435
{
396
436
  return gimp_image_view_new (GIMP_VIEW_TYPE_GRID,
397
437
                              context->gimp->images,
398
438
                              context,
399
 
                              preview_size, 1,
 
439
                              view_size, 1,
400
440
                              factory->menu_factory);
401
441
}
402
442
 
403
443
GtkWidget *
404
444
dialogs_brush_grid_view_new (GimpDialogFactory *factory,
405
 
                             GimpContext       *context,
406
 
                             gint               preview_size)
 
445
                             GimpContext       *context,
 
446
                             gint               view_size)
407
447
{
408
448
  return gimp_brush_factory_view_new (GIMP_VIEW_TYPE_GRID,
409
 
                                      context->gimp->brush_factory,
410
 
                                      context,
411
 
                                      TRUE,
412
 
                                      preview_size, 1,
 
449
                                      context->gimp->brush_factory,
 
450
                                      context,
 
451
                                      TRUE,
 
452
                                      view_size, 1,
413
453
                                      factory->menu_factory);
414
454
}
415
455
 
416
456
GtkWidget *
417
457
dialogs_pattern_grid_view_new (GimpDialogFactory *factory,
418
 
                               GimpContext       *context,
419
 
                               gint               preview_size)
 
458
                               GimpContext       *context,
 
459
                               gint               view_size)
420
460
{
421
461
  return gimp_pattern_factory_view_new (GIMP_VIEW_TYPE_GRID,
422
462
                                        context->gimp->pattern_factory,
423
463
                                        context,
424
 
                                        preview_size, 1,
 
464
                                        view_size, 1,
425
465
                                        factory->menu_factory);
426
466
}
427
467
 
428
468
GtkWidget *
429
469
dialogs_gradient_grid_view_new (GimpDialogFactory *factory,
430
 
                                GimpContext       *context,
431
 
                                gint               preview_size)
 
470
                                GimpContext       *context,
 
471
                                gint               view_size)
432
472
{
433
473
  return gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
434
474
                                     context->gimp->gradient_factory,
435
475
                                     context,
436
 
                                     preview_size, 1,
 
476
                                     view_size, 1,
437
477
                                     factory->menu_factory, "<Gradients>",
438
478
                                     "/gradients-popup",
439
479
                                     "gradients");
441
481
 
442
482
GtkWidget *
443
483
dialogs_palette_grid_view_new (GimpDialogFactory *factory,
444
 
                               GimpContext       *context,
445
 
                               gint               preview_size)
 
484
                               GimpContext       *context,
 
485
                               gint               view_size)
446
486
{
447
487
  return gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
448
488
                                     context->gimp->palette_factory,
449
489
                                     context,
450
 
                                     preview_size, 1,
 
490
                                     view_size, 1,
451
491
                                     factory->menu_factory, "<Palettes>",
452
492
                                     "/palettes-popup",
453
493
                                     "palettes");
456
496
GtkWidget *
457
497
dialogs_font_grid_view_new (GimpDialogFactory *factory,
458
498
                            GimpContext       *context,
459
 
                            gint               preview_size)
 
499
                            gint               view_size)
460
500
{
461
501
  return gimp_font_view_new (GIMP_VIEW_TYPE_GRID,
462
502
                             context->gimp->fonts,
463
503
                             context,
464
 
                             preview_size, 1,
 
504
                             view_size, 1,
465
505
                             factory->menu_factory);
466
506
}
467
507
 
468
508
GtkWidget *
469
509
dialogs_tool_grid_view_new (GimpDialogFactory *factory,
470
 
                            GimpContext       *context,
471
 
                            gint               preview_size)
 
510
                            GimpContext       *context,
 
511
                            gint               view_size)
472
512
{
473
513
  return gimp_tool_view_new (GIMP_VIEW_TYPE_GRID,
474
514
                             context->gimp->tool_info_list,
475
515
                             context,
476
 
                             preview_size, 1,
 
516
                             view_size, 1,
477
517
                             factory->menu_factory);
478
518
}
479
519
 
480
520
GtkWidget *
481
521
dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
482
 
                              GimpContext       *context,
483
 
                              gint               preview_size)
 
522
                              GimpContext       *context,
 
523
                              gint               view_size)
484
524
{
485
525
  return gimp_buffer_view_new (GIMP_VIEW_TYPE_GRID,
486
 
                               context->gimp->named_buffers,
487
 
                               context,
488
 
                               preview_size, 1,
 
526
                               context->gimp->named_buffers,
 
527
                               context,
 
528
                               view_size, 1,
489
529
                               factory->menu_factory);
490
530
}
491
531
 
492
532
GtkWidget *
493
533
dialogs_document_grid_view_new (GimpDialogFactory *factory,
494
534
                                GimpContext       *context,
495
 
                                gint               preview_size)
 
535
                                gint               view_size)
496
536
{
497
537
  return gimp_document_view_new (GIMP_VIEW_TYPE_GRID,
498
538
                                 context->gimp->documents,
499
539
                                 context,
500
 
                                 preview_size, 0,
 
540
                                 view_size, 0,
501
541
                                 factory->menu_factory);
502
542
}
503
543
 
504
544
GtkWidget *
505
545
dialogs_template_grid_view_new (GimpDialogFactory *factory,
506
546
                                GimpContext       *context,
507
 
                                gint               preview_size)
 
547
                                gint               view_size)
508
548
{
509
549
  return gimp_template_view_new (GIMP_VIEW_TYPE_GRID,
510
550
                                 context->gimp->templates,
511
551
                                 context,
512
 
                                 preview_size, 0,
 
552
                                 view_size, 0,
513
553
                                 factory->menu_factory);
514
554
}
515
555
 
518
558
 
519
559
GtkWidget *
520
560
dialogs_layer_list_view_new (GimpDialogFactory *factory,
521
 
                             GimpContext       *context,
522
 
                             gint               preview_size)
 
561
                             GimpContext       *context,
 
562
                             gint               view_size)
523
563
{
524
 
  if (preview_size < 1)
525
 
    preview_size = context->gimp->config->layer_preview_size;
 
564
  if (view_size < 1)
 
565
    view_size = context->gimp->config->layer_preview_size;
526
566
 
527
567
  return gimp_item_tree_view_new (GIMP_TYPE_LAYER_TREE_VIEW,
528
 
                                  preview_size, 2,
 
568
                                  view_size, 2,
529
569
                                  gimp_context_get_image (context),
530
570
                                  factory->menu_factory, "<Layers>",
531
571
                                  "/layers-popup");
533
573
 
534
574
GtkWidget *
535
575
dialogs_channel_list_view_new (GimpDialogFactory *factory,
536
 
                               GimpContext       *context,
537
 
                               gint               preview_size)
 
576
                               GimpContext       *context,
 
577
                               gint               view_size)
538
578
{
539
 
  if (preview_size < 1)
540
 
    preview_size = context->gimp->config->layer_preview_size;
 
579
  if (view_size < 1)
 
580
    view_size = context->gimp->config->layer_preview_size;
541
581
 
542
582
  return gimp_item_tree_view_new (GIMP_TYPE_CHANNEL_TREE_VIEW,
543
 
                                  preview_size, 1,
 
583
                                  view_size, 1,
544
584
                                  gimp_context_get_image (context),
545
585
                                  factory->menu_factory, "<Channels>",
546
586
                                  "/channels-popup");
548
588
 
549
589
GtkWidget *
550
590
dialogs_vectors_list_view_new (GimpDialogFactory *factory,
551
 
                               GimpContext       *context,
552
 
                               gint               preview_size)
 
591
                               GimpContext       *context,
 
592
                               gint               view_size)
553
593
{
554
 
  if (preview_size < 1)
555
 
    preview_size = context->gimp->config->layer_preview_size;
 
594
  if (view_size < 1)
 
595
    view_size = context->gimp->config->layer_preview_size;
556
596
 
557
597
  return gimp_item_tree_view_new (GIMP_TYPE_VECTORS_TREE_VIEW,
558
 
                                  preview_size, 1,
 
598
                                  view_size, 1,
559
599
                                  gimp_context_get_image (context),
560
600
                                  factory->menu_factory, "<Vectors>",
561
601
                                  "/vectors-popup");
563
603
 
564
604
GtkWidget *
565
605
dialogs_colormap_editor_new (GimpDialogFactory *factory,
566
 
                             GimpContext       *context,
567
 
                             gint               preview_size)
 
606
                             GimpContext       *context,
 
607
                             gint               view_size)
568
608
{
569
609
  GtkWidget *view;
570
610
 
571
611
  view = gimp_colormap_editor_new (factory->menu_factory);
572
612
 
573
613
  g_signal_connect (view, "selected",
574
 
                    G_CALLBACK (dialogs_indexed_palette_selected),
575
 
                    NULL);
 
614
                    G_CALLBACK (dialogs_indexed_palette_selected),
 
615
                    NULL);
576
616
 
577
617
  return view;
578
618
}
580
620
GtkWidget *
581
621
dialogs_histogram_editor_new (GimpDialogFactory *factory,
582
622
                              GimpContext       *context,
583
 
                              gint               preview_size)
 
623
                              gint               view_size)
584
624
{
585
625
  return gimp_histogram_editor_new ();
586
626
}
588
628
GtkWidget *
589
629
dialogs_selection_editor_new (GimpDialogFactory *factory,
590
630
                              GimpContext       *context,
591
 
                              gint               preview_size)
 
631
                              gint               view_size)
592
632
{
593
633
  return gimp_selection_editor_new (factory->menu_factory);
594
634
}
596
636
GtkWidget *
597
637
dialogs_undo_editor_new (GimpDialogFactory *factory,
598
638
                         GimpContext       *context,
599
 
                         gint               preview_size)
 
639
                         gint               view_size)
600
640
{
601
641
  return gimp_undo_editor_new (context->gimp->config,
602
642
                               factory->menu_factory);
603
643
}
604
644
 
 
645
GtkWidget *
 
646
dialogs_sample_point_editor_new (GimpDialogFactory *factory,
 
647
                                 GimpContext       *context,
 
648
                                 gint               view_size)
 
649
{
 
650
  return gimp_sample_point_editor_new (factory->menu_factory);
 
651
}
 
652
 
605
653
 
606
654
/*****  display related dialogs  *****/
607
655
 
608
656
GtkWidget *
609
657
dialogs_navigation_editor_new (GimpDialogFactory *factory,
610
658
                               GimpContext       *context,
611
 
                               gint               preview_size)
 
659
                               gint               view_size)
612
660
{
613
661
  return gimp_navigation_editor_new (factory->menu_factory);
614
662
}
619
667
GtkWidget *
620
668
dialogs_color_editor_new (GimpDialogFactory *factory,
621
669
                          GimpContext       *context,
622
 
                          gint               preview_size)
 
670
                          gint               view_size)
623
671
{
624
672
  return gimp_color_editor_new (context);
625
673
}
631
679
 
632
680
GtkWidget *
633
681
dialogs_brush_editor_get (GimpDialogFactory *factory,
634
 
                          GimpContext       *context,
635
 
                          gint               preview_size)
 
682
                          GimpContext       *context,
 
683
                          gint               view_size)
636
684
{
637
 
  return gimp_brush_editor_new (context->gimp);
 
685
  return gimp_brush_editor_new (context,
 
686
                                factory->menu_factory);
638
687
}
639
688
 
640
689
GtkWidget *
641
690
dialogs_gradient_editor_get (GimpDialogFactory *factory,
642
 
                             GimpContext       *context,
643
 
                             gint               preview_size)
 
691
                             GimpContext       *context,
 
692
                             gint               view_size)
644
693
{
645
 
  return gimp_gradient_editor_new (context->gimp,
 
694
  return gimp_gradient_editor_new (context,
646
695
                                   factory->menu_factory);
647
696
}
648
697
 
649
698
GtkWidget *
650
699
dialogs_palette_editor_get (GimpDialogFactory *factory,
651
 
                            GimpContext       *context,
652
 
                            gint               preview_size)
 
700
                            GimpContext       *context,
 
701
                            gint               view_size)
653
702
{
654
 
  return gimp_palette_editor_new (context->gimp,
 
703
  return gimp_palette_editor_new (context,
655
704
                                  factory->menu_factory);
656
705
}
657
706
 
661
710
static void
662
711
dialogs_indexed_palette_selected (GimpColormapEditor *editor,
663
712
                                  GdkModifierType     state,
664
 
                                  gpointer            data)
 
713
                                  gpointer            data)
665
714
{
666
715
  GimpImageEditor *image_editor = GIMP_IMAGE_EDITOR (editor);
667
716
 
668
 
  if (image_editor->gimage)
 
717
  if (image_editor->image)
669
718
    {
670
719
      GimpRGB color;
671
720
      gint    index;
672
721
 
673
 
      index = gimp_colormap_editor_col_index (editor);
 
722
      index = gimp_colormap_editor_get_index (editor, NULL);
674
723
 
675
 
      gimp_image_get_colormap_entry (image_editor->gimage, index, &color);
 
724
      gimp_image_get_colormap_entry (image_editor->image, index, &color);
676
725
 
677
726
      if (state & GDK_CONTROL_MASK)
678
727
        gimp_context_set_background (image_editor->context, &color);