Mercurial > dwindows
diff gtk/dw.c @ 1933:758f49e54566
Enable dw_windows_get_text() to return value of label under GTK.
Support for fullscreen display on GTK.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 11 Sep 2017 05:56:04 +0000 |
parents | 3c60066cb16f |
children | a17cc1958369 |
line wrap: on
line diff
--- a/gtk/dw.c Sat Jul 08 11:53:30 2017 +0000 +++ b/gtk/dw.c Mon Sep 11 05:56:04 2017 +0000 @@ -1227,7 +1227,7 @@ static SignalHandler _get_signal_handler(gpointer data) { SignalHandler sh = {0}; - + if(data) { void **params = (void **)data; @@ -2400,7 +2400,7 @@ { void *tmp; int newprocess = 0; - + if(!dialog) return NULL; @@ -3605,11 +3605,15 @@ flags |= GDK_DECOR_BORDER; #if GTK_MAJOR_VERSION > 1 - if(flStyle & DW_FCF_MAXIMIZE) - gtk_window_maximize(GTK_WINDOW(tmp)); - - if(flStyle & DW_FCF_MINIMIZE) - gtk_window_iconify(GTK_WINDOW(tmp)); + if(flStyle & DW_FCF_FULLSCREEN) + gtk_window_fullscreen(GTK_WINDOW(tmp)); + else + { + if(flStyle & DW_FCF_MAXIMIZE) + gtk_window_maximize(GTK_WINDOW(tmp)); + if(flStyle & DW_FCF_MINIMIZE) + gtk_window_iconify(GTK_WINDOW(tmp)); + } #endif #if GTK_CHECK_VERSION(2,10,0) @@ -4901,7 +4905,7 @@ { #if GTK_MAJOR_VERSION > 1 GdkPixbuf *pixbuf = NULL; -#else +#else GdkBitmap *bitmap = NULL; GdkPixmap *tmp = NULL; #endif @@ -4918,7 +4922,7 @@ pixbuf = _find_pixbuf((HICN)id); #else tmp = _find_pixmap(&bitmap, (HICN)id, handle, NULL, NULL); -#endif +#endif else { char *file = alloca(strlen(filename) + 6); @@ -4969,9 +4973,9 @@ #if GTK_MAJOR_VERSION > 1 if (pixbuf) -#else +#else if (tmp) -#endif +#endif { if ( GTK_IS_BUTTON(handle) ) { @@ -4998,7 +5002,7 @@ #if GTK_MAJOR_VERSION > 1 if(pixbuf) g_object_unref(pixbuf); -#endif +#endif DW_MUTEX_UNLOCK; } @@ -5017,7 +5021,7 @@ { #if GTK_MAJOR_VERSION > 1 GdkPixbuf *pixbuf = NULL; -#else +#else GdkBitmap *bitmap = NULL; GdkPixmap *tmp = NULL; #endif @@ -5069,13 +5073,13 @@ pixbuf = _find_pixbuf((HICN)id); #else tmp = _find_pixmap(&bitmap, (HICN)id, handle, NULL, NULL); -#endif +#endif #if GTK_MAJOR_VERSION > 1 if (pixbuf) -#else +#else if (tmp) -#endif +#endif { if ( GTK_IS_BUTTON(handle) ) { @@ -5102,7 +5106,7 @@ #if GTK_MAJOR_VERSION > 1 if(pixbuf) g_object_unref(pixbuf); -#endif +#endif DW_MUTEX_UNLOCK; } @@ -5189,6 +5193,8 @@ possible = gtk_entry_get_text(GTK_ENTRY(handle)); else if(GTK_IS_COMBO(handle)) possible = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(handle)->entry)); + else if(GTK_IS_LABEL(handle)) + possible = gtk_label_get_text(GTK_LABEL(handle)); DW_MUTEX_UNLOCK; return strdup(possible); @@ -6242,7 +6248,7 @@ void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); void **params = calloc(sizeof(void *), 3): SignalHandler work; - + params[0] = mydata; params[2] = (void *)tree; work = _get_signal_handler(mydata); @@ -6398,7 +6404,7 @@ void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); void **params = calloc(sizeof(void *), 3): SignalHandler work; - + params[0] = mydata; params[2] = (void *)tree; work = _get_signal_handler(mydata); @@ -6636,7 +6642,7 @@ GtkTreeIter iter; if(gtk_tree_model_iter_parent(store, &iter, (GtkTreeIter *)item)) - gtk_tree_model_get(store, &iter, 3, &parent, -1); + gtk_tree_model_get(store, &iter, 3, &parent, -1); } #else parent = (HTREEITEM)gtk_object_get_data(GTK_OBJECT(item), "_dw_parent"); @@ -7681,7 +7687,7 @@ void _dw_container_row_data_destroy(gpointer data) { void **params = (void **)data; - + if(params) { if(params[0]) @@ -7709,7 +7715,7 @@ if(clist) { void **params = (void **)gtk_clist_get_row_data(GTK_CLIST(clist), row); - + if(!params) { params = (void **)calloc(2, sizeof(void *)); @@ -7968,7 +7974,7 @@ int _locked_by_me = FALSE; int type = _DW_DATA_TYPE_STRING; void **params = NULL; - + if(flags & DW_CR_RETDATA) type = _DW_DATA_TYPE_POINTER; @@ -8045,7 +8051,7 @@ for(z=0;z<rowcount;z++) { void **params = (void **)gtk_clist_get_row_data(GTK_CLIST(clist), z); - + if ( params && ((textcomp && params[0] && strcmp((char *)params[0], (char *)data) == 0) || (!textcomp && params[1] == data)) ) { gfloat pos; @@ -8106,7 +8112,7 @@ for(z=0;z<rowcount;z++) { void **params = (void **)gtk_clist_get_row_data(GTK_CLIST(clist), z); - + if ( params && ((textcomp && params[0] && strcmp((char *)params[0], (char *)data) == 0) || (!textcomp && params[1] == data)) ) { _dw_unselect(clist); @@ -10117,7 +10123,7 @@ return DW_ERROR_NONE; } -/* +/* * Generally an internal function called from a newly created * thread to setup the Dynamic Windows environment for the thread. * However it is exported so language bindings can call it when @@ -10132,7 +10138,7 @@ pthread_setspecific(_dw_bg_color_key, NULL); } -/* +/* * Generally an internal function called from a terminating * thread to cleanup the Dynamic Windows environment for the thread. * However it is exported so language bindings can call it when @@ -10141,7 +10147,7 @@ void API _dw_deinit_thread(void) { GdkColor *foreground, *background; - + if((foreground = pthread_getspecific(_dw_fg_color_key))) free(foreground); if((background = pthread_getspecific(_dw_bg_color_key))) @@ -13668,7 +13674,7 @@ if(discfunc) { SignalHandler work = _get_signal_handler(data); - + if(work.window) { discfunc(work.window, work.data); @@ -13782,7 +13788,7 @@ gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_container_context_data", params); cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), params); _set_signal_handler_id(thiswindow, sigid, cid); - + params = calloc(sizeof(void *), 3); sigid = _set_signal_handler(window, window, sigfunc, data, thisfunc); params[0] = GINT_TO_POINTER(sigid); @@ -13906,7 +13912,7 @@ for(z=0;z<count;z++) { SignalHandler sh; - + params[0] = GINT_TO_POINTER(z); sh = _get_signal_handler(params); @@ -13956,7 +13962,7 @@ for(z=0;z<count;z++) { SignalHandler sh; - + params[0] = GINT_TO_POINTER(z); sh = _get_signal_handler(params);