Mercurial > godwindows
changeset 97:e024aa0b0c53
Restrucure for modern versions of Go using modules.
author | Brian Smith <brian@dbsoft.org> |
---|---|
date | Fri, 05 Nov 2021 15:27:32 -0500 |
parents | ad6bd34d7777 |
children | f1837535d46c |
files | dw/dw.go dw/dwglue.c dwib/dwib.go dwib/dwibglue.c dwibtest/dwibtest.exe.x64.manifest dwibtest/dwibtest.exe.x86.manifest dwibtest/dwibtest.go dwibtest/dwibtest.rc dwibtest/example.xml dwibtest/makesyso.bat dwootest/dwootest.exe.x64.manifest dwootest/dwootest.exe.x86.manifest dwootest/dwootest.go dwootest/dwootest.rc dwootest/makesyso.bat dwtest/dwtest.exe.x64.manifest dwtest/dwtest.exe.x86.manifest dwtest/dwtest.go dwtest/dwtest.rc dwtest/file.png dwtest/folder.png dwtest/makesyso.bat dwtest/test.png go.mod hello/hello.exe.x64.manifest hello/hello.exe.x86.manifest hello/hello.go hello/hello.rc hello/makesyso.bat src/dw/dw.go src/dw/dwglue.c src/dwib/dwib.go src/dwib/dwibglue.c src/dwibtest/dwibtest.exe.x64.manifest src/dwibtest/dwibtest.exe.x86.manifest src/dwibtest/dwibtest.go src/dwibtest/dwibtest.rc src/dwibtest/example.xml src/dwibtest/makesyso.bat src/dwootest/dwootest.exe.x64.manifest src/dwootest/dwootest.exe.x86.manifest src/dwootest/dwootest.go src/dwootest/dwootest.rc src/dwootest/makesyso.bat src/dwtest/dwtest.exe.x64.manifest src/dwtest/dwtest.exe.x86.manifest src/dwtest/dwtest.go src/dwtest/dwtest.rc src/dwtest/file.png src/dwtest/folder.png src/dwtest/makesyso.bat src/dwtest/test.png src/hello/hello.exe.x64.manifest src/hello/hello.exe.x86.manifest src/hello/hello.go src/hello/hello.rc src/hello/makesyso.bat |
diffstat | 57 files changed, 11935 insertions(+), 11848 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dw/dw.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,6111 @@ +package dw + +/* +#cgo linux pkg-config: dwindows +#cgo freebsd pkg-config: dwindows +#cgo darwin CFLAGS: -I/usr/local/include -g -O2 -D__MAC__ +#cgo darwin LDFLAGS: -L/usr/local/lib -ldwindows -lresolv -framework Cocoa -framework WebKit -lpthread +#cgo windows CFLAGS: -IC:/Work/BitBucket/dwindows -g -O2 -D__WIN32__ -mthreads +#cgo windows LDFLAGS: -LC:/Work/BitBucket/dwindows -ldw +#include "dwglue.c" +*/ +import "C" +import "unsafe" +import "runtime" +import "reflect" +import "os" + +type HANDLE interface { + GetHandle() unsafe.Pointer + GetType() C.uint +} +type DRAWABLE interface { + DrawPoint(x int, y int) + DrawLine(x1 int, y1 int, x2 int, y2 int) + DrawPolygon(flags int, x []int, y []int) + DrawRect(fill int, x int, y int, width int, height int) + DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) + DrawText(x int, y int, text string) + BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int + BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int + BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) + BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) +} +type HGENERIC struct { + hwnd unsafe.Pointer +} +type HWND struct { + hwnd unsafe.Pointer +} +type HENTRYFIELD struct { + hwnd unsafe.Pointer +} +type HTEXT struct { + hwnd unsafe.Pointer +} +type HTREE struct { + hwnd unsafe.Pointer +} +type HCONTAINER struct { + hwnd unsafe.Pointer + filesystem bool +} +type HMLE struct { + hwnd unsafe.Pointer +} +type HBUTTON struct { + hwnd unsafe.Pointer +} +type HSPINBUTTON struct { + hwnd unsafe.Pointer +} +type HNOTEBOOK struct { + hwnd unsafe.Pointer +} +type HBOX struct { + hwnd unsafe.Pointer +} +type HSCROLLBOX struct { + hwnd unsafe.Pointer +} +type HMENUITEM struct { + hwnd unsafe.Pointer +} +type HLISTBOX struct { + hwnd unsafe.Pointer +} +type HPERCENT struct { + hwnd unsafe.Pointer +} +type HSLIDER struct { + hwnd unsafe.Pointer +} +type HSCROLLBAR struct { + hwnd unsafe.Pointer +} +type HRENDER struct { + hwnd unsafe.Pointer +} +type HHTML struct { + hwnd unsafe.Pointer +} +type HCALENDAR struct { + hwnd unsafe.Pointer +} +type HBITMAP struct { + hwnd unsafe.Pointer +} +type HSPLITBAR struct { + hwnd unsafe.Pointer +} +type HTREEITEM struct { + htreeitem unsafe.Pointer + htree HANDLE +} +type HCONTINS struct { + ptr unsafe.Pointer + rowcount int + hcont HANDLE + filesystem bool +} +type HDIALOG struct { + hdialog unsafe.Pointer +} +type HEV struct { + hev unsafe.Pointer +} +type HMTX struct { + hmtx unsafe.Pointer +} +type HICN unsafe.Pointer +type HTIMER struct { + tid C.int +} +type HMENUI struct { + hmenui unsafe.Pointer +} +type HPIXMAP struct { + hpixmap unsafe.Pointer +} +type HPRINT struct { + hprint unsafe.Pointer + jobname string +} +type HNOTEPAGE struct { + pageid C.ulong + hnotebook HANDLE +} +type COLOR C.ulong +type POINTER unsafe.Pointer +type SIGNAL_FUNC unsafe.Pointer + +type Env struct { + OSName, BuildDate, BuildTime string + MajorVersion, MinorVersion, MajorBuild, MinorBuild C.short + DWMajorVersion, DWMinorVersion, DWSubVersion C.short +} + +// Define our exported constants +const ( + FALSE int = iota + TRUE +) + +var DESKTOP HWND + +// Varaibles to pass if "none/nil" is intended +var NOHWND HWND +var NOHTIMER HTIMER +var NOHPRINT HPRINT +var NOHPIXMAP HPIXMAP +var NOHMENUI HMENUI +var NOMENU HMENUI +var NOHTREEITEM HTREEITEM +var NOHICN HICN = nil + +// Import as much as we can from C +var HORZ = C.DW_HORZ +var VERT = C.DW_VERT + +// Message box return values +var MB_RETURN_OK = C.DW_MB_RETURN_OK +var MB_RETURN_YES = C.DW_MB_RETURN_YES +var MB_RETURN_NO = C.DW_MB_RETURN_NO +var MB_RETURN_CANCEL = C.DW_MB_RETURN_CANCEL + +// Message box button options +var MB_OK = C.DW_MB_OK +var MB_OKCANCEL = C.DW_MB_OKCANCEL +var MB_YESNO = C.DW_MB_YESNO +var MB_YESNOCANCEL = C.DW_MB_YESNOCANCEL + +// Message box icons +var MB_WARNING = C.DW_MB_WARNING +var MB_ERROR = C.DW_MB_ERROR +var MB_INFORMATION = C.DW_MB_INFORMATION +var MB_QUESTION = C.DW_MB_QUESTION + +/* Preset Pointers */ +var POINTER_DEFAULT = C.DW_POINTER_DEFAULT +var POINTER_ARROW = C.DW_POINTER_ARROW +var POINTER_CLOCK = C.DW_POINTER_CLOCK +var POINTER_QUESTION = C.DW_POINTER_QUESTION + +/* Draw Text Flags */ +var DT_LEFT uint = C.DW_DT_LEFT +var DT_CENTER uint = C.DW_DT_CENTER +var DT_RIGHT uint = C.DW_DT_RIGHT +var DT_VCENTER uint = C.DW_DT_VCENTER +var DT_WORDBREAK uint = C.DW_DT_WORDBREAK + +/* Window Frame Creation Flags */ +var FCF_CLOSEBUTTON uint = C.DW_FCF_CLOSEBUTTON +var FCF_TITLEBAR uint = C.DW_FCF_TITLEBAR +var FCF_SYSMENU uint = C.DW_FCF_SYSMENU +var FCF_SIZEBORDER uint = C.DW_FCF_SIZEBORDER +var FCF_MINBUTTON uint = C.DW_FCF_MINBUTTON +var FCF_MAXBUTTON uint = C.DW_FCF_MAXBUTTON +var FCF_MINMAX uint = C.DW_FCF_MINMAX +var FCF_DLGBORDER uint = C.DW_FCF_DLGBORDER +var FCF_BORDER uint = C.DW_FCF_BORDER +var FCF_TASKLIST uint = C.DW_FCF_TASKLIST +var FCF_HIDEBUTTON uint = C.DW_FCF_HIDEBUTTON +var FCF_HIDEMAX uint = C.DW_FCF_HIDEMAX +var FCF_MAXIMIZE uint = C.DW_FCF_MAXIMIZE +var FCF_MINIMIZE uint = C.DW_FCF_MINIMIZE +var FCF_COMPOSITED uint = C.DW_FCF_COMPOSITED +var FCF_TEXTURED uint = C.DW_FCF_TEXTURED + +var LIT_NONE = C.DW_LIT_NONE + +var MLE_CASESENSITIVE = C.DW_MLE_CASESENSITIVE + +/* Button Styles */ +var BS_NOBORDER uint = C.DW_BS_NOBORDER + +/* Key Code Modifiers */ +var KC_CTRL = C.KC_CTRL +var KC_SHIFT = C.KC_SHIFT +var KC_ALT = C.KC_ALT + +/* Menu Presets */ +var MENU_SEPARATOR = C.DW_MENU_SEPARATOR +var MENU_AUTO uint = C.DW_MENU_AUTO +var MENU_POPUP uint = ^uint(0) + +var PERCENT_INDETERMINATE uint = ^uint(0) + +/* Return value error codes */ +var ERROR_NONE = C.DW_ERROR_NONE +var ERROR_GENERAL = C.DW_ERROR_GENERAL +var ERROR_TIMEOUT = C.DW_ERROR_TIMEOUT +var ERROR_NON_INIT = C.DW_ERROR_NON_INIT +var ERROR_NO_MEM = C.DW_ERROR_NO_MEM +var ERROR_INTERRUPT = C.DW_ERROR_INTERRUPT +var ERROR_UNKNOWN = C.DW_ERROR_UNKNOWN + +/* Embedded HTML actions */ +var HTML_GOBACK = C.DW_HTML_GOBACK +var HTML_GOFORWARD = C.DW_HTML_GOFORWARD +var HTML_GOHOME = C.DW_HTML_GOHOME +var HTML_SEARCH = C.DW_HTML_SEARCH +var HTML_RELOAD = C.DW_HTML_RELOAD +var HTML_STOP = C.DW_HTML_STOP +var HTML_PRINT = C.DW_HTML_PRINT + +/* Drawing flags */ +var DRAW_DEFAULT = C.DW_DRAW_DEFAULT +var DRAW_FILL = C.DW_DRAW_FILL +var DRAW_FULL = C.DW_DRAW_FULL +var DRAW_NOAA = C.DW_DRAW_NOAA + +/* Preset Drawing Colors */ +var CLR_BLACK = COLOR(C.DW_CLR_BLACK) +var CLR_DARKRED = COLOR(C.DW_CLR_DARKRED) +var CLR_DARKGREEN = COLOR(C.DW_CLR_DARKGREEN) +var CLR_BROWN = COLOR(C.DW_CLR_BROWN) +var CLR_DARKBLUE = COLOR(C.DW_CLR_DARKBLUE) +var CLR_DARKPINK = COLOR(C.DW_CLR_DARKPINK) +var CLR_DARKCYAN = COLOR(C.DW_CLR_DARKCYAN) +var CLR_PALEGRAY = COLOR(C.DW_CLR_PALEGRAY) +var CLR_DARKGRAY = COLOR(C.DW_CLR_DARKGRAY) +var CLR_RED = COLOR(C.DW_CLR_RED) +var CLR_GREEN = COLOR(C.DW_CLR_GREEN) +var CLR_YELLOW = COLOR(C.DW_CLR_YELLOW) +var CLR_BLUE = COLOR(C.DW_CLR_BLUE) +var CLR_PINK = COLOR(C.DW_CLR_PINK) +var CLR_CYAN = COLOR(C.DW_CLR_CYAN) +var CLR_WHITE = COLOR(C.DW_CLR_WHITE) +var CLR_DEFAULT = COLOR(C.DW_CLR_DEFAULT) + +/* Signal handler defines */ +var SIGNAL_CONFIGURE = C.DW_SIGNAL_CONFIGURE +var SIGNAL_KEY_PRESS = C.DW_SIGNAL_KEY_PRESS +var SIGNAL_BUTTON_PRESS = C.DW_SIGNAL_BUTTON_PRESS +var SIGNAL_BUTTON_RELEASE = C.DW_SIGNAL_BUTTON_RELEASE +var SIGNAL_MOTION_NOTIFY = C.DW_SIGNAL_MOTION_NOTIFY +var SIGNAL_DELETE = C.DW_SIGNAL_DELETE +var SIGNAL_EXPOSE = C.DW_SIGNAL_EXPOSE +var SIGNAL_CLICKED = C.DW_SIGNAL_CLICKED +var SIGNAL_ITEM_ENTER = C.DW_SIGNAL_ITEM_ENTER +var SIGNAL_ITEM_CONTEXT = C.DW_SIGNAL_ITEM_CONTEXT +var SIGNAL_ITEM_SELECT = C.DW_SIGNAL_ITEM_SELECT +var SIGNAL_LIST_SELECT = C.DW_SIGNAL_LIST_SELECT +var SIGNAL_SET_FOCUS = C.DW_SIGNAL_SET_FOCUS +var SIGNAL_VALUE_CHANGED = C.DW_SIGNAL_VALUE_CHANGED +var SIGNAL_SWITCH_PAGE = C.DW_SIGNAL_SWITCH_PAGE +var SIGNAL_COLUMN_CLICK = C.DW_SIGNAL_COLUMN_CLICK +var SIGNAL_TREE_EXPAND = C.DW_SIGNAL_TREE_EXPAND + +/* status of menu items */ +var MIS_ENABLED uint = C.DW_MIS_ENABLED +var MIS_DISABLED uint = C.DW_MIS_DISABLED +var MIS_CHECKED uint = C.DW_MIS_CHECKED +var MIS_UNCHECKED uint = C.DW_MIS_UNCHECKED + +/* Gravity */ +var GRAV_TOP = C.DW_GRAV_TOP +var GRAV_LEFT = C.DW_GRAV_LEFT +var GRAV_CENTER = C.DW_GRAV_CENTER +var GRAV_RIGHT = C.DW_GRAV_RIGHT +var GRAV_BOTTOM = C.DW_GRAV_BOTTOM +var GRAV_OBSTACLES = C.DW_GRAV_OBSTACLES + +/* Container Flags */ +var CFA_BITMAPORICON uint = C.DW_CFA_BITMAPORICON +var CFA_STRING uint = C.DW_CFA_STRING +var CFA_ULONG uint = C.DW_CFA_ULONG +var CFA_TIME uint = C.DW_CFA_TIME +var CFA_DATE uint = C.DW_CFA_DATE +var CFA_CENTER uint = C.DW_CFA_CENTER +var CFA_LEFT uint = C.DW_CFA_LEFT +var CFA_RIGHT uint = C.DW_CFA_RIGHT + +var CFA_STRINGANDICON uint = C.DW_CFA_STRINGANDICON +var CFA_HORZSEPARATOR uint = C.DW_CFA_HORZSEPARATOR +var CFA_SEPARATOR uint = C.DW_CFA_SEPARATOR + +var CRA_SELECTED uint = C.DW_CRA_SELECTED +var CRA_CUROSRED uint = C.DW_CRA_CURSORED + +/* Mouse buttons */ +var BUTTON1_MASK = C.DW_BUTTON1_MASK +var BUTTON2_MASK = C.DW_BUTTON2_MASK +var BUTTON3_MASK = C.DW_BUTTON3_MASK + +/* File dialog */ +var FILE_OPEN = C.DW_FILE_OPEN +var FILE_SAVE = C.DW_FILE_SAVE +var DIRECTORY_OPEN = C.DW_DIRECTORY_OPEN + +/* Key codes */ +var VK_LBUTTON = int(C.VK_LBUTTON) +var VK_RBUTTON = int(C.VK_RBUTTON) +var VK_CANCEL = int(C.VK_CANCEL) +var VK_MBUTTON = int(C.VK_MBUTTON) +var VK_TAB = int(C.VK_TAB) +var VK_CLEAR = int(C.VK_CLEAR) +var VK_RETURN = int(C.VK_RETURN) +var VK_PAUSE = int(C.VK_PAUSE) +var VK_CAPITAL = int(C.VK_CAPITAL) +var VK_ESCAPE = int(C.VK_ESCAPE) +var VK_SPACE = int(C.VK_SPACE) +var VK_PRIOR = int(C.VK_PRIOR) +var VK_NEXT = int(C.VK_NEXT) +var VK_END = int(C.VK_END) +var VK_HOME = int(C.VK_HOME) +var VK_LEFT = int(C.VK_LEFT) +var VK_UP = int(C.VK_UP) +var VK_RIGHT = int(C.VK_RIGHT) +var VK_DOWN = int(C.VK_DOWN) +var VK_SELECT = int(C.VK_SELECT) +var VK_PRINT = int(C.VK_PRINT) +var VK_EXECUTE = int(C.VK_EXECUTE) +var VK_SNAPSHOT = int(C.VK_SNAPSHOT) +var VK_INSERT = int(C.VK_INSERT) +var VK_DELETE = int(C.VK_DELETE) +var VK_HELP = int(C.VK_HELP) +var VK_LWIN = int(C.VK_LWIN) +var VK_RWIN = int(C.VK_RWIN) +var VK_NUMPAD0 = int(C.VK_NUMPAD0) +var VK_NUMPAD1 = int(C.VK_NUMPAD1) +var VK_NUMPAD2 = int(C.VK_NUMPAD2) +var VK_NUMPAD3 = int(C.VK_NUMPAD3) +var VK_NUMPAD4 = int(C.VK_NUMPAD4) +var VK_NUMPAD5 = int(C.VK_NUMPAD5) +var VK_NUMPAD6 = int(C.VK_NUMPAD6) +var VK_NUMPAD7 = int(C.VK_NUMPAD7) +var VK_NUMPAD8 = int(C.VK_NUMPAD8) +var VK_NUMPAD9 = int(C.VK_NUMPAD9) +var VK_MULTIPLY = int(C.VK_MULTIPLY) +var VK_ADD = int(C.VK_ADD) +var VK_SEPARATOR = int(C.VK_SEPARATOR) +var VK_SUBTRACT = int(C.VK_SUBTRACT) +var VK_DECIMAL = int(C.VK_DECIMAL) +var VK_DIVIDE = int(C.VK_DIVIDE) +var VK_F1 = int(C.VK_F1) +var VK_F2 = int(C.VK_F2) +var VK_F3 = int(C.VK_F3) +var VK_F4 = int(C.VK_F4) +var VK_F5 = int(C.VK_F5) +var VK_F6 = int(C.VK_F6) +var VK_F7 = int(C.VK_F7) +var VK_F8 = int(C.VK_F8) +var VK_F9 = int(C.VK_F9) +var VK_F10 = int(C.VK_F10) +var VK_F11 = int(C.VK_F11) +var VK_F12 = int(C.VK_F12) +var VK_F13 = int(C.VK_F13) +var VK_F14 = int(C.VK_F14) +var VK_F15 = int(C.VK_F15) +var VK_F16 = int(C.VK_F16) +var VK_F17 = int(C.VK_F17) +var VK_F18 = int(C.VK_F18) +var VK_F19 = int(C.VK_F19) +var VK_F20 = int(C.VK_F20) +var VK_F21 = int(C.VK_F21) +var VK_F22 = int(C.VK_F22) +var VK_F23 = int(C.VK_F23) +var VK_F24 = int(C.VK_F24) +var VK_NUMLOCK = int(C.VK_NUMLOCK) +var VK_SCROLL = int(C.VK_SCROLL) +var VK_LSHIFT = int(C.VK_LSHIFT) +var VK_RSHIFT = int(C.VK_RSHIFT) +var VK_LCONTROL = int(C.VK_LCONTROL) +var VK_RCONTROL = int(C.VK_RCONTROL) + +// Cache the function pointers so they don't get garbage collected +var backs []unsafe.Pointer + +// Convert a resource ID into a pointer +func RESOURCE(id uintptr) unsafe.Pointer { + return unsafe.Pointer(id) +} + +// Convert component colors into a COLOR type +func RGB(red uint8, green uint8, blue uint8) COLOR { + lred := C.ulong(red) + lgreen := C.ulong(green) + lblue := C.ulong(blue) + return COLOR((0xF0000000 | (lred) | (lgreen << 8) | (lblue << 16))) +} + +// Convert a POINTER to a HANDLE (use with care) +func POINTER_TO_HANDLE(ptr POINTER) HANDLE { + return HANDLE(HGENERIC{unsafe.Pointer(ptr)}) +} + +// Convert a HANDLE to a UINTPTR, mostly used for display purposes +func HANDLE_TO_UINTPTR(handle HANDLE) uintptr { + return uintptr(handle.GetHandle()) +} + +// Convert a HANDLE to a POINTER (use with care) +func HANDLE_TO_POINTER(handle HANDLE) POINTER { + return POINTER(handle.GetHandle()) +} + +// Convert a HNOTEPAGE to a UINT, mostly used for display purposes +func HNOTEPAGE_TO_UINT(handle HNOTEPAGE) uint { + return uint(handle.pageid) +} + +/* Functions to convert from HANDLE to specific types.. + * These will only work if the hanldle was of the + * correct type, or were HGENERIC. Use with care. + */ + +// Convert HANDLE to HWND (use with care) +func HANDLE_TO_HWND(handle HANDLE) HWND { + if handle.GetType() == 1 || handle.GetType() == 0 { + return HWND{handle.GetHandle()} + } + return HWND{nil} +} + +// Convert HANDLE to HENTRYFIELD (use with care) +func HANDLE_TO_HENTRYFIELD(handle HANDLE) HENTRYFIELD { + if handle.GetType() == 2 || handle.GetType() == 0 { + return HENTRYFIELD{handle.GetHandle()} + } + return HENTRYFIELD{nil} +} + +// Convert HANDLE to HTEXT (use with care) +func HANDLE_TO_HTEXT(handle HANDLE) HTEXT { + if handle.GetType() == 3 || handle.GetType() == 0 { + return HTEXT{handle.GetHandle()} + } + return HTEXT{nil} +} + +// Convert HANDLE to HTREE (use with care) +func HANDLE_TO_HTREE(handle HANDLE) HTREE { + if handle.GetType() == 4 || handle.GetType() == 0 { + return HTREE{handle.GetHandle()} + } + return HTREE{nil} +} + +// Convert HANDLE to HCONTAINER (use with care) +func HANDLE_TO_HCONTAINER(handle HANDLE) HCONTAINER { + if handle.GetType() == 5 || handle.GetType() == 0 { + filesystem := false + if Window_get_data(HCONTAINER{handle.GetHandle(), false}, "_go_filesystem") != nil { + filesystem = true + } + return HCONTAINER{handle.GetHandle(), filesystem} + } + return HCONTAINER{nil, false} +} + +// Convert HANDLE to HMLE (use with care) +func HANDLE_TO_HMLE(handle HANDLE) HMLE { + if handle.GetType() == 6 || handle.GetType() == 0 { + return HMLE{handle.GetHandle()} + } + return HMLE{nil} +} + +// Convert HANDLE to HBUTTON (use with care) +func HANDLE_TO_HBUTTON(handle HANDLE) HBUTTON { + if handle.GetType() == 7 || handle.GetType() == 0 { + return HBUTTON{handle.GetHandle()} + } + return HBUTTON{nil} +} + +// Convert HANDLE to HSPINBUTTON (use with care) +func HANDLE_TO_HSPINBUTTON(handle HANDLE) HSPINBUTTON { + if handle.GetType() == 8 || handle.GetType() == 0 { + return HSPINBUTTON{handle.GetHandle()} + } + return HSPINBUTTON{nil} +} + +// Convert HANDLE to HNOTEBOOK (use with care) +func HANDLE_TO_HNOTEBOOK(handle HANDLE) HNOTEBOOK { + if handle.GetType() == 9 || handle.GetType() == 0 { + return HNOTEBOOK{handle.GetHandle()} + } + return HNOTEBOOK{nil} +} + +// Convert HANDLE to HBOX (use with care) +func HANDLE_TO_HBOX(handle HANDLE) HBOX { + if handle.GetType() == 10 || handle.GetType() == 0 { + return HBOX{handle.GetHandle()} + } + return HBOX{nil} +} + +// Convert HANDLE to HSCROLLBOX (use with care) +func HANDLE_TO_HSCROLLBOX(handle HANDLE) HSCROLLBOX { + if handle.GetType() == 11 || handle.GetType() == 0 { + return HSCROLLBOX{handle.GetHandle()} + } + return HSCROLLBOX{nil} +} + +// Convert HANDLE to HMENUITEM (use with care) +func HANDLE_TO_HMENUITEM(handle HANDLE) HMENUITEM { + if handle.GetType() == 12 || handle.GetType() == 0 { + return HMENUITEM{handle.GetHandle()} + } + return HMENUITEM{nil} +} + +// Convert HANDLE to HLISTBOX (use with care) +func HANDLE_TO_HLISTBOX(handle HANDLE) HLISTBOX { + if handle.GetType() == 13 || handle.GetType() == 0 { + return HLISTBOX{handle.GetHandle()} + } + return HLISTBOX{nil} +} + +// Convert HANDLE to HPERCENT (use with care) +func HANDLE_TO_HPERCENT(handle HANDLE) HPERCENT { + if handle.GetType() == 14 || handle.GetType() == 0 { + return HPERCENT{handle.GetHandle()} + } + return HPERCENT{nil} +} + +// Convert HANDLE to HSLIDER (use with care) +func HANDLE_TO_HSLIDER(handle HANDLE) HSLIDER { + if handle.GetType() == 15 || handle.GetType() == 0 { + return HSLIDER{handle.GetHandle()} + } + return HSLIDER{nil} +} + +// Convert HANDLE to HSCROLLBAR (use with care) +func HANDLE_TO_HSCROLLBAR(handle HANDLE) HSCROLLBAR { + if handle.GetType() == 16 || handle.GetType() == 0 { + return HSCROLLBAR{handle.GetHandle()} + } + return HSCROLLBAR{nil} +} + +// Convert HANDLE to HRENDER (use with care) +func HANDLE_TO_HRENDER(handle HANDLE) HRENDER { + if handle.GetType() == 17 || handle.GetType() == 0 { + return HRENDER{handle.GetHandle()} + } + return HRENDER{nil} +} + +// Convert HANDLE to HHTML (use with care) +func HANDLE_TO_HHTML(handle HANDLE) HHTML { + if handle.GetType() == 18 || handle.GetType() == 0 { + return HHTML{handle.GetHandle()} + } + return HHTML{nil} +} + +// Convert HANDLE to HCALENDAR (use with care) +func HANDLE_TO_HCALENDAR(handle HANDLE) HCALENDAR { + if handle.GetType() == 19 || handle.GetType() == 0 { + return HCALENDAR{handle.GetHandle()} + } + return HCALENDAR{nil} +} + +// Convert HANDLE to HBITMAP (use with care) +func HANDLE_TO_HBITMAP(handle HANDLE) HBITMAP { + if handle.GetType() == 20 || handle.GetType() == 0 { + return HBITMAP{handle.GetHandle()} + } + return HBITMAP{nil} +} + +// Convert HANDLE to HSPLITBAR (use with care) +func HANDLE_TO_HSPLITBAR(handle HANDLE) HSPLITBAR { + if handle.GetType() == 21 || handle.GetType() == 0 { + return HSPLITBAR{handle.GetHandle()} + } + return HSPLITBAR{nil} +} + +func (window HGENERIC) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HGENERIC) GetType() C.uint { + return 0 +} + +func (window HWND) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HWND) GetType() C.uint { + return 1 +} + +func (window HENTRYFIELD) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HENTRYFIELD) GetType() C.uint { + return 2 +} + +func (window HTEXT) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HTEXT) GetType() C.uint { + return 3 +} + +func (window HTREE) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HTREE) GetType() C.uint { + return 4 +} + +func (window HCONTAINER) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HCONTAINER) GetType() C.uint { + return 5 +} + +func (window HMLE) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HMLE) GetType() C.uint { + return 6 +} + +func (window HBUTTON) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HBUTTON) GetType() C.uint { + return 7 +} + +func (window HSPINBUTTON) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HSPINBUTTON) GetType() C.uint { + return 8 +} + +func (window HNOTEBOOK) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HNOTEBOOK) GetType() C.uint { + return 9 +} + +func (window HBOX) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HBOX) GetType() C.uint { + return 10 +} + +func (window HSCROLLBOX) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HSCROLLBOX) GetType() C.uint { + return 11 +} + +func (window HMENUITEM) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HMENUITEM) GetType() C.uint { + return 12 +} + +func (window HLISTBOX) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HLISTBOX) GetType() C.uint { + return 13 +} + +func (window HPERCENT) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HPERCENT) GetType() C.uint { + return 14 +} + +func (window HSLIDER) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HSLIDER) GetType() C.uint { + return 15 +} + +func (window HSCROLLBAR) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HSCROLLBAR) GetType() C.uint { + return 16 +} + +func (window HRENDER) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HRENDER) GetType() C.uint { + return 17 +} + +func (window HHTML) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HHTML) GetType() C.uint { + return 18 +} + +func (window HCALENDAR) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HCALENDAR) GetType() C.uint { + return 19 +} + +func (window HBITMAP) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HBITMAP) GetType() C.uint { + return 20 +} + +func (window HSPLITBAR) GetHandle() unsafe.Pointer { + return window.hwnd +} + +func (window HSPLITBAR) GetType() C.uint { + return 21 +} + +func (treeitem HTREEITEM) GetHandle() unsafe.Pointer { + return treeitem.htreeitem +} + +func (window HTREEITEM) GetType() C.uint { + return 22 +} + +func (contins HCONTINS) GetHandle() unsafe.Pointer { + return contins.ptr +} + +func (window HCONTINS) GetType() C.uint { + return 0 +} + +func (event HEV) GetHandle() unsafe.Pointer { + return event.hev +} + +func (window HEV) GetType() C.uint { + return 0 +} + +func (mutex HMTX) GetHandle() unsafe.Pointer { + return mutex.hmtx +} + +func (window HMTX) GetType() C.uint { + return 0 +} + +// Initializes the Dynamic Windows engine. +func Init(newthread int) int { + if len(os.Args) > 0 { + var argc C.int = C.int(len(os.Args)) + argv := C.go_string_array_make(argc) + defer C.go_string_array_free(argv, argc) + for i, s := range os.Args { + C.go_string_array_set(argv, C.CString(s), C.int(i)) + } + return int(C.go_init(C.int(newthread), argc, argv)) + } + return int(C.go_init(C.int(newthread), 0, nil)) +} + +// Initializes a Go Routine for Dynamic Windows calls +func InitThread() { + runtime.LockOSThread() + + C._dw_init_thread() +} + +// Deinitializes a Go Routine when Dyamic Windows calls are complete +func DeinitThread() { + C._dw_deinit_thread() + + runtime.UnlockOSThread() +} + +// Cleanly terminates a DW session, should be signal handler safe but does not exit. +func Shutdown() { + C.dw_shutdown() +} + +// Returns some information about the current operating environment. +func Environment_query(env *Env) { + var cenv C.DWEnv + C.dw_environment_query(&cenv) + env.OSName = C.GoString((*C.char)(unsafe.Pointer(&cenv.osName[0]))) + env.BuildDate = C.GoString((*C.char)(unsafe.Pointer(&cenv.buildDate[0]))) + env.BuildTime = C.GoString((*C.char)(unsafe.Pointer(&cenv.buildTime[0]))) + env.MajorVersion = cenv.MajorVersion + env.MinorVersion = cenv.MajorVersion + env.MajorBuild = cenv.MajorBuild + env.MinorBuild = cenv.MinorBuild + env.DWMajorVersion = cenv.DWMajorVersion + env.DWMinorVersion = cenv.DWMinorVersion + env.DWSubVersion = cenv.DWSubVersion +} + +// Returns some information about the current operating environment. +func EnvironmentGet() Env { + var env Env + Environment_query(&env) + return env +} + +// Displays a Message Box with given text and title. +func Messagebox(title string, flags int, message string) int { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + cmessage := C.CString(message) + defer C.free(unsafe.Pointer(cmessage)) + + return int(C.go_messagebox(ctitle, C.int(flags), cmessage)) +} + +// Displays a Message Box with given text and title. +func MessageBox(title string, flags int, message string) int { + return Messagebox(title, flags, message) +} + +// Create a new Window Frame. +func Window_new(owner HWND, title string, flags uint) HWND { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + return HWND{C.go_window_new(unsafe.Pointer(owner.hwnd), ctitle, C.ulong(flags))} +} + +// Create a new Window Frame. +func WindowNew(owner HWND, title string, flags uint) HWND { + return Window_new(owner, title, flags) +} + +// Makes the window visible. +func Window_show(handle HANDLE) int { + return int(C.go_window_show(handle.GetHandle())) +} + +// Makes the window visible. +func (window HWND) Show() int { + return Window_show(window) +} + +// Makes the window invisible. +func Window_hide(handle HANDLE) int { + return int(C.go_window_hide(handle.GetHandle())) +} + +// Makes the window invisible. +func (window HWND) Hide() int { + return Window_hide(window) +} + +// Makes the window bottommost. +func Window_lower(handle HANDLE) int { + return int(C.go_window_lower(handle.GetHandle())) +} + +// Makes the window bottommost. +func (window HWND) Lower() int { + return Window_lower(window) +} + +// Makes the window topmost. +func Window_raise(handle HANDLE) int { + return int(C.go_window_raise(handle.GetHandle())) +} + +// Makes the window topmost. +func (window HWND) Raise() int { + return Window_raise(window) +} + +// Minimizes or Iconifies a top-level window. +func Window_minimize(handle HANDLE) int { + return int(C.go_window_minimize(handle.GetHandle())) +} + +// Minimizes or Iconifies a top-level window. +func (window HWND) Minimize() int { + return Window_minimize(window) +} + +// Sets the position of a given window. +func Window_set_pos(handle HANDLE, x int, y int) { + C.go_window_set_pos(handle.GetHandle(), C.long(x), C.long(y)) +} + +// Sets the position of a given window. +func (window HWND) SetPos(x int, y int) { + Window_set_pos(window, x, y) +} + +// Sets the position and size of a given window. +func Window_set_pos_size(handle HANDLE, x int, y int, width uint, height uint) { + C.go_window_set_pos_size(handle.GetHandle(), C.long(x), C.long(y), C.ulong(width), C.ulong(height)) +} + +// Sets the position and size of a given window. +func (window HWND) SetPosSize(x int, y int, width uint, height uint) { + Window_set_pos_size(window, x, y, width, height) +} + +// Sets the size of a given window. +func Window_set_size(handle HANDLE, width uint, height uint) { + C.go_window_set_size(handle.GetHandle(), C.ulong(width), C.ulong(height)) +} + +// Sets the size of a given window. +func (window HWND) SetSize(width uint, height uint) { + Window_set_size(window, width, height) +} + +// Sets the colors used by a specified widget handle. +func Window_set_color(handle HANDLE, fore COLOR, back COLOR) int { + return int(C.go_window_set_color(handle.GetHandle(), C.ulong(fore), C.ulong(back))) +} + +// Sets the style of a given widget. +func Window_set_style(handle HANDLE, style uint, mask uint) { + C.go_window_set_style(handle.GetHandle(), C.ulong(style), C.ulong(mask)) +} + +// Sets widget to click the default dialog item when an ENTER is pressed. +func Window_click_default(window HANDLE, next HANDLE) { + C.go_window_click_default(window.GetHandle(), next.GetHandle()) +} + +// Sets widget to click the default dialog item when an ENTER is pressed. +func (window HWND) ClickDefault(next HANDLE) { + Window_click_default(window, next) +} + +// Sets the default focus item for a window/dialog. +func Window_default(window HWND, defaultitem HANDLE) { + C.go_window_default(unsafe.Pointer(window.hwnd), defaultitem.GetHandle()) +} + +// Sets the default focus item for a window/dialog. +func (window HWND) Default(defaultitem HANDLE) { + Window_default(window, defaultitem) +} + +// Destroys a window and all of it's children. +func Window_destroy(handle HANDLE) int { + return int(C.go_window_destroy(handle.GetHandle())) +} + +// Disables given widget. +func Window_disable(handle HANDLE) { + C.go_window_disable(handle.GetHandle()) +} + +// Enables given widget. +func Window_enable(handle HANDLE) { + C.go_window_enable(handle.GetHandle()) +} + +// Gets the child widget handle with specified ID. +func Window_from_id(handle HANDLE, cid int) HGENERIC { + return HGENERIC{C.go_window_from_id(handle.GetHandle(), C.int(cid))} +} + +// Gets the child widget handle with specified ID. +func (window HWND) FromID(cid int) HGENERIC { + return Window_from_id(window, cid) +} + +// Gets a named user data item from a widget handle. +func Window_get_data(window HANDLE, dataname string) POINTER { + cdataname := C.CString(dataname) + defer C.free(unsafe.Pointer(cdataname)) + + return POINTER(C.go_window_get_data(window.GetHandle(), cdataname)) +} + +// Add a named user data item to a widget handle. +func Window_set_data(window HANDLE, dataname string, data POINTER) { + cdataname := C.CString(dataname) + defer C.free(unsafe.Pointer(cdataname)) + + C.go_window_set_data(window.GetHandle(), cdataname, unsafe.Pointer(data)) +} + +// Returns the current font for the specified widget +func Window_get_font(handle HANDLE) string { + cfontname := C.go_window_get_font(handle.GetHandle()) + fontname := C.GoString(cfontname) + C.dw_free(unsafe.Pointer(cfontname)) + return fontname +} + +// Sets the font used by a specified widget handle. +func Window_set_font(handle HANDLE, fontname string) int { + cfontname := C.CString(fontname) + defer C.free(unsafe.Pointer(cfontname)) + + return int(C.go_window_set_font(handle.GetHandle(), cfontname)) +} + +// Gets the position and size of a given window. +func Window_get_pos_size(handle HANDLE) (int, int, uint, uint) { + var x, y C.long + var width, height C.ulong + C.go_window_get_pos_size(handle.GetHandle(), &x, &y, &width, &height) + return int(x), int(y), uint(width), uint(height) +} + +// Gets the position and size of a given window. +func (window HWND) GetPosSize() (int, int, uint, uint) { + return Window_get_pos_size(window) +} + +// Gets the size the system thinks the widget should be. +func Window_get_preferred_size(handle HANDLE) (int, int) { + var width, height C.int + C.go_window_get_preferred_size(handle.GetHandle(), &width, &height) + return int(width), int(height) +} + +// Gets the text used for a given widget. +func Window_get_text(handle HANDLE) string { + ctext := C.go_window_get_text(handle.GetHandle()) + text := C.GoString(ctext) + C.dw_free(unsafe.Pointer(ctext)) + return text +} + +// Sets the text used for a given widget. +func Window_set_text(handle HANDLE, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_window_set_text(handle.GetHandle(), ctext) +} + +// Sets the text used for a given widget's floating bubble help. +func Window_set_tooltip(handle HANDLE, bubbletext string) { + cbubbletext := C.CString(bubbletext) + defer C.free(unsafe.Pointer(cbubbletext)) + + C.go_window_set_tooltip(handle.GetHandle(), cbubbletext) +} + +// Causes entire window to be invalidated and redrawn. +func Window_redraw(handle HANDLE) { + C.go_window_redraw(handle.GetHandle()) +} + +// Causes entire window to be invalidated and redrawn. +func (window HWND) Redraw() { + Window_redraw(window) +} + +// Captures the mouse input to this window even if it is outside the bounds. +func Window_capture(handle HANDLE) { + C.go_window_capture(handle.GetHandle()) +} + +// Captures the mouse input to this window even if it is outside the bounds. +func (window HWND) Capture() { + Window_capture(window) +} + +// Releases previous mouse capture. +func Window_release() { + C.dw_window_release() +} + +// Releases previous mouse capture. +func (window HWND) Release() { + Window_release() +} + +// Sets the bitmap used for a given widget. +func Window_set_bitmap(window HANDLE, id uint, filename string) { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + C.go_window_set_bitmap(window.GetHandle(), C.ulong(id), cfilename) +} + +// Sets the bitmap used for a given widget. +func (window HBUTTON) SetBitmap(id uint, filename string) { + Window_set_bitmap(window, id, filename) +} + +// Sets the bitmap used for a given widget. +func (window HBITMAP) SetBitmap(id uint, filename string) { + Window_set_bitmap(window, id, filename) +} + +// Sets the border size of a specified window handle. +// This function may only work on OS/2. +func Window_set_border(handle HANDLE, border int) { + C.go_window_set_border(handle.GetHandle(), C.int(border)) +} + +// Sets the border size of a specified window handle. +// This function may only work on OS/2. +func (window HWND) SetBorder(border int) { + Window_set_border(window, border) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func Window_set_focus(handle HANDLE) { + C.go_window_set_focus(handle.GetHandle()) +} + +// Sets the gravity of a given window. +// Gravity controls which corner of the screen and window the position is relative to. +func Window_set_gravity(handle HANDLE, horz int, vert int) { + C.go_window_set_gravity(handle.GetHandle(), C.int(horz), C.int(vert)) +} + +// Sets the gravity of a given window. +// Gravity controls which corner of the screen and window the position is relative to. +func (window HWND) SetGravity(horz int, vert int) { + Window_set_gravity(window, horz, vert) +} + +// Sets the icon used for a given window. +func Window_set_icon(handle HANDLE, icon HICN) { + C.go_window_set_icon(handle.GetHandle(), unsafe.Pointer(icon)) +} + +// Sets the icon used for a given window. +func (window HWND) SetIcon(icon HICN) { + Window_set_icon(window, icon) +} + +// Changes the appearance of the mouse pointer. +func Window_set_pointer(handle HANDLE, cursortype int) { + C.go_window_set_pointer(handle.GetHandle(), C.int(cursortype)) +} + +/* Start Generic Section --- + * These need to be implemented by basically every class/type + */ + +// Destroys a window and all of it's children. +func (window HWND) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HWND) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HWND) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HWND) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HWND) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HWND) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HWND) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HWND) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HWND) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HWND) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HWND) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HWND) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HWND) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HWND) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Destroys a widget and all of it's children. +func (window HENTRYFIELD) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HENTRYFIELD) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HENTRYFIELD) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HENTRYFIELD) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HENTRYFIELD) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HENTRYFIELD) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HENTRYFIELD) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HENTRYFIELD) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HENTRYFIELD) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HENTRYFIELD) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HENTRYFIELD) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HENTRYFIELD) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HENTRYFIELD) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HENTRYFIELD) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HENTRYFIELD) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HTEXT) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HTEXT) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HTEXT) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HTEXT) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HTEXT) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HTEXT) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HTEXT) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HTEXT) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HTEXT) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HTEXT) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HTEXT) SetText(text string) { + Window_set_text(window, text) +} + +// Changes the appearance of the mouse pointer. +func (window HTEXT) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HTEXT) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HTEXT) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HTREE) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HTREE) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HTREE) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HTREE) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HTREE) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HTREE) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HTREE) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HTREE) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HTREE) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HTREE) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HTREE) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HTREE) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HTREE) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HTREE) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HTREE) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HCONTAINER) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HCONTAINER) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HCONTAINER) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HCONTAINER) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HCONTAINER) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HCONTAINER) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HCONTAINER) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HCONTAINER) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HCONTAINER) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HCONTAINER) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HCONTAINER) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HCONTAINER) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HCONTAINER) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HCONTAINER) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HCONTAINER) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HMLE) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HMLE) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HMLE) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HMLE) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HMLE) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HMLE) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HMLE) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HMLE) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HMLE) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HMLE) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HMLE) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HMLE) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HMLE) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HMLE) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HMLE) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HBUTTON) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HBUTTON) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HBUTTON) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HBUTTON) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HBUTTON) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HBUTTON) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HBUTTON) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HBUTTON) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HBUTTON) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HBUTTON) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HBUTTON) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HBUTTON) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HBUTTON) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HBUTTON) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HBUTTON) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HSPINBUTTON) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HSPINBUTTON) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HSPINBUTTON) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HSPINBUTTON) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HSPINBUTTON) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HSPINBUTTON) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HSPINBUTTON) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HSPINBUTTON) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HSPINBUTTON) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HSPINBUTTON) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HSPINBUTTON) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HSPINBUTTON) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HSPINBUTTON) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HSPINBUTTON) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HSPINBUTTON) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HNOTEBOOK) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HNOTEBOOK) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HNOTEBOOK) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HNOTEBOOK) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HNOTEBOOK) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HNOTEBOOK) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HNOTEBOOK) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HNOTEBOOK) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HNOTEBOOK) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HNOTEBOOK) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HNOTEBOOK) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HNOTEBOOK) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HNOTEBOOK) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HNOTEBOOK) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HNOTEBOOK) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HLISTBOX) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HLISTBOX) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HLISTBOX) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HLISTBOX) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HLISTBOX) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HLISTBOX) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Sets the colors used by a specified widget handle. +func (window HLISTBOX) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HLISTBOX) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HLISTBOX) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HLISTBOX) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HLISTBOX) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HLISTBOX) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HLISTBOX) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HPERCENT) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HPERCENT) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HPERCENT) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HPERCENT) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HPERCENT) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HPERCENT) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HPERCENT) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HPERCENT) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HPERCENT) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HPERCENT) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HPERCENT) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HPERCENT) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HPERCENT) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HPERCENT) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HPERCENT) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HSLIDER) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HSLIDER) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HSLIDER) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HSLIDER) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HSLIDER) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HSLIDER) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HSLIDER) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HSLIDER) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HSLIDER) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HSLIDER) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HSLIDER) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HSLIDER) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HSLIDER) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HSLIDER) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HSLIDER) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HSCROLLBAR) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HSCROLLBAR) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HSCROLLBAR) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HSCROLLBAR) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HSCROLLBAR) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HSCROLLBAR) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Gets the text used for a given widget. +func (window HSCROLLBAR) GetText() string { + return Window_get_text(window) +} + +// Sets the colors used by a specified widget handle. +func (window HSCROLLBAR) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HSCROLLBAR) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HSCROLLBAR) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget. +func (window HSCROLLBAR) SetText(text string) { + Window_set_text(window, text) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HSCROLLBAR) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HSCROLLBAR) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HSCROLLBAR) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HSCROLLBAR) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HCALENDAR) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HCALENDAR) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HCALENDAR) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HCALENDAR) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HCALENDAR) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HCALENDAR) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Sets the colors used by a specified widget handle. +func (window HCALENDAR) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HCALENDAR) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HCALENDAR) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HCALENDAR) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HCALENDAR) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HCALENDAR) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HCALENDAR) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HBITMAP) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HBITMAP) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HBITMAP) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HBITMAP) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HBITMAP) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HBITMAP) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Sets the colors used by a specified widget handle. +func (window HBITMAP) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HBITMAP) SetFocus() { + Window_set_focus(window) +} + +// Sets the font used by a specified widget handle. +func (window HBITMAP) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Sets the text used for a given widget's floating bubble help. +func (window HBITMAP) SetTooltip(bubbletext string) { + Window_set_tooltip(window, bubbletext) +} + +// Changes the appearance of the mouse pointer. +func (window HBITMAP) SetPointer(cursortype int) { + Window_set_pointer(window, cursortype) +} + +// Sets the style of a given widget. +func (window HBITMAP) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HBITMAP) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HHTML) Destroy() int { + return Window_destroy(window) +} + +// Disables given widget. +func (window HHTML) Disable() { + Window_disable(window) +} + +// Enables given widget. +func (window HHTML) Enable() { + Window_enable(window) +} + +// Gets a named user data item from a widget handle. +func (window HHTML) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HHTML) GetFont() string { + return Window_get_font(window) +} + +// Gets the size the system thinks the widget should be. +func (window HHTML) GetPreferredSize() (int, int) { + return Window_get_preferred_size(window) +} + +// Sets the current focus widget for a window/dialog. +// This is for use after showing the window/dialog. +func (window HHTML) SetFocus() { + Window_set_focus(window) +} + +// Sets the style of a given widget. +func (window HHTML) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +// Remove widget from the box it is packed into. +func (window HHTML) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HSPLITBAR) Destroy() int { + return Window_destroy(window) +} + +// Gets a named user data item from a widget handle. +func (window HSPLITBAR) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Remove widget from the box it is packed into. +func (window HSPLITBAR) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HBOX) Destroy() int { + return Window_destroy(window) +} + +// Gets a named user data item from a widget handle. +func (window HBOX) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Sets the colors used by a specified widget handle. +func (window HBOX) SetColor(fore COLOR, back COLOR) int { + return Window_set_color(window, fore, back) +} + +// Remove widget from the box it is packed into. +func (window HBOX) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HSCROLLBOX) Destroy() int { + return Window_destroy(window) +} + +// Gets a named user data item from a widget handle. +func (window HSCROLLBOX) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Remove widget from the box it is packed into. +func (window HSCROLLBOX) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HRENDER) Destroy() int { + return Window_destroy(window) +} + +// Gets a named user data item from a widget handle. +func (window HRENDER) GetData(dataname string) POINTER { + return Window_get_data(window, dataname) +} + +// Returns the current font for the specified widget +func (window HRENDER) GetFont() string { + return Window_get_font(window) +} + +// Get the width and height of a text string. +func (window HRENDER) GetTextExtents(text string) (int, int) { + return Font_text_extents_get(window, NOHPIXMAP, text) +} + +// Sets the font used by a specified widget handle. +func (window HRENDER) SetFont(fontname string) int { + return Window_set_font(window, fontname) +} + +// Remove widget from the box it is packed into. +func (window HRENDER) Unpack() int { + return Box_unpack(window) +} + +// Destroys a widget and all of it's children. +func (window HMENUITEM) Destroy() int { + return Window_destroy(window) +} + +// Sets the style of a given widget. +func (window HMENUITEM) SetStyle(style uint, mask uint) { + Window_set_style(window, style, mask) +} + +/* End Generic Section */ + +// Runs a message loop for Dynamic Windows. +func Main() { + C.dw_main() +} + +// Processes a single message iteration and returns. +func Main_iteration() { + C.dw_main_iteration() +} + +// Processes a single message iteration and returns. +func MainIteration() { + Main_iteration() +} + +// Causes running dw.Main() to return. +func Main_quit() { + C.dw_main_quit() +} + +// Causes running dw.Main() to return. +func MainQuit() { + Main_quit() +} + +// Runs a message loop for Dynamic Windows, for a period of milliseconds. +func Main_sleep(milliseconds int) { + C.dw_main_sleep(C.int(milliseconds)) +} + +// Runs a message loop for Dynamic Windows, for a period of milliseconds. +func MainSleep(milliseconds int) { + Main_sleep(milliseconds) +} + +// Create a new Box to be packed. +func Box_new(btype int, pad int) HBOX { + return HBOX{C.go_box_new(C.int(btype), C.int(pad))} +} + +// Create a new Box to be packed. +func BoxNew(btype int, pad int) HBOX { + return Box_new(btype, pad) +} + +// Pack widgets into a box at an arbitrary location. +func Box_pack_at_index(box HANDLE, item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { + C.go_box_pack_at_index(box.GetHandle(), item.GetHandle(), C.int(index), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) +} + +// Pack widgets into a box at an arbitrary location. +func (window HWND) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { + Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box at an arbitrary location. +func (window HBOX) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { + Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box at an arbitrary location. +func (window HSCROLLBOX) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { + Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the end (or bottom). +func Box_pack_end(box HANDLE, item HANDLE, width int, height int, hsize int, vsize int, pad int) { + C.go_box_pack_end(box.GetHandle(), item.GetHandle(), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) +} + +// Pack widgets into a box from the end (or bottom). +func (window HWND) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_end(window, item, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the end (or bottom). +func (window HBOX) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_end(window, item, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the end (or bottom). +func (window HSCROLLBOX) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_end(window, item, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the start (or top). +func Box_pack_start(box HANDLE, item HANDLE, width int, height int, hsize int, vsize int, pad int) { + C.go_box_pack_start(box.GetHandle(), item.GetHandle(), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) +} + +// Pack widgets into a box from the start (or top). +func (window HWND) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_start(window, item, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the start (or top). +func (window HBOX) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_start(window, item, width, height, hsize, vsize, pad) +} + +// Pack widgets into a box from the start (or top). +func (window HSCROLLBOX) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { + Box_pack_start(window, item, width, height, hsize, vsize, pad) +} + +// Remove widget from the box it is packed into. +func Box_unpack(handle HANDLE) int { + return int(C.go_box_unpack(handle.GetHandle())) +} + +// Remove widgets from a box at an arbitrary location. +func Box_unpack_at_index(handle HANDLE, index int) HANDLE { + return HANDLE(HWND{C.go_box_unpack_at_index(handle.GetHandle(), C.int(index))}) +} + +// Remove widgets from a box at an arbitrary location. +func (window HWND) UnpackAtIndex(index int) HANDLE { + return Box_unpack_at_index(window, index) +} + +// Remove widgets from a box at an arbitrary location. +func (window HBOX) UnpackAtIndex(index int) HANDLE { + return Box_unpack_at_index(window, index) +} + +// Remove widgets from a box at an arbitrary location. +func (window HSCROLLBOX) UnpackAtIndex(index int) HANDLE { + return Box_unpack_at_index(window, index) +} + +// Create a new static text widget to be packed. +func Text_new(text string, id uint) HTEXT { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HTEXT{C.go_text_new(ctext, C.ulong(id))} +} + +// Create a new static text widget to be packed. +func TextNew(text string, id uint) HTEXT { + return Text_new(text, id) +} + +// Create a new status text widget to be packed. +func Status_text_new(text string, id uint) HTEXT { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HTEXT{C.go_status_text_new(ctext, C.ulong(id))} +} + +// Create a new status text widget to be packed. +func StatusTextNew(text string, id uint) HTEXT { + return Status_text_new(text, id) +} + +// Create a new entryfield widget to be packed. +func Entryfield_new(text string, id uint) HENTRYFIELD { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HENTRYFIELD{C.go_entryfield_new(ctext, C.ulong(id))} +} + +// Create a new entryfield widget to be packed. +func EntryfieldNew(text string, id uint) HENTRYFIELD { + return Entryfield_new(text, id) +} + +// Create a new entryfield password widget to be packed. +func Entryfield_password_new(text string, id uint) HENTRYFIELD { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HENTRYFIELD{C.go_entryfield_password_new(ctext, C.ulong(id))} +} + +// Create a new entryfield password widget to be packed. +func EntryfieldPasswordNew(text string, id uint) HENTRYFIELD { + return Entryfield_password_new(text, id) +} + +// Sets the entryfield character limit. +func Entryfield_set_limit(handle HANDLE, limit int) { + C.go_entryfield_set_limit(handle.GetHandle(), C.int(limit)) +} + +// Sets the entryfield character limit. +func (handle HENTRYFIELD) SetLimit(limit int) { + Entryfield_set_limit(handle, limit) +} + +// Create a new button widget to be packed. +func Button_new(text string, id uint) HBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HBUTTON{C.go_button_new(ctext, C.ulong(id))} +} + +// Create a new button widget to be packed. +func ButtonNew(text string, id uint) HBUTTON { + return Button_new(text, id) +} + +// Gets the contents of the default clipboard as text. +func Clipboard_get_text() string { + ctext := C.dw_clipboard_get_text() + text := C.GoString(ctext) + C.dw_free(unsafe.Pointer(ctext)) + return text +} + +// Gets the contents of the default clipboard as text. +func ClipboardGetText() string { + return Clipboard_get_text() +} + +// Sets the contents of the default clipboard to the supplied text. +func Clipboard_set_text(text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.dw_clipboard_set_text(ctext, C.int(C.strlen(ctext))) +} + +// Sets the contents of the default clipboard to the supplied text. +func ClipboardSetText(text string) { + Clipboard_set_text(text) +} + +// Opens a file dialog and queries user selection. +func File_browse(title string, defpath string, ext string, flags int) string { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + cdefpath := C.CString(defpath) + defer C.free(unsafe.Pointer(cdefpath)) + cext := C.CString(ext) + defer C.free(unsafe.Pointer(cext)) + + result := C.dw_file_browse(ctitle, cdefpath, cext, C.int(flags)) + defer C.dw_free(unsafe.Pointer(result)) + return C.GoString(result) +} + +// Opens a file dialog and queries user selection. +func FileBrowse(title string, defpath string, ext string, flags int) string { + return File_browse(title, defpath, ext, flags) +} + +// Allows the user to choose a color using the system's color chooser dialog. +func Color_choose(value COLOR) COLOR { + return COLOR(C.dw_color_choose(C.ulong(value))) +} + +// Allows the user to choose a color using the system's color chooser dialog. +func ColorChoose(value COLOR) COLOR { + return Color_choose(value) +} + +// Add a callback to a timer event. +func Timer_connect(interval int, sigfunc SIGNAL_FUNC, data POINTER) HTIMER { + backs = append(backs, unsafe.Pointer(sigfunc)) + return HTIMER{C.go_timer_connect(C.int(interval), unsafe.Pointer(sigfunc), unsafe.Pointer(data), 0)} +} + +// Create a new timer. +func TimerNew() HTIMER { + return HTIMER{0} +} + +//Removes timer callback. +func Timer_disconnect(id HTIMER) { + if id.tid > 0 { + C.dw_timer_disconnect(C.int(id.tid)) + } +} + +// Add a callback to a widget event. +func Signal_connect(window HANDLE, signame string, sigfunc SIGNAL_FUNC, data POINTER) { + csigname := C.CString(signame) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(sigfunc)) + thissigfunc := unsafe.Pointer(sigfunc) + thisdata := unsafe.Pointer(data) + C.go_signal_connect(window.GetHandle(), csigname, thissigfunc, thisdata, window.GetType()<<8) +} + +// Emits a beep. +func Beep(freq int, dur int) { + C.dw_beep(C.int(freq), C.int(dur)) +} + +// Create a menu object to be popped up. +func Menu_new(id uint) HMENUI { + return HMENUI{C.go_menu_new(C.ulong(id))} +} + +// Create a menu object to be popped up. +func MenuNew(id uint) HMENUI { + return Menu_new(id) +} + +// Create a menubar on a window. +func Menubar_new(location HWND) HMENUI { + return HMENUI{C.go_menubar_new(unsafe.Pointer(location.hwnd))} +} + +// Create a menubar on a window. +func (window HWND) MenubarNew() HMENUI { + return Menubar_new(window) +} + +// Adds a menuitem or submenu to an existing menu. +func Menu_append_item(menu HMENUI, title string, id uint, flags uint, end int, check int, submenu HMENUI) HMENUITEM { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + return HMENUITEM{C.go_menu_append_item(menu.hmenui, ctitle, C.ulong(id), C.ulong(flags), C.int(end), C.int(check), submenu.hmenui)} +} + +// Adds a menuitem or submenu to an existing menu. +func (menui HMENUI) AppendItem(title string, id uint, flags uint, end int, check int, submenu HMENUI) HMENUITEM { + return Menu_append_item(menui, title, id, flags, end, check, submenu) +} + +// Deletes the menu item specified. +func Menu_delete_item(menu HMENUI, id uint) { + C.go_menu_delete_item(menu.hmenui, C.ulong(id)) +} + +// Deletes the menu item specified. +func (menui HMENUI) DeleteItem(id uint) { + Menu_delete_item(menui, id) +} + +// Destroys a menu created with dw.Menubar_new or dw.Menu_new. +func Menu_destroy(menu HMENUI) { + C.go_menu_destroy(menu.hmenui) +} + +// Destroys a menu created with dw.MenubarNew or dw.MenuNew. +func (menui HMENUI) Destroy() { + Menu_destroy(menui) +} + +// Sets the state of a menu item. +func Menu_item_set_state(menu HMENUI, id uint, flags uint) { + C.go_menu_item_set_state(menu.hmenui, C.ulong(id), C.ulong(flags)) +} + +// Sets the state of a menu item. +func (menui HMENUI) SetState(id uint, flags uint) { + Menu_item_set_state(menui, id, flags) +} + +// Pops up a context menu at given x and y coordinates. +func Menu_popup(menu HMENUI, parent HANDLE, x int, y int) { + C.go_menu_popup(menu.hmenui, parent.GetHandle(), C.int(x), C.int(y)) +} + +// Pops up a context menu at given x and y coordinates. +func (menui HMENUI) Popup(parent HANDLE, x int, y int) { + Menu_popup(menui, parent, x, y) +} + +// Create a notebook widget to be packed. +func Notebook_new(id uint, top int) HNOTEBOOK { + return HNOTEBOOK{C.go_notebook_new(C.ulong(id), C.int(top))} +} + +// Create a notebook widget to be packed. +func NotebookNew(id uint, top int) HNOTEBOOK { + return Notebook_new(id, top) +} + +// Packs the specified box into the notebook page. +func Notebook_pack(handle HANDLE, pageid HNOTEPAGE, page HANDLE) { + C.go_notebook_pack(handle.GetHandle(), pageid.pageid, page.GetHandle()) +} + +// Packs the specified box into the notebook page. +func (handle HNOTEPAGE) Pack(page HANDLE) { + Notebook_pack(handle.hnotebook, handle, page) +} + +// The contents of the notebook page will be destroyed as well. +func Notebook_page_destroy(handle HANDLE, pageid HNOTEPAGE) { + C.go_notebook_page_destroy(handle.GetHandle(), pageid.pageid) +} + +// The contents of the notebook page will be destroyed as well. +func (handle HNOTEPAGE) Destroy() { + Notebook_page_destroy(handle.hnotebook, handle) +} + +// Get the currently visible page. +func Notebook_page_get(handle HANDLE) HNOTEPAGE { + return HNOTEPAGE{C.go_notebook_page_get(handle.GetHandle()), handle} +} + +// Get the currently visible page. +func (handle HNOTEBOOK) PageGet() HNOTEPAGE { + return Notebook_page_get(handle) +} + +// Adds a new page to specified notebook. +func Notebook_page_new(handle HANDLE, flags uint, front int) HNOTEPAGE { + return HNOTEPAGE{C.go_notebook_page_new(handle.GetHandle(), C.ulong(flags), C.int(front)), handle} +} + +// Adds a new page to specified notebook. +func (handle HNOTEBOOK) PageNew(flags uint, front int) HNOTEPAGE { + return Notebook_page_new(handle, flags, front) +} + +// Sets the currently visible page. +func Notebook_page_set(handle HANDLE, pageid HNOTEPAGE) { + C.go_notebook_page_set(handle.GetHandle(), pageid.pageid) +} + +// Sets the text on the specified notebook tab. +func Notebook_page_set_text(handle HANDLE, pageid HNOTEPAGE, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_notebook_page_set_text(handle.GetHandle(), pageid.pageid, ctext) +} + +// Sets the text on the specified notebook tab. +func (handle HNOTEPAGE) SetText(text string) { + Notebook_page_set_text(handle.hnotebook, handle, text) +} + +// Obtains an icon from a file. +func Icon_load_from_file(filename string) HICN { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + return HICN(C.go_icon_load_from_file(cfilename)) +} + +// Obtains an icon from a file. +func IconLoadFromFile(filename string) HICN { + return Icon_load_from_file(filename) +} + +// Obtains an icon from a module (or header in GTK). +func Icon_load(id uint) HICN { + return HICN(C.go_icon_load(0, C.ulong(id))) +} + +// Obtains an icon from a module (or header in GTK). +func IconLoad(id uint) HICN { + return Icon_load(id) +} + +// Deletes an icon from the taskbar. +func Taskbar_delete(handle HANDLE, icon HICN) { + C.go_taskbar_delete(handle.GetHandle(), unsafe.Pointer(icon)) +} + +// Deletes an icon from the taskbar. +func TaskbarDelete(handle HANDLE, icon HICN) { + Taskbar_delete(handle, icon) +} + +// Inserts an icon into the taskbar. +func Taskbar_insert(handle HANDLE, icon HICN, bubbletext string) { + cbubbletext := C.CString(bubbletext) + defer C.free(unsafe.Pointer(cbubbletext)) + + C.go_taskbar_insert(handle.GetHandle(), unsafe.Pointer(icon), cbubbletext) +} + +// Inserts an icon into the taskbar. +func TaskbarInsert(handle HANDLE, icon HICN, bubbletext string) { + Taskbar_insert(handle, icon, bubbletext) +} + +// Create a new Combobox widget to be packed. +func Combobox_new(text string, id uint) HLISTBOX { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HLISTBOX{C.go_combobox_new(ctext, C.ulong(id))} +} + +// Create a new Combobox widget to be packed. +func ComboboxNew(text string, id uint) HLISTBOX { + return Combobox_new(text, id) +} + +// Create a new listbox widget to be packed. +func Listbox_new(id uint, multi int) HLISTBOX { + return HLISTBOX{C.go_listbox_new(C.ulong(id), C.int(multi))} +} + +// Create a new listbox widget to be packed. +func ListboxNew(id uint, multi int) HLISTBOX { + return Listbox_new(id, multi) +} + +// Appends the specified text to the listbox's (or combobox) entry list. +func Listbox_append(handle HANDLE, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_listbox_append(handle.GetHandle(), ctext) +} + +// Appends the specified text to the listbox's (or combobox) entry list. +func (handle HLISTBOX) Append(text string) { + Listbox_append(handle, text) +} + +// Appends the specified text items to the listbox's (or combobox) entry list. +func Listbox_list_append(handle HANDLE, text []string) { + count := len(text) + ctext := C.go_string_array_make(C.int(count)) + defer C.go_string_array_free(ctext, C.int(count)) + + for i, s := range text { + C.go_string_array_set(ctext, C.CString(s), C.int(i)) + } + + C.go_listbox_list_append(handle.GetHandle(), ctext, C.int(count)) +} + +// Appends the specified text items to the listbox's (or combobox) entry list. +func (handle HLISTBOX) AppendList(text []string) { + Listbox_list_append(handle, text) +} + +func Listbox_insert(handle HANDLE, text string, pos int) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_listbox_insert(handle.GetHandle(), ctext, C.int(pos)) +} + +// Inserts the specified text into the listbox's (or combobox) entry list. +func (handle HLISTBOX) Insert(text string, pos int) { + Listbox_insert(handle, text, pos) +} + +// Clears the listbox's (or combobox) list of all entries. +func Listbox_clear(handle HANDLE) { + C.go_listbox_clear(handle.GetHandle()) +} + +// Clears the listbox's (or combobox) list of all entries. +func (handle HLISTBOX) Clear() { + Listbox_clear(handle) +} + +// Returns the listbox's item count. +func Listbox_count(handle HANDLE) int { + return int(C.go_listbox_count(handle.GetHandle())) +} + +// Returns the listbox's item count. +func (handle HLISTBOX) Count() int { + return Listbox_count(handle) +} + +// Sets the topmost item in the viewport. +func Listbox_set_top(handle HANDLE, top int) { + C.go_listbox_set_top(handle.GetHandle(), C.int(top)) +} + +// Sets the topmost item in the viewport. +func (handle HLISTBOX) SetTop(top int) { + Listbox_set_top(handle, top) +} + +// Sets the selection state of a given index. +func Listbox_select(handle HANDLE, index int, state int) { + C.go_listbox_select(handle.GetHandle(), C.int(index), C.int(state)) +} + +// Sets the selection state of a given index. +func (handle HLISTBOX) Select(index int, state int) { + Listbox_select(handle, index, state) +} + +// Deletes the item with given index from the list. +func Listbox_delete(handle HANDLE, index int) { + C.go_listbox_delete(handle.GetHandle(), C.int(index)) +} + +// Deletes the item with given index from the list. +func (handle HLISTBOX) Delete(index int) { + Listbox_delete(handle, index) +} + +// Get the given index item's text. +func Listbox_get_text(handle HANDLE, index int) string { + var buf [201]C.char + + C.go_listbox_get_text(handle.GetHandle(), C.int(index), &buf[0], 200) + return C.GoString((*C.char)(unsafe.Pointer(&buf[0]))) +} + +// Get the given index item's text. +func (handle HLISTBOX) GetText(index int) string { + return Listbox_get_text(handle, index) +} + +// Sets the text of a given listbox entry. +func Listbox_set_text(handle HANDLE, index int, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_listbox_set_text(handle.GetHandle(), C.int(index), ctext) +} + +// Sets the text of a given listbox entry. +func (handle HLISTBOX) SetText(index int, text string) { + Listbox_set_text(handle, index, text) +} + +// Returns the index to the item in the list currently selected. +func Listbox_selected(handle HANDLE) int { + return int(C.go_listbox_selected(handle.GetHandle())) +} + +// Returns the index to the item in the list currently selected. +func (handle HLISTBOX) Selected() int { + return Listbox_selected(handle) +} + +// Returns the index to the current selected item or -1 when done. +func Listbox_selected_multi(handle HANDLE, where int) int { + return int(C.go_listbox_selected_multi(handle.GetHandle(), C.int(where))) +} + +// Returns the index to the current selected item or -1 when done. +func (handle HLISTBOX) SelectedMulti(where int) int { + return Listbox_selected_multi(handle, where) +} + +// Returns the width of the screen. +func Screen_width() int { + return int(C.dw_screen_width()) +} + +// Returns the width of the screen. +func ScreenWidth() int { + return Screen_width() +} + +// Returns the height of the screen. +func Screen_height() int { + return int(C.dw_screen_height()) +} + +// Returns the height of the screen. +func ScreenHeight() int { + return Screen_height() +} + +// This should return the current color depth. +func Color_depth_get() uint { + return uint(C.dw_color_depth_get()) +} + +// This should return the current color depth. +func ColorDepthGet() uint { + return Color_depth_get() +} + +// Sets the current foreground drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). +func Color_foreground_set(color COLOR) { + C.dw_color_foreground_set(C.ulong(color)) +} + +// Sets the current foreground drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). +func ColorForegroundSet(color COLOR) { + Color_foreground_set(color) +} + +// Sets the current background drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). +func Color_background_set(color COLOR) { + C.dw_color_background_set(C.ulong(color)) +} + +// Sets the current background drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). +func ColorBackgroundSet(color COLOR) { + Color_background_set(color) +} + +// Create a new spinbutton widget to be packed. +func Spinbutton_new(text string, id C.ulong) HSPINBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HSPINBUTTON{C.go_spinbutton_new(ctext, id)} +} + +// Create a new spinbutton widget to be packed. +func SpinButtonNew(text string, id C.ulong) HSPINBUTTON { + return Spinbutton_new(text, id) +} + +// Sets the spinbutton value. +func Spinbutton_set_pos(handle HANDLE, position int) { + C.go_spinbutton_set_pos(handle.GetHandle(), C.long(position)) +} + +// Sets the spinbutton value. +func (handle HSPINBUTTON) SetPos(position int) { + Spinbutton_set_pos(handle, position) +} + +// Sets the spinbutton limits. +func Spinbutton_set_limits(handle HANDLE, upper int, lower int) { + C.go_spinbutton_set_limits(handle.GetHandle(), C.long(upper), C.long(lower)) +} + +// Sets the spinbutton limits. +func (handle HSPINBUTTON) SetLimits(upper int, lower int) { + Spinbutton_set_limits(handle, upper, lower) +} + +// Returns the current value of the spinbutton. +func Spinbutton_get_pos(handle HANDLE) int { + return int(C.go_spinbutton_get_pos(handle.GetHandle())) +} + +// Returns the current value of the spinbutton. +func (handle HSPINBUTTON) GetPos() int { + return Spinbutton_get_pos(handle) +} + +// Create a new radiobutton widget to be packed. +func Radiobutton_new(text string, id uint) HBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HBUTTON{C.go_radiobutton_new(ctext, C.ulong(id))} +} + +// Create a new radiobutton widget to be packed. +func RadioButtonNew(text string, id uint) HBUTTON { + return Radiobutton_new(text, id) +} + +// Create a new checkbox widget to be packed. +func Checkbox_new(text string, id uint) HBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HBUTTON{C.go_checkbox_new(ctext, C.ulong(id))} +} + +// Create a new checkbox widget to be packed. +func CheckButtonNew(text string, id uint) HBUTTON { + return Checkbox_new(text, id) +} + +// Returns the state of the checkbox. +func Checkbox_get(handle HANDLE) int { + return int(C.go_checkbox_get(handle.GetHandle())) +} + +// Returns the state of the checkbox. +func (handle HBUTTON) Get() int { + return Checkbox_get(handle) +} + +// Sets the state of the checkbox. +func Checkbox_set(handle HANDLE, value int) { + C.go_checkbox_set(handle.GetHandle(), C.int(value)) +} + +// Sets the state of the checkbox. +func (handle HBUTTON) Set(value int) { + Checkbox_set(handle, value) +} + +// Create a new percent bar widget to be packed. +func Percent_new(id C.ulong) HPERCENT { + return HPERCENT{C.go_percent_new(id)} +} + +// Create a new percent bar widget to be packed. +func PercentNew(id C.ulong) HPERCENT { + return Percent_new(id) +} + +// Sets the percent bar position. +func Percent_set_pos(handle HANDLE, position uint) { + C.go_percent_set_pos(handle.GetHandle(), C.uint(position)) +} + +// Sets the percent bar position. +func (handle HPERCENT) SetPos(position uint) { + Percent_set_pos(handle, position) +} + +// Create a new slider widget to be packed. +func Slider_new(vertical int, increments int, id uint) HSLIDER { + return HSLIDER{C.go_slider_new(C.int(vertical), C.int(increments), C.ulong(id))} +} + +// Create a new slider widget to be packed. +func SliderNew(vertical int, increments int, id uint) HSLIDER { + return Slider_new(vertical, increments, id) +} + +// Create a new scrollbar widget to be packed. +func Scrollbar_new(vertical int, id uint) HSCROLLBAR { + return HSCROLLBAR{C.go_scrollbar_new(C.int(vertical), C.ulong(id))} +} + +// Create a new scrollbar widget to be packed. +func ScrollbarNew(vertical int, id uint) HSCROLLBAR { + return Scrollbar_new(vertical, id) +} + +// Returns the position of the slider. +func Slider_get_pos(handle HANDLE) uint { + return uint(C.go_slider_get_pos(handle.GetHandle())) +} + +// Returns the position of the slider. +func (handle HSLIDER) GetPos() uint { + return Slider_get_pos(handle) +} + +// Sets the slider position. +func Slider_set_pos(handle HANDLE, position uint) { + C.go_slider_set_pos(handle.GetHandle(), C.uint(position)) +} + +// Sets the slider position. +func (handle HSLIDER) SetPos(position uint) { + Slider_set_pos(handle, position) +} + +// Returns the position of the scrollbar. +func Scrollbar_get_pos(handle HANDLE) uint { + return uint(C.go_scrollbar_get_pos(handle.GetHandle())) +} + +// Returns the position of the scrollbar. +func (handle HSCROLLBAR) GetPos() uint { + return Scrollbar_get_pos(handle) +} + +// Sets the scrollbar position. +func Scrollbar_set_pos(handle HANDLE, position uint) { + C.go_scrollbar_set_pos(handle.GetHandle(), C.uint(position)) +} + +// Sets the scrollbar position. +func (handle HSCROLLBAR) SetPos(position uint) { + Scrollbar_set_pos(handle, position) +} + +// Sets the scrollbar range. +func Scrollbar_set_range(handle HANDLE, srange uint, visible uint) { + C.go_scrollbar_set_range(handle.GetHandle(), C.uint(srange), C.uint(visible)) +} + +// Sets the scrollbar range. +func (handle HSCROLLBAR) SetRange(srange uint, visible uint) { + Scrollbar_set_range(handle, srange, visible) +} + +// Create a new scrollable Box to be packed. +func Scrollbox_new(btype int, pad int) HSCROLLBOX { + return HSCROLLBOX{C.go_scrollbox_new(C.int(btype), C.int(pad))} +} + +// Create a new scrollable Box to be packed. +func ScrollBoxNew(btype int, pad int) HSCROLLBOX { + return Scrollbox_new(btype, pad) +} + +// Returns the position of the scrollbar in the scrollbox. +func Scrollbox_get_pos(handle HANDLE) (int, int) { + return int(C.go_scrollbox_get_pos(handle.GetHandle(), C.int(C.DW_HORZ))), int(C.go_scrollbox_get_pos(handle.GetHandle(), C.int(C.DW_VERT))) +} + +// Returns the position of the scrollbar in the scrollbox. +func (handle HSCROLLBOX) GetPos() (int, int) { + return Scrollbox_get_pos(handle) +} + +// Gets the range for the scrollbar in the scrollbox. +func Scrollbox_get_range(handle HANDLE) (int, int) { + return int(C.go_scrollbox_get_range(handle.GetHandle(), C.int(C.DW_HORZ))), int(C.go_scrollbox_get_range(handle.GetHandle(), C.int(C.DW_VERT))) +} + +// Gets the range for the scrollbar in the scrollbox. +func (handle HSCROLLBOX) GetRange() (int, int) { + return Scrollbox_get_range(handle) +} + +// Create a new Group Box to be packed. +func Groupbox_new(btype C.int, pad int, title string) HBOX { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + return HBOX{C.go_groupbox_new(btype, C.int(pad), ctitle)} +} + +// Create a new Group Box to be packed. +func GroupboxNew(btype C.int, pad int, title string) HBOX { + return Groupbox_new(btype, pad, title) +} + +// Creates a rendering context widget to be packed. +func Render_new(id uint) HRENDER { + return HRENDER{C.go_render_new(C.ulong(id))} +} + +// Creates a rendering context widget to be packed. +func RenderNew(id uint) HRENDER { + return Render_new(id) +} + +// Allows the user to choose a font using the system's font chooser dialog. +func Font_choose(currfont string) string { + ccurrfont := C.CString(currfont) + defer C.free(unsafe.Pointer(ccurrfont)) + newfont := C.dw_font_choose(ccurrfont) + defer C.dw_free(unsafe.Pointer(newfont)) + return C.GoString(newfont) +} + +// Allows the user to choose a font using the system's font chooser dialog. +func FontChoose(currfont string) string { + return Font_choose(currfont) +} + +// Sets the default font used on text based widgets. +func Font_set_default(fontname string) { + cfontname := C.CString(fontname) + defer C.free(unsafe.Pointer(cfontname)) + C.dw_font_set_default(cfontname) +} + +// Sets the default font used on text based widgets. +func FontSetFefault(fontname string) { + Font_set_default(fontname) +} + +// Get the width and height of a text string. +func Font_text_extents_get(handle HANDLE, pixmap HPIXMAP, text string) (int, int) { + var width, height C.int + + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_font_text_extents_get(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), ctext, &width, &height) + return int(width), int(height) +} + +// Get the width and height of a text string. +func (pixmap HPIXMAP) GetTextExtents(text string) (int, int) { + return Font_text_extents_get(NOHWND, pixmap, text) +} + +// Creates a pixmap with given parameters. +func Pixmap_new(handle HANDLE, width uint, height uint, depth uint) HPIXMAP { + return HPIXMAP{C.go_pixmap_new(handle.GetHandle(), C.ulong(width), C.ulong(height), C.ulong(depth))} +} + +// Creates a pixmap with given parameters. +func PixmapNew(handle HANDLE, width uint, height uint, depth uint) HPIXMAP { + return Pixmap_new(handle, width, height, depth) +} + +// Creates a pixmap from a file. +func Pixmap_new_from_file(handle HANDLE, filename string) HPIXMAP { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + return HPIXMAP{C.go_pixmap_new_from_file(handle.GetHandle(), cfilename)} +} + +// Creates a pixmap from a file. +func PixmapNewFromFile(handle HANDLE, filename string) HPIXMAP { + return Pixmap_new_from_file(handle, filename) +} + +// Creates a pixmap from internal resource graphic specified by id. +func Pixmap_grab(handle HANDLE, id uint) HPIXMAP { + return HPIXMAP{C.go_pixmap_grab(handle.GetHandle(), C.ulong(id))} +} + +// Creates a pixmap from internal resource graphic specified by id. +func PixmapGrab(handle HANDLE, id uint) HPIXMAP { + return Pixmap_grab(handle, id) +} + +// Creates a pixmap from internal resource graphic specified by id. +func (window HRENDER) PixmapGrab(id uint) HPIXMAP { + return Pixmap_grab(window, id) +} + +// Copies from one surface to another. +func Pixmap_bitblt(dest HANDLE, destp HPIXMAP, xdest int, ydest int, width int, height int, src HANDLE, srcp HPIXMAP, xsrc int, ysrc int) { + C.go_pixmap_bitblt(dest.GetHandle(), unsafe.Pointer(destp.hpixmap), C.int(xdest), C.int(ydest), C.int(width), C.int(height), src.GetHandle(), unsafe.Pointer(srcp.hpixmap), C.int(xsrc), C.int(ysrc)) +} + +// Copies from one surface to another allowing for stretching. +func Pixmap_stretch_bitblt(dest HANDLE, destp HPIXMAP, xdest int, ydest int, width int, height int, src HANDLE, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { + return int(C.go_pixmap_stretch_bitblt(dest.GetHandle(), unsafe.Pointer(destp.hpixmap), C.int(xdest), C.int(ydest), C.int(width), C.int(height), src.GetHandle(), unsafe.Pointer(srcp.hpixmap), C.int(xsrc), C.int(ysrc), C.int(srcwidth), C.int(srcheight))) +} + +// Copies from one surface to another allowing for stretching. +func (window HRENDER) BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { + return Pixmap_stretch_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc, srcwidth, srcheight) +} + +// Copies from one surface to another allowing for stretching. +func (window HRENDER) BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int { + return Pixmap_stretch_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc, srcwidth, srcheight) +} + +// Copies from one surface to another allowing for stretching. +func (pixmap HPIXMAP) BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { + return Pixmap_stretch_bitblt(NOHWND, pixmap, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc, srcwidth, srcheight) +} + +// Copies from one surface to another allowing for stretching. +func (pixmap HPIXMAP) BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int { + return Pixmap_stretch_bitblt(NOHWND, pixmap, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc, srcwidth, srcheight) +} + +// Copies from one surface to another. +func (window HRENDER) BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) { + Pixmap_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc) +} + +// Copies from one surface to another. +func (window HRENDER) BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) { + Pixmap_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc) +} + +// Copies from one surface to another. +func (pixmap HPIXMAP) BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) { + Pixmap_bitblt(NOHWND, pixmap, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc) +} + +// Copies from one surface to another. +func (pixmap HPIXMAP) BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) { + Pixmap_bitblt(NOHWND, pixmap, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc) +} + +// Sets the transparent color for a pixmap. +func Pixmap_set_transparent_color(pixmap HPIXMAP, color COLOR) { + C.go_pixmap_set_transparent_color(unsafe.Pointer(pixmap.hpixmap), C.ulong(color)) +} + +// Sets the transparent color for a pixmap. +func (pixmap HPIXMAP) SetTransparentColor(color COLOR) { + Pixmap_set_transparent_color(pixmap, color) +} + +// Sets the font used by a specified pixmap. +func Pixmap_set_font(pixmap HPIXMAP, fontname string) int { + cfontname := C.CString(fontname) + defer C.free(unsafe.Pointer(cfontname)) + + return int(C.go_pixmap_set_font(unsafe.Pointer(pixmap.hpixmap), cfontname)) +} + +// Sets the font used by a specified pixmap. +func (pixmap HPIXMAP) SetFont(fontname string) int { + return Pixmap_set_font(pixmap, fontname) +} + +// Destroys an allocated pixmap. +func Pixmap_destroy(pixmap HPIXMAP) { + C.go_pixmap_destroy(unsafe.Pointer(pixmap.hpixmap)) +} + +// Destroys an allocated pixmap. +func (pixmap HPIXMAP) Destroy() { + Pixmap_destroy(pixmap) +} + +// Returns the width in pixels of the specified pixmap. +func Pixmap_width(pixmap HPIXMAP) int { + return int(C.go_pixmap_width(unsafe.Pointer(pixmap.hpixmap))) +} + +// Returns the width in pixels of the specified pixmap. +func (pixmap HPIXMAP) GetWidth() int { + return Pixmap_width(pixmap) +} + +// Returns the height in pixels of the specified pixmap. +func Pixmap_height(pixmap HPIXMAP) int { + return int(C.go_pixmap_height(unsafe.Pointer(pixmap.hpixmap))) +} + +// Returns the height in pixels of the specified pixmap. +func (pixmap HPIXMAP) GetHeight() int { + return Pixmap_height(pixmap) +} + +// Draw a point. +func Draw_point(handle HANDLE, pixmap HPIXMAP, x int, y int) { + C.go_draw_point(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x), C.int(y)) +} + +// Draw a point on a widget. +func (window HRENDER) DrawPoint(x int, y int) { + Draw_point(window, NOHPIXMAP, x, y) +} + +// Draw a point on a pixmap. +func (pixmap HPIXMAP) DrawPoint(x int, y int) { + Draw_point(NOHWND, pixmap, x, y) +} + +// Draw a line. +func Draw_line(handle HANDLE, pixmap HPIXMAP, x1 int, y1 int, x2 int, y2 int) { + C.go_draw_line(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x1), C.int(y1), C.int(x2), C.int(y2)) +} + +// Draw a line on a widget. +func (window HRENDER) DrawLine(x1 int, y1 int, x2 int, y2 int) { + Draw_line(window, NOHPIXMAP, x1, y1, x2, y2) +} + +// Draw a line on a pixmap. +func (pixmap HPIXMAP) DrawLine(x1 int, y1 int, x2 int, y2 int) { + Draw_line(NOHWND, pixmap, x1, y1, x2, y2) +} + +// Draw a polygon. +func Draw_polygon(handle HANDLE, pixmap HPIXMAP, flags int, x []int, y []int) { + count := len(x) + if len(y) < count { + count = len(y) + } + cx := make([]C.int, count) + cy := make([]C.int, count) + for n := 0; n < count; n++ { + cx[n] = C.int(x[n]) + cy[n] = C.int(y[n]) + } + xHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cx))) + yHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cy))) + + C.go_draw_polygon(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(flags), C.int(count), (*C.int)(unsafe.Pointer(xHeader.Data)), (*C.int)(unsafe.Pointer(yHeader.Data))) +} + +// Draw a polygon on a widget. +func (window HRENDER) DrawPolygon(flags int, x []int, y []int) { + Draw_polygon(window, NOHPIXMAP, flags, x, y) +} + +// Draw a polygon on a pixmap. +func (pixmap HPIXMAP) DrawPolygon(flags int, x []int, y []int) { + Draw_polygon(NOHWND, pixmap, flags, x, y) +} + +// Draw a rectangle. +func Draw_rect(handle HANDLE, pixmap HPIXMAP, fill int, x int, y int, width int, height int) { + C.go_draw_rect(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(fill), C.int(x), C.int(y), C.int(width), C.int(height)) +} + +// Draw a rectangle on a widget. +func (window HRENDER) DrawRect(fill int, x int, y int, width int, height int) { + Draw_rect(window, NOHPIXMAP, fill, x, y, width, height) +} + +// Draw a rectangle on a pixmap. +func (pixmap HPIXMAP) DrawRect(fill int, x int, y int, width int, height int) { + Draw_rect(NOHWND, pixmap, fill, x, y, width, height) +} + +// Draw an arc. +func Draw_arc(handle HANDLE, pixmap HPIXMAP, flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { + C.go_draw_arc(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(flags), C.int(xorigin), C.int(yorigin), C.int(x1), C.int(y1), C.int(x2), C.int(y2)) +} + +// Draw an arc on a widget. +func (window HRENDER) DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { + Draw_arc(window, NOHPIXMAP, flags, xorigin, yorigin, x1, y1, x2, y2) +} + +// Draw an arc on a pixmap. +func (pixmap HPIXMAP) DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { + Draw_arc(NOHWND, pixmap, flags, xorigin, yorigin, x1, y1, x2, y2) +} + +// Draw text. +func Draw_text(handle HANDLE, pixmap HPIXMAP, x int, y int, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_draw_text(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x), C.int(y), ctext) +} + +// Draw text on a widget. +func (window HRENDER) DrawText(x int, y int, text string) { + Draw_text(window, NOHPIXMAP, x, y, text) +} + +// Draw text on a pixmap. +func (pixmap HPIXMAP) DrawText(x int, y int, text string) { + Draw_text(NOHWND, pixmap, x, y, text) +} + +// Returns the current X and Y coordinates of the mouse pointer. +func Pointer_query_pos() (int, int) { + var x, y C.long + C.dw_pointer_query_pos(&x, &y) + return int(x), int(y) +} + +// Returns the current X and Y coordinates of the mouse pointer. +func PointerGetPos() (int, int) { + return Pointer_query_pos() +} + +// Sets the X and Y coordinates of the mouse pointer. +func Pointer_set_pos(x int, y int) { + C.dw_pointer_set_pos(C.long(x), C.long(y)) +} + +// Sets the X and Y coordinates of the mouse pointer. +func PointerSetPos(x int, y int) { + Pointer_set_pos(x, y) +} + +// Call this after drawing to the screen to make sure anything you have drawn is visible. +func Flush() { + C.dw_flush() +} + +// Create a tree widget to be packed. +func Tree_new(id uint) HTREE { + return HTREE{C.go_tree_new(C.ulong(id))} +} + +// Create a tree widget to be packed. +func TreeNew(id uint) HTREE { + return Tree_new(id) +} + +// Inserts an item into a tree widget. +func Tree_insert(handle HANDLE, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + return HTREEITEM{C.go_tree_insert(handle.GetHandle(), ctitle, unsafe.Pointer(icon), parent.htreeitem, unsafe.Pointer(itemdata)), handle} +} + +// Inserts an item into a tree widget. +func (handle HTREE) Insert(title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { + return Tree_insert(handle, title, icon, parent, itemdata) +} + +// Inserts an item into a tree widget after another item. +func Tree_insert_after(handle HANDLE, item HTREEITEM, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + return HTREEITEM{C.go_tree_insert_after(handle.GetHandle(), item.htreeitem, ctitle, unsafe.Pointer(icon), parent.htreeitem, unsafe.Pointer(itemdata)), handle} +} + +// Inserts an item into a tree widget after another item. +func (handle HTREE) InsertAfter(item HTREEITEM, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { + return Tree_insert_after(handle, item, title, icon, parent, itemdata) +} + +// Removes all nodes from a tree. +func Tree_clear(handle HANDLE) { + C.go_tree_clear(handle.GetHandle()) +} + +// Removes all nodes from a tree. +func (handle HTREE) Clear() { + Tree_clear(handle) +} + +// Removes a node from a tree. +func Tree_item_delete(handle HANDLE, item HTREEITEM) { + C.go_tree_item_delete(handle.GetHandle(), item.htreeitem) +} + +// Removes a node from a tree. +func (handle HTREEITEM) Delete() { + Tree_item_delete(handle.htree, handle) +} + +// Sets the text and icon of an item in a tree widget. +func Tree_item_change(handle HANDLE, item HTREEITEM, title string, icon HICN) { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + C.go_tree_item_change(handle.GetHandle(), item.htreeitem, ctitle, unsafe.Pointer(icon)) +} + +// Sets the text and icon of an item in a tree widget. +func (handle HTREEITEM) Change(title string, icon HICN) { + Tree_item_change(handle.htree, handle, title, icon) +} + +// Expands a node on a tree. +func Tree_item_expand(handle HANDLE, item HTREEITEM) { + C.go_tree_item_expand(handle.GetHandle(), item.htreeitem) +} + +// Expands a node on a tree. +func (handle HTREEITEM) Expand() { + Tree_item_expand(handle.htree, handle) +} + +// Collapses a node on a tree. +func Tree_item_collapse(handle HANDLE, item HTREEITEM) { + C.go_tree_item_collapse(handle.GetHandle(), item.htreeitem) +} + +// Collapses a node on a tree. +func (handle HTREEITEM) Collapse() { + Tree_item_collapse(handle.htree, handle) +} + +// Sets this item as the active selection. +func Tree_item_select(handle HANDLE, item HTREEITEM) { + C.go_tree_item_select(handle.GetHandle(), item.htreeitem) +} + +// Sets this item as the active selection. +func (handle HTREEITEM) Select() { + Tree_item_select(handle.htree, handle) +} + +// Sets the item data of a tree item. +func Tree_item_set_data(handle HANDLE, item HTREEITEM, itemdata POINTER) { + C.go_tree_item_set_data(handle.GetHandle(), item.htreeitem, unsafe.Pointer(itemdata)) +} + +// Sets the item data of a tree item. +func (handle HTREEITEM) SetData(itemdata POINTER) { + Tree_item_set_data(handle.htree, handle, itemdata) +} + +// Gets the item data of a tree item. +func Tree_item_get_data(handle HANDLE, item HTREEITEM) POINTER { + return POINTER(C.go_tree_item_get_data(handle.GetHandle(), item.htreeitem)) +} + +// Gets the item data of a tree item. +func (handle HTREEITEM) GetData() POINTER { + return Tree_item_get_data(handle.htree, handle) +} + +// Gets the text an item in a tree widget. +func Tree_get_title(handle HANDLE, item HTREEITEM) string { + ctitle := C.go_tree_get_title(handle.GetHandle(), item.htreeitem) + title := C.GoString(ctitle) + C.dw_free(unsafe.Pointer(ctitle)) + return title +} + +// Gets the text an item in a tree widget. +func (handle HTREEITEM) GetTitle() string { + return Tree_get_title(handle.htree, handle) +} + +// Create a new HTML widget to be packed. +func Html_new(id uint) HHTML { + return HHTML{C.go_html_new(C.ulong(id))} +} + +// Create a new HTML widget to be packed. +func HtmlNew(id uint) HHTML { + return Html_new(id) +} + +// Causes the embedded HTML widget to take action. +func Html_action(handle HANDLE, action int) { + C.go_html_action(handle.GetHandle(), C.int(action)) +} + +// Causes the embedded HTML widget to take action. +func (handle HHTML) Action(action int) { + Html_action(handle, action) +} + +// Render raw HTML code in the embedded HTML widget. +func Html_raw(handle HANDLE, code string) int { + ccode := C.CString(code) + defer C.free(unsafe.Pointer(ccode)) + + return int(C.go_html_raw(handle.GetHandle(), ccode)) +} + +// Render raw HTML code in the embedded HTML widget. +func (handle HHTML) Raw(code string) { + Html_raw(handle, code) +} + +// Render file or web page in the embedded HTML widget. +func Html_url(handle HANDLE, url string) int { + curl := C.CString(url) + defer C.free(unsafe.Pointer(curl)) + + return int(C.go_html_url(handle.GetHandle(), curl)) +} + +// Render file or web page in the embedded HTML widget. +func (handle HHTML) URL(url string) int { + return Html_url(handle, url) +} + +// Create a new Multiline Editbox widget to be packed. +func Mle_new(id uint) HMLE { + return HMLE{C.go_mle_new(C.ulong(id))} +} + +// Create a new Multiline Editbox widget to be packed. +func MLENew(id uint) HMLE { + return Mle_new(id) +} + +// Adds text to an MLE box and returns the current point. +func Mle_import(handle HANDLE, buffer string, startpoint int) int { + cbuffer := C.CString(buffer) + defer C.free(unsafe.Pointer(cbuffer)) + + return int(C.go_mle_import(handle.GetHandle(), cbuffer, C.int(startpoint))) +} + +// Adds text to an MLE box and returns the current point. +func (handle HMLE) Import(buffer string, startpoint int) int { + return Mle_import(handle, buffer, startpoint) +} + +// Grabs text from an MLE box. +func Mle_export(handle HANDLE, startpoint int, length int) string { + cbuf := C.calloc(1, C.size_t(length+1)) + C.go_mle_export(handle.GetHandle(), (*C.char)(cbuf), C.int(startpoint), C.int(length)) + buf := C.GoString((*C.char)(cbuf)) + C.free(cbuf) + return buf +} + +// Grabs text from an MLE box. +func (handle HMLE) Export(startpoint int, length int) string { + return Mle_export(handle, startpoint, length) +} + +// Obtains information about an MLE box. +func Mle_get_size(handle HANDLE) (int, int) { + var bytes, lines C.ulong + C.go_mle_get_size(handle.GetHandle(), &bytes, &lines) + return int(bytes), int(lines) +} + +// Obtains information about an MLE box. +func (handle HMLE) GetSize() (int, int) { + return Mle_get_size(handle) +} + +// Deletes text from an MLE box. +func Mle_delete(handle HANDLE, startpoint int, length int) { + C.go_mle_delete(handle.GetHandle(), C.int(startpoint), C.int(length)) +} + +// Deletes text from an MLE box. +func (handle HMLE) Delete(startpoint int, length int) { + Mle_delete(handle, startpoint, length) +} + +// Clears all text from an MLE box. +func Mle_clear(handle HANDLE) { + C.go_mle_clear(handle.GetHandle()) +} + +// Clears all text from an MLE box. +func (handle HMLE) Clear() { + Mle_clear(handle) +} + +// Stops redrawing of an MLE box. +func Mle_freeze(handle HANDLE) { + C.go_mle_freeze(handle.GetHandle()) +} + +// Stops redrawing of an MLE box. +func (handle HMLE) Freeze() { + Mle_freeze(handle) +} + +// Resumes redrawing of an MLE box. +func Mle_thaw(handle HANDLE) { + C.go_mle_thaw(handle.GetHandle()) +} + +// Resumes redrawing of an MLE box. +func (handle HMLE) Thaw() { + Mle_thaw(handle) +} + +// Sets the current cursor position of an MLE box. +func Mle_set_cursor(handle HANDLE, point int) { + C.go_mle_set_cursor(handle.GetHandle(), C.int(point)) +} + +// Sets the current cursor position of an MLE box. +func (handle HMLE) SetCursor(point int) { + Mle_set_cursor(handle, point) +} + +// Sets the visible line of an MLE box. +func Mle_set_visible(handle HANDLE, line int) { + C.go_mle_set_visible(handle.GetHandle(), C.int(line)) +} + +// Sets the visible line of an MLE box. +func (handle HMLE) SetVisible(line int) { + Mle_set_visible(handle, line) +} + +// Sets the editablity of an MLE box. +func Mle_set_editable(handle HANDLE, state int) { + C.go_mle_set_editable(handle.GetHandle(), C.int(state)) +} + +// Sets the editablity of an MLE box. +func (handle HMLE) SetEditable(state int) { + Mle_set_editable(handle, state) +} + +// Sets the word wrap state of an MLE box. +func Mle_set_word_wrap(handle HANDLE, state int) { + C.go_mle_set_word_wrap(handle.GetHandle(), C.int(state)) +} + +// Sets the word wrap state of an MLE box. +func (handle HMLE) SetWordWrap(state int) { + Mle_set_word_wrap(handle, state) +} + +// Finds text in an MLE box. +func Mle_search(handle HANDLE, text string, point int, flags uint) int { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return int(C.go_mle_search(handle.GetHandle(), ctext, C.int(point), C.ulong(flags))) +} + +// Finds text in an MLE box. +func (handle HMLE) Search(text string, point int, flags uint) int { + return Mle_search(handle, text, point, flags) +} + +// Create a container widget to be packed. +func Container_new(id uint, multi int) HCONTAINER { + return HCONTAINER{C.go_container_new(C.ulong(id), C.int(multi)), false} +} + +// Create a container widget to be packed. +func ContainerNew(id uint, multi int) HCONTAINER { + return Container_new(id, multi) +} + +// Sets up the container columns. +func Container_setup(handle HANDLE, flags []uint, titles []string, separator int) int { + count := len(flags) + if len(titles) < count { + count = len(titles) + } + + ctitles := C.go_string_array_make(C.int(len(titles))) + defer C.go_string_array_free(ctitles, C.int(len(titles))) + for i, s := range titles { + C.go_string_array_set(ctitles, C.CString(s), C.int(i)) + } + + cflags := make([]C.ulong, count) + for n := 0; n < count; n++ { + cflags[n] = C.ulong(flags[n]) + } + flagsHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cflags))) + return int(C.go_container_setup(handle.GetHandle(), (*C.ulong)(unsafe.Pointer(flagsHeader.Data)), ctitles, C.int(count), C.int(separator))) +} + +// Sets up the container columns. +func (handle HCONTAINER) Setup(flags []uint, titles []string, separator int) int { + return Container_setup(handle, flags, titles, separator) +} + +// Sets up the filesystem columns, note: filesystem always has an icon/filename field. +func Filesystem_setup(handle HANDLE, flags []uint, titles []string) int { + count := len(flags) + if len(titles) < count { + count = len(titles) + } + + ctitles := C.go_string_array_make(C.int(len(titles))) + defer C.go_string_array_free(ctitles, C.int(len(titles))) + for i, s := range titles { + C.go_string_array_set(ctitles, C.CString(s), C.int(i)) + } + + cflags := make([]C.ulong, count) + for n := 0; n < count; n++ { + cflags[n] = C.ulong(flags[n]) + } + flagsHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cflags))) + Window_set_data(handle, "_go_filesystem", POINTER(uintptr(1))) + return int(C.go_filesystem_setup(handle.GetHandle(), (*C.ulong)(unsafe.Pointer(flagsHeader.Data)), ctitles, C.int(count))) +} + +// Sets up the filesystem columns, note: filesystem always has an icon/filename field. +func (handle *HCONTAINER) FileSystemSetup(flags []uint, titles []string) int { + handle.filesystem = true + return Filesystem_setup(handle, flags, titles) +} + +// Allocates memory used to populate a container. +func Container_alloc(handle HANDLE, rowcount int) HCONTINS { + return HCONTINS{C.go_container_alloc(handle.GetHandle(), C.int(rowcount)), rowcount, handle, false} +} + +// Allocates memory used to populate a container. +func (handle *HCONTAINER) Alloc(rowcount int) HCONTINS { + contins := Container_alloc(handle, rowcount) + contins.filesystem = handle.filesystem + return contins +} + +// Sets an item in specified row and column to the given data. +func Container_set_item(handle HANDLE, contins HCONTINS, column int, row int, data POINTER) { + C.go_container_set_item(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(data)) +} + +// Sets an item in specified row and column to the given data. +func (handle HCONTINS) SetItem(column int, row int, data POINTER) { + if handle.filesystem == true { + Filesystem_set_item(handle.hcont, handle, column, row, data) + } + Container_set_item(handle.hcont, handle, column, row, data) +} + +// Sets an item in specified row and column to the given unsigned integer. +func Container_set_item_ulong(handle HANDLE, contins HCONTINS, column int, row int, val uint) { + C.go_container_set_item_ulong(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.ulong(val)) +} + +// Sets an item in specified row and column to the given unsigned integer. +func (handle HCONTINS) SetItemULong(column int, row int, val uint) { + if handle.filesystem == true { + Filesystem_set_item_ulong(handle.hcont, handle, column, row, val) + } + Container_set_item_ulong(handle.hcont, handle, column, row, val) +} + +// Sets an item in specified row and column to the given icon. +func Container_set_item_icon(handle HANDLE, contins HCONTINS, column int, row int, icon HICN) { + C.go_container_set_item_icon(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(icon)) +} + +// Sets an item in specified row and column to the given icon. +func (handle HCONTINS) SetItemIcon(column int, row int, icon HICN) { + if handle.filesystem == true { + Filesystem_set_item_icon(handle.hcont, handle, column, row, icon) + } + Container_set_item_icon(handle.hcont, handle, column, row, icon) +} + +// Sets an item in specified row and column to the given time. +func Container_set_item_time(handle HANDLE, contins HCONTINS, column int, row int, seconds int, minutes int, hours int) { + C.go_container_set_item_time(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) +} + +// Sets an item in specified row and column to the given time. +func (handle HCONTINS) SetItemTime(column int, row int, seconds int, minutes int, hours int) { + if handle.filesystem == true { + Filesystem_set_item_time(handle.hcont, handle, column, row, seconds, minutes, hours) + } + Container_set_item_time(handle.hcont, handle, column, row, seconds, minutes, hours) +} + +// Sets an item in specified row and column to the given date. +func Container_set_item_date(handle HANDLE, contins HCONTINS, column int, row int, day int, month int, year int) { + C.go_container_set_item_date(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) +} + +// Sets an item in specified row and column to the given date. +func (handle HCONTINS) SetItemDate(column int, row int, day int, month int, year int) { + if handle.filesystem == true { + Filesystem_set_item_date(handle.hcont, handle, column, row, day, month, year) + } + Container_set_item_date(handle.hcont, handle, column, row, day, month, year) +} + +// Changes an existing item in specified row and column to the given data. +func Container_change_item(handle HANDLE, column int, row int, data POINTER) { + C.go_container_change_item(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(data)) +} + +// Changes an existing item in specified row and column to the given data. +func (handle HCONTAINER) ChangeItem(column int, row int, data POINTER) { + if handle.filesystem == true { + Filesystem_change_item(handle, column, row, data) + } + Container_change_item(handle, column, row, data) +} + +// Changes an existing item in specified row and column to the given unsigned integer. +func Container_change_item_ulong(handle HANDLE, column int, row int, val uint) { + C.go_container_change_item_ulong(handle.GetHandle(), C.int(column), C.int(row), C.ulong(val)) +} + +// Changes an existing item in specified row and column to the given unsigned integer. +func (handle HCONTAINER) ChangeItemULong(column int, row int, val uint) { + if handle.filesystem == true { + Filesystem_change_item_ulong(handle, column, row, val) + } + Container_change_item_ulong(handle, column, row, val) +} + +// Changes an existing item in specified row and column to the given icon. +func Container_change_item_icon(handle HANDLE, column int, row int, icon HICN) { + C.go_container_change_item_icon(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(icon)) +} + +// Changes an existing item in specified row and column to the given icon. +func (handle HCONTAINER) ChangeItemIcon(column int, row int, icon HICN) { + if handle.filesystem == true { + Filesystem_change_item_icon(handle, column, row, icon) + } + Container_change_item_icon(handle, column, row, icon) +} + +// Changes an existing item in specified row and column to the given time. +func Container_change_item_time(handle HANDLE, column int, row int, seconds int, minutes int, hours int) { + C.go_container_change_item_time(handle.GetHandle(), C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) +} + +// Changes an existing item in specified row and column to the given time. +func (handle HCONTAINER) ChangeItemTime(column int, row int, seconds int, minutes int, hours int) { + if handle.filesystem == true { + Filesystem_change_item_time(handle, column, row, seconds, minutes, hours) + } + Container_change_item_time(handle, column, row, seconds, minutes, hours) +} + +// Changes an existing item in specified row and column to the given date. +func Container_change_item_date(handle HANDLE, column int, row int, day int, month int, year int) { + C.go_container_change_item_date(handle.GetHandle(), C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) +} + +// Changes an existing item in specified row and column to the given date. +func (handle HCONTAINER) ChangeItemDate(column int, row int, day int, month int, year int) { + if handle.filesystem == true { + Filesystem_change_item_date(handle, column, row, day, month, year) + } + Container_change_item_date(handle, column, row, day, month, year) +} + +// Sets the width of a column in the container. +func Container_set_column_width(handle HANDLE, column int, width int) { + C.go_container_set_column_width(handle.GetHandle(), C.int(column), C.int(width)) +} + +// Sets the width of a column in the container. +func (handle HCONTAINER) SetColumnWidth(column int, width int) { + Container_set_column_width(handle, column, width) +} + +// Sets the title of a row in the container. +func Container_set_row_title(contins HCONTINS, row int, title string) { + ctitle := C.CString(title) + C.dw_container_set_row_title(contins.ptr, C.int(row), ctitle) + defer C.free(unsafe.Pointer(ctitle)) +} + +// Sets the title of a row in the container. +func (handle HCONTINS) SetRowTitle(row int, title string) { + Container_set_row_title(handle, row, title) +} + +// Sets the pointer of a row in the container. +func Container_set_row_data(contins HCONTINS, row int, data POINTER) { + C.dw_container_set_row_data(contins.ptr, C.int(row), unsafe.Pointer(data)) +} + +// Sets the pointer of a row in the container. +func (handle HCONTINS) SetRowData(row int, data POINTER) { + Container_set_row_data(handle, row, data) +} + +// Sets the title of a row in the container. +func Container_change_row_title(handle HANDLE, row int, title string) { + ctitle := C.CString(title) + C.go_container_change_row_title(handle.GetHandle(), C.int(row), ctitle) +} + +// Sets the title of a row in the container. +func (handle HCONTAINER) ChangeRowTitle(row int, title string) { + Container_change_row_title(handle, row, title) +} + +// Sets the pointer of a row in the container. +func Container_change_row_data(handle HANDLE, row int, data unsafe.Pointer) { + C.go_container_change_row_data(handle.GetHandle(), C.int(row), data) +} + +// Sets the pointer of a row in the container. +func (handle HCONTAINER) ChangeRowData(row int, data POINTER) { + Container_change_row_data(handle, row, unsafe.Pointer(data)) +} + +// Inserts allocated rows into the container widget. +func Container_insert(handle HANDLE, contins HCONTINS, rowcount int) { + C.go_container_insert(handle.GetHandle(), contins.ptr, C.int(rowcount)) + contins.ptr = nil + contins.rowcount = 0 +} + +// Inserts allocated rows into the container widget. +func (handle HCONTINS) Insert() { + Container_insert(handle.hcont, handle, handle.rowcount) +} + +// Removes all rows from a container. +func Container_clear(handle HANDLE, redraw int) { + C.go_container_clear(handle.GetHandle(), C.int(redraw)) +} + +// Removes all rows from a container. +func (handle HCONTAINER) Clear(redraw int) { + Container_clear(handle, redraw) +} + +// Removes the first x rows from a container. +func Container_delete(handle HANDLE, rowcount int) { + C.go_container_delete(handle.GetHandle(), C.int(rowcount)) +} + +// Removes the first x rows from a container. +func (handle HCONTAINER) Delete(rowcount int) { + Container_delete(handle, rowcount) +} + +// Starts a new query of a container. +func Container_query_start(handle HANDLE, flags uint) string { + cresult := C.go_container_query_start(handle.GetHandle(), C.ulong(flags)&^C.DW_CR_RETDATA) + result := C.GoString(cresult) + defer C.dw_free(unsafe.Pointer(cresult)) + return result +} + +func Container_query_start_data(handle HANDLE, flags uint) POINTER { + cresult := C.go_container_query_start(handle.GetHandle(), C.ulong(flags)|C.DW_CR_RETDATA) + return POINTER(cresult) +} + +// Starts a new query of a container. +func (handle HCONTAINER) QueryStart(flags uint) string { + return Container_query_start(handle, flags) +} + +// Continues an existing query of a container. +func Container_query_next(handle HANDLE, flags uint) string { + cresult := C.go_container_query_next(handle.GetHandle(), C.ulong(flags)&^C.DW_CR_RETDATA) + result := C.GoString(cresult) + defer C.dw_free(unsafe.Pointer(cresult)) + return result +} + +func Container_query_next_data(handle HANDLE, flags uint) POINTER { + cresult := C.go_container_query_next(handle.GetHandle(), C.ulong(flags)|C.DW_CR_RETDATA) + return POINTER(cresult) +} + +// Continues an existing query of a container. +func (handle HCONTAINER) QueryNext(flags uint) string { + return Container_query_next(handle, flags) +} + +// Scrolls container up or down. +func Container_scroll(handle HANDLE, direction int, rows int) { + C.go_container_scroll(handle.GetHandle(), C.int(direction), C.long(rows)) +} + +// Scrolls container up or down. +func (handle HCONTAINER) Scroll(direction int, rows int) { + Container_scroll(handle, direction, rows) +} + +// Cursors the item with the title speficied, and scrolls to that item. +func Container_cursor(handle HANDLE, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_container_cursor(handle.GetHandle(), ctext) +} + +// Cursors the item with the title speficied, and scrolls to that item. +func (handle HCONTAINER) Cursor(text string) { + Container_cursor(handle, text) +} + +// Cursors the item with the data speficied, and scrolls to that item. +func Container_cursor_by_data(handle HANDLE, data POINTER) { + C.go_container_cursor_by_data(handle.GetHandle(), unsafe.Pointer(data)) +} + +// Cursors the item with the data speficied, and scrolls to that item. +func (handle HCONTAINER) CursorByData(data POINTER) { + Container_cursor_by_data(handle, data) +} + +// Deletes the item with the title specified. +func Container_delete_row(handle HANDLE, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + C.go_container_delete_row(handle.GetHandle(), ctext) +} + +// Deletes the item with the title specified. +func (handle HCONTAINER) DeleteRow(text string) { + Container_delete_row(handle, text) +} + +// Deletes the item with the data specified. +func Container_delete_row_by_data(handle HANDLE, data POINTER) { + C.go_container_delete_row_by_data(handle.GetHandle(), unsafe.Pointer(data)) +} + +// Deletes the item with the data specified. +func (handle HCONTAINER) DeleteRowByData(data POINTER) { + Container_delete_row_by_data(handle, data) +} + +// Optimizes the column widths so that all data is visible. +func Container_optimize(handle HANDLE) { + C.go_container_optimize(handle.GetHandle()) +} + +// Optimizes the column widths so that all data is visible. +func (handle HCONTAINER) Optimize() { + Container_optimize(handle) +} + +// Sets the alternating row colors for container widget handle. +func Container_set_stripe(handle HANDLE, oddcolor COLOR, evencolor COLOR) { + C.go_container_set_stripe(handle.GetHandle(), C.ulong(oddcolor), C.ulong(evencolor)) +} + +// Sets the alternating row colors for container widget handle. +func (handle HCONTAINER) SetStripe(oddcolor COLOR, evencolor COLOR) { + Container_set_stripe(handle, oddcolor, evencolor) +} + +// Gets column type for a container column. +func Container_get_column_type(handle HANDLE, column int) uint { + return uint(C.go_container_get_column_type(handle.GetHandle(), C.int(column))) +} + +// Gets column type for a container column. +func (handle HCONTAINER) GetColumnType(column int) uint { + if handle.filesystem == true { + return Filesystem_get_column_type(handle, column) + } + return Container_get_column_type(handle, column) +} + +// Gets column type for a filesystem container column. +func Filesystem_get_column_type(handle HANDLE, column int) uint { + return uint(C.go_filesystem_get_column_type(handle.GetHandle(), C.int(column))) +} + +// Configures the main filesystem column title for localization. +func Filesystem_set_column_title(handle HANDLE, title string) { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + + C.go_filesystem_set_column_title(handle.GetHandle(), ctitle) +} + +// Configures the main filesystem column title for localization. +func (handle HCONTAINER) SetColumnTitle(title string) { + Filesystem_set_column_title(handle, title) +} + +// Sets an item in specified row and column to the given data. +func Filesystem_set_item(handle HANDLE, contins HCONTINS, column int, row int, data POINTER) { + C.go_filesystem_set_item(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(data)) +} + +// Sets an item in specified row and column to the given unsigned integer. +func Filesystem_set_item_ulong(handle HANDLE, contins HCONTINS, column int, row int, val uint) { + C.go_filesystem_set_item_ulong(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.ulong(val)) +} + +// Sets an item in specified row and column to the given icon. +func Filesystem_set_item_icon(handle HANDLE, contins HCONTINS, column int, row int, icon HICN) { + C.go_filesystem_set_item_icon(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(icon)) +} + +// Sets an item in specified row and column to the given time. +func Filesystem_set_item_time(handle HANDLE, contins HCONTINS, column int, row int, seconds int, minutes int, hours int) { + C.go_filesystem_set_item_time(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) +} + +// Sets an item in specified row and column to the given date. +func Filesystem_set_item_date(handle HANDLE, contins HCONTINS, column int, row int, day int, month int, year int) { + C.go_filesystem_set_item_date(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) +} + +// Sets the filename and icon of the row in a filesystem style container. +func Filesystem_set_file(handle HANDLE, contins HCONTINS, row int, filename string, icon HICN) { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + C.go_filesystem_set_file(handle.GetHandle(), contins.ptr, C.int(row), cfilename, unsafe.Pointer(icon)) +} + +// Sets the filename and icon of the row in a filesystem style container. +func (handle HCONTINS) SetFile(row int, filename string, icon HICN) { + if handle.filesystem == true { + Filesystem_set_file(handle.hcont, handle, row, filename, icon) + } +} + +// Changes an existing item in specified row and column to the given data. +func Filesystem_change_item(handle HANDLE, column int, row int, data POINTER) { + C.go_filesystem_change_item(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(data)) +} + +// Changes an existing item in specified row and column to the given unsigned integer. +func Filesystem_change_item_ulong(handle HANDLE, column int, row int, val uint) { + C.go_filesystem_change_item_ulong(handle.GetHandle(), C.int(column), C.int(row), C.ulong(val)) +} + +// Changes an existing item in specified row and column to the given icon. +func Filesystem_change_item_icon(handle HANDLE, column int, row int, icon HICN) { + C.go_filesystem_change_item_icon(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(icon)) +} + +// Changes an existing item in specified row and column to the given time. +func Filesystem_change_item_time(handle HANDLE, column int, row int, seconds int, minutes int, hours int) { + C.go_filesystem_change_item_time(handle.GetHandle(), C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) +} + +// Changes an existing item in specified row and column to the given date. +func Filesystem_change_item_date(handle HANDLE, column int, row int, day int, month int, year int) { + C.go_filesystem_change_item_date(handle.GetHandle(), C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) +} + +// Changes the filename and icon of the row in a filesystem style container. +func Filesystem_change_file(handle HANDLE, row int, filename string, icon HICN) { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + C.go_filesystem_change_file(handle.GetHandle(), C.int(row), cfilename, unsafe.Pointer(icon)) +} + +// Changes the filename and icon of the row in a filesystem style container. +func (handle HCONTAINER) ChangeFile(row int, filename string, icon HICN) { + if handle.filesystem == true { + Filesystem_change_file(handle, row, filename, icon) + } +} + +// Create a new calendar widget to be packed. +func Calendar_new(id uint) HCALENDAR { + return HCALENDAR{C.go_calendar_new(C.ulong(id))} +} + +// Create a new calendar widget to be packed. +func CalendarNew(id uint) HCALENDAR { + return Calendar_new(id) +} + +// Sets the current date of a calendar. +func Calendar_set_date(handle HANDLE, year uint, month uint, day uint) { + C.go_calendar_set_date(handle.GetHandle(), C.uint(year), C.uint(month), C.uint(day)) +} + +// Sets the current date of a calendar. +func (handle HCALENDAR) SetDate(year uint, month uint, day uint) { + Calendar_set_date(handle, year, month, day) +} + +// Gets the year, month and day set in the calendar widget. +func Calendar_get_date(handle HANDLE) (uint, uint, uint) { + var year, month, day C.uint + + C.go_calendar_get_date(handle.GetHandle(), &year, &month, &day) + return uint(year), uint(month), uint(day) +} + +// Gets the year, month and day set in the calendar widget. +func (handle HCALENDAR) GetDate() (uint, uint, uint) { + return Calendar_get_date(handle) +} + +// Create a bitmap widget to be packed. +func Bitmap_new(id uint) HBITMAP { + return HBITMAP{C.go_bitmap_new(C.ulong(id))} +} + +// Create a bitmap widget to be packed. +func BitmapNew(id uint) HBITMAP { + return Bitmap_new(id) +} + +// Create a new bitmap button widget to be packed. +func Bitmapbutton_new(text string, id uint) HBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + + return HBUTTON{C.go_bitmapbutton_new(ctext, C.ulong(id))} +} + +// Create a new bitmap button widget to be packed. +func BitmapButtonNew(text string, id uint) HBUTTON { + return Bitmapbutton_new(text, id) +} + +// Create a new bitmap button widget to be packed from a file. +func Bitmapbutton_new_from_file(text string, id uint, filename string) HBUTTON { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + return HBUTTON{C.go_bitmapbutton_new_from_file(ctext, C.ulong(id), cfilename)} +} + +// Create a new bitmap button widget to be packed from a file. +func BitmapButtonNewFromFile(text string, id uint, filename string) HBUTTON { + return Bitmapbutton_new_from_file(text, id, filename) +} + +// Creates a splitbar widget with given widgets on either side. +func Splitbar_new(btype int, topleft HWND, bottomright HWND, id uint) HSPLITBAR { + return HSPLITBAR{C.go_splitbar_new(C.int(btype), unsafe.Pointer(topleft.hwnd), unsafe.Pointer(bottomright.hwnd), C.ulong(id))} +} + +// Creates a splitbar widget with given widgets on either side. +func SplitbarNew(btype int, topleft HWND, bottomright HWND, id uint) HSPLITBAR { + return Splitbar_new(btype, topleft, bottomright, id) +} + +// Sets the position of a splitbar (pecentage). +func Splitbar_set(handle HANDLE, position float32) { + C.go_splitbar_set(handle.GetHandle(), C.float(position)) +} + +// Sets the position of a splitbar (pecentage). +func (handle HSPLITBAR) Set(position float32) { + Splitbar_set(handle, position) +} + +// Gets the position of a splitbar (pecentage). +func Splitbar_get(handle HANDLE) float32 { + return float32(C.go_splitbar_get(handle.GetHandle())) +} + +// Gets the position of a splitbar (pecentage). +func (handle HSPLITBAR) Get() float32 { + return Splitbar_get(handle) +} + +// Creates a new print object. +func PrintNew(jobname string) HPRINT { + return HPRINT{nil, jobname} +} + +// Creates a new print object. +func Print_new(jobname string, flags uint, pages uint, drawfunc SIGNAL_FUNC, drawdata POINTER) HPRINT { + backs = append(backs, unsafe.Pointer(drawfunc)) + cjobname := C.CString(jobname) + defer C.free(unsafe.Pointer(cjobname)) + + return HPRINT{C.go_print_new(cjobname, C.ulong(flags), C.uint(pages), unsafe.Pointer(drawfunc), unsafe.Pointer(drawdata), 0), jobname} +} + +// Runs the print job, causing the draw page callbacks to fire. +func Print_run(print HPRINT, flags uint) int { + if print.hprint != nil { + return int(C.go_print_run(unsafe.Pointer(print.hprint), C.ulong(flags))) + } + return C.DW_ERROR_UNKNOWN +} + +// Runs the print job, causing the draw page callbacks to fire. +func (print HPRINT) Run(flags uint) { + Print_run(print, flags) +} + +// Cancels the print job, typically called from a draw page callback. +func Print_cancel(print HPRINT) { + if print.hprint != nil { + C.go_print_cancel(unsafe.Pointer(print.hprint)) + } +} + +// Cancels the print job, typically called from a draw page callback. +func (print HPRINT) Cancel() { + Print_cancel(print) +} + +func init() { + runtime.LockOSThread() +} + +// Creates a new mutex semaphore. +func Mutex_new() HMTX { + return HMTX{C.go_mutex_new()} +} + +// Creates a new mutex semaphore. +func MutexNew() HMTX { + return Mutex_new() +} + +// Closes a semaphore created by Mutex_new(). +func Mutex_close(handle HMTX) { + C.go_mutex_close(unsafe.Pointer(handle.hmtx)) +} + +// Closes a semaphore created by MutexNew(). +func (handle HMTX) Close() { + Mutex_close(handle) +} + +// Tries to gain access to the semaphore, if it can't it blocks. +func Mutex_lock(handle HMTX) { + C.go_mutex_lock(unsafe.Pointer(handle.hmtx)) +} + +// Tries to gain access to the semaphore, if it can't it blocks. +func (handle HMTX) Lock() { + Mutex_lock(handle) +} + +// Reliquishes the access to the semaphore. +func Mutex_unlock(handle HMTX) { + C.go_mutex_unlock(unsafe.Pointer(handle.hmtx)) +} + +// Reliquishes the access to the semaphore. +func (handle HMTX) Unlock() { + Mutex_unlock(handle) +} + +// Tries to gain access to the semaphore. +func Mutex_trylock(handle HMTX) int { + return int(C.go_mutex_trylock(unsafe.Pointer(handle.hmtx))) +} + +// Tries to gain access to the semaphore. +func (handle HMTX) TryLock() int { + return Mutex_trylock(handle) +} + +// Allocates and initializes a dialog. +func Dialog_new() HDIALOG { + return HDIALOG{C.go_dialog_new()} +} + +// Allocates and initializes a dialog. +func DialogNew() HDIALOG { + return Dialog_new() +} + +// Accepts a dialog and returns the given data to the initial call of Dialog_wait(). +func Dialog_dismiss(handle HDIALOG, result POINTER) int { + return int(C.go_dialog_dismiss(unsafe.Pointer(handle.hdialog), unsafe.Pointer(result))) +} + +// Returns the given data to the initial call of Wait(). +func (handle HDIALOG) Dismiss(result uintptr) int { + return Dialog_dismiss(handle, POINTER(result)) +} + +// Accepts a dialog, waits for Dialog_dismiss() to be called by a signal handler with the given dialog. +func Dialog_wait(handle HDIALOG) POINTER { + return POINTER(C.go_dialog_wait(unsafe.Pointer(handle.hdialog))) +} + +// Waits for Dismiss() to be called by a signal handler. +func (handle HDIALOG) Wait() uintptr { + return uintptr(Dialog_wait(handle)) +} + +// Creates an unnamed event semaphore. +func Event_new() HEV { + return HEV{C.go_event_new()} +} + +// Creates an unnamed event semaphore. +func EventNew() HEV { + return Event_new() +} + +// Closes a semaphore created by Event_new(). +func Event_close(handle *HEV) int { + retval := int(C.go_event_close(unsafe.Pointer(handle.hev))) + handle.hev = nil + return retval +} + +// Closes a semaphore created by EventNew(). +func (handle *HEV) Close() int { + return Event_close(handle) +} + +// Posts a semaphore created by Event_new(). Causing all threads waiting on this event in Event_wait() to continue. +func Event_post(handle HEV) int { + return int(C.go_event_post(unsafe.Pointer(handle.hev))) +} + +// Posts a semaphore created by EventNew(). Causing all threads waiting on this event in Wait() to continue. +func (handle HEV) Post() int { + return Event_post(handle) +} + +// Resets a semaphore created by Event_new(). +func Event_reset(handle HEV) int { + return int(C.go_event_reset(unsafe.Pointer(handle.hev))) +} + +// Resets a semaphore created by EventNew(). +func (handle HEV) Reset() int { + return Event_reset(handle) +} + +// Waits on a semaphore created by Event_new(), until the event gets posted or until the timeout expires. +func Event_wait(handle HEV, timeout int) int { + return int(C.go_event_wait(unsafe.Pointer(handle.hev), C.ulong(timeout))) +} + +// Waits on a semaphore created by EventNew(), until the event gets posted or until the timeout expires. +func (handle HEV) Wait(timeout int) int { + return Event_wait(handle, timeout) +} + +var go_flags_no_data C.uint = 1 + +// Connect a function or closure to a window close (delete) event. +func (window HWND) ConnectDelete(sigfunc func(window HWND) int) { + csigname := C.CString(C.DW_SIGNAL_DELETE) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a widget clicked event. +func (window HBUTTON) ConnectClicked(sigfunc func(window HBUTTON) int) { + csigname := C.CString(C.DW_SIGNAL_CLICKED) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a focus clicked event. +func (window HWND) ConnectSetFocus(sigfunc func(window HWND) int) { + csigname := C.CString(C.DW_SIGNAL_SET_FOCUS) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a key press event. +func (window HWND) ConnectKeyPress(sigfunc func(window HWND, ch uint8, vk int, state int, utf8 string) int) { + csigname := C.CString(C.DW_SIGNAL_KEY_PRESS) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a key press event. +func (window HRENDER) ConnectKeyPress(sigfunc func(window HRENDER, ch uint8, vk int, state int, utf8 string) int) { + csigname := C.CString(C.DW_SIGNAL_KEY_PRESS) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a mouse motion event. +func (window HRENDER) ConnectMotion(sigfunc func(window HRENDER, x int, y int, mask int) int) { + csigname := C.CString(C.DW_SIGNAL_MOTION_NOTIFY) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a mouse button press event. +func (window HRENDER) ConnectButtonPress(sigfunc func(window HRENDER, x int, y int, mask int) int) { + csigname := C.CString(C.DW_SIGNAL_BUTTON_PRESS) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a mouse button release event. +func (window HRENDER) ConnectButtonRelease(sigfunc func(window HRENDER, x int, y int, mask int) int) { + csigname := C.CString(C.DW_SIGNAL_BUTTON_RELEASE) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a render expose event. +func (window HRENDER) ConnectExpose(sigfunc func(window HRENDER, x int, y int, width int, height int) int) { + csigname := C.CString(C.DW_SIGNAL_EXPOSE) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a configure (size change) event. +func (window HRENDER) ConnectConfigure(sigfunc func(window HRENDER, width int, height int) int) { + csigname := C.CString(C.DW_SIGNAL_CONFIGURE) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a tree ENTER/RETURN press event. +func (window HTREE) ConnectItemEnter(sigfunc func(window HTREE, str string, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_ENTER) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a container ENTER/RETURN press event. +func (window HCONTAINER) ConnectItemEnter(sigfunc func(window HCONTAINER, str string, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_ENTER) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a tree context event. +func (window HTREE) ConnectItemContext(sigfunc func(window HTREE, text string, x int, y int, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_CONTEXT) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a container context event. +func (window HCONTAINER) ConnectItemContext(sigfunc func(window HCONTAINER, text string, x int, y int, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_CONTEXT) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a tree select event. +func (window HTREE) ConnectItemSelect(sigfunc func(window HTREE, item HTREEITEM, text string, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_SELECT) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a container select event. +func (window HCONTAINER) ConnectItemSelect(sigfunc func(window HCONTAINER, item HTREEITEM, text string, itemdata POINTER) int) { + csigname := C.CString(C.DW_SIGNAL_ITEM_SELECT) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a listbox select event. +func (window HLISTBOX) ConnectListSelect(sigfunc func(window HLISTBOX, index int) int) { + csigname := C.CString(C.DW_SIGNAL_LIST_SELECT) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a value changed event. +func (window HSCROLLBAR) ConnectValueChanged(sigfunc func(window HSCROLLBAR, index int) int) { + csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a value changed event. +func (window HSLIDER) ConnectValueChanged(sigfunc func(window HSLIDER, index int) int) { + csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a value changed event. +func (window HSPINBUTTON) ConnectValueChanged(sigfunc func(window HSPINBUTTON, index int) int) { + csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a column title click event. +func (window HCONTAINER) ConnectColumnClick(sigfunc func(window HCONTAINER, index int) int) { + csigname := C.CString(C.DW_SIGNAL_COLUMN_CLICK) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a notebook switch page event. +func (window HNOTEBOOK) ConnectSwitchPage(sigfunc func(window HNOTEBOOK, pageid HNOTEPAGE) int) { + csigname := C.CString(C.DW_SIGNAL_SWITCH_PAGE) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a tree item (node) expand event. +func (window HTREE) ConnectTreeExpand(sigfunc func(window HTREE, item HTREEITEM) int) { + csigname := C.CString(C.DW_SIGNAL_TREE_EXPAND) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a menu item clicked event. +func (window HMENUITEM) ConnectClicked(sigfunc func(window HMENUITEM) int) { + csigname := C.CString(C.DW_SIGNAL_CLICKED) + defer C.free(unsafe.Pointer(csigname)) + + backs = append(backs, unsafe.Pointer(&sigfunc)) + C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) +} + +// Connect a function or closure to a timer event. +func (id *HTIMER) Connect(sigfunc func() int, interval int) { + if id.tid == 0 { + backs = append(backs, unsafe.Pointer(&sigfunc)) + id.tid = C.go_timer_connect(C.int(interval), unsafe.Pointer(&sigfunc), nil, go_flags_no_data) + } +} + +// Disconnect an active timer event. +func (id HTIMER) Disconnect() { + if id.tid > 0 { + C.dw_timer_disconnect(C.int(id.tid)) + } +} + +// Connect a function or closure to a print object draw page event. +func (print HPRINT) Connect(drawfunc func(HPRINT, HPIXMAP, int) int, flags uint, pages int) { + if print.hprint == nil { + backs = append(backs, unsafe.Pointer(&drawfunc)) + cjobname := C.CString(print.jobname) + defer C.free(unsafe.Pointer(cjobname)) + + print.hprint = C.go_print_new(cjobname, C.ulong(flags), C.uint(pages), unsafe.Pointer(&drawfunc), nil, go_flags_no_data) + } +} + +//export go_callback_remove +func go_callback_remove(pfunc unsafe.Pointer) { + // Scan through the callback function pointer list... + for i, p := range backs { + // When we find the pointer of the function + // we are removing... + if p == pfunc { + // Remove it from the callback list... + // So it can be garbage collected if not used + backs = append(backs[:i], backs[i+1:]...) + //delete(backs, i); + return + } + } +} + +//export go_int_callback_basic +func go_int_callback_basic(pfunc unsafe.Pointer, window unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, POINTER) int)(pfunc) + return C.int(thisfunc(HWND{window}, POINTER(data))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, POINTER) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, POINTER(data))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, POINTER) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, POINTER(data))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, POINTER(data))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, POINTER(data))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, POINTER) int)(pfunc) + return C.int(thisfunc(HMLE{window}, POINTER(data))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, POINTER) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, POINTER(data))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, POINTER) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, POINTER(data))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, POINTER) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, POINTER(data))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, POINTER) int)(pfunc) + return C.int(thisfunc(HBOX{window}, POINTER(data))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, POINTER(data))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, POINTER) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, POINTER(data))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, POINTER) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, POINTER(data))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, POINTER) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, POINTER(data))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, POINTER) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, POINTER(data))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, POINTER(data))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, POINTER) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, POINTER(data))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, POINTER) int)(pfunc) + return C.int(thisfunc(HHTML{window}, POINTER(data))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, POINTER) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, POINTER(data))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, POINTER) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, POINTER(data))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, POINTER) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE) int)(pfunc) + return C.int(thisfunc(HGENERIC{window})) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND) int)(pfunc) + return C.int(thisfunc(HWND{window})) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window})) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT) int)(pfunc) + return C.int(thisfunc(HTEXT{window})) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE) int)(pfunc) + return C.int(thisfunc(HTREE{window})) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem})) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE) int)(pfunc) + return C.int(thisfunc(HMLE{window})) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON) int)(pfunc) + return C.int(thisfunc(HBUTTON{window})) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window})) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window})) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX) int)(pfunc) + return C.int(thisfunc(HBOX{window})) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window})) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window})) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window})) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT) int)(pfunc) + return C.int(thisfunc(HPERCENT{window})) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER) int)(pfunc) + return C.int(thisfunc(HSLIDER{window})) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window})) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER) int)(pfunc) + return C.int(thisfunc(HRENDER{window})) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML) int)(pfunc) + return C.int(thisfunc(HHTML{window})) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window})) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP) int)(pfunc) + return C.int(thisfunc(HBITMAP{window})) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window})) + } + thisfunc := *(*func(HANDLE, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, POINTER(data))) +} + +//export go_int_callback_configure +func go_int_callback_configure(pfunc unsafe.Pointer, window unsafe.Pointer, width C.int, height C.int, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HWND{window}, int(width), int(height), POINTER(data))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(width), int(height), POINTER(data))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(width), int(height), POINTER(data))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(width), int(height), POINTER(data))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, int, int, POINTER) C.int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(width), int(height), POINTER(data))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(width), int(height), POINTER(data))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(width), int(height), POINTER(data))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(width), int(height), POINTER(data))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(width), int(height), POINTER(data))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(width), int(height), POINTER(data))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(width), int(height), POINTER(data))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(width), int(height), POINTER(data))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(width), int(height), POINTER(data))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(width), int(height), POINTER(data))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(width), int(height), POINTER(data))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(width), int(height), POINTER(data))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(width), int(height), POINTER(data))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(width), int(height), POINTER(data))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(width), int(height), POINTER(data))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(width), int(height), POINTER(data))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(width), int(height), POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, int, int) C.int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(width), int(height))) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND, int, int) C.int)(pfunc) + return C.int(thisfunc(HWND{window}, int(width), int(height))) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int, int) C.int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(width), int(height))) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT, int, int) C.int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(width), int(height))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, int, int) C.int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(width), int(height))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, int, int) C.int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(width), int(height))) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE, int, int) C.int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(width), int(height))) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON, int, int) C.int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(width), int(height))) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int, int) C.int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(width), int(height))) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int, int) C.int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(width), int(height))) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX, int, int) C.int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(width), int(height))) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int, int) C.int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(width), int(height))) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM, int, int) C.int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(width), int(height))) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX, int, int) C.int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(width), int(height))) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT, int, int) C.int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(width), int(height))) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER, int, int) C.int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(width), int(height))) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int, int) C.int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(width), int(height))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, int, int) C.int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(width), int(height))) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML, int, int) C.int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(width), int(height))) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR, int, int) C.int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(width), int(height))) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP, int, int) C.int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(width), int(height))) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int, int) C.int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(width), int(height))) + } + thisfunc := *(*func(HANDLE, int, int, POINTER) C.int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(width), int(height), POINTER(data))) +} + +//export go_int_callback_keypress +func go_int_callback_keypress(pfunc unsafe.Pointer, window unsafe.Pointer, ch C.char, vk C.int, state C.int, data unsafe.Pointer, utf8 *C.char, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HWND{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HTREE{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, uint8, int, int, POINTER, string) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HMLE{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HHTML{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HWND{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HTREE{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, uint8, int, int, string) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HMLE{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HHTML{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, uint8, int, int, string) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) + } + thisfunc := *(*func(HANDLE, uint8, int, int, POINTER, string) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) +} + +//export go_int_callback_mouse +func go_int_callback_mouse(pfunc unsafe.Pointer, window unsafe.Pointer, x C.int, y C.int, mask C.int, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HWND{window}, int(x), int(y), int(mask), POINTER(data))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(x), int(y), int(mask), POINTER(data))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(x), int(y), int(mask), POINTER(data))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(x), int(y), int(mask), POINTER(data))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, int, int, int, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(x), int(y), int(mask), POINTER(data))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(x), int(y), int(mask), POINTER(data))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(x), int(y), int(mask), POINTER(data))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(x), int(y), int(mask), POINTER(data))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(x), int(y), int(mask), POINTER(data))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(x), int(y), int(mask), POINTER(data))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(x), int(y), int(mask), POINTER(data))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(x), int(y), int(mask), POINTER(data))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(x), int(y), int(mask), POINTER(data))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(x), int(y), int(mask), POINTER(data))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(x), int(y), int(mask), POINTER(data))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(x), int(y), int(mask), POINTER(data))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(mask), POINTER(data))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(x), int(y), int(mask), POINTER(data))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(x), int(y), int(mask), POINTER(data))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(x), int(y), int(mask), POINTER(data))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(x), int(y), int(mask), POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, int, int, int) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(mask))) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND, int, int, int) int)(pfunc) + return C.int(thisfunc(HWND{window}, int(x), int(y), int(mask))) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int, int, int) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(x), int(y), int(mask))) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT, int, int, int) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(x), int(y), int(mask))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, int, int, int) int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(x), int(y), int(mask))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, int, int, int) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(x), int(y), int(mask))) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE, int, int, int) int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(x), int(y), int(mask))) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON, int, int, int) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(x), int(y), int(mask))) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int, int, int) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(x), int(y), int(mask))) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int, int, int) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(x), int(y), int(mask))) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX, int, int, int) int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(x), int(y), int(mask))) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int, int, int) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(x), int(y), int(mask))) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM, int, int, int) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(x), int(y), int(mask))) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX, int, int, int) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(x), int(y), int(mask))) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT, int, int, int) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(x), int(y), int(mask))) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER, int, int, int) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(x), int(y), int(mask))) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int, int, int) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(x), int(y), int(mask))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, int, int, int) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(mask))) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML, int, int, int) int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(x), int(y), int(mask))) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR, int, int, int) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(x), int(y), int(mask))) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP, int, int, int) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(x), int(y), int(mask))) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int, int, int) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(x), int(y), int(mask))) + } + thisfunc := *(*func(HANDLE, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(mask), POINTER(data))) +} + +//export go_int_callback_expose +func go_int_callback_expose(pfunc unsafe.Pointer, window unsafe.Pointer, x C.int, y C.int, width C.int, height C.int, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, int, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(width), int(height), POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, int, int, int, int) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(width), int(height))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, int, int, int, int) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(width), int(height))) + } + thisfunc := *(*func(HANDLE, int, int, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(width), int(height), POINTER(data))) +} + +//export go_int_callback_item_enter +func go_int_callback_item_enter(pfunc unsafe.Pointer, window unsafe.Pointer, text *C.char, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, string, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, C.GoString(text), POINTER(data), POINTER(itemdata))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, string, POINTER, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), POINTER(data), POINTER(itemdata))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, string, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, C.GoString(text), POINTER(itemdata))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, string, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, C.GoString(text), POINTER(itemdata))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, string, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), POINTER(itemdata))) + } + thisfunc := *(*func(HANDLE, string, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, C.GoString(text), POINTER(data), POINTER(itemdata))) +} + +//export go_int_callback_item_context +func go_int_callback_item_context(pfunc unsafe.Pointer, window unsafe.Pointer, text *C.char, x C.int, y C.int, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, string, int, int, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, string, int, int, POINTER, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, string, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, C.GoString(text), int(x), int(y), POINTER(itemdata))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, string, int, int, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, C.GoString(text), int(x), int(y), POINTER(itemdata))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, string, int, int, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), int(x), int(y), POINTER(itemdata))) + } + thisfunc := *(*func(HANDLE, string, int, int, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) +} + +//export go_int_callback_item_select +func go_int_callback_item_select(pfunc unsafe.Pointer, window unsafe.Pointer, item unsafe.Pointer, text *C.char, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, HTREEITEM, string, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, HTREEITEM, string, POINTER, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, HTREEITEM, string, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, HTREEITEM, string, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, HTREEITEM, string, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) + } + thisfunc := *(*func(HANDLE, HTREEITEM, string, POINTER, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) +} + +//export go_int_callback_numeric +func go_int_callback_numeric(pfunc unsafe.Pointer, window unsafe.Pointer, val C.int, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, int, POINTER) int)(pfunc) + return C.int(thisfunc(HWND{window}, int(val), POINTER(data))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int, POINTER) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(val), POINTER(data))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, int, POINTER) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(val), POINTER(data))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, int, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(val), POINTER(data))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, int, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(val), POINTER(data))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, int, POINTER) int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(val), POINTER(data))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(val), POINTER(data))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(val), POINTER(data))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int, POINTER) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(val), POINTER(data))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(val), POINTER(data))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(val), POINTER(data))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, int, POINTER) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(val), POINTER(data))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, int, POINTER) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(val), POINTER(data))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, int, POINTER) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(val), POINTER(data))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(val), POINTER(data))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(val), POINTER(data))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, int, POINTER) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(val), POINTER(data))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, int, POINTER) int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(val), POINTER(data))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, int, POINTER) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(val), POINTER(data))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, int, POINTER) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(val), POINTER(data))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int, POINTER) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(val), POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, int) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(val))) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND, int) int)(pfunc) + return C.int(thisfunc(HWND{window}, int(val))) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, int) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, int(val))) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT, int) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, int(val))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, int) int)(pfunc) + return C.int(thisfunc(HTREE{window}, int(val))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, int) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, int(val))) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE, int) int)(pfunc) + return C.int(thisfunc(HMLE{window}, int(val))) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON, int) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, int(val))) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, int) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, int(val))) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, int) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, int(val))) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX, int) int)(pfunc) + return C.int(thisfunc(HBOX{window}, int(val))) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, int) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, int(val))) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM, int) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, int(val))) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX, int) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, int(val))) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT, int) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, int(val))) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER, int) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, int(val))) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, int) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, int(val))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, int) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, int(val))) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML, int) int)(pfunc) + return C.int(thisfunc(HHTML{window}, int(val))) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR, int) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, int(val))) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP, int) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, int(val))) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, int) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, int(val))) + } + thisfunc := *(*func(HANDLE, int, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, int(val), POINTER(data))) +} + +//export go_int_callback_ulong +func go_int_callback_ulong(pfunc unsafe.Pointer, window unsafe.Pointer, val C.ulong, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (1 << 8): // HWND + thisfunc := *(*func(HWND, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HWND{window}, uint(val), POINTER(data))) + case (2 << 8): // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, uint(val), POINTER(data))) + case (3 << 8): // HTEXT + thisfunc := *(*func(HTEXT, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, uint(val), POINTER(data))) + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, uint(val), POINTER(data))) + case (5 << 8): // HCONTAINER + thisfunc := *(*func(HCONTAINER, uint, POINTER) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, uint(val), POINTER(data))) + case (6 << 8): // HMLE + thisfunc := *(*func(HMLE, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HMLE{window}, uint(val), POINTER(data))) + case (7 << 8): // HBUTTON + thisfunc := *(*func(HBUTTON, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, uint(val), POINTER(data))) + case (8 << 8): // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, uint(val), POINTER(data))) + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, uint(val), POINTER(data))) + case (10 << 8): // HBOX + thisfunc := *(*func(HBOX, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HBOX{window}, uint(val), POINTER(data))) + case (11 << 8): // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, uint(val), POINTER(data))) + case (12 << 8): // HMENUITEM + thisfunc := *(*func(HMENUITEM, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, uint(val), POINTER(data))) + case (13 << 8): // HLISTBOX + thisfunc := *(*func(HLISTBOX, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, uint(val), POINTER(data))) + case (14 << 8): // HPERCENT + thisfunc := *(*func(HPERCENT, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, uint(val), POINTER(data))) + case (15 << 8): // HSLIDER + thisfunc := *(*func(HSLIDER, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, uint(val), POINTER(data))) + case (16 << 8): // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, uint(val), POINTER(data))) + case (17 << 8): // HRENDER + thisfunc := *(*func(HRENDER, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, uint(val), POINTER(data))) + case (18 << 8): // HHTML + thisfunc := *(*func(HHTML, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HHTML{window}, uint(val), POINTER(data))) + case (19 << 8): // HCALENDAR + thisfunc := *(*func(HCALENDAR, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, uint(val), POINTER(data))) + case (20 << 8): // HBITMAP + thisfunc := *(*func(HBITMAP, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, uint(val), POINTER(data))) + case (21 << 8): // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, uint(val), POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, uint) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, uint(val))) + case (1 << 8) | go_flags_no_data: // HWND + thisfunc := *(*func(HWND, uint) int)(pfunc) + return C.int(thisfunc(HWND{window}, uint(val))) + case (2 << 8) | go_flags_no_data: // HENTRYFIELD + thisfunc := *(*func(HENTRYFIELD, uint) int)(pfunc) + return C.int(thisfunc(HENTRYFIELD{window}, uint(val))) + case (3 << 8) | go_flags_no_data: // HTEXT + thisfunc := *(*func(HTEXT, uint) int)(pfunc) + return C.int(thisfunc(HTEXT{window}, uint(val))) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, uint) int)(pfunc) + return C.int(thisfunc(HTREE{window}, uint(val))) + case (5 << 8) | go_flags_no_data: // HCONTAINER + thisfunc := *(*func(HCONTAINER, uint) int)(pfunc) + filesystem := false + if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { + filesystem = true + } + return C.int(thisfunc(HCONTAINER{window, filesystem}, uint(val))) + case (6 << 8) | go_flags_no_data: // HMLE + thisfunc := *(*func(HMLE, uint) int)(pfunc) + return C.int(thisfunc(HMLE{window}, uint(val))) + case (7 << 8) | go_flags_no_data: // HBUTTON + thisfunc := *(*func(HBUTTON, uint) int)(pfunc) + return C.int(thisfunc(HBUTTON{window}, uint(val))) + case (8 << 8) | go_flags_no_data: // HSPINBUTTON + thisfunc := *(*func(HSPINBUTTON, uint) int)(pfunc) + return C.int(thisfunc(HSPINBUTTON{window}, uint(val))) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, uint) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, uint(val))) + case (10 << 8) | go_flags_no_data: // HBOX + thisfunc := *(*func(HBOX, uint) int)(pfunc) + return C.int(thisfunc(HBOX{window}, uint(val))) + case (11 << 8) | go_flags_no_data: // HSCROLLBOX + thisfunc := *(*func(HSCROLLBOX, uint) int)(pfunc) + return C.int(thisfunc(HSCROLLBOX{window}, uint(val))) + case (12 << 8) | go_flags_no_data: // HMENUITEM + thisfunc := *(*func(HMENUITEM, uint) int)(pfunc) + return C.int(thisfunc(HMENUITEM{window}, uint(val))) + case (13 << 8) | go_flags_no_data: // HLISTBOX + thisfunc := *(*func(HLISTBOX, uint) int)(pfunc) + return C.int(thisfunc(HLISTBOX{window}, uint(val))) + case (14 << 8) | go_flags_no_data: // HPERCENT + thisfunc := *(*func(HPERCENT, uint) int)(pfunc) + return C.int(thisfunc(HPERCENT{window}, uint(val))) + case (15 << 8) | go_flags_no_data: // HSLIDER + thisfunc := *(*func(HSLIDER, uint) int)(pfunc) + return C.int(thisfunc(HSLIDER{window}, uint(val))) + case (16 << 8) | go_flags_no_data: // HSCROLLBAR + thisfunc := *(*func(HSCROLLBAR, uint) int)(pfunc) + return C.int(thisfunc(HSCROLLBAR{window}, uint(val))) + case (17 << 8) | go_flags_no_data: // HRENDER + thisfunc := *(*func(HRENDER, uint) int)(pfunc) + return C.int(thisfunc(HRENDER{window}, uint(val))) + case (18 << 8) | go_flags_no_data: // HHTML + thisfunc := *(*func(HHTML, uint) int)(pfunc) + return C.int(thisfunc(HHTML{window}, uint(val))) + case (19 << 8) | go_flags_no_data: // HCALENDAR + thisfunc := *(*func(HCALENDAR, uint) int)(pfunc) + return C.int(thisfunc(HCALENDAR{window}, uint(val))) + case (20 << 8) | go_flags_no_data: // HBITMAP + thisfunc := *(*func(HBITMAP, uint) int)(pfunc) + return C.int(thisfunc(HBITMAP{window}, uint(val))) + case (21 << 8) | go_flags_no_data: // HSPLITBAR + thisfunc := *(*func(HSPLITBAR, uint) int)(pfunc) + return C.int(thisfunc(HSPLITBAR{window}, uint(val))) + } + thisfunc := *(*func(HANDLE, uint, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, uint(val), POINTER(data))) +} + +//export go_int_callback_notepage +func go_int_callback_notepage(pfunc unsafe.Pointer, window unsafe.Pointer, val C.ulong, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (9 << 8): // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, HNOTEPAGE, POINTER) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, HNOTEPAGE{val, HNOTEBOOK{window}}, POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, HNOTEPAGE) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HNOTEPAGE{val, HNOTEBOOK{window}})) + case (9 << 8) | go_flags_no_data: // HNOTEBOOK + thisfunc := *(*func(HNOTEBOOK, HNOTEPAGE) int)(pfunc) + return C.int(thisfunc(HNOTEBOOK{window}, HNOTEPAGE{val, HNOTEBOOK{window}})) + } + thisfunc := *(*func(HANDLE, HNOTEPAGE, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HNOTEPAGE{val, HNOTEBOOK{window}}, POINTER(data))) +} + +//export go_int_callback_tree +func go_int_callback_tree(pfunc unsafe.Pointer, window unsafe.Pointer, tree unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { + switch flags { + case (4 << 8): // HTREE + thisfunc := *(*func(HTREE, HTREEITEM, POINTER) int)(pfunc) + return C.int(thisfunc(HTREE{window}, HTREEITEM{tree, HWND{window}}, POINTER(data))) + case go_flags_no_data: + thisfunc := *(*func(HANDLE, HTREEITEM) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HTREEITEM{tree, HWND{window}})) + case (4 << 8) | go_flags_no_data: // HTREE + thisfunc := *(*func(HTREE, HTREEITEM) int)(pfunc) + return C.int(thisfunc(HTREE{window}, HTREEITEM{tree, HWND{window}})) + } + thisfunc := *(*func(HANDLE, HTREEITEM, POINTER) int)(pfunc) + return C.int(thisfunc(HGENERIC{window}, HTREEITEM{tree, HWND{window}}, POINTER(data))) +} + +//export go_int_callback_timer +func go_int_callback_timer(pfunc unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { + if (flags & go_flags_no_data) == go_flags_no_data { + thisfunc := *(*func() int)(pfunc) + return C.int(thisfunc()) + } + thisfunc := *(*func(POINTER) int)(pfunc) + return C.int(thisfunc(POINTER(data))) +} + +//export go_int_callback_print +func go_int_callback_print(pfunc unsafe.Pointer, print unsafe.Pointer, pixmap unsafe.Pointer, page_num C.int, data unsafe.Pointer, flags C.uint) C.int { + if (flags & go_flags_no_data) == go_flags_no_data { + thisfunc := *(*func(HPRINT, HPIXMAP, int) int)(pfunc) + return C.int(thisfunc(HPRINT{print, ""}, HPIXMAP{pixmap}, int(page_num))) + } + thisfunc := *(*func(HPRINT, HPIXMAP, int, POINTER) int)(pfunc) + return C.int(thisfunc(HPRINT{print, ""}, HPIXMAP{pixmap}, int(page_num), POINTER(data))) +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dw/dwglue.c Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,1422 @@ +#include <dw.h> +#include <stdlib.h> +#include <string.h> + +static int go_init(int newthread, int argc, char *argv[]) +{ + return dw_init(newthread, argc, argv); +} + +static int go_messagebox(char *title, int flags, char *message) +{ + return dw_messagebox(title, flags, message); +} + +static void *go_window_new(void *owner, char *title, unsigned long flags) +{ + return (void *)dw_window_new((HWND)owner, title, flags); +} + +static int go_window_show(void *handle) +{ + return dw_window_show((HWND)handle); +} + +static int go_window_hide(void *handle) +{ + return dw_window_hide((HWND)handle); +} + +static int go_window_lower(void *handle) +{ + return dw_window_lower((HWND)handle); +} + +static int go_window_raise(void *handle) +{ + return dw_window_raise((HWND)handle); +} + +static int go_window_minimize(void *handle) +{ + return dw_window_minimize((HWND)handle); +} + +static void go_window_set_pos(void *handle, long x, long y) +{ + dw_window_set_pos((HWND)handle, x, y); +} + +static void go_window_set_pos_size(void *handle, long x, long y, unsigned long width, unsigned long height) +{ + dw_window_set_pos_size((HWND)handle, x, y, width, height); +} + +static void go_window_set_size(void *handle, unsigned long width, unsigned long height) +{ + dw_window_set_size((HWND)handle, width, height); +} + +static int go_window_set_color(void *handle, unsigned long fore, unsigned long back) +{ + return dw_window_set_color((HWND)handle, fore, back); +} + +static void go_window_set_style(void *handle, unsigned long style, unsigned long mask) +{ + dw_window_set_style((HWND)handle, style, mask); +} + +static void go_window_click_default(void *window, void *next) +{ + dw_window_click_default((HWND)window, (HWND)next); +} + +static void go_window_default(void *window, void *defaultitem) +{ + dw_window_default((HWND)window, (HWND)defaultitem); +} + +static int go_window_destroy(void *handle) +{ + return dw_window_destroy((HWND)handle); +} + +static void go_window_disable(void *handle) +{ + dw_window_disable((HWND)handle); +} + +static void go_window_enable(void *handle) +{ + dw_window_enable((HWND)handle); +} + +static void *go_window_from_id(void *handle, int id) +{ + return dw_window_from_id((HWND)handle, id); +} + +static void *go_window_get_data(void *handle, char *dataname) +{ + return dw_window_get_data((HWND)handle, dataname); +} + +static void go_window_set_data(void *handle, char *dataname, void *data) +{ + dw_window_set_data((HWND)handle, dataname, data); +} + +static char *go_window_get_font(void *handle) +{ + return dw_window_get_font((HWND)handle); +} + +static int go_window_set_font(void *handle, char *fontname) +{ + return dw_window_set_font((HWND)handle, fontname); +} + +static void go_window_get_pos_size(void *handle, long *x, long *y, unsigned long *width, unsigned long *height) +{ + dw_window_get_pos_size((HWND)handle, x, y, width, height); +} + +static void go_window_get_preferred_size(void *handle, int *width, int *height) +{ + dw_window_get_preferred_size((HWND)handle, width, height); +} + +static char *go_window_get_text(void *handle) +{ + return dw_window_get_text((HWND)handle); +} + +static void go_window_set_text(void *handle, char *text) +{ + dw_window_set_text((HWND)handle, text); +} + +static void go_window_set_tooltip(void *handle, char *bubbletext) +{ + dw_window_set_tooltip((HWND)handle, bubbletext); +} + +static void go_window_redraw(void *handle) +{ + dw_window_redraw((HWND)handle); +} + +static void go_window_capture(void *handle) +{ + dw_window_capture((HWND)handle); +} + +static void go_window_set_bitmap(void *handle, unsigned long cid, char *filename) +{ + dw_window_set_bitmap((HWND)handle, cid, filename); +} + +static int go_window_set_border(void *handle, int border) +{ + return dw_window_set_border((HWND)handle, border); +} + +static void go_window_set_focus(void *handle) +{ + dw_window_set_focus((HWND)handle); +} + +static void go_window_set_gravity(void *handle, int horz, int vert) +{ + dw_window_set_gravity((HWND)handle, horz, vert); +} + +static void go_window_set_icon(void *handle, void *icon) +{ + dw_window_set_icon((HWND)handle, (HICN)icon); +} + +static void go_window_set_pointer(void *handle, int cursortype) +{ + dw_window_set_pointer((HWND)handle, cursortype); +} + +static void *go_box_new(int type, int pad) +{ + return (void *)dw_box_new(type, pad); +} + +static void go_box_pack_at_index(void *box, void *item, int index, int width, int height, int hsize, int vsize, int pad) +{ + dw_box_pack_at_index((HWND)box, (HWND)item, index, width, height, hsize, vsize, pad); +} + +static void go_box_pack_end(void *box, void *item, int width, int height, int hsize, int vsize, int pad) +{ + dw_box_pack_end((HWND)box, (HWND)item, width, height, hsize, vsize, pad); +} + +static void go_box_pack_start(void *box, void *item, int width, int height, int hsize, int vsize, int pad) +{ + dw_box_pack_start((HWND)box, (HWND)item, width, height, hsize, vsize, pad); +} + +static int go_box_unpack(void *handle) +{ + return dw_box_unpack((HWND)handle); +} + +static void *go_box_unpack_at_index(void *handle, int index) +{ + return (void *)dw_box_unpack_at_index((HWND)handle, index); +} + +static void *go_text_new(char *text, unsigned long id) +{ + return (void *)dw_text_new(text, id); +} + +static void *go_status_text_new(char *text, unsigned long id) +{ + return (void *)dw_status_text_new(text, id); +} + +static void *go_entryfield_new(char *text, unsigned long id) +{ + return (void *)dw_entryfield_new(text, id); +} + +static void *go_entryfield_password_new(char *text, unsigned long id) +{ + return (void *)dw_entryfield_password_new(text, id); +} + +static void go_entryfield_set_limit(void *handle, int limit) +{ + dw_entryfield_set_limit((HWND)handle, limit); +} + +static void *go_button_new(char *text, unsigned long id) +{ + return (void *)dw_button_new(text, id); +} + +static void *go_menu_new(unsigned long cid) +{ + return (void *)dw_menu_new(cid); +} + +static void *go_menubar_new(void *location) +{ + return (void *)dw_menubar_new((HWND)location); +} + +static void *go_menu_append_item(void *menu, char *title, unsigned long id, unsigned long flags, int end, int check, void *submenu) +{ + return dw_menu_append_item((HMENUI)menu, title, id, flags, end, check, submenu); +} + +static int go_menu_delete_item(void *menu, unsigned long cid) +{ + return dw_menu_delete_item((HMENUI)menu, cid); +} + +static void go_menu_destroy(void *menu) +{ + HMENUI thismenu = (HMENUI)menu; + dw_menu_destroy(&thismenu); +} + +static void go_menu_item_set_state(void *menu, unsigned long cid, unsigned long flags) +{ + dw_menu_item_set_state((HMENUI)menu, cid, flags); +} + +static void go_menu_popup(void *menu, void *parent, int x, int y) +{ + HMENUI thismenu = (HMENUI)menu; + dw_menu_popup(&thismenu, (HWND)parent, x, y); +} + +static void *go_notebook_new(unsigned long cid, int top) +{ + return (void *)dw_notebook_new(cid, top); +} + +static void go_notebook_pack(void *handle, unsigned long pageid, void *page) +{ + dw_notebook_pack((HWND)handle, pageid, (HWND)page); +} + +static void go_notebook_page_destroy(void *handle, unsigned long pageid) +{ + dw_notebook_page_destroy((HWND)handle, (unsigned int)pageid); +} + +static unsigned long go_notebook_page_get(void *handle) +{ + return dw_notebook_page_get((HWND)handle); +} + +static unsigned long go_notebook_page_new(void *handle, unsigned long flags, int front) +{ + return dw_notebook_page_new((HWND)handle, flags, front); +} + +static void go_notebook_page_set(void *handle, unsigned long pageid) +{ + dw_notebook_page_set((HWND)handle, (unsigned int)pageid); +} + +static void go_notebook_page_set_text(void *handle, unsigned long pageid, char *text) +{ + dw_notebook_page_set_text((HWND)handle, pageid, text); +} + +static void *go_icon_load_from_file(char *filename) +{ + return (void *)dw_icon_load_from_file(filename); +} + +static void *go_icon_load(unsigned long module, unsigned long cid) +{ + return (void *)dw_icon_load(module, cid); +} + +static void go_taskbar_delete(void *handle, void *icon) +{ + dw_taskbar_delete((HWND)handle, (HICN)icon); +} + +static void go_taskbar_insert(void *handle, void *icon, char *bubbletext) +{ + dw_taskbar_insert((HWND)handle, (HICN)icon, bubbletext); +} + +static void *go_combobox_new(char *text, unsigned long id) +{ + return (void *)dw_combobox_new(text, id); +} + +static void *go_listbox_new(unsigned long id, int multi) +{ + return (void *)dw_listbox_new(id, multi); +} + +static void go_listbox_append(void *handle, char *text) +{ + dw_listbox_append((HWND)handle, text); +} + +static void go_listbox_list_append(void *handle, char **text, int count) +{ + dw_listbox_list_append((HWND)handle, text, count); +} + +static void go_listbox_insert(void *handle, char *text, int pos) +{ + dw_listbox_insert((HWND)handle, text, pos); +} + +static void go_listbox_clear(void *handle) +{ + dw_listbox_clear((HWND)handle); +} + +static int go_listbox_count(void *handle) +{ + return dw_listbox_count((HWND)handle); +} + +static void go_listbox_set_top(void *handle, int top) +{ + dw_listbox_set_top((HWND)handle, top); +} + +static void go_listbox_select(void *handle, int index, int state) +{ + dw_listbox_select((HWND)handle, index, state); +} + +static void go_listbox_delete(void *handle, int index) +{ + dw_listbox_delete((HWND)handle, index); +} + +static void go_listbox_get_text(void *handle, int index, char *text, int length) +{ + dw_listbox_get_text((HWND)handle, index, text, length); +} + +static void go_listbox_set_text(void *handle, int index, char *text) +{ + dw_listbox_set_text((HWND)handle, index, text); +} + +static int go_listbox_selected(void *handle) +{ + return dw_listbox_selected((HWND)handle); +} + +static int go_listbox_selected_multi(void *handle, int where) +{ + return dw_listbox_selected_multi((HWND)handle, where); +} + +static void *go_spinbutton_new(char *text, unsigned long id) +{ + return (void *)dw_spinbutton_new(text, id); +} + +static void go_spinbutton_set_pos(void *handle, long position) +{ + dw_spinbutton_set_pos((HWND)handle, position); +} +static void go_spinbutton_set_limits(void *handle, long upper, long lower) +{ + dw_spinbutton_set_limits((HWND)handle, upper, lower); +} + +static long go_spinbutton_get_pos(void *handle) +{ + return dw_spinbutton_get_pos((HWND)handle); +} + +static void *go_radiobutton_new(char *text, unsigned long id) +{ + return (void *)dw_radiobutton_new(text, id); +} + +static void *go_checkbox_new(char *text, unsigned long id) +{ + return (void *)dw_checkbox_new(text, id); +} + +static int go_checkbox_get(void *handle) +{ + return dw_checkbox_get((HWND)handle); +} + +static void go_checkbox_set(void *handle, int value) +{ + return dw_checkbox_set((HWND)handle, value); +} + +static void *go_percent_new(unsigned long id) +{ + return (void *)dw_percent_new(id); +} + +static void go_percent_set_pos(void *handle, unsigned int position) +{ + dw_percent_set_pos((HWND)handle, position); +} + +static void *go_slider_new(int vertical, int increments, unsigned long id) +{ + return (void *)dw_slider_new(vertical, increments, id); +} + +static unsigned int go_slider_get_pos(void *handle) +{ + return dw_slider_get_pos((HWND)handle); +} + +static void go_slider_set_pos(void *handle, unsigned int pos) +{ + dw_slider_set_pos((HWND)handle, pos); +} + +static void *go_scrollbar_new(int vertical, unsigned long id) +{ + return (void *)dw_scrollbar_new(vertical, id); +} + +static unsigned int go_scrollbar_get_pos(void *handle) +{ + return dw_scrollbar_get_pos((HWND)handle); +} + +static void go_scrollbar_set_pos(void *handle, unsigned int pos) +{ + dw_scrollbar_set_pos((HWND)handle, pos); +} + +static void go_scrollbar_set_range(void *handle, unsigned int range, unsigned int visible) +{ + dw_scrollbar_set_range((HWND)handle, range, visible); +} + +static void *go_scrollbox_new(int type, int pad) +{ + return (void *)dw_scrollbox_new(type, pad); +} + +static int go_scrollbox_get_pos(void *handle, int orient) +{ + return dw_scrollbox_get_pos((HWND)handle, orient); +} + +static int go_scrollbox_get_range(void *handle, int orient) +{ + return dw_scrollbox_get_range((HWND)handle, orient); +} + +static void *go_groupbox_new(int type, int pad, char *title) +{ + return (void *)dw_groupbox_new(type, pad, title); +} + +static void *go_render_new(unsigned long id) +{ + return (void *)dw_render_new(id); +} + +static void go_font_text_extents_get(void *handle, void *pixmap, char *text, int *width, int *height) +{ + dw_font_text_extents_get((HWND)handle, (HPIXMAP)pixmap, text, width, height); +} + +static void *go_pixmap_new(void *handle, unsigned long width, unsigned long height, unsigned long depth) +{ + return (void *)dw_pixmap_new((HWND)handle, width, height, (int)depth); +} + +static void *go_pixmap_new_from_file(void *handle, char *filename) +{ + return (void *)dw_pixmap_new_from_file((HWND)handle, filename); +} + +static void *go_pixmap_grab(void *handle, unsigned long cid) +{ + return (void *)dw_pixmap_grab((HWND)handle, cid); +} + +static void go_pixmap_bitblt(void *dest, void *destp, int xdest, int ydest, int width, int height, void *src, void *srcp, int xsrc, int ysrc) +{ + dw_pixmap_bitblt((HWND)dest, (HPIXMAP)destp, xdest, ydest, width, height, (HWND)src, (HPIXMAP)srcp, xsrc, ysrc); +} + +static int go_pixmap_stretch_bitblt(void *dest, void *destp, int xdest, int ydest, int width, int height, void *src, void *srcp, int xsrc, int ysrc, int srcwidth, int srcheight) +{ + return dw_pixmap_stretch_bitblt((HWND)dest, (HPIXMAP)destp, xdest, ydest, width, height, (HWND)src, (HPIXMAP)srcp, xsrc, ysrc, srcwidth, srcheight); +} + +static void go_pixmap_set_transparent_color(void *pixmap, unsigned long color) +{ + dw_pixmap_set_transparent_color((HPIXMAP)pixmap, color); +} + +static int go_pixmap_set_font(void *pixmap, char *fontname) +{ + return dw_pixmap_set_font((HPIXMAP)pixmap, fontname); +} + +static void go_pixmap_destroy(void *pixmap) +{ + dw_pixmap_destroy((HPIXMAP)pixmap); +} + +static int go_pixmap_width(void *pixmap) +{ + return (int)DW_PIXMAP_WIDTH(((HPIXMAP)pixmap)); +} + +static int go_pixmap_height(void *pixmap) +{ + return (int)DW_PIXMAP_HEIGHT(((HPIXMAP)pixmap)); +} + +static void go_draw_point(void *handle, void *pixmap, int x, int y) +{ + dw_draw_point((HWND)handle, (HPIXMAP)pixmap, x, y); +} + +static void go_draw_line(void *handle, void *pixmap, int x1, int y1, int x2, int y2) +{ + dw_draw_line((HWND)handle, (HPIXMAP)pixmap, x1, y1, x2, y2); +} + +static void go_draw_polygon(void *handle, void *pixmap, int fill, int count, int x[], int y[]) +{ + dw_draw_polygon((HWND)handle, (HPIXMAP)pixmap, fill, count, x, y); +} + +static void go_draw_rect(void *handle, void *pixmap, int fill, int x, int y, int width, int height) +{ + dw_draw_rect((HWND)handle, (HPIXMAP)pixmap, fill, x, y, width, height); +} + +static void go_draw_arc(void *handle, void *pixmap, int flags, int xorigin, int yorigin, int x1, int y1, int x2, int y2) +{ + dw_draw_arc((HWND)handle, (HPIXMAP)pixmap, flags, xorigin, yorigin, x1, y1, x2, y2); +} + +static void go_draw_text(void *handle, void *pixmap, int x, int y, char *text) +{ + dw_draw_text((HWND)handle, (HPIXMAP)pixmap, x, y, text); +} + +static void *go_tree_new(unsigned long id) +{ + return (void *)dw_tree_new(id); +} + +static void *go_tree_insert(void *handle, char *title, void *icon, void *parent, void *itemdata) +{ + return (void *)dw_tree_insert((HWND)handle, title, (HICN)icon, (HTREEITEM)parent, itemdata); +} + +static void *go_tree_insert_after(void *handle, void *item, char *title, void *icon, void *parent, void *itemdata) +{ + return (void *)dw_tree_insert_after((HWND)handle, (HTREEITEM)item, title, (HICN)icon, (HTREEITEM)parent, itemdata); +} + +static void go_tree_clear(void *handle) +{ + dw_tree_clear((HWND)handle); +} + +static void go_tree_item_delete(void *handle, void *item) +{ + dw_tree_item_delete((HWND)handle, (HTREEITEM)item); +} + +static void go_tree_item_change(void *handle, void *item, char *title, void *icon) +{ + dw_tree_item_change((HWND)handle, (HTREEITEM)item, title, (HICN)icon); +} + +static void go_tree_item_expand(void *handle, void *item) +{ + dw_tree_item_expand((HWND)handle, (HTREEITEM)item); +} + +static void go_tree_item_collapse(void *handle, void *item) +{ + dw_tree_item_collapse((HWND)handle, (HTREEITEM)item); +} + +static void go_tree_item_select(void *handle, void *item) +{ + dw_tree_item_select((HWND)handle, (HTREEITEM)item); +} + +static void go_tree_item_set_data(void *handle, void *item, void *itemdata) +{ + dw_tree_item_set_data((HWND)handle, (HTREEITEM)item, itemdata); +} + +static void *go_tree_item_get_data(void *handle, void *item) +{ + return dw_tree_item_get_data((HWND)handle, (HTREEITEM)item); +} + +static char *go_tree_get_title(void *handle, void *item) +{ + return dw_tree_get_title((HWND)handle, (HTREEITEM)item); +} + +static void *go_html_new(unsigned long id) +{ + return (void *)dw_html_new(id); +} + + +static void go_html_action(void *hwnd, int action) +{ + dw_html_action((HWND)hwnd, action); +} + +static int go_html_raw(void *hwnd, char *string) +{ + return dw_html_raw((HWND)hwnd, string); +} + +static int go_html_url(void *hwnd, char *url) +{ + return dw_html_url((HWND)hwnd, url); +} + +static void *go_mle_new(unsigned long id) +{ + return (void *)dw_mle_new(id); +} + +static unsigned int go_mle_import(void *handle, char *buffer, int startpoint) +{ + return dw_mle_import((HWND)handle, buffer, startpoint); +} + +static void go_mle_export(void *handle, char *buffer, int startpoint, int length) +{ + dw_mle_export((HWND)handle, buffer, startpoint, length); +} + +static void go_mle_get_size(void *handle, unsigned long *bytes, unsigned long *lines) +{ + dw_mle_get_size((HWND)handle, bytes, lines); +} + +static void go_mle_delete(void *handle, int startpoint, int length) +{ + dw_mle_delete((HWND)handle, startpoint, length); +} + +static void go_mle_clear(void *handle) +{ + dw_mle_clear((HWND)handle); +} + +static void go_mle_freeze(void *handle) +{ + dw_mle_freeze((HWND)handle); +} + +static void go_mle_thaw(void *handle) +{ + dw_mle_thaw((HWND)handle); +} + +static void go_mle_set_cursor(void *handle, int point) +{ + dw_mle_set_cursor((HWND)handle, point); +} + +static void go_mle_set_visible(void *handle, int line) +{ + dw_mle_set_visible((HWND)handle, line); +} + +static void go_mle_set_editable(void *handle, int state) +{ + dw_mle_set_editable((HWND)handle, state); +} + +static void go_mle_set_word_wrap(void *handle, int state) +{ + dw_mle_set_word_wrap((HWND)handle, state); +} + +static int go_mle_search(void *handle, char *text, int point, unsigned long flags) +{ + return dw_mle_search((HWND)handle, text, point, flags); +} + +static void *go_container_new(unsigned long id, int multi) +{ + return (void *)dw_container_new(id, multi); +} + +static char **go_string_array_make(int size) +{ + return calloc(sizeof(char*), size); +} + +static void go_string_array_set(char **a, char *s, int n) +{ + a[n] = s; +} + +static void go_string_array_free(char **a, int size) +{ + int x; + + for(x = 0; x < size; x++) + free(a[x]); + free(a); +} + +static int go_container_setup(void *handle, unsigned long *flags, char **titles, int count, int separator) +{ + return dw_container_setup((HWND)handle, flags, titles, count, separator); +} + +static void * go_container_alloc(void *handle, int rowcount) +{ + return dw_container_alloc((HWND)handle, rowcount); +} + +static void go_container_set_item(void *handle, void *pointer, int column, int row, void *data) +{ + dw_container_set_item((HWND)handle, pointer, column, row, data); +} + +static void go_container_set_item_ulong(void *handle, void *pointer, int column, int row, unsigned long val) +{ + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_ULONG) + dw_container_set_item((HWND)handle, pointer, column, row, &val); +} + +static void go_container_set_item_icon(void *handle, void *pointer, int column, int row, void *icon) +{ + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) + dw_container_set_item((HWND)handle, pointer, column, row, &icon); +} + +static void go_container_set_item_time(void *handle, void *pointer, int column, int row, int seconds, int minutes, int hours) +{ + CTIME time; + + time.seconds = seconds; + time.minutes = minutes; + time.hours = hours; + + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_TIME) + dw_container_set_item((HWND)handle, pointer, column, row, &time); +} + +static void go_container_set_item_date(void *handle, void *pointer, int column, int row, int day, int month, int year) +{ + CDATE date; + + date.day = day; + date.month = month; + date.year = year; + + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_DATE) + dw_container_set_item((HWND)handle, pointer, column, row, &date); +} + +static void go_container_change_item(void *handle, int column, int row, void *data) +{ + dw_container_change_item((HWND)handle, column, row, data); +} + +static void go_container_change_item_ulong(void *handle, int column, int row, unsigned long val) +{ + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_ULONG) + dw_container_change_item((HWND)handle, column, row, &val); +} + +static void go_container_change_item_icon(void *handle, int column, int row, void *icon) +{ + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) + dw_container_change_item((HWND)handle, column, row, &icon); +} + +static void go_container_change_item_time(void *handle, int column, int row, int seconds, int minutes, int hours) +{ + CTIME time; + + time.seconds = seconds; + time.minutes = minutes; + time.hours = hours; + + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_TIME) + dw_container_change_item((HWND)handle, column, row, &time); +} + +static void go_container_change_item_date(void *handle, int column, int row, int day, int month, int year) +{ + CDATE date; + + date.day = day; + date.month = month; + date.year = year; + + if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_DATE) + dw_container_change_item((HWND)handle, column, row, &date); +} + +static void go_container_set_column_width(void *handle, int column, int width) +{ + dw_container_set_column_width((HWND)handle, column, width); +} + +static void go_container_change_row_title(void *handle, int row, char *title) +{ + dw_container_change_row_title((HWND)handle, row, title); +} + +static void go_container_change_row_data(void *handle, int row, void *data) +{ + dw_container_change_row_title((HWND)handle, row, (char *)data); +} + +static void go_container_insert(void *handle, void *pointer, int rowcount) +{ + dw_container_insert((HWND)handle, pointer, rowcount); +} + +static void go_container_clear(void *handle, int redraw) +{ + dw_container_clear((HWND)handle, redraw); +} + +static void go_container_delete(void *handle, int rowcount) +{ + dw_container_delete((HWND)handle, rowcount); +} + +static char *go_container_query_start(void *handle, unsigned long flags) +{ + return dw_container_query_start((HWND)handle, flags); +} + +static char *go_container_query_next(void *handle, unsigned long flags) +{ + return dw_container_query_next((HWND)handle, flags); +} + +static void go_container_scroll(void *handle, int direction, long rows) +{ + dw_container_scroll((HWND)handle, direction, rows); +} + +static void go_container_cursor(void *handle, char *text) +{ + dw_container_cursor((HWND)handle, text); +} + +static void go_container_cursor_by_data(void *handle, void *data) +{ + dw_container_cursor_by_data((HWND)handle, data); +} + +static void go_container_delete_row(void *handle, char *text) +{ + dw_container_delete_row((HWND)handle, text); +} + +static void go_container_delete_row_by_data(void *handle, void *data) +{ + dw_container_delete_row_by_data((HWND)handle, data); +} + +static void go_container_optimize(void *handle) +{ + dw_container_optimize((HWND)handle); +} + +static void go_container_set_stripe(void *handle, unsigned long oddcolor, unsigned long evencolor) +{ + dw_container_set_stripe((HWND)handle, oddcolor, evencolor); +} + +static void go_filesystem_set_column_title(void *handle, char *title) +{ + dw_filesystem_set_column_title((HWND)handle, title); +} + +static int go_filesystem_setup(void *handle, unsigned long *flags, char **titles, int count) +{ + return dw_filesystem_setup((HWND)handle, flags, titles, count); +} + +static void go_filesystem_set_item(void *handle, void *pointer, int column, int row, void *data) +{ + dw_filesystem_set_item((HWND)handle, pointer, column, row, data); +} + +static void go_filesystem_set_item_ulong(void *handle, void *pointer, int column, int row, unsigned long val) +{ + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_ULONG) + dw_filesystem_set_item((HWND)handle, pointer, column, row, &val); +} + +static void go_filesystem_set_item_icon(void *handle, void *pointer, int column, int row, void *icon) +{ + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) + dw_filesystem_set_item((HWND)handle, pointer, column, row, &icon); +} + +static void go_filesystem_set_item_time(void *handle, void *pointer, int column, int row, int seconds, int minutes, int hours) +{ + CTIME time; + + time.seconds = seconds; + time.minutes = minutes; + time.hours = hours; + + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_TIME) + dw_filesystem_set_item((HWND)handle, pointer, column, row, &time); +} + +static void go_filesystem_set_item_date(void *handle, void *pointer, int column, int row, int day, int month, int year) +{ + CDATE date; + + date.day = day; + date.month = month; + date.year = year; + + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_DATE) + dw_filesystem_set_item((HWND)handle, pointer, column, row, &date); +} + +static void go_filesystem_set_file(void *handle, void *pointer, int row, char *filename, void *icon) +{ + dw_filesystem_set_file((HWND)handle, pointer, row, filename, (HICN)icon); +} + +static void go_filesystem_change_item(void *handle, int column, int row, void *data) +{ + dw_filesystem_change_item((HWND)handle, column, row, data); +} + +static void go_filesystem_change_item_ulong(void *handle, int column, int row, unsigned long val) +{ + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_ULONG) + dw_filesystem_change_item((HWND)handle, column, row, &val); +} + +static void go_filesystem_change_item_icon(void *handle, int column, int row, void *icon) +{ + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) + dw_filesystem_change_item((HWND)handle, column, row, &icon); +} + +static void go_filesystem_change_item_time(void *handle, int column, int row, int seconds, int minutes, int hours) +{ + CTIME time; + + time.seconds = seconds; + time.minutes = minutes; + time.hours = hours; + + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_TIME) + dw_filesystem_change_item((HWND)handle, column, row, &time); +} + +static void go_filesystem_change_item_date(void *handle, int column, int row, int day, int month, int year) +{ + CDATE date; + + date.day = day; + date.month = month; + date.year = year; + + if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_DATE) + dw_filesystem_change_item((HWND)handle, column, row, &date); +} + +static void go_filesystem_change_file(void *handle, int row, char *filename, void *icon) +{ + dw_filesystem_change_file((HWND)handle, row, filename, (HICN)icon); +} + +static int go_container_get_column_type(void *handle, int column) +{ + return dw_container_get_column_type((HWND)handle, column); +} +static int go_filesystem_get_column_type(void *handle, int column) +{ + return dw_filesystem_get_column_type((HWND)handle, column); +} + +static void *go_calendar_new(unsigned long id) +{ + return (void *)dw_calendar_new(id); +} + +static void go_calendar_set_date(void *handle, unsigned int year, unsigned int month, unsigned int day) +{ + dw_calendar_set_date((HWND)handle, year, month, day); +} + +static void go_calendar_get_date(void *handle, unsigned int *year, unsigned int *month, unsigned int *day) +{ + dw_calendar_get_date((HWND)handle, year, month, day); +} + +static void *go_bitmap_new(unsigned long id) +{ + return (void *)dw_bitmap_new(id); +} + +static void *go_bitmapbutton_new(char *text, unsigned long id) +{ + return (void *)dw_bitmapbutton_new(text, id); +} + +static void *go_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename) +{ + return (void *)dw_bitmapbutton_new_from_file(text, id, filename); +} + +static void *go_splitbar_new(int type, void *topleft, void *bottomright, unsigned long cid) +{ + return (void *)dw_splitbar_new(type, (HWND)topleft, (HWND)bottomright, cid); +} + +static void go_splitbar_set(void *handle, float position) +{ + dw_splitbar_set((HWND)handle, position); +} + +static float go_splitbar_get(void *handle) +{ + return dw_splitbar_get((HWND)handle); +} + +static int go_print_run(void *print, unsigned long flags) +{ + return dw_print_run((HPRINT)print, flags); +} + +static void go_print_cancel(void *print) +{ + return dw_print_cancel((HPRINT)print); +} + +static void *go_mutex_new(void) +{ + return (void *)dw_mutex_new(); +} + +static void go_mutex_close(void *mutex) +{ + dw_mutex_close((HMTX)mutex); +} + +static void go_mutex_lock(void *mutex) +{ + dw_mutex_lock((HMTX)mutex); +} + +static void go_mutex_unlock(void *mutex) +{ + dw_mutex_unlock((HMTX)mutex); +} + +static int go_mutex_trylock(void *mutex) +{ + return dw_mutex_trylock((HMTX)mutex); +} + +static void *go_dialog_new(void) +{ + return (void *)dw_dialog_new(NULL); +} + +static int go_dialog_dismiss(void *dialog, void *result) +{ + return dw_dialog_dismiss((DWDialog *)dialog, result); +} + +static void *go_dialog_wait(void *dialog) +{ + return (void *)dw_dialog_wait((DWDialog *)dialog); +} + +static void *go_event_new(void) +{ + return (void *)dw_event_new(); +} + +static int go_event_close(void *event) +{ + HEV thisevent = (HEV)event; + return dw_event_close(&thisevent); +} + +static int go_event_post(void *event) +{ + return dw_event_post((HEV)event); +} + +static int go_event_reset(void *event) +{ + return dw_event_reset((HEV)event); +} + +static int go_event_wait(void *event, unsigned long timeout) +{ + return dw_event_wait((HEV)event, timeout); +} + +extern int go_int_callback_basic(void *pfunc, void* window, void *data, unsigned int flags); +extern int go_int_callback_configure(void *pfunc, void* window, int width, int height, void *data, unsigned int flags); +extern int go_int_callback_keypress(void *pfunc, void *window, char ch, int vk, int state, void *data, char *utf8, unsigned int flags); +extern int go_int_callback_mouse(void *pfunc, void* window, int x, int y, int mask, void *data, unsigned int flags); +extern int go_int_callback_expose(void *pfunc, void* window, int x, int y, int width, int height, void *data, unsigned int flags); +extern int go_int_callback_item_enter(void *pfunc, void *window, char *text, void *data, void *itemdata, unsigned int flags); +extern int go_int_callback_item_context(void *pfunc, void *window, char *text, int x, int y, void *data, void *itemdata, unsigned int flags); +extern int go_int_callback_item_select(void *pfunc, void *window, void *item, char *text, void *data, void *itemdata, unsigned int flags); +extern int go_int_callback_numeric(void *pfunc, void* window, int val, void *data, unsigned int flags); +extern int go_int_callback_ulong(void *pfunc, void* window, unsigned long val, void *data, unsigned int flags); +extern int go_int_callback_notepage(void *pfunc, void* window, unsigned long val, void *data, unsigned int flags); +extern int go_int_callback_tree(void *pfunc, void* window, void *item, void *data, unsigned int flags); +extern int go_int_callback_timer(void *pfunc, void *data, unsigned int flags); +extern int go_int_callback_print(void *pfunc, void *print, void *pixmap, int page_num, void *data, unsigned int flags); +extern void go_callback_remove(void *pfunc); + +static int DWSIGNAL go_callback_basic(HWND window, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_basic(param[0], (void *)window, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_configure(HWND window, int width, int height, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_configure(param[0], (void *)window, width, height, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_keypress(HWND window, char ch, int vk, int state, void *data, char *utf8) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_keypress(param[0], (void *)window, ch, vk, state, param[1], utf8, DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_mouse(HWND window, int x, int y, int mask, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_mouse(param[0], (void *)window, x, y, mask, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_expose(HWND window, DWExpose *exp, void *data) +{ + if(data && exp) + { + void **param = (void **)data; + return go_int_callback_expose(param[0], (void *)window, exp->x, exp->y, exp->width, exp->height, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_item_enter(HWND window, char *text, void *data, void *itemdata) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_item_enter(param[0], (void *)window, text, param[1], itemdata, DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_item_context(HWND window, char *text, int x, int y, void *data, void *itemdata) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_item_context(param[0], (void *)window, text, x, y, param[1], itemdata, DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_item_select(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_item_select(param[0], (void *)window, (void *)item, text, param[1], itemdata, DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_numeric(HWND window, int val, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_numeric(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +/*static int DWSIGNAL go_callback_ulong(HWND window, unsigned long val, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_ulong(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +}*/ + +static int DWSIGNAL go_callback_notepage(HWND window, unsigned long val, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_notepage(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_tree(HWND window, HTREEITEM tree, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_tree(param[0], (void *)window, (void *)tree, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_timer(void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_timer(param[0], param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static int DWSIGNAL go_callback_print(HPRINT print, HPIXMAP pixmap, int page_num, void *data) +{ + if(data) + { + void **param = (void **)data; + return go_int_callback_print(param[0], (void *)print, (void *)pixmap, page_num, param[1], DW_POINTER_TO_INT(param[2])); + } + return 0; +} + +static void *go_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata, unsigned int sflags) +{ + void **param = malloc(sizeof(void *) * 3); + + if(param && drawfunc) + { + param[0] = drawfunc; + param[1] = drawdata; + param[2] = DW_UINT_TO_POINTER(sflags); + return (void*)dw_print_new(jobname, flags, pages, DW_SIGNAL_FUNC(go_callback_print), param); + } + return NULL; +} + +static int go_timer_connect(int interval, void *sigfunc, void *data, unsigned int flags) +{ + void **param = malloc(sizeof(void *) * 3); + + if(param && sigfunc) + { + param[0] = sigfunc; + param[1] = data; + param[2] = DW_UINT_TO_POINTER(flags); + return dw_timer_connect(interval, DW_SIGNAL_FUNC(go_callback_timer), param); + } + return 0; +} + +static void DWSIGNAL go_signal_free(HWND window, void *data) +{ + if(data) + { + void **param = (void **)data; + go_callback_remove(param[0]); + free(data); + } +} + +static void go_signal_connect(void *window, char *signame, void *sigfunc, void *data, unsigned int flags) +{ + void **param = malloc(sizeof(void *) * 3); + void *func = (void *)go_callback_basic; + + if(param && sigfunc) + { + param[0] = sigfunc; + param[1] = data; + param[2] = DW_UINT_TO_POINTER(flags); + + if(strcmp(signame, DW_SIGNAL_CONFIGURE) == 0) + { + func = (void *)go_callback_configure; + } + else if(strcmp(signame, DW_SIGNAL_KEY_PRESS) == 0) + { + func = (void *)go_callback_keypress; + } + else if(strcmp(signame, DW_SIGNAL_BUTTON_PRESS) == 0 || + strcmp(signame, DW_SIGNAL_BUTTON_RELEASE) == 0 || + strcmp(signame, DW_SIGNAL_MOTION_NOTIFY) == 0) + { + func = (void *)go_callback_mouse; + } + else if(strcmp(signame, DW_SIGNAL_EXPOSE) == 0) + { + func = (void *)go_callback_expose; + } + else if(strcmp(signame, DW_SIGNAL_ITEM_ENTER) == 0) + { + func = (void *)go_callback_item_enter; + } + else if(strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) + { + func = (void *)go_callback_item_context; + } + else if(strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) + { + func = (void *)go_callback_item_select; + } + else if(strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0 || + strcmp(signame, DW_SIGNAL_VALUE_CHANGED) == 0 || + strcmp(signame, DW_SIGNAL_COLUMN_CLICK) == 0) + { + func = (void *)go_callback_numeric; + } + else if(strcmp(signame, DW_SIGNAL_SWITCH_PAGE) == 0) + { + func = (void *)go_callback_notepage; + } + else if(strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) + { + func = (void *)go_callback_tree; + } + + dw_signal_connect_data((HWND)window, signame, func, DW_SIGNAL_FUNC(go_signal_free), param); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwib/dwib.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,96 @@ +package dwib + +/* +#cgo linux pkg-config: dwib dwindows libxml-2.0 +#cgo freebsd pkg-config: dwib dwindows libxml-2.0 +#cgo darwin CFLAGS: -I/usr/local/include -g -O2 -D__MAC__ +#cgo darwin LDFLAGS: -L/usr/local/lib -ldwindows -ldwib -lresolv -framework Cocoa -framework WebKit -lpthread +#cgo windows CFLAGS: -IC:/Work/BitBucket/dwindows -IC:/Work/BitBucket/dwib -g -O2 -D__WIN32__ -mthreads +#cgo windows LDFLAGS: -LC:/Work/BitBucket/dwindows -ldw -LC:/Work/BitBucket/dwib -ldwib +#include "dwibglue.c" +*/ +import "C" +import "unsafe" +import "hg.code.sf.net/p/godwindows/code.hg/dw" + +type DWIB unsafe.Pointer + +// Loads a window with the specified name from an XML tree. +func Load(handle DWIB, name string) dw.HWND { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + + return dw.HANDLE_TO_HWND(dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_load(unsafe.Pointer(handle), cname)))) +} + +// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index. +func Load_at_index(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + cdataname := C.CString(dataname) + defer C.free(unsafe.Pointer(cdataname)) + + return int(C.goib_load_at_index(unsafe.Pointer(handle), cname, cdataname, unsafe.Pointer(dw.HANDLE_TO_POINTER(window)), unsafe.Pointer(dw.HANDLE_TO_POINTER(box)), C.int(index))) +} + +// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index. +func LoadAtIndex(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int { + return Load_at_index(handle, name, dataname, window, box, index) +} + +// Shows a window loaded with dwib.Load() using the stored settings. +func Show(handle dw.HANDLE) { + C.goib_show(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle))) +} + +// Loads an XML templates and returns a handle to the XML tree. +func Open(filename string) DWIB { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + + return DWIB(C.goib_open(cfilename)) +} + +// Closes a handle to an XML tree returned by dwib.Open*() and frees the memory associated with the tree. +func Close(handle DWIB) { + C.goib_close(unsafe.Pointer(handle)) +} + +// Update the location of the image root for locating image files. +func Image_root_set(path string) int { + cpath := C.CString(path) + defer C.free(unsafe.Pointer(cpath)) + + return int(C.goib_image_root_set(cpath)) +} + +// Update the location of the image root for locating image files. +func ImageRootSet(path string) int { + return Image_root_set(path) +} + +// Update the locale used when identifying locating strings during creation. +func Locale_set(loc string) int { + cloc := C.CString(loc) + defer C.free(unsafe.Pointer(cloc)) + + return int(C.goib_locale_set(cloc)) +} + +// Update the locale used when identifying locating strings during creation. +func LocaleSet(loc string) int { + return Locale_set(loc) +} + +// Gets the window handle for a named widget. +func Window_get_handle(handle dw.HANDLE, dataname string) dw.HANDLE { + cdataname := C.CString(dataname) + defer C.free(unsafe.Pointer(cdataname)) + + return dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_window_get_handle(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle)), cdataname))) +} + +// Gets the window handle for a named widget. +func GetHandle(handle dw.HANDLE, dataname string) dw.HANDLE { + return Window_get_handle(handle, dataname) +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwib/dwibglue.c Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,43 @@ +#include <dwib.h> +#include <stdlib.h> +#include <string.h> + +static void *goib_load(void *handle, char *name) +{ + return (void *)dwib_load((DWIB)handle, name); +} + +static int goib_load_at_index(void *handle, char *name, char *dataname, void *window, void *box, int index) +{ + return dwib_load_at_index((DWIB)handle, name, dataname, (HWND)window, (HWND)box, index); +} + +static void goib_show(void *window) +{ + dwib_show((HWND)window); +} + +static void *goib_open(char *filename) +{ + return (void *)dwib_open(filename); +} + +static void goib_close(void *handle) +{ + dwib_close((DWIB)handle); +} + +static int goib_image_root_set(char *path) +{ + return dwib_image_root_set(path); +} + +static int goib_locale_set(char *loc) +{ + return dwib_locale_set(loc); +} + +static void *goib_window_get_handle(void *handle, char *dataname) +{ + return (void *)dwib_window_get_handle((HWND)handle, dataname); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/dwibtest.exe.x64.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="AMD64" + name="dwibtest" + type="win32" +/> +<description>Dynamic Windows Interface Builder Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="AMD64" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/dwibtest.exe.x86.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="X86" + name="dwibtest" + type="win32" +/> +<description>Dynamic Windows Interface Builder Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/dwibtest.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,73 @@ +package main + +import ( + "fmt" + "go/build" + "hg.code.sf.net/p/godwindows/code.hg/dw" + "hg.code.sf.net/p/godwindows/code.hg/dwib" +) + +// Global variables +const ( + FALSE int = iota + TRUE +) + +var APP_NAME = "DWIB Example" +var SRCROOT string + +/* Handle exiting the application */ +func exit_handler() int { + if dw.MessageBox(APP_NAME, dw.MB_YESNO|dw.MB_QUESTION, "Are you sure you want to exit?") == dw.MB_RETURN_YES { + /* Exit the application cleanly */ + dw.MainQuit() + } + return TRUE +} + +var exit_handler_func = exit_handler + +func main() { + /* Locate the source root of the package */ + pkg, err := build.Import("dwibtest", "", build.FindOnly) + if err == nil && len(pkg.SrcRoot) > 0 { + SRCROOT = fmt.Sprintf("%s/dwibtest", pkg.SrcRoot) + } + + /* Initialize Dynamic Windows */ + dw.Init(TRUE) + + /* Load the interface XML file */ + handle := dwib.Open("example.xml") + if handle == nil && len(SRCROOT) > 0 { + handle = dwib.Open(fmt.Sprintf("%s/example.xml", SRCROOT)) + } + + /* Show an error if it fails to load */ + if handle == nil { + dw.MessageBox(APP_NAME, dw.MB_OK|dw.MB_ERROR, "Unable to load the interface XML.") + return + } + + /* Create the loading window... */ + window := dwib.Load(handle, "Test") + dwib.Show(window) + + /* Connect the signal handlers */ + window.ConnectDelete(func(window dw.HWND) int { return exit_handler() }) + /* Handler for Mac application menu Quit */ + dw.DESKTOP.ConnectDelete(func(window dw.HWND) int { return exit_handler() }) + quitmenu := dw.HANDLE_TO_HMENUITEM(dwib.GetHandle(window, "quitmenu")) + quitmenu.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler() }) + + dw.Main() + + /* Destroy the main window */ + window.Destroy() + /* Close the Interface Builder XML */ + dwib.Close(handle) + + /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ + dw.Shutdown() + return +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/dwibtest.rc Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,6 @@ +#include "winuser.h" +#ifdef DW64 +1 RT_MANIFEST dwibtest.exe.x64.manifest +#else +1 RT_MANIFEST dwibtest.exe.x86.manifest +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/example.xml Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,817 @@ +<?xml version="1.0"?> +<DynamicWindows> + <Window><Children><Notebook><Children><NotebookPage><Children><Tree><dataname>tree</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><tooltip/><macfont>Default</macfont><winfont>Default</winfont></Tree><Text>Status<subtype>Status</subtype><dataname/><width>1</width><height>-1</height><hexpand>1</hexpand><vexpand>0</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><label de_DE="Dies ist ein Status-Feld." da_DK="Det er en status felt.">This is a status field.</label><alignment>Left</alignment><valignment>Top</valignment><macfont>Default</macfont><winfont>Default</winfont></Text></Children><title de_DE="Baum">Tree</title><statustext/><orientation>Vertical</orientation></NotebookPage><NotebookPage><Children><HTML><dataname/><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><URL>http://dbsoft.org</URL><macfont>Default</macfont></HTML><Combobox><dataname>combobox</dataname><width>1</width><height>25</height><hexpand>1</hexpand><vexpand>0</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><deftext/><List><Item de_DE="Artikel 1">Item 1</Item><Item de_DE="Artikel 2">Item 2</Item></List><tooltip/><winfont>Default</winfont><macfont>Default</macfont><clickdefault></clickdefault></Combobox></Children><title>HTML</title><statustext/><orientation>Vertical</orientation></NotebookPage><NotebookPage><Children><Container>Filesystem<dataname>filesystem</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>1</multi><subtype>Filesystem</subtype><tooltip/><winfont>Default</winfont><idstring>0</idstring><oddcolor>None</oddcolor><evencolor>None</evencolor><splitcol>None</splitcol><Columns><Item ColType="Number" ColAlign="Left" de_DE="Größe" da_DK="Størrelse">Size</Item><Item ColType="Date" ColAlign="Left" da_DK="Dato" de_DE="Datum">Date</Item><Item ColType="String" ColAlign="Left"></Item></Columns><macfont>Default</macfont><coltitle de_DE="Dateiname" da_DK="Filnavn">Filename</coltitle></Container></Children><title>Container</title><statustext/><orientation>Horizontal</orientation></NotebookPage><NotebookPage><Children><Box>Splitbar<Children><Listbox><dataname>hellogoodbye</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>0</multi><List><Item de_DE="Hallo" da_DK="Hej">Hello</Item><Item da_DK="Farvel" de_DE="Auf Wiedersehen">Goodbye</Item></List><tooltip/><macfont>Default</macfont></Listbox><Container>None<subtype>None</subtype><dataname>greetingdeparting</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>1</multi><Columns><Item ColType="String" ColAlign="Left" de_DE="Gruß" da_DK="Hilsen">Greeting</Item><Item ColType="String" ColAlign="Right" de_DE="Abfahrt" da_DK="Afrejse">Departing</Item><Item ColType="String" ColAlign="Left"></Item></Columns><tooltip/><macfont>Default</macfont><coltitle/><idstring>0</idstring><oddcolor>None</oddcolor><evencolor>None</evencolor><splitcol>None</splitcol></Container></Children><subtype>Splitbar</subtype><dataname/><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><orientation>Horizontal</orientation><title/><splitper>50</splitper><winfont>Default</winfont></Box></Children><title>Splitbar</title><statustext/><orientation>Horizontal</orientation></NotebookPage><NotebookPage><Children><Bitmap><dataname/><width>-1</width><height>-1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><tooltip/><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><winfont>Default</winfont><setting>300 - SunLightLogo.png</setting><macfont>Default</macfont></Bitmap></Children><title>Bitmap</title><statustext/><orientation>Horizontal</orientation></NotebookPage></Children><dataname/><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><position>Top</position><width>1</width><height>1</height><enabled>1</enabled></Notebook><Menu><Children><Menu><Children/><title da_DK="Åbent" de_DE="Öffnen">Open</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title de_DE="Beenden">Quit</title><dataname>quitmenu</dataname><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children><Menu><Children/><title de_DE="Dies wird im Folgenden als" da_DK="Det vil være under">This will be below</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title/><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled></Menu><Menu><Children/><title de_DE="Zweite unten" da_DK="Anden nedenfor">Second below</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title>Test Submenu</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title de_DE="Datei" da_DK="Fil">File</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid><title_da_DK>Fil</title_da_DK></Menu><Menu><Children><Menu><Children/><title de_DE="Aktiviert" da_DK="Aktiveret">Enabled</title><dataname/><checkable>1</checkable><checked>1</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title/><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled></Menu><Menu><Children/><title de_DE="Schneiden" da_DK="Klip">Cut</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title de_DE="Kopie" da_DK="Kopier">Copy</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title da_DK="Indsæt">Paste</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><title_da_DK>Indsæt</title_da_DK><menuid>0</menuid></Menu></Children><title de_DE="Edieren" da_DK="Rediger">Edit</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title de_DE="Versuch" da_DK="Prøve">Test</title><width>600</width><height>500</height><x>100</x><y>100</y><bordersize>-1</bordersize><close>1</close><minimize>1</minimize><maximize>1</maximize><hide>0</hide><resize>1</resize><dialog>0</dialog><border>0</border><sysmenu>1</sysmenu><tasklist>1</tasklist><orientation>Horizontal</orientation><titlebar>1</titlebar><center>0</center><hgravity>Left</hgravity><vgravity>Top</vgravity><hobstacles>0</hobstacles><vobstacles>0</vobstacles><composited>0</composited><textured>0</textured><default></default></Window> +<ImageRoot/><Image>SunLightLogo.png<ImageID>300</ImageID><Embedded>iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAACXBIWXMAAAsTAAALEwEAmpwY +AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUI +IFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuj +a9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMB +APh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCd +mCZT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bBRdVwql9R +1X0WVr7Ggkn7hMxQthsue6M6NuC2+Fybh76Dh5FiPjiR4+dP5IZF2xcq7yaqxp7wKpTphyHT +X1GUGYx9aAtReFDvKLpl5HTE50zx2bz+/wMA/oxEJE0aGvMAAAAASUVORK5CYII=</Embedded></Image><Locales><de_DE/><da_DK/></Locales></DynamicWindows>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwibtest/makesyso.bat Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,3 @@ +@echo off +windres -i dwibtest.rc -o dwibtest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 +windres -i dwibtest.rc -o dwibtest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwootest/dwootest.exe.x64.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="AMD64" + name="dwootest" + type="win32" +/> +<description>Dynamic Windows Object Oriented Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="AMD64" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwootest/dwootest.exe.x86.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="X86" + name="dwootest" + type="win32" +/> +<description>Dynamic Windows Object Oriented Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwootest/dwootest.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,1449 @@ +package main + +import ( + "bufio" + "bytes" + "fmt" + "go/build" + "hg.code.sf.net/p/godwindows/code.hg/dw" + "io" + "os" + "runtime" +) + +var FIXEDFONT = "10.monospace" + +var mainwindow dw.HWND + +// Page 1 +var current_color dw.COLOR = dw.RGB(100, 100, 100) +var cursor_arrow bool = true +var timerid dw.HTIMER + +// Page 2 +var textbox1, textbox2 dw.HRENDER +var status1, status2 dw.HTEXT +var vscrollbar, hscrollbar dw.HSCROLLBAR +var imagexspin, imageyspin dw.HSPINBUTTON +var imagestretchcheck dw.HBUTTON +var text1pm, text2pm, image dw.HPIXMAP +var font_width = 8 +var font_height = 12 +var rows = 10 +var width1 = 6 +var cols = 80 +var render_type = 0 +var current_row = 0 +var current_col = 0 +var max_linewidth = 0 + +// Page 4 +var mle_point = 0 + +// Page 5 +var iteration = 0 + +// Page 8 +var MAX_WIDGETS = 20 + +// Page 9 +var threadmle dw.HMLE +var startbutton dw.HBUTTON +var mutex dw.HMTX +var workevent, controlevent dw.HEV +var finished = 0 +var ready = 0 +var mlepos = 0 + +// Miscellaneous +var fileicon, foldericon dw.HICN +var current_file string +var lines []string +var menu_enabled bool = true + +var FOLDER_ICON_NAME string = "folder" +var FILE_ICON_NAME string = "file" +var SRCROOT string + +func read_file() { + var ( + file *os.File + part []byte + prefix bool + length int + err error + ) + + lines = nil + max_linewidth = 0 + + if file, err = os.Open(current_file); err != nil { + return + } + reader := bufio.NewReader(file) + buffer := bytes.NewBuffer(make([]byte, 1024)) + buffer.Reset() + for { + if part, prefix, err = reader.ReadLine(); err != nil { + break + } + buffer.Write(part) + if !prefix { + lines = append(lines, buffer.String()) + length = len(buffer.String()) + if length > max_linewidth { + max_linewidth = length + } + buffer.Reset() + } + } + if err == io.EOF { + err = nil + } + hscrollbar.SetRange(uint(max_linewidth), uint(cols)) + hscrollbar.SetPos(0) + vscrollbar.SetRange(uint(len(lines)), uint(rows)) + vscrollbar.SetPos(0) +} + +// Call back section +func exit_handler() int { + if dw.MessageBox("dwtest", dw.MB_YESNO|dw.MB_QUESTION, "Are you sure you want to exit?") != 0 { + dw.MainQuit() + } + return dw.TRUE +} + +/* When hpma is not NULL we are printing.. so handle things differently */ +func draw_file(row int, col int, nrows int, fheight int, hpma dw.HPIXMAP) { + var hpm dw.HPIXMAP + + if hpma == dw.NOHPIXMAP { + hpm = text2pm + } else { + hpm = hpma + } + + if len(current_file) > 0 { + var i int + + dw.ColorForegroundSet(dw.CLR_WHITE) + if hpma == dw.NOHPIXMAP { + text1pm.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, text1pm.GetWidth(), text1pm.GetHeight()) + } + hpm.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, hpm.GetWidth(), hpm.GetHeight()) + + for i = 0; (i < nrows) && (i+row < len(lines)); i++ { + fileline := i + row - 1 + y := i * fheight + dw.ColorBackgroundSet(dw.COLOR(1 + (fileline % 15))) + dw.ColorForegroundSet(dw.COLOR(fileline % 16)) + if hpma == dw.NOHPIXMAP { + text1pm.DrawText(0, y, fmt.Sprintf("%6.6d", i+row)) + } + thisline := lines[i+row] + if len(thisline) > col { + hpm.DrawText(0, y, thisline[col:]) + } + } + if hpma == dw.NOHPIXMAP { + text_expose(textbox1, text1pm) + text_expose(textbox2, text2pm) + } + } +} + +/* When hpma is not NULL we are printing.. so handle things differently */ +func draw_shapes(direct int, hpma dw.HPIXMAP) { + var hpm dw.HPIXMAP = dw.NOHPIXMAP + var drawable dw.DRAWABLE = textbox2 + if hpma != dw.NOHPIXMAP { + hpm = hpma + } else { + hpm = text2pm + } + if direct != dw.TRUE { + drawable = hpm + } + + width := hpm.GetWidth() + height := hpm.GetHeight() + + x := []int{20, 180, 180, 230, 180, 180, 20} + y := []int{50, 50, 20, 70, 120, 90, 90} + + image_x := imagexspin.GetPos() + image_y := imageyspin.GetPos() + image_stretch := imagestretchcheck.Get() + + dw.ColorForegroundSet(dw.CLR_WHITE) + drawable.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, width, height) + dw.ColorForegroundSet(dw.CLR_DARKPINK) + drawable.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 10, 10, width-20, height-20) + dw.ColorForegroundSet(dw.CLR_GREEN) + dw.ColorBackgroundSet(dw.CLR_DARKRED) + drawable.DrawText(10, 10, "This should be aligned with the edges.") + dw.ColorForegroundSet(dw.CLR_YELLOW) + drawable.DrawLine(width-10, 10, 10, height-10) + dw.ColorForegroundSet(dw.CLR_BLUE) + drawable.DrawPolygon(dw.DRAW_FILL, x, y) + dw.ColorForegroundSet(dw.CLR_BLACK) + drawable.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 80, 80, 80, 40) + dw.ColorForegroundSet(dw.CLR_CYAN) + /* Bottom right corner */ + drawable.DrawArc(0, width-30, height-30, width-10, height-30, width-30, height-10) + /* Top right corner */ + drawable.DrawArc(0, width-30, 30, width-30, 10, width-10, 30) + /* Bottom left corner */ + drawable.DrawArc(0, 30, height-30, 30, height-10, 10, height-30) + /* Full circle in the left top area */ + drawable.DrawArc(dw.DRAW_FULL, 120, 100, 80, 80, 160, 120) + if image != dw.NOHPIXMAP { + if image_stretch == dw.TRUE { + drawable.BitBltStretchPixmap(10, 10, width-20, height-20, image, 0, 0, image.GetWidth(), image.GetHeight()) + } else { + drawable.BitBltPixmap(image_x, image_y, image.GetWidth(), image.GetHeight(), image, 0, 0) + } + } + + /* If we aren't drawing direct do a bitblt */ + if direct == dw.FALSE && hpma == dw.NOHPIXMAP { + text_expose(textbox2, text2pm) + } +} + +func update_render() { + switch render_type { + case 0: + draw_shapes(dw.FALSE, dw.NOHPIXMAP) + case 1: + draw_shapes(dw.TRUE, dw.NOHPIXMAP) + case 2: + draw_file(current_row, current_col, rows, font_height, dw.NOHPIXMAP) + } +} + +func print_callback() { + print := dw.PrintNew("DWTest Job") + print.Connect(func(print dw.HPRINT, pixmap dw.HPIXMAP, page_num int) int { + pixmap.SetFont(FIXEDFONT) + if page_num == 0 { + draw_shapes(dw.FALSE, pixmap) + } else if page_num == 1 { + /* If we have a file to display... */ + if len(current_file) > 0 { + /* Calculate new dimensions */ + _, fheight := pixmap.GetTextExtents("(g") + nrows := int(pixmap.GetHeight() / fheight) + + /* Do the actual drawing */ + draw_file(0, 0, nrows, fheight, pixmap) + } else { + /* We don't have a file so center an error message on the page */ + var text = "No file currently selected!" + + /* Get the font size for this printer context... */ + fwidth, fheight := pixmap.GetTextExtents(text) + + posx := int(pixmap.GetWidth()-fwidth) / 2 + posy := int(pixmap.GetHeight()-fheight) / 2 + + dw.ColorForegroundSet(dw.CLR_BLACK) + dw.ColorBackgroundSet(dw.CLR_WHITE) + pixmap.DrawText(posx, posy, text) + } + } + return dw.TRUE + }, 0, 2) + print.Run(0) +} + +func context_menu() { + hwndMenu := dw.MenuNew(0) + menuitem := hwndMenu.AppendItem("~Quit", dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + + menuitem.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler() }) + hwndMenu.AppendItem(dw.MENU_SEPARATOR, dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem = hwndMenu.AppendItem("~Show Window", dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem.ConnectClicked(func(window dw.HMENUITEM) int { + mainwindow.Show() + mainwindow.Raise() + return dw.TRUE + }) + px, py := dw.PointerGetPos() + /* Use the toplevel window handle here.... because on the Mac.. + * using the control itself, when a different tab is active + * the control is removed from the window and can no longer + * handle the messages. + */ + hwndMenu.Popup(mainwindow, px, py) +} + +/* This gets called when a part of the graph needs to be repainted. */ +func text_expose(hwnd dw.HRENDER, hpm dw.HPIXMAP) int { + if render_type != 1 { + width := hpm.GetWidth() + height := hpm.GetHeight() + + hwnd.BitBltPixmap(0, 0, width, height, hpm, 0, 0) + dw.Flush() + } else { + update_render() + } + return dw.TRUE +} + +func resolve_keyname(vk int) string { + var keyname string = "<unknown>" + + switch vk { + case dw.VK_LBUTTON: + keyname = "VK_LBUTTON" + case dw.VK_RBUTTON: + keyname = "VK_RBUTTON" + case dw.VK_CANCEL: + keyname = "VK_CANCEL" + case dw.VK_MBUTTON: + keyname = "VK_MBUTTON" + case dw.VK_TAB: + keyname = "VK_TAB" + case dw.VK_CLEAR: + keyname = "VK_CLEAR" + case dw.VK_RETURN: + keyname = "VK_RETURN" + case dw.VK_PAUSE: + keyname = "VK_PAUSE" + case dw.VK_CAPITAL: + keyname = "VK_CAPITAL" + case dw.VK_ESCAPE: + keyname = "VK_ESCAPE" + case dw.VK_SPACE: + keyname = "VK_SPACE" + case dw.VK_PRIOR: + keyname = "VK_PRIOR" + case dw.VK_NEXT: + keyname = "VK_NEXT" + case dw.VK_END: + keyname = "VK_END" + case dw.VK_HOME: + keyname = "VK_HOME" + case dw.VK_LEFT: + keyname = "VK_LEFT" + case dw.VK_UP: + keyname = "VK_UP" + case dw.VK_RIGHT: + keyname = "VK_RIGHT" + case dw.VK_DOWN: + keyname = "VK_DOWN" + case dw.VK_SELECT: + keyname = "VK_SELECT" + case dw.VK_PRINT: + keyname = "VK_PRINT" + case dw.VK_EXECUTE: + keyname = "VK_EXECUTE" + case dw.VK_SNAPSHOT: + keyname = "VK_SNAPSHOT" + case dw.VK_INSERT: + keyname = "VK_INSERT" + case dw.VK_DELETE: + keyname = "VK_DELETE" + case dw.VK_HELP: + keyname = "VK_HELP" + case dw.VK_LWIN: + keyname = "VK_LWIN" + case dw.VK_RWIN: + keyname = "VK_RWIN" + case dw.VK_NUMPAD0: + keyname = "VK_NUMPAD0" + case dw.VK_NUMPAD1: + keyname = "VK_NUMPAD1" + case dw.VK_NUMPAD2: + keyname = "VK_NUMPAD2" + case dw.VK_NUMPAD3: + keyname = "VK_NUMPAD3" + case dw.VK_NUMPAD4: + keyname = "VK_NUMPAD4" + case dw.VK_NUMPAD5: + keyname = "VK_NUMPAD5" + case dw.VK_NUMPAD6: + keyname = "VK_NUMPAD6" + case dw.VK_NUMPAD7: + keyname = "VK_NUMPAD7" + case dw.VK_NUMPAD8: + keyname = "VK_NUMPAD8" + case dw.VK_NUMPAD9: + keyname = "VK_NUMPAD9" + case dw.VK_MULTIPLY: + keyname = "VK_MULTIPLY" + case dw.VK_ADD: + keyname = "VK_ADD" + case dw.VK_SEPARATOR: + keyname = "VK_SEPARATOR" + case dw.VK_SUBTRACT: + keyname = "VK_SUBTRACT" + case dw.VK_DECIMAL: + keyname = "VK_DECIMAL" + case dw.VK_DIVIDE: + keyname = "VK_DIVIDE" + case dw.VK_F1: + keyname = "VK_F1" + case dw.VK_F2: + keyname = "VK_F2" + case dw.VK_F3: + keyname = "VK_F3" + case dw.VK_F4: + keyname = "VK_F4" + case dw.VK_F5: + keyname = "VK_F5" + case dw.VK_F6: + keyname = "VK_F6" + case dw.VK_F7: + keyname = "VK_F7" + case dw.VK_F8: + keyname = "VK_F8" + case dw.VK_F9: + keyname = "VK_F9" + case dw.VK_F10: + keyname = "VK_F10" + case dw.VK_F11: + keyname = "VK_F11" + case dw.VK_F12: + keyname = "VK_F12" + case dw.VK_F13: + keyname = "VK_F13" + case dw.VK_F14: + keyname = "VK_F14" + case dw.VK_F15: + keyname = "VK_F15" + case dw.VK_F16: + keyname = "VK_F16" + case dw.VK_F17: + keyname = "VK_F17" + case dw.VK_F18: + keyname = "VK_F18" + case dw.VK_F19: + keyname = "VK_F19" + case dw.VK_F20: + keyname = "VK_F20" + case dw.VK_F21: + keyname = "VK_F21" + case dw.VK_F22: + keyname = "VK_F22" + case dw.VK_F23: + keyname = "VK_F23" + case dw.VK_F24: + keyname = "VK_F24" + case dw.VK_NUMLOCK: + keyname = "VK_NUMLOCK" + case dw.VK_SCROLL: + keyname = "VK_SCROLL" + case dw.VK_LSHIFT: + keyname = "VK_LSHIFT" + case dw.VK_RSHIFT: + keyname = "VK_RSHIFT" + case dw.VK_LCONTROL: + keyname = "VK_LCONTROL" + case dw.VK_RCONTROL: + keyname = "VK_RCONTROL" + } + return keyname +} + +func resolve_keymodifiers(mask int) string { + if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_CTRL KC_SHIFT KC_ALT" + } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT { + return "KC_CTRL KC_SHIFT" + } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_CTRL KC_ALT" + } else if (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_SHIFT KC_ALT" + } else if (mask & dw.KC_SHIFT) == dw.KC_SHIFT { + return "KC_SHIFT" + } else if (mask & dw.KC_CTRL) == dw.KC_CTRL { + return "KC_CTRL" + } else if (mask & dw.KC_ALT) == dw.KC_ALT { + return "KC_ALT" + } + return "none" +} + +func button_callback(combobox1 dw.HLISTBOX, combobox2 dw.HLISTBOX, spinbutton dw.HSPINBUTTON, cal dw.HCALENDAR) { + idx := combobox1.Selected() + buf1 := combobox1.GetText(idx) + idx = combobox2.Selected() + buf2 := combobox2.GetText(idx) + y, m, d := cal.GetDate() + spvalue := spinbutton.GetPos() + message := fmt.Sprintf("spinbutton: %d\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d", + spvalue, + buf1, buf2, + y, m, d) + dw.MessageBox("Values", dw.MB_OK|dw.MB_INFORMATION, message) +} + +// Create the menu +func menu_add(mainwindow dw.HWND) { + mainmenubar := mainwindow.MenubarNew() + /* add menus to the menubar */ + menu := dw.MenuNew(0) + menuitem := menu.AppendItem("~Quit", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler() }) + /* + * Add the "File" menu to the menubar... + */ + mainmenubar.AppendItem("~File", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) + + changeable_menu := dw.MenuNew(0) + checkable_menuitem := changeable_menu.AppendItem("~Checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) + checkable_menuitem.ConnectClicked(func(window dw.HMENUITEM) int { + dw.MessageBox("Menu Item Callback", dw.MB_OK|dw.MB_INFORMATION, "Checkable menu item selected") + return dw.FALSE + }) + + noncheckable_menuitem := changeable_menu.AppendItem("~Non-checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + noncheckable_menuitem.ConnectClicked(func(window dw.HMENUITEM) int { + dw.MessageBox("Menu Item Callback", dw.MB_OK|dw.MB_INFORMATION, "Non-checkable menu item selected") + return dw.FALSE + }) + changeable_menu.AppendItem("~Disabled menu Item", dw.MENU_AUTO, dw.MIS_DISABLED|dw.MIS_CHECKED, dw.TRUE, dw.TRUE, dw.NOMENU) + /* seperator */ + changeable_menu.AppendItem(dw.MENU_SEPARATOR, dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem = changeable_menu.AppendItem("~Menu Items Disabled", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) + menuitem.ConnectClicked(func(window dw.HMENUITEM) int { + if menu_enabled { + checkable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_DISABLED) + noncheckable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_DISABLED) + menu_enabled = false + } else { + checkable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_ENABLED) + noncheckable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_ENABLED) + menu_enabled = true + } + return dw.FALSE + }) + + /* + * Add the "Menu" menu to the menubar... + */ + mainmenubar.AppendItem("~Menu", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, changeable_menu) + + menu = dw.MenuNew(0) + menuitem = menu.AppendItem("~About", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem.ConnectClicked(func(window dw.HMENUITEM) int { + env := dw.EnvironmentGet() + message := fmt.Sprintf("dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\ndwindows Version: %d.%d.%d", + env.OSName, env.BuildDate, env.BuildTime, + env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild, + env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion) + dw.MessageBox("About dwindows", dw.MB_OK|dw.MB_INFORMATION, message) + return dw.FALSE + }) + + /* + * Add the "Help" menu to the menubar... + */ + mainmenubar.AppendItem("~Help", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) +} + +// Create Page 1 +func archive_add(notebookbox1 dw.HBOX) { + lbbox := dw.BoxNew(dw.VERT, 10) + + notebookbox1.PackStart(lbbox, 150, 70, dw.TRUE, dw.TRUE, 0) + + /* Copy and Paste */ + browsebox := dw.BoxNew(dw.HORZ, 0) + + lbbox.PackStart(browsebox, 0, 0, dw.FALSE, dw.FALSE, 0) + + copypastefield := dw.EntryfieldNew("", 0) + + copypastefield.SetLimit(260) + + browsebox.PackStart(copypastefield, -1, -1, dw.TRUE, dw.FALSE, 4) + + copybutton := dw.ButtonNew("Copy", 0) + + browsebox.PackStart(copybutton, -1, -1, dw.FALSE, dw.FALSE, 0) + + pastebutton := dw.ButtonNew("Paste", 0) + + browsebox.PackStart(pastebutton, -1, -1, dw.FALSE, dw.FALSE, 0) + + /* Archive Name */ + stext := dw.TextNew("File to browse", 0) + + stext.SetStyle(dw.DT_VCENTER, dw.DT_VCENTER) + + lbbox.PackStart(stext, 130, 15, dw.TRUE, dw.TRUE, 2) + + browsebox = dw.BoxNew(dw.HORZ, 0) + + lbbox.PackStart(browsebox, 0, 0, dw.TRUE, dw.TRUE, 0) + + entryfield := dw.EntryfieldNew("", 100) + + entryfield.SetLimit(260) + + browsebox.PackStart(entryfield, 100, 15, dw.TRUE, dw.TRUE, 4) + + browsefilebutton := dw.ButtonNew("Browse File", 1001) + + browsebox.PackStart(browsefilebutton, 40, 15, dw.TRUE, dw.TRUE, 0) + + browsefolderbutton := dw.ButtonNew("Browse Folder", 1001) + + browsebox.PackStart(browsefolderbutton, 40, 15, dw.TRUE, dw.TRUE, 0) + + browsebox.SetColor(dw.CLR_PALEGRAY, dw.CLR_PALEGRAY) + stext.SetColor(dw.CLR_BLACK, dw.CLR_PALEGRAY) + + /* Buttons */ + buttonbox := dw.BoxNew(dw.HORZ, 10) + + lbbox.PackStart(buttonbox, 0, 0, dw.TRUE, dw.TRUE, 0) + + cancelbutton := dw.ButtonNew("Exit", 1002) + buttonbox.PackStart(cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + cursortogglebutton := dw.ButtonNew("Set Cursor pointer - CLOCK", 1003) + buttonbox.PackStart(cursortogglebutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + okbutton := dw.ButtonNew("Turn Off Annoying Beep!", 1001) + buttonbox.PackStart(okbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + cancelbutton.Unpack() + buttonbox.PackStart(cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + mainwindow.ClickDefault(cancelbutton) + + colorchoosebutton := dw.ButtonNew("Color Chooser Dialog", 1004) + buttonbox.PackAtIndex(colorchoosebutton, 1, 130, 30, dw.TRUE, dw.TRUE, 2) + + /* Set some nice fonts and colors */ + lbbox.SetColor(dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) + buttonbox.SetColor(dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) + okbutton.SetColor(dw.CLR_PALEGRAY, dw.CLR_DARKCYAN) + + browsefilebutton.ConnectClicked(func(window dw.HBUTTON) int { + tmp := dw.FileBrowse("Pick a file", "dwootest.go", "go", dw.FILE_OPEN) + if len(tmp) > 0 { + current_file = tmp + entryfield.SetText(current_file) + read_file() + current_col = 0 + current_row = 0 + update_render() + } + copypastefield.SetFocus() + return dw.FALSE + }) + + browsefolderbutton.ConnectClicked(func(window dw.HBUTTON) int { + tmp := dw.FileBrowse("Pick a folder", ".", "c", dw.DIRECTORY_OPEN) + fmt.Printf("Folder picked: %s\n", tmp) + return dw.FALSE + }) + copybutton.ConnectClicked(func(button dw.HBUTTON) int { + test := copypastefield.GetText() + + if len(test) > 0 { + dw.ClipboardSetText(test) + } + entryfield.SetFocus() + return dw.TRUE + }) + pastebutton.ConnectClicked(func(button dw.HBUTTON) int { + test := dw.ClipboardGetText() + + if len(test) > 0 { + copypastefield.SetText(test) + } + return dw.TRUE + }) + okbutton.ConnectClicked(func(window dw.HBUTTON) int { timerid.Disconnect(); return dw.TRUE }) + cancelbutton.ConnectClicked(func(window dw.HBUTTON) int { return exit_handler() }) + cursortogglebutton.ConnectClicked(func(window dw.HBUTTON) int { + if cursor_arrow { + cursortogglebutton.SetText("Set Cursor pointer - ARROW") + mainwindow.SetPointer(dw.POINTER_CLOCK) + cursor_arrow = false + } else { + cursortogglebutton.SetText("Set Cursor pointer - CLOCK") + mainwindow.SetPointer(dw.POINTER_DEFAULT) + cursor_arrow = true + } + return dw.FALSE + }) + colorchoosebutton.ConnectClicked(func(window dw.HBUTTON) int { current_color = dw.Color_choose(current_color); return dw.FALSE }) + + /* Set the default field */ + mainwindow.Default(copypastefield) +} + +// Create Page 2 +func text_add(notebookbox2 dw.HBOX) { + depth := dw.ColorDepthGet() + + /* create a box to pack into the notebook page */ + pagebox := dw.BoxNew(dw.HORZ, 2) + notebookbox2.PackStart(pagebox, 0, 0, dw.TRUE, dw.TRUE, 0) + /* now a status area under this box */ + hbox := dw.BoxNew(dw.HORZ, 1) + notebookbox2.PackStart(hbox, 100, 20, dw.TRUE, dw.FALSE, 1) + status1 = dw.StatusTextNew("", 0) + hbox.PackStart(status1, 100, -1, dw.TRUE, dw.FALSE, 1) + status2 = dw.StatusTextNew("", 0) + hbox.PackStart(status2, 100, -1, dw.TRUE, dw.FALSE, 1) + /* a box with combobox and button */ + hbox = dw.BoxNew(dw.HORZ, 1) + notebookbox2.PackStart(hbox, 100, 25, dw.TRUE, dw.FALSE, 1) + rendcombo := dw.ComboboxNew("Shapes Double Buffered", 0) + hbox.PackStart(rendcombo, 80, 25, dw.TRUE, dw.FALSE, 0) + rendcombo.Append("Shapes Double Buffered") + rendcombo.Append("Shapes Direct") + rendcombo.Append("File Display") + label := dw.TextNew("Image X:", 100) + label.SetStyle(dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) + hbox.PackStart(label, -1, 25, dw.FALSE, dw.FALSE, 0) + imagexspin = dw.SpinButtonNew("20", 1021) + hbox.PackStart(imagexspin, 25, 25, dw.TRUE, dw.FALSE, 0) + label = dw.TextNew("Y:", 100) + label.SetStyle(dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) + hbox.PackStart(label, -1, 25, dw.FALSE, dw.FALSE, 0) + imageyspin = dw.SpinButtonNew("20", 1021) + hbox.PackStart(imageyspin, 25, 25, dw.TRUE, dw.FALSE, 0) + imagexspin.SetLimits(2000, 0) + imageyspin.SetLimits(2000, 0) + imagexspin.SetPos(20) + imageyspin.SetPos(20) + imagestretchcheck = dw.CheckButtonNew("Stretch", 1021) + hbox.PackStart(imagestretchcheck, -1, 25, dw.FALSE, dw.FALSE, 0) + + button1 := dw.ButtonNew("Refresh", 1223) + hbox.PackStart(button1, 100, 25, dw.FALSE, dw.FALSE, 0) + button2 := dw.ButtonNew("Print", 1224) + hbox.PackStart(button2, 100, 25, dw.FALSE, dw.FALSE, 0) + + /* Pre-create the scrollbars so we can query their sizes */ + vscrollbar = dw.ScrollbarNew(dw.VERT, 50) + hscrollbar = dw.ScrollbarNew(dw.HORZ, 50) + vscrollbarwidth, _ := vscrollbar.GetPreferredSize() + _, hscrollbarheight := hscrollbar.GetPreferredSize() + + /* On GTK with overlay scrollbars enabled this returns us 0... + * so in that case we need to give it some real values. + */ + if vscrollbarwidth == 0 { + vscrollbarwidth = 8 + } + if hscrollbarheight == 0 { + hscrollbarheight = 8 + } + + /* create render box for number pixmap */ + textbox1 = dw.RenderNew(100) + textbox1.SetFont(FIXEDFONT) + font_width, font_height = textbox1.GetTextExtents("(g") + font_width = font_width / 2 + vscrollbox := dw.BoxNew(dw.VERT, 0) + vscrollbox.PackStart(textbox1, font_width*width1, font_height*rows, dw.FALSE, dw.TRUE, 0) + vscrollbox.PackStart(dw.NOHWND, font_width*(width1+1), hscrollbarheight, dw.FALSE, dw.FALSE, 0) + pagebox.PackStart(vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) + + /* pack empty space 1 character wide */ + pagebox.PackStart(dw.NOHWND, font_width, 0, dw.FALSE, dw.TRUE, 0) + + /* create box for filecontents and horz scrollbar */ + textboxA := dw.BoxNew(dw.VERT, 0) + pagebox.PackStart(textboxA, 0, 0, dw.TRUE, dw.TRUE, 0) + + /* create render box for filecontents pixmap */ + textbox2 = dw.RenderNew(101) + textboxA.PackStart(textbox2, 10, 10, dw.TRUE, dw.TRUE, 0) + textbox2.SetFont(FIXEDFONT) + /* create horizonal scrollbar */ + textboxA.PackStart(hscrollbar, -1, -1, dw.TRUE, dw.FALSE, 0) + + /* create vertical scrollbar */ + vscrollbox = dw.BoxNew(dw.VERT, 0) + vscrollbox.PackStart(vscrollbar, -1, -1, dw.FALSE, dw.TRUE, 0) + /* Pack an area of empty space 14x14 pixels */ + vscrollbox.PackStart(dw.NOHWND, vscrollbarwidth, hscrollbarheight, dw.FALSE, dw.FALSE, 0) + pagebox.PackStart(vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) + + text1pm = dw.PixmapNew(textbox1, uint(font_width*width1), uint(font_height*rows), depth) + text2pm = dw.PixmapNew(textbox2, uint(font_width*cols), uint(font_height*rows), depth) + image = dw.PixmapNewFromFile(textbox2, "test") + if image == dw.NOHPIXMAP && len(SRCROOT) > 0 { + image = dw.PixmapNewFromFile(textbox2, fmt.Sprintf("%s/test", SRCROOT)) + } + if image != dw.NOHPIXMAP { + image.SetTransparentColor(dw.CLR_WHITE) + } + + dw.MessageBox("DWTest", dw.MB_OK|dw.MB_INFORMATION, fmt.Sprintf("Width: %d Height: %d\n", font_width, font_height)) + text1pm.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*width1, font_height*rows) + text2pm.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*cols, font_height*rows) + textbox1.ConnectButtonPress(func(window dw.HRENDER, x int, y int, buttonmask int) int { context_menu(); return dw.TRUE }) + textbox1.ConnectExpose(func(hwnd dw.HRENDER, x int, y int, width int, height int) int { return text_expose(hwnd, text1pm) }) + textbox2.ConnectExpose(func(hwnd dw.HRENDER, x int, y int, width int, height int) int { return text_expose(hwnd, text2pm) }) + textbox2.ConnectConfigure(func(hwnd dw.HRENDER, width int, height int) int { + old1 := text1pm + old2 := text2pm + depth := dw.ColorDepthGet() + + rows = height / font_height + cols = width / font_width + + /* Create new pixmaps with the current sizes */ + text1pm = dw.PixmapNew(textbox1, uint(font_width*(width1)), uint(height), depth) + text2pm = dw.PixmapNew(textbox2, uint(width), uint(height), depth) + + /* Make sure the side area is cleared */ + dw.ColorForegroundSet(dw.CLR_WHITE) + text1pm.DrawRect(dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)) + + /* Destroy the old pixmaps */ + old1.Destroy() + old2.Destroy() + + /* Update scrollbar ranges with new values */ + hscrollbar.SetRange(uint(max_linewidth), uint(cols)) + vscrollbar.SetRange(uint(len(lines)), uint(rows)) + + /* Redraw the window */ + update_render() + return dw.TRUE + }) + textbox2.ConnectMotion(func(window dw.HRENDER, x int, y int, buttonmask int) int { + status2.SetText(fmt.Sprintf("motion_notify: %dx%d", x, y)) + return dw.FALSE + }) + textbox2.ConnectButtonPress(func(window dw.HRENDER, x int, y int, buttonmask int) int { + status2.SetText(fmt.Sprintf("button_press: %dx%d", x, y)) + return dw.FALSE + }) + hscrollbar.ConnectValueChanged(func(hwnd dw.HSCROLLBAR, value int) int { + current_col = value + status1.SetText(fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)) + update_render() + return dw.FALSE + }) + vscrollbar.ConnectValueChanged(func(hwnd dw.HSCROLLBAR, value int) int { + current_row = value + status1.SetText(fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)) + update_render() + return dw.FALSE + }) + imagestretchcheck.ConnectClicked(func(window dw.HBUTTON) int { update_render(); return dw.FALSE }) + button1.ConnectClicked(func(window dw.HBUTTON) int { update_render(); return dw.FALSE }) + button2.ConnectClicked(func(window dw.HBUTTON) int { print_callback(); return dw.FALSE }) + rendcombo.ConnectListSelect(func(window dw.HLISTBOX, index int) int { + if index != render_type { + if index == 2 { + hscrollbar.SetRange(uint(max_linewidth), uint(cols)) + hscrollbar.SetPos(0) + vscrollbar.SetRange(uint(len(lines)), uint(rows)) + vscrollbar.SetPos(0) + current_col = 0 + current_row = 0 + } else { + hscrollbar.SetRange(0, 0) + hscrollbar.SetPos(0) + vscrollbar.SetRange(0, 0) + vscrollbar.SetPos(0) + } + render_type = index + update_render() + } + return dw.FALSE + }) + mainwindow.ConnectKeyPress(func(window dw.HWND, ch uint8, vk int, state int, utf8 string) int { + var message string + + if ch != 0 { + message = fmt.Sprintf("Key: %c(%d) Modifiers: %s(%d) utf8 %s", ch, ch, resolve_keymodifiers(state), state, utf8) + } else { + message = fmt.Sprintf("Key: %s(%d) Modifiers: %s(%d) utf8 %s", resolve_keyname(vk), vk, resolve_keymodifiers(state), state, utf8) + } + status1.SetText(message) + return dw.FALSE + }) + + dw.TaskbarInsert(textbox1, fileicon, "DWTest") +} + +// Page 3 +func tree_add(notebookbox3 dw.HBOX) { + /* create a box to pack into the notebook page */ + listbox := dw.ListboxNew(1024, dw.TRUE) + notebookbox3.PackStart(listbox, 500, 200, dw.TRUE, dw.TRUE, 0) + listbox.Append("Test 1") + listbox.Append("Test 2") + listbox.Append("Test 3") + listbox.Append("Test 4") + listbox.Append("Test 5") + + /* now a tree area under this box */ + tree := dw.TreeNew(101) + notebookbox3.PackStart(tree, 500, 200, dw.TRUE, dw.TRUE, 1) + + /* and a status area to see whats going on */ + tree_status := dw.StatusTextNew("", 0) + notebookbox3.PackStart(tree_status, 100, -1, dw.TRUE, dw.FALSE, 1) + + /* set up our signal trappers... */ + tree.ConnectItemContext(func(window dw.HTREE, text string, x int, y int, itemdata dw.POINTER) int { + tree_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", + dw.HANDLE_TO_UINTPTR(window), text, x, y, uintptr(itemdata))) + return dw.FALSE + }) + tree.ConnectItemSelect(func(window dw.HTREE, item dw.HTREEITEM, text string, itemdata dw.POINTER) int { + tree_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", + dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata))) + return dw.FALSE + }) + + t1 := tree.Insert("tree folder 1", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(1))) + t2 := tree.Insert("tree folder 2", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(2))) + tree.Insert("tree file 1", fileicon, t1, dw.POINTER(uintptr(3))) + tree.Insert("tree file 2", fileicon, t1, dw.POINTER(uintptr(4))) + tree.Insert("tree file 3", fileicon, t2, dw.POINTER(uintptr(5))) + tree.Insert("tree file 4", fileicon, t2, dw.POINTER(uintptr(6))) + t1.Change("tree folder 1", foldericon) + t2.Change("tree folder 2", foldericon) + t2.SetData(dw.POINTER(uintptr(100))) + fmt.Printf("t1 title \"%s\" data %d t2 data %d\n", t1.GetTitle(), uintptr(t1.GetData()), uintptr(t2.GetData())) +} + +// Page 4 +func container_add(notebookbox4 dw.HBOX) { + var z int + titles := []string{"Type", "Size", "Time", "Date"} + flags := []uint{dw.CFA_BITMAPORICON | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_ULONG | dw.CFA_RIGHT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_TIME | dw.CFA_CENTER | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_DATE | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR} + + /* create a box to pack into the notebook page */ + containerbox := dw.BoxNew(dw.HORZ, 2) + notebookbox4.PackStart(containerbox, 500, 200, dw.TRUE, dw.TRUE, 0) + + /* now a container area under this box */ + container := dw.ContainerNew(100, dw.TRUE) + notebookbox4.PackStart(container, 500, 200, dw.TRUE, dw.FALSE, 1) + + /* and a status area to see whats going on */ + container_status := dw.StatusTextNew("", 0) + notebookbox4.PackStart(container_status, 100, -1, dw.TRUE, dw.FALSE, 1) + + container.SetColumnTitle("Test") + container.FileSystemSetup(flags, titles) + container.SetStripe(dw.CLR_DEFAULT, dw.CLR_DEFAULT) + containerinfo := container.Alloc(3) + + for z = 0; z < 3; z++ { + var thisicon dw.HICN = fileicon + + if z == 0 { + thisicon = foldericon + } + fmt.Printf("Initial: container: %x containerinfo: %x icon: %x\n", uintptr(dw.HANDLE_TO_POINTER(container)), + dw.HANDLE_TO_UINTPTR(containerinfo), uintptr(dw.POINTER(thisicon))) + containerinfo.SetFile(z, fmt.Sprintf("Filename %d", z+1), thisicon) + containerinfo.SetItemIcon(0, z, thisicon) + containerinfo.SetItemULong(1, z, uint(z*100)) + containerinfo.SetItemTime(2, z, z+10, z+10, z+10) + containerinfo.SetItemDate(3, z, z+10, z+10, z+2000) + containerinfo.SetRowTitle(z, fmt.Sprintf("We can now allocate from the stack: Item: %d", z)) + containerinfo.SetRowData(z, dw.POINTER(uintptr(z))) + } + containerinfo.Insert() + + containerinfo = container.Alloc(1) + containerinfo.SetFile(0, "Yikes", foldericon) + containerinfo.SetItemIcon(0, 0, foldericon) + containerinfo.SetItemULong(1, 0, 324) + containerinfo.SetItemTime(2, 0, z+10, z+10, z+10) + containerinfo.SetItemDate(3, 0, z+10, z+10, z+2000) + containerinfo.SetRowTitle(0, "Extra") + + containerinfo.Insert() + container.Optimize() + + container_mle := dw.MLENew(111) + containerbox.PackStart(container_mle, 500, 200, dw.TRUE, dw.TRUE, 0) + + mle_point = container_mle.Import("", -1) + mle_point = container_mle.Import(fmt.Sprintf("[%d]", mle_point), mle_point) + mle_point = container_mle.Import(fmt.Sprintf("[%d]abczxydefijkl", mle_point), mle_point) + dw.Mle_delete(container_mle, 9, 3) + mle_point = container_mle.Import("gh", 12) + newpoint, _ := container_mle.GetSize() + mle_point = newpoint + mle_point = container_mle.Import(fmt.Sprintf("[%d]\r\n\r\n", mle_point), mle_point) + container_mle.SetCursor(mle_point) + /* connect our event trappers... */ + container.ConnectItemEnter(func(window dw.HCONTAINER, text string, itemdata dw.POINTER) int { + container_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), text, uintptr(itemdata))) + return dw.FALSE + }) + container.ConnectItemContext(func(window dw.HCONTAINER, text string, x int, y int, itemdata dw.POINTER) int { + container_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", + dw.HANDLE_TO_UINTPTR(window), text, x, y, uintptr(itemdata))) + return dw.FALSE + }) + + container.ConnectItemSelect(func(window dw.HCONTAINER, item dw.HTREEITEM, text string, itemdata dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", + dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) + container_status.SetText(message) + message = fmt.Sprintf("\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", + dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) + mle_point = container_mle.Import(message, mle_point) + str := container.QueryStart(dw.CRA_SELECTED) + for len(str) > 0 { + mle_point = container_mle.Import(fmt.Sprintf("Selected: %s\r\n", str), mle_point) + str = container.QueryNext(dw.CRA_SELECTED) + } + /* Make the last inserted point the cursor location */ + container_mle.SetCursor(mle_point) + /* set the details of item 0 to new data */ + container.ChangeFile(0, "new data", fileicon) + container.ChangeItemULong(1, 0, 999) + return dw.FALSE + }) + + container.ConnectColumnClick(func(window dw.HCONTAINER, column_num int) int { + var stype = "Unknown" + + if column_num == 0 { + stype = "Filename" + } else { + column_type := window.GetColumnType(column_num - 1) + if column_type == dw.CFA_STRING { + stype = "String" + } else if column_type == dw.CFA_ULONG { + stype = "ULong" + } else if column_type == dw.CFA_DATE { + stype = "Date" + } else if column_type == dw.CFA_TIME { + stype = "Time" + } else if column_type == dw.CFA_BITMAPORICON { + stype = "BitmapOrIcon" + } + } + container_status.SetText(fmt.Sprintf("DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", + dw.HANDLE_TO_UINTPTR(window), column_num, stype)) + return dw.FALSE + }) +} + +// Page 5 +func buttons_add(notebookbox5 dw.HBOX) { + var i int + + /* create a box to pack into the notebook page */ + buttonsbox := dw.BoxNew(dw.VERT, 2) + notebookbox5.PackStart(buttonsbox, 25, 200, dw.TRUE, dw.TRUE, 0) + buttonsbox.SetColor(dw.CLR_RED, dw.CLR_RED) + + calbox := dw.BoxNew(dw.HORZ, 0) + notebookbox5.PackStart(calbox, 500, 200, dw.TRUE, dw.TRUE, 1) + cal := dw.CalendarNew(100) + calbox.PackStart(cal, 180, 120, dw.TRUE, dw.TRUE, 0) + /* + cal.SetDate(2001, 1, 1); + */ + /* + * Create our file toolbar boxes... + */ + buttonboxperm := dw.BoxNew(dw.VERT, 0) + buttonsbox.PackStart(buttonboxperm, 25, 0, dw.FALSE, dw.TRUE, 2) + buttonboxperm.SetColor(dw.CLR_WHITE, dw.CLR_WHITE) + abutton1 := dw.BitmapButtonNewFromFile("Top Button", 0, fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) + buttonboxperm.PackStart(abutton1, 100, 30, dw.FALSE, dw.FALSE, 0) + buttonboxperm.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0) + abutton2 := dw.BitmapButtonNewFromFile("Bottom", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + buttonsbox.PackStart(abutton2, 25, 25, dw.FALSE, dw.FALSE, 0) + abutton2.SetBitmap(0, FILE_ICON_NAME) + + /* Pre-create the percent */ + percent := dw.PercentNew(0) + + create_button(buttonboxperm, buttonsbox, percent) + + /* make a combobox */ + combox := dw.BoxNew(dw.VERT, 2) + notebookbox5.PackStart(combox, 25, 200, dw.TRUE, dw.FALSE, 0) + combobox1 := dw.ComboboxNew("fred", 0) /* no point in specifying an initial value */ + combobox1.Append("fred") + combox.PackStart(combobox1, -1, -1, dw.TRUE, dw.FALSE, 0) + + combobox2 := dw.ComboboxNew("joe", 0) /* no point in specifying an initial value */ + combox.PackStart(combobox2, -1, -1, dw.TRUE, dw.FALSE, 0) + /* add LOTS of items */ + fmt.Printf("before appending 500 items to combobox using dw_listbox_list_append()\n") + text := make([]string, 500) + for i = 0; i < 500; i++ { + text[i] = fmt.Sprintf("item %d", i) + } + combobox2.AppendList(text) + fmt.Printf("after appending 500 items to combobox\n") + /* now insert a couple of items */ + combobox2.Insert("inserted item 2", 2) + combobox2.Insert("inserted item 5", 5) + /* make a spinbutton */ + spinbutton := dw.SpinButtonNew("", 0) /* no point in specifying text */ + combox.PackStart(spinbutton, -1, -1, dw.TRUE, dw.FALSE, 0) + spinbutton.SetLimits(100, 1) + spinbutton.SetPos(30) + + /* make a slider */ + slider := dw.SliderNew(dw.FALSE, 11, 0) /* no point in specifying text */ + combox.PackStart(slider, -1, -1, dw.TRUE, dw.FALSE, 0) + + /* Pack the percent */ + combox.PackStart(percent, -1, -1, dw.TRUE, dw.FALSE, 0) + + /* Connect the handlers */ + abutton1.ConnectClicked(func(window dw.HBUTTON) int { button_callback(combobox1, combobox2, spinbutton, cal); return dw.TRUE }) + abutton2.ConnectClicked(func(window dw.HBUTTON) int { button_callback(combobox1, combobox2, spinbutton, cal); return dw.TRUE }) + combobox1.ConnectListSelect(func(window dw.HLISTBOX, index int) int { + fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration) + iteration++ + return dw.FALSE + }) + combobox2.ConnectListSelect(func(window dw.HLISTBOX, index int) int { + fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration) + iteration++ + return dw.FALSE + }) + spinbutton.ConnectValueChanged(func(hwnd dw.HSPINBUTTON, value int) int { + dw.MessageBox("DWTest", dw.MB_OK, fmt.Sprintf("New value from spinbutton: %d\n", value)) + return dw.FALSE + }) + slider.ConnectValueChanged(func(hwnd dw.HSLIDER, value int) int { percent.SetPos(uint(value * 10)); return dw.FALSE }) +} + +func create_button(buttonboxperm, buttonsbox dw.HBOX, percent dw.HPERCENT) { + filetoolbarbox := dw.BoxNew(dw.VERT, 0) + buttonboxperm.PackStart(filetoolbarbox, 0, 0, dw.TRUE, dw.TRUE, 0) + + abutton1 := dw.BitmapButtonNewFromFile("Empty image. Should be under Top button", 0, "junk") + filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0) + abutton1.ConnectClicked(func(window dw.HBUTTON) int { buttonsbox.SetColor(dw.CLR_RED, dw.CLR_RED); return dw.FALSE }) + + filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0) + + abutton1 = dw.BitmapButtonNewFromFile("A borderless bitmapbitton", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0) + abutton1.ConnectClicked(func(window dw.HBUTTON) int { buttonsbox.SetColor(dw.CLR_YELLOW, dw.CLR_YELLOW); return dw.FALSE }) + + filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0) + abutton1.SetStyle(dw.BS_NOBORDER, dw.BS_NOBORDER) + + //abutton1 = dw.Bitmapbutton_new_from_data("A button from data", 0, folder_ico, 1718 ); + abutton1 = dw.BitmapButtonNewFromFile("A button from data", 0, "junk") + filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0) + abutton1.ConnectClicked(func(window dw.HBUTTON) int { percent.SetPos(dw.PERCENT_INDETERMINATE); return dw.FALSE }) + + filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0) +} + +// Page 8 +func scrollbox_add(notebookbox8 dw.HBOX) { + var i int + + /* create a box to pack into the notebook page */ + scrollbox := dw.ScrollBoxNew(dw.VERT, 0) + notebookbox8.PackStart(scrollbox, 0, 0, dw.TRUE, dw.TRUE, 1) + + abutton1 := dw.ButtonNew("Show Adjustments", 0) + scrollbox.PackStart(abutton1, -1, 30, dw.FALSE, dw.FALSE, 0) + abutton1.ConnectClicked(func(window dw.HBUTTON) int { + _, pos := scrollbox.GetPos() + _, rng := scrollbox.GetRange() + fmt.Printf("Pos %d Range %d\n", pos, rng) + return dw.FALSE + }) + + for i = 0; i < MAX_WIDGETS; i++ { + tmpbox := dw.BoxNew(dw.HORZ, 0) + scrollbox.PackStart(tmpbox, 0, 24, dw.TRUE, dw.FALSE, 2) + label := dw.TextNew(fmt.Sprintf("Label %d", i), 0) + tmpbox.PackStart(label, 0, 20, dw.TRUE, dw.FALSE, 0) + item := dw.EntryfieldNew(fmt.Sprintf("Entry %d", i), uint(i)) + tmpbox.PackStart(item, 0, 20, dw.TRUE, dw.FALSE, 0) + } +} + +// Page 9 +func update_mle(text string, lock int) { + /* Protect pos from being changed by different threads */ + if lock != 0 { + mutex.Lock() + } + mlepos = threadmle.Import(text, mlepos) + threadmle.SetCursor(mlepos) + if lock != 0 { + mutex.Unlock() + } +} + +func thread_add(notebookbox9 dw.HBOX) { + /* create a box to pack into the notebook page */ + tmpbox := dw.BoxNew(dw.VERT, 0) + notebookbox9.PackStart(tmpbox, 0, 0, dw.TRUE, dw.TRUE, 1) + + startbutton = dw.ButtonNew("Start Threads", 0) + tmpbox.PackStart(startbutton, -1, 30, dw.FALSE, dw.FALSE, 0) + /* Create the base threading components */ + threadmle = dw.MLENew(0) + tmpbox.PackStart(threadmle, 1, 1, dw.TRUE, dw.TRUE, 0) + mutex = dw.MutexNew() + workevent = dw.EventNew() + /* Connect signal handlers */ + startbutton.ConnectClicked(func(window dw.HBUTTON) int { + startbutton.Disable() + mutex.Lock() + controlevent = dw.EventNew() + workevent.Reset() + finished = dw.FALSE + ready = 0 + update_mle("Starting thread 1\r\n", dw.FALSE) + go run_thread(1) + update_mle("Starting thread 2\r\n", dw.FALSE) + go run_thread(2) + update_mle("Starting thread 3\r\n", dw.FALSE) + go run_thread(3) + update_mle("Starting thread 4\r\n", dw.FALSE) + go run_thread(4) + update_mle("Starting control thread\r\n", dw.FALSE) + go control_thread() + mutex.Unlock() + return dw.FALSE + }) + +} + +func run_thread(threadnum int) { + dw.InitThread() + update_mle(fmt.Sprintf("Thread %d started.\r\n", threadnum), dw.TRUE) + + /* Increment the ready count while protected by mutex */ + mutex.Lock() + ready++ + /* If all 4 threads have incrememted the ready count... + * Post the control event semaphore so things will get started. + */ + if ready == 4 { + controlevent.Post() + } + mutex.Unlock() + + for finished == 0 { + result := workevent.Wait(2000) + + if result == dw.ERROR_TIMEOUT { + update_mle(fmt.Sprintf("Thread %d timeout waiting for event.\r\n", threadnum), dw.TRUE) + } else if result == dw.ERROR_NONE { + update_mle(fmt.Sprintf("Thread %d doing some work.\r\n", threadnum), dw.TRUE) + /* Pretend to do some work */ + dw.MainSleep(1000 * threadnum) + + /* Increment the ready count while protected by mutex */ + mutex.Lock() + ready++ + buf := fmt.Sprintf("Thread %d work done. ready=%d", threadnum, ready) + /* If all 4 threads have incrememted the ready count... + * Post the control event semaphore so things will get started. + */ + if ready == 4 { + controlevent.Post() + buf = fmt.Sprintf("%s%s", buf, " Control posted.") + } + mutex.Unlock() + update_mle(fmt.Sprintf("%s\r\n", buf), dw.TRUE) + } else { + update_mle(fmt.Sprintf("Thread %d error %d.\r\n", threadnum), dw.TRUE) + dw.MainSleep(10000) + } + } + update_mle(fmt.Sprintf("Thread %d finished.\r\n", threadnum), dw.TRUE) + dw.DeinitThread() +} + +func control_thread() { + dw.InitThread() + + inprogress := 5 + + for inprogress != 0 { + result := controlevent.Wait(2000) + + if result == dw.ERROR_TIMEOUT { + update_mle("Control thread timeout waiting for event.\r\n", dw.TRUE) + } else if result == dw.ERROR_NONE { + /* Reset the control event */ + controlevent.Reset() + ready = 0 + update_mle(fmt.Sprintf("Control thread starting worker threads. Inprogress=%d\r\n", inprogress), dw.TRUE) + /* Start the work threads */ + workevent.Post() + dw.MainSleep(100) + /* Reset the work event */ + workevent.Reset() + inprogress-- + } else { + update_mle(fmt.Sprintf("Control thread error %d.\r\n", result), dw.TRUE) + dw.MainSleep(10000) + } + } + /* Tell the other threads we are done */ + finished = dw.TRUE + workevent.Post() + /* Close the control event */ + controlevent.Close() + update_mle("Control thread finished.\r\n", dw.TRUE) + startbutton.Enable() + dw.DeinitThread() +} + +func main() { + /* Pick an approriate font for our platform */ + if runtime.GOOS == "windows" { + FIXEDFONT = "10.Lucida Console" + } else if runtime.GOOS == "darwin" { + FIXEDFONT = "9.Monaco" + } + + /* Locate the source root of the package */ + pkg, err := build.Import("dwtest", "", build.FindOnly) + if err == nil && len(pkg.SrcRoot) > 0 { + SRCROOT = fmt.Sprintf("%s/dwtest", pkg.SrcRoot) + } + + /* Initialize the Dynamic Windows engine */ + dw.Init(dw.TRUE) + + /* Create our window */ + mainwindow := dw.WindowNew(dw.DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", dw.FCF_SYSMENU|dw.FCF_TITLEBAR|dw.FCF_TASKLIST|dw.FCF_DLGBORDER|dw.FCF_SIZEBORDER|dw.FCF_MINMAX) + + menu_add(mainwindow) + + notebookbox := dw.BoxNew(dw.VERT, 5) + mainwindow.PackStart(notebookbox, 0, 0, dw.TRUE, dw.TRUE, 0) + + foldericon = dw.IconLoadFromFile(FOLDER_ICON_NAME) + if foldericon == dw.NOHICN && len(SRCROOT) > 0 { + foldericon = dw.IconLoadFromFile(fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + } + fileicon = dw.IconLoadFromFile(FILE_ICON_NAME) + if fileicon == dw.NOHICN && len(SRCROOT) > 0 { + fileicon = dw.IconLoadFromFile(fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) + } + notebook := dw.NotebookNew(1, dw.TRUE) + notebookbox.PackStart(notebook, 100, 100, dw.TRUE, dw.TRUE, 0) + notebook.ConnectSwitchPage(func(window dw.HNOTEBOOK, page_num dw.HNOTEPAGE) int { + fmt.Printf("DW_SIGNAL_SWITCH_PAGE: PageNum: %d\n", dw.HNOTEPAGE_TO_UINT(page_num)) + return dw.FALSE + }) + + notebookbox1 := dw.BoxNew(dw.VERT, 5) + notebookpage1 := notebook.PageNew(0, dw.TRUE) + notebookpage1.Pack(notebookbox1) + notebookpage1.SetText("buttons and entry") + archive_add(notebookbox1) + + notebookbox2 := dw.BoxNew(dw.VERT, 5) + notebookpage2 := notebook.PageNew(1, dw.FALSE) + notebookpage2.Pack(notebookbox2) + notebookpage2.SetText("render") + text_add(notebookbox2) + + notebookbox3 := dw.BoxNew(dw.VERT, 5) + notebookpage3 := notebook.PageNew(1, dw.FALSE) + notebookpage3.Pack(notebookbox3) + notebookpage3.SetText("tree") + tree_add(notebookbox3) + + notebookbox4 := dw.BoxNew(dw.VERT, 5) + notebookpage4 := notebook.PageNew(1, dw.FALSE) + notebookpage4.Pack(notebookbox4) + notebookpage4.SetText("container") + container_add(notebookbox4) + + notebookbox5 := dw.BoxNew(dw.VERT, 5) + notebookpage5 := notebook.PageNew(1, dw.FALSE) + notebookpage5.Pack(notebookbox5) + notebookpage5.SetText("buttons") + buttons_add(notebookbox5) + + /* DEPRECATED + notebookbox6 := dw.BoxNew(dw.VERT, 5); + notebookpage6 := notebook.PageNew(1, dw.FALSE ); + notebookpage6.Pack(notebookbox6); + notebookpage6.SetText("mdi"); + mdi_add(notebookbox6); + */ + + notebookbox7 := dw.BoxNew(dw.VERT, 6) + notebookpage7 := notebook.PageNew(1, dw.FALSE) + notebookpage7.Pack(notebookbox7) + notebookpage7.SetText("html") + + rawhtml := dw.HtmlNew(1001) + if rawhtml.GetHandle() != nil { + notebookbox7.PackStart(rawhtml, 0, 100, dw.TRUE, dw.FALSE, 0) + rawhtml.Raw("<html><body><center><h1>dwtest</h1></center></body></html>") + html := dw.HtmlNew(1002) + notebookbox7.PackStart(html, 0, 100, dw.TRUE, dw.TRUE, 0) + html.URL("http://dwindows.netlabs.org") + } else { + label := dw.Text_new("HTML widget not available.", 0) + notebookbox7.PackStart(label, 0, 100, dw.TRUE, dw.TRUE, 0) + } + + notebookbox8 := dw.BoxNew(dw.VERT, 7) + notebookpage8 := notebook.PageNew(1, dw.FALSE) + notebookpage8.Pack(notebookbox8) + notebookpage8.SetText("scrollbox") + scrollbox_add(notebookbox8) + + notebookbox9 := dw.BoxNew(dw.VERT, 8) + notebookpage9 := notebook.PageNew(1, dw.FALSE) + notebookpage9.Pack(notebookbox9) + notebookpage9.SetText("thread/event") + thread_add(notebookbox9) + + mainwindow.ConnectDelete(func(window dw.HWND) int { return exit_handler() }) + /* + * The following is a special case handler for the Mac and other platforms which contain + * an application object which can be closed. It function identically to a window delete/close + * request except it applies to the entire application not an individual window. If it is not + * handled or you allow the default handler to take place the entire application will close. + * On platforms which do not have an application object this line will be ignored. + */ + dw.DESKTOP.ConnectDelete(func(window dw.HWND) int { return exit_handler() }) + timerid = dw.TimerNew() + /* Return dw.TRUE so we get called again */ + timerid.Connect(func() int { dw.Beep(200, 200); return dw.TRUE }, 2000) + + mainwindow.SetSize(640, 550) + mainwindow.Show() + + /* Now that the window is created and shown... + * run the main loop until we get dw_main_quit() + */ + dw.Main() + + /* Now that the loop is done we can cleanup */ + dw.TaskbarDelete(textbox1, fileicon) + mainwindow.Destroy() + + fmt.Printf("dwtest exiting...\n") + /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ + dw.Shutdown() +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwootest/dwootest.rc Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,6 @@ +#include "winuser.h" +#ifdef DW64 +1 RT_MANIFEST dwootest.exe.x64.manifest +#else +1 RT_MANIFEST dwootest.exe.x86.manifest +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwootest/makesyso.bat Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,3 @@ +@echo off +windres -i dwootest.rc -o dwootest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 +windres -i dwootest.rc -o dwootest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtest/dwtest.exe.x64.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="AMD64" + name="dwtest" + type="win32" +/> +<description>Dynamic Windows Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="AMD64" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtest/dwtest.exe.x86.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="X86" + name="dwtest" + type="win32" +/> +<description>Dynamic Windows Test</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtest/dwtest.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,1663 @@ +package main + +import ( + "bufio" + "bytes" + "fmt" + "go/build" + "hg.code.sf.net/p/godwindows/code.hg/dw" + "io" + "os" + "runtime" +) + +// Global variables +const ( + FALSE int = iota + TRUE +) + +var FIXEDFONT = "10.monospace" + +var mainwindow dw.HWND + +// Page 1 +var notebookbox1 dw.HBOX +var cursortogglebutton dw.HBUTTON +var noncheckable_menuitem, checkable_menuitem dw.HMENUITEM +var copypastefield, entryfield dw.HENTRYFIELD +var current_color dw.COLOR = dw.RGB(100, 100, 100) +var cursor_arrow bool = true +var timerid dw.HTIMER + +// Page 2 +var notebookbox2 dw.HBOX +var textbox1, textbox2 dw.HRENDER +var status1, status2 dw.HTEXT +var vscrollbar, hscrollbar dw.HSCROLLBAR +var rendcombo dw.HLISTBOX +var imagexspin, imageyspin dw.HSPINBUTTON +var imagestretchcheck dw.HBUTTON +var text1pm, text2pm, image dw.HPIXMAP +var image_x = 20 +var image_y = 20 +var image_stretch int = FALSE +var font_width = 8 +var font_height = 12 +var rows = 10 +var width1 = 6 +var cols = 80 +var render_type = 0 +var current_row = 0 +var current_col = 0 +var max_linewidth = 0 + +// Page 3 +var notebookbox3 dw.HBOX +var tree dw.HTREE + +// Page 4 +var notebookbox4 dw.HBOX +var container_mle dw.HMLE +var container dw.HCONTAINER +var mle_point = 0 + +// Page 5 +var notebookbox5, buttonboxperm, buttonsbox dw.HBOX +var combobox1, combobox2 dw.HLISTBOX +var cal dw.HCALENDAR +var spinbutton dw.HSPINBUTTON +var slider dw.HSLIDER +var percent dw.HPERCENT + +// Page 7 +var notebookbox7 dw.HBOX +var html dw.HHTML + +// Page 8 +var notebookbox8 dw.HBOX +var scrollbox dw.HSCROLLBOX +var MAX_WIDGETS = 20 + +var iteration = 0 + +// Page 9 +var notebookbox9 dw.HBOX +var threadmle dw.HMLE +var startbutton dw.HBUTTON +var mutex dw.HMTX +var workevent, controlevent dw.HEV +var finished = 0 +var ready = 0 +var mlepos = 0 + +// Miscellaneous +var fileicon, foldericon dw.HICN +var current_file string +var lines []string +var menu_enabled bool = true + +var FOLDER_ICON_NAME string = "folder" +var FILE_ICON_NAME string = "file" +var SRCROOT string + +func read_file() { + var ( + file *os.File + part []byte + prefix bool + length int + err error + ) + + lines = nil + max_linewidth = 0 + + if file, err = os.Open(current_file); err != nil { + return + } + reader := bufio.NewReader(file) + buffer := bytes.NewBuffer(make([]byte, 1024)) + buffer.Reset() + for { + if part, prefix, err = reader.ReadLine(); err != nil { + break + } + buffer.Write(part) + if !prefix { + lines = append(lines, buffer.String()) + length = len(buffer.String()) + if length > max_linewidth { + max_linewidth = length + } + buffer.Reset() + } + } + if err == io.EOF { + err = nil + } + dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) + dw.Scrollbar_set_pos(hscrollbar, 0) + dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) + dw.Scrollbar_set_pos(vscrollbar, 0) +} + +// Call back section +func exit_callback(window dw.HWND, data dw.POINTER) int { + if dw.Messagebox("dwtest", dw.MB_YESNO|dw.MB_QUESTION, "Are you sure you want to exit?") != 0 { + dw.Main_quit() + } + return TRUE +} + +func switch_page_callback(window dw.HNOTEBOOK, page_num dw.HNOTEPAGE, itemdata dw.POINTER) int { + fmt.Printf("DW_SIGNAL_SWITCH_PAGE: PageNum: %d\n", dw.HNOTEPAGE_TO_UINT(page_num)) + return FALSE +} + +func menu_callback(window dw.HMENUITEM, data dw.POINTER) int { + info := *(*string)(data) + buf := fmt.Sprintf("%s menu item selected", info) + dw.Messagebox("Menu Item Callback", dw.MB_OK|dw.MB_INFORMATION, buf) + return FALSE +} + +func menutoggle_callback(window dw.HMENUITEM, data dw.POINTER) int { + if menu_enabled { + dw.Window_set_style(checkable_menuitem, dw.MIS_DISABLED, dw.MIS_DISABLED) + dw.Window_set_style(noncheckable_menuitem, dw.MIS_DISABLED, dw.MIS_DISABLED) + menu_enabled = false + } else { + dw.Window_set_style(checkable_menuitem, dw.MIS_DISABLED, dw.MIS_ENABLED) + dw.Window_set_style(noncheckable_menuitem, dw.MIS_DISABLED, dw.MIS_ENABLED) + menu_enabled = true + } + return FALSE +} + +func helpabout_callback(window dw.HMENUITEM, data dw.POINTER) int { + var env dw.Env + + dw.Environment_query(&env) + message := fmt.Sprintf("dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\ndwindows Version: %d.%d.%d", + env.OSName, env.BuildDate, env.BuildTime, + env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild, + env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion) + dw.Messagebox("About dwindows", dw.MB_OK|dw.MB_INFORMATION, message) + return FALSE +} + +// Page 1 Callbacks +func paste_clicked_callback(button dw.HBUTTON, data dw.POINTER) int { + test := dw.Clipboard_get_text() + + if len(test) > 0 { + dw.Window_set_text(copypastefield, test) + } + return TRUE +} + +func copy_clicked_callback(button dw.HBUTTON, data dw.POINTER) int { + test := dw.Window_get_text(copypastefield) + + if len(test) > 0 { + dw.Clipboard_set_text(test) + } + dw.Window_set_focus(entryfield) + return TRUE +} + +func browse_file_callback(window dw.HBUTTON, data dw.POINTER) int { + tmp := dw.File_browse("Pick a file", "dwtest.c", "c", dw.FILE_OPEN) + if len(tmp) > 0 { + current_file = tmp + dw.Window_set_text(entryfield, current_file) + read_file() + current_col = 0 + current_row = 0 + update_render() + } + dw.Window_set_focus(copypastefield) + return FALSE +} + +func browse_folder_callback(window dw.HBUTTON, data dw.POINTER) int { + tmp := dw.File_browse("Pick a folder", ".", "c", dw.DIRECTORY_OPEN) + fmt.Printf("Folder picked: %s\n", tmp) + return FALSE +} + +func colorchoose_callback(window dw.HBUTTON, data dw.POINTER) int { + current_color = dw.Color_choose(current_color) + return FALSE +} + +func cursortoggle_callback(window dw.HBUTTON, data dw.POINTER) int { + if cursor_arrow { + dw.Window_set_text(cursortogglebutton, "Set Cursor pointer - ARROW") + dw.Window_set_pointer(dw.POINTER_TO_HANDLE(data), dw.POINTER_CLOCK) + cursor_arrow = false + } else { + dw.Window_set_text(cursortogglebutton, "Set Cursor pointer - CLOCK") + dw.Window_set_pointer(dw.POINTER_TO_HANDLE(data), dw.POINTER_DEFAULT) + cursor_arrow = true + } + return FALSE +} + +func beep_callback(window dw.HBUTTON, data dw.POINTER) int { + dw.Timer_disconnect(timerid) + return TRUE +} + +/* Beep every second */ +func timer_callback(data dw.POINTER) int { + dw.Beep(200, 200) + + /* Return TRUE so we get called again */ + return TRUE +} + +// Page 2 Callbacks +func motion_notify_event(window dw.HRENDER, x int, y int, buttonmask int, data dw.POINTER) int { + var which = "button_press" + + if uintptr(data) > 0 { + which = "motion_notify" + } + dw.Window_set_text(status2, fmt.Sprintf("%s: %dx%d", which, x, y)) + return FALSE +} + +func show_window_callback(window dw.HMENUITEM, data dw.POINTER) int { + thiswindow := dw.POINTER_TO_HANDLE(data) + + if thiswindow != dw.NOHWND { + dw.Window_show(thiswindow) + dw.Window_raise(thiswindow) + } + return TRUE +} + +func context_menu_event(window dw.HANDLE, x int, y int, buttonmask int, data dw.POINTER) int { + hwndMenu := dw.Menu_new(0) + menuitem := dw.Menu_append_item(hwndMenu, "~Quit", dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) + + dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + dw.Menu_append_item(hwndMenu, dw.MENU_SEPARATOR, dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) + menuitem = dw.Menu_append_item(hwndMenu, "~Show Window", dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) + dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&show_window_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + px, py := dw.Pointer_query_pos() + /* Use the toplevel window handle here.... because on the Mac.. + * using the control itself, when a different tab is active + * the control is removed from the window and can no longer + * handle the messages. + */ + dw.Menu_popup(hwndMenu, mainwindow, px, py) + return TRUE +} + +/* When hpma is not NULL we are printing.. so handle things differently */ +func draw_file(row int, col int, nrows int, fheight int, hpma dw.HPIXMAP) { + var hpm dw.HPIXMAP + + if hpma == dw.NOHPIXMAP { + hpm = text2pm + } else { + hpm = hpma + } + + if len(current_file) > 0 { + var i int + + dw.Color_foreground_set(dw.CLR_WHITE) + if hpma == dw.NOHPIXMAP { + dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)) + } + dw.Draw_rect(dw.NOHWND, hpm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(hpm), dw.Pixmap_height(hpm)) + + for i = 0; (i < nrows) && (i+row < len(lines)); i++ { + fileline := i + row - 1 + y := i * fheight + dw.Color_background_set(dw.COLOR(1 + (fileline % 15))) + dw.Color_foreground_set(dw.COLOR(fileline % 16)) + if hpma == dw.NOHPIXMAP { + dw.Draw_text(dw.NOHWND, text1pm, 0, y, fmt.Sprintf("%6.6d", i+row)) + } + thisline := lines[i+row] + if len(thisline) > col { + dw.Draw_text(dw.NOHWND, hpm, 0, y, thisline[col:]) + } + } + if hpma == dw.NOHPIXMAP { + text_expose(textbox1, 0, 0, 0, 0, nil) + text_expose(textbox2, 0, 0, 0, 0, nil) + } + } +} + +/* When hpma is not NULL we are printing.. so handle things differently */ +func draw_shapes(direct int, hpma dw.HPIXMAP) { + var hpm, pixmap dw.HPIXMAP = dw.NOHPIXMAP, dw.NOHPIXMAP + var window dw.HRENDER + if hpma != dw.NOHPIXMAP { + hpm = hpma + } else { + hpm = text2pm + } + if direct == TRUE { + window = textbox2 + } else { + pixmap = hpm + } + + width := dw.Pixmap_width(hpm) + height := dw.Pixmap_height(hpm) + + x := []int{20, 180, 180, 230, 180, 180, 20} + y := []int{50, 50, 20, 70, 120, 90, 90} + + image_x = dw.Spinbutton_get_pos(imagexspin) + image_y = dw.Spinbutton_get_pos(imageyspin) + image_stretch = dw.Checkbox_get(imagestretchcheck) + + dw.Color_foreground_set(dw.CLR_WHITE) + dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, width, height) + dw.Color_foreground_set(dw.CLR_DARKPINK) + dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 10, 10, width-20, height-20) + dw.Color_foreground_set(dw.CLR_GREEN) + dw.Color_background_set(dw.CLR_DARKRED) + dw.Draw_text(window, pixmap, 10, 10, "This should be aligned with the edges.") + dw.Color_foreground_set(dw.CLR_YELLOW) + dw.Draw_line(window, pixmap, width-10, 10, 10, height-10) + dw.Color_foreground_set(dw.CLR_BLUE) + dw.Draw_polygon(window, pixmap, dw.DRAW_FILL, x, y) + dw.Color_foreground_set(dw.CLR_BLACK) + dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 80, 80, 80, 40) + dw.Color_foreground_set(dw.CLR_CYAN) + /* Bottom right corner */ + dw.Draw_arc(window, pixmap, 0, width-30, height-30, width-10, height-30, width-30, height-10) + /* Top right corner */ + dw.Draw_arc(window, pixmap, 0, width-30, 30, width-30, 10, width-10, 30) + /* Bottom left corner */ + dw.Draw_arc(window, pixmap, 0, 30, height-30, 30, height-10, 10, height-30) + /* Full circle in the left top area */ + dw.Draw_arc(window, pixmap, dw.DRAW_FULL, 120, 100, 80, 80, 160, 120) + if image != dw.NOHPIXMAP { + if image_stretch == TRUE { + dw.Pixmap_stretch_bitblt(window, pixmap, 10, 10, width-20, height-20, dw.NOHWND, image, 0, 0, dw.Pixmap_width(image), dw.Pixmap_height(image)) + } else { + dw.Pixmap_bitblt(window, pixmap, image_x, image_y, dw.Pixmap_width(image), dw.Pixmap_height(image), dw.NOHWND, image, 0, 0) + } + } + + /* If we aren't drawing direct do a bitblt */ + if direct == FALSE && hpma == dw.NOHPIXMAP { + text_expose(textbox2, 0, 0, 0, 0, nil) + } +} + +func update_render() { + switch render_type { + case 0: + draw_shapes(FALSE, dw.NOHPIXMAP) + case 1: + draw_shapes(TRUE, dw.NOHPIXMAP) + case 2: + draw_file(current_row, current_col, rows, font_height, dw.NOHPIXMAP) + } +} + +func draw_page(print dw.HPRINT, pixmap dw.HPIXMAP, page_num int, data dw.POINTER) int { + dw.Pixmap_set_font(pixmap, FIXEDFONT) + if page_num == 0 { + draw_shapes(FALSE, pixmap) + } else if page_num == 1 { + /* If we have a file to display... */ + if len(current_file) > 0 { + /* Calculate new dimensions */ + _, fheight := dw.Font_text_extents_get(dw.NOHWND, pixmap, "(g") + nrows := int(dw.Pixmap_height(pixmap) / fheight) + + /* Do the actual drawing */ + draw_file(0, 0, nrows, fheight, pixmap) + } else { + /* We don't have a file so center an error message on the page */ + var text = "No file currently selected!" + + /* Get the font size for this printer context... */ + fwidth, fheight := dw.Font_text_extents_get(dw.NOHWND, pixmap, text) + + posx := int(dw.Pixmap_width(pixmap)-fwidth) / 2 + posy := int(dw.Pixmap_height(pixmap)-fheight) / 2 + + dw.Color_foreground_set(dw.CLR_BLACK) + dw.Color_background_set(dw.CLR_WHITE) + dw.Draw_text(dw.NOHWND, pixmap, posx, posy, text) + } + } + return TRUE +} + +func print_callback(window dw.HANDLE, data dw.POINTER) int { + print := dw.Print_new("DWTest Job", 0, 2, dw.SIGNAL_FUNC(&draw_page_func), nil) + dw.Print_run(print, 0) + return FALSE +} + +/* This gets called when a part of the graph needs to be repainted. */ +func text_expose(hwnd dw.HRENDER, x int, y int, width int, height int, data dw.POINTER) int { + if render_type != 1 { + var hpm dw.HPIXMAP + + if hwnd.GetHandle() == textbox1.GetHandle() { + hpm = text1pm + } else if hwnd.GetHandle() == textbox2.GetHandle() { + hpm = text2pm + } else { + return TRUE + } + + width = dw.Pixmap_width(hpm) + height = dw.Pixmap_height(hpm) + + dw.Pixmap_bitblt(hwnd, dw.NOHPIXMAP, 0, 0, width, height, dw.NOHWND, hpm, 0, 0) + dw.Flush() + } else { + update_render() + } + return TRUE +} + +/* Handle size change of the main render window */ +func configure_event(hwnd dw.HRENDER, width int, height int, data dw.POINTER) int { + old1 := text1pm + old2 := text2pm + depth := dw.Color_depth_get() + + rows = height / font_height + cols = width / font_width + + /* Create new pixmaps with the current sizes */ + text1pm = dw.Pixmap_new(textbox1, uint(font_width*(width1)), uint(height), depth) + text2pm = dw.Pixmap_new(textbox2, uint(width), uint(height), depth) + + /* Make sure the side area is cleared */ + dw.Color_foreground_set(dw.CLR_WHITE) + dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)) + + /* Destroy the old pixmaps */ + dw.Pixmap_destroy(old1) + dw.Pixmap_destroy(old2) + + /* Update scrollbar ranges with new values */ + dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) + dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) + + /* Redraw the window */ + update_render() + return TRUE +} + +func refresh_callback(window dw.HBUTTON, data dw.POINTER) int { + update_render() + return FALSE +} + +func render_select_event_callback(window dw.HLISTBOX, index int, data dw.POINTER) int { + if index != render_type { + if index == 2 { + dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) + dw.Scrollbar_set_pos(hscrollbar, 0) + dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) + dw.Scrollbar_set_pos(vscrollbar, 0) + current_col = 0 + current_row = 0 + } else { + dw.Scrollbar_set_range(hscrollbar, 0, 0) + dw.Scrollbar_set_pos(hscrollbar, 0) + dw.Scrollbar_set_range(vscrollbar, 0, 0) + dw.Scrollbar_set_pos(vscrollbar, 0) + } + render_type = index + update_render() + } + return FALSE +} + +/* Callback to handle user selection of the scrollbar position */ +func scrollbar_valuechanged_callback(hwnd dw.HSCROLLBAR, value int, data dw.POINTER) int { + if data != nil { + stext := dw.POINTER_TO_HANDLE(data) + + if hwnd == vscrollbar { + current_row = value + } else { + current_col = value + } + dw.Window_set_text(stext, fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)) + update_render() + } + return FALSE +} + +func resolve_keyname(vk int) string { + var keyname string = "<unknown>" + + switch vk { + case dw.VK_LBUTTON: + keyname = "VK_LBUTTON" + case dw.VK_RBUTTON: + keyname = "VK_RBUTTON" + case dw.VK_CANCEL: + keyname = "VK_CANCEL" + case dw.VK_MBUTTON: + keyname = "VK_MBUTTON" + case dw.VK_TAB: + keyname = "VK_TAB" + case dw.VK_CLEAR: + keyname = "VK_CLEAR" + case dw.VK_RETURN: + keyname = "VK_RETURN" + case dw.VK_PAUSE: + keyname = "VK_PAUSE" + case dw.VK_CAPITAL: + keyname = "VK_CAPITAL" + case dw.VK_ESCAPE: + keyname = "VK_ESCAPE" + case dw.VK_SPACE: + keyname = "VK_SPACE" + case dw.VK_PRIOR: + keyname = "VK_PRIOR" + case dw.VK_NEXT: + keyname = "VK_NEXT" + case dw.VK_END: + keyname = "VK_END" + case dw.VK_HOME: + keyname = "VK_HOME" + case dw.VK_LEFT: + keyname = "VK_LEFT" + case dw.VK_UP: + keyname = "VK_UP" + case dw.VK_RIGHT: + keyname = "VK_RIGHT" + case dw.VK_DOWN: + keyname = "VK_DOWN" + case dw.VK_SELECT: + keyname = "VK_SELECT" + case dw.VK_PRINT: + keyname = "VK_PRINT" + case dw.VK_EXECUTE: + keyname = "VK_EXECUTE" + case dw.VK_SNAPSHOT: + keyname = "VK_SNAPSHOT" + case dw.VK_INSERT: + keyname = "VK_INSERT" + case dw.VK_DELETE: + keyname = "VK_DELETE" + case dw.VK_HELP: + keyname = "VK_HELP" + case dw.VK_LWIN: + keyname = "VK_LWIN" + case dw.VK_RWIN: + keyname = "VK_RWIN" + case dw.VK_NUMPAD0: + keyname = "VK_NUMPAD0" + case dw.VK_NUMPAD1: + keyname = "VK_NUMPAD1" + case dw.VK_NUMPAD2: + keyname = "VK_NUMPAD2" + case dw.VK_NUMPAD3: + keyname = "VK_NUMPAD3" + case dw.VK_NUMPAD4: + keyname = "VK_NUMPAD4" + case dw.VK_NUMPAD5: + keyname = "VK_NUMPAD5" + case dw.VK_NUMPAD6: + keyname = "VK_NUMPAD6" + case dw.VK_NUMPAD7: + keyname = "VK_NUMPAD7" + case dw.VK_NUMPAD8: + keyname = "VK_NUMPAD8" + case dw.VK_NUMPAD9: + keyname = "VK_NUMPAD9" + case dw.VK_MULTIPLY: + keyname = "VK_MULTIPLY" + case dw.VK_ADD: + keyname = "VK_ADD" + case dw.VK_SEPARATOR: + keyname = "VK_SEPARATOR" + case dw.VK_SUBTRACT: + keyname = "VK_SUBTRACT" + case dw.VK_DECIMAL: + keyname = "VK_DECIMAL" + case dw.VK_DIVIDE: + keyname = "VK_DIVIDE" + case dw.VK_F1: + keyname = "VK_F1" + case dw.VK_F2: + keyname = "VK_F2" + case dw.VK_F3: + keyname = "VK_F3" + case dw.VK_F4: + keyname = "VK_F4" + case dw.VK_F5: + keyname = "VK_F5" + case dw.VK_F6: + keyname = "VK_F6" + case dw.VK_F7: + keyname = "VK_F7" + case dw.VK_F8: + keyname = "VK_F8" + case dw.VK_F9: + keyname = "VK_F9" + case dw.VK_F10: + keyname = "VK_F10" + case dw.VK_F11: + keyname = "VK_F11" + case dw.VK_F12: + keyname = "VK_F12" + case dw.VK_F13: + keyname = "VK_F13" + case dw.VK_F14: + keyname = "VK_F14" + case dw.VK_F15: + keyname = "VK_F15" + case dw.VK_F16: + keyname = "VK_F16" + case dw.VK_F17: + keyname = "VK_F17" + case dw.VK_F18: + keyname = "VK_F18" + case dw.VK_F19: + keyname = "VK_F19" + case dw.VK_F20: + keyname = "VK_F20" + case dw.VK_F21: + keyname = "VK_F21" + case dw.VK_F22: + keyname = "VK_F22" + case dw.VK_F23: + keyname = "VK_F23" + case dw.VK_F24: + keyname = "VK_F24" + case dw.VK_NUMLOCK: + keyname = "VK_NUMLOCK" + case dw.VK_SCROLL: + keyname = "VK_SCROLL" + case dw.VK_LSHIFT: + keyname = "VK_LSHIFT" + case dw.VK_RSHIFT: + keyname = "VK_RSHIFT" + case dw.VK_LCONTROL: + keyname = "VK_LCONTROL" + case dw.VK_RCONTROL: + keyname = "VK_RCONTROL" + } + return keyname +} + +func resolve_keymodifiers(mask int) string { + if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_CTRL KC_SHIFT KC_ALT" + } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT { + return "KC_CTRL KC_SHIFT" + } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_CTRL KC_ALT" + } else if (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { + return "KC_SHIFT KC_ALT" + } else if (mask & dw.KC_SHIFT) == dw.KC_SHIFT { + return "KC_SHIFT" + } else if (mask & dw.KC_CTRL) == dw.KC_CTRL { + return "KC_CTRL" + } else if (mask & dw.KC_ALT) == dw.KC_ALT { + return "KC_ALT" + } + return "none" +} + +func keypress_callback(window dw.HWND, ch uint8, vk int, state int, data dw.POINTER, utf8 string) int { + var message string + + if ch != 0 { + message = fmt.Sprintf("Key: %c(%d) Modifiers: %s(%d) utf8 %s", ch, ch, resolve_keymodifiers(state), state, utf8) + } else { + message = fmt.Sprintf("Key: %s(%d) Modifiers: %s(%d) utf8 %s", resolve_keyname(vk), vk, resolve_keymodifiers(state), state, utf8) + } + dw.Window_set_text(status1, message) + return FALSE +} + +// Page 3 and 4 Callbacks +func item_enter_cb(window dw.HCONTAINER, text string, data dw.POINTER, itemdata dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), text, uintptr(itemdata)) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + return FALSE +} + +func item_context_cb(window dw.HCONTAINER, text string, x int, y int, data dw.POINTER, itemdata dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), + text, x, y, uintptr(itemdata)) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + return FALSE +} + +func list_select_cb(window dw.HLISTBOX, item int, data dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_LIST_SELECT: Window: %x Item: %d", dw.HANDLE_TO_UINTPTR(window), item) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + return FALSE +} + +func item_select_cb(window dw.HTREE, item dw.HTREEITEM, text string, data dw.POINTER, itemdata dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), + dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + return FALSE +} + +func container_select_cb(window dw.HCONTAINER, item dw.HTREEITEM, text string, data dw.POINTER, itemdata dw.POINTER) int { + message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), + dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + message = fmt.Sprintf("\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", dw.HANDLE_TO_UINTPTR(window), + dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) + mle_point = dw.Mle_import(container_mle, message, mle_point) + str := dw.Container_query_start(container, dw.CRA_SELECTED) + for len(str) > 0 { + mle_point = dw.Mle_import(container_mle, fmt.Sprintf("Selected: %s\r\n", str), mle_point) + str = dw.Container_query_next(container, dw.CRA_SELECTED) + } + /* Make the last inserted point the cursor location */ + dw.Mle_set_cursor(container_mle, mle_point) + /* set the details of item 0 to new data */ + dw.Filesystem_change_file(container, 0, "new data", fileicon) + dw.Filesystem_change_item_ulong(container, 1, 0, 999) + return FALSE +} + +func combobox_select_event_callback(window dw.HLISTBOX, index int, data dw.POINTER) int { + fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration) + iteration++ + return FALSE +} + +func column_click_cb(window dw.HCONTAINER, column_num int, data dw.POINTER) int { + var stype = "Unknown" + + if column_num == 0 { + stype = "Filename" + } else { + column_type := dw.Filesystem_get_column_type(window, column_num-1) + if column_type == dw.CFA_STRING { + stype = "String" + } else if column_type == dw.CFA_ULONG { + stype = "ULong" + } else if column_type == dw.CFA_DATE { + stype = "Date" + } else if column_type == dw.CFA_TIME { + stype = "Time" + } else if column_type == dw.CFA_BITMAPORICON { + stype = "BitmapOrIcon" + } + } + message := fmt.Sprintf("DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), + column_num, stype) + dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) + return FALSE +} + +// Page 5 Callbacks +func button_callback(window dw.HBUTTON, data dw.POINTER) int { + idx := dw.Listbox_selected(combobox1) + buf1 := dw.Listbox_get_text(combobox1, idx) + idx = dw.Listbox_selected(combobox2) + buf2 := dw.Listbox_get_text(combobox2, idx) + y, m, d := dw.Calendar_get_date(cal) + spvalue := dw.Spinbutton_get_pos(spinbutton) + message := fmt.Sprintf("spinbutton: %d\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d", + spvalue, + buf1, buf2, + y, m, d) + dw.Messagebox("Values", dw.MB_OK|dw.MB_INFORMATION, message) + return FALSE +} + +var isfoldericon bool = true + +func bitmap_toggle_callback(window dw.HBUTTON, data dw.POINTER) int { + if isfoldericon == true { + isfoldericon = false + dw.Window_set_bitmap(window, 0, FILE_ICON_NAME) + dw.Window_set_tooltip(window, "File Icon") + } else { + isfoldericon = true + //dw.Window_set_bitmap_from_data(window, 0, folder_ico, sizeof(folder_ico)); + dw.Window_set_tooltip(window, "Folder Icon") + } + return FALSE +} + +func percent_button_box_callback(window dw.HBUTTON, data dw.POINTER) int { + dw.Percent_set_pos(percent, dw.PERCENT_INDETERMINATE) + return FALSE +} + +func change_color_red_callback(window dw.HBUTTON, data dw.POINTER) int { + dw.Window_set_color(buttonsbox, dw.CLR_RED, dw.CLR_RED) + return FALSE +} + +func change_color_yellow_callback(window dw.HBUTTON, data dw.POINTER) int { + dw.Window_set_color(buttonsbox, dw.CLR_YELLOW, dw.CLR_YELLOW) + return FALSE +} + +/* Callback to handle user selection of the spinbutton position */ +func spinbutton_valuechanged_callback(hwnd dw.HSPINBUTTON, value int, data dw.POINTER) int { + dw.Messagebox("DWTest", dw.MB_OK, fmt.Sprintf("New value from spinbutton: %d\n", value)) + return FALSE +} + +/* Callback to handle user selection of the slider position */ +func slider_valuechanged_callback(hwnd dw.HSLIDER, value int, data dw.POINTER) int { + dw.Percent_set_pos(percent, uint(value*10)) + return FALSE +} + +// Page 8 Callbacks +func scrollbox_button_callback(window dw.HBUTTON, data dw.POINTER) int { + _, pos := dw.Scrollbox_get_pos(scrollbox) + _, rng := dw.Scrollbox_get_range(scrollbox) + fmt.Printf("Pos %d Range %d\n", pos, rng) + return FALSE +} + +// Page 9 Callbacks +func run_thread(threadnum int) { + dw.InitThread() + update_mle(fmt.Sprintf("Thread %d started.\r\n", threadnum), TRUE) + + /* Increment the ready count while protected by mutex */ + dw.Mutex_lock(mutex) + ready++ + /* If all 4 threads have incrememted the ready count... + * Post the control event semaphore so things will get started. + */ + if ready == 4 { + dw.Event_post(controlevent) + } + dw.Mutex_unlock(mutex) + + for finished == 0 { + result := dw.Event_wait(workevent, 2000) + + if result == dw.ERROR_TIMEOUT { + update_mle(fmt.Sprintf("Thread %d timeout waiting for event.\r\n", threadnum), dw.TRUE) + } else if result == dw.ERROR_NONE { + update_mle(fmt.Sprintf("Thread %d doing some work.\r\n", threadnum), dw.TRUE) + /* Pretend to do some work */ + dw.Main_sleep(1000 * threadnum) + + /* Increment the ready count while protected by mutex */ + dw.Mutex_lock(mutex) + ready++ + buf := fmt.Sprintf("Thread %d work done. ready=%d", threadnum, ready) + /* If all 4 threads have incrememted the ready count... + * Post the control event semaphore so things will get started. + */ + if ready == 4 { + dw.Event_post(controlevent) + buf = fmt.Sprintf("%s%s", buf, " Control posted.") + } + dw.Mutex_unlock(mutex) + update_mle(fmt.Sprintf("%s\r\n", buf), dw.TRUE) + } else { + update_mle(fmt.Sprintf("Thread %d error %d.\r\n", threadnum), dw.TRUE) + dw.Main_sleep(10000) + } + } + update_mle(fmt.Sprintf("Thread %d finished.\r\n", threadnum), dw.TRUE) + dw.DeinitThread() +} + +func control_thread() { + dw.InitThread() + + inprogress := 5 + + for inprogress != 0 { + result := dw.Event_wait(controlevent, 2000) + + if result == dw.ERROR_TIMEOUT { + update_mle("Control thread timeout waiting for event.\r\n", dw.TRUE) + } else if result == dw.ERROR_NONE { + /* Reset the control event */ + dw.Event_reset(controlevent) + ready = 0 + update_mle(fmt.Sprintf("Control thread starting worker threads. Inprogress=%d\r\n", inprogress), dw.TRUE) + /* Start the work threads */ + dw.Event_post(workevent) + dw.Main_sleep(100) + /* Reset the work event */ + dw.Event_reset(workevent) + inprogress-- + } else { + update_mle(fmt.Sprintf("Control thread error %d.\r\n", result), dw.TRUE) + dw.Main_sleep(10000) + } + } + /* Tell the other threads we are done */ + finished = dw.TRUE + dw.Event_post(workevent) + /* Close the control event */ + dw.Event_close(&controlevent) + update_mle("Control thread finished.\r\n", dw.TRUE) + dw.Window_enable(startbutton) + dw.DeinitThread() +} + +func start_threads_button_callback(window dw.HWND, data dw.POINTER) int { + dw.Window_disable(startbutton) + dw.Mutex_lock(mutex) + controlevent = dw.Event_new() + dw.Event_reset(workevent) + finished = FALSE + ready = 0 + update_mle("Starting thread 1\r\n", FALSE) + go run_thread(1) + update_mle("Starting thread 2\r\n", FALSE) + go run_thread(2) + update_mle("Starting thread 3\r\n", FALSE) + go run_thread(3) + update_mle("Starting thread 4\r\n", FALSE) + go run_thread(4) + update_mle("Starting control thread\r\n", FALSE) + go control_thread() + dw.Mutex_unlock(mutex) + return FALSE +} + +var exit_callback_func = exit_callback +var copy_clicked_callback_func = copy_clicked_callback +var paste_clicked_callback_func = paste_clicked_callback +var browse_file_callback_func = browse_file_callback +var browse_folder_callback_func = browse_folder_callback +var colorchoose_callback_func = colorchoose_callback +var cursortoggle_callback_func = cursortoggle_callback +var beep_callback_func = beep_callback +var timer_callback_func = timer_callback +var switch_page_callback_func = switch_page_callback +var helpabout_callback_func = helpabout_callback +var menu_callback_func = menu_callback +var menutoggle_callback_func = menutoggle_callback +var text_expose_func = text_expose +var configure_event_func = configure_event +var motion_notify_event_func = motion_notify_event +var show_window_callback_func = show_window_callback +var context_menu_event_func = context_menu_event +var refresh_callback_func = refresh_callback +var render_select_event_callback_func = render_select_event_callback +var scrollbar_valuechanged_callback_func = scrollbar_valuechanged_callback +var keypress_callback_func = keypress_callback +var item_enter_cb_func = item_enter_cb +var item_context_cb_func = item_context_cb +var list_select_cb_func = list_select_cb +var item_select_cb_func = item_select_cb +var column_click_cb_func = column_click_cb +var container_select_cb_func = container_select_cb +var combobox_select_event_callback_func = combobox_select_event_callback +var scrollbox_button_callback_func = scrollbox_button_callback +var button_callback_func = button_callback +var bitmap_toggle_callback_func = bitmap_toggle_callback +var percent_button_box_callback_func = percent_button_box_callback +var change_color_red_callback_func = change_color_red_callback +var change_color_yellow_callback_func = change_color_yellow_callback +var spinbutton_valuechanged_callback_func = spinbutton_valuechanged_callback +var slider_valuechanged_callback_func = slider_valuechanged_callback +var print_callback_func = print_callback +var draw_page_func = draw_page +var start_threads_button_callback_func = start_threads_button_callback + +var checkable_string = "checkable" +var noncheckable_string = "non-checkable" + +// Create the menu +func menu_add() { + mainmenubar := dw.Menubar_new(mainwindow) + /* add menus to the menubar */ + menu := dw.Menu_new(0) + menuitem := dw.Menu_append_item(menu, "~Quit", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + /* + * Add the "File" menu to the menubar... + */ + dw.Menu_append_item(mainmenubar, "~File", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) + + changeable_menu := dw.Menu_new(0) + checkable_menuitem = dw.Menu_append_item(changeable_menu, "~Checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) + dw.Signal_connect(checkable_menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menu_callback_func), dw.POINTER(&checkable_string)) + noncheckable_menuitem = dw.Menu_append_item(changeable_menu, "~Non-checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + dw.Signal_connect(noncheckable_menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menu_callback_func), dw.POINTER(&noncheckable_string)) + dw.Menu_append_item(changeable_menu, "~Disabled menu Item", dw.MENU_AUTO, dw.MIS_DISABLED|dw.MIS_CHECKED, dw.TRUE, dw.TRUE, dw.NOMENU) + /* seperator */ + dw.Menu_append_item(changeable_menu, dw.MENU_SEPARATOR, dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + menuitem = dw.Menu_append_item(changeable_menu, "~Menu Items Disabled", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) + dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menutoggle_callback_func), nil) + /* + * Add the "Menu" menu to the menubar... + */ + dw.Menu_append_item(mainmenubar, "~Menu", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, changeable_menu) + + menu = dw.Menu_new(0) + menuitem = dw.Menu_append_item(menu, "~About", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) + dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&helpabout_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + /* + * Add the "Help" menu to the menubar... + */ + dw.Menu_append_item(mainmenubar, "~Help", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) +} + +// Create Page 1 +func archive_add() { + lbbox := dw.Box_new(dw.VERT, 10) + + dw.Box_pack_start(notebookbox1, lbbox, 150, 70, dw.TRUE, dw.TRUE, 0) + + /* Copy and Paste */ + browsebox := dw.Box_new(dw.HORZ, 0) + + dw.Box_pack_start(lbbox, browsebox, 0, 0, dw.FALSE, dw.FALSE, 0) + + copypastefield = dw.Entryfield_new("", 0) + + dw.Entryfield_set_limit(copypastefield, 260) + + dw.Box_pack_start(browsebox, copypastefield, -1, -1, dw.TRUE, dw.FALSE, 4) + + copybutton := dw.Button_new("Copy", 0) + + dw.Box_pack_start(browsebox, copybutton, -1, -1, dw.FALSE, dw.FALSE, 0) + + pastebutton := dw.Button_new("Paste", 0) + + dw.Box_pack_start(browsebox, pastebutton, -1, -1, dw.FALSE, dw.FALSE, 0) + + /* Archive Name */ + stext := dw.Text_new("File to browse", 0) + + dw.Window_set_style(stext, dw.DT_VCENTER, dw.DT_VCENTER) + + dw.Box_pack_start(lbbox, stext, 130, 15, dw.TRUE, dw.TRUE, 2) + + browsebox = dw.Box_new(dw.HORZ, 0) + + dw.Box_pack_start(lbbox, browsebox, 0, 0, dw.TRUE, dw.TRUE, 0) + + entryfield = dw.Entryfield_new("", 100) + + dw.Entryfield_set_limit(entryfield, 260) + + dw.Box_pack_start(browsebox, entryfield, 100, 15, dw.TRUE, dw.TRUE, 4) + + browsefilebutton := dw.Button_new("Browse File", 1001) + + dw.Box_pack_start(browsebox, browsefilebutton, 40, 15, dw.TRUE, dw.TRUE, 0) + + browsefolderbutton := dw.Button_new("Browse Folder", 1001) + + dw.Box_pack_start(browsebox, browsefolderbutton, 40, 15, dw.TRUE, dw.TRUE, 0) + + dw.Window_set_color(browsebox, dw.CLR_PALEGRAY, dw.CLR_PALEGRAY) + dw.Window_set_color(stext, dw.CLR_BLACK, dw.CLR_PALEGRAY) + + /* Buttons */ + buttonbox := dw.Box_new(dw.HORZ, 10) + + dw.Box_pack_start(lbbox, buttonbox, 0, 0, dw.TRUE, dw.TRUE, 0) + + cancelbutton := dw.Button_new("Exit", 1002) + dw.Box_pack_start(buttonbox, cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + cursortogglebutton = dw.Button_new("Set Cursor pointer - CLOCK", 1003) + dw.Box_pack_start(buttonbox, cursortogglebutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + okbutton := dw.Button_new("Turn Off Annoying Beep!", 1001) + dw.Box_pack_start(buttonbox, okbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + + dw.Box_unpack(cancelbutton) + dw.Box_pack_start(buttonbox, cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) + dw.Window_click_default(mainwindow, cancelbutton) + + colorchoosebutton := dw.Button_new("Color Chooser Dialog", 1004) + dw.Box_pack_at_index(buttonbox, colorchoosebutton, 1, 130, 30, dw.TRUE, dw.TRUE, 2) + + /* Set some nice fonts and colors */ + dw.Window_set_color(lbbox, dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) + dw.Window_set_color(buttonbox, dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) + dw.Window_set_color(okbutton, dw.CLR_PALEGRAY, dw.CLR_DARKCYAN) + + dw.Signal_connect(browsefilebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&browse_file_callback_func), nil) + dw.Signal_connect(browsefolderbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&browse_folder_callback_func), nil) + dw.Signal_connect(copybutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(©_clicked_callback_func), dw.HANDLE_TO_POINTER(copypastefield)) + dw.Signal_connect(pastebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&paste_clicked_callback_func), dw.HANDLE_TO_POINTER(copypastefield)) + dw.Signal_connect(okbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&beep_callback_func), nil) + dw.Signal_connect(cancelbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + dw.Signal_connect(cursortogglebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&cursortoggle_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + dw.Signal_connect(colorchoosebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&colorchoose_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) +} + +// Create Page 2 +func text_add() { + depth := dw.Color_depth_get() + + /* create a box to pack into the notebook page */ + pagebox := dw.Box_new(dw.HORZ, 2) + dw.Box_pack_start(notebookbox2, pagebox, 0, 0, dw.TRUE, dw.TRUE, 0) + /* now a status area under this box */ + hbox := dw.Box_new(dw.HORZ, 1) + dw.Box_pack_start(notebookbox2, hbox, 100, 20, dw.TRUE, dw.FALSE, 1) + status1 = dw.Status_text_new("", 0) + dw.Box_pack_start(hbox, status1, 100, -1, dw.TRUE, dw.FALSE, 1) + status2 = dw.Status_text_new("", 0) + dw.Box_pack_start(hbox, status2, 100, -1, dw.TRUE, dw.FALSE, 1) + /* a box with combobox and button */ + hbox = dw.Box_new(dw.HORZ, 1) + dw.Box_pack_start(notebookbox2, hbox, 100, 25, dw.TRUE, dw.FALSE, 1) + rendcombo := dw.Combobox_new("Shapes Double Buffered", 0) + dw.Box_pack_start(hbox, rendcombo, 80, 25, dw.TRUE, dw.FALSE, 0) + dw.Listbox_append(rendcombo, "Shapes Double Buffered") + dw.Listbox_append(rendcombo, "Shapes Direct") + dw.Listbox_append(rendcombo, "File Display") + label := dw.Text_new("Image X:", 100) + dw.Window_set_style(label, dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) + dw.Box_pack_start(hbox, label, -1, 25, dw.FALSE, dw.FALSE, 0) + imagexspin = dw.Spinbutton_new("20", 1021) + dw.Box_pack_start(hbox, imagexspin, 25, 25, dw.TRUE, dw.FALSE, 0) + label = dw.Text_new("Y:", 100) + dw.Window_set_style(label, dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) + dw.Box_pack_start(hbox, label, -1, 25, dw.FALSE, dw.FALSE, 0) + imageyspin = dw.Spinbutton_new("20", 1021) + dw.Box_pack_start(hbox, imageyspin, 25, 25, dw.TRUE, dw.FALSE, 0) + dw.Spinbutton_set_limits(imagexspin, 2000, 0) + dw.Spinbutton_set_limits(imageyspin, 2000, 0) + dw.Spinbutton_set_pos(imagexspin, 20) + dw.Spinbutton_set_pos(imageyspin, 20) + imagestretchcheck = dw.Checkbox_new("Stretch", 1021) + dw.Box_pack_start(hbox, imagestretchcheck, -1, 25, dw.FALSE, dw.FALSE, 0) + + button1 := dw.Button_new("Refresh", 1223) + dw.Box_pack_start(hbox, button1, 100, 25, dw.FALSE, dw.FALSE, 0) + button2 := dw.Button_new("Print", 1224) + dw.Box_pack_start(hbox, button2, 100, 25, dw.FALSE, dw.FALSE, 0) + + /* Pre-create the scrollbars so we can query their sizes */ + vscrollbar = dw.Scrollbar_new(dw.VERT, 50) + hscrollbar = dw.Scrollbar_new(dw.HORZ, 50) + vscrollbarwidth, _ := dw.Window_get_preferred_size(vscrollbar) + _, hscrollbarheight := dw.Window_get_preferred_size(hscrollbar) + + /* On GTK with overlay scrollbars enabled this returns us 0... + * so in that case we need to give it some real values. + */ + if vscrollbarwidth == 0 { + vscrollbarwidth = 8 + } + if hscrollbarheight == 0 { + hscrollbarheight = 8 + } + + /* create render box for number pixmap */ + textbox1 = dw.Render_new(100) + dw.Window_set_font(textbox1, FIXEDFONT) + font_width, font_height = dw.Font_text_extents_get(textbox1, dw.NOHPIXMAP, "(g") + font_width = font_width / 2 + vscrollbox := dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, dw.FALSE, dw.TRUE, 0) + dw.Box_pack_start(vscrollbox, dw.NOHWND, font_width*(width1+1), hscrollbarheight, dw.FALSE, dw.FALSE, 0) + dw.Box_pack_start(pagebox, vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) + + /* pack empty space 1 character wide */ + dw.Box_pack_start(pagebox, dw.NOHWND, font_width, 0, dw.FALSE, dw.TRUE, 0) + + /* create box for filecontents and horz scrollbar */ + textboxA := dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(pagebox, textboxA, 0, 0, dw.TRUE, dw.TRUE, 0) + + /* create render box for filecontents pixmap */ + textbox2 = dw.Render_new(101) + dw.Box_pack_start(textboxA, textbox2, 10, 10, dw.TRUE, dw.TRUE, 0) + dw.Window_set_font(textbox2, FIXEDFONT) + /* create horizonal scrollbar */ + dw.Box_pack_start(textboxA, hscrollbar, -1, -1, dw.TRUE, dw.FALSE, 0) + + /* create vertical scrollbar */ + vscrollbox = dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(vscrollbox, vscrollbar, -1, -1, dw.FALSE, dw.TRUE, 0) + /* Pack an area of empty space 14x14 pixels */ + dw.Box_pack_start(vscrollbox, dw.NOHWND, vscrollbarwidth, hscrollbarheight, dw.FALSE, dw.FALSE, 0) + dw.Box_pack_start(pagebox, vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) + + text1pm = dw.Pixmap_new(textbox1, uint(font_width*width1), uint(font_height*rows), depth) + text2pm = dw.Pixmap_new(textbox2, uint(font_width*cols), uint(font_height*rows), depth) + image = dw.Pixmap_new_from_file(textbox2, "test") + if image == dw.NOHPIXMAP && len(SRCROOT) > 0 { + image = dw.Pixmap_new_from_file(textbox2, fmt.Sprintf("%s/test", SRCROOT)) + } + if image != dw.NOHPIXMAP { + dw.Pixmap_set_transparent_color(image, dw.CLR_WHITE) + } + + dw.Messagebox("DWTest", dw.MB_OK|dw.MB_INFORMATION, fmt.Sprintf("Width: %d Height: %d\n", font_width, font_height)) + dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*width1, font_height*rows) + dw.Draw_rect(dw.NOHWND, text2pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*cols, font_height*rows) + dw.Signal_connect(textbox1, dw.SIGNAL_BUTTON_PRESS, dw.SIGNAL_FUNC(&context_menu_event_func), nil) + dw.Signal_connect(textbox1, dw.SIGNAL_EXPOSE, dw.SIGNAL_FUNC(&text_expose_func), nil) + dw.Signal_connect(textbox2, dw.SIGNAL_EXPOSE, dw.SIGNAL_FUNC(&text_expose_func), nil) + dw.Signal_connect(textbox2, dw.SIGNAL_CONFIGURE, dw.SIGNAL_FUNC(&configure_event_func), nil) + dw.Signal_connect(textbox2, dw.SIGNAL_MOTION_NOTIFY, dw.SIGNAL_FUNC(&motion_notify_event_func), dw.POINTER(uintptr(1))) + dw.Signal_connect(textbox2, dw.SIGNAL_BUTTON_PRESS, dw.SIGNAL_FUNC(&motion_notify_event_func), nil) + dw.Signal_connect(hscrollbar, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&scrollbar_valuechanged_callback_func), dw.HANDLE_TO_POINTER(status1)) + dw.Signal_connect(vscrollbar, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&scrollbar_valuechanged_callback_func), dw.HANDLE_TO_POINTER(status1)) + dw.Signal_connect(imagestretchcheck, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&refresh_callback_func), nil) + dw.Signal_connect(button1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&refresh_callback_func), nil) + dw.Signal_connect(button2, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&print_callback_func), nil) + dw.Signal_connect(rendcombo, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&render_select_event_callback_func), nil) + dw.Signal_connect(mainwindow, dw.SIGNAL_KEY_PRESS, dw.SIGNAL_FUNC(&keypress_callback_func), nil) + + dw.Taskbar_insert(textbox1, fileicon, "DWTest") +} + +// Page 3 +func tree_add() { + /* create a box to pack into the notebook page */ + listbox := dw.Listbox_new(1024, TRUE) + dw.Box_pack_start(notebookbox3, listbox, 500, 200, TRUE, TRUE, 0) + dw.Listbox_append(listbox, "Test 1") + dw.Listbox_append(listbox, "Test 2") + dw.Listbox_append(listbox, "Test 3") + dw.Listbox_append(listbox, "Test 4") + dw.Listbox_append(listbox, "Test 5") + + /* now a tree area under this box */ + tree = dw.Tree_new(101) + dw.Box_pack_start(notebookbox3, tree, 500, 200, TRUE, TRUE, 1) + + /* and a status area to see whats going on */ + tree_status := dw.Status_text_new("", 0) + dw.Box_pack_start(notebookbox3, tree_status, 100, -1, TRUE, FALSE, 1) + + /* set up our signal trappers... */ + dw.Signal_connect(tree, dw.SIGNAL_ITEM_CONTEXT, dw.SIGNAL_FUNC(&item_context_cb_func), dw.HANDLE_TO_POINTER(tree_status)) + dw.Signal_connect(tree, dw.SIGNAL_ITEM_SELECT, dw.SIGNAL_FUNC(&item_select_cb_func), dw.HANDLE_TO_POINTER(tree_status)) + + t1 := dw.Tree_insert(tree, "tree folder 1", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(1))) + t2 := dw.Tree_insert(tree, "tree folder 2", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(2))) + dw.Tree_insert(tree, "tree file 1", fileicon, t1, dw.POINTER(uintptr(3))) + dw.Tree_insert(tree, "tree file 2", fileicon, t1, dw.POINTER(uintptr(4))) + dw.Tree_insert(tree, "tree file 3", fileicon, t2, dw.POINTER(uintptr(5))) + dw.Tree_insert(tree, "tree file 4", fileicon, t2, dw.POINTER(uintptr(6))) + dw.Tree_item_change(tree, t1, "tree folder 1", foldericon) + dw.Tree_item_change(tree, t2, "tree folder 2", foldericon) + dw.Tree_item_set_data(tree, t2, dw.POINTER(uintptr(100))) + fmt.Printf("t1 title \"%s\" data %d t2 data %d\n", dw.Tree_get_title(tree, t1), uintptr(dw.Tree_item_get_data(tree, t1)), uintptr(dw.Tree_item_get_data(tree, t2))) +} + +// Page 4 +func container_add() { + var z int + titles := []string{"Type", "Size", "Time", "Date"} + flags := []uint{dw.CFA_BITMAPORICON | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_ULONG | dw.CFA_RIGHT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_TIME | dw.CFA_CENTER | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, + dw.CFA_DATE | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR} + + /* create a box to pack into the notebook page */ + containerbox := dw.Box_new(dw.HORZ, 2) + dw.Box_pack_start(notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0) + + /* now a container area under this box */ + container = dw.Container_new(100, TRUE) + dw.Box_pack_start(notebookbox4, container, 500, 200, TRUE, FALSE, 1) + + /* and a status area to see whats going on */ + container_status := dw.Status_text_new("", 0) + dw.Box_pack_start(notebookbox4, container_status, 100, -1, TRUE, FALSE, 1) + + dw.Filesystem_set_column_title(container, "Test") + dw.Filesystem_setup(container, flags, titles) + dw.Container_set_stripe(container, dw.CLR_DEFAULT, dw.CLR_DEFAULT) + containerinfo := dw.Container_alloc(container, 3) + + for z = 0; z < 3; z++ { + var thisicon dw.HICN = fileicon + + if z == 0 { + thisicon = foldericon + } + fmt.Printf("Initial: container: %x containerinfo: %x icon: %x\n", uintptr(dw.HANDLE_TO_POINTER(container)), + dw.HANDLE_TO_UINTPTR(containerinfo), uintptr(dw.POINTER(thisicon))) + dw.Filesystem_set_file(container, containerinfo, z, fmt.Sprintf("Filename %d", z+1), thisicon) + dw.Filesystem_set_item_icon(container, containerinfo, 0, z, thisicon) + dw.Filesystem_set_item_ulong(container, containerinfo, 1, z, uint(z*100)) + dw.Filesystem_set_item_time(container, containerinfo, 2, z, z+10, z+10, z+10) + dw.Filesystem_set_item_date(container, containerinfo, 3, z, z+10, z+10, z+2000) + dw.Container_set_row_title(containerinfo, z, fmt.Sprintf("We can now allocate from the stack: Item: %d", z)) + dw.Container_set_row_data(containerinfo, z, dw.POINTER(uintptr(z))) + } + dw.Container_insert(container, containerinfo, 3) + + containerinfo = dw.Container_alloc(container, 1) + dw.Filesystem_set_file(container, containerinfo, 0, "Yikes", foldericon) + dw.Filesystem_set_item_icon(container, containerinfo, 0, 0, foldericon) + dw.Filesystem_set_item_ulong(container, containerinfo, 1, 0, 324) + dw.Filesystem_set_item_time(container, containerinfo, 2, 0, z+10, z+10, z+10) + dw.Filesystem_set_item_date(container, containerinfo, 3, 0, z+10, z+10, z+2000) + dw.Container_set_row_title(containerinfo, 0, "Extra") + + dw.Container_insert(container, containerinfo, 1) + dw.Container_optimize(container) + + container_mle = dw.Mle_new(111) + dw.Box_pack_start(containerbox, container_mle, 500, 200, TRUE, TRUE, 0) + + mle_point = dw.Mle_import(container_mle, "", -1) + mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]", mle_point), mle_point) + mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]abczxydefijkl", mle_point), mle_point) + dw.Mle_delete(container_mle, 9, 3) + mle_point = dw.Mle_import(container_mle, "gh", 12) + newpoint, _ := dw.Mle_get_size(container_mle) + mle_point = newpoint + mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]\r\n\r\n", mle_point), mle_point) + dw.Mle_set_cursor(container_mle, mle_point) + /* connect our event trappers... */ + dw.Signal_connect(container, dw.SIGNAL_ITEM_ENTER, dw.SIGNAL_FUNC(&item_enter_cb_func), dw.HANDLE_TO_POINTER(container_status)) + dw.Signal_connect(container, dw.SIGNAL_ITEM_CONTEXT, dw.SIGNAL_FUNC(&item_context_cb_func), dw.HANDLE_TO_POINTER(container_status)) + dw.Signal_connect(container, dw.SIGNAL_ITEM_SELECT, dw.SIGNAL_FUNC(&container_select_cb_func), dw.HANDLE_TO_POINTER(container_status)) + dw.Signal_connect(container, dw.SIGNAL_COLUMN_CLICK, dw.SIGNAL_FUNC(&column_click_cb_func), dw.HANDLE_TO_POINTER(container_status)) +} + +// Page 5 +func buttons_add() { + var i int + + /* create a box to pack into the notebook page */ + buttonsbox = dw.Box_new(dw.VERT, 2) + dw.Box_pack_start(notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0) + dw.Window_set_color(buttonsbox, dw.CLR_RED, dw.CLR_RED) + + calbox := dw.Box_new(dw.HORZ, 0) + dw.Box_pack_start(notebookbox5, calbox, 500, 200, TRUE, TRUE, 1) + cal = dw.Calendar_new(100) + dw.Box_pack_start(calbox, cal, 180, 120, TRUE, TRUE, 0) + /* + dw.Calendar_set_date(cal, 2001, 1, 1); + */ + /* + * Create our file toolbar boxes... + */ + buttonboxperm = dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2) + dw.Window_set_color(buttonboxperm, dw.CLR_WHITE, dw.CLR_WHITE) + abutton1 := dw.Bitmapbutton_new_from_file("Top Button", 0, fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) + dw.Box_pack_start(buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0) + dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&button_callback_func), nil) + dw.Box_pack_start(buttonboxperm, dw.NOHWND, 25, 5, FALSE, FALSE, 0) + abutton2 := dw.Bitmapbutton_new_from_file("Bottom", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + dw.Box_pack_start(buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0) + dw.Signal_connect(abutton2, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&button_callback_func), nil) + dw.Window_set_bitmap(abutton2, 0, FILE_ICON_NAME) + + create_button(false) + /* make a combobox */ + combox := dw.Box_new(dw.VERT, 2) + dw.Box_pack_start(notebookbox5, combox, 25, 200, TRUE, FALSE, 0) + combobox1 = dw.Combobox_new("fred", 0) /* no point in specifying an initial value */ + dw.Listbox_append(combobox1, "fred") + dw.Box_pack_start(combox, combobox1, -1, -1, TRUE, FALSE, 0) + /* + dw_window_set_text( combobox, "initial value"); + */ + dw.Signal_connect(combobox1, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&combobox_select_event_callback_func), nil) + + combobox2 = dw.Combobox_new("joe", 0) /* no point in specifying an initial value */ + dw.Box_pack_start(combox, combobox2, -1, -1, TRUE, FALSE, 0) + /* + dw_window_set_text( combobox, "initial value"); + */ + dw.Signal_connect(combobox2, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&combobox_select_event_callback_func), nil) + /* add LOTS of items */ + fmt.Printf("before appending 500 items to combobox using dw_listbox_list_append()\n") + text := make([]string, 500) + for i = 0; i < 500; i++ { + text[i] = fmt.Sprintf("item %d", i) + } + dw.Listbox_list_append(combobox2, text) + fmt.Printf("after appending 500 items to combobox\n") + /* now insert a couple of items */ + dw.Listbox_insert(combobox2, "inserted item 2", 2) + dw.Listbox_insert(combobox2, "inserted item 5", 5) + /* make a spinbutton */ + spinbutton = dw.Spinbutton_new("", 0) /* no point in specifying text */ + dw.Box_pack_start(combox, spinbutton, -1, -1, TRUE, FALSE, 0) + dw.Spinbutton_set_limits(spinbutton, 100, 1) + dw.Spinbutton_set_pos(spinbutton, 30) + dw.Signal_connect(spinbutton, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&spinbutton_valuechanged_callback_func), nil) + /* make a slider */ + slider = dw.Slider_new(FALSE, 11, 0) /* no point in specifying text */ + dw.Box_pack_start(combox, slider, -1, -1, TRUE, FALSE, 0) + dw.Signal_connect(slider, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&slider_valuechanged_callback_func), nil) + /* make a percent */ + percent = dw.Percent_new(0) + dw.Box_pack_start(combox, percent, -1, -1, TRUE, FALSE, 0) +} + +func create_button(redraw bool) { + filetoolbarbox := dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0) + + abutton1 := dw.Bitmapbutton_new_from_file("Empty image. Should be under Top button", 0, "junk") + dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) + dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&change_color_red_callback_func), nil) + dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) + + abutton1 = dw.Bitmapbutton_new_from_file("A borderless bitmapbitton", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) + dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&change_color_yellow_callback_func), nil) + dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) + dw.Window_set_style(abutton1, dw.BS_NOBORDER, dw.BS_NOBORDER) + + //abutton1 = dw.Bitmapbutton_new_from_data("A button from data", 0, folder_ico, 1718 ); + abutton1 = dw.Bitmapbutton_new_from_file("A button from data", 0, "junk") + dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) + dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&percent_button_box_callback_func), nil) + dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) + if redraw == true { + dw.Window_redraw(filetoolbarbox) + dw.Window_redraw(mainwindow) + } +} + +// Page 8 +func scrollbox_add() { + var i int + + /* create a box to pack into the notebook page */ + scrollbox = dw.Scrollbox_new(dw.VERT, 0) + dw.Box_pack_start(notebookbox8, scrollbox, 0, 0, TRUE, TRUE, 1) + + abutton1 := dw.Button_new("Show Adjustments", 0) + dw.Box_pack_start(scrollbox, abutton1, -1, 30, FALSE, FALSE, 0) + dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&scrollbox_button_callback_func), nil) + + for i = 0; i < MAX_WIDGETS; i++ { + tmpbox := dw.Box_new(dw.HORZ, 0) + dw.Box_pack_start(scrollbox, tmpbox, 0, 24, TRUE, FALSE, 2) + label := dw.Text_new(fmt.Sprintf("Label %d", i), 0) + dw.Box_pack_start(tmpbox, label, 0, 20, TRUE, FALSE, 0) + item := dw.Entryfield_new(fmt.Sprintf("Entry %d", i), uint(i)) + dw.Box_pack_start(tmpbox, item, 0, 20, TRUE, FALSE, 0) + } +} + +// Page 9 +func update_mle(text string, lock int) { + /* Protect pos from being changed by different threads */ + if lock != 0 { + dw.Mutex_lock(mutex) + } + mlepos = dw.Mle_import(threadmle, text, mlepos) + dw.Mle_set_cursor(threadmle, mlepos) + if lock != 0 { + dw.Mutex_unlock(mutex) + } +} + +func thread_add() { + /* create a box to pack into the notebook page */ + tmpbox := dw.Box_new(dw.VERT, 0) + dw.Box_pack_start(notebookbox9, tmpbox, 0, 0, dw.TRUE, dw.TRUE, 1) + + startbutton = dw.Button_new("Start Threads", 0) + dw.Box_pack_start(tmpbox, startbutton, -1, 30, dw.FALSE, dw.FALSE, 0) + dw.Signal_connect(startbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&start_threads_button_callback_func), nil) + + /* Create the base threading components */ + threadmle = dw.Mle_new(0) + dw.Box_pack_start(tmpbox, threadmle, 1, 1, TRUE, TRUE, 0) + mutex = dw.Mutex_new() + workevent = dw.Event_new() +} + +func main() { + /* Pick an approriate font for our platform */ + if runtime.GOOS == "windows" { + FIXEDFONT = "10.Lucida Console" + } else if runtime.GOOS == "darwin" { + FIXEDFONT = "9.Monaco" + } + + /* Locate the source root of the package */ + pkg, err := build.Import("dwtest", "", build.FindOnly) + if err == nil && len(pkg.SrcRoot) > 0 { + SRCROOT = fmt.Sprintf("%s/dwtest", pkg.SrcRoot) + } + + /* Initialize the Dynamic Windows engine */ + dw.Init(dw.TRUE) + + /* Create our window */ + mainwindow = dw.Window_new(dw.DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", dw.FCF_SYSMENU|dw.FCF_TITLEBAR|dw.FCF_TASKLIST|dw.FCF_DLGBORDER|dw.FCF_SIZEBORDER|dw.FCF_MINMAX) + + menu_add() + + notebookbox := dw.Box_new(dw.VERT, 5) + dw.Box_pack_start(mainwindow, notebookbox, 0, 0, dw.TRUE, dw.TRUE, 0) + + foldericon = dw.Icon_load_from_file(FOLDER_ICON_NAME) + if foldericon == dw.NOHICN && len(SRCROOT) > 0 { + foldericon = dw.Icon_load_from_file(fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) + } + fileicon = dw.Icon_load_from_file(FILE_ICON_NAME) + if fileicon == dw.NOHICN && len(SRCROOT) > 0 { + fileicon = dw.Icon_load_from_file(fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) + } + notebook := dw.Notebook_new(1, dw.TRUE) + dw.Box_pack_start(notebookbox, notebook, 100, 100, dw.TRUE, dw.TRUE, 0) + dw.Signal_connect(notebook, dw.SIGNAL_SWITCH_PAGE, dw.SIGNAL_FUNC(&switch_page_callback_func), nil) + + notebookbox1 = dw.Box_new(dw.VERT, 5) + notebookpage1 := dw.Notebook_page_new(notebook, 0, dw.TRUE) + dw.Notebook_pack(notebook, notebookpage1, notebookbox1) + dw.Notebook_page_set_text(notebook, notebookpage1, "buttons and entry") + archive_add() + + notebookbox2 = dw.Box_new(dw.VERT, 5) + notebookpage2 := dw.Notebook_page_new(notebook, 1, dw.FALSE) + dw.Notebook_pack(notebook, notebookpage2, notebookbox2) + dw.Notebook_page_set_text(notebook, notebookpage2, "render") + text_add() + + notebookbox3 = dw.Box_new(dw.VERT, 5) + notebookpage3 := dw.Notebook_page_new(notebook, 1, dw.FALSE) + dw.Notebook_pack(notebook, notebookpage3, notebookbox3) + dw.Notebook_page_set_text(notebook, notebookpage3, "tree") + tree_add() + + notebookbox4 = dw.Box_new(dw.VERT, 5) + notebookpage4 := dw.Notebook_page_new(notebook, 1, FALSE) + dw.Notebook_pack(notebook, notebookpage4, notebookbox4) + dw.Notebook_page_set_text(notebook, notebookpage4, "container") + container_add() + + notebookbox5 = dw.Box_new(dw.VERT, 5) + notebookpage5 := dw.Notebook_page_new(notebook, 1, FALSE) + dw.Notebook_pack(notebook, notebookpage5, notebookbox5) + dw.Notebook_page_set_text(notebook, notebookpage5, "buttons") + buttons_add() + + /* DEPRECATED + notebookbox6 = dw.Box_new(dw.VERT, 5); + notebookpage6 := dw.Notebook_page_new( notebook, 1, FALSE ); + dw.Notebook_pack(notebook, notebookpage6, notebookbox6); + dw.Notebook_page_set_text(notebook, notebookpage6, "mdi"); + mdi_add(); + */ + + notebookbox7 = dw.Box_new(dw.VERT, 6) + notebookpage7 := dw.Notebook_page_new(notebook, 1, FALSE) + dw.Notebook_pack(notebook, notebookpage7, notebookbox7) + dw.Notebook_page_set_text(notebook, notebookpage7, "html") + + rawhtml := dw.Html_new(1001) + if rawhtml.GetHandle() != nil { + dw.Box_pack_start(notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0) + dw.Html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>") + html = dw.Html_new(1002) + dw.Box_pack_start(notebookbox7, html, 0, 100, TRUE, TRUE, 0) + dw.Html_url(html, "http://dwindows.netlabs.org") + } else { + label := dw.Text_new("HTML widget not available.", 0) + dw.Box_pack_start(notebookbox7, label, 0, 100, TRUE, TRUE, 0) + } + + notebookbox8 = dw.Box_new(dw.VERT, 7) + notebookpage8 := dw.Notebook_page_new(notebook, 1, FALSE) + dw.Notebook_pack(notebook, notebookpage8, notebookbox8) + dw.Notebook_page_set_text(notebook, notebookpage8, "scrollbox") + scrollbox_add() + + notebookbox9 = dw.Box_new(dw.VERT, 8) + notebookpage9 := dw.Notebook_page_new(notebook, 1, FALSE) + dw.Notebook_pack(notebook, notebookpage9, notebookbox9) + dw.Notebook_page_set_text(notebook, notebookpage9, "thread/event") + thread_add() + + /* Set the default field */ + dw.Window_default(mainwindow, copypastefield) + + dw.Signal_connect(mainwindow, dw.SIGNAL_DELETE, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + /* + * The following is a special case handler for the Mac and other platforms which contain + * an application object which can be closed. It function identically to a window delete/close + * request except it applies to the entire application not an individual window. If it is not + * handled or you allow the default handler to take place the entire application will close. + * On platforms which do not have an application object this line will be ignored. + */ + dw.Signal_connect(dw.DESKTOP, dw.SIGNAL_DELETE, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) + timerid = dw.Timer_connect(2000, dw.SIGNAL_FUNC(&timer_callback_func), nil) + dw.Window_set_size(mainwindow, 640, 550) + dw.Window_show(mainwindow) + + /* Now that the window is created and shown... + * run the main loop until we get dw_main_quit() + */ + dw.Main() + + /* Now that the loop is done we can cleanup */ + dw.Taskbar_delete(textbox1, fileicon) + dw.Window_destroy(mainwindow) + + fmt.Printf("dwtest exiting...\n") + /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ + dw.Shutdown() +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtest/dwtest.rc Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,6 @@ +#include "winuser.h" +#ifdef DW64 +1 RT_MANIFEST dwtest.exe.x64.manifest +#else +1 RT_MANIFEST dwtest.exe.x86.manifest +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtest/makesyso.bat Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,3 @@ +@echo off +windres -i dwtest.rc -o dwtest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 +windres -i dwtest.rc -o dwtest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/go.mod Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,3 @@ +module hg.code.sf.net/p/godwindows/code.hg + +go 1.17
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hello/hello.exe.x64.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="AMD64" + name="hello" + type="win32" +/> +<description>Dynamic Windows Hello World Example</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="AMD64" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hello/hello.exe.x86.manifest Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.1.0.0" + processorArchitecture="X86" + name="hello" + type="win32" +/> +<description>Dynamic Windows Hello World Example</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hello/hello.go Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,46 @@ +package main + +import ( + "hg.code.sf.net/p/godwindows/code.hg/dw" +) + +// Global variables +var APP_NAME = "DW Hello World Example" + +/* Handle exiting the application */ +func exit_handler(win dw.HWND, message string) int { + if dw.Messagebox(APP_NAME, dw.MB_YESNO|dw.MB_QUESTION, message) == dw.MB_RETURN_YES { + /* Exit the application cleanly */ + dw.MainQuit() + } + return dw.TRUE +} + +func main() { + var message = "Are you sure you want to exit?" + + /* Initialize Dynamic Windows */ + dw.Init(dw.TRUE) + + /* Create our window */ + window := dw.WindowNew(dw.DESKTOP, APP_NAME, dw.FCF_SYSMENU|dw.FCF_TITLEBAR|dw.FCF_TASKLIST|dw.FCF_DLGBORDER|dw.FCF_SIZEBORDER|dw.FCF_MINMAX) + + label := dw.TextNew("Hello, 世界", 0) + window.PackStart(label, 0, 0, dw.TRUE, dw.TRUE, 0) + + /* Connect the signal handlers */ + window.ConnectDelete(func(window dw.HWND) int { return exit_handler(window, message) }) + + /* Set the size and show the window */ + window.SetSize(640, 550) + window.Show() + + dw.Main() + + /* Destroy the main window */ + window.Destroy() + + /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ + dw.Shutdown() + return +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hello/hello.rc Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,6 @@ +#include "winuser.h" +#ifdef DW64 +1 RT_MANIFEST hello.exe.x64.manifest +#else +1 RT_MANIFEST hello.exe.x86.manifest +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hello/makesyso.bat Fri Nov 05 15:27:32 2021 -0500 @@ -0,0 +1,3 @@ +@echo off +windres -i hello.rc -o hello_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 +windres -i hello.rc -o hello_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- a/src/dw/dw.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6111 +0,0 @@ -package dw - -/* -#cgo linux pkg-config: dwindows -#cgo freebsd pkg-config: dwindows -#cgo darwin CFLAGS: -I/usr/local/include -g -O2 -D__MAC__ -#cgo darwin LDFLAGS: -L/usr/local/lib -ldwindows -lresolv -framework Cocoa -framework WebKit -lpthread -#cgo windows CFLAGS: -IC:/Work/BitBucket/dwindows -g -O2 -D__WIN32__ -mthreads -#cgo windows LDFLAGS: -LC:/Work/BitBucket/dwindows -ldw -#include "dwglue.c" -*/ -import "C" -import "unsafe" -import "runtime" -import "reflect" -import "os" - -type HANDLE interface { - GetHandle() unsafe.Pointer - GetType() C.uint -} -type DRAWABLE interface { - DrawPoint(x int, y int) - DrawLine(x1 int, y1 int, x2 int, y2 int) - DrawPolygon(flags int, x []int, y []int) - DrawRect(fill int, x int, y int, width int, height int) - DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) - DrawText(x int, y int, text string) - BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int - BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int - BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) - BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) -} -type HGENERIC struct { - hwnd unsafe.Pointer -} -type HWND struct { - hwnd unsafe.Pointer -} -type HENTRYFIELD struct { - hwnd unsafe.Pointer -} -type HTEXT struct { - hwnd unsafe.Pointer -} -type HTREE struct { - hwnd unsafe.Pointer -} -type HCONTAINER struct { - hwnd unsafe.Pointer - filesystem bool -} -type HMLE struct { - hwnd unsafe.Pointer -} -type HBUTTON struct { - hwnd unsafe.Pointer -} -type HSPINBUTTON struct { - hwnd unsafe.Pointer -} -type HNOTEBOOK struct { - hwnd unsafe.Pointer -} -type HBOX struct { - hwnd unsafe.Pointer -} -type HSCROLLBOX struct { - hwnd unsafe.Pointer -} -type HMENUITEM struct { - hwnd unsafe.Pointer -} -type HLISTBOX struct { - hwnd unsafe.Pointer -} -type HPERCENT struct { - hwnd unsafe.Pointer -} -type HSLIDER struct { - hwnd unsafe.Pointer -} -type HSCROLLBAR struct { - hwnd unsafe.Pointer -} -type HRENDER struct { - hwnd unsafe.Pointer -} -type HHTML struct { - hwnd unsafe.Pointer -} -type HCALENDAR struct { - hwnd unsafe.Pointer -} -type HBITMAP struct { - hwnd unsafe.Pointer -} -type HSPLITBAR struct { - hwnd unsafe.Pointer -} -type HTREEITEM struct { - htreeitem unsafe.Pointer - htree HANDLE -} -type HCONTINS struct { - ptr unsafe.Pointer - rowcount int - hcont HANDLE - filesystem bool -} -type HDIALOG struct { - hdialog unsafe.Pointer -} -type HEV struct { - hev unsafe.Pointer -} -type HMTX struct { - hmtx unsafe.Pointer -} -type HICN unsafe.Pointer -type HTIMER struct { - tid C.int -} -type HMENUI struct { - hmenui unsafe.Pointer -} -type HPIXMAP struct { - hpixmap unsafe.Pointer -} -type HPRINT struct { - hprint unsafe.Pointer - jobname string -} -type HNOTEPAGE struct { - pageid C.ulong - hnotebook HANDLE -} -type COLOR C.ulong -type POINTER unsafe.Pointer -type SIGNAL_FUNC unsafe.Pointer - -type Env struct { - OSName, BuildDate, BuildTime string - MajorVersion, MinorVersion, MajorBuild, MinorBuild C.short - DWMajorVersion, DWMinorVersion, DWSubVersion C.short -} - -// Define our exported constants -const ( - FALSE int = iota - TRUE -) - -var DESKTOP HWND - -// Varaibles to pass if "none/nil" is intended -var NOHWND HWND -var NOHTIMER HTIMER -var NOHPRINT HPRINT -var NOHPIXMAP HPIXMAP -var NOHMENUI HMENUI -var NOMENU HMENUI -var NOHTREEITEM HTREEITEM -var NOHICN HICN = nil - -// Import as much as we can from C -var HORZ = C.DW_HORZ -var VERT = C.DW_VERT - -// Message box return values -var MB_RETURN_OK = C.DW_MB_RETURN_OK -var MB_RETURN_YES = C.DW_MB_RETURN_YES -var MB_RETURN_NO = C.DW_MB_RETURN_NO -var MB_RETURN_CANCEL = C.DW_MB_RETURN_CANCEL - -// Message box button options -var MB_OK = C.DW_MB_OK -var MB_OKCANCEL = C.DW_MB_OKCANCEL -var MB_YESNO = C.DW_MB_YESNO -var MB_YESNOCANCEL = C.DW_MB_YESNOCANCEL - -// Message box icons -var MB_WARNING = C.DW_MB_WARNING -var MB_ERROR = C.DW_MB_ERROR -var MB_INFORMATION = C.DW_MB_INFORMATION -var MB_QUESTION = C.DW_MB_QUESTION - -/* Preset Pointers */ -var POINTER_DEFAULT = C.DW_POINTER_DEFAULT -var POINTER_ARROW = C.DW_POINTER_ARROW -var POINTER_CLOCK = C.DW_POINTER_CLOCK -var POINTER_QUESTION = C.DW_POINTER_QUESTION - -/* Draw Text Flags */ -var DT_LEFT uint = C.DW_DT_LEFT -var DT_CENTER uint = C.DW_DT_CENTER -var DT_RIGHT uint = C.DW_DT_RIGHT -var DT_VCENTER uint = C.DW_DT_VCENTER -var DT_WORDBREAK uint = C.DW_DT_WORDBREAK - -/* Window Frame Creation Flags */ -var FCF_CLOSEBUTTON uint = C.DW_FCF_CLOSEBUTTON -var FCF_TITLEBAR uint = C.DW_FCF_TITLEBAR -var FCF_SYSMENU uint = C.DW_FCF_SYSMENU -var FCF_SIZEBORDER uint = C.DW_FCF_SIZEBORDER -var FCF_MINBUTTON uint = C.DW_FCF_MINBUTTON -var FCF_MAXBUTTON uint = C.DW_FCF_MAXBUTTON -var FCF_MINMAX uint = C.DW_FCF_MINMAX -var FCF_DLGBORDER uint = C.DW_FCF_DLGBORDER -var FCF_BORDER uint = C.DW_FCF_BORDER -var FCF_TASKLIST uint = C.DW_FCF_TASKLIST -var FCF_HIDEBUTTON uint = C.DW_FCF_HIDEBUTTON -var FCF_HIDEMAX uint = C.DW_FCF_HIDEMAX -var FCF_MAXIMIZE uint = C.DW_FCF_MAXIMIZE -var FCF_MINIMIZE uint = C.DW_FCF_MINIMIZE -var FCF_COMPOSITED uint = C.DW_FCF_COMPOSITED -var FCF_TEXTURED uint = C.DW_FCF_TEXTURED - -var LIT_NONE = C.DW_LIT_NONE - -var MLE_CASESENSITIVE = C.DW_MLE_CASESENSITIVE - -/* Button Styles */ -var BS_NOBORDER uint = C.DW_BS_NOBORDER - -/* Key Code Modifiers */ -var KC_CTRL = C.KC_CTRL -var KC_SHIFT = C.KC_SHIFT -var KC_ALT = C.KC_ALT - -/* Menu Presets */ -var MENU_SEPARATOR = C.DW_MENU_SEPARATOR -var MENU_AUTO uint = C.DW_MENU_AUTO -var MENU_POPUP uint = ^uint(0) - -var PERCENT_INDETERMINATE uint = ^uint(0) - -/* Return value error codes */ -var ERROR_NONE = C.DW_ERROR_NONE -var ERROR_GENERAL = C.DW_ERROR_GENERAL -var ERROR_TIMEOUT = C.DW_ERROR_TIMEOUT -var ERROR_NON_INIT = C.DW_ERROR_NON_INIT -var ERROR_NO_MEM = C.DW_ERROR_NO_MEM -var ERROR_INTERRUPT = C.DW_ERROR_INTERRUPT -var ERROR_UNKNOWN = C.DW_ERROR_UNKNOWN - -/* Embedded HTML actions */ -var HTML_GOBACK = C.DW_HTML_GOBACK -var HTML_GOFORWARD = C.DW_HTML_GOFORWARD -var HTML_GOHOME = C.DW_HTML_GOHOME -var HTML_SEARCH = C.DW_HTML_SEARCH -var HTML_RELOAD = C.DW_HTML_RELOAD -var HTML_STOP = C.DW_HTML_STOP -var HTML_PRINT = C.DW_HTML_PRINT - -/* Drawing flags */ -var DRAW_DEFAULT = C.DW_DRAW_DEFAULT -var DRAW_FILL = C.DW_DRAW_FILL -var DRAW_FULL = C.DW_DRAW_FULL -var DRAW_NOAA = C.DW_DRAW_NOAA - -/* Preset Drawing Colors */ -var CLR_BLACK = COLOR(C.DW_CLR_BLACK) -var CLR_DARKRED = COLOR(C.DW_CLR_DARKRED) -var CLR_DARKGREEN = COLOR(C.DW_CLR_DARKGREEN) -var CLR_BROWN = COLOR(C.DW_CLR_BROWN) -var CLR_DARKBLUE = COLOR(C.DW_CLR_DARKBLUE) -var CLR_DARKPINK = COLOR(C.DW_CLR_DARKPINK) -var CLR_DARKCYAN = COLOR(C.DW_CLR_DARKCYAN) -var CLR_PALEGRAY = COLOR(C.DW_CLR_PALEGRAY) -var CLR_DARKGRAY = COLOR(C.DW_CLR_DARKGRAY) -var CLR_RED = COLOR(C.DW_CLR_RED) -var CLR_GREEN = COLOR(C.DW_CLR_GREEN) -var CLR_YELLOW = COLOR(C.DW_CLR_YELLOW) -var CLR_BLUE = COLOR(C.DW_CLR_BLUE) -var CLR_PINK = COLOR(C.DW_CLR_PINK) -var CLR_CYAN = COLOR(C.DW_CLR_CYAN) -var CLR_WHITE = COLOR(C.DW_CLR_WHITE) -var CLR_DEFAULT = COLOR(C.DW_CLR_DEFAULT) - -/* Signal handler defines */ -var SIGNAL_CONFIGURE = C.DW_SIGNAL_CONFIGURE -var SIGNAL_KEY_PRESS = C.DW_SIGNAL_KEY_PRESS -var SIGNAL_BUTTON_PRESS = C.DW_SIGNAL_BUTTON_PRESS -var SIGNAL_BUTTON_RELEASE = C.DW_SIGNAL_BUTTON_RELEASE -var SIGNAL_MOTION_NOTIFY = C.DW_SIGNAL_MOTION_NOTIFY -var SIGNAL_DELETE = C.DW_SIGNAL_DELETE -var SIGNAL_EXPOSE = C.DW_SIGNAL_EXPOSE -var SIGNAL_CLICKED = C.DW_SIGNAL_CLICKED -var SIGNAL_ITEM_ENTER = C.DW_SIGNAL_ITEM_ENTER -var SIGNAL_ITEM_CONTEXT = C.DW_SIGNAL_ITEM_CONTEXT -var SIGNAL_ITEM_SELECT = C.DW_SIGNAL_ITEM_SELECT -var SIGNAL_LIST_SELECT = C.DW_SIGNAL_LIST_SELECT -var SIGNAL_SET_FOCUS = C.DW_SIGNAL_SET_FOCUS -var SIGNAL_VALUE_CHANGED = C.DW_SIGNAL_VALUE_CHANGED -var SIGNAL_SWITCH_PAGE = C.DW_SIGNAL_SWITCH_PAGE -var SIGNAL_COLUMN_CLICK = C.DW_SIGNAL_COLUMN_CLICK -var SIGNAL_TREE_EXPAND = C.DW_SIGNAL_TREE_EXPAND - -/* status of menu items */ -var MIS_ENABLED uint = C.DW_MIS_ENABLED -var MIS_DISABLED uint = C.DW_MIS_DISABLED -var MIS_CHECKED uint = C.DW_MIS_CHECKED -var MIS_UNCHECKED uint = C.DW_MIS_UNCHECKED - -/* Gravity */ -var GRAV_TOP = C.DW_GRAV_TOP -var GRAV_LEFT = C.DW_GRAV_LEFT -var GRAV_CENTER = C.DW_GRAV_CENTER -var GRAV_RIGHT = C.DW_GRAV_RIGHT -var GRAV_BOTTOM = C.DW_GRAV_BOTTOM -var GRAV_OBSTACLES = C.DW_GRAV_OBSTACLES - -/* Container Flags */ -var CFA_BITMAPORICON uint = C.DW_CFA_BITMAPORICON -var CFA_STRING uint = C.DW_CFA_STRING -var CFA_ULONG uint = C.DW_CFA_ULONG -var CFA_TIME uint = C.DW_CFA_TIME -var CFA_DATE uint = C.DW_CFA_DATE -var CFA_CENTER uint = C.DW_CFA_CENTER -var CFA_LEFT uint = C.DW_CFA_LEFT -var CFA_RIGHT uint = C.DW_CFA_RIGHT - -var CFA_STRINGANDICON uint = C.DW_CFA_STRINGANDICON -var CFA_HORZSEPARATOR uint = C.DW_CFA_HORZSEPARATOR -var CFA_SEPARATOR uint = C.DW_CFA_SEPARATOR - -var CRA_SELECTED uint = C.DW_CRA_SELECTED -var CRA_CUROSRED uint = C.DW_CRA_CURSORED - -/* Mouse buttons */ -var BUTTON1_MASK = C.DW_BUTTON1_MASK -var BUTTON2_MASK = C.DW_BUTTON2_MASK -var BUTTON3_MASK = C.DW_BUTTON3_MASK - -/* File dialog */ -var FILE_OPEN = C.DW_FILE_OPEN -var FILE_SAVE = C.DW_FILE_SAVE -var DIRECTORY_OPEN = C.DW_DIRECTORY_OPEN - -/* Key codes */ -var VK_LBUTTON = int(C.VK_LBUTTON) -var VK_RBUTTON = int(C.VK_RBUTTON) -var VK_CANCEL = int(C.VK_CANCEL) -var VK_MBUTTON = int(C.VK_MBUTTON) -var VK_TAB = int(C.VK_TAB) -var VK_CLEAR = int(C.VK_CLEAR) -var VK_RETURN = int(C.VK_RETURN) -var VK_PAUSE = int(C.VK_PAUSE) -var VK_CAPITAL = int(C.VK_CAPITAL) -var VK_ESCAPE = int(C.VK_ESCAPE) -var VK_SPACE = int(C.VK_SPACE) -var VK_PRIOR = int(C.VK_PRIOR) -var VK_NEXT = int(C.VK_NEXT) -var VK_END = int(C.VK_END) -var VK_HOME = int(C.VK_HOME) -var VK_LEFT = int(C.VK_LEFT) -var VK_UP = int(C.VK_UP) -var VK_RIGHT = int(C.VK_RIGHT) -var VK_DOWN = int(C.VK_DOWN) -var VK_SELECT = int(C.VK_SELECT) -var VK_PRINT = int(C.VK_PRINT) -var VK_EXECUTE = int(C.VK_EXECUTE) -var VK_SNAPSHOT = int(C.VK_SNAPSHOT) -var VK_INSERT = int(C.VK_INSERT) -var VK_DELETE = int(C.VK_DELETE) -var VK_HELP = int(C.VK_HELP) -var VK_LWIN = int(C.VK_LWIN) -var VK_RWIN = int(C.VK_RWIN) -var VK_NUMPAD0 = int(C.VK_NUMPAD0) -var VK_NUMPAD1 = int(C.VK_NUMPAD1) -var VK_NUMPAD2 = int(C.VK_NUMPAD2) -var VK_NUMPAD3 = int(C.VK_NUMPAD3) -var VK_NUMPAD4 = int(C.VK_NUMPAD4) -var VK_NUMPAD5 = int(C.VK_NUMPAD5) -var VK_NUMPAD6 = int(C.VK_NUMPAD6) -var VK_NUMPAD7 = int(C.VK_NUMPAD7) -var VK_NUMPAD8 = int(C.VK_NUMPAD8) -var VK_NUMPAD9 = int(C.VK_NUMPAD9) -var VK_MULTIPLY = int(C.VK_MULTIPLY) -var VK_ADD = int(C.VK_ADD) -var VK_SEPARATOR = int(C.VK_SEPARATOR) -var VK_SUBTRACT = int(C.VK_SUBTRACT) -var VK_DECIMAL = int(C.VK_DECIMAL) -var VK_DIVIDE = int(C.VK_DIVIDE) -var VK_F1 = int(C.VK_F1) -var VK_F2 = int(C.VK_F2) -var VK_F3 = int(C.VK_F3) -var VK_F4 = int(C.VK_F4) -var VK_F5 = int(C.VK_F5) -var VK_F6 = int(C.VK_F6) -var VK_F7 = int(C.VK_F7) -var VK_F8 = int(C.VK_F8) -var VK_F9 = int(C.VK_F9) -var VK_F10 = int(C.VK_F10) -var VK_F11 = int(C.VK_F11) -var VK_F12 = int(C.VK_F12) -var VK_F13 = int(C.VK_F13) -var VK_F14 = int(C.VK_F14) -var VK_F15 = int(C.VK_F15) -var VK_F16 = int(C.VK_F16) -var VK_F17 = int(C.VK_F17) -var VK_F18 = int(C.VK_F18) -var VK_F19 = int(C.VK_F19) -var VK_F20 = int(C.VK_F20) -var VK_F21 = int(C.VK_F21) -var VK_F22 = int(C.VK_F22) -var VK_F23 = int(C.VK_F23) -var VK_F24 = int(C.VK_F24) -var VK_NUMLOCK = int(C.VK_NUMLOCK) -var VK_SCROLL = int(C.VK_SCROLL) -var VK_LSHIFT = int(C.VK_LSHIFT) -var VK_RSHIFT = int(C.VK_RSHIFT) -var VK_LCONTROL = int(C.VK_LCONTROL) -var VK_RCONTROL = int(C.VK_RCONTROL) - -// Cache the function pointers so they don't get garbage collected -var backs []unsafe.Pointer - -// Convert a resource ID into a pointer -func RESOURCE(id uintptr) unsafe.Pointer { - return unsafe.Pointer(id) -} - -// Convert component colors into a COLOR type -func RGB(red uint8, green uint8, blue uint8) COLOR { - lred := C.ulong(red) - lgreen := C.ulong(green) - lblue := C.ulong(blue) - return COLOR((0xF0000000 | (lred) | (lgreen << 8) | (lblue << 16))) -} - -// Convert a POINTER to a HANDLE (use with care) -func POINTER_TO_HANDLE(ptr POINTER) HANDLE { - return HANDLE(HGENERIC{unsafe.Pointer(ptr)}) -} - -// Convert a HANDLE to a UINTPTR, mostly used for display purposes -func HANDLE_TO_UINTPTR(handle HANDLE) uintptr { - return uintptr(handle.GetHandle()) -} - -// Convert a HANDLE to a POINTER (use with care) -func HANDLE_TO_POINTER(handle HANDLE) POINTER { - return POINTER(handle.GetHandle()) -} - -// Convert a HNOTEPAGE to a UINT, mostly used for display purposes -func HNOTEPAGE_TO_UINT(handle HNOTEPAGE) uint { - return uint(handle.pageid) -} - -/* Functions to convert from HANDLE to specific types.. - * These will only work if the hanldle was of the - * correct type, or were HGENERIC. Use with care. - */ - -// Convert HANDLE to HWND (use with care) -func HANDLE_TO_HWND(handle HANDLE) HWND { - if handle.GetType() == 1 || handle.GetType() == 0 { - return HWND{handle.GetHandle()} - } - return HWND{nil} -} - -// Convert HANDLE to HENTRYFIELD (use with care) -func HANDLE_TO_HENTRYFIELD(handle HANDLE) HENTRYFIELD { - if handle.GetType() == 2 || handle.GetType() == 0 { - return HENTRYFIELD{handle.GetHandle()} - } - return HENTRYFIELD{nil} -} - -// Convert HANDLE to HTEXT (use with care) -func HANDLE_TO_HTEXT(handle HANDLE) HTEXT { - if handle.GetType() == 3 || handle.GetType() == 0 { - return HTEXT{handle.GetHandle()} - } - return HTEXT{nil} -} - -// Convert HANDLE to HTREE (use with care) -func HANDLE_TO_HTREE(handle HANDLE) HTREE { - if handle.GetType() == 4 || handle.GetType() == 0 { - return HTREE{handle.GetHandle()} - } - return HTREE{nil} -} - -// Convert HANDLE to HCONTAINER (use with care) -func HANDLE_TO_HCONTAINER(handle HANDLE) HCONTAINER { - if handle.GetType() == 5 || handle.GetType() == 0 { - filesystem := false - if Window_get_data(HCONTAINER{handle.GetHandle(), false}, "_go_filesystem") != nil { - filesystem = true - } - return HCONTAINER{handle.GetHandle(), filesystem} - } - return HCONTAINER{nil, false} -} - -// Convert HANDLE to HMLE (use with care) -func HANDLE_TO_HMLE(handle HANDLE) HMLE { - if handle.GetType() == 6 || handle.GetType() == 0 { - return HMLE{handle.GetHandle()} - } - return HMLE{nil} -} - -// Convert HANDLE to HBUTTON (use with care) -func HANDLE_TO_HBUTTON(handle HANDLE) HBUTTON { - if handle.GetType() == 7 || handle.GetType() == 0 { - return HBUTTON{handle.GetHandle()} - } - return HBUTTON{nil} -} - -// Convert HANDLE to HSPINBUTTON (use with care) -func HANDLE_TO_HSPINBUTTON(handle HANDLE) HSPINBUTTON { - if handle.GetType() == 8 || handle.GetType() == 0 { - return HSPINBUTTON{handle.GetHandle()} - } - return HSPINBUTTON{nil} -} - -// Convert HANDLE to HNOTEBOOK (use with care) -func HANDLE_TO_HNOTEBOOK(handle HANDLE) HNOTEBOOK { - if handle.GetType() == 9 || handle.GetType() == 0 { - return HNOTEBOOK{handle.GetHandle()} - } - return HNOTEBOOK{nil} -} - -// Convert HANDLE to HBOX (use with care) -func HANDLE_TO_HBOX(handle HANDLE) HBOX { - if handle.GetType() == 10 || handle.GetType() == 0 { - return HBOX{handle.GetHandle()} - } - return HBOX{nil} -} - -// Convert HANDLE to HSCROLLBOX (use with care) -func HANDLE_TO_HSCROLLBOX(handle HANDLE) HSCROLLBOX { - if handle.GetType() == 11 || handle.GetType() == 0 { - return HSCROLLBOX{handle.GetHandle()} - } - return HSCROLLBOX{nil} -} - -// Convert HANDLE to HMENUITEM (use with care) -func HANDLE_TO_HMENUITEM(handle HANDLE) HMENUITEM { - if handle.GetType() == 12 || handle.GetType() == 0 { - return HMENUITEM{handle.GetHandle()} - } - return HMENUITEM{nil} -} - -// Convert HANDLE to HLISTBOX (use with care) -func HANDLE_TO_HLISTBOX(handle HANDLE) HLISTBOX { - if handle.GetType() == 13 || handle.GetType() == 0 { - return HLISTBOX{handle.GetHandle()} - } - return HLISTBOX{nil} -} - -// Convert HANDLE to HPERCENT (use with care) -func HANDLE_TO_HPERCENT(handle HANDLE) HPERCENT { - if handle.GetType() == 14 || handle.GetType() == 0 { - return HPERCENT{handle.GetHandle()} - } - return HPERCENT{nil} -} - -// Convert HANDLE to HSLIDER (use with care) -func HANDLE_TO_HSLIDER(handle HANDLE) HSLIDER { - if handle.GetType() == 15 || handle.GetType() == 0 { - return HSLIDER{handle.GetHandle()} - } - return HSLIDER{nil} -} - -// Convert HANDLE to HSCROLLBAR (use with care) -func HANDLE_TO_HSCROLLBAR(handle HANDLE) HSCROLLBAR { - if handle.GetType() == 16 || handle.GetType() == 0 { - return HSCROLLBAR{handle.GetHandle()} - } - return HSCROLLBAR{nil} -} - -// Convert HANDLE to HRENDER (use with care) -func HANDLE_TO_HRENDER(handle HANDLE) HRENDER { - if handle.GetType() == 17 || handle.GetType() == 0 { - return HRENDER{handle.GetHandle()} - } - return HRENDER{nil} -} - -// Convert HANDLE to HHTML (use with care) -func HANDLE_TO_HHTML(handle HANDLE) HHTML { - if handle.GetType() == 18 || handle.GetType() == 0 { - return HHTML{handle.GetHandle()} - } - return HHTML{nil} -} - -// Convert HANDLE to HCALENDAR (use with care) -func HANDLE_TO_HCALENDAR(handle HANDLE) HCALENDAR { - if handle.GetType() == 19 || handle.GetType() == 0 { - return HCALENDAR{handle.GetHandle()} - } - return HCALENDAR{nil} -} - -// Convert HANDLE to HBITMAP (use with care) -func HANDLE_TO_HBITMAP(handle HANDLE) HBITMAP { - if handle.GetType() == 20 || handle.GetType() == 0 { - return HBITMAP{handle.GetHandle()} - } - return HBITMAP{nil} -} - -// Convert HANDLE to HSPLITBAR (use with care) -func HANDLE_TO_HSPLITBAR(handle HANDLE) HSPLITBAR { - if handle.GetType() == 21 || handle.GetType() == 0 { - return HSPLITBAR{handle.GetHandle()} - } - return HSPLITBAR{nil} -} - -func (window HGENERIC) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HGENERIC) GetType() C.uint { - return 0 -} - -func (window HWND) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HWND) GetType() C.uint { - return 1 -} - -func (window HENTRYFIELD) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HENTRYFIELD) GetType() C.uint { - return 2 -} - -func (window HTEXT) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HTEXT) GetType() C.uint { - return 3 -} - -func (window HTREE) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HTREE) GetType() C.uint { - return 4 -} - -func (window HCONTAINER) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HCONTAINER) GetType() C.uint { - return 5 -} - -func (window HMLE) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HMLE) GetType() C.uint { - return 6 -} - -func (window HBUTTON) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HBUTTON) GetType() C.uint { - return 7 -} - -func (window HSPINBUTTON) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HSPINBUTTON) GetType() C.uint { - return 8 -} - -func (window HNOTEBOOK) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HNOTEBOOK) GetType() C.uint { - return 9 -} - -func (window HBOX) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HBOX) GetType() C.uint { - return 10 -} - -func (window HSCROLLBOX) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HSCROLLBOX) GetType() C.uint { - return 11 -} - -func (window HMENUITEM) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HMENUITEM) GetType() C.uint { - return 12 -} - -func (window HLISTBOX) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HLISTBOX) GetType() C.uint { - return 13 -} - -func (window HPERCENT) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HPERCENT) GetType() C.uint { - return 14 -} - -func (window HSLIDER) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HSLIDER) GetType() C.uint { - return 15 -} - -func (window HSCROLLBAR) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HSCROLLBAR) GetType() C.uint { - return 16 -} - -func (window HRENDER) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HRENDER) GetType() C.uint { - return 17 -} - -func (window HHTML) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HHTML) GetType() C.uint { - return 18 -} - -func (window HCALENDAR) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HCALENDAR) GetType() C.uint { - return 19 -} - -func (window HBITMAP) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HBITMAP) GetType() C.uint { - return 20 -} - -func (window HSPLITBAR) GetHandle() unsafe.Pointer { - return window.hwnd -} - -func (window HSPLITBAR) GetType() C.uint { - return 21 -} - -func (treeitem HTREEITEM) GetHandle() unsafe.Pointer { - return treeitem.htreeitem -} - -func (window HTREEITEM) GetType() C.uint { - return 22 -} - -func (contins HCONTINS) GetHandle() unsafe.Pointer { - return contins.ptr -} - -func (window HCONTINS) GetType() C.uint { - return 0 -} - -func (event HEV) GetHandle() unsafe.Pointer { - return event.hev -} - -func (window HEV) GetType() C.uint { - return 0 -} - -func (mutex HMTX) GetHandle() unsafe.Pointer { - return mutex.hmtx -} - -func (window HMTX) GetType() C.uint { - return 0 -} - -// Initializes the Dynamic Windows engine. -func Init(newthread int) int { - if len(os.Args) > 0 { - var argc C.int = C.int(len(os.Args)) - argv := C.go_string_array_make(argc) - defer C.go_string_array_free(argv, argc) - for i, s := range os.Args { - C.go_string_array_set(argv, C.CString(s), C.int(i)) - } - return int(C.go_init(C.int(newthread), argc, argv)) - } - return int(C.go_init(C.int(newthread), 0, nil)) -} - -// Initializes a Go Routine for Dynamic Windows calls -func InitThread() { - runtime.LockOSThread() - - C._dw_init_thread() -} - -// Deinitializes a Go Routine when Dyamic Windows calls are complete -func DeinitThread() { - C._dw_deinit_thread() - - runtime.UnlockOSThread() -} - -// Cleanly terminates a DW session, should be signal handler safe but does not exit. -func Shutdown() { - C.dw_shutdown() -} - -// Returns some information about the current operating environment. -func Environment_query(env *Env) { - var cenv C.DWEnv - C.dw_environment_query(&cenv) - env.OSName = C.GoString((*C.char)(unsafe.Pointer(&cenv.osName[0]))) - env.BuildDate = C.GoString((*C.char)(unsafe.Pointer(&cenv.buildDate[0]))) - env.BuildTime = C.GoString((*C.char)(unsafe.Pointer(&cenv.buildTime[0]))) - env.MajorVersion = cenv.MajorVersion - env.MinorVersion = cenv.MajorVersion - env.MajorBuild = cenv.MajorBuild - env.MinorBuild = cenv.MinorBuild - env.DWMajorVersion = cenv.DWMajorVersion - env.DWMinorVersion = cenv.DWMinorVersion - env.DWSubVersion = cenv.DWSubVersion -} - -// Returns some information about the current operating environment. -func EnvironmentGet() Env { - var env Env - Environment_query(&env) - return env -} - -// Displays a Message Box with given text and title. -func Messagebox(title string, flags int, message string) int { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - cmessage := C.CString(message) - defer C.free(unsafe.Pointer(cmessage)) - - return int(C.go_messagebox(ctitle, C.int(flags), cmessage)) -} - -// Displays a Message Box with given text and title. -func MessageBox(title string, flags int, message string) int { - return Messagebox(title, flags, message) -} - -// Create a new Window Frame. -func Window_new(owner HWND, title string, flags uint) HWND { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - return HWND{C.go_window_new(unsafe.Pointer(owner.hwnd), ctitle, C.ulong(flags))} -} - -// Create a new Window Frame. -func WindowNew(owner HWND, title string, flags uint) HWND { - return Window_new(owner, title, flags) -} - -// Makes the window visible. -func Window_show(handle HANDLE) int { - return int(C.go_window_show(handle.GetHandle())) -} - -// Makes the window visible. -func (window HWND) Show() int { - return Window_show(window) -} - -// Makes the window invisible. -func Window_hide(handle HANDLE) int { - return int(C.go_window_hide(handle.GetHandle())) -} - -// Makes the window invisible. -func (window HWND) Hide() int { - return Window_hide(window) -} - -// Makes the window bottommost. -func Window_lower(handle HANDLE) int { - return int(C.go_window_lower(handle.GetHandle())) -} - -// Makes the window bottommost. -func (window HWND) Lower() int { - return Window_lower(window) -} - -// Makes the window topmost. -func Window_raise(handle HANDLE) int { - return int(C.go_window_raise(handle.GetHandle())) -} - -// Makes the window topmost. -func (window HWND) Raise() int { - return Window_raise(window) -} - -// Minimizes or Iconifies a top-level window. -func Window_minimize(handle HANDLE) int { - return int(C.go_window_minimize(handle.GetHandle())) -} - -// Minimizes or Iconifies a top-level window. -func (window HWND) Minimize() int { - return Window_minimize(window) -} - -// Sets the position of a given window. -func Window_set_pos(handle HANDLE, x int, y int) { - C.go_window_set_pos(handle.GetHandle(), C.long(x), C.long(y)) -} - -// Sets the position of a given window. -func (window HWND) SetPos(x int, y int) { - Window_set_pos(window, x, y) -} - -// Sets the position and size of a given window. -func Window_set_pos_size(handle HANDLE, x int, y int, width uint, height uint) { - C.go_window_set_pos_size(handle.GetHandle(), C.long(x), C.long(y), C.ulong(width), C.ulong(height)) -} - -// Sets the position and size of a given window. -func (window HWND) SetPosSize(x int, y int, width uint, height uint) { - Window_set_pos_size(window, x, y, width, height) -} - -// Sets the size of a given window. -func Window_set_size(handle HANDLE, width uint, height uint) { - C.go_window_set_size(handle.GetHandle(), C.ulong(width), C.ulong(height)) -} - -// Sets the size of a given window. -func (window HWND) SetSize(width uint, height uint) { - Window_set_size(window, width, height) -} - -// Sets the colors used by a specified widget handle. -func Window_set_color(handle HANDLE, fore COLOR, back COLOR) int { - return int(C.go_window_set_color(handle.GetHandle(), C.ulong(fore), C.ulong(back))) -} - -// Sets the style of a given widget. -func Window_set_style(handle HANDLE, style uint, mask uint) { - C.go_window_set_style(handle.GetHandle(), C.ulong(style), C.ulong(mask)) -} - -// Sets widget to click the default dialog item when an ENTER is pressed. -func Window_click_default(window HANDLE, next HANDLE) { - C.go_window_click_default(window.GetHandle(), next.GetHandle()) -} - -// Sets widget to click the default dialog item when an ENTER is pressed. -func (window HWND) ClickDefault(next HANDLE) { - Window_click_default(window, next) -} - -// Sets the default focus item for a window/dialog. -func Window_default(window HWND, defaultitem HANDLE) { - C.go_window_default(unsafe.Pointer(window.hwnd), defaultitem.GetHandle()) -} - -// Sets the default focus item for a window/dialog. -func (window HWND) Default(defaultitem HANDLE) { - Window_default(window, defaultitem) -} - -// Destroys a window and all of it's children. -func Window_destroy(handle HANDLE) int { - return int(C.go_window_destroy(handle.GetHandle())) -} - -// Disables given widget. -func Window_disable(handle HANDLE) { - C.go_window_disable(handle.GetHandle()) -} - -// Enables given widget. -func Window_enable(handle HANDLE) { - C.go_window_enable(handle.GetHandle()) -} - -// Gets the child widget handle with specified ID. -func Window_from_id(handle HANDLE, cid int) HGENERIC { - return HGENERIC{C.go_window_from_id(handle.GetHandle(), C.int(cid))} -} - -// Gets the child widget handle with specified ID. -func (window HWND) FromID(cid int) HGENERIC { - return Window_from_id(window, cid) -} - -// Gets a named user data item from a widget handle. -func Window_get_data(window HANDLE, dataname string) POINTER { - cdataname := C.CString(dataname) - defer C.free(unsafe.Pointer(cdataname)) - - return POINTER(C.go_window_get_data(window.GetHandle(), cdataname)) -} - -// Add a named user data item to a widget handle. -func Window_set_data(window HANDLE, dataname string, data POINTER) { - cdataname := C.CString(dataname) - defer C.free(unsafe.Pointer(cdataname)) - - C.go_window_set_data(window.GetHandle(), cdataname, unsafe.Pointer(data)) -} - -// Returns the current font for the specified widget -func Window_get_font(handle HANDLE) string { - cfontname := C.go_window_get_font(handle.GetHandle()) - fontname := C.GoString(cfontname) - C.dw_free(unsafe.Pointer(cfontname)) - return fontname -} - -// Sets the font used by a specified widget handle. -func Window_set_font(handle HANDLE, fontname string) int { - cfontname := C.CString(fontname) - defer C.free(unsafe.Pointer(cfontname)) - - return int(C.go_window_set_font(handle.GetHandle(), cfontname)) -} - -// Gets the position and size of a given window. -func Window_get_pos_size(handle HANDLE) (int, int, uint, uint) { - var x, y C.long - var width, height C.ulong - C.go_window_get_pos_size(handle.GetHandle(), &x, &y, &width, &height) - return int(x), int(y), uint(width), uint(height) -} - -// Gets the position and size of a given window. -func (window HWND) GetPosSize() (int, int, uint, uint) { - return Window_get_pos_size(window) -} - -// Gets the size the system thinks the widget should be. -func Window_get_preferred_size(handle HANDLE) (int, int) { - var width, height C.int - C.go_window_get_preferred_size(handle.GetHandle(), &width, &height) - return int(width), int(height) -} - -// Gets the text used for a given widget. -func Window_get_text(handle HANDLE) string { - ctext := C.go_window_get_text(handle.GetHandle()) - text := C.GoString(ctext) - C.dw_free(unsafe.Pointer(ctext)) - return text -} - -// Sets the text used for a given widget. -func Window_set_text(handle HANDLE, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_window_set_text(handle.GetHandle(), ctext) -} - -// Sets the text used for a given widget's floating bubble help. -func Window_set_tooltip(handle HANDLE, bubbletext string) { - cbubbletext := C.CString(bubbletext) - defer C.free(unsafe.Pointer(cbubbletext)) - - C.go_window_set_tooltip(handle.GetHandle(), cbubbletext) -} - -// Causes entire window to be invalidated and redrawn. -func Window_redraw(handle HANDLE) { - C.go_window_redraw(handle.GetHandle()) -} - -// Causes entire window to be invalidated and redrawn. -func (window HWND) Redraw() { - Window_redraw(window) -} - -// Captures the mouse input to this window even if it is outside the bounds. -func Window_capture(handle HANDLE) { - C.go_window_capture(handle.GetHandle()) -} - -// Captures the mouse input to this window even if it is outside the bounds. -func (window HWND) Capture() { - Window_capture(window) -} - -// Releases previous mouse capture. -func Window_release() { - C.dw_window_release() -} - -// Releases previous mouse capture. -func (window HWND) Release() { - Window_release() -} - -// Sets the bitmap used for a given widget. -func Window_set_bitmap(window HANDLE, id uint, filename string) { - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - C.go_window_set_bitmap(window.GetHandle(), C.ulong(id), cfilename) -} - -// Sets the bitmap used for a given widget. -func (window HBUTTON) SetBitmap(id uint, filename string) { - Window_set_bitmap(window, id, filename) -} - -// Sets the bitmap used for a given widget. -func (window HBITMAP) SetBitmap(id uint, filename string) { - Window_set_bitmap(window, id, filename) -} - -// Sets the border size of a specified window handle. -// This function may only work on OS/2. -func Window_set_border(handle HANDLE, border int) { - C.go_window_set_border(handle.GetHandle(), C.int(border)) -} - -// Sets the border size of a specified window handle. -// This function may only work on OS/2. -func (window HWND) SetBorder(border int) { - Window_set_border(window, border) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func Window_set_focus(handle HANDLE) { - C.go_window_set_focus(handle.GetHandle()) -} - -// Sets the gravity of a given window. -// Gravity controls which corner of the screen and window the position is relative to. -func Window_set_gravity(handle HANDLE, horz int, vert int) { - C.go_window_set_gravity(handle.GetHandle(), C.int(horz), C.int(vert)) -} - -// Sets the gravity of a given window. -// Gravity controls which corner of the screen and window the position is relative to. -func (window HWND) SetGravity(horz int, vert int) { - Window_set_gravity(window, horz, vert) -} - -// Sets the icon used for a given window. -func Window_set_icon(handle HANDLE, icon HICN) { - C.go_window_set_icon(handle.GetHandle(), unsafe.Pointer(icon)) -} - -// Sets the icon used for a given window. -func (window HWND) SetIcon(icon HICN) { - Window_set_icon(window, icon) -} - -// Changes the appearance of the mouse pointer. -func Window_set_pointer(handle HANDLE, cursortype int) { - C.go_window_set_pointer(handle.GetHandle(), C.int(cursortype)) -} - -/* Start Generic Section --- - * These need to be implemented by basically every class/type - */ - -// Destroys a window and all of it's children. -func (window HWND) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HWND) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HWND) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HWND) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HWND) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HWND) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HWND) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HWND) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HWND) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HWND) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HWND) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HWND) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HWND) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HWND) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Destroys a widget and all of it's children. -func (window HENTRYFIELD) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HENTRYFIELD) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HENTRYFIELD) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HENTRYFIELD) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HENTRYFIELD) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HENTRYFIELD) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HENTRYFIELD) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HENTRYFIELD) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HENTRYFIELD) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HENTRYFIELD) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HENTRYFIELD) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HENTRYFIELD) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HENTRYFIELD) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HENTRYFIELD) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HENTRYFIELD) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HTEXT) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HTEXT) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HTEXT) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HTEXT) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HTEXT) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HTEXT) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HTEXT) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HTEXT) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HTEXT) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HTEXT) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HTEXT) SetText(text string) { - Window_set_text(window, text) -} - -// Changes the appearance of the mouse pointer. -func (window HTEXT) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HTEXT) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HTEXT) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HTREE) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HTREE) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HTREE) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HTREE) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HTREE) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HTREE) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HTREE) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HTREE) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HTREE) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HTREE) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HTREE) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HTREE) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HTREE) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HTREE) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HTREE) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HCONTAINER) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HCONTAINER) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HCONTAINER) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HCONTAINER) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HCONTAINER) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HCONTAINER) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HCONTAINER) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HCONTAINER) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HCONTAINER) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HCONTAINER) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HCONTAINER) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HCONTAINER) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HCONTAINER) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HCONTAINER) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HCONTAINER) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HMLE) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HMLE) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HMLE) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HMLE) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HMLE) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HMLE) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HMLE) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HMLE) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HMLE) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HMLE) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HMLE) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HMLE) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HMLE) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HMLE) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HMLE) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HBUTTON) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HBUTTON) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HBUTTON) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HBUTTON) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HBUTTON) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HBUTTON) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HBUTTON) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HBUTTON) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HBUTTON) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HBUTTON) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HBUTTON) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HBUTTON) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HBUTTON) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HBUTTON) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HBUTTON) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HSPINBUTTON) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HSPINBUTTON) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HSPINBUTTON) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HSPINBUTTON) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HSPINBUTTON) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HSPINBUTTON) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HSPINBUTTON) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HSPINBUTTON) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HSPINBUTTON) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HSPINBUTTON) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HSPINBUTTON) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HSPINBUTTON) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HSPINBUTTON) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HSPINBUTTON) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HSPINBUTTON) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HNOTEBOOK) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HNOTEBOOK) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HNOTEBOOK) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HNOTEBOOK) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HNOTEBOOK) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HNOTEBOOK) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HNOTEBOOK) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HNOTEBOOK) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HNOTEBOOK) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HNOTEBOOK) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HNOTEBOOK) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HNOTEBOOK) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HNOTEBOOK) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HNOTEBOOK) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HNOTEBOOK) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HLISTBOX) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HLISTBOX) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HLISTBOX) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HLISTBOX) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HLISTBOX) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HLISTBOX) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Sets the colors used by a specified widget handle. -func (window HLISTBOX) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HLISTBOX) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HLISTBOX) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HLISTBOX) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HLISTBOX) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HLISTBOX) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HLISTBOX) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HPERCENT) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HPERCENT) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HPERCENT) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HPERCENT) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HPERCENT) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HPERCENT) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HPERCENT) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HPERCENT) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HPERCENT) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HPERCENT) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HPERCENT) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HPERCENT) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HPERCENT) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HPERCENT) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HPERCENT) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HSLIDER) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HSLIDER) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HSLIDER) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HSLIDER) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HSLIDER) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HSLIDER) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HSLIDER) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HSLIDER) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HSLIDER) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HSLIDER) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HSLIDER) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HSLIDER) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HSLIDER) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HSLIDER) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HSLIDER) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HSCROLLBAR) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HSCROLLBAR) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HSCROLLBAR) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HSCROLLBAR) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HSCROLLBAR) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HSCROLLBAR) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Gets the text used for a given widget. -func (window HSCROLLBAR) GetText() string { - return Window_get_text(window) -} - -// Sets the colors used by a specified widget handle. -func (window HSCROLLBAR) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HSCROLLBAR) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HSCROLLBAR) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget. -func (window HSCROLLBAR) SetText(text string) { - Window_set_text(window, text) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HSCROLLBAR) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HSCROLLBAR) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HSCROLLBAR) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HSCROLLBAR) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HCALENDAR) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HCALENDAR) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HCALENDAR) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HCALENDAR) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HCALENDAR) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HCALENDAR) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Sets the colors used by a specified widget handle. -func (window HCALENDAR) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HCALENDAR) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HCALENDAR) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HCALENDAR) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HCALENDAR) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HCALENDAR) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HCALENDAR) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HBITMAP) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HBITMAP) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HBITMAP) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HBITMAP) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HBITMAP) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HBITMAP) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Sets the colors used by a specified widget handle. -func (window HBITMAP) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HBITMAP) SetFocus() { - Window_set_focus(window) -} - -// Sets the font used by a specified widget handle. -func (window HBITMAP) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Sets the text used for a given widget's floating bubble help. -func (window HBITMAP) SetTooltip(bubbletext string) { - Window_set_tooltip(window, bubbletext) -} - -// Changes the appearance of the mouse pointer. -func (window HBITMAP) SetPointer(cursortype int) { - Window_set_pointer(window, cursortype) -} - -// Sets the style of a given widget. -func (window HBITMAP) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HBITMAP) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HHTML) Destroy() int { - return Window_destroy(window) -} - -// Disables given widget. -func (window HHTML) Disable() { - Window_disable(window) -} - -// Enables given widget. -func (window HHTML) Enable() { - Window_enable(window) -} - -// Gets a named user data item from a widget handle. -func (window HHTML) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HHTML) GetFont() string { - return Window_get_font(window) -} - -// Gets the size the system thinks the widget should be. -func (window HHTML) GetPreferredSize() (int, int) { - return Window_get_preferred_size(window) -} - -// Sets the current focus widget for a window/dialog. -// This is for use after showing the window/dialog. -func (window HHTML) SetFocus() { - Window_set_focus(window) -} - -// Sets the style of a given widget. -func (window HHTML) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -// Remove widget from the box it is packed into. -func (window HHTML) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HSPLITBAR) Destroy() int { - return Window_destroy(window) -} - -// Gets a named user data item from a widget handle. -func (window HSPLITBAR) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Remove widget from the box it is packed into. -func (window HSPLITBAR) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HBOX) Destroy() int { - return Window_destroy(window) -} - -// Gets a named user data item from a widget handle. -func (window HBOX) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Sets the colors used by a specified widget handle. -func (window HBOX) SetColor(fore COLOR, back COLOR) int { - return Window_set_color(window, fore, back) -} - -// Remove widget from the box it is packed into. -func (window HBOX) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HSCROLLBOX) Destroy() int { - return Window_destroy(window) -} - -// Gets a named user data item from a widget handle. -func (window HSCROLLBOX) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Remove widget from the box it is packed into. -func (window HSCROLLBOX) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HRENDER) Destroy() int { - return Window_destroy(window) -} - -// Gets a named user data item from a widget handle. -func (window HRENDER) GetData(dataname string) POINTER { - return Window_get_data(window, dataname) -} - -// Returns the current font for the specified widget -func (window HRENDER) GetFont() string { - return Window_get_font(window) -} - -// Get the width and height of a text string. -func (window HRENDER) GetTextExtents(text string) (int, int) { - return Font_text_extents_get(window, NOHPIXMAP, text) -} - -// Sets the font used by a specified widget handle. -func (window HRENDER) SetFont(fontname string) int { - return Window_set_font(window, fontname) -} - -// Remove widget from the box it is packed into. -func (window HRENDER) Unpack() int { - return Box_unpack(window) -} - -// Destroys a widget and all of it's children. -func (window HMENUITEM) Destroy() int { - return Window_destroy(window) -} - -// Sets the style of a given widget. -func (window HMENUITEM) SetStyle(style uint, mask uint) { - Window_set_style(window, style, mask) -} - -/* End Generic Section */ - -// Runs a message loop for Dynamic Windows. -func Main() { - C.dw_main() -} - -// Processes a single message iteration and returns. -func Main_iteration() { - C.dw_main_iteration() -} - -// Processes a single message iteration and returns. -func MainIteration() { - Main_iteration() -} - -// Causes running dw.Main() to return. -func Main_quit() { - C.dw_main_quit() -} - -// Causes running dw.Main() to return. -func MainQuit() { - Main_quit() -} - -// Runs a message loop for Dynamic Windows, for a period of milliseconds. -func Main_sleep(milliseconds int) { - C.dw_main_sleep(C.int(milliseconds)) -} - -// Runs a message loop for Dynamic Windows, for a period of milliseconds. -func MainSleep(milliseconds int) { - Main_sleep(milliseconds) -} - -// Create a new Box to be packed. -func Box_new(btype int, pad int) HBOX { - return HBOX{C.go_box_new(C.int(btype), C.int(pad))} -} - -// Create a new Box to be packed. -func BoxNew(btype int, pad int) HBOX { - return Box_new(btype, pad) -} - -// Pack widgets into a box at an arbitrary location. -func Box_pack_at_index(box HANDLE, item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { - C.go_box_pack_at_index(box.GetHandle(), item.GetHandle(), C.int(index), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) -} - -// Pack widgets into a box at an arbitrary location. -func (window HWND) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { - Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box at an arbitrary location. -func (window HBOX) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { - Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box at an arbitrary location. -func (window HSCROLLBOX) PackAtIndex(item HANDLE, index int, width int, height int, hsize int, vsize int, pad int) { - Box_pack_at_index(window, item, index, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the end (or bottom). -func Box_pack_end(box HANDLE, item HANDLE, width int, height int, hsize int, vsize int, pad int) { - C.go_box_pack_end(box.GetHandle(), item.GetHandle(), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) -} - -// Pack widgets into a box from the end (or bottom). -func (window HWND) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_end(window, item, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the end (or bottom). -func (window HBOX) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_end(window, item, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the end (or bottom). -func (window HSCROLLBOX) PackEnd(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_end(window, item, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the start (or top). -func Box_pack_start(box HANDLE, item HANDLE, width int, height int, hsize int, vsize int, pad int) { - C.go_box_pack_start(box.GetHandle(), item.GetHandle(), C.int(width), C.int(height), C.int(hsize), C.int(vsize), C.int(pad)) -} - -// Pack widgets into a box from the start (or top). -func (window HWND) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_start(window, item, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the start (or top). -func (window HBOX) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_start(window, item, width, height, hsize, vsize, pad) -} - -// Pack widgets into a box from the start (or top). -func (window HSCROLLBOX) PackStart(item HANDLE, width int, height int, hsize int, vsize int, pad int) { - Box_pack_start(window, item, width, height, hsize, vsize, pad) -} - -// Remove widget from the box it is packed into. -func Box_unpack(handle HANDLE) int { - return int(C.go_box_unpack(handle.GetHandle())) -} - -// Remove widgets from a box at an arbitrary location. -func Box_unpack_at_index(handle HANDLE, index int) HANDLE { - return HANDLE(HWND{C.go_box_unpack_at_index(handle.GetHandle(), C.int(index))}) -} - -// Remove widgets from a box at an arbitrary location. -func (window HWND) UnpackAtIndex(index int) HANDLE { - return Box_unpack_at_index(window, index) -} - -// Remove widgets from a box at an arbitrary location. -func (window HBOX) UnpackAtIndex(index int) HANDLE { - return Box_unpack_at_index(window, index) -} - -// Remove widgets from a box at an arbitrary location. -func (window HSCROLLBOX) UnpackAtIndex(index int) HANDLE { - return Box_unpack_at_index(window, index) -} - -// Create a new static text widget to be packed. -func Text_new(text string, id uint) HTEXT { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HTEXT{C.go_text_new(ctext, C.ulong(id))} -} - -// Create a new static text widget to be packed. -func TextNew(text string, id uint) HTEXT { - return Text_new(text, id) -} - -// Create a new status text widget to be packed. -func Status_text_new(text string, id uint) HTEXT { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HTEXT{C.go_status_text_new(ctext, C.ulong(id))} -} - -// Create a new status text widget to be packed. -func StatusTextNew(text string, id uint) HTEXT { - return Status_text_new(text, id) -} - -// Create a new entryfield widget to be packed. -func Entryfield_new(text string, id uint) HENTRYFIELD { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HENTRYFIELD{C.go_entryfield_new(ctext, C.ulong(id))} -} - -// Create a new entryfield widget to be packed. -func EntryfieldNew(text string, id uint) HENTRYFIELD { - return Entryfield_new(text, id) -} - -// Create a new entryfield password widget to be packed. -func Entryfield_password_new(text string, id uint) HENTRYFIELD { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HENTRYFIELD{C.go_entryfield_password_new(ctext, C.ulong(id))} -} - -// Create a new entryfield password widget to be packed. -func EntryfieldPasswordNew(text string, id uint) HENTRYFIELD { - return Entryfield_password_new(text, id) -} - -// Sets the entryfield character limit. -func Entryfield_set_limit(handle HANDLE, limit int) { - C.go_entryfield_set_limit(handle.GetHandle(), C.int(limit)) -} - -// Sets the entryfield character limit. -func (handle HENTRYFIELD) SetLimit(limit int) { - Entryfield_set_limit(handle, limit) -} - -// Create a new button widget to be packed. -func Button_new(text string, id uint) HBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HBUTTON{C.go_button_new(ctext, C.ulong(id))} -} - -// Create a new button widget to be packed. -func ButtonNew(text string, id uint) HBUTTON { - return Button_new(text, id) -} - -// Gets the contents of the default clipboard as text. -func Clipboard_get_text() string { - ctext := C.dw_clipboard_get_text() - text := C.GoString(ctext) - C.dw_free(unsafe.Pointer(ctext)) - return text -} - -// Gets the contents of the default clipboard as text. -func ClipboardGetText() string { - return Clipboard_get_text() -} - -// Sets the contents of the default clipboard to the supplied text. -func Clipboard_set_text(text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.dw_clipboard_set_text(ctext, C.int(C.strlen(ctext))) -} - -// Sets the contents of the default clipboard to the supplied text. -func ClipboardSetText(text string) { - Clipboard_set_text(text) -} - -// Opens a file dialog and queries user selection. -func File_browse(title string, defpath string, ext string, flags int) string { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - cdefpath := C.CString(defpath) - defer C.free(unsafe.Pointer(cdefpath)) - cext := C.CString(ext) - defer C.free(unsafe.Pointer(cext)) - - result := C.dw_file_browse(ctitle, cdefpath, cext, C.int(flags)) - defer C.dw_free(unsafe.Pointer(result)) - return C.GoString(result) -} - -// Opens a file dialog and queries user selection. -func FileBrowse(title string, defpath string, ext string, flags int) string { - return File_browse(title, defpath, ext, flags) -} - -// Allows the user to choose a color using the system's color chooser dialog. -func Color_choose(value COLOR) COLOR { - return COLOR(C.dw_color_choose(C.ulong(value))) -} - -// Allows the user to choose a color using the system's color chooser dialog. -func ColorChoose(value COLOR) COLOR { - return Color_choose(value) -} - -// Add a callback to a timer event. -func Timer_connect(interval int, sigfunc SIGNAL_FUNC, data POINTER) HTIMER { - backs = append(backs, unsafe.Pointer(sigfunc)) - return HTIMER{C.go_timer_connect(C.int(interval), unsafe.Pointer(sigfunc), unsafe.Pointer(data), 0)} -} - -// Create a new timer. -func TimerNew() HTIMER { - return HTIMER{0} -} - -//Removes timer callback. -func Timer_disconnect(id HTIMER) { - if id.tid > 0 { - C.dw_timer_disconnect(C.int(id.tid)) - } -} - -// Add a callback to a widget event. -func Signal_connect(window HANDLE, signame string, sigfunc SIGNAL_FUNC, data POINTER) { - csigname := C.CString(signame) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(sigfunc)) - thissigfunc := unsafe.Pointer(sigfunc) - thisdata := unsafe.Pointer(data) - C.go_signal_connect(window.GetHandle(), csigname, thissigfunc, thisdata, window.GetType()<<8) -} - -// Emits a beep. -func Beep(freq int, dur int) { - C.dw_beep(C.int(freq), C.int(dur)) -} - -// Create a menu object to be popped up. -func Menu_new(id uint) HMENUI { - return HMENUI{C.go_menu_new(C.ulong(id))} -} - -// Create a menu object to be popped up. -func MenuNew(id uint) HMENUI { - return Menu_new(id) -} - -// Create a menubar on a window. -func Menubar_new(location HWND) HMENUI { - return HMENUI{C.go_menubar_new(unsafe.Pointer(location.hwnd))} -} - -// Create a menubar on a window. -func (window HWND) MenubarNew() HMENUI { - return Menubar_new(window) -} - -// Adds a menuitem or submenu to an existing menu. -func Menu_append_item(menu HMENUI, title string, id uint, flags uint, end int, check int, submenu HMENUI) HMENUITEM { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - return HMENUITEM{C.go_menu_append_item(menu.hmenui, ctitle, C.ulong(id), C.ulong(flags), C.int(end), C.int(check), submenu.hmenui)} -} - -// Adds a menuitem or submenu to an existing menu. -func (menui HMENUI) AppendItem(title string, id uint, flags uint, end int, check int, submenu HMENUI) HMENUITEM { - return Menu_append_item(menui, title, id, flags, end, check, submenu) -} - -// Deletes the menu item specified. -func Menu_delete_item(menu HMENUI, id uint) { - C.go_menu_delete_item(menu.hmenui, C.ulong(id)) -} - -// Deletes the menu item specified. -func (menui HMENUI) DeleteItem(id uint) { - Menu_delete_item(menui, id) -} - -// Destroys a menu created with dw.Menubar_new or dw.Menu_new. -func Menu_destroy(menu HMENUI) { - C.go_menu_destroy(menu.hmenui) -} - -// Destroys a menu created with dw.MenubarNew or dw.MenuNew. -func (menui HMENUI) Destroy() { - Menu_destroy(menui) -} - -// Sets the state of a menu item. -func Menu_item_set_state(menu HMENUI, id uint, flags uint) { - C.go_menu_item_set_state(menu.hmenui, C.ulong(id), C.ulong(flags)) -} - -// Sets the state of a menu item. -func (menui HMENUI) SetState(id uint, flags uint) { - Menu_item_set_state(menui, id, flags) -} - -// Pops up a context menu at given x and y coordinates. -func Menu_popup(menu HMENUI, parent HANDLE, x int, y int) { - C.go_menu_popup(menu.hmenui, parent.GetHandle(), C.int(x), C.int(y)) -} - -// Pops up a context menu at given x and y coordinates. -func (menui HMENUI) Popup(parent HANDLE, x int, y int) { - Menu_popup(menui, parent, x, y) -} - -// Create a notebook widget to be packed. -func Notebook_new(id uint, top int) HNOTEBOOK { - return HNOTEBOOK{C.go_notebook_new(C.ulong(id), C.int(top))} -} - -// Create a notebook widget to be packed. -func NotebookNew(id uint, top int) HNOTEBOOK { - return Notebook_new(id, top) -} - -// Packs the specified box into the notebook page. -func Notebook_pack(handle HANDLE, pageid HNOTEPAGE, page HANDLE) { - C.go_notebook_pack(handle.GetHandle(), pageid.pageid, page.GetHandle()) -} - -// Packs the specified box into the notebook page. -func (handle HNOTEPAGE) Pack(page HANDLE) { - Notebook_pack(handle.hnotebook, handle, page) -} - -// The contents of the notebook page will be destroyed as well. -func Notebook_page_destroy(handle HANDLE, pageid HNOTEPAGE) { - C.go_notebook_page_destroy(handle.GetHandle(), pageid.pageid) -} - -// The contents of the notebook page will be destroyed as well. -func (handle HNOTEPAGE) Destroy() { - Notebook_page_destroy(handle.hnotebook, handle) -} - -// Get the currently visible page. -func Notebook_page_get(handle HANDLE) HNOTEPAGE { - return HNOTEPAGE{C.go_notebook_page_get(handle.GetHandle()), handle} -} - -// Get the currently visible page. -func (handle HNOTEBOOK) PageGet() HNOTEPAGE { - return Notebook_page_get(handle) -} - -// Adds a new page to specified notebook. -func Notebook_page_new(handle HANDLE, flags uint, front int) HNOTEPAGE { - return HNOTEPAGE{C.go_notebook_page_new(handle.GetHandle(), C.ulong(flags), C.int(front)), handle} -} - -// Adds a new page to specified notebook. -func (handle HNOTEBOOK) PageNew(flags uint, front int) HNOTEPAGE { - return Notebook_page_new(handle, flags, front) -} - -// Sets the currently visible page. -func Notebook_page_set(handle HANDLE, pageid HNOTEPAGE) { - C.go_notebook_page_set(handle.GetHandle(), pageid.pageid) -} - -// Sets the text on the specified notebook tab. -func Notebook_page_set_text(handle HANDLE, pageid HNOTEPAGE, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_notebook_page_set_text(handle.GetHandle(), pageid.pageid, ctext) -} - -// Sets the text on the specified notebook tab. -func (handle HNOTEPAGE) SetText(text string) { - Notebook_page_set_text(handle.hnotebook, handle, text) -} - -// Obtains an icon from a file. -func Icon_load_from_file(filename string) HICN { - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - return HICN(C.go_icon_load_from_file(cfilename)) -} - -// Obtains an icon from a file. -func IconLoadFromFile(filename string) HICN { - return Icon_load_from_file(filename) -} - -// Obtains an icon from a module (or header in GTK). -func Icon_load(id uint) HICN { - return HICN(C.go_icon_load(0, C.ulong(id))) -} - -// Obtains an icon from a module (or header in GTK). -func IconLoad(id uint) HICN { - return Icon_load(id) -} - -// Deletes an icon from the taskbar. -func Taskbar_delete(handle HANDLE, icon HICN) { - C.go_taskbar_delete(handle.GetHandle(), unsafe.Pointer(icon)) -} - -// Deletes an icon from the taskbar. -func TaskbarDelete(handle HANDLE, icon HICN) { - Taskbar_delete(handle, icon) -} - -// Inserts an icon into the taskbar. -func Taskbar_insert(handle HANDLE, icon HICN, bubbletext string) { - cbubbletext := C.CString(bubbletext) - defer C.free(unsafe.Pointer(cbubbletext)) - - C.go_taskbar_insert(handle.GetHandle(), unsafe.Pointer(icon), cbubbletext) -} - -// Inserts an icon into the taskbar. -func TaskbarInsert(handle HANDLE, icon HICN, bubbletext string) { - Taskbar_insert(handle, icon, bubbletext) -} - -// Create a new Combobox widget to be packed. -func Combobox_new(text string, id uint) HLISTBOX { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HLISTBOX{C.go_combobox_new(ctext, C.ulong(id))} -} - -// Create a new Combobox widget to be packed. -func ComboboxNew(text string, id uint) HLISTBOX { - return Combobox_new(text, id) -} - -// Create a new listbox widget to be packed. -func Listbox_new(id uint, multi int) HLISTBOX { - return HLISTBOX{C.go_listbox_new(C.ulong(id), C.int(multi))} -} - -// Create a new listbox widget to be packed. -func ListboxNew(id uint, multi int) HLISTBOX { - return Listbox_new(id, multi) -} - -// Appends the specified text to the listbox's (or combobox) entry list. -func Listbox_append(handle HANDLE, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_listbox_append(handle.GetHandle(), ctext) -} - -// Appends the specified text to the listbox's (or combobox) entry list. -func (handle HLISTBOX) Append(text string) { - Listbox_append(handle, text) -} - -// Appends the specified text items to the listbox's (or combobox) entry list. -func Listbox_list_append(handle HANDLE, text []string) { - count := len(text) - ctext := C.go_string_array_make(C.int(count)) - defer C.go_string_array_free(ctext, C.int(count)) - - for i, s := range text { - C.go_string_array_set(ctext, C.CString(s), C.int(i)) - } - - C.go_listbox_list_append(handle.GetHandle(), ctext, C.int(count)) -} - -// Appends the specified text items to the listbox's (or combobox) entry list. -func (handle HLISTBOX) AppendList(text []string) { - Listbox_list_append(handle, text) -} - -func Listbox_insert(handle HANDLE, text string, pos int) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_listbox_insert(handle.GetHandle(), ctext, C.int(pos)) -} - -// Inserts the specified text into the listbox's (or combobox) entry list. -func (handle HLISTBOX) Insert(text string, pos int) { - Listbox_insert(handle, text, pos) -} - -// Clears the listbox's (or combobox) list of all entries. -func Listbox_clear(handle HANDLE) { - C.go_listbox_clear(handle.GetHandle()) -} - -// Clears the listbox's (or combobox) list of all entries. -func (handle HLISTBOX) Clear() { - Listbox_clear(handle) -} - -// Returns the listbox's item count. -func Listbox_count(handle HANDLE) int { - return int(C.go_listbox_count(handle.GetHandle())) -} - -// Returns the listbox's item count. -func (handle HLISTBOX) Count() int { - return Listbox_count(handle) -} - -// Sets the topmost item in the viewport. -func Listbox_set_top(handle HANDLE, top int) { - C.go_listbox_set_top(handle.GetHandle(), C.int(top)) -} - -// Sets the topmost item in the viewport. -func (handle HLISTBOX) SetTop(top int) { - Listbox_set_top(handle, top) -} - -// Sets the selection state of a given index. -func Listbox_select(handle HANDLE, index int, state int) { - C.go_listbox_select(handle.GetHandle(), C.int(index), C.int(state)) -} - -// Sets the selection state of a given index. -func (handle HLISTBOX) Select(index int, state int) { - Listbox_select(handle, index, state) -} - -// Deletes the item with given index from the list. -func Listbox_delete(handle HANDLE, index int) { - C.go_listbox_delete(handle.GetHandle(), C.int(index)) -} - -// Deletes the item with given index from the list. -func (handle HLISTBOX) Delete(index int) { - Listbox_delete(handle, index) -} - -// Get the given index item's text. -func Listbox_get_text(handle HANDLE, index int) string { - var buf [201]C.char - - C.go_listbox_get_text(handle.GetHandle(), C.int(index), &buf[0], 200) - return C.GoString((*C.char)(unsafe.Pointer(&buf[0]))) -} - -// Get the given index item's text. -func (handle HLISTBOX) GetText(index int) string { - return Listbox_get_text(handle, index) -} - -// Sets the text of a given listbox entry. -func Listbox_set_text(handle HANDLE, index int, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_listbox_set_text(handle.GetHandle(), C.int(index), ctext) -} - -// Sets the text of a given listbox entry. -func (handle HLISTBOX) SetText(index int, text string) { - Listbox_set_text(handle, index, text) -} - -// Returns the index to the item in the list currently selected. -func Listbox_selected(handle HANDLE) int { - return int(C.go_listbox_selected(handle.GetHandle())) -} - -// Returns the index to the item in the list currently selected. -func (handle HLISTBOX) Selected() int { - return Listbox_selected(handle) -} - -// Returns the index to the current selected item or -1 when done. -func Listbox_selected_multi(handle HANDLE, where int) int { - return int(C.go_listbox_selected_multi(handle.GetHandle(), C.int(where))) -} - -// Returns the index to the current selected item or -1 when done. -func (handle HLISTBOX) SelectedMulti(where int) int { - return Listbox_selected_multi(handle, where) -} - -// Returns the width of the screen. -func Screen_width() int { - return int(C.dw_screen_width()) -} - -// Returns the width of the screen. -func ScreenWidth() int { - return Screen_width() -} - -// Returns the height of the screen. -func Screen_height() int { - return int(C.dw_screen_height()) -} - -// Returns the height of the screen. -func ScreenHeight() int { - return Screen_height() -} - -// This should return the current color depth. -func Color_depth_get() uint { - return uint(C.dw_color_depth_get()) -} - -// This should return the current color depth. -func ColorDepthGet() uint { - return Color_depth_get() -} - -// Sets the current foreground drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). -func Color_foreground_set(color COLOR) { - C.dw_color_foreground_set(C.ulong(color)) -} - -// Sets the current foreground drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). -func ColorForegroundSet(color COLOR) { - Color_foreground_set(color) -} - -// Sets the current background drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). -func Color_background_set(color COLOR) { - C.dw_color_background_set(C.ulong(color)) -} - -// Sets the current background drawing color. Either a color constant such as dw.CLR_BLACK or an RGB color using the dw.RGB(). -func ColorBackgroundSet(color COLOR) { - Color_background_set(color) -} - -// Create a new spinbutton widget to be packed. -func Spinbutton_new(text string, id C.ulong) HSPINBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HSPINBUTTON{C.go_spinbutton_new(ctext, id)} -} - -// Create a new spinbutton widget to be packed. -func SpinButtonNew(text string, id C.ulong) HSPINBUTTON { - return Spinbutton_new(text, id) -} - -// Sets the spinbutton value. -func Spinbutton_set_pos(handle HANDLE, position int) { - C.go_spinbutton_set_pos(handle.GetHandle(), C.long(position)) -} - -// Sets the spinbutton value. -func (handle HSPINBUTTON) SetPos(position int) { - Spinbutton_set_pos(handle, position) -} - -// Sets the spinbutton limits. -func Spinbutton_set_limits(handle HANDLE, upper int, lower int) { - C.go_spinbutton_set_limits(handle.GetHandle(), C.long(upper), C.long(lower)) -} - -// Sets the spinbutton limits. -func (handle HSPINBUTTON) SetLimits(upper int, lower int) { - Spinbutton_set_limits(handle, upper, lower) -} - -// Returns the current value of the spinbutton. -func Spinbutton_get_pos(handle HANDLE) int { - return int(C.go_spinbutton_get_pos(handle.GetHandle())) -} - -// Returns the current value of the spinbutton. -func (handle HSPINBUTTON) GetPos() int { - return Spinbutton_get_pos(handle) -} - -// Create a new radiobutton widget to be packed. -func Radiobutton_new(text string, id uint) HBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HBUTTON{C.go_radiobutton_new(ctext, C.ulong(id))} -} - -// Create a new radiobutton widget to be packed. -func RadioButtonNew(text string, id uint) HBUTTON { - return Radiobutton_new(text, id) -} - -// Create a new checkbox widget to be packed. -func Checkbox_new(text string, id uint) HBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HBUTTON{C.go_checkbox_new(ctext, C.ulong(id))} -} - -// Create a new checkbox widget to be packed. -func CheckButtonNew(text string, id uint) HBUTTON { - return Checkbox_new(text, id) -} - -// Returns the state of the checkbox. -func Checkbox_get(handle HANDLE) int { - return int(C.go_checkbox_get(handle.GetHandle())) -} - -// Returns the state of the checkbox. -func (handle HBUTTON) Get() int { - return Checkbox_get(handle) -} - -// Sets the state of the checkbox. -func Checkbox_set(handle HANDLE, value int) { - C.go_checkbox_set(handle.GetHandle(), C.int(value)) -} - -// Sets the state of the checkbox. -func (handle HBUTTON) Set(value int) { - Checkbox_set(handle, value) -} - -// Create a new percent bar widget to be packed. -func Percent_new(id C.ulong) HPERCENT { - return HPERCENT{C.go_percent_new(id)} -} - -// Create a new percent bar widget to be packed. -func PercentNew(id C.ulong) HPERCENT { - return Percent_new(id) -} - -// Sets the percent bar position. -func Percent_set_pos(handle HANDLE, position uint) { - C.go_percent_set_pos(handle.GetHandle(), C.uint(position)) -} - -// Sets the percent bar position. -func (handle HPERCENT) SetPos(position uint) { - Percent_set_pos(handle, position) -} - -// Create a new slider widget to be packed. -func Slider_new(vertical int, increments int, id uint) HSLIDER { - return HSLIDER{C.go_slider_new(C.int(vertical), C.int(increments), C.ulong(id))} -} - -// Create a new slider widget to be packed. -func SliderNew(vertical int, increments int, id uint) HSLIDER { - return Slider_new(vertical, increments, id) -} - -// Create a new scrollbar widget to be packed. -func Scrollbar_new(vertical int, id uint) HSCROLLBAR { - return HSCROLLBAR{C.go_scrollbar_new(C.int(vertical), C.ulong(id))} -} - -// Create a new scrollbar widget to be packed. -func ScrollbarNew(vertical int, id uint) HSCROLLBAR { - return Scrollbar_new(vertical, id) -} - -// Returns the position of the slider. -func Slider_get_pos(handle HANDLE) uint { - return uint(C.go_slider_get_pos(handle.GetHandle())) -} - -// Returns the position of the slider. -func (handle HSLIDER) GetPos() uint { - return Slider_get_pos(handle) -} - -// Sets the slider position. -func Slider_set_pos(handle HANDLE, position uint) { - C.go_slider_set_pos(handle.GetHandle(), C.uint(position)) -} - -// Sets the slider position. -func (handle HSLIDER) SetPos(position uint) { - Slider_set_pos(handle, position) -} - -// Returns the position of the scrollbar. -func Scrollbar_get_pos(handle HANDLE) uint { - return uint(C.go_scrollbar_get_pos(handle.GetHandle())) -} - -// Returns the position of the scrollbar. -func (handle HSCROLLBAR) GetPos() uint { - return Scrollbar_get_pos(handle) -} - -// Sets the scrollbar position. -func Scrollbar_set_pos(handle HANDLE, position uint) { - C.go_scrollbar_set_pos(handle.GetHandle(), C.uint(position)) -} - -// Sets the scrollbar position. -func (handle HSCROLLBAR) SetPos(position uint) { - Scrollbar_set_pos(handle, position) -} - -// Sets the scrollbar range. -func Scrollbar_set_range(handle HANDLE, srange uint, visible uint) { - C.go_scrollbar_set_range(handle.GetHandle(), C.uint(srange), C.uint(visible)) -} - -// Sets the scrollbar range. -func (handle HSCROLLBAR) SetRange(srange uint, visible uint) { - Scrollbar_set_range(handle, srange, visible) -} - -// Create a new scrollable Box to be packed. -func Scrollbox_new(btype int, pad int) HSCROLLBOX { - return HSCROLLBOX{C.go_scrollbox_new(C.int(btype), C.int(pad))} -} - -// Create a new scrollable Box to be packed. -func ScrollBoxNew(btype int, pad int) HSCROLLBOX { - return Scrollbox_new(btype, pad) -} - -// Returns the position of the scrollbar in the scrollbox. -func Scrollbox_get_pos(handle HANDLE) (int, int) { - return int(C.go_scrollbox_get_pos(handle.GetHandle(), C.int(C.DW_HORZ))), int(C.go_scrollbox_get_pos(handle.GetHandle(), C.int(C.DW_VERT))) -} - -// Returns the position of the scrollbar in the scrollbox. -func (handle HSCROLLBOX) GetPos() (int, int) { - return Scrollbox_get_pos(handle) -} - -// Gets the range for the scrollbar in the scrollbox. -func Scrollbox_get_range(handle HANDLE) (int, int) { - return int(C.go_scrollbox_get_range(handle.GetHandle(), C.int(C.DW_HORZ))), int(C.go_scrollbox_get_range(handle.GetHandle(), C.int(C.DW_VERT))) -} - -// Gets the range for the scrollbar in the scrollbox. -func (handle HSCROLLBOX) GetRange() (int, int) { - return Scrollbox_get_range(handle) -} - -// Create a new Group Box to be packed. -func Groupbox_new(btype C.int, pad int, title string) HBOX { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - return HBOX{C.go_groupbox_new(btype, C.int(pad), ctitle)} -} - -// Create a new Group Box to be packed. -func GroupboxNew(btype C.int, pad int, title string) HBOX { - return Groupbox_new(btype, pad, title) -} - -// Creates a rendering context widget to be packed. -func Render_new(id uint) HRENDER { - return HRENDER{C.go_render_new(C.ulong(id))} -} - -// Creates a rendering context widget to be packed. -func RenderNew(id uint) HRENDER { - return Render_new(id) -} - -// Allows the user to choose a font using the system's font chooser dialog. -func Font_choose(currfont string) string { - ccurrfont := C.CString(currfont) - defer C.free(unsafe.Pointer(ccurrfont)) - newfont := C.dw_font_choose(ccurrfont) - defer C.dw_free(unsafe.Pointer(newfont)) - return C.GoString(newfont) -} - -// Allows the user to choose a font using the system's font chooser dialog. -func FontChoose(currfont string) string { - return Font_choose(currfont) -} - -// Sets the default font used on text based widgets. -func Font_set_default(fontname string) { - cfontname := C.CString(fontname) - defer C.free(unsafe.Pointer(cfontname)) - C.dw_font_set_default(cfontname) -} - -// Sets the default font used on text based widgets. -func FontSetFefault(fontname string) { - Font_set_default(fontname) -} - -// Get the width and height of a text string. -func Font_text_extents_get(handle HANDLE, pixmap HPIXMAP, text string) (int, int) { - var width, height C.int - - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_font_text_extents_get(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), ctext, &width, &height) - return int(width), int(height) -} - -// Get the width and height of a text string. -func (pixmap HPIXMAP) GetTextExtents(text string) (int, int) { - return Font_text_extents_get(NOHWND, pixmap, text) -} - -// Creates a pixmap with given parameters. -func Pixmap_new(handle HANDLE, width uint, height uint, depth uint) HPIXMAP { - return HPIXMAP{C.go_pixmap_new(handle.GetHandle(), C.ulong(width), C.ulong(height), C.ulong(depth))} -} - -// Creates a pixmap with given parameters. -func PixmapNew(handle HANDLE, width uint, height uint, depth uint) HPIXMAP { - return Pixmap_new(handle, width, height, depth) -} - -// Creates a pixmap from a file. -func Pixmap_new_from_file(handle HANDLE, filename string) HPIXMAP { - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - return HPIXMAP{C.go_pixmap_new_from_file(handle.GetHandle(), cfilename)} -} - -// Creates a pixmap from a file. -func PixmapNewFromFile(handle HANDLE, filename string) HPIXMAP { - return Pixmap_new_from_file(handle, filename) -} - -// Creates a pixmap from internal resource graphic specified by id. -func Pixmap_grab(handle HANDLE, id uint) HPIXMAP { - return HPIXMAP{C.go_pixmap_grab(handle.GetHandle(), C.ulong(id))} -} - -// Creates a pixmap from internal resource graphic specified by id. -func PixmapGrab(handle HANDLE, id uint) HPIXMAP { - return Pixmap_grab(handle, id) -} - -// Creates a pixmap from internal resource graphic specified by id. -func (window HRENDER) PixmapGrab(id uint) HPIXMAP { - return Pixmap_grab(window, id) -} - -// Copies from one surface to another. -func Pixmap_bitblt(dest HANDLE, destp HPIXMAP, xdest int, ydest int, width int, height int, src HANDLE, srcp HPIXMAP, xsrc int, ysrc int) { - C.go_pixmap_bitblt(dest.GetHandle(), unsafe.Pointer(destp.hpixmap), C.int(xdest), C.int(ydest), C.int(width), C.int(height), src.GetHandle(), unsafe.Pointer(srcp.hpixmap), C.int(xsrc), C.int(ysrc)) -} - -// Copies from one surface to another allowing for stretching. -func Pixmap_stretch_bitblt(dest HANDLE, destp HPIXMAP, xdest int, ydest int, width int, height int, src HANDLE, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { - return int(C.go_pixmap_stretch_bitblt(dest.GetHandle(), unsafe.Pointer(destp.hpixmap), C.int(xdest), C.int(ydest), C.int(width), C.int(height), src.GetHandle(), unsafe.Pointer(srcp.hpixmap), C.int(xsrc), C.int(ysrc), C.int(srcwidth), C.int(srcheight))) -} - -// Copies from one surface to another allowing for stretching. -func (window HRENDER) BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { - return Pixmap_stretch_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc, srcwidth, srcheight) -} - -// Copies from one surface to another allowing for stretching. -func (window HRENDER) BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int { - return Pixmap_stretch_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc, srcwidth, srcheight) -} - -// Copies from one surface to another allowing for stretching. -func (pixmap HPIXMAP) BitBltStretchPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int, srcwidth int, srcheight int) int { - return Pixmap_stretch_bitblt(NOHWND, pixmap, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc, srcwidth, srcheight) -} - -// Copies from one surface to another allowing for stretching. -func (pixmap HPIXMAP) BitBltStretchWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int, srcwidth int, srcheight int) int { - return Pixmap_stretch_bitblt(NOHWND, pixmap, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc, srcwidth, srcheight) -} - -// Copies from one surface to another. -func (window HRENDER) BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) { - Pixmap_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc) -} - -// Copies from one surface to another. -func (window HRENDER) BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) { - Pixmap_bitblt(window, NOHPIXMAP, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc) -} - -// Copies from one surface to another. -func (pixmap HPIXMAP) BitBltPixmap(xdest int, ydest int, width int, height int, srcp HPIXMAP, xsrc int, ysrc int) { - Pixmap_bitblt(NOHWND, pixmap, xdest, ydest, width, height, NOHWND, srcp, xsrc, ysrc) -} - -// Copies from one surface to another. -func (pixmap HPIXMAP) BitBltWindow(xdest int, ydest int, width int, height int, src HANDLE, xsrc int, ysrc int) { - Pixmap_bitblt(NOHWND, pixmap, xdest, ydest, width, height, src, NOHPIXMAP, xsrc, ysrc) -} - -// Sets the transparent color for a pixmap. -func Pixmap_set_transparent_color(pixmap HPIXMAP, color COLOR) { - C.go_pixmap_set_transparent_color(unsafe.Pointer(pixmap.hpixmap), C.ulong(color)) -} - -// Sets the transparent color for a pixmap. -func (pixmap HPIXMAP) SetTransparentColor(color COLOR) { - Pixmap_set_transparent_color(pixmap, color) -} - -// Sets the font used by a specified pixmap. -func Pixmap_set_font(pixmap HPIXMAP, fontname string) int { - cfontname := C.CString(fontname) - defer C.free(unsafe.Pointer(cfontname)) - - return int(C.go_pixmap_set_font(unsafe.Pointer(pixmap.hpixmap), cfontname)) -} - -// Sets the font used by a specified pixmap. -func (pixmap HPIXMAP) SetFont(fontname string) int { - return Pixmap_set_font(pixmap, fontname) -} - -// Destroys an allocated pixmap. -func Pixmap_destroy(pixmap HPIXMAP) { - C.go_pixmap_destroy(unsafe.Pointer(pixmap.hpixmap)) -} - -// Destroys an allocated pixmap. -func (pixmap HPIXMAP) Destroy() { - Pixmap_destroy(pixmap) -} - -// Returns the width in pixels of the specified pixmap. -func Pixmap_width(pixmap HPIXMAP) int { - return int(C.go_pixmap_width(unsafe.Pointer(pixmap.hpixmap))) -} - -// Returns the width in pixels of the specified pixmap. -func (pixmap HPIXMAP) GetWidth() int { - return Pixmap_width(pixmap) -} - -// Returns the height in pixels of the specified pixmap. -func Pixmap_height(pixmap HPIXMAP) int { - return int(C.go_pixmap_height(unsafe.Pointer(pixmap.hpixmap))) -} - -// Returns the height in pixels of the specified pixmap. -func (pixmap HPIXMAP) GetHeight() int { - return Pixmap_height(pixmap) -} - -// Draw a point. -func Draw_point(handle HANDLE, pixmap HPIXMAP, x int, y int) { - C.go_draw_point(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x), C.int(y)) -} - -// Draw a point on a widget. -func (window HRENDER) DrawPoint(x int, y int) { - Draw_point(window, NOHPIXMAP, x, y) -} - -// Draw a point on a pixmap. -func (pixmap HPIXMAP) DrawPoint(x int, y int) { - Draw_point(NOHWND, pixmap, x, y) -} - -// Draw a line. -func Draw_line(handle HANDLE, pixmap HPIXMAP, x1 int, y1 int, x2 int, y2 int) { - C.go_draw_line(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x1), C.int(y1), C.int(x2), C.int(y2)) -} - -// Draw a line on a widget. -func (window HRENDER) DrawLine(x1 int, y1 int, x2 int, y2 int) { - Draw_line(window, NOHPIXMAP, x1, y1, x2, y2) -} - -// Draw a line on a pixmap. -func (pixmap HPIXMAP) DrawLine(x1 int, y1 int, x2 int, y2 int) { - Draw_line(NOHWND, pixmap, x1, y1, x2, y2) -} - -// Draw a polygon. -func Draw_polygon(handle HANDLE, pixmap HPIXMAP, flags int, x []int, y []int) { - count := len(x) - if len(y) < count { - count = len(y) - } - cx := make([]C.int, count) - cy := make([]C.int, count) - for n := 0; n < count; n++ { - cx[n] = C.int(x[n]) - cy[n] = C.int(y[n]) - } - xHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cx))) - yHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cy))) - - C.go_draw_polygon(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(flags), C.int(count), (*C.int)(unsafe.Pointer(xHeader.Data)), (*C.int)(unsafe.Pointer(yHeader.Data))) -} - -// Draw a polygon on a widget. -func (window HRENDER) DrawPolygon(flags int, x []int, y []int) { - Draw_polygon(window, NOHPIXMAP, flags, x, y) -} - -// Draw a polygon on a pixmap. -func (pixmap HPIXMAP) DrawPolygon(flags int, x []int, y []int) { - Draw_polygon(NOHWND, pixmap, flags, x, y) -} - -// Draw a rectangle. -func Draw_rect(handle HANDLE, pixmap HPIXMAP, fill int, x int, y int, width int, height int) { - C.go_draw_rect(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(fill), C.int(x), C.int(y), C.int(width), C.int(height)) -} - -// Draw a rectangle on a widget. -func (window HRENDER) DrawRect(fill int, x int, y int, width int, height int) { - Draw_rect(window, NOHPIXMAP, fill, x, y, width, height) -} - -// Draw a rectangle on a pixmap. -func (pixmap HPIXMAP) DrawRect(fill int, x int, y int, width int, height int) { - Draw_rect(NOHWND, pixmap, fill, x, y, width, height) -} - -// Draw an arc. -func Draw_arc(handle HANDLE, pixmap HPIXMAP, flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { - C.go_draw_arc(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(flags), C.int(xorigin), C.int(yorigin), C.int(x1), C.int(y1), C.int(x2), C.int(y2)) -} - -// Draw an arc on a widget. -func (window HRENDER) DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { - Draw_arc(window, NOHPIXMAP, flags, xorigin, yorigin, x1, y1, x2, y2) -} - -// Draw an arc on a pixmap. -func (pixmap HPIXMAP) DrawArc(flags int, xorigin int, yorigin int, x1 int, y1 int, x2 int, y2 int) { - Draw_arc(NOHWND, pixmap, flags, xorigin, yorigin, x1, y1, x2, y2) -} - -// Draw text. -func Draw_text(handle HANDLE, pixmap HPIXMAP, x int, y int, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_draw_text(handle.GetHandle(), unsafe.Pointer(pixmap.hpixmap), C.int(x), C.int(y), ctext) -} - -// Draw text on a widget. -func (window HRENDER) DrawText(x int, y int, text string) { - Draw_text(window, NOHPIXMAP, x, y, text) -} - -// Draw text on a pixmap. -func (pixmap HPIXMAP) DrawText(x int, y int, text string) { - Draw_text(NOHWND, pixmap, x, y, text) -} - -// Returns the current X and Y coordinates of the mouse pointer. -func Pointer_query_pos() (int, int) { - var x, y C.long - C.dw_pointer_query_pos(&x, &y) - return int(x), int(y) -} - -// Returns the current X and Y coordinates of the mouse pointer. -func PointerGetPos() (int, int) { - return Pointer_query_pos() -} - -// Sets the X and Y coordinates of the mouse pointer. -func Pointer_set_pos(x int, y int) { - C.dw_pointer_set_pos(C.long(x), C.long(y)) -} - -// Sets the X and Y coordinates of the mouse pointer. -func PointerSetPos(x int, y int) { - Pointer_set_pos(x, y) -} - -// Call this after drawing to the screen to make sure anything you have drawn is visible. -func Flush() { - C.dw_flush() -} - -// Create a tree widget to be packed. -func Tree_new(id uint) HTREE { - return HTREE{C.go_tree_new(C.ulong(id))} -} - -// Create a tree widget to be packed. -func TreeNew(id uint) HTREE { - return Tree_new(id) -} - -// Inserts an item into a tree widget. -func Tree_insert(handle HANDLE, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - return HTREEITEM{C.go_tree_insert(handle.GetHandle(), ctitle, unsafe.Pointer(icon), parent.htreeitem, unsafe.Pointer(itemdata)), handle} -} - -// Inserts an item into a tree widget. -func (handle HTREE) Insert(title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { - return Tree_insert(handle, title, icon, parent, itemdata) -} - -// Inserts an item into a tree widget after another item. -func Tree_insert_after(handle HANDLE, item HTREEITEM, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - return HTREEITEM{C.go_tree_insert_after(handle.GetHandle(), item.htreeitem, ctitle, unsafe.Pointer(icon), parent.htreeitem, unsafe.Pointer(itemdata)), handle} -} - -// Inserts an item into a tree widget after another item. -func (handle HTREE) InsertAfter(item HTREEITEM, title string, icon HICN, parent HTREEITEM, itemdata POINTER) HTREEITEM { - return Tree_insert_after(handle, item, title, icon, parent, itemdata) -} - -// Removes all nodes from a tree. -func Tree_clear(handle HANDLE) { - C.go_tree_clear(handle.GetHandle()) -} - -// Removes all nodes from a tree. -func (handle HTREE) Clear() { - Tree_clear(handle) -} - -// Removes a node from a tree. -func Tree_item_delete(handle HANDLE, item HTREEITEM) { - C.go_tree_item_delete(handle.GetHandle(), item.htreeitem) -} - -// Removes a node from a tree. -func (handle HTREEITEM) Delete() { - Tree_item_delete(handle.htree, handle) -} - -// Sets the text and icon of an item in a tree widget. -func Tree_item_change(handle HANDLE, item HTREEITEM, title string, icon HICN) { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - C.go_tree_item_change(handle.GetHandle(), item.htreeitem, ctitle, unsafe.Pointer(icon)) -} - -// Sets the text and icon of an item in a tree widget. -func (handle HTREEITEM) Change(title string, icon HICN) { - Tree_item_change(handle.htree, handle, title, icon) -} - -// Expands a node on a tree. -func Tree_item_expand(handle HANDLE, item HTREEITEM) { - C.go_tree_item_expand(handle.GetHandle(), item.htreeitem) -} - -// Expands a node on a tree. -func (handle HTREEITEM) Expand() { - Tree_item_expand(handle.htree, handle) -} - -// Collapses a node on a tree. -func Tree_item_collapse(handle HANDLE, item HTREEITEM) { - C.go_tree_item_collapse(handle.GetHandle(), item.htreeitem) -} - -// Collapses a node on a tree. -func (handle HTREEITEM) Collapse() { - Tree_item_collapse(handle.htree, handle) -} - -// Sets this item as the active selection. -func Tree_item_select(handle HANDLE, item HTREEITEM) { - C.go_tree_item_select(handle.GetHandle(), item.htreeitem) -} - -// Sets this item as the active selection. -func (handle HTREEITEM) Select() { - Tree_item_select(handle.htree, handle) -} - -// Sets the item data of a tree item. -func Tree_item_set_data(handle HANDLE, item HTREEITEM, itemdata POINTER) { - C.go_tree_item_set_data(handle.GetHandle(), item.htreeitem, unsafe.Pointer(itemdata)) -} - -// Sets the item data of a tree item. -func (handle HTREEITEM) SetData(itemdata POINTER) { - Tree_item_set_data(handle.htree, handle, itemdata) -} - -// Gets the item data of a tree item. -func Tree_item_get_data(handle HANDLE, item HTREEITEM) POINTER { - return POINTER(C.go_tree_item_get_data(handle.GetHandle(), item.htreeitem)) -} - -// Gets the item data of a tree item. -func (handle HTREEITEM) GetData() POINTER { - return Tree_item_get_data(handle.htree, handle) -} - -// Gets the text an item in a tree widget. -func Tree_get_title(handle HANDLE, item HTREEITEM) string { - ctitle := C.go_tree_get_title(handle.GetHandle(), item.htreeitem) - title := C.GoString(ctitle) - C.dw_free(unsafe.Pointer(ctitle)) - return title -} - -// Gets the text an item in a tree widget. -func (handle HTREEITEM) GetTitle() string { - return Tree_get_title(handle.htree, handle) -} - -// Create a new HTML widget to be packed. -func Html_new(id uint) HHTML { - return HHTML{C.go_html_new(C.ulong(id))} -} - -// Create a new HTML widget to be packed. -func HtmlNew(id uint) HHTML { - return Html_new(id) -} - -// Causes the embedded HTML widget to take action. -func Html_action(handle HANDLE, action int) { - C.go_html_action(handle.GetHandle(), C.int(action)) -} - -// Causes the embedded HTML widget to take action. -func (handle HHTML) Action(action int) { - Html_action(handle, action) -} - -// Render raw HTML code in the embedded HTML widget. -func Html_raw(handle HANDLE, code string) int { - ccode := C.CString(code) - defer C.free(unsafe.Pointer(ccode)) - - return int(C.go_html_raw(handle.GetHandle(), ccode)) -} - -// Render raw HTML code in the embedded HTML widget. -func (handle HHTML) Raw(code string) { - Html_raw(handle, code) -} - -// Render file or web page in the embedded HTML widget. -func Html_url(handle HANDLE, url string) int { - curl := C.CString(url) - defer C.free(unsafe.Pointer(curl)) - - return int(C.go_html_url(handle.GetHandle(), curl)) -} - -// Render file or web page in the embedded HTML widget. -func (handle HHTML) URL(url string) int { - return Html_url(handle, url) -} - -// Create a new Multiline Editbox widget to be packed. -func Mle_new(id uint) HMLE { - return HMLE{C.go_mle_new(C.ulong(id))} -} - -// Create a new Multiline Editbox widget to be packed. -func MLENew(id uint) HMLE { - return Mle_new(id) -} - -// Adds text to an MLE box and returns the current point. -func Mle_import(handle HANDLE, buffer string, startpoint int) int { - cbuffer := C.CString(buffer) - defer C.free(unsafe.Pointer(cbuffer)) - - return int(C.go_mle_import(handle.GetHandle(), cbuffer, C.int(startpoint))) -} - -// Adds text to an MLE box and returns the current point. -func (handle HMLE) Import(buffer string, startpoint int) int { - return Mle_import(handle, buffer, startpoint) -} - -// Grabs text from an MLE box. -func Mle_export(handle HANDLE, startpoint int, length int) string { - cbuf := C.calloc(1, C.size_t(length+1)) - C.go_mle_export(handle.GetHandle(), (*C.char)(cbuf), C.int(startpoint), C.int(length)) - buf := C.GoString((*C.char)(cbuf)) - C.free(cbuf) - return buf -} - -// Grabs text from an MLE box. -func (handle HMLE) Export(startpoint int, length int) string { - return Mle_export(handle, startpoint, length) -} - -// Obtains information about an MLE box. -func Mle_get_size(handle HANDLE) (int, int) { - var bytes, lines C.ulong - C.go_mle_get_size(handle.GetHandle(), &bytes, &lines) - return int(bytes), int(lines) -} - -// Obtains information about an MLE box. -func (handle HMLE) GetSize() (int, int) { - return Mle_get_size(handle) -} - -// Deletes text from an MLE box. -func Mle_delete(handle HANDLE, startpoint int, length int) { - C.go_mle_delete(handle.GetHandle(), C.int(startpoint), C.int(length)) -} - -// Deletes text from an MLE box. -func (handle HMLE) Delete(startpoint int, length int) { - Mle_delete(handle, startpoint, length) -} - -// Clears all text from an MLE box. -func Mle_clear(handle HANDLE) { - C.go_mle_clear(handle.GetHandle()) -} - -// Clears all text from an MLE box. -func (handle HMLE) Clear() { - Mle_clear(handle) -} - -// Stops redrawing of an MLE box. -func Mle_freeze(handle HANDLE) { - C.go_mle_freeze(handle.GetHandle()) -} - -// Stops redrawing of an MLE box. -func (handle HMLE) Freeze() { - Mle_freeze(handle) -} - -// Resumes redrawing of an MLE box. -func Mle_thaw(handle HANDLE) { - C.go_mle_thaw(handle.GetHandle()) -} - -// Resumes redrawing of an MLE box. -func (handle HMLE) Thaw() { - Mle_thaw(handle) -} - -// Sets the current cursor position of an MLE box. -func Mle_set_cursor(handle HANDLE, point int) { - C.go_mle_set_cursor(handle.GetHandle(), C.int(point)) -} - -// Sets the current cursor position of an MLE box. -func (handle HMLE) SetCursor(point int) { - Mle_set_cursor(handle, point) -} - -// Sets the visible line of an MLE box. -func Mle_set_visible(handle HANDLE, line int) { - C.go_mle_set_visible(handle.GetHandle(), C.int(line)) -} - -// Sets the visible line of an MLE box. -func (handle HMLE) SetVisible(line int) { - Mle_set_visible(handle, line) -} - -// Sets the editablity of an MLE box. -func Mle_set_editable(handle HANDLE, state int) { - C.go_mle_set_editable(handle.GetHandle(), C.int(state)) -} - -// Sets the editablity of an MLE box. -func (handle HMLE) SetEditable(state int) { - Mle_set_editable(handle, state) -} - -// Sets the word wrap state of an MLE box. -func Mle_set_word_wrap(handle HANDLE, state int) { - C.go_mle_set_word_wrap(handle.GetHandle(), C.int(state)) -} - -// Sets the word wrap state of an MLE box. -func (handle HMLE) SetWordWrap(state int) { - Mle_set_word_wrap(handle, state) -} - -// Finds text in an MLE box. -func Mle_search(handle HANDLE, text string, point int, flags uint) int { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return int(C.go_mle_search(handle.GetHandle(), ctext, C.int(point), C.ulong(flags))) -} - -// Finds text in an MLE box. -func (handle HMLE) Search(text string, point int, flags uint) int { - return Mle_search(handle, text, point, flags) -} - -// Create a container widget to be packed. -func Container_new(id uint, multi int) HCONTAINER { - return HCONTAINER{C.go_container_new(C.ulong(id), C.int(multi)), false} -} - -// Create a container widget to be packed. -func ContainerNew(id uint, multi int) HCONTAINER { - return Container_new(id, multi) -} - -// Sets up the container columns. -func Container_setup(handle HANDLE, flags []uint, titles []string, separator int) int { - count := len(flags) - if len(titles) < count { - count = len(titles) - } - - ctitles := C.go_string_array_make(C.int(len(titles))) - defer C.go_string_array_free(ctitles, C.int(len(titles))) - for i, s := range titles { - C.go_string_array_set(ctitles, C.CString(s), C.int(i)) - } - - cflags := make([]C.ulong, count) - for n := 0; n < count; n++ { - cflags[n] = C.ulong(flags[n]) - } - flagsHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cflags))) - return int(C.go_container_setup(handle.GetHandle(), (*C.ulong)(unsafe.Pointer(flagsHeader.Data)), ctitles, C.int(count), C.int(separator))) -} - -// Sets up the container columns. -func (handle HCONTAINER) Setup(flags []uint, titles []string, separator int) int { - return Container_setup(handle, flags, titles, separator) -} - -// Sets up the filesystem columns, note: filesystem always has an icon/filename field. -func Filesystem_setup(handle HANDLE, flags []uint, titles []string) int { - count := len(flags) - if len(titles) < count { - count = len(titles) - } - - ctitles := C.go_string_array_make(C.int(len(titles))) - defer C.go_string_array_free(ctitles, C.int(len(titles))) - for i, s := range titles { - C.go_string_array_set(ctitles, C.CString(s), C.int(i)) - } - - cflags := make([]C.ulong, count) - for n := 0; n < count; n++ { - cflags[n] = C.ulong(flags[n]) - } - flagsHeader := (*reflect.SliceHeader)((unsafe.Pointer(&cflags))) - Window_set_data(handle, "_go_filesystem", POINTER(uintptr(1))) - return int(C.go_filesystem_setup(handle.GetHandle(), (*C.ulong)(unsafe.Pointer(flagsHeader.Data)), ctitles, C.int(count))) -} - -// Sets up the filesystem columns, note: filesystem always has an icon/filename field. -func (handle *HCONTAINER) FileSystemSetup(flags []uint, titles []string) int { - handle.filesystem = true - return Filesystem_setup(handle, flags, titles) -} - -// Allocates memory used to populate a container. -func Container_alloc(handle HANDLE, rowcount int) HCONTINS { - return HCONTINS{C.go_container_alloc(handle.GetHandle(), C.int(rowcount)), rowcount, handle, false} -} - -// Allocates memory used to populate a container. -func (handle *HCONTAINER) Alloc(rowcount int) HCONTINS { - contins := Container_alloc(handle, rowcount) - contins.filesystem = handle.filesystem - return contins -} - -// Sets an item in specified row and column to the given data. -func Container_set_item(handle HANDLE, contins HCONTINS, column int, row int, data POINTER) { - C.go_container_set_item(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(data)) -} - -// Sets an item in specified row and column to the given data. -func (handle HCONTINS) SetItem(column int, row int, data POINTER) { - if handle.filesystem == true { - Filesystem_set_item(handle.hcont, handle, column, row, data) - } - Container_set_item(handle.hcont, handle, column, row, data) -} - -// Sets an item in specified row and column to the given unsigned integer. -func Container_set_item_ulong(handle HANDLE, contins HCONTINS, column int, row int, val uint) { - C.go_container_set_item_ulong(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.ulong(val)) -} - -// Sets an item in specified row and column to the given unsigned integer. -func (handle HCONTINS) SetItemULong(column int, row int, val uint) { - if handle.filesystem == true { - Filesystem_set_item_ulong(handle.hcont, handle, column, row, val) - } - Container_set_item_ulong(handle.hcont, handle, column, row, val) -} - -// Sets an item in specified row and column to the given icon. -func Container_set_item_icon(handle HANDLE, contins HCONTINS, column int, row int, icon HICN) { - C.go_container_set_item_icon(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(icon)) -} - -// Sets an item in specified row and column to the given icon. -func (handle HCONTINS) SetItemIcon(column int, row int, icon HICN) { - if handle.filesystem == true { - Filesystem_set_item_icon(handle.hcont, handle, column, row, icon) - } - Container_set_item_icon(handle.hcont, handle, column, row, icon) -} - -// Sets an item in specified row and column to the given time. -func Container_set_item_time(handle HANDLE, contins HCONTINS, column int, row int, seconds int, minutes int, hours int) { - C.go_container_set_item_time(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) -} - -// Sets an item in specified row and column to the given time. -func (handle HCONTINS) SetItemTime(column int, row int, seconds int, minutes int, hours int) { - if handle.filesystem == true { - Filesystem_set_item_time(handle.hcont, handle, column, row, seconds, minutes, hours) - } - Container_set_item_time(handle.hcont, handle, column, row, seconds, minutes, hours) -} - -// Sets an item in specified row and column to the given date. -func Container_set_item_date(handle HANDLE, contins HCONTINS, column int, row int, day int, month int, year int) { - C.go_container_set_item_date(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) -} - -// Sets an item in specified row and column to the given date. -func (handle HCONTINS) SetItemDate(column int, row int, day int, month int, year int) { - if handle.filesystem == true { - Filesystem_set_item_date(handle.hcont, handle, column, row, day, month, year) - } - Container_set_item_date(handle.hcont, handle, column, row, day, month, year) -} - -// Changes an existing item in specified row and column to the given data. -func Container_change_item(handle HANDLE, column int, row int, data POINTER) { - C.go_container_change_item(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(data)) -} - -// Changes an existing item in specified row and column to the given data. -func (handle HCONTAINER) ChangeItem(column int, row int, data POINTER) { - if handle.filesystem == true { - Filesystem_change_item(handle, column, row, data) - } - Container_change_item(handle, column, row, data) -} - -// Changes an existing item in specified row and column to the given unsigned integer. -func Container_change_item_ulong(handle HANDLE, column int, row int, val uint) { - C.go_container_change_item_ulong(handle.GetHandle(), C.int(column), C.int(row), C.ulong(val)) -} - -// Changes an existing item in specified row and column to the given unsigned integer. -func (handle HCONTAINER) ChangeItemULong(column int, row int, val uint) { - if handle.filesystem == true { - Filesystem_change_item_ulong(handle, column, row, val) - } - Container_change_item_ulong(handle, column, row, val) -} - -// Changes an existing item in specified row and column to the given icon. -func Container_change_item_icon(handle HANDLE, column int, row int, icon HICN) { - C.go_container_change_item_icon(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(icon)) -} - -// Changes an existing item in specified row and column to the given icon. -func (handle HCONTAINER) ChangeItemIcon(column int, row int, icon HICN) { - if handle.filesystem == true { - Filesystem_change_item_icon(handle, column, row, icon) - } - Container_change_item_icon(handle, column, row, icon) -} - -// Changes an existing item in specified row and column to the given time. -func Container_change_item_time(handle HANDLE, column int, row int, seconds int, minutes int, hours int) { - C.go_container_change_item_time(handle.GetHandle(), C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) -} - -// Changes an existing item in specified row and column to the given time. -func (handle HCONTAINER) ChangeItemTime(column int, row int, seconds int, minutes int, hours int) { - if handle.filesystem == true { - Filesystem_change_item_time(handle, column, row, seconds, minutes, hours) - } - Container_change_item_time(handle, column, row, seconds, minutes, hours) -} - -// Changes an existing item in specified row and column to the given date. -func Container_change_item_date(handle HANDLE, column int, row int, day int, month int, year int) { - C.go_container_change_item_date(handle.GetHandle(), C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) -} - -// Changes an existing item in specified row and column to the given date. -func (handle HCONTAINER) ChangeItemDate(column int, row int, day int, month int, year int) { - if handle.filesystem == true { - Filesystem_change_item_date(handle, column, row, day, month, year) - } - Container_change_item_date(handle, column, row, day, month, year) -} - -// Sets the width of a column in the container. -func Container_set_column_width(handle HANDLE, column int, width int) { - C.go_container_set_column_width(handle.GetHandle(), C.int(column), C.int(width)) -} - -// Sets the width of a column in the container. -func (handle HCONTAINER) SetColumnWidth(column int, width int) { - Container_set_column_width(handle, column, width) -} - -// Sets the title of a row in the container. -func Container_set_row_title(contins HCONTINS, row int, title string) { - ctitle := C.CString(title) - C.dw_container_set_row_title(contins.ptr, C.int(row), ctitle) - defer C.free(unsafe.Pointer(ctitle)) -} - -// Sets the title of a row in the container. -func (handle HCONTINS) SetRowTitle(row int, title string) { - Container_set_row_title(handle, row, title) -} - -// Sets the pointer of a row in the container. -func Container_set_row_data(contins HCONTINS, row int, data POINTER) { - C.dw_container_set_row_data(contins.ptr, C.int(row), unsafe.Pointer(data)) -} - -// Sets the pointer of a row in the container. -func (handle HCONTINS) SetRowData(row int, data POINTER) { - Container_set_row_data(handle, row, data) -} - -// Sets the title of a row in the container. -func Container_change_row_title(handle HANDLE, row int, title string) { - ctitle := C.CString(title) - C.go_container_change_row_title(handle.GetHandle(), C.int(row), ctitle) -} - -// Sets the title of a row in the container. -func (handle HCONTAINER) ChangeRowTitle(row int, title string) { - Container_change_row_title(handle, row, title) -} - -// Sets the pointer of a row in the container. -func Container_change_row_data(handle HANDLE, row int, data unsafe.Pointer) { - C.go_container_change_row_data(handle.GetHandle(), C.int(row), data) -} - -// Sets the pointer of a row in the container. -func (handle HCONTAINER) ChangeRowData(row int, data POINTER) { - Container_change_row_data(handle, row, unsafe.Pointer(data)) -} - -// Inserts allocated rows into the container widget. -func Container_insert(handle HANDLE, contins HCONTINS, rowcount int) { - C.go_container_insert(handle.GetHandle(), contins.ptr, C.int(rowcount)) - contins.ptr = nil - contins.rowcount = 0 -} - -// Inserts allocated rows into the container widget. -func (handle HCONTINS) Insert() { - Container_insert(handle.hcont, handle, handle.rowcount) -} - -// Removes all rows from a container. -func Container_clear(handle HANDLE, redraw int) { - C.go_container_clear(handle.GetHandle(), C.int(redraw)) -} - -// Removes all rows from a container. -func (handle HCONTAINER) Clear(redraw int) { - Container_clear(handle, redraw) -} - -// Removes the first x rows from a container. -func Container_delete(handle HANDLE, rowcount int) { - C.go_container_delete(handle.GetHandle(), C.int(rowcount)) -} - -// Removes the first x rows from a container. -func (handle HCONTAINER) Delete(rowcount int) { - Container_delete(handle, rowcount) -} - -// Starts a new query of a container. -func Container_query_start(handle HANDLE, flags uint) string { - cresult := C.go_container_query_start(handle.GetHandle(), C.ulong(flags)&^C.DW_CR_RETDATA) - result := C.GoString(cresult) - defer C.dw_free(unsafe.Pointer(cresult)) - return result -} - -func Container_query_start_data(handle HANDLE, flags uint) POINTER { - cresult := C.go_container_query_start(handle.GetHandle(), C.ulong(flags)|C.DW_CR_RETDATA) - return POINTER(cresult) -} - -// Starts a new query of a container. -func (handle HCONTAINER) QueryStart(flags uint) string { - return Container_query_start(handle, flags) -} - -// Continues an existing query of a container. -func Container_query_next(handle HANDLE, flags uint) string { - cresult := C.go_container_query_next(handle.GetHandle(), C.ulong(flags)&^C.DW_CR_RETDATA) - result := C.GoString(cresult) - defer C.dw_free(unsafe.Pointer(cresult)) - return result -} - -func Container_query_next_data(handle HANDLE, flags uint) POINTER { - cresult := C.go_container_query_next(handle.GetHandle(), C.ulong(flags)|C.DW_CR_RETDATA) - return POINTER(cresult) -} - -// Continues an existing query of a container. -func (handle HCONTAINER) QueryNext(flags uint) string { - return Container_query_next(handle, flags) -} - -// Scrolls container up or down. -func Container_scroll(handle HANDLE, direction int, rows int) { - C.go_container_scroll(handle.GetHandle(), C.int(direction), C.long(rows)) -} - -// Scrolls container up or down. -func (handle HCONTAINER) Scroll(direction int, rows int) { - Container_scroll(handle, direction, rows) -} - -// Cursors the item with the title speficied, and scrolls to that item. -func Container_cursor(handle HANDLE, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_container_cursor(handle.GetHandle(), ctext) -} - -// Cursors the item with the title speficied, and scrolls to that item. -func (handle HCONTAINER) Cursor(text string) { - Container_cursor(handle, text) -} - -// Cursors the item with the data speficied, and scrolls to that item. -func Container_cursor_by_data(handle HANDLE, data POINTER) { - C.go_container_cursor_by_data(handle.GetHandle(), unsafe.Pointer(data)) -} - -// Cursors the item with the data speficied, and scrolls to that item. -func (handle HCONTAINER) CursorByData(data POINTER) { - Container_cursor_by_data(handle, data) -} - -// Deletes the item with the title specified. -func Container_delete_row(handle HANDLE, text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - C.go_container_delete_row(handle.GetHandle(), ctext) -} - -// Deletes the item with the title specified. -func (handle HCONTAINER) DeleteRow(text string) { - Container_delete_row(handle, text) -} - -// Deletes the item with the data specified. -func Container_delete_row_by_data(handle HANDLE, data POINTER) { - C.go_container_delete_row_by_data(handle.GetHandle(), unsafe.Pointer(data)) -} - -// Deletes the item with the data specified. -func (handle HCONTAINER) DeleteRowByData(data POINTER) { - Container_delete_row_by_data(handle, data) -} - -// Optimizes the column widths so that all data is visible. -func Container_optimize(handle HANDLE) { - C.go_container_optimize(handle.GetHandle()) -} - -// Optimizes the column widths so that all data is visible. -func (handle HCONTAINER) Optimize() { - Container_optimize(handle) -} - -// Sets the alternating row colors for container widget handle. -func Container_set_stripe(handle HANDLE, oddcolor COLOR, evencolor COLOR) { - C.go_container_set_stripe(handle.GetHandle(), C.ulong(oddcolor), C.ulong(evencolor)) -} - -// Sets the alternating row colors for container widget handle. -func (handle HCONTAINER) SetStripe(oddcolor COLOR, evencolor COLOR) { - Container_set_stripe(handle, oddcolor, evencolor) -} - -// Gets column type for a container column. -func Container_get_column_type(handle HANDLE, column int) uint { - return uint(C.go_container_get_column_type(handle.GetHandle(), C.int(column))) -} - -// Gets column type for a container column. -func (handle HCONTAINER) GetColumnType(column int) uint { - if handle.filesystem == true { - return Filesystem_get_column_type(handle, column) - } - return Container_get_column_type(handle, column) -} - -// Gets column type for a filesystem container column. -func Filesystem_get_column_type(handle HANDLE, column int) uint { - return uint(C.go_filesystem_get_column_type(handle.GetHandle(), C.int(column))) -} - -// Configures the main filesystem column title for localization. -func Filesystem_set_column_title(handle HANDLE, title string) { - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - C.go_filesystem_set_column_title(handle.GetHandle(), ctitle) -} - -// Configures the main filesystem column title for localization. -func (handle HCONTAINER) SetColumnTitle(title string) { - Filesystem_set_column_title(handle, title) -} - -// Sets an item in specified row and column to the given data. -func Filesystem_set_item(handle HANDLE, contins HCONTINS, column int, row int, data POINTER) { - C.go_filesystem_set_item(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(data)) -} - -// Sets an item in specified row and column to the given unsigned integer. -func Filesystem_set_item_ulong(handle HANDLE, contins HCONTINS, column int, row int, val uint) { - C.go_filesystem_set_item_ulong(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.ulong(val)) -} - -// Sets an item in specified row and column to the given icon. -func Filesystem_set_item_icon(handle HANDLE, contins HCONTINS, column int, row int, icon HICN) { - C.go_filesystem_set_item_icon(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), unsafe.Pointer(icon)) -} - -// Sets an item in specified row and column to the given time. -func Filesystem_set_item_time(handle HANDLE, contins HCONTINS, column int, row int, seconds int, minutes int, hours int) { - C.go_filesystem_set_item_time(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) -} - -// Sets an item in specified row and column to the given date. -func Filesystem_set_item_date(handle HANDLE, contins HCONTINS, column int, row int, day int, month int, year int) { - C.go_filesystem_set_item_date(handle.GetHandle(), contins.ptr, C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) -} - -// Sets the filename and icon of the row in a filesystem style container. -func Filesystem_set_file(handle HANDLE, contins HCONTINS, row int, filename string, icon HICN) { - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - C.go_filesystem_set_file(handle.GetHandle(), contins.ptr, C.int(row), cfilename, unsafe.Pointer(icon)) -} - -// Sets the filename and icon of the row in a filesystem style container. -func (handle HCONTINS) SetFile(row int, filename string, icon HICN) { - if handle.filesystem == true { - Filesystem_set_file(handle.hcont, handle, row, filename, icon) - } -} - -// Changes an existing item in specified row and column to the given data. -func Filesystem_change_item(handle HANDLE, column int, row int, data POINTER) { - C.go_filesystem_change_item(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(data)) -} - -// Changes an existing item in specified row and column to the given unsigned integer. -func Filesystem_change_item_ulong(handle HANDLE, column int, row int, val uint) { - C.go_filesystem_change_item_ulong(handle.GetHandle(), C.int(column), C.int(row), C.ulong(val)) -} - -// Changes an existing item in specified row and column to the given icon. -func Filesystem_change_item_icon(handle HANDLE, column int, row int, icon HICN) { - C.go_filesystem_change_item_icon(handle.GetHandle(), C.int(column), C.int(row), unsafe.Pointer(icon)) -} - -// Changes an existing item in specified row and column to the given time. -func Filesystem_change_item_time(handle HANDLE, column int, row int, seconds int, minutes int, hours int) { - C.go_filesystem_change_item_time(handle.GetHandle(), C.int(column), C.int(row), C.int(seconds), C.int(minutes), C.int(hours)) -} - -// Changes an existing item in specified row and column to the given date. -func Filesystem_change_item_date(handle HANDLE, column int, row int, day int, month int, year int) { - C.go_filesystem_change_item_date(handle.GetHandle(), C.int(column), C.int(row), C.int(day), C.int(month), C.int(year)) -} - -// Changes the filename and icon of the row in a filesystem style container. -func Filesystem_change_file(handle HANDLE, row int, filename string, icon HICN) { - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - C.go_filesystem_change_file(handle.GetHandle(), C.int(row), cfilename, unsafe.Pointer(icon)) -} - -// Changes the filename and icon of the row in a filesystem style container. -func (handle HCONTAINER) ChangeFile(row int, filename string, icon HICN) { - if handle.filesystem == true { - Filesystem_change_file(handle, row, filename, icon) - } -} - -// Create a new calendar widget to be packed. -func Calendar_new(id uint) HCALENDAR { - return HCALENDAR{C.go_calendar_new(C.ulong(id))} -} - -// Create a new calendar widget to be packed. -func CalendarNew(id uint) HCALENDAR { - return Calendar_new(id) -} - -// Sets the current date of a calendar. -func Calendar_set_date(handle HANDLE, year uint, month uint, day uint) { - C.go_calendar_set_date(handle.GetHandle(), C.uint(year), C.uint(month), C.uint(day)) -} - -// Sets the current date of a calendar. -func (handle HCALENDAR) SetDate(year uint, month uint, day uint) { - Calendar_set_date(handle, year, month, day) -} - -// Gets the year, month and day set in the calendar widget. -func Calendar_get_date(handle HANDLE) (uint, uint, uint) { - var year, month, day C.uint - - C.go_calendar_get_date(handle.GetHandle(), &year, &month, &day) - return uint(year), uint(month), uint(day) -} - -// Gets the year, month and day set in the calendar widget. -func (handle HCALENDAR) GetDate() (uint, uint, uint) { - return Calendar_get_date(handle) -} - -// Create a bitmap widget to be packed. -func Bitmap_new(id uint) HBITMAP { - return HBITMAP{C.go_bitmap_new(C.ulong(id))} -} - -// Create a bitmap widget to be packed. -func BitmapNew(id uint) HBITMAP { - return Bitmap_new(id) -} - -// Create a new bitmap button widget to be packed. -func Bitmapbutton_new(text string, id uint) HBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - - return HBUTTON{C.go_bitmapbutton_new(ctext, C.ulong(id))} -} - -// Create a new bitmap button widget to be packed. -func BitmapButtonNew(text string, id uint) HBUTTON { - return Bitmapbutton_new(text, id) -} - -// Create a new bitmap button widget to be packed from a file. -func Bitmapbutton_new_from_file(text string, id uint, filename string) HBUTTON { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - cfilename := C.CString(filename) - defer C.free(unsafe.Pointer(cfilename)) - - return HBUTTON{C.go_bitmapbutton_new_from_file(ctext, C.ulong(id), cfilename)} -} - -// Create a new bitmap button widget to be packed from a file. -func BitmapButtonNewFromFile(text string, id uint, filename string) HBUTTON { - return Bitmapbutton_new_from_file(text, id, filename) -} - -// Creates a splitbar widget with given widgets on either side. -func Splitbar_new(btype int, topleft HWND, bottomright HWND, id uint) HSPLITBAR { - return HSPLITBAR{C.go_splitbar_new(C.int(btype), unsafe.Pointer(topleft.hwnd), unsafe.Pointer(bottomright.hwnd), C.ulong(id))} -} - -// Creates a splitbar widget with given widgets on either side. -func SplitbarNew(btype int, topleft HWND, bottomright HWND, id uint) HSPLITBAR { - return Splitbar_new(btype, topleft, bottomright, id) -} - -// Sets the position of a splitbar (pecentage). -func Splitbar_set(handle HANDLE, position float32) { - C.go_splitbar_set(handle.GetHandle(), C.float(position)) -} - -// Sets the position of a splitbar (pecentage). -func (handle HSPLITBAR) Set(position float32) { - Splitbar_set(handle, position) -} - -// Gets the position of a splitbar (pecentage). -func Splitbar_get(handle HANDLE) float32 { - return float32(C.go_splitbar_get(handle.GetHandle())) -} - -// Gets the position of a splitbar (pecentage). -func (handle HSPLITBAR) Get() float32 { - return Splitbar_get(handle) -} - -// Creates a new print object. -func PrintNew(jobname string) HPRINT { - return HPRINT{nil, jobname} -} - -// Creates a new print object. -func Print_new(jobname string, flags uint, pages uint, drawfunc SIGNAL_FUNC, drawdata POINTER) HPRINT { - backs = append(backs, unsafe.Pointer(drawfunc)) - cjobname := C.CString(jobname) - defer C.free(unsafe.Pointer(cjobname)) - - return HPRINT{C.go_print_new(cjobname, C.ulong(flags), C.uint(pages), unsafe.Pointer(drawfunc), unsafe.Pointer(drawdata), 0), jobname} -} - -// Runs the print job, causing the draw page callbacks to fire. -func Print_run(print HPRINT, flags uint) int { - if print.hprint != nil { - return int(C.go_print_run(unsafe.Pointer(print.hprint), C.ulong(flags))) - } - return C.DW_ERROR_UNKNOWN -} - -// Runs the print job, causing the draw page callbacks to fire. -func (print HPRINT) Run(flags uint) { - Print_run(print, flags) -} - -// Cancels the print job, typically called from a draw page callback. -func Print_cancel(print HPRINT) { - if print.hprint != nil { - C.go_print_cancel(unsafe.Pointer(print.hprint)) - } -} - -// Cancels the print job, typically called from a draw page callback. -func (print HPRINT) Cancel() { - Print_cancel(print) -} - -func init() { - runtime.LockOSThread() -} - -// Creates a new mutex semaphore. -func Mutex_new() HMTX { - return HMTX{C.go_mutex_new()} -} - -// Creates a new mutex semaphore. -func MutexNew() HMTX { - return Mutex_new() -} - -// Closes a semaphore created by Mutex_new(). -func Mutex_close(handle HMTX) { - C.go_mutex_close(unsafe.Pointer(handle.hmtx)) -} - -// Closes a semaphore created by MutexNew(). -func (handle HMTX) Close() { - Mutex_close(handle) -} - -// Tries to gain access to the semaphore, if it can't it blocks. -func Mutex_lock(handle HMTX) { - C.go_mutex_lock(unsafe.Pointer(handle.hmtx)) -} - -// Tries to gain access to the semaphore, if it can't it blocks. -func (handle HMTX) Lock() { - Mutex_lock(handle) -} - -// Reliquishes the access to the semaphore. -func Mutex_unlock(handle HMTX) { - C.go_mutex_unlock(unsafe.Pointer(handle.hmtx)) -} - -// Reliquishes the access to the semaphore. -func (handle HMTX) Unlock() { - Mutex_unlock(handle) -} - -// Tries to gain access to the semaphore. -func Mutex_trylock(handle HMTX) int { - return int(C.go_mutex_trylock(unsafe.Pointer(handle.hmtx))) -} - -// Tries to gain access to the semaphore. -func (handle HMTX) TryLock() int { - return Mutex_trylock(handle) -} - -// Allocates and initializes a dialog. -func Dialog_new() HDIALOG { - return HDIALOG{C.go_dialog_new()} -} - -// Allocates and initializes a dialog. -func DialogNew() HDIALOG { - return Dialog_new() -} - -// Accepts a dialog and returns the given data to the initial call of Dialog_wait(). -func Dialog_dismiss(handle HDIALOG, result POINTER) int { - return int(C.go_dialog_dismiss(unsafe.Pointer(handle.hdialog), unsafe.Pointer(result))) -} - -// Returns the given data to the initial call of Wait(). -func (handle HDIALOG) Dismiss(result uintptr) int { - return Dialog_dismiss(handle, POINTER(result)) -} - -// Accepts a dialog, waits for Dialog_dismiss() to be called by a signal handler with the given dialog. -func Dialog_wait(handle HDIALOG) POINTER { - return POINTER(C.go_dialog_wait(unsafe.Pointer(handle.hdialog))) -} - -// Waits for Dismiss() to be called by a signal handler. -func (handle HDIALOG) Wait() uintptr { - return uintptr(Dialog_wait(handle)) -} - -// Creates an unnamed event semaphore. -func Event_new() HEV { - return HEV{C.go_event_new()} -} - -// Creates an unnamed event semaphore. -func EventNew() HEV { - return Event_new() -} - -// Closes a semaphore created by Event_new(). -func Event_close(handle *HEV) int { - retval := int(C.go_event_close(unsafe.Pointer(handle.hev))) - handle.hev = nil - return retval -} - -// Closes a semaphore created by EventNew(). -func (handle *HEV) Close() int { - return Event_close(handle) -} - -// Posts a semaphore created by Event_new(). Causing all threads waiting on this event in Event_wait() to continue. -func Event_post(handle HEV) int { - return int(C.go_event_post(unsafe.Pointer(handle.hev))) -} - -// Posts a semaphore created by EventNew(). Causing all threads waiting on this event in Wait() to continue. -func (handle HEV) Post() int { - return Event_post(handle) -} - -// Resets a semaphore created by Event_new(). -func Event_reset(handle HEV) int { - return int(C.go_event_reset(unsafe.Pointer(handle.hev))) -} - -// Resets a semaphore created by EventNew(). -func (handle HEV) Reset() int { - return Event_reset(handle) -} - -// Waits on a semaphore created by Event_new(), until the event gets posted or until the timeout expires. -func Event_wait(handle HEV, timeout int) int { - return int(C.go_event_wait(unsafe.Pointer(handle.hev), C.ulong(timeout))) -} - -// Waits on a semaphore created by EventNew(), until the event gets posted or until the timeout expires. -func (handle HEV) Wait(timeout int) int { - return Event_wait(handle, timeout) -} - -var go_flags_no_data C.uint = 1 - -// Connect a function or closure to a window close (delete) event. -func (window HWND) ConnectDelete(sigfunc func(window HWND) int) { - csigname := C.CString(C.DW_SIGNAL_DELETE) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a widget clicked event. -func (window HBUTTON) ConnectClicked(sigfunc func(window HBUTTON) int) { - csigname := C.CString(C.DW_SIGNAL_CLICKED) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a focus clicked event. -func (window HWND) ConnectSetFocus(sigfunc func(window HWND) int) { - csigname := C.CString(C.DW_SIGNAL_SET_FOCUS) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a key press event. -func (window HWND) ConnectKeyPress(sigfunc func(window HWND, ch uint8, vk int, state int, utf8 string) int) { - csigname := C.CString(C.DW_SIGNAL_KEY_PRESS) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a key press event. -func (window HRENDER) ConnectKeyPress(sigfunc func(window HRENDER, ch uint8, vk int, state int, utf8 string) int) { - csigname := C.CString(C.DW_SIGNAL_KEY_PRESS) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a mouse motion event. -func (window HRENDER) ConnectMotion(sigfunc func(window HRENDER, x int, y int, mask int) int) { - csigname := C.CString(C.DW_SIGNAL_MOTION_NOTIFY) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a mouse button press event. -func (window HRENDER) ConnectButtonPress(sigfunc func(window HRENDER, x int, y int, mask int) int) { - csigname := C.CString(C.DW_SIGNAL_BUTTON_PRESS) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a mouse button release event. -func (window HRENDER) ConnectButtonRelease(sigfunc func(window HRENDER, x int, y int, mask int) int) { - csigname := C.CString(C.DW_SIGNAL_BUTTON_RELEASE) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a render expose event. -func (window HRENDER) ConnectExpose(sigfunc func(window HRENDER, x int, y int, width int, height int) int) { - csigname := C.CString(C.DW_SIGNAL_EXPOSE) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a configure (size change) event. -func (window HRENDER) ConnectConfigure(sigfunc func(window HRENDER, width int, height int) int) { - csigname := C.CString(C.DW_SIGNAL_CONFIGURE) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a tree ENTER/RETURN press event. -func (window HTREE) ConnectItemEnter(sigfunc func(window HTREE, str string, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_ENTER) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a container ENTER/RETURN press event. -func (window HCONTAINER) ConnectItemEnter(sigfunc func(window HCONTAINER, str string, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_ENTER) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a tree context event. -func (window HTREE) ConnectItemContext(sigfunc func(window HTREE, text string, x int, y int, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_CONTEXT) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a container context event. -func (window HCONTAINER) ConnectItemContext(sigfunc func(window HCONTAINER, text string, x int, y int, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_CONTEXT) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a tree select event. -func (window HTREE) ConnectItemSelect(sigfunc func(window HTREE, item HTREEITEM, text string, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_SELECT) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a container select event. -func (window HCONTAINER) ConnectItemSelect(sigfunc func(window HCONTAINER, item HTREEITEM, text string, itemdata POINTER) int) { - csigname := C.CString(C.DW_SIGNAL_ITEM_SELECT) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a listbox select event. -func (window HLISTBOX) ConnectListSelect(sigfunc func(window HLISTBOX, index int) int) { - csigname := C.CString(C.DW_SIGNAL_LIST_SELECT) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a value changed event. -func (window HSCROLLBAR) ConnectValueChanged(sigfunc func(window HSCROLLBAR, index int) int) { - csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a value changed event. -func (window HSLIDER) ConnectValueChanged(sigfunc func(window HSLIDER, index int) int) { - csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a value changed event. -func (window HSPINBUTTON) ConnectValueChanged(sigfunc func(window HSPINBUTTON, index int) int) { - csigname := C.CString(C.DW_SIGNAL_VALUE_CHANGED) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a column title click event. -func (window HCONTAINER) ConnectColumnClick(sigfunc func(window HCONTAINER, index int) int) { - csigname := C.CString(C.DW_SIGNAL_COLUMN_CLICK) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a notebook switch page event. -func (window HNOTEBOOK) ConnectSwitchPage(sigfunc func(window HNOTEBOOK, pageid HNOTEPAGE) int) { - csigname := C.CString(C.DW_SIGNAL_SWITCH_PAGE) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a tree item (node) expand event. -func (window HTREE) ConnectTreeExpand(sigfunc func(window HTREE, item HTREEITEM) int) { - csigname := C.CString(C.DW_SIGNAL_TREE_EXPAND) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a menu item clicked event. -func (window HMENUITEM) ConnectClicked(sigfunc func(window HMENUITEM) int) { - csigname := C.CString(C.DW_SIGNAL_CLICKED) - defer C.free(unsafe.Pointer(csigname)) - - backs = append(backs, unsafe.Pointer(&sigfunc)) - C.go_signal_connect(unsafe.Pointer(window.hwnd), csigname, unsafe.Pointer(&sigfunc), nil, (window.GetType()<<8)|go_flags_no_data) -} - -// Connect a function or closure to a timer event. -func (id *HTIMER) Connect(sigfunc func() int, interval int) { - if id.tid == 0 { - backs = append(backs, unsafe.Pointer(&sigfunc)) - id.tid = C.go_timer_connect(C.int(interval), unsafe.Pointer(&sigfunc), nil, go_flags_no_data) - } -} - -// Disconnect an active timer event. -func (id HTIMER) Disconnect() { - if id.tid > 0 { - C.dw_timer_disconnect(C.int(id.tid)) - } -} - -// Connect a function or closure to a print object draw page event. -func (print HPRINT) Connect(drawfunc func(HPRINT, HPIXMAP, int) int, flags uint, pages int) { - if print.hprint == nil { - backs = append(backs, unsafe.Pointer(&drawfunc)) - cjobname := C.CString(print.jobname) - defer C.free(unsafe.Pointer(cjobname)) - - print.hprint = C.go_print_new(cjobname, C.ulong(flags), C.uint(pages), unsafe.Pointer(&drawfunc), nil, go_flags_no_data) - } -} - -//export go_callback_remove -func go_callback_remove(pfunc unsafe.Pointer) { - // Scan through the callback function pointer list... - for i, p := range backs { - // When we find the pointer of the function - // we are removing... - if p == pfunc { - // Remove it from the callback list... - // So it can be garbage collected if not used - backs = append(backs[:i], backs[i+1:]...) - //delete(backs, i); - return - } - } -} - -//export go_int_callback_basic -func go_int_callback_basic(pfunc unsafe.Pointer, window unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, POINTER) int)(pfunc) - return C.int(thisfunc(HWND{window}, POINTER(data))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, POINTER) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, POINTER(data))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, POINTER) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, POINTER(data))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, POINTER(data))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, POINTER(data))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, POINTER) int)(pfunc) - return C.int(thisfunc(HMLE{window}, POINTER(data))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, POINTER) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, POINTER(data))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, POINTER) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, POINTER(data))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, POINTER) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, POINTER(data))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, POINTER) int)(pfunc) - return C.int(thisfunc(HBOX{window}, POINTER(data))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, POINTER(data))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, POINTER) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, POINTER(data))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, POINTER) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, POINTER(data))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, POINTER) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, POINTER(data))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, POINTER) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, POINTER(data))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, POINTER(data))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, POINTER) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, POINTER(data))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, POINTER) int)(pfunc) - return C.int(thisfunc(HHTML{window}, POINTER(data))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, POINTER) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, POINTER(data))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, POINTER) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, POINTER(data))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, POINTER) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE) int)(pfunc) - return C.int(thisfunc(HGENERIC{window})) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND) int)(pfunc) - return C.int(thisfunc(HWND{window})) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window})) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT) int)(pfunc) - return C.int(thisfunc(HTEXT{window})) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE) int)(pfunc) - return C.int(thisfunc(HTREE{window})) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem})) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE) int)(pfunc) - return C.int(thisfunc(HMLE{window})) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON) int)(pfunc) - return C.int(thisfunc(HBUTTON{window})) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window})) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window})) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX) int)(pfunc) - return C.int(thisfunc(HBOX{window})) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window})) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window})) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window})) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT) int)(pfunc) - return C.int(thisfunc(HPERCENT{window})) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER) int)(pfunc) - return C.int(thisfunc(HSLIDER{window})) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window})) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER) int)(pfunc) - return C.int(thisfunc(HRENDER{window})) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML) int)(pfunc) - return C.int(thisfunc(HHTML{window})) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window})) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP) int)(pfunc) - return C.int(thisfunc(HBITMAP{window})) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window})) - } - thisfunc := *(*func(HANDLE, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, POINTER(data))) -} - -//export go_int_callback_configure -func go_int_callback_configure(pfunc unsafe.Pointer, window unsafe.Pointer, width C.int, height C.int, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HWND{window}, int(width), int(height), POINTER(data))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(width), int(height), POINTER(data))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(width), int(height), POINTER(data))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(width), int(height), POINTER(data))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, int, int, POINTER) C.int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(width), int(height), POINTER(data))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(width), int(height), POINTER(data))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(width), int(height), POINTER(data))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(width), int(height), POINTER(data))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(width), int(height), POINTER(data))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(width), int(height), POINTER(data))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(width), int(height), POINTER(data))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(width), int(height), POINTER(data))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(width), int(height), POINTER(data))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(width), int(height), POINTER(data))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(width), int(height), POINTER(data))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(width), int(height), POINTER(data))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(width), int(height), POINTER(data))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(width), int(height), POINTER(data))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(width), int(height), POINTER(data))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(width), int(height), POINTER(data))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(width), int(height), POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, int, int) C.int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(width), int(height))) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND, int, int) C.int)(pfunc) - return C.int(thisfunc(HWND{window}, int(width), int(height))) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int, int) C.int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(width), int(height))) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT, int, int) C.int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(width), int(height))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, int, int) C.int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(width), int(height))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, int, int) C.int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(width), int(height))) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE, int, int) C.int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(width), int(height))) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON, int, int) C.int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(width), int(height))) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int, int) C.int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(width), int(height))) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int, int) C.int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(width), int(height))) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX, int, int) C.int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(width), int(height))) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int, int) C.int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(width), int(height))) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM, int, int) C.int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(width), int(height))) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX, int, int) C.int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(width), int(height))) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT, int, int) C.int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(width), int(height))) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER, int, int) C.int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(width), int(height))) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int, int) C.int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(width), int(height))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, int, int) C.int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(width), int(height))) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML, int, int) C.int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(width), int(height))) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR, int, int) C.int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(width), int(height))) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP, int, int) C.int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(width), int(height))) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int, int) C.int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(width), int(height))) - } - thisfunc := *(*func(HANDLE, int, int, POINTER) C.int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(width), int(height), POINTER(data))) -} - -//export go_int_callback_keypress -func go_int_callback_keypress(pfunc unsafe.Pointer, window unsafe.Pointer, ch C.char, vk C.int, state C.int, data unsafe.Pointer, utf8 *C.char, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HWND{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HTREE{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, uint8, int, int, POINTER, string) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HMLE{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HHTML{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HWND{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HTREE{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, uint8, int, int, string) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HMLE{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HHTML{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, uint8, int, int, string) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, uint8(ch), int(vk), int(state), C.GoString(utf8))) - } - thisfunc := *(*func(HANDLE, uint8, int, int, POINTER, string) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, uint8(ch), int(vk), int(state), POINTER(data), C.GoString(utf8))) -} - -//export go_int_callback_mouse -func go_int_callback_mouse(pfunc unsafe.Pointer, window unsafe.Pointer, x C.int, y C.int, mask C.int, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HWND{window}, int(x), int(y), int(mask), POINTER(data))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(x), int(y), int(mask), POINTER(data))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(x), int(y), int(mask), POINTER(data))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(x), int(y), int(mask), POINTER(data))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, int, int, int, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(x), int(y), int(mask), POINTER(data))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(x), int(y), int(mask), POINTER(data))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(x), int(y), int(mask), POINTER(data))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(x), int(y), int(mask), POINTER(data))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(x), int(y), int(mask), POINTER(data))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(x), int(y), int(mask), POINTER(data))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(x), int(y), int(mask), POINTER(data))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(x), int(y), int(mask), POINTER(data))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(x), int(y), int(mask), POINTER(data))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(x), int(y), int(mask), POINTER(data))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(x), int(y), int(mask), POINTER(data))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(x), int(y), int(mask), POINTER(data))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(mask), POINTER(data))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(x), int(y), int(mask), POINTER(data))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(x), int(y), int(mask), POINTER(data))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(x), int(y), int(mask), POINTER(data))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(x), int(y), int(mask), POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, int, int, int) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(mask))) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND, int, int, int) int)(pfunc) - return C.int(thisfunc(HWND{window}, int(x), int(y), int(mask))) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int, int, int) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(x), int(y), int(mask))) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT, int, int, int) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(x), int(y), int(mask))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, int, int, int) int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(x), int(y), int(mask))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, int, int, int) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(x), int(y), int(mask))) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE, int, int, int) int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(x), int(y), int(mask))) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON, int, int, int) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(x), int(y), int(mask))) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int, int, int) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(x), int(y), int(mask))) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int, int, int) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(x), int(y), int(mask))) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX, int, int, int) int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(x), int(y), int(mask))) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int, int, int) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(x), int(y), int(mask))) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM, int, int, int) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(x), int(y), int(mask))) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX, int, int, int) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(x), int(y), int(mask))) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT, int, int, int) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(x), int(y), int(mask))) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER, int, int, int) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(x), int(y), int(mask))) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int, int, int) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(x), int(y), int(mask))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, int, int, int) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(mask))) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML, int, int, int) int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(x), int(y), int(mask))) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR, int, int, int) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(x), int(y), int(mask))) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP, int, int, int) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(x), int(y), int(mask))) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int, int, int) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(x), int(y), int(mask))) - } - thisfunc := *(*func(HANDLE, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(mask), POINTER(data))) -} - -//export go_int_callback_expose -func go_int_callback_expose(pfunc unsafe.Pointer, window unsafe.Pointer, x C.int, y C.int, width C.int, height C.int, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, int, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(width), int(height), POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, int, int, int, int) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(width), int(height))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, int, int, int, int) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(x), int(y), int(width), int(height))) - } - thisfunc := *(*func(HANDLE, int, int, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(x), int(y), int(width), int(height), POINTER(data))) -} - -//export go_int_callback_item_enter -func go_int_callback_item_enter(pfunc unsafe.Pointer, window unsafe.Pointer, text *C.char, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, string, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, C.GoString(text), POINTER(data), POINTER(itemdata))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, string, POINTER, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), POINTER(data), POINTER(itemdata))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, string, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, C.GoString(text), POINTER(itemdata))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, string, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, C.GoString(text), POINTER(itemdata))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, string, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), POINTER(itemdata))) - } - thisfunc := *(*func(HANDLE, string, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, C.GoString(text), POINTER(data), POINTER(itemdata))) -} - -//export go_int_callback_item_context -func go_int_callback_item_context(pfunc unsafe.Pointer, window unsafe.Pointer, text *C.char, x C.int, y C.int, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, string, int, int, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, string, int, int, POINTER, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, string, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, C.GoString(text), int(x), int(y), POINTER(itemdata))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, string, int, int, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, C.GoString(text), int(x), int(y), POINTER(itemdata))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, string, int, int, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, C.GoString(text), int(x), int(y), POINTER(itemdata))) - } - thisfunc := *(*func(HANDLE, string, int, int, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, C.GoString(text), int(x), int(y), POINTER(data), POINTER(itemdata))) -} - -//export go_int_callback_item_select -func go_int_callback_item_select(pfunc unsafe.Pointer, window unsafe.Pointer, item unsafe.Pointer, text *C.char, data unsafe.Pointer, itemdata unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, HTREEITEM, string, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, HTREEITEM, string, POINTER, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, HTREEITEM, string, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, HTREEITEM, string, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, HTREEITEM, string, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(itemdata))) - } - thisfunc := *(*func(HANDLE, HTREEITEM, string, POINTER, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HTREEITEM{item, HWND{window}}, C.GoString(text), POINTER(data), POINTER(itemdata))) -} - -//export go_int_callback_numeric -func go_int_callback_numeric(pfunc unsafe.Pointer, window unsafe.Pointer, val C.int, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, int, POINTER) int)(pfunc) - return C.int(thisfunc(HWND{window}, int(val), POINTER(data))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int, POINTER) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(val), POINTER(data))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, int, POINTER) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(val), POINTER(data))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, int, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(val), POINTER(data))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, int, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(val), POINTER(data))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, int, POINTER) int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(val), POINTER(data))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(val), POINTER(data))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(val), POINTER(data))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int, POINTER) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(val), POINTER(data))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(val), POINTER(data))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(val), POINTER(data))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, int, POINTER) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(val), POINTER(data))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, int, POINTER) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(val), POINTER(data))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, int, POINTER) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(val), POINTER(data))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(val), POINTER(data))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(val), POINTER(data))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, int, POINTER) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(val), POINTER(data))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, int, POINTER) int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(val), POINTER(data))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, int, POINTER) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(val), POINTER(data))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, int, POINTER) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(val), POINTER(data))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int, POINTER) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(val), POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, int) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(val))) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND, int) int)(pfunc) - return C.int(thisfunc(HWND{window}, int(val))) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, int) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, int(val))) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT, int) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, int(val))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, int) int)(pfunc) - return C.int(thisfunc(HTREE{window}, int(val))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, int) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, int(val))) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE, int) int)(pfunc) - return C.int(thisfunc(HMLE{window}, int(val))) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON, int) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, int(val))) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, int) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, int(val))) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, int) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, int(val))) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX, int) int)(pfunc) - return C.int(thisfunc(HBOX{window}, int(val))) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, int) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, int(val))) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM, int) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, int(val))) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX, int) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, int(val))) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT, int) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, int(val))) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER, int) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, int(val))) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, int) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, int(val))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, int) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, int(val))) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML, int) int)(pfunc) - return C.int(thisfunc(HHTML{window}, int(val))) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR, int) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, int(val))) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP, int) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, int(val))) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, int) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, int(val))) - } - thisfunc := *(*func(HANDLE, int, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, int(val), POINTER(data))) -} - -//export go_int_callback_ulong -func go_int_callback_ulong(pfunc unsafe.Pointer, window unsafe.Pointer, val C.ulong, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (1 << 8): // HWND - thisfunc := *(*func(HWND, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HWND{window}, uint(val), POINTER(data))) - case (2 << 8): // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, uint(val), POINTER(data))) - case (3 << 8): // HTEXT - thisfunc := *(*func(HTEXT, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, uint(val), POINTER(data))) - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, uint(val), POINTER(data))) - case (5 << 8): // HCONTAINER - thisfunc := *(*func(HCONTAINER, uint, POINTER) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, uint(val), POINTER(data))) - case (6 << 8): // HMLE - thisfunc := *(*func(HMLE, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HMLE{window}, uint(val), POINTER(data))) - case (7 << 8): // HBUTTON - thisfunc := *(*func(HBUTTON, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, uint(val), POINTER(data))) - case (8 << 8): // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, uint(val), POINTER(data))) - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, uint(val), POINTER(data))) - case (10 << 8): // HBOX - thisfunc := *(*func(HBOX, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HBOX{window}, uint(val), POINTER(data))) - case (11 << 8): // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, uint(val), POINTER(data))) - case (12 << 8): // HMENUITEM - thisfunc := *(*func(HMENUITEM, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, uint(val), POINTER(data))) - case (13 << 8): // HLISTBOX - thisfunc := *(*func(HLISTBOX, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, uint(val), POINTER(data))) - case (14 << 8): // HPERCENT - thisfunc := *(*func(HPERCENT, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, uint(val), POINTER(data))) - case (15 << 8): // HSLIDER - thisfunc := *(*func(HSLIDER, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, uint(val), POINTER(data))) - case (16 << 8): // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, uint(val), POINTER(data))) - case (17 << 8): // HRENDER - thisfunc := *(*func(HRENDER, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, uint(val), POINTER(data))) - case (18 << 8): // HHTML - thisfunc := *(*func(HHTML, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HHTML{window}, uint(val), POINTER(data))) - case (19 << 8): // HCALENDAR - thisfunc := *(*func(HCALENDAR, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, uint(val), POINTER(data))) - case (20 << 8): // HBITMAP - thisfunc := *(*func(HBITMAP, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, uint(val), POINTER(data))) - case (21 << 8): // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, uint(val), POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, uint) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, uint(val))) - case (1 << 8) | go_flags_no_data: // HWND - thisfunc := *(*func(HWND, uint) int)(pfunc) - return C.int(thisfunc(HWND{window}, uint(val))) - case (2 << 8) | go_flags_no_data: // HENTRYFIELD - thisfunc := *(*func(HENTRYFIELD, uint) int)(pfunc) - return C.int(thisfunc(HENTRYFIELD{window}, uint(val))) - case (3 << 8) | go_flags_no_data: // HTEXT - thisfunc := *(*func(HTEXT, uint) int)(pfunc) - return C.int(thisfunc(HTEXT{window}, uint(val))) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, uint) int)(pfunc) - return C.int(thisfunc(HTREE{window}, uint(val))) - case (5 << 8) | go_flags_no_data: // HCONTAINER - thisfunc := *(*func(HCONTAINER, uint) int)(pfunc) - filesystem := false - if Window_get_data(HCONTAINER{window, false}, "_go_filesystem") != nil { - filesystem = true - } - return C.int(thisfunc(HCONTAINER{window, filesystem}, uint(val))) - case (6 << 8) | go_flags_no_data: // HMLE - thisfunc := *(*func(HMLE, uint) int)(pfunc) - return C.int(thisfunc(HMLE{window}, uint(val))) - case (7 << 8) | go_flags_no_data: // HBUTTON - thisfunc := *(*func(HBUTTON, uint) int)(pfunc) - return C.int(thisfunc(HBUTTON{window}, uint(val))) - case (8 << 8) | go_flags_no_data: // HSPINBUTTON - thisfunc := *(*func(HSPINBUTTON, uint) int)(pfunc) - return C.int(thisfunc(HSPINBUTTON{window}, uint(val))) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, uint) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, uint(val))) - case (10 << 8) | go_flags_no_data: // HBOX - thisfunc := *(*func(HBOX, uint) int)(pfunc) - return C.int(thisfunc(HBOX{window}, uint(val))) - case (11 << 8) | go_flags_no_data: // HSCROLLBOX - thisfunc := *(*func(HSCROLLBOX, uint) int)(pfunc) - return C.int(thisfunc(HSCROLLBOX{window}, uint(val))) - case (12 << 8) | go_flags_no_data: // HMENUITEM - thisfunc := *(*func(HMENUITEM, uint) int)(pfunc) - return C.int(thisfunc(HMENUITEM{window}, uint(val))) - case (13 << 8) | go_flags_no_data: // HLISTBOX - thisfunc := *(*func(HLISTBOX, uint) int)(pfunc) - return C.int(thisfunc(HLISTBOX{window}, uint(val))) - case (14 << 8) | go_flags_no_data: // HPERCENT - thisfunc := *(*func(HPERCENT, uint) int)(pfunc) - return C.int(thisfunc(HPERCENT{window}, uint(val))) - case (15 << 8) | go_flags_no_data: // HSLIDER - thisfunc := *(*func(HSLIDER, uint) int)(pfunc) - return C.int(thisfunc(HSLIDER{window}, uint(val))) - case (16 << 8) | go_flags_no_data: // HSCROLLBAR - thisfunc := *(*func(HSCROLLBAR, uint) int)(pfunc) - return C.int(thisfunc(HSCROLLBAR{window}, uint(val))) - case (17 << 8) | go_flags_no_data: // HRENDER - thisfunc := *(*func(HRENDER, uint) int)(pfunc) - return C.int(thisfunc(HRENDER{window}, uint(val))) - case (18 << 8) | go_flags_no_data: // HHTML - thisfunc := *(*func(HHTML, uint) int)(pfunc) - return C.int(thisfunc(HHTML{window}, uint(val))) - case (19 << 8) | go_flags_no_data: // HCALENDAR - thisfunc := *(*func(HCALENDAR, uint) int)(pfunc) - return C.int(thisfunc(HCALENDAR{window}, uint(val))) - case (20 << 8) | go_flags_no_data: // HBITMAP - thisfunc := *(*func(HBITMAP, uint) int)(pfunc) - return C.int(thisfunc(HBITMAP{window}, uint(val))) - case (21 << 8) | go_flags_no_data: // HSPLITBAR - thisfunc := *(*func(HSPLITBAR, uint) int)(pfunc) - return C.int(thisfunc(HSPLITBAR{window}, uint(val))) - } - thisfunc := *(*func(HANDLE, uint, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, uint(val), POINTER(data))) -} - -//export go_int_callback_notepage -func go_int_callback_notepage(pfunc unsafe.Pointer, window unsafe.Pointer, val C.ulong, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (9 << 8): // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, HNOTEPAGE, POINTER) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, HNOTEPAGE{val, HNOTEBOOK{window}}, POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, HNOTEPAGE) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HNOTEPAGE{val, HNOTEBOOK{window}})) - case (9 << 8) | go_flags_no_data: // HNOTEBOOK - thisfunc := *(*func(HNOTEBOOK, HNOTEPAGE) int)(pfunc) - return C.int(thisfunc(HNOTEBOOK{window}, HNOTEPAGE{val, HNOTEBOOK{window}})) - } - thisfunc := *(*func(HANDLE, HNOTEPAGE, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HNOTEPAGE{val, HNOTEBOOK{window}}, POINTER(data))) -} - -//export go_int_callback_tree -func go_int_callback_tree(pfunc unsafe.Pointer, window unsafe.Pointer, tree unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { - switch flags { - case (4 << 8): // HTREE - thisfunc := *(*func(HTREE, HTREEITEM, POINTER) int)(pfunc) - return C.int(thisfunc(HTREE{window}, HTREEITEM{tree, HWND{window}}, POINTER(data))) - case go_flags_no_data: - thisfunc := *(*func(HANDLE, HTREEITEM) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HTREEITEM{tree, HWND{window}})) - case (4 << 8) | go_flags_no_data: // HTREE - thisfunc := *(*func(HTREE, HTREEITEM) int)(pfunc) - return C.int(thisfunc(HTREE{window}, HTREEITEM{tree, HWND{window}})) - } - thisfunc := *(*func(HANDLE, HTREEITEM, POINTER) int)(pfunc) - return C.int(thisfunc(HGENERIC{window}, HTREEITEM{tree, HWND{window}}, POINTER(data))) -} - -//export go_int_callback_timer -func go_int_callback_timer(pfunc unsafe.Pointer, data unsafe.Pointer, flags C.uint) C.int { - if (flags & go_flags_no_data) == go_flags_no_data { - thisfunc := *(*func() int)(pfunc) - return C.int(thisfunc()) - } - thisfunc := *(*func(POINTER) int)(pfunc) - return C.int(thisfunc(POINTER(data))) -} - -//export go_int_callback_print -func go_int_callback_print(pfunc unsafe.Pointer, print unsafe.Pointer, pixmap unsafe.Pointer, page_num C.int, data unsafe.Pointer, flags C.uint) C.int { - if (flags & go_flags_no_data) == go_flags_no_data { - thisfunc := *(*func(HPRINT, HPIXMAP, int) int)(pfunc) - return C.int(thisfunc(HPRINT{print, ""}, HPIXMAP{pixmap}, int(page_num))) - } - thisfunc := *(*func(HPRINT, HPIXMAP, int, POINTER) int)(pfunc) - return C.int(thisfunc(HPRINT{print, ""}, HPIXMAP{pixmap}, int(page_num), POINTER(data))) -}
--- a/src/dw/dwglue.c Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1422 +0,0 @@ -#include <dw.h> -#include <stdlib.h> -#include <string.h> - -static int go_init(int newthread, int argc, char *argv[]) -{ - return dw_init(newthread, argc, argv); -} - -static int go_messagebox(char *title, int flags, char *message) -{ - return dw_messagebox(title, flags, message); -} - -static void *go_window_new(void *owner, char *title, unsigned long flags) -{ - return (void *)dw_window_new((HWND)owner, title, flags); -} - -static int go_window_show(void *handle) -{ - return dw_window_show((HWND)handle); -} - -static int go_window_hide(void *handle) -{ - return dw_window_hide((HWND)handle); -} - -static int go_window_lower(void *handle) -{ - return dw_window_lower((HWND)handle); -} - -static int go_window_raise(void *handle) -{ - return dw_window_raise((HWND)handle); -} - -static int go_window_minimize(void *handle) -{ - return dw_window_minimize((HWND)handle); -} - -static void go_window_set_pos(void *handle, long x, long y) -{ - dw_window_set_pos((HWND)handle, x, y); -} - -static void go_window_set_pos_size(void *handle, long x, long y, unsigned long width, unsigned long height) -{ - dw_window_set_pos_size((HWND)handle, x, y, width, height); -} - -static void go_window_set_size(void *handle, unsigned long width, unsigned long height) -{ - dw_window_set_size((HWND)handle, width, height); -} - -static int go_window_set_color(void *handle, unsigned long fore, unsigned long back) -{ - return dw_window_set_color((HWND)handle, fore, back); -} - -static void go_window_set_style(void *handle, unsigned long style, unsigned long mask) -{ - dw_window_set_style((HWND)handle, style, mask); -} - -static void go_window_click_default(void *window, void *next) -{ - dw_window_click_default((HWND)window, (HWND)next); -} - -static void go_window_default(void *window, void *defaultitem) -{ - dw_window_default((HWND)window, (HWND)defaultitem); -} - -static int go_window_destroy(void *handle) -{ - return dw_window_destroy((HWND)handle); -} - -static void go_window_disable(void *handle) -{ - dw_window_disable((HWND)handle); -} - -static void go_window_enable(void *handle) -{ - dw_window_enable((HWND)handle); -} - -static void *go_window_from_id(void *handle, int id) -{ - return dw_window_from_id((HWND)handle, id); -} - -static void *go_window_get_data(void *handle, char *dataname) -{ - return dw_window_get_data((HWND)handle, dataname); -} - -static void go_window_set_data(void *handle, char *dataname, void *data) -{ - dw_window_set_data((HWND)handle, dataname, data); -} - -static char *go_window_get_font(void *handle) -{ - return dw_window_get_font((HWND)handle); -} - -static int go_window_set_font(void *handle, char *fontname) -{ - return dw_window_set_font((HWND)handle, fontname); -} - -static void go_window_get_pos_size(void *handle, long *x, long *y, unsigned long *width, unsigned long *height) -{ - dw_window_get_pos_size((HWND)handle, x, y, width, height); -} - -static void go_window_get_preferred_size(void *handle, int *width, int *height) -{ - dw_window_get_preferred_size((HWND)handle, width, height); -} - -static char *go_window_get_text(void *handle) -{ - return dw_window_get_text((HWND)handle); -} - -static void go_window_set_text(void *handle, char *text) -{ - dw_window_set_text((HWND)handle, text); -} - -static void go_window_set_tooltip(void *handle, char *bubbletext) -{ - dw_window_set_tooltip((HWND)handle, bubbletext); -} - -static void go_window_redraw(void *handle) -{ - dw_window_redraw((HWND)handle); -} - -static void go_window_capture(void *handle) -{ - dw_window_capture((HWND)handle); -} - -static void go_window_set_bitmap(void *handle, unsigned long cid, char *filename) -{ - dw_window_set_bitmap((HWND)handle, cid, filename); -} - -static int go_window_set_border(void *handle, int border) -{ - return dw_window_set_border((HWND)handle, border); -} - -static void go_window_set_focus(void *handle) -{ - dw_window_set_focus((HWND)handle); -} - -static void go_window_set_gravity(void *handle, int horz, int vert) -{ - dw_window_set_gravity((HWND)handle, horz, vert); -} - -static void go_window_set_icon(void *handle, void *icon) -{ - dw_window_set_icon((HWND)handle, (HICN)icon); -} - -static void go_window_set_pointer(void *handle, int cursortype) -{ - dw_window_set_pointer((HWND)handle, cursortype); -} - -static void *go_box_new(int type, int pad) -{ - return (void *)dw_box_new(type, pad); -} - -static void go_box_pack_at_index(void *box, void *item, int index, int width, int height, int hsize, int vsize, int pad) -{ - dw_box_pack_at_index((HWND)box, (HWND)item, index, width, height, hsize, vsize, pad); -} - -static void go_box_pack_end(void *box, void *item, int width, int height, int hsize, int vsize, int pad) -{ - dw_box_pack_end((HWND)box, (HWND)item, width, height, hsize, vsize, pad); -} - -static void go_box_pack_start(void *box, void *item, int width, int height, int hsize, int vsize, int pad) -{ - dw_box_pack_start((HWND)box, (HWND)item, width, height, hsize, vsize, pad); -} - -static int go_box_unpack(void *handle) -{ - return dw_box_unpack((HWND)handle); -} - -static void *go_box_unpack_at_index(void *handle, int index) -{ - return (void *)dw_box_unpack_at_index((HWND)handle, index); -} - -static void *go_text_new(char *text, unsigned long id) -{ - return (void *)dw_text_new(text, id); -} - -static void *go_status_text_new(char *text, unsigned long id) -{ - return (void *)dw_status_text_new(text, id); -} - -static void *go_entryfield_new(char *text, unsigned long id) -{ - return (void *)dw_entryfield_new(text, id); -} - -static void *go_entryfield_password_new(char *text, unsigned long id) -{ - return (void *)dw_entryfield_password_new(text, id); -} - -static void go_entryfield_set_limit(void *handle, int limit) -{ - dw_entryfield_set_limit((HWND)handle, limit); -} - -static void *go_button_new(char *text, unsigned long id) -{ - return (void *)dw_button_new(text, id); -} - -static void *go_menu_new(unsigned long cid) -{ - return (void *)dw_menu_new(cid); -} - -static void *go_menubar_new(void *location) -{ - return (void *)dw_menubar_new((HWND)location); -} - -static void *go_menu_append_item(void *menu, char *title, unsigned long id, unsigned long flags, int end, int check, void *submenu) -{ - return dw_menu_append_item((HMENUI)menu, title, id, flags, end, check, submenu); -} - -static int go_menu_delete_item(void *menu, unsigned long cid) -{ - return dw_menu_delete_item((HMENUI)menu, cid); -} - -static void go_menu_destroy(void *menu) -{ - HMENUI thismenu = (HMENUI)menu; - dw_menu_destroy(&thismenu); -} - -static void go_menu_item_set_state(void *menu, unsigned long cid, unsigned long flags) -{ - dw_menu_item_set_state((HMENUI)menu, cid, flags); -} - -static void go_menu_popup(void *menu, void *parent, int x, int y) -{ - HMENUI thismenu = (HMENUI)menu; - dw_menu_popup(&thismenu, (HWND)parent, x, y); -} - -static void *go_notebook_new(unsigned long cid, int top) -{ - return (void *)dw_notebook_new(cid, top); -} - -static void go_notebook_pack(void *handle, unsigned long pageid, void *page) -{ - dw_notebook_pack((HWND)handle, pageid, (HWND)page); -} - -static void go_notebook_page_destroy(void *handle, unsigned long pageid) -{ - dw_notebook_page_destroy((HWND)handle, (unsigned int)pageid); -} - -static unsigned long go_notebook_page_get(void *handle) -{ - return dw_notebook_page_get((HWND)handle); -} - -static unsigned long go_notebook_page_new(void *handle, unsigned long flags, int front) -{ - return dw_notebook_page_new((HWND)handle, flags, front); -} - -static void go_notebook_page_set(void *handle, unsigned long pageid) -{ - dw_notebook_page_set((HWND)handle, (unsigned int)pageid); -} - -static void go_notebook_page_set_text(void *handle, unsigned long pageid, char *text) -{ - dw_notebook_page_set_text((HWND)handle, pageid, text); -} - -static void *go_icon_load_from_file(char *filename) -{ - return (void *)dw_icon_load_from_file(filename); -} - -static void *go_icon_load(unsigned long module, unsigned long cid) -{ - return (void *)dw_icon_load(module, cid); -} - -static void go_taskbar_delete(void *handle, void *icon) -{ - dw_taskbar_delete((HWND)handle, (HICN)icon); -} - -static void go_taskbar_insert(void *handle, void *icon, char *bubbletext) -{ - dw_taskbar_insert((HWND)handle, (HICN)icon, bubbletext); -} - -static void *go_combobox_new(char *text, unsigned long id) -{ - return (void *)dw_combobox_new(text, id); -} - -static void *go_listbox_new(unsigned long id, int multi) -{ - return (void *)dw_listbox_new(id, multi); -} - -static void go_listbox_append(void *handle, char *text) -{ - dw_listbox_append((HWND)handle, text); -} - -static void go_listbox_list_append(void *handle, char **text, int count) -{ - dw_listbox_list_append((HWND)handle, text, count); -} - -static void go_listbox_insert(void *handle, char *text, int pos) -{ - dw_listbox_insert((HWND)handle, text, pos); -} - -static void go_listbox_clear(void *handle) -{ - dw_listbox_clear((HWND)handle); -} - -static int go_listbox_count(void *handle) -{ - return dw_listbox_count((HWND)handle); -} - -static void go_listbox_set_top(void *handle, int top) -{ - dw_listbox_set_top((HWND)handle, top); -} - -static void go_listbox_select(void *handle, int index, int state) -{ - dw_listbox_select((HWND)handle, index, state); -} - -static void go_listbox_delete(void *handle, int index) -{ - dw_listbox_delete((HWND)handle, index); -} - -static void go_listbox_get_text(void *handle, int index, char *text, int length) -{ - dw_listbox_get_text((HWND)handle, index, text, length); -} - -static void go_listbox_set_text(void *handle, int index, char *text) -{ - dw_listbox_set_text((HWND)handle, index, text); -} - -static int go_listbox_selected(void *handle) -{ - return dw_listbox_selected((HWND)handle); -} - -static int go_listbox_selected_multi(void *handle, int where) -{ - return dw_listbox_selected_multi((HWND)handle, where); -} - -static void *go_spinbutton_new(char *text, unsigned long id) -{ - return (void *)dw_spinbutton_new(text, id); -} - -static void go_spinbutton_set_pos(void *handle, long position) -{ - dw_spinbutton_set_pos((HWND)handle, position); -} -static void go_spinbutton_set_limits(void *handle, long upper, long lower) -{ - dw_spinbutton_set_limits((HWND)handle, upper, lower); -} - -static long go_spinbutton_get_pos(void *handle) -{ - return dw_spinbutton_get_pos((HWND)handle); -} - -static void *go_radiobutton_new(char *text, unsigned long id) -{ - return (void *)dw_radiobutton_new(text, id); -} - -static void *go_checkbox_new(char *text, unsigned long id) -{ - return (void *)dw_checkbox_new(text, id); -} - -static int go_checkbox_get(void *handle) -{ - return dw_checkbox_get((HWND)handle); -} - -static void go_checkbox_set(void *handle, int value) -{ - return dw_checkbox_set((HWND)handle, value); -} - -static void *go_percent_new(unsigned long id) -{ - return (void *)dw_percent_new(id); -} - -static void go_percent_set_pos(void *handle, unsigned int position) -{ - dw_percent_set_pos((HWND)handle, position); -} - -static void *go_slider_new(int vertical, int increments, unsigned long id) -{ - return (void *)dw_slider_new(vertical, increments, id); -} - -static unsigned int go_slider_get_pos(void *handle) -{ - return dw_slider_get_pos((HWND)handle); -} - -static void go_slider_set_pos(void *handle, unsigned int pos) -{ - dw_slider_set_pos((HWND)handle, pos); -} - -static void *go_scrollbar_new(int vertical, unsigned long id) -{ - return (void *)dw_scrollbar_new(vertical, id); -} - -static unsigned int go_scrollbar_get_pos(void *handle) -{ - return dw_scrollbar_get_pos((HWND)handle); -} - -static void go_scrollbar_set_pos(void *handle, unsigned int pos) -{ - dw_scrollbar_set_pos((HWND)handle, pos); -} - -static void go_scrollbar_set_range(void *handle, unsigned int range, unsigned int visible) -{ - dw_scrollbar_set_range((HWND)handle, range, visible); -} - -static void *go_scrollbox_new(int type, int pad) -{ - return (void *)dw_scrollbox_new(type, pad); -} - -static int go_scrollbox_get_pos(void *handle, int orient) -{ - return dw_scrollbox_get_pos((HWND)handle, orient); -} - -static int go_scrollbox_get_range(void *handle, int orient) -{ - return dw_scrollbox_get_range((HWND)handle, orient); -} - -static void *go_groupbox_new(int type, int pad, char *title) -{ - return (void *)dw_groupbox_new(type, pad, title); -} - -static void *go_render_new(unsigned long id) -{ - return (void *)dw_render_new(id); -} - -static void go_font_text_extents_get(void *handle, void *pixmap, char *text, int *width, int *height) -{ - dw_font_text_extents_get((HWND)handle, (HPIXMAP)pixmap, text, width, height); -} - -static void *go_pixmap_new(void *handle, unsigned long width, unsigned long height, unsigned long depth) -{ - return (void *)dw_pixmap_new((HWND)handle, width, height, (int)depth); -} - -static void *go_pixmap_new_from_file(void *handle, char *filename) -{ - return (void *)dw_pixmap_new_from_file((HWND)handle, filename); -} - -static void *go_pixmap_grab(void *handle, unsigned long cid) -{ - return (void *)dw_pixmap_grab((HWND)handle, cid); -} - -static void go_pixmap_bitblt(void *dest, void *destp, int xdest, int ydest, int width, int height, void *src, void *srcp, int xsrc, int ysrc) -{ - dw_pixmap_bitblt((HWND)dest, (HPIXMAP)destp, xdest, ydest, width, height, (HWND)src, (HPIXMAP)srcp, xsrc, ysrc); -} - -static int go_pixmap_stretch_bitblt(void *dest, void *destp, int xdest, int ydest, int width, int height, void *src, void *srcp, int xsrc, int ysrc, int srcwidth, int srcheight) -{ - return dw_pixmap_stretch_bitblt((HWND)dest, (HPIXMAP)destp, xdest, ydest, width, height, (HWND)src, (HPIXMAP)srcp, xsrc, ysrc, srcwidth, srcheight); -} - -static void go_pixmap_set_transparent_color(void *pixmap, unsigned long color) -{ - dw_pixmap_set_transparent_color((HPIXMAP)pixmap, color); -} - -static int go_pixmap_set_font(void *pixmap, char *fontname) -{ - return dw_pixmap_set_font((HPIXMAP)pixmap, fontname); -} - -static void go_pixmap_destroy(void *pixmap) -{ - dw_pixmap_destroy((HPIXMAP)pixmap); -} - -static int go_pixmap_width(void *pixmap) -{ - return (int)DW_PIXMAP_WIDTH(((HPIXMAP)pixmap)); -} - -static int go_pixmap_height(void *pixmap) -{ - return (int)DW_PIXMAP_HEIGHT(((HPIXMAP)pixmap)); -} - -static void go_draw_point(void *handle, void *pixmap, int x, int y) -{ - dw_draw_point((HWND)handle, (HPIXMAP)pixmap, x, y); -} - -static void go_draw_line(void *handle, void *pixmap, int x1, int y1, int x2, int y2) -{ - dw_draw_line((HWND)handle, (HPIXMAP)pixmap, x1, y1, x2, y2); -} - -static void go_draw_polygon(void *handle, void *pixmap, int fill, int count, int x[], int y[]) -{ - dw_draw_polygon((HWND)handle, (HPIXMAP)pixmap, fill, count, x, y); -} - -static void go_draw_rect(void *handle, void *pixmap, int fill, int x, int y, int width, int height) -{ - dw_draw_rect((HWND)handle, (HPIXMAP)pixmap, fill, x, y, width, height); -} - -static void go_draw_arc(void *handle, void *pixmap, int flags, int xorigin, int yorigin, int x1, int y1, int x2, int y2) -{ - dw_draw_arc((HWND)handle, (HPIXMAP)pixmap, flags, xorigin, yorigin, x1, y1, x2, y2); -} - -static void go_draw_text(void *handle, void *pixmap, int x, int y, char *text) -{ - dw_draw_text((HWND)handle, (HPIXMAP)pixmap, x, y, text); -} - -static void *go_tree_new(unsigned long id) -{ - return (void *)dw_tree_new(id); -} - -static void *go_tree_insert(void *handle, char *title, void *icon, void *parent, void *itemdata) -{ - return (void *)dw_tree_insert((HWND)handle, title, (HICN)icon, (HTREEITEM)parent, itemdata); -} - -static void *go_tree_insert_after(void *handle, void *item, char *title, void *icon, void *parent, void *itemdata) -{ - return (void *)dw_tree_insert_after((HWND)handle, (HTREEITEM)item, title, (HICN)icon, (HTREEITEM)parent, itemdata); -} - -static void go_tree_clear(void *handle) -{ - dw_tree_clear((HWND)handle); -} - -static void go_tree_item_delete(void *handle, void *item) -{ - dw_tree_item_delete((HWND)handle, (HTREEITEM)item); -} - -static void go_tree_item_change(void *handle, void *item, char *title, void *icon) -{ - dw_tree_item_change((HWND)handle, (HTREEITEM)item, title, (HICN)icon); -} - -static void go_tree_item_expand(void *handle, void *item) -{ - dw_tree_item_expand((HWND)handle, (HTREEITEM)item); -} - -static void go_tree_item_collapse(void *handle, void *item) -{ - dw_tree_item_collapse((HWND)handle, (HTREEITEM)item); -} - -static void go_tree_item_select(void *handle, void *item) -{ - dw_tree_item_select((HWND)handle, (HTREEITEM)item); -} - -static void go_tree_item_set_data(void *handle, void *item, void *itemdata) -{ - dw_tree_item_set_data((HWND)handle, (HTREEITEM)item, itemdata); -} - -static void *go_tree_item_get_data(void *handle, void *item) -{ - return dw_tree_item_get_data((HWND)handle, (HTREEITEM)item); -} - -static char *go_tree_get_title(void *handle, void *item) -{ - return dw_tree_get_title((HWND)handle, (HTREEITEM)item); -} - -static void *go_html_new(unsigned long id) -{ - return (void *)dw_html_new(id); -} - - -static void go_html_action(void *hwnd, int action) -{ - dw_html_action((HWND)hwnd, action); -} - -static int go_html_raw(void *hwnd, char *string) -{ - return dw_html_raw((HWND)hwnd, string); -} - -static int go_html_url(void *hwnd, char *url) -{ - return dw_html_url((HWND)hwnd, url); -} - -static void *go_mle_new(unsigned long id) -{ - return (void *)dw_mle_new(id); -} - -static unsigned int go_mle_import(void *handle, char *buffer, int startpoint) -{ - return dw_mle_import((HWND)handle, buffer, startpoint); -} - -static void go_mle_export(void *handle, char *buffer, int startpoint, int length) -{ - dw_mle_export((HWND)handle, buffer, startpoint, length); -} - -static void go_mle_get_size(void *handle, unsigned long *bytes, unsigned long *lines) -{ - dw_mle_get_size((HWND)handle, bytes, lines); -} - -static void go_mle_delete(void *handle, int startpoint, int length) -{ - dw_mle_delete((HWND)handle, startpoint, length); -} - -static void go_mle_clear(void *handle) -{ - dw_mle_clear((HWND)handle); -} - -static void go_mle_freeze(void *handle) -{ - dw_mle_freeze((HWND)handle); -} - -static void go_mle_thaw(void *handle) -{ - dw_mle_thaw((HWND)handle); -} - -static void go_mle_set_cursor(void *handle, int point) -{ - dw_mle_set_cursor((HWND)handle, point); -} - -static void go_mle_set_visible(void *handle, int line) -{ - dw_mle_set_visible((HWND)handle, line); -} - -static void go_mle_set_editable(void *handle, int state) -{ - dw_mle_set_editable((HWND)handle, state); -} - -static void go_mle_set_word_wrap(void *handle, int state) -{ - dw_mle_set_word_wrap((HWND)handle, state); -} - -static int go_mle_search(void *handle, char *text, int point, unsigned long flags) -{ - return dw_mle_search((HWND)handle, text, point, flags); -} - -static void *go_container_new(unsigned long id, int multi) -{ - return (void *)dw_container_new(id, multi); -} - -static char **go_string_array_make(int size) -{ - return calloc(sizeof(char*), size); -} - -static void go_string_array_set(char **a, char *s, int n) -{ - a[n] = s; -} - -static void go_string_array_free(char **a, int size) -{ - int x; - - for(x = 0; x < size; x++) - free(a[x]); - free(a); -} - -static int go_container_setup(void *handle, unsigned long *flags, char **titles, int count, int separator) -{ - return dw_container_setup((HWND)handle, flags, titles, count, separator); -} - -static void * go_container_alloc(void *handle, int rowcount) -{ - return dw_container_alloc((HWND)handle, rowcount); -} - -static void go_container_set_item(void *handle, void *pointer, int column, int row, void *data) -{ - dw_container_set_item((HWND)handle, pointer, column, row, data); -} - -static void go_container_set_item_ulong(void *handle, void *pointer, int column, int row, unsigned long val) -{ - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_ULONG) - dw_container_set_item((HWND)handle, pointer, column, row, &val); -} - -static void go_container_set_item_icon(void *handle, void *pointer, int column, int row, void *icon) -{ - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) - dw_container_set_item((HWND)handle, pointer, column, row, &icon); -} - -static void go_container_set_item_time(void *handle, void *pointer, int column, int row, int seconds, int minutes, int hours) -{ - CTIME time; - - time.seconds = seconds; - time.minutes = minutes; - time.hours = hours; - - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_TIME) - dw_container_set_item((HWND)handle, pointer, column, row, &time); -} - -static void go_container_set_item_date(void *handle, void *pointer, int column, int row, int day, int month, int year) -{ - CDATE date; - - date.day = day; - date.month = month; - date.year = year; - - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_DATE) - dw_container_set_item((HWND)handle, pointer, column, row, &date); -} - -static void go_container_change_item(void *handle, int column, int row, void *data) -{ - dw_container_change_item((HWND)handle, column, row, data); -} - -static void go_container_change_item_ulong(void *handle, int column, int row, unsigned long val) -{ - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_ULONG) - dw_container_change_item((HWND)handle, column, row, &val); -} - -static void go_container_change_item_icon(void *handle, int column, int row, void *icon) -{ - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) - dw_container_change_item((HWND)handle, column, row, &icon); -} - -static void go_container_change_item_time(void *handle, int column, int row, int seconds, int minutes, int hours) -{ - CTIME time; - - time.seconds = seconds; - time.minutes = minutes; - time.hours = hours; - - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_TIME) - dw_container_change_item((HWND)handle, column, row, &time); -} - -static void go_container_change_item_date(void *handle, int column, int row, int day, int month, int year) -{ - CDATE date; - - date.day = day; - date.month = month; - date.year = year; - - if(dw_container_get_column_type((HWND)handle, column) == DW_CFA_DATE) - dw_container_change_item((HWND)handle, column, row, &date); -} - -static void go_container_set_column_width(void *handle, int column, int width) -{ - dw_container_set_column_width((HWND)handle, column, width); -} - -static void go_container_change_row_title(void *handle, int row, char *title) -{ - dw_container_change_row_title((HWND)handle, row, title); -} - -static void go_container_change_row_data(void *handle, int row, void *data) -{ - dw_container_change_row_title((HWND)handle, row, (char *)data); -} - -static void go_container_insert(void *handle, void *pointer, int rowcount) -{ - dw_container_insert((HWND)handle, pointer, rowcount); -} - -static void go_container_clear(void *handle, int redraw) -{ - dw_container_clear((HWND)handle, redraw); -} - -static void go_container_delete(void *handle, int rowcount) -{ - dw_container_delete((HWND)handle, rowcount); -} - -static char *go_container_query_start(void *handle, unsigned long flags) -{ - return dw_container_query_start((HWND)handle, flags); -} - -static char *go_container_query_next(void *handle, unsigned long flags) -{ - return dw_container_query_next((HWND)handle, flags); -} - -static void go_container_scroll(void *handle, int direction, long rows) -{ - dw_container_scroll((HWND)handle, direction, rows); -} - -static void go_container_cursor(void *handle, char *text) -{ - dw_container_cursor((HWND)handle, text); -} - -static void go_container_cursor_by_data(void *handle, void *data) -{ - dw_container_cursor_by_data((HWND)handle, data); -} - -static void go_container_delete_row(void *handle, char *text) -{ - dw_container_delete_row((HWND)handle, text); -} - -static void go_container_delete_row_by_data(void *handle, void *data) -{ - dw_container_delete_row_by_data((HWND)handle, data); -} - -static void go_container_optimize(void *handle) -{ - dw_container_optimize((HWND)handle); -} - -static void go_container_set_stripe(void *handle, unsigned long oddcolor, unsigned long evencolor) -{ - dw_container_set_stripe((HWND)handle, oddcolor, evencolor); -} - -static void go_filesystem_set_column_title(void *handle, char *title) -{ - dw_filesystem_set_column_title((HWND)handle, title); -} - -static int go_filesystem_setup(void *handle, unsigned long *flags, char **titles, int count) -{ - return dw_filesystem_setup((HWND)handle, flags, titles, count); -} - -static void go_filesystem_set_item(void *handle, void *pointer, int column, int row, void *data) -{ - dw_filesystem_set_item((HWND)handle, pointer, column, row, data); -} - -static void go_filesystem_set_item_ulong(void *handle, void *pointer, int column, int row, unsigned long val) -{ - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_ULONG) - dw_filesystem_set_item((HWND)handle, pointer, column, row, &val); -} - -static void go_filesystem_set_item_icon(void *handle, void *pointer, int column, int row, void *icon) -{ - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) - dw_filesystem_set_item((HWND)handle, pointer, column, row, &icon); -} - -static void go_filesystem_set_item_time(void *handle, void *pointer, int column, int row, int seconds, int minutes, int hours) -{ - CTIME time; - - time.seconds = seconds; - time.minutes = minutes; - time.hours = hours; - - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_TIME) - dw_filesystem_set_item((HWND)handle, pointer, column, row, &time); -} - -static void go_filesystem_set_item_date(void *handle, void *pointer, int column, int row, int day, int month, int year) -{ - CDATE date; - - date.day = day; - date.month = month; - date.year = year; - - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_DATE) - dw_filesystem_set_item((HWND)handle, pointer, column, row, &date); -} - -static void go_filesystem_set_file(void *handle, void *pointer, int row, char *filename, void *icon) -{ - dw_filesystem_set_file((HWND)handle, pointer, row, filename, (HICN)icon); -} - -static void go_filesystem_change_item(void *handle, int column, int row, void *data) -{ - dw_filesystem_change_item((HWND)handle, column, row, data); -} - -static void go_filesystem_change_item_ulong(void *handle, int column, int row, unsigned long val) -{ - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_ULONG) - dw_filesystem_change_item((HWND)handle, column, row, &val); -} - -static void go_filesystem_change_item_icon(void *handle, int column, int row, void *icon) -{ - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_BITMAPORICON) - dw_filesystem_change_item((HWND)handle, column, row, &icon); -} - -static void go_filesystem_change_item_time(void *handle, int column, int row, int seconds, int minutes, int hours) -{ - CTIME time; - - time.seconds = seconds; - time.minutes = minutes; - time.hours = hours; - - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_TIME) - dw_filesystem_change_item((HWND)handle, column, row, &time); -} - -static void go_filesystem_change_item_date(void *handle, int column, int row, int day, int month, int year) -{ - CDATE date; - - date.day = day; - date.month = month; - date.year = year; - - if(dw_filesystem_get_column_type((HWND)handle, column) == DW_CFA_DATE) - dw_filesystem_change_item((HWND)handle, column, row, &date); -} - -static void go_filesystem_change_file(void *handle, int row, char *filename, void *icon) -{ - dw_filesystem_change_file((HWND)handle, row, filename, (HICN)icon); -} - -static int go_container_get_column_type(void *handle, int column) -{ - return dw_container_get_column_type((HWND)handle, column); -} -static int go_filesystem_get_column_type(void *handle, int column) -{ - return dw_filesystem_get_column_type((HWND)handle, column); -} - -static void *go_calendar_new(unsigned long id) -{ - return (void *)dw_calendar_new(id); -} - -static void go_calendar_set_date(void *handle, unsigned int year, unsigned int month, unsigned int day) -{ - dw_calendar_set_date((HWND)handle, year, month, day); -} - -static void go_calendar_get_date(void *handle, unsigned int *year, unsigned int *month, unsigned int *day) -{ - dw_calendar_get_date((HWND)handle, year, month, day); -} - -static void *go_bitmap_new(unsigned long id) -{ - return (void *)dw_bitmap_new(id); -} - -static void *go_bitmapbutton_new(char *text, unsigned long id) -{ - return (void *)dw_bitmapbutton_new(text, id); -} - -static void *go_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename) -{ - return (void *)dw_bitmapbutton_new_from_file(text, id, filename); -} - -static void *go_splitbar_new(int type, void *topleft, void *bottomright, unsigned long cid) -{ - return (void *)dw_splitbar_new(type, (HWND)topleft, (HWND)bottomright, cid); -} - -static void go_splitbar_set(void *handle, float position) -{ - dw_splitbar_set((HWND)handle, position); -} - -static float go_splitbar_get(void *handle) -{ - return dw_splitbar_get((HWND)handle); -} - -static int go_print_run(void *print, unsigned long flags) -{ - return dw_print_run((HPRINT)print, flags); -} - -static void go_print_cancel(void *print) -{ - return dw_print_cancel((HPRINT)print); -} - -static void *go_mutex_new(void) -{ - return (void *)dw_mutex_new(); -} - -static void go_mutex_close(void *mutex) -{ - dw_mutex_close((HMTX)mutex); -} - -static void go_mutex_lock(void *mutex) -{ - dw_mutex_lock((HMTX)mutex); -} - -static void go_mutex_unlock(void *mutex) -{ - dw_mutex_unlock((HMTX)mutex); -} - -static int go_mutex_trylock(void *mutex) -{ - return dw_mutex_trylock((HMTX)mutex); -} - -static void *go_dialog_new(void) -{ - return (void *)dw_dialog_new(NULL); -} - -static int go_dialog_dismiss(void *dialog, void *result) -{ - return dw_dialog_dismiss((DWDialog *)dialog, result); -} - -static void *go_dialog_wait(void *dialog) -{ - return (void *)dw_dialog_wait((DWDialog *)dialog); -} - -static void *go_event_new(void) -{ - return (void *)dw_event_new(); -} - -static int go_event_close(void *event) -{ - HEV thisevent = (HEV)event; - return dw_event_close(&thisevent); -} - -static int go_event_post(void *event) -{ - return dw_event_post((HEV)event); -} - -static int go_event_reset(void *event) -{ - return dw_event_reset((HEV)event); -} - -static int go_event_wait(void *event, unsigned long timeout) -{ - return dw_event_wait((HEV)event, timeout); -} - -extern int go_int_callback_basic(void *pfunc, void* window, void *data, unsigned int flags); -extern int go_int_callback_configure(void *pfunc, void* window, int width, int height, void *data, unsigned int flags); -extern int go_int_callback_keypress(void *pfunc, void *window, char ch, int vk, int state, void *data, char *utf8, unsigned int flags); -extern int go_int_callback_mouse(void *pfunc, void* window, int x, int y, int mask, void *data, unsigned int flags); -extern int go_int_callback_expose(void *pfunc, void* window, int x, int y, int width, int height, void *data, unsigned int flags); -extern int go_int_callback_item_enter(void *pfunc, void *window, char *text, void *data, void *itemdata, unsigned int flags); -extern int go_int_callback_item_context(void *pfunc, void *window, char *text, int x, int y, void *data, void *itemdata, unsigned int flags); -extern int go_int_callback_item_select(void *pfunc, void *window, void *item, char *text, void *data, void *itemdata, unsigned int flags); -extern int go_int_callback_numeric(void *pfunc, void* window, int val, void *data, unsigned int flags); -extern int go_int_callback_ulong(void *pfunc, void* window, unsigned long val, void *data, unsigned int flags); -extern int go_int_callback_notepage(void *pfunc, void* window, unsigned long val, void *data, unsigned int flags); -extern int go_int_callback_tree(void *pfunc, void* window, void *item, void *data, unsigned int flags); -extern int go_int_callback_timer(void *pfunc, void *data, unsigned int flags); -extern int go_int_callback_print(void *pfunc, void *print, void *pixmap, int page_num, void *data, unsigned int flags); -extern void go_callback_remove(void *pfunc); - -static int DWSIGNAL go_callback_basic(HWND window, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_basic(param[0], (void *)window, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_configure(HWND window, int width, int height, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_configure(param[0], (void *)window, width, height, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_keypress(HWND window, char ch, int vk, int state, void *data, char *utf8) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_keypress(param[0], (void *)window, ch, vk, state, param[1], utf8, DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_mouse(HWND window, int x, int y, int mask, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_mouse(param[0], (void *)window, x, y, mask, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_expose(HWND window, DWExpose *exp, void *data) -{ - if(data && exp) - { - void **param = (void **)data; - return go_int_callback_expose(param[0], (void *)window, exp->x, exp->y, exp->width, exp->height, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_item_enter(HWND window, char *text, void *data, void *itemdata) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_item_enter(param[0], (void *)window, text, param[1], itemdata, DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_item_context(HWND window, char *text, int x, int y, void *data, void *itemdata) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_item_context(param[0], (void *)window, text, x, y, param[1], itemdata, DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_item_select(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_item_select(param[0], (void *)window, (void *)item, text, param[1], itemdata, DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_numeric(HWND window, int val, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_numeric(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -/*static int DWSIGNAL go_callback_ulong(HWND window, unsigned long val, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_ulong(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -}*/ - -static int DWSIGNAL go_callback_notepage(HWND window, unsigned long val, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_notepage(param[0], (void *)window, val, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_tree(HWND window, HTREEITEM tree, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_tree(param[0], (void *)window, (void *)tree, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_timer(void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_timer(param[0], param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static int DWSIGNAL go_callback_print(HPRINT print, HPIXMAP pixmap, int page_num, void *data) -{ - if(data) - { - void **param = (void **)data; - return go_int_callback_print(param[0], (void *)print, (void *)pixmap, page_num, param[1], DW_POINTER_TO_INT(param[2])); - } - return 0; -} - -static void *go_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata, unsigned int sflags) -{ - void **param = malloc(sizeof(void *) * 3); - - if(param && drawfunc) - { - param[0] = drawfunc; - param[1] = drawdata; - param[2] = DW_UINT_TO_POINTER(sflags); - return (void*)dw_print_new(jobname, flags, pages, DW_SIGNAL_FUNC(go_callback_print), param); - } - return NULL; -} - -static int go_timer_connect(int interval, void *sigfunc, void *data, unsigned int flags) -{ - void **param = malloc(sizeof(void *) * 3); - - if(param && sigfunc) - { - param[0] = sigfunc; - param[1] = data; - param[2] = DW_UINT_TO_POINTER(flags); - return dw_timer_connect(interval, DW_SIGNAL_FUNC(go_callback_timer), param); - } - return 0; -} - -static void DWSIGNAL go_signal_free(HWND window, void *data) -{ - if(data) - { - void **param = (void **)data; - go_callback_remove(param[0]); - free(data); - } -} - -static void go_signal_connect(void *window, char *signame, void *sigfunc, void *data, unsigned int flags) -{ - void **param = malloc(sizeof(void *) * 3); - void *func = (void *)go_callback_basic; - - if(param && sigfunc) - { - param[0] = sigfunc; - param[1] = data; - param[2] = DW_UINT_TO_POINTER(flags); - - if(strcmp(signame, DW_SIGNAL_CONFIGURE) == 0) - { - func = (void *)go_callback_configure; - } - else if(strcmp(signame, DW_SIGNAL_KEY_PRESS) == 0) - { - func = (void *)go_callback_keypress; - } - else if(strcmp(signame, DW_SIGNAL_BUTTON_PRESS) == 0 || - strcmp(signame, DW_SIGNAL_BUTTON_RELEASE) == 0 || - strcmp(signame, DW_SIGNAL_MOTION_NOTIFY) == 0) - { - func = (void *)go_callback_mouse; - } - else if(strcmp(signame, DW_SIGNAL_EXPOSE) == 0) - { - func = (void *)go_callback_expose; - } - else if(strcmp(signame, DW_SIGNAL_ITEM_ENTER) == 0) - { - func = (void *)go_callback_item_enter; - } - else if(strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) - { - func = (void *)go_callback_item_context; - } - else if(strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) - { - func = (void *)go_callback_item_select; - } - else if(strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0 || - strcmp(signame, DW_SIGNAL_VALUE_CHANGED) == 0 || - strcmp(signame, DW_SIGNAL_COLUMN_CLICK) == 0) - { - func = (void *)go_callback_numeric; - } - else if(strcmp(signame, DW_SIGNAL_SWITCH_PAGE) == 0) - { - func = (void *)go_callback_notepage; - } - else if(strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) - { - func = (void *)go_callback_tree; - } - - dw_signal_connect_data((HWND)window, signame, func, DW_SIGNAL_FUNC(go_signal_free), param); - } -}
--- a/src/dwib/dwib.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -package dwib - -/* -#cgo linux pkg-config: dwib dwindows libxml-2.0 -#cgo freebsd pkg-config: dwib dwindows libxml-2.0 -#cgo darwin CFLAGS: -I/usr/local/include -g -O2 -D__MAC__ -#cgo darwin LDFLAGS: -L/usr/local/lib -ldwindows -ldwib -lresolv -framework Cocoa -framework WebKit -lpthread -#cgo windows CFLAGS: -IC:/Work/BitBucket/dwindows -IC:/Work/BitBucket/dwib -g -O2 -D__WIN32__ -mthreads -#cgo windows LDFLAGS: -LC:/Work/BitBucket/dwindows -ldw -LC:/Work/BitBucket/dwib -ldwib -#include "dwibglue.c" -*/ -import "C" -import "unsafe" -import "dw" - -type DWIB unsafe.Pointer - -// Loads a window with the specified name from an XML tree. -func Load(handle DWIB, name string) dw.HWND { - cname := C.CString(name); - defer C.free(unsafe.Pointer(cname)); - - return dw.HANDLE_TO_HWND(dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_load(unsafe.Pointer(handle), cname)))); -} - -// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index. -func Load_at_index(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int { - cname := C.CString(name); - defer C.free(unsafe.Pointer(cname)); - cdataname := C.CString(dataname); - defer C.free(unsafe.Pointer(cdataname)); - - return int(C.goib_load_at_index(unsafe.Pointer(handle), cname, cdataname, unsafe.Pointer(dw.HANDLE_TO_POINTER(window)), unsafe.Pointer(dw.HANDLE_TO_POINTER(box)), C.int(index))); -} - -// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index. -func LoadAtIndex(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int { - return Load_at_index(handle, name, dataname, window, box, index); -} - -// Shows a window loaded with dwib.Load() using the stored settings. -func Show(handle dw.HANDLE) { - C.goib_show(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle))); -} - -// Loads an XML templates and returns a handle to the XML tree. -func Open(filename string) DWIB { - cfilename := C.CString(filename); - defer C.free(unsafe.Pointer(cfilename)); - - return DWIB(C.goib_open(cfilename)); -} - -// Closes a handle to an XML tree returned by dwib.Open*() and frees the memory associated with the tree. -func Close(handle DWIB) { - C.goib_close(unsafe.Pointer(handle)); -} - -// Update the location of the image root for locating image files. -func Image_root_set(path string) int { - cpath := C.CString(path); - defer C.free(unsafe.Pointer(cpath)); - - return int(C.goib_image_root_set(cpath)); -} - -// Update the location of the image root for locating image files. -func ImageRootSet(path string) int { - return Image_root_set(path); -} - -// Update the locale used when identifying locating strings during creation. -func Locale_set(loc string) int { - cloc := C.CString(loc); - defer C.free(unsafe.Pointer(cloc)); - - return int(C.goib_locale_set(cloc)); -} - -// Update the locale used when identifying locating strings during creation. -func LocaleSet(loc string) int { - return Locale_set(loc); -} - -// Gets the window handle for a named widget. -func Window_get_handle(handle dw.HANDLE, dataname string) dw.HANDLE { - cdataname := C.CString(dataname); - defer C.free(unsafe.Pointer(cdataname)); - - return dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_window_get_handle(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle)), cdataname))); -} - -// Gets the window handle for a named widget. -func GetHandle(handle dw.HANDLE, dataname string) dw.HANDLE { - return Window_get_handle(handle, dataname); -} - -
--- a/src/dwib/dwibglue.c Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -#include <dwib.h> -#include <stdlib.h> -#include <string.h> - -static void *goib_load(void *handle, char *name) -{ - return (void *)dwib_load((DWIB)handle, name); -} - -static int goib_load_at_index(void *handle, char *name, char *dataname, void *window, void *box, int index) -{ - return dwib_load_at_index((DWIB)handle, name, dataname, (HWND)window, (HWND)box, index); -} - -static void goib_show(void *window) -{ - dwib_show((HWND)window); -} - -static void *goib_open(char *filename) -{ - return (void *)dwib_open(filename); -} - -static void goib_close(void *handle) -{ - dwib_close((DWIB)handle); -} - -static int goib_image_root_set(char *path) -{ - return dwib_image_root_set(path); -} - -static int goib_locale_set(char *loc) -{ - return dwib_locale_set(loc); -} - -static void *goib_window_get_handle(void *handle, char *dataname) -{ - return (void *)dwib_window_get_handle((HWND)handle, dataname); -}
--- a/src/dwibtest/dwibtest.exe.x64.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="AMD64" - name="dwibtest" - type="win32" -/> -<description>Dynamic Windows Interface Builder Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="AMD64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwibtest/dwibtest.exe.x86.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="X86" - name="dwibtest" - type="win32" -/> -<description>Dynamic Windows Interface Builder Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwibtest/dwibtest.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -package main - -import ( - "dw" - "dwib" - "fmt" - "go/build" -) - -// Global variables -const ( - FALSE int = iota - TRUE -) - -var APP_NAME = "DWIB Example" -var SRCROOT string - -/* Handle exiting the application */ -func exit_handler() int { - if dw.MessageBox(APP_NAME, dw.MB_YESNO | dw.MB_QUESTION, "Are you sure you want to exit?") == dw.MB_RETURN_YES { - /* Exit the application cleanly */ - dw.MainQuit(); - } - return TRUE; -} - -var exit_handler_func = exit_handler; - -func main() { - /* Locate the source root of the package */ - pkg, err := build.Import("dwibtest", "", build.FindOnly); - if err == nil && len(pkg.SrcRoot) > 0 { - SRCROOT = fmt.Sprintf("%s/dwibtest", pkg.SrcRoot); - } - - /* Initialize Dynamic Windows */ - dw.Init(TRUE); - - /* Load the interface XML file */ - handle := dwib.Open("example.xml"); - if handle == nil && len(SRCROOT) > 0 { - handle = dwib.Open(fmt.Sprintf("%s/example.xml", SRCROOT)); - } - - /* Show an error if it fails to load */ - if handle == nil { - dw.MessageBox(APP_NAME, dw.MB_OK | dw.MB_ERROR, "Unable to load the interface XML."); - return; - } - - /* Create the loading window... */ - window := dwib.Load(handle, "Test"); - dwib.Show(window); - - /* Connect the signal handlers */ - window.ConnectDelete(func(window dw.HWND) int { return exit_handler(); }); - /* Handler for Mac application menu Quit */ - dw.DESKTOP.ConnectDelete(func(window dw.HWND) int { return exit_handler(); }); - quitmenu := dw.HANDLE_TO_HMENUITEM(dwib.GetHandle(window, "quitmenu")); - quitmenu.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler(); }); - - dw.Main(); - - /* Destroy the main window */ - window.Destroy(); - /* Close the Interface Builder XML */ - dwib.Close(handle); - - /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ - dw.Shutdown(); - return; -} -
--- a/src/dwibtest/dwibtest.rc Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include "winuser.h" -#ifdef DW64 -1 RT_MANIFEST dwibtest.exe.x64.manifest -#else -1 RT_MANIFEST dwibtest.exe.x86.manifest -#endif \ No newline at end of file
--- a/src/dwibtest/example.xml Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,817 +0,0 @@ -<?xml version="1.0"?> -<DynamicWindows> - <Window><Children><Notebook><Children><NotebookPage><Children><Tree><dataname>tree</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><tooltip/><macfont>Default</macfont><winfont>Default</winfont></Tree><Text>Status<subtype>Status</subtype><dataname/><width>1</width><height>-1</height><hexpand>1</hexpand><vexpand>0</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><label de_DE="Dies ist ein Status-Feld." da_DK="Det er en status felt.">This is a status field.</label><alignment>Left</alignment><valignment>Top</valignment><macfont>Default</macfont><winfont>Default</winfont></Text></Children><title de_DE="Baum">Tree</title><statustext/><orientation>Vertical</orientation></NotebookPage><NotebookPage><Children><HTML><dataname/><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><URL>http://dbsoft.org</URL><macfont>Default</macfont></HTML><Combobox><dataname>combobox</dataname><width>1</width><height>25</height><hexpand>1</hexpand><vexpand>0</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><deftext/><List><Item de_DE="Artikel 1">Item 1</Item><Item de_DE="Artikel 2">Item 2</Item></List><tooltip/><winfont>Default</winfont><macfont>Default</macfont><clickdefault></clickdefault></Combobox></Children><title>HTML</title><statustext/><orientation>Vertical</orientation></NotebookPage><NotebookPage><Children><Container>Filesystem<dataname>filesystem</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>1</multi><subtype>Filesystem</subtype><tooltip/><winfont>Default</winfont><idstring>0</idstring><oddcolor>None</oddcolor><evencolor>None</evencolor><splitcol>None</splitcol><Columns><Item ColType="Number" ColAlign="Left" de_DE="Größe" da_DK="Størrelse">Size</Item><Item ColType="Date" ColAlign="Left" da_DK="Dato" de_DE="Datum">Date</Item><Item ColType="String" ColAlign="Left"></Item></Columns><macfont>Default</macfont><coltitle de_DE="Dateiname" da_DK="Filnavn">Filename</coltitle></Container></Children><title>Container</title><statustext/><orientation>Horizontal</orientation></NotebookPage><NotebookPage><Children><Box>Splitbar<Children><Listbox><dataname>hellogoodbye</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>0</multi><List><Item de_DE="Hallo" da_DK="Hej">Hello</Item><Item da_DK="Farvel" de_DE="Auf Wiedersehen">Goodbye</Item></List><tooltip/><macfont>Default</macfont></Listbox><Container>None<subtype>None</subtype><dataname>greetingdeparting</dataname><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><multi>1</multi><Columns><Item ColType="String" ColAlign="Left" de_DE="Gruß" da_DK="Hilsen">Greeting</Item><Item ColType="String" ColAlign="Right" de_DE="Abfahrt" da_DK="Afrejse">Departing</Item><Item ColType="String" ColAlign="Left"></Item></Columns><tooltip/><macfont>Default</macfont><coltitle/><idstring>0</idstring><oddcolor>None</oddcolor><evencolor>None</evencolor><splitcol>None</splitcol></Container></Children><subtype>Splitbar</subtype><dataname/><width>1</width><height>1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><orientation>Horizontal</orientation><title/><splitper>50</splitper><winfont>Default</winfont></Box></Children><title>Splitbar</title><statustext/><orientation>Horizontal</orientation></NotebookPage><NotebookPage><Children><Bitmap><dataname/><width>-1</width><height>-1</height><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><enabled>1</enabled><tooltip/><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><winfont>Default</winfont><setting>300 - SunLightLogo.png</setting><macfont>Default</macfont></Bitmap></Children><title>Bitmap</title><statustext/><orientation>Horizontal</orientation></NotebookPage></Children><dataname/><hexpand>1</hexpand><vexpand>1</vexpand><padding>0</padding><fcolor>Default</fcolor><bcolor>Default</bcolor><font>Default</font><position>Top</position><width>1</width><height>1</height><enabled>1</enabled></Notebook><Menu><Children><Menu><Children/><title da_DK="Åbent" de_DE="Öffnen">Open</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title de_DE="Beenden">Quit</title><dataname>quitmenu</dataname><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children><Menu><Children/><title de_DE="Dies wird im Folgenden als" da_DK="Det vil være under">This will be below</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title/><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled></Menu><Menu><Children/><title de_DE="Zweite unten" da_DK="Anden nedenfor">Second below</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title>Test Submenu</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title de_DE="Datei" da_DK="Fil">File</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid><title_da_DK>Fil</title_da_DK></Menu><Menu><Children><Menu><Children/><title de_DE="Aktiviert" da_DK="Aktiveret">Enabled</title><dataname/><checkable>1</checkable><checked>1</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title/><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled></Menu><Menu><Children/><title de_DE="Schneiden" da_DK="Klip">Cut</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title de_DE="Kopie" da_DK="Kopier">Copy</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu><Menu><Children/><title da_DK="Indsæt">Paste</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><title_da_DK>Indsæt</title_da_DK><menuid>0</menuid></Menu></Children><title de_DE="Edieren" da_DK="Rediger">Edit</title><dataname/><checkable>0</checkable><checked>0</checked><enabled>1</enabled><menuid>0</menuid></Menu></Children><title de_DE="Versuch" da_DK="Prøve">Test</title><width>600</width><height>500</height><x>100</x><y>100</y><bordersize>-1</bordersize><close>1</close><minimize>1</minimize><maximize>1</maximize><hide>0</hide><resize>1</resize><dialog>0</dialog><border>0</border><sysmenu>1</sysmenu><tasklist>1</tasklist><orientation>Horizontal</orientation><titlebar>1</titlebar><center>0</center><hgravity>Left</hgravity><vgravity>Top</vgravity><hobstacles>0</hobstacles><vobstacles>0</vobstacles><composited>0</composited><textured>0</textured><default></default></Window> -<ImageRoot/><Image>SunLightLogo.png<ImageID>300</ImageID><Embedded>iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAACXBIWXMAAAsTAAALEwEAmpwY -AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhU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qA -qkZQWH2RG1FPcKG3K/6Gt7o+S8xvAhuvMdyz2gSNxj7BL10i0zIzDJfre/yx/BY3UO0BATO9 -wpxc7xEXnxT/yvyjDOcUha/luXyP3AZZXPuEbDS/RbBtHnAjd2oEQzMDFC/5Zgn9Nn/edVj1 -za6xOGKmCYKtY/+92xUCd36TDDO7ys+WzBNAi5d9kOs1Joej/RYr0NWH/kDz3AbBRdVwql9R -1X0WVr7Ggkn7hMxQthsue6M6NuC2+Fybh76Dh5FiPjiR4+dP5IZF2xcq7yaqxp7wKpTphyHT -X1GUGYx9aAtReFDvKLpl5HTE50zx2bz+/wMA/oxEJE0aGvMAAAAASUVORK5CYII=</Embedded></Image><Locales><de_DE/><da_DK/></Locales></DynamicWindows>
--- a/src/dwibtest/makesyso.bat Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -@echo off -windres -i dwibtest.rc -o dwibtest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 -windres -i dwibtest.rc -o dwibtest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- a/src/dwootest/dwootest.exe.x64.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="AMD64" - name="dwootest" - type="win32" -/> -<description>Dynamic Windows Object Oriented Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="AMD64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwootest/dwootest.exe.x86.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="X86" - name="dwootest" - type="win32" -/> -<description>Dynamic Windows Object Oriented Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwootest/dwootest.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1361 +0,0 @@ -package main - -import ( - "dw" - "fmt" - "os" - "bufio" - "bytes" - "io" - "runtime" - "go/build" -) - -var FIXEDFONT = "10.monospace" - -var mainwindow dw.HWND - -// Page 1 -var current_color dw.COLOR = dw.RGB(100, 100, 100) -var cursor_arrow bool = true -var timerid dw.HTIMER - -// Page 2 -var textbox1, textbox2 dw.HRENDER -var status1, status2 dw.HTEXT -var vscrollbar, hscrollbar dw.HSCROLLBAR -var imagexspin, imageyspin dw.HSPINBUTTON -var imagestretchcheck dw.HBUTTON -var text1pm, text2pm, image dw.HPIXMAP -var font_width = 8 -var font_height = 12 -var rows = 10 -var width1 = 6 -var cols = 80 -var render_type = 0 -var current_row = 0 -var current_col = 0 -var max_linewidth = 0 - -// Page 4 -var mle_point = 0 - -// Page 5 -var iteration = 0; - -// Page 8 -var MAX_WIDGETS = 20 - -// Page 9 -var threadmle dw.HMLE -var startbutton dw.HBUTTON -var mutex dw.HMTX; -var workevent, controlevent dw.HEV -var finished = 0 -var ready = 0 -var mlepos = 0 - -// Miscellaneous -var fileicon, foldericon dw.HICN -var current_file string -var lines []string -var menu_enabled bool = true - -var FOLDER_ICON_NAME string = "folder" -var FILE_ICON_NAME string = "file" -var SRCROOT string - -func read_file() { - var ( - file *os.File - part []byte - prefix bool - length int - err error - ) - - lines = nil; - max_linewidth = 0; - - if file, err = os.Open(current_file); err != nil { - return; - } - reader := bufio.NewReader(file); - buffer := bytes.NewBuffer(make([]byte, 1024)); - buffer.Reset(); - for { - if part, prefix, err = reader.ReadLine(); err != nil { - break; - } - buffer.Write(part); - if !prefix { - lines = append(lines, buffer.String()); - length = len(buffer.String()); - if length > max_linewidth { - max_linewidth = length; - } - buffer.Reset(); - } - } - if err == io.EOF { - err = nil; - } - hscrollbar.SetRange(uint(max_linewidth), uint(cols)); - hscrollbar.SetPos(0); - vscrollbar.SetRange(uint(len(lines)), uint(rows)); - vscrollbar.SetPos(0); -} - -// Call back section -func exit_handler() int { - if dw.MessageBox("dwtest", dw.MB_YESNO | dw.MB_QUESTION, "Are you sure you want to exit?") != 0 { - dw.MainQuit(); - } - return dw.TRUE; -} - -/* When hpma is not NULL we are printing.. so handle things differently */ -func draw_file(row int, col int, nrows int, fheight int, hpma dw.HPIXMAP) { - var hpm dw.HPIXMAP - - if hpma == dw.NOHPIXMAP { - hpm = text2pm; - } else { - hpm = hpma; - } - - if len(current_file) > 0 { - var i int - - dw.ColorForegroundSet(dw.CLR_WHITE); - if hpma == dw.NOHPIXMAP { - text1pm.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, text1pm.GetWidth(), text1pm.GetHeight()); - } - hpm.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, hpm.GetWidth(), hpm.GetHeight()); - - for i = 0; (i < nrows) && (i+row < len(lines)); i++ { - fileline := i + row - 1; - y := i*fheight; - dw.ColorBackgroundSet(dw.COLOR(1 + (fileline % 15))); - dw.ColorForegroundSet(dw.COLOR(fileline % 16)); - if hpma == dw.NOHPIXMAP { - text1pm.DrawText(0, y, fmt.Sprintf("%6.6d", i+row)); - } - thisline := lines[i+row]; - if len(thisline) > col { - hpm.DrawText(0, y, thisline[col:]); - } - } - if hpma == dw.NOHPIXMAP { - text_expose(textbox1, text1pm); - text_expose(textbox2, text2pm); - } - } -} - -/* When hpma is not NULL we are printing.. so handle things differently */ -func draw_shapes(direct int, hpma dw.HPIXMAP) { - var hpm dw.HPIXMAP = dw.NOHPIXMAP - var drawable dw.DRAWABLE = textbox2 - if hpma != dw.NOHPIXMAP { - hpm = hpma; - } else { - hpm = text2pm; - } - if direct != dw.TRUE { - drawable = hpm; - } - - width := hpm.GetWidth(); - height := hpm.GetHeight(); - - x := []int{ 20, 180, 180, 230, 180, 180, 20 }; - y := []int{ 50, 50, 20, 70, 120, 90, 90 }; - - image_x := imagexspin.GetPos(); - image_y := imageyspin.GetPos(); - image_stretch := imagestretchcheck.Get(); - - dw.ColorForegroundSet(dw.CLR_WHITE); - drawable.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, width, height); - dw.ColorForegroundSet(dw.CLR_DARKPINK); - drawable.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 10, 10, width - 20, height - 20); - dw.ColorForegroundSet(dw.CLR_GREEN); - dw.ColorBackgroundSet(dw.CLR_DARKRED); - drawable.DrawText(10, 10, "This should be aligned with the edges."); - dw.ColorForegroundSet(dw.CLR_YELLOW); - drawable.DrawLine(width - 10, 10, 10, height - 10); - dw.ColorForegroundSet(dw.CLR_BLUE); - drawable.DrawPolygon(dw.DRAW_FILL, x, y); - dw.ColorForegroundSet(dw.CLR_BLACK); - drawable.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 80, 80, 80, 40); - dw.ColorForegroundSet(dw.CLR_CYAN); - /* Bottom right corner */ - drawable.DrawArc(0, width - 30, height - 30, width - 10, height - 30, width - 30, height - 10); - /* Top right corner */ - drawable.DrawArc(0, width - 30, 30, width - 30, 10, width - 10, 30); - /* Bottom left corner */ - drawable.DrawArc(0, 30, height - 30, 30, height - 10, 10, height - 30); - /* Full circle in the left top area */ - drawable.DrawArc(dw.DRAW_FULL, 120, 100, 80, 80, 160, 120); - if image != dw.NOHPIXMAP { - if image_stretch == dw.TRUE { - drawable.BitBltStretchPixmap(10, 10, width - 20, height - 20, image, 0, 0, image.GetWidth(), image.GetHeight()); - } else { - drawable.BitBltPixmap(image_x, image_y, image.GetWidth(), image.GetHeight(), image, 0, 0); - } - } - - /* If we aren't drawing direct do a bitblt */ - if direct == dw.FALSE && hpma == dw.NOHPIXMAP { - text_expose(textbox2, text2pm); - } -} - -func update_render() { - switch render_type { - case 0: - draw_shapes(dw.FALSE, dw.NOHPIXMAP); - case 1: - draw_shapes(dw.TRUE, dw.NOHPIXMAP); - case 2: - draw_file(current_row, current_col, rows, font_height, dw.NOHPIXMAP); - } -} - -func print_callback() { - print := dw.PrintNew("DWTest Job"); - print.Connect(func(print dw.HPRINT, pixmap dw.HPIXMAP, page_num int) int { - pixmap.SetFont(FIXEDFONT); - if page_num == 0 { - draw_shapes(dw.FALSE, pixmap); - } else if page_num == 1 { - /* If we have a file to display... */ - if len(current_file) > 0 { - /* Calculate new dimensions */ - _, fheight := pixmap.GetTextExtents("(g"); - nrows := int(pixmap.GetHeight() / fheight); - - /* Do the actual drawing */ - draw_file(0, 0, nrows, fheight, pixmap); - } else { - /* We don't have a file so center an error message on the page */ - var text = "No file currently selected!"; - - /* Get the font size for this printer context... */ - fwidth, fheight := pixmap.GetTextExtents(text); - - posx := int(pixmap.GetWidth() - fwidth)/2; - posy := int(pixmap.GetHeight() - fheight)/2; - - dw.ColorForegroundSet(dw.CLR_BLACK); - dw.ColorBackgroundSet(dw.CLR_WHITE); - pixmap.DrawText(posx, posy, text); - } - } - return dw.TRUE; - }, 0, 2); - print.Run(0); -} - -func context_menu() { - hwndMenu := dw.MenuNew(0); - menuitem := hwndMenu.AppendItem("~Quit", dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - - menuitem.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler(); }); - hwndMenu.AppendItem(dw.MENU_SEPARATOR, dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - menuitem = hwndMenu.AppendItem("~Show Window", dw.MENU_POPUP, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - menuitem.ConnectClicked(func(window dw.HMENUITEM) int { - mainwindow.Show(); - mainwindow.Raise(); - return dw.TRUE; - }); - px, py := dw.PointerGetPos(); - /* Use the toplevel window handle here.... because on the Mac.. - * using the control itself, when a different tab is active - * the control is removed from the window and can no longer - * handle the messages. - */ - hwndMenu.Popup(mainwindow, px, py); -} - -/* This gets called when a part of the graph needs to be repainted. */ -func text_expose(hwnd dw.HRENDER, hpm dw.HPIXMAP) int { - if render_type != 1 { - width := hpm.GetWidth(); - height := hpm.GetHeight(); - - hwnd.BitBltPixmap(0, 0, width, height, hpm, 0, 0); - dw.Flush(); - } else { - update_render(); - } - return dw.TRUE; -} - -func resolve_keyname(vk int) string { - var keyname string = "<unknown>" - - switch vk { - case dw.VK_LBUTTON : keyname = "VK_LBUTTON"; - case dw.VK_RBUTTON : keyname = "VK_RBUTTON"; - case dw.VK_CANCEL : keyname = "VK_CANCEL"; - case dw.VK_MBUTTON : keyname = "VK_MBUTTON"; - case dw.VK_TAB : keyname = "VK_TAB"; - case dw.VK_CLEAR : keyname = "VK_CLEAR"; - case dw.VK_RETURN : keyname = "VK_RETURN"; - case dw.VK_PAUSE : keyname = "VK_PAUSE"; - case dw.VK_CAPITAL : keyname = "VK_CAPITAL"; - case dw.VK_ESCAPE : keyname = "VK_ESCAPE"; - case dw.VK_SPACE : keyname = "VK_SPACE"; - case dw.VK_PRIOR : keyname = "VK_PRIOR"; - case dw.VK_NEXT : keyname = "VK_NEXT"; - case dw.VK_END : keyname = "VK_END"; - case dw.VK_HOME : keyname = "VK_HOME"; - case dw.VK_LEFT : keyname = "VK_LEFT"; - case dw.VK_UP : keyname = "VK_UP"; - case dw.VK_RIGHT : keyname = "VK_RIGHT"; - case dw.VK_DOWN : keyname = "VK_DOWN"; - case dw.VK_SELECT : keyname = "VK_SELECT"; - case dw.VK_PRINT : keyname = "VK_PRINT"; - case dw.VK_EXECUTE : keyname = "VK_EXECUTE"; - case dw.VK_SNAPSHOT: keyname = "VK_SNAPSHOT"; - case dw.VK_INSERT : keyname = "VK_INSERT"; - case dw.VK_DELETE : keyname = "VK_DELETE"; - case dw.VK_HELP : keyname = "VK_HELP"; - case dw.VK_LWIN : keyname = "VK_LWIN"; - case dw.VK_RWIN : keyname = "VK_RWIN"; - case dw.VK_NUMPAD0 : keyname = "VK_NUMPAD0"; - case dw.VK_NUMPAD1 : keyname = "VK_NUMPAD1"; - case dw.VK_NUMPAD2 : keyname = "VK_NUMPAD2"; - case dw.VK_NUMPAD3 : keyname = "VK_NUMPAD3"; - case dw.VK_NUMPAD4 : keyname = "VK_NUMPAD4"; - case dw.VK_NUMPAD5 : keyname = "VK_NUMPAD5"; - case dw.VK_NUMPAD6 : keyname = "VK_NUMPAD6"; - case dw.VK_NUMPAD7 : keyname = "VK_NUMPAD7"; - case dw.VK_NUMPAD8 : keyname = "VK_NUMPAD8"; - case dw.VK_NUMPAD9 : keyname = "VK_NUMPAD9"; - case dw.VK_MULTIPLY: keyname = "VK_MULTIPLY"; - case dw.VK_ADD : keyname = "VK_ADD"; - case dw.VK_SEPARATOR: keyname = "VK_SEPARATOR"; - case dw.VK_SUBTRACT: keyname = "VK_SUBTRACT"; - case dw.VK_DECIMAL : keyname = "VK_DECIMAL"; - case dw.VK_DIVIDE : keyname = "VK_DIVIDE"; - case dw.VK_F1 : keyname = "VK_F1"; - case dw.VK_F2 : keyname = "VK_F2"; - case dw.VK_F3 : keyname = "VK_F3"; - case dw.VK_F4 : keyname = "VK_F4"; - case dw.VK_F5 : keyname = "VK_F5"; - case dw.VK_F6 : keyname = "VK_F6"; - case dw.VK_F7 : keyname = "VK_F7"; - case dw.VK_F8 : keyname = "VK_F8"; - case dw.VK_F9 : keyname = "VK_F9"; - case dw.VK_F10 : keyname = "VK_F10"; - case dw.VK_F11 : keyname = "VK_F11"; - case dw.VK_F12 : keyname = "VK_F12"; - case dw.VK_F13 : keyname = "VK_F13"; - case dw.VK_F14 : keyname = "VK_F14"; - case dw.VK_F15 : keyname = "VK_F15"; - case dw.VK_F16 : keyname = "VK_F16"; - case dw.VK_F17 : keyname = "VK_F17"; - case dw.VK_F18 : keyname = "VK_F18"; - case dw.VK_F19 : keyname = "VK_F19"; - case dw.VK_F20 : keyname = "VK_F20"; - case dw.VK_F21 : keyname = "VK_F21"; - case dw.VK_F22 : keyname = "VK_F22"; - case dw.VK_F23 : keyname = "VK_F23"; - case dw.VK_F24 : keyname = "VK_F24"; - case dw.VK_NUMLOCK : keyname = "VK_NUMLOCK"; - case dw.VK_SCROLL : keyname = "VK_SCROLL"; - case dw.VK_LSHIFT : keyname = "VK_LSHIFT"; - case dw.VK_RSHIFT : keyname = "VK_RSHIFT"; - case dw.VK_LCONTROL: keyname = "VK_LCONTROL"; - case dw.VK_RCONTROL: keyname = "VK_RCONTROL"; - } - return keyname; -} - -func resolve_keymodifiers(mask int) string { - if (mask & dw.KC_CTRL) == dw.KC_CTRL && (mask & dw.KC_SHIFT) == dw.KC_SHIFT && (mask & dw.KC_ALT) == dw.KC_ALT { - return "KC_CTRL KC_SHIFT KC_ALT"; - } else if (mask & dw.KC_CTRL) == dw.KC_CTRL && (mask & dw.KC_SHIFT) == dw.KC_SHIFT { - return "KC_CTRL KC_SHIFT"; - } else if (mask & dw.KC_CTRL) == dw.KC_CTRL && (mask & dw.KC_ALT) == dw.KC_ALT { - return "KC_CTRL KC_ALT"; - } else if (mask & dw.KC_SHIFT) == dw.KC_SHIFT && (mask & dw.KC_ALT) == dw.KC_ALT { - return "KC_SHIFT KC_ALT"; - } else if (mask & dw.KC_SHIFT) == dw.KC_SHIFT { - return "KC_SHIFT"; - } else if (mask & dw.KC_CTRL) == dw.KC_CTRL { - return "KC_CTRL"; - } else if (mask & dw.KC_ALT) == dw.KC_ALT { - return "KC_ALT"; - } - return "none"; -} - - -func button_callback(combobox1 dw.HLISTBOX, combobox2 dw.HLISTBOX, spinbutton dw.HSPINBUTTON, cal dw.HCALENDAR) { - idx := combobox1.Selected(); - buf1 := combobox1.GetText(idx); - idx = combobox2.Selected(); - buf2 := combobox2.GetText(idx); - y, m, d := cal.GetDate(); - spvalue := spinbutton.GetPos(); - message := fmt.Sprintf("spinbutton: %d\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d", - spvalue, - buf1, buf2, - y, m, d); - dw.MessageBox( "Values", dw.MB_OK | dw.MB_INFORMATION, message); -} - -// Create the menu -func menu_add(mainwindow dw.HWND) { - mainmenubar := mainwindow.MenubarNew(); - /* add menus to the menubar */ - menu := dw.MenuNew(0); - menuitem := menu.AppendItem("~Quit", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - menuitem.ConnectClicked(func(window dw.HMENUITEM) int { return exit_handler(); }); - /* - * Add the "File" menu to the menubar... - */ - mainmenubar.AppendItem("~File", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu); - - changeable_menu := dw.MenuNew(0); - checkable_menuitem := changeable_menu.AppendItem("~Checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU); - checkable_menuitem.ConnectClicked(func(window dw.HMENUITEM) int { dw.MessageBox("Menu Item Callback", dw.MB_OK | dw.MB_INFORMATION, "Checkable menu item selected"); return dw.FALSE }); - - - noncheckable_menuitem := changeable_menu.AppendItem("~Non-checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - noncheckable_menuitem.ConnectClicked(func(window dw.HMENUITEM) int { dw.MessageBox("Menu Item Callback", dw.MB_OK | dw.MB_INFORMATION, "Non-checkable menu item selected"); return dw.FALSE }); - changeable_menu.AppendItem("~Disabled menu Item", dw.MENU_AUTO, dw.MIS_DISABLED | dw.MIS_CHECKED, dw.TRUE, dw.TRUE, dw.NOMENU); - /* seperator */ - changeable_menu.AppendItem(dw.MENU_SEPARATOR, dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - menuitem = changeable_menu.AppendItem("~Menu Items Disabled", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU); - menuitem.ConnectClicked(func(window dw.HMENUITEM) int { - if menu_enabled { - checkable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_DISABLED); - noncheckable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_DISABLED); - menu_enabled = false; - } else { - checkable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_ENABLED); - noncheckable_menuitem.SetStyle(dw.MIS_DISABLED, dw.MIS_ENABLED); - menu_enabled = true; - } - return dw.FALSE; - }); - - - /* - * Add the "Menu" menu to the menubar... - */ - mainmenubar.AppendItem("~Menu", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, changeable_menu); - - menu = dw.MenuNew(0); - menuitem = menu.AppendItem("~About", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU); - menuitem.ConnectClicked(func(window dw.HMENUITEM) int { - env := dw.EnvironmentGet(); - message := fmt.Sprintf("dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\ndwindows Version: %d.%d.%d", - env.OSName, env.BuildDate, env.BuildTime, - env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild, - env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion); - dw.MessageBox("About dwindows", dw.MB_OK | dw.MB_INFORMATION, message); - return dw.FALSE; - }); - - /* - * Add the "Help" menu to the menubar... - */ - mainmenubar.AppendItem("~Help", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu); -} - -// Create Page 1 -func archive_add(notebookbox1 dw.HBOX) { - lbbox := dw.BoxNew(dw.VERT, 10); - - notebookbox1.PackStart(lbbox, 150, 70, dw.TRUE, dw.TRUE, 0); - - /* Copy and Paste */ - browsebox := dw.BoxNew(dw.HORZ, 0); - - lbbox.PackStart(browsebox, 0, 0, dw.FALSE, dw.FALSE, 0); - - copypastefield := dw.EntryfieldNew("", 0); - - copypastefield.SetLimit(260); - - browsebox.PackStart(copypastefield, -1, -1, dw.TRUE, dw.FALSE, 4); - - copybutton := dw.ButtonNew("Copy", 0); - - browsebox.PackStart(copybutton, -1, -1, dw.FALSE, dw.FALSE, 0); - - pastebutton := dw.ButtonNew("Paste", 0); - - browsebox.PackStart(pastebutton, -1, -1, dw.FALSE, dw.FALSE, 0); - - /* Archive Name */ - stext := dw.TextNew("File to browse", 0); - - stext.SetStyle(dw.DT_VCENTER, dw.DT_VCENTER); - - lbbox.PackStart(stext, 130, 15, dw.TRUE, dw.TRUE, 2); - - browsebox = dw.BoxNew(dw.HORZ, 0); - - lbbox.PackStart(browsebox, 0, 0, dw.TRUE, dw.TRUE, 0); - - entryfield := dw.EntryfieldNew("", 100); - - entryfield.SetLimit(260); - - browsebox.PackStart(entryfield, 100, 15, dw.TRUE, dw.TRUE, 4); - - browsefilebutton := dw.ButtonNew("Browse File", 1001); - - browsebox.PackStart(browsefilebutton, 40, 15, dw.TRUE, dw.TRUE, 0); - - browsefolderbutton := dw.ButtonNew("Browse Folder", 1001); - - browsebox.PackStart(browsefolderbutton, 40, 15, dw.TRUE, dw.TRUE, 0); - - browsebox.SetColor(dw.CLR_PALEGRAY, dw.CLR_PALEGRAY); - stext.SetColor(dw.CLR_BLACK, dw.CLR_PALEGRAY); - - /* Buttons */ - buttonbox := dw.BoxNew(dw.HORZ, 10); - - lbbox.PackStart(buttonbox, 0, 0, dw.TRUE, dw.TRUE, 0); - - cancelbutton := dw.ButtonNew("Exit", 1002); - buttonbox.PackStart(cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2); - - cursortogglebutton := dw.ButtonNew("Set Cursor pointer - CLOCK", 1003); - buttonbox.PackStart(cursortogglebutton, 130, 30, dw.TRUE, dw.TRUE, 2); - - okbutton := dw.ButtonNew("Turn Off Annoying Beep!", 1001); - buttonbox.PackStart(okbutton, 130, 30, dw.TRUE, dw.TRUE, 2); - - cancelbutton.Unpack(); - buttonbox.PackStart(cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2); - mainwindow.ClickDefault(cancelbutton); - - colorchoosebutton := dw.ButtonNew("Color Chooser Dialog", 1004); - buttonbox.PackAtIndex(colorchoosebutton, 1, 130, 30, dw.TRUE, dw.TRUE, 2); - - /* Set some nice fonts and colors */ - lbbox.SetColor(dw.CLR_DARKCYAN, dw.CLR_PALEGRAY); - buttonbox.SetColor(dw.CLR_DARKCYAN, dw.CLR_PALEGRAY); - okbutton.SetColor(dw.CLR_PALEGRAY, dw.CLR_DARKCYAN); - - browsefilebutton.ConnectClicked(func(window dw.HBUTTON) int { - tmp := dw.FileBrowse("Pick a file", "dwootest.go", "go", dw.FILE_OPEN); - if len(tmp) > 0 { - current_file = tmp; - entryfield.SetText(current_file); - read_file(); - current_col = 0; - current_row = 0; - update_render(); - } - copypastefield.SetFocus(); - return dw.FALSE; - }); - - browsefolderbutton.ConnectClicked(func(window dw.HBUTTON) int { - tmp := dw.FileBrowse("Pick a folder", ".", "c", dw.DIRECTORY_OPEN); - fmt.Printf("Folder picked: %s\n", tmp); - return dw.FALSE; - }); - copybutton.ConnectClicked(func(button dw.HBUTTON) int { - test := copypastefield.GetText(); - - if len(test) > 0 { - dw.ClipboardSetText(test); - } - entryfield.SetFocus(); - return dw.TRUE; - }); - pastebutton.ConnectClicked(func(button dw.HBUTTON) int { - test := dw.ClipboardGetText(); - - if len(test) > 0 { - copypastefield.SetText(test); - } - return dw.TRUE; - }); - okbutton.ConnectClicked(func(window dw.HBUTTON) int { timerid.Disconnect(); return dw.TRUE; }); - cancelbutton.ConnectClicked(func(window dw.HBUTTON) int { return exit_handler(); }); - cursortogglebutton.ConnectClicked(func(window dw.HBUTTON) int { - if cursor_arrow { - cursortogglebutton.SetText("Set Cursor pointer - ARROW"); - mainwindow.SetPointer(dw.POINTER_CLOCK); - cursor_arrow = false; - } else { - cursortogglebutton.SetText("Set Cursor pointer - CLOCK"); - mainwindow.SetPointer(dw.POINTER_DEFAULT); - cursor_arrow = true; - } - return dw.FALSE; - }); - colorchoosebutton.ConnectClicked(func(window dw.HBUTTON) int { current_color = dw.Color_choose(current_color); return dw.FALSE;}); - - /* Set the default field */ - mainwindow.Default(copypastefield); -} - -// Create Page 2 -func text_add(notebookbox2 dw.HBOX) { - depth := dw.ColorDepthGet(); - - /* create a box to pack into the notebook page */ - pagebox := dw.BoxNew(dw.HORZ, 2); - notebookbox2.PackStart(pagebox, 0, 0, dw.TRUE, dw.TRUE, 0); - /* now a status area under this box */ - hbox := dw.BoxNew(dw.HORZ, 1); - notebookbox2.PackStart(hbox, 100, 20, dw.TRUE, dw.FALSE, 1); - status1 = dw.StatusTextNew("", 0); - hbox.PackStart(status1, 100, -1, dw.TRUE, dw.FALSE, 1); - status2 = dw.StatusTextNew("", 0); - hbox.PackStart(status2, 100, -1, dw.TRUE, dw.FALSE, 1); - /* a box with combobox and button */ - hbox = dw.BoxNew(dw.HORZ, 1); - notebookbox2.PackStart(hbox, 100, 25, dw.TRUE, dw.FALSE, 1); - rendcombo := dw.ComboboxNew("Shapes Double Buffered", 0); - hbox.PackStart(rendcombo, 80, 25, dw.TRUE, dw.FALSE, 0); - rendcombo.Append("Shapes Double Buffered"); - rendcombo.Append("Shapes Direct"); - rendcombo.Append("File Display"); - label := dw.TextNew("Image X:", 100); - label.SetStyle(dw.DT_VCENTER | dw.DT_CENTER, dw.DT_VCENTER | dw.DT_CENTER); - hbox.PackStart(label, -1, 25, dw.FALSE, dw.FALSE, 0); - imagexspin = dw.SpinButtonNew("20", 1021); - hbox.PackStart(imagexspin, 25, 25, dw.TRUE, dw.FALSE, 0); - label = dw.TextNew("Y:", 100); - label.SetStyle(dw.DT_VCENTER | dw.DT_CENTER, dw.DT_VCENTER | dw.DT_CENTER); - hbox.PackStart(label, -1, 25, dw.FALSE, dw.FALSE, 0); - imageyspin = dw.SpinButtonNew("20", 1021); - hbox.PackStart(imageyspin, 25, 25, dw.TRUE, dw.FALSE, 0); - imagexspin.SetLimits(2000, 0); - imageyspin.SetLimits(2000, 0); - imagexspin.SetPos(20); - imageyspin.SetPos(20); - imagestretchcheck = dw.CheckButtonNew("Stretch", 1021); - hbox.PackStart(imagestretchcheck, -1, 25, dw.FALSE, dw.FALSE, 0); - - button1 := dw.ButtonNew("Refresh", 1223); - hbox.PackStart(button1, 100, 25, dw.FALSE, dw.FALSE, 0); - button2 := dw.ButtonNew("Print", 1224); - hbox.PackStart(button2, 100, 25, dw.FALSE, dw.FALSE, 0); - - /* Pre-create the scrollbars so we can query their sizes */ - vscrollbar = dw.ScrollbarNew(dw.VERT, 50); - hscrollbar = dw.ScrollbarNew(dw.HORZ, 50); - vscrollbarwidth, _ := vscrollbar.GetPreferredSize(); - _, hscrollbarheight := hscrollbar.GetPreferredSize(); - - /* On GTK with overlay scrollbars enabled this returns us 0... - * so in that case we need to give it some real values. - */ - if vscrollbarwidth == 0 { - vscrollbarwidth = 8; - } - if hscrollbarheight == 0 { - hscrollbarheight = 8; - } - - /* create render box for number pixmap */ - textbox1 = dw.RenderNew(100); - textbox1.SetFont(FIXEDFONT); - font_width, font_height = textbox1.GetTextExtents("(g"); - font_width = font_width / 2; - vscrollbox := dw.BoxNew(dw.VERT, 0); - vscrollbox.PackStart(textbox1, font_width * width1, font_height * rows, dw.FALSE, dw.TRUE, 0); - vscrollbox.PackStart(dw.NOHWND, font_width * (width1 + 1), hscrollbarheight, dw.FALSE, dw.FALSE, 0); - pagebox.PackStart(vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0); - - /* pack empty space 1 character wide */ - pagebox.PackStart(dw.NOHWND, font_width, 0, dw.FALSE, dw.TRUE, 0); - - /* create box for filecontents and horz scrollbar */ - textboxA := dw.BoxNew(dw.VERT, 0); - pagebox.PackStart(textboxA, 0, 0, dw.TRUE, dw.TRUE, 0); - - /* create render box for filecontents pixmap */ - textbox2 = dw.RenderNew(101); - textboxA.PackStart(textbox2, 10, 10, dw.TRUE, dw.TRUE, 0); - textbox2.SetFont(FIXEDFONT); - /* create horizonal scrollbar */ - textboxA.PackStart(hscrollbar, -1, -1, dw.TRUE, dw.FALSE, 0); - - /* create vertical scrollbar */ - vscrollbox = dw.BoxNew(dw.VERT, 0); - vscrollbox.PackStart(vscrollbar, -1, -1, dw.FALSE, dw.TRUE, 0); - /* Pack an area of empty space 14x14 pixels */ - vscrollbox.PackStart(dw.NOHWND, vscrollbarwidth, hscrollbarheight, dw.FALSE, dw.FALSE, 0); - pagebox.PackStart(vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0); - - text1pm = dw.PixmapNew(textbox1, uint(font_width * width1), uint(font_height * rows), depth); - text2pm = dw.PixmapNew(textbox2, uint(font_width * cols), uint(font_height * rows), depth); - image = dw.PixmapNewFromFile(textbox2, "test"); - if image == dw.NOHPIXMAP && len(SRCROOT) > 0 { - image = dw.PixmapNewFromFile(textbox2, fmt.Sprintf("%s/test", SRCROOT)); - } - if image != dw.NOHPIXMAP { - image.SetTransparentColor(dw.CLR_WHITE); - } - - dw.MessageBox("DWTest", dw.MB_OK | dw.MB_INFORMATION, fmt.Sprintf("Width: %d Height: %d\n", font_width, font_height)); - text1pm.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, font_width * width1, font_height * rows); - text2pm.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, font_width * cols, font_height * rows); - textbox1.ConnectButtonPress(func(window dw.HRENDER, x int, y int, buttonmask int) int { context_menu(); return dw.TRUE; }); - textbox1.ConnectExpose(func(hwnd dw.HRENDER, x int, y int, width int, height int) int { return text_expose(hwnd, text1pm); }); - textbox2.ConnectExpose(func(hwnd dw.HRENDER, x int, y int, width int, height int) int { return text_expose(hwnd, text2pm); }); - textbox2.ConnectConfigure(func(hwnd dw.HRENDER, width int, height int) int { - old1 := text1pm; - old2 := text2pm; - depth := dw.ColorDepthGet(); - - rows = height / font_height; - cols = width / font_width; - - /* Create new pixmaps with the current sizes */ - text1pm = dw.PixmapNew(textbox1, uint(font_width*(width1)), uint(height), depth); - text2pm = dw.PixmapNew(textbox2, uint(width), uint(height), depth); - - /* Make sure the side area is cleared */ - dw.ColorForegroundSet(dw.CLR_WHITE); - text1pm.DrawRect(dw.DRAW_FILL | dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)); - - /* Destroy the old pixmaps */ - old1.Destroy(); - old2.Destroy(); - - /* Update scrollbar ranges with new values */ - hscrollbar.SetRange(uint(max_linewidth), uint(cols)); - vscrollbar.SetRange(uint(len(lines)), uint(rows)); - - /* Redraw the window */ - update_render(); - return dw.TRUE; - }); - textbox2.ConnectMotion(func(window dw.HRENDER, x int, y int, buttonmask int) int { status2.SetText(fmt.Sprintf("motion_notify: %dx%d", x, y)); return dw.FALSE; }); - textbox2.ConnectButtonPress(func(window dw.HRENDER, x int, y int, buttonmask int) int { status2.SetText(fmt.Sprintf("button_press: %dx%d", x, y)); return dw.FALSE; }); - hscrollbar.ConnectValueChanged(func(hwnd dw.HSCROLLBAR, value int) int { - current_col = value; - status1.SetText(fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)); - update_render(); - return dw.FALSE; - }); - vscrollbar.ConnectValueChanged(func(hwnd dw.HSCROLLBAR, value int) int { - current_row = value; - status1.SetText(fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)); - update_render(); - return dw.FALSE; - }); - imagestretchcheck.ConnectClicked(func(window dw.HBUTTON) int { update_render(); return dw.FALSE; }); - button1.ConnectClicked(func(window dw.HBUTTON) int { update_render(); return dw.FALSE; }); - button2.ConnectClicked(func(window dw.HBUTTON) int { print_callback(); return dw.FALSE; }); - rendcombo.ConnectListSelect(func(window dw.HLISTBOX, index int) int { - if index != render_type { - if index == 2 { - hscrollbar.SetRange(uint(max_linewidth), uint(cols)); - hscrollbar.SetPos(0); - vscrollbar.SetRange(uint(len(lines)), uint(rows)); - vscrollbar.SetPos(0); - current_col = 0; - current_row = 0; - } else { - hscrollbar.SetRange(0, 0); - hscrollbar.SetPos(0); - vscrollbar.SetRange(0, 0); - vscrollbar.SetPos(0); - } - render_type = index; - update_render(); - } - return dw.FALSE; - }); - mainwindow.ConnectKeyPress(func(window dw.HWND, ch uint8, vk int, state int, utf8 string) int { - var message string - - if ch != 0 { - message = fmt.Sprintf("Key: %c(%d) Modifiers: %s(%d) utf8 %s", ch, ch, resolve_keymodifiers(state), state, utf8); - } else { - message = fmt.Sprintf("Key: %s(%d) Modifiers: %s(%d) utf8 %s", resolve_keyname(vk), vk, resolve_keymodifiers(state), state, utf8); - } - status1.SetText(message); - return dw.FALSE; - }); - - - dw.TaskbarInsert(textbox1, fileicon, "DWTest"); -} - -// Page 3 -func tree_add(notebookbox3 dw.HBOX) { - /* create a box to pack into the notebook page */ - listbox := dw.ListboxNew(1024, dw.TRUE); - notebookbox3.PackStart(listbox, 500, 200, dw.TRUE, dw.TRUE, 0); - listbox.Append("Test 1"); - listbox.Append("Test 2"); - listbox.Append("Test 3"); - listbox.Append("Test 4"); - listbox.Append("Test 5"); - - /* now a tree area under this box */ - tree := dw.TreeNew(101); - notebookbox3.PackStart(tree, 500, 200, dw.TRUE, dw.TRUE, 1); - - /* and a status area to see whats going on */ - tree_status := dw.StatusTextNew("", 0); - notebookbox3.PackStart(tree_status, 100, -1, dw.TRUE, dw.FALSE, 1); - - /* set up our signal trappers... */ - tree.ConnectItemContext(func(window dw.HTREE, text string, x int, y int, itemdata dw.POINTER) int { - tree_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", - dw.HANDLE_TO_UINTPTR(window), text, x, y, uintptr(itemdata))); - return dw.FALSE; - }); - tree.ConnectItemSelect(func(window dw.HTREE, item dw.HTREEITEM, text string, itemdata dw.POINTER) int { - tree_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", - dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata))); - return dw.FALSE; - }); - - t1 := tree.Insert("tree folder 1", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(1))); - t2 := tree.Insert("tree folder 2", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(2))); - tree.Insert("tree file 1", fileicon, t1, dw.POINTER(uintptr(3))); - tree.Insert("tree file 2", fileicon, t1, dw.POINTER(uintptr(4))); - tree.Insert("tree file 3", fileicon, t2, dw.POINTER(uintptr(5))); - tree.Insert("tree file 4", fileicon, t2, dw.POINTER(uintptr(6))); - t1.Change("tree folder 1", foldericon); - t2.Change("tree folder 2", foldericon); - t2.SetData(dw.POINTER(uintptr(100))); - fmt.Printf("t1 title \"%s\" data %d t2 data %d\n", t1.GetTitle(), uintptr(t1.GetData()), uintptr(t2.GetData())); -} - -// Page 4 -func container_add(notebookbox4 dw.HBOX) { - var z int - titles := []string{ "Type", "Size", "Time", "Date" }; - flags := []uint{ dw.CFA_BITMAPORICON | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_ULONG | dw.CFA_RIGHT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_TIME | dw.CFA_CENTER | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_DATE | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR }; - - - /* create a box to pack into the notebook page */ - containerbox := dw.BoxNew(dw.HORZ, 2); - notebookbox4.PackStart(containerbox, 500, 200, dw.TRUE, dw.TRUE, 0); - - /* now a container area under this box */ - container := dw.ContainerNew(100, dw.TRUE); - notebookbox4.PackStart(container, 500, 200, dw.TRUE, dw.FALSE, 1); - - /* and a status area to see whats going on */ - container_status := dw.StatusTextNew("", 0); - notebookbox4.PackStart(container_status, 100, -1, dw.TRUE, dw.FALSE, 1); - - container.SetColumnTitle("Test"); - container.FileSystemSetup(flags, titles); - container.SetStripe(dw.CLR_DEFAULT, dw.CLR_DEFAULT); - containerinfo := container.Alloc(3); - - for z=0; z<3; z++ { - var thisicon dw.HICN = fileicon; - - if z == 0 { - thisicon = foldericon; - } - fmt.Printf("Initial: container: %x containerinfo: %x icon: %x\n", uintptr(dw.HANDLE_TO_POINTER(container)), - dw.HANDLE_TO_UINTPTR(containerinfo), uintptr(dw.POINTER(thisicon))); - containerinfo.SetFile(z, fmt.Sprintf("Filename %d", z+1), thisicon); - containerinfo.SetItemIcon(0, z, thisicon); - containerinfo.SetItemULong(1, z, uint(z*100)); - containerinfo.SetItemTime(2, z, z+10, z+10, z+10); - containerinfo.SetItemDate(3, z, z+10, z+10, z+2000); - containerinfo.SetRowTitle(z, fmt.Sprintf("We can now allocate from the stack: Item: %d", z)); - containerinfo.SetRowData(z, dw.POINTER(uintptr(z))); - } - containerinfo.Insert(); - - containerinfo = container.Alloc(1); - containerinfo.SetFile(0, "Yikes", foldericon); - containerinfo.SetItemIcon(0, 0, foldericon); - containerinfo.SetItemULong(1, 0, 324); - containerinfo.SetItemTime(2, 0, z+10, z+10, z+10); - containerinfo.SetItemDate(3, 0, z+10, z+10, z+2000); - containerinfo.SetRowTitle(0, "Extra"); - - containerinfo.Insert(); - container.Optimize(); - - container_mle := dw.MLENew(111); - containerbox.PackStart(container_mle, 500, 200, dw.TRUE, dw.TRUE, 0); - - mle_point = container_mle.Import("", -1); - mle_point = container_mle.Import(fmt.Sprintf("[%d]", mle_point), mle_point); - mle_point = container_mle.Import(fmt.Sprintf("[%d]abczxydefijkl", mle_point), mle_point); - dw.Mle_delete(container_mle, 9, 3); - mle_point = container_mle.Import("gh", 12); - newpoint, _ := container_mle.GetSize(); - mle_point = newpoint; - mle_point = container_mle.Import(fmt.Sprintf("[%d]\r\n\r\n", mle_point), mle_point); - container_mle.SetCursor(mle_point); - /* connect our event trappers... */ - container.ConnectItemEnter(func(window dw.HCONTAINER, text string, itemdata dw.POINTER) int { - container_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), text, uintptr(itemdata))); - return dw.FALSE; - }); - container.ConnectItemContext(func(window dw.HCONTAINER, text string, x int, y int, itemdata dw.POINTER) int { - container_status.SetText(fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", - dw.HANDLE_TO_UINTPTR(window), text, x, y, uintptr(itemdata))); - return dw.FALSE; - }); - - container.ConnectItemSelect(func(window dw.HCONTAINER, item dw.HTREEITEM, text string, itemdata dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", - dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)); - container_status.SetText(message); - message = fmt.Sprintf("\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", - dw.HANDLE_TO_UINTPTR(window), dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)); - mle_point = container_mle.Import(message, mle_point); - str := container.QueryStart(dw.CRA_SELECTED); - for len(str) > 0 { - mle_point = container_mle.Import(fmt.Sprintf("Selected: %s\r\n", str), mle_point); - str = container.QueryNext(dw.CRA_SELECTED); - } - /* Make the last inserted point the cursor location */ - container_mle.SetCursor(mle_point); - /* set the details of item 0 to new data */ - container.ChangeFile(0, "new data", fileicon); - container.ChangeItemULong(1, 0, 999); - return dw.FALSE; - }); - - container.ConnectColumnClick(func(window dw.HCONTAINER, column_num int) int { - var stype = "Unknown"; - - if column_num == 0 { - stype = "Filename"; - } else { - column_type := window.GetColumnType(column_num-1); - if column_type == dw.CFA_STRING { - stype = "String"; - } else if column_type == dw.CFA_ULONG { - stype = "ULong"; - } else if column_type == dw.CFA_DATE { - stype = "Date"; - } else if column_type == dw.CFA_TIME { - stype = "Time"; - } else if column_type == dw.CFA_BITMAPORICON { - stype = "BitmapOrIcon"; - } - } - container_status.SetText(fmt.Sprintf("DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", - dw.HANDLE_TO_UINTPTR(window), column_num, stype)); - return dw.FALSE; - }); -} - -// Page 5 -func buttons_add(notebookbox5 dw.HBOX) { - var i int; - - /* create a box to pack into the notebook page */ - buttonsbox := dw.BoxNew(dw.VERT, 2); - notebookbox5.PackStart(buttonsbox, 25, 200, dw.TRUE, dw.TRUE, 0); - buttonsbox.SetColor(dw.CLR_RED, dw.CLR_RED); - - calbox := dw.BoxNew(dw.HORZ, 0); - notebookbox5.PackStart(calbox, 500, 200, dw.TRUE, dw.TRUE, 1); - cal := dw.CalendarNew(100); - calbox.PackStart(cal, 180, 120, dw.TRUE, dw.TRUE, 0); - /* - cal.SetDate(2001, 1, 1); - */ - /* - * Create our file toolbar boxes... - */ - buttonboxperm := dw.BoxNew(dw.VERT, 0); - buttonsbox.PackStart(buttonboxperm, 25, 0, dw.FALSE, dw.TRUE, 2); - buttonboxperm.SetColor(dw.CLR_WHITE, dw.CLR_WHITE); - abutton1 := dw.BitmapButtonNewFromFile("Top Button", 0, fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)); - buttonboxperm.PackStart(abutton1, 100, 30, dw.FALSE, dw.FALSE, 0); - buttonboxperm.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0); - abutton2 := dw.BitmapButtonNewFromFile("Bottom", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)); - buttonsbox.PackStart(abutton2, 25, 25, dw.FALSE, dw.FALSE, 0); - abutton2.SetBitmap(0, FILE_ICON_NAME); - - /* Pre-create the percent */ - percent := dw.PercentNew(0); - - create_button(buttonboxperm, buttonsbox, percent); - - /* make a combobox */ - combox := dw.BoxNew(dw.VERT, 2); - notebookbox5.PackStart(combox, 25, 200, dw.TRUE, dw.FALSE, 0); - combobox1 := dw.ComboboxNew("fred", 0 ); /* no point in specifying an initial value */ - combobox1.Append("fred" ); - combox.PackStart(combobox1, -1, -1, dw.TRUE, dw.FALSE, 0); - - - combobox2 := dw.ComboboxNew("joe", 0); /* no point in specifying an initial value */ - combox.PackStart(combobox2, -1, -1, dw.TRUE, dw.FALSE, 0); - /* add LOTS of items */ - fmt.Printf("before appending 500 items to combobox using dw_listbox_list_append()\n"); - text := make([]string, 500); - for i = 0; i < 500; i++ { - text[i] = fmt.Sprintf("item %d", i); - } - combobox2.AppendList(text); - fmt.Printf("after appending 500 items to combobox\n"); - /* now insert a couple of items */ - combobox2.Insert("inserted item 2", 2 ); - combobox2.Insert("inserted item 5", 5 ); - /* make a spinbutton */ - spinbutton := dw.SpinButtonNew("", 0); /* no point in specifying text */ - combox.PackStart(spinbutton, -1, -1, dw.TRUE, dw.FALSE, 0); - spinbutton.SetLimits(100, 1); - spinbutton.SetPos(30); - - /* make a slider */ - slider := dw.SliderNew(dw.FALSE, 11, 0); /* no point in specifying text */ - combox.PackStart(slider, -1, -1, dw.TRUE, dw.FALSE, 0); - - /* Pack the percent */ - combox.PackStart(percent, -1, -1, dw.TRUE, dw.FALSE, 0); - - /* Connect the handlers */ - abutton1.ConnectClicked(func(window dw.HBUTTON) int { button_callback(combobox1, combobox2, spinbutton, cal); return dw.TRUE; }); - abutton2.ConnectClicked(func(window dw.HBUTTON) int { button_callback(combobox1, combobox2, spinbutton, cal); return dw.TRUE; }); - combobox1.ConnectListSelect(func(window dw.HLISTBOX, index int) int { - fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration); - iteration++; - return dw.FALSE; - }); - combobox2.ConnectListSelect(func(window dw.HLISTBOX, index int) int { - fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration); - iteration++; - return dw.FALSE; - }); - spinbutton.ConnectValueChanged(func(hwnd dw.HSPINBUTTON, value int) int { dw.MessageBox("DWTest", dw.MB_OK, fmt.Sprintf("New value from spinbutton: %d\n", value)); return dw.FALSE; }); - slider.ConnectValueChanged(func(hwnd dw.HSLIDER, value int) int { percent.SetPos(uint(value * 10)); return dw.FALSE; }); -} - -func create_button(buttonboxperm, buttonsbox dw.HBOX, percent dw.HPERCENT) { - filetoolbarbox := dw.BoxNew(dw.VERT, 0); - buttonboxperm.PackStart(filetoolbarbox, 0, 0, dw.TRUE, dw.TRUE, 0); - - abutton1 := dw.BitmapButtonNewFromFile("Empty image. Should be under Top button", 0, "junk"); - filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0); - abutton1.ConnectClicked(func(window dw.HBUTTON) int { buttonsbox.SetColor(dw.CLR_RED, dw.CLR_RED); return dw.FALSE; }); - - filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0); - - abutton1 = dw.BitmapButtonNewFromFile("A borderless bitmapbitton", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)); - filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0); - abutton1.ConnectClicked(func(window dw.HBUTTON) int { buttonsbox.SetColor(dw.CLR_YELLOW, dw.CLR_YELLOW); return dw.FALSE; }); - - filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0); - abutton1.SetStyle(dw.BS_NOBORDER, dw.BS_NOBORDER); - - //abutton1 = dw.Bitmapbutton_new_from_data("A button from data", 0, folder_ico, 1718 ); - abutton1 = dw.BitmapButtonNewFromFile("A button from data", 0, "junk"); - filetoolbarbox.PackStart(abutton1, 25, 25, dw.FALSE, dw.FALSE, 0); - abutton1.ConnectClicked(func(window dw.HBUTTON) int { percent.SetPos(dw.PERCENT_INDETERMINATE); return dw.FALSE; }); - - filetoolbarbox.PackStart(dw.NOHWND, 25, 5, dw.FALSE, dw.FALSE, 0); -} - -// Page 8 -func scrollbox_add(notebookbox8 dw.HBOX) { - var i int; - - /* create a box to pack into the notebook page */ - scrollbox := dw.ScrollBoxNew(dw.VERT, 0); - notebookbox8.PackStart(scrollbox, 0, 0, dw.TRUE, dw.TRUE, 1); - - abutton1 := dw.ButtonNew("Show Adjustments", 0); - scrollbox.PackStart(abutton1, -1, 30, dw.FALSE, dw.FALSE, 0 ); - abutton1.ConnectClicked(func(window dw.HBUTTON) int { _, pos := scrollbox.GetPos(); _, rng := scrollbox.GetRange(); fmt.Printf("Pos %d Range %d\n", pos, rng); return dw.FALSE; }); - - for i = 0; i < MAX_WIDGETS; i++ { - tmpbox := dw.BoxNew(dw.HORZ, 0); - scrollbox.PackStart(tmpbox, 0, 24, dw.TRUE, dw.FALSE, 2); - label := dw.TextNew(fmt.Sprintf("Label %d", i), 0 ); - tmpbox.PackStart(label, 0, 20, dw.TRUE, dw.FALSE, 0); - item := dw.EntryfieldNew(fmt.Sprintf("Entry %d", i), uint(i)); - tmpbox.PackStart(item, 0, 20, dw.TRUE, dw.FALSE, 0); - } -} - -// Page 9 -func update_mle(text string, lock int) { - /* Protect pos from being changed by different threads */ - if(lock != 0) { - mutex.Lock(); - } - mlepos = threadmle.Import(text, mlepos); - threadmle.SetCursor(mlepos); - if(lock != 0) { - mutex.Unlock(); - } -} - -func thread_add(notebookbox9 dw.HBOX) { - /* create a box to pack into the notebook page */ - tmpbox := dw.BoxNew(dw.VERT, 0); - notebookbox9.PackStart(tmpbox, 0, 0, dw.TRUE, dw.TRUE, 1); - - startbutton = dw.ButtonNew("Start Threads", 0); - tmpbox.PackStart(startbutton, -1, 30, dw.FALSE, dw.FALSE, 0); - /* Create the base threading components */ - threadmle = dw.MLENew(0); - tmpbox.PackStart(threadmle, 1, 1, dw.TRUE, dw.TRUE, 0); - mutex = dw.MutexNew(); - workevent = dw.EventNew(); - /* Connect signal handlers */ - startbutton.ConnectClicked(func(window dw.HBUTTON) int { - startbutton.Disable(); - mutex.Lock(); - controlevent = dw.EventNew(); - workevent.Reset(); - finished = dw.FALSE; - ready = 0; - update_mle("Starting thread 1\r\n", dw.FALSE); - go run_thread(1); - update_mle("Starting thread 2\r\n", dw.FALSE); - go run_thread(2); - update_mle("Starting thread 3\r\n", dw.FALSE); - go run_thread(3); - update_mle("Starting thread 4\r\n", dw.FALSE); - go run_thread(4); - update_mle("Starting control thread\r\n", dw.FALSE); - go control_thread(); - mutex.Unlock(); - return dw.FALSE; - }); - -} - -func run_thread(threadnum int) { - dw.InitThread(); - update_mle(fmt.Sprintf("Thread %d started.\r\n", threadnum), dw.TRUE); - - /* Increment the ready count while protected by mutex */ - mutex.Lock(); - ready++; - /* If all 4 threads have incrememted the ready count... - * Post the control event semaphore so things will get started. - */ - if(ready == 4) { - controlevent.Post(); - } - mutex.Unlock(); - - for finished == 0 { - result := workevent.Wait(2000); - - if(result == dw.ERROR_TIMEOUT) { - update_mle(fmt.Sprintf("Thread %d timeout waiting for event.\r\n", threadnum), dw.TRUE); - } else if(result == dw.ERROR_NONE) { - update_mle(fmt.Sprintf("Thread %d doing some work.\r\n", threadnum), dw.TRUE); - /* Pretend to do some work */ - dw.MainSleep(1000 * threadnum); - - /* Increment the ready count while protected by mutex */ - mutex.Lock(); - ready++; - buf := fmt.Sprintf("Thread %d work done. ready=%d", threadnum, ready); - /* If all 4 threads have incrememted the ready count... - * Post the control event semaphore so things will get started. - */ - if(ready == 4) { - controlevent.Post(); - buf = fmt.Sprintf("%s%s", buf, " Control posted."); - } - mutex.Unlock(); - update_mle(fmt.Sprintf("%s\r\n", buf), dw.TRUE); - } else { - update_mle(fmt.Sprintf("Thread %d error %d.\r\n", threadnum), dw.TRUE); - dw.MainSleep(10000); - } - } - update_mle(fmt.Sprintf("Thread %d finished.\r\n", threadnum), dw.TRUE); - dw.DeinitThread(); -} - -func control_thread() { - dw.InitThread(); - - inprogress := 5; - - for inprogress != 0 { - result := controlevent.Wait(2000); - - if(result == dw.ERROR_TIMEOUT) { - update_mle("Control thread timeout waiting for event.\r\n", dw.TRUE); - } else if(result == dw.ERROR_NONE) { - /* Reset the control event */ - controlevent.Reset(); - ready = 0; - update_mle(fmt.Sprintf("Control thread starting worker threads. Inprogress=%d\r\n", inprogress), dw.TRUE); - /* Start the work threads */ - workevent.Post(); - dw.MainSleep(100); - /* Reset the work event */ - workevent.Reset(); - inprogress--; - } else { - update_mle(fmt.Sprintf("Control thread error %d.\r\n", result), dw.TRUE); - dw.MainSleep(10000); - } - } - /* Tell the other threads we are done */ - finished = dw.TRUE; - workevent.Post(); - /* Close the control event */ - controlevent.Close(); - update_mle("Control thread finished.\r\n", dw.TRUE); - startbutton.Enable(); - dw.DeinitThread(); -} - -func main() { - /* Pick an approriate font for our platform */ - if runtime.GOOS == "windows" { - FIXEDFONT = "10.Lucida Console"; - } else if runtime.GOOS == "darwin" { - FIXEDFONT = "9.Monaco"; - } - - /* Locate the source root of the package */ - pkg, err := build.Import("dwtest", "", build.FindOnly); - if err == nil && len(pkg.SrcRoot) > 0 { - SRCROOT = fmt.Sprintf("%s/dwtest", pkg.SrcRoot); - } - - /* Initialize the Dynamic Windows engine */ - dw.Init(dw.TRUE); - - /* Create our window */ - mainwindow := dw.WindowNew(dw.DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", dw.FCF_SYSMENU | dw.FCF_TITLEBAR | dw.FCF_TASKLIST | dw.FCF_DLGBORDER | dw.FCF_SIZEBORDER | dw.FCF_MINMAX); - - menu_add(mainwindow); - - notebookbox := dw.BoxNew(dw.VERT, 5); - mainwindow.PackStart(notebookbox, 0, 0, dw.TRUE, dw.TRUE, 0); - - foldericon = dw.IconLoadFromFile(FOLDER_ICON_NAME); - if foldericon == dw.NOHICN && len(SRCROOT) > 0 { - foldericon = dw.IconLoadFromFile(fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)); - } - fileicon = dw.IconLoadFromFile(FILE_ICON_NAME); - if fileicon == dw.NOHICN && len(SRCROOT) > 0 { - fileicon = dw.IconLoadFromFile(fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)); - } - notebook := dw.NotebookNew(1, dw.TRUE); - notebookbox.PackStart(notebook, 100, 100, dw.TRUE, dw.TRUE, 0); - notebook.ConnectSwitchPage(func(window dw.HNOTEBOOK, page_num dw.HNOTEPAGE) int { - fmt.Printf("DW_SIGNAL_SWITCH_PAGE: PageNum: %d\n", dw.HNOTEPAGE_TO_UINT(page_num)); - return dw.FALSE; - }); - - notebookbox1 := dw.BoxNew(dw.VERT, 5); - notebookpage1 := notebook.PageNew(0, dw.TRUE); - notebookpage1.Pack(notebookbox1); - notebookpage1.SetText("buttons and entry"); - archive_add(notebookbox1); - - notebookbox2 := dw.BoxNew(dw.VERT, 5); - notebookpage2 := notebook.PageNew(1, dw.FALSE); - notebookpage2.Pack(notebookbox2); - notebookpage2.SetText("render"); - text_add(notebookbox2); - - notebookbox3 := dw.BoxNew(dw.VERT, 5); - notebookpage3 := notebook.PageNew(1, dw.FALSE); - notebookpage3.Pack(notebookbox3); - notebookpage3.SetText("tree"); - tree_add(notebookbox3); - - notebookbox4 := dw.BoxNew(dw.VERT, 5); - notebookpage4 := notebook.PageNew(1, dw.FALSE); - notebookpage4.Pack(notebookbox4); - notebookpage4.SetText("container"); - container_add(notebookbox4); - - notebookbox5 := dw.BoxNew(dw.VERT, 5); - notebookpage5 := notebook.PageNew(1, dw.FALSE); - notebookpage5.Pack(notebookbox5); - notebookpage5.SetText("buttons"); - buttons_add(notebookbox5); - -/* DEPRECATED - notebookbox6 := dw.BoxNew(dw.VERT, 5); - notebookpage6 := notebook.PageNew(1, dw.FALSE ); - notebookpage6.Pack(notebookbox6); - notebookpage6.SetText("mdi"); - mdi_add(notebookbox6); -*/ - - notebookbox7 := dw.BoxNew(dw.VERT, 6); - notebookpage7 := notebook.PageNew(1, dw.FALSE); - notebookpage7.Pack(notebookbox7); - notebookpage7.SetText("html"); - - rawhtml := dw.HtmlNew(1001); - if rawhtml.GetHandle() != nil { - notebookbox7.PackStart(rawhtml, 0, 100, dw.TRUE, dw.FALSE, 0); - rawhtml.Raw("<html><body><center><h1>dwtest</h1></center></body></html>"); - html := dw.HtmlNew(1002); - notebookbox7.PackStart(html, 0, 100, dw.TRUE, dw.TRUE, 0); - html.URL("http://dwindows.netlabs.org"); - } else { - label := dw.Text_new("HTML widget not available.", 0); - notebookbox7.PackStart(label, 0, 100, dw.TRUE, dw.TRUE, 0); - } - - notebookbox8 := dw.BoxNew(dw.VERT, 7); - notebookpage8 := notebook.PageNew(1, dw.FALSE); - notebookpage8.Pack(notebookbox8); - notebookpage8.SetText("scrollbox"); - scrollbox_add(notebookbox8); - - notebookbox9 := dw.BoxNew(dw.VERT, 8); - notebookpage9 := notebook.PageNew(1, dw.FALSE); - notebookpage9.Pack(notebookbox9); - notebookpage9.SetText("thread/event"); - thread_add(notebookbox9); - - mainwindow.ConnectDelete(func(window dw.HWND) int { return exit_handler(); }); - /* - * The following is a special case handler for the Mac and other platforms which contain - * an application object which can be closed. It function identically to a window delete/close - * request except it applies to the entire application not an individual window. If it is not - * handled or you allow the default handler to take place the entire application will close. - * On platforms which do not have an application object this line will be ignored. - */ - dw.DESKTOP.ConnectDelete(func(window dw.HWND) int { return exit_handler(); }); - timerid = dw.TimerNew(); - /* Return dw.TRUE so we get called again */ - timerid.Connect(func() int { dw.Beep(200, 200); return dw.TRUE; }, 2000); - - mainwindow.SetSize(640, 550); - mainwindow.Show(); - - /* Now that the window is created and shown... - * run the main loop until we get dw_main_quit() - */ - dw.Main(); - - /* Now that the loop is done we can cleanup */ - dw.TaskbarDelete(textbox1, fileicon); - mainwindow.Destroy(); - - fmt.Printf("dwtest exiting...\n"); - /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ - dw.Shutdown(); -}
--- a/src/dwootest/dwootest.rc Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include "winuser.h" -#ifdef DW64 -1 RT_MANIFEST dwootest.exe.x64.manifest -#else -1 RT_MANIFEST dwootest.exe.x86.manifest -#endif \ No newline at end of file
--- a/src/dwootest/makesyso.bat Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -@echo off -windres -i dwootest.rc -o dwootest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 -windres -i dwootest.rc -o dwootest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- a/src/dwtest/dwtest.exe.x64.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="AMD64" - name="dwtest" - type="win32" -/> -<description>Dynamic Windows Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="AMD64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwtest/dwtest.exe.x86.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="X86" - name="dwtest" - type="win32" -/> -<description>Dynamic Windows Test</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/dwtest/dwtest.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1663 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "dw" - "fmt" - "go/build" - "io" - "os" - "runtime" -) - -// Global variables -const ( - FALSE int = iota - TRUE -) - -var FIXEDFONT = "10.monospace" - -var mainwindow dw.HWND - -// Page 1 -var notebookbox1 dw.HBOX -var cursortogglebutton dw.HBUTTON -var noncheckable_menuitem, checkable_menuitem dw.HMENUITEM -var copypastefield, entryfield dw.HENTRYFIELD -var current_color dw.COLOR = dw.RGB(100, 100, 100) -var cursor_arrow bool = true -var timerid dw.HTIMER - -// Page 2 -var notebookbox2 dw.HBOX -var textbox1, textbox2 dw.HRENDER -var status1, status2 dw.HTEXT -var vscrollbar, hscrollbar dw.HSCROLLBAR -var rendcombo dw.HLISTBOX -var imagexspin, imageyspin dw.HSPINBUTTON -var imagestretchcheck dw.HBUTTON -var text1pm, text2pm, image dw.HPIXMAP -var image_x = 20 -var image_y = 20 -var image_stretch int = FALSE -var font_width = 8 -var font_height = 12 -var rows = 10 -var width1 = 6 -var cols = 80 -var render_type = 0 -var current_row = 0 -var current_col = 0 -var max_linewidth = 0 - -// Page 3 -var notebookbox3 dw.HBOX -var tree dw.HTREE - -// Page 4 -var notebookbox4 dw.HBOX -var container_mle dw.HMLE -var container dw.HCONTAINER -var mle_point = 0 - -// Page 5 -var notebookbox5, buttonboxperm, buttonsbox dw.HBOX -var combobox1, combobox2 dw.HLISTBOX -var cal dw.HCALENDAR -var spinbutton dw.HSPINBUTTON -var slider dw.HSLIDER -var percent dw.HPERCENT - -// Page 7 -var notebookbox7 dw.HBOX -var html dw.HHTML - -// Page 8 -var notebookbox8 dw.HBOX -var scrollbox dw.HSCROLLBOX -var MAX_WIDGETS = 20 - -var iteration = 0 - -// Page 9 -var notebookbox9 dw.HBOX -var threadmle dw.HMLE -var startbutton dw.HBUTTON -var mutex dw.HMTX -var workevent, controlevent dw.HEV -var finished = 0 -var ready = 0 -var mlepos = 0 - -// Miscellaneous -var fileicon, foldericon dw.HICN -var current_file string -var lines []string -var menu_enabled bool = true - -var FOLDER_ICON_NAME string = "folder" -var FILE_ICON_NAME string = "file" -var SRCROOT string - -func read_file() { - var ( - file *os.File - part []byte - prefix bool - length int - err error - ) - - lines = nil - max_linewidth = 0 - - if file, err = os.Open(current_file); err != nil { - return - } - reader := bufio.NewReader(file) - buffer := bytes.NewBuffer(make([]byte, 1024)) - buffer.Reset() - for { - if part, prefix, err = reader.ReadLine(); err != nil { - break - } - buffer.Write(part) - if !prefix { - lines = append(lines, buffer.String()) - length = len(buffer.String()) - if length > max_linewidth { - max_linewidth = length - } - buffer.Reset() - } - } - if err == io.EOF { - err = nil - } - dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) - dw.Scrollbar_set_pos(hscrollbar, 0) - dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) - dw.Scrollbar_set_pos(vscrollbar, 0) -} - -// Call back section -func exit_callback(window dw.HWND, data dw.POINTER) int { - if dw.Messagebox("dwtest", dw.MB_YESNO|dw.MB_QUESTION, "Are you sure you want to exit?") != 0 { - dw.Main_quit() - } - return TRUE -} - -func switch_page_callback(window dw.HNOTEBOOK, page_num dw.HNOTEPAGE, itemdata dw.POINTER) int { - fmt.Printf("DW_SIGNAL_SWITCH_PAGE: PageNum: %d\n", dw.HNOTEPAGE_TO_UINT(page_num)) - return FALSE -} - -func menu_callback(window dw.HMENUITEM, data dw.POINTER) int { - info := *(*string)(data) - buf := fmt.Sprintf("%s menu item selected", info) - dw.Messagebox("Menu Item Callback", dw.MB_OK|dw.MB_INFORMATION, buf) - return FALSE -} - -func menutoggle_callback(window dw.HMENUITEM, data dw.POINTER) int { - if menu_enabled { - dw.Window_set_style(checkable_menuitem, dw.MIS_DISABLED, dw.MIS_DISABLED) - dw.Window_set_style(noncheckable_menuitem, dw.MIS_DISABLED, dw.MIS_DISABLED) - menu_enabled = false - } else { - dw.Window_set_style(checkable_menuitem, dw.MIS_DISABLED, dw.MIS_ENABLED) - dw.Window_set_style(noncheckable_menuitem, dw.MIS_DISABLED, dw.MIS_ENABLED) - menu_enabled = true - } - return FALSE -} - -func helpabout_callback(window dw.HMENUITEM, data dw.POINTER) int { - var env dw.Env - - dw.Environment_query(&env) - message := fmt.Sprintf("dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\ndwindows Version: %d.%d.%d", - env.OSName, env.BuildDate, env.BuildTime, - env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild, - env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion) - dw.Messagebox("About dwindows", dw.MB_OK|dw.MB_INFORMATION, message) - return FALSE -} - -// Page 1 Callbacks -func paste_clicked_callback(button dw.HBUTTON, data dw.POINTER) int { - test := dw.Clipboard_get_text() - - if len(test) > 0 { - dw.Window_set_text(copypastefield, test) - } - return TRUE -} - -func copy_clicked_callback(button dw.HBUTTON, data dw.POINTER) int { - test := dw.Window_get_text(copypastefield) - - if len(test) > 0 { - dw.Clipboard_set_text(test) - } - dw.Window_set_focus(entryfield) - return TRUE -} - -func browse_file_callback(window dw.HBUTTON, data dw.POINTER) int { - tmp := dw.File_browse("Pick a file", "dwtest.c", "c", dw.FILE_OPEN) - if len(tmp) > 0 { - current_file = tmp - dw.Window_set_text(entryfield, current_file) - read_file() - current_col = 0 - current_row = 0 - update_render() - } - dw.Window_set_focus(copypastefield) - return FALSE -} - -func browse_folder_callback(window dw.HBUTTON, data dw.POINTER) int { - tmp := dw.File_browse("Pick a folder", ".", "c", dw.DIRECTORY_OPEN) - fmt.Printf("Folder picked: %s\n", tmp) - return FALSE -} - -func colorchoose_callback(window dw.HBUTTON, data dw.POINTER) int { - current_color = dw.Color_choose(current_color) - return FALSE -} - -func cursortoggle_callback(window dw.HBUTTON, data dw.POINTER) int { - if cursor_arrow { - dw.Window_set_text(cursortogglebutton, "Set Cursor pointer - ARROW") - dw.Window_set_pointer(dw.POINTER_TO_HANDLE(data), dw.POINTER_CLOCK) - cursor_arrow = false - } else { - dw.Window_set_text(cursortogglebutton, "Set Cursor pointer - CLOCK") - dw.Window_set_pointer(dw.POINTER_TO_HANDLE(data), dw.POINTER_DEFAULT) - cursor_arrow = true - } - return FALSE -} - -func beep_callback(window dw.HBUTTON, data dw.POINTER) int { - dw.Timer_disconnect(timerid) - return TRUE -} - -/* Beep every second */ -func timer_callback(data dw.POINTER) int { - dw.Beep(200, 200) - - /* Return TRUE so we get called again */ - return TRUE -} - -// Page 2 Callbacks -func motion_notify_event(window dw.HRENDER, x int, y int, buttonmask int, data dw.POINTER) int { - var which = "button_press" - - if uintptr(data) > 0 { - which = "motion_notify" - } - dw.Window_set_text(status2, fmt.Sprintf("%s: %dx%d", which, x, y)) - return FALSE -} - -func show_window_callback(window dw.HMENUITEM, data dw.POINTER) int { - thiswindow := dw.POINTER_TO_HANDLE(data) - - if thiswindow != dw.NOHWND { - dw.Window_show(thiswindow) - dw.Window_raise(thiswindow) - } - return TRUE -} - -func context_menu_event(window dw.HANDLE, x int, y int, buttonmask int, data dw.POINTER) int { - hwndMenu := dw.Menu_new(0) - menuitem := dw.Menu_append_item(hwndMenu, "~Quit", dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) - - dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - dw.Menu_append_item(hwndMenu, dw.MENU_SEPARATOR, dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) - menuitem = dw.Menu_append_item(hwndMenu, "~Show Window", dw.MENU_POPUP, 0, TRUE, FALSE, dw.NOMENU) - dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&show_window_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - px, py := dw.Pointer_query_pos() - /* Use the toplevel window handle here.... because on the Mac.. - * using the control itself, when a different tab is active - * the control is removed from the window and can no longer - * handle the messages. - */ - dw.Menu_popup(hwndMenu, mainwindow, px, py) - return TRUE -} - -/* When hpma is not NULL we are printing.. so handle things differently */ -func draw_file(row int, col int, nrows int, fheight int, hpma dw.HPIXMAP) { - var hpm dw.HPIXMAP - - if hpma == dw.NOHPIXMAP { - hpm = text2pm - } else { - hpm = hpma - } - - if len(current_file) > 0 { - var i int - - dw.Color_foreground_set(dw.CLR_WHITE) - if hpma == dw.NOHPIXMAP { - dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)) - } - dw.Draw_rect(dw.NOHWND, hpm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(hpm), dw.Pixmap_height(hpm)) - - for i = 0; (i < nrows) && (i+row < len(lines)); i++ { - fileline := i + row - 1 - y := i * fheight - dw.Color_background_set(dw.COLOR(1 + (fileline % 15))) - dw.Color_foreground_set(dw.COLOR(fileline % 16)) - if hpma == dw.NOHPIXMAP { - dw.Draw_text(dw.NOHWND, text1pm, 0, y, fmt.Sprintf("%6.6d", i+row)) - } - thisline := lines[i+row] - if len(thisline) > col { - dw.Draw_text(dw.NOHWND, hpm, 0, y, thisline[col:]) - } - } - if hpma == dw.NOHPIXMAP { - text_expose(textbox1, 0, 0, 0, 0, nil) - text_expose(textbox2, 0, 0, 0, 0, nil) - } - } -} - -/* When hpma is not NULL we are printing.. so handle things differently */ -func draw_shapes(direct int, hpma dw.HPIXMAP) { - var hpm, pixmap dw.HPIXMAP = dw.NOHPIXMAP, dw.NOHPIXMAP - var window dw.HRENDER - if hpma != dw.NOHPIXMAP { - hpm = hpma - } else { - hpm = text2pm - } - if direct == TRUE { - window = textbox2 - } else { - pixmap = hpm - } - - width := dw.Pixmap_width(hpm) - height := dw.Pixmap_height(hpm) - - x := []int{20, 180, 180, 230, 180, 180, 20} - y := []int{50, 50, 20, 70, 120, 90, 90} - - image_x = dw.Spinbutton_get_pos(imagexspin) - image_y = dw.Spinbutton_get_pos(imageyspin) - image_stretch = dw.Checkbox_get(imagestretchcheck) - - dw.Color_foreground_set(dw.CLR_WHITE) - dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, width, height) - dw.Color_foreground_set(dw.CLR_DARKPINK) - dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 10, 10, width-20, height-20) - dw.Color_foreground_set(dw.CLR_GREEN) - dw.Color_background_set(dw.CLR_DARKRED) - dw.Draw_text(window, pixmap, 10, 10, "This should be aligned with the edges.") - dw.Color_foreground_set(dw.CLR_YELLOW) - dw.Draw_line(window, pixmap, width-10, 10, 10, height-10) - dw.Color_foreground_set(dw.CLR_BLUE) - dw.Draw_polygon(window, pixmap, dw.DRAW_FILL, x, y) - dw.Color_foreground_set(dw.CLR_BLACK) - dw.Draw_rect(window, pixmap, dw.DRAW_FILL|dw.DRAW_NOAA, 80, 80, 80, 40) - dw.Color_foreground_set(dw.CLR_CYAN) - /* Bottom right corner */ - dw.Draw_arc(window, pixmap, 0, width-30, height-30, width-10, height-30, width-30, height-10) - /* Top right corner */ - dw.Draw_arc(window, pixmap, 0, width-30, 30, width-30, 10, width-10, 30) - /* Bottom left corner */ - dw.Draw_arc(window, pixmap, 0, 30, height-30, 30, height-10, 10, height-30) - /* Full circle in the left top area */ - dw.Draw_arc(window, pixmap, dw.DRAW_FULL, 120, 100, 80, 80, 160, 120) - if image != dw.NOHPIXMAP { - if image_stretch == TRUE { - dw.Pixmap_stretch_bitblt(window, pixmap, 10, 10, width-20, height-20, dw.NOHWND, image, 0, 0, dw.Pixmap_width(image), dw.Pixmap_height(image)) - } else { - dw.Pixmap_bitblt(window, pixmap, image_x, image_y, dw.Pixmap_width(image), dw.Pixmap_height(image), dw.NOHWND, image, 0, 0) - } - } - - /* If we aren't drawing direct do a bitblt */ - if direct == FALSE && hpma == dw.NOHPIXMAP { - text_expose(textbox2, 0, 0, 0, 0, nil) - } -} - -func update_render() { - switch render_type { - case 0: - draw_shapes(FALSE, dw.NOHPIXMAP) - case 1: - draw_shapes(TRUE, dw.NOHPIXMAP) - case 2: - draw_file(current_row, current_col, rows, font_height, dw.NOHPIXMAP) - } -} - -func draw_page(print dw.HPRINT, pixmap dw.HPIXMAP, page_num int, data dw.POINTER) int { - dw.Pixmap_set_font(pixmap, FIXEDFONT) - if page_num == 0 { - draw_shapes(FALSE, pixmap) - } else if page_num == 1 { - /* If we have a file to display... */ - if len(current_file) > 0 { - /* Calculate new dimensions */ - _, fheight := dw.Font_text_extents_get(dw.NOHWND, pixmap, "(g") - nrows := int(dw.Pixmap_height(pixmap) / fheight) - - /* Do the actual drawing */ - draw_file(0, 0, nrows, fheight, pixmap) - } else { - /* We don't have a file so center an error message on the page */ - var text = "No file currently selected!" - - /* Get the font size for this printer context... */ - fwidth, fheight := dw.Font_text_extents_get(dw.NOHWND, pixmap, text) - - posx := int(dw.Pixmap_width(pixmap)-fwidth) / 2 - posy := int(dw.Pixmap_height(pixmap)-fheight) / 2 - - dw.Color_foreground_set(dw.CLR_BLACK) - dw.Color_background_set(dw.CLR_WHITE) - dw.Draw_text(dw.NOHWND, pixmap, posx, posy, text) - } - } - return TRUE -} - -func print_callback(window dw.HANDLE, data dw.POINTER) int { - print := dw.Print_new("DWTest Job", 0, 2, dw.SIGNAL_FUNC(&draw_page_func), nil) - dw.Print_run(print, 0) - return FALSE -} - -/* This gets called when a part of the graph needs to be repainted. */ -func text_expose(hwnd dw.HRENDER, x int, y int, width int, height int, data dw.POINTER) int { - if render_type != 1 { - var hpm dw.HPIXMAP - - if hwnd.GetHandle() == textbox1.GetHandle() { - hpm = text1pm - } else if hwnd.GetHandle() == textbox2.GetHandle() { - hpm = text2pm - } else { - return TRUE - } - - width = dw.Pixmap_width(hpm) - height = dw.Pixmap_height(hpm) - - dw.Pixmap_bitblt(hwnd, dw.NOHPIXMAP, 0, 0, width, height, dw.NOHWND, hpm, 0, 0) - dw.Flush() - } else { - update_render() - } - return TRUE -} - -/* Handle size change of the main render window */ -func configure_event(hwnd dw.HRENDER, width int, height int, data dw.POINTER) int { - old1 := text1pm - old2 := text2pm - depth := dw.Color_depth_get() - - rows = height / font_height - cols = width / font_width - - /* Create new pixmaps with the current sizes */ - text1pm = dw.Pixmap_new(textbox1, uint(font_width*(width1)), uint(height), depth) - text2pm = dw.Pixmap_new(textbox2, uint(width), uint(height), depth) - - /* Make sure the side area is cleared */ - dw.Color_foreground_set(dw.CLR_WHITE) - dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, dw.Pixmap_width(text1pm), dw.Pixmap_height(text1pm)) - - /* Destroy the old pixmaps */ - dw.Pixmap_destroy(old1) - dw.Pixmap_destroy(old2) - - /* Update scrollbar ranges with new values */ - dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) - dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) - - /* Redraw the window */ - update_render() - return TRUE -} - -func refresh_callback(window dw.HBUTTON, data dw.POINTER) int { - update_render() - return FALSE -} - -func render_select_event_callback(window dw.HLISTBOX, index int, data dw.POINTER) int { - if index != render_type { - if index == 2 { - dw.Scrollbar_set_range(hscrollbar, uint(max_linewidth), uint(cols)) - dw.Scrollbar_set_pos(hscrollbar, 0) - dw.Scrollbar_set_range(vscrollbar, uint(len(lines)), uint(rows)) - dw.Scrollbar_set_pos(vscrollbar, 0) - current_col = 0 - current_row = 0 - } else { - dw.Scrollbar_set_range(hscrollbar, 0, 0) - dw.Scrollbar_set_pos(hscrollbar, 0) - dw.Scrollbar_set_range(vscrollbar, 0, 0) - dw.Scrollbar_set_pos(vscrollbar, 0) - } - render_type = index - update_render() - } - return FALSE -} - -/* Callback to handle user selection of the scrollbar position */ -func scrollbar_valuechanged_callback(hwnd dw.HSCROLLBAR, value int, data dw.POINTER) int { - if data != nil { - stext := dw.POINTER_TO_HANDLE(data) - - if hwnd == vscrollbar { - current_row = value - } else { - current_col = value - } - dw.Window_set_text(stext, fmt.Sprintf("Row:%d Col:%d Lines:%d Cols:%d", current_row, current_col, len(lines), max_linewidth)) - update_render() - } - return FALSE -} - -func resolve_keyname(vk int) string { - var keyname string = "<unknown>" - - switch vk { - case dw.VK_LBUTTON: - keyname = "VK_LBUTTON" - case dw.VK_RBUTTON: - keyname = "VK_RBUTTON" - case dw.VK_CANCEL: - keyname = "VK_CANCEL" - case dw.VK_MBUTTON: - keyname = "VK_MBUTTON" - case dw.VK_TAB: - keyname = "VK_TAB" - case dw.VK_CLEAR: - keyname = "VK_CLEAR" - case dw.VK_RETURN: - keyname = "VK_RETURN" - case dw.VK_PAUSE: - keyname = "VK_PAUSE" - case dw.VK_CAPITAL: - keyname = "VK_CAPITAL" - case dw.VK_ESCAPE: - keyname = "VK_ESCAPE" - case dw.VK_SPACE: - keyname = "VK_SPACE" - case dw.VK_PRIOR: - keyname = "VK_PRIOR" - case dw.VK_NEXT: - keyname = "VK_NEXT" - case dw.VK_END: - keyname = "VK_END" - case dw.VK_HOME: - keyname = "VK_HOME" - case dw.VK_LEFT: - keyname = "VK_LEFT" - case dw.VK_UP: - keyname = "VK_UP" - case dw.VK_RIGHT: - keyname = "VK_RIGHT" - case dw.VK_DOWN: - keyname = "VK_DOWN" - case dw.VK_SELECT: - keyname = "VK_SELECT" - case dw.VK_PRINT: - keyname = "VK_PRINT" - case dw.VK_EXECUTE: - keyname = "VK_EXECUTE" - case dw.VK_SNAPSHOT: - keyname = "VK_SNAPSHOT" - case dw.VK_INSERT: - keyname = "VK_INSERT" - case dw.VK_DELETE: - keyname = "VK_DELETE" - case dw.VK_HELP: - keyname = "VK_HELP" - case dw.VK_LWIN: - keyname = "VK_LWIN" - case dw.VK_RWIN: - keyname = "VK_RWIN" - case dw.VK_NUMPAD0: - keyname = "VK_NUMPAD0" - case dw.VK_NUMPAD1: - keyname = "VK_NUMPAD1" - case dw.VK_NUMPAD2: - keyname = "VK_NUMPAD2" - case dw.VK_NUMPAD3: - keyname = "VK_NUMPAD3" - case dw.VK_NUMPAD4: - keyname = "VK_NUMPAD4" - case dw.VK_NUMPAD5: - keyname = "VK_NUMPAD5" - case dw.VK_NUMPAD6: - keyname = "VK_NUMPAD6" - case dw.VK_NUMPAD7: - keyname = "VK_NUMPAD7" - case dw.VK_NUMPAD8: - keyname = "VK_NUMPAD8" - case dw.VK_NUMPAD9: - keyname = "VK_NUMPAD9" - case dw.VK_MULTIPLY: - keyname = "VK_MULTIPLY" - case dw.VK_ADD: - keyname = "VK_ADD" - case dw.VK_SEPARATOR: - keyname = "VK_SEPARATOR" - case dw.VK_SUBTRACT: - keyname = "VK_SUBTRACT" - case dw.VK_DECIMAL: - keyname = "VK_DECIMAL" - case dw.VK_DIVIDE: - keyname = "VK_DIVIDE" - case dw.VK_F1: - keyname = "VK_F1" - case dw.VK_F2: - keyname = "VK_F2" - case dw.VK_F3: - keyname = "VK_F3" - case dw.VK_F4: - keyname = "VK_F4" - case dw.VK_F5: - keyname = "VK_F5" - case dw.VK_F6: - keyname = "VK_F6" - case dw.VK_F7: - keyname = "VK_F7" - case dw.VK_F8: - keyname = "VK_F8" - case dw.VK_F9: - keyname = "VK_F9" - case dw.VK_F10: - keyname = "VK_F10" - case dw.VK_F11: - keyname = "VK_F11" - case dw.VK_F12: - keyname = "VK_F12" - case dw.VK_F13: - keyname = "VK_F13" - case dw.VK_F14: - keyname = "VK_F14" - case dw.VK_F15: - keyname = "VK_F15" - case dw.VK_F16: - keyname = "VK_F16" - case dw.VK_F17: - keyname = "VK_F17" - case dw.VK_F18: - keyname = "VK_F18" - case dw.VK_F19: - keyname = "VK_F19" - case dw.VK_F20: - keyname = "VK_F20" - case dw.VK_F21: - keyname = "VK_F21" - case dw.VK_F22: - keyname = "VK_F22" - case dw.VK_F23: - keyname = "VK_F23" - case dw.VK_F24: - keyname = "VK_F24" - case dw.VK_NUMLOCK: - keyname = "VK_NUMLOCK" - case dw.VK_SCROLL: - keyname = "VK_SCROLL" - case dw.VK_LSHIFT: - keyname = "VK_LSHIFT" - case dw.VK_RSHIFT: - keyname = "VK_RSHIFT" - case dw.VK_LCONTROL: - keyname = "VK_LCONTROL" - case dw.VK_RCONTROL: - keyname = "VK_RCONTROL" - } - return keyname -} - -func resolve_keymodifiers(mask int) string { - if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { - return "KC_CTRL KC_SHIFT KC_ALT" - } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_SHIFT) == dw.KC_SHIFT { - return "KC_CTRL KC_SHIFT" - } else if (mask&dw.KC_CTRL) == dw.KC_CTRL && (mask&dw.KC_ALT) == dw.KC_ALT { - return "KC_CTRL KC_ALT" - } else if (mask&dw.KC_SHIFT) == dw.KC_SHIFT && (mask&dw.KC_ALT) == dw.KC_ALT { - return "KC_SHIFT KC_ALT" - } else if (mask & dw.KC_SHIFT) == dw.KC_SHIFT { - return "KC_SHIFT" - } else if (mask & dw.KC_CTRL) == dw.KC_CTRL { - return "KC_CTRL" - } else if (mask & dw.KC_ALT) == dw.KC_ALT { - return "KC_ALT" - } - return "none" -} - -func keypress_callback(window dw.HWND, ch uint8, vk int, state int, data dw.POINTER, utf8 string) int { - var message string - - if ch != 0 { - message = fmt.Sprintf("Key: %c(%d) Modifiers: %s(%d) utf8 %s", ch, ch, resolve_keymodifiers(state), state, utf8) - } else { - message = fmt.Sprintf("Key: %s(%d) Modifiers: %s(%d) utf8 %s", resolve_keyname(vk), vk, resolve_keymodifiers(state), state, utf8) - } - dw.Window_set_text(status1, message) - return FALSE -} - -// Page 3 and 4 Callbacks -func item_enter_cb(window dw.HCONTAINER, text string, data dw.POINTER, itemdata dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), text, uintptr(itemdata)) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - return FALSE -} - -func item_context_cb(window dw.HCONTAINER, text string, x int, y int, data dw.POINTER, itemdata dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), - text, x, y, uintptr(itemdata)) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - return FALSE -} - -func list_select_cb(window dw.HLISTBOX, item int, data dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_LIST_SELECT: Window: %x Item: %d", dw.HANDLE_TO_UINTPTR(window), item) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - return FALSE -} - -func item_select_cb(window dw.HTREE, item dw.HTREEITEM, text string, data dw.POINTER, itemdata dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), - dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - return FALSE -} - -func container_select_cb(window dw.HCONTAINER, item dw.HTREEITEM, text string, data dw.POINTER, itemdata dw.POINTER) int { - message := fmt.Sprintf("DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), - dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - message = fmt.Sprintf("\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", dw.HANDLE_TO_UINTPTR(window), - dw.HANDLE_TO_UINTPTR(item), text, uintptr(itemdata)) - mle_point = dw.Mle_import(container_mle, message, mle_point) - str := dw.Container_query_start(container, dw.CRA_SELECTED) - for len(str) > 0 { - mle_point = dw.Mle_import(container_mle, fmt.Sprintf("Selected: %s\r\n", str), mle_point) - str = dw.Container_query_next(container, dw.CRA_SELECTED) - } - /* Make the last inserted point the cursor location */ - dw.Mle_set_cursor(container_mle, mle_point) - /* set the details of item 0 to new data */ - dw.Filesystem_change_file(container, 0, "new data", fileicon) - dw.Filesystem_change_item_ulong(container, 1, 0, 999) - return FALSE -} - -func combobox_select_event_callback(window dw.HLISTBOX, index int, data dw.POINTER) int { - fmt.Printf("got combobox_select_event for index: %d, iteration: %d\n", index, iteration) - iteration++ - return FALSE -} - -func column_click_cb(window dw.HCONTAINER, column_num int, data dw.POINTER) int { - var stype = "Unknown" - - if column_num == 0 { - stype = "Filename" - } else { - column_type := dw.Filesystem_get_column_type(window, column_num-1) - if column_type == dw.CFA_STRING { - stype = "String" - } else if column_type == dw.CFA_ULONG { - stype = "ULong" - } else if column_type == dw.CFA_DATE { - stype = "Date" - } else if column_type == dw.CFA_TIME { - stype = "Time" - } else if column_type == dw.CFA_BITMAPORICON { - stype = "BitmapOrIcon" - } - } - message := fmt.Sprintf("DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", dw.HANDLE_TO_UINTPTR(window), - column_num, stype) - dw.Window_set_text(dw.POINTER_TO_HANDLE(data), message) - return FALSE -} - -// Page 5 Callbacks -func button_callback(window dw.HBUTTON, data dw.POINTER) int { - idx := dw.Listbox_selected(combobox1) - buf1 := dw.Listbox_get_text(combobox1, idx) - idx = dw.Listbox_selected(combobox2) - buf2 := dw.Listbox_get_text(combobox2, idx) - y, m, d := dw.Calendar_get_date(cal) - spvalue := dw.Spinbutton_get_pos(spinbutton) - message := fmt.Sprintf("spinbutton: %d\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d", - spvalue, - buf1, buf2, - y, m, d) - dw.Messagebox("Values", dw.MB_OK|dw.MB_INFORMATION, message) - return FALSE -} - -var isfoldericon bool = true - -func bitmap_toggle_callback(window dw.HBUTTON, data dw.POINTER) int { - if isfoldericon == true { - isfoldericon = false - dw.Window_set_bitmap(window, 0, FILE_ICON_NAME) - dw.Window_set_tooltip(window, "File Icon") - } else { - isfoldericon = true - //dw.Window_set_bitmap_from_data(window, 0, folder_ico, sizeof(folder_ico)); - dw.Window_set_tooltip(window, "Folder Icon") - } - return FALSE -} - -func percent_button_box_callback(window dw.HBUTTON, data dw.POINTER) int { - dw.Percent_set_pos(percent, dw.PERCENT_INDETERMINATE) - return FALSE -} - -func change_color_red_callback(window dw.HBUTTON, data dw.POINTER) int { - dw.Window_set_color(buttonsbox, dw.CLR_RED, dw.CLR_RED) - return FALSE -} - -func change_color_yellow_callback(window dw.HBUTTON, data dw.POINTER) int { - dw.Window_set_color(buttonsbox, dw.CLR_YELLOW, dw.CLR_YELLOW) - return FALSE -} - -/* Callback to handle user selection of the spinbutton position */ -func spinbutton_valuechanged_callback(hwnd dw.HSPINBUTTON, value int, data dw.POINTER) int { - dw.Messagebox("DWTest", dw.MB_OK, fmt.Sprintf("New value from spinbutton: %d\n", value)) - return FALSE -} - -/* Callback to handle user selection of the slider position */ -func slider_valuechanged_callback(hwnd dw.HSLIDER, value int, data dw.POINTER) int { - dw.Percent_set_pos(percent, uint(value*10)) - return FALSE -} - -// Page 8 Callbacks -func scrollbox_button_callback(window dw.HBUTTON, data dw.POINTER) int { - _, pos := dw.Scrollbox_get_pos(scrollbox) - _, rng := dw.Scrollbox_get_range(scrollbox) - fmt.Printf("Pos %d Range %d\n", pos, rng) - return FALSE -} - -// Page 9 Callbacks -func run_thread(threadnum int) { - dw.InitThread() - update_mle(fmt.Sprintf("Thread %d started.\r\n", threadnum), TRUE) - - /* Increment the ready count while protected by mutex */ - dw.Mutex_lock(mutex) - ready++ - /* If all 4 threads have incrememted the ready count... - * Post the control event semaphore so things will get started. - */ - if ready == 4 { - dw.Event_post(controlevent) - } - dw.Mutex_unlock(mutex) - - for finished == 0 { - result := dw.Event_wait(workevent, 2000) - - if result == dw.ERROR_TIMEOUT { - update_mle(fmt.Sprintf("Thread %d timeout waiting for event.\r\n", threadnum), dw.TRUE) - } else if result == dw.ERROR_NONE { - update_mle(fmt.Sprintf("Thread %d doing some work.\r\n", threadnum), dw.TRUE) - /* Pretend to do some work */ - dw.Main_sleep(1000 * threadnum) - - /* Increment the ready count while protected by mutex */ - dw.Mutex_lock(mutex) - ready++ - buf := fmt.Sprintf("Thread %d work done. ready=%d", threadnum, ready) - /* If all 4 threads have incrememted the ready count... - * Post the control event semaphore so things will get started. - */ - if ready == 4 { - dw.Event_post(controlevent) - buf = fmt.Sprintf("%s%s", buf, " Control posted.") - } - dw.Mutex_unlock(mutex) - update_mle(fmt.Sprintf("%s\r\n", buf), dw.TRUE) - } else { - update_mle(fmt.Sprintf("Thread %d error %d.\r\n", threadnum), dw.TRUE) - dw.Main_sleep(10000) - } - } - update_mle(fmt.Sprintf("Thread %d finished.\r\n", threadnum), dw.TRUE) - dw.DeinitThread() -} - -func control_thread() { - dw.InitThread() - - inprogress := 5 - - for inprogress != 0 { - result := dw.Event_wait(controlevent, 2000) - - if result == dw.ERROR_TIMEOUT { - update_mle("Control thread timeout waiting for event.\r\n", dw.TRUE) - } else if result == dw.ERROR_NONE { - /* Reset the control event */ - dw.Event_reset(controlevent) - ready = 0 - update_mle(fmt.Sprintf("Control thread starting worker threads. Inprogress=%d\r\n", inprogress), dw.TRUE) - /* Start the work threads */ - dw.Event_post(workevent) - dw.Main_sleep(100) - /* Reset the work event */ - dw.Event_reset(workevent) - inprogress-- - } else { - update_mle(fmt.Sprintf("Control thread error %d.\r\n", result), dw.TRUE) - dw.Main_sleep(10000) - } - } - /* Tell the other threads we are done */ - finished = dw.TRUE - dw.Event_post(workevent) - /* Close the control event */ - dw.Event_close(&controlevent) - update_mle("Control thread finished.\r\n", dw.TRUE) - dw.Window_enable(startbutton) - dw.DeinitThread() -} - -func start_threads_button_callback(window dw.HWND, data dw.POINTER) int { - dw.Window_disable(startbutton) - dw.Mutex_lock(mutex) - controlevent = dw.Event_new() - dw.Event_reset(workevent) - finished = FALSE - ready = 0 - update_mle("Starting thread 1\r\n", FALSE) - go run_thread(1) - update_mle("Starting thread 2\r\n", FALSE) - go run_thread(2) - update_mle("Starting thread 3\r\n", FALSE) - go run_thread(3) - update_mle("Starting thread 4\r\n", FALSE) - go run_thread(4) - update_mle("Starting control thread\r\n", FALSE) - go control_thread() - dw.Mutex_unlock(mutex) - return FALSE -} - -var exit_callback_func = exit_callback -var copy_clicked_callback_func = copy_clicked_callback -var paste_clicked_callback_func = paste_clicked_callback -var browse_file_callback_func = browse_file_callback -var browse_folder_callback_func = browse_folder_callback -var colorchoose_callback_func = colorchoose_callback -var cursortoggle_callback_func = cursortoggle_callback -var beep_callback_func = beep_callback -var timer_callback_func = timer_callback -var switch_page_callback_func = switch_page_callback -var helpabout_callback_func = helpabout_callback -var menu_callback_func = menu_callback -var menutoggle_callback_func = menutoggle_callback -var text_expose_func = text_expose -var configure_event_func = configure_event -var motion_notify_event_func = motion_notify_event -var show_window_callback_func = show_window_callback -var context_menu_event_func = context_menu_event -var refresh_callback_func = refresh_callback -var render_select_event_callback_func = render_select_event_callback -var scrollbar_valuechanged_callback_func = scrollbar_valuechanged_callback -var keypress_callback_func = keypress_callback -var item_enter_cb_func = item_enter_cb -var item_context_cb_func = item_context_cb -var list_select_cb_func = list_select_cb -var item_select_cb_func = item_select_cb -var column_click_cb_func = column_click_cb -var container_select_cb_func = container_select_cb -var combobox_select_event_callback_func = combobox_select_event_callback -var scrollbox_button_callback_func = scrollbox_button_callback -var button_callback_func = button_callback -var bitmap_toggle_callback_func = bitmap_toggle_callback -var percent_button_box_callback_func = percent_button_box_callback -var change_color_red_callback_func = change_color_red_callback -var change_color_yellow_callback_func = change_color_yellow_callback -var spinbutton_valuechanged_callback_func = spinbutton_valuechanged_callback -var slider_valuechanged_callback_func = slider_valuechanged_callback -var print_callback_func = print_callback -var draw_page_func = draw_page -var start_threads_button_callback_func = start_threads_button_callback - -var checkable_string = "checkable" -var noncheckable_string = "non-checkable" - -// Create the menu -func menu_add() { - mainmenubar := dw.Menubar_new(mainwindow) - /* add menus to the menubar */ - menu := dw.Menu_new(0) - menuitem := dw.Menu_append_item(menu, "~Quit", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) - dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - /* - * Add the "File" menu to the menubar... - */ - dw.Menu_append_item(mainmenubar, "~File", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) - - changeable_menu := dw.Menu_new(0) - checkable_menuitem = dw.Menu_append_item(changeable_menu, "~Checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) - dw.Signal_connect(checkable_menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menu_callback_func), dw.POINTER(&checkable_string)) - noncheckable_menuitem = dw.Menu_append_item(changeable_menu, "~Non-checkable Menu Item", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) - dw.Signal_connect(noncheckable_menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menu_callback_func), dw.POINTER(&noncheckable_string)) - dw.Menu_append_item(changeable_menu, "~Disabled menu Item", dw.MENU_AUTO, dw.MIS_DISABLED|dw.MIS_CHECKED, dw.TRUE, dw.TRUE, dw.NOMENU) - /* seperator */ - dw.Menu_append_item(changeable_menu, dw.MENU_SEPARATOR, dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) - menuitem = dw.Menu_append_item(changeable_menu, "~Menu Items Disabled", dw.MENU_AUTO, 0, dw.TRUE, dw.TRUE, dw.NOMENU) - dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&menutoggle_callback_func), nil) - /* - * Add the "Menu" menu to the menubar... - */ - dw.Menu_append_item(mainmenubar, "~Menu", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, changeable_menu) - - menu = dw.Menu_new(0) - menuitem = dw.Menu_append_item(menu, "~About", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, dw.NOMENU) - dw.Signal_connect(menuitem, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&helpabout_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - /* - * Add the "Help" menu to the menubar... - */ - dw.Menu_append_item(mainmenubar, "~Help", dw.MENU_AUTO, 0, dw.TRUE, dw.FALSE, menu) -} - -// Create Page 1 -func archive_add() { - lbbox := dw.Box_new(dw.VERT, 10) - - dw.Box_pack_start(notebookbox1, lbbox, 150, 70, dw.TRUE, dw.TRUE, 0) - - /* Copy and Paste */ - browsebox := dw.Box_new(dw.HORZ, 0) - - dw.Box_pack_start(lbbox, browsebox, 0, 0, dw.FALSE, dw.FALSE, 0) - - copypastefield = dw.Entryfield_new("", 0) - - dw.Entryfield_set_limit(copypastefield, 260) - - dw.Box_pack_start(browsebox, copypastefield, -1, -1, dw.TRUE, dw.FALSE, 4) - - copybutton := dw.Button_new("Copy", 0) - - dw.Box_pack_start(browsebox, copybutton, -1, -1, dw.FALSE, dw.FALSE, 0) - - pastebutton := dw.Button_new("Paste", 0) - - dw.Box_pack_start(browsebox, pastebutton, -1, -1, dw.FALSE, dw.FALSE, 0) - - /* Archive Name */ - stext := dw.Text_new("File to browse", 0) - - dw.Window_set_style(stext, dw.DT_VCENTER, dw.DT_VCENTER) - - dw.Box_pack_start(lbbox, stext, 130, 15, dw.TRUE, dw.TRUE, 2) - - browsebox = dw.Box_new(dw.HORZ, 0) - - dw.Box_pack_start(lbbox, browsebox, 0, 0, dw.TRUE, dw.TRUE, 0) - - entryfield = dw.Entryfield_new("", 100) - - dw.Entryfield_set_limit(entryfield, 260) - - dw.Box_pack_start(browsebox, entryfield, 100, 15, dw.TRUE, dw.TRUE, 4) - - browsefilebutton := dw.Button_new("Browse File", 1001) - - dw.Box_pack_start(browsebox, browsefilebutton, 40, 15, dw.TRUE, dw.TRUE, 0) - - browsefolderbutton := dw.Button_new("Browse Folder", 1001) - - dw.Box_pack_start(browsebox, browsefolderbutton, 40, 15, dw.TRUE, dw.TRUE, 0) - - dw.Window_set_color(browsebox, dw.CLR_PALEGRAY, dw.CLR_PALEGRAY) - dw.Window_set_color(stext, dw.CLR_BLACK, dw.CLR_PALEGRAY) - - /* Buttons */ - buttonbox := dw.Box_new(dw.HORZ, 10) - - dw.Box_pack_start(lbbox, buttonbox, 0, 0, dw.TRUE, dw.TRUE, 0) - - cancelbutton := dw.Button_new("Exit", 1002) - dw.Box_pack_start(buttonbox, cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) - - cursortogglebutton = dw.Button_new("Set Cursor pointer - CLOCK", 1003) - dw.Box_pack_start(buttonbox, cursortogglebutton, 130, 30, dw.TRUE, dw.TRUE, 2) - - okbutton := dw.Button_new("Turn Off Annoying Beep!", 1001) - dw.Box_pack_start(buttonbox, okbutton, 130, 30, dw.TRUE, dw.TRUE, 2) - - dw.Box_unpack(cancelbutton) - dw.Box_pack_start(buttonbox, cancelbutton, 130, 30, dw.TRUE, dw.TRUE, 2) - dw.Window_click_default(mainwindow, cancelbutton) - - colorchoosebutton := dw.Button_new("Color Chooser Dialog", 1004) - dw.Box_pack_at_index(buttonbox, colorchoosebutton, 1, 130, 30, dw.TRUE, dw.TRUE, 2) - - /* Set some nice fonts and colors */ - dw.Window_set_color(lbbox, dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) - dw.Window_set_color(buttonbox, dw.CLR_DARKCYAN, dw.CLR_PALEGRAY) - dw.Window_set_color(okbutton, dw.CLR_PALEGRAY, dw.CLR_DARKCYAN) - - dw.Signal_connect(browsefilebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&browse_file_callback_func), nil) - dw.Signal_connect(browsefolderbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&browse_folder_callback_func), nil) - dw.Signal_connect(copybutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(©_clicked_callback_func), dw.HANDLE_TO_POINTER(copypastefield)) - dw.Signal_connect(pastebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&paste_clicked_callback_func), dw.HANDLE_TO_POINTER(copypastefield)) - dw.Signal_connect(okbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&beep_callback_func), nil) - dw.Signal_connect(cancelbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - dw.Signal_connect(cursortogglebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&cursortoggle_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - dw.Signal_connect(colorchoosebutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&colorchoose_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) -} - -// Create Page 2 -func text_add() { - depth := dw.Color_depth_get() - - /* create a box to pack into the notebook page */ - pagebox := dw.Box_new(dw.HORZ, 2) - dw.Box_pack_start(notebookbox2, pagebox, 0, 0, dw.TRUE, dw.TRUE, 0) - /* now a status area under this box */ - hbox := dw.Box_new(dw.HORZ, 1) - dw.Box_pack_start(notebookbox2, hbox, 100, 20, dw.TRUE, dw.FALSE, 1) - status1 = dw.Status_text_new("", 0) - dw.Box_pack_start(hbox, status1, 100, -1, dw.TRUE, dw.FALSE, 1) - status2 = dw.Status_text_new("", 0) - dw.Box_pack_start(hbox, status2, 100, -1, dw.TRUE, dw.FALSE, 1) - /* a box with combobox and button */ - hbox = dw.Box_new(dw.HORZ, 1) - dw.Box_pack_start(notebookbox2, hbox, 100, 25, dw.TRUE, dw.FALSE, 1) - rendcombo := dw.Combobox_new("Shapes Double Buffered", 0) - dw.Box_pack_start(hbox, rendcombo, 80, 25, dw.TRUE, dw.FALSE, 0) - dw.Listbox_append(rendcombo, "Shapes Double Buffered") - dw.Listbox_append(rendcombo, "Shapes Direct") - dw.Listbox_append(rendcombo, "File Display") - label := dw.Text_new("Image X:", 100) - dw.Window_set_style(label, dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) - dw.Box_pack_start(hbox, label, -1, 25, dw.FALSE, dw.FALSE, 0) - imagexspin = dw.Spinbutton_new("20", 1021) - dw.Box_pack_start(hbox, imagexspin, 25, 25, dw.TRUE, dw.FALSE, 0) - label = dw.Text_new("Y:", 100) - dw.Window_set_style(label, dw.DT_VCENTER|dw.DT_CENTER, dw.DT_VCENTER|dw.DT_CENTER) - dw.Box_pack_start(hbox, label, -1, 25, dw.FALSE, dw.FALSE, 0) - imageyspin = dw.Spinbutton_new("20", 1021) - dw.Box_pack_start(hbox, imageyspin, 25, 25, dw.TRUE, dw.FALSE, 0) - dw.Spinbutton_set_limits(imagexspin, 2000, 0) - dw.Spinbutton_set_limits(imageyspin, 2000, 0) - dw.Spinbutton_set_pos(imagexspin, 20) - dw.Spinbutton_set_pos(imageyspin, 20) - imagestretchcheck = dw.Checkbox_new("Stretch", 1021) - dw.Box_pack_start(hbox, imagestretchcheck, -1, 25, dw.FALSE, dw.FALSE, 0) - - button1 := dw.Button_new("Refresh", 1223) - dw.Box_pack_start(hbox, button1, 100, 25, dw.FALSE, dw.FALSE, 0) - button2 := dw.Button_new("Print", 1224) - dw.Box_pack_start(hbox, button2, 100, 25, dw.FALSE, dw.FALSE, 0) - - /* Pre-create the scrollbars so we can query their sizes */ - vscrollbar = dw.Scrollbar_new(dw.VERT, 50) - hscrollbar = dw.Scrollbar_new(dw.HORZ, 50) - vscrollbarwidth, _ := dw.Window_get_preferred_size(vscrollbar) - _, hscrollbarheight := dw.Window_get_preferred_size(hscrollbar) - - /* On GTK with overlay scrollbars enabled this returns us 0... - * so in that case we need to give it some real values. - */ - if vscrollbarwidth == 0 { - vscrollbarwidth = 8 - } - if hscrollbarheight == 0 { - hscrollbarheight = 8 - } - - /* create render box for number pixmap */ - textbox1 = dw.Render_new(100) - dw.Window_set_font(textbox1, FIXEDFONT) - font_width, font_height = dw.Font_text_extents_get(textbox1, dw.NOHPIXMAP, "(g") - font_width = font_width / 2 - vscrollbox := dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, dw.FALSE, dw.TRUE, 0) - dw.Box_pack_start(vscrollbox, dw.NOHWND, font_width*(width1+1), hscrollbarheight, dw.FALSE, dw.FALSE, 0) - dw.Box_pack_start(pagebox, vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) - - /* pack empty space 1 character wide */ - dw.Box_pack_start(pagebox, dw.NOHWND, font_width, 0, dw.FALSE, dw.TRUE, 0) - - /* create box for filecontents and horz scrollbar */ - textboxA := dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(pagebox, textboxA, 0, 0, dw.TRUE, dw.TRUE, 0) - - /* create render box for filecontents pixmap */ - textbox2 = dw.Render_new(101) - dw.Box_pack_start(textboxA, textbox2, 10, 10, dw.TRUE, dw.TRUE, 0) - dw.Window_set_font(textbox2, FIXEDFONT) - /* create horizonal scrollbar */ - dw.Box_pack_start(textboxA, hscrollbar, -1, -1, dw.TRUE, dw.FALSE, 0) - - /* create vertical scrollbar */ - vscrollbox = dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(vscrollbox, vscrollbar, -1, -1, dw.FALSE, dw.TRUE, 0) - /* Pack an area of empty space 14x14 pixels */ - dw.Box_pack_start(vscrollbox, dw.NOHWND, vscrollbarwidth, hscrollbarheight, dw.FALSE, dw.FALSE, 0) - dw.Box_pack_start(pagebox, vscrollbox, 0, 0, dw.FALSE, dw.TRUE, 0) - - text1pm = dw.Pixmap_new(textbox1, uint(font_width*width1), uint(font_height*rows), depth) - text2pm = dw.Pixmap_new(textbox2, uint(font_width*cols), uint(font_height*rows), depth) - image = dw.Pixmap_new_from_file(textbox2, "test") - if image == dw.NOHPIXMAP && len(SRCROOT) > 0 { - image = dw.Pixmap_new_from_file(textbox2, fmt.Sprintf("%s/test", SRCROOT)) - } - if image != dw.NOHPIXMAP { - dw.Pixmap_set_transparent_color(image, dw.CLR_WHITE) - } - - dw.Messagebox("DWTest", dw.MB_OK|dw.MB_INFORMATION, fmt.Sprintf("Width: %d Height: %d\n", font_width, font_height)) - dw.Draw_rect(dw.NOHWND, text1pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*width1, font_height*rows) - dw.Draw_rect(dw.NOHWND, text2pm, dw.DRAW_FILL|dw.DRAW_NOAA, 0, 0, font_width*cols, font_height*rows) - dw.Signal_connect(textbox1, dw.SIGNAL_BUTTON_PRESS, dw.SIGNAL_FUNC(&context_menu_event_func), nil) - dw.Signal_connect(textbox1, dw.SIGNAL_EXPOSE, dw.SIGNAL_FUNC(&text_expose_func), nil) - dw.Signal_connect(textbox2, dw.SIGNAL_EXPOSE, dw.SIGNAL_FUNC(&text_expose_func), nil) - dw.Signal_connect(textbox2, dw.SIGNAL_CONFIGURE, dw.SIGNAL_FUNC(&configure_event_func), nil) - dw.Signal_connect(textbox2, dw.SIGNAL_MOTION_NOTIFY, dw.SIGNAL_FUNC(&motion_notify_event_func), dw.POINTER(uintptr(1))) - dw.Signal_connect(textbox2, dw.SIGNAL_BUTTON_PRESS, dw.SIGNAL_FUNC(&motion_notify_event_func), nil) - dw.Signal_connect(hscrollbar, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&scrollbar_valuechanged_callback_func), dw.HANDLE_TO_POINTER(status1)) - dw.Signal_connect(vscrollbar, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&scrollbar_valuechanged_callback_func), dw.HANDLE_TO_POINTER(status1)) - dw.Signal_connect(imagestretchcheck, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&refresh_callback_func), nil) - dw.Signal_connect(button1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&refresh_callback_func), nil) - dw.Signal_connect(button2, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&print_callback_func), nil) - dw.Signal_connect(rendcombo, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&render_select_event_callback_func), nil) - dw.Signal_connect(mainwindow, dw.SIGNAL_KEY_PRESS, dw.SIGNAL_FUNC(&keypress_callback_func), nil) - - dw.Taskbar_insert(textbox1, fileicon, "DWTest") -} - -// Page 3 -func tree_add() { - /* create a box to pack into the notebook page */ - listbox := dw.Listbox_new(1024, TRUE) - dw.Box_pack_start(notebookbox3, listbox, 500, 200, TRUE, TRUE, 0) - dw.Listbox_append(listbox, "Test 1") - dw.Listbox_append(listbox, "Test 2") - dw.Listbox_append(listbox, "Test 3") - dw.Listbox_append(listbox, "Test 4") - dw.Listbox_append(listbox, "Test 5") - - /* now a tree area under this box */ - tree = dw.Tree_new(101) - dw.Box_pack_start(notebookbox3, tree, 500, 200, TRUE, TRUE, 1) - - /* and a status area to see whats going on */ - tree_status := dw.Status_text_new("", 0) - dw.Box_pack_start(notebookbox3, tree_status, 100, -1, TRUE, FALSE, 1) - - /* set up our signal trappers... */ - dw.Signal_connect(tree, dw.SIGNAL_ITEM_CONTEXT, dw.SIGNAL_FUNC(&item_context_cb_func), dw.HANDLE_TO_POINTER(tree_status)) - dw.Signal_connect(tree, dw.SIGNAL_ITEM_SELECT, dw.SIGNAL_FUNC(&item_select_cb_func), dw.HANDLE_TO_POINTER(tree_status)) - - t1 := dw.Tree_insert(tree, "tree folder 1", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(1))) - t2 := dw.Tree_insert(tree, "tree folder 2", foldericon, dw.NOHTREEITEM, dw.POINTER(uintptr(2))) - dw.Tree_insert(tree, "tree file 1", fileicon, t1, dw.POINTER(uintptr(3))) - dw.Tree_insert(tree, "tree file 2", fileicon, t1, dw.POINTER(uintptr(4))) - dw.Tree_insert(tree, "tree file 3", fileicon, t2, dw.POINTER(uintptr(5))) - dw.Tree_insert(tree, "tree file 4", fileicon, t2, dw.POINTER(uintptr(6))) - dw.Tree_item_change(tree, t1, "tree folder 1", foldericon) - dw.Tree_item_change(tree, t2, "tree folder 2", foldericon) - dw.Tree_item_set_data(tree, t2, dw.POINTER(uintptr(100))) - fmt.Printf("t1 title \"%s\" data %d t2 data %d\n", dw.Tree_get_title(tree, t1), uintptr(dw.Tree_item_get_data(tree, t1)), uintptr(dw.Tree_item_get_data(tree, t2))) -} - -// Page 4 -func container_add() { - var z int - titles := []string{"Type", "Size", "Time", "Date"} - flags := []uint{dw.CFA_BITMAPORICON | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_ULONG | dw.CFA_RIGHT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_TIME | dw.CFA_CENTER | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR, - dw.CFA_DATE | dw.CFA_LEFT | dw.CFA_HORZSEPARATOR | dw.CFA_SEPARATOR} - - /* create a box to pack into the notebook page */ - containerbox := dw.Box_new(dw.HORZ, 2) - dw.Box_pack_start(notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0) - - /* now a container area under this box */ - container = dw.Container_new(100, TRUE) - dw.Box_pack_start(notebookbox4, container, 500, 200, TRUE, FALSE, 1) - - /* and a status area to see whats going on */ - container_status := dw.Status_text_new("", 0) - dw.Box_pack_start(notebookbox4, container_status, 100, -1, TRUE, FALSE, 1) - - dw.Filesystem_set_column_title(container, "Test") - dw.Filesystem_setup(container, flags, titles) - dw.Container_set_stripe(container, dw.CLR_DEFAULT, dw.CLR_DEFAULT) - containerinfo := dw.Container_alloc(container, 3) - - for z = 0; z < 3; z++ { - var thisicon dw.HICN = fileicon - - if z == 0 { - thisicon = foldericon - } - fmt.Printf("Initial: container: %x containerinfo: %x icon: %x\n", uintptr(dw.HANDLE_TO_POINTER(container)), - dw.HANDLE_TO_UINTPTR(containerinfo), uintptr(dw.POINTER(thisicon))) - dw.Filesystem_set_file(container, containerinfo, z, fmt.Sprintf("Filename %d", z+1), thisicon) - dw.Filesystem_set_item_icon(container, containerinfo, 0, z, thisicon) - dw.Filesystem_set_item_ulong(container, containerinfo, 1, z, uint(z*100)) - dw.Filesystem_set_item_time(container, containerinfo, 2, z, z+10, z+10, z+10) - dw.Filesystem_set_item_date(container, containerinfo, 3, z, z+10, z+10, z+2000) - dw.Container_set_row_title(containerinfo, z, fmt.Sprintf("We can now allocate from the stack: Item: %d", z)) - dw.Container_set_row_data(containerinfo, z, dw.POINTER(uintptr(z))) - } - dw.Container_insert(container, containerinfo, 3) - - containerinfo = dw.Container_alloc(container, 1) - dw.Filesystem_set_file(container, containerinfo, 0, "Yikes", foldericon) - dw.Filesystem_set_item_icon(container, containerinfo, 0, 0, foldericon) - dw.Filesystem_set_item_ulong(container, containerinfo, 1, 0, 324) - dw.Filesystem_set_item_time(container, containerinfo, 2, 0, z+10, z+10, z+10) - dw.Filesystem_set_item_date(container, containerinfo, 3, 0, z+10, z+10, z+2000) - dw.Container_set_row_title(containerinfo, 0, "Extra") - - dw.Container_insert(container, containerinfo, 1) - dw.Container_optimize(container) - - container_mle = dw.Mle_new(111) - dw.Box_pack_start(containerbox, container_mle, 500, 200, TRUE, TRUE, 0) - - mle_point = dw.Mle_import(container_mle, "", -1) - mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]", mle_point), mle_point) - mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]abczxydefijkl", mle_point), mle_point) - dw.Mle_delete(container_mle, 9, 3) - mle_point = dw.Mle_import(container_mle, "gh", 12) - newpoint, _ := dw.Mle_get_size(container_mle) - mle_point = newpoint - mle_point = dw.Mle_import(container_mle, fmt.Sprintf("[%d]\r\n\r\n", mle_point), mle_point) - dw.Mle_set_cursor(container_mle, mle_point) - /* connect our event trappers... */ - dw.Signal_connect(container, dw.SIGNAL_ITEM_ENTER, dw.SIGNAL_FUNC(&item_enter_cb_func), dw.HANDLE_TO_POINTER(container_status)) - dw.Signal_connect(container, dw.SIGNAL_ITEM_CONTEXT, dw.SIGNAL_FUNC(&item_context_cb_func), dw.HANDLE_TO_POINTER(container_status)) - dw.Signal_connect(container, dw.SIGNAL_ITEM_SELECT, dw.SIGNAL_FUNC(&container_select_cb_func), dw.HANDLE_TO_POINTER(container_status)) - dw.Signal_connect(container, dw.SIGNAL_COLUMN_CLICK, dw.SIGNAL_FUNC(&column_click_cb_func), dw.HANDLE_TO_POINTER(container_status)) -} - -// Page 5 -func buttons_add() { - var i int - - /* create a box to pack into the notebook page */ - buttonsbox = dw.Box_new(dw.VERT, 2) - dw.Box_pack_start(notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0) - dw.Window_set_color(buttonsbox, dw.CLR_RED, dw.CLR_RED) - - calbox := dw.Box_new(dw.HORZ, 0) - dw.Box_pack_start(notebookbox5, calbox, 500, 200, TRUE, TRUE, 1) - cal = dw.Calendar_new(100) - dw.Box_pack_start(calbox, cal, 180, 120, TRUE, TRUE, 0) - /* - dw.Calendar_set_date(cal, 2001, 1, 1); - */ - /* - * Create our file toolbar boxes... - */ - buttonboxperm = dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2) - dw.Window_set_color(buttonboxperm, dw.CLR_WHITE, dw.CLR_WHITE) - abutton1 := dw.Bitmapbutton_new_from_file("Top Button", 0, fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) - dw.Box_pack_start(buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0) - dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&button_callback_func), nil) - dw.Box_pack_start(buttonboxperm, dw.NOHWND, 25, 5, FALSE, FALSE, 0) - abutton2 := dw.Bitmapbutton_new_from_file("Bottom", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) - dw.Box_pack_start(buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0) - dw.Signal_connect(abutton2, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&button_callback_func), nil) - dw.Window_set_bitmap(abutton2, 0, FILE_ICON_NAME) - - create_button(false) - /* make a combobox */ - combox := dw.Box_new(dw.VERT, 2) - dw.Box_pack_start(notebookbox5, combox, 25, 200, TRUE, FALSE, 0) - combobox1 = dw.Combobox_new("fred", 0) /* no point in specifying an initial value */ - dw.Listbox_append(combobox1, "fred") - dw.Box_pack_start(combox, combobox1, -1, -1, TRUE, FALSE, 0) - /* - dw_window_set_text( combobox, "initial value"); - */ - dw.Signal_connect(combobox1, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&combobox_select_event_callback_func), nil) - - combobox2 = dw.Combobox_new("joe", 0) /* no point in specifying an initial value */ - dw.Box_pack_start(combox, combobox2, -1, -1, TRUE, FALSE, 0) - /* - dw_window_set_text( combobox, "initial value"); - */ - dw.Signal_connect(combobox2, dw.SIGNAL_LIST_SELECT, dw.SIGNAL_FUNC(&combobox_select_event_callback_func), nil) - /* add LOTS of items */ - fmt.Printf("before appending 500 items to combobox using dw_listbox_list_append()\n") - text := make([]string, 500) - for i = 0; i < 500; i++ { - text[i] = fmt.Sprintf("item %d", i) - } - dw.Listbox_list_append(combobox2, text) - fmt.Printf("after appending 500 items to combobox\n") - /* now insert a couple of items */ - dw.Listbox_insert(combobox2, "inserted item 2", 2) - dw.Listbox_insert(combobox2, "inserted item 5", 5) - /* make a spinbutton */ - spinbutton = dw.Spinbutton_new("", 0) /* no point in specifying text */ - dw.Box_pack_start(combox, spinbutton, -1, -1, TRUE, FALSE, 0) - dw.Spinbutton_set_limits(spinbutton, 100, 1) - dw.Spinbutton_set_pos(spinbutton, 30) - dw.Signal_connect(spinbutton, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&spinbutton_valuechanged_callback_func), nil) - /* make a slider */ - slider = dw.Slider_new(FALSE, 11, 0) /* no point in specifying text */ - dw.Box_pack_start(combox, slider, -1, -1, TRUE, FALSE, 0) - dw.Signal_connect(slider, dw.SIGNAL_VALUE_CHANGED, dw.SIGNAL_FUNC(&slider_valuechanged_callback_func), nil) - /* make a percent */ - percent = dw.Percent_new(0) - dw.Box_pack_start(combox, percent, -1, -1, TRUE, FALSE, 0) -} - -func create_button(redraw bool) { - filetoolbarbox := dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0) - - abutton1 := dw.Bitmapbutton_new_from_file("Empty image. Should be under Top button", 0, "junk") - dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) - dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&change_color_red_callback_func), nil) - dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) - - abutton1 = dw.Bitmapbutton_new_from_file("A borderless bitmapbitton", 0, fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) - dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) - dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&change_color_yellow_callback_func), nil) - dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) - dw.Window_set_style(abutton1, dw.BS_NOBORDER, dw.BS_NOBORDER) - - //abutton1 = dw.Bitmapbutton_new_from_data("A button from data", 0, folder_ico, 1718 ); - abutton1 = dw.Bitmapbutton_new_from_file("A button from data", 0, "junk") - dw.Box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0) - dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&percent_button_box_callback_func), nil) - dw.Box_pack_start(filetoolbarbox, dw.NOHWND, 25, 5, FALSE, FALSE, 0) - if redraw == true { - dw.Window_redraw(filetoolbarbox) - dw.Window_redraw(mainwindow) - } -} - -// Page 8 -func scrollbox_add() { - var i int - - /* create a box to pack into the notebook page */ - scrollbox = dw.Scrollbox_new(dw.VERT, 0) - dw.Box_pack_start(notebookbox8, scrollbox, 0, 0, TRUE, TRUE, 1) - - abutton1 := dw.Button_new("Show Adjustments", 0) - dw.Box_pack_start(scrollbox, abutton1, -1, 30, FALSE, FALSE, 0) - dw.Signal_connect(abutton1, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&scrollbox_button_callback_func), nil) - - for i = 0; i < MAX_WIDGETS; i++ { - tmpbox := dw.Box_new(dw.HORZ, 0) - dw.Box_pack_start(scrollbox, tmpbox, 0, 24, TRUE, FALSE, 2) - label := dw.Text_new(fmt.Sprintf("Label %d", i), 0) - dw.Box_pack_start(tmpbox, label, 0, 20, TRUE, FALSE, 0) - item := dw.Entryfield_new(fmt.Sprintf("Entry %d", i), uint(i)) - dw.Box_pack_start(tmpbox, item, 0, 20, TRUE, FALSE, 0) - } -} - -// Page 9 -func update_mle(text string, lock int) { - /* Protect pos from being changed by different threads */ - if lock != 0 { - dw.Mutex_lock(mutex) - } - mlepos = dw.Mle_import(threadmle, text, mlepos) - dw.Mle_set_cursor(threadmle, mlepos) - if lock != 0 { - dw.Mutex_unlock(mutex) - } -} - -func thread_add() { - /* create a box to pack into the notebook page */ - tmpbox := dw.Box_new(dw.VERT, 0) - dw.Box_pack_start(notebookbox9, tmpbox, 0, 0, dw.TRUE, dw.TRUE, 1) - - startbutton = dw.Button_new("Start Threads", 0) - dw.Box_pack_start(tmpbox, startbutton, -1, 30, dw.FALSE, dw.FALSE, 0) - dw.Signal_connect(startbutton, dw.SIGNAL_CLICKED, dw.SIGNAL_FUNC(&start_threads_button_callback_func), nil) - - /* Create the base threading components */ - threadmle = dw.Mle_new(0) - dw.Box_pack_start(tmpbox, threadmle, 1, 1, TRUE, TRUE, 0) - mutex = dw.Mutex_new() - workevent = dw.Event_new() -} - -func main() { - /* Pick an approriate font for our platform */ - if runtime.GOOS == "windows" { - FIXEDFONT = "10.Lucida Console" - } else if runtime.GOOS == "darwin" { - FIXEDFONT = "9.Monaco" - } - - /* Locate the source root of the package */ - pkg, err := build.Import("dwtest", "", build.FindOnly) - if err == nil && len(pkg.SrcRoot) > 0 { - SRCROOT = fmt.Sprintf("%s/dwtest", pkg.SrcRoot) - } - - /* Initialize the Dynamic Windows engine */ - dw.Init(dw.TRUE) - - /* Create our window */ - mainwindow = dw.Window_new(dw.DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", dw.FCF_SYSMENU|dw.FCF_TITLEBAR|dw.FCF_TASKLIST|dw.FCF_DLGBORDER|dw.FCF_SIZEBORDER|dw.FCF_MINMAX) - - menu_add() - - notebookbox := dw.Box_new(dw.VERT, 5) - dw.Box_pack_start(mainwindow, notebookbox, 0, 0, dw.TRUE, dw.TRUE, 0) - - foldericon = dw.Icon_load_from_file(FOLDER_ICON_NAME) - if foldericon == dw.NOHICN && len(SRCROOT) > 0 { - foldericon = dw.Icon_load_from_file(fmt.Sprintf("%s/%s", SRCROOT, FOLDER_ICON_NAME)) - } - fileicon = dw.Icon_load_from_file(FILE_ICON_NAME) - if fileicon == dw.NOHICN && len(SRCROOT) > 0 { - fileicon = dw.Icon_load_from_file(fmt.Sprintf("%s/%s", SRCROOT, FILE_ICON_NAME)) - } - notebook := dw.Notebook_new(1, dw.TRUE) - dw.Box_pack_start(notebookbox, notebook, 100, 100, dw.TRUE, dw.TRUE, 0) - dw.Signal_connect(notebook, dw.SIGNAL_SWITCH_PAGE, dw.SIGNAL_FUNC(&switch_page_callback_func), nil) - - notebookbox1 = dw.Box_new(dw.VERT, 5) - notebookpage1 := dw.Notebook_page_new(notebook, 0, dw.TRUE) - dw.Notebook_pack(notebook, notebookpage1, notebookbox1) - dw.Notebook_page_set_text(notebook, notebookpage1, "buttons and entry") - archive_add() - - notebookbox2 = dw.Box_new(dw.VERT, 5) - notebookpage2 := dw.Notebook_page_new(notebook, 1, dw.FALSE) - dw.Notebook_pack(notebook, notebookpage2, notebookbox2) - dw.Notebook_page_set_text(notebook, notebookpage2, "render") - text_add() - - notebookbox3 = dw.Box_new(dw.VERT, 5) - notebookpage3 := dw.Notebook_page_new(notebook, 1, dw.FALSE) - dw.Notebook_pack(notebook, notebookpage3, notebookbox3) - dw.Notebook_page_set_text(notebook, notebookpage3, "tree") - tree_add() - - notebookbox4 = dw.Box_new(dw.VERT, 5) - notebookpage4 := dw.Notebook_page_new(notebook, 1, FALSE) - dw.Notebook_pack(notebook, notebookpage4, notebookbox4) - dw.Notebook_page_set_text(notebook, notebookpage4, "container") - container_add() - - notebookbox5 = dw.Box_new(dw.VERT, 5) - notebookpage5 := dw.Notebook_page_new(notebook, 1, FALSE) - dw.Notebook_pack(notebook, notebookpage5, notebookbox5) - dw.Notebook_page_set_text(notebook, notebookpage5, "buttons") - buttons_add() - - /* DEPRECATED - notebookbox6 = dw.Box_new(dw.VERT, 5); - notebookpage6 := dw.Notebook_page_new( notebook, 1, FALSE ); - dw.Notebook_pack(notebook, notebookpage6, notebookbox6); - dw.Notebook_page_set_text(notebook, notebookpage6, "mdi"); - mdi_add(); - */ - - notebookbox7 = dw.Box_new(dw.VERT, 6) - notebookpage7 := dw.Notebook_page_new(notebook, 1, FALSE) - dw.Notebook_pack(notebook, notebookpage7, notebookbox7) - dw.Notebook_page_set_text(notebook, notebookpage7, "html") - - rawhtml := dw.Html_new(1001) - if rawhtml.GetHandle() != nil { - dw.Box_pack_start(notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0) - dw.Html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>") - html = dw.Html_new(1002) - dw.Box_pack_start(notebookbox7, html, 0, 100, TRUE, TRUE, 0) - dw.Html_url(html, "http://dwindows.netlabs.org") - } else { - label := dw.Text_new("HTML widget not available.", 0) - dw.Box_pack_start(notebookbox7, label, 0, 100, TRUE, TRUE, 0) - } - - notebookbox8 = dw.Box_new(dw.VERT, 7) - notebookpage8 := dw.Notebook_page_new(notebook, 1, FALSE) - dw.Notebook_pack(notebook, notebookpage8, notebookbox8) - dw.Notebook_page_set_text(notebook, notebookpage8, "scrollbox") - scrollbox_add() - - notebookbox9 = dw.Box_new(dw.VERT, 8) - notebookpage9 := dw.Notebook_page_new(notebook, 1, FALSE) - dw.Notebook_pack(notebook, notebookpage9, notebookbox9) - dw.Notebook_page_set_text(notebook, notebookpage9, "thread/event") - thread_add() - - /* Set the default field */ - dw.Window_default(mainwindow, copypastefield) - - dw.Signal_connect(mainwindow, dw.SIGNAL_DELETE, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - /* - * The following is a special case handler for the Mac and other platforms which contain - * an application object which can be closed. It function identically to a window delete/close - * request except it applies to the entire application not an individual window. If it is not - * handled or you allow the default handler to take place the entire application will close. - * On platforms which do not have an application object this line will be ignored. - */ - dw.Signal_connect(dw.DESKTOP, dw.SIGNAL_DELETE, dw.SIGNAL_FUNC(&exit_callback_func), dw.HANDLE_TO_POINTER(mainwindow)) - timerid = dw.Timer_connect(2000, dw.SIGNAL_FUNC(&timer_callback_func), nil) - dw.Window_set_size(mainwindow, 640, 550) - dw.Window_show(mainwindow) - - /* Now that the window is created and shown... - * run the main loop until we get dw_main_quit() - */ - dw.Main() - - /* Now that the loop is done we can cleanup */ - dw.Taskbar_delete(textbox1, fileicon) - dw.Window_destroy(mainwindow) - - fmt.Printf("dwtest exiting...\n") - /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ - dw.Shutdown() -}
--- a/src/dwtest/dwtest.rc Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include "winuser.h" -#ifdef DW64 -1 RT_MANIFEST dwtest.exe.x64.manifest -#else -1 RT_MANIFEST dwtest.exe.x86.manifest -#endif \ No newline at end of file
--- a/src/dwtest/makesyso.bat Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -@echo off -windres -i dwtest.rc -o dwtest_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 -windres -i dwtest.rc -o dwtest_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386
--- a/src/hello/hello.exe.x64.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="AMD64" - name="hello" - type="win32" -/> -<description>Dynamic Windows Hello World Example</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="AMD64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/hello/hello.exe.x86.manifest Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.1.0.0" - processorArchitecture="X86" - name="hello" - type="win32" -/> -<description>Dynamic Windows Hello World Example</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> \ No newline at end of file
--- a/src/hello/hello.go Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -package main - -import ( - "dw" -) - -// Global variables -var APP_NAME = "DW Hello World Example" - -/* Handle exiting the application */ -func exit_handler(win dw.HWND, message string) int { - if dw.Messagebox(APP_NAME, dw.MB_YESNO | dw.MB_QUESTION, message) == dw.MB_RETURN_YES { - /* Exit the application cleanly */ - dw.MainQuit(); - } - return dw.TRUE; -} - -func main() { - var message = "Are you sure you want to exit?"; - - /* Initialize Dynamic Windows */ - dw.Init(dw.TRUE); - - /* Create our window */ - window := dw.WindowNew(dw.DESKTOP, APP_NAME, dw.FCF_SYSMENU | dw.FCF_TITLEBAR | dw.FCF_TASKLIST | dw.FCF_DLGBORDER | dw.FCF_SIZEBORDER | dw.FCF_MINMAX); - - label := dw.TextNew("Hello, 世界", 0); - window.PackStart(label, 0, 0, dw.TRUE, dw.TRUE, 0); - - /* Connect the signal handlers */ - window.ConnectDelete(func(window dw.HWND) int { return exit_handler(window, message); }); - - /* Set the size and show the window */ - window.SetSize(640, 550); - window.Show(); - - dw.Main(); - - /* Destroy the main window */ - window.Destroy(); - - /* Call dw.Shutdown() to shutdown the Dynamic Windows engine */ - dw.Shutdown(); - return; -} -
--- a/src/hello/hello.rc Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include "winuser.h" -#ifdef DW64 -1 RT_MANIFEST hello.exe.x64.manifest -#else -1 RT_MANIFEST hello.exe.x86.manifest -#endif \ No newline at end of file
--- a/src/hello/makesyso.bat Tue Dec 31 08:36:17 2019 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -@echo off -windres -i hello.rc -o hello_windows_amd64.syso --input-format=rc --output-format=coff --target=pe-x86-64 -DDW64 -windres -i hello.rc -o hello_windows_386.syso --input-format=rc --output-format=coff --target=pe-i386