comparison template/dw.c @ 1010:9af693aafa93

Attempt at implmenting dw_window_get_font on OS/2. Also some more formatting cleanups in the template.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 14 May 2011 06:40:27 +0000
parents f046a2712b38
children b58032a619b9
comparison
equal deleted inserted replaced
1009:f1256b32fd22 1010:9af693aafa93
662 * Parameters: 662 * Parameters:
663 * handle: Handle to the scrollbox to be queried. 663 * handle: Handle to the scrollbox to be queried.
664 * orient: The vertical or horizontal scrollbar. 664 * orient: The vertical or horizontal scrollbar.
665 * Returns: 665 * Returns:
666 * The vertical or horizontal range of the scrollbox. 666 * The vertical or horizontal range of the scrollbox.
667 */ 667 */
668 int API dw_scrollbox_get_range(HWND handle, int orient) 668 int API dw_scrollbox_get_range(HWND handle, int orient)
669 { 669 {
670 return 0; 670 return 0;
671 } 671 }
672 672
828 * Parameters: 828 * Parameters:
829 * text: The default text to be in the entryfield widget. 829 * text: The default text to be in the entryfield widget.
830 * id: An ID to be used with dw_window_from_id() or 0L. 830 * id: An ID to be used with dw_window_from_id() or 0L.
831 * Returns: 831 * Returns:
832 * A handle to an entryfield window or NULL on failure. 832 * A handle to an entryfield window or NULL on failure.
833 */ 833 */
834 HWND API dw_entryfield_new(char *text, ULONG cid) 834 HWND API dw_entryfield_new(char *text, ULONG cid)
835 { 835 {
836 return 0; 836 return 0;
837 } 837 }
838 838
907 /* 907 /*
908 * Create a new spinbutton window (widget) to be packed. 908 * Create a new spinbutton window (widget) to be packed.
909 * Parameters: 909 * Parameters:
910 * text: The text to be display by the static text widget. 910 * text: The text to be display by the static text widget.
911 * id: An ID to be used with dw_window_from_id() or 0L. 911 * id: An ID to be used with dw_window_from_id() or 0L.
912 * Returns: 912 * Returns:
913 * A handle to a spinbutton window or NULL on failure. 913 * A handle to a spinbutton window or NULL on failure.
914 */ 914 */
915 HWND API dw_spinbutton_new(char *text, ULONG cid) 915 HWND API dw_spinbutton_new(char *text, ULONG cid)
916 { 916 {
917 return 0; 917 return 0;
918 } 918 }
919 919
942 * Returns the current value of the spinbutton. 942 * Returns the current value of the spinbutton.
943 * Parameters: 943 * Parameters:
944 * handle: Handle to the spinbutton to be queried. 944 * handle: Handle to the spinbutton to be queried.
945 * Returns: 945 * Returns:
946 * Number value displayed in the spinbutton. 946 * Number value displayed in the spinbutton.
947 */ 947 */
948 long API dw_spinbutton_get_pos(HWND handle) 948 long API dw_spinbutton_get_pos(HWND handle)
949 { 949 {
950 return 0; 950 return 0;
951 } 951 }
952 952
1158 1158
1159 /* 1159 /*
1160 * Returns the listbox's item count. 1160 * Returns the listbox's item count.
1161 * Parameters: 1161 * Parameters:
1162 * handle: Handle to the listbox to be counted. 1162 * handle: Handle to the listbox to be counted.
1163 * Returns: 1163 * Returns:
1164 * The number of items in the listbox. 1164 * The number of items in the listbox.
1165 */ 1165 */
1166 int API dw_listbox_count(HWND handle) 1166 int API dw_listbox_count(HWND handle)
1167 { 1167 {
1168 return 0; 1168 return 0;
1169 } 1169 }
1170 1170
1250 /* 1250 /*
1251 * Create a new Combobox window (widget) to be packed. 1251 * Create a new Combobox window (widget) to be packed.
1252 * Parameters: 1252 * Parameters:
1253 * text: The default text to be in the combpbox widget. 1253 * text: The default text to be in the combpbox widget.
1254 * id: An ID to be used with dw_window_from_id() or 0L. 1254 * id: An ID to be used with dw_window_from_id() or 0L.
1255 * Returns: 1255 * Returns:
1256 * A handle to a combobox window or NULL on failure. 1256 * A handle to a combobox window or NULL on failure.
1257 */ 1257 */
1258 HWND API dw_combobox_new(char *text, ULONG cid) 1258 HWND API dw_combobox_new(char *text, ULONG cid)
1259 { 1259 {
1260 return 0; 1260 return 0;
1261 } 1261 }
1262 1262
1263 /* 1263 /*
1264 * Create a new Multiline Editbox window (widget) to be packed. 1264 * Create a new Multiline Editbox window (widget) to be packed.
1265 * Parameters: 1265 * Parameters:
1266 * id: An ID to be used with dw_window_from_id() or 0L. 1266 * id: An ID to be used with dw_window_from_id() or 0L.
1267 * Returns: 1267 * Returns:
1268 * A handle to a MLE window or NULL on failure. 1268 * A handle to a MLE window or NULL on failure.
1269 */ 1269 */
1270 HWND API dw_mle_new(ULONG cid) 1270 HWND API dw_mle_new(ULONG cid)
1271 { 1271 {
1272 return 0; 1272 return 0;
1273 } 1273 }
1274 1274
1376 * Parameters: 1376 * Parameters:
1377 * handle: Handle to the MLE to be cleared. 1377 * handle: Handle to the MLE to be cleared.
1378 * text: Text to search for. 1378 * text: Text to search for.
1379 * point: Start point of search. 1379 * point: Start point of search.
1380 * flags: Search specific flags. 1380 * flags: Search specific flags.
1381 * Returns: 1381 * Returns:
1382 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error. 1382 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error.
1383 */ 1383 */
1384 int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags) 1384 int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags)
1385 { 1385 {
1386 return DW_ERROR_UNKNOWN; 1386 return DW_ERROR_UNKNOWN;
1387 } 1387 }
1388 1388
1407 /* 1407 /*
1408 * Create a new status text window (widget) to be packed. 1408 * Create a new status text window (widget) to be packed.
1409 * Parameters: 1409 * Parameters:
1410 * text: The text to be display by the static text widget. 1410 * text: The text to be display by the static text widget.
1411 * id: An ID to be used with dw_window_from_id() or 0L. 1411 * id: An ID to be used with dw_window_from_id() or 0L.
1412 * Returns: 1412 * Returns:
1413 * A handle to a status text window or NULL on failure. 1413 * A handle to a status text window or NULL on failure.
1414 */ 1414 */
1415 HWND API dw_status_text_new(char *text, ULONG cid) 1415 HWND API dw_status_text_new(char *text, ULONG cid)
1416 { 1416 {
1417 return 0; 1417 return 0;
1418 } 1418 }
1419 1419
1551 /* 1551 /*
1552 * Create a tree object to be packed. 1552 * Create a tree object to be packed.
1553 * Parameters: 1553 * Parameters:
1554 * id: An ID to be used for getting the resource from the 1554 * id: An ID to be used for getting the resource from the
1555 * resource file. 1555 * resource file.
1556 * Returns: 1556 * Returns:
1557 * A handle to a tree window or NULL on failure. 1557 * A handle to a tree window or NULL on failure.
1558 */ 1558 */
1559 HWND API dw_tree_new(ULONG cid) 1559 HWND API dw_tree_new(ULONG cid)
1560 { 1560 {
1561 return 0; 1561 return 0;
1562 } 1562 }
1563 1563
1949 * flags: If this parameter is DW_CRA_SELECTED it will only 1949 * flags: If this parameter is DW_CRA_SELECTED it will only
1950 * return items that are currently selected. Otherwise 1950 * return items that are currently selected. Otherwise
1951 * it will return all records in the container. 1951 * it will return all records in the container.
1952 * Returns: 1952 * Returns:
1953 * Pointer to data associated with first entry or NULL on error. 1953 * Pointer to data associated with first entry or NULL on error.
1954 */ 1954 */
1955 char * API dw_container_query_start(HWND handle, unsigned long flags) 1955 char * API dw_container_query_start(HWND handle, unsigned long flags)
1956 { 1956 {
1957 return NULL; 1957 return NULL;
1958 } 1958 }
1959 1959
1964 * flags: If this parameter is DW_CRA_SELECTED it will only 1964 * flags: If this parameter is DW_CRA_SELECTED it will only
1965 * return items that are currently selected. Otherwise 1965 * return items that are currently selected. Otherwise
1966 * it will return all records in the container. 1966 * it will return all records in the container.
1967 * Returns: 1967 * Returns:
1968 * Pointer to data associated with next entry or NULL on error or completion. 1968 * Pointer to data associated with next entry or NULL on error or completion.
1969 */ 1969 */
1970 char * API dw_container_query_next(HWND handle, unsigned long flags) 1970 char * API dw_container_query_next(HWND handle, unsigned long flags)
1971 { 1971 {
1972 return NULL; 1972 return NULL;
1973 } 1973 }
1974 1974
2041 * Obtains an icon from a file. 2041 * Obtains an icon from a file.
2042 * Parameters: 2042 * Parameters:
2043 * filename: Name of the file, omit extention to have 2043 * filename: Name of the file, omit extention to have
2044 * DW pick the appropriate file extension. 2044 * DW pick the appropriate file extension.
2045 * (ICO on OS/2 or Windows, XPM on Unix) 2045 * (ICO on OS/2 or Windows, XPM on Unix)
2046 * Returns: 2046 * Returns:
2047 * Handle to the created icon or NULL on error. 2047 * Handle to the created icon or NULL on error.
2048 */ 2048 */
2049 HICN API dw_icon_load_from_file(char *filename) 2049 HICN API dw_icon_load_from_file(char *filename)
2050 { 2050 {
2051 return 0; 2051 return 0;
2052 } 2052 }
2053 2053
2056 * Parameters: 2056 * Parameters:
2057 * data: Data for the icon (ICO on OS/2 or Windows, XPM on Unix, PNG on Mac) 2057 * data: Data for the icon (ICO on OS/2 or Windows, XPM on Unix, PNG on Mac)
2058 * len: Length of the passed in data. 2058 * len: Length of the passed in data.
2059 * Returns: 2059 * Returns:
2060 * Handle to the created icon or NULL on error. 2060 * Handle to the created icon or NULL on error.
2061 */ 2061 */
2062 HICN API dw_icon_load_from_data(char *data, int len) 2062 HICN API dw_icon_load_from_data(char *data, int len)
2063 { 2063 {
2064 return 0; 2064 return 0;
2065 } 2065 }
2066 2066
2337 2337
2338 /* 2338 /*
2339 * Create a menu object to be popped up. 2339 * Create a menu object to be popped up.
2340 * Parameters: 2340 * Parameters:
2341 * id: An ID to be used associated with this menu. 2341 * id: An ID to be used associated with this menu.
2342 * Returns: 2342 * Returns:
2343 * Handle to the created menu or NULL on error. 2343 * Handle to the created menu or NULL on error.
2344 */ 2344 */
2345 HMENUI API dw_menu_new(ULONG cid) 2345 HMENUI API dw_menu_new(ULONG cid)
2346 { 2346 {
2347 return 0; 2347 return 0;
2348 } 2348 }
2349 2349
2350 /* 2350 /*
2351 * Create a menubar on a window. 2351 * Create a menubar on a window.
2352 * Parameters: 2352 * Parameters:
2353 * location: Handle of a window frame to be attached to. 2353 * location: Handle of a window frame to be attached to.
2354 * Returns: 2354 * Returns:
2355 * Handle to the created menu bar or NULL on error. 2355 * Handle to the created menu bar or NULL on error.
2356 */ 2356 */
2357 HMENUI API dw_menubar_new(HWND location) 2357 HMENUI API dw_menubar_new(HWND location)
2358 { 2358 {
2359 return 0; 2359 return 0;
2360 } 2360 }
2361 2361
2520 * owner: The Owner's window handle or HWND_DESKTOP. 2520 * owner: The Owner's window handle or HWND_DESKTOP.
2521 * title: The Window title. 2521 * title: The Window title.
2522 * flStyle: Style flags. 2522 * flStyle: Style flags.
2523 * Returns: 2523 * Returns:
2524 * Handle to the created window or NULL on error. 2524 * Handle to the created window or NULL on error.
2525 */ 2525 */
2526 HWND API dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) 2526 HWND API dw_window_new(HWND hwndOwner, char *title, ULONG flStyle)
2527 { 2527 {
2528 return 0; 2528 return 0;
2529 } 2529 }
2530 2530
2578 * Sets the colors used by a specified window (widget) handle. 2578 * Sets the colors used by a specified window (widget) handle.
2579 * Parameters: 2579 * Parameters:
2580 * handle: The window (widget) handle. 2580 * handle: The window (widget) handle.
2581 * fore: Foreground color in DW_RGB format or a default color index. 2581 * fore: Foreground color in DW_RGB format or a default color index.
2582 * back: Background color in DW_RGB format or a default color index. 2582 * back: Background color in DW_RGB format or a default color index.
2583 * Returns: 2583 * Returns:
2584 * DW_ERROR_NONE (0) on success. 2584 * DW_ERROR_NONE (0) on success.
2585 */ 2585 */
2586 int API dw_window_set_color(HWND handle, ULONG fore, ULONG back) 2586 int API dw_window_set_color(HWND handle, ULONG fore, ULONG back)
2587 { 2587 {
2588 return DW_ERROR_GENERAL; 2588 return DW_ERROR_GENERAL;
2589 } 2589 }
2590 2590
2685 2685
2686 /* 2686 /*
2687 * Destroys a window and all of it's children. 2687 * Destroys a window and all of it's children.
2688 * Parameters: 2688 * Parameters:
2689 * handle: The window handle to destroy. 2689 * handle: The window handle to destroy.
2690 * Returns: 2690 * Returns:
2691 * DW_ERROR_NONE (0) on success. 2691 * DW_ERROR_NONE (0) on success.
2692 */ 2692 */
2693 int API dw_window_destroy(HWND handle) 2693 int API dw_window_destroy(HWND handle)
2694 { 2694 {
2695 return DW_ERROR_GENERAL; 2695 return DW_ERROR_GENERAL;
2696 } 2696 }
2697 2697
3030 /* Open a shared library and return a handle. 3030 /* Open a shared library and return a handle.
3031 * Parameters: 3031 * Parameters:
3032 * name: Base name of the shared library. 3032 * name: Base name of the shared library.
3033 * handle: Pointer to a module handle, 3033 * handle: Pointer to a module handle,
3034 * will be filled in with the handle. 3034 * will be filled in with the handle.
3035 * Returns: 3035 * Returns:
3036 * DW_ERROR_NONE (0) on success. 3036 * DW_ERROR_NONE (0) on success.
3037 */ 3037 */
3038 int dw_module_load(char *name, HMOD *handle) 3038 int dw_module_load(char *name, HMOD *handle)
3039 { 3039 {
3040 return DW_ERROR_UNKNOWN; 3040 return DW_ERROR_UNKNOWN;
3212 /* Resets the event semaphore so threads who call wait 3212 /* Resets the event semaphore so threads who call wait
3213 * on this semaphore will block. 3213 * on this semaphore will block.
3214 * Parameters: 3214 * Parameters:
3215 * eve: Handle to the semaphore obtained by 3215 * eve: Handle to the semaphore obtained by
3216 * an get or new call. 3216 * an get or new call.
3217 * Returns: 3217 * Returns:
3218 * DW_ERROR_NONE (0) on success. 3218 * DW_ERROR_NONE (0) on success.
3219 */ 3219 */
3220 int dw_named_event_reset(HEV eve) 3220 int dw_named_event_reset(HEV eve)
3221 { 3221 {
3222 return DW_ERROR_GENERAL; 3222 return DW_ERROR_GENERAL;
3223 } 3223 }
3224 3224
3227 * Parameters: 3227 * Parameters:
3228 * eve: Handle to the semaphore obtained by 3228 * eve: Handle to the semaphore obtained by
3229 * an get or new call. 3229 * an get or new call.
3230 * Returns: 3230 * Returns:
3231 * DW_ERROR_NONE (0) on success. 3231 * DW_ERROR_NONE (0) on success.
3232 */ 3232 */
3233 int dw_named_event_post(HEV eve) 3233 int dw_named_event_post(HEV eve)
3234 { 3234 {
3235 return DW_ERROR_GENERAL; 3235 return DW_ERROR_GENERAL;
3236 } 3236 }
3237 3237
3253 /* Release this semaphore, if there are no more open 3253 /* Release this semaphore, if there are no more open
3254 * handles on this semaphore the semaphore will be destroyed. 3254 * handles on this semaphore the semaphore will be destroyed.
3255 * Parameters: 3255 * Parameters:
3256 * eve: Handle to the semaphore obtained by 3256 * eve: Handle to the semaphore obtained by
3257 * an get or new call. 3257 * an get or new call.
3258 * Returns: 3258 * Returns:
3259 * DW_ERROR_NONE (0) on success. 3259 * DW_ERROR_NONE (0) on success.
3260 */ 3260 */
3261 int dw_named_event_close(HEV eve) 3261 int dw_named_event_close(HEV eve)
3262 { 3262 {
3263 return DW_ERROR_UNKNOWN; 3263 return DW_ERROR_UNKNOWN;
3264 } 3264 }
3265 3265
3284 * dest: A pointer to a pointer to receive the memory address. 3284 * dest: A pointer to a pointer to receive the memory address.
3285 * size: Size in bytes of the shared memory region to allocate. 3285 * size: Size in bytes of the shared memory region to allocate.
3286 * name: A string pointer to a unique memory name. 3286 * name: A string pointer to a unique memory name.
3287 * Returns: 3287 * Returns:
3288 * Handle to shared memory or NULL on error. 3288 * Handle to shared memory or NULL on error.
3289 */ 3289 */
3290 HSHM dw_named_memory_new(void **dest, int size, char *name) 3290 HSHM dw_named_memory_new(void **dest, int size, char *name)
3291 { 3291 {
3292 return NULL; 3292 return NULL;
3293 } 3293 }
3294 3294
3298 * dest: A pointer to a pointer to receive the memory address. 3298 * dest: A pointer to a pointer to receive the memory address.
3299 * size: Size in bytes of the shared memory region to requested. 3299 * size: Size in bytes of the shared memory region to requested.
3300 * name: A string pointer to a unique memory name. 3300 * name: A string pointer to a unique memory name.
3301 * Returns: 3301 * Returns:
3302 * Handle to shared memory or NULL on error. 3302 * Handle to shared memory or NULL on error.
3303 */ 3303 */
3304 HSHM dw_named_memory_get(void **dest, int size, char *name) 3304 HSHM dw_named_memory_get(void **dest, int size, char *name)
3305 { 3305 {
3306 return NULL; 3306 return NULL;
3307 } 3307 }
3308 3308
3311 * Parameters: 3311 * Parameters:
3312 * handle: Handle obtained from dw_named_memory_new(). 3312 * handle: Handle obtained from dw_named_memory_new().
3313 * ptr: The memory address aquired with dw_named_memory_new(). 3313 * ptr: The memory address aquired with dw_named_memory_new().
3314 * Returns: 3314 * Returns:
3315 * DW_ERROR_NONE (0) on success or DW_ERROR_UNKNOWN (-1) on error. 3315 * DW_ERROR_NONE (0) on success or DW_ERROR_UNKNOWN (-1) on error.
3316 */ 3316 */
3317 int dw_named_memory_free(HSHM handle, void *ptr) 3317 int dw_named_memory_free(HSHM handle, void *ptr)
3318 { 3318 {
3319 int rc = DW_ERROR_UNKNOWN; 3319 int rc = DW_ERROR_UNKNOWN;
3320 3320
3321 return rc; 3321 return rc;
3325 * Creates a new thread with a starting point of func. 3325 * Creates a new thread with a starting point of func.
3326 * Parameters: 3326 * Parameters:
3327 * func: Function which will be run in the new thread. 3327 * func: Function which will be run in the new thread.
3328 * data: Parameter(s) passed to the function. 3328 * data: Parameter(s) passed to the function.
3329 * stack: Stack size of new thread (OS/2 and Windows only). 3329 * stack: Stack size of new thread (OS/2 and Windows only).
3330 * Returns: 3330 * Returns:
3331 * Thread ID on success or DW_ERROR_UNKNOWN (-1) on error. 3331 * Thread ID on success or DW_ERROR_UNKNOWN (-1) on error.
3332 */ 3332 */
3333 DWTID dw_thread_new(void *func, void *data, int stack) 3333 DWTID dw_thread_new(void *func, void *data, int stack)
3334 { 3334 {
3335 return (DWTID)DW_ERROR_UNKNOWN; 3335 return (DWTID)DW_ERROR_UNKNOWN;
3336 } 3336 }
3337 3337
3370 * Loads a web browser pointed at the given URL. 3370 * Loads a web browser pointed at the given URL.
3371 * Parameters: 3371 * Parameters:
3372 * url: Uniform resource locator. 3372 * url: Uniform resource locator.
3373 * Returns: 3373 * Returns:
3374 * DW_ERROR_NONE (0) on success. 3374 * DW_ERROR_NONE (0) on success.
3375 */ 3375 */
3376 int dw_browse(char *url) 3376 int dw_browse(char *url)
3377 { 3377 {
3378 return DW_ERROR_GENERAL; 3378 return DW_ERROR_GENERAL;
3379 } 3379 }