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

« back to all changes in this revision

Viewing changes to app/dialogs/resolution-calibrate-dialog.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
46
46
 * is connected to a #GimpSizeEntry handling the resolution to be set.
47
47
 **/
48
48
void
49
 
resolution_calibrate_dialog (GtkWidget  *resolution_entry,
50
 
                             GdkPixbuf  *pixbuf)
 
49
resolution_calibrate_dialog (GtkWidget *resolution_entry,
 
50
                             GdkPixbuf *pixbuf)
51
51
{
52
 
  GtkWidget *dialog;
53
 
  GtkWidget *table;
54
 
  GtkWidget *vbox;
55
 
  GtkWidget *hbox;
56
 
  GtkWidget *ruler;
57
 
  GtkWidget *label;
58
 
  GdkScreen *screen;
 
52
  GtkWidget    *dialog;
 
53
  GtkWidget    *table;
 
54
  GtkWidget    *vbox;
 
55
  GtkWidget    *hbox;
 
56
  GtkWidget    *ruler;
 
57
  GtkWidget    *label;
 
58
  GdkScreen    *screen;
 
59
  GdkRectangle  rect;
 
60
  gint          monitor;
59
61
 
60
62
  g_return_if_fail (GIMP_IS_SIZE_ENTRY (resolution_entry));
 
63
  g_return_if_fail (GTK_WIDGET_REALIZED (resolution_entry));
61
64
  g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
62
65
 
63
66
  /*  this dialog can only exist once  */
65
68
    return;
66
69
 
67
70
  dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"),
68
 
                            "calibrate_resolution",
 
71
                            "gimp-resolution-calibration",
69
72
                            gtk_widget_get_toplevel (resolution_entry),
70
73
                            GTK_DIALOG_DESTROY_WITH_PARENT,
71
 
                            NULL, NULL,
72
 
 
73
 
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
74
 
                            GTK_STOCK_OK,     GTK_RESPONSE_OK,
75
 
 
76
 
                            NULL);
 
74
                            NULL, NULL,
 
75
 
 
76
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
77
                            GTK_STOCK_OK,     GTK_RESPONSE_OK,
 
78
 
 
79
                            NULL);
 
80
 
 
81
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
82
                                           GTK_RESPONSE_OK,
 
83
                                           GTK_RESPONSE_CANCEL,
 
84
                                           -1);
77
85
 
78
86
  screen = gtk_widget_get_screen (dialog);
79
 
 
80
 
  ruler_width  = gdk_screen_get_width (screen);
81
 
  ruler_height = gdk_screen_get_height (screen);
82
 
 
83
 
  ruler_width  = ruler_width  - 300 - (ruler_width  % 100);
84
 
  ruler_height = ruler_height - 300 - (ruler_height % 100);
 
87
  monitor = gdk_screen_get_monitor_at_window (screen,
 
88
                                              resolution_entry->window);
 
89
  gdk_screen_get_monitor_geometry (screen, monitor, &rect);
 
90
 
 
91
  ruler_width  = rect.width  - 300 - (rect.width  % 100);
 
92
  ruler_height = rect.height - 300 - (rect.height % 100);
85
93
 
86
94
  table = gtk_table_new (4, 4, FALSE);
87
95
  gtk_container_set_border_width (GTK_CONTAINER (table), 12);
101
109
  gtk_widget_set_size_request (ruler, ruler_width, 32);
102
110
  gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_width, 0, ruler_width);
103
111
  gtk_table_attach (GTK_TABLE (table), ruler, 1, 3, 0, 1,
104
 
                    GTK_SHRINK, GTK_SHRINK, 0, 0);
 
112
                    GTK_SHRINK, GTK_SHRINK, 0, 0);
105
113
  gtk_widget_show (ruler);
106
114
 
107
115
  ruler = gtk_vruler_new ();
108
116
  gtk_widget_set_size_request (ruler, 32, ruler_height);
109
117
  gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_height, 0, ruler_height);
110
118
  gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 3,
111
 
                    GTK_SHRINK, GTK_SHRINK, 0, 0);
 
119
                    GTK_SHRINK, GTK_SHRINK, 0, 0);
112
120
  gtk_widget_show (ruler);
113
121
 
114
122
  vbox = gtk_vbox_new (FALSE, 12);
138
146
 
139
147
  calibrate_entry =
140
148
    gimp_coordinates_new  (GIMP_UNIT_INCH, "%p",
141
 
                           FALSE, FALSE, 10,
142
 
                           GIMP_SIZE_ENTRY_UPDATE_SIZE,
143
 
                           FALSE,
144
 
                           FALSE,
145
 
                           _("_Horizontal:"),
146
 
                           ruler_width,
147
 
                           calibrate_xres,
148
 
                           1, GIMP_MAX_IMAGE_SIZE,
149
 
                           0, 0,
150
 
                           _("_Vertical:"),
151
 
                           ruler_height,
152
 
                           calibrate_yres,
153
 
                           1, GIMP_MAX_IMAGE_SIZE,
154
 
                           0, 0);
 
149
                           FALSE, FALSE, 10,
 
150
                           GIMP_SIZE_ENTRY_UPDATE_SIZE,
 
151
                           FALSE,
 
152
                           FALSE,
 
153
                           _("_Horizontal:"),
 
154
                           ruler_width,
 
155
                           calibrate_xres,
 
156
                           1, GIMP_MAX_IMAGE_SIZE,
 
157
                           0, 0,
 
158
                           _("_Vertical:"),
 
159
                           ruler_height,
 
160
                           calibrate_yres,
 
161
                           1, GIMP_MAX_IMAGE_SIZE,
 
162
                           0, 0);
155
163
  gtk_widget_hide (GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (calibrate_entry)));
156
164
  g_signal_connect (dialog, "destroy",
157
165
                    G_CALLBACK (gtk_widget_destroyed),