Skip to content

Commit 8219327

Browse files
committed
Merge branch 'master' of github.com:Immediate-Mode-UI/Nuklear into merge-x11-xft
2 parents 64ba544 + 242f35e commit 8219327

48 files changed

Lines changed: 705 additions & 452 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ccpp.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: apt-update
1313
run: sudo apt-get update -qq
1414
- name: apt get demo-libs
15-
run: sudo apt-get install -y --no-install-recommends liballegro5-dev liballegro-image5-dev liballegro-ttf5-dev libglfw3 libglfw3-dev libglew-dev libsdl2-dev libwayland-dev libx11-dev libxft-dev wayland-protocols
15+
run: sudo apt-get install -y --no-install-recommends glslc liballegro5-dev liballegro-image5-dev liballegro-ttf5-dev libcairo2-dev libglfw3 libglfw3-dev libglew-dev libsdl2-dev libvulkan-dev libwayland-dev libx11-dev libxcb1-dev libxcb-util0-dev libxcb-keysyms1-dev libxft-dev libxkbcommon-x11-dev wayland-protocols
1616
- name: build allegro5
1717
run: make -C demo/allegro5
1818
- name: build glfw_opengl2
@@ -21,8 +21,8 @@ jobs:
2121
run: make -C demo/glfw_opengl3
2222
- name: build glfw_opengl4
2323
run: make -C demo/glfw_opengl4
24-
# - name: build glfw_vulkan
25-
# run: make -C demo/glfw_vulkan
24+
- name: build glfw_vulkan
25+
run: make -C demo/glfw_vulkan
2626
- name: build sdl_opengl2
2727
run: make -C demo/sdl_opengl2
2828
- name: build sdl_opengl3
@@ -31,6 +31,8 @@ jobs:
3131
run: make -C demo/sdl_opengles2
3232
- name: build sdl_renderer
3333
run: make -C demo/sdl_renderer
34+
- name: build sdl_vulkan
35+
run: make -C demo/sdl_vulkan
3436
- name: build sdl_rawfb
3537
run: make -C demo/rawfb/sdl
3638
- name: build wayland_rawfb
@@ -43,5 +45,7 @@ jobs:
4345
run: make -C demo/x11_opengl3
4446
- name: build x11_rawfb
4547
run: make -C demo/rawfb/x11
48+
- name: build xcb_cairo
49+
run: make -C demo/xcb_cairo
4650
- name: build example
4751
run: make -C example

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
demo/*/*.exe
2-
demo/*/*.obj
1+
demo/*/*/demo
32
demo/*/bin/*
43
example/bin/*
54
docs/xml
@@ -10,4 +9,8 @@ doc/*
109
*.tmp
1110
*.swo
1211
*.swp
12+
*.o
13+
*.obj
14+
*.exe
15+
*.dSYM
1316
/private/

clib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuklear",
3-
"version": "4.12.4",
3+
"version": "4.12.8",
44
"repo": "Immediate-Mode-UI/Nuklear",
55
"description": "A small ANSI C gui toolkit",
66
"keywords": ["gl", "ui", "toolkit"],

demo/allegro5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int main(void)
120120
al_register_event_source(event_queue, al_get_mouse_event_source());
121121
al_register_event_source(event_queue, al_get_keyboard_event_source());
122122

123-
font = nk_allegro5_font_create_from_file("../../../extra_font/Roboto-Regular.ttf", 12, 0);
123+
font = nk_allegro5_font_create_from_file("../../extra_font/Roboto-Regular.ttf", 12, 0);
124124

125125
ctx = nk_allegro5_init(font, display, WINDOW_WIDTH, WINDOW_HEIGHT);
126126

demo/allegro5/nuklear_allegro5.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ nk_allegro5_handle_event(ALLEGRO_EVENT *ev)
417417

418418
if (kc == ALLEGRO_KEY_LSHIFT || kc == ALLEGRO_KEY_RSHIFT) nk_input_key(ctx, NK_KEY_SHIFT, down);
419419
else if (kc == ALLEGRO_KEY_DELETE) nk_input_key(ctx, NK_KEY_DEL, down);
420-
else if (kc == ALLEGRO_KEY_ENTER) nk_input_key(ctx, NK_KEY_ENTER, down);
420+
else if (kc == ALLEGRO_KEY_ENTER || kc == ALLEGRO_KEY_PAD_ENTER) nk_input_key(ctx, NK_KEY_ENTER, down);
421421
else if (kc == ALLEGRO_KEY_TAB) nk_input_key(ctx, NK_KEY_TAB, down);
422422
else if (kc == ALLEGRO_KEY_LEFT) nk_input_key(ctx, NK_KEY_LEFT, down);
423423
else if (kc == ALLEGRO_KEY_RIGHT) nk_input_key(ctx, NK_KEY_RIGHT, down);

demo/d3d11/nuklear_d3d11.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
232232
return 1;
233233

234234
case VK_RETURN:
235+
case VK_SEPARATOR:
235236
nk_input_key(&d3d11.ctx, NK_KEY_ENTER, down);
236237
return 1;
237238

demo/d3d12/nuklear_d3d12.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ nk_d3d12_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
364364
return 1;
365365

366366
case VK_RETURN:
367+
case VK_SEPARATOR:
367368
nk_input_key(&d3d12.ctx, NK_KEY_ENTER, down);
368369
return 1;
369370

demo/d3d9/nuklear_d3d9.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ nk_d3d9_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
292292
return 1;
293293

294294
case VK_RETURN:
295+
case VK_SEPARATOR:
295296
nk_input_key(&d3d9.ctx, NK_KEY_ENTER, down);
296297
return 1;
297298

demo/gdi/nuklear_gdi.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ nk_create_image(struct nk_image * image, const char * frame_buffer, const int wi
7676
image->region[1] = 0;
7777
image->region[2] = width;
7878
image->region[3] = height;
79-
79+
8080
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
8181
bi.bmiHeader.biWidth = width;
8282
bi.bmiHeader.biHeight = height;
8383
bi.bmiHeader.biPlanes = 1;
8484
bi.bmiHeader.biBitCount = 24;
8585
bi.bmiHeader.biCompression = BI_RGB;
8686
bi.bmiHeader.biSizeImage = row * height;
87-
87+
8888
hbm = CreateDIBSection(NULL, &bi, DIB_RGB_COLORS, (void**)&lpBuf, NULL, 0);
89-
89+
9090
pb = lpBuf + row * height;
9191
for (v = 0; v < height; v++)
9292
{
@@ -98,7 +98,7 @@ nk_create_image(struct nk_image * image, const char * frame_buffer, const int wi
9898
pb[i + 2] = src[2];
9999
src += 3;
100100
}
101-
}
101+
}
102102
SetDIBits(NULL, hbm, 0, height, lpBuf, &bi, DIB_RGB_COLORS);
103103
image->handle.ptr = hbm;
104104
}
@@ -122,10 +122,10 @@ nk_gdi_draw_image(short x, short y, unsigned short w, unsigned short h,
122122
HBITMAP hbm = (HBITMAP)img.handle.ptr;
123123
HDC hDCBits;
124124
BITMAP bitmap;
125-
125+
126126
if (!gdi.memory_dc || !hbm)
127127
return;
128-
128+
129129
hDCBits = CreateCompatibleDC(gdi.memory_dc);
130130
GetObject(hbm, sizeof(BITMAP), (LPSTR)&bitmap);
131131
SelectObject(hDCBits, hbm);
@@ -192,7 +192,7 @@ nk_gdi_stroke_rect(HDC dc, short x, short y, unsigned short w,
192192
}
193193
SelectObject(dc, br);
194194

195-
if (pen) {
195+
if (pen) {
196196
SelectObject(dc, GetStockObject(DC_PEN));
197197
DeleteObject(pen);
198198
}
@@ -470,7 +470,7 @@ nk_gdi_stroke_circle(HDC dc, short x, short y, unsigned short w,
470470
pen = CreatePen(PS_SOLID, line_thickness, color);
471471
SelectObject(dc, pen);
472472
}
473-
473+
474474
HGDIOBJ br = SelectObject(dc, GetStockObject(NULL_BRUSH));
475475
SetDCBrushColor(dc, OPAQUE);
476476
Ellipse(dc, x, y, x + w, y + h);
@@ -524,7 +524,7 @@ nk_gdi_draw_text(HDC dc, short x, short y, unsigned short w, unsigned short h,
524524
wsize = MultiByteToWideChar(CP_UTF8, 0, text, len, NULL, 0);
525525
wstr = (WCHAR*)_alloca(wsize * sizeof(wchar_t));
526526
MultiByteToWideChar(CP_UTF8, 0, text, len, wstr, wsize);
527-
527+
528528
SetBkMode(dc, TRANSPARENT); /* Transparent Text Background */
529529
SetBkColor(dc, convert_color(cbg));
530530
SetTextColor(dc, convert_color(cfg));
@@ -599,14 +599,14 @@ nk_gdi_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
599599
(void)usr;
600600
if (IsClipboardFormatAvailable(CF_UNICODETEXT) && OpenClipboard(NULL))
601601
{
602-
HGLOBAL mem = GetClipboardData(CF_UNICODETEXT);
602+
HGLOBAL mem = GetClipboardData(CF_UNICODETEXT);
603603
if (mem)
604604
{
605605
SIZE_T size = GlobalSize(mem) - 1;
606606
if (size)
607607
{
608608
LPCWSTR wstr = (LPCWSTR)GlobalLock(mem);
609-
if (wstr)
609+
if (wstr)
610610
{
611611
int utf8size = WideCharToMultiByte(CP_UTF8, 0, wstr, (int)(size / sizeof(wchar_t)), NULL, 0, NULL, NULL);
612612
if (utf8size)
@@ -619,7 +619,7 @@ nk_gdi_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
619619
free(utf8);
620620
}
621621
}
622-
GlobalUnlock(mem);
622+
GlobalUnlock(mem);
623623
}
624624
}
625625
}
@@ -643,9 +643,9 @@ nk_gdi_clipboard_copy(nk_handle usr, const char *text, int len)
643643
{
644644
MultiByteToWideChar(CP_UTF8, 0, text, len, wstr, wsize);
645645
wstr[wsize] = 0;
646-
GlobalUnlock(mem);
646+
GlobalUnlock(mem);
647647

648-
SetClipboardData(CF_UNICODETEXT, mem);
648+
SetClipboardData(CF_UNICODETEXT, mem);
649649
}
650650
}
651651
}
@@ -734,6 +734,7 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
734734
return 1;
735735

736736
case VK_RETURN:
737+
case VK_SEPARATOR:
737738
nk_input_key(&gdi.ctx, NK_KEY_ENTER, down);
738739
return 1;
739740

@@ -776,7 +777,7 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
776777
case VK_PRIOR:
777778
nk_input_key(&gdi.ctx, NK_KEY_SCROLL_UP, down);
778779
return 1;
779-
780+
780781
case 'A':
781782
if (ctrl) {
782783
nk_input_key(&gdi.ctx, NK_KEY_TEXT_SELECT_ALL, down);

demo/gdi_native_nuklear/nuklear_gdi.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* Nuklear - 1.32.0 - public domain
33
* no warrenty implied; use at your own risk.
44
* authored from 2015-2016 by Micha Mettke
5-
*
5+
*
66
* Modified GDI backend 2022
77
* Now based on a context that is required for each API function call.
88
* Removes the global state --> you can have multiple windows :-)
9-
*
9+
*
1010
*/
1111
/*
1212
* ==============================================================
@@ -698,6 +698,7 @@ nk_gdi_handle_event(nk_gdi_ctx gdi, HWND wnd, UINT msg, WPARAM wparam, LPARAM lp
698698
return 1;
699699

700700
case VK_RETURN:
701+
case VK_SEPARATOR:
701702
nk_input_key(&gdi->ctx, NK_KEY_ENTER, down);
702703
return 1;
703704

0 commit comments

Comments
 (0)