This commit is contained in:
parent
974947b400
commit
85b66d0d9a
9 changed files with 25 additions and 24 deletions
|
|
@ -34,8 +34,7 @@ struct _MwLLGDI {
|
|||
struct _MwLLGDIColor {
|
||||
struct _MwLLCommonColor common;
|
||||
|
||||
COLORREF color;
|
||||
HBRUSH brush;
|
||||
HBRUSH brush;
|
||||
};
|
||||
|
||||
struct _MwLLGDIPixmap {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@
|
|||
#define MwNsubForeground "SsubForeground"
|
||||
#define MwNtitleForeground "StitleForeground"
|
||||
|
||||
|
||||
#define MwNvulkanExtension "SEvulkanExtension"
|
||||
#define MwNvulkanLayer "SEvulkanLayer"
|
||||
#define MwNvulkanConfig "VEvulkanConfig"
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ static void MwLLFreeColorImpl(MwLLColor color) {}
|
|||
|
||||
static MwBool lmao = MwFALSE;
|
||||
static int MwLLPendingImpl(MwLL handle) {
|
||||
lmao = !lmao;
|
||||
return lmao;
|
||||
lmao = !lmao;
|
||||
return lmao;
|
||||
}
|
||||
static void MwLLNextEventImpl(MwLL handle) {
|
||||
MwLLDispatch(handle, draw, NULL);
|
||||
|
|
@ -257,10 +257,10 @@ static void MwLLRaiseImpl(MwLL handle) {}
|
|||
static void MwLLClipImpl(MwLL handle, MwRect* rect) {}
|
||||
static void MwLLSetupDragAndDropImpl(MwLL handle) {}
|
||||
static int MwLLCairoCallInitImpl(void) {
|
||||
if(cairo_load_funcs() != 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
if(cairo_load_funcs() != 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#include "call.c"
|
||||
CALL(Cairo);
|
||||
|
|
|
|||
|
|
@ -170,9 +170,9 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|||
}
|
||||
case WM_DROPFILES:
|
||||
{
|
||||
HDROP hDrop = (HDROP)wp;
|
||||
UINT count;
|
||||
UINT i;
|
||||
HDROP hDrop = (HDROP)wp;
|
||||
UINT count;
|
||||
UINT i;
|
||||
|
||||
count = wsymtbl.DragQueryFileW(hDrop, 0xFFFFFFFF, NULL, 0);
|
||||
|
||||
|
|
@ -524,7 +524,8 @@ static MwLLColor MwLLAllocColorImpl(MwLL handle, int r, int g, int b) {
|
|||
}
|
||||
|
||||
static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) {
|
||||
HDC dc = GetDC(handle->gdi.hWnd);
|
||||
HDC dc = GetDC(handle->gdi.hWnd);
|
||||
COLORREF color;
|
||||
|
||||
if(r > 255) r = 255;
|
||||
if(g > 255) g = 255;
|
||||
|
|
@ -533,9 +534,10 @@ static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) {
|
|||
if(g < 0) g = 0;
|
||||
if(b < 0) b = 0;
|
||||
|
||||
color = GetNearestColor(dc, RGB(r, g, b));
|
||||
|
||||
if(c->gdi.brush != NULL) DeleteObject(c->gdi.brush);
|
||||
c->gdi.color = GetNearestColor(dc, RGB(r, g, b));
|
||||
c->gdi.brush = CreateSolidBrush(c->gdi.color);
|
||||
c->gdi.brush = CreateSolidBrush(color);
|
||||
c->common.red = r;
|
||||
c->common.green = g;
|
||||
c->common.blue = b;
|
||||
|
|
@ -1032,7 +1034,7 @@ static void MwLLSetupDragAndDropImpl(MwLL handle) {
|
|||
}
|
||||
|
||||
static int MwLLGDICallInitImpl(void) {
|
||||
void* ntdll;
|
||||
void* ntdll;
|
||||
|
||||
memset(&wsymtbl, 0, sizeof(wsymtbl));
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ static void llclipboardhandler(MwLL handle, void* data) {
|
|||
}
|
||||
|
||||
static void lldraganddrophandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->common.user;
|
||||
MwWidget h = (MwWidget)handle->common.user;
|
||||
if(MwGetInteger(h, MwNdisabled) == 1) return;
|
||||
|
||||
MwDispatchUserHandler(h, MwNdragAndDropHandler, data);
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
|||
if(flag & MwMB_BUTTONYES) spawn_button(window, w - (x += 8 + 80), h - 8 - 24, MwMB_BUTTONYES, "Yes");
|
||||
|
||||
if((flag & MwMB_ICONMASK) != 0) {
|
||||
MwWidget icon;
|
||||
MwLLPixmap px;
|
||||
MwU32* data = NULL;
|
||||
MwWidget icon;
|
||||
MwLLPixmap px;
|
||||
MwU32* data = NULL;
|
||||
|
||||
icon = MwCreateWidget(MwImageClass, "image", window, 8, (h - 48) / 2, 48, 48);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ static int GDI_MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const c
|
|||
tw = MwTextWidth(handle, ttf, text);
|
||||
th = MwTextHeight(handle, ttf, text);
|
||||
|
||||
if(handle->lowlevel->common.type == MwLLBackendGDI && MwGetInteger(handle, MwNmodernLook) == MwFALSE) {
|
||||
if(handle->lowlevel->common.type == MwLLBackendGDI) {
|
||||
HFONT old_font = SelectObject(handle->lowlevel->gdi.hDC, ttf->font);
|
||||
int old_bkmode = SetBkMode(handle->lowlevel->gdi.hDC, TRANSPARENT);
|
||||
COLORREF old_color = SetTextColor(handle->lowlevel->gdi.hDC, color->gdi.color);
|
||||
COLORREF old_color = SetTextColor(handle->lowlevel->gdi.hDC, RGB(color->common.red, color->common.green, color->common.blue));
|
||||
|
||||
TextOut(handle->lowlevel->gdi.hDC, point->x, point->y - th / 2, t, strlen(t));
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ static HANDLE WINAPI _AddFontMemResourceExPolyFill(PVOID pFileView, DWORD cjSize
|
|||
CHAR temp_path_dir[MAX_PATH];
|
||||
CHAR temp_path_name[MAX_PATH];
|
||||
HANDLE tempFile = NULL;
|
||||
DWORD hr;
|
||||
DWORD hr;
|
||||
|
||||
(void)pvResrved;
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text,
|
|||
fadedColor->common.red = fadedColor->common.red + (c->common.red - fadedColor->common.red) * 0.5;
|
||||
fadedColor->common.green = fadedColor->common.green + (c->common.green - fadedColor->common.green) * 0.5;
|
||||
fadedColor->common.blue = fadedColor->common.blue + (c->common.blue - fadedColor->common.blue) * 0.5;
|
||||
MwLLColorUpdate(handle->lowlevel, fadedColor, fadedColor->common.red, fadedColor->common.green, fadedColor->common.blue);
|
||||
|
||||
MwLLFreeColor(c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ static int wcreate(MwWidget handle) {
|
|||
t->right = 0;
|
||||
t->length = 0;
|
||||
t->cursor_blink_timer = 0;
|
||||
t->active = 0;
|
||||
t->active = 0;
|
||||
handle->internal = t;
|
||||
|
||||
while(topmost_parent->parent) topmost_parent = topmost_parent->parent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue