forked from pyrite-dev/milsko
Compare commits
No commits in common. "6f331d613d194c592ffcd0b6e15072a543df75ca" and "cc0543187945e95a342d0fd0b28de53812f1f513" have entirely different histories.
6f331d613d
...
cc05431879
21 changed files with 359 additions and 529 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*.dll
|
||||||
examples/*
|
examples/*
|
||||||
examples/*.exe
|
examples/*.exe
|
||||||
examples/*/*
|
examples/*/*
|
||||||
|
|
@ -5,10 +8,4 @@ examples/*/*.exe
|
||||||
!examples/*/
|
!examples/*/
|
||||||
!examples/*.*
|
!examples/*.*
|
||||||
!examples/*/*.*
|
!examples/*/*.*
|
||||||
*.o
|
|
||||||
*.so
|
|
||||||
*.dll
|
|
||||||
*.lib
|
|
||||||
*.a
|
|
||||||
/Makefile
|
|
||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ if (param_get("static")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $l (@library_targets) {
|
foreach my $l (@library_targets) {
|
||||||
my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value";
|
my $warn = "-Wall -Wextra -Wno-sign-compare";
|
||||||
my $s = $l;
|
my $s = $l;
|
||||||
my $o = $object_suffix;
|
my $o = $object_suffix;
|
||||||
$o =~ s/\./\\\./g;
|
$o =~ s/\./\\\./g;
|
||||||
|
|
|
||||||
|
|
@ -315,13 +315,6 @@ MWDECL void MwReparent(MwWidget handle, MwWidget new_parent);
|
||||||
*/
|
*/
|
||||||
MWDECL MwClass MwGetClass(MwWidget handle);
|
MWDECL MwClass MwGetClass(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Gets name of widget
|
|
||||||
* @param handle Widget
|
|
||||||
* @return Name
|
|
||||||
*/
|
|
||||||
MWDECL const char* MwGetName(MwWidget handle);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets children of widget
|
* @brief Gets children of widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,8 @@ MWDECL void (*MwLLMakePopup)(MwLL handle, MwLL parent);
|
||||||
MWDECL void (*MwLLBeginStateChange)(MwLL handle);
|
MWDECL void (*MwLLBeginStateChange)(MwLL handle);
|
||||||
MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
||||||
|
|
||||||
|
MWDECL void (*MwLLSetBackground)(MwLL handle, MwLLColor color);
|
||||||
|
|
||||||
MWDECL void (*MwLLFocus)(MwLL handle);
|
MWDECL void (*MwLLFocus)(MwLL handle);
|
||||||
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ struct _MwLLGDI {
|
||||||
HICON icon;
|
HICON icon;
|
||||||
|
|
||||||
int grabbed;
|
int grabbed;
|
||||||
int force_render;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLGDIColor {
|
struct _MwLLGDIColor {
|
||||||
|
|
@ -39,6 +38,5 @@ struct _MwLLGDIPixmap {
|
||||||
};
|
};
|
||||||
|
|
||||||
MWDECL int MwLLGDICallInit(void);
|
MWDECL int MwLLGDICallInit(void);
|
||||||
MWDECL HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,5 @@ struct _MwLLX11Pixmap {
|
||||||
};
|
};
|
||||||
|
|
||||||
MWDECL int MwLLX11CallInit(void);
|
MWDECL int MwLLX11CallInit(void);
|
||||||
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#define MwNflat "Iflat"
|
#define MwNflat "Iflat"
|
||||||
#define MwNshowArrows "IshowArrows"
|
#define MwNshowArrows "IshowArrows"
|
||||||
#define MwNpadding "Ipadding"
|
#define MwNpadding "Ipadding"
|
||||||
#define MwNborderWidth "IborderWidth"
|
|
||||||
|
|
||||||
#define MwNtitle "Stitle"
|
#define MwNtitle "Stitle"
|
||||||
#define MwNtext "Stext"
|
#define MwNtext "Stext"
|
||||||
|
|
|
||||||
36
milsko.xml
36
milsko.xml
|
|
@ -21,12 +21,6 @@
|
||||||
<integer name="x" />
|
<integer name="x" />
|
||||||
<integer name="y" />
|
<integer name="y" />
|
||||||
</struct>
|
</struct>
|
||||||
<struct name="MwRect">
|
|
||||||
<integer name="x" />
|
|
||||||
<integer name="y" />
|
|
||||||
<integer name="width" />
|
|
||||||
<integer name="height" />
|
|
||||||
</struct>
|
|
||||||
<struct name="MwSizeHints">
|
<struct name="MwSizeHints">
|
||||||
<integer name="min_width" />
|
<integer name="min_width" />
|
||||||
<integer name="min_height" />
|
<integer name="min_height" />
|
||||||
|
|
@ -47,7 +41,6 @@
|
||||||
- MwNy
|
- MwNy
|
||||||
- MwNwidth
|
- MwNwidth
|
||||||
- MwNheight
|
- MwNheight
|
||||||
- MwNborderWidth
|
|
||||||
|
|
||||||
Integer properties must be prefixed with I.
|
Integer properties must be prefixed with I.
|
||||||
String properties must be prefixed with S.
|
String properties must be prefixed with S.
|
||||||
|
|
@ -80,7 +73,6 @@
|
||||||
<integer name="flat" />
|
<integer name="flat" />
|
||||||
<integer name="showArrows" />
|
<integer name="showArrows" />
|
||||||
<integer name="padding" />
|
<integer name="padding" />
|
||||||
<integer name="borderWidth" />
|
|
||||||
|
|
||||||
<string name="title" />
|
<string name="title" />
|
||||||
<string name="text" />
|
<string name="text" />
|
||||||
|
|
@ -361,34 +353,6 @@
|
||||||
<integer name="toggle" />
|
<integer name="toggle" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
<function name="MwGetName">
|
|
||||||
<return>
|
|
||||||
<string />
|
|
||||||
</return>
|
|
||||||
<arguments>
|
|
||||||
<widget name="handle" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwGetChildren">
|
|
||||||
<return>
|
|
||||||
<widget pointer="yes" />
|
|
||||||
</return>
|
|
||||||
<arguments>
|
|
||||||
<widget name="handle" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwGetCursorCoord">
|
|
||||||
<arguments>
|
|
||||||
<widget name="handle" />
|
|
||||||
<struct defname="MwPoint" pointer="yes" name="point" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwGetScreenSize">
|
|
||||||
<arguments>
|
|
||||||
<widget name="handle" />
|
|
||||||
<struct defname="MwRect" pointer="yes" name="rect" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
</functions>
|
</functions>
|
||||||
</header>
|
</header>
|
||||||
<header name="Error">
|
<header name="Error">
|
||||||
|
|
|
||||||
|
|
@ -603,15 +603,15 @@ BBX 7 14 0 -2
|
||||||
BITMAP
|
BITMAP
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
08
|
||||||
|
2A
|
||||||
|
1C
|
||||||
|
08
|
||||||
|
1C
|
||||||
|
2A
|
||||||
|
08
|
||||||
|
00
|
||||||
00
|
00
|
||||||
08
|
|
||||||
2A
|
|
||||||
1C
|
|
||||||
08
|
|
||||||
08
|
|
||||||
1C
|
|
||||||
2A
|
|
||||||
08
|
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
|
|
||||||
|
|
@ -603,15 +603,15 @@ BBX 7 14 0 -2
|
||||||
BITMAP
|
BITMAP
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
5a
|
||||||
|
5a
|
||||||
|
3c
|
||||||
|
18
|
||||||
|
3c
|
||||||
|
5a
|
||||||
|
5a
|
||||||
|
00
|
||||||
00
|
00
|
||||||
5a
|
|
||||||
5a
|
|
||||||
3c
|
|
||||||
18
|
|
||||||
18
|
|
||||||
3c
|
|
||||||
5a
|
|
||||||
5a
|
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
|
|
||||||
|
|
@ -57,14 +57,6 @@
|
||||||
119 136 153 LightSlateGrey
|
119 136 153 LightSlateGrey
|
||||||
190 190 190 gray
|
190 190 190 gray
|
||||||
190 190 190 grey
|
190 190 190 grey
|
||||||
190 190 190 x11 gray
|
|
||||||
190 190 190 X11Gray
|
|
||||||
190 190 190 x11 grey
|
|
||||||
190 190 190 X11Grey
|
|
||||||
128 128 128 web gray
|
|
||||||
128 128 128 WebGray
|
|
||||||
128 128 128 web grey
|
|
||||||
128 128 128 WebGrey
|
|
||||||
211 211 211 light grey
|
211 211 211 light grey
|
||||||
211 211 211 LightGrey
|
211 211 211 LightGrey
|
||||||
211 211 211 light gray
|
211 211 211 light gray
|
||||||
|
|
@ -113,7 +105,6 @@
|
||||||
72 209 204 MediumTurquoise
|
72 209 204 MediumTurquoise
|
||||||
64 224 208 turquoise
|
64 224 208 turquoise
|
||||||
0 255 255 cyan
|
0 255 255 cyan
|
||||||
0 255 255 aqua
|
|
||||||
224 255 255 light cyan
|
224 255 255 light cyan
|
||||||
224 255 255 LightCyan
|
224 255 255 LightCyan
|
||||||
95 158 160 cadet blue
|
95 158 160 cadet blue
|
||||||
|
|
@ -140,11 +131,6 @@
|
||||||
124 252 0 lawn green
|
124 252 0 lawn green
|
||||||
124 252 0 LawnGreen
|
124 252 0 LawnGreen
|
||||||
0 255 0 green
|
0 255 0 green
|
||||||
0 255 0 lime
|
|
||||||
0 255 0 x11 green
|
|
||||||
0 255 0 X11Green
|
|
||||||
0 128 0 web green
|
|
||||||
0 128 0 WebGreen
|
|
||||||
127 255 0 chartreuse
|
127 255 0 chartreuse
|
||||||
0 250 154 medium spring green
|
0 250 154 medium spring green
|
||||||
0 250 154 MediumSpringGreen
|
0 250 154 MediumSpringGreen
|
||||||
|
|
@ -216,16 +202,11 @@
|
||||||
219 112 147 pale violet red
|
219 112 147 pale violet red
|
||||||
219 112 147 PaleVioletRed
|
219 112 147 PaleVioletRed
|
||||||
176 48 96 maroon
|
176 48 96 maroon
|
||||||
176 48 96 x11 maroon
|
|
||||||
176 48 96 X11Maroon
|
|
||||||
128 0 0 web maroon
|
|
||||||
128 0 0 WebMaroon
|
|
||||||
199 21 133 medium violet red
|
199 21 133 medium violet red
|
||||||
199 21 133 MediumVioletRed
|
199 21 133 MediumVioletRed
|
||||||
208 32 144 violet red
|
208 32 144 violet red
|
||||||
208 32 144 VioletRed
|
208 32 144 VioletRed
|
||||||
255 0 255 magenta
|
255 0 255 magenta
|
||||||
255 0 255 fuchsia
|
|
||||||
238 130 238 violet
|
238 130 238 violet
|
||||||
221 160 221 plum
|
221 160 221 plum
|
||||||
218 112 214 orchid
|
218 112 214 orchid
|
||||||
|
|
@ -238,10 +219,6 @@
|
||||||
138 43 226 blue violet
|
138 43 226 blue violet
|
||||||
138 43 226 BlueViolet
|
138 43 226 BlueViolet
|
||||||
160 32 240 purple
|
160 32 240 purple
|
||||||
160 32 240 x11 purple
|
|
||||||
160 32 240 X11Purple
|
|
||||||
128 0 128 web purple
|
|
||||||
128 0 128 WebPurple
|
|
||||||
147 112 219 medium purple
|
147 112 219 medium purple
|
||||||
147 112 219 MediumPurple
|
147 112 219 MediumPurple
|
||||||
216 191 216 thistle
|
216 191 216 thistle
|
||||||
|
|
@ -759,24 +736,3 @@
|
||||||
252 252 252 grey99
|
252 252 252 grey99
|
||||||
255 255 255 gray100
|
255 255 255 gray100
|
||||||
255 255 255 grey100
|
255 255 255 grey100
|
||||||
169 169 169 dark grey
|
|
||||||
169 169 169 DarkGrey
|
|
||||||
169 169 169 dark gray
|
|
||||||
169 169 169 DarkGray
|
|
||||||
0 0 139 dark blue
|
|
||||||
0 0 139 DarkBlue
|
|
||||||
0 139 139 dark cyan
|
|
||||||
0 139 139 DarkCyan
|
|
||||||
139 0 139 dark magenta
|
|
||||||
139 0 139 DarkMagenta
|
|
||||||
139 0 0 dark red
|
|
||||||
139 0 0 DarkRed
|
|
||||||
144 238 144 light green
|
|
||||||
144 238 144 LightGreen
|
|
||||||
220 20 60 crimson
|
|
||||||
75 0 130 indigo
|
|
||||||
128 128 0 olive
|
|
||||||
102 51 153 rebecca purple
|
|
||||||
102 51 153 RebeccaPurple
|
|
||||||
192 192 192 silver
|
|
||||||
0 128 128 teal
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
\
|
\
|
||||||
MwLLBeginStateChange = MwLLBeginStateChangeImpl; \
|
MwLLBeginStateChange = MwLLBeginStateChangeImpl; \
|
||||||
MwLLEndStateChange = MwLLEndStateChangeImpl; \
|
MwLLEndStateChange = MwLLEndStateChangeImpl; \
|
||||||
|
\
|
||||||
|
MwLLSetBackground = MwLLSetBackgroundImpl; \
|
||||||
\
|
\
|
||||||
MwLLFocus = MwLLFocusImpl; \
|
MwLLFocus = MwLLFocusImpl; \
|
||||||
MwLLGrabPointer = MwLLGrabPointerImpl; \
|
MwLLGrabPointer = MwLLGrabPointerImpl; \
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||||
HBITMAP hbmp;
|
HBITMAP hbmp;
|
||||||
HDC dc, hbdc;
|
HDC dc, hbdc;
|
||||||
|
|
||||||
u->ll->gdi.force_render = 0;
|
|
||||||
|
|
||||||
if(u->ll->common.copy_buffer) {
|
if(u->ll->common.copy_buffer) {
|
||||||
GetClientRect(hWnd, &rc);
|
GetClientRect(hWnd, &rc);
|
||||||
|
|
||||||
|
|
@ -237,7 +235,6 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
||||||
r->common.copy_buffer = 1;
|
r->common.copy_buffer = 1;
|
||||||
r->common.type = MwLLBackendGDI;
|
r->common.type = MwLLBackendGDI;
|
||||||
|
|
||||||
r->gdi.force_render = 0;
|
|
||||||
r->gdi.grabbed = 0;
|
r->gdi.grabbed = 0;
|
||||||
r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL);
|
r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL);
|
||||||
r->gdi.hInstance = wc.hInstance;
|
r->gdi.hInstance = wc.hInstance;
|
||||||
|
|
@ -344,6 +341,11 @@ static void MwLLFreeColorImpl(MwLLColor color) {
|
||||||
free(color);
|
free(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void MwLLSetBackgroundImpl(MwLL handle, MwLLColor color) {
|
||||||
|
(void)handle;
|
||||||
|
(void)color;
|
||||||
|
}
|
||||||
|
|
||||||
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
|
|
@ -513,14 +515,10 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLForceRenderImpl(MwLL handle) {
|
static void MwLLForceRenderImpl(MwLL handle) {
|
||||||
if(!handle->gdi.force_render) {
|
|
||||||
PostMessage(handle->gdi.hWnd, WM_USER, 0, 0);
|
PostMessage(handle->gdi.hWnd, WM_USER, 0, 0);
|
||||||
|
|
||||||
handle->gdi.force_render = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask) {
|
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||||
HCURSOR cursor;
|
HCURSOR cursor;
|
||||||
BYTE* dmask = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
|
BYTE* dmask = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
|
||||||
BYTE* dimage = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
|
BYTE* dimage = malloc((MwCursorDataHeight / 8) * MwCursorDataHeight);
|
||||||
|
|
@ -561,18 +559,12 @@ HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask) {
|
||||||
|
|
||||||
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
|
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
|
||||||
|
|
||||||
free(dimage);
|
|
||||||
free(dmask);
|
|
||||||
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
|
||||||
HCURSOR cursor = MwLLGDICreateCursor(image, mask);
|
|
||||||
|
|
||||||
if(handle->gdi.cursor != NULL) DestroyCursor(handle->gdi.cursor);
|
if(handle->gdi.cursor != NULL) DestroyCursor(handle->gdi.cursor);
|
||||||
if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon);
|
if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon);
|
||||||
handle->gdi.cursor = cursor;
|
handle->gdi.cursor = cursor;
|
||||||
|
|
||||||
|
free(dimage);
|
||||||
|
free(dmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
||||||
|
|
|
||||||
|
|
@ -386,11 +386,8 @@ static void MwLLSetWHImpl(MwLL handle, int w, int h) {
|
||||||
destroy_pixmap(handle);
|
destroy_pixmap(handle);
|
||||||
create_pixmap(handle);
|
create_pixmap(handle);
|
||||||
|
|
||||||
/* we want events */
|
|
||||||
#if 0
|
|
||||||
handle->x11.width = w;
|
handle->x11.width = w;
|
||||||
handle->x11.height = h;
|
handle->x11.height = h;
|
||||||
#endif
|
|
||||||
|
|
||||||
XSync(handle->x11.display, False);
|
XSync(handle->x11.display, False);
|
||||||
|
|
||||||
|
|
@ -401,6 +398,10 @@ static void MwLLFreeColorImpl(MwLLColor color) {
|
||||||
free(color);
|
free(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void MwLLSetBackgroundImpl(MwLL handle, MwLLColor color) {
|
||||||
|
XSetWindowBackground(handle->x11.display, handle->x11.window, color->x11.pixel);
|
||||||
|
}
|
||||||
|
|
||||||
static int MwLLPendingImpl(MwLL handle) {
|
static int MwLLPendingImpl(MwLL handle) {
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
if(XCheckTypedWindowEvent(handle->x11.display, handle->x11.window, ClientMessage, &ev) || XCheckWindowEvent(handle->x11.display, handle->x11.window, mask, &ev)) {
|
if(XCheckTypedWindowEvent(handle->x11.display, handle->x11.window, ClientMessage, &ev) || XCheckWindowEvent(handle->x11.display, handle->x11.window, mask, &ev)) {
|
||||||
|
|
@ -772,10 +773,10 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLForceRenderImpl(MwLL handle) {
|
static void MwLLForceRenderImpl(MwLL handle) {
|
||||||
if(!handle->x11.force_render) {
|
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
memset(&ev, 0, sizeof(ev));
|
memset(&ev, 0, sizeof(ev));
|
||||||
|
|
||||||
|
if(!handle->x11.force_render) {
|
||||||
ev.type = Expose;
|
ev.type = Expose;
|
||||||
ev.xexpose.window = handle->x11.window;
|
ev.xexpose.window = handle->x11.window;
|
||||||
XSendEvent(handle->x11.display, handle->x11.window, False, ExposureMask, &ev);
|
XSendEvent(handle->x11.display, handle->x11.window, False, ExposureMask, &ev);
|
||||||
|
|
@ -784,17 +785,17 @@ static void MwLLForceRenderImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask) {
|
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||||
Cursor cur;
|
Cursor cur;
|
||||||
int y, x, ys, xs;
|
int y, x, ys, xs;
|
||||||
char* di = malloc(MwCursorDataHeight * MwCursorDataHeight * 4);
|
char* di = malloc(MwCursorDataHeight * MwCursorDataHeight * 4);
|
||||||
char* dm = malloc(MwCursorDataHeight * MwCursorDataHeight * 4);
|
char* dm = malloc(MwCursorDataHeight * MwCursorDataHeight * 4);
|
||||||
XImage* cimage = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, ZPixmap, 0, di, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
XImage* cimage = XCreateImage(handle->x11.display, DefaultVisual(handle->x11.display, DefaultScreen(handle->x11.display)), 1, ZPixmap, 0, di, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
||||||
XImage* cmask = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, ZPixmap, 0, dm, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
XImage* cmask = XCreateImage(handle->x11.display, DefaultVisual(handle->x11.display, DefaultScreen(handle->x11.display)), 1, ZPixmap, 0, dm, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
||||||
Pixmap pimage = XCreatePixmap(display, DefaultRootWindow(display), MwCursorDataHeight, MwCursorDataHeight, 1);
|
Pixmap pimage = XCreatePixmap(handle->x11.display, handle->x11.window, MwCursorDataHeight, MwCursorDataHeight, 1);
|
||||||
Pixmap pmask = XCreatePixmap(display, DefaultRootWindow(display), MwCursorDataHeight, MwCursorDataHeight, 1);
|
Pixmap pmask = XCreatePixmap(handle->x11.display, handle->x11.window, MwCursorDataHeight, MwCursorDataHeight, 1);
|
||||||
GC imagegc = XCreateGC(display, pimage, 0, NULL);
|
GC imagegc = XCreateGC(handle->x11.display, pimage, 0, NULL);
|
||||||
GC maskgc = XCreateGC(display, pmask, 0, NULL);
|
GC maskgc = XCreateGC(handle->x11.display, pmask, 0, NULL);
|
||||||
XColor cfg, cbg;
|
XColor cfg, cbg;
|
||||||
|
|
||||||
xs = -mask->x + image->x;
|
xs = -mask->x + image->x;
|
||||||
|
|
@ -826,32 +827,25 @@ Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask) {
|
||||||
cfg.red = 65535;
|
cfg.red = 65535;
|
||||||
cfg.green = 65535;
|
cfg.green = 65535;
|
||||||
cfg.blue = 65535;
|
cfg.blue = 65535;
|
||||||
XAllocColor(display, DefaultColormap(display, DefaultScreen(display)), &cfg);
|
XAllocColor(handle->x11.display, handle->x11.colormap, &cfg);
|
||||||
|
|
||||||
cbg.red = 0;
|
cbg.red = 0;
|
||||||
cbg.green = 0;
|
cbg.green = 0;
|
||||||
cbg.blue = 0;
|
cbg.blue = 0;
|
||||||
XAllocColor(display, DefaultColormap(display, DefaultScreen(display)), &cbg);
|
XAllocColor(handle->x11.display, handle->x11.colormap, &cbg);
|
||||||
|
|
||||||
XPutImage(display, pimage, imagegc, cimage, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
XPutImage(handle->x11.display, pimage, imagegc, cimage, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
||||||
XPutImage(display, pmask, maskgc, cmask, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
XPutImage(handle->x11.display, pmask, maskgc, cmask, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
||||||
|
|
||||||
cur = XCreatePixmapCursor(display, pimage, pmask, &cfg, &cbg, xs, ys);
|
cur = XCreatePixmapCursor(handle->x11.display, pimage, pmask, &cfg, &cbg, xs, ys);
|
||||||
|
XDefineCursor(handle->x11.display, handle->x11.window, cur);
|
||||||
|
XFreeCursor(handle->x11.display, cur);
|
||||||
|
|
||||||
XFreePixmap(display, pimage);
|
XFreePixmap(handle->x11.display, pimage);
|
||||||
XFreePixmap(display, pmask);
|
XFreePixmap(handle->x11.display, pmask);
|
||||||
|
|
||||||
XDestroyImage(cimage);
|
XDestroyImage(cimage);
|
||||||
XDestroyImage(cmask);
|
XDestroyImage(cmask);
|
||||||
|
|
||||||
return cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
|
||||||
Cursor cur = MwLLX11CreateCursor(handle->x11.display, image, mask);
|
|
||||||
|
|
||||||
XDefineCursor(handle->x11.display, handle->x11.window, cur);
|
|
||||||
XFreeCursor(handle->x11.display, cur);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
||||||
|
|
|
||||||
44
src/color.c
44
src/color.c
|
|
@ -60,14 +60,6 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "LightSlateGrey") == 0) return MwLLAllocColor(handle->lowlevel, 119, 136, 153);
|
if(strcmp(color, "LightSlateGrey") == 0) return MwLLAllocColor(handle->lowlevel, 119, 136, 153);
|
||||||
if(strcmp(color, "gray") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
if(strcmp(color, "gray") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
||||||
if(strcmp(color, "grey") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
if(strcmp(color, "grey") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
||||||
if(strcmp(color, "x11 gray") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
|
||||||
if(strcmp(color, "X11Gray") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
|
||||||
if(strcmp(color, "x11 grey") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
|
||||||
if(strcmp(color, "X11Grey") == 0) return MwLLAllocColor(handle->lowlevel, 190, 190, 190);
|
|
||||||
if(strcmp(color, "web gray") == 0) return MwLLAllocColor(handle->lowlevel, 128, 128, 128);
|
|
||||||
if(strcmp(color, "WebGray") == 0) return MwLLAllocColor(handle->lowlevel, 128, 128, 128);
|
|
||||||
if(strcmp(color, "web grey") == 0) return MwLLAllocColor(handle->lowlevel, 128, 128, 128);
|
|
||||||
if(strcmp(color, "WebGrey") == 0) return MwLLAllocColor(handle->lowlevel, 128, 128, 128);
|
|
||||||
if(strcmp(color, "light grey") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
if(strcmp(color, "light grey") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
||||||
if(strcmp(color, "LightGrey") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
if(strcmp(color, "LightGrey") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
||||||
if(strcmp(color, "light gray") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
if(strcmp(color, "light gray") == 0) return MwLLAllocColor(handle->lowlevel, 211, 211, 211);
|
||||||
|
|
@ -116,7 +108,6 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "MediumTurquoise") == 0) return MwLLAllocColor(handle->lowlevel, 72, 209, 204);
|
if(strcmp(color, "MediumTurquoise") == 0) return MwLLAllocColor(handle->lowlevel, 72, 209, 204);
|
||||||
if(strcmp(color, "turquoise") == 0) return MwLLAllocColor(handle->lowlevel, 64, 224, 208);
|
if(strcmp(color, "turquoise") == 0) return MwLLAllocColor(handle->lowlevel, 64, 224, 208);
|
||||||
if(strcmp(color, "cyan") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 255);
|
if(strcmp(color, "cyan") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 255);
|
||||||
if(strcmp(color, "aqua") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 255);
|
|
||||||
if(strcmp(color, "light cyan") == 0) return MwLLAllocColor(handle->lowlevel, 224, 255, 255);
|
if(strcmp(color, "light cyan") == 0) return MwLLAllocColor(handle->lowlevel, 224, 255, 255);
|
||||||
if(strcmp(color, "LightCyan") == 0) return MwLLAllocColor(handle->lowlevel, 224, 255, 255);
|
if(strcmp(color, "LightCyan") == 0) return MwLLAllocColor(handle->lowlevel, 224, 255, 255);
|
||||||
if(strcmp(color, "cadet blue") == 0) return MwLLAllocColor(handle->lowlevel, 95, 158, 160);
|
if(strcmp(color, "cadet blue") == 0) return MwLLAllocColor(handle->lowlevel, 95, 158, 160);
|
||||||
|
|
@ -143,11 +134,6 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "lawn green") == 0) return MwLLAllocColor(handle->lowlevel, 124, 252, 0);
|
if(strcmp(color, "lawn green") == 0) return MwLLAllocColor(handle->lowlevel, 124, 252, 0);
|
||||||
if(strcmp(color, "LawnGreen") == 0) return MwLLAllocColor(handle->lowlevel, 124, 252, 0);
|
if(strcmp(color, "LawnGreen") == 0) return MwLLAllocColor(handle->lowlevel, 124, 252, 0);
|
||||||
if(strcmp(color, "green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 0);
|
if(strcmp(color, "green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 0);
|
||||||
if(strcmp(color, "lime") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 0);
|
|
||||||
if(strcmp(color, "x11 green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 0);
|
|
||||||
if(strcmp(color, "X11Green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 255, 0);
|
|
||||||
if(strcmp(color, "web green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 128, 0);
|
|
||||||
if(strcmp(color, "WebGreen") == 0) return MwLLAllocColor(handle->lowlevel, 0, 128, 0);
|
|
||||||
if(strcmp(color, "chartreuse") == 0) return MwLLAllocColor(handle->lowlevel, 127, 255, 0);
|
if(strcmp(color, "chartreuse") == 0) return MwLLAllocColor(handle->lowlevel, 127, 255, 0);
|
||||||
if(strcmp(color, "medium spring green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 250, 154);
|
if(strcmp(color, "medium spring green") == 0) return MwLLAllocColor(handle->lowlevel, 0, 250, 154);
|
||||||
if(strcmp(color, "MediumSpringGreen") == 0) return MwLLAllocColor(handle->lowlevel, 0, 250, 154);
|
if(strcmp(color, "MediumSpringGreen") == 0) return MwLLAllocColor(handle->lowlevel, 0, 250, 154);
|
||||||
|
|
@ -219,16 +205,11 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "pale violet red") == 0) return MwLLAllocColor(handle->lowlevel, 219, 112, 147);
|
if(strcmp(color, "pale violet red") == 0) return MwLLAllocColor(handle->lowlevel, 219, 112, 147);
|
||||||
if(strcmp(color, "PaleVioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 219, 112, 147);
|
if(strcmp(color, "PaleVioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 219, 112, 147);
|
||||||
if(strcmp(color, "maroon") == 0) return MwLLAllocColor(handle->lowlevel, 176, 48, 96);
|
if(strcmp(color, "maroon") == 0) return MwLLAllocColor(handle->lowlevel, 176, 48, 96);
|
||||||
if(strcmp(color, "x11 maroon") == 0) return MwLLAllocColor(handle->lowlevel, 176, 48, 96);
|
|
||||||
if(strcmp(color, "X11Maroon") == 0) return MwLLAllocColor(handle->lowlevel, 176, 48, 96);
|
|
||||||
if(strcmp(color, "web maroon") == 0) return MwLLAllocColor(handle->lowlevel, 128, 0, 0);
|
|
||||||
if(strcmp(color, "WebMaroon") == 0) return MwLLAllocColor(handle->lowlevel, 128, 0, 0);
|
|
||||||
if(strcmp(color, "medium violet red") == 0) return MwLLAllocColor(handle->lowlevel, 199, 21, 133);
|
if(strcmp(color, "medium violet red") == 0) return MwLLAllocColor(handle->lowlevel, 199, 21, 133);
|
||||||
if(strcmp(color, "MediumVioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 199, 21, 133);
|
if(strcmp(color, "MediumVioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 199, 21, 133);
|
||||||
if(strcmp(color, "violet red") == 0) return MwLLAllocColor(handle->lowlevel, 208, 32, 144);
|
if(strcmp(color, "violet red") == 0) return MwLLAllocColor(handle->lowlevel, 208, 32, 144);
|
||||||
if(strcmp(color, "VioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 208, 32, 144);
|
if(strcmp(color, "VioletRed") == 0) return MwLLAllocColor(handle->lowlevel, 208, 32, 144);
|
||||||
if(strcmp(color, "magenta") == 0) return MwLLAllocColor(handle->lowlevel, 255, 0, 255);
|
if(strcmp(color, "magenta") == 0) return MwLLAllocColor(handle->lowlevel, 255, 0, 255);
|
||||||
if(strcmp(color, "fuchsia") == 0) return MwLLAllocColor(handle->lowlevel, 255, 0, 255);
|
|
||||||
if(strcmp(color, "violet") == 0) return MwLLAllocColor(handle->lowlevel, 238, 130, 238);
|
if(strcmp(color, "violet") == 0) return MwLLAllocColor(handle->lowlevel, 238, 130, 238);
|
||||||
if(strcmp(color, "plum") == 0) return MwLLAllocColor(handle->lowlevel, 221, 160, 221);
|
if(strcmp(color, "plum") == 0) return MwLLAllocColor(handle->lowlevel, 221, 160, 221);
|
||||||
if(strcmp(color, "orchid") == 0) return MwLLAllocColor(handle->lowlevel, 218, 112, 214);
|
if(strcmp(color, "orchid") == 0) return MwLLAllocColor(handle->lowlevel, 218, 112, 214);
|
||||||
|
|
@ -241,10 +222,6 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "blue violet") == 0) return MwLLAllocColor(handle->lowlevel, 138, 43, 226);
|
if(strcmp(color, "blue violet") == 0) return MwLLAllocColor(handle->lowlevel, 138, 43, 226);
|
||||||
if(strcmp(color, "BlueViolet") == 0) return MwLLAllocColor(handle->lowlevel, 138, 43, 226);
|
if(strcmp(color, "BlueViolet") == 0) return MwLLAllocColor(handle->lowlevel, 138, 43, 226);
|
||||||
if(strcmp(color, "purple") == 0) return MwLLAllocColor(handle->lowlevel, 160, 32, 240);
|
if(strcmp(color, "purple") == 0) return MwLLAllocColor(handle->lowlevel, 160, 32, 240);
|
||||||
if(strcmp(color, "x11 purple") == 0) return MwLLAllocColor(handle->lowlevel, 160, 32, 240);
|
|
||||||
if(strcmp(color, "X11Purple") == 0) return MwLLAllocColor(handle->lowlevel, 160, 32, 240);
|
|
||||||
if(strcmp(color, "web purple") == 0) return MwLLAllocColor(handle->lowlevel, 128, 0, 128);
|
|
||||||
if(strcmp(color, "WebPurple") == 0) return MwLLAllocColor(handle->lowlevel, 128, 0, 128);
|
|
||||||
if(strcmp(color, "medium purple") == 0) return MwLLAllocColor(handle->lowlevel, 147, 112, 219);
|
if(strcmp(color, "medium purple") == 0) return MwLLAllocColor(handle->lowlevel, 147, 112, 219);
|
||||||
if(strcmp(color, "MediumPurple") == 0) return MwLLAllocColor(handle->lowlevel, 147, 112, 219);
|
if(strcmp(color, "MediumPurple") == 0) return MwLLAllocColor(handle->lowlevel, 147, 112, 219);
|
||||||
if(strcmp(color, "thistle") == 0) return MwLLAllocColor(handle->lowlevel, 216, 191, 216);
|
if(strcmp(color, "thistle") == 0) return MwLLAllocColor(handle->lowlevel, 216, 191, 216);
|
||||||
|
|
@ -762,26 +739,5 @@ MwLLColor MwParseColorName(MwWidget handle, const char* color) {
|
||||||
if(strcmp(color, "grey99") == 0) return MwLLAllocColor(handle->lowlevel, 252, 252, 252);
|
if(strcmp(color, "grey99") == 0) return MwLLAllocColor(handle->lowlevel, 252, 252, 252);
|
||||||
if(strcmp(color, "gray100") == 0) return MwLLAllocColor(handle->lowlevel, 255, 255, 255);
|
if(strcmp(color, "gray100") == 0) return MwLLAllocColor(handle->lowlevel, 255, 255, 255);
|
||||||
if(strcmp(color, "grey100") == 0) return MwLLAllocColor(handle->lowlevel, 255, 255, 255);
|
if(strcmp(color, "grey100") == 0) return MwLLAllocColor(handle->lowlevel, 255, 255, 255);
|
||||||
if(strcmp(color, "dark grey") == 0) return MwLLAllocColor(handle->lowlevel, 169, 169, 169);
|
|
||||||
if(strcmp(color, "DarkGrey") == 0) return MwLLAllocColor(handle->lowlevel, 169, 169, 169);
|
|
||||||
if(strcmp(color, "dark gray") == 0) return MwLLAllocColor(handle->lowlevel, 169, 169, 169);
|
|
||||||
if(strcmp(color, "DarkGray") == 0) return MwLLAllocColor(handle->lowlevel, 169, 169, 169);
|
|
||||||
if(strcmp(color, "dark blue") == 0) return MwLLAllocColor(handle->lowlevel, 0, 0, 139);
|
|
||||||
if(strcmp(color, "DarkBlue") == 0) return MwLLAllocColor(handle->lowlevel, 0, 0, 139);
|
|
||||||
if(strcmp(color, "dark cyan") == 0) return MwLLAllocColor(handle->lowlevel, 0, 139, 139);
|
|
||||||
if(strcmp(color, "DarkCyan") == 0) return MwLLAllocColor(handle->lowlevel, 0, 139, 139);
|
|
||||||
if(strcmp(color, "dark magenta") == 0) return MwLLAllocColor(handle->lowlevel, 139, 0, 139);
|
|
||||||
if(strcmp(color, "DarkMagenta") == 0) return MwLLAllocColor(handle->lowlevel, 139, 0, 139);
|
|
||||||
if(strcmp(color, "dark red") == 0) return MwLLAllocColor(handle->lowlevel, 139, 0, 0);
|
|
||||||
if(strcmp(color, "DarkRed") == 0) return MwLLAllocColor(handle->lowlevel, 139, 0, 0);
|
|
||||||
if(strcmp(color, "light green") == 0) return MwLLAllocColor(handle->lowlevel, 144, 238, 144);
|
|
||||||
if(strcmp(color, "LightGreen") == 0) return MwLLAllocColor(handle->lowlevel, 144, 238, 144);
|
|
||||||
if(strcmp(color, "crimson") == 0) return MwLLAllocColor(handle->lowlevel, 220, 20, 60);
|
|
||||||
if(strcmp(color, "indigo") == 0) return MwLLAllocColor(handle->lowlevel, 75, 0, 130);
|
|
||||||
if(strcmp(color, "olive") == 0) return MwLLAllocColor(handle->lowlevel, 128, 128, 0);
|
|
||||||
if(strcmp(color, "rebecca purple") == 0) return MwLLAllocColor(handle->lowlevel, 102, 51, 153);
|
|
||||||
if(strcmp(color, "RebeccaPurple") == 0) return MwLLAllocColor(handle->lowlevel, 102, 51, 153);
|
|
||||||
if(strcmp(color, "silver") == 0) return MwLLAllocColor(handle->lowlevel, 192, 192, 192);
|
|
||||||
if(strcmp(color, "teal") == 0) return MwLLAllocColor(handle->lowlevel, 0, 128, 128);
|
|
||||||
return MwLLAllocColor(handle->lowlevel, 0, 0, 0);
|
return MwLLAllocColor(handle->lowlevel, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
src/core.c
24
src/core.c
|
|
@ -238,14 +238,6 @@ static void MwFreeWidget(MwWidget handle) {
|
||||||
free(handle);
|
free(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void destroy_children(MwWidget handle) {
|
|
||||||
int i;
|
|
||||||
for(i = 0; i < arrlen(handle->children); i++) {
|
|
||||||
destroy_children(handle->children[i]);
|
|
||||||
}
|
|
||||||
handle->destroyed = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MwDestroyWidget(MwWidget handle) {
|
void MwDestroyWidget(MwWidget handle) {
|
||||||
if(handle->parent != NULL) {
|
if(handle->parent != NULL) {
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -256,7 +248,6 @@ void MwDestroyWidget(MwWidget handle) {
|
||||||
arrput(handle->parent->destroy_queue, handle);
|
arrput(handle->parent->destroy_queue, handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
destroy_children(handle);
|
|
||||||
handle->destroyed = 1;
|
handle->destroyed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,17 +370,18 @@ void MwSetText(MwWidget handle, const char* key, const char* value) {
|
||||||
if(strcmp(key, MwNtitle) == 0) {
|
if(strcmp(key, MwNtitle) == 0) {
|
||||||
MwLLSetTitle(handle->lowlevel, value);
|
MwLLSetTitle(handle->lowlevel, value);
|
||||||
} else {
|
} else {
|
||||||
char* v = value == NULL ? NULL : MwStringDuplicate(value);
|
char* v = MwStringDuplicate(value);
|
||||||
|
|
||||||
if(shgeti(handle->text, key) != -1) free(shget(handle->text, key));
|
if(shgeti(handle->text, key) != -1) free(shget(handle->text, key));
|
||||||
|
|
||||||
if(value != NULL) {
|
|
||||||
shput(handle->text, key, v);
|
shput(handle->text, key, v);
|
||||||
} else {
|
|
||||||
shdel(handle->text, key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(handle->prop_event) MwDispatch3(handle, prop_change, key);
|
if(handle->prop_event) MwDispatch3(handle, prop_change, key);
|
||||||
|
if(strcmp(key, MwNbackground) == 0) {
|
||||||
|
MwLLColor c = MwParseColor(handle, value);
|
||||||
|
MwLLSetBackground(handle->lowlevel, c);
|
||||||
|
MwLLFreeColor(c);
|
||||||
|
}
|
||||||
if(strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0) {
|
if(strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0) {
|
||||||
MwForceRender(handle);
|
MwForceRender(handle);
|
||||||
}
|
}
|
||||||
|
|
@ -733,10 +725,6 @@ MwClass MwGetClass(MwWidget handle) {
|
||||||
return handle->widget_class;
|
return handle->widget_class;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* MwGetName(MwWidget handle) {
|
|
||||||
return handle->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
MwWidget* MwGetChildren(MwWidget handle) {
|
MwWidget* MwGetChildren(MwWidget handle) {
|
||||||
MwWidget* c = malloc(sizeof(*c) * (arrlen(handle->children) + 1));
|
MwWidget* c = malloc(sizeof(*c) * (arrlen(handle->children) + 1));
|
||||||
int i;
|
int i;
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,6 @@ const char* MwDefaultDarkSubBackground = "#333";
|
||||||
const char* MwDefaultDarkSubForeground = "#ddd";
|
const char* MwDefaultDarkSubForeground = "#ddd";
|
||||||
|
|
||||||
int MwDefaultBorderWidth(MwWidget handle) {
|
int MwDefaultBorderWidth(MwWidget handle) {
|
||||||
int bw = MwGetInteger(handle, MwNborderWidth);
|
|
||||||
|
|
||||||
if(bw != MwDEFAULT) return bw;
|
|
||||||
|
|
||||||
if(MwGetInteger(handle, MwNmodernLook)) {
|
if(MwGetInteger(handle, MwNmodernLook)) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
12
src/draw.c
12
src/draw.c
|
|
@ -131,16 +131,8 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
|
||||||
} else {
|
} else {
|
||||||
int diff = get_color_diff(handle) / 3 * 2;
|
int diff = get_color_diff(handle) / 3 * 2;
|
||||||
|
|
||||||
if(MwDefaultBorderWidth(handle) >= 2) {
|
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
|
||||||
int i;
|
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, diff, 0);
|
||||||
int st = invert ? 1 : 0;
|
|
||||||
for(i = st; i < st + 2; i++) {
|
|
||||||
if((i % 2) == 0) MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) - 1, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
|
|
||||||
if((i % 2) == 1) MwDrawFrameEx(handle, rect, color, invert, 1, diff, 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
src/font/boldfont.c
generated
2
src/font/boldfont.c
generated
|
|
@ -47,7 +47,7 @@ MwFont MwBoldFontData[] = {
|
||||||
{0, 12, {28, 12, 12, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 39 */
|
{0, 12, {28, 12, 12, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 39 */
|
||||||
{0, 12, {0, 3, 6, 12, 12, 24, 24, 24, 24, 24, 12, 12, 6, 3}}, /* 40 */
|
{0, 12, {0, 3, 6, 12, 12, 24, 24, 24, 24, 24, 12, 12, 6, 3}}, /* 40 */
|
||||||
{0, 12, {0, 48, 24, 12, 12, 6, 6, 6, 6, 6, 12, 12, 24, 48}}, /* 41 */
|
{0, 12, {0, 48, 24, 12, 12, 6, 6, 6, 6, 6, 12, 12, 24, 48}}, /* 41 */
|
||||||
{0, 12, {0, 0, 0, 45, 45, 30, 12, 12, 30, 45, 45, 0, 0, 0}}, /* 42 */
|
{0, 12, {0, 0, 45, 45, 30, 12, 30, 45, 45, 0, 0, 0, 0, 0}}, /* 42 */
|
||||||
{0, 12, {0, 0, 0, 0, 12, 12, 12, 63, 12, 12, 12, 0, 0, 0}}, /* 43 */
|
{0, 12, {0, 0, 0, 0, 12, 12, 12, 63, 12, 12, 12, 0, 0, 0}}, /* 43 */
|
||||||
{0, 12, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 12, 12, 24}}, /* 44 */
|
{0, 12, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 12, 12, 24}}, /* 44 */
|
||||||
{0, 12, {0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0}}, /* 45 */
|
{0, 12, {0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0}}, /* 45 */
|
||||||
|
|
|
||||||
2
src/font/font.c
generated
2
src/font/font.c
generated
|
|
@ -47,7 +47,7 @@ MwFont MwFontData[] = {
|
||||||
{0, 12, {24, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 39 */
|
{0, 12, {24, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 39 */
|
||||||
{0, 12, {0, 1, 2, 4, 4, 8, 8, 8, 8, 8, 4, 4, 2, 1}}, /* 40 */
|
{0, 12, {0, 1, 2, 4, 4, 8, 8, 8, 8, 8, 4, 4, 2, 1}}, /* 40 */
|
||||||
{0, 12, {0, 32, 16, 8, 8, 4, 4, 4, 4, 4, 8, 8, 16, 32}}, /* 41 */
|
{0, 12, {0, 32, 16, 8, 8, 4, 4, 4, 4, 4, 8, 8, 16, 32}}, /* 41 */
|
||||||
{0, 12, {0, 0, 0, 4, 21, 14, 4, 4, 14, 21, 4, 0, 0, 0}}, /* 42 */
|
{0, 12, {0, 0, 4, 21, 14, 4, 14, 21, 4, 0, 0, 0, 0, 0}}, /* 42 */
|
||||||
{0, 12, {0, 0, 0, 0, 8, 8, 8, 62, 8, 8, 8, 0, 0, 0}}, /* 43 */
|
{0, 12, {0, 0, 0, 0, 8, 8, 8, 62, 8, 8, 8, 0, 0, 0}}, /* 43 */
|
||||||
{0, 12, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 8, 8, 16}}, /* 44 */
|
{0, 12, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 8, 8, 16}}, /* 44 */
|
||||||
{0, 12, {0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0}}, /* 45 */
|
{0, 12, {0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0}}, /* 45 */
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ void (*MwLLMakePopup)(MwLL handle, MwLL parent);
|
||||||
void (*MwLLBeginStateChange)(MwLL handle);
|
void (*MwLLBeginStateChange)(MwLL handle);
|
||||||
void (*MwLLEndStateChange)(MwLL handle);
|
void (*MwLLEndStateChange)(MwLL handle);
|
||||||
|
|
||||||
|
void (*MwLLSetBackground)(MwLL handle, MwLLColor color);
|
||||||
|
|
||||||
void (*MwLLFocus)(MwLL handle);
|
void (*MwLLFocus)(MwLL handle);
|
||||||
void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue