diff --git a/redo/objimpl/windows/control.c b/redo/objimpl/windows/control.c new file mode 100644 index 00000000..c127ef88 --- /dev/null +++ b/redo/objimpl/windows/control.c @@ -0,0 +1,75 @@ +// 27 may 2015 +#include "uipriv_windows.h" + +#define HWND(c) ((HWND) uiControlHandle((c))) + +void uiWindowsUtilDestroy(HWND hwnd) +{ + if (DestroyWindow(hwnd) == 0) + logLastError("error destroying window in uiWindowsUtilDestroyWindow()"); +} + +void uiWindowsSingleHWNDControlCommitDestroy(uiControl *c) +{ + uiWindowsUtilDestroy(HWND(c)); +} + +void uiWindowsUtilSetParent(HWND hwnd, uiControl *parent) +{ + HWND newParent; + + newParent = utilWindow; + if (parent != NULL) + newParent = HWND(parent); + if (SetParent(hwnd, newParent) == 0) + logLastError("error changing window parent in uiWindowsUtilSetParent()"); +} + +void uiWindowsSingleHWNDControlCommitSetParent(uiControl *c, uiControl *parent) +{ + uiWindowsUtilSetParent(HWND(c), parent); +} + +// TODO resizing + +void uiWIndowsUtilShow(HWND hwnd) +{ + ShowWindow(hwnd, SW_SHOW); +} + +void uiWindowsSingleHWNDControlCommitShow(uiControl *c) +{ + uiWindowsUtilShow(HWND(c)); +} + +void uiWindowsUtilHide(HWND hwnd) +{ + ShowWindow(hwnd, SW_HIDE); +} + +void uiWindowsSingleHWNDControlCommitHide(uiControl *c) +{ + uiWindowsUtilHide(HWND(c)); +} + +void uiWIndowsUtilEnable(HWND hwnd) +{ + EnableWindow(hwnd, TRUE); +} + +void uiWindowsSingleHWNDControlCommitEnable(uiControl *c) +{ + uiWindowsUtilEnable(HWND(c)); +} + +void uiWindowsUtilDisable(HWND hwnd) +{ + EnableWindow(hwnd, FALSE); +} + +void uiWindowsSingleHWNDControlCommitDisable(uiControl *c) +{ + uiWindowsUtilDisable(HWND(c)); +} + +// TODO sysfunc and zorder diff --git a/redo/windows/init.c b/redo/windows/init.c index 9dc1604b..3c3933d9 100644 --- a/redo/windows/init.c +++ b/redo/windows/init.c @@ -144,12 +144,18 @@ const char *uiInit(uiInitOptions *o) if (initDialogHelper(hDefaultIcon, hDefaultCursor) == 0) return loadLastError("initializing the dialog helper"); + // TODO initialize COM + // TODO initialize COM security + // TODO (windows vista) turn off COM exception handling + return NULL; } void uiUninit(void) { uninitMenus(); + // TODO uninitialize COM + // TODO uninitialize the dialog helper // TODO delete hollow brush if (SetConsoleCtrlHandler(consoleCtrlHandler, FALSE) == 0) logLastError("unregistering console end session handler");