comparison gtk4/dw.c @ 2506:fa976a5bc7bd

Add DW_FEATURE_WINDOW_PLACEMENT for platforms supporting arbitrary window placement. Several of the new platforms supported do not allow arbitrary window placement. GTK3/4 with Wayland does not allow you to specify the location, just the size. iOS and Android by default the window is the full screen, or fraction of it. GTK2/3/4 with X11, Windows, OS/2 and MacOS support arbitrary window placement.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 06 May 2021 23:19:46 +0000
parents 8f7c2f20c7c0
children cb795bba48a4
comparison
equal deleted inserted replaced
2505:a149dabf6a1f 2506:fa976a5bc7bd
11055 g_free(freeme); 11055 g_free(freeme);
11056 } 11056 }
11057 return retval; 11057 return retval;
11058 } 11058 }
11059 11059
11060 DW_FUNCTION_DEFINITION(dw_x11_check, int, int trueresult, int falseresult)
11061 DW_FUNCTION_ADD_PARAM1(handle)
11062 DW_FUNCTION_RETURN(dw_window_raise, int)
11063 DW_FUNCTION_RESTORE_PARAM1(trueresult, int, falseresult, int)
11064 {
11065 int retval = falseresult;
11066 #ifdef GDK_WINDOWING_X11
11067 GdkDisplay *display = gdk_display_get_default();
11068
11069 if(display && GDK_IS_X11_DISPLAY(display))
11070 {
11071 retval = trueresult;
11072 }
11073 #endif
11074 DW_FUNCTION_RETURN_THIS(retval);
11075 }
11076
11060 /* 11077 /*
11061 * Gets the state of the requested library feature. 11078 * Gets the state of the requested library feature.
11062 * Parameters: 11079 * Parameters:
11063 * feature: The requested feature for example DW_FEATURE_DARK_MODE 11080 * feature: The requested feature for example DW_FEATURE_DARK_MODE
11064 * Returns: 11081 * Returns:
11078 case DW_FEATURE_NOTIFICATION: 11095 case DW_FEATURE_NOTIFICATION:
11079 case DW_FEATURE_UTF8_UNICODE: 11096 case DW_FEATURE_UTF8_UNICODE:
11080 case DW_FEATURE_MLE_WORD_WRAP: 11097 case DW_FEATURE_MLE_WORD_WRAP:
11081 case DW_FEATURE_TREE: 11098 case DW_FEATURE_TREE:
11082 return DW_FEATURE_ENABLED; 11099 return DW_FEATURE_ENABLED;
11100 case DW_FEATURE_WINDOW_PLACEMENT:
11101 return dw_x11_check(DW_FEATURE_ENABLED, DW_FEATURE_UNSUPPORTED);
11083 default: 11102 default:
11084 return DW_FEATURE_UNSUPPORTED; 11103 return DW_FEATURE_UNSUPPORTED;
11085 } 11104 }
11086 } 11105 }
11087 11106
11110 case DW_FEATURE_NOTIFICATION: 11129 case DW_FEATURE_NOTIFICATION:
11111 case DW_FEATURE_UTF8_UNICODE: 11130 case DW_FEATURE_UTF8_UNICODE:
11112 case DW_FEATURE_MLE_WORD_WRAP: 11131 case DW_FEATURE_MLE_WORD_WRAP:
11113 case DW_FEATURE_TREE: 11132 case DW_FEATURE_TREE:
11114 return DW_ERROR_GENERAL; 11133 return DW_ERROR_GENERAL;
11134 case DW_FEATURE_WINDOW_PLACEMENT:
11135 return dw_x11_check(DW_ERROR_GENERAL, DW_FEATURE_UNSUPPORTED);
11115 /* These features are supported and configurable */ 11136 /* These features are supported and configurable */
11116 default: 11137 default:
11117 return DW_FEATURE_UNSUPPORTED; 11138 return DW_FEATURE_UNSUPPORTED;
11118 } 11139 }
11119 } 11140 }