mirror of https://github.com/GNOME/gimp.git
Wishlist item #57669:
2001-11-16 Michael Natterer <mitch@gimp.org> Wishlist item #57669: * app/gimprc.[ch]: replaced gimprc option "allow-resize-windows" by "resize-windows-on-zoom" and "resize-windows-on-resize". * app/gui/preferences-dialog.c: added a toggle for "resize-windows-on-resize". * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-scale.c * app/tools/gimpmagnifytool.c * docs/gimprc.5.in * etc/gimprc.in * etc/gimprc.win32: changed accordingly. * app/display/gimpdisplay-area.[ch]: added gimp_area_new(). * app/display/gimpdisplay.c: cleanup usage of GimpArea. * app/display/gimpdisplayshell.[ch]: added configurable canvas padding color and a small color_panel to change it in the upper right corner of the window. * app/display/gimpdisplayshell-callbacks.[ch]: added a callback for the color_panel, initialize the color in the "realize" callback. Wishlist item #51548. * app/display/gimpdisplayshell-selection.[ch] * app/gui/menus.c * app/gui/view-commands.[ch]: made the layer boundary toggleable separately from the selection. * app/gui/color-notebook.c: #if 0'ed a debugging g_print().
This commit is contained in:
parent
a1439a3cca
commit
4403d58a62
38
ChangeLog
38
ChangeLog
|
@ -1,3 +1,41 @@
|
|||
2001-11-16 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Wishlist item #57669:
|
||||
|
||||
* app/gimprc.[ch]: replaced gimprc option "allow-resize-windows"
|
||||
by "resize-windows-on-zoom" and "resize-windows-on-resize".
|
||||
|
||||
* app/gui/preferences-dialog.c: added a toggle for
|
||||
"resize-windows-on-resize".
|
||||
|
||||
* app/display/gimpdisplayshell-handlers.c
|
||||
* app/display/gimpdisplayshell-scale.c
|
||||
* app/tools/gimpmagnifytool.c
|
||||
* docs/gimprc.5.in
|
||||
* etc/gimprc.in
|
||||
* etc/gimprc.win32: changed accordingly.
|
||||
|
||||
* app/display/gimpdisplay-area.[ch]: added gimp_area_new().
|
||||
|
||||
* app/display/gimpdisplay.c: cleanup usage of GimpArea.
|
||||
|
||||
* app/display/gimpdisplayshell.[ch]: added configurable canvas
|
||||
padding color and a small color_panel to change it in the upper
|
||||
right corner of the window.
|
||||
|
||||
* app/display/gimpdisplayshell-callbacks.[ch]: added a callback
|
||||
for the color_panel, initialize the color in the "realize"
|
||||
callback.
|
||||
|
||||
Wishlist item #51548.
|
||||
|
||||
* app/display/gimpdisplayshell-selection.[ch]
|
||||
* app/gui/menus.c
|
||||
* app/gui/view-commands.[ch]: made the layer boundary toggleable
|
||||
separately from the selection.
|
||||
|
||||
* app/gui/color-notebook.c: #if 0'ed a debugging g_print().
|
||||
|
||||
2001-11-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpcolorbutton.[ch]: added Black and White to popup
|
||||
|
|
|
@ -164,7 +164,29 @@ view_toggle_selection_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
gimp_display_shell_selection_toggle (shell->select);
|
||||
|
||||
gdisplays_flush ();
|
||||
gimp_display_shell_flush (shell);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayShell *shell;
|
||||
gint new_val;
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
new_val = GTK_CHECK_MENU_ITEM (widget)->active;
|
||||
|
||||
/* hidden == TRUE corresponds to the menu toggle being FALSE */
|
||||
if (new_val == shell->select->layer_hidden)
|
||||
{
|
||||
gimp_display_shell_selection_toggle_layer (shell->select);
|
||||
|
||||
gimp_display_shell_flush (shell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,35 +20,37 @@
|
|||
#define __VIEW_COMMANDS_H__
|
||||
|
||||
|
||||
void view_zoom_in_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_out_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_fit_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_cmd_callback (GtkWidget *widget,
|
||||
gpointer data,
|
||||
guint action);
|
||||
void view_dot_for_dot_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_info_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_nav_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_selection_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_rulers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_statusbar_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_snap_to_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_new_view_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_shrink_wrap_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_in_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_out_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_fit_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_cmd_callback (GtkWidget *widget,
|
||||
gpointer data,
|
||||
guint action);
|
||||
void view_dot_for_dot_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_info_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_nav_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_selection_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_rulers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_statusbar_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_snap_to_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_new_view_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_shrink_wrap_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __VIEW_COMMANDS_H__ */
|
||||
|
|
|
@ -28,6 +28,24 @@
|
|||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
|
||||
|
||||
GimpArea *
|
||||
gimp_area_new (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
GimpArea *area;
|
||||
|
||||
area = g_new (GimpArea, 1);
|
||||
|
||||
area->x1 = x1;
|
||||
area->y1 = y1;
|
||||
area->x2 = x2;
|
||||
area->y2 = y2;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
/*
|
||||
* As far as I can tell, this function takes a GimpArea and unifies it with
|
||||
* an existing list of GimpAreas, trying to avoid overdraw. [adam]
|
||||
|
|
|
@ -28,9 +28,14 @@ struct _GimpArea
|
|||
};
|
||||
|
||||
|
||||
GSList * gimp_display_area_list_process (GSList *list,
|
||||
GimpArea *area);
|
||||
GSList * gimp_display_area_list_free (GSList *list);
|
||||
GimpArea * gimp_area_new (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
|
||||
GSList * gimp_display_area_list_process (GSList *list,
|
||||
GimpArea *area);
|
||||
GSList * gimp_display_area_list_free (GSList *list);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_AREA_H__ */
|
||||
|
|
|
@ -288,18 +288,17 @@ gimp_display_add_update_area (GimpDisplay *gdisp,
|
|||
gint w,
|
||||
gint h)
|
||||
{
|
||||
GimpArea *ga;
|
||||
GimpArea *area;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
|
||||
|
||||
ga = g_new (GimpArea, 1);
|
||||
area = gimp_area_new (CLAMP (x, 0, gdisp->gimage->width),
|
||||
CLAMP (y, 0, gdisp->gimage->height),
|
||||
CLAMP (x + w, 0, gdisp->gimage->width),
|
||||
CLAMP (y + h, 0, gdisp->gimage->height));
|
||||
|
||||
ga->x1 = CLAMP (x, 0, gdisp->gimage->width);
|
||||
ga->y1 = CLAMP (y, 0, gdisp->gimage->height);
|
||||
ga->x2 = CLAMP (x + w, 0, gdisp->gimage->width);
|
||||
ga->y2 = CLAMP (y + h, 0, gdisp->gimage->height);
|
||||
|
||||
gdisp->update_areas = gimp_display_area_list_process (gdisp->update_areas, ga);
|
||||
gdisp->update_areas = gimp_display_area_list_process (gdisp->update_areas,
|
||||
area);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -518,9 +517,6 @@ static void
|
|||
gimp_display_flush_whenever (GimpDisplay *gdisp,
|
||||
gboolean now)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga;
|
||||
|
||||
/* Flush the items in the displays and updates lists -
|
||||
* but only if gdisplay has been mapped and exposed
|
||||
*/
|
||||
|
@ -535,22 +531,22 @@ gimp_display_flush_whenever (GimpDisplay *gdisp,
|
|||
{
|
||||
/* Synchronous */
|
||||
|
||||
list = gdisp->update_areas;
|
||||
while (list)
|
||||
GSList *list;
|
||||
GimpArea *area;
|
||||
|
||||
for (list = gdisp->update_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
/* Paint the area specified by the GimpArea */
|
||||
ga = (GimpArea *) list->data;
|
||||
|
||||
if ((ga->x1 != ga->x2) && (ga->y1 != ga->y2))
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
if ((area->x1 != area->x2) && (area->y1 != area->y2))
|
||||
{
|
||||
gimp_display_paint_area (gdisp,
|
||||
ga->x1,
|
||||
ga->y1,
|
||||
(ga->x2 - ga->x1),
|
||||
(ga->y2 - ga->y1));
|
||||
area->x1,
|
||||
area->y1,
|
||||
(area->x2 - area->x1),
|
||||
(area->y2 - area->y1));
|
||||
}
|
||||
|
||||
list = g_slist_next (list);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -582,26 +578,23 @@ static void
|
|||
gimp_display_idlerender_init (GimpDisplay *gdisp)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga, *new_ga;
|
||||
GimpArea *area, *new_area;
|
||||
|
||||
/* We need to merge the IdleRender's and the GimpDisplay's update_areas list
|
||||
* to keep track of which of the updates have been flushed and hence need
|
||||
* to be drawn.
|
||||
*/
|
||||
list = gdisp->update_areas;
|
||||
|
||||
while (list)
|
||||
for (list = gdisp->update_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
ga = (GimpArea *) list->data;
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
new_ga = g_new (GimpArea, 1);
|
||||
new_area = g_new (GimpArea, 1);
|
||||
|
||||
memcpy (new_ga, ga, sizeof (GimpArea));
|
||||
memcpy (new_area, area, sizeof (GimpArea));
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas, new_ga);
|
||||
|
||||
list = g_slist_next (list);
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas,
|
||||
new_area);
|
||||
}
|
||||
|
||||
/* If an idlerender was already running, merge the remainder of its
|
||||
|
@ -610,17 +603,17 @@ gimp_display_idlerender_init (GimpDisplay *gdisp)
|
|||
*/
|
||||
if (gdisp->idle_render.idle_id)
|
||||
{
|
||||
new_ga = g_new (GimpArea, 1);
|
||||
|
||||
new_ga->x1 = gdisp->idle_render.basex;
|
||||
new_ga->y1 = gdisp->idle_render.y;
|
||||
new_ga->x2 = gdisp->idle_render.basex + gdisp->idle_render.width;
|
||||
new_ga->y2 = gdisp->idle_render.y + (gdisp->idle_render.height -
|
||||
(gdisp->idle_render.y -
|
||||
gdisp->idle_render.basey));
|
||||
new_area =
|
||||
gimp_area_new (gdisp->idle_render.basex,
|
||||
gdisp->idle_render.y,
|
||||
gdisp->idle_render.basex + gdisp->idle_render.width,
|
||||
gdisp->idle_render.y + (gdisp->idle_render.height -
|
||||
(gdisp->idle_render.y -
|
||||
gdisp->idle_render.basey)));
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas, new_ga);
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas,
|
||||
new_area);
|
||||
|
||||
gimp_display_idle_render_next_area (gdisp);
|
||||
}
|
||||
|
@ -667,7 +660,7 @@ gimp_display_idlerender_callback (gpointer data)
|
|||
workw = gdisp->idle_render.basex + gdisp->idle_render.width - workx;
|
||||
}
|
||||
|
||||
if (worky+workh > gdisp->idle_render.basey+gdisp->idle_render.height)
|
||||
if (worky + workh > gdisp->idle_render.basey + gdisp->idle_render.height)
|
||||
{
|
||||
workh = gdisp->idle_render.basey + gdisp->idle_render.height - worky;
|
||||
}
|
||||
|
@ -704,27 +697,22 @@ gimp_display_idlerender_callback (gpointer data)
|
|||
static gboolean
|
||||
gimp_display_idle_render_next_area (GimpDisplay *gdisp)
|
||||
{
|
||||
GimpArea *ga;
|
||||
GSList *list;
|
||||
|
||||
list = gdisp->idle_render.update_areas;
|
||||
GimpArea *area;
|
||||
|
||||
if (list == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (! gdisp->idle_render.update_areas)
|
||||
return FALSE;
|
||||
|
||||
ga = (GimpArea *) list->data;
|
||||
area = (GimpArea *) gdisp->idle_render.update_areas->data;
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
g_slist_remove (gdisp->idle_render.update_areas, ga);
|
||||
g_slist_remove (gdisp->idle_render.update_areas, area);
|
||||
|
||||
gdisp->idle_render.x = gdisp->idle_render.basex = ga->x1;
|
||||
gdisp->idle_render.y = gdisp->idle_render.basey = ga->y1;
|
||||
gdisp->idle_render.width = ga->x2 - ga->x1;
|
||||
gdisp->idle_render.height = ga->y2 - ga->y1;
|
||||
gdisp->idle_render.x = gdisp->idle_render.basex = area->x1;
|
||||
gdisp->idle_render.y = gdisp->idle_render.basey = area->y1;
|
||||
gdisp->idle_render.width = area->x2 - area->x1;
|
||||
gdisp->idle_render.height = area->y2 - area->y1;
|
||||
|
||||
g_free (ga);
|
||||
g_free (area);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -1102,6 +1102,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
cnp);
|
||||
}
|
||||
|
||||
#if 0
|
||||
g_print ("RGB: %d %d %d HSV: %d %d %d ALPHA: %d\n",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
values[GIMP_COLOR_SELECTOR_GREEN],
|
||||
|
@ -1110,6 +1111,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
values[GIMP_COLOR_SELECTOR_SATURATION],
|
||||
values[GIMP_COLOR_SELECTOR_VALUE],
|
||||
values[GIMP_COLOR_SELECTOR_ALPHA]);
|
||||
#endif
|
||||
|
||||
g_snprintf (buffer, sizeof (buffer), "#%.2x%.2x%.2x",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
|
|
|
@ -110,7 +110,8 @@ static gint old_transparency_type;
|
|||
static gint old_transparency_size;
|
||||
static gint old_levels_of_undo;
|
||||
static gint old_marching_speed;
|
||||
static gboolean old_allow_resize_windows;
|
||||
static gboolean old_resize_windows_on_zoom;
|
||||
static gboolean old_resize_windows_on_resize;
|
||||
static gboolean old_auto_save;
|
||||
static gint old_preview_size;
|
||||
static gint old_nav_preview_size;
|
||||
|
@ -560,10 +561,15 @@ prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "marching-ants-speed");
|
||||
}
|
||||
if (gimprc.allow_resize_windows != old_allow_resize_windows)
|
||||
if (gimprc.resize_windows_on_zoom != old_resize_windows_on_zoom)
|
||||
{
|
||||
update = g_list_append (update, "allow-resize-windows");
|
||||
remove = g_list_append (remove, "dont-allow-resize-windows");
|
||||
update = g_list_append (update, "resize-windows-on-zoom");
|
||||
remove = g_list_append (remove, "dont-resize-windows-on-zoom");
|
||||
}
|
||||
if (gimprc.resize_windows_on_resize != old_resize_windows_on_resize)
|
||||
{
|
||||
update = g_list_append (update, "resize-windows-on-resize");
|
||||
remove = g_list_append (remove, "dont-resize-windows-on-resize");
|
||||
}
|
||||
if (gimprc.auto_save != old_auto_save)
|
||||
{
|
||||
|
@ -892,7 +898,8 @@ prefs_cancel_callback (GtkWidget *widget,
|
|||
gimp->config->thumbnail_mode = old_thumbnail_mode;
|
||||
|
||||
gimprc.marching_speed = old_marching_speed;
|
||||
gimprc.allow_resize_windows = old_allow_resize_windows;
|
||||
gimprc.resize_windows_on_zoom = old_resize_windows_on_zoom;
|
||||
gimprc.resize_windows_on_resize = old_resize_windows_on_resize;
|
||||
gimprc.auto_save = old_auto_save;
|
||||
gimprc.no_cursor_updating = old_no_cursor_updating;
|
||||
gimprc.perfectmouse = old_perfectmouse;
|
||||
|
@ -994,26 +1001,27 @@ prefs_toggle_callback (GtkWidget *widget,
|
|||
val = (gint *) data;
|
||||
|
||||
/* toggle buttos */
|
||||
if (data == &gimprc.allow_resize_windows ||
|
||||
data == &gimprc.auto_save ||
|
||||
data == &gimprc.no_cursor_updating ||
|
||||
data == &gimprc.perfectmouse ||
|
||||
data == &gimprc.show_tool_tips ||
|
||||
data == &gimprc.show_rulers ||
|
||||
data == &gimprc.show_statusbar ||
|
||||
data == &gimprc.confirm_on_close ||
|
||||
data == &gimprc.save_session_info ||
|
||||
data == &gimprc.save_device_status ||
|
||||
data == &gimprc.always_restore_session ||
|
||||
data == &gimprc.default_dot_for_dot ||
|
||||
data == &gimprc.use_help ||
|
||||
if (data == &gimprc.resize_windows_on_zoom ||
|
||||
data == &gimprc.resize_windows_on_resize ||
|
||||
data == &gimprc.auto_save ||
|
||||
data == &gimprc.no_cursor_updating ||
|
||||
data == &gimprc.perfectmouse ||
|
||||
data == &gimprc.show_tool_tips ||
|
||||
data == &gimprc.show_rulers ||
|
||||
data == &gimprc.show_statusbar ||
|
||||
data == &gimprc.confirm_on_close ||
|
||||
data == &gimprc.save_session_info ||
|
||||
data == &gimprc.save_device_status ||
|
||||
data == &gimprc.always_restore_session ||
|
||||
data == &gimprc.default_dot_for_dot ||
|
||||
data == &gimprc.use_help ||
|
||||
|
||||
data == &edit_stingy_memory_use ||
|
||||
data == &edit_install_cmap ||
|
||||
data == &edit_cycled_marching_ants ||
|
||||
data == &edit_show_indicators ||
|
||||
data == &edit_nav_window_per_display ||
|
||||
data == &edit_info_window_follows_mouse ||
|
||||
data == &edit_stingy_memory_use ||
|
||||
data == &edit_install_cmap ||
|
||||
data == &edit_cycled_marching_ants ||
|
||||
data == &edit_show_indicators ||
|
||||
data == &edit_nav_window_per_display ||
|
||||
data == &edit_info_window_follows_mouse ||
|
||||
data == &edit_disable_tearoff_menus)
|
||||
{
|
||||
*val = GTK_TOGGLE_BUTTON (widget)->active;
|
||||
|
@ -1528,7 +1536,8 @@ preferences_dialog_create (Gimp *gimp)
|
|||
old_transparency_type = gimprc.transparency_type;
|
||||
old_transparency_size = gimprc.transparency_size;
|
||||
old_marching_speed = gimprc.marching_speed;
|
||||
old_allow_resize_windows = gimprc.allow_resize_windows;
|
||||
old_resize_windows_on_zoom = gimprc.resize_windows_on_zoom;
|
||||
old_resize_windows_on_resize = gimprc.resize_windows_on_resize;
|
||||
old_auto_save = gimprc.auto_save;
|
||||
old_preview_size = gimprc.preview_size;
|
||||
old_nav_preview_size = gimprc.nav_preview_size;
|
||||
|
@ -2159,13 +2168,23 @@ preferences_dialog_create (Gimp *gimp)
|
|||
|
||||
button = gtk_check_button_new_with_label(_("Resize Window on Zoom"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
gimprc.allow_resize_windows);
|
||||
gimprc.resize_windows_on_zoom);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (G_OBJECT (button), "toggled",
|
||||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.allow_resize_windows);
|
||||
&gimprc.resize_windows_on_zoom);
|
||||
|
||||
button = gtk_check_button_new_with_label(_("Resize Window on Image Size Change"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
gimprc.resize_windows_on_resize);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (G_OBJECT (button), "toggled",
|
||||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.resize_windows_on_resize);
|
||||
|
||||
button = gtk_check_button_new_with_label(_("Show Rulers"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
|
|
|
@ -28,6 +28,24 @@
|
|||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
|
||||
|
||||
GimpArea *
|
||||
gimp_area_new (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
GimpArea *area;
|
||||
|
||||
area = g_new (GimpArea, 1);
|
||||
|
||||
area->x1 = x1;
|
||||
area->y1 = y1;
|
||||
area->x2 = x2;
|
||||
area->y2 = y2;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
/*
|
||||
* As far as I can tell, this function takes a GimpArea and unifies it with
|
||||
* an existing list of GimpAreas, trying to avoid overdraw. [adam]
|
||||
|
|
|
@ -28,9 +28,14 @@ struct _GimpArea
|
|||
};
|
||||
|
||||
|
||||
GSList * gimp_display_area_list_process (GSList *list,
|
||||
GimpArea *area);
|
||||
GSList * gimp_display_area_list_free (GSList *list);
|
||||
GimpArea * gimp_area_new (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
|
||||
GSList * gimp_display_area_list_process (GSList *list,
|
||||
GimpArea *area);
|
||||
GSList * gimp_display_area_list_free (GSList *list);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_AREA_H__ */
|
||||
|
|
|
@ -288,18 +288,17 @@ gimp_display_add_update_area (GimpDisplay *gdisp,
|
|||
gint w,
|
||||
gint h)
|
||||
{
|
||||
GimpArea *ga;
|
||||
GimpArea *area;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
|
||||
|
||||
ga = g_new (GimpArea, 1);
|
||||
area = gimp_area_new (CLAMP (x, 0, gdisp->gimage->width),
|
||||
CLAMP (y, 0, gdisp->gimage->height),
|
||||
CLAMP (x + w, 0, gdisp->gimage->width),
|
||||
CLAMP (y + h, 0, gdisp->gimage->height));
|
||||
|
||||
ga->x1 = CLAMP (x, 0, gdisp->gimage->width);
|
||||
ga->y1 = CLAMP (y, 0, gdisp->gimage->height);
|
||||
ga->x2 = CLAMP (x + w, 0, gdisp->gimage->width);
|
||||
ga->y2 = CLAMP (y + h, 0, gdisp->gimage->height);
|
||||
|
||||
gdisp->update_areas = gimp_display_area_list_process (gdisp->update_areas, ga);
|
||||
gdisp->update_areas = gimp_display_area_list_process (gdisp->update_areas,
|
||||
area);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -518,9 +517,6 @@ static void
|
|||
gimp_display_flush_whenever (GimpDisplay *gdisp,
|
||||
gboolean now)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga;
|
||||
|
||||
/* Flush the items in the displays and updates lists -
|
||||
* but only if gdisplay has been mapped and exposed
|
||||
*/
|
||||
|
@ -535,22 +531,22 @@ gimp_display_flush_whenever (GimpDisplay *gdisp,
|
|||
{
|
||||
/* Synchronous */
|
||||
|
||||
list = gdisp->update_areas;
|
||||
while (list)
|
||||
GSList *list;
|
||||
GimpArea *area;
|
||||
|
||||
for (list = gdisp->update_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
/* Paint the area specified by the GimpArea */
|
||||
ga = (GimpArea *) list->data;
|
||||
|
||||
if ((ga->x1 != ga->x2) && (ga->y1 != ga->y2))
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
if ((area->x1 != area->x2) && (area->y1 != area->y2))
|
||||
{
|
||||
gimp_display_paint_area (gdisp,
|
||||
ga->x1,
|
||||
ga->y1,
|
||||
(ga->x2 - ga->x1),
|
||||
(ga->y2 - ga->y1));
|
||||
area->x1,
|
||||
area->y1,
|
||||
(area->x2 - area->x1),
|
||||
(area->y2 - area->y1));
|
||||
}
|
||||
|
||||
list = g_slist_next (list);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -582,26 +578,23 @@ static void
|
|||
gimp_display_idlerender_init (GimpDisplay *gdisp)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga, *new_ga;
|
||||
GimpArea *area, *new_area;
|
||||
|
||||
/* We need to merge the IdleRender's and the GimpDisplay's update_areas list
|
||||
* to keep track of which of the updates have been flushed and hence need
|
||||
* to be drawn.
|
||||
*/
|
||||
list = gdisp->update_areas;
|
||||
|
||||
while (list)
|
||||
for (list = gdisp->update_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
ga = (GimpArea *) list->data;
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
new_ga = g_new (GimpArea, 1);
|
||||
new_area = g_new (GimpArea, 1);
|
||||
|
||||
memcpy (new_ga, ga, sizeof (GimpArea));
|
||||
memcpy (new_area, area, sizeof (GimpArea));
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas, new_ga);
|
||||
|
||||
list = g_slist_next (list);
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas,
|
||||
new_area);
|
||||
}
|
||||
|
||||
/* If an idlerender was already running, merge the remainder of its
|
||||
|
@ -610,17 +603,17 @@ gimp_display_idlerender_init (GimpDisplay *gdisp)
|
|||
*/
|
||||
if (gdisp->idle_render.idle_id)
|
||||
{
|
||||
new_ga = g_new (GimpArea, 1);
|
||||
|
||||
new_ga->x1 = gdisp->idle_render.basex;
|
||||
new_ga->y1 = gdisp->idle_render.y;
|
||||
new_ga->x2 = gdisp->idle_render.basex + gdisp->idle_render.width;
|
||||
new_ga->y2 = gdisp->idle_render.y + (gdisp->idle_render.height -
|
||||
(gdisp->idle_render.y -
|
||||
gdisp->idle_render.basey));
|
||||
new_area =
|
||||
gimp_area_new (gdisp->idle_render.basex,
|
||||
gdisp->idle_render.y,
|
||||
gdisp->idle_render.basex + gdisp->idle_render.width,
|
||||
gdisp->idle_render.y + (gdisp->idle_render.height -
|
||||
(gdisp->idle_render.y -
|
||||
gdisp->idle_render.basey)));
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas, new_ga);
|
||||
gimp_display_area_list_process (gdisp->idle_render.update_areas,
|
||||
new_area);
|
||||
|
||||
gimp_display_idle_render_next_area (gdisp);
|
||||
}
|
||||
|
@ -667,7 +660,7 @@ gimp_display_idlerender_callback (gpointer data)
|
|||
workw = gdisp->idle_render.basex + gdisp->idle_render.width - workx;
|
||||
}
|
||||
|
||||
if (worky+workh > gdisp->idle_render.basey+gdisp->idle_render.height)
|
||||
if (worky + workh > gdisp->idle_render.basey + gdisp->idle_render.height)
|
||||
{
|
||||
workh = gdisp->idle_render.basey + gdisp->idle_render.height - worky;
|
||||
}
|
||||
|
@ -704,27 +697,22 @@ gimp_display_idlerender_callback (gpointer data)
|
|||
static gboolean
|
||||
gimp_display_idle_render_next_area (GimpDisplay *gdisp)
|
||||
{
|
||||
GimpArea *ga;
|
||||
GSList *list;
|
||||
|
||||
list = gdisp->idle_render.update_areas;
|
||||
GimpArea *area;
|
||||
|
||||
if (list == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (! gdisp->idle_render.update_areas)
|
||||
return FALSE;
|
||||
|
||||
ga = (GimpArea *) list->data;
|
||||
area = (GimpArea *) gdisp->idle_render.update_areas->data;
|
||||
|
||||
gdisp->idle_render.update_areas =
|
||||
g_slist_remove (gdisp->idle_render.update_areas, ga);
|
||||
g_slist_remove (gdisp->idle_render.update_areas, area);
|
||||
|
||||
gdisp->idle_render.x = gdisp->idle_render.basex = ga->x1;
|
||||
gdisp->idle_render.y = gdisp->idle_render.basey = ga->y1;
|
||||
gdisp->idle_render.width = ga->x2 - ga->x1;
|
||||
gdisp->idle_render.height = ga->y2 - ga->y1;
|
||||
gdisp->idle_render.x = gdisp->idle_render.basex = area->x1;
|
||||
gdisp->idle_render.y = gdisp->idle_render.basey = area->y1;
|
||||
gdisp->idle_render.width = area->x2 - area->x1;
|
||||
gdisp->idle_render.height = area->y2 - area->y1;
|
||||
|
||||
g_free (ga);
|
||||
g_free (area);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "display-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
|
@ -49,6 +52,7 @@
|
|||
#include "gimpdisplayshell-scroll.h"
|
||||
#include "gimpdisplayshell-selection.h"
|
||||
|
||||
#include "colormaps.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -163,11 +167,43 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
|
|||
GimpDisplayShell *shell)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GdkColor color;
|
||||
guchar r, g, b;
|
||||
|
||||
gdisp = shell->gdisp;
|
||||
|
||||
gtk_widget_grab_focus (shell->canvas);
|
||||
|
||||
if (TRUE /* gimprc.use_style_padding_color */)
|
||||
{
|
||||
r = shell->canvas->style->bg[GTK_STATE_NORMAL].red >> 8;
|
||||
g = shell->canvas->style->bg[GTK_STATE_NORMAL].green >> 8;
|
||||
b = shell->canvas->style->bg[GTK_STATE_NORMAL].blue >> 8;
|
||||
|
||||
gimp_rgb_set_uchar (&shell->padding_color, r, g, b);
|
||||
|
||||
g_signal_handlers_block_by_func (G_OBJECT (shell->padding_button),
|
||||
gimp_display_shell_color_changed,
|
||||
shell);
|
||||
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (shell->padding_button),
|
||||
&shell->padding_color);
|
||||
|
||||
g_signal_handlers_unblock_by_func (G_OBJECT (shell->padding_button),
|
||||
gimp_display_shell_color_changed,
|
||||
shell);
|
||||
}
|
||||
|
||||
gimp_rgb_get_uchar (&shell->padding_color, &r, &g, &b);
|
||||
|
||||
shell->padding_gc = gdk_gc_new (canvas->window);
|
||||
|
||||
color.red = (r << 8) | r;
|
||||
color.green = (g << 8) | g;
|
||||
color.blue = (b << 8) | b;
|
||||
|
||||
gdk_gc_set_rgb_fg_color (shell->padding_gc, &color);
|
||||
|
||||
gdk_window_set_back_pixmap (shell->canvas->window, NULL, FALSE);
|
||||
|
||||
gimp_display_shell_resize_cursor_label (shell);
|
||||
|
@ -1079,3 +1115,25 @@ gimp_display_shell_origin_button_press (GtkWidget *widget,
|
|||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_color_changed (GtkWidget *widget,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
GdkColor color;
|
||||
guchar r, g, b;
|
||||
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (widget),
|
||||
&shell->padding_color);
|
||||
|
||||
gimp_rgb_get_uchar (&shell->padding_color, &r, &g, &b);
|
||||
|
||||
color.red = r + r * 256;
|
||||
color.green = g + g * 256;
|
||||
color.blue = b + b * 256;
|
||||
|
||||
gdk_gc_set_rgb_fg_color (shell->padding_gc, &color);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
gimp_display_shell_flush (shell);
|
||||
}
|
||||
|
|
|
@ -53,5 +53,8 @@ gboolean gimp_display_shell_origin_button_press (GtkWidget *widget,
|
|||
GdkEventButton *bevent,
|
||||
GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_color_changed (GtkWidget *widget,
|
||||
GimpDisplayShell *shell);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_CALLBACKS_H__ */
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "display-types.h"
|
||||
|
@ -37,6 +38,7 @@
|
|||
#include "core/gimplayermask.h"
|
||||
#include "core/gimppattern.h"
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpcursor.h"
|
||||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
@ -228,6 +230,10 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
|||
shell->cursor_x = 0;
|
||||
shell->cursor_y = 0;
|
||||
|
||||
shell->padding_button = NULL;
|
||||
gimp_rgb_set (&shell->padding_color, 1.0, 1.0, 1.0);
|
||||
shell->padding_gc = NULL;
|
||||
|
||||
shell->warning_dialog = NULL;
|
||||
shell->info_dialog = NULL;
|
||||
shell->nav_dialog = NULL;
|
||||
|
@ -294,6 +300,12 @@ gimp_display_shell_destroy (GtkObject *object)
|
|||
shell->iconmask = NULL;
|
||||
}
|
||||
|
||||
if (shell->padding_gc)
|
||||
{
|
||||
g_object_unref (G_OBJECT (shell->padding_gc));
|
||||
shell->padding_gc = NULL;
|
||||
}
|
||||
|
||||
if (shell->info_dialog)
|
||||
{
|
||||
info_window_free (shell->info_dialog);
|
||||
|
@ -337,6 +349,7 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
GtkWidget *main_vbox;
|
||||
GtkWidget *disp_vbox;
|
||||
GtkWidget *upper_hbox;
|
||||
GtkWidget *right_vbox;
|
||||
GtkWidget *lower_hbox;
|
||||
GtkWidget *inner_table;
|
||||
GtkWidget *status_hbox;
|
||||
|
@ -468,7 +481,10 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
* | | | +-- vruler
|
||||
* | | | +-- canvas
|
||||
* | | |
|
||||
* | | +-- vscrollbar
|
||||
* | | +-- right_vbox
|
||||
* | | |
|
||||
* | | +-- padding_button
|
||||
* | | +-- vscrollbar
|
||||
* | |
|
||||
* | +-- lower_hbox
|
||||
* | |
|
||||
|
@ -509,6 +525,11 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
gtk_box_pack_start (GTK_BOX (upper_hbox), inner_table, TRUE, TRUE, 0);
|
||||
gtk_widget_show (inner_table);
|
||||
|
||||
/* the vbox containing the color button and the vertical scrollbar */
|
||||
right_vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_box_pack_start (GTK_BOX (upper_hbox), right_vbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (right_vbox);
|
||||
|
||||
/* the hbox containing qmask buttons, vertical scrollbar and nav button */
|
||||
lower_hbox = gtk_hbox_new (FALSE, 1);
|
||||
gtk_box_pack_start (GTK_BOX (disp_vbox), lower_hbox, FALSE, FALSE, 0);
|
||||
|
@ -609,6 +630,20 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
G_CALLBACK (gimp_display_shell_canvas_events),
|
||||
shell);
|
||||
|
||||
/* create the contents of the right_vbox *********************************/
|
||||
shell->padding_button = gimp_color_panel_new (_("Set Canvas Padding Color"),
|
||||
&shell->padding_color,
|
||||
GIMP_COLOR_AREA_FLAT,
|
||||
15, 15);
|
||||
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
|
||||
|
||||
gimp_help_set_help_data (shell->padding_button,
|
||||
_("Set canvas padding color"), "#padding_button");
|
||||
|
||||
g_signal_connect (G_OBJECT (shell->padding_button), "color_changed",
|
||||
G_CALLBACK (gimp_display_shell_color_changed),
|
||||
shell);
|
||||
|
||||
/* create the contents of the lower_hbox *********************************/
|
||||
|
||||
/* the qmask buttons */
|
||||
|
@ -706,9 +741,6 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
|
||||
/* pack all the widgets **************************************************/
|
||||
|
||||
/* fill the upper_hbox */
|
||||
gtk_box_pack_start (GTK_BOX (upper_hbox), shell->vsb, FALSE, FALSE, 0);
|
||||
|
||||
/* fill the inner_table */
|
||||
gtk_table_attach (GTK_TABLE (inner_table), shell->origin, 0, 1, 0, 1,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
@ -720,6 +752,11 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
|
||||
/* fill the right_vbox */
|
||||
gtk_box_pack_start (GTK_BOX (right_vbox), shell->padding_button,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (right_vbox), shell->vsb, TRUE, TRUE, 0);
|
||||
|
||||
/* fill the lower_hbox */
|
||||
gtk_box_pack_start (GTK_BOX (lower_hbox), shell->qmaskoff, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (lower_hbox), shell->qmaskon, FALSE, FALSE, 0);
|
||||
|
@ -745,6 +782,8 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
gtk_widget_show (shell->vsb);
|
||||
gtk_widget_show (shell->hsb);
|
||||
|
||||
gtk_widget_show (shell->padding_button);
|
||||
|
||||
gtk_widget_show (shell->qmaskoff);
|
||||
gtk_widget_show (shell->qmaskon);
|
||||
gtk_widget_show (nav_ebox);
|
||||
|
@ -958,6 +997,7 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
|
|||
if (gdisp)
|
||||
{
|
||||
SET_STATE ("View/Toggle Selection", ! shell->select->hidden);
|
||||
SET_STATE ("View/Toggle Layer Boundary", ! shell->select->layer_hidden);
|
||||
SET_STATE ("View/Toggle Rulers",
|
||||
GTK_WIDGET_VISIBLE (shell->origin) ? 1 : 0);
|
||||
SET_STATE ("View/Toggle Guides", gdisp->draw_guides);
|
||||
|
@ -1226,12 +1266,10 @@ gimp_display_shell_add_expose_area (GimpDisplayShell *shell,
|
|||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
area = g_new (GimpArea, 1);
|
||||
|
||||
area->x1 = CLAMP (x, 0, shell->disp_width);
|
||||
area->y1 = CLAMP (y, 0, shell->disp_height);
|
||||
area->x2 = CLAMP (x + w, 0, shell->disp_width);
|
||||
area->y2 = CLAMP (y + h, 0, shell->disp_height);
|
||||
area = gimp_area_new (CLAMP (x, 0, shell->disp_width),
|
||||
CLAMP (y, 0, shell->disp_height),
|
||||
CLAMP (x + w, 0, shell->disp_width),
|
||||
CLAMP (y + h, 0, shell->disp_height));
|
||||
|
||||
shell->display_areas = gimp_display_area_list_process (shell->display_areas,
|
||||
area);
|
||||
|
@ -1290,7 +1328,7 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
|
|||
if (shell->display_areas)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga;
|
||||
GimpArea *area;
|
||||
|
||||
/* stop the currently active tool */
|
||||
tool_manager_control_active (shell->gdisp->gimage->gimp, PAUSE,
|
||||
|
@ -1299,11 +1337,14 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
|
|||
for (list = shell->display_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
/* Paint the area specified by the GimpArea */
|
||||
ga = (GimpArea *) list->data;
|
||||
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
gimp_display_shell_display_area (shell,
|
||||
ga->x1, ga->y1,
|
||||
(ga->x2 - ga->x1), (ga->y2 - ga->y1));
|
||||
area->x1,
|
||||
area->y1,
|
||||
(area->x2 - area->x1),
|
||||
(area->y2 - area->y1));
|
||||
}
|
||||
|
||||
/* Free the update lists */
|
||||
|
@ -1949,7 +1990,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (y1 < shell->disp_yoffset)
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x, y,
|
||||
w, shell->disp_yoffset - y);
|
||||
|
@ -1963,7 +2004,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (x1 < shell->disp_xoffset)
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x, y1,
|
||||
shell->disp_xoffset - x, h);
|
||||
|
@ -1977,7 +2018,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (x2 > (shell->disp_xoffset + sx))
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
shell->disp_xoffset + sx, y1,
|
||||
x2 - (shell->disp_xoffset + sx), h - (y1 - y));
|
||||
|
@ -1991,7 +2032,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (y2 > (shell->disp_yoffset + sy))
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x1, shell->disp_yoffset + sy,
|
||||
x2 - x1, y2 - (shell->disp_yoffset + sy));
|
||||
|
|
|
@ -90,33 +90,37 @@ struct _GimpDisplayShell
|
|||
|
||||
GdkGC *scroll_gc; /* GC for scrolling */
|
||||
|
||||
GdkPixmap *icon; /* Pixmap for the icon */
|
||||
GdkBitmap *iconmask; /* Bitmap for the icon mask */
|
||||
guint iconsize; /* size of the icon pixmap */
|
||||
gboolean icon_needs_update; /* Do we need to render a new icon? */
|
||||
guint icon_timeout_id; /* ID of the timeout-function */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
GdkPixmap *icon; /* Pixmap for the icon */
|
||||
GdkBitmap *iconmask; /* Bitmap for the icon mask */
|
||||
guint iconsize; /* size of the icon pixmap */
|
||||
gboolean icon_needs_update; /* Do we need to render a new icon? */
|
||||
guint icon_timeout_id; /* ID of the timeout-function */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
|
||||
GdkCursorType current_cursor; /* Currently installed main cursor */
|
||||
GimpToolCursorType tool_cursor; /* Current Tool cursor */
|
||||
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
|
||||
|
||||
GdkCursorType override_cursor; /* Overriding cursor */
|
||||
gboolean using_override_cursor; /* is the cursor overridden? */
|
||||
GdkCursorType override_cursor; /* Overriding cursor */
|
||||
gboolean using_override_cursor; /* is the cursor overridden? */
|
||||
|
||||
gboolean draw_cursor; /* should we draw software cursor ? */
|
||||
gint cursor_x; /* software cursor X value */
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
gboolean have_cursor; /* is cursor currently drawn ? */
|
||||
gboolean draw_cursor; /* should we draw software cursor ? */
|
||||
gboolean have_cursor; /* is cursor currently drawn ? */
|
||||
gint cursor_x; /* software cursor X value */
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
InfoDialog *info_dialog; /* image information dialog */
|
||||
NavigationDialog *nav_dialog; /* image navigation dialog */
|
||||
NavigationDialog *nav_popup; /* navigation popup */
|
||||
GtkWidget *padding_button; /* GimpColorPanel in the NE corner */
|
||||
GimpRGB padding_color; /* color of the empty around the image */
|
||||
GdkGC *padding_gc; /* GC with padding_color as BG */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
InfoDialog *info_dialog; /* image information dialog */
|
||||
NavigationDialog *nav_dialog; /* image navigation dialog */
|
||||
NavigationDialog *nav_popup; /* navigation popup */
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
GList *cd_list; /* color display conversion stuff */
|
||||
GtkWidget *cd_ui; /* color display filter dialog */
|
||||
GList *cd_list; /* color display conversion stuff */
|
||||
GtkWidget *cd_ui; /* color display filter dialog */
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
};
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ gimp_display_shell_size_changed_handler (GimpImage *gimage,
|
|||
GimpDisplayShell *shell)
|
||||
{
|
||||
gimp_display_shell_resize_cursor_label (shell);
|
||||
gimp_display_shell_scale_resize (shell, gimprc.allow_resize_windows, TRUE);
|
||||
gimp_display_shell_scale_resize (shell, gimprc.resize_windows_on_resize, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -178,7 +178,7 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
|
|||
|
||||
gimp_display_shell_resize_cursor_label (shell);
|
||||
gimp_display_shell_scale_resize (shell,
|
||||
gimprc.allow_resize_windows, TRUE);
|
||||
gimprc.resize_windows_on_zoom, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,8 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
|
|||
shell->offset_y = (gint) (offset_y - (shell->disp_height / 2));
|
||||
|
||||
/* resize the display */
|
||||
gimp_display_shell_scale_resize (shell, gimprc.allow_resize_windows, TRUE);
|
||||
gimp_display_shell_scale_resize (shell, gimprc.resize_windows_on_zoom,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -124,6 +124,7 @@ gimp_display_shell_selection_create (GdkWindow *win,
|
|||
new->recalc = TRUE;
|
||||
new->speed = speed;
|
||||
new->hidden = FALSE;
|
||||
new->layer_hidden = FALSE;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
new->points_in[i] = NULL;
|
||||
|
@ -348,6 +349,18 @@ gimp_display_shell_selection_toggle (Selection *select)
|
|||
gimp_display_shell_selection_start (select, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_selection_toggle_layer (Selection *select)
|
||||
{
|
||||
gimp_display_shell_selection_invis (select);
|
||||
gimp_display_shell_selection_layer_invis (select);
|
||||
|
||||
/* toggle the visibility */
|
||||
select->layer_hidden = select->layer_hidden ? FALSE : TRUE;
|
||||
|
||||
gimp_display_shell_selection_start (select, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
|
@ -514,12 +527,16 @@ selection_render_points (Selection *select)
|
|||
static void
|
||||
selection_draw (Selection *select)
|
||||
{
|
||||
if (! select->layer_hidden)
|
||||
{
|
||||
if (select->segs_layer && select->index_layer == 0)
|
||||
gdk_draw_segments (select->win, select->gc_layer,
|
||||
select->segs_layer, select->num_segs_layer);
|
||||
}
|
||||
|
||||
if (select->hidden)
|
||||
return;
|
||||
|
||||
if (select->segs_layer && select->index_layer == 0)
|
||||
gdk_draw_segments (select->win, select->gc_layer,
|
||||
select->segs_layer, select->num_segs_layer);
|
||||
#ifdef USE_XDRAWPOINTS
|
||||
#ifdef VERBOSE
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@ struct _Selection
|
|||
gboolean recalc; /* flag to recalculate the selection */
|
||||
gint speed; /* speed of marching ants */
|
||||
gboolean hidden; /* is the selection hidden? */
|
||||
gboolean layer_hidden; /* is the layer boundary hidden? */
|
||||
guint timeout_id; /* timer for successive draws */
|
||||
gint cycle; /* color cycling turned on */
|
||||
GdkPixmap *cycle_pix; /* cycling pixmap */
|
||||
|
@ -57,22 +58,23 @@ struct _Selection
|
|||
};
|
||||
|
||||
|
||||
Selection * gimp_display_shell_selection_create (GdkWindow *window,
|
||||
GimpDisplayShell *gdisp,
|
||||
gint size,
|
||||
gint width,
|
||||
gint speed);
|
||||
void gimp_display_shell_selection_free (Selection *select);
|
||||
Selection * gimp_display_shell_selection_create (GdkWindow *window,
|
||||
GimpDisplayShell *gdisp,
|
||||
gint size,
|
||||
gint width,
|
||||
gint speed);
|
||||
void gimp_display_shell_selection_free (Selection *select);
|
||||
|
||||
void gimp_display_shell_selection_pause (Selection *select);
|
||||
void gimp_display_shell_selection_resume (Selection *select);
|
||||
void gimp_display_shell_selection_pause (Selection *select);
|
||||
void gimp_display_shell_selection_resume (Selection *select);
|
||||
|
||||
void gimp_display_shell_selection_start (Selection *select,
|
||||
gboolean recalc);
|
||||
void gimp_display_shell_selection_invis (Selection *select);
|
||||
void gimp_display_shell_selection_layer_invis (Selection *select);
|
||||
void gimp_display_shell_selection_start (Selection *select,
|
||||
gboolean recalc);
|
||||
void gimp_display_shell_selection_invis (Selection *select);
|
||||
void gimp_display_shell_selection_layer_invis (Selection *select);
|
||||
|
||||
void gimp_display_shell_selection_toggle (Selection *select);
|
||||
void gimp_display_shell_selection_toggle (Selection *select);
|
||||
void gimp_display_shell_selection_toggle_layer (Selection *select);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_SELECTION_H__ */
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "display-types.h"
|
||||
|
@ -37,6 +38,7 @@
|
|||
#include "core/gimplayermask.h"
|
||||
#include "core/gimppattern.h"
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpcursor.h"
|
||||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
@ -228,6 +230,10 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
|||
shell->cursor_x = 0;
|
||||
shell->cursor_y = 0;
|
||||
|
||||
shell->padding_button = NULL;
|
||||
gimp_rgb_set (&shell->padding_color, 1.0, 1.0, 1.0);
|
||||
shell->padding_gc = NULL;
|
||||
|
||||
shell->warning_dialog = NULL;
|
||||
shell->info_dialog = NULL;
|
||||
shell->nav_dialog = NULL;
|
||||
|
@ -294,6 +300,12 @@ gimp_display_shell_destroy (GtkObject *object)
|
|||
shell->iconmask = NULL;
|
||||
}
|
||||
|
||||
if (shell->padding_gc)
|
||||
{
|
||||
g_object_unref (G_OBJECT (shell->padding_gc));
|
||||
shell->padding_gc = NULL;
|
||||
}
|
||||
|
||||
if (shell->info_dialog)
|
||||
{
|
||||
info_window_free (shell->info_dialog);
|
||||
|
@ -337,6 +349,7 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
GtkWidget *main_vbox;
|
||||
GtkWidget *disp_vbox;
|
||||
GtkWidget *upper_hbox;
|
||||
GtkWidget *right_vbox;
|
||||
GtkWidget *lower_hbox;
|
||||
GtkWidget *inner_table;
|
||||
GtkWidget *status_hbox;
|
||||
|
@ -468,7 +481,10 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
* | | | +-- vruler
|
||||
* | | | +-- canvas
|
||||
* | | |
|
||||
* | | +-- vscrollbar
|
||||
* | | +-- right_vbox
|
||||
* | | |
|
||||
* | | +-- padding_button
|
||||
* | | +-- vscrollbar
|
||||
* | |
|
||||
* | +-- lower_hbox
|
||||
* | |
|
||||
|
@ -509,6 +525,11 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
gtk_box_pack_start (GTK_BOX (upper_hbox), inner_table, TRUE, TRUE, 0);
|
||||
gtk_widget_show (inner_table);
|
||||
|
||||
/* the vbox containing the color button and the vertical scrollbar */
|
||||
right_vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_box_pack_start (GTK_BOX (upper_hbox), right_vbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (right_vbox);
|
||||
|
||||
/* the hbox containing qmask buttons, vertical scrollbar and nav button */
|
||||
lower_hbox = gtk_hbox_new (FALSE, 1);
|
||||
gtk_box_pack_start (GTK_BOX (disp_vbox), lower_hbox, FALSE, FALSE, 0);
|
||||
|
@ -609,6 +630,20 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
G_CALLBACK (gimp_display_shell_canvas_events),
|
||||
shell);
|
||||
|
||||
/* create the contents of the right_vbox *********************************/
|
||||
shell->padding_button = gimp_color_panel_new (_("Set Canvas Padding Color"),
|
||||
&shell->padding_color,
|
||||
GIMP_COLOR_AREA_FLAT,
|
||||
15, 15);
|
||||
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
|
||||
|
||||
gimp_help_set_help_data (shell->padding_button,
|
||||
_("Set canvas padding color"), "#padding_button");
|
||||
|
||||
g_signal_connect (G_OBJECT (shell->padding_button), "color_changed",
|
||||
G_CALLBACK (gimp_display_shell_color_changed),
|
||||
shell);
|
||||
|
||||
/* create the contents of the lower_hbox *********************************/
|
||||
|
||||
/* the qmask buttons */
|
||||
|
@ -706,9 +741,6 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
|
||||
/* pack all the widgets **************************************************/
|
||||
|
||||
/* fill the upper_hbox */
|
||||
gtk_box_pack_start (GTK_BOX (upper_hbox), shell->vsb, FALSE, FALSE, 0);
|
||||
|
||||
/* fill the inner_table */
|
||||
gtk_table_attach (GTK_TABLE (inner_table), shell->origin, 0, 1, 0, 1,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
@ -720,6 +752,11 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
|
||||
/* fill the right_vbox */
|
||||
gtk_box_pack_start (GTK_BOX (right_vbox), shell->padding_button,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (right_vbox), shell->vsb, TRUE, TRUE, 0);
|
||||
|
||||
/* fill the lower_hbox */
|
||||
gtk_box_pack_start (GTK_BOX (lower_hbox), shell->qmaskoff, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (lower_hbox), shell->qmaskon, FALSE, FALSE, 0);
|
||||
|
@ -745,6 +782,8 @@ gimp_display_shell_new (GimpDisplay *gdisp)
|
|||
gtk_widget_show (shell->vsb);
|
||||
gtk_widget_show (shell->hsb);
|
||||
|
||||
gtk_widget_show (shell->padding_button);
|
||||
|
||||
gtk_widget_show (shell->qmaskoff);
|
||||
gtk_widget_show (shell->qmaskon);
|
||||
gtk_widget_show (nav_ebox);
|
||||
|
@ -958,6 +997,7 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
|
|||
if (gdisp)
|
||||
{
|
||||
SET_STATE ("View/Toggle Selection", ! shell->select->hidden);
|
||||
SET_STATE ("View/Toggle Layer Boundary", ! shell->select->layer_hidden);
|
||||
SET_STATE ("View/Toggle Rulers",
|
||||
GTK_WIDGET_VISIBLE (shell->origin) ? 1 : 0);
|
||||
SET_STATE ("View/Toggle Guides", gdisp->draw_guides);
|
||||
|
@ -1226,12 +1266,10 @@ gimp_display_shell_add_expose_area (GimpDisplayShell *shell,
|
|||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
area = g_new (GimpArea, 1);
|
||||
|
||||
area->x1 = CLAMP (x, 0, shell->disp_width);
|
||||
area->y1 = CLAMP (y, 0, shell->disp_height);
|
||||
area->x2 = CLAMP (x + w, 0, shell->disp_width);
|
||||
area->y2 = CLAMP (y + h, 0, shell->disp_height);
|
||||
area = gimp_area_new (CLAMP (x, 0, shell->disp_width),
|
||||
CLAMP (y, 0, shell->disp_height),
|
||||
CLAMP (x + w, 0, shell->disp_width),
|
||||
CLAMP (y + h, 0, shell->disp_height));
|
||||
|
||||
shell->display_areas = gimp_display_area_list_process (shell->display_areas,
|
||||
area);
|
||||
|
@ -1290,7 +1328,7 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
|
|||
if (shell->display_areas)
|
||||
{
|
||||
GSList *list;
|
||||
GimpArea *ga;
|
||||
GimpArea *area;
|
||||
|
||||
/* stop the currently active tool */
|
||||
tool_manager_control_active (shell->gdisp->gimage->gimp, PAUSE,
|
||||
|
@ -1299,11 +1337,14 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
|
|||
for (list = shell->display_areas; list; list = g_slist_next (list))
|
||||
{
|
||||
/* Paint the area specified by the GimpArea */
|
||||
ga = (GimpArea *) list->data;
|
||||
|
||||
area = (GimpArea *) list->data;
|
||||
|
||||
gimp_display_shell_display_area (shell,
|
||||
ga->x1, ga->y1,
|
||||
(ga->x2 - ga->x1), (ga->y2 - ga->y1));
|
||||
area->x1,
|
||||
area->y1,
|
||||
(area->x2 - area->x1),
|
||||
(area->y2 - area->y1));
|
||||
}
|
||||
|
||||
/* Free the update lists */
|
||||
|
@ -1949,7 +1990,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (y1 < shell->disp_yoffset)
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x, y,
|
||||
w, shell->disp_yoffset - y);
|
||||
|
@ -1963,7 +2004,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (x1 < shell->disp_xoffset)
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x, y1,
|
||||
shell->disp_xoffset - x, h);
|
||||
|
@ -1977,7 +2018,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (x2 > (shell->disp_xoffset + sx))
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
shell->disp_xoffset + sx, y1,
|
||||
x2 - (shell->disp_xoffset + sx), h - (y1 - y));
|
||||
|
@ -1991,7 +2032,7 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
|||
if (y2 > (shell->disp_yoffset + sy))
|
||||
{
|
||||
gdk_draw_rectangle (shell->canvas->window,
|
||||
shell->canvas->style->bg_gc[GTK_STATE_NORMAL],
|
||||
shell->padding_gc,
|
||||
TRUE,
|
||||
x1, shell->disp_yoffset + sy,
|
||||
x2 - x1, y2 - (shell->disp_yoffset + sy));
|
||||
|
|
|
@ -90,33 +90,37 @@ struct _GimpDisplayShell
|
|||
|
||||
GdkGC *scroll_gc; /* GC for scrolling */
|
||||
|
||||
GdkPixmap *icon; /* Pixmap for the icon */
|
||||
GdkBitmap *iconmask; /* Bitmap for the icon mask */
|
||||
guint iconsize; /* size of the icon pixmap */
|
||||
gboolean icon_needs_update; /* Do we need to render a new icon? */
|
||||
guint icon_timeout_id; /* ID of the timeout-function */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
GdkPixmap *icon; /* Pixmap for the icon */
|
||||
GdkBitmap *iconmask; /* Bitmap for the icon mask */
|
||||
guint iconsize; /* size of the icon pixmap */
|
||||
gboolean icon_needs_update; /* Do we need to render a new icon? */
|
||||
guint icon_timeout_id; /* ID of the timeout-function */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
|
||||
GdkCursorType current_cursor; /* Currently installed main cursor */
|
||||
GimpToolCursorType tool_cursor; /* Current Tool cursor */
|
||||
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
|
||||
|
||||
GdkCursorType override_cursor; /* Overriding cursor */
|
||||
gboolean using_override_cursor; /* is the cursor overridden? */
|
||||
GdkCursorType override_cursor; /* Overriding cursor */
|
||||
gboolean using_override_cursor; /* is the cursor overridden? */
|
||||
|
||||
gboolean draw_cursor; /* should we draw software cursor ? */
|
||||
gint cursor_x; /* software cursor X value */
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
gboolean have_cursor; /* is cursor currently drawn ? */
|
||||
gboolean draw_cursor; /* should we draw software cursor ? */
|
||||
gboolean have_cursor; /* is cursor currently drawn ? */
|
||||
gint cursor_x; /* software cursor X value */
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
InfoDialog *info_dialog; /* image information dialog */
|
||||
NavigationDialog *nav_dialog; /* image navigation dialog */
|
||||
NavigationDialog *nav_popup; /* navigation popup */
|
||||
GtkWidget *padding_button; /* GimpColorPanel in the NE corner */
|
||||
GimpRGB padding_color; /* color of the empty around the image */
|
||||
GdkGC *padding_gc; /* GC with padding_color as BG */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
InfoDialog *info_dialog; /* image information dialog */
|
||||
NavigationDialog *nav_dialog; /* image navigation dialog */
|
||||
NavigationDialog *nav_popup; /* navigation popup */
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
GList *cd_list; /* color display conversion stuff */
|
||||
GtkWidget *cd_ui; /* color display filter dialog */
|
||||
GList *cd_list; /* color display conversion stuff */
|
||||
GtkWidget *cd_ui; /* color display filter dialog */
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
};
|
||||
|
||||
|
|
135
app/gimprc.c
135
app/gimprc.c
|
@ -207,7 +207,8 @@ GimpRc gimprc =
|
|||
/* install_cmap */ FALSE,
|
||||
/* cycled_marching_ants */ 0,
|
||||
/* default_threshold */ 15,
|
||||
/* allow_resize_windows */ FALSE,
|
||||
/* resize_windows_on_zoom */ FALSE,
|
||||
/* resize_windows_on_resize */ FALSE,
|
||||
/* no_cursor_updating */ FALSE,
|
||||
/* preview_size */ 32,
|
||||
/* nav_preview_size */ 112,
|
||||
|
@ -245,72 +246,74 @@ static GHashTable *parse_func_hash = NULL;
|
|||
|
||||
static ParseFunc funcs[] =
|
||||
{
|
||||
{ "gamma-correction", TT_DOUBLE, &gimprc.gamma_val, NULL },
|
||||
{ "marching-ants-speed", TT_INT, &gimprc.marching_speed, NULL },
|
||||
{ "last-opened-size", TT_INT, &gimprc.last_opened_size, NULL },
|
||||
{ "transparency-type", TT_INT, &gimprc.transparency_type, NULL },
|
||||
{ "perfect-mouse", TT_BOOLEAN, &gimprc.perfectmouse, NULL },
|
||||
{ "transparency-size", TT_INT, &gimprc.transparency_size, NULL },
|
||||
{ "min-colors", TT_INT, &gimprc.min_colors, NULL },
|
||||
{ "install-colormap", TT_BOOLEAN, &gimprc.install_cmap, NULL },
|
||||
{ "colormap-cycling", TT_BOOLEAN, &gimprc.cycled_marching_ants, NULL },
|
||||
{ "default-threshold", TT_INT, &gimprc.default_threshold, NULL },
|
||||
{ "allow-resize-windows", TT_BOOLEAN, &gimprc.allow_resize_windows, NULL },
|
||||
{ "dont-allow-resize-windows", TT_BOOLEAN, NULL, &gimprc.allow_resize_windows },
|
||||
{ "cursor-updating", TT_BOOLEAN, NULL, &gimprc.no_cursor_updating },
|
||||
{ "no-cursor-updating", TT_BOOLEAN, &gimprc.no_cursor_updating, NULL },
|
||||
{ "preview-size", TT_XPREVSIZE, &gimprc.preview_size, NULL },
|
||||
{ "nav-preview-size", TT_XNAVPREVSIZE, &gimprc.nav_preview_size, NULL },
|
||||
{ "show-rulers", TT_BOOLEAN, &gimprc.show_rulers, NULL },
|
||||
{ "dont-show-rulers", TT_BOOLEAN, NULL, &gimprc.show_rulers },
|
||||
{ "show-statusbar", TT_BOOLEAN, &gimprc.show_statusbar, NULL },
|
||||
{ "dont-show-statusbar", TT_BOOLEAN, NULL, &gimprc.show_statusbar },
|
||||
{ "auto-save", TT_BOOLEAN, &gimprc.auto_save, NULL },
|
||||
{ "dont-auto-save", TT_BOOLEAN, NULL, &gimprc.auto_save },
|
||||
{ "confirm-on-close", TT_BOOLEAN, &gimprc.confirm_on_close, NULL },
|
||||
{ "dont-confirm-on-close", TT_BOOLEAN, NULL, &gimprc.confirm_on_close },
|
||||
{ "save-session-info", TT_BOOLEAN, &gimprc.save_session_info, NULL },
|
||||
{ "dont-save-session-info", TT_BOOLEAN, NULL, &gimprc.save_session_info },
|
||||
{ "save-device-status", TT_BOOLEAN, &gimprc.save_device_status, NULL },
|
||||
{ "dont-save-device-status", TT_BOOLEAN, NULL, &gimprc.save_device_status },
|
||||
{ "always-restore-session", TT_BOOLEAN, &gimprc.always_restore_session , NULL },
|
||||
{ "show-tips", TT_BOOLEAN, &gimprc.show_tips, NULL },
|
||||
{ "dont-show-tips", TT_BOOLEAN, NULL, &gimprc.show_tips },
|
||||
{ "last-tip-shown", TT_INT, &gimprc.last_tip, NULL },
|
||||
{ "show-tool-tips", TT_BOOLEAN, &gimprc.show_tool_tips, NULL },
|
||||
{ "dont-show-tool-tips", TT_BOOLEAN, NULL, &gimprc.show_tool_tips },
|
||||
{ "default-dot-for-dot", TT_BOOLEAN, &gimprc.default_dot_for_dot, NULL },
|
||||
{ "monitor-xresolution", TT_DOUBLE, &gimprc.monitor_xres, NULL },
|
||||
{ "monitor-yresolution", TT_DOUBLE, &gimprc.monitor_yres, NULL },
|
||||
{ "image-title-format", TT_STRING, &gimprc.image_title_format, NULL },
|
||||
{ "global-paint-options", TT_BOOLEAN, &gimprc.global_paint_options, NULL },
|
||||
{ "show-indicators", TT_BOOLEAN, &gimprc.show_indicators, NULL },
|
||||
{ "dont-show-indicators", TT_BOOLEAN, NULL, &gimprc.show_indicators },
|
||||
{ "no-global-paint-options", TT_BOOLEAN, NULL, &gimprc.global_paint_options },
|
||||
{ "max-new-image-size", TT_MEMSIZE, &gimprc.max_new_image_size, NULL },
|
||||
{ "trust-dirty-flag", TT_BOOLEAN, &gimprc.trust_dirty_flag, NULL },
|
||||
{ "dont-trust-dirty-flag", TT_BOOLEAN, NULL, &gimprc.trust_dirty_flag },
|
||||
{ "use-help", TT_BOOLEAN, &gimprc.use_help, NULL },
|
||||
{ "dont-use-help", TT_BOOLEAN, NULL, &gimprc.use_help },
|
||||
{ "nav-window-per-display", TT_BOOLEAN, &gimprc.nav_window_per_display, NULL },
|
||||
{ "nav-window-follows-auto", TT_BOOLEAN, NULL, &gimprc.nav_window_per_display },
|
||||
{ "info-window-follows-mouse", TT_BOOLEAN, &gimprc.info_window_follows_mouse, NULL },
|
||||
{ "info-window-per-display", TT_BOOLEAN, NULL, &gimprc.info_window_follows_mouse },
|
||||
{ "help-browser", TT_XHELPBROWSER, &gimprc.help_browser, NULL },
|
||||
{ "cursor-mode", TT_XCURSORMODE, &gimprc.cursor_mode, NULL },
|
||||
{ "disable-tearoff-menus", TT_BOOLEAN, &gimprc.disable_tearoff_menus, NULL },
|
||||
{ "theme-path", TT_PATH, &gimprc.theme_path, NULL },
|
||||
{ "theme", TT_STRING, &gimprc.theme, NULL },
|
||||
{ "gamma-correction", TT_DOUBLE, &gimprc.gamma_val, NULL },
|
||||
{ "marching-ants-speed", TT_INT, &gimprc.marching_speed, NULL },
|
||||
{ "last-opened-size", TT_INT, &gimprc.last_opened_size, NULL },
|
||||
{ "transparency-type", TT_INT, &gimprc.transparency_type, NULL },
|
||||
{ "perfect-mouse", TT_BOOLEAN, &gimprc.perfectmouse, NULL },
|
||||
{ "transparency-size", TT_INT, &gimprc.transparency_size, NULL },
|
||||
{ "min-colors", TT_INT, &gimprc.min_colors, NULL },
|
||||
{ "install-colormap", TT_BOOLEAN, &gimprc.install_cmap, NULL },
|
||||
{ "colormap-cycling", TT_BOOLEAN, &gimprc.cycled_marching_ants, NULL },
|
||||
{ "default-threshold", TT_INT, &gimprc.default_threshold, NULL },
|
||||
{ "resize-windows-on-zoom", TT_BOOLEAN, &gimprc.resize_windows_on_zoom, NULL },
|
||||
{ "dont-resize-windows-on-zoom", TT_BOOLEAN, NULL, &gimprc.resize_windows_on_zoom },
|
||||
{ "resize-windows-on-resize", TT_BOOLEAN, &gimprc.resize_windows_on_resize, NULL },
|
||||
{ "dont-resize-windows-on-resize", TT_BOOLEAN, NULL, &gimprc.resize_windows_on_resize },
|
||||
{ "cursor-updating", TT_BOOLEAN, NULL, &gimprc.no_cursor_updating },
|
||||
{ "no-cursor-updating", TT_BOOLEAN, &gimprc.no_cursor_updating, NULL },
|
||||
{ "preview-size", TT_XPREVSIZE, &gimprc.preview_size, NULL },
|
||||
{ "nav-preview-size", TT_XNAVPREVSIZE, &gimprc.nav_preview_size, NULL },
|
||||
{ "show-rulers", TT_BOOLEAN, &gimprc.show_rulers, NULL },
|
||||
{ "dont-show-rulers", TT_BOOLEAN, NULL, &gimprc.show_rulers },
|
||||
{ "show-statusbar", TT_BOOLEAN, &gimprc.show_statusbar, NULL },
|
||||
{ "dont-show-statusbar", TT_BOOLEAN, NULL, &gimprc.show_statusbar },
|
||||
{ "auto-save", TT_BOOLEAN, &gimprc.auto_save, NULL },
|
||||
{ "dont-auto-save", TT_BOOLEAN, NULL, &gimprc.auto_save },
|
||||
{ "confirm-on-close", TT_BOOLEAN, &gimprc.confirm_on_close, NULL },
|
||||
{ "dont-confirm-on-close", TT_BOOLEAN, NULL, &gimprc.confirm_on_close },
|
||||
{ "save-session-info", TT_BOOLEAN, &gimprc.save_session_info, NULL },
|
||||
{ "dont-save-session-info", TT_BOOLEAN, NULL, &gimprc.save_session_info },
|
||||
{ "save-device-status", TT_BOOLEAN, &gimprc.save_device_status, NULL },
|
||||
{ "dont-save-device-status", TT_BOOLEAN, NULL, &gimprc.save_device_status },
|
||||
{ "always-restore-session", TT_BOOLEAN, &gimprc.always_restore_session , NULL },
|
||||
{ "show-tips", TT_BOOLEAN, &gimprc.show_tips, NULL },
|
||||
{ "dont-show-tips", TT_BOOLEAN, NULL, &gimprc.show_tips },
|
||||
{ "last-tip-shown", TT_INT, &gimprc.last_tip, NULL },
|
||||
{ "show-tool-tips", TT_BOOLEAN, &gimprc.show_tool_tips, NULL },
|
||||
{ "dont-show-tool-tips", TT_BOOLEAN, NULL, &gimprc.show_tool_tips },
|
||||
{ "default-dot-for-dot", TT_BOOLEAN, &gimprc.default_dot_for_dot, NULL },
|
||||
{ "monitor-xresolution", TT_DOUBLE, &gimprc.monitor_xres, NULL },
|
||||
{ "monitor-yresolution", TT_DOUBLE, &gimprc.monitor_yres, NULL },
|
||||
{ "image-title-format", TT_STRING, &gimprc.image_title_format, NULL },
|
||||
{ "global-paint-options", TT_BOOLEAN, &gimprc.global_paint_options, NULL },
|
||||
{ "show-indicators", TT_BOOLEAN, &gimprc.show_indicators, NULL },
|
||||
{ "dont-show-indicators", TT_BOOLEAN, NULL, &gimprc.show_indicators },
|
||||
{ "no-global-paint-options", TT_BOOLEAN, NULL, &gimprc.global_paint_options },
|
||||
{ "max-new-image-size", TT_MEMSIZE, &gimprc.max_new_image_size, NULL },
|
||||
{ "trust-dirty-flag", TT_BOOLEAN, &gimprc.trust_dirty_flag, NULL },
|
||||
{ "dont-trust-dirty-flag", TT_BOOLEAN, NULL, &gimprc.trust_dirty_flag },
|
||||
{ "use-help", TT_BOOLEAN, &gimprc.use_help, NULL },
|
||||
{ "dont-use-help", TT_BOOLEAN, NULL, &gimprc.use_help },
|
||||
{ "nav-window-per-display", TT_BOOLEAN, &gimprc.nav_window_per_display, NULL },
|
||||
{ "nav-window-follows-auto", TT_BOOLEAN, NULL, &gimprc.nav_window_per_display },
|
||||
{ "info-window-follows-mouse", TT_BOOLEAN, &gimprc.info_window_follows_mouse, NULL },
|
||||
{ "info-window-per-display", TT_BOOLEAN, NULL, &gimprc.info_window_follows_mouse },
|
||||
{ "help-browser", TT_XHELPBROWSER, &gimprc.help_browser, NULL },
|
||||
{ "cursor-mode", TT_XCURSORMODE, &gimprc.cursor_mode, NULL },
|
||||
{ "disable-tearoff-menus", TT_BOOLEAN, &gimprc.disable_tearoff_menus, NULL },
|
||||
{ "theme-path", TT_PATH, &gimprc.theme_path, NULL },
|
||||
{ "theme", TT_STRING, &gimprc.theme, NULL },
|
||||
|
||||
{ "parasite", TT_XPARASITE, NULL, NULL },
|
||||
{ "plug-in", TT_XPLUGIN, NULL, NULL },
|
||||
{ "plug-in-def", TT_XPLUGINDEF, NULL, NULL },
|
||||
{ "menu-path", TT_XMENUPATH, NULL, NULL },
|
||||
{ "device", TT_XDEVICE, NULL, NULL },
|
||||
{ "session-info", TT_XSESSIONINFO, NULL, NULL },
|
||||
{ "color-history", TT_XCOLORHISTORY, NULL, NULL },
|
||||
{ "unit-info", TT_XUNITINFO, NULL, NULL },
|
||||
{ "document", TT_XDOCUMENT, NULL, NULL }
|
||||
{ "parasite", TT_XPARASITE, NULL, NULL },
|
||||
{ "plug-in", TT_XPLUGIN, NULL, NULL },
|
||||
{ "plug-in-def", TT_XPLUGINDEF, NULL, NULL },
|
||||
{ "menu-path", TT_XMENUPATH, NULL, NULL },
|
||||
{ "device", TT_XDEVICE, NULL, NULL },
|
||||
{ "session-info", TT_XSESSIONINFO, NULL, NULL },
|
||||
{ "color-history", TT_XCOLORHISTORY, NULL, NULL },
|
||||
{ "unit-info", TT_XUNITINFO, NULL, NULL },
|
||||
{ "document", TT_XDOCUMENT, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ struct _GimpRc
|
|||
gboolean install_cmap;
|
||||
gboolean cycled_marching_ants;
|
||||
gint default_threshold;
|
||||
gboolean allow_resize_windows;
|
||||
gboolean resize_windows_on_zoom;
|
||||
gboolean resize_windows_on_resize;
|
||||
gboolean no_cursor_updating;
|
||||
gint preview_size;
|
||||
gint nav_preview_size;
|
||||
|
|
|
@ -1102,6 +1102,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
cnp);
|
||||
}
|
||||
|
||||
#if 0
|
||||
g_print ("RGB: %d %d %d HSV: %d %d %d ALPHA: %d\n",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
values[GIMP_COLOR_SELECTOR_GREEN],
|
||||
|
@ -1110,6 +1111,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
values[GIMP_COLOR_SELECTOR_SATURATION],
|
||||
values[GIMP_COLOR_SELECTOR_VALUE],
|
||||
values[GIMP_COLOR_SELECTOR_ALPHA]);
|
||||
#endif
|
||||
|
||||
g_snprintf (buffer, sizeof (buffer), "#%.2x%.2x%.2x",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
|
|
|
@ -599,14 +599,10 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
view_toggle_selection_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
{ { N_("/View/Toggle Layer Boundary"), NULL,
|
||||
view_toggle_layer_boundary_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Guides"), "<control><shift>T",
|
||||
view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
|
@ -618,6 +614,17 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/New View"), NULL,
|
||||
view_new_view_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_NEW },
|
||||
|
|
|
@ -110,7 +110,8 @@ static gint old_transparency_type;
|
|||
static gint old_transparency_size;
|
||||
static gint old_levels_of_undo;
|
||||
static gint old_marching_speed;
|
||||
static gboolean old_allow_resize_windows;
|
||||
static gboolean old_resize_windows_on_zoom;
|
||||
static gboolean old_resize_windows_on_resize;
|
||||
static gboolean old_auto_save;
|
||||
static gint old_preview_size;
|
||||
static gint old_nav_preview_size;
|
||||
|
@ -560,10 +561,15 @@ prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "marching-ants-speed");
|
||||
}
|
||||
if (gimprc.allow_resize_windows != old_allow_resize_windows)
|
||||
if (gimprc.resize_windows_on_zoom != old_resize_windows_on_zoom)
|
||||
{
|
||||
update = g_list_append (update, "allow-resize-windows");
|
||||
remove = g_list_append (remove, "dont-allow-resize-windows");
|
||||
update = g_list_append (update, "resize-windows-on-zoom");
|
||||
remove = g_list_append (remove, "dont-resize-windows-on-zoom");
|
||||
}
|
||||
if (gimprc.resize_windows_on_resize != old_resize_windows_on_resize)
|
||||
{
|
||||
update = g_list_append (update, "resize-windows-on-resize");
|
||||
remove = g_list_append (remove, "dont-resize-windows-on-resize");
|
||||
}
|
||||
if (gimprc.auto_save != old_auto_save)
|
||||
{
|
||||
|
@ -892,7 +898,8 @@ prefs_cancel_callback (GtkWidget *widget,
|
|||
gimp->config->thumbnail_mode = old_thumbnail_mode;
|
||||
|
||||
gimprc.marching_speed = old_marching_speed;
|
||||
gimprc.allow_resize_windows = old_allow_resize_windows;
|
||||
gimprc.resize_windows_on_zoom = old_resize_windows_on_zoom;
|
||||
gimprc.resize_windows_on_resize = old_resize_windows_on_resize;
|
||||
gimprc.auto_save = old_auto_save;
|
||||
gimprc.no_cursor_updating = old_no_cursor_updating;
|
||||
gimprc.perfectmouse = old_perfectmouse;
|
||||
|
@ -994,26 +1001,27 @@ prefs_toggle_callback (GtkWidget *widget,
|
|||
val = (gint *) data;
|
||||
|
||||
/* toggle buttos */
|
||||
if (data == &gimprc.allow_resize_windows ||
|
||||
data == &gimprc.auto_save ||
|
||||
data == &gimprc.no_cursor_updating ||
|
||||
data == &gimprc.perfectmouse ||
|
||||
data == &gimprc.show_tool_tips ||
|
||||
data == &gimprc.show_rulers ||
|
||||
data == &gimprc.show_statusbar ||
|
||||
data == &gimprc.confirm_on_close ||
|
||||
data == &gimprc.save_session_info ||
|
||||
data == &gimprc.save_device_status ||
|
||||
data == &gimprc.always_restore_session ||
|
||||
data == &gimprc.default_dot_for_dot ||
|
||||
data == &gimprc.use_help ||
|
||||
if (data == &gimprc.resize_windows_on_zoom ||
|
||||
data == &gimprc.resize_windows_on_resize ||
|
||||
data == &gimprc.auto_save ||
|
||||
data == &gimprc.no_cursor_updating ||
|
||||
data == &gimprc.perfectmouse ||
|
||||
data == &gimprc.show_tool_tips ||
|
||||
data == &gimprc.show_rulers ||
|
||||
data == &gimprc.show_statusbar ||
|
||||
data == &gimprc.confirm_on_close ||
|
||||
data == &gimprc.save_session_info ||
|
||||
data == &gimprc.save_device_status ||
|
||||
data == &gimprc.always_restore_session ||
|
||||
data == &gimprc.default_dot_for_dot ||
|
||||
data == &gimprc.use_help ||
|
||||
|
||||
data == &edit_stingy_memory_use ||
|
||||
data == &edit_install_cmap ||
|
||||
data == &edit_cycled_marching_ants ||
|
||||
data == &edit_show_indicators ||
|
||||
data == &edit_nav_window_per_display ||
|
||||
data == &edit_info_window_follows_mouse ||
|
||||
data == &edit_stingy_memory_use ||
|
||||
data == &edit_install_cmap ||
|
||||
data == &edit_cycled_marching_ants ||
|
||||
data == &edit_show_indicators ||
|
||||
data == &edit_nav_window_per_display ||
|
||||
data == &edit_info_window_follows_mouse ||
|
||||
data == &edit_disable_tearoff_menus)
|
||||
{
|
||||
*val = GTK_TOGGLE_BUTTON (widget)->active;
|
||||
|
@ -1528,7 +1536,8 @@ preferences_dialog_create (Gimp *gimp)
|
|||
old_transparency_type = gimprc.transparency_type;
|
||||
old_transparency_size = gimprc.transparency_size;
|
||||
old_marching_speed = gimprc.marching_speed;
|
||||
old_allow_resize_windows = gimprc.allow_resize_windows;
|
||||
old_resize_windows_on_zoom = gimprc.resize_windows_on_zoom;
|
||||
old_resize_windows_on_resize = gimprc.resize_windows_on_resize;
|
||||
old_auto_save = gimprc.auto_save;
|
||||
old_preview_size = gimprc.preview_size;
|
||||
old_nav_preview_size = gimprc.nav_preview_size;
|
||||
|
@ -2159,13 +2168,23 @@ preferences_dialog_create (Gimp *gimp)
|
|||
|
||||
button = gtk_check_button_new_with_label(_("Resize Window on Zoom"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
gimprc.allow_resize_windows);
|
||||
gimprc.resize_windows_on_zoom);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (G_OBJECT (button), "toggled",
|
||||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.allow_resize_windows);
|
||||
&gimprc.resize_windows_on_zoom);
|
||||
|
||||
button = gtk_check_button_new_with_label(_("Resize Window on Image Size Change"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
gimprc.resize_windows_on_resize);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (G_OBJECT (button), "toggled",
|
||||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.resize_windows_on_resize);
|
||||
|
||||
button = gtk_check_button_new_with_label(_("Show Rulers"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
|
|
|
@ -164,7 +164,29 @@ view_toggle_selection_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
gimp_display_shell_selection_toggle (shell->select);
|
||||
|
||||
gdisplays_flush ();
|
||||
gimp_display_shell_flush (shell);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayShell *shell;
|
||||
gint new_val;
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
new_val = GTK_CHECK_MENU_ITEM (widget)->active;
|
||||
|
||||
/* hidden == TRUE corresponds to the menu toggle being FALSE */
|
||||
if (new_val == shell->select->layer_hidden)
|
||||
{
|
||||
gimp_display_shell_selection_toggle_layer (shell->select);
|
||||
|
||||
gimp_display_shell_flush (shell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,35 +20,37 @@
|
|||
#define __VIEW_COMMANDS_H__
|
||||
|
||||
|
||||
void view_zoom_in_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_out_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_fit_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_cmd_callback (GtkWidget *widget,
|
||||
gpointer data,
|
||||
guint action);
|
||||
void view_dot_for_dot_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_info_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_nav_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_selection_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_rulers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_statusbar_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_snap_to_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_new_view_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_shrink_wrap_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_in_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_out_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_fit_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_zoom_cmd_callback (GtkWidget *widget,
|
||||
gpointer data,
|
||||
guint action);
|
||||
void view_dot_for_dot_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_info_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_nav_window_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_selection_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_rulers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_statusbar_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_toggle_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_snap_to_guides_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_new_view_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void view_shrink_wrap_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __VIEW_COMMANDS_H__ */
|
||||
|
|
|
@ -599,14 +599,10 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
view_toggle_selection_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
{ { N_("/View/Toggle Layer Boundary"), NULL,
|
||||
view_toggle_layer_boundary_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Guides"), "<control><shift>T",
|
||||
view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
|
@ -618,6 +614,17 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/New View"), NULL,
|
||||
view_new_view_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_NEW },
|
||||
|
|
|
@ -46,7 +46,7 @@ struct _MagnifyOptions
|
|||
{
|
||||
GimpToolOptions tool_options;
|
||||
|
||||
/* gint allow_resize_windows; (from gimprc) */
|
||||
/* gint resize_windows_on_zoom; (from gimprc) */
|
||||
gint allow_resize_d;
|
||||
GtkWidget *allow_resize_w;
|
||||
|
||||
|
@ -224,7 +224,7 @@ magnify_options_new (void)
|
|||
tool_options_init ((GimpToolOptions *) options,
|
||||
magnify_options_reset);
|
||||
|
||||
options->allow_resize_d = gimprc.allow_resize_windows;
|
||||
options->allow_resize_d = gimprc.resize_windows_on_zoom;
|
||||
options->type_d = options->type = GIMP_ZOOM_IN;
|
||||
|
||||
/* the main vbox */
|
||||
|
@ -235,9 +235,9 @@ magnify_options_new (void)
|
|||
gtk_check_button_new_with_label (_("Allow Window Resizing"));
|
||||
g_signal_connect (G_OBJECT (options->allow_resize_w), "toggled",
|
||||
G_CALLBACK (gimp_toggle_button_update),
|
||||
&(gimprc.allow_resize_windows));
|
||||
&(gimprc.resize_windows_on_zoom));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->allow_resize_w),
|
||||
gimprc.allow_resize_windows);
|
||||
gimprc.resize_windows_on_zoom);
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
options->allow_resize_w, FALSE, FALSE, 0);
|
||||
gtk_widget_show (options->allow_resize_w);
|
||||
|
@ -401,7 +401,8 @@ gimp_magnify_tool_button_release (GimpTool *tool,
|
|||
(win_height / 2));
|
||||
|
||||
/* resize the image */
|
||||
gimp_display_shell_scale_resize (shell, gimprc.allow_resize_windows, TRUE);
|
||||
gimp_display_shell_scale_resize (shell, gimprc.resize_windows_on_zoom,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1102,6 +1102,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
cnp);
|
||||
}
|
||||
|
||||
#if 0
|
||||
g_print ("RGB: %d %d %d HSV: %d %d %d ALPHA: %d\n",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
values[GIMP_COLOR_SELECTOR_GREEN],
|
||||
|
@ -1110,6 +1111,7 @@ color_notebook_update_scales (ColorNotebook *cnp,
|
|||
values[GIMP_COLOR_SELECTOR_SATURATION],
|
||||
values[GIMP_COLOR_SELECTOR_VALUE],
|
||||
values[GIMP_COLOR_SELECTOR_ALPHA]);
|
||||
#endif
|
||||
|
||||
g_snprintf (buffer, sizeof (buffer), "#%.2x%.2x%.2x",
|
||||
values[GIMP_COLOR_SELECTOR_RED],
|
||||
|
|
|
@ -599,14 +599,10 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
view_toggle_selection_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
{ { N_("/View/Toggle Layer Boundary"), NULL,
|
||||
view_toggle_layer_boundary_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
"view/toggle_selection.html", NULL },
|
||||
{ { N_("/View/Toggle Guides"), "<control><shift>T",
|
||||
view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
|
@ -618,6 +614,17 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/Toggle Rulers"), "<control><shift>R",
|
||||
view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_rulers.html", NULL },
|
||||
{ { N_("/View/Toggle Statusbar"), "<control><shift>S",
|
||||
view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
||||
NULL,
|
||||
"view/toggle_statusbar.html", NULL },
|
||||
|
||||
SEPARATOR ("/View/---"),
|
||||
|
||||
{ { N_("/View/New View"), NULL,
|
||||
view_new_view_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_NEW },
|
||||
|
|
|
@ -260,12 +260,19 @@ There is always a tradeoff between memory usage and speed. In most
|
|||
cases, the GIMP opts for speed over memory. However, if memory is a
|
||||
big issue, set stingy-memory-use.
|
||||
.TP
|
||||
.I allow-resize-windows BOOLEAN
|
||||
.I resize-windows-on-zoom BOOLEAN
|
||||
When zooming into and out of images, this option enables the automatic
|
||||
resizing of windows.
|
||||
.TP
|
||||
.I dont-allow-resize-windows BOOLEAN
|
||||
Negated version of allow-resize-windows.
|
||||
.I dont-resize-windows-on-zoom BOOLEAN
|
||||
Negated version of resize-windows-on-zoom.
|
||||
.TP
|
||||
.I resize-windows-on-resize BOOLEAN
|
||||
When the physical image size changes, this option enables the automatic
|
||||
resizing of windows.
|
||||
.TP
|
||||
.I dont-resize-windows-on-zoom BOOLEAN
|
||||
Negated version of resize-windows-on-resize.
|
||||
.TP
|
||||
.I cursor-updating BOOLEAN
|
||||
Context-dependent cursors are cool. They are enabled by default.
|
||||
|
|
|
@ -260,12 +260,19 @@ There is always a tradeoff between memory usage and speed. In most
|
|||
cases, the GIMP opts for speed over memory. However, if memory is a
|
||||
big issue, set stingy-memory-use.
|
||||
.TP
|
||||
.I allow-resize-windows BOOLEAN
|
||||
.I resize-windows-on-zoom BOOLEAN
|
||||
When zooming into and out of images, this option enables the automatic
|
||||
resizing of windows.
|
||||
.TP
|
||||
.I dont-allow-resize-windows BOOLEAN
|
||||
Negated version of allow-resize-windows.
|
||||
.I dont-resize-windows-on-zoom BOOLEAN
|
||||
Negated version of resize-windows-on-zoom.
|
||||
.TP
|
||||
.I resize-windows-on-resize BOOLEAN
|
||||
When the physical image size changes, this option enables the automatic
|
||||
resizing of windows.
|
||||
.TP
|
||||
.I dont-resize-windows-on-zoom BOOLEAN
|
||||
Negated version of resize-windows-on-resize.
|
||||
.TP
|
||||
.I cursor-updating BOOLEAN
|
||||
Context-dependent cursors are cool. They are enabled by default.
|
||||
|
|
|
@ -140,7 +140,11 @@
|
|||
|
||||
# When zooming into and out of images, this option enables the
|
||||
# automatic resizing of windows
|
||||
# (allow-resize-windows)
|
||||
# (resize-windows-on-zoom)
|
||||
|
||||
# When the physical size of the image changes, this option enables the
|
||||
# automatic resizing of windows
|
||||
# (resize-windows-on-resize)
|
||||
|
||||
# Context-dependent cursors are cool. They are enabled by default.
|
||||
# However, they require overhead that you may want to do without.
|
||||
|
|
|
@ -149,7 +149,11 @@
|
|||
|
||||
# When zooming into and out of images, this option enables the
|
||||
# automatic resizing of windows
|
||||
# (allow-resize-windows)
|
||||
# (resize-windows-on-zoom)
|
||||
|
||||
# When the physical size of the image changes, this option enables the
|
||||
# automatic resizing of windows
|
||||
# (resize-windows-on-resize)
|
||||
|
||||
# Context-dependent cursors are cool. They are enabled by default.
|
||||
# However, they require overhead that you may want to do without.
|
||||
|
|
Loading…
Reference in New Issue