changeset 134:caeb52bb5ef4

Pass pointers to argc and argv on Unix.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 21 Oct 2002 00:40:55 +0000
parents 85f8ba78736d
children f57ef391f104
files dw.h gtk/dw.c
diffstat 2 files changed, 34 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Sun Oct 20 22:55:40 2002 +0000
+++ b/dw.h	Mon Oct 21 00:40:55 2002 +0000
@@ -602,8 +602,8 @@
 void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad);
 void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad);
 #if !defined(__OS2__) && !defined(__WIN32__) && !defined(__EMX__)
-int dw_int_init(DWResources *res, int newthread, int argc, char *argv[]);
-#define dw_init(a, b, c) dw_int_init(&_resources, a, b, c)
+int dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]);
+#define dw_init(a, b, c) dw_int_init(&_resources, a, &b, &c)
 #else
 int dw_init(int newthread, int argc, char *argv[]);
 #endif
--- a/gtk/dw.c	Sun Oct 20 22:55:40 2002 +0000
+++ b/gtk/dw.c	Mon Oct 21 00:40:55 2002 +0000
@@ -669,7 +669,7 @@
  *           newthread: True if this is the only thread.
  *                      False if there is already a message loop running.
  */
-int dw_int_init(DWResources *res, int newthread, int argc, char *argv[])
+int dw_int_init(DWResources *res, int newthread, int *argc, char **argv[])
 {
 	int z;
 	char *tmp;
@@ -683,7 +683,7 @@
 	gtk_set_locale();
 	g_thread_init(NULL);
 
-	gtk_init(&argc, &argv);
+	gtk_init(argc, argv);
 #ifdef USE_IMLIB
 	gdk_imlib_init();
 #endif
@@ -836,26 +836,29 @@
 	return tmp;
 }
 
-void _delete(GtkWidget *widget, GtkWidget *event, gpointer param)
+int _delete(GtkWidget *widget, GtkWidget *event, gpointer param)
 {
 	gtk_widget_destroy(GTK_WIDGET(param));
-}
-
-void _delete2(GtkWidget *widget, gpointer param)
+	return FALSE;
+}
+
+int _delete2(GtkWidget *widget, gpointer param)
 {
 	gtk_widget_destroy(GTK_WIDGET(param));
-}
-
-
-void _dw_ok_func(HWND window, void *data)
+	return FALSE;
+}
+
+
+int _dw_ok_func(HWND window, void *data)
 {
 	DWDialog *dwwait = (DWDialog *)data;
 
 	if(!dwwait)
-		return;
+		return FALSE;
 
 	dw_window_destroy((HWND)dwwait->data);
 	dw_dialog_dismiss((DWDialog *)data, (void *)0);
+	return FALSE;
 }
 
 /*
@@ -913,26 +916,28 @@
 	return strlen(outbuf);
 }
 
-void _dw_yes_func(HWND window, void *data)
+int _dw_yes_func(HWND window, void *data)
 {
 	DWDialog *dwwait = (DWDialog *)data;
 
 	if(!dwwait)
-		return;
+		return FALSE;
 
 	dw_window_destroy((HWND)dwwait->data);
 	dw_dialog_dismiss((DWDialog *)data, (void *)1);
-}
-
-void _dw_no_func(HWND window, void *data)
+	return FALSE;
+}
+
+int _dw_no_func(HWND window, void *data)
 {
 	DWDialog *dwwait = (DWDialog *)data;
 
 	if(!dwwait)
-		return;
+		return FALSE;
 
 	dw_window_destroy((HWND)dwwait->data);
 	dw_dialog_dismiss((DWDialog *)data, (void *)0);
+	return FALSE;
 }
 
 /*
@@ -4443,14 +4448,12 @@
  */
 void dw_pixmap_destroy(HPIXMAP pixmap)
 {
-#if GTK_MAJOR_VERSION < 2
 	int _locked_by_me = FALSE;
 
 	DW_MUTEX_LOCK;
 	gdk_pixmap_unref(pixmap->pixmap);
 	free(pixmap);
 	DW_MUTEX_UNLOCK;
-#endif
 }
 
 /*
@@ -5740,7 +5743,7 @@
 
 	/* Prevent infinite recursion ;) */  
 	if(!percent || (lastwidth == event->width && lastheight == event->height))
-		return TRUE;
+		return FALSE;
 
 	lastwidth = event->width; lastheight = event->height;
   
@@ -5751,7 +5754,7 @@
 		gtk_paned_set_position(GTK_PANED(widget), (int)(event->width * (*percent / 100.0)));
 	if(GTK_IS_VPANED(widget))
 		gtk_paned_set_position(GTK_PANED(widget), (int)(event->height * (*percent / 100.0)));
-	return TRUE;
+	return FALSE;
 }
 
 #if GTK_MAJOR_VERSION > 1
@@ -5762,7 +5765,7 @@
 	int size = 0, position = gtk_paned_get_position(GTK_PANED(widget));
 
 	if(!percent)
-		return TRUE;
+		return FALSE;
 
 	if(GTK_IS_VPANED(widget))
 		size = widget->allocation.height;
@@ -5771,7 +5774,7 @@
 
 	if(size > 0)
 		*percent = ((float)(position * 100) / (float)size);
-	return TRUE;
+	return FALSE;
 }
 #endif
 
@@ -6025,7 +6028,7 @@
 }
 
 /* Internal function to handle the file OK press */
-void _gtk_file_ok(GtkWidget *widget, DWDialog *dwwait)
+gint _gtk_file_ok(GtkWidget *widget, DWDialog *dwwait)
 {
 #if GTK_MAJOR_VERSION > 1
 	const char *tmp;
@@ -6034,23 +6037,25 @@
 #endif
 
 	if(!dwwait)
-		return;
+		return FALSE;
 
 	tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dwwait->data));
 	gtk_widget_destroy(GTK_WIDGET(dwwait->data));
 	_dw_file_active = 0;
 	dw_dialog_dismiss(dwwait, (void *)(tmp ? strdup(tmp) : NULL));
+	return FALSE;
 }
 
 /* Internal function to handle the file Cancel press */
-void _gtk_file_cancel(GtkWidget *widget, DWDialog *dwwait)
+gint _gtk_file_cancel(GtkWidget *widget, DWDialog *dwwait)
 {
 	if(!dwwait)
-		return;
+		return FALSE;
 
 	gtk_widget_destroy(GTK_WIDGET(dwwait->data));
 	_dw_file_active = 0;
 	dw_dialog_dismiss(dwwait, NULL);
+	return FALSE;
 }
 
 /*