158 lines
5.2 KiB
Text
158 lines
5.2 KiB
Text
$NetBSD: patch-at,v 1.2 2011/11/25 21:42:44 joerg Exp $
|
|
|
|
--- rf/uwidget.cpp.orig 2003-01-14 18:07:42.000000000 +0000
|
|
+++ rf/uwidget.cpp
|
|
@@ -24,7 +24,9 @@
|
|
#include "config.h"
|
|
#endif
|
|
|
|
+#include <inttypes.h>
|
|
#include <stdio.h>
|
|
+#include <stdlib.h>
|
|
|
|
#include "uwidget.h"
|
|
#include "uconsole.h"
|
|
@@ -231,23 +233,23 @@ extern "C"
|
|
|
|
static void gtkclicked(GtkButton *button, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
UEventSendMessage(widid, EV_CMD, cmdid, 0L);
|
|
}
|
|
|
|
static void gtkmenuitemactivate(GtkMenuItem *menuitem, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
UEventSendMessage(widid, EV_CMD, cmdid, 0L);
|
|
}
|
|
|
|
static void gtkselectclist(GtkWidget *clist, gint row, gint column,
|
|
GdkEventButton *event, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
gchar *text;
|
|
gtk_clist_get_text(GTK_CLIST(clist), row, column, &text);
|
|
UEventSendMessage(widid, EV_LIST_SELECTING, UMAKEINT(cmdid, row), text);
|
|
@@ -255,15 +257,15 @@ extern "C"
|
|
|
|
static void gtkselectclistcolumn(GtkCList *clist, gint column, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
UEventSendMessage(widid, EV_LIST_SELCOLUMN, UMAKEINT(cmdid, column), 0L);
|
|
}
|
|
|
|
static gint gtkclistdblclick(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
|
{
|
|
- int widid = ULOWORD((int)data);
|
|
- int cmdid = UHIWORD((int)data);
|
|
+ int widid = ULOWORD((int)(intptr_t)data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)data);
|
|
if (event->type == GDK_2BUTTON_PRESS)
|
|
{
|
|
UEventSendMessage(widid, EV_LIST_DBLCLICK, cmdid, 0L);
|
|
@@ -274,8 +276,8 @@ extern "C"
|
|
|
|
static void gtkcomboclicked(GtkWidget *widget, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
|
|
GtkList *list = GTK_LIST(widget->parent);
|
|
GList *selection = list->selection;
|
|
@@ -320,8 +322,8 @@ extern "C"
|
|
|
|
static void gtkmenuactivated(GtkWidget *widget, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
|
|
UStr selTxt;
|
|
|
|
@@ -392,7 +394,7 @@ extern "C"
|
|
static void dataForeach(GQuark key_id, gpointer data, gpointer user_data)
|
|
{
|
|
const char *str = g_quark_to_string(key_id);
|
|
- int id = (int)user_data;
|
|
+ int id = (int)(intptr_t)user_data;
|
|
int cmd;
|
|
if(matchToken(str, cmd))
|
|
{
|
|
@@ -514,32 +516,32 @@ extern "C"
|
|
|
|
static void gtktreeexpand(GtkWidget *item, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
g_assert(GTK_IS_TREE_ITEM(item));
|
|
UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 0), item);
|
|
}
|
|
|
|
static void gtktreecollapse(GtkWidget *item, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
g_assert(GTK_IS_TREE_ITEM(item));
|
|
UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 1), item);
|
|
}
|
|
|
|
static void gtktreeselect(GtkWidget *item, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
g_assert(GTK_IS_TREE_ITEM(item));
|
|
UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 0), item);
|
|
}
|
|
|
|
static void gtktreedeselect(GtkWidget *item, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
g_assert(GTK_IS_TREE_ITEM(item));
|
|
UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 1), item);
|
|
}
|
|
@@ -661,8 +663,8 @@ extern "C"
|
|
gint page_num,
|
|
gpointer data)
|
|
{
|
|
- int widid = ULOWORD((int)data);
|
|
- int cmdid = UHIWORD((int)data);
|
|
+ int widid = ULOWORD((int)(intptr_t)data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)data);
|
|
|
|
UEventSendMessage(widid, EV_PAGE_CHANGED, UMAKEINT(cmdid, page_num), 0L);
|
|
}
|
|
@@ -682,8 +684,8 @@ extern "C"
|
|
|
|
static gint gtkexposeevent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
|
{
|
|
- int widid = ULOWORD((int)user_data);
|
|
- int cmdid = UHIWORD((int)user_data);
|
|
+ int widid = ULOWORD((int)(intptr_t)user_data);
|
|
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
|
|
|
|
UEventSendMessage(widid, EV_CUSTOM_DRAW, cmdid, event);
|
|
return TRUE;
|