Mercurial > dwindows
comparison template/dw.c @ 2225:1ec6300a627b
Updated the platform template for the new 3.1 APIs.
Removed lingering Photon support, replace it with __TEMPLATE__.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 26 Dec 2020 03:42:38 +0000 |
parents | 2b30ff777eee |
children | 2de088fb5dd4 |
comparison
equal
deleted
inserted
replaced
2224:d3974aa8ad64 | 2225:1ec6300a627b |
---|---|
1 /* | 1 /* |
2 * Dynamic Windows: | 2 * Dynamic Windows: |
3 * A GTK like GUI implementation template. | 3 * A GTK like GUI implementation template. |
4 * | 4 * |
5 * (C) 2011-2012 Brian Smith <brian@dbsoft.org> | 5 * (C) 2011-2021 Brian Smith <brian@dbsoft.org> |
6 * (C) 2011-2012 Mark Hessling <mark@rexx.org> | 6 * (C) 2011-2021 Mark Hessling <mark@rexx.org> |
7 * | |
8 * Compile with $CC -I. -D__TEMPLATE__ template/dw.c | |
7 * | 9 * |
8 */ | 10 */ |
9 | 11 |
10 #include "dw.h" | 12 #include "dw.h" |
11 #include <stdlib.h> | 13 #include <stdlib.h> |
289 /* | 291 /* |
290 * Returns a pointer to a static buffer which contains the | 292 * Returns a pointer to a static buffer which contains the |
291 * current user directory. Or the root directory if it could | 293 * current user directory. Or the root directory if it could |
292 * not be determined. | 294 * not be determined. |
293 */ | 295 */ |
296 char * API dw_user_dir(void) | |
297 { | |
298 static char _dw_user_dir[MAX_PATH+1] = {0}; | |
299 | |
300 if(!_dw_user_dir[0]) | |
301 { | |
302 char *home = getenv("HOME"); | |
303 | |
304 if(home) | |
305 strcpy(_dw_user_dir, home); | |
306 else | |
307 strcpy(_dw_user_dir, "/"); | |
308 } | |
309 return _dw_user_dir; | |
310 } | |
311 | |
312 /* | |
313 * Returns a pointer to a static buffer which containes the | |
314 * private application data directory. | |
315 */ | |
294 char * API dw_app_dir(void) | 316 char * API dw_app_dir(void) |
295 { | 317 { |
296 static char _user_dir[1024] = ""; | 318 static char _dw_exec_dir[MAX_PATH+1] = {0}; |
297 | 319 /* Code to determine the execution directory here, |
298 if(!_user_dir[0]) | 320 * some implementations make this variable global |
299 { | 321 * and determin the location in dw_init(). |
300 char *home = getenv("HOME"); | 322 */ |
301 | 323 return _dw_exec_dir; |
302 if(home) | 324 } |
303 strcpy(_user_dir, home); | 325 |
304 else | 326 /* |
305 strcpy(_user_dir, "/"); | 327 * Sets the application ID used by this Dynamic Windows application instance. |
306 } | 328 * Parameters: |
307 return _user_dir; | 329 * appid: A string typically in the form: com.company.division.application |
308 } | 330 * appname: The application name used on Windows or NULL. |
309 | 331 * Returns: |
310 /* | 332 * DW_ERROR_NONE after successfully setting the application ID. |
311 * Returns a pointer to a static buffer which containes the | 333 * DW_ERROR_UNKNOWN if unsupported on this system. |
312 * private application data directory. | 334 * DW_ERROR_GENERAL if the application ID is not allowed. |
313 */ | 335 * Remarks: |
314 char *dw_app_dir(void) | 336 * This must be called before dw_init(). If dw_init() is called first |
315 { | 337 * it will create a unique ID in the form: org.dbsoft.dwindows.application |
316 static _dw_app_dir[MAX_PATH+1] = "/"; | 338 * or if the application name cannot be detected: org.dbsoft.dwindows.pid.# |
317 return _dw_app_dir; | 339 * The appname is only required on Windows. If NULL is passed the detected |
340 * application name will be used, but a prettier name may be desired. | |
341 */ | |
342 int API dw_app_id_set(const char * DW_UNUSED(appid), const char * DW_UNUSED(appname)) | |
343 { | |
344 return DW_ERROR_UNKNOWN; | |
318 } | 345 } |
319 | 346 |
320 /* | 347 /* |
321 * Displays a debug message on the console... | 348 * Displays a debug message on the console... |
322 * Parameters: | 349 * Parameters: |
323 * format: printf style format string. | 350 * format: printf style format string. |
324 * ...: Additional variables for use in the format. | 351 * ...: Additional variables for use in the format. |
325 */ | 352 */ |
326 void API dw_debug(char *format, ...) | 353 void API dw_debug(const char *format, ...) |
327 { | 354 { |
328 va_list args; | 355 va_list args; |
329 char outbuf[1025] = {0}; | 356 char outbuf[1025] = {0}; |
330 | 357 |
331 va_start(args, format); | 358 va_start(args, format); |
332 vsnprintf(outbuf, 1024, format, args); | 359 vsnprintf(outbuf, 1024, format, args); |
333 va_end(args); | 360 va_end(args); |
334 | 361 |
362 /* Output to stderr, if there is another way to send it | |
363 * on the implementation platform, change this. | |
364 */ | |
335 fprintf(stderr, "%s", outbuf); | 365 fprintf(stderr, "%s", outbuf); |
336 } | 366 } |
337 | 367 |
338 /* | 368 /* |
339 * Displays a Message Box with given text and title.. | 369 * Displays a Message Box with given text and title.. |
344 * ...: Additional variables for use in the format. | 374 * ...: Additional variables for use in the format. |
345 * Returns: | 375 * Returns: |
346 * DW_MB_RETURN_YES, DW_MB_RETURN_NO, DW_MB_RETURN_OK, | 376 * DW_MB_RETURN_YES, DW_MB_RETURN_NO, DW_MB_RETURN_OK, |
347 * or DW_MB_RETURN_CANCEL based on flags and user response. | 377 * or DW_MB_RETURN_CANCEL based on flags and user response. |
348 */ | 378 */ |
349 int API dw_messagebox(char *title, int flags, char *format, ...) | 379 int API dw_messagebox(const char *title, int flags, const char *format, ...) |
350 { | 380 { |
351 return 0; | 381 return 0; |
352 } | 382 } |
353 | 383 |
354 /* | 384 /* |
361 * Returns: | 391 * Returns: |
362 * NULL on error. A malloced buffer containing | 392 * NULL on error. A malloced buffer containing |
363 * the file path on success. | 393 * the file path on success. |
364 * | 394 * |
365 */ | 395 */ |
366 char * API dw_file_browse(char *title, char *defpath, char *ext, int flags) | 396 char * API dw_file_browse(const char *title, const char *defpath, const char *ext, int flags) |
367 { | 397 { |
368 return NULL; | 398 return NULL; |
369 } | 399 } |
370 | 400 |
371 /* | 401 /* |
385 * Sets the contents of the default clipboard to the supplied text. | 415 * Sets the contents of the default clipboard to the supplied text. |
386 * Parameters: | 416 * Parameters: |
387 * str: Text to put on the clipboard. | 417 * str: Text to put on the clipboard. |
388 * len: Length of the text. | 418 * len: Length of the text. |
389 */ | 419 */ |
390 void dw_clipboard_set_text(char *str, int len) | 420 void dw_clipboard_set_text(const char *str, int len) |
391 { | 421 { |
392 } | 422 } |
393 | 423 |
394 | 424 |
395 /* | 425 /* |
480 * pad: Number of pixels to pad around the box. | 510 * pad: Number of pixels to pad around the box. |
481 * title: Text to be displayined in the group outline. | 511 * title: Text to be displayined in the group outline. |
482 * Returns: | 512 * Returns: |
483 * A handle to a groupbox window or NULL on failure. | 513 * A handle to a groupbox window or NULL on failure. |
484 */ | 514 */ |
485 HWND API dw_groupbox_new(int type, int pad, char *title) | 515 HWND API dw_groupbox_new(int type, int pad, const char *title) |
486 { | 516 { |
487 return 0; | 517 return 0; |
488 } | 518 } |
489 | 519 |
490 /* | 520 /* |
678 * text: The text to be display by the static text widget. | 708 * text: The text to be display by the static text widget. |
679 * id: An ID to be used with dw_window_from_id() or 0L. | 709 * id: An ID to be used with dw_window_from_id() or 0L. |
680 * Returns: | 710 * Returns: |
681 * A handle to a button window or NULL on failure. | 711 * A handle to a button window or NULL on failure. |
682 */ | 712 */ |
683 HWND API dw_button_new(char *text, ULONG cid) | 713 HWND API dw_button_new(const char *text, ULONG cid) |
684 { | 714 { |
685 return 0; | 715 return 0; |
686 } | 716 } |
687 | 717 |
688 /* | 718 /* |
691 * text: The default text to be in the entryfield widget. | 721 * text: The default text to be in the entryfield widget. |
692 * id: An ID to be used with dw_window_from_id() or 0L. | 722 * id: An ID to be used with dw_window_from_id() or 0L. |
693 * Returns: | 723 * Returns: |
694 * A handle to an entryfield window or NULL on failure. | 724 * A handle to an entryfield window or NULL on failure. |
695 */ | 725 */ |
696 HWND API dw_entryfield_new(char *text, ULONG cid) | 726 HWND API dw_entryfield_new(const char *text, ULONG cid) |
697 { | 727 { |
698 return 0; | 728 return 0; |
699 } | 729 } |
700 | 730 |
701 /* | 731 /* |
704 * text: The default text to be in the entryfield widget. | 734 * text: The default text to be in the entryfield widget. |
705 * id: An ID to be used with dw_window_from_id() or 0L. | 735 * id: An ID to be used with dw_window_from_id() or 0L. |
706 * Returns: | 736 * Returns: |
707 * A handle to an entryfield password window or NULL on failure. | 737 * A handle to an entryfield password window or NULL on failure. |
708 */ | 738 */ |
709 HWND API dw_entryfield_password_new(char *text, ULONG cid) | 739 HWND API dw_entryfield_password_new(const char *text, ULONG cid) |
710 { | 740 { |
711 return 0; | 741 return 0; |
712 } | 742 } |
713 | 743 |
714 /* | 744 /* |
727 * text: Bubble help text to be displayed. | 757 * text: Bubble help text to be displayed. |
728 * id: An ID of a bitmap in the resource file. | 758 * id: An ID of a bitmap in the resource file. |
729 * Returns: | 759 * Returns: |
730 * A handle to a bitmap button window or NULL on failure. | 760 * A handle to a bitmap button window or NULL on failure. |
731 */ | 761 */ |
732 HWND API dw_bitmapbutton_new(char *text, ULONG resid) | 762 HWND API dw_bitmapbutton_new(const char *text, ULONG resid) |
733 { | 763 { |
734 return 0; | 764 return 0; |
735 } | 765 } |
736 | 766 |
737 /* | 767 /* |
743 * DW pick the appropriate file extension. | 773 * DW pick the appropriate file extension. |
744 * (BMP on OS/2 or Windows, XPM on Unix) | 774 * (BMP on OS/2 or Windows, XPM on Unix) |
745 * Returns: | 775 * Returns: |
746 * A handle to a bitmap button window or NULL on failure. | 776 * A handle to a bitmap button window or NULL on failure. |
747 */ | 777 */ |
748 HWND API dw_bitmapbutton_new_from_file(char *text, unsigned long cid, char *filename) | 778 HWND API dw_bitmapbutton_new_from_file(const char *text, unsigned long cid, const char *filename) |
749 { | 779 { |
750 return 0; | 780 return 0; |
751 } | 781 } |
752 | 782 |
753 /* | 783 /* |
759 * (BMP or ICO on OS/2 or Windows, XPM on Unix) | 789 * (BMP or ICO on OS/2 or Windows, XPM on Unix) |
760 * len: length of str | 790 * len: length of str |
761 * Returns: | 791 * Returns: |
762 * A handle to a bitmap button window or NULL on failure. | 792 * A handle to a bitmap button window or NULL on failure. |
763 */ | 793 */ |
764 HWND API dw_bitmapbutton_new_from_data(char *text, unsigned long cid, char *data, int len) | 794 HWND API dw_bitmapbutton_new_from_data(const char *text, unsigned long cid, const char *data, int len) |
765 { | 795 { |
766 return 0; | 796 return 0; |
767 } | 797 } |
768 | 798 |
769 /* | 799 /* |
772 * text: The text to be display by the static text widget. | 802 * text: The text to be display by the static text widget. |
773 * id: An ID to be used with dw_window_from_id() or 0L. | 803 * id: An ID to be used with dw_window_from_id() or 0L. |
774 * Returns: | 804 * Returns: |
775 * A handle to a spinbutton window or NULL on failure. | 805 * A handle to a spinbutton window or NULL on failure. |
776 */ | 806 */ |
777 HWND API dw_spinbutton_new(char *text, ULONG cid) | 807 HWND API dw_spinbutton_new(const char *text, ULONG cid) |
778 { | 808 { |
779 return 0; | 809 return 0; |
780 } | 810 } |
781 | 811 |
782 /* | 812 /* |
818 * text: The text to be display by the static text widget. | 848 * text: The text to be display by the static text widget. |
819 * id: An ID to be used with dw_window_from_id() or 0L. | 849 * id: An ID to be used with dw_window_from_id() or 0L. |
820 * Returns: | 850 * Returns: |
821 * A handle to a radio button window or NULL on failure. | 851 * A handle to a radio button window or NULL on failure. |
822 */ | 852 */ |
823 HWND API dw_radiobutton_new(char *text, ULONG cid) | 853 HWND API dw_radiobutton_new(const char *text, ULONG cid) |
824 { | 854 { |
825 return 0; | 855 return 0; |
826 } | 856 } |
827 | 857 |
828 /* | 858 /* |
935 * text: The text to be display by the static text widget. | 965 * text: The text to be display by the static text widget. |
936 * id: An ID to be used with dw_window_from_id() or 0L. | 966 * id: An ID to be used with dw_window_from_id() or 0L. |
937 * Returns: | 967 * Returns: |
938 * A handle to a checkbox window or NULL on failure. | 968 * A handle to a checkbox window or NULL on failure. |
939 */ | 969 */ |
940 HWND API dw_checkbox_new(char *text, ULONG cid) | 970 HWND API dw_checkbox_new(const char *text, ULONG cid) |
941 { | 971 { |
942 return 0; | 972 return 0; |
943 } | 973 } |
944 | 974 |
945 /* | 975 /* |
981 * Appends the specified text to the listbox's (or combobox) entry list. | 1011 * Appends the specified text to the listbox's (or combobox) entry list. |
982 * Parameters: | 1012 * Parameters: |
983 * handle: Handle to the listbox to be appended to. | 1013 * handle: Handle to the listbox to be appended to. |
984 * text: Text to append into listbox. | 1014 * text: Text to append into listbox. |
985 */ | 1015 */ |
986 void API dw_listbox_append(HWND handle, char *text) | 1016 void API dw_listbox_append(HWND handle, const char *text) |
987 { | 1017 { |
988 } | 1018 } |
989 | 1019 |
990 /* | 1020 /* |
991 * Inserts the specified text into the listbox's (or combobox) entry list. | 1021 * Inserts the specified text into the listbox's (or combobox) entry list. |
992 * Parameters: | 1022 * Parameters: |
993 * handle: Handle to the listbox to be inserted into. | 1023 * handle: Handle to the listbox to be inserted into. |
994 * text: Text to insert into listbox. | 1024 * text: Text to insert into listbox. |
995 * pos: 0-based position to insert text | 1025 * pos: 0-based position to insert text |
996 */ | 1026 */ |
997 void API dw_listbox_insert(HWND handle, char *text, int pos) | 1027 void API dw_listbox_insert(HWND handle, const char *text, int pos) |
998 { | 1028 { |
999 } | 1029 } |
1000 | 1030 |
1001 /* | 1031 /* |
1002 * Appends the specified text items to the listbox's (or combobox) entry list. | 1032 * Appends the specified text items to the listbox's (or combobox) entry list. |
1057 * Parameters: | 1087 * Parameters: |
1058 * handle: Handle to the listbox to be queried. | 1088 * handle: Handle to the listbox to be queried. |
1059 * index: Index into the list to be queried. | 1089 * index: Index into the list to be queried. |
1060 * buffer: Buffer where text will be copied. | 1090 * buffer: Buffer where text will be copied. |
1061 */ | 1091 */ |
1062 void API dw_listbox_set_text(HWND handle, unsigned int index, char *buffer) | 1092 void API dw_listbox_set_text(HWND handle, unsigned int index, const char *buffer) |
1063 { | 1093 { |
1064 } | 1094 } |
1065 | 1095 |
1066 /* | 1096 /* |
1067 * Returns the index to the item in the list currently selected. | 1097 * Returns the index to the item in the list currently selected. |
1115 * text: The default text to be in the combpbox widget. | 1145 * text: The default text to be in the combpbox widget. |
1116 * id: An ID to be used with dw_window_from_id() or 0L. | 1146 * id: An ID to be used with dw_window_from_id() or 0L. |
1117 * Returns: | 1147 * Returns: |
1118 * A handle to a combobox window or NULL on failure. | 1148 * A handle to a combobox window or NULL on failure. |
1119 */ | 1149 */ |
1120 HWND API dw_combobox_new(char *text, ULONG cid) | 1150 HWND API dw_combobox_new(const char *text, ULONG cid) |
1121 { | 1151 { |
1122 return 0; | 1152 return 0; |
1123 } | 1153 } |
1124 | 1154 |
1125 /* | 1155 /* |
1141 * buffer: Text buffer to be imported. | 1171 * buffer: Text buffer to be imported. |
1142 * startpoint: Point to start entering text. | 1172 * startpoint: Point to start entering text. |
1143 * Returns: | 1173 * Returns: |
1144 * Current position in the buffer. | 1174 * Current position in the buffer. |
1145 */ | 1175 */ |
1146 unsigned int API dw_mle_import(HWND handle, char *buffer, int startpoint) | 1176 unsigned int API dw_mle_import(HWND handle, const char *buffer, int startpoint) |
1147 { | 1177 { |
1148 return 0; | 1178 return 0; |
1149 } | 1179 } |
1150 | 1180 |
1151 /* | 1181 /* |
1232 void API dw_mle_set_cursor(HWND handle, int point) | 1262 void API dw_mle_set_cursor(HWND handle, int point) |
1233 { | 1263 { |
1234 } | 1264 } |
1235 | 1265 |
1236 /* | 1266 /* |
1267 * Sets the word auto complete state of an MLE box. | |
1268 * Parameters: | |
1269 * handle: Handle to the MLE. | |
1270 * state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE | |
1271 */ | |
1272 void API dw_mle_set_auto_complete(HWND handle, int state) | |
1273 { | |
1274 } | |
1275 | |
1276 /* | |
1237 * Finds text in an MLE box. | 1277 * Finds text in an MLE box. |
1238 * Parameters: | 1278 * Parameters: |
1239 * handle: Handle to the MLE to be cleared. | 1279 * handle: Handle to the MLE to be cleared. |
1240 * text: Text to search for. | 1280 * text: Text to search for. |
1241 * point: Start point of search. | 1281 * point: Start point of search. |
1242 * flags: Search specific flags. | 1282 * flags: Search specific flags. |
1243 * Returns: | 1283 * Returns: |
1244 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error. | 1284 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error. |
1245 */ | 1285 */ |
1246 int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags) | 1286 int API dw_mle_search(HWND handle, const char *text, int point, unsigned long flags) |
1247 { | 1287 { |
1248 return DW_ERROR_UNKNOWN; | 1288 return DW_ERROR_UNKNOWN; |
1249 } | 1289 } |
1250 | 1290 |
1251 /* | 1291 /* |
1272 * text: The text to be display by the static text widget. | 1312 * text: The text to be display by the static text widget. |
1273 * id: An ID to be used with dw_window_from_id() or 0L. | 1313 * id: An ID to be used with dw_window_from_id() or 0L. |
1274 * Returns: | 1314 * Returns: |
1275 * A handle to a status text window or NULL on failure. | 1315 * A handle to a status text window or NULL on failure. |
1276 */ | 1316 */ |
1277 HWND API dw_status_text_new(char *text, ULONG cid) | 1317 HWND API dw_status_text_new(const char *text, ULONG cid) |
1278 { | 1318 { |
1279 return 0; | 1319 return 0; |
1280 } | 1320 } |
1281 | 1321 |
1282 /* | 1322 /* |
1285 * text: The text to be display by the static text widget. | 1325 * text: The text to be display by the static text widget. |
1286 * id: An ID to be used with dw_window_from_id() or 0L. | 1326 * id: An ID to be used with dw_window_from_id() or 0L. |
1287 * Returns: | 1327 * Returns: |
1288 * A handle to a text window or NULL on failure. | 1328 * A handle to a text window or NULL on failure. |
1289 */ | 1329 */ |
1290 HWND API dw_text_new(char *text, ULONG cid) | 1330 HWND API dw_text_new(const char *text, ULONG cid) |
1291 { | 1331 { |
1292 return 0; | 1332 return 0; |
1293 } | 1333 } |
1294 | 1334 |
1295 /* | 1335 /* |
1365 * pixmap: Handle to the pixmap. (choose only one of these) | 1405 * pixmap: Handle to the pixmap. (choose only one of these) |
1366 * x: X coordinate. | 1406 * x: X coordinate. |
1367 * y: Y coordinate. | 1407 * y: Y coordinate. |
1368 * text: Text to be displayed. | 1408 * text: Text to be displayed. |
1369 */ | 1409 */ |
1370 void API dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) | 1410 void API dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, const char *text) |
1371 { | 1411 { |
1372 } | 1412 } |
1373 | 1413 |
1374 /* Query the width and height of a text string. | 1414 /* Query the width and height of a text string. |
1375 * Parameters: | 1415 * Parameters: |
1377 * pixmap: Handle to the pixmap. (choose only one of these) | 1417 * pixmap: Handle to the pixmap. (choose only one of these) |
1378 * text: Text to be queried. | 1418 * text: Text to be queried. |
1379 * width: Pointer to a variable to be filled in with the width. | 1419 * width: Pointer to a variable to be filled in with the width. |
1380 * height: Pointer to a variable to be filled in with the height. | 1420 * height: Pointer to a variable to be filled in with the height. |
1381 */ | 1421 */ |
1382 void API dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height) | 1422 void API dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, const char *text, int *width, int *height) |
1383 { | 1423 { |
1384 } | 1424 } |
1385 | 1425 |
1386 /* Draw a polygon on a window (preferably a render window). | 1426 /* Draw a polygon on a window (preferably a render window). |
1387 * Parameters: | 1427 * Parameters: |
1450 * parent: Parent handle or 0 if root. | 1490 * parent: Parent handle or 0 if root. |
1451 * itemdata: Item specific data. | 1491 * itemdata: Item specific data. |
1452 * Returns: | 1492 * Returns: |
1453 * A handle to a tree item or NULL on failure. | 1493 * A handle to a tree item or NULL on failure. |
1454 */ | 1494 */ |
1455 HTREEITEM API dw_tree_insert_after(HWND handle, HTREEITEM item, char *title, HICN icon, HTREEITEM parent, void *itemdata) | 1495 HTREEITEM API dw_tree_insert_after(HWND handle, HTREEITEM item, const char *title, HICN icon, HTREEITEM parent, void *itemdata) |
1456 { | 1496 { |
1457 return 0; | 1497 return 0; |
1458 } | 1498 } |
1459 | 1499 |
1460 /* | 1500 /* |
1466 * parent: Parent handle or 0 if root. | 1506 * parent: Parent handle or 0 if root. |
1467 * itemdata: Item specific data. | 1507 * itemdata: Item specific data. |
1468 * Returns: | 1508 * Returns: |
1469 * A handle to a tree item or NULL on failure. | 1509 * A handle to a tree item or NULL on failure. |
1470 */ | 1510 */ |
1471 HTREEITEM API dw_tree_insert(HWND handle, char *title, HICN icon, HTREEITEM parent, void *itemdata) | 1511 HTREEITEM API dw_tree_insert(HWND handle, const char *title, HICN icon, HTREEITEM parent, void *itemdata) |
1472 { | 1512 { |
1473 return 0; | 1513 return 0; |
1474 } | 1514 } |
1475 | 1515 |
1476 /* | 1516 /* |
1505 * handle: Handle to the tree containing the item. | 1545 * handle: Handle to the tree containing the item. |
1506 * item: Handle of the item to be modified. | 1546 * item: Handle of the item to be modified. |
1507 * title: The text title of the entry. | 1547 * title: The text title of the entry. |
1508 * icon: Handle to coresponding icon. | 1548 * icon: Handle to coresponding icon. |
1509 */ | 1549 */ |
1510 void API dw_tree_item_change(HWND handle, HTREEITEM item, char *title, HICN icon) | 1550 void API dw_tree_item_change(HWND handle, HTREEITEM item, const char *title, HICN icon) |
1511 { | 1551 { |
1512 } | 1552 } |
1513 | 1553 |
1514 /* | 1554 /* |
1515 * Sets the item data of a tree item. | 1555 * Sets the item data of a tree item. |
1618 * Configures the main filesystem column title for localization. | 1658 * Configures the main filesystem column title for localization. |
1619 * Parameters: | 1659 * Parameters: |
1620 * handle: Handle to the container to be configured. | 1660 * handle: Handle to the container to be configured. |
1621 * title: The title to be displayed in the main column. | 1661 * title: The title to be displayed in the main column. |
1622 */ | 1662 */ |
1623 void API dw_filesystem_set_column_title(HWND handle, char *title) | 1663 void API dw_filesystem_set_column_title(HWND handle, const char *title) |
1624 { | 1664 { |
1625 } | 1665 } |
1626 | 1666 |
1627 /* | 1667 /* |
1628 * Sets up the filesystem columns, note: filesystem always has an icon/filename field. | 1668 * Sets up the filesystem columns, note: filesystem always has an icon/filename field. |
1696 * pointer: Pointer to the allocated memory in dw_container_alloc(). | 1736 * pointer: Pointer to the allocated memory in dw_container_alloc(). |
1697 * column: Zero based column of data being set. | 1737 * column: Zero based column of data being set. |
1698 * row: Zero based row of data being set. | 1738 * row: Zero based row of data being set. |
1699 * data: Pointer to the data to be added. | 1739 * data: Pointer to the data to be added. |
1700 */ | 1740 */ |
1701 void API dw_filesystem_change_file(HWND handle, int row, char *filename, HICN icon) | 1741 void API dw_filesystem_change_file(HWND handle, int row, const char *filename, HICN icon) |
1702 { | 1742 { |
1703 } | 1743 } |
1704 | 1744 |
1705 /* | 1745 /* |
1706 * Sets an item in specified row and column to the given data. | 1746 * Sets an item in specified row and column to the given data. |
1709 * pointer: Pointer to the allocated memory in dw_container_alloc(). | 1749 * pointer: Pointer to the allocated memory in dw_container_alloc(). |
1710 * column: Zero based column of data being set. | 1750 * column: Zero based column of data being set. |
1711 * row: Zero based row of data being set. | 1751 * row: Zero based row of data being set. |
1712 * data: Pointer to the data to be added. | 1752 * data: Pointer to the data to be added. |
1713 */ | 1753 */ |
1714 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, HICN icon) | 1754 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, const char *filename, HICN icon) |
1715 { | 1755 { |
1716 } | 1756 } |
1717 | 1757 |
1718 /* | 1758 /* |
1719 * Sets an item in specified row and column to the given data. | 1759 * Sets an item in specified row and column to the given data. |
1783 * Parameters: | 1823 * Parameters: |
1784 * pointer: Pointer to the allocated memory in dw_container_alloc(). | 1824 * pointer: Pointer to the allocated memory in dw_container_alloc(). |
1785 * row: Zero based row of data being set. | 1825 * row: Zero based row of data being set. |
1786 * title: String title of the item. | 1826 * title: String title of the item. |
1787 */ | 1827 */ |
1788 void API dw_container_set_row_title(void *pointer, int row, char *title) | 1828 void API dw_container_set_row_title(void *pointer, int row, const char *title) |
1789 { | 1829 { |
1790 } | 1830 } |
1791 | 1831 |
1792 | 1832 |
1793 /* | 1833 /* |
1795 * Parameters: | 1835 * Parameters: |
1796 * handle: Handle to window (widget) of container. | 1836 * handle: Handle to window (widget) of container. |
1797 * row: Zero based row of data being set. | 1837 * row: Zero based row of data being set. |
1798 * title: String title of the item. | 1838 * title: String title of the item. |
1799 */ | 1839 */ |
1800 void API dw_container_change_row_title(HWND handle, int row, char *title) | 1840 void API dw_container_change_row_title(HWND handle, int row, const char *title) |
1801 { | 1841 { |
1802 } | 1842 } |
1803 | 1843 |
1804 /* | 1844 /* |
1805 * Sets the title of a row in the container. | 1845 * Sets the title of a row in the container. |
1878 * Cursors the item with the text speficied, and scrolls to that item. | 1918 * Cursors the item with the text speficied, and scrolls to that item. |
1879 * Parameters: | 1919 * Parameters: |
1880 * handle: Handle to the window (widget) to be queried. | 1920 * handle: Handle to the window (widget) to be queried. |
1881 * text: Text usually returned by dw_container_query(). | 1921 * text: Text usually returned by dw_container_query(). |
1882 */ | 1922 */ |
1883 void API dw_container_cursor(HWND handle, char *text) | 1923 void API dw_container_cursor(HWND handle, const char *text) |
1884 { | 1924 { |
1885 } | 1925 } |
1886 | 1926 |
1887 /* | 1927 /* |
1888 * Deletes the item with the text speficied. | 1928 * Deletes the item with the text speficied. |
1889 * Parameters: | 1929 * Parameters: |
1890 * handle: Handle to the window (widget). | 1930 * handle: Handle to the window (widget). |
1891 * text: Text usually returned by dw_container_query(). | 1931 * text: Text usually returned by dw_container_query(). |
1892 */ | 1932 */ |
1893 void API dw_container_delete_row(HWND handle, char *text) | 1933 void API dw_container_delete_row(HWND handle, const char *text) |
1894 { | 1934 { |
1895 } | 1935 } |
1896 | 1936 |
1897 /* | 1937 /* |
1898 * Optimizes the column widths so that all data is visible. | 1938 * Optimizes the column widths so that all data is visible. |
1908 * Parameters: | 1948 * Parameters: |
1909 * handle: Window handle that will handle taskbar icon messages. | 1949 * handle: Window handle that will handle taskbar icon messages. |
1910 * icon: Icon handle to display in the taskbar. | 1950 * icon: Icon handle to display in the taskbar. |
1911 * bubbletext: Text to show when the mouse is above the icon. | 1951 * bubbletext: Text to show when the mouse is above the icon. |
1912 */ | 1952 */ |
1913 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext) | 1953 void API dw_taskbar_insert(HWND handle, HICN icon, const char *bubbletext) |
1914 { | 1954 { |
1915 } | 1955 } |
1916 | 1956 |
1917 /* | 1957 /* |
1918 * Deletes an icon from the taskbar. | 1958 * Deletes an icon from the taskbar. |
1946 * DW pick the appropriate file extension. | 1986 * DW pick the appropriate file extension. |
1947 * (ICO on OS/2 or Windows, XPM on Unix) | 1987 * (ICO on OS/2 or Windows, XPM on Unix) |
1948 * Returns: | 1988 * Returns: |
1949 * Handle to the created icon or NULL on error. | 1989 * Handle to the created icon or NULL on error. |
1950 */ | 1990 */ |
1951 HICN API dw_icon_load_from_file(char *filename) | 1991 HICN API dw_icon_load_from_file(const char *filename) |
1952 { | 1992 { |
1953 return 0; | 1993 return 0; |
1954 } | 1994 } |
1955 | 1995 |
1956 /* | 1996 /* |
1959 * data: Data for the icon (ICO on OS/2 or Windows, XPM on Unix, PNG on Mac) | 1999 * data: Data for the icon (ICO on OS/2 or Windows, XPM on Unix, PNG on Mac) |
1960 * len: Length of the passed in data. | 2000 * len: Length of the passed in data. |
1961 * Returns: | 2001 * Returns: |
1962 * Handle to the created icon or NULL on error. | 2002 * Handle to the created icon or NULL on error. |
1963 */ | 2003 */ |
1964 HICN API dw_icon_load_from_data(char *data, int len) | 2004 HICN API dw_icon_load_from_data(const char *data, int len) |
1965 { | 2005 { |
1966 return 0; | 2006 return 0; |
1967 } | 2007 } |
1968 | 2008 |
1969 /* | 2009 /* |
2058 * DW pick the appropriate file extension. | 2098 * DW pick the appropriate file extension. |
2059 * (BMP on OS/2 or Windows, XPM on Unix) | 2099 * (BMP on OS/2 or Windows, XPM on Unix) |
2060 * Returns: | 2100 * Returns: |
2061 * A handle to a pixmap or NULL on failure. | 2101 * A handle to a pixmap or NULL on failure. |
2062 */ | 2102 */ |
2063 HPIXMAP API dw_pixmap_new_from_file(HWND handle, char *filename) | 2103 HPIXMAP API dw_pixmap_new_from_file(HWND handle, const char *filename) |
2064 { | 2104 { |
2065 return 0; | 2105 return 0; |
2066 } | 2106 } |
2067 | 2107 |
2068 /* | 2108 /* |
2073 * (BMP on OS/2 or Windows, XPM on Unix) | 2113 * (BMP on OS/2 or Windows, XPM on Unix) |
2074 * len: Length of data | 2114 * len: Length of data |
2075 * Returns: | 2115 * Returns: |
2076 * A handle to a pixmap or NULL on failure. | 2116 * A handle to a pixmap or NULL on failure. |
2077 */ | 2117 */ |
2078 HPIXMAP API dw_pixmap_new_from_data(HWND handle, char *data, int len) | 2118 HPIXMAP API dw_pixmap_new_from_data(HWND handle, const char *data, int len) |
2079 { | 2119 { |
2080 return 0; | 2120 return 0; |
2081 } | 2121 } |
2082 | 2122 |
2083 /* | 2123 /* |
2115 * passed to the application via a callback. | 2155 * passed to the application via a callback. |
2116 * fontname: Name and size of the font in the form "size.fontname" | 2156 * fontname: Name and size of the font in the form "size.fontname" |
2117 * Returns: | 2157 * Returns: |
2118 * DW_ERROR_NONE on success and DW_ERROR_GENERAL on failure. | 2158 * DW_ERROR_NONE on success and DW_ERROR_GENERAL on failure. |
2119 */ | 2159 */ |
2120 int API dw_pixmap_set_font(HPIXMAP pixmap, char *fontname) | 2160 int API dw_pixmap_set_font(HPIXMAP pixmap, const char *fontname) |
2121 { | 2161 { |
2122 return DW_ERROR_GENERAL; | 2162 return DW_ERROR_GENERAL; |
2123 } | 2163 } |
2124 | 2164 |
2125 /* | 2165 /* |
2201 * string: String buffer containt HTML code to | 2241 * string: String buffer containt HTML code to |
2202 * be rendered. | 2242 * be rendered. |
2203 * Returns: | 2243 * Returns: |
2204 * DW_ERROR_NONE (0) on success. | 2244 * DW_ERROR_NONE (0) on success. |
2205 */ | 2245 */ |
2206 int API dw_html_raw(HWND handle, char *string) | 2246 int API dw_html_raw(HWND handle, const char *string) |
2207 { | 2247 { |
2208 return DW_ERROR_GENERAL; | 2248 return DW_ERROR_GENERAL; |
2209 } | 2249 } |
2210 | 2250 |
2211 /* | 2251 /* |
2215 * url: Universal Resource Locator of the web or | 2255 * url: Universal Resource Locator of the web or |
2216 * file object to be rendered. | 2256 * file object to be rendered. |
2217 * Returns: | 2257 * Returns: |
2218 * DW_ERROR_NONE (0) on success. | 2258 * DW_ERROR_NONE (0) on success. |
2219 */ | 2259 */ |
2220 int API dw_html_url(HWND handle, char *url) | 2260 int API dw_html_url(HWND handle, const char *url) |
2221 { | 2261 { |
2222 return DW_ERROR_GENERAL; | 2262 return DW_ERROR_GENERAL; |
2263 } | |
2264 | |
2265 /* | |
2266 * Executes the javascript contained in "script" in the HTML window. | |
2267 * Parameters: | |
2268 * handle: Handle to the HTML window. | |
2269 * script: Javascript code to execute. | |
2270 * scriptdata: Data passed to the signal handler. | |
2271 * Notes: A DW_SIGNAL_HTML_RESULT event will be raised with scriptdata. | |
2272 * Returns: | |
2273 * DW_ERROR_NONE (0) on success. | |
2274 */ | |
2275 int dw_html_javascript_run(HWND handle, const char *script, void *scriptdata) | |
2276 { | |
2277 return DW_ERROR_UNKNOWN; | |
2223 } | 2278 } |
2224 | 2279 |
2225 /* | 2280 /* |
2226 * Create a new HTML window (widget) to be packed. | 2281 * Create a new HTML window (widget) to be packed. |
2227 * Parameters: | 2282 * Parameters: |
2323 * check: If TRUE menu is "check"able. | 2378 * check: If TRUE menu is "check"able. |
2324 * submenu: Handle to an existing menu to be a submenu or NULL. | 2379 * submenu: Handle to an existing menu to be a submenu or NULL. |
2325 * Returns: | 2380 * Returns: |
2326 * Handle to the created menu item or NULL on error. | 2381 * Handle to the created menu item or NULL on error. |
2327 */ | 2382 */ |
2328 HWND API dw_menu_append_item(HMENUI menux, char *title, ULONG itemid, ULONG flags, int end, int check, HMENUI submenux) | 2383 HWND API dw_menu_append_item(HMENUI menux, const char *title, ULONG itemid, ULONG flags, int end, int check, HMENUI submenux) |
2329 { | 2384 { |
2330 return 0; | 2385 return 0; |
2331 } | 2386 } |
2332 | 2387 |
2333 /* | 2388 /* |
2418 * Parameters: | 2473 * Parameters: |
2419 * handle: Notebook handle. | 2474 * handle: Notebook handle. |
2420 * pageid: Page ID of the tab to set. | 2475 * pageid: Page ID of the tab to set. |
2421 * text: Pointer to the text to set. | 2476 * text: Pointer to the text to set. |
2422 */ | 2477 */ |
2423 void API dw_notebook_page_set_text(HWND handle, ULONG pageid, char *text) | 2478 void API dw_notebook_page_set_text(HWND handle, ULONG pageid, const char *text) |
2424 { | 2479 { |
2425 } | 2480 } |
2426 | 2481 |
2427 /* | 2482 /* |
2428 * Sets the text on the specified notebook tab status area. | 2483 * Sets the text on the specified notebook tab status area. |
2429 * Parameters: | 2484 * Parameters: |
2430 * handle: Notebook handle. | 2485 * handle: Notebook handle. |
2431 * pageid: Page ID of the tab to set. | 2486 * pageid: Page ID of the tab to set. |
2432 * text: Pointer to the text to set. | 2487 * text: Pointer to the text to set. |
2433 */ | 2488 */ |
2434 void API dw_notebook_page_set_status_text(HWND handle, ULONG pageid, char *text) | 2489 void API dw_notebook_page_set_status_text(HWND handle, ULONG pageid, const char *text) |
2435 { | 2490 { |
2436 } | 2491 } |
2437 | 2492 |
2438 /* | 2493 /* |
2439 * Packs the specified box into the notebook page. | 2494 * Packs the specified box into the notebook page. |
2453 * title: The Window title. | 2508 * title: The Window title. |
2454 * flStyle: Style flags. | 2509 * flStyle: Style flags. |
2455 * Returns: | 2510 * Returns: |
2456 * Handle to the created window or NULL on error. | 2511 * Handle to the created window or NULL on error. |
2457 */ | 2512 */ |
2458 HWND API dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) | 2513 HWND API dw_window_new(HWND hwndOwner, const char *title, ULONG flStyle) |
2459 { | 2514 { |
2460 return 0; | 2515 return 0; |
2461 } | 2516 } |
2462 | 2517 |
2463 /* | 2518 /* |
2609 * handle: The window (widget) handle. | 2664 * handle: The window (widget) handle. |
2610 * fontname: Name and size of the font in the form "size.fontname" | 2665 * fontname: Name and size of the font in the form "size.fontname" |
2611 * Returns: | 2666 * Returns: |
2612 * DW_ERROR_NONE (0) on success. | 2667 * DW_ERROR_NONE (0) on success. |
2613 */ | 2668 */ |
2614 int API dw_window_set_font(HWND handle, char *fontname) | 2669 int API dw_window_set_font(HWND handle, const char *fontname) |
2615 { | 2670 { |
2616 return DW_ERROR_GENERAL; | 2671 return DW_ERROR_GENERAL; |
2617 } | 2672 } |
2618 | 2673 |
2619 /* | 2674 /* |
2632 * Parameters: | 2687 * Parameters: |
2633 * currfont: current font | 2688 * currfont: current font |
2634 * Returns: | 2689 * Returns: |
2635 * A malloced buffer with the selected font or NULL on error. | 2690 * A malloced buffer with the selected font or NULL on error. |
2636 */ | 2691 */ |
2637 char * API dw_font_choose(char *currfont) | 2692 char * API dw_font_choose(const char *currfont) |
2638 { | 2693 { |
2639 return NULL; | 2694 return NULL; |
2640 } | 2695 } |
2641 | 2696 |
2642 /* | 2697 /* |
2643 * Sets the default font used on text based widgets. | 2698 * Sets the default font used on text based widgets. |
2644 * Parameters: | 2699 * Parameters: |
2645 * fontname: Font name in Dynamic Windows format. | 2700 * fontname: Font name in Dynamic Windows format. |
2646 */ | 2701 */ |
2647 void API dw_font_set_default(char *fontname) | 2702 void API dw_font_set_default(const char *fontname) |
2648 { | 2703 { |
2649 } | 2704 } |
2650 | 2705 |
2651 /* | 2706 /* |
2652 * Destroys a window and all of it's children. | 2707 * Destroys a window and all of it's children. |
2676 * Sets the text used for a given window. | 2731 * Sets the text used for a given window. |
2677 * Parameters: | 2732 * Parameters: |
2678 * handle: Handle to the window. | 2733 * handle: Handle to the window. |
2679 * text: The text associsated with a given window. | 2734 * text: The text associsated with a given window. |
2680 */ | 2735 */ |
2681 void API dw_window_set_text(HWND handle, char *text) | 2736 void API dw_window_set_text(HWND handle, const char *text) |
2682 { | 2737 { |
2683 } | 2738 } |
2684 | 2739 |
2685 /* | 2740 /* |
2686 * Sets the text used for a given window's floating bubble help. | 2741 * Sets the text used for a given window's floating bubble help. |
2687 * Parameters: | 2742 * Parameters: |
2688 * handle: Handle to the window (widget). | 2743 * handle: Handle to the window (widget). |
2689 * bubbletext: The text in the floating bubble tooltip. | 2744 * bubbletext: The text in the floating bubble tooltip. |
2690 */ | 2745 */ |
2691 void API dw_window_set_tooltip(HWND handle, char *bubbletext) | 2746 void API dw_window_set_tooltip(HWND handle, const char *bubbletext) |
2692 { | 2747 { |
2693 } | 2748 } |
2694 | 2749 |
2695 /* | 2750 /* |
2696 * Disables given window (widget). | 2751 * Disables given window (widget). |
2719 * data: memory buffer containing image (Bitmap on OS/2 or | 2774 * data: memory buffer containing image (Bitmap on OS/2 or |
2720 * Windows and a pixmap on Unix, pass | 2775 * Windows and a pixmap on Unix, pass |
2721 * NULL if you use the id param) | 2776 * NULL if you use the id param) |
2722 * len: Length of data passed | 2777 * len: Length of data passed |
2723 */ | 2778 */ |
2724 void API dw_window_set_bitmap_from_data(HWND handle, unsigned long cid, char *data, int len) | 2779 void API dw_window_set_bitmap_from_data(HWND handle, unsigned long cid, const char *data, int len) |
2725 { | 2780 { |
2726 } | 2781 } |
2727 | 2782 |
2728 /* | 2783 /* |
2729 * Sets the bitmap used for a given static window. | 2784 * Sets the bitmap used for a given static window. |
2733 * (pass 0 if you use the filename param) | 2788 * (pass 0 if you use the filename param) |
2734 * filename: a path to a file (Bitmap on OS/2 or | 2789 * filename: a path to a file (Bitmap on OS/2 or |
2735 * Windows and a pixmap on Unix, pass | 2790 * Windows and a pixmap on Unix, pass |
2736 * NULL if you use the id param) | 2791 * NULL if you use the id param) |
2737 */ | 2792 */ |
2738 void API dw_window_set_bitmap(HWND handle, unsigned long resid, char *filename) | 2793 void API dw_window_set_bitmap(HWND handle, unsigned long resid, const char *filename) |
2739 { | 2794 { |
2740 } | 2795 } |
2741 | 2796 |
2742 /* | 2797 /* |
2743 * Sets the icon used for a given window. | 2798 * Sets the icon used for a given window. |
2942 * Parameters: | 2997 * Parameters: |
2943 * window: Window handle to save data to. | 2998 * window: Window handle to save data to. |
2944 * dataname: A string pointer identifying which data to be saved. | 2999 * dataname: A string pointer identifying which data to be saved. |
2945 * data: User data to be saved to the window handle. | 3000 * data: User data to be saved to the window handle. |
2946 */ | 3001 */ |
2947 void dw_window_set_data(HWND window, char *dataname, void *data) | 3002 void dw_window_set_data(HWND window, const char *dataname, void *data) |
2948 { | 3003 { |
2949 } | 3004 } |
2950 | 3005 |
2951 /* | 3006 /* |
2952 * Gets a named user data item from a window handle. | 3007 * Gets a named user data item from a window handle. |
2954 * window: Window handle to get data from. | 3009 * window: Window handle to get data from. |
2955 * dataname: A string pointer identifying which data to get. | 3010 * dataname: A string pointer identifying which data to get. |
2956 * Returns: | 3011 * Returns: |
2957 * Pointer to data or NULL if no data is available. | 3012 * Pointer to data or NULL if no data is available. |
2958 */ | 3013 */ |
2959 void *dw_window_get_data(HWND window, char *dataname) | 3014 void *dw_window_get_data(HWND window, const char *dataname) |
2960 { | 3015 { |
2961 return NULL; | 3016 return NULL; |
2962 } | 3017 } |
2963 | 3018 |
2964 /* | 3019 /* |
2990 * window: Window handle of signal to be called back. | 3045 * window: Window handle of signal to be called back. |
2991 * signame: A string pointer identifying which signal to be hooked. | 3046 * signame: A string pointer identifying which signal to be hooked. |
2992 * sigfunc: The pointer to the function to be used as the callback. | 3047 * sigfunc: The pointer to the function to be used as the callback. |
2993 * data: User data to be passed to the handler function. | 3048 * data: User data to be passed to the handler function. |
2994 */ | 3049 */ |
2995 void API dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data) | 3050 void API dw_signal_connect(HWND window, const char *signame, void *sigfunc, void *data) |
2996 { | 3051 { |
2997 } | 3052 } |
2998 | 3053 |
2999 /* | 3054 /* |
3000 * Removes callbacks for a given window with given name. | 3055 * Removes callbacks for a given window with given name. |
3001 * Parameters: | 3056 * Parameters: |
3002 * window: Window handle of callback to be removed. | 3057 * window: Window handle of callback to be removed. |
3003 * signame: Signal name to be matched on window. | 3058 * signame: Signal name to be matched on window. |
3004 */ | 3059 */ |
3005 void API dw_signal_disconnect_by_name(HWND window, char *signame) | 3060 void API dw_signal_disconnect_by_name(HWND window, const char *signame) |
3006 { | 3061 { |
3007 } | 3062 } |
3008 | 3063 |
3009 /* | 3064 /* |
3010 * Removes all callbacks for a given window. | 3065 * Removes all callbacks for a given window. |
3031 * handle: Pointer to a module handle, | 3086 * handle: Pointer to a module handle, |
3032 * will be filled in with the handle. | 3087 * will be filled in with the handle. |
3033 * Returns: | 3088 * Returns: |
3034 * DW_ERROR_NONE (0) on success. | 3089 * DW_ERROR_NONE (0) on success. |
3035 */ | 3090 */ |
3036 int dw_module_load(char *name, HMOD *handle) | 3091 int dw_module_load(const char *name, HMOD *handle) |
3037 { | 3092 { |
3038 return DW_ERROR_UNKNOWN; | 3093 return DW_ERROR_UNKNOWN; |
3039 } | 3094 } |
3040 | 3095 |
3041 /* Queries the address of a symbol within open handle. | 3096 /* Queries the address of a symbol within open handle. |
3045 * func: A pointer to a function pointer, to obtain | 3100 * func: A pointer to a function pointer, to obtain |
3046 * the address. | 3101 * the address. |
3047 * Returns: | 3102 * Returns: |
3048 * DW_ERROR_NONE (0) on success. | 3103 * DW_ERROR_NONE (0) on success. |
3049 */ | 3104 */ |
3050 int dw_module_symbol(HMOD handle, char *name, void**func) | 3105 int dw_module_symbol(HMOD handle, const char *name, void**func) |
3051 { | 3106 { |
3052 return DW_ERROR_UNKNOWN; | 3107 return DW_ERROR_UNKNOWN; |
3053 } | 3108 } |
3054 | 3109 |
3055 /* Frees the shared library previously opened. | 3110 /* Frees the shared library previously opened. |
3200 * name: Name given to semaphore which can be opened | 3255 * name: Name given to semaphore which can be opened |
3201 * by other processes. | 3256 * by other processes. |
3202 * Returns: | 3257 * Returns: |
3203 * Handle to event semaphore or NULL on error. | 3258 * Handle to event semaphore or NULL on error. |
3204 */ | 3259 */ |
3205 HEV dw_named_event_new(char *name) | 3260 HEV dw_named_event_new(const char *name) |
3206 { | 3261 { |
3207 return NULL; | 3262 return NULL; |
3208 } | 3263 } |
3209 | 3264 |
3210 /* Open an already existing named event semaphore. | 3265 /* Open an already existing named event semaphore. |
3212 * name: Name given to semaphore which can be opened | 3267 * name: Name given to semaphore which can be opened |
3213 * by other processes. | 3268 * by other processes. |
3214 * Returns: | 3269 * Returns: |
3215 * Handle to event semaphore or NULL on error. | 3270 * Handle to event semaphore or NULL on error. |
3216 */ | 3271 */ |
3217 HEV dw_named_event_get(char *name) | 3272 HEV dw_named_event_get(const char *name) |
3218 { | 3273 { |
3219 return NULL; | 3274 return NULL; |
3220 } | 3275 } |
3221 | 3276 |
3222 /* Resets the event semaphore so threads who call wait | 3277 /* Resets the event semaphore so threads who call wait |
3295 * size: Size in bytes of the shared memory region to allocate. | 3350 * size: Size in bytes of the shared memory region to allocate. |
3296 * name: A string pointer to a unique memory name. | 3351 * name: A string pointer to a unique memory name. |
3297 * Returns: | 3352 * Returns: |
3298 * Handle to shared memory or NULL on error. | 3353 * Handle to shared memory or NULL on error. |
3299 */ | 3354 */ |
3300 HSHM dw_named_memory_new(void **dest, int size, char *name) | 3355 HSHM dw_named_memory_new(void **dest, int size, const char *name) |
3301 { | 3356 { |
3302 return NULL; | 3357 return NULL; |
3303 } | 3358 } |
3304 | 3359 |
3305 /* | 3360 /* |
3309 * size: Size in bytes of the shared memory region to requested. | 3364 * size: Size in bytes of the shared memory region to requested. |
3310 * name: A string pointer to a unique memory name. | 3365 * name: A string pointer to a unique memory name. |
3311 * Returns: | 3366 * Returns: |
3312 * Handle to shared memory or NULL on error. | 3367 * Handle to shared memory or NULL on error. |
3313 */ | 3368 */ |
3314 HSHM dw_named_memory_get(void **dest, int size, char *name) | 3369 HSHM dw_named_memory_get(void **dest, int size, const char *name) |
3315 { | 3370 { |
3316 return NULL; | 3371 return NULL; |
3317 } | 3372 } |
3318 | 3373 |
3319 /* | 3374 /* |
3367 * type: Either DW_EXEC_CON or DW_EXEC_GUI. | 3422 * type: Either DW_EXEC_CON or DW_EXEC_GUI. |
3368 * params: An array of pointers to string arguements. | 3423 * params: An array of pointers to string arguements. |
3369 * Returns: | 3424 * Returns: |
3370 * Process ID on success or DW_ERROR_UNKNOWN (-1) on error. | 3425 * Process ID on success or DW_ERROR_UNKNOWN (-1) on error. |
3371 */ | 3426 */ |
3372 int dw_exec(char *program, int type, char **params) | 3427 int dw_exec(const char *program, int type, char **params) |
3373 { | 3428 { |
3374 int ret = DW_ERROR_UNKNOWN; | 3429 int ret = DW_ERROR_UNKNOWN; |
3375 | 3430 |
3376 return ret; | 3431 return ret; |
3377 } | 3432 } |
3381 * Parameters: | 3436 * Parameters: |
3382 * url: Uniform resource locator. | 3437 * url: Uniform resource locator. |
3383 * Returns: | 3438 * Returns: |
3384 * DW_ERROR_UNKNOWN (-1) on error; DW_ERROR_NONE (0) or a positive Process ID on success. | 3439 * DW_ERROR_UNKNOWN (-1) on error; DW_ERROR_NONE (0) or a positive Process ID on success. |
3385 */ | 3440 */ |
3386 int dw_browse(char *url) | 3441 int dw_browse(const char *url) |
3387 { | 3442 { |
3388 return DW_ERROR_UNKNOWN; | 3443 return DW_ERROR_UNKNOWN; |
3389 } | 3444 } |
3390 | 3445 |
3391 /* | 3446 /* |
3397 * drawfunc: The pointer to the function to be used as the callback. | 3452 * drawfunc: The pointer to the function to be used as the callback. |
3398 * drawdata: User data to be passed to the handler function. | 3453 * drawdata: User data to be passed to the handler function. |
3399 * Returns: | 3454 * Returns: |
3400 * A handle to the print object or NULL on failure. | 3455 * A handle to the print object or NULL on failure. |
3401 */ | 3456 */ |
3402 HPRINT API dw_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) | 3457 HPRINT API dw_print_new(const char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) |
3403 { | 3458 { |
3404 return NULL; | 3459 return NULL; |
3405 } | 3460 } |
3406 | 3461 |
3407 /* | 3462 /* |
3424 */ | 3479 */ |
3425 void API dw_print_cancel(HPRINT print) | 3480 void API dw_print_cancel(HPRINT print) |
3426 { | 3481 { |
3427 } | 3482 } |
3428 | 3483 |
3484 /* | |
3485 * Creates a new system notification if possible. | |
3486 * Parameters: | |
3487 * title: The short title of the notification. | |
3488 * imagepath: Path to an image to display or NULL if none. | |
3489 * description: A longer description of the notification, | |
3490 * or NULL if none is necessary. | |
3491 * Returns: | |
3492 * A handle to the notification which can be used to attach a "clicked" event if desired, | |
3493 * or NULL if it fails or notifications are not supported by the system. | |
3494 * Remarks: | |
3495 * This will create a system notification that will show in the notifaction panel | |
3496 * on supported systems, which may be clicked to perform another task. | |
3497 */ | |
3498 HWND API dw_notification_new(const char * DW_UNUSED(title), const char * DW_UNUSED(imagepath), const char * DW_UNUSED(description), ...) | |
3499 { | |
3500 return 0; | |
3501 } | |
3502 | |
3503 /* | |
3504 * Sends a notification created by dw_notification_new() after attaching signal handler. | |
3505 * Parameters: | |
3506 * notification: The handle to the notification returned by dw_notification_new(). | |
3507 * Returns: | |
3508 * DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported. | |
3509 */ | |
3510 int API dw_notification_send(HWND DW_UNUSED(notification)) | |
3511 { | |
3512 return DW_ERROR_UNKNOWN; | |
3513 } | |
3514 | |
3515 /* | |
3516 * Converts a UTF-8 encoded string into a wide string. | |
3517 * Parameters: | |
3518 * utf8string: UTF-8 encoded source string. | |
3519 * Returns: | |
3520 * Wide string that needs to be freed with dw_free() | |
3521 * or NULL on failure. | |
3522 */ | |
3523 wchar_t * API dw_utf8_to_wchar(const char *utf8string) | |
3524 { | |
3525 return NULL; | |
3526 } | |
3527 | |
3528 /* | |
3529 * Converts a wide string into a UTF-8 encoded string. | |
3530 * Parameters: | |
3531 * wstring: Wide source string. | |
3532 * Returns: | |
3533 * UTF-8 encoded string that needs to be freed with dw_free() | |
3534 * or NULL on failure. | |
3535 */ | |
3536 char * API dw_wchar_to_utf8(const wchar_t *wstring) | |
3537 { | |
3538 return NULL; | |
3539 } | |
3540 | |
3541 /* | |
3542 * Gets the state of the requested library feature. | |
3543 * Parameters: | |
3544 * feature: The requested feature for example DW_FEATURE_DARK_MODE | |
3545 * Returns: | |
3546 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature. | |
3547 * DW_FEATURE_DISABLED if the feature is supported but disabled. | |
3548 * DW_FEATURE_ENABLED if the feature is supported and enabled. | |
3549 * Other value greater than 1, same as enabled but with extra info. | |
3550 */ | |
3551 int API dw_feature_get(DWFEATURE feature) | |
3552 { | |
3553 switch(feature) | |
3554 { | |
3555 #if 0 | |
3556 case DW_FEATURE_HTML: /* Supports the HTML Widget */ | |
3557 case DW_FEATURE_HTML_RESULT: /* Supports the DW_SIGNAL_HTML_RESULT callback */ | |
3558 case DW_FEATURE_WINDOW_BORDER: /* Supports custom window border sizes */ | |
3559 case DW_FEATURE_WINDOW_TRANSPARENCY: /* Supports window frame transparency */ | |
3560 case DW_FEATURE_DARK_MODE: /* Supports Dark Mode user interface */ | |
3561 case DW_FEATURE_MLE_AUTO_COMPLETE: /* Supports auto completion in Multi-line Edit boxes */ | |
3562 case DW_FEATURE_MLE_WORD_WRAP: /* Supports word wrapping in Multi-line Edit boxes */ | |
3563 case DW_FEATURE_CONTAINER_STRIPE: /* Supports striped line display in container widgets */ | |
3564 case DW_FEATURE_MDI: /* Supports Multiple Document Interface window frame */ | |
3565 case DW_FEATURE_NOTEBOOK_STATUS_TEXT: /* Supports status text area on notebook/tabbed controls */ | |
3566 case DW_FEATURE_NOTIFICATION: /* Supports sending system notifications */ | |
3567 case DW_FEATURE_UTF8_UNICODE: /* Supports UTF8 encoded Unicode text */ | |
3568 return DW_FEATURE_ENABLED; | |
3569 #endif | |
3570 default: | |
3571 return DW_FEATURE_UNSUPPORTED; | |
3572 } | |
3573 } | |
3574 | |
3575 /* | |
3576 * Sets the state of the requested library feature. | |
3577 * Parameters: | |
3578 * feature: The requested feature for example DW_FEATURE_DARK_MODE | |
3579 * state: DW_FEATURE_DISABLED, DW_FEATURE_ENABLED or any value greater than 1. | |
3580 * Returns: | |
3581 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature. | |
3582 * DW_ERROR_NONE if the feature is supported and successfully configured. | |
3583 * DW_ERROR_GENERAL if the feature is supported but could not be configured. | |
3584 * Remarks: | |
3585 * These settings are typically used during dw_init() so issue before | |
3586 * setting up the library with dw_init(). | |
3587 */ | |
3588 int API dw_feature_set(DWFEATURE feature, int state) | |
3589 { | |
3590 switch(feature) | |
3591 { | |
3592 /* These features are supported but not configurable */ | |
3593 #if 0 | |
3594 case DW_FEATURE_HTML: /* Supports the HTML Widget */ | |
3595 case DW_FEATURE_HTML_RESULT: /* Supports the DW_SIGNAL_HTML_RESULT callback */ | |
3596 case DW_FEATURE_WINDOW_BORDER: /* Supports custom window border sizes */ | |
3597 case DW_FEATURE_WINDOW_TRANSPARENCY: /* Supports window frame transparency */ | |
3598 case DW_FEATURE_DARK_MODE: /* Supports Dark Mode user interface */ | |
3599 case DW_FEATURE_MLE_AUTO_COMPLETE: /* Supports auto completion in Multi-line Edit boxes */ | |
3600 case DW_FEATURE_MLE_WORD_WRAP: /* Supports word wrapping in Multi-line Edit boxes */ | |
3601 case DW_FEATURE_CONTAINER_STRIPE: /* Supports striped line display in container widgets */ | |
3602 case DW_FEATURE_MDI: /* Supports Multiple Document Interface window frame */ | |
3603 case DW_FEATURE_NOTEBOOK_STATUS_TEXT: /* Supports status text area on notebook/tabbed controls */ | |
3604 case DW_FEATURE_NOTIFICATION: /* Supports sending system notifications */ | |
3605 case DW_FEATURE_UTF8_UNICODE: /* Supports UTF8 encoded Unicode text */ | |
3606 return DW_ERROR_GENERAL; | |
3607 #endif | |
3608 /* These features are supported and configurable */ | |
3609 default: | |
3610 return DW_FEATURE_UNSUPPORTED; | |
3611 } | |
3612 } |