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

« back to all changes in this revision

Viewing changes to app/widgets/gimpprogressdialog.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
 * gimpprogressdialog.c
35
35
#include "gimp-intl.h"
36
36
 
37
37
 
38
 
static void     gimp_progress_dialog_class_init (GimpProgressDialogClass *klass);
39
 
static void     gimp_progress_dialog_init       (GimpProgressDialog      *dialog);
40
 
static void     gimp_progress_dialog_progress_iface_init (GimpProgressInterface *progress_iface);
 
38
#define PROGRESS_DIALOG_WIDTH  400
 
39
 
 
40
 
 
41
static void    gimp_progress_dialog_progress_iface_init (GimpProgressInterface *iface);
41
42
 
42
43
static void     gimp_progress_dialog_response           (GtkDialog    *dialog,
43
44
                                                         gint          response_id);
53
54
static void     gimp_progress_dialog_progress_set_value (GimpProgress *progress,
54
55
                                                         gdouble       percentage);
55
56
static gdouble  gimp_progress_dialog_progress_get_value (GimpProgress *progress);
56
 
 
57
 
 
58
 
static GimpDialogClass *parent_class = NULL;
59
 
 
60
 
 
61
 
GType
62
 
gimp_progress_dialog_get_type (void)
63
 
{
64
 
  static GType dialog_type = 0;
65
 
 
66
 
  if (! dialog_type)
67
 
    {
68
 
      static const GTypeInfo dialog_info =
69
 
      {
70
 
        sizeof (GimpProgressDialogClass),
71
 
        (GBaseInitFunc) NULL,
72
 
        (GBaseFinalizeFunc) NULL,
73
 
        (GClassInitFunc) gimp_progress_dialog_class_init,
74
 
        NULL,           /* class_finalize */
75
 
        NULL,           /* class_data     */
76
 
        sizeof (GimpProgressDialog),
77
 
        0,              /* n_preallocs    */
78
 
        (GInstanceInitFunc) gimp_progress_dialog_init,
79
 
      };
80
 
 
81
 
      static const GInterfaceInfo progress_iface_info =
82
 
      {
83
 
        (GInterfaceInitFunc) gimp_progress_dialog_progress_iface_init,
84
 
        NULL,           /* iface_finalize */
85
 
        NULL            /* iface_data     */
86
 
      };
87
 
 
88
 
      dialog_type = g_type_register_static (GIMP_TYPE_DIALOG,
89
 
                                            "GimpProgressDialog",
90
 
                                            &dialog_info, 0);
91
 
 
92
 
      g_type_add_interface_static (dialog_type, GIMP_TYPE_PROGRESS,
93
 
                                   &progress_iface_info);
94
 
    }
95
 
 
96
 
  return dialog_type;
97
 
}
 
57
static void     gimp_progress_dialog_progress_pulse     (GimpProgress *progress);
 
58
 
 
59
 
 
60
G_DEFINE_TYPE_WITH_CODE (GimpProgressDialog, gimp_progress_dialog,
 
61
                         GIMP_TYPE_DIALOG,
 
62
                         G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS,
 
63
                                                gimp_progress_dialog_progress_iface_init))
 
64
 
 
65
#define parent_class gimp_progress_dialog_parent_class
 
66
 
98
67
 
99
68
static void
100
69
gimp_progress_dialog_class_init (GimpProgressDialogClass *klass)
101
70
{
102
71
  GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
103
72
 
104
 
  parent_class = g_type_class_peek_parent (klass);
105
 
 
106
73
  dialog_class->response = gimp_progress_dialog_response;
107
74
}
108
75
 
121
88
  gtk_dialog_add_button (GTK_DIALOG (dialog),
122
89
                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
123
90
  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
 
91
 
 
92
  gtk_widget_set_size_request (GTK_WIDGET (dialog), PROGRESS_DIALOG_WIDTH, -1);
124
93
}
125
94
 
126
95
static void
127
 
gimp_progress_dialog_progress_iface_init (GimpProgressInterface *progress_iface)
 
96
gimp_progress_dialog_progress_iface_init (GimpProgressInterface *iface)
128
97
{
129
 
  progress_iface->start     = gimp_progress_dialog_progress_start;
130
 
  progress_iface->end       = gimp_progress_dialog_progress_end;
131
 
  progress_iface->is_active = gimp_progress_dialog_progress_is_active;
132
 
  progress_iface->set_text  = gimp_progress_dialog_progress_set_text;
133
 
  progress_iface->set_value = gimp_progress_dialog_progress_set_value;
134
 
  progress_iface->get_value = gimp_progress_dialog_progress_get_value;
 
98
  iface->start     = gimp_progress_dialog_progress_start;
 
99
  iface->end       = gimp_progress_dialog_progress_end;
 
100
  iface->is_active = gimp_progress_dialog_progress_is_active;
 
101
  iface->set_text  = gimp_progress_dialog_progress_set_text;
 
102
  iface->set_value = gimp_progress_dialog_progress_set_value;
 
103
  iface->get_value = gimp_progress_dialog_progress_get_value;
 
104
  iface->pulse     = gimp_progress_dialog_progress_pulse;
135
105
}
136
106
 
137
107
static void
232
202
  return gimp_progress_get_value (GIMP_PROGRESS (dialog->box));
233
203
}
234
204
 
 
205
static void
 
206
gimp_progress_dialog_progress_pulse (GimpProgress *progress)
 
207
{
 
208
  GimpProgressDialog *dialog = GIMP_PROGRESS_DIALOG (progress);
 
209
 
 
210
  if (! dialog->box)
 
211
    return;
 
212
 
 
213
  gimp_progress_pulse (GIMP_PROGRESS (dialog->box));
 
214
}
 
215
 
235
216
GtkWidget *
236
217
gimp_progress_dialog_new (void)
237
218
{
238
219
  return g_object_new (GIMP_TYPE_PROGRESS_DIALOG,
239
220
                       "title",             _("Progress"),
240
221
                       "role",              "progress",
241
 
                       "skip_taskbar_hint", TRUE,
242
 
                       "skip_pager_hint",   TRUE,
 
222
                       "skip-taskbar-hint", TRUE,
 
223
                       "skip-pager-hint",   TRUE,
243
224
                       "resizable",         FALSE,
244
225
                       NULL);
245
226
}