~ubuntu-branches/ubuntu/quantal/vice/quantal

« back to all changes in this revision

Viewing changes to src/arch/unix/x11/gnome/uimenu.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-03-27 13:06:04 UTC
  • mfrom: (4 hoary)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20050327130604-zodmv0i60dbbmcik
Tags: 1.16-3
Apply patch from Andreas Jochens <aj@andaco.de> to correct building on
AMD64 and GCC 4.x (closes: #300936)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <stdarg.h>
35
35
#include <stdlib.h>
36
36
 
37
 
#include <X11/Xlib.h>
38
 
#include <X11/Intrinsic.h>
39
 
#include <X11/Xaw/SimpleMenu.h>
40
 
#include <X11/Xaw/SmeLine.h>
41
 
#include <X11/Xaw/SmeBSB.h>
42
 
 
 
37
#include "lib.h"
43
38
#include "machine.h"
44
39
#include "resources.h"
45
 
#include "utils.h"
46
 
#include "vsync.h"
47
40
#include "x11menu.h"
48
41
#include "uimenu.h"
49
42
 
 
43
 
50
44
/* Separator item.  */
51
45
ui_menu_entry_t ui_menu_separator[] = {
52
46
    { "--" },
87
81
 
88
82
int ui_menu_init()
89
83
{
90
 
    ui_create_dynamic_menues();
91
84
    return(0);
92
85
}
93
86
 
97
90
    
98
91
    cm = (checkmark_t *) data;
99
92
    checkmark_list = g_list_remove(checkmark_list, data);
100
 
    free(cm->name);
101
 
    free(cm);
 
93
    lib_free(cm->name);
 
94
    lib_free(cm);
102
95
}
103
96
 
104
97
GtkWidget* ui_menu_create(const char *menu_name, ...)
141
134
                    checkmark_t *cmt;
142
135
                    new_item = gtk_check_menu_item_new_with_label(label+1);
143
136
                    
144
 
                    cmt = (checkmark_t *) xmalloc(sizeof(checkmark_t));
145
 
                    cmt->name = stralloc(label+1);
 
137
                    cmt = (checkmark_t *)lib_malloc(sizeof(checkmark_t));
 
138
                    cmt->name = lib_stralloc(label+1);
146
139
                    cmt->w = new_item;
147
140
                    cmt->cb = list[i].callback;
148
141
                    cmt->obj.value = (void*) list[i].callback_data;
161
154
                    new_item = gtk_menu_item_new_with_label(label+1);
162
155
 
163
156
                j++;
164
 
                free(label);
 
157
                lib_free(label);
165
158
                break;
166
159
            }
167
160
            default:
169
162
                char *label = make_menu_label(&list[i]);
170
163
                new_item = gtk_menu_item_new_with_label(label);
171
164
                if (list[i].callback) {
172
 
                    obj = (ui_menu_cb_obj*) xmalloc(sizeof(ui_menu_cb_obj));
 
165
                    obj = (ui_menu_cb_obj*)lib_malloc(sizeof(ui_menu_cb_obj));
173
166
                    obj->value = (void*) list[i].callback_data;
174
167
                    
175
168
                    gtk_signal_connect(GTK_OBJECT(new_item),"activate",
176
169
                                       GTK_SIGNAL_FUNC(list[i].callback),
177
170
                                       (gpointer) obj); 
178
171
                }
179
 
                free(label);
 
172
                lib_free(label);
180
173
                j++;
181
174
            }
182
175
            }
201
194
                if (list[i].hotkey_keysym != (KeySym) 0
202
195
                    && list[i].callback != NULL)
203
196
                    ui_hotkey_register(list[i].hotkey_modifier,
204
 
                                       list[i].hotkey_keysym,
205
 
                                       list[i].callback,
206
 
                                       obj);
 
197
                                       (signed long)list[i].hotkey_keysym,
 
198
                                       (ui_callback_t)list[i].callback,
 
199
                                       (ui_callback_data_t)obj);
207
200
            }
208
201
        }
209
202
    }
273
266
{
274
267
    int current_value;
275
268
 
276
 
    if (resources_get_value(resource_name,
277
 
                            (resource_value_t *) &current_value) < 0)
 
269
    if (resources_get_value(resource_name, (void *)&current_value) < 0)
278
270
        return;
279
271
 
280
272
    if(!CHECK_MENUS) {
291
283
{
292
284
    int current_value;
293
285
 
294
 
    resources_get_value(resource_name, (resource_value_t *) &current_value);
 
286
    resources_get_value(resource_name, (void *)&current_value);
295
287
 
296
288
    if (!CHECK_MENUS) {
297
289
        if (current_value != (int) UI_MENU_CB_PARAM) {
310
302
{
311
303
    resource_value_t current_value;
312
304
 
313
 
    resources_get_value(resource_name, &current_value);
 
305
    resources_get_value(resource_name, (void *)&current_value);
314
306
 
315
307
    if( current_value == 0) return;
316
308
 
324
316
                                   (const char *) UI_MENU_CB_PARAM) == 0);
325
317
    }
326
318
}
 
319