comparison dw.h @ 643:9ab89d89e6b4

Add dw_listview_insert() Default to using webkit for Gtk+ HTML widget Add option to build with libgtkhtml2 - incomplete Initial attempt to use customdraw for Win32 container - not working Added dw_window_get_font() for Gtk+ - not implemented in other ports yet Change package name from dw to dwindows for Linux ports - use dwindows-config now Add debian package build target
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 03 Oct 2010 00:34:36 +0000
parents 9fa3cb5b3290
children 55b677d460e9
comparison
equal deleted inserted replaced
642:fda03b13ebda 643:9ab89d89e6b4
79 #define SPLITBAR_WIDTH 4 79 #define SPLITBAR_WIDTH 4
80 #define BUBBLE_HELP_MAX 256 80 #define BUBBLE_HELP_MAX 256
81 81
82 typedef struct _user_data 82 typedef struct _user_data
83 { 83 {
84 struct _user_data *next; 84 struct _user_data *next;
85 void *data; 85 void *data;
86 char *varname; 86 char *varname;
87 } UserData; 87 } UserData;
88 88
89 /* OS/2 Specific section */ 89 /* OS/2 Specific section */
90 #if defined(__OS2__) || defined(__EMX__) 90 #if defined(__OS2__) || defined(__EMX__)
91 #define INCL_DOS 91 #define INCL_DOS
215 #define VK_BACK VK_BACKSPACE 215 #define VK_BACK VK_BACKSPACE
216 #define VK_LMENU VK_MENU 216 #define VK_LMENU VK_MENU
217 #define VK_RMENU VK_MENU 217 #define VK_RMENU VK_MENU
218 218
219 typedef struct _window_data { 219 typedef struct _window_data {
220 PFNWP oldproc; 220 PFNWP oldproc;
221 UserData *root; 221 UserData *root;
222 HWND clickdefault; 222 HWND clickdefault;
223 ULONG flags; 223 ULONG flags;
224 void *data; 224 void *data;
225 } WindowData; 225 } WindowData;
226 226
227 typedef struct _hpixmap { 227 typedef struct _hpixmap {
228 unsigned long width, height; 228 unsigned long width, height;
229 HDC hdc; 229 HDC hdc;
230 HPS hps; 230 HPS hps;
231 HBITMAP hbm; 231 HBITMAP hbm;
232 HWND handle; 232 HWND handle;
233 unsigned long transcolor; 233 unsigned long transcolor;
234 } *HPIXMAP; 234 } *HPIXMAP;
235 235
236 typedef void *HTREEITEM; 236 typedef void *HTREEITEM;
237 typedef HWND HMENUI; 237 typedef HWND HMENUI;
238 typedef HMODULE HMOD; 238 typedef HMODULE HMOD;
265 typedef void *HMOD; 265 typedef void *HMOD;
266 typedef void *HTREEITEM; 266 typedef void *HTREEITEM;
267 typedef MenuRef HMENUI; 267 typedef MenuRef HMENUI;
268 268
269 typedef struct _window_data { 269 typedef struct _window_data {
270 UserData *root; 270 UserData *root;
271 HWND clickdefault; 271 HWND clickdefault;
272 ULONG flags; 272 ULONG flags;
273 void *data; 273 void *data;
274 } WindowData; 274 } WindowData;
275 275
276 typedef struct _hpixmap { 276 typedef struct _hpixmap {
277 unsigned long width, height; 277 unsigned long width, height;
278 /* ?? *pixmap; */ 278 /* ?? *pixmap; */
279 HWND handle; 279 HWND handle;
280 } *HPIXMAP; 280 } *HPIXMAP;
281 281
282 #define DW_DT_LEFT 0 282 #define DW_DT_LEFT 0
283 #define DW_DT_QUERYEXTENT 0 283 #define DW_DT_QUERYEXTENT 0
284 #define DW_DT_UNDERSCORE 0 284 #define DW_DT_UNDERSCORE 0
344 344
345 #define DW_POINTER_DEFAULT 0 345 #define DW_POINTER_DEFAULT 0
346 #define DW_POINTER_ARROW 0 346 #define DW_POINTER_ARROW 0
347 #define DW_POINTER_CLOCK watchCursor 347 #define DW_POINTER_CLOCK watchCursor
348 348
349 #define HWND_DESKTOP ((HWND)0) 349 #define HWND_DESKTOP ((HWND)0)
350 350
351 /* flag values for dw_messagebox() */ 351 /* flag values for dw_messagebox() */
352 #define DW_MB_OK (1 << 1) 352 #define DW_MB_OK (1 << 1)
353 #define DW_MB_OKCANCEL (1 << 2) 353 #define DW_MB_OKCANCEL (1 << 2)
354 #define DW_MB_YESNO (1 << 3) 354 #define DW_MB_YESNO (1 << 3)
494 #define DW_FCF_TASKLIST WS_VSCROLL 494 #define DW_FCF_TASKLIST WS_VSCROLL
495 #define DW_FCF_NOBYTEALIGN 0 495 #define DW_FCF_NOBYTEALIGN 0
496 #define DW_FCF_NOMOVEWITHOWNER 0 496 #define DW_FCF_NOMOVEWITHOWNER 0
497 #define DW_FCF_SYSMODAL 0 497 #define DW_FCF_SYSMODAL 0
498 #define DW_FCF_HIDEBUTTON WS_MINIMIZEBOX 498 #define DW_FCF_HIDEBUTTON WS_MINIMIZEBOX
499 #define DW_FCF_HIDEMAX 0 499 #define DW_FCF_HIDEMAX (WS_MINIMIZEBOX|WS_MAXIMIZEBOX)
500 #define DW_FCF_AUTOICON 0 500 #define DW_FCF_AUTOICON 0
501 #define DW_FCF_MAXIMIZE WS_MAXIMIZE 501 #define DW_FCF_MAXIMIZE WS_MAXIMIZE
502 #define DW_FCF_MINIMIZE WS_MINIMIZE 502 #define DW_FCF_MINIMIZE WS_MINIMIZE
503 503
504 #define DW_CFA_BITMAPORICON 1 504 #define DW_CFA_BITMAPORICON 1
556 #define ObjectClassName "dwobjectclass" 556 #define ObjectClassName "dwobjectclass"
557 #define BrowserClassName "dwbrowserclass" 557 #define BrowserClassName "dwbrowserclass"
558 #define DefaultFont NULL 558 #define DefaultFont NULL
559 559
560 typedef struct _color { 560 typedef struct _color {
561 int fore; 561 int fore;
562 int back; 562 int back;
563 HWND combo, buddy; 563 HWND combo, buddy;
564 int user; 564 int user;
565 int vcenter; 565 int vcenter;
566 HWND clickdefault; 566 HWND clickdefault;
567 HBRUSH hbrush; 567 HBRUSH hbrush;
568 HFONT hfont; 568 HFONT hfont;
569 char fontname[128]; 569 char fontname[128];
570 WNDPROC pOldProc; 570 WNDPROC pOldProc;
571 UserData *root; 571 UserData *root;
572 } ColorInfo; 572 } ColorInfo;
573 573
574 typedef struct _notebookpage { 574 typedef struct _notebookpage {
575 ColorInfo cinfo; 575 ColorInfo cinfo;
576 TC_ITEM item; 576 TC_ITEM item;
577 HWND hwnd; 577 HWND hwnd;
578 int realid; 578 int realid;
579 } NotebookPage; 579 } NotebookPage;
580 580
581 typedef HANDLE HMTX; 581 typedef HANDLE HMTX;
582 typedef HANDLE HEV; 582 typedef HANDLE HEV;
583 typedef HANDLE HMOD; 583 typedef HANDLE HMOD;
584 typedef HANDLE HSHM; 584 typedef HANDLE HSHM;
585 585
586 typedef struct _container { 586 typedef struct _container {
587 ColorInfo cinfo; 587 ColorInfo cinfo;
588 ULONG *flags; 588 ULONG *flags;
589 WNDPROC pOldProc; 589 WNDPROC pOldProc;
590 ULONG columns; 590 ULONG columns;
591 } ContainerInfo; 591 } ContainerInfo;
592 592
593 typedef struct _hpixmap { 593 typedef struct _hpixmap {
594 unsigned long width, height; 594 unsigned long width, height;
595 HBITMAP hbm; 595 HBITMAP hbm;
596 HDC hdc; 596 HDC hdc;
597 unsigned long transcolor; 597 unsigned long transcolor;
598 HWND handle; 598 HWND handle;
599 void *bits; 599 void *bits;
600 } *HPIXMAP; 600 } *HPIXMAP;
601 601
602 typedef HWND HMENUI; 602 typedef HWND HMENUI;
603 #endif 603 #endif
604 604
605 typedef struct _item { 605 typedef struct _item {
606 /* Item type - Box or Item */ 606 /* Item type - Box or Item */
607 int type; 607 int type;
608 /* Handle to Frame or Window */ 608 /* Handle to Frame or Window */
609 HWND hwnd; 609 HWND hwnd;
610 /* Width and Height of static size */ 610 /* Width and Height of static size */
611 int width, height, origwidth, origheight; 611 int width, height, origwidth, origheight;
612 /* Size Type - Static or Expand */ 612 /* Size Type - Static or Expand */
613 int hsize, vsize; 613 int hsize, vsize;
614 /* Padding */ 614 /* Padding */
615 int pad; 615 int pad;
616 /* Ratio of current item */ 616 /* Ratio of current item */
617 float xratio, yratio; 617 float xratio, yratio;
618 } Item; 618 } Item;
619 619
620 typedef struct _box { 620 typedef struct _box {
621 #if defined(__WIN32__) || defined(WINNT) 621 #if defined(__WIN32__) || defined(WINNT)
622 ColorInfo cinfo; 622 ColorInfo cinfo;
623 #elif defined(__OS2__) || defined(__EMX__) 623 #elif defined(__OS2__) || defined(__EMX__)
624 PFNWP oldproc; 624 PFNWP oldproc;
625 UserData *root; 625 UserData *root;
626 HWND hwndtitle, hwnd; 626 HWND hwndtitle, hwnd;
627 int titlebar; 627 int titlebar;
628 #endif 628 #endif
629 /* Number of items in the box */ 629 /* Number of items in the box */
630 int count; 630 int count;
631 /* Box type - horizontal or vertical */ 631 /* Box type - horizontal or vertical */
632 int type; 632 int type;
633 /* Padding */ 633 /* Padding */
634 int pad, parentpad, grouppadx, grouppady; 634 int pad, parentpad, grouppadx, grouppady;
635 /* Groupbox */ 635 /* Groupbox */
636 HWND grouphwnd; 636 HWND grouphwnd;
637 /* Default item */ 637 /* Default item */
638 HWND defaultitem; 638 HWND defaultitem;
639 /* Used as temporary storage in the calculation stage */ 639 /* Used as temporary storage in the calculation stage */
640 int upx, upy, minheight, minwidth; 640 int upx, upy, minheight, minwidth;
641 /* Ratio in this box */ 641 /* Ratio in this box */
642 float xratio, yratio, parentxratio, parentyratio; 642 float xratio, yratio, parentxratio, parentyratio;
643 /* Used for calculating individual item ratios */ 643 /* Used for calculating individual item ratios */
644 int width, height; 644 int width, height;
645 /* Any combinations of flags describing the box */ 645 /* Any combinations of flags describing the box */
646 unsigned long flags; 646 unsigned long flags;
647 /* Array of item structures */ 647 /* Array of item structures */
648 struct _item *items; 648 struct _item *items;
649 } Box; 649 } Box;
650 650
651 typedef struct _bubblebutton { 651 typedef struct _bubblebutton {
652 #if defined(__WIN32__) || defined(WINNT) 652 #if defined(__WIN32__) || defined(WINNT)
653 ColorInfo cinfo; 653 ColorInfo cinfo;
654 int checkbox; 654 int checkbox;
655 WNDPROC pOldProc; 655 WNDPROC pOldProc;
656 #endif 656 #endif
657 #if defined(__OS2__) || defined(__EMX__) 657 #if defined(__OS2__) || defined(__EMX__)
658 PFNWP pOldProc; 658 PFNWP pOldProc;
659 UserData *root; 659 UserData *root;
660 #endif 660 #endif
661 unsigned long id; 661 unsigned long id;
662 char bubbletext[BUBBLE_HELP_MAX]; 662 char bubbletext[BUBBLE_HELP_MAX];
663 } BubbleButton; 663 } BubbleButton;
664 664
665 #else 665 #else
666 /* GTK Specific section */ 666 /* GTK Specific section */
667 #include <gtk/gtk.h> 667 #include <gtk/gtk.h>
853 typedef char CHAR; 853 typedef char CHAR;
854 typedef unsigned UINT; 854 typedef unsigned UINT;
855 typedef int INT; 855 typedef int INT;
856 typedef pthread_mutex_t *HMTX; 856 typedef pthread_mutex_t *HMTX;
857 typedef struct _dw_unix_event { 857 typedef struct _dw_unix_event {
858 pthread_mutex_t mutex; 858 pthread_mutex_t mutex;
859 pthread_cond_t event; 859 pthread_cond_t event;
860 pthread_t thread; 860 pthread_t thread;
861 int alive; 861 int alive;
862 int posted; 862 int posted;
863 } *HEV; 863 } *HEV;
864 typedef pthread_t DWTID; 864 typedef pthread_t DWTID;
865 typedef void * HMOD; 865 typedef void * HMOD;
866 struct _dw_unix_shm { 866 struct _dw_unix_shm {
867 int fd; 867 int fd;
868 char *path; 868 char *path;
869 int sid; 869 int sid;
870 int size; 870 int size;
871 }; 871 };
872 872
873 typedef struct _hpixmap { 873 typedef struct _hpixmap {
874 unsigned long width, height; 874 unsigned long width, height;
875 GdkPixmap *pixmap; /* the actual image */ 875 GdkPixmap *pixmap; /* the actual image */
880 typedef GtkWidget *HMENUI; 880 typedef GtkWidget *HMENUI;
881 typedef void *HTREEITEM; 881 typedef void *HTREEITEM;
882 typedef void *HSHM; 882 typedef void *HSHM;
883 883
884 typedef struct _resource_struct { 884 typedef struct _resource_struct {
885 long resource_max, *resource_id; 885 long resource_max, *resource_id;
886 char **resource_data; 886 char **resource_data;
887 } DWResources; 887 } DWResources;
888 888
889 #if !defined(DW_RESOURCES) || defined(BUILD_DLL) 889 #if !defined(DW_RESOURCES) || defined(BUILD_DLL)
890 static DWResources _resources = { 0, 0, 0 }; 890 static DWResources _resources = { 0, 0, 0 };
891 #else 891 #else
895 #endif 895 #endif
896 896
897 #if !defined(__OS2__) && !defined(__EMX__) 897 #if !defined(__OS2__) && !defined(__EMX__)
898 typedef struct _CDATE 898 typedef struct _CDATE
899 { 899 {
900 UCHAR day; 900 UCHAR day;
901 UCHAR month; 901 UCHAR month;
902 USHORT year; 902 USHORT year;
903 } CDATE; 903 } CDATE;
904 typedef CDATE *PCDATE; 904 typedef CDATE *PCDATE;
905 905
906 typedef struct _CTIME 906 typedef struct _CTIME
907 { 907 {
908 UCHAR hours; 908 UCHAR hours;
909 UCHAR minutes; 909 UCHAR minutes;
910 UCHAR seconds; 910 UCHAR seconds;
911 UCHAR ucReserved; 911 UCHAR ucReserved;
912 } CTIME; 912 } CTIME;
913 typedef CTIME *PCTIME; 913 typedef CTIME *PCTIME;
914 #endif 914 #endif
915 915
916 #if defined(__OS2__) || (defined(__WIN32__) && !defined(GDK_WINDOWING_WIN32)) || (defined(WINNT) && !defined(GDK_WINDOWING_WIN32)) || defined(__EMX__) 916 #if defined(__OS2__) || (defined(__WIN32__) && !defined(GDK_WINDOWING_WIN32)) || (defined(WINNT) && !defined(GDK_WINDOWING_WIN32)) || defined(__EMX__)
917 typedef unsigned long DWTID; 917 typedef unsigned long DWTID;
918 #endif 918 #endif
919 919
920 typedef struct _dwenv { 920 typedef struct _dwenv {
921 /* Operating System Name and DW Build Date/Time */ 921 /* Operating System Name and DW Build Date/Time */
922 char osName[30], buildDate[30], buildTime[30]; 922 char osName[30], buildDate[30], buildTime[30];
923 /* Versions and builds */ 923 /* Versions and builds */
924 short MajorVersion, MinorVersion, MajorBuild, MinorBuild; 924 short MajorVersion, MinorVersion, MajorBuild, MinorBuild;
925 /* Dynamic Window version */ 925 /* Dynamic Window version */
926 short DWMajorVersion, DWMinorVersion, DWSubVersion; 926 short DWMajorVersion, DWMinorVersion, DWSubVersion;
927 } DWEnv; 927 } DWEnv;
928 928
929 929
930 typedef struct _dwexpose { 930 typedef struct _dwexpose {
931 int x, y; 931 int x, y;
932 int width, height; 932 int width, height;
933 } DWExpose; 933 } DWExpose;
934 934
935 typedef struct _dwdialog { 935 typedef struct _dwdialog {
936 HEV eve; 936 HEV eve;
937 int done; 937 int done;
938 int method; 938 int method;
939 void *data, *result; 939 void *data, *result;
940 } DWDialog; 940 } DWDialog;
941 941
942 #define DW_SIGNAL_FUNC(a) ((void *)a) 942 #define DW_SIGNAL_FUNC(a) ((void *)a)
943 943
944 #define DW_DESKTOP HWND_DESKTOP 944 #define DW_DESKTOP HWND_DESKTOP
997 #define DW_ERROR_NON_INIT 3 997 #define DW_ERROR_NON_INIT 3
998 #define DW_ERROR_NO_MEM 4 998 #define DW_ERROR_NO_MEM 4
999 #define DW_ERROR_INTERRUPT 5 999 #define DW_ERROR_INTERRUPT 5
1000 1000
1001 /* Embedded HTML actions */ 1001 /* Embedded HTML actions */
1002 #define DW_HTML_GOBACK 0 1002 #define DW_HTML_GOBACK 0
1003 #define DW_HTML_GOFORWARD 1 1003 #define DW_HTML_GOFORWARD 1
1004 #define DW_HTML_GOHOME 2 1004 #define DW_HTML_GOHOME 2
1005 #define DW_HTML_SEARCH 3 1005 #define DW_HTML_SEARCH 3
1006 #define DW_HTML_RELOAD 4 1006 #define DW_HTML_RELOAD 4
1007 #define DW_HTML_STOP 5 1007 #define DW_HTML_STOP 5
1008 #define DW_HTML_PRINT 6
1008 1009
1009 #ifndef API 1010 #ifndef API
1010 #define API 1011 #define API
1011 #endif 1012 #endif
1012 1013
1074 HWND API dw_slider_new(int vertical, int increments, ULONG id); 1075 HWND API dw_slider_new(int vertical, int increments, ULONG id);
1075 HWND API dw_scrollbar_new(int vertical, ULONG id); 1076 HWND API dw_scrollbar_new(int vertical, ULONG id);
1076 HWND API dw_checkbox_new(char *text, unsigned long id); 1077 HWND API dw_checkbox_new(char *text, unsigned long id);
1077 HWND API dw_listbox_new(unsigned long id, int multi); 1078 HWND API dw_listbox_new(unsigned long id, int multi);
1078 void API dw_listbox_append(HWND handle, char *text); 1079 void API dw_listbox_append(HWND handle, char *text);
1080 void API dw_listbox_insert(HWND handle, char *text, int pos);
1079 void API dw_listbox_list_append(HWND handle, char **text, int count); 1081 void API dw_listbox_list_append(HWND handle, char **text, int count);
1080 void API dw_listbox_clear(HWND handle); 1082 void API dw_listbox_clear(HWND handle);
1081 int API dw_listbox_count(HWND handle); 1083 int API dw_listbox_count(HWND handle);
1082 void API dw_listbox_set_top(HWND handle, int top); 1084 void API dw_listbox_set_top(HWND handle, int top);
1083 void API dw_listbox_select(HWND handle, int index, int state); 1085 void API dw_listbox_select(HWND handle, int index, int state);