comparison src/gui_gtk.c @ 836:5a7843c57316 v7.0e02

updated for version 7.0e02
author vimboss
date Tue, 18 Apr 2006 21:55:01 +0000
parents c8680debe1cc
children 2c885fab04e3
comparison
equal deleted inserted replaced
835:8bebcabccc2c 836:5a7843c57316
129 # define gboolean int 129 # define gboolean int
130 # define GdkEventKey int 130 # define GdkEventKey int
131 # define CancelData int 131 # define CancelData int
132 #endif 132 #endif
133 133
134 #ifdef HAVE_GTK2
135 /*
136 * Convenience macros to convert from 'encoding' to 'termencoding' and
137 * vice versa. If no conversion is necessary the passed-in pointer is
138 * returned as is, without allocating any memory. Thus additional _FREE()
139 * macros are provided. The _FREE() macros also set the pointer to NULL,
140 * in order to avoid bugs due to illegal memory access only happening if
141 * 'encoding' != utf-8...
142 *
143 * Defining these macros as pure expressions looks a bit tricky but
144 * avoids depending on the context of the macro expansion. One of the
145 * rare occasions where the comma operator comes in handy :)
146 *
147 * Note: Do NOT keep the result around when handling control back to
148 * the main Vim! The user could change 'encoding' at any time.
149 */
150 # define CONVERT_TO_UTF8(String) \
151 ((output_conv.vc_type == CONV_NONE || (String) == NULL) \
152 ? (String) \
153 : string_convert(&output_conv, (String), NULL))
154
155 # define CONVERT_TO_UTF8_FREE(String) \
156 ((String) = ((output_conv.vc_type == CONV_NONE) \
157 ? (char_u *)NULL \
158 : (vim_free(String), (char_u *)NULL)))
159
160 # define CONVERT_FROM_UTF8(String) \
161 ((input_conv.vc_type == CONV_NONE || (String) == NULL) \
162 ? (String) \
163 : string_convert(&input_conv, (String), NULL))
164
165 # define CONVERT_FROM_UTF8_FREE(String) \
166 ((String) = ((input_conv.vc_type == CONV_NONE) \
167 ? (char_u *)NULL \
168 : (vim_free(String), (char_u *)NULL)))
169
170 #endif /* HAVE_GTK2 */
171
172 static void entry_activate_cb(GtkWidget *widget, gpointer data); 134 static void entry_activate_cb(GtkWidget *widget, gpointer data);
173 static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog); 135 static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
174 static void find_replace_cb(GtkWidget *widget, gpointer data); 136 static void find_replace_cb(GtkWidget *widget, gpointer data);
175 #ifndef HAVE_GTK2 137 #ifndef HAVE_GTK2
176 static void gui_gtk_position_in_parent(GtkWidget *parent, GtkWidget *child, gui_win_pos_T where); 138 static void gui_gtk_position_in_parent(GtkWidget *parent, GtkWidget *child, gui_win_pos_T where);