annotate src/ui_menu.c @ 1753:c4d37e0fc841 default tip

installation fix
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 29 Jan 2010 19:22:50 +0900
parents 89dedc61b1bd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * (SLIK) SimpLIstic sKin functions
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1055
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13 #ifdef HAVE_CONFIG_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 # include "config.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "intl.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include <stdio.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include <stdlib.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include <string.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include <gtk/gtk.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 * menu items
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
31 */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 static void menu_item_finish(GtkWidget *menu, GtkWidget *item, GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 if (func) g_signal_connect(G_OBJECT(item), "activate", func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 gtk_widget_show(item);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 GtkWidget *menu_item_add(GtkWidget *menu, const gchar *label,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 item = gtk_menu_item_new_with_mnemonic(label);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 menu_item_finish(menu, item, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 GtkWidget *menu_item_add_stock(GtkWidget *menu, const gchar *label, const gchar *stock_id,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 GtkWidget *image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 item = gtk_image_menu_item_new_with_mnemonic(label);
513
985fdfebd89e Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents: 475
diff changeset
58 image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 gtk_widget_show(image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 menu_item_finish(menu, item, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1437
diff changeset
66 GtkWidget *menu_item_add_sensitive(GtkWidget *menu, const gchar *label, gboolean sensitive,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 item = menu_item_add(menu, label, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 gtk_widget_set_sensitive(item, sensitive);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1437
diff changeset
77 GtkWidget *menu_item_add_stock_sensitive(GtkWidget *menu, const gchar *label, const gchar *stock_id, gboolean sensitive,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 item = menu_item_add_stock(menu, label, stock_id, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 gtk_widget_set_sensitive(item, sensitive);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
84
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1437
diff changeset
88 GtkWidget *menu_item_add_check(GtkWidget *menu, const gchar *label, gboolean active,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 item = gtk_check_menu_item_new_with_mnemonic(label);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), active);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 menu_item_finish(menu, item, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
100 GtkWidget *menu_item_add_radio(GtkWidget *menu, GtkWidget *parent,
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1437
diff changeset
101 const gchar *label, gboolean active,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
102 GCallback func, gpointer data)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
103 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
104 GtkWidget *item;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
105 GSList *group = NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
106
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
107 if (parent) group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(parent));
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
108
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
109 item = gtk_radio_menu_item_new_with_mnemonic(group, label);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
110 if (active) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), active);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
111 menu_item_finish(menu, item, func, data);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
112
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
113 return item;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
114 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 88
diff changeset
115
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116 void menu_item_add_divider(GtkWidget *menu)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 GtkWidget *item = gtk_menu_item_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 gtk_widget_set_sensitive(item, FALSE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
120 gtk_menu_shell_append(GTK_MENU_SHELL(menu),item);
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
121 gtk_widget_show(item);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124 GtkWidget *menu_item_add_simple(GtkWidget *menu, const gchar *label,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
125 GCallback func, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 GtkWidget *item = gtk_menu_item_new_with_label(label);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 menu_item_finish(menu, item, func, data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
130 return item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 * popup menus
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
137 */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
139 static void popup_menu_short_lived_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 /* destroy the menu */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142 g_object_unref(G_OBJECT(data));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145 GtkWidget *popup_menu_short_lived(void)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 menu = gtk_menu_new();
88
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
150
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
151 /* take ownership of menu */
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
152 #ifdef GTK_OBJECT_FLOATING
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
153 /* GTK+ < 2.10 */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 g_object_ref(G_OBJECT(menu));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 gtk_object_sink(GTK_OBJECT(menu));
88
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
156 #else
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
157 /* GTK+ >= 2.10 */
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
158 g_object_ref_sink(G_OBJECT(menu));
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
159 #endif
2099ee3f9a8d Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
160
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 g_signal_connect(G_OBJECT(menu), "selection_done",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162 G_CALLBACK(popup_menu_short_lived_cb), menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 return menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1437
diff changeset
166 gboolean popup_menu_position_clamp(GtkMenu *menu, gint *x, gint *y, gint height)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167 {
1437
a3d3208b0c50 gint -> gboolean.
zas_
parents: 1284
diff changeset
168 gboolean adjusted = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 gint w, h;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 gint xw, xh;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 113
diff changeset
171
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 w = GTK_WIDGET(menu)->requisition.width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173 h = GTK_WIDGET(menu)->requisition.height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 xw = gdk_screen_width();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 xh = gdk_screen_height();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 if (*x + w > xw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
179 *x = xw - w;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 adjusted = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182 if (*y + h > xh)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 if (height)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
185 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186 *y = MAX(0, *y - h - height);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
187 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 *y = xh - h;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
192 adjusted = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
193 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195 if (*x < 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197 *x = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
198 adjusted = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 if (*y < 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
201 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202 *y = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
203 adjusted = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
204 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
205
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
206 return adjusted;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 }
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 513
diff changeset
208 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */