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

« back to all changes in this revision

Viewing changes to app/widgets/gimptemplateview.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
 * gimptemplateview.c
25
25
 
26
26
#include <gtk/gtk.h>
27
27
 
 
28
#include "libgimpconfig/gimpconfig.h"
28
29
#include "libgimpwidgets/gimpwidgets.h"
29
30
 
30
31
#include "widgets-types.h"
31
32
 
32
 
#include "config/gimpconfig.h"
33
 
 
34
33
#include "core/gimp.h"
35
34
#include "core/gimpcontainer.h"
36
35
#include "core/gimpcontext.h"
48
47
#include "gimp-intl.h"
49
48
 
50
49
 
51
 
static void   gimp_template_view_class_init     (GimpTemplateViewClass *klass);
52
 
static void   gimp_template_view_init           (GimpTemplateView      *view);
53
 
 
54
 
static void   gimp_template_view_activate_item  (GimpContainerEditor *editor,
 
50
static void gimp_template_view_activate_item    (GimpContainerEditor *editor,
55
51
                                                 GimpViewable        *viewable);
56
52
static void gimp_template_view_tree_name_edited (GtkCellRendererText *cell,
57
53
                                                 const gchar         *path_str,
59
55
                                                 GimpTemplateView    *view);
60
56
 
61
57
 
62
 
static GimpContainerEditorClass *parent_class = NULL;
63
 
 
64
 
 
65
 
GType
66
 
gimp_template_view_get_type (void)
67
 
{
68
 
  static GType view_type = 0;
69
 
 
70
 
  if (! view_type)
71
 
    {
72
 
      static const GTypeInfo view_info =
73
 
      {
74
 
        sizeof (GimpTemplateViewClass),
75
 
        NULL,           /* base_init */
76
 
        NULL,           /* base_finalize */
77
 
        (GClassInitFunc) gimp_template_view_class_init,
78
 
        NULL,           /* class_finalize */
79
 
        NULL,           /* class_data */
80
 
        sizeof (GimpTemplateView),
81
 
        0,              /* n_preallocs */
82
 
        (GInstanceInitFunc) gimp_template_view_init,
83
 
      };
84
 
 
85
 
      view_type = g_type_register_static (GIMP_TYPE_CONTAINER_EDITOR,
86
 
                                          "GimpTemplateView",
87
 
                                          &view_info, 0);
88
 
    }
89
 
 
90
 
  return view_type;
91
 
}
 
58
G_DEFINE_TYPE (GimpTemplateView, gimp_template_view,
 
59
               GIMP_TYPE_CONTAINER_EDITOR);
 
60
 
 
61
#define parent_class gimp_template_view_parent_class
 
62
 
92
63
 
93
64
static void
94
65
gimp_template_view_class_init (GimpTemplateViewClass *klass)
95
66
{
96
67
  GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
97
68
 
98
 
  parent_class = g_type_class_peek_parent (klass);
99
 
 
100
69
  editor_class->activate_item = gimp_template_view_activate_item;
101
70
}
102
71
 
114
83
gimp_template_view_new (GimpViewType     view_type,
115
84
                        GimpContainer   *container,
116
85
                        GimpContext     *context,
117
 
                        gint             preview_size,
118
 
                        gint             preview_border_width,
 
86
                        gint             view_size,
 
87
                        gint             view_border_width,
119
88
                        GimpMenuFactory *menu_factory)
120
89
{
121
90
  GimpTemplateView    *template_view;
126
95
  if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (template_view),
127
96
                                         view_type,
128
97
                                         container, context,
129
 
                                         preview_size, preview_border_width,
 
98
                                         view_size, view_border_width,
130
99
                                         menu_factory, "<Templates>",
131
100
                                         "/templates-popup"))
132
101
    {
174
143
                                   "templates-delete", NULL);
175
144
 
176
145
  gimp_container_view_enable_dnd (editor->view,
177
 
                                  GTK_BUTTON (template_view->create_button),
178
 
                                  GIMP_TYPE_TEMPLATE);
179
 
  gimp_container_view_enable_dnd (editor->view,
180
 
                                  GTK_BUTTON (template_view->duplicate_button),
181
 
                                  GIMP_TYPE_TEMPLATE);
182
 
  gimp_container_view_enable_dnd (editor->view,
183
 
                                  GTK_BUTTON (template_view->edit_button),
184
 
                                  GIMP_TYPE_TEMPLATE);
185
 
  gimp_container_view_enable_dnd (editor->view,
186
 
                                  GTK_BUTTON (template_view->delete_button),
187
 
                                  GIMP_TYPE_TEMPLATE);
 
146
                                  GTK_BUTTON (template_view->create_button),
 
147
                                  GIMP_TYPE_TEMPLATE);
 
148
  gimp_container_view_enable_dnd (editor->view,
 
149
                                  GTK_BUTTON (template_view->duplicate_button),
 
150
                                  GIMP_TYPE_TEMPLATE);
 
151
  gimp_container_view_enable_dnd (editor->view,
 
152
                                  GTK_BUTTON (template_view->edit_button),
 
153
                                  GIMP_TYPE_TEMPLATE);
 
154
  gimp_container_view_enable_dnd (editor->view,
 
155
                                  GTK_BUTTON (template_view->delete_button),
 
156
                                  GIMP_TYPE_TEMPLATE);
188
157
 
189
158
  gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor);
190
159
 
248
217
        }
249
218
      else
250
219
        {
251
 
          gchar *name = gimp_viewable_get_description (renderer->viewable, NULL);
 
220
          gchar *name = gimp_viewable_get_description (renderer->viewable,
 
221
                                                       NULL);
252
222
 
253
223
          gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
254
224
                              tree_view->model_column_name, name,