Moved most of the headers to C++.
This commit is contained in:
parent
655e05463d
commit
09c1a62a8e
|
@ -38,9 +38,9 @@ _UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
||||||
} \
|
} \
|
||||||
static void _ ## type ## CommitDestroy(uiControl *c) \
|
static void _ ## type ## CommitDestroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
type *this = type(c); \
|
type *me = type(c); \
|
||||||
onDestroy; \
|
onDestroy; \
|
||||||
uiWindowsEnsureDestroyWindow(this->hwnd); \
|
uiWindowsEnsureDestroyWindow(me->hwnd); \
|
||||||
} \
|
} \
|
||||||
static uintptr_t _ ## type ## Handle(uiControl *c) \
|
static uintptr_t _ ## type ## Handle(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -71,7 +71,7 @@ _UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiWindowsDefineControl(type, typefn) \
|
#define uiWindowsDefineControl(type, typefn) \
|
||||||
uiWindowsDefineControlWithOnDestroy(type, typefn, (void) this;)
|
uiWindowsDefineControlWithOnDestroy(type, typefn, (void) me;)
|
||||||
|
|
||||||
#define uiWindowsFinishNewControl(variable, type) \
|
#define uiWindowsFinishNewControl(variable, type) \
|
||||||
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
||||||
|
@ -89,7 +89,7 @@ _UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
||||||
_UI_EXTERN void uiWindowsFinishControl(uiControl *c);
|
_UI_EXTERN void uiWindowsFinishControl(uiControl *c);
|
||||||
|
|
||||||
// This creates a HWND compatible with libui.
|
// This creates a HWND compatible with libui.
|
||||||
// It has no failure state; libui handles errors for you.
|
// It will not return NULL; libui handles errors for you.
|
||||||
_UI_EXTERN HWND uiWindowsEnsureCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, HINSTANCE hInstance, LPVOID lpParam, BOOL useStandardControlFont);
|
_UI_EXTERN HWND uiWindowsEnsureCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, HINSTANCE hInstance, LPVOID lpParam, BOOL useStandardControlFont);
|
||||||
|
|
||||||
// This is a wrapper for certain Windows API functions; use them to have libui handle errors for you.
|
// This is a wrapper for certain Windows API functions; use them to have libui handle errors for you.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// 30 may 2015
|
// 30 may 2015
|
||||||
#include "winapi.h"
|
#include "winapi.hpp"
|
||||||
#include "resources.h"
|
#include "resources.hpp"
|
||||||
|
|
||||||
// this is a UTF-8 file
|
// this is a UTF-8 file
|
||||||
#pragma code_page(65001)
|
#pragma code_page(65001)
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
#define STRICT
|
#define STRICT
|
||||||
#define STRICT_TYPED_ITEMIDS
|
#define STRICT_TYPED_ITEMIDS
|
||||||
#ifndef __cplusplus
|
|
||||||
#define CINTERFACE
|
|
||||||
#define COBJMACROS
|
|
||||||
#endif
|
|
||||||
// see https://github.com/golang/go/issues/9916#issuecomment-74812211
|
// see https://github.com/golang/go/issues/9916#issuecomment-74812211
|
||||||
// TODO get rid of this
|
// TODO get rid of this
|
||||||
#define INITGUID
|
#define INITGUID
|
||||||
|
@ -37,8 +33,5 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <d2d1.h>
|
#include <d2d1.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
// see drawtext.cpp for details
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#include <dwrite.h>
|
#include <dwrite.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
Loading…
Reference in New Issue