forked from pyrite-dev/milsko
Compare commits
19 commits
61d8a72026
...
020f51a0cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 020f51a0cb | |||
| 49a0f08f61 | |||
|
6f331d613d |
|||
|
b239dd3819 |
|||
|
b9796e99d5 |
|||
|
218f8fa9cf |
|||
|
71cb96b06e |
|||
|
c2e960fe59 |
|||
|
a0b3ecb697 |
|||
|
14cf131528 |
|||
|
ce80f70332 |
|||
|
498a76facd |
|||
|
0e183f64f2 |
|||
|
d4887f4940 |
|||
|
d5336dd38c |
|||
|
5fea127518 |
|||
|
baa2f81d9a |
|||
|
2782277d06 |
|||
|
e397f40485 |
17 changed files with 517 additions and 331 deletions
|
|
@ -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";
|
my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value";
|
||||||
my $s = $l;
|
my $s = $l;
|
||||||
my $o = $object_suffix;
|
my $o = $object_suffix;
|
||||||
$o =~ s/\./\\\./g;
|
$o =~ s/\./\\\./g;
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,13 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ struct _MwLLGDI {
|
||||||
HICON icon;
|
HICON icon;
|
||||||
|
|
||||||
int grabbed;
|
int grabbed;
|
||||||
|
int force_render;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLGDIColor {
|
struct _MwLLGDIColor {
|
||||||
|
|
@ -38,5 +39,6 @@ struct _MwLLGDIPixmap {
|
||||||
};
|
};
|
||||||
|
|
||||||
MWDECL int MwLLGDICallInit(void);
|
MWDECL int MwLLGDICallInit(void);
|
||||||
|
MWDECL HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -69,5 +69,6 @@ struct _MwLLX11Pixmap {
|
||||||
};
|
};
|
||||||
|
|
||||||
MWDECL int MwLLX11CallInit(void);
|
MWDECL int MwLLX11CallInit(void);
|
||||||
|
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#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,6 +21,12 @@
|
||||||
<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" />
|
||||||
|
|
@ -41,6 +47,7 @@
|
||||||
- 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.
|
||||||
|
|
@ -73,6 +80,7 @@
|
||||||
<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" />
|
||||||
|
|
@ -353,6 +361,34 @@
|
||||||
<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,18 +603,18 @@ BBX 7 14 0 -2
|
||||||
BITMAP
|
BITMAP
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
00
|
||||||
08
|
08
|
||||||
2A
|
2A
|
||||||
1C
|
1C
|
||||||
08
|
08
|
||||||
|
08
|
||||||
1C
|
1C
|
||||||
2A
|
2A
|
||||||
08
|
08
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
|
||||||
00
|
|
||||||
ENDCHAR
|
ENDCHAR
|
||||||
STARTCHAR 002b
|
STARTCHAR 002b
|
||||||
ENCODING 43
|
ENCODING 43
|
||||||
|
|
|
||||||
|
|
@ -603,18 +603,18 @@ BBX 7 14 0 -2
|
||||||
BITMAP
|
BITMAP
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
|
00
|
||||||
5a
|
5a
|
||||||
5a
|
5a
|
||||||
3c
|
3c
|
||||||
18
|
18
|
||||||
|
18
|
||||||
3c
|
3c
|
||||||
5a
|
5a
|
||||||
5a
|
5a
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
00
|
||||||
00
|
|
||||||
00
|
|
||||||
ENDCHAR
|
ENDCHAR
|
||||||
STARTCHAR 002b
|
STARTCHAR 002b
|
||||||
ENCODING 43
|
ENCODING 43
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,14 @@
|
||||||
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
|
||||||
|
|
@ -105,6 +113,7 @@
|
||||||
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
|
||||||
|
|
@ -131,6 +140,11 @@
|
||||||
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
|
||||||
|
|
@ -202,11 +216,16 @@
|
||||||
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
|
||||||
|
|
@ -219,6 +238,10 @@
|
||||||
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
|
||||||
|
|
@ -736,3 +759,24 @@
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ 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);
|
||||||
|
|
||||||
|
|
@ -235,6 +237,7 @@ 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;
|
||||||
|
|
@ -518,10 +521,14 @@ 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
HCURSOR MwLLGDICreateCursor(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);
|
||||||
|
|
@ -562,12 +569,18 @@ static void MwLLSetCursorImpl(MwLL handle, 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) {
|
||||||
|
|
|
||||||
|
|
@ -394,8 +394,11 @@ 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);
|
||||||
|
|
||||||
|
|
@ -777,10 +780,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);
|
||||||
|
|
@ -789,17 +792,17 @@ static void MwLLForceRenderImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
Cursor MwLLX11CreateCursor(Display* display, 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(handle->x11.display, DefaultVisual(handle->x11.display, DefaultScreen(handle->x11.display)), 1, ZPixmap, 0, di, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
XImage* cimage = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, ZPixmap, 0, di, 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);
|
XImage* cmask = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, ZPixmap, 0, dm, MwCursorDataHeight, MwCursorDataHeight, 32, MwCursorDataHeight * 4);
|
||||||
Pixmap pimage = XCreatePixmap(handle->x11.display, handle->x11.window, MwCursorDataHeight, MwCursorDataHeight, 1);
|
Pixmap pimage = XCreatePixmap(display, DefaultRootWindow(display), MwCursorDataHeight, MwCursorDataHeight, 1);
|
||||||
Pixmap pmask = XCreatePixmap(handle->x11.display, handle->x11.window, MwCursorDataHeight, MwCursorDataHeight, 1);
|
Pixmap pmask = XCreatePixmap(display, DefaultRootWindow(display), MwCursorDataHeight, MwCursorDataHeight, 1);
|
||||||
GC imagegc = XCreateGC(handle->x11.display, pimage, 0, NULL);
|
GC imagegc = XCreateGC(display, pimage, 0, NULL);
|
||||||
GC maskgc = XCreateGC(handle->x11.display, pmask, 0, NULL);
|
GC maskgc = XCreateGC(display, pmask, 0, NULL);
|
||||||
XColor cfg, cbg;
|
XColor cfg, cbg;
|
||||||
|
|
||||||
xs = -mask->x + image->x;
|
xs = -mask->x + image->x;
|
||||||
|
|
@ -831,25 +834,32 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||||
cfg.red = 65535;
|
cfg.red = 65535;
|
||||||
cfg.green = 65535;
|
cfg.green = 65535;
|
||||||
cfg.blue = 65535;
|
cfg.blue = 65535;
|
||||||
XAllocColor(handle->x11.display, handle->x11.colormap, &cfg);
|
XAllocColor(display, DefaultColormap(display, DefaultScreen(display)), &cfg);
|
||||||
|
|
||||||
cbg.red = 0;
|
cbg.red = 0;
|
||||||
cbg.green = 0;
|
cbg.green = 0;
|
||||||
cbg.blue = 0;
|
cbg.blue = 0;
|
||||||
XAllocColor(handle->x11.display, handle->x11.colormap, &cbg);
|
XAllocColor(display, DefaultColormap(display, DefaultScreen(display)), &cbg);
|
||||||
|
|
||||||
XPutImage(handle->x11.display, pimage, imagegc, cimage, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
XPutImage(display, pimage, imagegc, cimage, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
||||||
XPutImage(handle->x11.display, pmask, maskgc, cmask, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
XPutImage(display, pmask, maskgc, cmask, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
|
||||||
|
|
||||||
cur = XCreatePixmapCursor(handle->x11.display, pimage, pmask, &cfg, &cbg, xs, ys);
|
cur = XCreatePixmapCursor(display, pimage, pmask, &cfg, &cbg, xs, ys);
|
||||||
XDefineCursor(handle->x11.display, handle->x11.window, cur);
|
|
||||||
XFreeCursor(handle->x11.display, cur);
|
|
||||||
|
|
||||||
XFreePixmap(handle->x11.display, pimage);
|
XFreePixmap(display, pimage);
|
||||||
XFreePixmap(handle->x11.display, pmask);
|
XFreePixmap(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,6 +60,14 @@ 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);
|
||||||
|
|
@ -108,6 +116,7 @@ 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);
|
||||||
|
|
@ -134,6 +143,11 @@ 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);
|
||||||
|
|
@ -205,11 +219,16 @@ 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);
|
||||||
|
|
@ -222,6 +241,10 @@ 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);
|
||||||
|
|
@ -739,5 +762,26 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
src/core.c
20
src/core.c
|
|
@ -242,6 +242,14 @@ 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;
|
||||||
|
|
@ -252,6 +260,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -377,14 +386,17 @@ 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 = MwStringDuplicate(value);
|
char* v = value == NULL ? NULL : 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 || 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);
|
||||||
}
|
}
|
||||||
|
|
@ -731,6 +743,10 @@ 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,6 +11,10 @@ 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,8 +131,16 @@ 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;
|
||||||
|
|
||||||
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
|
if(MwDefaultBorderWidth(handle) >= 2) {
|
||||||
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, diff, 0);
|
int i;
|
||||||
|
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, 45, 45, 30, 12, 30, 45, 45, 0, 0, 0, 0, 0}}, /* 42 */
|
{0, 12, {0, 0, 0, 45, 45, 30, 12, 12, 30, 45, 45, 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, 4, 21, 14, 4, 14, 21, 4, 0, 0, 0, 0, 0}}, /* 42 */
|
{0, 12, {0, 0, 0, 4, 21, 14, 4, 4, 14, 21, 4, 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 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue