Compare commits
544 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca9a24a2b0 | |||
| df1972e91c | |||
| ca41b5936b | |||
| f652523963 | |||
| 6a205453a7 | |||
| 87f6dff101 | |||
| 8e4774054e | |||
| ff823028cd | |||
| 054b085bcd | |||
| 9856979906 | |||
| 6f976ae0ce | |||
| bde66f13a5 | |||
| 85b66d0d9a | |||
| 974947b400 | |||
| 7c2ab989fa | |||
| 39a458d80f | |||
| f6c129b31c | |||
| e20684f89b | |||
| 9dd96d9cec | |||
| f35e781762 | |||
| c404e9e14b | |||
| 7e339cfd60 | |||
| 0fd0611a99 | |||
| fb6c7a4772 | |||
| 981591120c | |||
| b3e24df2f6 | |||
| 27b4f83840 | |||
| d3af13ebd6 | |||
| 7d6f6ca93a | |||
| 90f69b63d4 | |||
| 6a635fc1df | |||
| 6843d6ae05 | |||
| 6db8ce17c3 | |||
| 639f8e619f | |||
| 1103751f57 | |||
| 2c19489acd | |||
| 80e3d25147 | |||
| 5a660bfe90 | |||
| 529309df37 | |||
| e2aa8dec7b | |||
| 6c6b97d92e | |||
| d2191ef33a | |||
| f91fc66fb6 | |||
| 2c2e21503f | |||
| d0d2339d6b | |||
| 3dc4641ff9 | |||
| d9bf9bbb95 | |||
| 74a800b3ef | |||
| d056d1b7fb | |||
| a30d306da0 | |||
| ad8173d562 | |||
| 1fe59521bf | |||
| b7ed160614 | |||
| 8a6bfb62de | |||
| d36c9190ec | |||
| b285d1ba8d | |||
| 09fc854aba | |||
| 84531e9be1 | |||
| bc5fc10816 | |||
| 6bc00c6dca | |||
| 8ebc8108ed | |||
| 9a29682915 | |||
| 2c9d0c78e4 | |||
| b20a54fb76 | |||
| f260c3c11e | |||
| 42802313cb | |||
| 575b8eaee1 | |||
| 610c63228e | |||
| 4b6eae99dc | |||
| a4d095cabf | |||
| 1a75d6cea1 | |||
| 82b68c9c53 | |||
| c2bb601311 | |||
| 14d010f9a2 | |||
| 53878b08ee | |||
| 070ee6025b | |||
| 044b067f7f | |||
| a16e48edd5 | |||
| 7dad6806c3 | |||
| b860c26505 | |||
| 5ea01c80c5 | |||
| d3b0996561 | |||
| 0826afb334 | |||
| 1f4fddfa67 | |||
| 541499f43c | |||
| 7d40eff3e5 | |||
| 884c05acb7 | |||
| 052863dcfe | |||
| e8a4e266b3 | |||
| 3c1bd9956f | |||
| fcca66d1e4 | |||
| 3727c9f587 | |||
| 6ecbe998f8 | |||
| 314cc0da85 | |||
| add02b695b | |||
| 3dac44ed92 | |||
| f7df6df342 | |||
| 732b47a300 | |||
| 143167761c | |||
| 149f99622a | |||
| 9e165b71d4 | |||
| 3d6e08541a | |||
| e7506922d2 | |||
| 262019b1d4 | |||
| 95e7db9607 | |||
| 2e2833f57b | |||
| 1fe971e1df | |||
| 31df1aa72c | |||
| 9ee96a71c4 | |||
| 632f63dee8 | |||
| 6f204af3e6 | |||
| 637015e4d5 | |||
| b8229c3ee8 | |||
| ddca432762 | |||
| 86286a0420 | |||
| b7415dd240 | |||
| 276a9eeec5 | |||
|
65115b53d6 |
|||
|
4b335ad49f |
|||
|
35e8e819e1 |
|||
|
32266c7656 |
|||
| 0628250631 | |||
| 501e32375e | |||
| b258f1e05d | |||
| 206dd9a0a6 | |||
| 1ec68267e5 | |||
| e448a8ed4e | |||
| 90128dc6b2 | |||
|
21dcb02428 |
|||
| 5ff8d9a6f1 | |||
| 56544212b1 | |||
|
b38c146ddf |
|||
|
1d4b1d4e35 |
|||
|
bb599c9fbb |
|||
|
416bdaf25e |
|||
|
e929efb461 |
|||
|
d0a4d1f1af |
|||
| 582582379b | |||
|
d1143a68ac |
|||
|
37c3f9cbdc |
|||
| 8cb40ce2d4 | |||
|
059b287a09 |
|||
|
4410656236 |
|||
|
19416d7451 |
|||
| fe9b08ef55 | |||
| bf5ab45f2e | |||
| ad49a55812 | |||
|
1c2cd6e875 |
|||
|
6eefe44f6f |
|||
| 44996a484a | |||
| fdb27599b6 | |||
| 3ead7afbcf | |||
| 786ed04e69 | |||
| 2c3cb787d4 | |||
| 232763a3e3 | |||
| 38d1cb7289 | |||
| 97778752ec | |||
| ee5e04c64e | |||
| 801c5e03d4 | |||
| 0550e74b98 | |||
| 5c74e65516 | |||
| daced7a897 | |||
|
8a59ee840b |
|||
|
f45b679be3 |
|||
|
6db3d83945 |
|||
|
4dc670850d |
|||
|
00c069b96a |
|||
|
7f667189fc |
|||
|
bcc4766e5f |
|||
|
2dd2ae3f85 |
|||
|
4fdc578448 |
|||
| cc7f4f7ea8 | |||
| e835a9cd60 | |||
|
4777f893c6 |
|||
|
89911082ed |
|||
| 37fae993b9 | |||
| 1c8e301e15 | |||
| d49e50f95a | |||
| 8eacf36c6a | |||
| 0b7f8d3f67 | |||
| b025f46507 | |||
| a205120e91 | |||
|
49294dc975 |
|||
|
0ae1d7e625 |
|||
| d24c948fbf | |||
|
11069552df |
|||
|
e7d9edec27 |
|||
|
c43c497780 |
|||
|
3b0f5faa57 |
|||
| 1214cc0854 | |||
|
ab1dfc2e60 |
|||
| d05e121bf1 | |||
| b1389692a1 | |||
|
ea20a31694 |
|||
|
5ac885e082 |
|||
|
9bfa4f4092 |
|||
|
1f232522b7 |
|||
| 141ea4a027 | |||
|
3542d7524a |
|||
|
dce15aed4d |
|||
|
d3bb57757c |
|||
|
4c17f84d4b |
|||
| 6b94ac5db9 | |||
| d1f97c0fa4 | |||
| a6adca6696 | |||
| c483c5f042 | |||
| 150581e716 | |||
| e618144fbc | |||
| 572c170cd6 | |||
| 94c4bcd2cc | |||
| b908921d68 | |||
| 8d6c2c0d52 | |||
|
38321022b9 |
|||
| 76f03c2019 | |||
| c095fb97a8 | |||
| c998c61655 | |||
| 1eb0b0154b | |||
| 7d005dc7bb | |||
| 62008ec5d9 | |||
| f2f901dc05 | |||
| 6a5ad2cd8c | |||
| f02a4d3f4b | |||
| f2de281e20 | |||
| f23a466d33 | |||
| 147124d408 | |||
| 39b3c035fc | |||
| d980f5c6b2 | |||
| df275c3331 | |||
| 4b2676b741 | |||
| 7b06a0d5f5 | |||
| 7893234cd3 | |||
| 733b3c1f1c | |||
| 6341b76a86 | |||
| 22b0891598 | |||
| 6137728de7 | |||
| f4be507c35 | |||
| bdcd380a2c | |||
| 5ae3704a4c | |||
| 095867ce70 | |||
| 7f98e8cae1 | |||
| 75ce2c3adc | |||
| d909812891 | |||
|
d1936e4a8f |
|||
|
e878ae0253 |
|||
| e79bffa5c6 | |||
| e66cb4e3d4 | |||
| 790688e4cc | |||
| 73b320fc18 | |||
| 36f5647883 | |||
| 413105c1a8 | |||
| 2323b7f69f | |||
| b4829308d9 | |||
| 84db46648e | |||
| 2a333897b7 | |||
| e40735b6e9 | |||
| fb56fac3dc | |||
| 4a0059b2f1 | |||
| af3f569b0a | |||
| a8b406bc04 | |||
| 196a1c87f5 | |||
| 153b7e8254 | |||
| a155126e84 | |||
| c0c64ad677 | |||
| 53ab5dd875 | |||
| c56bea32ed | |||
| c7d9a2e6cc | |||
| d3135d4c1e | |||
| 24d7412f1c | |||
| 93a7c5e350 | |||
| a8b2fa1e18 | |||
| c14c267ebe | |||
| b639367470 | |||
| 1562c3b89e | |||
| fa3488402e | |||
| 4f7b3718e3 | |||
| ea5906b03b | |||
| beba0116a0 | |||
| 2a982603d3 | |||
| 4bf321f3a2 | |||
| 3779b2e0db | |||
| bb51bc3c5f | |||
| 9035133782 | |||
| 3005ec9c0c | |||
| 2e23342620 | |||
| f00c380f3d | |||
| a78b7b6762 | |||
| 4aaecdb962 | |||
| 984b8de414 | |||
|
e65d4e7f32 |
|||
|
4e78157e71 |
|||
|
16a0eeae4f |
|||
| 837c28133a | |||
| 6c3d376d1f | |||
| 215488e653 | |||
|
b6e21d8478 |
|||
| 1e939ae316 | |||
| 64bd640529 | |||
| 3beb11706e | |||
|
6927ffd27d |
|||
| 6f9f98f22c | |||
| 7cb7a2739e | |||
| 8ad9e19de0 | |||
|
212d00ea13 |
|||
|
21e2f2d599 |
|||
|
2ae01d3902 |
|||
|
2cd11d0189 |
|||
|
190e4353e4 |
|||
|
986ffdccc1 |
|||
|
ca703f24d5 |
|||
|
833947c1ec |
|||
| 4536b30fbc | |||
| 1c26efcc91 | |||
| 47c2a74d74 | |||
| 4d6d459920 | |||
| 931cff0f6d | |||
| 7cdd2bcc79 | |||
| 70c5d7782f | |||
| cb375fbcbf | |||
|
201c5f84a5 |
|||
|
2a09a71659 |
|||
|
d9a6c7ee5f |
|||
|
05e7d8377b |
|||
| ae0791dbc3 | |||
| 261622a2e0 | |||
| 21d07056d9 | |||
| efc6002bdb | |||
| 9c95757f8d | |||
|
0c793d6832 |
|||
|
d225f7cb72 |
|||
| 183e2b0e04 | |||
| 81b154982b | |||
| f8fff8f37d | |||
| da20432c31 | |||
| 85c5409790 | |||
| a249b3264d | |||
| ca7e50d911 | |||
| dbb436f5a2 | |||
|
06645250ca |
|||
|
6ae6386852 |
|||
| 5ff982d106 | |||
| 2369b96091 | |||
| 65f16f3144 | |||
| 0b1879bfa5 | |||
| 319927aee1 | |||
| 129f8f4d66 | |||
| 2dd2c3870f | |||
| 77ca92452e | |||
| b0f89d1dcc | |||
| 89cfece767 | |||
| 79e1774cb8 | |||
| 8eca6c04e9 | |||
| 352f2e5059 | |||
| 1fd86732f5 | |||
| 4423c318e8 | |||
| ece1527689 | |||
| 8870b3a0c5 | |||
| 76a82c821e | |||
| 42d6ca171e | |||
| 65f907a65f | |||
| 0788297ed3 | |||
| fdf73ab9e7 | |||
| 81b229c99a | |||
| 0606f398ae | |||
| e0554cdb92 | |||
| 4869821fe1 | |||
| 4b250960b6 | |||
| 0396e9b269 | |||
| eff89312ac | |||
| 65382dcf3f | |||
| 70deb1b303 | |||
| ccdad14846 | |||
| e62db26db2 | |||
| e3e170bebd | |||
| 3f722de0b6 | |||
| 315638ba3f | |||
| aecfdf8f2b | |||
| 98a6559215 | |||
| b4df1ab241 | |||
|
775488f7d2 |
|||
|
51f88a848f |
|||
|
5d0c84d748 |
|||
|
93325bb49c |
|||
|
6eee227693 |
|||
|
769a49c1ff |
|||
|
a7828a44d8 |
|||
|
c945ebb9ca |
|||
|
27c9eb97c1 |
|||
|
449a0691e0 |
|||
|
a59154d5f1 |
|||
|
20d1a455e7 |
|||
|
4eb20e47b5 |
|||
|
be6198aa83 |
|||
|
47ba1a9b50 |
|||
|
d3eb93a30a |
|||
|
74f41cafde |
|||
|
7fb12e8182 |
|||
|
f4087440aa |
|||
| d0a6bd892d | |||
|
39bee0e5cc |
|||
|
55c562645a |
|||
|
a666010564 |
|||
| 10fda7bfc4 | |||
| ba15189c21 | |||
|
c93a9980f3 |
|||
|
242253efbb |
|||
|
212782f0be |
|||
|
251b497c2f |
|||
|
7b9870cebc |
|||
|
40cae5d2a5 |
|||
| be2b40731f | |||
| e4bd49ab83 | |||
|
e916154df6 |
|||
| 138555f41d | |||
| bc942153fe | |||
| 3e49278a15 | |||
| e41dbd43c1 | |||
|
9caa50b94d |
|||
|
d6538d4410 |
|||
|
c0e36df063 |
|||
|
6259f57677 |
|||
|
570f05540e |
|||
|
5220f742be |
|||
|
7a2ca3aa2d |
|||
|
13a2db7fa8 |
|||
|
5201c46a21 |
|||
|
b82e13cb2e |
|||
|
79efc31c55 |
|||
| c88dc48817 | |||
| 8b176d3a00 | |||
| 9b138c458e | |||
| 0e96b715b0 | |||
| 5ca241ad0a | |||
| b2ce5597b0 | |||
| 220b76135e | |||
| 15c39a2405 | |||
| 62fd2adcd1 | |||
| 2228fa1a46 | |||
| 5136207bf1 | |||
| c85b471c43 | |||
| f8a94b7380 | |||
| 47fe57b31c | |||
| 5315f4ec4d | |||
| 712a640f9d | |||
| 4e4da8659e | |||
| 6f9b3c12a7 | |||
| 48b847093b | |||
| a2c1489ffb | |||
| 0fb9c45ea4 | |||
| 677d8c8046 | |||
| 54fed150e8 | |||
| ecdecbc93b | |||
| 9087782960 | |||
| dc97522bb0 | |||
| 43c66417c7 | |||
| 12703d451e | |||
| 6257376b1f | |||
| a0c864d85b | |||
| 64930db2fc | |||
| d05e31b154 | |||
| a3bbcf30b2 | |||
| f7eb9840de | |||
| e77eb5e08a | |||
| b641a03bae | |||
| 5c386e7665 | |||
| 6ff6b22644 | |||
| 5cb9b5cab9 | |||
| 0c822d5bfa | |||
| 4ab846ad51 | |||
| fc8330f477 | |||
| 714842461c | |||
| aac2b410c0 | |||
| 83f5f7a820 | |||
| 391f5a6924 | |||
| 28f6d6ac56 | |||
| 065b0d824c | |||
| 32f99b62b6 | |||
| 4d7b33741f | |||
| a01e1a9514 | |||
| a7d790698f | |||
| 6e5057f8c6 | |||
| d597dc9411 | |||
| bfc6d8e9af | |||
| 1d59488927 | |||
| f22f45d5bf | |||
| 0e2e3a1901 | |||
| fe72bc92bf | |||
| c0d7cb3fbc | |||
| 554e5cd5dd | |||
| 522f32cfcd | |||
| 9283455cb9 | |||
| 7d85a784f5 | |||
| a4c61b0e38 | |||
| bb876b9620 | |||
| b661face26 | |||
| f44a70d4ec | |||
| 14e908488c | |||
| 728983b92c | |||
| 0ab497ca88 | |||
| c4f6d1eb14 | |||
| 2a7cf2de83 | |||
|
d1f351a7ef |
|||
|
3852646ce3 |
|||
|
00397f17ea |
|||
|
0325584319 |
|||
| 67788da3fb | |||
| 37bba97508 | |||
| c0bfb51601 | |||
| e9ea675ae6 | |||
| 84ad1b0d6b | |||
| 42af900127 | |||
|
3c336b5e95 |
|||
|
a652514ab0 |
|||
| d373f04eed | |||
|
291bb09047 |
|||
|
8a5a2f0f02 |
|||
|
6af4c73905 |
|||
|
1531f89ef0 |
|||
|
5d8e39b268 |
|||
|
5f6789631d |
|||
|
d76bb49e45 |
|||
|
8d597328f9 |
|||
|
07cab25d3e |
|||
|
29bab28b78 |
|||
|
0de09207a4 |
|||
|
9fc659b652 |
|||
|
55cb65be26 |
|||
| cce41b32b8 | |||
| a00d4ba144 | |||
| da3312cee9 | |||
| d4f6ca14e2 | |||
| 2e2a97e4a8 | |||
| b6b8f742d7 | |||
| af54b3e515 | |||
| 9d7d4541e4 | |||
| 2e30d7f4d9 | |||
| 597dbe4e5a | |||
| 9560c4fd92 | |||
| 3d99a9249f | |||
| 32842ca160 | |||
| 35d2b4bb76 | |||
|
a5beb9e6b9 |
|||
|
e8d32dafc7 |
|||
|
e312b325c8 |
|||
|
112ddd1521 |
182 changed files with 31913 additions and 19043 deletions
|
|
@ -5,6 +5,8 @@ AlignConsecutiveAssignments:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
AlignConsecutiveDeclarations:
|
AlignConsecutiveDeclarations:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
NamespaceIndentation: All
|
||||||
IndentWidth: 8
|
IndentWidth: 8
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ColumnLimit: 0
|
ColumnLimit: 0
|
||||||
|
|
@ -12,6 +14,9 @@ AllowShortIfStatementsOnASingleLine: Always
|
||||||
AllowShortBlocksOnASingleLine: Never
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortFunctionsOnASingleLine: Empty
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
AllowShortLoopsOnASingleLine: true
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: true
|
||||||
SpaceBeforeParens: Never
|
SpaceBeforeParens: Never
|
||||||
AlignEscapedNewlines: DontAlign
|
AlignEscapedNewlines: DontAlign
|
||||||
SortIncludes: false
|
SortIncludes: false
|
||||||
|
|
|
||||||
14
.gitignore
vendored
14
.gitignore
vendored
|
|
@ -7,6 +7,8 @@ examples/*/*.exe
|
||||||
!examples/*/*.*
|
!examples/*/*.*
|
||||||
*.exe
|
*.exe
|
||||||
*.o
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.core
|
||||||
*.so
|
*.so
|
||||||
*.dll
|
*.dll
|
||||||
*.lib
|
*.lib
|
||||||
|
|
@ -17,3 +19,15 @@ examples/*/*.exe
|
||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
.cache
|
.cache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/vms
|
||||||
|
/BorMakefile
|
||||||
|
*.err
|
||||||
|
*.zip
|
||||||
|
|
||||||
|
*.pef
|
||||||
|
*.dsk
|
||||||
|
*.bin
|
||||||
|
*.rsrc
|
||||||
|
*.finf
|
||||||
|
*.gdb
|
||||||
|
|
||||||
|
|
|
||||||
84
BorMakefile
generated
84
BorMakefile
generated
|
|
@ -1,84 +0,0 @@
|
||||||
CC = bcc32 -c
|
|
||||||
LD = bcc32
|
|
||||||
|
|
||||||
CFLAGS = -Iinclude -D_MILSKO -DUSE_GDI -DUSE_STB_TRUETYPE -DUSE_STB_IMAGE -DSTBI_NO_SIMD
|
|
||||||
LDFLAGS = -tWD
|
|
||||||
.SUFFIXES: .obj .c
|
|
||||||
all: src\Mw.dll
|
|
||||||
clean:
|
|
||||||
del /f /q external\stb_ds.obj
|
|
||||||
del /f /q external\stb_image.obj
|
|
||||||
del /f /q external\stb_truetype.obj
|
|
||||||
del /f /q src\abstract\directory.obj
|
|
||||||
del /f /q src\abstract\dynamic.obj
|
|
||||||
del /f /q src\abstract\time.obj
|
|
||||||
del /f /q src\backend\gdi.obj
|
|
||||||
del /f /q src\color.obj
|
|
||||||
del /f /q src\core.obj
|
|
||||||
del /f /q src\cursor\arrow.obj
|
|
||||||
del /f /q src\cursor\cross.obj
|
|
||||||
del /f /q src\cursor\default.obj
|
|
||||||
del /f /q src\cursor\hidden.obj
|
|
||||||
del /f /q src\cursor\text.obj
|
|
||||||
del /f /q src\default.obj
|
|
||||||
del /f /q src\dialog\colorpicker.obj
|
|
||||||
del /f /q src\dialog\directorychooser.obj
|
|
||||||
del /f /q src\dialog\filechooser.obj
|
|
||||||
del /f /q src\dialog\messagebox.obj
|
|
||||||
del /f /q src\draw.obj
|
|
||||||
del /f /q src\error.obj
|
|
||||||
del /f /q src\icon\back.obj
|
|
||||||
del /f /q src\icon\clock.obj
|
|
||||||
del /f /q src\icon\computer.obj
|
|
||||||
del /f /q src\icon\directory.obj
|
|
||||||
del /f /q src\icon\down.obj
|
|
||||||
del /f /q src\icon\error.obj
|
|
||||||
del /f /q src\icon\file.obj
|
|
||||||
del /f /q src\icon\forward.obj
|
|
||||||
del /f /q src\icon\info.obj
|
|
||||||
del /f /q src\icon\left.obj
|
|
||||||
del /f /q src\icon\news.obj
|
|
||||||
del /f /q src\icon\note.obj
|
|
||||||
del /f /q src\icon\right.obj
|
|
||||||
del /f /q src\icon\search.obj
|
|
||||||
del /f /q src\icon\up.obj
|
|
||||||
del /f /q src\icon\warning.obj
|
|
||||||
del /f /q src\lowlevel.obj
|
|
||||||
del /f /q src\string.obj
|
|
||||||
del /f /q src\text\font\boldfont.obj
|
|
||||||
del /f /q src\text\font\boldttf.obj
|
|
||||||
del /f /q src\text\font\font.obj
|
|
||||||
del /f /q src\text\font\ttf.obj
|
|
||||||
del /f /q src\text\ft2.obj
|
|
||||||
del /f /q src\text\stbtt.obj
|
|
||||||
del /f /q src\text\text.obj
|
|
||||||
del /f /q src\unicode.obj
|
|
||||||
del /f /q src\widget\box.obj
|
|
||||||
del /f /q src\widget\button.obj
|
|
||||||
del /f /q src\widget\checkbox.obj
|
|
||||||
del /f /q src\widget\combobox.obj
|
|
||||||
del /f /q src\widget\entry.obj
|
|
||||||
del /f /q src\widget\frame.obj
|
|
||||||
del /f /q src\widget\image.obj
|
|
||||||
del /f /q src\widget\label.obj
|
|
||||||
del /f /q src\widget\listbox.obj
|
|
||||||
del /f /q src\widget\menu.obj
|
|
||||||
del /f /q src\widget\numberentry.obj
|
|
||||||
del /f /q src\widget\opengl.obj
|
|
||||||
del /f /q src\widget\progressbar.obj
|
|
||||||
del /f /q src\widget\radiobox.obj
|
|
||||||
del /f /q src\widget\scrollbar.obj
|
|
||||||
del /f /q src\widget\separator.obj
|
|
||||||
del /f /q src\widget\submenu.obj
|
|
||||||
del /f /q src\widget\treeview.obj
|
|
||||||
del /f /q src\widget\viewport.obj
|
|
||||||
del /f /q src\widget\window.obj
|
|
||||||
del /f /q src\Mw.dll
|
|
||||||
del /f /q src\Mw.lib
|
|
||||||
|
|
||||||
src\Mw.dll: external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\error.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\ttf.obj src\text\ft2.obj src\text\stbtt.obj src\text\text.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj
|
|
||||||
$(LD) $(LDFLAGS) -e$@ external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\error.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\ttf.obj src\text\ft2.obj src\text\stbtt.obj src\text\text.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj -lopengl32.lib -lgdi32.lib -luser32.lib
|
|
||||||
implib src\Mw.lib src\Mw.dll
|
|
||||||
|
|
||||||
.c.obj:
|
|
||||||
$(CC) $(CFLAGS) -o$@ $<
|
|
||||||
17
CHANGELOG.txt
Normal file
17
CHANGELOG.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
========================= 1.4 =========================
|
||||||
|
- CMakeLists.txt downgraded to version 3.13 to allow compiling on Windows XP
|
||||||
|
- CMake build now generates a pkgconfig file.
|
||||||
|
- GDI backend now natively uses GDI for text rendering
|
||||||
|
- Widgets can now be disabled with MwNdisabled
|
||||||
|
- Added `MwTabFocus` for letting a tab widget steal focus.
|
||||||
|
- New table widget (`MwTableClass`).
|
||||||
|
- Added `MwWindowShouldClose` for letting custom loops know when a window should close.
|
||||||
|
- Remove VMS build files
|
||||||
|
- Entry widgets now have blinking cursor that appears only when you hover over the widget.
|
||||||
|
- Wayland backend:
|
||||||
|
- Can now create layer surfaces (Use `MwLLMakeToolWindow` on a parentless window)
|
||||||
|
- Now properly handles keys being held down
|
||||||
|
- has drastically improved CSD (functionality wise)
|
||||||
|
- Uses KMSDRM directly for the OpenGL widget instead of wl_egl for a smoother experience
|
||||||
|
- Various overall performance improvements putting it on the same level as the X11 backend finally
|
||||||
|
- Menu widget works better under compositors that use CSD.
|
||||||
430
CMakeLists.txt
430
CMakeLists.txt
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.25)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(
|
project(
|
||||||
milsko
|
milsko
|
||||||
)
|
)
|
||||||
|
|
@ -9,116 +9,130 @@ include(GNUInstallDirs)
|
||||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
option(MW_TRY_OPENGL "Try to compile OpenGL widget or not" ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
option(MW_TRY_VULKAN "Try to compile Vulkan widget or not" ON)
|
|
||||||
|
if(WIN32)
|
||||||
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(MW_CLASSIC_THEME "Use classic theme" OFF)
|
option(MW_CLASSIC_THEME "Use classic theme" OFF)
|
||||||
option(MW_BUILD_EXAMPLES "Build examples" OFF)
|
option(MW_BUILD_EXAMPLES "Build examples" OFF)
|
||||||
option(MW_USE_STB_IMAGE "Use stb_image" ON)
|
option(MW_USE_STB_IMAGE "Use stb_image" ON)
|
||||||
option(MW_USE_STB_TRUETYPE "Use stb_truetype" OFF)
|
option(MW_USE_STB_TRUETYPE "Use stb_truetype" OFF)
|
||||||
option(MW_BUILD_SHARED "Build a shared library" ON)
|
|
||||||
option(MW_BUILD_STATIC "Build a static library" OFF)
|
|
||||||
option(MW_INSTALL_HEADERS "Install headers" ON)
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
|
if(${CMAKE_SYSTEM_NAME} MATCHES Retro)
|
||||||
option(MW_USE_FREETYPE2 "Use FreeType 2" OFF)
|
option(MW_BUILD_SHARED "Build a shared library" OFF)
|
||||||
|
option(MW_BUILD_STATIC "Build a static library" ON)
|
||||||
|
option(MW_TRY_OPENGL "Try to compile OpenGL widget or not" OFF)
|
||||||
|
option(MW_TRY_VULKAN "Try to compile Vulkan widget or not" OFF)
|
||||||
else()
|
else()
|
||||||
option(MW_USE_FREETYPE2 "Use FreeType 2" ON)
|
option(MW_BUILD_SHARED "Build a shared library" ON)
|
||||||
|
option(MW_BUILD_STATIC "Build a static library" OFF)
|
||||||
|
option(MW_TRY_OPENGL "Try to compile OpenGL widget or not" ON)
|
||||||
|
option(MW_TRY_VULKAN "Try to compile Vulkan widget or not" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
|
option(MW_INSTALL_HEADERS "Install headers" ON)
|
||||||
option(MW_USE_WAYLAND "Enable Wayland backend" ON)
|
|
||||||
|
if( ${CMAKE_SYSTEM_NAME} STREQUAL Darwin
|
||||||
|
OR ${CMAKE_SYSTEM_NAME} MATCHES Retro
|
||||||
|
OR ${CMAKE_SYSTEM_NAME} MATCHES Windows)
|
||||||
|
option(MW_USE_FREETYPE2 "Use FreeType 2" OFF)
|
||||||
|
else()
|
||||||
|
option(MW_USE_FREETYPE2 "Use FreeType 2" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
|
||||||
|
option(MW_USE_GDI_TEXT "Use GDI for text rendering" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux OR ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
|
||||||
|
option(MW_USE_WAYLAND "Enable Wayland backend" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(
|
file(
|
||||||
GLOB
|
GLOB
|
||||||
SOURCES
|
SOURCES
|
||||||
src/*.c src/cursor/*.c src/icon/*.c src/widget/*.c src/text/*.c src/text/font/*.c src/dialog/*.c src/abstract/*.c external/*.c
|
external/libz/src/*.c src/*.c src/cursor/*.c src/icon/*.c src/widget/*.c src/text/*.c src/text/font/*.c src/dialog/*.c src/abstract/*.c external/*.c
|
||||||
)
|
)
|
||||||
|
|
||||||
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/opengl.c")
|
|
||||||
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/vulkan.c")
|
|
||||||
|
|
||||||
if(NOT MW_USE_STB_IMAGE)
|
if(NOT MW_USE_STB_IMAGE)
|
||||||
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/external/stb_image.c")
|
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/external/stb_image.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MW_USE_STB_TRUETYPE)
|
if(NOT MW_USE_STB_TRUETYPE)
|
||||||
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/external/stb_truetype.c")
|
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/external/stb_truetype.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "/usr/X11R7/include")
|
list(APPEND CMAKE_REQUIRED_INCLUDES "/usr/X11R7/include")
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "/usr/pkg/include")
|
list(APPEND CMAKE_REQUIRED_INCLUDES "/usr/pkg/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_TRY_OPENGL)
|
if(MW_TRY_OPENGL)
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
if(OpenGL_FOUND)
|
if(OpenGL_FOUND AND NOT APPLE)
|
||||||
set(MW_BUILD_OPENGL ON)
|
set(MW_BUILD_OPENGL ON)
|
||||||
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/opengl.c")
|
message(STATUS "OpenGL widget has been enabled")
|
||||||
if(APPLE)
|
else()
|
||||||
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/opengl_cocoa.m")
|
message(WARNING "OpenGL widget has been disabled")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "OpenGL widget has been enabled")
|
|
||||||
else()
|
|
||||||
message(WARNING "OpenGL widget has been disabled")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_TRY_VULKAN)
|
if(MW_TRY_VULKAN)
|
||||||
check_include_files(vulkan/vulkan.h HAVE_VULKAN_VULKAN_H)
|
find_package(Vulkan)
|
||||||
if(HAVE_VULKAN_VULKAN_H)
|
if(${Vulkan_FOUND})
|
||||||
set(MW_BUILD_VULKAN ON)
|
set(MW_BUILD_VULKAN ON)
|
||||||
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/vulkan.c")
|
message(STATUS "Vulkan widget has been enabled")
|
||||||
message(STATUS "Vulkan widget has been enabled")
|
else()
|
||||||
else()
|
message(WARNING "Vulkan widget has been disabled")
|
||||||
message(WARNING "Vulkan widget has been disabled")
|
endif()
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_BUILD_STATIC)
|
if(MW_BUILD_STATIC)
|
||||||
message(STATUS "Building Milsko as a static library")
|
message(STATUS "Building Milsko as a static library")
|
||||||
add_library(
|
add_library(
|
||||||
Mw
|
Mw
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
elseif(MW_BUILD_SHARED)
|
elseif(MW_BUILD_SHARED)
|
||||||
message(STATUS "Building Milsko as a shared library")
|
message(STATUS "Building Milsko as a shared library")
|
||||||
add_library(
|
add_library(
|
||||||
Mw
|
Mw
|
||||||
SHARED
|
SHARED
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(ERROR "Must either build a shared library or a static library")
|
message(ERROR "Must either build a shared library or a static library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_USE_STB_IMAGE)
|
if(MW_USE_STB_IMAGE)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_STB_IMAGE
|
USE_STB_IMAGE
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
file(
|
file(
|
||||||
GLOB
|
GLOB
|
||||||
IMAGE_SOURCES
|
IMAGE_SOURCES
|
||||||
external/libz/src/*.c external/libjpeg/src/*.c external/libpng/src/*.c
|
external/libjpeg/src/*.c external/libpng/src/*.c
|
||||||
)
|
)
|
||||||
target_sources(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${MW_IMAGE_SOURCES}
|
${MW_IMAGE_SOURCES}
|
||||||
)
|
)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
external/libz/include external/libjpeg/include external/libpng/include
|
external/libjpeg/include external/libpng/include
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_USE_STB_TRUETYPE)
|
if(MW_USE_STB_TRUETYPE)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_STB_TRUETYPE
|
USE_STB_TRUETYPE
|
||||||
|
|
@ -126,35 +140,47 @@ if(MW_USE_STB_TRUETYPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_USE_FREETYPE2)
|
if(MW_USE_FREETYPE2)
|
||||||
|
find_package(Freetype)
|
||||||
|
if(Freetype_FOUND)
|
||||||
|
message(STATUS "FreeType2 found")
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_FREETYPE2
|
USE_FREETYPE2
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(PkgConfig)
|
list(APPEND INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
|
||||||
pkg_check_modules(FT2 REQUIRED freetype2)
|
list(APPEND LIBRARY_DIRS ${FREETYPE_LIBRARY_DIRS})
|
||||||
list(APPEND INCLUDE_DIRS ${FT2_INCLUDE_DIRS})
|
else()
|
||||||
list(APPEND LIBRARY_DIRS ${FT2_LIBRARY_DIRS})
|
message(WARNING "FreeType2 not found")
|
||||||
list(APPEND LIBRARIES ${FT2_LIBRARIES})
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(MW_USE_GDI_TEXT)
|
||||||
|
target_compile_definitions(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
USE_GDI_TEXT
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_USE_WAYLAND)
|
if(MW_USE_WAYLAND)
|
||||||
function(scan_wayland_protocol_core)
|
function(scan_wayland_protocol_core)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND wayland-scanner private-code /usr/share/wayland/wayland.xml ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland-core-protocol.c
|
COMMAND wayland-scanner private-code /usr/share/wayland/wayland.xml ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland/wayland-core-protocol.c
|
||||||
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
ERROR_VARIABLE WAYLAND_SCANNER_ERROR
|
ERROR_VARIABLE WAYLAND_SCANNER_ERROR
|
||||||
ECHO_OUTPUT_VARIABLE
|
ECHO_OUTPUT_VARIABLE
|
||||||
ECHO_ERROR_VARIABLE
|
ECHO_ERROR_VARIABLE
|
||||||
COMMAND_ECHO STDOUT
|
COMMAND_ECHO STDOUT
|
||||||
)
|
)
|
||||||
target_sources(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland-core-protocol.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland/wayland-core-protocol.c
|
||||||
)
|
)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND wayland-scanner client-header /usr/share/wayland/wayland.xml ${CMAKE_CURRENT_SOURCE_DIR}/include/Mw/LowLevel/Wayland/wayland-core-protocol.h
|
COMMAND wayland-scanner client-header /usr/share/wayland/wayland.xml ${CMAKE_CURRENT_SOURCE_DIR}/include/Mw/LowLevel/Wayland/wayland-core-protocol.h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
|
|
@ -163,11 +189,11 @@ if(MW_USE_WAYLAND)
|
||||||
ECHO_ERROR_VARIABLE
|
ECHO_ERROR_VARIABLE
|
||||||
COMMAND_ECHO STDOUT
|
COMMAND_ECHO STDOUT
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(scan_wayland_protocol tier proto ver)
|
function(scan_wayland_protocol tier proto ver)
|
||||||
SET(proto_c ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland-${proto}-protocol.c)
|
SET(proto_c ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland/wayland-${proto}-protocol.c)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND wayland-scanner private-code /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml ${proto_c}
|
COMMAND wayland-scanner private-code /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml ${proto_c}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
|
|
@ -176,12 +202,12 @@ if(MW_USE_WAYLAND)
|
||||||
ECHO_ERROR_VARIABLE
|
ECHO_ERROR_VARIABLE
|
||||||
COMMAND_ECHO STDOUT
|
COMMAND_ECHO STDOUT
|
||||||
)
|
)
|
||||||
target_sources(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${proto_c}
|
${proto_c}
|
||||||
)
|
)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND wayland-scanner client-header /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml ${CMAKE_CURRENT_SOURCE_DIR}/include/Mw/LowLevel/Wayland/${proto}-client-protocol.h
|
COMMAND wayland-scanner client-header /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml ${CMAKE_CURRENT_SOURCE_DIR}/include/Mw/LowLevel/Wayland/${proto}-client-protocol.h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
|
|
@ -190,55 +216,93 @@ if(MW_USE_WAYLAND)
|
||||||
ECHO_ERROR_VARIABLE
|
ECHO_ERROR_VARIABLE
|
||||||
COMMAND_ECHO STDOUT
|
COMMAND_ECHO STDOUT
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
check_include_files(wayland-client.h HAVE_WL_H)
|
function(scan_wayland_protocol_from_file proto file)
|
||||||
check_include_files(xkbcommon/xkbcommon.h HAVE_XKBCOMMON_H)
|
SET(proto_c ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/wayland/wayland-${proto}-protocol.c)
|
||||||
check_include_files(cairo/cairo.h HAVE_CAIRO_H)
|
execute_process(
|
||||||
if(HAVE_WL_H)
|
COMMAND wayland-scanner private-code ${CMAKE_CURRENT_SOURCE_DIR}/resource/wayland/${file} ${proto_c}
|
||||||
if(HAVE_XKBCOMMON_H)
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
if(HAVE_CAIRO_H)
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
scan_wayland_protocol_core()
|
ERROR_VARIABLE WAYLAND_SCANNER_ERROR
|
||||||
scan_wayland_protocol("stable" "xdg-shell" "")
|
ECHO_OUTPUT_VARIABLE
|
||||||
scan_wayland_protocol("stable" "viewporter" "")
|
ECHO_ERROR_VARIABLE
|
||||||
scan_wayland_protocol("stable" "tablet" "-v2")
|
COMMAND_ECHO STDOUT
|
||||||
scan_wayland_protocol("staging" "xdg-toplevel-icon" "-v1")
|
)
|
||||||
scan_wayland_protocol("staging" "cursor-shape" "-v1")
|
target_sources(
|
||||||
scan_wayland_protocol("unstable" "xdg-decoration" "-unstable-v1")
|
Mw
|
||||||
scan_wayland_protocol("unstable" "primary-selection" "-unstable-v1")
|
PRIVATE
|
||||||
scan_wayland_protocol("unstable" "pointer-constraints" "-unstable-v1")
|
${proto_c}
|
||||||
scan_wayland_protocol("unstable" "relative-pointer" "-unstable-v1")
|
)
|
||||||
|
execute_process(
|
||||||
|
COMMAND wayland-scanner client-header ${CMAKE_CURRENT_SOURCE_DIR}/resource/wayland/${file} ${CMAKE_CURRENT_SOURCE_DIR}/include/Mw/LowLevel/Wayland/${proto}-client-protocol.h
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE WAYLAND_SCANNER_OUTPUT
|
||||||
|
ERROR_VARIABLE WAYLAND_SCANNER_ERROR
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
ECHO_ERROR_VARIABLE
|
||||||
|
COMMAND_ECHO STDOUT
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
target_sources(
|
check_include_files(wayland-client.h HAVE_WL_H)
|
||||||
|
check_include_files(xkbcommon/xkbcommon.h HAVE_XKBCOMMON_H)
|
||||||
|
check_include_files(cairo/cairo.h HAVE_CAIRO_H)
|
||||||
|
if(HAVE_WL_H)
|
||||||
|
if(HAVE_XKBCOMMON_H)
|
||||||
|
if(HAVE_CAIRO_H)
|
||||||
|
scan_wayland_protocol_core()
|
||||||
|
scan_wayland_protocol("stable" "xdg-shell" "")
|
||||||
|
scan_wayland_protocol("stable" "viewporter" "")
|
||||||
|
scan_wayland_protocol("stable" "tablet" "-v2")
|
||||||
|
scan_wayland_protocol("staging" "xdg-toplevel-icon" "-v1")
|
||||||
|
scan_wayland_protocol("staging" "cursor-shape" "-v1")
|
||||||
|
scan_wayland_protocol("unstable" "xdg-decoration" "-unstable-v1")
|
||||||
|
scan_wayland_protocol("unstable" "primary-selection" "-unstable-v1")
|
||||||
|
scan_wayland_protocol("unstable" "pointer-constraints" "-unstable-v1")
|
||||||
|
scan_wayland_protocol("unstable" "relative-pointer" "-unstable-v1")
|
||||||
|
scan_wayland_protocol_from_file("wlr-layer-shell" "wlr-layer-shell-unstable-v1.xml")
|
||||||
|
|
||||||
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
src/backend/wayland.c
|
src/backend/cairo.c
|
||||||
|
src/backend/wayland/wayland.c
|
||||||
|
src/backend/wayland/buffer.c
|
||||||
|
src/backend/wayland/interfaces.c
|
||||||
|
src/backend/wayland/region.c
|
||||||
)
|
)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_WAYLAND
|
USE_WAYLAND
|
||||||
)
|
)
|
||||||
message(STATUS "Wayland backend has been enabled")
|
message(STATUS "Wayland backend has been enabled")
|
||||||
else()
|
else()
|
||||||
message(WARNING "Wayland backend has been disabled")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(WARNING "Wayland backend has been disabled")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(WARNING "Wayland backend has been disabled")
|
message(WARNING "Wayland backend has been disabled")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "Wayland backend has been disabled")
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "Wayland backend has been disabled")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE AND MW_BUILD_OPENGL)
|
if(APPLE AND MW_BUILD_OPENGL)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
GL_SILENCE_DEPRECATION
|
GL_SILENCE_DEPRECATION
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
external/libz/include
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
Mw
|
Mw
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
|
@ -246,68 +310,126 @@ target_include_directories(
|
||||||
)
|
)
|
||||||
|
|
||||||
if(MW_CLASSIC_THEME)
|
if(MW_CLASSIC_THEME)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_CLASSIC_THEME
|
USE_CLASSIC_THEME
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
message("Building Milsko for ${CMAKE_SYSTEM_NAME}")
|
||||||
target_sources(
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "MSYS")
|
||||||
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
src/backend/gdi.c
|
src/backend/gdi.c
|
||||||
)
|
)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_GDI
|
USE_GDI
|
||||||
)
|
)
|
||||||
list(APPEND LIBRARIES gdi32)
|
list(APPEND LIBRARIES gdi32 ole32 uuid)
|
||||||
target_link_options(
|
if(NOT MSVC)
|
||||||
|
target_link_options(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
-static-libgcc
|
-static-libgcc
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
target_sources(
|
# target_sources(
|
||||||
Mw
|
# Mw
|
||||||
PRIVATE
|
# PRIVATE
|
||||||
src/backend/cocoa.m
|
# src/backend/cocoa.m
|
||||||
)
|
# )
|
||||||
target_compile_definitions(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_COCOA
|
src/backend/nococoa.m
|
||||||
)
|
)
|
||||||
list(APPEND LIBRARIES objc)
|
# target_compile_definitions(
|
||||||
target_link_options(
|
# Mw
|
||||||
|
# PRIVATE
|
||||||
|
# USE_COCOA
|
||||||
|
# )
|
||||||
|
list(APPEND LIBRARIES objc)
|
||||||
|
target_link_options(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
-framework Cocoa
|
-framework Cocoa
|
||||||
)
|
)
|
||||||
else()
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
|
||||||
find_package(PkgConfig)
|
|
||||||
pkg_check_modules(X11 REQUIRED x11)
|
|
||||||
pkg_check_modules(XRENDER REQUIRED xrender)
|
|
||||||
|
|
||||||
target_sources(
|
target_sources(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
src/backend/classicmacos.c
|
||||||
|
)
|
||||||
|
if(PLATFORM MATCHES retroppc)
|
||||||
|
set_target_properties(Mw PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=601 -Os -Wall -Wextra -Wno-unused-parameter")
|
||||||
|
set_target_properties(Mw PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND LIBRARIES InterfaceLib WindowsLib ThreadsLib)
|
||||||
|
|
||||||
|
target_compile_definitions(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
CLASSIC_MAC_OS
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
find_package(X11)
|
||||||
|
pkg_check_modules(DBUS dbus-1)
|
||||||
|
|
||||||
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
src/backend/x11.c
|
src/backend/x11.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(${X11_FOUND})
|
||||||
|
list(APPEND INCLUDE_DIRS ${X11_INCLUDE_DIRS})
|
||||||
|
list(APPEND LIBRARY_DIRS ${X11_LIBRARY_DIRS})
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
USE_X11
|
USE_X11
|
||||||
)
|
)
|
||||||
list(APPEND INCLUDE_DIRS ${X11_INCLUDE_DIRS} ${XRENDER_INCLUDE_DIRS})
|
endif()
|
||||||
list(APPEND LIBRARY_DIRS ${X11_LIBRARY_DIRS} ${XRENDER_LIBRARY_DIRS})
|
if(${X11_Xrender_FOUND})
|
||||||
list(APPEND LIBRARIES ${X11_LIBRARIES} ${XRENDER_LIBRARIES} m)
|
list(APPEND INCLUDE_DIRS ${XRENDER_INCLUDE_DIRS})
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
list(APPEND LIBRARY_DIRS ${XRENDER_LIBRARY_DIRS})
|
||||||
list(APPEND LIBRARIES dl)
|
target_compile_definitions(
|
||||||
endif()
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
USE_XRENDER
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
list(APPEND LIBRARIES dl)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(DBus1)
|
||||||
|
|
||||||
|
if(${DBus1_FOUND})
|
||||||
|
list(APPEND INCLUDE_DIRS ${DBUS_INCLUDE_DIRS})
|
||||||
|
list(APPEND LIBRARY_DIRS ${DBUS_LIBRARY_DIRS})
|
||||||
|
target_compile_definitions(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
USE_DBUS
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
list(APPEND LIBRARIES m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
|
|
@ -326,21 +448,38 @@ target_link_libraries(
|
||||||
${LIBRARIES}
|
${LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(MW_BUILD_OPENGL)
|
||||||
|
target_compile_definitions(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
MW_OPENGL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MW_BUILD_VULKAN)
|
if(MW_BUILD_VULKAN)
|
||||||
check_include_files(vulkan/vk_enum_string_helper.h HAS_VK_ENUM_STRING_HELPER)
|
check_include_files(vulkan/vk_enum_string_helper.h HAS_VK_ENUM_STRING_HELPER)
|
||||||
if(HAS_VK_ENUM_STRING_HELPER)
|
if(HAS_VK_ENUM_STRING_HELPER)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
HAS_VK_ENUM_STRING_HELPER
|
HAS_VK_ENUM_STRING_HELPER
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
check_include_files(vulkan/VULKAN.h HAS_VK_HEADER)
|
||||||
|
if(HAS_VK_HEADER)
|
||||||
|
target_compile_definitions(
|
||||||
|
Mw
|
||||||
|
PRIVATE
|
||||||
|
MW_VULKAN
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
_MILSKO
|
_MILSKO _MILSKO_BUILD
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
|
@ -350,8 +489,19 @@ install(
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/resource/${PROJECT_NAME}.pc.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
|
||||||
|
DESTINATION $ENV{MINGW_PREFIX}/${CMAKE_INSTALL_DATADIR}/pkgconfig
|
||||||
|
)
|
||||||
|
|
||||||
if(MW_INSTALL_HEADERS)
|
if(MW_INSTALL_HEADERS)
|
||||||
install(
|
install(
|
||||||
DIRECTORY include/
|
DIRECTORY include/
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
FILES_MATCHING PATTERN "*.h"
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
|
@ -359,5 +509,5 @@ if(MW_INSTALL_HEADERS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MW_BUILD_EXAMPLES)
|
if(MW_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
45
Jenkinsfile
vendored
45
Jenkinsfile
vendored
|
|
@ -7,7 +7,11 @@ pipeline {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "master"
|
||||||
}
|
}
|
||||||
|
agent {
|
||||||
|
label "built-in"
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
|
sh("rm -rf include/Mw/LowLevel/Wayland")
|
||||||
sh("doxygen")
|
sh("doxygen")
|
||||||
sh("rm -rf /var/www/milsko-doxygen")
|
sh("rm -rf /var/www/milsko-doxygen")
|
||||||
sh("mv doxygen/html /var/www/milsko-doxygen")
|
sh("mv doxygen/html /var/www/milsko-doxygen")
|
||||||
|
|
@ -25,9 +29,11 @@ pipeline {
|
||||||
label "built-in"
|
label "built-in"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
sh("git clean -dfx")
|
||||||
sh("./configure --enable-opengl --enable-vulkan --without-vulkan-string-helper")
|
sh("./configure --enable-opengl --enable-vulkan --without-vulkan-string-helper")
|
||||||
sh("make clean")
|
|
||||||
sh("make -j4")
|
sh("make -j4")
|
||||||
|
sh("mv src/libMw.so libMw64.so")
|
||||||
|
archiveArtifacts("libMw64.so")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Build for Windows 32-bit") {
|
stage("Build for Windows 32-bit") {
|
||||||
|
|
@ -35,9 +41,12 @@ pipeline {
|
||||||
label "built-in"
|
label "built-in"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
sh("git clean -dfx")
|
||||||
sh("./configure --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=i686-w64-mingw32")
|
sh("./configure --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=i686-w64-mingw32")
|
||||||
sh("make clean")
|
|
||||||
sh("make -j4")
|
sh("make -j4")
|
||||||
|
sh("mv src/Mw.dll Mw32.dll")
|
||||||
|
sh("mv src/libMw.dll.a libMw32.dll.a")
|
||||||
|
archiveArtifacts("Mw32.dll,libMw32.dll.a")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Build for Windows 64-bit") {
|
stage("Build for Windows 64-bit") {
|
||||||
|
|
@ -45,18 +54,44 @@ pipeline {
|
||||||
label "built-in"
|
label "built-in"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
sh("git clean -dfx")
|
||||||
sh("./configure --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=x86_64-w64-mingw32")
|
sh("./configure --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=x86_64-w64-mingw32")
|
||||||
sh("make clean")
|
|
||||||
sh("make -j4")
|
sh("make -j4")
|
||||||
|
sh("mv src/Mw.dll Mw64.dll")
|
||||||
|
sh("mv src/libMw.dll.a libMw64.dll.a")
|
||||||
|
archiveArtifacts("Mw64.dll,libMw64.dll.a")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Build for Windows 64-bit (MSVC)") {
|
stage("Build for Windows 32-bit (MSVC)") {
|
||||||
agent {
|
agent {
|
||||||
label "2012r2"
|
label "2012r2"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
bat("nmake -f NTMakefile clean")
|
bat("git clean -dfx")
|
||||||
bat("nmake -f NTMakefile")
|
bat("nmake -f NTMakefile")
|
||||||
|
bat("move /y src\\Mw.dll MwMSVC32.dll")
|
||||||
|
bat("move /y src\\Mw.lib MwMSVC32.lib")
|
||||||
|
archiveArtifacts("MwMSVC32.dll,MwMSVC32.lib")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage("Build for Windows 32-bit (Watcom)") {
|
||||||
|
agent {
|
||||||
|
label "built-in"
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
WATCOM = "/usr/watcom"
|
||||||
|
INCLUDE = "/usr/watcom/h:/usr/watcom/h/nt"
|
||||||
|
PATH = "/usr/watcom/binl64:${env.PATH}"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh("git clean -dfx")
|
||||||
|
sh("wmake -f WatMakefile")
|
||||||
|
sh("mv src/Mw.dll MwWat32.dll")
|
||||||
|
sh("mv src/Mw.lib MwWat32.lib")
|
||||||
|
archiveArtifacts("MwWat32.dll,MwWat32.lib")
|
||||||
|
sh("./tools/watcom-pack.sh")
|
||||||
|
sh("mv milsko-examples.zip milsko-examples-win32.zip")
|
||||||
|
archiveArtifacts("milsko-examples-win32.zip")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
258
NTMakefile
generated
258
NTMakefile
generated
|
|
@ -1,14 +1,34 @@
|
||||||
CC = cl /TC /c /nologo
|
CC = cl /TC /c /nologo
|
||||||
LD = link /nologo
|
LD = link /nologo
|
||||||
|
|
||||||
CFLAGS = /Iinclude /D_MILSKO /DUSE_GDI /DUSE_STB_TRUETYPE /DUSE_STB_IMAGE /DSTBI_NO_SIMD
|
MW_CFLAGS = /Iinclude /Iexternal\libz\include /D_MILSKO /D_MILSKO_BUILD /DUSE_GDI /DUSE_STB_IMAGE /DSTBI_NO_SIMD /DUSE_GDI_TEXT /DMW_OPENGL
|
||||||
LDFLAGS = /DLL
|
MW_LDFLAGS = /DLL
|
||||||
|
EXE_CFLAGS = /Iinclude
|
||||||
|
EXE_LDFLAGS =
|
||||||
.SUFFIXES: .obj .c
|
.SUFFIXES: .obj .c
|
||||||
all: src\Mw.dll
|
all: src\Mw.dll examples\basic\box.exe examples\basic\calculator.exe examples\basic\checkbox.exe examples\basic\clipboard.exe examples\basic\colorpicker.exe examples\basic\combobox.exe examples\basic\example.exe examples\basic\filechooser.exe examples\basic\image.exe examples\basic\listbox.exe examples\basic\messagebox.exe examples\basic\periodic.exe examples\basic\progressbar.exe examples\basic\radiobox.exe examples\basic\rotate.exe examples\basic\scrollbar.exe examples\basic\sevensegment.exe examples\basic\subwindow.exe examples\basic\tab.exe examples\basic\treeview.exe examples\basic\viewport.exe examples\gldemos\boing.exe examples\gldemos\clock.exe examples\gldemos\cube.exe examples\gldemos\gears.exe examples\gldemos\triangle.exe examples\gldemos\tripaint.exe
|
||||||
|
lib: src\Mw.dll
|
||||||
|
examples: examples\basic\box.exe examples\basic\calculator.exe examples\basic\checkbox.exe examples\basic\clipboard.exe examples\basic\colorpicker.exe examples\basic\combobox.exe examples\basic\example.exe examples\basic\filechooser.exe examples\basic\image.exe examples\basic\listbox.exe examples\basic\messagebox.exe examples\basic\periodic.exe examples\basic\progressbar.exe examples\basic\radiobox.exe examples\basic\rotate.exe examples\basic\scrollbar.exe examples\basic\sevensegment.exe examples\basic\subwindow.exe examples\basic\tab.exe examples\basic\treeview.exe examples\basic\viewport.exe examples\gldemos\boing.exe examples\gldemos\clock.exe examples\gldemos\cube.exe examples\gldemos\gears.exe examples\gldemos\triangle.exe examples\gldemos\tripaint.exe
|
||||||
clean:
|
clean:
|
||||||
|
del /f /q external\libz\src\adler32.obj
|
||||||
|
del /f /q external\libz\src\compress.obj
|
||||||
|
del /f /q external\libz\src\crc32.obj
|
||||||
|
del /f /q external\libz\src\deflate.obj
|
||||||
|
del /f /q external\libz\src\gzclose.obj
|
||||||
|
del /f /q external\libz\src\gzlib.obj
|
||||||
|
del /f /q external\libz\src\gzread.obj
|
||||||
|
del /f /q external\libz\src\gzwrite.obj
|
||||||
|
del /f /q external\libz\src\infback.obj
|
||||||
|
del /f /q external\libz\src\inffast.obj
|
||||||
|
del /f /q external\libz\src\inflate.obj
|
||||||
|
del /f /q external\libz\src\inftrees.obj
|
||||||
|
del /f /q external\libz\src\trees.obj
|
||||||
|
del /f /q external\libz\src\uncompr.obj
|
||||||
|
del /f /q external\libz\src\zutil.obj
|
||||||
del /f /q external\stb_ds.obj
|
del /f /q external\stb_ds.obj
|
||||||
del /f /q external\stb_image.obj
|
del /f /q external\stb_image.obj
|
||||||
del /f /q external\stb_truetype.obj
|
del /f /q external\stb_truetype.obj
|
||||||
|
del /f /q src\abstract\charset.obj
|
||||||
del /f /q src\abstract\directory.obj
|
del /f /q src\abstract\directory.obj
|
||||||
del /f /q src\abstract\dynamic.obj
|
del /f /q src\abstract\dynamic.obj
|
||||||
del /f /q src\abstract\time.obj
|
del /f /q src\abstract\time.obj
|
||||||
|
|
@ -26,7 +46,6 @@ clean:
|
||||||
del /f /q src\dialog\filechooser.obj
|
del /f /q src\dialog\filechooser.obj
|
||||||
del /f /q src\dialog\messagebox.obj
|
del /f /q src\dialog\messagebox.obj
|
||||||
del /f /q src\draw.obj
|
del /f /q src\draw.obj
|
||||||
del /f /q src\error.obj
|
|
||||||
del /f /q src\icon\back.obj
|
del /f /q src\icon\back.obj
|
||||||
del /f /q src\icon\clock.obj
|
del /f /q src\icon\clock.obj
|
||||||
del /f /q src\icon\computer.obj
|
del /f /q src\icon\computer.obj
|
||||||
|
|
@ -46,15 +65,20 @@ clean:
|
||||||
del /f /q src\lowlevel.obj
|
del /f /q src\lowlevel.obj
|
||||||
del /f /q src\string.obj
|
del /f /q src\string.obj
|
||||||
del /f /q src\text\font\boldfont.obj
|
del /f /q src\text\font\boldfont.obj
|
||||||
|
del /f /q src\text\font\boldmonottf.obj
|
||||||
del /f /q src\text\font\boldttf.obj
|
del /f /q src\text\font\boldttf.obj
|
||||||
del /f /q src\text\font\font.obj
|
del /f /q src\text\font\font.obj
|
||||||
|
del /f /q src\text\font\monottf.obj
|
||||||
del /f /q src\text\font\ttf.obj
|
del /f /q src\text\font\ttf.obj
|
||||||
del /f /q src\text\ft2.obj
|
del /f /q src\text\ft2.obj
|
||||||
|
del /f /q src\text\gdi.obj
|
||||||
del /f /q src\text\stbtt.obj
|
del /f /q src\text\stbtt.obj
|
||||||
del /f /q src\text\text.obj
|
del /f /q src\text\text.obj
|
||||||
|
del /f /q src\truetype.obj
|
||||||
del /f /q src\unicode.obj
|
del /f /q src\unicode.obj
|
||||||
del /f /q src\widget\box.obj
|
del /f /q src\widget\box.obj
|
||||||
del /f /q src\widget\button.obj
|
del /f /q src\widget\button.obj
|
||||||
|
del /f /q src\widget\calendar.obj
|
||||||
del /f /q src\widget\checkbox.obj
|
del /f /q src\widget\checkbox.obj
|
||||||
del /f /q src\widget\combobox.obj
|
del /f /q src\widget\combobox.obj
|
||||||
del /f /q src\widget\entry.obj
|
del /f /q src\widget\entry.obj
|
||||||
|
|
@ -70,15 +94,235 @@ clean:
|
||||||
del /f /q src\widget\scrollbar.obj
|
del /f /q src\widget\scrollbar.obj
|
||||||
del /f /q src\widget\separator.obj
|
del /f /q src\widget\separator.obj
|
||||||
del /f /q src\widget\submenu.obj
|
del /f /q src\widget\submenu.obj
|
||||||
|
del /f /q src\widget\subwindow.obj
|
||||||
|
del /f /q src\widget\tab.obj
|
||||||
|
del /f /q src\widget\table.obj
|
||||||
del /f /q src\widget\treeview.obj
|
del /f /q src\widget\treeview.obj
|
||||||
del /f /q src\widget\viewport.obj
|
del /f /q src\widget\viewport.obj
|
||||||
del /f /q src\widget\window.obj
|
del /f /q src\widget\window.obj
|
||||||
del /f /q src\Mw.dll
|
del /f /q src\Mw.dll
|
||||||
del /f /q src\Mw.lib
|
del /f /q src\Mw.lib
|
||||||
|
del /f /q examples\basic\box.obj
|
||||||
|
del /f /q examples\basic\calculator.obj
|
||||||
|
del /f /q examples\basic\checkbox.obj
|
||||||
|
del /f /q examples\basic\clipboard.obj
|
||||||
|
del /f /q examples\basic\colorpicker.obj
|
||||||
|
del /f /q examples\basic\combobox.obj
|
||||||
|
del /f /q examples\basic\example.obj
|
||||||
|
del /f /q examples\basic\filechooser.obj
|
||||||
|
del /f /q examples\basic\image.obj
|
||||||
|
del /f /q examples\basic\listbox.obj
|
||||||
|
del /f /q examples\basic\messagebox.obj
|
||||||
|
del /f /q examples\basic\periodic.obj
|
||||||
|
del /f /q examples\basic\progressbar.obj
|
||||||
|
del /f /q examples\basic\radiobox.obj
|
||||||
|
del /f /q examples\basic\rotate.obj
|
||||||
|
del /f /q examples\basic\scrollbar.obj
|
||||||
|
del /f /q examples\basic\sevensegment.obj
|
||||||
|
del /f /q examples\basic\subwindow.obj
|
||||||
|
del /f /q examples\basic\tab.obj
|
||||||
|
del /f /q examples\basic\treeview.obj
|
||||||
|
del /f /q examples\basic\viewport.obj
|
||||||
|
del /f /q examples\gldemos\boing.obj
|
||||||
|
del /f /q examples\gldemos\clock.obj
|
||||||
|
del /f /q examples\gldemos\cube.obj
|
||||||
|
del /f /q examples\gldemos\gears.obj
|
||||||
|
del /f /q examples\gldemos\triangle.obj
|
||||||
|
del /f /q examples\gldemos\tripaint.obj
|
||||||
|
del /f /q examples\basic\box.exe
|
||||||
|
del /f /q examples\basic\calculator.exe
|
||||||
|
del /f /q examples\basic\checkbox.exe
|
||||||
|
del /f /q examples\basic\clipboard.exe
|
||||||
|
del /f /q examples\basic\colorpicker.exe
|
||||||
|
del /f /q examples\basic\combobox.exe
|
||||||
|
del /f /q examples\basic\example.exe
|
||||||
|
del /f /q examples\basic\filechooser.exe
|
||||||
|
del /f /q examples\basic\image.exe
|
||||||
|
del /f /q examples\basic\listbox.exe
|
||||||
|
del /f /q examples\basic\messagebox.exe
|
||||||
|
del /f /q examples\basic\periodic.exe
|
||||||
|
del /f /q examples\basic\progressbar.exe
|
||||||
|
del /f /q examples\basic\radiobox.exe
|
||||||
|
del /f /q examples\basic\rotate.exe
|
||||||
|
del /f /q examples\basic\scrollbar.exe
|
||||||
|
del /f /q examples\basic\sevensegment.exe
|
||||||
|
del /f /q examples\basic\subwindow.exe
|
||||||
|
del /f /q examples\basic\tab.exe
|
||||||
|
del /f /q examples\basic\treeview.exe
|
||||||
|
del /f /q examples\basic\viewport.exe
|
||||||
|
del /f /q examples\gldemos\boing.exe
|
||||||
|
del /f /q examples\gldemos\clock.exe
|
||||||
|
del /f /q examples\gldemos\cube.exe
|
||||||
|
del /f /q examples\gldemos\gears.exe
|
||||||
|
del /f /q examples\gldemos\triangle.exe
|
||||||
|
del /f /q examples\gldemos\tripaint.exe
|
||||||
|
|
||||||
src\Mw.dll: external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\error.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\ttf.obj src\text\ft2.obj src\text\stbtt.obj src\text\text.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj
|
examples\basic\box.exe: examples\basic\box.obj src\Mw.dll
|
||||||
$(LD) $(LDFLAGS) /OUT:$@ external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\error.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\ttf.obj src\text\ft2.obj src\text\stbtt.obj src\text\text.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj opengl32.lib gdi32.lib user32.lib
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\box.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\box.obj: examples/basic/box.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/box.c
|
||||||
|
|
||||||
|
examples\basic\calculator.exe: examples\basic\calculator.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\calculator.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\calculator.obj: examples/basic/calculator.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/calculator.c
|
||||||
|
|
||||||
|
examples\basic\checkbox.exe: examples\basic\checkbox.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\checkbox.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\checkbox.obj: examples/basic/checkbox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/checkbox.c
|
||||||
|
|
||||||
|
examples\basic\clipboard.exe: examples\basic\clipboard.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\clipboard.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\clipboard.obj: examples/basic/clipboard.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/clipboard.c
|
||||||
|
|
||||||
|
examples\basic\colorpicker.exe: examples\basic\colorpicker.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\colorpicker.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\colorpicker.obj: examples/basic/colorpicker.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/colorpicker.c
|
||||||
|
|
||||||
|
examples\basic\combobox.exe: examples\basic\combobox.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\combobox.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\combobox.obj: examples/basic/combobox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/combobox.c
|
||||||
|
|
||||||
|
examples\basic\example.exe: examples\basic\example.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\example.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\example.obj: examples/basic/example.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/example.c
|
||||||
|
|
||||||
|
examples\basic\filechooser.exe: examples\basic\filechooser.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\filechooser.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\filechooser.obj: examples/basic/filechooser.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/filechooser.c
|
||||||
|
|
||||||
|
examples\basic\image.exe: examples\basic\image.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\image.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\image.obj: examples/basic/image.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/image.c
|
||||||
|
|
||||||
|
examples\basic\listbox.exe: examples\basic\listbox.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\listbox.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\listbox.obj: examples/basic/listbox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/listbox.c
|
||||||
|
|
||||||
|
examples\basic\messagebox.exe: examples\basic\messagebox.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\messagebox.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\messagebox.obj: examples/basic/messagebox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/messagebox.c
|
||||||
|
|
||||||
|
examples\basic\periodic.exe: examples\basic\periodic.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\periodic.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\periodic.obj: examples/basic/periodic.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/periodic.c
|
||||||
|
|
||||||
|
examples\basic\progressbar.exe: examples\basic\progressbar.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\progressbar.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\progressbar.obj: examples/basic/progressbar.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/progressbar.c
|
||||||
|
|
||||||
|
examples\basic\radiobox.exe: examples\basic\radiobox.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\radiobox.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\radiobox.obj: examples/basic/radiobox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/radiobox.c
|
||||||
|
|
||||||
|
examples\basic\rotate.exe: examples\basic\rotate.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\rotate.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\rotate.obj: examples/basic/rotate.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/rotate.c
|
||||||
|
|
||||||
|
examples\basic\scrollbar.exe: examples\basic\scrollbar.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\scrollbar.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\scrollbar.obj: examples/basic/scrollbar.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/scrollbar.c
|
||||||
|
|
||||||
|
examples\basic\sevensegment.exe: examples\basic\sevensegment.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\sevensegment.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\sevensegment.obj: examples/basic/sevensegment.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/sevensegment.c
|
||||||
|
|
||||||
|
examples\basic\subwindow.exe: examples\basic\subwindow.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\subwindow.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\subwindow.obj: examples/basic/subwindow.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/subwindow.c
|
||||||
|
|
||||||
|
examples\basic\tab.exe: examples\basic\tab.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\tab.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\tab.obj: examples/basic/tab.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/tab.c
|
||||||
|
|
||||||
|
examples\basic\treeview.exe: examples\basic\treeview.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\treeview.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\treeview.obj: examples/basic/treeview.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/treeview.c
|
||||||
|
|
||||||
|
examples\basic\viewport.exe: examples\basic\viewport.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\viewport.obj src\Mw.lib
|
||||||
|
|
||||||
|
examples\basic\viewport.obj: examples/basic/viewport.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/viewport.c
|
||||||
|
|
||||||
|
examples\gldemos\boing.exe: examples\gldemos\boing.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\boing.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\boing.obj: examples/gldemos/boing.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/boing.c
|
||||||
|
|
||||||
|
examples\gldemos\clock.exe: examples\gldemos\clock.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\clock.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\clock.obj: examples/gldemos/clock.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/clock.c
|
||||||
|
|
||||||
|
examples\gldemos\cube.exe: examples\gldemos\cube.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\cube.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\cube.obj: examples/gldemos/cube.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/cube.c
|
||||||
|
|
||||||
|
examples\gldemos\gears.exe: examples\gldemos\gears.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\gears.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\gears.obj: examples/gldemos/gears.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/gears.c
|
||||||
|
|
||||||
|
examples\gldemos\triangle.exe: examples\gldemos\triangle.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\triangle.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\triangle.obj: examples/gldemos/triangle.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/triangle.c
|
||||||
|
|
||||||
|
examples\gldemos\tripaint.exe: examples\gldemos\tripaint.obj src\Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\tripaint.obj src\Mw.lib opengl32.lib glu32.lib
|
||||||
|
|
||||||
|
examples\gldemos\tripaint.obj: examples/gldemos/tripaint.c
|
||||||
|
$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/tripaint.c
|
||||||
|
|
||||||
|
|
||||||
|
src\Mw.dll: external\libz\src\adler32.obj external\libz\src\compress.obj external\libz\src\crc32.obj external\libz\src\deflate.obj external\libz\src\gzclose.obj external\libz\src\gzlib.obj external\libz\src\gzread.obj external\libz\src\gzwrite.obj external\libz\src\infback.obj external\libz\src\inffast.obj external\libz\src\inflate.obj external\libz\src\inftrees.obj external\libz\src\trees.obj external\libz\src\uncompr.obj external\libz\src\zutil.obj external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\charset.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldmonottf.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\monottf.obj src\text\font\ttf.obj src\text\ft2.obj src\text\gdi.obj src\text\stbtt.obj src\text\text.obj src\truetype.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\calendar.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\subwindow.obj src\widget\tab.obj src\widget\table.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj
|
||||||
|
$(LD) $(MW_LDFLAGS) /OUT:$@ external\libz\src\adler32.obj external\libz\src\compress.obj external\libz\src\crc32.obj external\libz\src\deflate.obj external\libz\src\gzclose.obj external\libz\src\gzlib.obj external\libz\src\gzread.obj external\libz\src\gzwrite.obj external\libz\src\infback.obj external\libz\src\inffast.obj external\libz\src\inflate.obj external\libz\src\inftrees.obj external\libz\src\trees.obj external\libz\src\uncompr.obj external\libz\src\zutil.obj external\stb_ds.obj external\stb_image.obj external\stb_truetype.obj src\abstract\charset.obj src\abstract\directory.obj src\abstract\dynamic.obj src\abstract\time.obj src\backend\gdi.obj src\color.obj src\core.obj src\cursor\arrow.obj src\cursor\cross.obj src\cursor\default.obj src\cursor\hidden.obj src\cursor\text.obj src\default.obj src\dialog\colorpicker.obj src\dialog\directorychooser.obj src\dialog\filechooser.obj src\dialog\messagebox.obj src\draw.obj src\icon\back.obj src\icon\clock.obj src\icon\computer.obj src\icon\directory.obj src\icon\down.obj src\icon\error.obj src\icon\file.obj src\icon\forward.obj src\icon\info.obj src\icon\left.obj src\icon\news.obj src\icon\note.obj src\icon\right.obj src\icon\search.obj src\icon\up.obj src\icon\warning.obj src\lowlevel.obj src\string.obj src\text\font\boldfont.obj src\text\font\boldmonottf.obj src\text\font\boldttf.obj src\text\font\font.obj src\text\font\monottf.obj src\text\font\ttf.obj src\text\ft2.obj src\text\gdi.obj src\text\stbtt.obj src\text\text.obj src\truetype.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\calendar.obj src\widget\checkbox.obj src\widget\combobox.obj src\widget\entry.obj src\widget\frame.obj src\widget\image.obj src\widget\label.obj src\widget\listbox.obj src\widget\menu.obj src\widget\numberentry.obj src\widget\opengl.obj src\widget\progressbar.obj src\widget\radiobox.obj src\widget\scrollbar.obj src\widget\separator.obj src\widget\submenu.obj src\widget\subwindow.obj src\widget\tab.obj src\widget\table.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj opengl32.lib gdi32.lib ole32.lib uuid.lib user32.lib advapi32.lib
|
||||||
|
|
||||||
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
$(CC) $(CFLAGS) /Fo$@ $<
|
$(CC) $(MW_CFLAGS) /Fo$@ $<
|
||||||
|
|
|
||||||
11
README.txt
11
README.txt
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
Greetings - Welcome to the Milsko GUI Toolkit (Version pre-1.0)
|
Greetings - Welcome to the Milsko GUI Toolkit (Version 1.4)
|
||||||
|
|
||||||
This document contains a brief summary of the contents of this source
|
This document contains a brief summary of the contents of this source
|
||||||
distributions and building instructions for Milsko GUI Toolkit.
|
distributions and building instructions for Milsko GUI Toolkit.
|
||||||
|
|
@ -8,8 +8,7 @@ distributions and building instructions for Milsko GUI Toolkit.
|
||||||
|
|
||||||
Milsko requires either
|
Milsko requires either
|
||||||
* A Windows environment with GDI (so anything NT or 9x)
|
* A Windows environment with GDI (so anything NT or 9x)
|
||||||
* A MacOS environment with Cocoa (10.4 or above supported)
|
* A Unix-like environment with Wayland and/or X11 for runtime.
|
||||||
* A Unix-like environment with X11 for runtime.
|
|
||||||
|
|
||||||
To build Milsko for Windows, you must have one of following compilers:
|
To build Milsko for Windows, you must have one of following compilers:
|
||||||
* Visual C++ 6.0 or newer
|
* Visual C++ 6.0 or newer
|
||||||
|
|
@ -63,8 +62,10 @@ D. MinGW-w64/GCC/Clang
|
||||||
|
|
||||||
1) Determine if you need Vulkan and/or OpenGL.
|
1) Determine if you need Vulkan and/or OpenGL.
|
||||||
|
|
||||||
2) Run `./configure'.
|
2) Either:
|
||||||
For help, run `./configure --help'.
|
a.) Run `./configure'. For help, run `./configure --help'.
|
||||||
|
b.) Use CMake; i.e. `cmake -B build`. (if contributing, name the build
|
||||||
|
folder build as that's what's included in the .gitignore)
|
||||||
|
|
||||||
3) Run `make'.
|
3) Run `make'.
|
||||||
|
|
||||||
|
|
|
||||||
440
WatMakefile
generated
440
WatMakefile
generated
|
|
@ -1,13 +1,33 @@
|
||||||
CC = wcc386 -bt=nt -q -bd
|
CC = wcc386 -bt=nt -q
|
||||||
LD = wlink option quiet
|
LD = wlink option quiet
|
||||||
|
|
||||||
CFLAGS = -i=include -d_MILSKO -dUSE_GDI -dUSE_STB_TRUETYPE -dUSE_STB_IMAGE -dSTBI_NO_SIMD
|
MW_CFLAGS = -bd -i=include -i=external/libz/include -d_MILSKO -d_MILSKO_BUILD -dUSE_GDI -dUSE_STB_IMAGE -dSTBI_NO_SIMD -dUSE_GDI_TEXT -dMW_OPENGL
|
||||||
LDFLAGS = system nt_dll
|
MW_LDFLAGS = system nt_dll
|
||||||
all: src/Mw.dll
|
EXE_CFLAGS = -i=include
|
||||||
|
EXE_LDFLAGS = system nt
|
||||||
|
all: src/Mw.dll examples/basic/box.exe examples/basic/calculator.exe examples/basic/checkbox.exe examples/basic/clipboard.exe examples/basic/colorpicker.exe examples/basic/combobox.exe examples/basic/example.exe examples/basic/filechooser.exe examples/basic/image.exe examples/basic/listbox.exe examples/basic/messagebox.exe examples/basic/periodic.exe examples/basic/progressbar.exe examples/basic/radiobox.exe examples/basic/rotate.exe examples/basic/scrollbar.exe examples/basic/sevensegment.exe examples/basic/subwindow.exe examples/basic/tab.exe examples/basic/treeview.exe examples/basic/viewport.exe examples/gldemos/boing.exe examples/gldemos/clock.exe examples/gldemos/cube.exe examples/gldemos/gears.exe examples/gldemos/triangle.exe examples/gldemos/tripaint.exe
|
||||||
|
lib: src/Mw.dll
|
||||||
|
examples: examples/basic/box.exe examples/basic/calculator.exe examples/basic/checkbox.exe examples/basic/clipboard.exe examples/basic/colorpicker.exe examples/basic/combobox.exe examples/basic/example.exe examples/basic/filechooser.exe examples/basic/image.exe examples/basic/listbox.exe examples/basic/messagebox.exe examples/basic/periodic.exe examples/basic/progressbar.exe examples/basic/radiobox.exe examples/basic/rotate.exe examples/basic/scrollbar.exe examples/basic/sevensegment.exe examples/basic/subwindow.exe examples/basic/tab.exe examples/basic/treeview.exe examples/basic/viewport.exe examples/gldemos/boing.exe examples/gldemos/clock.exe examples/gldemos/cube.exe examples/gldemos/gears.exe examples/gldemos/triangle.exe examples/gldemos/tripaint.exe
|
||||||
clean: .SYMBOLIC
|
clean: .SYMBOLIC
|
||||||
|
%erase external/libz/src/adler32.obj
|
||||||
|
%erase external/libz/src/compress.obj
|
||||||
|
%erase external/libz/src/crc32.obj
|
||||||
|
%erase external/libz/src/deflate.obj
|
||||||
|
%erase external/libz/src/gzclose.obj
|
||||||
|
%erase external/libz/src/gzlib.obj
|
||||||
|
%erase external/libz/src/gzread.obj
|
||||||
|
%erase external/libz/src/gzwrite.obj
|
||||||
|
%erase external/libz/src/infback.obj
|
||||||
|
%erase external/libz/src/inffast.obj
|
||||||
|
%erase external/libz/src/inflate.obj
|
||||||
|
%erase external/libz/src/inftrees.obj
|
||||||
|
%erase external/libz/src/trees.obj
|
||||||
|
%erase external/libz/src/uncompr.obj
|
||||||
|
%erase external/libz/src/zutil.obj
|
||||||
%erase external/stb_ds.obj
|
%erase external/stb_ds.obj
|
||||||
%erase external/stb_image.obj
|
%erase external/stb_image.obj
|
||||||
%erase external/stb_truetype.obj
|
%erase external/stb_truetype.obj
|
||||||
|
%erase src/abstract/charset.obj
|
||||||
%erase src/abstract/directory.obj
|
%erase src/abstract/directory.obj
|
||||||
%erase src/abstract/dynamic.obj
|
%erase src/abstract/dynamic.obj
|
||||||
%erase src/abstract/time.obj
|
%erase src/abstract/time.obj
|
||||||
|
|
@ -25,7 +45,6 @@ clean: .SYMBOLIC
|
||||||
%erase src/dialog/filechooser.obj
|
%erase src/dialog/filechooser.obj
|
||||||
%erase src/dialog/messagebox.obj
|
%erase src/dialog/messagebox.obj
|
||||||
%erase src/draw.obj
|
%erase src/draw.obj
|
||||||
%erase src/error.obj
|
|
||||||
%erase src/icon/back.obj
|
%erase src/icon/back.obj
|
||||||
%erase src/icon/clock.obj
|
%erase src/icon/clock.obj
|
||||||
%erase src/icon/computer.obj
|
%erase src/icon/computer.obj
|
||||||
|
|
@ -45,15 +64,20 @@ clean: .SYMBOLIC
|
||||||
%erase src/lowlevel.obj
|
%erase src/lowlevel.obj
|
||||||
%erase src/string.obj
|
%erase src/string.obj
|
||||||
%erase src/text/font/boldfont.obj
|
%erase src/text/font/boldfont.obj
|
||||||
|
%erase src/text/font/boldmonottf.obj
|
||||||
%erase src/text/font/boldttf.obj
|
%erase src/text/font/boldttf.obj
|
||||||
%erase src/text/font/font.obj
|
%erase src/text/font/font.obj
|
||||||
|
%erase src/text/font/monottf.obj
|
||||||
%erase src/text/font/ttf.obj
|
%erase src/text/font/ttf.obj
|
||||||
%erase src/text/ft2.obj
|
%erase src/text/ft2.obj
|
||||||
|
%erase src/text/gdi.obj
|
||||||
%erase src/text/stbtt.obj
|
%erase src/text/stbtt.obj
|
||||||
%erase src/text/text.obj
|
%erase src/text/text.obj
|
||||||
|
%erase src/truetype.obj
|
||||||
%erase src/unicode.obj
|
%erase src/unicode.obj
|
||||||
%erase src/widget/box.obj
|
%erase src/widget/box.obj
|
||||||
%erase src/widget/button.obj
|
%erase src/widget/button.obj
|
||||||
|
%erase src/widget/calendar.obj
|
||||||
%erase src/widget/checkbox.obj
|
%erase src/widget/checkbox.obj
|
||||||
%erase src/widget/combobox.obj
|
%erase src/widget/combobox.obj
|
||||||
%erase src/widget/entry.obj
|
%erase src/widget/entry.obj
|
||||||
|
|
@ -69,148 +93,414 @@ clean: .SYMBOLIC
|
||||||
%erase src/widget/scrollbar.obj
|
%erase src/widget/scrollbar.obj
|
||||||
%erase src/widget/separator.obj
|
%erase src/widget/separator.obj
|
||||||
%erase src/widget/submenu.obj
|
%erase src/widget/submenu.obj
|
||||||
|
%erase src/widget/subwindow.obj
|
||||||
|
%erase src/widget/tab.obj
|
||||||
|
%erase src/widget/table.obj
|
||||||
%erase src/widget/treeview.obj
|
%erase src/widget/treeview.obj
|
||||||
%erase src/widget/viewport.obj
|
%erase src/widget/viewport.obj
|
||||||
%erase src/widget/window.obj
|
%erase src/widget/window.obj
|
||||||
%erase src/Mw.dll
|
%erase src/Mw.dll
|
||||||
%erase src/Mw.lib
|
%erase src/Mw.lib
|
||||||
|
%erase examples/basic/box.obj
|
||||||
|
%erase examples/basic/calculator.obj
|
||||||
|
%erase examples/basic/checkbox.obj
|
||||||
|
%erase examples/basic/clipboard.obj
|
||||||
|
%erase examples/basic/colorpicker.obj
|
||||||
|
%erase examples/basic/combobox.obj
|
||||||
|
%erase examples/basic/example.obj
|
||||||
|
%erase examples/basic/filechooser.obj
|
||||||
|
%erase examples/basic/image.obj
|
||||||
|
%erase examples/basic/listbox.obj
|
||||||
|
%erase examples/basic/messagebox.obj
|
||||||
|
%erase examples/basic/periodic.obj
|
||||||
|
%erase examples/basic/progressbar.obj
|
||||||
|
%erase examples/basic/radiobox.obj
|
||||||
|
%erase examples/basic/rotate.obj
|
||||||
|
%erase examples/basic/scrollbar.obj
|
||||||
|
%erase examples/basic/sevensegment.obj
|
||||||
|
%erase examples/basic/subwindow.obj
|
||||||
|
%erase examples/basic/tab.obj
|
||||||
|
%erase examples/basic/treeview.obj
|
||||||
|
%erase examples/basic/viewport.obj
|
||||||
|
%erase examples/gldemos/boing.obj
|
||||||
|
%erase examples/gldemos/clock.obj
|
||||||
|
%erase examples/gldemos/cube.obj
|
||||||
|
%erase examples/gldemos/gears.obj
|
||||||
|
%erase examples/gldemos/triangle.obj
|
||||||
|
%erase examples/gldemos/tripaint.obj
|
||||||
|
%erase examples/basic/box.exe
|
||||||
|
%erase examples/basic/calculator.exe
|
||||||
|
%erase examples/basic/checkbox.exe
|
||||||
|
%erase examples/basic/clipboard.exe
|
||||||
|
%erase examples/basic/colorpicker.exe
|
||||||
|
%erase examples/basic/combobox.exe
|
||||||
|
%erase examples/basic/example.exe
|
||||||
|
%erase examples/basic/filechooser.exe
|
||||||
|
%erase examples/basic/image.exe
|
||||||
|
%erase examples/basic/listbox.exe
|
||||||
|
%erase examples/basic/messagebox.exe
|
||||||
|
%erase examples/basic/periodic.exe
|
||||||
|
%erase examples/basic/progressbar.exe
|
||||||
|
%erase examples/basic/radiobox.exe
|
||||||
|
%erase examples/basic/rotate.exe
|
||||||
|
%erase examples/basic/scrollbar.exe
|
||||||
|
%erase examples/basic/sevensegment.exe
|
||||||
|
%erase examples/basic/subwindow.exe
|
||||||
|
%erase examples/basic/tab.exe
|
||||||
|
%erase examples/basic/treeview.exe
|
||||||
|
%erase examples/basic/viewport.exe
|
||||||
|
%erase examples/gldemos/boing.exe
|
||||||
|
%erase examples/gldemos/clock.exe
|
||||||
|
%erase examples/gldemos/cube.exe
|
||||||
|
%erase examples/gldemos/gears.exe
|
||||||
|
%erase examples/gldemos/triangle.exe
|
||||||
|
%erase examples/gldemos/tripaint.exe
|
||||||
|
|
||||||
src/Mw.dll: external/stb_ds.obj external/stb_image.obj external/stb_truetype.obj src/abstract/directory.obj src/abstract/dynamic.obj src/abstract/time.obj src/backend/gdi.obj src/color.obj src/core.obj src/cursor/arrow.obj src/cursor/cross.obj src/cursor/default.obj src/cursor/hidden.obj src/cursor/text.obj src/default.obj src/dialog/colorpicker.obj src/dialog/directorychooser.obj src/dialog/filechooser.obj src/dialog/messagebox.obj src/draw.obj src/error.obj src/icon/back.obj src/icon/clock.obj src/icon/computer.obj src/icon/directory.obj src/icon/down.obj src/icon/error.obj src/icon/file.obj src/icon/forward.obj src/icon/info.obj src/icon/left.obj src/icon/news.obj src/icon/note.obj src/icon/right.obj src/icon/search.obj src/icon/up.obj src/icon/warning.obj src/lowlevel.obj src/string.obj src/text/font/boldfont.obj src/text/font/boldttf.obj src/text/font/font.obj src/text/font/ttf.obj src/text/ft2.obj src/text/stbtt.obj src/text/text.obj src/unicode.obj src/widget/box.obj src/widget/button.obj src/widget/checkbox.obj src/widget/combobox.obj src/widget/entry.obj src/widget/frame.obj src/widget/image.obj src/widget/label.obj src/widget/listbox.obj src/widget/menu.obj src/widget/numberentry.obj src/widget/opengl.obj src/widget/progressbar.obj src/widget/radiobox.obj src/widget/scrollbar.obj src/widget/separator.obj src/widget/submenu.obj src/widget/treeview.obj src/widget/viewport.obj src/widget/window.obj
|
examples/basic/box.exe: examples/basic/box.obj src/Mw.dll
|
||||||
$(LD) $(LDFLAGS) option implib=src/Mw.lib name $@ file external/stb_ds.obj file external/stb_image.obj file external/stb_truetype.obj file src/abstract/directory.obj file src/abstract/dynamic.obj file src/abstract/time.obj file src/backend/gdi.obj file src/color.obj file src/core.obj file src/cursor/arrow.obj file src/cursor/cross.obj file src/cursor/default.obj file src/cursor/hidden.obj file src/cursor/text.obj file src/default.obj file src/dialog/colorpicker.obj file src/dialog/directorychooser.obj file src/dialog/filechooser.obj file src/dialog/messagebox.obj file src/draw.obj file src/error.obj file src/icon/back.obj file src/icon/clock.obj file src/icon/computer.obj file src/icon/directory.obj file src/icon/down.obj file src/icon/error.obj file src/icon/file.obj file src/icon/forward.obj file src/icon/info.obj file src/icon/left.obj file src/icon/news.obj file src/icon/note.obj file src/icon/right.obj file src/icon/search.obj file src/icon/up.obj file src/icon/warning.obj file src/lowlevel.obj file src/string.obj file src/text/font/boldfont.obj file src/text/font/boldttf.obj file src/text/font/font.obj file src/text/font/ttf.obj file src/text/ft2.obj file src/text/stbtt.obj file src/text/text.obj file src/unicode.obj file src/widget/box.obj file src/widget/button.obj file src/widget/checkbox.obj file src/widget/combobox.obj file src/widget/entry.obj file src/widget/frame.obj file src/widget/image.obj file src/widget/label.obj file src/widget/listbox.obj file src/widget/menu.obj file src/widget/numberentry.obj file src/widget/opengl.obj file src/widget/progressbar.obj file src/widget/radiobox.obj file src/widget/scrollbar.obj file src/widget/separator.obj file src/widget/submenu.obj file src/widget/treeview.obj file src/widget/viewport.obj file src/widget/window.obj library clib3r.lib library opengl32.lib library gdi32.lib library user32.lib
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/box.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/box.obj: examples/basic/box.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/box.c
|
||||||
|
|
||||||
|
examples/basic/calculator.exe: examples/basic/calculator.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/calculator.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/calculator.obj: examples/basic/calculator.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/calculator.c
|
||||||
|
|
||||||
|
examples/basic/checkbox.exe: examples/basic/checkbox.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/checkbox.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/checkbox.obj: examples/basic/checkbox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/checkbox.c
|
||||||
|
|
||||||
|
examples/basic/clipboard.exe: examples/basic/clipboard.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/clipboard.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/clipboard.obj: examples/basic/clipboard.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/clipboard.c
|
||||||
|
|
||||||
|
examples/basic/colorpicker.exe: examples/basic/colorpicker.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/colorpicker.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/colorpicker.obj: examples/basic/colorpicker.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/colorpicker.c
|
||||||
|
|
||||||
|
examples/basic/combobox.exe: examples/basic/combobox.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/combobox.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/combobox.obj: examples/basic/combobox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/combobox.c
|
||||||
|
|
||||||
|
examples/basic/example.exe: examples/basic/example.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/example.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/example.obj: examples/basic/example.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/example.c
|
||||||
|
|
||||||
|
examples/basic/filechooser.exe: examples/basic/filechooser.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/filechooser.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/filechooser.obj: examples/basic/filechooser.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/filechooser.c
|
||||||
|
|
||||||
|
examples/basic/image.exe: examples/basic/image.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/image.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/image.obj: examples/basic/image.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/image.c
|
||||||
|
|
||||||
|
examples/basic/listbox.exe: examples/basic/listbox.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/listbox.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/listbox.obj: examples/basic/listbox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/listbox.c
|
||||||
|
|
||||||
|
examples/basic/messagebox.exe: examples/basic/messagebox.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/messagebox.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/messagebox.obj: examples/basic/messagebox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/messagebox.c
|
||||||
|
|
||||||
|
examples/basic/periodic.exe: examples/basic/periodic.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/periodic.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/periodic.obj: examples/basic/periodic.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/periodic.c
|
||||||
|
|
||||||
|
examples/basic/progressbar.exe: examples/basic/progressbar.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/progressbar.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/progressbar.obj: examples/basic/progressbar.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/progressbar.c
|
||||||
|
|
||||||
|
examples/basic/radiobox.exe: examples/basic/radiobox.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/radiobox.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/radiobox.obj: examples/basic/radiobox.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/radiobox.c
|
||||||
|
|
||||||
|
examples/basic/rotate.exe: examples/basic/rotate.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/rotate.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/rotate.obj: examples/basic/rotate.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/rotate.c
|
||||||
|
|
||||||
|
examples/basic/scrollbar.exe: examples/basic/scrollbar.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/scrollbar.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/scrollbar.obj: examples/basic/scrollbar.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/scrollbar.c
|
||||||
|
|
||||||
|
examples/basic/sevensegment.exe: examples/basic/sevensegment.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/sevensegment.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/sevensegment.obj: examples/basic/sevensegment.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/sevensegment.c
|
||||||
|
|
||||||
|
examples/basic/subwindow.exe: examples/basic/subwindow.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/subwindow.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/subwindow.obj: examples/basic/subwindow.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/subwindow.c
|
||||||
|
|
||||||
|
examples/basic/tab.exe: examples/basic/tab.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/tab.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/tab.obj: examples/basic/tab.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/tab.c
|
||||||
|
|
||||||
|
examples/basic/treeview.exe: examples/basic/treeview.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/treeview.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/treeview.obj: examples/basic/treeview.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/treeview.c
|
||||||
|
|
||||||
|
examples/basic/viewport.exe: examples/basic/viewport.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/basic/viewport.obj library clib3r.lib library src/Mw.lib
|
||||||
|
|
||||||
|
examples/basic/viewport.obj: examples/basic/viewport.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/basic/viewport.c
|
||||||
|
|
||||||
|
examples/gldemos/boing.exe: examples/gldemos/boing.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/boing.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/boing.obj: examples/gldemos/boing.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/boing.c
|
||||||
|
|
||||||
|
examples/gldemos/clock.exe: examples/gldemos/clock.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/clock.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/clock.obj: examples/gldemos/clock.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/clock.c
|
||||||
|
|
||||||
|
examples/gldemos/cube.exe: examples/gldemos/cube.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/cube.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/cube.obj: examples/gldemos/cube.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/cube.c
|
||||||
|
|
||||||
|
examples/gldemos/gears.exe: examples/gldemos/gears.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/gears.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/gears.obj: examples/gldemos/gears.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/gears.c
|
||||||
|
|
||||||
|
examples/gldemos/triangle.exe: examples/gldemos/triangle.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/triangle.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/triangle.obj: examples/gldemos/triangle.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/triangle.c
|
||||||
|
|
||||||
|
examples/gldemos/tripaint.exe: examples/gldemos/tripaint.obj src/Mw.dll
|
||||||
|
$(LD) $(EXE_LDFLAGS) name $@ file examples/gldemos/tripaint.obj library clib3r.lib library src/Mw.lib library opengl32.lib library glu32.lib
|
||||||
|
|
||||||
|
examples/gldemos/tripaint.obj: examples/gldemos/tripaint.c
|
||||||
|
$(CC) $(EXE_CFLAGS) -fo=$@ examples/gldemos/tripaint.c
|
||||||
|
|
||||||
|
|
||||||
|
src/Mw.dll: external/libz/src/adler32.obj external/libz/src/compress.obj external/libz/src/crc32.obj external/libz/src/deflate.obj external/libz/src/gzclose.obj external/libz/src/gzlib.obj external/libz/src/gzread.obj external/libz/src/gzwrite.obj external/libz/src/infback.obj external/libz/src/inffast.obj external/libz/src/inflate.obj external/libz/src/inftrees.obj external/libz/src/trees.obj external/libz/src/uncompr.obj external/libz/src/zutil.obj external/stb_ds.obj external/stb_image.obj external/stb_truetype.obj src/abstract/charset.obj src/abstract/directory.obj src/abstract/dynamic.obj src/abstract/time.obj src/backend/gdi.obj src/color.obj src/core.obj src/cursor/arrow.obj src/cursor/cross.obj src/cursor/default.obj src/cursor/hidden.obj src/cursor/text.obj src/default.obj src/dialog/colorpicker.obj src/dialog/directorychooser.obj src/dialog/filechooser.obj src/dialog/messagebox.obj src/draw.obj src/icon/back.obj src/icon/clock.obj src/icon/computer.obj src/icon/directory.obj src/icon/down.obj src/icon/error.obj src/icon/file.obj src/icon/forward.obj src/icon/info.obj src/icon/left.obj src/icon/news.obj src/icon/note.obj src/icon/right.obj src/icon/search.obj src/icon/up.obj src/icon/warning.obj src/lowlevel.obj src/string.obj src/text/font/boldfont.obj src/text/font/boldmonottf.obj src/text/font/boldttf.obj src/text/font/font.obj src/text/font/monottf.obj src/text/font/ttf.obj src/text/ft2.obj src/text/gdi.obj src/text/stbtt.obj src/text/text.obj src/truetype.obj src/unicode.obj src/widget/box.obj src/widget/button.obj src/widget/calendar.obj src/widget/checkbox.obj src/widget/combobox.obj src/widget/entry.obj src/widget/frame.obj src/widget/image.obj src/widget/label.obj src/widget/listbox.obj src/widget/menu.obj src/widget/numberentry.obj src/widget/opengl.obj src/widget/progressbar.obj src/widget/radiobox.obj src/widget/scrollbar.obj src/widget/separator.obj src/widget/submenu.obj src/widget/subwindow.obj src/widget/tab.obj src/widget/table.obj src/widget/treeview.obj src/widget/viewport.obj src/widget/window.obj
|
||||||
|
$(LD) $(MW_LDFLAGS) option implib=src/Mw.lib name $@ file external/libz/src/adler32.obj file external/libz/src/compress.obj file external/libz/src/crc32.obj file external/libz/src/deflate.obj file external/libz/src/gzclose.obj file external/libz/src/gzlib.obj file external/libz/src/gzread.obj file external/libz/src/gzwrite.obj file external/libz/src/infback.obj file external/libz/src/inffast.obj file external/libz/src/inflate.obj file external/libz/src/inftrees.obj file external/libz/src/trees.obj file external/libz/src/uncompr.obj file external/libz/src/zutil.obj file external/stb_ds.obj file external/stb_image.obj file external/stb_truetype.obj file src/abstract/charset.obj file src/abstract/directory.obj file src/abstract/dynamic.obj file src/abstract/time.obj file src/backend/gdi.obj file src/color.obj file src/core.obj file src/cursor/arrow.obj file src/cursor/cross.obj file src/cursor/default.obj file src/cursor/hidden.obj file src/cursor/text.obj file src/default.obj file src/dialog/colorpicker.obj file src/dialog/directorychooser.obj file src/dialog/filechooser.obj file src/dialog/messagebox.obj file src/draw.obj file src/icon/back.obj file src/icon/clock.obj file src/icon/computer.obj file src/icon/directory.obj file src/icon/down.obj file src/icon/error.obj file src/icon/file.obj file src/icon/forward.obj file src/icon/info.obj file src/icon/left.obj file src/icon/news.obj file src/icon/note.obj file src/icon/right.obj file src/icon/search.obj file src/icon/up.obj file src/icon/warning.obj file src/lowlevel.obj file src/string.obj file src/text/font/boldfont.obj file src/text/font/boldmonottf.obj file src/text/font/boldttf.obj file src/text/font/font.obj file src/text/font/monottf.obj file src/text/font/ttf.obj file src/text/ft2.obj file src/text/gdi.obj file src/text/stbtt.obj file src/text/text.obj file src/truetype.obj file src/unicode.obj file src/widget/box.obj file src/widget/button.obj file src/widget/calendar.obj file src/widget/checkbox.obj file src/widget/combobox.obj file src/widget/entry.obj file src/widget/frame.obj file src/widget/image.obj file src/widget/label.obj file src/widget/listbox.obj file src/widget/menu.obj file src/widget/numberentry.obj file src/widget/opengl.obj file src/widget/progressbar.obj file src/widget/radiobox.obj file src/widget/scrollbar.obj file src/widget/separator.obj file src/widget/submenu.obj file src/widget/subwindow.obj file src/widget/tab.obj file src/widget/table.obj file src/widget/treeview.obj file src/widget/viewport.obj file src/widget/window.obj library clib3r.lib library opengl32.lib library gdi32.lib library ole32.lib library uuid.lib library user32.lib library advapi32.lib
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
external/libz/src/adler32.obj: external/libz/src/adler32.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/adler32.c
|
||||||
|
external/libz/src/compress.obj: external/libz/src/compress.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/compress.c
|
||||||
|
external/libz/src/crc32.obj: external/libz/src/crc32.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/crc32.c
|
||||||
|
external/libz/src/deflate.obj: external/libz/src/deflate.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/deflate.c
|
||||||
|
external/libz/src/gzclose.obj: external/libz/src/gzclose.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/gzclose.c
|
||||||
|
external/libz/src/gzlib.obj: external/libz/src/gzlib.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/gzlib.c
|
||||||
|
external/libz/src/gzread.obj: external/libz/src/gzread.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/gzread.c
|
||||||
|
external/libz/src/gzwrite.obj: external/libz/src/gzwrite.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/gzwrite.c
|
||||||
|
external/libz/src/infback.obj: external/libz/src/infback.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/infback.c
|
||||||
|
external/libz/src/inffast.obj: external/libz/src/inffast.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/inffast.c
|
||||||
|
external/libz/src/inflate.obj: external/libz/src/inflate.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/inflate.c
|
||||||
|
external/libz/src/inftrees.obj: external/libz/src/inftrees.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/inftrees.c
|
||||||
|
external/libz/src/trees.obj: external/libz/src/trees.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/trees.c
|
||||||
|
external/libz/src/uncompr.obj: external/libz/src/uncompr.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/uncompr.c
|
||||||
|
external/libz/src/zutil.obj: external/libz/src/zutil.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ external/libz/src/zutil.c
|
||||||
external/stb_ds.obj: external/stb_ds.c
|
external/stb_ds.obj: external/stb_ds.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ external/stb_ds.c
|
||||||
external/stb_image.obj: external/stb_image.c
|
external/stb_image.obj: external/stb_image.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ external/stb_image.c
|
||||||
external/stb_truetype.obj: external/stb_truetype.c
|
external/stb_truetype.obj: external/stb_truetype.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ external/stb_truetype.c
|
||||||
|
src/abstract/charset.obj: src/abstract/charset.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/abstract/charset.c
|
||||||
src/abstract/directory.obj: src/abstract/directory.c
|
src/abstract/directory.obj: src/abstract/directory.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/abstract/directory.c
|
||||||
src/abstract/dynamic.obj: src/abstract/dynamic.c
|
src/abstract/dynamic.obj: src/abstract/dynamic.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/abstract/dynamic.c
|
||||||
src/abstract/time.obj: src/abstract/time.c
|
src/abstract/time.obj: src/abstract/time.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/abstract/time.c
|
||||||
src/backend/gdi.obj: src/backend/gdi.c
|
src/backend/gdi.obj: src/backend/gdi.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/backend/gdi.c
|
||||||
src/color.obj: src/color.c
|
src/color.obj: src/color.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/color.c
|
||||||
src/core.obj: src/core.c
|
src/core.obj: src/core.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/core.c
|
||||||
src/cursor/arrow.obj: src/cursor/arrow.c
|
src/cursor/arrow.obj: src/cursor/arrow.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/cursor/arrow.c
|
||||||
src/cursor/cross.obj: src/cursor/cross.c
|
src/cursor/cross.obj: src/cursor/cross.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/cursor/cross.c
|
||||||
src/cursor/default.obj: src/cursor/default.c
|
src/cursor/default.obj: src/cursor/default.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/cursor/default.c
|
||||||
src/cursor/hidden.obj: src/cursor/hidden.c
|
src/cursor/hidden.obj: src/cursor/hidden.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/cursor/hidden.c
|
||||||
src/cursor/text.obj: src/cursor/text.c
|
src/cursor/text.obj: src/cursor/text.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/cursor/text.c
|
||||||
src/default.obj: src/default.c
|
src/default.obj: src/default.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/default.c
|
||||||
src/dialog/colorpicker.obj: src/dialog/colorpicker.c
|
src/dialog/colorpicker.obj: src/dialog/colorpicker.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/dialog/colorpicker.c
|
||||||
src/dialog/directorychooser.obj: src/dialog/directorychooser.c
|
src/dialog/directorychooser.obj: src/dialog/directorychooser.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/dialog/directorychooser.c
|
||||||
src/dialog/filechooser.obj: src/dialog/filechooser.c
|
src/dialog/filechooser.obj: src/dialog/filechooser.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/dialog/filechooser.c
|
||||||
src/dialog/messagebox.obj: src/dialog/messagebox.c
|
src/dialog/messagebox.obj: src/dialog/messagebox.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/dialog/messagebox.c
|
||||||
src/draw.obj: src/draw.c
|
src/draw.obj: src/draw.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/draw.c
|
||||||
src/error.obj: src/error.c
|
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
|
||||||
src/icon/back.obj: src/icon/back.c
|
src/icon/back.obj: src/icon/back.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/back.c
|
||||||
src/icon/clock.obj: src/icon/clock.c
|
src/icon/clock.obj: src/icon/clock.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/clock.c
|
||||||
src/icon/computer.obj: src/icon/computer.c
|
src/icon/computer.obj: src/icon/computer.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/computer.c
|
||||||
src/icon/directory.obj: src/icon/directory.c
|
src/icon/directory.obj: src/icon/directory.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/directory.c
|
||||||
src/icon/down.obj: src/icon/down.c
|
src/icon/down.obj: src/icon/down.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/down.c
|
||||||
src/icon/error.obj: src/icon/error.c
|
src/icon/error.obj: src/icon/error.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/error.c
|
||||||
src/icon/file.obj: src/icon/file.c
|
src/icon/file.obj: src/icon/file.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/file.c
|
||||||
src/icon/forward.obj: src/icon/forward.c
|
src/icon/forward.obj: src/icon/forward.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/forward.c
|
||||||
src/icon/info.obj: src/icon/info.c
|
src/icon/info.obj: src/icon/info.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/info.c
|
||||||
src/icon/left.obj: src/icon/left.c
|
src/icon/left.obj: src/icon/left.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/left.c
|
||||||
src/icon/news.obj: src/icon/news.c
|
src/icon/news.obj: src/icon/news.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/news.c
|
||||||
src/icon/note.obj: src/icon/note.c
|
src/icon/note.obj: src/icon/note.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/note.c
|
||||||
src/icon/right.obj: src/icon/right.c
|
src/icon/right.obj: src/icon/right.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/right.c
|
||||||
src/icon/search.obj: src/icon/search.c
|
src/icon/search.obj: src/icon/search.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/search.c
|
||||||
src/icon/up.obj: src/icon/up.c
|
src/icon/up.obj: src/icon/up.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/up.c
|
||||||
src/icon/warning.obj: src/icon/warning.c
|
src/icon/warning.obj: src/icon/warning.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/icon/warning.c
|
||||||
src/lowlevel.obj: src/lowlevel.c
|
src/lowlevel.obj: src/lowlevel.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/lowlevel.c
|
||||||
src/string.obj: src/string.c
|
src/string.obj: src/string.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/string.c
|
||||||
src/text/font/boldfont.obj: src/text/font/boldfont.c
|
src/text/font/boldfont.obj: src/text/font/boldfont.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/boldfont.c
|
||||||
|
src/text/font/boldmonottf.obj: src/text/font/boldmonottf.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/boldmonottf.c
|
||||||
src/text/font/boldttf.obj: src/text/font/boldttf.c
|
src/text/font/boldttf.obj: src/text/font/boldttf.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/boldttf.c
|
||||||
src/text/font/font.obj: src/text/font/font.c
|
src/text/font/font.obj: src/text/font/font.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/font.c
|
||||||
|
src/text/font/monottf.obj: src/text/font/monottf.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/monottf.c
|
||||||
src/text/font/ttf.obj: src/text/font/ttf.c
|
src/text/font/ttf.obj: src/text/font/ttf.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/font/ttf.c
|
||||||
src/text/ft2.obj: src/text/ft2.c
|
src/text/ft2.obj: src/text/ft2.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/ft2.c
|
||||||
|
src/text/gdi.obj: src/text/gdi.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/gdi.c
|
||||||
src/text/stbtt.obj: src/text/stbtt.c
|
src/text/stbtt.obj: src/text/stbtt.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/stbtt.c
|
||||||
src/text/text.obj: src/text/text.c
|
src/text/text.obj: src/text/text.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/text/text.c
|
||||||
|
src/truetype.obj: src/truetype.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/truetype.c
|
||||||
src/unicode.obj: src/unicode.c
|
src/unicode.obj: src/unicode.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/unicode.c
|
||||||
src/widget/box.obj: src/widget/box.c
|
src/widget/box.obj: src/widget/box.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/box.c
|
||||||
src/widget/button.obj: src/widget/button.c
|
src/widget/button.obj: src/widget/button.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/button.c
|
||||||
|
src/widget/calendar.obj: src/widget/calendar.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/calendar.c
|
||||||
src/widget/checkbox.obj: src/widget/checkbox.c
|
src/widget/checkbox.obj: src/widget/checkbox.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/checkbox.c
|
||||||
src/widget/combobox.obj: src/widget/combobox.c
|
src/widget/combobox.obj: src/widget/combobox.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/combobox.c
|
||||||
src/widget/entry.obj: src/widget/entry.c
|
src/widget/entry.obj: src/widget/entry.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/entry.c
|
||||||
src/widget/frame.obj: src/widget/frame.c
|
src/widget/frame.obj: src/widget/frame.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/frame.c
|
||||||
src/widget/image.obj: src/widget/image.c
|
src/widget/image.obj: src/widget/image.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/image.c
|
||||||
src/widget/label.obj: src/widget/label.c
|
src/widget/label.obj: src/widget/label.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/label.c
|
||||||
src/widget/listbox.obj: src/widget/listbox.c
|
src/widget/listbox.obj: src/widget/listbox.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/listbox.c
|
||||||
src/widget/menu.obj: src/widget/menu.c
|
src/widget/menu.obj: src/widget/menu.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/menu.c
|
||||||
src/widget/numberentry.obj: src/widget/numberentry.c
|
src/widget/numberentry.obj: src/widget/numberentry.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/numberentry.c
|
||||||
src/widget/opengl.obj: src/widget/opengl.c
|
src/widget/opengl.obj: src/widget/opengl.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/opengl.c
|
||||||
src/widget/progressbar.obj: src/widget/progressbar.c
|
src/widget/progressbar.obj: src/widget/progressbar.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/progressbar.c
|
||||||
src/widget/radiobox.obj: src/widget/radiobox.c
|
src/widget/radiobox.obj: src/widget/radiobox.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/radiobox.c
|
||||||
src/widget/scrollbar.obj: src/widget/scrollbar.c
|
src/widget/scrollbar.obj: src/widget/scrollbar.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/scrollbar.c
|
||||||
src/widget/separator.obj: src/widget/separator.c
|
src/widget/separator.obj: src/widget/separator.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/separator.c
|
||||||
src/widget/submenu.obj: src/widget/submenu.c
|
src/widget/submenu.obj: src/widget/submenu.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/submenu.c
|
||||||
|
src/widget/subwindow.obj: src/widget/subwindow.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/subwindow.c
|
||||||
|
src/widget/tab.obj: src/widget/tab.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/tab.c
|
||||||
|
src/widget/table.obj: src/widget/table.c
|
||||||
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/table.c
|
||||||
src/widget/treeview.obj: src/widget/treeview.c
|
src/widget/treeview.obj: src/widget/treeview.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/treeview.c
|
||||||
src/widget/viewport.obj: src/widget/viewport.c
|
src/widget/viewport.obj: src/widget/viewport.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/viewport.c
|
||||||
src/widget/window.obj: src/widget/window.c
|
src/widget/window.obj: src/widget/window.c
|
||||||
$(CC) $(CFLAGS) -fo=$@ $<
|
$(CC) $(MW_CFLAGS) -fo=$@ src/widget/window.c
|
||||||
|
|
|
||||||
120
configure
vendored
120
configure
vendored
|
|
@ -2,6 +2,11 @@
|
||||||
our $target = `uname -s`;
|
our $target = `uname -s`;
|
||||||
$target =~ s/\r?\n$//;
|
$target =~ s/\r?\n$//;
|
||||||
|
|
||||||
|
# MSYS with MinGW gives us some other shit idk
|
||||||
|
if (index($target, "MINGW") != -1) {
|
||||||
|
$target = "Windows";
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $l (@ARGV) {
|
foreach my $l (@ARGV) {
|
||||||
if ($l =~ /^--.+$/) {
|
if ($l =~ /^--.+$/) {
|
||||||
}
|
}
|
||||||
|
|
@ -12,9 +17,11 @@ foreach my $l (@ARGV) {
|
||||||
|
|
||||||
our $prefix = "/usr/local";
|
our $prefix = "/usr/local";
|
||||||
our $cc = defined($ENV{CC}) ? $ENV{CC} : "*host*gcc";
|
our $cc = defined($ENV{CC}) ? $ENV{CC} : "*host*gcc";
|
||||||
|
our $cxx = defined($ENV{CXX}) ? $ENV{CXX} : "*host*g++";
|
||||||
our $ar = defined($ENV{AR}) ? $ENV{AR} : "*host*ar";
|
our $ar = defined($ENV{AR}) ? $ENV{AR} : "*host*ar";
|
||||||
our $incdir = "-I include";
|
our $incdir = "-I include";
|
||||||
our $cflags = "-fPIC -D_MILSKO";
|
our $incdir2 = "";
|
||||||
|
our $cflags = "-fPIC -D_MILSKO -D_MILSKO_BUILD -fvisibility=hidden";
|
||||||
our $libdir = "";
|
our $libdir = "";
|
||||||
our $ldflags = "";
|
our $ldflags = "";
|
||||||
our $math = "-lm";
|
our $math = "-lm";
|
||||||
|
|
@ -37,45 +44,81 @@ require("./pl/utils.pl");
|
||||||
|
|
||||||
param_set("classic-theme", 0);
|
param_set("classic-theme", 0);
|
||||||
param_set("stb-image", 1);
|
param_set("stb-image", 1);
|
||||||
param_set("stb-truetype", 0);
|
|
||||||
param_set("xrender", 1);
|
|
||||||
param_set("opengl", 0);
|
param_set("opengl", 0);
|
||||||
param_set("vulkan", 0);
|
param_set("vulkan", 0);
|
||||||
param_set("vulkan-string-helper", 1);
|
param_set("vulkan-string-helper", 1);
|
||||||
param_set("shared", 1);
|
param_set("shared", 1);
|
||||||
param_set("static", 1);
|
param_set("static", 1);
|
||||||
param_set("examples", 1);
|
param_set("examples", 1);
|
||||||
if($target eq "Linux") {
|
|
||||||
param_set("wayland", 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($target ne "Darwin") {
|
|
||||||
param_set("freetype2", 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# (option that only makes sense on x11)
|
||||||
|
param_set("allow-sloppy-focus", 0);
|
||||||
|
|
||||||
my %features = (
|
my %features = (
|
||||||
"classic-theme" => "use classic theme",
|
"classic-theme" => "use classic theme",
|
||||||
"stb-image" => "use stb_image, instead use libjpeg/libpng",
|
"stb-image" => "use stb_image, instead use libjpeg/libpng",
|
||||||
"stb-truetype" => "use stb_truetype",
|
"stb-truetype" => "use stb_truetype",
|
||||||
"freetype2" => "use FreeType2",
|
"freetype2" => "use FreeType2",
|
||||||
"xrender" => "use XRender",
|
"gdi-text" => "(Windows only) use GDI Text",
|
||||||
|
"xrender" => "(X11 only) use XRender",
|
||||||
"opengl" => "build OpenGL widget",
|
"opengl" => "build OpenGL widget",
|
||||||
"vulkan" => "build Vulkan widget",
|
"vulkan" => "build Vulkan widget",
|
||||||
"vulkan-string-helper" => "use Vulkan string helper",
|
"vulkan-string-helper" => "use Vulkan string helper",
|
||||||
"shared" => "build shared library",
|
"shared" => "build shared library",
|
||||||
"static" => "build static library",
|
"static" => "build static library",
|
||||||
"wayland" => "enable wayland backend",
|
"wayland" => "enable wayland backend",
|
||||||
|
"gnustep" => "use gnustep",
|
||||||
|
"dbus" => "use DBus on supported platform",
|
||||||
|
"allow-sloppy-focus" => "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus"
|
||||||
);
|
);
|
||||||
my @features_keys = (
|
my @features_keys = (
|
||||||
"1classic-theme", "1stb-image",
|
"1classic-theme", "1stb-image",
|
||||||
"1stb-truetype", "1freetype2",
|
"1stb-truetype", "1freetype2", "1gdi-text",
|
||||||
"1opengl", "2xrender",
|
"1opengl", "2xrender",
|
||||||
"1vulkan", "2vulkan-string-helper",
|
"1vulkan", "2vulkan-string-helper",
|
||||||
"1shared", "1static",
|
"1shared", "1static",
|
||||||
"1wayland"
|
"1wayland", "1gnustep",
|
||||||
|
"1dbus"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sub def_platform {
|
||||||
|
if($target eq "Windows") {
|
||||||
|
param_set("freetype2", 0);
|
||||||
|
param_set("stb-truetype", 0);
|
||||||
|
} elsif($target ne "Darwin" and $target ne "ClassicMacOS" and $target ne "Haiku") {
|
||||||
|
param_set("freetype2", 1);
|
||||||
|
param_set("stb-truetype", 0);
|
||||||
|
} else {
|
||||||
|
param_set("freetype2", 0);
|
||||||
|
param_set("stb-truetype", 1);
|
||||||
|
}
|
||||||
|
if($target eq "Linux" || $target eq "FreeBSD") {
|
||||||
|
param_set("x11", 1);
|
||||||
|
param_set("xrender", 1);
|
||||||
|
if(!param_get("tiny")){
|
||||||
|
param_set("wayland", 1);
|
||||||
|
}
|
||||||
|
param_set("dbus", 1);
|
||||||
|
}
|
||||||
|
if($target eq "NetBSD" || $target eq "OpenBSD") {
|
||||||
|
param_set("x11", 1);
|
||||||
|
}
|
||||||
|
if($target eq "Windows") {
|
||||||
|
param_set("gdi-text", 1);
|
||||||
|
} else {
|
||||||
|
param_set("gdi-text", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach my $l (@ARGV) {
|
||||||
|
if ($l =~ /^--target=(.+)$/) {
|
||||||
|
$target = $1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def_platform();
|
||||||
|
|
||||||
|
|
||||||
foreach my $l (@ARGV) {
|
foreach my $l (@ARGV) {
|
||||||
if ($l =~ /^--with-([^=]+)=(.+)$/) {
|
if ($l =~ /^--with-([^=]+)=(.+)$/) {
|
||||||
param_set($1, $2);
|
param_set($1, $2);
|
||||||
|
|
@ -86,15 +129,18 @@ foreach my $l (@ARGV) {
|
||||||
elsif ($l =~ /^--(?:without|disable)-(.+)$/) {
|
elsif ($l =~ /^--(?:without|disable)-(.+)$/) {
|
||||||
param_set($1, 0);
|
param_set($1, 0);
|
||||||
}
|
}
|
||||||
elsif ($l =~ /^--target=(.+)$/) {
|
|
||||||
$target = $1;
|
|
||||||
}
|
|
||||||
elsif ($l =~ /^--host=(.+)$/) {
|
elsif ($l =~ /^--host=(.+)$/) {
|
||||||
$host = $1 . "-";
|
$host = $1 . "-";
|
||||||
}
|
}
|
||||||
|
elsif ($l =~ /^--cflags=(.+)$/) {
|
||||||
|
add_cflags($1);
|
||||||
|
}
|
||||||
elsif ($l eq "--cross") {
|
elsif ($l eq "--cross") {
|
||||||
$cross = 1;
|
$cross = 1;
|
||||||
}
|
}
|
||||||
|
elsif ($l eq "--tiny") {
|
||||||
|
param_set("tiny",1);
|
||||||
|
}
|
||||||
elsif (($l eq "-h") or ($l eq "--help")) {
|
elsif (($l eq "-h") or ($l eq "--help")) {
|
||||||
print("Milsko Toolkit Configuration Utility\n");
|
print("Milsko Toolkit Configuration Utility\n");
|
||||||
print("\n");
|
print("\n");
|
||||||
|
|
@ -105,6 +151,8 @@ foreach my $l (@ARGV) {
|
||||||
print(" --prefix=PREFIX Installation prefix\n");
|
print(" --prefix=PREFIX Installation prefix\n");
|
||||||
print(" --host=TARGET Host for compiler/archiver\n");
|
print(" --host=TARGET Host for compiler/archiver\n");
|
||||||
print(" --target=TARGET Specify target\n");
|
print(" --target=TARGET Specify target\n");
|
||||||
|
print(" --cflags=CFLAGS Add cflags\n");
|
||||||
|
print(" --tiny Build smallest possible library\n");
|
||||||
print(" --cross Indicate cross compilation\n");
|
print(" --cross Indicate cross compilation\n");
|
||||||
print("\n");
|
print("\n");
|
||||||
print("Features:\n");
|
print("Features:\n");
|
||||||
|
|
@ -162,13 +210,15 @@ foreach my $e (param_list()) {
|
||||||
print("Enabled: " . join(" ", @l) . "\n");
|
print("Enabled: " . join(" ", @l) . "\n");
|
||||||
|
|
||||||
$cc =~ s/\*host\*/$host/;
|
$cc =~ s/\*host\*/$host/;
|
||||||
|
$cxx =~ s/\*host\*/$host/;
|
||||||
$ar =~ s/\*host\*/$host/;
|
$ar =~ s/\*host\*/$host/;
|
||||||
|
|
||||||
open(OUT, ">", "Makefile");
|
open(OUT, ">", "Makefile");
|
||||||
print(OUT "PREFIX = ${prefix}\n");
|
print(OUT "PREFIX = ${prefix}\n");
|
||||||
print(OUT "AR = ${ar}\n");
|
print(OUT "AR = ${ar}\n");
|
||||||
print(OUT "CC = ${cc}\n");
|
print(OUT "CC = ${cc}\n");
|
||||||
print(OUT "INCDIR = ${incdir}\n");
|
print(OUT "CXX = ${cxx}\n");
|
||||||
|
print(OUT "INCDIR = ${incdir} ${incdir2}\n");
|
||||||
print(OUT "CFLAGS = ${cflags}\n");
|
print(OUT "CFLAGS = ${cflags}\n");
|
||||||
print(OUT "LIBDIR = ${libdir}\n");
|
print(OUT "LIBDIR = ${libdir}\n");
|
||||||
print(OUT "LDFLAGS = ${ldflags}\n");
|
print(OUT "LDFLAGS = ${ldflags}\n");
|
||||||
|
|
@ -191,7 +241,7 @@ print(OUT " cp -rf include \$(DESTDIR)\$(PREFIX)/\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "format:\n");
|
print(OUT "format:\n");
|
||||||
print(OUT
|
print(OUT
|
||||||
" clang-format --verbose -i `find src include examples -name \"*.c\" -or -name \"*.h\" -or -name \"*.m\"`\n"
|
" clang-format --verbose -i `find tools src include examples \"(\" -name \"*.c\" -or -name \"*.cc\" -or -name \"*.h\" -or -name \"*.m\" \")\" -and -not -name \"*ttf.c\"`\n"
|
||||||
);
|
);
|
||||||
print(OUT
|
print(OUT
|
||||||
" perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"
|
" perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"
|
||||||
|
|
@ -208,11 +258,15 @@ if (param_get("static")) {
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
if (param_get("shared")) {
|
if (param_get("shared")) {
|
||||||
|
my $linker = "CC";
|
||||||
|
if (grep(/^haiku$/, @backends)) {
|
||||||
|
$linker = "CXX";
|
||||||
|
}
|
||||||
print( OUT "src/${library_prefix}Mw${library_suffix}: "
|
print( OUT "src/${library_prefix}Mw${library_suffix}: "
|
||||||
. join(" ", @library_targets)
|
. join(" ", @library_targets)
|
||||||
. "\n");
|
. "\n");
|
||||||
print(OUT
|
print(OUT
|
||||||
" \$(CC) \$(SHARED) \$(LDFLAGS\) \$(LIBDIR) -o src/${library_prefix}Mw${library_suffix} "
|
" \$($linker) \$(SHARED) \$(LDFLAGS\) \$(LIBDIR) -o src/${library_prefix}Mw${library_suffix} "
|
||||||
. join(" ", @library_targets)
|
. join(" ", @library_targets)
|
||||||
. " \$(LIBS)\n");
|
. " \$(LIBS)\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
@ -225,12 +279,17 @@ 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 -Wno-unused-value";
|
||||||
my $s = $l;
|
my $s = $l;
|
||||||
|
my $compiler = "CC";
|
||||||
my $o = $object_suffix;
|
my $o = $object_suffix;
|
||||||
$o =~ s/\./\\\./g;
|
$o =~ s/\./\\\./g;
|
||||||
|
|
||||||
if ($l =~ /cocoa/) {
|
if ($l =~ /cocoa/) {
|
||||||
$s =~ s/$o$/.m/;
|
$s =~ s/$o$/.m/;
|
||||||
}
|
}
|
||||||
|
elsif ($l =~ /haiku/) {
|
||||||
|
$s =~ s/$o$/.cc/;
|
||||||
|
$compiler = "CXX";
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$s =~ s/$o$/.c/;
|
$s =~ s/$o$/.c/;
|
||||||
}
|
}
|
||||||
|
|
@ -240,7 +299,7 @@ foreach my $l (@library_targets) {
|
||||||
}
|
}
|
||||||
|
|
||||||
print(OUT "${l}: ${s}\n");
|
print(OUT "${l}: ${s}\n");
|
||||||
print(OUT " \$(CC) $warn \$\(INCDIR) \$(CFLAGS\) -c -o ${l} ${s}\n");
|
print(OUT " \$($compiler) $warn \$\(INCDIR) \$(CFLAGS\) -c -o ${l} ${s}\n");
|
||||||
}
|
}
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
@ -258,9 +317,15 @@ if (param_get("examples")) {
|
||||||
$libs = $examples_libs{$l};
|
$libs = $examples_libs{$l};
|
||||||
}
|
}
|
||||||
|
|
||||||
print(OUT
|
if (param_get("shared")) {
|
||||||
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
|
print(OUT
|
||||||
);
|
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
print(OUT
|
||||||
|
"${l}: ${s}${object_suffix} src/${library_prefix}Mw.a\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
if (grep(/^cocoa$/, @backends)) {
|
if (grep(/^cocoa$/, @backends)) {
|
||||||
print(OUT
|
print(OUT
|
||||||
" \$(CC) -L./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
|
" \$(CC) -L./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
|
||||||
|
|
@ -271,6 +336,15 @@ if (param_get("examples")) {
|
||||||
" \$(CC) -L src -Wl,-R./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
|
" \$(CC) -L src -Wl,-R./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($target eq "ClassicMacOS") {
|
||||||
|
print(OUT
|
||||||
|
" ".$ENV{RETRO68_TOOLCHAIN_PATH}."/bin/MakePEF ${l} -o ${s}.pef\n");
|
||||||
|
print(OUT
|
||||||
|
" Rez -I ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes/Retro68APPL.r -DCFRAG_NAME=\"example\" --data ${l}.pef --cc ${l}.dsk -t APPL\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
print(OUT "${s}${object_suffix}: ${s}.c\n");
|
print(OUT "${s}${object_suffix}: ${s}.c\n");
|
||||||
print(OUT
|
print(OUT
|
||||||
" \$(CC) -c \$\(INCDIR) -o ${s}${object_suffix} ${s}.c -lMw ${math}\n"
|
" \$(CC) -c \$\(INCDIR) -o ${s}${object_suffix} ${s}.c -lMw ${math}\n"
|
||||||
|
|
|
||||||
25
doc/BACKENDDEV.md
Normal file
25
doc/BACKENDDEV.md
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Backend dev
|
||||||
|
|
||||||
|
The basic process of creating a new Milsko backend is
|
||||||
|
|
||||||
|
- Adding a new include header into `include/Mw/LowLevel`. It must include;
|
||||||
|
- `struct _MwLLBackendName`: Any details about a window or a subwidget
|
||||||
|
- `struct _MwLLBackendNameColor`: An 8-bit RGB Color. You'll probably never impl this, this is for platforms like X11/GDI where they have a secondary color representation that can be stored.
|
||||||
|
- `struct _MwLLBackendNamePixmap`: Self-explanatory. This is also used for the soft gradients in the modern theme.
|
||||||
|
- `MwLLBackendNameCallInitImpl(void)` called by `MwLibraryInit` to address and platform globals.
|
||||||
|
- Note that all of those structs are actually unions. They should all start with their `MwLLCommon...` equivalants.
|
||||||
|
- Fill out `Mw/LowLevel.h` appopriately, adding an include to your new file and the structs in the appropriate unions. These need to be guarded by a `USE_BACKENDNAME` macro which you'll define later when you modify the build system.
|
||||||
|
- Creating a new impl file in `src/backend`
|
||||||
|
- Backends actually return a table of function pointers that you have to implement with static functions. Your file should end with `#include "call.c"` and then `CALL(BackendName);`, and somewhere you should have the impl for `MwLLBackendNameCallInitImpl(void)`.
|
||||||
|
- Prefer to keep the backend file to one file if you can, though obviously exceptions like the Wayland backend exist because it's simply too complex to sanely stuff into one file.
|
||||||
|
- Add `MwLLBackendNameCallInitImpl` to the `MwLibraryInit` impl in `src/core.c`.
|
||||||
|
- Add a new enum variation to `MwLLBackends` in `Mw/Include/LowLevel.h`; your impl of `MwLLCreateImpl` will set `common.type` to this so the user can check which backend they're on (important for platforms with multiple supported backends).
|
||||||
|
- Either
|
||||||
|
- a.) Modify `CMakeLists.txt` for your platform.
|
||||||
|
- b.) Add a new perl file in `pl/ostype` that `./configure` can reference, and modify `pl/rules.pl`; If you don't know how to use perl it's fine, just copy a file like the `Linux.pl` or `Windows.pl`, the functions you'll have to change for your platform are self explanatory. Ensure it ends with `1;`.
|
||||||
|
- c.) Both.
|
||||||
|
- Both are recommended, but some platforms like Classic Mac OS can't be used with the `./configure` script, and that's fine.
|
||||||
|
|
||||||
|
The functions you'll have to impl are too many to list here so you should start by just copying `x11.c` and then replacing all the function impls with your own.
|
||||||
|
|
||||||
|
\*\*Pay attention to some of these functions' comments in LowLevel.h as they might not be as you expect; for example, `MwLLSetDarkThemeImpl` is for setting the accent color to dark theme on platforms like modern Windows (dark theme itself is set with `MwSetInteger(handle, MwNdarktheme, 1)`).
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# LowLevel.h function tips
|
|
||||||
@warning This is mainly for developers
|
|
||||||
|
|
||||||
1. `MwLLSetSizeHints`, `MwLLMakeBorderless`, `MwLLMakeToolWindow`, `MwLLMakePopup` have to be called between `MwLLBeginStateChange` and `MwLLEndStateChange`
|
|
||||||
|
|
||||||
20
doc/TIERS.md
Normal file
20
doc/TIERS.md
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Tiers
|
||||||
|
|
||||||
|
Ports of Milsko are grouped into three "tiers" in terms of their support.
|
||||||
|
|
||||||
|
- **Tier 1**: Before every new release of Milsko, these platforms will be tested to make sure they have full support, and the CI will test them.
|
||||||
|
- **Tier 2**: These might be outdated or not updated in awhile, they might only compile under a specific version/commit of Milsko. Authors of these backends will be made aware of these updates.
|
||||||
|
- **Tier 3**: These are outright unfinished. Only use these if you're a developer.
|
||||||
|
|
||||||
|
Currently, the Tier 1 backends are:
|
||||||
|
|
||||||
|
- Windows 9x+/NT 4.0+
|
||||||
|
- Any Unix/Linux system that supports X11 or Wayland.
|
||||||
|
|
||||||
|
There are currently no Tier 2 backends.
|
||||||
|
|
||||||
|
Tier 3 backends are:
|
||||||
|
|
||||||
|
- Mac OS X 10.4+ with Cocoa
|
||||||
|
- Mac OS 7-9, PowerPC (68k support not planned).
|
||||||
|
- Haiku
|
||||||
9
doc/TINYCONFIG.md
Normal file
9
doc/TINYCONFIG.md
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Tiny Config
|
||||||
|
|
||||||
|
Milsko's configure script supports the `--tiny` option for building the tiniest possible Milsko library (~400kb as of writing). Currently, what it does is:
|
||||||
|
|
||||||
|
- Add `-Oz` to the cflags
|
||||||
|
- (clang only) add `-flto=thin` to the cflags and linker flags
|
||||||
|
- Build stb-image with `STB_IMAGE_STATIC` (this is why you get warnings with stb_image when you use it)
|
||||||
|
- (Linux) Disable the Wayland backend
|
||||||
|
- (Linux) Disable dbus integration
|
||||||
|
|
@ -1,22 +1,26 @@
|
||||||
file(
|
file(
|
||||||
GLOB
|
GLOB
|
||||||
EXAMPLES_BASIC_SOURCES
|
EXAMPLES_BASIC_SOURCES
|
||||||
*.c
|
*.c
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(PATH IN LISTS EXAMPLES_BASIC_SOURCES)
|
foreach(PATH IN LISTS EXAMPLES_BASIC_SOURCES)
|
||||||
get_filename_component(TARGET ${PATH} NAME_WE)
|
get_filename_component(TARGET ${PATH} NAME_WE)
|
||||||
add_executable(${TARGET} WIN32 MACOSX_BUNDLE ${PATH})
|
if(CMAKE_SYSTEM_NAME MATCHES Retro)
|
||||||
target_link_libraries(
|
add_application(${TARGET} ${PATH})
|
||||||
${TARGET}
|
else()
|
||||||
PRIVATE
|
add_executable(${TARGET} MACOSX_BUNDLE ${PATH})
|
||||||
Mw
|
endif()
|
||||||
)
|
target_link_libraries(
|
||||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
${TARGET}
|
||||||
target_link_libraries(
|
PRIVATE
|
||||||
${TARGET}
|
Mw
|
||||||
PRIVATE
|
)
|
||||||
m
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
)
|
target_link_libraries(
|
||||||
endif()
|
${TARGET}
|
||||||
|
PRIVATE
|
||||||
|
m
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MwWidget window, box;
|
MwWidget window, box;
|
||||||
|
|
||||||
void resize(MwWidget handle, void* user, void* client) {
|
void MWAPI resize(MwWidget handle, void* user, void* client) {
|
||||||
int ww = MwGetInteger(handle, MwNwidth);
|
int ww = MwGetInteger(handle, MwNwidth);
|
||||||
int wh = MwGetInteger(handle, MwNheight);
|
int wh = MwGetInteger(handle, MwNheight);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ MwWidget inp;
|
||||||
double stack[512];
|
double stack[512];
|
||||||
int sp = 0;
|
int sp = 0;
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* client, void* user) {
|
static void MWAPI resize(MwWidget handle, void* client, void* user) {
|
||||||
int ww = MwGetInteger(handle, MwNwidth);
|
int ww = MwGetInteger(handle, MwNwidth);
|
||||||
int wh = MwGetInteger(handle, MwNheight) - MwGetInteger(inp, MwNheight);
|
int wh = MwGetInteger(handle, MwNheight) - MwGetInteger(inp, MwNheight);
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -30,7 +30,7 @@ static void resize(MwWidget handle, void* client, void* user) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void activate(MwWidget handle, void* client, void* user) {
|
static void MWAPI activate(MwWidget handle, void* client, void* user) {
|
||||||
const char* n = MwGetText(handle, MwNtext);
|
const char* n = MwGetText(handle, MwNtext);
|
||||||
|
|
||||||
if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {
|
if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {
|
||||||
|
|
@ -82,7 +82,7 @@ static void activate(MwWidget handle, void* client, void* user) {
|
||||||
v = fv / sv;
|
v = fv / sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "%g", v);
|
MwStringPrintIntoBuffer(buf, 256, "%g", v);
|
||||||
|
|
||||||
MwVaApply(inp,
|
MwVaApply(inp,
|
||||||
MwNtext, buf,
|
MwNtext, buf,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
MwWidget window, instructions, text;
|
MwWidget window, instructions, text1, text2, cur_text;
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user_data, void* call_data) {
|
static void MWAPI resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
|
|
@ -17,27 +17,35 @@ static void resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
MwNheight, h - 125 - 50 * 3,
|
MwNheight, h - 125 - 50 * 3,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVaApply(text,
|
MwVaApply(text1,
|
||||||
MwNy, 200,
|
MwNy, 150,
|
||||||
MwNwidth, w - 50 * 2,
|
MwNwidth, w - 25 * 2,
|
||||||
|
MwNheight, h - 125 - 50 * 3,
|
||||||
|
NULL);
|
||||||
|
MwVaApply(text2,
|
||||||
|
MwNy, 250,
|
||||||
|
MwNwidth, w - 25 * 2,
|
||||||
MwNheight, h - 125 - 50 * 3,
|
MwNheight, h - 125 - 50 * 3,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
static void clipboard(MwWidget handle, void* user_data, void* call_data) {
|
static void MWAPI clipboard(MwWidget handle, void* user_data, void* call_data) {
|
||||||
char* clipboard = call_data;
|
char* clipboard = call_data;
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
|
|
||||||
if(clipboard != NULL) {
|
if(clipboard != NULL) {
|
||||||
MwVaApply(text, MwNtext, clipboard, NULL);
|
MwVaApply(cur_text, MwNtext, clipboard, NULL);
|
||||||
MwForceRender(text);
|
MwForceRender(cur_text);
|
||||||
}
|
}
|
||||||
MwForceRender(window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tick(MwWidget handle, void* user_data, void* call_data) {
|
static void MWAPI tick(MwWidget handle, void* user_data, void* call_data) {
|
||||||
MwGetClipboard(handle);
|
cur_text = text1;
|
||||||
|
MwGetClipboard(handle, MwCLIPBOARD_MAIN);
|
||||||
|
cur_text = text2;
|
||||||
|
MwGetClipboard(handle, MwCLIPBOARD_PRIMARY);
|
||||||
|
MwForceRender(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
@ -49,14 +57,19 @@ int main() {
|
||||||
instructions = MwVaCreateWidget(MwLabelClass, "button", window, 50, 50, 300, 125,
|
instructions = MwVaCreateWidget(MwLabelClass, "button", window, 50, 50, 300, 125,
|
||||||
MwNtext, "clipboard contents will show up below.",
|
MwNtext, "clipboard contents will show up below.",
|
||||||
NULL);
|
NULL);
|
||||||
text = MwVaCreateWidget(MwLabelClass, "label", window, 50, 200, 300, 125,
|
text1 = MwVaCreateWidget(MwLabelClass, "label", window, 25, 150, 300, 75,
|
||||||
MwNtext, "",
|
MwNtext, "",
|
||||||
NULL);
|
NULL);
|
||||||
|
text2 = MwVaCreateWidget(MwLabelClass, "label2", window, 25, 250, 300, 75,
|
||||||
|
MwNtext, "",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
cur_text = text1;
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
MwAddUserHandler(window, MwNclipboardHandler, clipboard, NULL);
|
MwAddUserHandler(window, MwNclipboardHandler, clipboard, NULL);
|
||||||
MwAddUserHandler(instructions, MwNclipboardHandler, clipboard, NULL);
|
MwAddUserHandler(instructions, MwNclipboardHandler, clipboard, NULL);
|
||||||
MwAddUserHandler(text, MwNclipboardHandler, clipboard, NULL);
|
MwAddUserHandler(cur_text, MwNclipboardHandler, clipboard, NULL);
|
||||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||||
|
|
||||||
resize(window, NULL, NULL);
|
resize(window, NULL, NULL);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
|
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
MwWidget cpicker;
|
MwWidget fpicker;
|
||||||
MwWidget window;
|
MwWidget window;
|
||||||
MwWidget button;
|
MwWidget button;
|
||||||
|
|
||||||
void color_callback(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
|
||||||
char hexColor[8];
|
char hexColor[8];
|
||||||
MwRGB* rgb = call_data;
|
MwRGB* rgb = call_data;
|
||||||
|
|
||||||
|
|
@ -15,20 +14,20 @@ void color_callback(MwWidget handle, void* user_data, void* call_data) {
|
||||||
rgb->red &= 0xff;
|
rgb->red &= 0xff;
|
||||||
rgb->green &= 0xff;
|
rgb->green &= 0xff;
|
||||||
rgb->blue &= 0xff;
|
rgb->blue &= 0xff;
|
||||||
sprintf(hexColor, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
|
MwStringPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
|
||||||
MwSetText(window, MwNbackground, hexColor);
|
MwSetText(window, MwNbackground, hexColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void color_picker(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
|
||||||
MwWidget cpicker = MwColorPicker(window, "cpicker");
|
MwWidget cpicker = MwColorPicker(window, "cpicker");
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
||||||
MwAddUserHandler(cpicker, MwNcolorChosenHandler, color_callback, NULL);
|
MwAddUserHandler(cpicker, MwNcolorChosenHandler, file_callback, NULL);
|
||||||
|
|
||||||
MwSetText(cpicker, MwNbackground, MwDefaultBackground);
|
MwSetText(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
@ -36,14 +35,14 @@ int main() {
|
||||||
|
|
||||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
|
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
|
||||||
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
|
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
|
||||||
MwSetText(window, MwNbackground, "#000000");
|
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
|
||||||
|
|
||||||
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
|
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
|
||||||
MwNtext, "change window background",
|
MwNtext, "change window background",
|
||||||
NULL);
|
NULL);
|
||||||
MwSetText(button, MwNbackground, MwDefaultBackground);
|
MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
|
||||||
|
|
||||||
MwAddUserHandler(button, MwNactivateHandler, color_picker, NULL);
|
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL);
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
MwWidget window, menu, button, button2, button3, button4, button5, button6;
|
MwWidget window, menu, button, button2, button3, button4, button5, button6, button7;
|
||||||
|
|
||||||
void handler(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI handler(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -10,7 +10,7 @@ void handler(MwWidget handle, void* user_data, void* call_data) {
|
||||||
printf("hello world!\n");
|
printf("hello world!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void handler_theme(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI handler_theme(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -20,7 +20,7 @@ void handler_theme(MwWidget handle, void* user_data, void* call_data) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handler_look(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI handler_look(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -30,7 +30,7 @@ void handler_look(MwWidget handle, void* user_data, void* call_data) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handler_font(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI handler_font(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -40,7 +40,7 @@ void handler_font(MwWidget handle, void* user_data, void* call_data) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resize(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
unsigned int w, h, mh;
|
unsigned int w, h, mh;
|
||||||
|
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
|
|
@ -51,24 +51,29 @@ void resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
|
|
||||||
MwVaApply(button,
|
MwVaApply(button,
|
||||||
MwNy, 50 + mh,
|
MwNy, 50 + mh,
|
||||||
MwNwidth, (w - 50 * 2) / 3,
|
MwNwidth, (w - 50 * 2) / 4,
|
||||||
MwNheight, h - 125 - 50 * 3,
|
MwNheight, h - 125 - 50 * 3,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVaApply(button2,
|
MwVaApply(button2,
|
||||||
MwNx, 50 + (w - 50 * 2) / 3,
|
MwNx, 50 + (w - 50 * 2) / 4,
|
||||||
MwNy, 50 + mh,
|
MwNy, 50 + mh,
|
||||||
MwNwidth, (w - 50 * 2) / 3,
|
MwNwidth, (w - 50 * 2) / 4,
|
||||||
MwNheight, h - 125 - 50 * 3,
|
MwNheight, h - 125 - 50 * 3,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVaApply(button3,
|
MwVaApply(button3,
|
||||||
MwNx, 50 + (w - 50 * 2) / 3 * 2,
|
MwNx, 50 + (w - 50 * 2) / 4 * 2,
|
||||||
MwNy, 50 + mh,
|
MwNy, 50 + mh,
|
||||||
MwNwidth, (w - 50 * 2) / 3,
|
MwNwidth, (w - 50 * 2) / 4,
|
||||||
|
MwNheight, h - 125 - 50 * 3,
|
||||||
|
NULL);
|
||||||
|
MwVaApply(button7,
|
||||||
|
MwNx, 50 + (w - 50 * 2) / 4 * 3,
|
||||||
|
MwNy, 50 + mh,
|
||||||
|
MwNwidth, (w - 50 * 2) / 4,
|
||||||
MwNheight, h - 125 - 50 * 3,
|
MwNheight, h - 125 - 50 * 3,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVaApply(button4,
|
MwVaApply(button4,
|
||||||
MwNx, 50 + (w - 50 * 2) / 3 * 0,
|
MwNx, 50 + (w - 50 * 2) / 3 * 0,
|
||||||
MwNy, h - 50 - 125 + mh,
|
MwNy, h - 50 - 125 + mh,
|
||||||
|
|
@ -121,6 +126,10 @@ int main() {
|
||||||
MwNbackground, "#66f",
|
MwNbackground, "#66f",
|
||||||
MwNforeground, "#000",
|
MwNforeground, "#000",
|
||||||
NULL);
|
NULL);
|
||||||
|
button7 = MwVaCreateWidget(MwButtonClass, "button", window, 250, 50, 100, 125,
|
||||||
|
MwNtext, "disabled",
|
||||||
|
MwNdisabled, 1,
|
||||||
|
NULL);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
MwAddUserHandler(button, MwNactivateHandler, handler_theme, NULL);
|
MwAddUserHandler(button, MwNactivateHandler, handler_theme, NULL);
|
||||||
|
|
|
||||||
70
examples/basic/filechooser.c
Normal file
70
examples/basic/filechooser.c
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
|
MwWidget fpicker;
|
||||||
|
MwWidget window;
|
||||||
|
MwWidget button;
|
||||||
|
MwWidget mb;
|
||||||
|
|
||||||
|
MwBool fpicker_wait = MwFALSE;
|
||||||
|
MwBool msgbox_wait = MwFALSE;
|
||||||
|
|
||||||
|
void MWAPI ok(MwWidget handle, void* user, void* call) {
|
||||||
|
(void)handle;
|
||||||
|
(void)call;
|
||||||
|
msgbox_wait = MwFALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
|
||||||
|
mb = MwMessageBox(handle, call_data, "File chosen", MwMB_ICONERROR | MwMB_BUTTONOK);
|
||||||
|
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
|
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
||||||
|
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
|
||||||
|
|
||||||
|
msgbox_wait = MwTRUE;
|
||||||
|
|
||||||
|
while(msgbox_wait) {
|
||||||
|
MwStep(mb);
|
||||||
|
}
|
||||||
|
|
||||||
|
fpicker_wait = MwFALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
|
||||||
|
fpicker = MwFileChooserEx(handle, "file chooser", 0);
|
||||||
|
|
||||||
|
(void)handle;
|
||||||
|
(void)user_data;
|
||||||
|
(void)call_data;
|
||||||
|
|
||||||
|
MwAddUserHandler(fpicker, MwNfileChosenHandler, file_callback, NULL);
|
||||||
|
|
||||||
|
MwSetText(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
|
||||||
|
|
||||||
|
fpicker_wait = MwTRUE;
|
||||||
|
|
||||||
|
while(fpicker_wait) {
|
||||||
|
MwStep(fpicker);
|
||||||
|
}
|
||||||
|
|
||||||
|
MwDestroyWidget(fpicker);
|
||||||
|
MwDestroyWidget(mb);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
MwLibraryInit();
|
||||||
|
|
||||||
|
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
|
||||||
|
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
|
||||||
|
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
|
||||||
|
|
||||||
|
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
|
||||||
|
MwNtext, "select file",
|
||||||
|
NULL);
|
||||||
|
MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
|
||||||
|
|
||||||
|
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL);
|
||||||
|
|
||||||
|
MwLoop(window);
|
||||||
|
}
|
||||||
|
|
@ -2,67 +2,60 @@
|
||||||
|
|
||||||
#include "../harvard.c"
|
#include "../harvard.c"
|
||||||
|
|
||||||
MwWidget wmain;
|
MwWidget w_main;
|
||||||
|
|
||||||
void destroy(MwWidget handle, void* user, void* call) {
|
void MWAPI destroy(MwWidget handle, void* user, void* call) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
MwMessageBoxDestroy(user);
|
MwDestroyWidget(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
void activate(MwWidget handle, void* user, void* call) {
|
void MWAPI activate(MwWidget handle, void* user, void* call) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
MwWidget msgbox;
|
MwWidget msgbox;
|
||||||
|
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
||||||
sprintf(msg, "You pressed: %s", MwListBoxGet(handle, *(int*)call));
|
MwStringPrintIntoBuffer(msg, 256, "You pressed: %s", MwListBoxGet(handle, *(int*)call));
|
||||||
|
|
||||||
msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
|
msgbox = MwMessageBox(w_main, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
|
||||||
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);
|
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
MwWidget lb;
|
MwWidget lb;
|
||||||
int len = sizeof(harvard) / sizeof(harvard[0]) - 1;
|
int len = sizeof(harvard) / sizeof(harvard[0]) - 1;
|
||||||
int i;
|
int i;
|
||||||
MwListBoxPacket* packet;
|
int index;
|
||||||
int index;
|
MwLLPixmap px;
|
||||||
MwLLPixmap px;
|
|
||||||
|
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
wmain = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
w_main = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||||
MwNtitle, "listbox",
|
MwNtitle, "listbox",
|
||||||
NULL);
|
NULL);
|
||||||
lb = MwCreateWidget(MwListBoxClass, "listbox", wmain, 5, 5, 630, 470);
|
lb = MwCreateWidget(MwListBoxClass, "listbox", w_main, 5, 5, 630, 470);
|
||||||
|
|
||||||
px = MwLoadIcon(lb, MwIconInfo);
|
px = MwLoadIcon(lb, MwIconInfo);
|
||||||
|
|
||||||
MwSetInteger(lb, MwNleftPadding, 20);
|
MwSetInteger(lb, MwNleftPadding, 20);
|
||||||
|
|
||||||
packet = MwListBoxCreatePacket();
|
index = MwListBoxSet(lb, -1, 0, "Harvard sentence");
|
||||||
index = MwListBoxPacketInsert(packet, -1);
|
MwListBoxSet(lb, index, -1, "Length");
|
||||||
MwListBoxPacketSet(packet, index, 0, "Harvard sentence");
|
|
||||||
MwListBoxPacketSet(packet, index, 1, "Length");
|
|
||||||
|
|
||||||
for(i = 0; i < len; i++) {
|
for(i = 0; i < len; i++) {
|
||||||
char sz[16];
|
char sz[16];
|
||||||
sprintf(sz, "%d", (int)strlen(harvard[i]));
|
MwStringPrintIntoBuffer(sz, 16, "%d", (int)strlen(harvard[i]));
|
||||||
index = MwListBoxPacketInsert(packet, -1);
|
index = MwListBoxSet(lb, -1, 0, harvard[i]);
|
||||||
MwListBoxPacketSetIcon(packet, index, px);
|
MwListBoxSet(lb, index, -1, sz);
|
||||||
MwListBoxPacketSet(packet, index, 0, harvard[i]);
|
MwListBoxSetIcon(lb, index, px);
|
||||||
MwListBoxPacketSet(packet, index, 1, sz);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MwAddUserHandler(lb, MwNactivateHandler, activate, NULL);
|
MwAddUserHandler(lb, MwNlistBoxActivateHandler, activate, NULL);
|
||||||
MwVaApply(lb,
|
MwVaApply(lb,
|
||||||
MwNhasHeading, 1,
|
MwNhasHeading, 1,
|
||||||
NULL);
|
NULL);
|
||||||
MwListBoxSetWidth(lb, 0, -128);
|
MwListBoxSetWidth(lb, 0, -128);
|
||||||
MwListBoxInsert(lb, -1, packet);
|
|
||||||
|
|
||||||
MwListBoxDestroyPacket(packet);
|
MwLoop(w_main);
|
||||||
|
|
||||||
MwLoop(wmain);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,32 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
void ok(MwWidget handle, void* user, void* call) {
|
void MWAPI ok(MwWidget handle, void* user, void* call) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
MwMessageBoxDestroy(user);
|
MwDestroyWidget(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spawn(MwWidget handle, void* user, void* call) {
|
void MWAPI spawn(MwWidget handle, void* user, void* call) {
|
||||||
MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
|
MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
||||||
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
||||||
|
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spawn2(MwWidget handle, void* user, void* call) {
|
void MWAPI spawn2(MwWidget handle, void* user, void* call) {
|
||||||
MwWidget mb = MwMessageBox(user, "something went wrong!", "title", MwMB_ICONERROR | MwMB_BUTTONOK);
|
MwWidget mb = MwMessageBox(user, "something went wrong!", "title", MwMB_ICONERROR | MwMB_BUTTONOK);
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
||||||
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
||||||
|
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spawn3(MwWidget handle, void* user, void* call) {
|
void MWAPI spawn3(MwWidget handle, void* user, void* call) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
|
|
@ -33,6 +35,7 @@ void spawn3(MwWidget handle, void* user, void* call) {
|
||||||
for(i = 0; i <= MwMB_ICONCLOCK; i++) {
|
for(i = 0; i <= MwMB_ICONCLOCK; i++) {
|
||||||
MwWidget mb = MwMessageBox(user, "messagebox test", "title", i | MwMB_BUTTONOK);
|
MwWidget mb = MwMessageBox(user, "messagebox test", "title", i | MwMB_BUTTONOK);
|
||||||
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
|
||||||
|
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,14 @@
|
||||||
#define Padding 20
|
#define Padding 20
|
||||||
#define PaddingContent 2
|
#define PaddingContent 2
|
||||||
|
|
||||||
MwWidget window, menu, box;
|
MwWidget window, menu, table;
|
||||||
MwWidget boxes[32];
|
MwMenu e;
|
||||||
int n = 0, row = -1;
|
|
||||||
MwMenu e;
|
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user, void* call) {
|
static void MWAPI resize(MwWidget handle, void* user, void* call) {
|
||||||
int w = MwGetInteger(window, MwNwidth);
|
int w = MwGetInteger(window, MwNwidth);
|
||||||
int h = MwGetInteger(window, MwNheight);
|
int h = MwGetInteger(window, MwNheight);
|
||||||
|
|
||||||
MwVaApply(box,
|
MwVaApply(table,
|
||||||
MwNx, Padding,
|
MwNx, Padding,
|
||||||
MwNy, MwGetInteger(menu, MwNheight) + Padding,
|
MwNy, MwGetInteger(menu, MwNheight) + Padding,
|
||||||
MwNwidth, w - Padding * 2,
|
MwNwidth, w - Padding * 2,
|
||||||
|
|
@ -23,31 +21,7 @@ static void resize(MwWidget handle, void* user, void* call) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void newrow(void) {
|
static void MWAPI resize_content(MwWidget handle, void* user, void* call) {
|
||||||
if(row >= 0) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for(i = n; i < Columns; i++) MwCreateWidget(MwFrameClass, "frame", boxes[row], 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
boxes[++row] = MwCreateWidget(MwBoxClass, "box", box, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
n = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void add(MwWidget w) {
|
|
||||||
int r = MwGetInteger(w, MwNratio);
|
|
||||||
|
|
||||||
if(r == MwDEFAULT) r = 1;
|
|
||||||
|
|
||||||
n += r;
|
|
||||||
|
|
||||||
if(n == Columns) {
|
|
||||||
newrow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void resize_content(MwWidget handle, void* user, void* call) {
|
|
||||||
MwWidget* ws = MwGetChildren(handle);
|
MwWidget* ws = MwGetChildren(handle);
|
||||||
if(ws != NULL) {
|
if(ws != NULL) {
|
||||||
int pw = MwGetInteger(ws[0], "IpWidth");
|
int pw = MwGetInteger(ws[0], "IpWidth");
|
||||||
|
|
@ -76,7 +50,7 @@ static void resize_content(MwWidget handle, void* user, void* call) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resize_frame(MwWidget handle, void* user, void* call) {
|
static void MWAPI resize_frame(MwWidget handle, void* user, void* call) {
|
||||||
MwWidget* ws = MwGetChildren(handle);
|
MwWidget* ws = MwGetChildren(handle);
|
||||||
if(ws != NULL) {
|
if(ws != NULL) {
|
||||||
int w = MwGetInteger(handle, MwNwidth);
|
int w = MwGetInteger(handle, MwNwidth);
|
||||||
|
|
@ -95,14 +69,14 @@ static void resize_frame(MwWidget handle, void* user, void* call) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static MwWidget frame(const char* name, int width, int height, MwClass cl, ...) {
|
static MwWidget frame(const char* name, int width, int height, MwClass cl, ...) {
|
||||||
MwWidget f = MwVaCreateWidget(MwFrameClass, "frame", boxes[row], 0, 0, 0, 0,
|
MwWidget f = MwVaCreateWidget(MwFrameClass, "frame", table, 0, 0, 0, 0,
|
||||||
MwNhasBorder, 1,
|
MwNhasBorder, 1,
|
||||||
MwNinverted, 1,
|
MwNinverted, 1,
|
||||||
NULL);
|
NULL);
|
||||||
MwWidget box = MwVaCreateWidget(MwBoxClass, "box", f, 0, 0, 0, 0,
|
MwWidget table = MwVaCreateWidget(MwBoxClass, "table", f, 0, 0, 0, 0,
|
||||||
MwNorientation, MwVERTICAL,
|
MwNorientation, MwVERTICAL,
|
||||||
NULL);
|
NULL);
|
||||||
MwWidget label = MwVaCreateWidget(MwLabelClass, "label", box, 0, 0, 0, 0,
|
MwWidget label = MwVaCreateWidget(MwLabelClass, "label", table, 0, 0, 0, 0,
|
||||||
MwNtext, name,
|
MwNtext, name,
|
||||||
MwNalignment, MwALIGNMENT_BEGINNING,
|
MwNalignment, MwALIGNMENT_BEGINNING,
|
||||||
MwNfixedSize, 20,
|
MwNfixedSize, 20,
|
||||||
|
|
@ -110,7 +84,7 @@ static MwWidget frame(const char* name, int width, int height, MwClass cl, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
if(cl != NULL) {
|
if(cl != NULL) {
|
||||||
MwWidget frame = MwCreateWidget(MwFrameClass, "frame", box, 0, 0, 0, 0);
|
MwWidget frame = MwCreateWidget(MwFrameClass, "frame", table, 0, 0, 0, 0);
|
||||||
MwWidget w;
|
MwWidget w;
|
||||||
|
|
||||||
va_start(va, cl);
|
va_start(va, cl);
|
||||||
|
|
@ -126,6 +100,8 @@ static MwWidget frame(const char* name, int width, int height, MwClass cl, ...)
|
||||||
|
|
||||||
MwVaApply(f,
|
MwVaApply(f,
|
||||||
"VhandledWidget", w,
|
"VhandledWidget", w,
|
||||||
|
MwNcolumnSpan, MwGetInteger(w, MwNcolumnSpan),
|
||||||
|
MwNrowSpan, MwGetInteger(w, MwNrowSpan),
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,17 +116,18 @@ static MwWidget child(MwWidget w) {
|
||||||
return MwGetVoid(w, "VhandledWidget");
|
return MwGetVoid(w, "VhandledWidget");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_handler(MwWidget handle, void* user, void* call){
|
static void MWAPI menu_handler(MwWidget handle, void* user, void* call) {
|
||||||
if(call == e) MwDestroyWidget(window);
|
if(call == e) MwDestroyWidget(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int i;
|
int i, j;
|
||||||
MwWidget f, w;
|
MwWidget f, w, b;
|
||||||
MwListBoxPacket* pkt;
|
MwLLPixmap px;
|
||||||
int index;
|
int index;
|
||||||
MwMenu m, m2;
|
MwMenu m, m2;
|
||||||
void* v;
|
void* v;
|
||||||
|
MwRect rc;
|
||||||
|
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
|
|
@ -158,6 +135,18 @@ int main() {
|
||||||
MwNtitle, "Milsko Periodic Table",
|
MwNtitle, "Milsko Periodic Table",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
MwGetScreenSize(window, &rc);
|
||||||
|
if(rc.height < 800) {
|
||||||
|
MwVaApply(window,
|
||||||
|
MwNx, (rc.width - (rc.height - 64)) / 2,
|
||||||
|
MwNy, (rc.height - (rc.height - 64)) / 2,
|
||||||
|
MwNwidth, rc.height - 64,
|
||||||
|
MwNheight, rc.height - 64,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
px = MwLoadIcon(window, MwIconError);
|
||||||
|
|
||||||
menu = MwCreateWidget(MwMenuClass, "menu", window, 0, 0, 0, 0);
|
menu = MwCreateWidget(MwMenuClass, "menu", window, 0, 0, 0, 0);
|
||||||
|
|
||||||
m = MwMenuAdd(menu, NULL, "File");
|
m = MwMenuAdd(menu, NULL, "File");
|
||||||
|
|
@ -187,7 +176,7 @@ int main() {
|
||||||
MwMenuAdd(menu, m, "Month");
|
MwMenuAdd(menu, m, "Month");
|
||||||
MwMenuAdd(menu, m, "Year");
|
MwMenuAdd(menu, m, "Year");
|
||||||
|
|
||||||
m = MwMenuAdd(menu, NULL, "Options");
|
m = MwMenuAdd(menu, NULL, "Options");
|
||||||
m2 = MwMenuAdd(menu, m, "Font");
|
m2 = MwMenuAdd(menu, m, "Font");
|
||||||
MwMenuAdd(menu, m2, "Small");
|
MwMenuAdd(menu, m2, "Small");
|
||||||
MwMenuAdd(menu, m2, "Medium");
|
MwMenuAdd(menu, m2, "Medium");
|
||||||
|
|
@ -208,78 +197,130 @@ int main() {
|
||||||
|
|
||||||
MwAddUserHandler(menu, MwNmenuHandler, menu_handler, NULL);
|
MwAddUserHandler(menu, MwNmenuHandler, menu_handler, NULL);
|
||||||
|
|
||||||
box = MwVaCreateWidget(MwBoxClass, "box", window, 0, 0, 0, 0,
|
table = MwVaCreateWidget(MwTableClass, "table", window, 0, 0, 0, 0,
|
||||||
MwNorientation, MwVERTICAL,
|
MwNwaitLayout, 1,
|
||||||
NULL);
|
MwNcolumns, 5,
|
||||||
|
NULL);
|
||||||
|
|
||||||
newrow();
|
f = frame("Button", -PaddingContent, -PaddingContent, MwBoxClass,
|
||||||
|
MwNorientation, MwVERTICAL,
|
||||||
f = frame("Button", -PaddingContent, -PaddingContent, MwButtonClass,
|
|
||||||
MwNtext, "Press me",
|
|
||||||
NULL);
|
NULL);
|
||||||
add(f);
|
b = MwVaCreateWidget(MwButtonClass, "btn", child(f), 0, 0, 0, 0,
|
||||||
|
MwNtext, "Press me",
|
||||||
|
NULL);
|
||||||
|
b = MwVaCreateWidget(MwButtonClass, "btn_disabled", child(f), 0, 0, 0, 0,
|
||||||
|
MwNtext, "Cannot press me",
|
||||||
|
MwNdisabled, 1,
|
||||||
|
NULL);
|
||||||
|
|
||||||
add(MwVaCreateWidget(MwLabelClass, "label", boxes[row], 0, 0, 0, 0,
|
MwVaCreateWidget(MwLabelClass, "label", table, 0, 0, 0, 0,
|
||||||
MwNbold, 1,
|
MwNbold, 1,
|
||||||
MwNtext, "The Periodic Table of Milsko Widgets",
|
MwNtext, "The Periodic Table of Milsko Widgets",
|
||||||
MwNratio, Columns - 2,
|
MwNcolumnSpan, Columns - 2,
|
||||||
NULL));
|
NULL);
|
||||||
|
|
||||||
|
for(i = 0; i < 2; i++) {
|
||||||
|
f = frame(i == 0 ? "CheckBox" : "RadioBox", -PaddingContent, -PaddingContent, MwBoxClass,
|
||||||
|
MwNmargin, PaddingContent,
|
||||||
|
NULL);
|
||||||
|
w = child(f);
|
||||||
|
b = MwVaCreateWidget(MwBoxClass, "table1", w, 0, 0, 0, 0,
|
||||||
|
MwNorientation, MwVERTICAL,
|
||||||
|
MwNfixedSize, 16,
|
||||||
|
NULL);
|
||||||
|
for(j = 0; j < 6; j++) MwVaCreateWidget(i == 0 ? MwCheckBoxClass : MwRadioBoxClass, i == 0 ? "cb" : "rb", b, 0, 0, 0, 0, MwNdisabled, (j == 5) ? 1 : 0, NULL);
|
||||||
|
b = MwVaCreateWidget(MwBoxClass, "table1", w, 0, 0, 0, 0,
|
||||||
|
MwNorientation, MwVERTICAL,
|
||||||
|
NULL);
|
||||||
|
for(j = 0; j < 6; j++) {
|
||||||
|
char buf[32];
|
||||||
|
sprintf(buf, "%sBox %d", i == 0 ? "Check" : "Radio", j + 1);
|
||||||
|
MwVaCreateWidget(MwLabelClass, "label", b, 0, 0, 0, 0,
|
||||||
|
MwNtext, buf,
|
||||||
|
MwNalignment, MwALIGNMENT_BEGINNING,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
f = frame("Calendar", -PaddingContent, -PaddingContent, MwCalendarClass,
|
||||||
|
MwNscale, 1,
|
||||||
|
NULL);
|
||||||
|
|
||||||
f = frame("ComboBox", -PaddingContent, 24, MwComboBoxClass, NULL);
|
f = frame("ComboBox", -PaddingContent, 24, MwComboBoxClass, NULL);
|
||||||
w = child(f);
|
w = child(f);
|
||||||
MwComboBoxAdd(w, -1, "Hello!");
|
MwComboBoxAdd(w, -1, "Hello!");
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("Entry", -PaddingContent, 24, MwEntryClass, NULL);
|
f = frame("Entry", -PaddingContent, 24, MwEntryClass, NULL);
|
||||||
add(f);
|
|
||||||
|
f = frame("Image", -PaddingContent, -PaddingContent, MwImageClass,
|
||||||
|
MwNpixmap, px,
|
||||||
|
NULL);
|
||||||
|
|
||||||
f = frame("Label", -PaddingContent, -PaddingContent, MwLabelClass,
|
f = frame("Label", -PaddingContent, -PaddingContent, MwLabelClass,
|
||||||
MwNtext, "Epic text",
|
MwNtext, "Epic text\nNewline can be used too!",
|
||||||
NULL);
|
NULL);
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("ListBox", -PaddingContent, -PaddingContent, MwListBoxClass,
|
f = frame("ListBox", -PaddingContent, -PaddingContent, MwListBoxClass,
|
||||||
MwNhasHeading, 1,
|
MwNhasHeading, 1,
|
||||||
NULL);
|
NULL);
|
||||||
w = child(f);
|
w = child(f);
|
||||||
pkt = MwListBoxCreatePacket();
|
index = MwListBoxSet(w, -1, 0, "Epic title...");
|
||||||
index = MwListBoxPacketInsert(pkt, -1);
|
index = MwListBoxSet(w, -1, 0, "Hello");
|
||||||
MwListBoxPacketSet(pkt, index, 0, "Epic title...");
|
|
||||||
index = MwListBoxPacketInsert(pkt, -1);
|
|
||||||
MwListBoxPacketSet(pkt, index, 0, "Hello");
|
|
||||||
MwListBoxInsert(w, -1, pkt);
|
|
||||||
MwListBoxDestroyPacket(pkt);
|
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("NumberEntry", -PaddingContent, 24, MwNumberEntryClass, NULL);
|
f = frame("NumberEntry", -PaddingContent, 24, MwNumberEntryClass, NULL);
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("ProgressBar", -PaddingContent, 24, MwProgressBarClass,
|
f = frame("ProgressBar", -PaddingContent, 24, MwProgressBarClass,
|
||||||
MwNvalue, 25,
|
MwNvalue, 25,
|
||||||
NULL);
|
NULL);
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("ScrollBar", -PaddingContent, 16, MwScrollBarClass,
|
f = frame("ScrollBar", -PaddingContent, 16, MwScrollBarClass,
|
||||||
MwNorientation, MwHORIZONTAL,
|
MwNorientation, MwHORIZONTAL,
|
||||||
NULL);
|
NULL);
|
||||||
add(f);
|
|
||||||
|
|
||||||
f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL);
|
f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL);
|
||||||
add(f);
|
|
||||||
|
f = frame("SubWindow", -PaddingContent, -PaddingContent, MwViewportClass,
|
||||||
|
MwNcolumnSpan, 2,
|
||||||
|
NULL);
|
||||||
|
w = child(f);
|
||||||
|
MwViewportSetSize(w, 512, 512);
|
||||||
|
MwVaCreateWidget(MwSubWindowClass, "swnd", MwViewportGetViewport(w), 32, 32, 256, 128,
|
||||||
|
MwNtitle, "Sub window",
|
||||||
|
NULL);
|
||||||
|
MwVaCreateWidget(MwSubWindowClass, "swnd", MwViewportGetViewport(w), 64, 64, 256, 128,
|
||||||
|
MwNtitle, "Sub window 2",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
f = frame("Tab", -PaddingContent, -PaddingContent, MwTabClass,
|
||||||
|
MwNcolumnSpan, 2,
|
||||||
|
NULL);
|
||||||
|
w = child(f);
|
||||||
|
MwSetText(MwTabAdd(w, "ABC"), MwNbackground, "#f00");
|
||||||
|
MwSetText(MwTabAdd(w, "DEF"), MwNbackground, "#0f0");
|
||||||
|
MwSetText(MwTabAdd(w, "GHI"), MwNbackground, "#00f");
|
||||||
|
|
||||||
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
|
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
|
||||||
w = child(f);
|
w = child(f);
|
||||||
v = MwTreeViewAdd(w, NULL, NULL, "abc");
|
v = MwTreeViewAdd(w, NULL, NULL, "abc");
|
||||||
v = MwTreeViewAdd(w, v, NULL, "def");
|
v = MwTreeViewAdd(w, v, NULL, "def");
|
||||||
v = MwTreeViewAdd(w, v, NULL, "ghi");
|
v = MwTreeViewAdd(w, v, NULL, "ghi");
|
||||||
add(f);
|
|
||||||
|
|
||||||
if(n != 0) newrow();
|
f = frame("Viewport", -PaddingContent, -PaddingContent, MwViewportClass, NULL);
|
||||||
if(n == 0) MwDestroyWidget(boxes[row]);
|
w = child(f);
|
||||||
|
MwViewportSetSize(w, 256, 256);
|
||||||
|
MwVaCreateWidget(MwButtonClass, "btn", MwViewportGetViewport(w), 64, 64, 128, 128,
|
||||||
|
MwNtext, "Thing",
|
||||||
|
NULL);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
|
|
||||||
resize(window, NULL, NULL);
|
resize(window, NULL, NULL);
|
||||||
|
|
||||||
|
MwVaApply(table,
|
||||||
|
MwNwaitLayout, 0,
|
||||||
|
NULL);
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
|
|
||||||
|
MwLLDestroyPixmap(px);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ double deg = 0;
|
||||||
|
|
||||||
int ww, wh;
|
int ww, wh;
|
||||||
|
|
||||||
void handler(MwWidget w, void* user, void* client) {
|
void MWAPI handler(MwWidget w, void* user, void* client) {
|
||||||
int i;
|
int i;
|
||||||
double cdeg = deg;
|
double cdeg = deg;
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ void handler(MwWidget w, void* user, void* client) {
|
||||||
deg += 120.0 / (1000.0 / MwWaitMS);
|
deg += 120.0 / (1000.0 / MwWaitMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resize(MwWidget w, void* user, void* client) {
|
void MWAPI resize(MwWidget w, void* user, void* client) {
|
||||||
(void)w;
|
(void)w;
|
||||||
(void)user;
|
(void)user;
|
||||||
(void)client;
|
(void)client;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
|
||||||
52
examples/basic/subwindow.c
Normal file
52
examples/basic/subwindow.c
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
|
#define Shift 16
|
||||||
|
|
||||||
|
static void MWAPI resize(MwWidget handle, void* user, void* client) {
|
||||||
|
MwWidget f = MwSubWindowGetFrame(handle);
|
||||||
|
MwVaApply(user,
|
||||||
|
MwNwidth, MwGetInteger(f, MwNwidth),
|
||||||
|
MwNheight, MwGetInteger(f, MwNheight),
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
MwWidget w;
|
||||||
|
int i;
|
||||||
|
MwLLPixmap px[6];
|
||||||
|
|
||||||
|
MwLibraryInit();
|
||||||
|
|
||||||
|
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 800, 600,
|
||||||
|
MwNtitle, "subwindow",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
px[0] = MwLoadIcon(w, MwIconClock);
|
||||||
|
px[1] = MwLoadIcon(w, MwIconError);
|
||||||
|
px[2] = MwLoadIcon(w, MwIconInfo);
|
||||||
|
px[3] = MwLoadIcon(w, MwIconNews);
|
||||||
|
px[4] = MwLoadIcon(w, MwIconNote);
|
||||||
|
px[5] = MwLoadIcon(w, MwIconWarning);
|
||||||
|
|
||||||
|
for(i = 0; i < 16; i++) {
|
||||||
|
char buf[32];
|
||||||
|
MwWidget sw, f, img;
|
||||||
|
|
||||||
|
sprintf(buf, "Sub window %d", i);
|
||||||
|
|
||||||
|
sw = MwVaCreateWidget(MwSubWindowClass, "swnd", w, i * Shift, i * Shift, 128, 128,
|
||||||
|
MwNtitle, buf,
|
||||||
|
MwNiconPixmap, px[rand() % 6],
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
f = MwSubWindowGetFrame(sw);
|
||||||
|
|
||||||
|
img = MwVaCreateWidget(MwImageClass, "img", f, 0, 0, MwGetInteger(f, MwNwidth), MwGetInteger(f, MwNheight),
|
||||||
|
MwNpixmap, px[rand() % 6],
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
MwAddUserHandler(sw, MwNresizeHandler, resize, img);
|
||||||
|
}
|
||||||
|
|
||||||
|
MwLoop(w);
|
||||||
|
}
|
||||||
43
examples/basic/tab.c
Normal file
43
examples/basic/tab.c
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
|
MwWidget tab;
|
||||||
|
|
||||||
|
static void MWAPI resize(MwWidget handle, void* user, void* client) {
|
||||||
|
MwVaApply(tab,
|
||||||
|
MwNwidth, MwGetInteger(handle, MwNwidth),
|
||||||
|
MwNheight, MwGetInteger(handle, MwNheight),
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
MwWidget w;
|
||||||
|
int i;
|
||||||
|
MwLLPixmap px[6];
|
||||||
|
|
||||||
|
MwLibraryInit();
|
||||||
|
|
||||||
|
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 800, 600,
|
||||||
|
MwNtitle, "subwindow",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
tab = MwCreateWidget(MwTabClass, "tab", w, 0, 0, 800, 600);
|
||||||
|
|
||||||
|
for(i = 0; i < 16; i++) {
|
||||||
|
char buf[32];
|
||||||
|
MwWidget sw, f, img;
|
||||||
|
|
||||||
|
sprintf(buf, "Tab %d", i);
|
||||||
|
|
||||||
|
MwTabAdd(tab, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
MwVaApply(MwTabGetFrame(tab, "Tab 1"),
|
||||||
|
MwNiconPixmap, MwLoadIcon(tab, MwIconWarning),
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
MwAddUserHandler(w, MwNresizeHandler, resize, NULL);
|
||||||
|
|
||||||
|
resize(w, NULL, NULL);
|
||||||
|
|
||||||
|
MwLoop(w);
|
||||||
|
}
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
MwWidget wmain;
|
MwWidget wmain;
|
||||||
|
|
||||||
void destroy(MwWidget handle, void* user, void* call) {
|
void MWAPI destroy(MwWidget handle, void* user, void* call) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
MwMessageBoxDestroy(user);
|
MwDestroyWidget(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
void activate(MwWidget handle, void* user, void* call) {
|
void MWAPI activate(MwWidget handle, void* user, void* call) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
MwWidget msgbox;
|
MwWidget msgbox;
|
||||||
|
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
||||||
sprintf(msg, "You pressed: %s", MwTreeViewGet(handle, call));
|
MwStringPrintIntoBuffer(msg, 256, "You pressed: %s", MwTreeViewGet(handle, call));
|
||||||
|
|
||||||
msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
|
msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
|
||||||
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);
|
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MwWidget vp;
|
MwWidget vp;
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user, void* call) {
|
static void MWAPI resize(MwWidget handle, void* user, void* call) {
|
||||||
int w = MwGetInteger(handle, MwNwidth);
|
int w = MwGetInteger(handle, MwNwidth);
|
||||||
int h = MwGetInteger(handle, MwNheight);
|
int h = MwGetInteger(handle, MwNheight);
|
||||||
|
|
||||||
|
|
@ -10,8 +10,8 @@ static void resize(MwWidget handle, void* user, void* call) {
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
||||||
MwVaApply(vp,
|
MwVaApply(vp,
|
||||||
MwNwidth, w - 10,
|
MwNwidth, w - 10 - 100,
|
||||||
MwNheight, h - 10,
|
MwNheight, h - 10 - 100,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ int main() {
|
||||||
|
|
||||||
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL);
|
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL);
|
||||||
|
|
||||||
vp = MwCreateWidget(MwViewportClass, "vp", w, 5, 5, 630, 470);
|
vp = MwCreateWidget(MwViewportClass, "vp", w, 5 + 50, 5 + 50, 640 - 10 - 100, 480 - 10 - 100);
|
||||||
|
|
||||||
px = MwLoadImage(vp, "examples/picture.png");
|
px = MwLoadImage(vp, "examples/picture.png");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@ foreach(PATH IN LISTS EXAMPLES_GL_SOURCES)
|
||||||
if(${TARGET} STREQUAL "glutlayer")
|
if(${TARGET} STREQUAL "glutlayer")
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
add_executable(${TARGET} WIN32 MACOSX_BUNDLE ${PATH})
|
add_executable(${TARGET} MACOSX_BUNDLE ${PATH})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${TARGET}
|
${TARGET}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Mw
|
Mw
|
||||||
OpenGL::GL
|
OpenGL::GL OpenGL::GLU
|
||||||
)
|
)
|
||||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ double deg2rad(double deg) {
|
||||||
return (360.0 - deg) / 180.0 * M_PI;
|
return (360.0 - deg) / 180.0 * M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tick(MwWidget handle, void* user, void* call) {
|
void MWAPI tick(MwWidget handle, void* user, void* call) {
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
int i;
|
int i;
|
||||||
double rad;
|
double rad;
|
||||||
|
|
@ -32,10 +32,10 @@ void tick(MwWidget handle, void* user, void* call) {
|
||||||
char buf[512];
|
char buf[512];
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
|
|
||||||
sprintf(buf, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
|
MwStringPrintIntoBuffer(buf, 512, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
|
||||||
MwSetText(ldate, MwNtext, buf);
|
MwSetText(ldate, MwNtext, buf);
|
||||||
|
|
||||||
sprintf(buf, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
|
MwStringPrintIntoBuffer(buf, 512, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
|
||||||
MwSetText(ltime, MwNtext, buf);
|
MwSetText(ltime, MwNtext, buf);
|
||||||
|
|
||||||
render = 1;
|
render = 1;
|
||||||
|
|
@ -104,7 +104,7 @@ void tick(MwWidget handle, void* user, void* call) {
|
||||||
MwOpenGLSwapBuffer(opengl);
|
MwOpenGLSwapBuffer(opengl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resize(MwWidget handle, void* user, void* call) {
|
void MWAPI resize(MwWidget handle, void* user, void* call) {
|
||||||
int w = MwGetInteger(handle, MwNwidth);
|
int w = MwGetInteger(handle, MwNwidth);
|
||||||
int h = MwGetInteger(handle, MwNheight);
|
int h = MwGetInteger(handle, MwNheight);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -231,13 +231,13 @@ static void init(void) {
|
||||||
static void key(int k) {
|
static void key(int k) {
|
||||||
(void)k;
|
(void)k;
|
||||||
|
|
||||||
if(k == MwLLKeyLeft) {
|
if(k == MwKEY_LEFT) {
|
||||||
view_roty += 5.0;
|
view_roty += 5.0;
|
||||||
} else if(k == MwLLKeyRight) {
|
} else if(k == MwKEY_RIGHT) {
|
||||||
view_roty -= 5.0;
|
view_roty -= 5.0;
|
||||||
} else if(k == MwLLKeyUp) {
|
} else if(k == MwKEY_UP) {
|
||||||
view_rotx += 5.0;
|
view_rotx += 5.0;
|
||||||
} else if(k == MwLLKeyDown) {
|
} else if(k == MwKEY_DOWN) {
|
||||||
view_rotx -= 5.0;
|
view_rotx -= 5.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ static void reshape(int width, int height);
|
||||||
static void init(void);
|
static void init(void);
|
||||||
static void key(int k);
|
static void key(int k);
|
||||||
|
|
||||||
static void tick(MwWidget handle, void* user, void* client) {
|
static void MWAPI tick(MwWidget handle, void* user, void* client) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user;
|
(void)user;
|
||||||
(void)client;
|
(void)client;
|
||||||
|
|
@ -20,7 +20,7 @@ static void tick(MwWidget handle, void* user, void* client) {
|
||||||
MwOpenGLSwapBuffer(opengl);
|
MwOpenGLSwapBuffer(opengl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user, void* client) {
|
static void MWAPI resize(MwWidget handle, void* user, void* client) {
|
||||||
int ww, wh;
|
int ww, wh;
|
||||||
|
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
@ -37,7 +37,7 @@ static void resize(MwWidget handle, void* user, void* client) {
|
||||||
reshape(ww, wh);
|
reshape(ww, wh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void key_pressed(MwWidget handle, void* user, void* client) {
|
static void MWAPI key_pressed(MwWidget handle, void* user, void* client) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
||||||
|
|
@ -53,18 +53,21 @@ int main() {
|
||||||
MwNtitle, TITLE,
|
MwNtitle, TITLE,
|
||||||
NULL);
|
NULL);
|
||||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 50, 50, 400, 400);
|
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 50, 50, 400, 400);
|
||||||
|
if(!opengl) {
|
||||||
|
MwMessageBox(NULL, "Unable to create OpenGL window.", "Error", MwMB_ICONERROR);
|
||||||
|
} else {
|
||||||
|
MwOpenGLMakeCurrent(opengl);
|
||||||
|
|
||||||
MwOpenGLMakeCurrent(opengl);
|
init();
|
||||||
|
reshape(400, 400);
|
||||||
|
|
||||||
init();
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
reshape(400, 400);
|
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddTickList(opengl);
|
||||||
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
|
||||||
|
|
||||||
MwAddTickList(opengl);
|
MwAddUserHandler(opengl, MwNkeyHandler, key_pressed, NULL);
|
||||||
|
}
|
||||||
MwAddUserHandler(opengl, MwNkeyHandler, key_pressed, NULL);
|
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ int ow, oh;
|
||||||
double deg = 0;
|
double deg = 0;
|
||||||
double dir = 1;
|
double dir = 1;
|
||||||
|
|
||||||
void resize(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
|
|
@ -27,7 +27,7 @@ void resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tick(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI tick(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -61,7 +61,7 @@ void tick(MwWidget handle, void* user_data, void* call_data) {
|
||||||
deg += 120.0 / (1000.0 / MwWaitMS) * dir;
|
deg += 120.0 / (1000.0 / MwWaitMS) * dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void activate(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI activate(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ int ct = 0;
|
||||||
int click = 0;
|
int click = 0;
|
||||||
int mx, my;
|
int mx, my;
|
||||||
|
|
||||||
static void tick(MwWidget handle, void* user, void* call) {
|
static void MWAPI tick(MwWidget handle, void* user, void* call) {
|
||||||
int i;
|
int i;
|
||||||
int w = MwGetInteger(opengl, MwNwidth);
|
int w = MwGetInteger(opengl, MwNwidth);
|
||||||
int h = MwGetInteger(opengl, MwNheight);
|
int h = MwGetInteger(opengl, MwNheight);
|
||||||
|
|
@ -50,13 +50,13 @@ static void tick(MwWidget handle, void* user, void* call) {
|
||||||
MwOpenGLSwapBuffer(opengl);
|
MwOpenGLSwapBuffer(opengl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse(MwWidget handle, void* user, void* call) {
|
static void MWAPI mouse(MwWidget handle, void* user, void* call) {
|
||||||
MwLLMouse* mouse = call;
|
MwMouse* mouse = call;
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
||||||
if(mouse->button == MwLLMouseLeft) {
|
if(mouse->button == MwMOUSE_LEFT) {
|
||||||
t[ct].points[click * 2 + 0] = mouse->point.x;
|
t[ct].points[click * 2 + 0] = mouse->point.x;
|
||||||
t[ct].points[click * 2 + 1] = mouse->point.y;
|
t[ct].points[click * 2 + 1] = mouse->point.y;
|
||||||
click++;
|
click++;
|
||||||
|
|
@ -82,7 +82,7 @@ static void mouse(MwWidget handle, void* user, void* call) {
|
||||||
for(i = 0; i < ct; i++) t[i] = old[i];
|
for(i = 0; i < ct; i++) t[i] = old[i];
|
||||||
free(old);
|
free(old);
|
||||||
}
|
}
|
||||||
} else if(mouse->button == MwLLMouseRight) {
|
} else if(mouse->button == MwMOUSE_RIGHT) {
|
||||||
if(click > 0) {
|
if(click > 0) {
|
||||||
click = 0;
|
click = 0;
|
||||||
} else if(ct > 0) {
|
} else if(ct > 0) {
|
||||||
|
|
@ -91,7 +91,7 @@ static void mouse(MwWidget handle, void* user, void* call) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_move(MwWidget handle, void* user, void* call) {
|
static void MWAPI mouse_move(MwWidget handle, void* user, void* call) {
|
||||||
MwPoint* point = call;
|
MwPoint* point = call;
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
|
|
@ -125,13 +125,12 @@ int main() {
|
||||||
MwNtext, "Press left click to draw triangle, right click to undo",
|
MwNtext, "Press left click to draw triangle, right click to undo",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwViewportSetSize(viewport, 1024, 768);
|
|
||||||
|
|
||||||
t = malloc(sizeof(*t));
|
t = malloc(sizeof(*t));
|
||||||
|
|
||||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", MwViewportGetViewport(viewport), 0, 0, 1024, 768);
|
opengl = MwCreateWidget(MwOpenGLClass, "opengl", viewport, 0, 0, 1024, 768);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||||
|
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||||
MwAddUserHandler(opengl, MwNmouseDownHandler, mouse, NULL);
|
MwAddUserHandler(opengl, MwNmouseDownHandler, mouse, NULL);
|
||||||
MwAddUserHandler(opengl, MwNmouseMoveHandler, mouse_move, NULL);
|
MwAddUserHandler(opengl, MwNmouseMoveHandler, mouse_move, NULL);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,30 @@
|
||||||
file(
|
file(
|
||||||
GLOB
|
GLOB
|
||||||
EXAMPLES_VULKAN_SOURCES
|
EXAMPLES_VULKAN_SOURCES
|
||||||
*.c
|
*.c
|
||||||
)
|
)
|
||||||
|
find_package(Vulkan)
|
||||||
|
|
||||||
foreach(PATH IN LISTS EXAMPLES_VULKAN_SOURCES)
|
if(${Vulkan_FOUND})
|
||||||
get_filename_component(TARGET ${PATH} NAME_WE)
|
foreach(PATH IN LISTS EXAMPLES_VULKAN_SOURCES)
|
||||||
add_executable(${TARGET} WIN32 MACOSX_BUNDLE ${PATH})
|
get_filename_component(TARGET ${PATH} NAME_WE)
|
||||||
target_link_libraries(
|
add_executable(${TARGET} MACOSX_BUNDLE ${PATH})
|
||||||
${TARGET}
|
target_include_directories(
|
||||||
PRIVATE
|
${TARGET}
|
||||||
Mw
|
PRIVATE
|
||||||
)
|
${Vulkan_INCLUDE_DIR}
|
||||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${TARGET}
|
${TARGET}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
m
|
Mw
|
||||||
)
|
)
|
||||||
endif()
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
endforeach()
|
target_link_libraries(
|
||||||
|
${TARGET}
|
||||||
|
PRIVATE
|
||||||
|
m
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,3 @@
|
||||||
|
|
||||||
/**
|
|
||||||
* this example is quite minimal, you may need to modify it if your graphics card is more esoteric
|
|
||||||
*
|
|
||||||
* ioixd maintains this file. nishi doesn't know vulkan at all
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Mw/Error.h"
|
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
#include <Mw/Widget/Vulkan.h>
|
#include <Mw/Widget/Vulkan.h>
|
||||||
|
|
||||||
|
|
@ -17,7 +9,7 @@
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
|
||||||
char* string_VkResult(VkResult res) {
|
char* string_VkResult(VkResult res) {
|
||||||
sprintf(buffer, "%d", res);
|
MwStringPrintIntoBuffer(buffer, 512, "%d", res);
|
||||||
|
|
||||||
return &buffer[0];
|
return &buffer[0];
|
||||||
}
|
}
|
||||||
|
|
@ -67,7 +59,7 @@ VkSwapchainCreateInfoKHR swapchainCreateInfo = {};
|
||||||
PFN_##name _##name = (PFN_##name)_vkGetInstanceProcAddr(instance, #name); \
|
PFN_##name _##name = (PFN_##name)_vkGetInstanceProcAddr(instance, #name); \
|
||||||
assert(_##name);
|
assert(_##name);
|
||||||
|
|
||||||
void tick(MwWidget handle, void* user_data, void* call_data) {
|
void MWAPI tick(MwWidget handle, void* user_data, void* call_data) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)user_data;
|
(void)user_data;
|
||||||
(void)call_data;
|
(void)call_data;
|
||||||
|
|
@ -232,43 +224,16 @@ void vulkan_setup(MwWidget handle) {
|
||||||
VkSemaphoreCreateInfo semaphoreInfo = {};
|
VkSemaphoreCreateInfo semaphoreInfo = {};
|
||||||
VkFenceCreateInfo fenceInfo = {};
|
VkFenceCreateInfo fenceInfo = {};
|
||||||
|
|
||||||
MwErrorEnum err = MwEsuccess;
|
int err = 0;
|
||||||
_vkGetInstanceProcAddr = MwVulkanGetField(handle, MwVulkanField_GetInstanceProcAddr, &err);
|
_vkGetInstanceProcAddr = MwVulkanGetField(handle, MwVULKANFIELD_GETINSTANCEPROCADDR, &err);
|
||||||
if(err != MwEsuccess) {
|
instance = MwVulkanGetField(handle, MwVULKANFIELD_INSTANCE, &err);
|
||||||
printf("Error getting vkGetInstanceProcAddr!\n%s\n", MwGetLastError());
|
device = MwVulkanGetField(handle, MwVULKANFIELD_LOGICALDEVICE, &err);
|
||||||
}
|
physicalDevice = MwVulkanGetField(handle, MwVULKANFIELD_PHYSICALDEVICE, &err);
|
||||||
instance = MwVulkanGetField(handle, MwVulkanField_Instance, &err);
|
graphicsQueue = MwVulkanGetField(handle, MwVULKANFIELD_GRAPHICSQUEUE, &err);
|
||||||
if(err != MwEsuccess) {
|
presentQueue = MwVulkanGetField(handle, MwVULKANFIELD_PRESENTQUEUE, &err);
|
||||||
printf("Error getting vulkan instance!\n%s\n", MwGetLastError());
|
surface = MwVulkanGetField(handle, MwVULKANFIELD_SURFACE, &err);
|
||||||
}
|
presentQueueIndex = MwVulkanGetField(handle, MwVULKANFIELD_PRESENTQUEUEINDEX, &err);
|
||||||
device = MwVulkanGetField(handle, MwVulkanField_LogicalDevice, &err);
|
graphicsQueueIndex = MwVulkanGetField(handle, MwVULKANFIELD_GRAPHICSQUEUEINDEX, &err);
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting VkDevice!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
physicalDevice = MwVulkanGetField(handle, MwVulkanField_PhysicalDevice, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting physical device!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
graphicsQueue = MwVulkanGetField(handle, MwVulkanField_GraphicsQueue, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting graphics queue!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
presentQueue = MwVulkanGetField(handle, MwVulkanField_PresentQueue, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting present queue!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
surface = MwVulkanGetField(handle, MwVulkanField_Surface, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting surface!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
presentQueueIndex = MwVulkanGetField(handle, MwVulkanField_PresentQueueIndex, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting present queue index!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
graphicsQueueIndex = MwVulkanGetField(handle, MwVulkanField_GraphicsQueueIndex, &err);
|
|
||||||
if(err != MwEsuccess) {
|
|
||||||
printf("Error getting graphics queue index!\n%s\n", MwGetLastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
LOAD_VK_FUNCTION(vkCreateShaderModule);
|
LOAD_VK_FUNCTION(vkCreateShaderModule);
|
||||||
LOAD_VK_FUNCTION(vkCreatePipelineLayout);
|
LOAD_VK_FUNCTION(vkCreatePipelineLayout);
|
||||||
|
|
@ -652,9 +617,9 @@ int main() {
|
||||||
MwNtitle, "hello world",
|
MwNtitle, "hello world",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVulkanEnableExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
vulkan = MwVaCreateWidget(MwVulkanClass, "vulkan", window, 50, 50, ow, oh,
|
||||||
|
MwNvulkanExtension, VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
||||||
vulkan = MwCreateWidget(MwVulkanClass, "vulkan", window, 50, 50, ow, oh);
|
NULL);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||||
|
|
||||||
|
|
|
||||||
22
include/Mw/Abstract/CharSet.h
Normal file
22
include/Mw/Abstract/CharSet.h
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/Abstract/CharSet.h
|
||||||
|
* @brief CharSet
|
||||||
|
*/
|
||||||
|
#ifndef __MW_ABSTRACT_CHARSET_H__
|
||||||
|
#define __MW_ABSTRACT_CHARSET_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MWDECL char* MWAPI MwACPToUTF8(const char* input);
|
||||||
|
|
||||||
|
MWDECL char* MWAPI MwUTF8ToACP(const char* input);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -17,32 +17,32 @@ extern "C" {
|
||||||
* @param path Path
|
* @param path Path
|
||||||
* @return Handle
|
* @return Handle
|
||||||
*/
|
*/
|
||||||
MWDECL void* MwDirectoryOpen(const char* path);
|
MWDECL void* MWAPI MwDirectoryOpen(const char* path);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Closes a directory
|
* @brief Closes a directory
|
||||||
* @param handle Handle
|
* @param handle Handle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDirectoryClose(void* handle);
|
MWDECL void MWAPI MwDirectoryClose(void* handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Reads a directory
|
* @brief Reads a directory
|
||||||
* @param handle Handle
|
* @param handle Handle
|
||||||
* @return Directory entry
|
* @return Directory entry
|
||||||
*/
|
*/
|
||||||
MWDECL MwDirectoryEntry* MwDirectoryRead(void* handle);
|
MWDECL MwDirectoryEntry* MWAPI MwDirectoryRead(void* handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Frees a directory entry
|
* @brief Frees a directory entry
|
||||||
* @param entry Entry
|
* @param entry Entry
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDirectoryFreeEntry(MwDirectoryEntry* entry);
|
MWDECL void MWAPI MwDirectoryFreeEntry(MwDirectoryEntry* entry);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets a current directory
|
* @brief Gets a current directory
|
||||||
* @param Directory
|
* @param Directory
|
||||||
*/
|
*/
|
||||||
MWDECL char* MwDirectoryCurrent(void);
|
MWDECL char* MWAPI MwDirectoryCurrent(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Joins 2 paths
|
* @brief Joins 2 paths
|
||||||
|
|
@ -50,7 +50,7 @@ MWDECL char* MwDirectoryCurrent(void);
|
||||||
* @param b Path
|
* @param b Path
|
||||||
* @return Path
|
* @return Path
|
||||||
*/
|
*/
|
||||||
MWDECL char* MwDirectoryJoin(char* a, char* b);
|
MWDECL char* MWAPI MwDirectoryJoin(char* a, char* b);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,20 +16,20 @@ extern "C" {
|
||||||
* @param path Path
|
* @param path Path
|
||||||
* @return Handle
|
* @return Handle
|
||||||
*/
|
*/
|
||||||
MWDECL void* MwDynamicOpen(const char* path);
|
MWDECL void* MWAPI MwDynamicOpen(const char* path);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets a symbol from the dynamic library
|
* @brief Gets a symbol from the dynamic library
|
||||||
* @param handle Handle
|
* @param handle Handle
|
||||||
* @param symbol Symbol
|
* @param symbol Symbol
|
||||||
*/
|
*/
|
||||||
MWDECL void* MwDynamicSymbol(void* handle, const char* symbol);
|
MWDECL void* MWAPI MwDynamicSymbol(void* handle, const char* symbol);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Closes a dynamic library
|
* @brief Closes a dynamic library
|
||||||
* @param handle Handle
|
* @param handle Handle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDynamicClose(void* handle);
|
MWDECL void MWAPI MwDynamicClose(void* handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ extern "C" {
|
||||||
* @brief Sleeps for milliseconds
|
* @brief Sleeps for milliseconds
|
||||||
* @param ms Milliseconds
|
* @param ms Milliseconds
|
||||||
*/
|
*/
|
||||||
MWDECL void MwTimeSleep(int ms);
|
MWDECL void MWAPI MwTimeSleep(int ms);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets a monotonic time
|
* @brief Gets a monotonic time
|
||||||
* @return Monotonic time
|
* @return Monotonic time
|
||||||
*/
|
*/
|
||||||
MWDECL long MwTimeGetTick(void);
|
MWDECL long MWAPI MwTimeGetTick(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ typedef int8_t MwI8;
|
||||||
typedef uint8_t MwU8;
|
typedef uint8_t MwU8;
|
||||||
|
|
||||||
#define MW_OTHER_TYPES_DEFINED
|
#define MW_OTHER_TYPES_DEFINED
|
||||||
#elif __GNUC__ > 2
|
#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) || defined(__clang__))
|
||||||
typedef long long MwI64;
|
typedef long long MwI64;
|
||||||
typedef unsigned long long MwU64;
|
typedef unsigned long long MwU64;
|
||||||
#elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
|
#elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
|
||||||
|
|
|
||||||
|
|
@ -99,4 +99,44 @@ enum MwMB_ICON {
|
||||||
*/
|
*/
|
||||||
#define MwMB_BUTTONYESNOCANCEL (MwMB_BUTTONYES | MwMB_BUTTONNO | MwMB_BUTTONCANCEL)
|
#define MwMB_BUTTONYESNOCANCEL (MwMB_BUTTONYES | MwMB_BUTTONNO | MwMB_BUTTONCANCEL)
|
||||||
|
|
||||||
|
/* Whether or not GetXY/SetXY works with global or local coordinates */
|
||||||
|
enum MwCOORDINATE {
|
||||||
|
MwCOORDINATE_GLOBAL = 0,
|
||||||
|
MwCOORDINATE_LOCAL,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The clipboard type that MwGetClipboard should return */
|
||||||
|
enum MwCLIPBOARD {
|
||||||
|
/* the clipboard that is present on every platform that supports it */
|
||||||
|
MwCLIPBOARD_MAIN = 0,
|
||||||
|
/* the "primary" clipboard that Wayland stores to emulate X11's behavior. */
|
||||||
|
MwCLIPBOARD_PRIMARY,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MwMOUSE {
|
||||||
|
MwMOUSE_LEFT = 1,
|
||||||
|
MwMOUSE_MIDDLE,
|
||||||
|
MwMOUSE_RIGHT,
|
||||||
|
MwMOUSE_WHEELUP,
|
||||||
|
MwMOUSE_WHEELDOWN
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MwKEY_FLAG 0x80000000
|
||||||
|
#define MwKEY_CONTROL_FLAG MwKEY_FLAG | 0x40000000
|
||||||
|
#define MwKEY_ALT_FLAG MwKEY_FLAG | 0x20000000
|
||||||
|
|
||||||
|
enum MwKEY {
|
||||||
|
MwKEY_BACKSPACE = MwKEY_FLAG | 1,
|
||||||
|
MwKEY_LEFT,
|
||||||
|
MwKEY_RIGHT,
|
||||||
|
MwKEY_UP,
|
||||||
|
MwKEY_DOWN,
|
||||||
|
MwKEY_ENTER,
|
||||||
|
MwKEY_ESCAPE,
|
||||||
|
MwKEY_LEFTSHIFT,
|
||||||
|
MwKEY_RIGHTSHIFT,
|
||||||
|
MwKEY_ALT,
|
||||||
|
MwKEY_CONTROL
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ extern "C" {
|
||||||
* @brief Initializes the Milsko Toolkit
|
* @brief Initializes the Milsko Toolkit
|
||||||
* @return `0` if successful
|
* @return `0` if successful
|
||||||
*/
|
*/
|
||||||
MWDECL int MwLibraryInit(void);
|
MWDECL int MWAPI MwLibraryInit(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a widget
|
* @brief Creates a widget
|
||||||
|
|
@ -73,7 +73,7 @@ MWDECL int MwLibraryInit(void);
|
||||||
* @param height Height
|
* @param height Height
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height);
|
MWDECL MwWidget MWAPI MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a widget
|
* @brief Creates a widget
|
||||||
|
|
@ -87,7 +87,7 @@ MWDECL MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget
|
||||||
* @param ... Same with MwVaApply
|
* @param ... Same with MwVaApply
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwVaCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
MWDECL MwWidget MWAPI MwVaCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, ...);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a widget
|
* @brief Creates a widget
|
||||||
|
|
@ -101,13 +101,13 @@ MWDECL MwWidget MwVaCreateWidget(MwClass widget_class, const char* name, MwWidge
|
||||||
* @param va Same with MwVaListApply
|
* @param va Same with MwVaListApply
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwVaListCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
MWDECL MwWidget MWAPI MwVaListCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height, va_list va);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Destroys the widget and its child widgets
|
* @brief Destroys the widget and its child widgets
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDestroyWidget(MwWidget handle);
|
MWDECL void MWAPI MwDestroyWidget(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Executes a method specific to the widget (varadic version).
|
* @brief Executes a method specific to the widget (varadic version).
|
||||||
|
|
@ -115,7 +115,7 @@ MWDECL void MwDestroyWidget(MwWidget handle);
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param ... Widget function arguments.
|
* @param ... Widget function arguments.
|
||||||
*/
|
*/
|
||||||
MWDECL void MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out, ...);
|
MWDECL void MWAPI MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out, ...);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Executes a method specific to the widget (va_list version).
|
* @brief Executes a method specific to the widget (va_list version).
|
||||||
|
|
@ -123,27 +123,27 @@ MWDECL void MwVaWidgetExecute(MwWidget handle, const char* func_name, void* out,
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param va Widget function arguments.
|
* @param va Widget function arguments.
|
||||||
*/
|
*/
|
||||||
MWDECL void MwVaListWidgetExecute(MwWidget handle, const char* func_name, void* out, va_list va);
|
MWDECL void MWAPI MwVaListWidgetExecute(MwWidget handle, const char* func_name, void* out, va_list va);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Runs the main loop
|
* @brief Runs the main loop
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwLoop(MwWidget handle);
|
MWDECL void MWAPI MwLoop(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Runs the single step
|
* @brief Runs the single step
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return `0` if successful
|
* @return `0` if successful
|
||||||
*/
|
*/
|
||||||
MWDECL int MwStep(MwWidget handle);
|
MWDECL int MWAPI MwStep(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Check if any event is pending
|
* @brief Check if any event is pending
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return `1` if any event is pending
|
* @return `1` if any event is pending
|
||||||
*/
|
*/
|
||||||
MWDECL int MwPending(MwWidget handle);
|
MWDECL int MWAPI MwPending(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets an integer property
|
* @brief Sets an integer property
|
||||||
|
|
@ -151,7 +151,7 @@ MWDECL int MwPending(MwWidget handle);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @param n Value
|
* @param n Value
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetInteger(MwWidget handle, const char* key, int n);
|
MWDECL void MWAPI MwSetInteger(MwWidget handle, const char* key, int n);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets a text property
|
* @brief Sets a text property
|
||||||
|
|
@ -159,7 +159,7 @@ MWDECL void MwSetInteger(MwWidget handle, const char* key, int n);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @param value Value
|
* @param value Value
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetText(MwWidget handle, const char* key, const char* value);
|
MWDECL void MWAPI MwSetText(MwWidget handle, const char* key, const char* value);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets a void pointer property
|
* @brief Sets a void pointer property
|
||||||
|
|
@ -167,7 +167,7 @@ MWDECL void MwSetText(MwWidget handle, const char* key, const char* value);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @param value Value
|
* @param value Value
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetVoid(MwWidget handle, const char* key, void* value);
|
MWDECL void MWAPI MwSetVoid(MwWidget handle, const char* key, void* value);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the integer property
|
* @brief Gets the integer property
|
||||||
|
|
@ -175,7 +175,7 @@ MWDECL void MwSetVoid(MwWidget handle, const char* key, void* value);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @return Value
|
* @return Value
|
||||||
*/
|
*/
|
||||||
MWDECL int MwGetInteger(MwWidget handle, const char* key);
|
MWDECL int MWAPI MwGetInteger(MwWidget handle, const char* key);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the text property
|
* @brief Gets the text property
|
||||||
|
|
@ -183,7 +183,7 @@ MWDECL int MwGetInteger(MwWidget handle, const char* key);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @return Value
|
* @return Value
|
||||||
*/
|
*/
|
||||||
MWDECL const char* MwGetText(MwWidget handle, const char* key);
|
MWDECL const char* MWAPI MwGetText(MwWidget handle, const char* key);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the void pointer property
|
* @brief Gets the void pointer property
|
||||||
|
|
@ -191,28 +191,28 @@ MWDECL const char* MwGetText(MwWidget handle, const char* key);
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @return Value
|
* @return Value
|
||||||
*/
|
*/
|
||||||
MWDECL void* MwGetVoid(MwWidget handle, const char* key);
|
MWDECL void* MWAPI MwGetVoid(MwWidget handle, const char* key);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets the default property
|
* @brief Sets the default property
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @warning This is called when widget is created
|
* @warning This is called when widget is created
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetDefault(MwWidget handle);
|
MWDECL void MWAPI MwSetDefault(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets the properties
|
* @brief Sets the properties
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param ... Properties
|
* @param ... Properties
|
||||||
*/
|
*/
|
||||||
MWDECL void MwVaApply(MwWidget handle, ...);
|
MWDECL void MWAPI MwVaApply(MwWidget handle, ...);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets properties
|
* @brief Sets properties
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param va Properties
|
* @param va Properties
|
||||||
*/
|
*/
|
||||||
MWDECL void MwVaListApply(MwWidget handle, va_list va);
|
MWDECL void MWAPI MwVaListApply(MwWidget handle, va_list va);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets a user handler
|
* @brief Sets a user handler
|
||||||
|
|
@ -221,7 +221,7 @@ MWDECL void MwVaListApply(MwWidget handle, va_list va);
|
||||||
* @param handler Handler
|
* @param handler Handler
|
||||||
* @param user_data User data passed to handler
|
* @param user_data User data passed to handler
|
||||||
*/
|
*/
|
||||||
MWDECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data);
|
MWDECL void MWAPI MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler handler, void* user_data);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Dispatches the user handler
|
* @brief Dispatches the user handler
|
||||||
|
|
@ -229,7 +229,7 @@ MWDECL void MwAddUserHandler(MwWidget handle, const char* key, MwUserHandler han
|
||||||
* @param key Key
|
* @param key Key
|
||||||
* @param handler_data Handler data passed to handler
|
* @param handler_data Handler data passed to handler
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data);
|
MWDECL void MWAPI MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets an error handler
|
* @brief Sets an error handler
|
||||||
|
|
@ -237,59 +237,52 @@ MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handle
|
||||||
* @param handler Handler
|
* @param handler Handler
|
||||||
* @param user_data User data passed to handler
|
* @param user_data User data passed to handler
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
MWDECL void MWAPI MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Dispatches the error handler
|
* @brief Dispatches the error handler
|
||||||
* @param code Error code
|
* @param code Error code
|
||||||
* @param message Error message
|
* @param message Error message
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDispatchError(int code, const char* message);
|
MWDECL void MWAPI MwDispatchError(int code, const char* message);
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Gets the before_step of widget
|
|
||||||
* @param handle Widget
|
|
||||||
* @param jmpbuf jmp_buf
|
|
||||||
*/
|
|
||||||
MWDECL void MwGetBeforeStep(MwWidget handle, jmp_buf* jmpbuf);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Forcefully makes widget render
|
* @brief Forcefully makes widget render
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwForceRender(MwWidget handle);
|
MWDECL void MWAPI MwForceRender(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Forcefully makes widget render
|
* @brief Forcefully makes widget render
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param ptr Ignored
|
* @param ptr Ignored
|
||||||
*/
|
*/
|
||||||
MWDECL void MwForceRender2(MwWidget handle, void* ptr);
|
MWDECL void MWAPI MwForceRender2(MwWidget handle, void* ptr);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Adds an widget to tick handler list
|
* @brief Adds an widget to tick handler list
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwAddTickList(MwWidget handle);
|
MWDECL void MWAPI MwAddTickList(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Focus the widget
|
* @brief Focus the widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwFocus(MwWidget handle);
|
MWDECL void MWAPI MwFocus(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Grabs the pointer
|
* @brief Grabs the pointer
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param toggle Toggle
|
* @param toggle Toggle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwGrabPointer(MwWidget handle, int toggle);
|
MWDECL void MWAPI MwGrabPointer(MwWidget handle, int toggle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Hides the cursor
|
* @brief Hides the cursor
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL void MwHideCursor(MwWidget handle);
|
MWDECL void MWAPI MwHideCursor(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Toggles the dark theme
|
* @brief Toggles the dark theme
|
||||||
|
|
@ -297,75 +290,113 @@ MWDECL void MwHideCursor(MwWidget handle);
|
||||||
* @param toggle Toggle
|
* @param toggle Toggle
|
||||||
* @deprecated Use MwNdarkTheme instead
|
* @deprecated Use MwNdarkTheme instead
|
||||||
*/
|
*/
|
||||||
MWDECL void MwSetDarkTheme(MwWidget handle, int toggle);
|
MWDECL void MWAPI MwSetDarkTheme(MwWidget handle, int toggle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the parent widget
|
* @brief Gets the parent widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return Parent widget
|
* @return Parent widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwGetParent(MwWidget handle);
|
MWDECL MwWidget MWAPI MwGetParent(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Show widget
|
* @brief Show widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param toggle Toggle
|
* @param toggle Toggle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwShow(MwWidget handle, int toggle);
|
MWDECL void MWAPI MwShow(MwWidget handle, int toggle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Reparents widget
|
* @brief Reparents widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param new_parent New parent
|
* @param new_parent New parent
|
||||||
*/
|
*/
|
||||||
MWDECL void MwReparent(MwWidget handle, MwWidget new_parent);
|
MWDECL void MWAPI MwReparent(MwWidget handle, MwWidget new_parent);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets class of widget
|
* @brief Gets class of widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return Class
|
* @return Class
|
||||||
*/
|
*/
|
||||||
MWDECL MwClass MwGetClass(MwWidget handle);
|
MWDECL MwClass MWAPI MwGetClass(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets name of widget
|
* @brief Gets name of widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return Name
|
* @return Name
|
||||||
*/
|
*/
|
||||||
MWDECL const char* MwGetName(MwWidget handle);
|
MWDECL const char* MWAPI MwGetName(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets children of widget
|
* @brief Gets children of widget
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @return Children (NULL-terminated array)
|
* @return Children (NULL-terminated array)
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget* MwGetChildren(MwWidget handle);
|
MWDECL MwWidget* MWAPI MwGetChildren(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the cursor coordinate
|
* @brief Gets the cursor coordinate
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param point Point
|
* @param point Point
|
||||||
*/
|
*/
|
||||||
MWDECL void MwGetCursorCoord(MwWidget handle, MwPoint* point);
|
MWDECL void MWAPI MwGetCursorCoord(MwWidget handle, MwPoint* point);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the screen size
|
* @brief Gets the screen size
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param rect Rectangle
|
* @param rect Rectangle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwGetScreenSize(MwWidget handle, MwRect* rect);
|
MWDECL void MWAPI MwGetScreenSize(MwWidget handle, MwRect* rect);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Reports whether a widget reports global or local coordinates upon GetXY/SetXY. Anything with a parent reports local, and most backends report global coordinates being supported for top level windows, but some (Wayland) do not.
|
* @brief Reports whether a widget reports global or local coordinates upon GetXY/SetXY. Anything with a parent reports local, and most backends report global coordinates being supported for top level windows, but some (Wayland) do not.
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL int MwGetCoordinateType(MwWidget handle);
|
MWDECL int MWAPI MwGetCoordinateType(MwWidget handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Queue to get clipboard content
|
* @brief Queue to get clipboard content
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
|
* @param clipboard_type The Clipboard Type to get. See MwClipboardType. This is ignored on backends that aren't X11/Wayland, so if you're unsure, just use MwClipboardMain
|
||||||
*/
|
*/
|
||||||
MWDECL void MwGetClipboard(MwWidget handle);
|
MWDECL void MWAPI MwGetClipboard(MwWidget handle, int clipboard_type);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Set user pointer
|
||||||
|
* @param handle Widget
|
||||||
|
* @param user User pointer
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwSetUser(MwWidget handle, void* user);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Get user pointer
|
||||||
|
* @param handle Widget
|
||||||
|
* @return User pointer
|
||||||
|
*/
|
||||||
|
MWDECL void* MWAPI MwGetUser(MwWidget handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Free the widget
|
||||||
|
* @param handle Widget
|
||||||
|
* @warning This is used internally!
|
||||||
|
* @note You can call this on toplevel widget safely if you're sure no event loops will be ran, e.g. after `MwLoop`.
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwFreeWidget(MwWidget handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Gets the frame of the widget
|
||||||
|
* @param handle Widget
|
||||||
|
* @param rect Frame
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwGetFrame(MwWidget handle, MwRect* rect);
|
||||||
|
|
||||||
|
#ifdef _MILSKO
|
||||||
|
MWDECL void MwForceRender_Internal(MwWidget handle);
|
||||||
|
MWDECL void MwForceRender2_Internal(MwWidget handle, void* ptr);
|
||||||
|
|
||||||
|
#define MwForceRender MwForceRender_Internal
|
||||||
|
#define MwForceRender2 MwForceRender2_Internal
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,16 @@ MWDECL const char* MwDefaultSubBackground;
|
||||||
*/
|
*/
|
||||||
MWDECL const char* MwDefaultSubForeground;
|
MWDECL const char* MwDefaultSubForeground;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default title background color
|
||||||
|
*/
|
||||||
|
MWDECL const char* MwDefaultTitleBackground;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default title foreground color
|
||||||
|
*/
|
||||||
|
MWDECL const char* MwDefaultTitleForeground;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Default dark theme background color
|
* @brief Default dark theme background color
|
||||||
*/
|
*/
|
||||||
|
|
@ -52,6 +62,16 @@ MWDECL const char* MwDefaultDarkSubBackground;
|
||||||
*/
|
*/
|
||||||
MWDECL const char* MwDefaultDarkSubForeground;
|
MWDECL const char* MwDefaultDarkSubForeground;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default dark theme title background color
|
||||||
|
*/
|
||||||
|
MWDECL const char* MwDefaultDarkTitleBackground;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default dark theme title foreground color
|
||||||
|
*/
|
||||||
|
MWDECL const char* MwDefaultDarkTitleForeground;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Default shadow difference
|
* @brief Default shadow difference
|
||||||
*/
|
*/
|
||||||
|
|
@ -61,7 +81,13 @@ MWDECL const int MwDefaultShadow;
|
||||||
* @brief Gets default border width
|
* @brief Gets default border width
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
*/
|
*/
|
||||||
MWDECL int MwDefaultBorderWidth(MwWidget handle);
|
MWDECL int MWAPI MwDefaultBorderWidth(MwWidget handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Gets default thin border width
|
||||||
|
* @param handle Widget
|
||||||
|
*/
|
||||||
|
MWDECL int MwDefaultThinBorderWidth(MwWidget handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
||||||
* @param title Title text
|
* @param title Title text
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwColorPicker(MwWidget handle, const char* title);
|
MWDECL MwWidget MWAPI MwColorPicker(MwWidget handle, const char* title);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
||||||
* @param title Title text
|
* @param title Title text
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwDirectoryChooser(MwWidget handle, const char* title);
|
MWDECL MwWidget MWAPI MwDirectoryChooser(MwWidget handle, const char* title);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
||||||
* @param title Title text
|
* @param title Title text
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwFileChooser(MwWidget handle, const char* title);
|
MWDECL MwWidget MWAPI MwFileChooser(MwWidget handle, const char* title);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a file chooser
|
* @brief Creates a file chooser
|
||||||
|
|
@ -27,7 +27,7 @@ MWDECL MwWidget MwFileChooser(MwWidget handle, const char* title);
|
||||||
* @param dir Show directory only or not
|
* @param dir Show directory only or not
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MwWidget MwFileChooserEx(MwWidget handle, const char* title, int dir);
|
MWDECL MwWidget MWAPI MwFileChooserEx(MwWidget handle, const char* title, int dir);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,20 +20,14 @@ extern "C" {
|
||||||
* @param flag Flag
|
* @param flag Flag
|
||||||
* @return Widget
|
* @return Widget
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag);
|
MWDECL MwWidget MWAPI MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets a child of the message box
|
* @brief Gets a child of the message box
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param child Child
|
* @param child Child
|
||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwMessageBoxGetChild(MwWidget handle, int child);
|
MWDECL MwWidget MWAPI MwMessageBoxGetChild(MwWidget handle, int child);
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Destroys the message box
|
|
||||||
* @param handle Widget
|
|
||||||
*/
|
|
||||||
MWDECL void MwMessageBoxDestroy(MwWidget handle);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,20 @@ extern "C" {
|
||||||
* @param text Color text
|
* @param text Color text
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLColor MwParseColor(MwWidget handle, const char* text);
|
MWDECL MwLLColor MWAPI MwParseColor(MwWidget handle, const char* text);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Parses a color text
|
* @brief Parses a color text
|
||||||
* @param text Color text
|
* @param text Color text
|
||||||
* @param rgb RGB
|
* @param rgb RGB
|
||||||
*/
|
*/
|
||||||
MWDECL void MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
MWDECL void MWAPI MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Initialize color table
|
||||||
|
* @warning This is called in MwLibraryInit - you do not have to call this
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwColorTableInit(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Lighten a color
|
* @brief Lighten a color
|
||||||
|
|
@ -37,7 +43,7 @@ MWDECL void MwParseColorNoAllocate(const char* text, MwRGB* rgb);
|
||||||
* @param b Blue
|
* @param b Blue
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLColor MwLightenColor(MwWidget handle, MwLLColor color, int r, int g, int b);
|
MWDECL MwLLColor MWAPI MwLightenColor(MwWidget handle, MwLLColor color, int r, int g, int b);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a filled rectangle
|
* @brief Draws a filled rectangle
|
||||||
|
|
@ -45,7 +51,7 @@ MWDECL MwLLColor MwLightenColor(MwWidget handle, MwLLColor color, int r, int g,
|
||||||
* @param rect Rectangle area
|
* @param rect Rectangle area
|
||||||
* @param color Color
|
* @param color Color
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
MWDECL void MWAPI MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a filled rectangle that fades to a darker color
|
* @brief Draws a filled rectangle that fades to a darker color
|
||||||
|
|
@ -53,7 +59,7 @@ MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||||
* @param rect Rectangle area
|
* @param rect Rectangle area
|
||||||
* @param color Color
|
* @param color Color
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded);
|
MWDECL void MWAPI MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a frame
|
* @brief Draws a frame
|
||||||
|
|
@ -63,7 +69,18 @@ MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int
|
||||||
* @param invert Invert the 3D border color or not
|
* @param invert Invert the 3D border color or not
|
||||||
* @warning `rect` gets changed to the area of rectangle inside
|
* @warning `rect` gets changed to the area of rectangle inside
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded);
|
MWDECL void MWAPI MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Draws a frame
|
||||||
|
* @param handle Widget
|
||||||
|
* @param rect Rectangle area
|
||||||
|
* @param color Color
|
||||||
|
* @param invert Invert the 3D border color or not
|
||||||
|
* @param border Border
|
||||||
|
* @warning `rect` gets changed to the area of rectangle inside
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwDrawFrameWithBorder(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Does the DrawFrame/DrawRect combo used for drawing widget.
|
* @brief Does the DrawFrame/DrawRect combo used for drawing widget.
|
||||||
|
|
@ -73,7 +90,7 @@ MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int inve
|
||||||
* @param invert Invert the 3D border color or not
|
* @param invert Invert the 3D border color or not
|
||||||
* @warning `rect` gets changed to the area of rectangle inside
|
* @warning `rect` gets changed to the area of rectangle inside
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border);
|
MWDECL void MWAPI MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a triangle
|
* @brief Draws a triangle
|
||||||
|
|
@ -82,7 +99,7 @@ MWDECL void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int
|
||||||
* @param color Color
|
* @param color Color
|
||||||
* @param invert Invert the 3D border color or not
|
* @param invert Invert the 3D border color or not
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int direction);
|
MWDECL void MWAPI MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int direction);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a frame with specified border width
|
* @brief Draws a frame with specified border width
|
||||||
|
|
@ -93,10 +110,9 @@ MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int i
|
||||||
* @param border Border width
|
* @param border Border width
|
||||||
* @param diff Difference (set this to 0 if you don't know what this does)
|
* @param diff Difference (set this to 0 if you don't know what this does)
|
||||||
* @param same Same as dark color
|
* @param same Same as dark color
|
||||||
* @param rounded Rounded or not
|
|
||||||
* @warning `rect` gets changed to the area of rectangle inside
|
* @warning `rect` gets changed to the area of rectangle inside
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded);
|
MWDECL void MWAPI MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a pixmap from image
|
* @brief Creates a pixmap from image
|
||||||
|
|
@ -104,7 +120,7 @@ MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int in
|
||||||
* @param path Path
|
* @param path Path
|
||||||
* @return Pixmap
|
* @return Pixmap
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLPixmap MwLoadImage(MwWidget handle, const char* path);
|
MWDECL MwLLPixmap MWAPI MwLoadImage(MwWidget handle, const char* path);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Get color components
|
* @brief Get color components
|
||||||
|
|
@ -113,7 +129,7 @@ MWDECL MwLLPixmap MwLoadImage(MwWidget handle, const char* path);
|
||||||
* @param green Pointer to green color
|
* @param green Pointer to green color
|
||||||
* @param blue Pointer to blue color
|
* @param blue Pointer to blue color
|
||||||
*/
|
*/
|
||||||
MWDECL void MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
MWDECL void MWAPI MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a pixmap from raw data
|
* @brief Creates a pixmap from raw data
|
||||||
|
|
@ -123,28 +139,28 @@ MWDECL void MwColorGet(MwLLColor color, int* red, int* green, int* blue);
|
||||||
* @param height Height
|
* @param height Height
|
||||||
* @return Pixmap
|
* @return Pixmap
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height);
|
MWDECL MwLLPixmap MWAPI MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Updates a pixmap using raw data
|
* @brief Updates a pixmap using raw data
|
||||||
* @param pixmap Pixmap to update
|
* @param pixmap Pixmap to update
|
||||||
* @param rgb RGBA data
|
* @param rgb RGBA data
|
||||||
*/
|
*/
|
||||||
MWDECL void MwPixmapReloadRaw(MwLLPixmap pixmap, unsigned char* rgb);
|
MWDECL void MWAPI MwPixmapReloadRaw(MwLLPixmap pixmap, unsigned char* rgb);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the raw data of pixmap
|
* @brief Gets the raw data of pixmap
|
||||||
* @param pixmap Pixmap
|
* @param pixmap Pixmap
|
||||||
* @return RFBA data
|
* @return RGBA data
|
||||||
*/
|
*/
|
||||||
MWDECL unsigned char* MwPixmapGetRaw(MwLLPixmap pixmap);
|
MWDECL unsigned char* MWAPI MwPixmapGetRaw(MwLLPixmap pixmap);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the size of pixmap
|
* @brief Gets the size of pixmap
|
||||||
* @param pixmap Pixmap
|
* @param pixmap Pixmap
|
||||||
* @param rect Size
|
* @param rect Size
|
||||||
*/
|
*/
|
||||||
MWDECL void MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
MWDECL void MWAPI MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a pixmap from XPM data
|
* @brief Creates a pixmap from XPM data
|
||||||
|
|
@ -152,7 +168,7 @@ MWDECL void MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
||||||
* @param data Data
|
* @param data Data
|
||||||
* @return Pixmap
|
* @return Pixmap
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLPixmap MwLoadXPM(MwWidget handle, char** data);
|
MWDECL MwLLPixmap MWAPI MwLoadXPM(MwWidget handle, char** data);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a pixmap from icon data
|
* @brief Creates a pixmap from icon data
|
||||||
|
|
@ -160,7 +176,7 @@ MWDECL MwLLPixmap MwLoadXPM(MwWidget handle, char** data);
|
||||||
* @param data Data
|
* @param data Data
|
||||||
* @return Pixmap
|
* @return Pixmap
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLPixmap MwLoadIcon(MwWidget handle, MwU32* data);
|
MWDECL MwLLPixmap MWAPI MwLoadIcon(MwWidget handle, MwU32* data);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a diamond
|
* @brief Draws a diamond
|
||||||
|
|
@ -169,36 +185,38 @@ MWDECL MwLLPixmap MwLoadIcon(MwWidget handle, MwU32* data);
|
||||||
* @param color Color
|
* @param color Color
|
||||||
* @param invert Invert the 3D border color or not
|
* @param invert Invert the 3D border color or not
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
MWDECL void MWAPI MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
|
||||||
|
|
||||||
/* text.c */
|
/* text.c */
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Draws a text
|
* @brief Draws a text
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
|
* @param ttf TTF, NULLable
|
||||||
* @param point Center point of the text
|
* @param point Center point of the text
|
||||||
* @param text Text
|
* @param text Text
|
||||||
* @param bold Bold
|
|
||||||
* @param align Align
|
* @param align Align
|
||||||
* @param color Color
|
* @param color Color
|
||||||
*/
|
*/
|
||||||
MWDECL void MwDrawText(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color);
|
MWDECL void MWAPI MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, int align, MwLLColor color);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Calculates a text width
|
* @brief Calculates a text width
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param text Text
|
* @param text Text
|
||||||
|
* @param font Font, NULLable
|
||||||
* @return Text width
|
* @return Text width
|
||||||
*/
|
*/
|
||||||
MWDECL int MwTextWidth(MwWidget handle, const char* text);
|
MWDECL int MWAPI MwTextWidth(MwWidget handle, MwFLFont font, const char* text);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Calculates a text height
|
* @brief Calculates a text height
|
||||||
* @param handle Widget
|
* @param handle Widget
|
||||||
* @param text Text
|
* @param text Text
|
||||||
|
* @param font Font, NULLable
|
||||||
* @return Text height
|
* @return Text height
|
||||||
*/
|
*/
|
||||||
MWDECL int MwTextHeight(MwWidget handle, const char* text);
|
MWDECL int MWAPI MwTextHeight(MwWidget handle, MwFLFont font, const char* text);
|
||||||
|
|
||||||
/* color.c */
|
/* color.c */
|
||||||
|
|
||||||
|
|
@ -208,14 +226,14 @@ MWDECL int MwTextHeight(MwWidget handle, const char* text);
|
||||||
* @param color Color name
|
* @param color Color name
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
MWDECL MwLLColor MwParseColorName(MwWidget handle, const char* color);
|
MWDECL MwLLColor MWAPI MwParseColorName(MwWidget handle, const char* color);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Parses a color name
|
* @brief Parses a color name
|
||||||
* @param color Color name
|
* @param color Color name
|
||||||
* @param rgb RGB
|
* @param rgb RGB
|
||||||
*/
|
*/
|
||||||
MWDECL void MwParseColorNameNoAllocate(const char* color, MwRGB* rgb);
|
MWDECL void MWAPI MwParseColorNameNoAllocate(const char* color, MwRGB* rgb);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
/*!
|
|
||||||
* @file Mw/Error.h
|
|
||||||
* @brief Error codes
|
|
||||||
*/
|
|
||||||
#ifndef __MW_ERROR_H__
|
|
||||||
#define __MW_ERROR_H__
|
|
||||||
|
|
||||||
#include <Mw/MachDep.h>
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Error code enumeration
|
|
||||||
*/
|
|
||||||
typedef enum MwErrorEnum_T {
|
|
||||||
/*!
|
|
||||||
* @brief No error
|
|
||||||
*/
|
|
||||||
MwEsuccess = 0,
|
|
||||||
/*!
|
|
||||||
* @brief There was an error
|
|
||||||
*/
|
|
||||||
MwEerror,
|
|
||||||
} MwErrorEnum;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Get the last error
|
|
||||||
*/
|
|
||||||
MWDECL const char* MwGetLastError(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -18,13 +18,13 @@ extern "C" {
|
||||||
* @param size Data size
|
* @param size Data size
|
||||||
* @return Font handle
|
* @return Font handle
|
||||||
*/
|
*/
|
||||||
MWDECL void* MwFontLoad(unsigned char* data, unsigned int size);
|
MWDECL void* MWAPI MwFontLoad(unsigned char* data, unsigned int size);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Frees a font handle
|
* @brief Frees a font handle
|
||||||
* @param handle Handle
|
* @param handle Handle
|
||||||
*/
|
*/
|
||||||
MWDECL void MwFontFree(void* handle);
|
MWDECL void MWAPI MwFontFree(void* handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@
|
||||||
#ifndef __MW_LOWLEVEL_H__
|
#ifndef __MW_LOWLEVEL_H__
|
||||||
#define __MW_LOWLEVEL_H__
|
#define __MW_LOWLEVEL_H__
|
||||||
|
|
||||||
#include "Mw/BaseTypes.h"
|
#include <Mw/BaseTypes.h>
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
|
|
||||||
typedef struct _MwLLHandler* MwLLHandler;
|
typedef struct _MwLLHandler* MwLLHandler;
|
||||||
typedef struct _MwLLMouse MwLLMouse;
|
|
||||||
typedef struct _MwLLCommon* MwLLCommon;
|
typedef struct _MwLLCommon* MwLLCommon;
|
||||||
typedef struct _MwLLCommonColor* MwLLCommonColor;
|
typedef struct _MwLLCommonColor* MwLLCommonColor;
|
||||||
typedef struct _MwLLCommonPixmap* MwLLCommonPixmap;
|
typedef struct _MwLLCommonPixmap* MwLLCommonPixmap;
|
||||||
|
|
@ -31,6 +30,7 @@ enum MwLLBackends {
|
||||||
MwLLBackendGDI,
|
MwLLBackendGDI,
|
||||||
MwLLBackendWayland,
|
MwLLBackendWayland,
|
||||||
MwLLBackendCocoa,
|
MwLLBackendCocoa,
|
||||||
|
MwLLBackendHaiku
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLCommon {
|
struct _MwLLCommon {
|
||||||
|
|
@ -56,6 +56,52 @@ struct _MwLLCommonPixmap {
|
||||||
void* user;
|
void* user;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef USE_DBUS
|
||||||
|
typedef struct _MwLLDBusFuncTable {
|
||||||
|
void* lib;
|
||||||
|
|
||||||
|
void (*dbus_error_init)(DBusError* error);
|
||||||
|
DBusConnection* (*dbus_bus_get)(DBusBusType type, DBusError* error);
|
||||||
|
dbus_bool_t (*dbus_error_is_set)(const DBusError* error);
|
||||||
|
void (*dbus_error_free)(DBusError* error);
|
||||||
|
DBusMessage* (*dbus_message_new_method_call)(const char* bus_name, const char* path, const char* iface, const char* method);
|
||||||
|
void (*dbus_message_iter_init_append)(DBusMessage* message, DBusMessageIter* iter);
|
||||||
|
dbus_bool_t (*dbus_message_iter_append_basic)(DBusMessageIter* iter, int type, const void* value);
|
||||||
|
void (*dbus_connection_flush)(DBusConnection* connection);
|
||||||
|
dbus_bool_t (*dbus_connection_read_write)(DBusConnection* connection, int timeout_milliseconds);
|
||||||
|
DBusMessage* (*dbus_connection_send_with_reply_and_block)(DBusConnection* connection, DBusMessage* message, int timeout_milliseconds, DBusError* error);
|
||||||
|
DBusMessage* (*dbus_connection_pop_message)(DBusConnection* connection);
|
||||||
|
void (*dbus_bus_add_match)(DBusConnection* connection, const char* rule, DBusError* error);
|
||||||
|
void (*dbus_message_unref)(DBusMessage* message);
|
||||||
|
dbus_bool_t (*dbus_message_iter_init)(DBusMessage* message, DBusMessageIter* iter);
|
||||||
|
dbus_bool_t (*dbus_message_is_signal)(DBusMessage* message, const char* iface, const char* signal_name);
|
||||||
|
int (*dbus_message_iter_get_arg_type)(DBusMessageIter* iter);
|
||||||
|
void (*dbus_message_iter_recurse)(DBusMessageIter* iter, DBusMessageIter* sub);
|
||||||
|
void (*dbus_message_iter_next)(DBusMessageIter* iter);
|
||||||
|
void (*dbus_connection_unref)(DBusConnection* connection);
|
||||||
|
void (*dbus_message_iter_get_basic)(DBusMessageIter* iter, void* value);
|
||||||
|
} MwLLDBusFuncTable;
|
||||||
|
|
||||||
|
typedef struct _MwLLDBusContext {
|
||||||
|
DBusConnection* dbus_conn;
|
||||||
|
DBusError dbus_err;
|
||||||
|
DBusMessage* dbus_msg;
|
||||||
|
DBusMessage* dbus_reply;
|
||||||
|
} MwLLDBusContext;
|
||||||
|
|
||||||
|
typedef void (*MwLLDBusPortalPollListener)(MwLL handle, MwU32 new_value);
|
||||||
|
|
||||||
|
/* setup the dbus func table. Returns false and prints a warning if dbus couldn't be found. */
|
||||||
|
MWDECL MwBool MwLLDBusFuncSetup(MwLLDBusFuncTable* tbl);
|
||||||
|
|
||||||
|
MWDECL MwBool MwLLDBusNewContext(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx);
|
||||||
|
MWDECL MwBool MwLLDBusPortalGet(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal, const char* namespace, const char* key, void* out);
|
||||||
|
MWDECL MwBool MwLLDBusPortalWatch(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal);
|
||||||
|
MWDECL MwBool MwLLDBusPortalPoll(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, MwLL handle, const char* portal, const char* namespace, const char* key, MwLLDBusPortalPollListener);
|
||||||
|
MWDECL void MwLLDBusFreeContext(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MILSKO
|
#ifdef _MILSKO
|
||||||
#ifdef USE_X11
|
#ifdef USE_X11
|
||||||
#include <Mw/LowLevel/X11.h>
|
#include <Mw/LowLevel/X11.h>
|
||||||
|
|
@ -69,6 +115,12 @@ struct _MwLLCommonPixmap {
|
||||||
#ifdef USE_COCOA
|
#ifdef USE_COCOA
|
||||||
#include <Mw/LowLevel/Cocoa.h>
|
#include <Mw/LowLevel/Cocoa.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CLASSIC_MAC_OS
|
||||||
|
#include <Mw/LowLevel/ClassicMacOS.h>
|
||||||
|
#endif
|
||||||
|
#ifdef USE_HAIKU
|
||||||
|
#include <Mw/LowLevel/Haiku.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
union _MwLL {
|
union _MwLL {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
|
|
@ -80,10 +132,17 @@ union _MwLL {
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_WAYLAND
|
#ifdef USE_WAYLAND
|
||||||
struct _MwLLWayland wayland;
|
struct _MwLLWayland wayland;
|
||||||
|
struct _MwLLCairo cairo;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_COCOA
|
#ifdef USE_COCOA
|
||||||
struct _MwLLCocoa cocoa;
|
struct _MwLLCocoa cocoa;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CLASSIC_MAC_OS
|
||||||
|
struct _MwLLClassicMacOS cmacos;
|
||||||
|
#endif
|
||||||
|
#ifdef USE_HAIKU
|
||||||
|
struct _MwLLHaiku haiku;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
union _MwLLColor {
|
union _MwLLColor {
|
||||||
|
|
@ -95,11 +154,14 @@ union _MwLLColor {
|
||||||
struct _MwLLGDIColor gdi;
|
struct _MwLLGDIColor gdi;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_WAYLAND
|
#ifdef USE_WAYLAND
|
||||||
struct _MwLLWaylandColor wayland;
|
struct _MwLLCairoColor wayland;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_COCOA
|
#ifdef USE_COCOA
|
||||||
struct _MwLLCocoaColor cocoa;
|
struct _MwLLCocoaColor cocoa;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_HAIKU
|
||||||
|
struct _MwLLHaikuColor haiku;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
union _MwLLPixmap {
|
union _MwLLPixmap {
|
||||||
|
|
@ -112,10 +174,17 @@ union _MwLLPixmap {
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_WAYLAND
|
#ifdef USE_WAYLAND
|
||||||
struct _MwLLWaylandPixmap wayland;
|
struct _MwLLWaylandPixmap wayland;
|
||||||
|
struct _MwLLCairoPixmap cairo; /* same structure but we do this for code clarity */
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_COCOA
|
#ifdef USE_COCOA
|
||||||
struct _MwLLCocoaPixmap cocoa;
|
struct _MwLLCocoaPixmap cocoa;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CLASSIC_MAC_OS
|
||||||
|
struct _MwLLClassicMacOSPixmap cmacos;
|
||||||
|
#endif
|
||||||
|
#ifdef USE_HAIKU
|
||||||
|
struct _MwLLHaikuPixmap haiku;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
@ -123,37 +192,6 @@ union _MwLLPixmap {
|
||||||
#define MwLLDispatch(x, y, z) \
|
#define MwLLDispatch(x, y, z) \
|
||||||
if(x->common.handler != NULL && x->common.handler->y != NULL) x->common.handler->y(x, z)
|
if(x->common.handler != NULL && x->common.handler->y != NULL) x->common.handler->y(x, z)
|
||||||
|
|
||||||
#define MwLLKeyMask (1 << 31)
|
|
||||||
enum MwLLKeyEnum {
|
|
||||||
MwLLKeyBackSpace = MwLLKeyMask | 1,
|
|
||||||
MwLLKeyLeft,
|
|
||||||
MwLLKeyRight,
|
|
||||||
MwLLKeyUp,
|
|
||||||
MwLLKeyDown,
|
|
||||||
MwLLKeyEnter,
|
|
||||||
MwLLKeyEscape,
|
|
||||||
MwLLKeyLeftShift,
|
|
||||||
MwLLKeyRightShift,
|
|
||||||
MwLLKeyAlt,
|
|
||||||
MwLLKeyControl
|
|
||||||
};
|
|
||||||
|
|
||||||
#define MwLLControlMask MwLLKeyMask | (1 << 30)
|
|
||||||
#define MwLLAltMask MwLLKeyMask | (1 << 29)
|
|
||||||
|
|
||||||
enum MwLLMouseEnum {
|
|
||||||
MwLLMouseLeft = 1,
|
|
||||||
MwLLMouseMiddle,
|
|
||||||
MwLLMouseRight,
|
|
||||||
MwLLMouseWheelUp,
|
|
||||||
MwLLMouseWheelDown
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MwLLMouse {
|
|
||||||
MwPoint point;
|
|
||||||
int button;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MwLLHandler {
|
struct _MwLLHandler {
|
||||||
void (*draw)(MwLL handle, void* data);
|
void (*draw)(MwLL handle, void* data);
|
||||||
void (*up)(MwLL handle, void* data);
|
void (*up)(MwLL handle, void* data);
|
||||||
|
|
@ -167,6 +205,7 @@ struct _MwLLHandler {
|
||||||
void (*focus_out)(MwLL handle, void* data);
|
void (*focus_out)(MwLL handle, void* data);
|
||||||
void (*clipboard)(MwLL handle, void* data);
|
void (*clipboard)(MwLL handle, void* data);
|
||||||
void (*dark_theme)(MwLL handle, void* data);
|
void (*dark_theme)(MwLL handle, void* data);
|
||||||
|
void (*drag_and_drop)(MwLL handle, void* data);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLTextDispatchTable {
|
struct _MwLLTextDispatchTable {
|
||||||
|
|
@ -177,6 +216,11 @@ struct _MwLLTextDispatchTable {
|
||||||
void (*fontFree)(void* handle);
|
void (*fontFree)(void* handle);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MwFLFlagMonospace (1 << 0)
|
||||||
|
#define MwFLFlagBold (1 << 1)
|
||||||
|
#define MwFLFlagBitmap (1 << 2)
|
||||||
|
#define MwFLBuildFont(x) ((MwFLFont)(void*)(size_t)(x))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -191,7 +235,17 @@ MWDECL void (*MwLLDestroy)(MwLL handle);
|
||||||
|
|
||||||
MWDECL void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
|
MWDECL void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
|
||||||
MWDECL void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color);
|
MWDECL void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Begin drawing sequence
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLBeginDraw)(MwLL handle);
|
MWDECL void (*MwLLBeginDraw)(MwLL handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief End drawing sequence
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLEndDraw)(MwLL handle);
|
MWDECL void (*MwLLEndDraw)(MwLL handle);
|
||||||
|
|
||||||
MWDECL MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b);
|
MWDECL MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b);
|
||||||
|
|
@ -216,42 +270,105 @@ MWDECL void (*MwLLSetIcon)(MwLL handle, MwLLPixmap pixmap);
|
||||||
MWDECL void (*MwLLForceRender)(MwLL handle);
|
MWDECL void (*MwLLForceRender)(MwLL handle);
|
||||||
|
|
||||||
MWDECL void (*MwLLSetCursor)(MwLL handle, MwCursor* image, MwCursor* mask);
|
MWDECL void (*MwLLSetCursor)(MwLL handle, MwCursor* image, MwCursor* mask);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Detach handle and make it toplevel window
|
||||||
|
* @param handle Handle
|
||||||
|
* @param point Point to be detached at, relative from the parent handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLDetach)(MwLL handle, MwPoint* point);
|
MWDECL void (*MwLLDetach)(MwLL handle, MwPoint* point);
|
||||||
MWDECL void (*MwLLShow)(MwLL handle, int show);
|
MWDECL void (*MwLLShow)(MwLL handle, int show);
|
||||||
|
|
||||||
MWDECL void (*MwLLSetSizeHints)(MwLL handle, int minx, int miny, int maxx, int maxy);
|
MWDECL void (*MwLLSetSizeHints)(MwLL handle, int minx, int miny, int maxx, int maxy);
|
||||||
MWDECL void (*MwLLMakeBorderless)(MwLL handle, int toggle);
|
MWDECL void (*MwLLMakeBorderless)(MwLL handle, int toggle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Make handle "tool" window, e.g. Submenu, combobox menu, and etc.
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLMakeToolWindow)(MwLL handle);
|
MWDECL void (*MwLLMakeToolWindow)(MwLL handle);
|
||||||
MWDECL void (*MwLLMakePopup)(MwLL handle, MwLL parent);
|
MWDECL void (*MwLLMakePopup)(MwLL handle, MwLL parent);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Begin changing state (has to be called before `MwLLSetSizeHints`, `MwLLMakeBorderless`, `MwLLMakeToolWindow`, and `MwLLMakePopup`)
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLBeginStateChange)(MwLL handle);
|
MWDECL void (*MwLLBeginStateChange)(MwLL handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief End changing state
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
||||||
|
|
||||||
MWDECL void (*MwLLFocus)(MwLL handle);
|
MWDECL void (*MwLLFocus)(MwLL handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Grab pointer, and keep moving pointer to center of handle
|
||||||
|
* @param handle Handle
|
||||||
|
* @param toggle Toggle
|
||||||
|
*/
|
||||||
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
||||||
|
|
||||||
MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text);
|
MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text, int clipboard_type);
|
||||||
MWDECL void (*MwLLGetClipboard)(MwLL handle);
|
MWDECL void (*MwLLGetClipboard)(MwLL handle, int clipboard_type);
|
||||||
|
|
||||||
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
||||||
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Setup drag and drop capabilities, should the user request it with MwNacceptsDnD
|
||||||
|
* @param handle Handle
|
||||||
|
*/
|
||||||
|
MWDECL void (*MwLLSetupDragAndDrop)(MwLL handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Set any extra parameters for dark theme
|
||||||
|
* @param handle Handle
|
||||||
|
* @param toggle Toggle
|
||||||
|
* @warning Do not run `handle->common.handler->dark_theme` when this function gets called
|
||||||
|
* @warning This is for stuff like, i.e. setting the accent color on modern Windows. The user themselves sets dark theme with MwNdarkTheme.
|
||||||
|
*/
|
||||||
|
MWDECL void (*MwLLSetDarkTheme)(MwLL handle, int toggle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Whether or not the platform should default to modern theme.
|
||||||
|
* @param handle Handle
|
||||||
|
* @return whether to default.
|
||||||
|
*/
|
||||||
|
MWDECL MwBool (*MwLLDoModern)(MwLL handle);
|
||||||
|
|
||||||
|
MWDECL void (*MwLLRaise)(MwLL handle);
|
||||||
|
|
||||||
|
MWDECL void (*MwLLClip)(MwLL handle, MwRect* rect);
|
||||||
|
|
||||||
/* font renderer */
|
/* font renderer */
|
||||||
MWDECL void MwFLSetup(void);
|
MWDECL void MwFLSetup(void);
|
||||||
|
|
||||||
#ifdef USE_FREETYPE2
|
#ifdef USE_FREETYPE2
|
||||||
MWDECL int MWFL_FT2Setup(void);
|
MWDECL int MwFL_FT2Setup(void);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_STB_TRUETYPE
|
#ifdef USE_STB_TRUETYPE
|
||||||
MWDECL int MwFL_STBTTSetup(void);
|
MWDECL int MwFL_STBTTSetup(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MWDECL int (*MwFLDrawText)(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color);
|
#ifdef USE_GDI_TEXT
|
||||||
MWDECL int (*MwFLTextWidth)(MwWidget handle, const char* text);
|
MWDECL int MwFL_GDISetup(void);
|
||||||
MWDECL int (*MwFLTextHeight)(MwWidget handle, int count);
|
#endif
|
||||||
MWDECL void* (*MwFLFontLoad)(unsigned char* data, unsigned int size);
|
|
||||||
|
MWDECL int (*MwFLDrawText)(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, MwLLColor color);
|
||||||
|
MWDECL int (*MwFLTextWidth)(MwFLFont ttf, const char* text);
|
||||||
|
MWDECL int (*MwFLTextHeight)(MwFLFont ttf, int count);
|
||||||
|
MWDECL int (*MwFLTextHeightWithText)(MwFLFont ttf, const char* text);
|
||||||
|
MWDECL void* (*MwFLFontLoad)(unsigned char* data, unsigned int size, int px);
|
||||||
MWDECL void (*MwFLFontFree)(void* handle);
|
MWDECL void (*MwFLFontFree)(void* handle);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
MWDECL void *MwLL_winmmLib;
|
||||||
|
MWDECL long (__stdcall* MwLL_PFN_timeGetTime)(void);
|
||||||
|
MWDECL unsigned int (__stdcall* MwLL_PFN_timeBeginPeriod)(unsigned int period);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
229
include/Mw/LowLevel/Cairo.h
Normal file
229
include/Mw/LowLevel/Cairo.h
Normal file
|
|
@ -0,0 +1,229 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/LowLevel/Cairo.h
|
||||||
|
* @brief Cairo Backend
|
||||||
|
* @warning This is used MEGA internally.
|
||||||
|
*/
|
||||||
|
#ifndef __MW_LOWLEVEL_CAIRO_H__
|
||||||
|
#define __MW_LOWLEVEL_CAIRO_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/LowLevel.h>
|
||||||
|
#include <Mw/Abstract/Dynamic.h>
|
||||||
|
|
||||||
|
#include <cairo/cairo.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MWDECL int MwLLCairoCallInit(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CSD_BORDER_FRAME_LEFT 5
|
||||||
|
#define CSD_BORDER_FRAME_RIGHT 5
|
||||||
|
#define CSD_BORDER_FRAME_TOP 23
|
||||||
|
#define CSD_BORDER_FRAME_BOTTOM 4
|
||||||
|
|
||||||
|
typedef struct cairo_call_table {
|
||||||
|
void* cairo_lib;
|
||||||
|
|
||||||
|
void (*cairo_set_line_width)(cairo_t* cr,
|
||||||
|
double width);
|
||||||
|
void (*cairo_scale)(cairo_t* cr,
|
||||||
|
double sx,
|
||||||
|
double sy);
|
||||||
|
cairo_t* (*cairo_create)(cairo_surface_t* target);
|
||||||
|
void (*cairo_move_to)(cairo_t* cr,
|
||||||
|
double x,
|
||||||
|
double y);
|
||||||
|
|
||||||
|
void (*cairo_rectangle)(cairo_t* cr,
|
||||||
|
double x,
|
||||||
|
double y,
|
||||||
|
double width,
|
||||||
|
double height);
|
||||||
|
void (*cairo_new_path)(cairo_t* cr);
|
||||||
|
void (*cairo_set_line_cap)(cairo_t* cr,
|
||||||
|
cairo_line_cap_t line_cap);
|
||||||
|
void (*cairo_set_source_rgba)(cairo_t* cr,
|
||||||
|
double red,
|
||||||
|
double green,
|
||||||
|
double blue,
|
||||||
|
double alpha);
|
||||||
|
void (*cairo_set_source_rgb)(cairo_t* cr,
|
||||||
|
double red,
|
||||||
|
double green,
|
||||||
|
double blue);
|
||||||
|
void (*cairo_reset_clip)(cairo_t* cr);
|
||||||
|
unsigned char* (*cairo_image_surface_get_data)(cairo_surface_t* surface);
|
||||||
|
void (*cairo_line_to)(cairo_t* cr,
|
||||||
|
double x,
|
||||||
|
double y);
|
||||||
|
cairo_status_t (*cairo_surface_write_to_png)(cairo_surface_t* surface, const char* filename);
|
||||||
|
void (*cairo_surface_destroy)(cairo_surface_t* surface);
|
||||||
|
cairo_surface_t* (*cairo_image_surface_create_for_data)(unsigned char* data,
|
||||||
|
cairo_format_t format,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
int stride);
|
||||||
|
cairo_surface_t* (*cairo_image_surface_create)(cairo_format_t format,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
void (*cairo_destroy)(cairo_t* cr);
|
||||||
|
cairo_pattern_t* (*cairo_get_source)(cairo_t* cr);
|
||||||
|
void (*cairo_close_path)(cairo_t* cr);
|
||||||
|
void (*cairo_paint)(cairo_t* cr);
|
||||||
|
void (*cairo_surface_flush)(cairo_surface_t* surface);
|
||||||
|
void (*cairo_clip)(cairo_t* cr);
|
||||||
|
void (*cairo_save)(cairo_t* cr);
|
||||||
|
void (*cairo_restore)(cairo_t* cr);
|
||||||
|
void (*cairo_surface_mark_dirty)(cairo_surface_t* surface);
|
||||||
|
void (*cairo_stroke)(cairo_t* cr);
|
||||||
|
void (*cairo_set_source_surface)(cairo_t* cr,
|
||||||
|
cairo_surface_t* surface,
|
||||||
|
double x,
|
||||||
|
double y);
|
||||||
|
void (*cairo_fill)(cairo_t* cr);
|
||||||
|
void (*cairo_pattern_set_filter)(cairo_pattern_t* pattern,
|
||||||
|
cairo_filter_t filter);
|
||||||
|
void (*cairo_set_antialias)(cairo_t*, cairo_antialias_t);
|
||||||
|
void (*cairo_set_operator)(cairo_t* cr, cairo_operator_t op);
|
||||||
|
|
||||||
|
} cairo_call_table_t;
|
||||||
|
|
||||||
|
extern cairo_call_table_t cairo_call_tbl;
|
||||||
|
|
||||||
|
/* defined inline right here so that it doesn't conflict with the other macros */
|
||||||
|
MwInline int cairo_load_funcs() {
|
||||||
|
#ifdef __APPLE__
|
||||||
|
cairo_call_tbl.cairo_lib = MwDynamicOpen("libcairo.dylib");
|
||||||
|
#else
|
||||||
|
cairo_call_tbl.cairo_lib = MwDynamicOpen("libcairo.so");
|
||||||
|
#endif
|
||||||
|
if(!cairo_call_tbl.cairo_lib) {
|
||||||
|
printf("(libcairo not found, cannot use Wayland or Cairo backend.)\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CAIRO_FUNC(x) \
|
||||||
|
cairo_call_tbl.x = MwDynamicSymbol(cairo_call_tbl.cairo_lib, #x); \
|
||||||
|
if(!cairo_call_tbl.x) { \
|
||||||
|
printf("WARNING: Could use Wayland/Cairo backend if " #x " was not found. Do you have libcairo?\n"); \
|
||||||
|
return 1; \
|
||||||
|
};
|
||||||
|
|
||||||
|
CAIRO_FUNC(cairo_set_line_width);
|
||||||
|
CAIRO_FUNC(cairo_scale);
|
||||||
|
CAIRO_FUNC(cairo_create);
|
||||||
|
CAIRO_FUNC(cairo_move_to);
|
||||||
|
CAIRO_FUNC(cairo_rectangle);
|
||||||
|
CAIRO_FUNC(cairo_new_path);
|
||||||
|
CAIRO_FUNC(cairo_set_line_cap);
|
||||||
|
CAIRO_FUNC(cairo_set_antialias);
|
||||||
|
CAIRO_FUNC(cairo_set_source_rgba);
|
||||||
|
CAIRO_FUNC(cairo_set_source_rgb);
|
||||||
|
CAIRO_FUNC(cairo_reset_clip);
|
||||||
|
CAIRO_FUNC(cairo_image_surface_get_data);
|
||||||
|
CAIRO_FUNC(cairo_line_to);
|
||||||
|
CAIRO_FUNC(cairo_surface_write_to_png);
|
||||||
|
CAIRO_FUNC(cairo_surface_destroy);
|
||||||
|
CAIRO_FUNC(cairo_image_surface_create_for_data);
|
||||||
|
CAIRO_FUNC(cairo_image_surface_create);
|
||||||
|
CAIRO_FUNC(cairo_destroy);
|
||||||
|
CAIRO_FUNC(cairo_get_source);
|
||||||
|
CAIRO_FUNC(cairo_close_path);
|
||||||
|
CAIRO_FUNC(cairo_paint);
|
||||||
|
CAIRO_FUNC(cairo_surface_flush);
|
||||||
|
CAIRO_FUNC(cairo_clip);
|
||||||
|
CAIRO_FUNC(cairo_save);
|
||||||
|
CAIRO_FUNC(cairo_restore);
|
||||||
|
CAIRO_FUNC(cairo_surface_mark_dirty);
|
||||||
|
CAIRO_FUNC(cairo_stroke);
|
||||||
|
CAIRO_FUNC(cairo_set_source_surface);
|
||||||
|
CAIRO_FUNC(cairo_fill);
|
||||||
|
CAIRO_FUNC(cairo_set_operator);
|
||||||
|
CAIRO_FUNC(cairo_pattern_set_filter);
|
||||||
|
#undef CAIRO_FUNC
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define cairo_set_line_width cairo_call_tbl.cairo_set_line_width
|
||||||
|
#define cairo_scale cairo_call_tbl.cairo_scale
|
||||||
|
#define cairo_create cairo_call_tbl.cairo_create
|
||||||
|
#define cairo_move_to cairo_call_tbl.cairo_move_to
|
||||||
|
#define cairo_rectangle cairo_call_tbl.cairo_rectangle
|
||||||
|
#define cairo_new_path cairo_call_tbl.cairo_new_path
|
||||||
|
#define cairo_set_line_cap cairo_call_tbl.cairo_set_line_cap
|
||||||
|
#define cairo_set_antialias cairo_call_tbl.cairo_set_antialias
|
||||||
|
#define cairo_set_source_rgba cairo_call_tbl.cairo_set_source_rgba
|
||||||
|
#define cairo_set_source_rgb cairo_call_tbl.cairo_set_source_rgb
|
||||||
|
#define cairo_reset_clip cairo_call_tbl.cairo_reset_clip
|
||||||
|
#define cairo_image_surface_get_data cairo_call_tbl.cairo_image_surface_get_data
|
||||||
|
#define cairo_line_to cairo_call_tbl.cairo_line_to
|
||||||
|
#define cairo_surface_write_to_png cairo_call_tbl.cairo_surface_write_to_png
|
||||||
|
#define cairo_surface_destroy cairo_call_tbl.cairo_surface_destroy
|
||||||
|
#define cairo_image_surface_create_for_data cairo_call_tbl.cairo_image_surface_create_for_data
|
||||||
|
#define cairo_image_surface_create cairo_call_tbl.cairo_image_surface_create
|
||||||
|
#define cairo_destroy cairo_call_tbl.cairo_destroy
|
||||||
|
#define cairo_get_source cairo_call_tbl.cairo_get_source
|
||||||
|
#define cairo_close_path cairo_call_tbl.cairo_close_path
|
||||||
|
#define cairo_paint cairo_call_tbl.cairo_paint
|
||||||
|
#define cairo_surface_flush cairo_call_tbl.cairo_surface_flush
|
||||||
|
#define cairo_clip cairo_call_tbl.cairo_clip
|
||||||
|
#define cairo_save cairo_call_tbl.cairo_save
|
||||||
|
#define cairo_restore cairo_call_tbl.cairo_restore
|
||||||
|
#define cairo_surface_mark_dirty cairo_call_tbl.cairo_surface_mark_dirty
|
||||||
|
#define cairo_stroke cairo_call_tbl.cairo_stroke
|
||||||
|
#define cairo_set_source_surface cairo_call_tbl.cairo_set_source_surface
|
||||||
|
#define cairo_fill cairo_call_tbl.cairo_fill
|
||||||
|
#define cairo_set_operator cairo_call_tbl.cairo_set_operator
|
||||||
|
#define cairo_pattern_set_filter cairo_call_tbl.cairo_pattern_set_filter
|
||||||
|
|
||||||
|
struct _MwLLCairo {
|
||||||
|
struct _MwLLCommon common;
|
||||||
|
|
||||||
|
cairo_surface_t* front_cs;
|
||||||
|
cairo_surface_t* back_cs;
|
||||||
|
cairo_t* front_cairo;
|
||||||
|
cairo_t* back_cairo;
|
||||||
|
/* The cairo to actually use for draw operations. Typically is front_cairo, but wayland's MwLLBeginDraw can change this to the back_cairo so it can be used to draw window decorations. */
|
||||||
|
cairo_t* selected_cairo;
|
||||||
|
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
|
||||||
|
MwBool toplevel;
|
||||||
|
MwLL parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLCairoColor {
|
||||||
|
struct _MwLLCommonColor common;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLCairoPixmap {
|
||||||
|
struct _MwLLCommonPixmap common;
|
||||||
|
|
||||||
|
cairo_surface_t* cs;
|
||||||
|
};
|
||||||
|
|
||||||
|
void MwLLCairoFrontSetup(struct _MwLLCairo* cairo, MwU8* data, MwU32 width, MwU32 height);
|
||||||
|
void MwLLCairoBackSetup(struct _MwLLCairo* cairo, MwU8* data, MwU32 width, MwU32 height);
|
||||||
|
void MwLLCairoFrontDestroy(struct _MwLLCairo* cairo);
|
||||||
|
void MwLLCairoBackDestroy(struct _MwLLCairo* cairo);
|
||||||
|
void MwLLCairoPolygon(struct _MwLLCairo handle, MwPoint* points, int points_count, MwLLColor color);
|
||||||
|
void MwLLCairoLine(struct _MwLLCairo handle, MwPoint* points, MwLLColor color);
|
||||||
|
MwLLPixmap MwLLCairoCreatePixmap(struct _MwLLCairo handle, unsigned char* data, int width, int height);
|
||||||
|
void MwLLCairoPixmapUpdate(MwLLPixmap handle);
|
||||||
|
void MwLLCairoDestroyPixmap(MwLLPixmap pixmap);
|
||||||
|
void MwLLCairoDrawPixmap(struct _MwLLCairo handle, MwRect* rect, MwLLPixmap pixmap);
|
||||||
|
|
||||||
|
void MwLLCairoDestroy(struct _MwLLCairo handle);
|
||||||
|
|
||||||
|
#endif
|
||||||
43
include/Mw/LowLevel/ClassicMacOS.h
Normal file
43
include/Mw/LowLevel/ClassicMacOS.h
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/LowLevel/ClassicMacOS.h
|
||||||
|
* @brief ClassicMacOS Backend
|
||||||
|
* @warning This is used internally
|
||||||
|
*/
|
||||||
|
#ifndef __MW_LOWLEVEL_ClassicMacOS_H__
|
||||||
|
#define __MW_LOWLEVEL_ClassicMacOS_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/LowLevel.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOS {
|
||||||
|
struct _MwLLCommon common;
|
||||||
|
|
||||||
|
MwLL parent;
|
||||||
|
|
||||||
|
WindowRef window;
|
||||||
|
ControlHandle control;
|
||||||
|
EventRecord event;
|
||||||
|
Rect winRect;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOSColor {
|
||||||
|
struct _MwLLCommonColor common;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOSPixmap {
|
||||||
|
struct _MwLLCommonPixmap common;
|
||||||
|
BitMap bmp;
|
||||||
|
};
|
||||||
|
|
||||||
|
MWDECL int MwLLClassicMacOSCallInit(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -10,17 +10,34 @@
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
enum {
|
||||||
|
COCOA_DRAW_COMMAND_POLY = 0,
|
||||||
|
COCOA_DRAW_COMMAND_LINES,
|
||||||
|
COCOA_DRAW_COMMAND_PIXMAP,
|
||||||
|
} type;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
MwPoint* points;
|
||||||
|
int points_count;
|
||||||
|
struct _MwLLCommonColor color;
|
||||||
|
} poly;
|
||||||
|
struct {
|
||||||
|
MwPoint* points;
|
||||||
|
struct _MwLLCommonColor color;
|
||||||
|
} lines;
|
||||||
|
struct {
|
||||||
|
MwRect rect;
|
||||||
|
MwLLPixmap pixmap;
|
||||||
|
} pixmap;
|
||||||
|
};
|
||||||
|
} draw_command;
|
||||||
|
|
||||||
#ifdef __OBJC__
|
#ifdef __OBJC__
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <Foundation/NSGeometry.h>
|
#import <Foundation/NSGeometry.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#import <CoreServices/CoreServices.h>
|
|
||||||
#else
|
|
||||||
#import <CoreGraphics/CoreGraphics.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface MilskoCocoaApplication : NSApplication {
|
@interface MilskoCocoaApplication : NSApplication {
|
||||||
MwBool doPending;
|
MwBool doPending;
|
||||||
}
|
}
|
||||||
|
|
@ -40,9 +57,9 @@
|
||||||
|
|
||||||
// Note: implements NSWindowDelegate
|
// Note: implements NSWindowDelegate
|
||||||
@interface MilskoCocoaWindowDelegate : NSObject {
|
@interface MilskoCocoaWindowDelegate : NSObject {
|
||||||
MilskoCocoaWindow* w;
|
NSWindow* w;
|
||||||
}
|
}
|
||||||
- (MilskoCocoaWindowDelegate*)initWithWin:(MilskoCocoaWindow*)win;
|
- (MilskoCocoaWindowDelegate*)initWithWin:(NSWindow*)win;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -67,6 +84,7 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MilskoCocoaPixmap : NSObject {
|
@interface MilskoCocoaPixmap : NSObject {
|
||||||
|
@public
|
||||||
MwBool valid;
|
MwBool valid;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
@ -86,33 +104,27 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MilskoCocoaView : NSView {
|
@interface MilskoCocoaView : NSView {
|
||||||
NSBitmapImageRep* rep;
|
MwBool _child;
|
||||||
NSGraphicsContext* context;
|
|
||||||
MwBool valid;
|
@public
|
||||||
CGColorSpaceRef space;
|
draw_command* commands;
|
||||||
CGDataProviderRef provider;
|
|
||||||
NSRect givenRect;
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
MwBool _child;
|
|
||||||
IBOutlet NSViewController* viewController;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initRepAndContextWithWidth:(float)w Height:(float)h;
|
|
||||||
- (NSGraphicsContext*)context;
|
|
||||||
- (void)destroy;
|
- (void)destroy;
|
||||||
- (NSBitmapImageRep*)getRep;
|
|
||||||
- (void)setChild;
|
- (void)setChild;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface MilskoCocoaSubView : MilskoCocoaView {
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MilskoCocoa : NSObject {
|
@interface MilskoCocoa : NSObject {
|
||||||
|
@public
|
||||||
MilskoCocoaApplication* application;
|
MilskoCocoaApplication* application;
|
||||||
MwBool _forceRender;
|
MwBool _forceRender;
|
||||||
MwBool _eventsPending;
|
MwBool _eventsPending;
|
||||||
MilskoCocoaWindow* window;
|
MwBool isClosing;
|
||||||
|
NSWindow* window;
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
MilskoCocoaView* view;
|
MilskoCocoaView* view;
|
||||||
MwLL parent;
|
MwLL parent;
|
||||||
|
|
@ -126,55 +138,21 @@
|
||||||
|
|
||||||
MwBool pointerLocked;
|
MwBool pointerLocked;
|
||||||
MwBool mouseMoved;
|
MwBool mouseMoved;
|
||||||
}
|
|
||||||
|
|
||||||
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
MwBool rejectFirstTest;
|
||||||
x:(int)x
|
}
|
||||||
y:(int)y
|
|
||||||
width:(int)width
|
|
||||||
height:(int)height
|
|
||||||
handle:(MwLL)handle;
|
|
||||||
- (void)polygonWithPoints:(MwPoint*)points
|
|
||||||
points_count:(int)points_count
|
|
||||||
color:(MwLLColor)color;
|
|
||||||
- (void)lineWithPoints:(MwPoint*)points color:(MwLLColor)color;
|
|
||||||
- (void)getX:(int*)x Y:(int*)y W:(unsigned int*)w H:(unsigned int*)h;
|
|
||||||
- (void)setX:(int)x Y:(int)y;
|
|
||||||
- (void)setW:(int)w H:(int)h;
|
|
||||||
- (int)pending;
|
|
||||||
- (void)getNextEvent;
|
|
||||||
- (void)setTitle:(const char*)title;
|
|
||||||
- (void)drawPixmap:(MwLLPixmap)pixmap rect:(MwRect*)rect;
|
|
||||||
- (void)setIcon:(MwLLPixmap)pixmap;
|
|
||||||
- (void)forceRender;
|
|
||||||
- (void)setCursor:(MwCursor*)image mask:(MwCursor*)mask;
|
|
||||||
- (void)detachWithPoint:(MwPoint*)point;
|
|
||||||
- (void)show:(int)show;
|
|
||||||
- (void)makePopupWithParent:(MwLL)parent;
|
|
||||||
- (void)setSizeHintsWithMinX:(int)minx
|
|
||||||
MinY:(int)miny
|
|
||||||
MaxX:(int)maxx
|
|
||||||
MaxY:(int)maxy;
|
|
||||||
- (void)makeBorderless:(int)toggle;
|
|
||||||
- (void)focus;
|
|
||||||
- (void)grabPointer:(int)toggle;
|
|
||||||
- (void)setClipboard:(const char*)text;
|
|
||||||
- (void)makeToolWindow;
|
|
||||||
- (void)getCursorCoord:(MwPoint*)point;
|
|
||||||
- (void)getScreenSize:(MwRect*)rect;
|
|
||||||
- (void)destroy;
|
- (void)destroy;
|
||||||
- (void)sendClipboardEvent;
|
- (void)sendClipboardEvent;
|
||||||
|
|
||||||
- (MwLL)getParent;
|
- (MwLL)getParent;
|
||||||
- (NSView*)getView;
|
- (NSView*)getView;
|
||||||
- (MilskoCocoaWindow*)getWindow;
|
- (NSWindow*)getWindow;
|
||||||
- (void)nudge;
|
- (void)nudge;
|
||||||
|
|
||||||
- (void)pushCursor;
|
- (void)pushCursor;
|
||||||
- (void)popCursor;
|
- (void)popCursor;
|
||||||
|
|
||||||
- (MilskoFakePointer*)getHandle;
|
- (MilskoFakePointer*)getHandle;
|
||||||
+ (void)eventCanceller:(MilskoCocoa*)this;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
#define OBJC(x) x
|
#define OBJC(x) x
|
||||||
|
|
@ -182,7 +160,9 @@
|
||||||
#define OBJC(x) void*
|
#define OBJC(x) void*
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MWDECL int MwLLCocoaCallInit(void);
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _MwLLCocoa {
|
struct _MwLLCocoa {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
|
|
@ -200,4 +180,10 @@ struct _MwLLCocoaPixmap {
|
||||||
real;
|
real;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MWDECL int MwLLCocoaCallInit(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
#include <Mw/LowLevel.h>
|
#include <Mw/LowLevel.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _MwLLGDI {
|
struct _MwLLGDI {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
|
|
||||||
|
|
@ -19,6 +23,8 @@ struct _MwLLGDI {
|
||||||
HCURSOR cursor;
|
HCURSOR cursor;
|
||||||
HICON icon;
|
HICON icon;
|
||||||
|
|
||||||
|
HRGN clip;
|
||||||
|
|
||||||
int grabbed;
|
int grabbed;
|
||||||
int force_render;
|
int force_render;
|
||||||
int get_clipboard;
|
int get_clipboard;
|
||||||
|
|
@ -43,4 +49,8 @@ struct _MwLLGDIPixmap {
|
||||||
MWDECL int MwLLGDICallInit(void);
|
MWDECL int MwLLGDICallInit(void);
|
||||||
MWDECL HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask);
|
MWDECL HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
173
include/Mw/LowLevel/Haiku.h
Normal file
173
include/Mw/LowLevel/Haiku.h
Normal file
|
|
@ -0,0 +1,173 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/LowLevel/Haiku.h
|
||||||
|
* @brief Haiku Backend
|
||||||
|
* @warning This is used internally
|
||||||
|
*/
|
||||||
|
#ifndef __MW_LOWLEVEL_HAIKU_H__
|
||||||
|
#define __MW_LOWLEVEL_HAIKU_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/LowLevel.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
class MwApplication;
|
||||||
|
class MwView;
|
||||||
|
class MwWindow;
|
||||||
|
|
||||||
|
class MwApplication : public BApplication {
|
||||||
|
public:
|
||||||
|
MwApplication(MwRect rc, MwLL handle);
|
||||||
|
~MwApplication();
|
||||||
|
|
||||||
|
void MessageReceived(BMessage* message);
|
||||||
|
};
|
||||||
|
|
||||||
|
class MwView : public BView {
|
||||||
|
public:
|
||||||
|
MwLL handle;
|
||||||
|
BLocker* locker;
|
||||||
|
uint32 buttons;
|
||||||
|
BBitmap* bitmap;
|
||||||
|
|
||||||
|
MwView(MwLL handle, BRect rc, uint32 resizingMode, uint32 flags);
|
||||||
|
~MwView();
|
||||||
|
|
||||||
|
void MessageReceived(BMessage* message);
|
||||||
|
void PostMessage(BMessage* message);
|
||||||
|
void PostMessage(uint32 command);
|
||||||
|
status_t SendMessage(BMessage* message);
|
||||||
|
status_t SendMessage(uint32 command);
|
||||||
|
void Invalidate();
|
||||||
|
|
||||||
|
void AttachedToWindow();
|
||||||
|
void Draw(BRect updateRect);
|
||||||
|
void FrameResized(float width, float height);
|
||||||
|
void MouseDown(BPoint point);
|
||||||
|
void MouseUp(BPoint point);
|
||||||
|
void MouseMoved(BPoint point, uint32 transit, const BMessage* message);
|
||||||
|
|
||||||
|
void SetColor(MwLLColor color);
|
||||||
|
};
|
||||||
|
|
||||||
|
class MwWindow : public BWindow {
|
||||||
|
public:
|
||||||
|
MwWindow(BRect rc, window_type type, uint32 flags);
|
||||||
|
|
||||||
|
void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
|
void FrameMoved(BPoint newLocation);
|
||||||
|
bool QuitRequested();
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef BBitmap MwBBitmap;
|
||||||
|
#else
|
||||||
|
typedef void MwApplication;
|
||||||
|
typedef void MwView;
|
||||||
|
typedef void MwWindow;
|
||||||
|
typedef void MwBBitmap;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef union _MwLLHaikuEvent MwLLHaikuEvent;
|
||||||
|
|
||||||
|
enum BAPP_MW_WHAT {
|
||||||
|
BAPP_MW_DESTROY = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
enum BVIEW_MW_WHAT {
|
||||||
|
BVIEW_MW_DESTROY = 0,
|
||||||
|
BVIEW_MW_DETACH,
|
||||||
|
BVIEW_MW_RESIZE,
|
||||||
|
BVIEW_MW_MOVE,
|
||||||
|
BVIEW_MW_SHOW,
|
||||||
|
BVIEW_MW_HIDE,
|
||||||
|
BVIEW_MW_SET_COLOR,
|
||||||
|
BVIEW_MW_POLYGON,
|
||||||
|
BVIEW_MW_LINE,
|
||||||
|
BVIEW_MW_BITMAP,
|
||||||
|
BVIEW_MW_RENDER,
|
||||||
|
BVIEW_MW_RAISE,
|
||||||
|
BVIEW_MW_GET_MOUSE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum BWIN_MW_WHAT {
|
||||||
|
BWIN_MW_DESTROY = 0,
|
||||||
|
BWIN_MW_SET_TITLE,
|
||||||
|
BWIN_MW_SET_TYPE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MwLLHAIKU_EVENT {
|
||||||
|
MwLLHAIKU_EVENT_DRAW = 0,
|
||||||
|
MwLLHAIKU_EVENT_CLOSE,
|
||||||
|
MwLLHAIKU_EVENT_FRAMERESIZED,
|
||||||
|
MwLLHAIKU_EVENT_FRAMEMOVED,
|
||||||
|
MwLLHAIKU_EVENT_MOUSEDOWN,
|
||||||
|
MwLLHAIKU_EVENT_MOUSEUP,
|
||||||
|
MwLLHAIKU_EVENT_MOUSEMOVED
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaikuEventMouse {
|
||||||
|
int type;
|
||||||
|
MwPoint point;
|
||||||
|
int button;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaikuEventFrameResized {
|
||||||
|
int type;
|
||||||
|
float width;
|
||||||
|
float height;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaikuEventFrameMoved {
|
||||||
|
int type;
|
||||||
|
MwPoint point;
|
||||||
|
};
|
||||||
|
|
||||||
|
union _MwLLHaikuEvent {
|
||||||
|
int type;
|
||||||
|
struct _MwLLHaikuEventMouse mouse;
|
||||||
|
struct _MwLLHaikuEventFrameResized frame_resized;
|
||||||
|
struct _MwLLHaikuEventFrameMoved frame_moved;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaiku {
|
||||||
|
struct _MwLLCommon common;
|
||||||
|
|
||||||
|
int type;
|
||||||
|
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
|
||||||
|
MwLL parent;
|
||||||
|
MwApplication* app;
|
||||||
|
MwWindow* window;
|
||||||
|
MwView* view;
|
||||||
|
thread_id app_thread;
|
||||||
|
int force_render;
|
||||||
|
|
||||||
|
MwLLHaikuEvent* events;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaikuColor {
|
||||||
|
struct _MwLLCommonColor common;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLHaikuPixmap {
|
||||||
|
struct _MwLLCommonPixmap common;
|
||||||
|
|
||||||
|
MwBBitmap* bitmap;
|
||||||
|
};
|
||||||
|
|
||||||
|
MWDECL int MwLLHaikuCallInit(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* @file Mw/LowLevel/Wayland.h
|
* @file Mw/LowLevel/Wayland.h
|
||||||
* @brief Work in progress Wayland Backend
|
* @brief Wayland Backend
|
||||||
* @warning This is used internally.
|
* @warning This is used internally.
|
||||||
* @warning This is disabled by default.
|
|
||||||
*/
|
*/
|
||||||
#ifndef __MW_LOWLEVEL_WAYLAND_H__
|
#ifndef __MW_LOWLEVEL_WAYLAND_H__
|
||||||
#define __MW_LOWLEVEL_WAYLAND_H__
|
#define __MW_LOWLEVEL_WAYLAND_H__
|
||||||
|
|
@ -12,16 +11,25 @@
|
||||||
#include <Mw/LowLevel.h>
|
#include <Mw/LowLevel.h>
|
||||||
#include <Mw/Abstract/Dynamic.h>
|
#include <Mw/Abstract/Dynamic.h>
|
||||||
|
|
||||||
|
#include <Mw/LowLevel/Cairo.h>
|
||||||
|
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
#include <cairo/cairo.h>
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
MWDECL int MwLLWaylandCallInit(void);
|
MWDECL int MwLLWaylandCallInit(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSD_BORDER_FRAME_LEFT 5
|
#define CSD_BORDER_FRAME_LEFT 5
|
||||||
#define CSD_BORDER_FRAME_RIGHT 5
|
#define CSD_BORDER_FRAME_RIGHT 5
|
||||||
#define CSD_BORDER_FRAME_TOP 24
|
#define CSD_BORDER_FRAME_TOP 23
|
||||||
#define CSD_BORDER_FRAME_BOTTOM 5
|
#define CSD_BORDER_FRAME_BOTTOM 4
|
||||||
|
|
||||||
struct _MwLLWayland;
|
struct _MwLLWayland;
|
||||||
|
|
||||||
|
|
@ -35,10 +43,12 @@ struct _MwLLWayland;
|
||||||
typedef struct wayland_call_table {
|
typedef struct wayland_call_table {
|
||||||
void* lib;
|
void* lib;
|
||||||
void* xkb_lib;
|
void* xkb_lib;
|
||||||
void* cairo_lib;
|
#ifdef USE_DBUS
|
||||||
#if WAYLAND_LOAD_OPENGL
|
MwLLDBusFuncTable dbus;
|
||||||
|
MwBool has_dbus;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int (*wl_display_dispatch)(struct wl_display* display);
|
||||||
int (*wl_display_dispatch_pending)(struct wl_display* display);
|
int (*wl_display_dispatch_pending)(struct wl_display* display);
|
||||||
void (*wl_display_disconnect)(struct wl_display* display);
|
void (*wl_display_disconnect)(struct wl_display* display);
|
||||||
void (*wl_display_cancel_read)(struct wl_display* display);
|
void (*wl_display_cancel_read)(struct wl_display* display);
|
||||||
|
|
@ -56,6 +66,8 @@ typedef struct wayland_call_table {
|
||||||
uint32_t flags, ...);
|
uint32_t flags, ...);
|
||||||
struct wl_display* (*wl_display_connect)(const char* name);
|
struct wl_display* (*wl_display_connect)(const char* name);
|
||||||
uint32_t (*wl_proxy_get_version)(struct wl_proxy* proxy);
|
uint32_t (*wl_proxy_get_version)(struct wl_proxy* proxy);
|
||||||
|
struct wl_display* (*wl_display_connect_to_fd)(int fd);
|
||||||
|
int (*wl_display_get_error)(struct wl_display* display);
|
||||||
|
|
||||||
struct xkb_context* (*xkb_context_new)(enum xkb_context_flags flags);
|
struct xkb_context* (*xkb_context_new)(enum xkb_context_flags flags);
|
||||||
void (*xkb_context_unref)(struct xkb_context* context);
|
void (*xkb_context_unref)(struct xkb_context* context);
|
||||||
|
|
@ -67,85 +79,38 @@ typedef struct wayland_call_table {
|
||||||
xkb_layout_index_t (*xkb_state_key_get_layout)(struct xkb_state* state, xkb_keycode_t key);
|
xkb_layout_index_t (*xkb_state_key_get_layout)(struct xkb_state* state, xkb_keycode_t key);
|
||||||
void (*xkb_keymap_unref)(struct xkb_keymap* keymap);
|
void (*xkb_keymap_unref)(struct xkb_keymap* keymap);
|
||||||
|
|
||||||
void (*cairo_set_line_width)(cairo_t* cr,
|
|
||||||
double width);
|
|
||||||
void (*cairo_scale)(cairo_t* cr,
|
|
||||||
double sx,
|
|
||||||
double sy);
|
|
||||||
cairo_t* (*cairo_create)(cairo_surface_t* target);
|
|
||||||
void (*cairo_move_to)(cairo_t* cr,
|
|
||||||
double x,
|
|
||||||
double y);
|
|
||||||
|
|
||||||
void (*cairo_rectangle)(cairo_t* cr,
|
|
||||||
double x,
|
|
||||||
double y,
|
|
||||||
double width,
|
|
||||||
double height);
|
|
||||||
void (*cairo_new_path)(cairo_t* cr);
|
|
||||||
void (*cairo_set_line_cap)(cairo_t* cr,
|
|
||||||
cairo_line_cap_t line_cap);
|
|
||||||
void (*cairo_set_source_rgba)(cairo_t* cr,
|
|
||||||
double red,
|
|
||||||
double green,
|
|
||||||
double blue,
|
|
||||||
double alpha);
|
|
||||||
void (*cairo_set_source_rgb)(cairo_t* cr,
|
|
||||||
double red,
|
|
||||||
double green,
|
|
||||||
double blue);
|
|
||||||
void (*cairo_reset_clip)(cairo_t* cr);
|
|
||||||
unsigned char* (*cairo_image_surface_get_data)(cairo_surface_t* surface);
|
|
||||||
void (*cairo_line_to)(cairo_t* cr,
|
|
||||||
double x,
|
|
||||||
double y);
|
|
||||||
void (*cairo_surface_destroy)(cairo_surface_t* surface);
|
|
||||||
cairo_surface_t* (*cairo_image_surface_create_for_data)(unsigned char* data,
|
|
||||||
cairo_format_t format,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
int stride);
|
|
||||||
cairo_surface_t* (*cairo_image_surface_create)(cairo_format_t format,
|
|
||||||
int width,
|
|
||||||
int height);
|
|
||||||
void (*cairo_destroy)(cairo_t* cr);
|
|
||||||
cairo_pattern_t* (*cairo_get_source)(cairo_t* cr);
|
|
||||||
void (*cairo_close_path)(cairo_t* cr);
|
|
||||||
void (*cairo_paint)(cairo_t* cr);
|
|
||||||
void (*cairo_surface_flush)(cairo_surface_t* surface);
|
|
||||||
void (*cairo_clip)(cairo_t* cr);
|
|
||||||
void (*cairo_surface_mark_dirty)(cairo_surface_t* surface);
|
|
||||||
void (*cairo_stroke)(cairo_t* cr);
|
|
||||||
void (*cairo_set_source_surface)(cairo_t* cr,
|
|
||||||
cairo_surface_t* surface,
|
|
||||||
double x,
|
|
||||||
double y);
|
|
||||||
void (*cairo_fill)(cairo_t* cr);
|
|
||||||
void (*cairo_pattern_set_filter)(cairo_pattern_t* pattern,
|
|
||||||
cairo_filter_t filter);
|
|
||||||
void (*cairo_set_antialias)(cairo_t*, cairo_antialias_t);
|
|
||||||
|
|
||||||
} wayland_call_table_t;
|
} wayland_call_table_t;
|
||||||
|
|
||||||
extern wayland_call_table_t wl_call_tbl;
|
extern wayland_call_table_t wl_call_tbl;
|
||||||
extern MwBool MwWaylandAlwaysRender;
|
#ifdef MW_VULKAN
|
||||||
|
extern MwBool MwWaylandVulkan;
|
||||||
|
#else
|
||||||
|
#define MwWaylandVulkan 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MWDECL MwBool MwWaylandCairoOnly;
|
||||||
|
|
||||||
/* defined inline right here so that it doesn't conflict with the other macros */
|
/* defined inline right here so that it doesn't conflict with the other macros */
|
||||||
MwInline int wayland_load_funcs() {
|
MwInline int wayland_load_funcs() {
|
||||||
|
#ifdef __APPLE__
|
||||||
|
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.dylib");
|
||||||
|
#else
|
||||||
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.so");
|
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.so");
|
||||||
|
#endif
|
||||||
if(!wl_call_tbl.lib) {
|
if(!wl_call_tbl.lib) {
|
||||||
printf("(libwayland-client.so not found, falling back to X11)\n");
|
printf("(libwayland-client not found, falling back to X11)\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#ifdef __APPLE__
|
||||||
|
wl_call_tbl.xkb_lib = MwDynamicOpen("libxkbcommon.dylib");
|
||||||
|
#else
|
||||||
wl_call_tbl.xkb_lib = MwDynamicOpen("libxkbcommon.so");
|
wl_call_tbl.xkb_lib = MwDynamicOpen("libxkbcommon.so");
|
||||||
|
#endif
|
||||||
if(!wl_call_tbl.xkb_lib) {
|
if(!wl_call_tbl.xkb_lib) {
|
||||||
printf("(libxkbcommon.so not found, cannot use Wayland backend.)\n");
|
printf("(libxkbcommon not found, cannot use Wayland backend.)\n");
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
wl_call_tbl.cairo_lib = MwDynamicOpen("libcairo.so");
|
|
||||||
if(!wl_call_tbl.cairo_lib) {
|
|
||||||
printf("(libcairo.so not found, cannot use Wayland backend.)\n");
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WAYLAND_FUNC(x) \
|
#define WAYLAND_FUNC(x) \
|
||||||
wl_call_tbl.x = MwDynamicSymbol(wl_call_tbl.lib, #x); \
|
wl_call_tbl.x = MwDynamicSymbol(wl_call_tbl.lib, #x); \
|
||||||
if(!wl_call_tbl.x) { \
|
if(!wl_call_tbl.x) { \
|
||||||
|
|
@ -153,6 +118,7 @@ MwInline int wayland_load_funcs() {
|
||||||
return 1; \
|
return 1; \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
WAYLAND_FUNC(wl_display_dispatch)
|
||||||
WAYLAND_FUNC(wl_display_dispatch_pending)
|
WAYLAND_FUNC(wl_display_dispatch_pending)
|
||||||
WAYLAND_FUNC(wl_display_disconnect)
|
WAYLAND_FUNC(wl_display_disconnect)
|
||||||
WAYLAND_FUNC(wl_display_cancel_read)
|
WAYLAND_FUNC(wl_display_cancel_read)
|
||||||
|
|
@ -167,6 +133,8 @@ MwInline int wayland_load_funcs() {
|
||||||
WAYLAND_FUNC(wl_proxy_marshal_flags)
|
WAYLAND_FUNC(wl_proxy_marshal_flags)
|
||||||
WAYLAND_FUNC(wl_display_connect)
|
WAYLAND_FUNC(wl_display_connect)
|
||||||
WAYLAND_FUNC(wl_proxy_get_version)
|
WAYLAND_FUNC(wl_proxy_get_version)
|
||||||
|
WAYLAND_FUNC(wl_display_connect_to_fd)
|
||||||
|
WAYLAND_FUNC(wl_display_get_error)
|
||||||
|
|
||||||
#undef WAYLAND_FUNC
|
#undef WAYLAND_FUNC
|
||||||
|
|
||||||
|
|
@ -188,45 +156,18 @@ MwInline int wayland_load_funcs() {
|
||||||
XKB_FUNC(xkb_state_key_get_layout)
|
XKB_FUNC(xkb_state_key_get_layout)
|
||||||
#undef XKB_FUNC
|
#undef XKB_FUNC
|
||||||
|
|
||||||
#define CAIRO_FUNC(x) \
|
if(cairo_load_funcs() != 0) {
|
||||||
wl_call_tbl.x = MwDynamicSymbol(wl_call_tbl.cairo_lib, #x); \
|
return 1;
|
||||||
if(!wl_call_tbl.x) { \
|
}
|
||||||
printf("WARNING: Could use Wayland backend if " #x " was found. Do you have libcairo?\n"); \
|
|
||||||
return 1; \
|
|
||||||
};
|
|
||||||
|
|
||||||
CAIRO_FUNC(cairo_set_line_width);
|
#ifdef USE_DBUS
|
||||||
CAIRO_FUNC(cairo_scale);
|
wl_call_tbl.has_dbus = MwLLDBusFuncSetup(&wl_call_tbl.dbus);
|
||||||
CAIRO_FUNC(cairo_create);
|
#endif
|
||||||
CAIRO_FUNC(cairo_move_to);
|
|
||||||
CAIRO_FUNC(cairo_rectangle);
|
|
||||||
CAIRO_FUNC(cairo_new_path);
|
|
||||||
CAIRO_FUNC(cairo_set_line_cap);
|
|
||||||
CAIRO_FUNC(cairo_set_antialias);
|
|
||||||
CAIRO_FUNC(cairo_set_source_rgba);
|
|
||||||
CAIRO_FUNC(cairo_set_source_rgb);
|
|
||||||
CAIRO_FUNC(cairo_reset_clip);
|
|
||||||
CAIRO_FUNC(cairo_image_surface_get_data);
|
|
||||||
CAIRO_FUNC(cairo_line_to);
|
|
||||||
CAIRO_FUNC(cairo_surface_destroy);
|
|
||||||
CAIRO_FUNC(cairo_image_surface_create_for_data);
|
|
||||||
CAIRO_FUNC(cairo_image_surface_create);
|
|
||||||
CAIRO_FUNC(cairo_destroy);
|
|
||||||
CAIRO_FUNC(cairo_get_source);
|
|
||||||
CAIRO_FUNC(cairo_close_path);
|
|
||||||
CAIRO_FUNC(cairo_paint);
|
|
||||||
CAIRO_FUNC(cairo_surface_flush);
|
|
||||||
CAIRO_FUNC(cairo_clip);
|
|
||||||
CAIRO_FUNC(cairo_surface_mark_dirty);
|
|
||||||
CAIRO_FUNC(cairo_stroke);
|
|
||||||
CAIRO_FUNC(cairo_set_source_surface);
|
|
||||||
CAIRO_FUNC(cairo_fill);
|
|
||||||
CAIRO_FUNC(cairo_pattern_set_filter);
|
|
||||||
#undef CAIRO_FUNC
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define wl_display_dispatch wl_call_tbl.wl_display_dispatch
|
||||||
#define wl_display_dispatch_pending wl_call_tbl.wl_display_dispatch_pending
|
#define wl_display_dispatch_pending wl_call_tbl.wl_display_dispatch_pending
|
||||||
#define wl_display_disconnect wl_call_tbl.wl_display_disconnect
|
#define wl_display_disconnect wl_call_tbl.wl_display_disconnect
|
||||||
#define wl_display_cancel_read wl_call_tbl.wl_display_cancel_read
|
#define wl_display_cancel_read wl_call_tbl.wl_display_cancel_read
|
||||||
|
|
@ -241,6 +182,8 @@ MwInline int wayland_load_funcs() {
|
||||||
#define wl_proxy_marshal_flags wl_call_tbl.wl_proxy_marshal_flags
|
#define wl_proxy_marshal_flags wl_call_tbl.wl_proxy_marshal_flags
|
||||||
#define wl_display_connect wl_call_tbl.wl_display_connect
|
#define wl_display_connect wl_call_tbl.wl_display_connect
|
||||||
#define wl_proxy_get_version wl_call_tbl.wl_proxy_get_version
|
#define wl_proxy_get_version wl_call_tbl.wl_proxy_get_version
|
||||||
|
#define wl_display_connect_to_fd wl_call_tbl.wl_display_connect_to_fd
|
||||||
|
#define wl_display_get_error wl_call_tbl.wl_display_get_error
|
||||||
|
|
||||||
#define xkb_state_unref wl_call_tbl.xkb_state_unref
|
#define xkb_state_unref wl_call_tbl.xkb_state_unref
|
||||||
#define xkb_context_new wl_call_tbl.xkb_context_new
|
#define xkb_context_new wl_call_tbl.xkb_context_new
|
||||||
|
|
@ -252,34 +195,6 @@ MwInline int wayland_load_funcs() {
|
||||||
#define xkb_keymap_key_get_syms_by_level wl_call_tbl.xkb_keymap_key_get_syms_by_level
|
#define xkb_keymap_key_get_syms_by_level wl_call_tbl.xkb_keymap_key_get_syms_by_level
|
||||||
#define xkb_state_key_get_layout wl_call_tbl.xkb_state_key_get_layout
|
#define xkb_state_key_get_layout wl_call_tbl.xkb_state_key_get_layout
|
||||||
|
|
||||||
#define cairo_set_line_width wl_call_tbl.cairo_set_line_width
|
|
||||||
#define cairo_scale wl_call_tbl.cairo_scale
|
|
||||||
#define cairo_create wl_call_tbl.cairo_create
|
|
||||||
#define cairo_move_to wl_call_tbl.cairo_move_to
|
|
||||||
#define cairo_rectangle wl_call_tbl.cairo_rectangle
|
|
||||||
#define cairo_new_path wl_call_tbl.cairo_new_path
|
|
||||||
#define cairo_set_line_cap wl_call_tbl.cairo_set_line_cap
|
|
||||||
#define cairo_set_antialias wl_call_tbl.cairo_set_antialias
|
|
||||||
#define cairo_set_source_rgba wl_call_tbl.cairo_set_source_rgba
|
|
||||||
#define cairo_set_source_rgb wl_call_tbl.cairo_set_source_rgb
|
|
||||||
#define cairo_reset_clip wl_call_tbl.cairo_reset_clip
|
|
||||||
#define cairo_image_surface_get_data wl_call_tbl.cairo_image_surface_get_data
|
|
||||||
#define cairo_line_to wl_call_tbl.cairo_line_to
|
|
||||||
#define cairo_surface_destroy wl_call_tbl.cairo_surface_destroy
|
|
||||||
#define cairo_image_surface_create_for_data wl_call_tbl.cairo_image_surface_create_for_data
|
|
||||||
#define cairo_image_surface_create wl_call_tbl.cairo_image_surface_create
|
|
||||||
#define cairo_destroy wl_call_tbl.cairo_destroy
|
|
||||||
#define cairo_get_source wl_call_tbl.cairo_get_source
|
|
||||||
#define cairo_close_path wl_call_tbl.cairo_close_path
|
|
||||||
#define cairo_paint wl_call_tbl.cairo_paint
|
|
||||||
#define cairo_surface_flush wl_call_tbl.cairo_surface_flush
|
|
||||||
#define cairo_clip wl_call_tbl.cairo_clip
|
|
||||||
#define cairo_surface_mark_dirty wl_call_tbl.cairo_surface_mark_dirty
|
|
||||||
#define cairo_stroke wl_call_tbl.cairo_stroke
|
|
||||||
#define cairo_set_source_surface wl_call_tbl.cairo_set_source_surface
|
|
||||||
#define cairo_fill wl_call_tbl.cairo_fill
|
|
||||||
#define cairo_pattern_set_filter wl_call_tbl.cairo_pattern_set_filter
|
|
||||||
|
|
||||||
#ifndef WL_PROTOCOLS_DEFINED
|
#ifndef WL_PROTOCOLS_DEFINED
|
||||||
#define WL_PROTOCOLS_DEFINED
|
#define WL_PROTOCOLS_DEFINED
|
||||||
#include "Wayland/wayland-core-protocol.h"
|
#include "Wayland/wayland-core-protocol.h"
|
||||||
|
|
@ -291,6 +206,7 @@ MwInline int wayland_load_funcs() {
|
||||||
#include "Wayland/pointer-constraints-client-protocol.h"
|
#include "Wayland/pointer-constraints-client-protocol.h"
|
||||||
#include "Wayland/relative-pointer-client-protocol.h"
|
#include "Wayland/relative-pointer-client-protocol.h"
|
||||||
#include "Wayland/xdg-toplevel-icon-client-protocol.h"
|
#include "Wayland/xdg-toplevel-icon-client-protocol.h"
|
||||||
|
#include "Wayland/wlr-layer-shell-client-protocol.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct wayland_protocol {
|
typedef struct wayland_protocol {
|
||||||
|
|
@ -298,7 +214,7 @@ typedef struct wayland_protocol {
|
||||||
void* context;
|
void* context;
|
||||||
} wayland_protocol_t;
|
} wayland_protocol_t;
|
||||||
|
|
||||||
typedef wayland_protocol_t*(wl_setup_func)(MwU32, struct _MwLLWayland*);
|
typedef wayland_protocol_t*(wl_setup_func)(MwU32, struct _MwLLWayland*, MwU32 version);
|
||||||
typedef void(wl_destroy_func)(struct _MwLLWayland* wayland, wayland_protocol_t* data);
|
typedef void(wl_destroy_func)(struct _MwLLWayland* wayland, wayland_protocol_t* data);
|
||||||
|
|
||||||
typedef struct wayland_protocol_callback_table {
|
typedef struct wayland_protocol_callback_table {
|
||||||
|
|
@ -311,6 +227,7 @@ struct _MwLLWaylandTopLevel {
|
||||||
struct xdg_toplevel* xdg_top_level;
|
struct xdg_toplevel* xdg_top_level;
|
||||||
struct xdg_toplevel_listener xdg_toplevel_listener;
|
struct xdg_toplevel_listener xdg_toplevel_listener;
|
||||||
struct xdg_surface_listener xdg_surface_listener;
|
struct xdg_surface_listener xdg_surface_listener;
|
||||||
|
MwBool maxim_state;
|
||||||
|
|
||||||
MwBool compositor_created;
|
MwBool compositor_created;
|
||||||
MwBool xdg_wm_base_created;
|
MwBool xdg_wm_base_created;
|
||||||
|
|
@ -338,6 +255,10 @@ struct _MwLLWaylandPopup {
|
||||||
MwLL topmost_parent;
|
MwLL topmost_parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _MwLLWaylandLayerSurface {
|
||||||
|
struct zwlr_layer_surface_v1* surface;
|
||||||
|
};
|
||||||
|
|
||||||
/* Shared set of anything needed for a shm buffer. */
|
/* Shared set of anything needed for a shm buffer. */
|
||||||
struct _MwLLWaylandShmBuffer {
|
struct _MwLLWaylandShmBuffer {
|
||||||
struct wl_shm* shm;
|
struct wl_shm* shm;
|
||||||
|
|
@ -357,29 +278,30 @@ struct _MwLLWaylandShmBuffer {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum _MwLLWaylandType {
|
enum _MwLLWaylandType {
|
||||||
MWLL_WAYLAND_UNKNOWN = 0,
|
MwLL_WAYLAND_UNKNOWN = 0,
|
||||||
MWLL_WAYLAND_TOPLEVEL,
|
MwLL_WAYLAND_TOPLEVEL,
|
||||||
MWLL_WAYLAND_SUBLEVEL,
|
MwLL_WAYLAND_SUBLEVEL,
|
||||||
MWLL_WAYLAND_POPUP,
|
MwLL_WAYLAND_POPUP,
|
||||||
|
MwLL_WAYLAND_LAYER_SURFACE,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct wl_clipboard_device_context {
|
typedef struct wl_clipboard_device_context {
|
||||||
union {
|
struct {
|
||||||
struct wl_data_device* wl;
|
struct wl_data_device* wl;
|
||||||
struct zwp_primary_selection_device_v1* zwp;
|
struct zwp_primary_selection_device_v1* zwp;
|
||||||
} device;
|
} device;
|
||||||
union {
|
struct {
|
||||||
struct wl_data_offer* wl;
|
struct wl_data_offer* wl;
|
||||||
struct zwp_primary_selection_offer_v1* zwp;
|
struct zwp_primary_selection_offer_v1* zwp;
|
||||||
} offer;
|
} offer;
|
||||||
|
|
||||||
MwLL ll;
|
MwLL ll;
|
||||||
struct wl_seat* seat;
|
// struct wl_seat* seat;
|
||||||
MwU32 capabilities;
|
|
||||||
} wl_clipboard_device_context_t;
|
} wl_clipboard_device_context_t;
|
||||||
|
|
||||||
struct _MwLLWayland {
|
struct _MwLLWayland {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
|
struct _MwLLCairo cairo;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
/* Pointer for data that's only loaded if the widget is a toplevel */
|
/* Pointer for data that's only loaded if the widget is a toplevel */
|
||||||
|
|
@ -388,30 +310,42 @@ struct _MwLLWayland {
|
||||||
struct _MwLLWaylandSublevel* sublevel;
|
struct _MwLLWaylandSublevel* sublevel;
|
||||||
/* Pointer for data that's only loaded if the widget is a popup */
|
/* Pointer for data that's only loaded if the widget is a popup */
|
||||||
struct _MwLLWaylandPopup* popup;
|
struct _MwLLWaylandPopup* popup;
|
||||||
|
/* Pointer for data that's only loaded if the widget is a layer surface */
|
||||||
|
struct _MwLLWaylandLayerSurface* layer_surface;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum _MwLLWaylandType type;
|
enum _MwLLWaylandType type;
|
||||||
enum _MwLLWaylandType type_to_be;
|
enum _MwLLWaylandType type_to_be;
|
||||||
|
|
||||||
|
MwRect clipping_rect;
|
||||||
|
MwBool no;
|
||||||
|
|
||||||
|
MwBool changing;
|
||||||
MwBool detatching;
|
MwBool detatching;
|
||||||
MwPoint detach_point;
|
MwPoint detach_point;
|
||||||
|
|
||||||
MwBool did_initial_resize;
|
MwBool did_initial_resize;
|
||||||
|
|
||||||
|
MwBool is_toplevel;
|
||||||
|
|
||||||
|
MwBool is_clipping;
|
||||||
|
MwRect clip;
|
||||||
|
|
||||||
/* Map of Wayland interfaces to their relevant setup functions. */
|
/* Map of Wayland interfaces to their relevant setup functions. */
|
||||||
struct {
|
struct {
|
||||||
const char* key;
|
char* key;
|
||||||
wayland_protocol_callback_table_t* value;
|
wayland_protocol_callback_table_t* value;
|
||||||
}* wl_protocol_setup_map;
|
}* wl_protocol_setup_map;
|
||||||
|
|
||||||
/* Map of Wayland interfaces to any information we keep about them once we've registered them. */
|
/* Map of Wayland interfaces to any information we keep about them once we've registered them. */
|
||||||
struct {
|
struct {
|
||||||
const char* key;
|
char* key;
|
||||||
wayland_protocol_t* value;
|
wayland_protocol_t* value;
|
||||||
}* wl_protocol_map;
|
}* wl_protocol_map;
|
||||||
|
|
||||||
|
MwBool do_csd;
|
||||||
MwBool has_decorations;
|
MwBool has_decorations;
|
||||||
char title[255];
|
char title[256];
|
||||||
|
|
||||||
struct xkb_context* xkb_context;
|
struct xkb_context* xkb_context;
|
||||||
struct xkb_keymap* xkb_keymap;
|
struct xkb_keymap* xkb_keymap;
|
||||||
|
|
@ -433,11 +367,19 @@ struct _MwLLWayland {
|
||||||
struct zwp_relative_pointer_v1* relative_pointer;
|
struct zwp_relative_pointer_v1* relative_pointer;
|
||||||
struct zwp_locked_pointer_v1* locked_pointer;
|
struct zwp_locked_pointer_v1* locked_pointer;
|
||||||
MwBool pointer_constrained;
|
MwBool pointer_constrained;
|
||||||
|
MwBool valid;
|
||||||
|
|
||||||
|
#ifdef USE_DBUS
|
||||||
|
MwLLDBusContext dbus;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MwBool dark_theme_detection;
|
||||||
|
MwU32 dark_theme;
|
||||||
|
|
||||||
/* clipboard related stuff.
|
/* clipboard related stuff.
|
||||||
* Note that unlike most interfaces, we don't keep zwp_primary_selection stuff in a wayland_protocol_t because we use wl_data_device as a fallback and want to have it share memory space.*/
|
* Note that unlike most interfaces, we don't keep zwp_primary_selection stuff in a wayland_protocol_t because we use wl_data_device as a fallback and want to have it share memory space.*/
|
||||||
|
|
||||||
union {
|
struct {
|
||||||
struct wl_data_device_manager* wl;
|
struct wl_data_device_manager* wl;
|
||||||
struct zwp_primary_selection_device_manager_v1* zwp;
|
struct zwp_primary_selection_device_manager_v1* zwp;
|
||||||
} clipboard_manager;
|
} clipboard_manager;
|
||||||
|
|
@ -447,9 +389,11 @@ struct _MwLLWayland {
|
||||||
} clipboard_source;
|
} clipboard_source;
|
||||||
char* clipboard_buffer;
|
char* clipboard_buffer;
|
||||||
MwBool supports_zwp;
|
MwBool supports_zwp;
|
||||||
|
MwBool zwp_setup;
|
||||||
|
|
||||||
uint32_t clipboard_serial;
|
uint32_t clipboard_serial;
|
||||||
wl_clipboard_device_context_t** clipboard_devices;
|
wl_clipboard_device_context_t** clipboard_devices_wl;
|
||||||
|
wl_clipboard_device_context_t** clipboard_devices_zwp;
|
||||||
|
|
||||||
struct wl_pointer* pointer;
|
struct wl_pointer* pointer;
|
||||||
MwU32 pointer_serial;
|
MwU32 pointer_serial;
|
||||||
|
|
@ -470,6 +414,11 @@ struct _MwLLWayland {
|
||||||
MwI32 ox, oy;
|
MwI32 ox, oy;
|
||||||
MwU32 ww, wh; /* Window position */
|
MwU32 ww, wh; /* Window position */
|
||||||
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
||||||
|
MwLL currentlyHeldWidget;
|
||||||
|
MwLL focusedWidget;
|
||||||
|
|
||||||
|
int resizing;
|
||||||
|
int setting_wh;
|
||||||
|
|
||||||
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
||||||
|
|
||||||
|
|
@ -480,37 +429,89 @@ struct _MwLLWayland {
|
||||||
|
|
||||||
MwBool dispatching_resize;
|
MwBool dispatching_resize;
|
||||||
|
|
||||||
|
MwBool is_toplevel_menu;
|
||||||
|
|
||||||
struct _MwLLWaylandShmBuffer framebuffer;
|
struct _MwLLWaylandShmBuffer framebuffer;
|
||||||
struct _MwLLWaylandShmBuffer backbuffer;
|
struct _MwLLWaylandShmBuffer backbuffer;
|
||||||
struct _MwLLWaylandShmBuffer cursor;
|
struct _MwLLWaylandShmBuffer cursor;
|
||||||
struct _MwLLWaylandShmBuffer* icon;
|
struct _MwLLWaylandShmBuffer* icon;
|
||||||
|
|
||||||
/*
|
MwLLPixmap icon_pixmap;
|
||||||
Events mutex. Any time a keyboard/mouse event happens, we try to lock this for 100 milliseconds, then give up if we can't do it. This is used in conjunction with some code in the MwLLDestroyImpl to make sure that destroy is NEVER interferes with an ongoing event.
|
|
||||||
|
|
||||||
IOI_XD: This sounds like a hilariously rare edge case, so it's almost funnier that this happened with 100% certainty for me and I spent day(s) trying to figure out what was happening. */
|
|
||||||
pthread_mutex_t eventsMutex;
|
pthread_mutex_t eventsMutex;
|
||||||
|
|
||||||
|
int cancelEvent;
|
||||||
|
int numCallbacksRunning;
|
||||||
|
|
||||||
uint32_t last_time;
|
uint32_t last_time;
|
||||||
|
|
||||||
MwBool moving;
|
MwBool moving;
|
||||||
|
|
||||||
cairo_surface_t* front_cs;
|
MwI64 keyboard_rate;
|
||||||
cairo_surface_t* back_cs;
|
MwI32 keyboard_delay;
|
||||||
cairo_t* front_cairo;
|
int last_pressed_key;
|
||||||
cairo_t* back_cairo;
|
MwBool holding_key;
|
||||||
/* The cairo to actually use for draw operations. Typically is front_cairo, but MwLLBeginDraw can change this to the back_cairo so it can be used to draw window decorations. */
|
MwU64 next_elapsed;
|
||||||
cairo_t* selected_cairo;
|
long start_time;
|
||||||
|
long end_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLWaylandColor {
|
struct _MwLLWaylandColor {
|
||||||
struct _MwLLCommonColor common;
|
struct _MwLLCommonColor common;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLWaylandPixmap {
|
#define _MwLLWaylandPixmap _MwLLCairoPixmap
|
||||||
struct _MwLLCommonPixmap common;
|
|
||||||
|
|
||||||
cairo_surface_t* cs;
|
/* Setup the framebuffer with the saved width/height */
|
||||||
};
|
void MwLLWaylandFramebufferSetup(struct _MwLLWayland* wayland);
|
||||||
|
/* Destroy the framebuffer */
|
||||||
|
void MwLLWaylandFramebufferDestroy(struct _MwLLWayland* handle);
|
||||||
|
|
||||||
|
/* Setup the framebuffer with the saved width/height */
|
||||||
|
void MwLLWaylandBackbufferSetup(struct _MwLLWayland* wayland);
|
||||||
|
/* Destroy the backbuffer */
|
||||||
|
void MwLLWaylandBackbufferDestroy(struct _MwLLWayland* handle);
|
||||||
|
|
||||||
|
void MwLLWaylandBufferSetup(struct _MwLLWaylandShmBuffer* buffer, MwU32 width, MwU32 height);
|
||||||
|
void MwLLWaylandBufferUpdate(MwLL self, struct _MwLLWaylandShmBuffer* buffer);
|
||||||
|
void MwLLWaylandBufferDestroy(struct _MwLLWaylandShmBuffer* buffer);
|
||||||
|
|
||||||
|
void MwLLWaylandRegionSetup(MwLL handle);
|
||||||
|
void MwLLWaylandRegionInvalidate(MwLL handle);
|
||||||
|
|
||||||
|
void MwLLWaylandHangUntilConfigured(MwLL handle);
|
||||||
|
|
||||||
|
MwBool MwLLWaylandWidgetIsDestroyed(MwLL self);
|
||||||
|
void MwLLWaylandWidgetUndestroy(MwLL self);
|
||||||
|
|
||||||
|
/* Function for setting up the callbacks/structs that will be registered upon the relevant interfaces being found. */
|
||||||
|
void MwLLWaylandSetupCallbacks(struct _MwLLWayland* wayland);
|
||||||
|
|
||||||
|
void MwLLWaylandClipboardRead(wl_clipboard_device_context_t* ctx, int clipboard_type);
|
||||||
|
|
||||||
|
/* Flush Wayland events */
|
||||||
|
void MwLLWaylandFlush(MwLL handle);
|
||||||
|
|
||||||
|
/* Standard procedure before event callbacks in Wayland */
|
||||||
|
#define WAYLAND_EVENT_OP_START(self) \
|
||||||
|
if(MwLLWaylandWidgetIsDestroyed(self)) { \
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Footer for WAYLAND_EVENT_OP_START */
|
||||||
|
#define WAYLAND_EVENT_OP_END(self)
|
||||||
|
|
||||||
|
#define WIDGET_CHECK(handle) \
|
||||||
|
if(!handle->wayland.valid) { \
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the two decoration manager constructs */
|
||||||
|
typedef struct zxdg_decoration_manager_v1_context {
|
||||||
|
struct zxdg_decoration_manager_v1* manager;
|
||||||
|
struct zxdg_toplevel_decoration_v1* decoration;
|
||||||
|
} zxdg_decoration_manager_v1_context_t;
|
||||||
|
|
||||||
|
extern struct zwp_relative_pointer_v1_listener MwLLWaylandRelativePointerListener;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _MwLLX11 {
|
struct _MwLLX11 {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
|
|
||||||
|
|
@ -39,7 +43,7 @@ struct _MwLLX11 {
|
||||||
XIC xic;
|
XIC xic;
|
||||||
|
|
||||||
long clipboard_time;
|
long clipboard_time;
|
||||||
int clipboard_pending; /* 1 if UTF8_STRING, 2 if COMPOUNd_TEXT, 3 if TEXT, 4 if STRING, otherwise 0 */
|
int clipboard_pending; /* 1 if UTF8_STRING, 2 if COMPOUND_TEXT, 3 if TEXT, 4 if STRING, otherwise 0 */
|
||||||
|
|
||||||
int top;
|
int top;
|
||||||
int toplevel;
|
int toplevel;
|
||||||
|
|
@ -57,6 +61,12 @@ struct _MwLLX11 {
|
||||||
unsigned long blue_mask;
|
unsigned long blue_mask;
|
||||||
unsigned long blue_max;
|
unsigned long blue_max;
|
||||||
unsigned long blue_shift;
|
unsigned long blue_shift;
|
||||||
|
|
||||||
|
#ifdef USE_DBUS
|
||||||
|
MwLLDBusContext dbus;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MwBool dark_theme_detection;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLX11Color {
|
struct _MwLLX11Color {
|
||||||
|
|
@ -80,4 +90,8 @@ struct _MwLLX11Pixmap {
|
||||||
MWDECL int MwLLX11CallInit(void);
|
MWDECL int MwLLX11CallInit(void);
|
||||||
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
|
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <setjmp.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
@ -17,11 +16,16 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199409L
|
||||||
|
#include <wchar.h>
|
||||||
|
#define MW_HAS_WCHAR
|
||||||
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
|
||||||
#ifdef _MILSKO
|
#ifdef _MILSKO
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <mmsystem.h>
|
||||||
#ifndef GWLP_USERDATA
|
#ifndef GWLP_USERDATA
|
||||||
#define GWLP_USERDATA GWL_USERDATA
|
#define GWLP_USERDATA GWL_USERDATA
|
||||||
#define GWLP_WNDPROC GWL_WNDPROC
|
#define GWLP_WNDPROC GWL_WNDPROC
|
||||||
|
|
@ -37,33 +41,82 @@
|
||||||
#define GET_WHEEL_DELTA_WPARAM(x) ((short)HIWORD(x))
|
#define GET_WHEEL_DELTA_WPARAM(x) ((short)HIWORD(x))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <MacTypes.h>
|
||||||
|
#include <CFBundle.h>
|
||||||
|
#include <CodeFragments.h>
|
||||||
|
#include <Timer.h>
|
||||||
|
#include <MacWindows.h>
|
||||||
|
#include <TextEdit.h>
|
||||||
|
#include <Dialogs.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include <Window.h>
|
||||||
|
#include <View.h>
|
||||||
|
#include <Screen.h>
|
||||||
|
#include <Application.h>
|
||||||
|
#include <Locker.h>
|
||||||
|
#include <Picture.h>
|
||||||
|
#include <Bitmap.h>
|
||||||
|
#endif
|
||||||
|
#include <OS.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <mach/clock.h>
|
#include <mach/clock.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_DBUS
|
||||||
|
#include <dbus/dbus.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.14159265
|
#define M_PI 3.14159265
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MILSKO) && defined(_WIN32)
|
/* Windows */
|
||||||
|
#if defined(_MILSKO) && defined(_MILSKO_BUILD) && defined(_WIN32)
|
||||||
#define MWDECL extern __declspec(dllexport)
|
#define MWDECL extern __declspec(dllexport)
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#define MWDECL extern __declspec(dllimport)
|
#define MWDECL extern __declspec(dllimport)
|
||||||
|
/* GCC/Clang */
|
||||||
|
/* First check if we have __has_attribute and can check for the existence of visibility */
|
||||||
|
#elif defined(__has_attribute)
|
||||||
|
#if __has_attribute(visibility)
|
||||||
|
#define MWDECL extern __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
#define MWDECL extern
|
#define MWDECL extern
|
||||||
#endif
|
#endif
|
||||||
|
/* It might be that we're on an old version of GCC (like the one Apple ships with older versions of Mac OS).
|
||||||
|
* If we're on gcc 3 or above, assume it's there
|
||||||
|
*/
|
||||||
|
#elif __GNUC__ >= 3
|
||||||
|
#define MWDECL extern __attribute__((visibility("default")))
|
||||||
|
#else
|
||||||
|
/* all else fails */
|
||||||
|
#define MWDECL extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define MWAPI __cdecl
|
||||||
|
#else
|
||||||
|
#define MWAPI
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MwInline static __inline
|
#define MwInline static __inline
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,17 @@
|
||||||
#include <Mw/Core.h>
|
#include <Mw/Core.h>
|
||||||
#include <Mw/Default.h>
|
#include <Mw/Default.h>
|
||||||
#include <Mw/Font.h>
|
#include <Mw/Font.h>
|
||||||
#include <Mw/Error.h>
|
|
||||||
#include <Mw/Constants.h>
|
#include <Mw/Constants.h>
|
||||||
#include <Mw/Unicode.h>
|
#include <Mw/Unicode.h>
|
||||||
#include <Mw/String.h>
|
#include <Mw/String.h>
|
||||||
#include <Mw/Draw.h>
|
#include <Mw/Draw.h>
|
||||||
#include <Mw/Version.h>
|
#include <Mw/Version.h>
|
||||||
|
#include <Mw/TrueType.h>
|
||||||
|
|
||||||
#include <Mw/Abstract/Dynamic.h>
|
#include <Mw/Abstract/Dynamic.h>
|
||||||
#include <Mw/Abstract/Directory.h>
|
#include <Mw/Abstract/Directory.h>
|
||||||
#include <Mw/Abstract/Time.h>
|
#include <Mw/Abstract/Time.h>
|
||||||
|
#include <Mw/Abstract/CharSet.h>
|
||||||
|
|
||||||
#include <Mw/Resource/Icon.h>
|
#include <Mw/Resource/Icon.h>
|
||||||
#include <Mw/Resource/Cursor.h>
|
#include <Mw/Resource/Cursor.h>
|
||||||
|
|
@ -32,24 +33,28 @@
|
||||||
#include <Mw/Dialog/DirectoryChooser.h>
|
#include <Mw/Dialog/DirectoryChooser.h>
|
||||||
#include <Mw/Dialog/ColorPicker.h>
|
#include <Mw/Dialog/ColorPicker.h>
|
||||||
|
|
||||||
#include <Mw/Widget/Window.h>
|
#include <Mw/Widget/Box.h>
|
||||||
#include <Mw/Widget/Menu.h>
|
|
||||||
#include <Mw/Widget/SubMenu.h>
|
|
||||||
#include <Mw/Widget/Button.h>
|
#include <Mw/Widget/Button.h>
|
||||||
#include <Mw/Widget/Label.h>
|
#include <Mw/Widget/Calendar.h>
|
||||||
#include <Mw/Widget/CheckBox.h>
|
#include <Mw/Widget/CheckBox.h>
|
||||||
|
#include <Mw/Widget/ComboBox.h>
|
||||||
|
#include <Mw/Widget/Entry.h>
|
||||||
#include <Mw/Widget/Frame.h>
|
#include <Mw/Widget/Frame.h>
|
||||||
#include <Mw/Widget/Image.h>
|
#include <Mw/Widget/Image.h>
|
||||||
#include <Mw/Widget/Entry.h>
|
#include <Mw/Widget/Label.h>
|
||||||
#include <Mw/Widget/ScrollBar.h>
|
|
||||||
#include <Mw/Widget/NumberEntry.h>
|
|
||||||
#include <Mw/Widget/Viewport.h>
|
|
||||||
#include <Mw/Widget/ListBox.h>
|
#include <Mw/Widget/ListBox.h>
|
||||||
|
#include <Mw/Widget/Menu.h>
|
||||||
|
#include <Mw/Widget/NumberEntry.h>
|
||||||
#include <Mw/Widget/ProgressBar.h>
|
#include <Mw/Widget/ProgressBar.h>
|
||||||
#include <Mw/Widget/RadioBox.h>
|
#include <Mw/Widget/RadioBox.h>
|
||||||
|
#include <Mw/Widget/ScrollBar.h>
|
||||||
#include <Mw/Widget/Separator.h>
|
#include <Mw/Widget/Separator.h>
|
||||||
#include <Mw/Widget/ComboBox.h>
|
#include <Mw/Widget/SubMenu.h>
|
||||||
|
#include <Mw/Widget/SubWindow.h>
|
||||||
|
#include <Mw/Widget/Tab.h>
|
||||||
|
#include <Mw/Widget/Table.h>
|
||||||
#include <Mw/Widget/TreeView.h>
|
#include <Mw/Widget/TreeView.h>
|
||||||
#include <Mw/Widget/Box.h>
|
#include <Mw/Widget/Viewport.h>
|
||||||
|
#include <Mw/Widget/Window.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,26 @@ MWDECL unsigned char MwBoldTTFData[];
|
||||||
*/
|
*/
|
||||||
MWDECL unsigned int MwBoldTTFDataSize;
|
MWDECL unsigned int MwBoldTTFDataSize;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default monospace TTF font data
|
||||||
|
*/
|
||||||
|
MWDECL unsigned char MwMonospaceTTFData[];
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default monospace TTF font size
|
||||||
|
*/
|
||||||
|
MWDECL unsigned int MwMonospaceTTFDataSize;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default bold monospace TTF font data
|
||||||
|
*/
|
||||||
|
MWDECL unsigned char MwBoldMonospaceTTFData[];
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Default bold monospace TTF font size
|
||||||
|
*/
|
||||||
|
MWDECL unsigned int MwBoldMonospaceTTFDataSize;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ extern "C" {
|
||||||
* @param str String
|
* @param str String
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
MWDECL char* MwStringDuplicate(const char* str);
|
MWDECL char* MWAPI MwStringDuplicate(const char* str);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Concatenates 2 strings
|
* @brief Concatenates 2 strings
|
||||||
|
|
@ -25,28 +25,36 @@ MWDECL char* MwStringDuplicate(const char* str);
|
||||||
* @param str2 String
|
* @param str2 String
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
MWDECL char* MwStringConcat(const char* str1, const char* str2);
|
MWDECL char* MWAPI MwStringConcat(const char* str1, const char* str2);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Converts size to string
|
* @brief Converts size to string
|
||||||
* @param out Output
|
* @param out Output
|
||||||
* @param size Size
|
* @param size Size
|
||||||
*/
|
*/
|
||||||
MWDECL void MwStringSize(char* out, MwOffset size);
|
MWDECL void MWAPI MwStringSize(char* out, MwOffset size);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Converts time to string
|
* @brief Converts time to string
|
||||||
* @param out Output
|
* @param out Output
|
||||||
* @param t Time
|
* @param t Time
|
||||||
*/
|
*/
|
||||||
MWDECL void MwStringTime(char* out, time_t t);
|
MWDECL void MWAPI MwStringTime(char* out, time_t t);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Prints up to n characters into a bufferMwStringPrintIntoBuffer.
|
||||||
|
* @note On compilers that support C99, this uses vsnprintf to safely print into a buffer; on compilers that don't, vsprintf is used.
|
||||||
|
* @param out Buffer
|
||||||
|
* @param size Max size
|
||||||
|
*/
|
||||||
|
MWDECL void MWAPI MwStringPrintIntoBuffer(char* out, MwU32 size, const char* fmt, ...);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Check if the given key is UTF8
|
* @brief Check if the given key is UTF8
|
||||||
* @param key Input
|
* @param key Input
|
||||||
* @return whether its utf8
|
* @return whether its utf8
|
||||||
*/
|
*/
|
||||||
MWDECL MwBool MwIsKeyUTF8(MwU32 key);
|
MWDECL MwBool MWAPI MwStringIsKeyUTF8(MwU32 key);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,16 +39,34 @@
|
||||||
#define MwNsevenSegment "IsevenSegment"
|
#define MwNsevenSegment "IsevenSegment"
|
||||||
#define MwNlength "Ilength"
|
#define MwNlength "Ilength"
|
||||||
#define MwNforceInverted "IforceInverted"
|
#define MwNforceInverted "IforceInverted"
|
||||||
#define MwNroundness "Iroundness"
|
|
||||||
#define MwNisRounded "IisRounded"
|
#define MwNisRounded "IisRounded"
|
||||||
#define MwNdarkTheme "IdarkTheme"
|
#define MwNdarkTheme "IdarkTheme"
|
||||||
|
#define MwNuseMonospace "IuseMonospace"
|
||||||
|
#define MwNdarkThemeAutomatic "IdarkThemeAutomatic"
|
||||||
|
#define MwNyear "Iyear"
|
||||||
|
#define MwNmonth "Imonth"
|
||||||
|
#define MwNdate "Idate"
|
||||||
|
#define MwNday "Iday"
|
||||||
|
#define MwNwaitLayout "IwaitLayout"
|
||||||
|
#define MwNscale "Iscale"
|
||||||
|
#define MwNcolumns "Icolumns"
|
||||||
|
#define MwNcolumnSpan "IcolumnSpan"
|
||||||
|
#define MwNrowSpan "IrowSpan"
|
||||||
|
#define MwNdisabled "Idisabled"
|
||||||
|
#define MwNacceptsDnD "IacceptsDnD"
|
||||||
|
|
||||||
#define MwNtitle "Stitle"
|
#define MwNtitle "Stitle"
|
||||||
#define MwNtext "Stext"
|
#define MwNtext "Stext"
|
||||||
#define MwNbackground "Sbackground"
|
#define MwNbackground "Sbackground"
|
||||||
#define MwNsubBackground "SsubBackground"
|
#define MwNsubBackground "SsubBackground"
|
||||||
|
#define MwNtitleBackground "StitleBackground"
|
||||||
#define MwNforeground "Sforeground"
|
#define MwNforeground "Sforeground"
|
||||||
#define MwNsubForeground "SsubForeground"
|
#define MwNsubForeground "SsubForeground"
|
||||||
|
#define MwNtitleForeground "StitleForeground"
|
||||||
|
|
||||||
|
#define MwNvulkanExtension "SEvulkanExtension"
|
||||||
|
#define MwNvulkanLayer "SEvulkanLayer"
|
||||||
|
#define MwNvulkanConfig "VEvulkanConfig"
|
||||||
|
|
||||||
#define MwNpixmap "Vpixmap"
|
#define MwNpixmap "Vpixmap"
|
||||||
#define MwNiconPixmap "ViconPixmap"
|
#define MwNiconPixmap "ViconPixmap"
|
||||||
|
|
@ -56,25 +74,31 @@
|
||||||
#define MwNfont "Vfont"
|
#define MwNfont "Vfont"
|
||||||
#define MwNboldFont "VboldFont"
|
#define MwNboldFont "VboldFont"
|
||||||
#define MwNbackgroundPixmap "VbackgroundPixmap"
|
#define MwNbackgroundPixmap "VbackgroundPixmap"
|
||||||
|
#define MwNmonospaceFont "VmonospaceFont"
|
||||||
|
#define MwNboldMonospaceFont "VboldMonospaceFont"
|
||||||
|
|
||||||
#define MwNactivateHandler "Cactivate" /* NULL/int* (MwListBox)/void* (MwTreeView) */
|
#define MwNactivateHandler "Cactivate"
|
||||||
#define MwNresizeHandler "Cresize" /* NULL */
|
#define MwNlistBoxActivateHandler "ClistBoxActivate"
|
||||||
#define MwNtickHandler "Ctick" /* NULL */
|
#define MwNtreeViewActivateHandler "CtreeViewActivate"
|
||||||
#define MwNmenuHandler "Cmenu" /* MwMenu */
|
#define MwNresizeHandler "Cresize"
|
||||||
#define MwNmouseDownHandler "CmouseDown" /* MwLLMouse* */
|
#define MwNtickHandler "Ctick"
|
||||||
#define MwNmouseUpHandler "CmouseUp" /* same as MwNmouseDownHandler */
|
#define MwNmenuHandler "Cmenu"
|
||||||
#define MwNmouseMoveHandler "CmouseMove" /* MwPoint* */
|
#define MwNmouseDownHandler "CmouseDown"
|
||||||
#define MwNchangedHandler "Cchanged" /* NULL/int* (MwComboBox) */
|
#define MwNmouseUpHandler "CmouseUp"
|
||||||
#define MwNkeyHandler "Ckey" /* int* (MwLLKeyEnum or character code) */
|
#define MwNmouseMoveHandler "CmouseMove"
|
||||||
#define MwNkeyReleaseHandler "CkeyRelease" /* same as MwNkeyHandler */
|
#define MwNchangedHandler "Cchanged"
|
||||||
#define MwNcloseHandler "Cclose" /* NULL */
|
#define MwNcomboBoxChangedHandler "CcomboBoxChanged"
|
||||||
#define MwNfocusInHandler "CfocusIn" /* NULL */
|
#define MwNkeyHandler "Ckey"
|
||||||
#define MwNfocusOutHandler "CfocusOut" /* NULL */
|
#define MwNkeyReleaseHandler "CkeyRelease"
|
||||||
#define MwNfileChosenHandler "CfileChosen" /* char* */
|
#define MwNcloseHandler "Cclose"
|
||||||
#define MwNdirectoryChosenHandler "CdirectoryChosen" /* char* */
|
#define MwNfocusInHandler "CfocusIn"
|
||||||
#define MwNcolorChosenHandler "CcolorChosen" /* MwRGB* */
|
#define MwNfocusOutHandler "CfocusOut"
|
||||||
#define MwNdrawHandler "Cdraw" /* NULL */
|
#define MwNfileChosenHandler "CfileChosen"
|
||||||
#define MwNclipboardHandler "Cclipboard" /* char* */
|
#define MwNdirectoryChosenHandler "CdirectoryChosen"
|
||||||
#define MwNdarkThemeHandler "CdarkTheme" /* int* */
|
#define MwNcolorChosenHandler "CcolorChosen"
|
||||||
|
#define MwNdrawHandler "Cdraw"
|
||||||
|
#define MwNclipboardHandler "Cclipboard"
|
||||||
|
#define MwNdarkThemeHandler "CdarkTheme"
|
||||||
|
#define MwNdragAndDropHandler "CdragAndDrop"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
33
include/Mw/TrueType.h
Normal file
33
include/Mw/TrueType.h
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/TrueType.h
|
||||||
|
* @brief TrueType utilities
|
||||||
|
*/
|
||||||
|
#ifndef __MW_TRUETYPE_H__
|
||||||
|
#define __MW_TRUETYPE_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Get the TrueType font information
|
||||||
|
* @param data Font data
|
||||||
|
* @param size Font size
|
||||||
|
* @return Information
|
||||||
|
*/
|
||||||
|
MWDECL MwTTFInfo MwTTFGetInfo(unsigned char* data, int size);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Free the TrueType font information
|
||||||
|
* @param info Information
|
||||||
|
*/
|
||||||
|
MWDECL void MwTTFFreeInfo(MwTTFInfo info);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -26,8 +26,12 @@ typedef struct _MwLabelSegment MwLabelSegment;
|
||||||
typedef struct _MwListBoxEntry MwListBoxEntry;
|
typedef struct _MwListBoxEntry MwListBoxEntry;
|
||||||
typedef struct _MwTreeViewEntry MwTreeViewEntry;
|
typedef struct _MwTreeViewEntry MwTreeViewEntry;
|
||||||
typedef struct _MwDirectoryEntry MwDirectoryEntry;
|
typedef struct _MwDirectoryEntry MwDirectoryEntry;
|
||||||
typedef struct _MwListBoxPacket MwListBoxPacket;
|
typedef struct _MwBox* MwBox;
|
||||||
typedef struct _MwBox* MwBox;
|
typedef struct _MwSubWindow* MwSubWindow;
|
||||||
|
typedef struct _MwTab* MwTab;
|
||||||
|
typedef struct _MwTable* MwTable;
|
||||||
|
typedef struct _MwMouse MwMouse;
|
||||||
|
typedef struct _MwTTFInfo* MwTTFInfo;
|
||||||
#ifdef _MILSKO
|
#ifdef _MILSKO
|
||||||
typedef struct _MwWidget* MwWidget;
|
typedef struct _MwWidget* MwWidget;
|
||||||
#else
|
#else
|
||||||
|
|
@ -35,15 +39,17 @@ typedef void* MwWidget;
|
||||||
#endif
|
#endif
|
||||||
typedef void (*MwHandler)(MwWidget handle);
|
typedef void (*MwHandler)(MwWidget handle);
|
||||||
typedef int (*MwHandlerWithStatus)(MwWidget handle);
|
typedef int (*MwHandlerWithStatus)(MwWidget handle);
|
||||||
|
typedef void (*MwHandlerProps)(MwWidget handle, char** key);
|
||||||
typedef void (*MwHandlerProp)(MwWidget handle, const char* key);
|
typedef void (*MwHandlerProp)(MwWidget handle, const char* key);
|
||||||
|
typedef void (*MwHandlerChildrenUpdate)(MwWidget handle, MwWidget child, int new_child);
|
||||||
typedef void (*MwHandlerChildrenProp)(MwWidget handle, MwWidget child, const char* key);
|
typedef void (*MwHandlerChildrenProp)(MwWidget handle, MwWidget child, const char* key);
|
||||||
typedef void (*MwHandlerKey)(MwWidget handle, int key);
|
typedef void (*MwHandlerKey)(MwWidget handle, int key);
|
||||||
typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr);
|
typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr);
|
||||||
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
|
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
|
||||||
typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
|
typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
|
||||||
|
|
||||||
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
typedef void(MWAPI* MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||||
typedef void (*MwErrorHandler)(int code, const char* message, void* user_data);
|
typedef void(MWAPI* MwErrorHandler)(int code, const char* message, void* user_data);
|
||||||
|
|
||||||
struct _MwTextKeyValue {
|
struct _MwTextKeyValue {
|
||||||
char* key;
|
char* key;
|
||||||
|
|
@ -85,12 +91,13 @@ struct _MwWidget {
|
||||||
int pressed;
|
int pressed;
|
||||||
MwPoint mouse_point;
|
MwPoint mouse_point;
|
||||||
int close;
|
int close;
|
||||||
jmp_buf before_step;
|
|
||||||
int prop_event;
|
int prop_event;
|
||||||
|
|
||||||
void* internal;
|
void* internal;
|
||||||
void* opaque;
|
void* opaque;
|
||||||
|
void* user;
|
||||||
void (*draw_inject)(MwWidget handle);
|
void (*draw_inject)(MwWidget handle);
|
||||||
|
void (*destroy_inject)(MwWidget handle);
|
||||||
|
|
||||||
MwIntegerKeyValue* integer;
|
MwIntegerKeyValue* integer;
|
||||||
MwTextKeyValue* text;
|
MwTextKeyValue* text;
|
||||||
|
|
@ -104,8 +111,18 @@ struct _MwWidget {
|
||||||
|
|
||||||
void* root_font;
|
void* root_font;
|
||||||
void* root_boldfont;
|
void* root_boldfont;
|
||||||
|
void* root_monofont;
|
||||||
|
void* root_boldmonofont;
|
||||||
|
|
||||||
int berserk;
|
int top_step;
|
||||||
|
MwWidget* draw_queue;
|
||||||
|
MwWidget* resize_queue;
|
||||||
|
MwWidget* monitored_entries;
|
||||||
|
|
||||||
|
int berserk;
|
||||||
|
long last_tick;
|
||||||
|
|
||||||
|
MwBool is_menu;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -115,12 +132,15 @@ struct _MwMenu {
|
||||||
MwWidget wsub;
|
MwWidget wsub;
|
||||||
MwMenu* sub;
|
MwMenu* sub;
|
||||||
void* opaque;
|
void* opaque;
|
||||||
|
int cleaned;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwEntry {
|
struct _MwEntry {
|
||||||
int cursor;
|
int cursor;
|
||||||
int right;
|
int right;
|
||||||
int length;
|
int length;
|
||||||
|
int active;
|
||||||
|
int cursor_blink_timer;
|
||||||
MwPoint mouse;
|
MwPoint mouse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -182,6 +202,7 @@ struct _MwScrollBar {
|
||||||
|
|
||||||
struct _MwLabel {
|
struct _MwLabel {
|
||||||
MwLabelSegment* segment;
|
MwLabelSegment* segment;
|
||||||
|
MwHandler draw;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLabelSegment {
|
struct _MwLabelSegment {
|
||||||
|
|
@ -196,15 +217,45 @@ struct _MwDirectoryEntry {
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwListBoxPacket {
|
|
||||||
MwLLPixmap* pixmaps;
|
|
||||||
char*** names;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MwBox {
|
struct _MwBox {
|
||||||
int layout;
|
int layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _MwTable {
|
||||||
|
int layout;
|
||||||
|
MwWidget* widgets;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwSubWindow {
|
||||||
|
MwWidget frame;
|
||||||
|
MwWidget minimize;
|
||||||
|
MwWidget maximize;
|
||||||
|
MwWidget close;
|
||||||
|
int maximized;
|
||||||
|
int minimized;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
MwPoint cursor_start;
|
||||||
|
MwPoint base;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwTab {
|
||||||
|
MwWidget* frames;
|
||||||
|
char** names;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwMouse {
|
||||||
|
MwPoint point;
|
||||||
|
int button;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwTTFInfo {
|
||||||
|
char* family;
|
||||||
|
int weight;
|
||||||
|
};
|
||||||
|
|
||||||
struct _MwClass {
|
struct _MwClass {
|
||||||
MwHandlerWithStatus create;
|
MwHandlerWithStatus create;
|
||||||
MwHandler destroy;
|
MwHandler destroy;
|
||||||
|
|
@ -219,19 +270,13 @@ struct _MwClass {
|
||||||
MwHandlerExecute execute;
|
MwHandlerExecute execute;
|
||||||
MwHandler tick;
|
MwHandler tick;
|
||||||
MwHandler resize;
|
MwHandler resize;
|
||||||
MwHandler children_update;
|
MwHandlerChildrenUpdate children_update;
|
||||||
MwHandlerChildrenProp children_prop_change;
|
MwHandlerChildrenProp children_prop_change;
|
||||||
MwHandlerClipboardReceived clipboard;
|
MwHandlerClipboardReceived clipboard;
|
||||||
void* reserved1;
|
MwHandlerProps props_change;
|
||||||
|
MwHandler drag_and_drop;
|
||||||
void* reserved2;
|
void* reserved2;
|
||||||
void* reserved3;
|
void* reserved3;
|
||||||
void* reserved4;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Whether or not GetXY/SetXY works with global or local coordinates */
|
|
||||||
enum MwCoordinateType {
|
|
||||||
MwCoordinatesGlobal = 0,
|
|
||||||
MwCoordinatesLocal,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ extern "C" {
|
||||||
* @brief output Output
|
* @brief output Output
|
||||||
* @return Bytes this multibyte takes
|
* @return Bytes this multibyte takes
|
||||||
*/
|
*/
|
||||||
MWDECL int MwUTF8ToUTF32(const char* input, int* output);
|
MWDECL int MWAPI MwUTF8ToUTF32(const char* input, int* output);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Calculates UTF-8 string length
|
* @brief Calculates UTF-8 string length
|
||||||
* @brief input Input
|
* @brief input Input
|
||||||
* @return Length
|
* @return Length
|
||||||
*/
|
*/
|
||||||
MWDECL int MwUTF8Length(const char* input);
|
MWDECL int MWAPI MwUTF8Length(const char* input);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Copies UTF-8 string to other string
|
* @brief Copies UTF-8 string to other string
|
||||||
|
|
@ -36,7 +36,7 @@ MWDECL int MwUTF8Length(const char* input);
|
||||||
* @brief len Length
|
* @brief len Length
|
||||||
* @return Copied length in bytes
|
* @return Copied length in bytes
|
||||||
*/
|
*/
|
||||||
MWDECL int MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int len);
|
MWDECL int MWAPI MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Converts UTF-32 to UTF-8
|
* @brief Converts UTF-32 to UTF-8
|
||||||
|
|
@ -44,7 +44,7 @@ MWDECL int MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int
|
||||||
* @brief output Output
|
* @brief output Output
|
||||||
* @return Bytes this wide byte takes
|
* @return Bytes this wide byte takes
|
||||||
*/
|
*/
|
||||||
MWDECL int MwUTF32ToUTF8(int input, char* output);
|
MWDECL int MWAPI MwUTF32ToUTF8(int input, char* output);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,26 @@
|
||||||
/*!
|
/*!
|
||||||
* @brief Major version
|
* @brief Major version
|
||||||
*/
|
*/
|
||||||
#define MwMAJOR 0
|
#define MwMAJOR 1
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Minor version
|
* @brief Minor version
|
||||||
*/
|
*/
|
||||||
#define MwMINOR 0
|
#define MwMINOR 3
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Patchlevel of version, if patchlevel_alphabet is a or bigger, this value is calculated by `patchlevel_alphabet - 'a' + 1`. Otherwise 0
|
||||||
|
*/
|
||||||
|
#define MwPATCH 0
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Version in string
|
* @brief Version in string
|
||||||
*/
|
*/
|
||||||
#define MwVERSION "pre-1.0"
|
#define MwVERSION "1.4"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Version in string
|
||||||
|
*/
|
||||||
|
MWDECL const char* MwVersionString;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
24
include/Mw/Widget/Calendar.h
Normal file
24
include/Mw/Widget/Calendar.h
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/Widget/Calendar.h
|
||||||
|
* @brief Calendar widget
|
||||||
|
*/
|
||||||
|
#ifndef __MW_WIDGET_CALENDAR_H__
|
||||||
|
#define __MW_WIDGET_CALENDAR_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Calendar widget class
|
||||||
|
*/
|
||||||
|
MWDECL MwClass MwCalendarClass;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/Core.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/Core.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -19,50 +19,29 @@ extern "C" {
|
||||||
MWDECL MwClass MwListBoxClass;
|
MWDECL MwClass MwListBoxClass;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Creates a listbox packet
|
* @brief Sets item on the listbox
|
||||||
* @return Packet
|
* @param handle Widget
|
||||||
*/
|
* @param row Row
|
||||||
MWDECL MwListBoxPacket* MwListBoxCreatePacket(void);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Destroys a listbox packet
|
|
||||||
* @param packet Packet
|
|
||||||
*/
|
|
||||||
MWDECL void MwListBoxDestroyPacket(MwListBoxPacket* packet);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Inserts a new item to a packet
|
|
||||||
* @param packet Packet
|
|
||||||
* @param index Index
|
|
||||||
* @return Index
|
|
||||||
*/
|
|
||||||
MWDECL int MwListBoxPacketInsert(MwListBoxPacket* packet, int index);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Sets a column of item in a packet
|
|
||||||
* @param packet Packet
|
|
||||||
* @param index Index
|
|
||||||
* @param col Column
|
* @param col Column
|
||||||
* @param text Text
|
* @param text Text
|
||||||
|
* @return Index
|
||||||
*/
|
*/
|
||||||
MWDECL void MwListBoxPacketSet(MwListBoxPacket* packet, int index, int col, const char* text);
|
MwInline int MwListBoxSet(MwWidget handle, int row, int col, const char* text) {
|
||||||
|
int out;
|
||||||
|
|
||||||
|
MwVaWidgetExecute(handle, "mwListBoxSet", (void*)&out, row, col, text);
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets an icon of item in a packet
|
* @brief Sets the icon of the row
|
||||||
* @param packet Packet
|
* @param handle Widget
|
||||||
* @param index Index
|
* @param index Index
|
||||||
* @param icon Icon
|
* @param icon Icon
|
||||||
*/
|
*/
|
||||||
MWDECL void MwListBoxPacketSetIcon(MwListBoxPacket* packet, int index, MwLLPixmap icon);
|
MwInline void MwListBoxSetIcon(MwWidget handle, int index, MwLLPixmap icon) {
|
||||||
|
MwVaWidgetExecute(handle, "mwListBoxSetIcon", NULL, index, icon);
|
||||||
/*!
|
|
||||||
* @brief Inserts item on the listbox
|
|
||||||
* @param handle Widget
|
|
||||||
* @param index Index
|
|
||||||
* @param packet Packet
|
|
||||||
*/
|
|
||||||
MwInline void MwListBoxInsert(MwWidget handle, int index, void* packet) {
|
|
||||||
MwVaWidgetExecute(handle, "mwListBoxInsert", NULL, index, packet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
36
include/Mw/Widget/SubWindow.h
Normal file
36
include/Mw/Widget/SubWindow.h
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/Widget/SubWindow.h
|
||||||
|
* @brief SubWindow widget
|
||||||
|
*/
|
||||||
|
#ifndef __MW_WIDGET_SUBWINDOW_H__
|
||||||
|
#define __MW_WIDGET_SUBWINDOW_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/Core.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief SubWindow widget class
|
||||||
|
*/
|
||||||
|
MWDECL MwClass MwSubWindowClass;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Get parent widget where widgets should be placed
|
||||||
|
* @param handle Widget
|
||||||
|
* @return Widget
|
||||||
|
*/
|
||||||
|
MwInline MwWidget MwSubWindowGetFrame(MwWidget handle) {
|
||||||
|
MwWidget out;
|
||||||
|
MwVaWidgetExecute(handle, "mwSubWindowGetFrame", &out);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
59
include/Mw/Widget/Tab.h
Normal file
59
include/Mw/Widget/Tab.h
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/Widget/Tab.h
|
||||||
|
* @brief Tab widget
|
||||||
|
*/
|
||||||
|
#ifndef __MW_WIDGET_TAB_H__
|
||||||
|
#define __MW_WIDGET_TAB_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/Core.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Tab widget class
|
||||||
|
*/
|
||||||
|
MWDECL MwClass MwTabClass;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Adds a tab
|
||||||
|
* @param handle Widget
|
||||||
|
* @param name Tab name
|
||||||
|
* @return Frame
|
||||||
|
*/
|
||||||
|
MwInline MwWidget MwTabAdd(MwWidget handle, const char* name) {
|
||||||
|
MwWidget out;
|
||||||
|
MwVaWidgetExecute(handle, "mwTabAdd", &out, name);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Gets a tab frame
|
||||||
|
* @param handle Widget
|
||||||
|
* @param name Tab name
|
||||||
|
* @return Frame
|
||||||
|
*/
|
||||||
|
MwInline MwWidget MwTabGetFrame(MwWidget handle, const char* name) {
|
||||||
|
MwWidget out;
|
||||||
|
MwVaWidgetExecute(handle, "mwTabGetFrame", &out, name);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Focus on a tab frame
|
||||||
|
* @param handle Widget
|
||||||
|
* @param name Tab name
|
||||||
|
* @return Frame
|
||||||
|
*/
|
||||||
|
MwInline void MwTabFocus(MwWidget handle, const char* name) {
|
||||||
|
MwVaWidgetExecute(handle, "mwTabFocus", NULL, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
24
include/Mw/Widget/Table.h
Normal file
24
include/Mw/Widget/Table.h
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*!
|
||||||
|
* @file Mw/Widget/Table.h
|
||||||
|
* @brief Table widget
|
||||||
|
*/
|
||||||
|
#ifndef __MW_WIDGET_TABLE_H__
|
||||||
|
#define __MW_WIDGET_TABLE_H__
|
||||||
|
|
||||||
|
#include <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Table widget class
|
||||||
|
*/
|
||||||
|
MWDECL MwClass MwTableClass;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -90,6 +90,19 @@ MwInline void MwTreeViewSetOpened(MwWidget handle, void* item, int opened) {
|
||||||
MwVaWidgetExecute(handle, "mwTreeViewSetOpened", NULL, item, opened);
|
MwVaWidgetExecute(handle, "mwTreeViewSetOpened", NULL, item, opened);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Gets the opened state of ithe item
|
||||||
|
* @param handle Widget
|
||||||
|
* @param item Item
|
||||||
|
* @return Opened or not
|
||||||
|
*/
|
||||||
|
MwInline int MwTreeViewGetOpened(MwWidget handle, void* item) {
|
||||||
|
int out;
|
||||||
|
MwVaWidgetExecute(handle, "mwTreeViewGetOpened", (void*)&out, item);
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,18 @@
|
||||||
#ifndef __MW_WIDGET_VULKAN_H__
|
#ifndef __MW_WIDGET_VULKAN_H__
|
||||||
#define __MW_WIDGET_VULKAN_H__
|
#define __MW_WIDGET_VULKAN_H__
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
#if defined(MW_VULKAN) && !defined(_WIN32) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||||
#error Vulkan is unsupported on the requested platform.
|
#error Vulkan is unsupported on the requested platform.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MW_VULKAN_NO_INCLUDE)
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#include <vulkan/vulkan_core.h>
|
#include <vulkan/vulkan_core.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
#include <Mw/Core.h>
|
#include <Mw/Core.h>
|
||||||
#include <Mw/Error.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -33,95 +34,76 @@ extern "C" {
|
||||||
MWDECL MwClass MwVulkanClass;
|
MWDECL MwClass MwVulkanClass;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Add an extension to the list of extensions to enable prior to initialization.
|
* @brief Configuration options that can be passed to setup parts of the Vulkan widget.
|
||||||
* @warning This must be called before MwCreateWidget.
|
|
||||||
*/
|
*/
|
||||||
MWDECL void MwVulkanEnableExtension(const char* ext_name);
|
typedef struct _MwVulkanConfig {
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Add an layer to the list of layers to enable prior to initialization.
|
|
||||||
* @warning This must be called before MwCreateWidget.
|
|
||||||
*/
|
|
||||||
MWDECL void MwVulkanEnableLayer(const char* ext_name);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Configuration options that can be passed to setup Vulkan before a widget is created.
|
|
||||||
*/
|
|
||||||
typedef struct MwVulkanConfig_T {
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Vulkan API version (default: VK_API_VERSION_1_0)
|
* @brief Vulkan API version (default: VK_API_VERSION_1_0)
|
||||||
*/
|
*/
|
||||||
uint32_t api_version;
|
MwU32 api_version;
|
||||||
/*!
|
/*!
|
||||||
* @brief Vulkan version (default: VK_VERSION_1_0)
|
* @brief Vulkan version (default: VK_VERSION_1_0)
|
||||||
*/
|
*/
|
||||||
uint32_t vk_version;
|
MwU32 vk_version;
|
||||||
/*!
|
/*!
|
||||||
* @brief Whether or not to enable validation layers (default: false)
|
* @brief Whether or not to enable validation layers (default: false)
|
||||||
*/
|
*/
|
||||||
VkBool32 validation_layers;
|
int validation_layers;
|
||||||
} MwVulkanConfig;
|
} MwVulkanConfig;
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief Configure Vulkan prior to initializing the widget.
|
|
||||||
* @warning This must be called before MwCreateWidget.
|
|
||||||
* @warning The configuration provided will be used for future initializations of the Vulkan widget (unless it's changed)
|
|
||||||
*/
|
|
||||||
MWDECL void MwVulkanConfigure(MwVulkanConfig cfg);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Field that can be gotten from Vulkan.
|
* @brief Field that can be gotten from Vulkan.
|
||||||
*/
|
*/
|
||||||
typedef enum MwVulkanField_T {
|
enum MwVULKANFIELD {
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's vkGetInstanceProcAddr function (PFN_vkGetInstanceProcAddr)
|
* @brief The address of the vulkan widget's vkGetInstanceProcAddr function (PFN_vkGetInstanceProcAddr)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_GetInstanceProcAddr = 0,
|
MwVULKANFIELD_GETINSTANCEPROCADDR = 0,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's instance (VkInstance)
|
* @brief The address of the vulkan widget's instance (VkInstance)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_Instance,
|
MwVULKANFIELD_INSTANCE,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's surface (VkSurfaceKHR)
|
* @brief The address of the vulkan widget's surface (VkSurfaceKHR)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_Surface,
|
MwVULKANFIELD_SURFACE,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's physical device (VkPhysicalDevice)
|
* @brief The address of the vulkan widget's physical device (VkPhysicalDevice)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_PhysicalDevice,
|
MwVULKANFIELD_PHYSICALDEVICE,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's logical device (VkDevice)
|
* @brief The address of the vulkan widget's logical device (VkDevice)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_LogicalDevice,
|
MwVULKANFIELD_LOGICALDEVICE,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the index that the vulkan widget uses for the graphics queue (uint32_t *)
|
* @brief The address of the index that the vulkan widget uses for the graphics queue (uint32_t *)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_GraphicsQueueIndex,
|
MwVULKANFIELD_GRAPHICSQUEUEINDEX,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the index that the vulkan widget uses for the present queue (uint32_t *)
|
* @brief The address of the index that the vulkan widget uses for the present queue (uint32_t *)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_PresentQueueIndex,
|
MwVULKANFIELD_PRESENTQUEUEINDEX,
|
||||||
MwVulkanField_GraphicsQueue,
|
MwVULKANFIELD_GRAPHICSQUEUE,
|
||||||
/*!
|
/*!
|
||||||
* @brief The address of the vulkan widget's graphics queue (VkQueue)
|
* @brief The address of the vulkan widget's graphics queue (VkQueue)
|
||||||
*/
|
*/
|
||||||
MwVulkanField_PresentQueue,
|
MwVULKANFIELD_PRESENTQUEUE,
|
||||||
} MwVulkanField;
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Function for getting a field from within Vulkan.
|
* @brief Function for getting a field from within Vulkan.
|
||||||
* @warning Consult the documentation for MwVulkanField to know what type is expected for out.
|
* @note Consult the documentation for MwVULKANFIELD to know what type is expected for output.
|
||||||
*/
|
*/
|
||||||
MwInline void* MwVulkanGetField(MwWidget handle, MwVulkanField field, MwErrorEnum* out) {
|
MwInline void* MwVulkanGetField(MwWidget handle, int field, int* err) {
|
||||||
void* field_out;
|
void* field_out;
|
||||||
MwVaWidgetExecute(handle, "mwVulkanGetField", &field_out, field, out);
|
MwVaWidgetExecute(handle, "mwVulkanGetField", &field_out, field, err);
|
||||||
return field_out;
|
return field_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Return whether Vulkan is installed on the target platform.
|
* @brief Return whether Vulkan is installed on the target platform.
|
||||||
*/
|
*/
|
||||||
MWDECL VkBool32 MwVulkanSupported(void);
|
MWDECL int MWAPI MwVulkanSupported(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,17 @@ MwInline void MwWindowMakeBorderless(MwWidget handle, int toggle) {
|
||||||
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
|
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Whether the window should close
|
||||||
|
* @param handle Widget
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
MwInline MwBool MwWindowShouldClose(MwWidget handle) {
|
||||||
|
MwBool res = MwFALSE;
|
||||||
|
MwVaWidgetExecute(handle, "mwWindowShouldClose", NULL, &res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
553
milsko.xml
553
milsko.xml
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0" ?>
|
||||||
<!--
|
<!--
|
||||||
Basically, you have to implement 10+n types:
|
Basically, you have to implement 10+n types:
|
||||||
- Integer (int)
|
- Integer (int)
|
||||||
|
|
@ -38,100 +38,160 @@
|
||||||
<short name="green" unsigned="yes" />
|
<short name="green" unsigned="yes" />
|
||||||
<short name="blue" unsigned="yes" />
|
<short name="blue" unsigned="yes" />
|
||||||
</struct>
|
</struct>
|
||||||
|
<struct name="MwMouse">
|
||||||
|
<struct defname="MwPoint" name="point" />
|
||||||
|
<integer name="button" />
|
||||||
|
</struct>
|
||||||
|
<struct name="MwVulkanConfig">
|
||||||
|
<integer name="api_version" unsigned="yes" />
|
||||||
|
<integer name="vk_version" unsigned="yes" />
|
||||||
|
<integer name="validation_layers" />
|
||||||
|
</struct>
|
||||||
</structs>
|
</structs>
|
||||||
<!--
|
<!--
|
||||||
All widgets have:
|
All widgets have properties that are common="yes".
|
||||||
- MwNbackground
|
|
||||||
- MwNsubBackground
|
|
||||||
- MwNforeground
|
|
||||||
- MwNsubForeground
|
|
||||||
- MwNx
|
|
||||||
- MwNy
|
|
||||||
- MwNwidth
|
|
||||||
- MwNheight
|
|
||||||
- MwNborderWidth
|
|
||||||
- MwNbackgroundPixmap
|
|
||||||
- MwNratio
|
|
||||||
- MwNfixedSize
|
|
||||||
- MwNbitmapFont
|
|
||||||
- MwNforceInverted
|
|
||||||
|
|
||||||
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.
|
||||||
Handler properties must be prefixed with C.
|
Handler properties must be prefixed with C.
|
||||||
Other properties must be prefixed with V.
|
Other properties must be prefixed with V.
|
||||||
|
|
||||||
|
"Early" properties must have letter "E" as 2nd letter.
|
||||||
|
e.g. vulkanExtension would be SEvulkanExtension
|
||||||
-->
|
-->
|
||||||
<properties>
|
<properties>
|
||||||
<integer name="x" />
|
<integer name="x" common="yes" />
|
||||||
<integer name="y" />
|
<integer name="y" common="yes" />
|
||||||
<integer name="width" />
|
<integer name="width" common="yes" />
|
||||||
<integer name="height" />
|
<integer name="height" common="yes" />
|
||||||
<integer name="orientation" />
|
<integer name="orientation" />
|
||||||
<integer name="minValue" />
|
<integer name="minValue" />
|
||||||
<integer name="maxValue" />
|
<integer name="maxValue" />
|
||||||
<integer name="value" />
|
<integer name="value" />
|
||||||
<integer name="changedBy" />
|
<integer name="changedBy" />
|
||||||
<integer name="areaShown" />
|
<integer name="areaShown" />
|
||||||
<integer name="checked" />
|
<integer name="checked" boolean="yes" />
|
||||||
<integer name="alignment" />
|
<integer name="alignment" />
|
||||||
<integer name="bold" />
|
<integer name="bold" boolean="yes" />
|
||||||
<integer name="main" />
|
<integer name="main" boolean="yes" />
|
||||||
<integer name="leftPadding" />
|
<integer name="leftPadding" />
|
||||||
<integer name="hasHeading" />
|
<integer name="hasHeading" boolean="yes" />
|
||||||
<integer name="hasBorder" />
|
<integer name="hasBorder" boolean="yes" />
|
||||||
<integer name="inverted" />
|
<integer name="inverted" boolean="yes" />
|
||||||
<integer name="modernLook" />
|
<integer name="modernLook" common="yes" boolean="yes" />
|
||||||
<integer name="waitMS" />
|
<integer name="hideInput" boolean="yes" />
|
||||||
<integer name="hideInput" />
|
<integer name="singleClickSelectable" boolean="yes" />
|
||||||
<integer name="singleClickSelectable" />
|
<integer name="flat" boolean="yes" />
|
||||||
<integer name="flat" />
|
<integer name="showArrows" boolean="yes" />
|
||||||
<integer name="showArrows" />
|
|
||||||
<integer name="padding" />
|
<integer name="padding" />
|
||||||
<integer name="borderWidth" />
|
<integer name="borderWidth" common="yes" />
|
||||||
<integer name="ratio" />
|
<integer name="ratio" common="yes" />
|
||||||
<integer name="fixedSize" />
|
<integer name="fixedSize" common="yes" />
|
||||||
<integer name="margin" />
|
<integer name="margin" />
|
||||||
<integer name="bitmapFont" />
|
<integer name="bitmapFont" common="yes" boolean="yes" />
|
||||||
<integer name="sevenSegment" />
|
<integer name="sevenSegment" boolean="yes" />
|
||||||
<integer name="length" />
|
<integer name="length" />
|
||||||
<integer name="forceInverted" />
|
<integer name="forceInverted" common="yes" boolean="yes" />
|
||||||
<integer name="roundness" />
|
<integer name="isRounded" common="yes" boolean="yes" />
|
||||||
<integer name="isRounded" />
|
<integer name="darkTheme" common="yes" boolean="yes" />
|
||||||
<integer name="darkTheme" />
|
<integer name="useMonospace" common="yes" boolean="yes" />
|
||||||
|
<integer name="fillArea" />
|
||||||
|
<integer name="darkThemeAutomatic" common="yes" boolean="yes" />
|
||||||
|
<integer name="year" />
|
||||||
|
<integer name="month" />
|
||||||
|
<integer name="date" />
|
||||||
|
<integer name="day" />
|
||||||
|
<integer name="waitLayout" />
|
||||||
|
<integer name="scale" />
|
||||||
|
<integer name="columns" />
|
||||||
|
<integer name="columnSpan" column="yes" />
|
||||||
|
<integer name="rowSpan" column="yes" />
|
||||||
|
|
||||||
|
<!-- waitMS is a special property, only applies to toplevel widget -->
|
||||||
|
<integer name="waitMS" common="yes" />
|
||||||
|
|
||||||
<string name="title" />
|
<string name="title" />
|
||||||
<string name="text" />
|
<string name="text" />
|
||||||
<string name="background" />
|
<string name="background" common="yes" />
|
||||||
<string name="subBackground" />
|
<string name="subBackground" common="yes" />
|
||||||
<string name="foreground" />
|
<string name="titleBackground" common="yes" />
|
||||||
<string name="subForeground" />
|
<string name="foreground" common="yes" />
|
||||||
|
<string name="subForeground" common="yes" />
|
||||||
|
<string name="titleForeground" common="yes" />
|
||||||
|
|
||||||
|
<!-- Early string properties -->
|
||||||
|
<string name="vulkanExtension" early="yes" />
|
||||||
|
<string name="vulkanLayer" early="yes" />
|
||||||
|
|
||||||
<pixmap name="pixmap" />
|
<pixmap name="pixmap" />
|
||||||
<pixmap name="iconPixmap" />
|
<pixmap name="iconPixmap" />
|
||||||
<struct defname="MwSizeHints" pointer="yes" name="sizeHints" />
|
<struct defname="MwSizeHints" pointer="yes" name="sizeHints" />
|
||||||
<pointer name="font" />
|
<pointer name="font" />
|
||||||
<pointer name="boldFont" />
|
<pointer name="boldFont" />
|
||||||
|
<pixmap name="backgroundPixmap" common="yes" />
|
||||||
|
<pointer name="monospaceFont" />
|
||||||
|
<pointer name="boldMonospaceFont" />
|
||||||
|
|
||||||
<handler name="activate" />
|
<!-- Early void properties -->
|
||||||
<handler name="resize" />
|
<struct
|
||||||
<handler name="tick" />
|
defname="MwVulkanConfig"
|
||||||
<handler name="menu" />
|
early="yes"
|
||||||
<handler name="mouseDown" />
|
pointer="yes"
|
||||||
<handler name="mouseUp" />
|
name="vulkanConfig"
|
||||||
<handler name="mouseMove" />
|
/>
|
||||||
<handler name="changed" />
|
|
||||||
<handler name="key" />
|
|
||||||
<handler name="keyRelease" />
|
|
||||||
<handler name="close" />
|
|
||||||
<handler name="focusIn" />
|
|
||||||
<handler name="focusOut" />
|
|
||||||
<handler name="fileChosen" />
|
|
||||||
<handler name="directoryChosen" />
|
|
||||||
<handler name="colorChosen" />
|
|
||||||
<handler name="draw" />
|
|
||||||
<handler name="clipboard" />
|
|
||||||
<handler name="darkTheme" />
|
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="activate" />
|
||||||
|
<handler name="listBoxActivate">
|
||||||
|
<integer pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="treeViewActivate">
|
||||||
|
<pointer />
|
||||||
|
</handler>
|
||||||
|
<handler name="resize" common="yes" />
|
||||||
|
<handler name="tick" common="yes" />
|
||||||
|
<handler name="menu">
|
||||||
|
<pointer />
|
||||||
|
</handler>
|
||||||
|
<handler name="mouseDown" common="yes">
|
||||||
|
<struct defname="MwMouse" pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="mouseUp" common="yes">
|
||||||
|
<struct defname="MwMouse" pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="mouseMove" common="yes">
|
||||||
|
<struct defname="MwPoint" pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="changed" />
|
||||||
|
<handler name="comboBoxChanged">
|
||||||
|
<integer pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="key" common="yes">
|
||||||
|
<integer pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="keyRelease" common="yes">
|
||||||
|
<integer pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="close" />
|
||||||
|
<handler name="focusIn" common="yes" />
|
||||||
|
<handler name="focusOut" common="yes" />
|
||||||
|
<handler name="fileChosen">
|
||||||
|
<string />
|
||||||
|
</handler>
|
||||||
|
<handler name="directoryChosen">
|
||||||
|
<string />
|
||||||
|
</handler>
|
||||||
|
<handler name="colorChosen">
|
||||||
|
<struct defname="MwRGB" pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
<handler name="draw" />
|
||||||
|
<handler name="clipboard" common="yes">
|
||||||
|
<string />
|
||||||
|
</handler>
|
||||||
|
<handler name="darkTheme" common="yes">
|
||||||
|
<integer pointer="yes" />
|
||||||
|
</handler>
|
||||||
|
</handlers>
|
||||||
<enumerations>
|
<enumerations>
|
||||||
<enumeration name="MwDIRECTION">
|
<enumeration name="MwDIRECTION">
|
||||||
<integer name="MwNORTH">0</integer>
|
<integer name="MwNORTH">0</integer>
|
||||||
|
|
@ -157,22 +217,67 @@
|
||||||
<integer name="MwMB_ICONERROR" />
|
<integer name="MwMB_ICONERROR" />
|
||||||
<integer name="MwMB_ICONCLOCK" />
|
<integer name="MwMB_ICONCLOCK" />
|
||||||
</enumeration>
|
</enumeration>
|
||||||
|
<enumeration name="MwCOORDINATE">
|
||||||
|
<integer name="MwCOORDINATE_GLOBAL">0</integer>
|
||||||
|
<integer name="MwCOORDINATE_LOCAL" />
|
||||||
|
</enumeration>
|
||||||
|
<enumeration name="MwCLIPBOARD">
|
||||||
|
<integer name="MwCLIPBOARD_MAIN">0</integer>
|
||||||
|
<integer name="MwCLIPBOARD_PRIMARY" />
|
||||||
|
</enumeration>
|
||||||
|
<enumeration name="MwMOUSE">
|
||||||
|
<integer name="MwMOUSE_LEFT">1</integer>
|
||||||
|
<integer name="MwMOUSE_MIDDLE" />
|
||||||
|
<integer name="MwMOUSE_RIGHT" />
|
||||||
|
<integer name="MwMOUSE_WHEELUP" />
|
||||||
|
<integer name="MwMOUSE_WHEELDOWN" />
|
||||||
|
</enumeration>
|
||||||
|
<enumeration name="MwKEY">
|
||||||
|
<integer name="MwKEY_BACKSPACE">0x80000001</integer>
|
||||||
|
<integer name="MwKEY_LEFT" />
|
||||||
|
<integer name="MwKEY_RIGHT" />
|
||||||
|
<integer name="MwKEY_UP" />
|
||||||
|
<integer name="MwKEY_DOWN" />
|
||||||
|
<integer name="MwKEY_ENTER" />
|
||||||
|
<integer name="MwKEY_ESCAPE" />
|
||||||
|
<integer name="MwKEY_LEFTSHIFT" />
|
||||||
|
<integer name="MwKEY_RIGHTSHIFT" />
|
||||||
|
<integer name="MwKEY_ALT" />
|
||||||
|
<integer name="MwKEY_CONTROL" />
|
||||||
|
</enumeration>
|
||||||
|
<enumeration name="MwVULKANFIELD">
|
||||||
|
<integer name="MwVULKANFIELD_GETINSTANCEPROCADDR">0</integer>
|
||||||
|
<integer name="MwVULKANFIELD_INSTANCE" />
|
||||||
|
<integer name="MwVULKANFIELD_SURFACE" />
|
||||||
|
<integer name="MwVULKANFIELD_PHYSICALDEVICE" />
|
||||||
|
<integer name="MwVULKANFIELD_LOGICALDEVICE" />
|
||||||
|
<integer name="MwVULKANFIELD_GRAPHICSQUEUEINDEX" />
|
||||||
|
<integer name="MwVULKANFIELD_PRESENTQUEUEINDEX" />
|
||||||
|
<integer name="MwVULKANFIELD_GRAPHICSQUEUE" />
|
||||||
|
<integer name="MwVULKANFIELD_PRESENTQUEUE" />
|
||||||
|
</enumeration>
|
||||||
</enumerations>
|
</enumerations>
|
||||||
|
<!-- You can assume all constants are unsigned -->
|
||||||
<constants>
|
<constants>
|
||||||
<integer name="MwDEFAULT">0x0fffffff</integer>
|
<integer name="MwDEFAULT">0x0fffffff</integer>
|
||||||
|
|
||||||
<integer name="MwMB_ICONMASK">0xf</integer>
|
<integer name="MwMB_ICONMASK">0xf</integer>
|
||||||
<integer name="MwMB_BUTTONMASK">0xf0</integer>
|
<integer name="MwMB_BUTTONMASK">0xf0</integer>
|
||||||
<integer name="MwMB_BUTTONOK">0x10</integer>
|
<integer name="MwMB_BUTTONOK">0x10</integer>
|
||||||
<integer name="MwMB_BUTTONCANCEL">0x20</integer>
|
<integer name="MwMB_BUTTONCANCEL">0x20</integer>
|
||||||
<integer name="MwMB_BUTTONYES">0x40</integer>
|
<integer name="MwMB_BUTTONYES">0x40</integer>
|
||||||
<integer name="MwMB_BUTTONNO">0x80</integer>
|
<integer name="MwMB_BUTTONNO">0x80</integer>
|
||||||
|
|
||||||
|
<integer name="MwKEY_FLAG">0x80000000</integer>
|
||||||
|
<integer name="MwKEY_CONTROL_FLAG">0xc0000000</integer>
|
||||||
|
<integer name="MwKEY_ALT_FLAG">0xa0000000</integer>
|
||||||
</constants>
|
</constants>
|
||||||
<headers>
|
<headers>
|
||||||
<header name="ColorChooser">
|
<header name="Dialog/ColorPicker">
|
||||||
<functions>
|
<functions>
|
||||||
<function name="MwColorChooser">
|
<function name="MwColorPicker">
|
||||||
<return>
|
<return>
|
||||||
<widget />
|
<widget type="Window" />
|
||||||
</return>
|
</return>
|
||||||
<arguments>
|
<arguments>
|
||||||
<widget name="handle" />
|
<widget name="handle" />
|
||||||
|
|
@ -410,22 +515,69 @@
|
||||||
<struct defname="MwRect" pointer="yes" name="rect" />
|
<struct defname="MwRect" pointer="yes" name="rect" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
</functions>
|
<function name="MwGetClipboard">
|
||||||
</header>
|
<arguments>
|
||||||
<header name="Error">
|
<widget name="handle" />
|
||||||
<functions>
|
<integer enumname="MwClipboardType" name="clipboard_type" />
|
||||||
<function name="MwGetLastError">
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="MwGetClass">
|
||||||
<return>
|
<return>
|
||||||
<string />
|
<class />
|
||||||
</return>
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="MwSetUser">
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
<pointer name="user" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="MwGetUser">
|
||||||
|
<return>
|
||||||
|
<pointer />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="MwFreeWidget">
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
</functions>
|
</functions>
|
||||||
</header>
|
</header>
|
||||||
<header name="FileChooser">
|
<header name="Dialog/FileChooser">
|
||||||
<functions>
|
<functions>
|
||||||
<function name="MwFileChooser">
|
<function name="MwFileChooser">
|
||||||
<return>
|
<return>
|
||||||
<widget />
|
<widget type="Window" />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
<string name="title" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="MwFileChooserEx">
|
||||||
|
<return>
|
||||||
|
<widget type="Window" />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
<string name="title" />
|
||||||
|
<integer name="dir" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
</functions>
|
||||||
|
</header>
|
||||||
|
<header name="Dialog/DirectoryChooser">
|
||||||
|
<functions>
|
||||||
|
<function name="MwDirectoryChooser">
|
||||||
|
<return>
|
||||||
|
<widget type="Window" />
|
||||||
</return>
|
</return>
|
||||||
<arguments>
|
<arguments>
|
||||||
<widget name="handle" />
|
<widget name="handle" />
|
||||||
|
|
@ -434,11 +586,11 @@
|
||||||
</function>
|
</function>
|
||||||
</functions>
|
</functions>
|
||||||
</header>
|
</header>
|
||||||
<header name="MessageBox">
|
<header name="Dialog/MessageBox">
|
||||||
<functions>
|
<functions>
|
||||||
<function name="MwMessageBox">
|
<function name="MwMessageBox">
|
||||||
<return>
|
<return>
|
||||||
<widget />
|
<widget type="Window" />
|
||||||
</return>
|
</return>
|
||||||
<arguments>
|
<arguments>
|
||||||
<widget name="handle" />
|
<widget name="handle" />
|
||||||
|
|
@ -449,59 +601,18 @@
|
||||||
</function>
|
</function>
|
||||||
<function name="MwMessageBoxGetChild">
|
<function name="MwMessageBoxGetChild">
|
||||||
<return>
|
<return>
|
||||||
<widget />
|
<widget type="Button" />
|
||||||
</return>
|
</return>
|
||||||
<arguments>
|
<arguments>
|
||||||
<widget name="handle" />
|
<widget name="handle" type="Window" />
|
||||||
<integer name="child" />
|
<integer name="child" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
<function name="MwMessageBoxDestroy">
|
|
||||||
<arguments>
|
|
||||||
<widget name="handle" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
</functions>
|
|
||||||
</header>
|
|
||||||
<header name="Widget/ListBox.h">
|
|
||||||
<functions>
|
|
||||||
<function name="MwListBoxCreatePacket">
|
|
||||||
<return>
|
|
||||||
<pointer />
|
|
||||||
</return>
|
|
||||||
</function>
|
|
||||||
<function name="MwListBoxDestroyPacket">
|
|
||||||
<arguments>
|
|
||||||
<pointer name="packet" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwListBoxPacketInsert">
|
|
||||||
<return>
|
|
||||||
<integer />
|
|
||||||
</return>
|
|
||||||
<arguments>
|
|
||||||
<pointer name="packet" />
|
|
||||||
<integer name="index" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwListBoxPacketSet">
|
|
||||||
<arguments>
|
|
||||||
<pointer name="packet" />
|
|
||||||
<integer name="index" />
|
|
||||||
<integer name="col" />
|
|
||||||
<string name="text" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="MwListBoxPacketSetIcon">
|
|
||||||
<arguments>
|
|
||||||
<pointer name="packet" />
|
|
||||||
<integer name="index" />
|
|
||||||
<pixmap name="icon" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
</functions>
|
</functions>
|
||||||
</header>
|
</header>
|
||||||
</headers>
|
</headers>
|
||||||
|
|
||||||
|
<!-- Widget functions are prefixed with mw<widget name> -->
|
||||||
<widgets>
|
<widgets>
|
||||||
<widget name="Box">
|
<widget name="Box">
|
||||||
<properties>
|
<properties>
|
||||||
|
|
@ -510,6 +621,7 @@
|
||||||
<property name="padding" />
|
<property name="padding" />
|
||||||
<property name="hasBorder" />
|
<property name="hasBorder" />
|
||||||
<property name="inverted" />
|
<property name="inverted" />
|
||||||
|
<property name="waitLayout" />
|
||||||
</properties>
|
</properties>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="Button">
|
<widget name="Button">
|
||||||
|
|
@ -520,22 +632,43 @@
|
||||||
<property name="padding" />
|
<property name="padding" />
|
||||||
<property name="fillArea" />
|
<property name="fillArea" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="activate" />
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
|
</widget>
|
||||||
|
<widget name="Calendar">
|
||||||
|
<properties>
|
||||||
|
<property name="year" />
|
||||||
|
<property name="month" />
|
||||||
|
<property name="date" />
|
||||||
|
<property name="day" />
|
||||||
|
<property name="scale" />
|
||||||
|
</properties>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="CheckBox">
|
<widget name="CheckBox">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="checked" />
|
<property name="checked" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="Entry">
|
<widget name="Entry">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="text" />
|
<property name="text" />
|
||||||
<property name="hideInput" />
|
<property name="hideInput" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="activate" />
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="Frame">
|
<widget name="Frame">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="hasBorder" />
|
<property name="hasBorder" />
|
||||||
<property name="inverted" />
|
<property name="inverted" />
|
||||||
|
<property name="iconPixmap" />
|
||||||
</properties>
|
</properties>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="Image">
|
<widget name="Image">
|
||||||
|
|
@ -570,11 +703,24 @@
|
||||||
<property name="hasHeading" />
|
<property name="hasHeading" />
|
||||||
<property name="singleClickSelectable" />
|
<property name="singleClickSelectable" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="listBoxActivate" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="Insert">
|
<function name="Set">
|
||||||
|
<return>
|
||||||
|
<integer />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<integer name="row" />
|
||||||
|
<integer name="col" />
|
||||||
|
<string name="text" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="SetIcon">
|
||||||
<arguments>
|
<arguments>
|
||||||
<integer name="index" />
|
<integer name="index" />
|
||||||
<pointer name="packet" />
|
<pixmap name="icon" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
<function name="Delete">
|
<function name="Delete">
|
||||||
|
|
@ -600,6 +746,9 @@
|
||||||
</functions>
|
</functions>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="Menu">
|
<widget name="Menu">
|
||||||
|
<handlers>
|
||||||
|
<handler name="menu" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="Add">
|
<function name="Add">
|
||||||
<return>
|
<return>
|
||||||
|
|
@ -616,20 +765,10 @@
|
||||||
<properties>
|
<properties>
|
||||||
<property name="text" />
|
<property name="text" />
|
||||||
</properties>
|
</properties>
|
||||||
</widget>
|
<handlers>
|
||||||
<widget name="OpenGL">
|
<handler name="activate" />
|
||||||
<functions>
|
<handler name="changed" />
|
||||||
<function name="MakeCurrent" />
|
</handlers>
|
||||||
<function name="GetProcAddress">
|
|
||||||
<return>
|
|
||||||
<pointer />
|
|
||||||
</return>
|
|
||||||
<arguments>
|
|
||||||
<string name="name" />
|
|
||||||
</arguments>
|
|
||||||
</function>
|
|
||||||
<function name="SwapBuffer" />
|
|
||||||
</functions>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="ScrollBar">
|
<widget name="ScrollBar">
|
||||||
<properties>
|
<properties>
|
||||||
|
|
@ -639,8 +778,10 @@
|
||||||
<property name="minValue" />
|
<property name="minValue" />
|
||||||
<property name="maxValue" />
|
<property name="maxValue" />
|
||||||
<property name="orientation" />
|
<property name="orientation" />
|
||||||
<property name="showArrows" />
|
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="GetVisibleLength">
|
<function name="GetVisibleLength">
|
||||||
<return>
|
<return>
|
||||||
|
|
@ -658,6 +799,13 @@
|
||||||
<arguments>
|
<arguments>
|
||||||
<pointer name="menu" />
|
<pointer name="menu" />
|
||||||
<struct defname="MwPoint" pointer="yes" name="point" />
|
<struct defname="MwPoint" pointer="yes" name="point" />
|
||||||
|
<integer name="diff_calc" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="GetSize">
|
||||||
|
<arguments>
|
||||||
|
<pointer name="menu" />
|
||||||
|
<struct defname="MwRect" pointer="yes" name="rect" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
</functions>
|
</functions>
|
||||||
|
|
@ -686,6 +834,12 @@
|
||||||
<property name="hasBorder" />
|
<property name="hasBorder" />
|
||||||
<property name="inverted" />
|
<property name="inverted" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="colorChosen" />
|
||||||
|
<handler name="fileChosen" />
|
||||||
|
<handler name="directoryChosen" />
|
||||||
|
<handler name="close" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="MakeBorderless" />
|
<function name="MakeBorderless" />
|
||||||
</functions>
|
</functions>
|
||||||
|
|
@ -701,12 +855,18 @@
|
||||||
<properties>
|
<properties>
|
||||||
<property name="checked" />
|
<property name="checked" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
</widget>
|
</widget>
|
||||||
<widget name="ComboBox">
|
<widget name="ComboBox">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="areaShown" />
|
<property name="areaShown" />
|
||||||
<property name="value" />
|
<property name="value" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="comboBoxChanged" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="Add">
|
<function name="Add">
|
||||||
<integer name="index" />
|
<integer name="index" />
|
||||||
|
|
@ -719,17 +879,124 @@
|
||||||
<property name="leftPadding" />
|
<property name="leftPadding" />
|
||||||
<property name="singleClickSelectable" />
|
<property name="singleClickSelectable" />
|
||||||
</properties>
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="treeViewActivate" />
|
||||||
|
</handlers>
|
||||||
<functions>
|
<functions>
|
||||||
<function name="Add">
|
<function name="Add">
|
||||||
<pointer name="parent" />
|
<arguments>
|
||||||
<pixmap name="pixmap" />
|
<pointer name="parent" />
|
||||||
<string name="item" />
|
<pixmap name="pixmap" />
|
||||||
|
<string name="item" />
|
||||||
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
<function name="Delete">
|
<function name="Delete">
|
||||||
<pointer name="item" />
|
<arguments>
|
||||||
|
<pointer name="item" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="SetOpened">
|
||||||
|
<arguments>
|
||||||
|
<pointer name="item" />
|
||||||
|
<integer name="opened" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="GetOpened">
|
||||||
|
<return>
|
||||||
|
<integer />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<pointer name="item" />
|
||||||
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
<function name="Reset" />
|
<function name="Reset" />
|
||||||
</functions>
|
</functions>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget name="SubWindow">
|
||||||
|
<properties>
|
||||||
|
<property name="iconPixmap" />
|
||||||
|
<property name="title" />
|
||||||
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="close" />
|
||||||
|
</handlers>
|
||||||
|
<functions>
|
||||||
|
<function name="GetFrame">
|
||||||
|
<return>
|
||||||
|
<widget />
|
||||||
|
</return>
|
||||||
|
</function>
|
||||||
|
</functions>
|
||||||
|
</widget>
|
||||||
|
<widget name="Table">
|
||||||
|
<properties>
|
||||||
|
<property name="columns" />
|
||||||
|
<property name="margin" />
|
||||||
|
<property name="padding" />
|
||||||
|
<property name="hasBorder" />
|
||||||
|
<property name="inverted" />
|
||||||
|
<property name="waitLayout" />
|
||||||
|
</properties>
|
||||||
|
</widget>
|
||||||
|
<widget name="Tab">
|
||||||
|
<properties>
|
||||||
|
<property name="value" />
|
||||||
|
</properties>
|
||||||
|
<handlers>
|
||||||
|
<handler name="changed" />
|
||||||
|
</handlers>
|
||||||
|
<functions>
|
||||||
|
<function name="Add">
|
||||||
|
<return>
|
||||||
|
<widget />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<string name="name" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="GetFrame">
|
||||||
|
<return>
|
||||||
|
<widget />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<string name="name" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="Focus">
|
||||||
|
<arguments>
|
||||||
|
<string name="name" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
</functions>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<!-- They are not alphabetically sorted for reasons -->
|
||||||
|
<widget name="OpenGL">
|
||||||
|
<functions>
|
||||||
|
<function name="MakeCurrent" />
|
||||||
|
<function name="GetProcAddress">
|
||||||
|
<return>
|
||||||
|
<pointer />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<string name="name" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
<function name="SwapBuffer" />
|
||||||
|
</functions>
|
||||||
|
</widget>
|
||||||
|
<widget name="Vulkan">
|
||||||
|
<functions>
|
||||||
|
<function name="GetField">
|
||||||
|
<return>
|
||||||
|
<pointer />
|
||||||
|
</return>
|
||||||
|
<arguments>
|
||||||
|
<integer enumname="MwVulkanField" name="field" />
|
||||||
|
<integer pointer="yes" name="output" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
|
</functions>
|
||||||
|
</widget>
|
||||||
</widgets>
|
</widgets>
|
||||||
</milsko>
|
</milsko>
|
||||||
|
|
|
||||||
12
pl/ostype/ClassicMacOS.pl
Normal file
12
pl/ostype/ClassicMacOS.pl
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
use_backend("classicmacos");
|
||||||
|
|
||||||
|
print(
|
||||||
|
"Compiling for Classic Mac OS via ./configure currently outputs a broken executable and it only supports PowerPC. Help is wanted. In the mean time, use CMake."
|
||||||
|
);
|
||||||
|
|
||||||
|
$cc = $ENV{RETRO68_TOOLCHAIN_PATH} . "/bin/powerpc-apple-macos-gcc";
|
||||||
|
$ar = $ENV{RETRO68_TOOLCHAIN_PATH} . "/bin/powerpc-apple-macos-ar";
|
||||||
|
add_cflags("-DCLASSIC_MAC_OS");
|
||||||
|
add_cflags("-DSTBI_NO_THREAD_LOCALS");
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
$library_suffix = ".dylib";
|
$library_suffix = ".dylib";
|
||||||
set_shared_flag("-dynamiclib");
|
set_shared_flag("-dynamiclib");
|
||||||
|
|
||||||
use_backend("cocoa");
|
#use_backend("cocoa");
|
||||||
|
new_object("src/backend/nococoa.m");
|
||||||
|
|
||||||
add_cflags("-DSTBI_NO_THREAD_LOCALS");
|
add_cflags("-DSTBI_NO_THREAD_LOCALS");
|
||||||
add_ldflags("-framework Cocoa -lobjc");
|
add_ldflags("-framework Cocoa -lobjc");
|
||||||
|
|
|
||||||
19
pl/ostype/FreeBSD.pl
Normal file
19
pl/ostype/FreeBSD.pl
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
my @enabled_backends = ();
|
||||||
|
|
||||||
|
add_incdir2("-I/usr/local/include");
|
||||||
|
add_libdir("-L/usr/local/lib -Wl,-R/usr/local/lib");
|
||||||
|
|
||||||
|
if (param_get("wayland") && not(param_get("tiny"))) {
|
||||||
|
push(@enabled_backends, "wayland");
|
||||||
|
}
|
||||||
|
if (param_get("x11")) {
|
||||||
|
push(@enabled_backends, "x11");
|
||||||
|
}
|
||||||
|
|
||||||
|
use_backend(@enabled_backends);
|
||||||
|
|
||||||
|
add_libs("-lpthread");
|
||||||
|
|
||||||
|
add_cflags("-DUSE_DBUS");
|
||||||
|
|
||||||
|
1;
|
||||||
3
pl/ostype/Haiku.pl
Normal file
3
pl/ostype/Haiku.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
use_backend("haiku");
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
if (param_get("wayland")) {
|
my @enabled_backends = ();
|
||||||
use_backend("wayland", "x11");
|
|
||||||
|
if (param_get("wayland") && not(param_get("tiny"))) {
|
||||||
|
push(@enabled_backends, "wayland");
|
||||||
}
|
}
|
||||||
else {
|
if (param_get("x11")) {
|
||||||
use_backend("x11");
|
push(@enabled_backends, "x11");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_cflags("-DUSE_DBUS");
|
||||||
|
|
||||||
|
use_backend(@enabled_backends);
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
add_incdir("-I/usr/X11R7/include -I/usr/pkg/include");
|
add_incdir2("-I/usr/X11R7/include -I/usr/pkg/include");
|
||||||
add_libdir(
|
add_libdir(
|
||||||
"-L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib");
|
"-L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib");
|
||||||
use_backend("x11");
|
use_backend("x11");
|
||||||
add_libs("-lpthread");
|
add_libs("-lpthread");
|
||||||
|
|
||||||
|
add_cflags("-DUSE_DBUS");
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
8
pl/ostype/OpenBSD.pl
Normal file
8
pl/ostype/OpenBSD.pl
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
add_incdir2("-I/usr/local/include");
|
||||||
|
add_libdir("-L/usr/local/lib -Wl,-R/usr/local/lib");
|
||||||
|
use_backend("x11");
|
||||||
|
add_libs("-lpthread");
|
||||||
|
|
||||||
|
add_cflags("-DUSE_DBUS");
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
@ -4,5 +4,7 @@ $executable_suffix = ".exe";
|
||||||
$math = "";
|
$math = "";
|
||||||
add_ldflags("-Wl,--out-implib,src/libMw.dll.a -static-libgcc");
|
add_ldflags("-Wl,--out-implib,src/libMw.dll.a -static-libgcc");
|
||||||
use_backend("gdi");
|
use_backend("gdi");
|
||||||
|
add_libs("-lole32");
|
||||||
|
add_libs("-luuid");
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
96
pl/rules.pl
96
pl/rules.pl
|
|
@ -1,20 +1,30 @@
|
||||||
new_object("src/*.c");
|
new_object("src/*.c");
|
||||||
|
|
||||||
my $gl_libs = "";
|
my $gl_libs = "";
|
||||||
|
if (param_get("tiny")) {
|
||||||
|
add_cflags("-Oz");
|
||||||
|
if (defined($ENV{CC}) && grep(/^clang$/, $ENV{CC})) {
|
||||||
|
add_libs("-flto=full");
|
||||||
|
add_cflags("-flto=full");
|
||||||
|
}
|
||||||
|
add_cflags("-fdata-sections -ffunction-sections");
|
||||||
|
add_libs("-Wl,--gc-sections");
|
||||||
|
|
||||||
|
# these don't actually disable either, they're here for the final output.
|
||||||
|
param_set("wayland", 0);
|
||||||
|
param_set("dbus", 0);
|
||||||
|
}
|
||||||
if (param_get("classic-theme")) {
|
if (param_get("classic-theme")) {
|
||||||
add_cflags("-DUSE_CLASSIC_THEME");
|
add_cflags("-DUSE_CLASSIC_THEME");
|
||||||
}
|
}
|
||||||
if (grep(/^x11$/, @backends)) {
|
if (grep(/^x11$/, @backends)) {
|
||||||
add_cflags("-DUSE_X11");
|
add_cflags("-DUSE_X11");
|
||||||
new_object("src/backend/x11.c");
|
new_object("src/backend/x11.c");
|
||||||
add_libs("-lX11");
|
|
||||||
|
|
||||||
$gl_libs = "-lGL -lGLU";
|
$gl_libs = "-lGL -lGLU";
|
||||||
|
|
||||||
if (param_get("xrender")) {
|
if (param_get("xrender")) {
|
||||||
add_cflags("-DUSE_XRENDER");
|
add_cflags("-DUSE_XRENDER");
|
||||||
add_libs("-lXrender");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,9 +36,21 @@ if (grep(/^gdi$/, @backends)) {
|
||||||
$gl_libs = "-lopengl32 -lglu32";
|
$gl_libs = "-lopengl32 -lglu32";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (grep(/^classicmacos$/, @backends)) {
|
||||||
|
|
||||||
|
#add_cflags("-DCLASSIC_MAC_OS");
|
||||||
|
new_object("src/backend/classicmacos.c");
|
||||||
|
|
||||||
|
$gl_libs = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (grep(/^wayland$/, @backends)) {
|
if (grep(/^wayland$/, @backends)) {
|
||||||
add_cflags("-DUSE_WAYLAND");
|
add_cflags("-DUSE_WAYLAND");
|
||||||
new_object("src/backend/wayland.c");
|
new_object("src/backend/cairo.c");
|
||||||
|
new_object("src/backend/wayland/wayland.c");
|
||||||
|
new_object("src/backend/wayland/buffer.c");
|
||||||
|
new_object("src/backend/wayland/interfaces.c");
|
||||||
|
new_object("src/backend/wayland/region.c");
|
||||||
|
|
||||||
if (param_get("opengl")) {
|
if (param_get("opengl")) {
|
||||||
add_cflags("-DWAYLAND_LOAD_OPENGL");
|
add_cflags("-DWAYLAND_LOAD_OPENGL");
|
||||||
|
|
@ -43,43 +65,80 @@ if (grep(/^wayland$/, @backends)) {
|
||||||
scan_wayland_protocol("unstable", "xdg-decoration", "-unstable-v1");
|
scan_wayland_protocol("unstable", "xdg-decoration", "-unstable-v1");
|
||||||
scan_wayland_protocol("unstable", "primary-selection", "-unstable-v1");
|
scan_wayland_protocol("unstable", "primary-selection", "-unstable-v1");
|
||||||
scan_wayland_protocol("unstable", "pointer-constraints", "-unstable-v1");
|
scan_wayland_protocol("unstable", "pointer-constraints", "-unstable-v1");
|
||||||
scan_wayland_protocol("unstable", "relative-pointer", "-unstable-v1");
|
scan_wayland_protocol("unstable", "relative-pointer", "-unstable-v1");
|
||||||
|
scan_wayland_protocol_from_file("wlr-layer-shell",
|
||||||
|
"wlr-layer-shell-unstable-v1.xml");
|
||||||
|
|
||||||
$gl_libs = "-lGL -lGLU";
|
$gl_libs = "-lGL -lGLU";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grep(/^cocoa$/, @backends)) {
|
if (not(param_get("dbus")) && not(param_get("tiny"))) {
|
||||||
|
$cflags =~ s/( |^)-DUSE_DBUS( |$)/ /;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grep(/( |^)-DUSE_DBUS( |$)/, $cflags)) {
|
||||||
|
add_cflags(`pkg-config --cflags dbus-1`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grep(/^cocoa$/, @backends) || param_get("gnustep")) {
|
||||||
add_cflags("-DUSE_COCOA");
|
add_cflags("-DUSE_COCOA");
|
||||||
new_object("src/backend/cocoa.m");
|
new_object("src/backend/cocoa.m");
|
||||||
|
|
||||||
|
if (param_get("gnustep")) {
|
||||||
|
add_incdir("-I" . `gnustep-config --variable=GNUSTEP_SYSTEM_HEADERS`);
|
||||||
|
add_libdir("-L" . `gnustep-config --variable=GNUSTEP_SYSTEM_LIBRARIES`);
|
||||||
|
add_cflags("-fobjc-runtime=gnustep-2.0 -fblocks");
|
||||||
|
add_ldflags("-lobjc -lgnustep-base -lm -lgnustep-gui");
|
||||||
|
}
|
||||||
|
|
||||||
if (param_get("opengl")) {
|
if (param_get("opengl")) {
|
||||||
new_object("src/widget/opengl_cocoa.m");
|
new_object("src/widget/opengl_cocoa.m");
|
||||||
}
|
}
|
||||||
|
|
||||||
# tim cook my man literally everybody and their mother who knows what opengl is knows its deprecated on macos and i'm not having you spam the console with this
|
# John Apple my man literally everybody and their mother who knows what opengl is knows its deprecated on macos and i'm not having you spam the console with this
|
||||||
add_cflags("-DGL_SILENCE_DEPRECATION");
|
add_cflags("-DGL_SILENCE_DEPRECATION");
|
||||||
|
|
||||||
$gl_libs = "-framework OpenGL";
|
$gl_libs = "-framework OpenGL";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (grep(/^haiku$/, @backends)) {
|
||||||
|
add_cflags("-DUSE_HAIKU");
|
||||||
|
new_object("src/backend/haiku.cc");
|
||||||
|
add_libs("-lbe");
|
||||||
|
}
|
||||||
|
|
||||||
if (param_get("stb-image")) {
|
if (param_get("stb-image")) {
|
||||||
add_cflags("-DUSE_STB_IMAGE");
|
add_cflags("-DUSE_STB_IMAGE");
|
||||||
|
if (param_get("tiny")) {
|
||||||
|
add_cflags("-DSTB_IMAGE_STATIC");
|
||||||
|
add_cflags("-DSTB_IMAGE_IMPLEMENTATION");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new_object("external/libjpeg/src/*.c");
|
||||||
|
new_object("external/libpng/src/*.c");
|
||||||
|
add_incdir("-Iexternal/libjpeg/include -Iexternal/libpng/include");
|
||||||
}
|
}
|
||||||
if (param_get("stb-truetype")) {
|
if (param_get("stb-truetype")) {
|
||||||
add_cflags("-DUSE_STB_TRUETYPE");
|
add_cflags("-DUSE_STB_TRUETYPE");
|
||||||
}
|
}
|
||||||
|
if (param_get("allow-sloppy-focus")) {
|
||||||
|
add_cflags("-DALLOW_SLOPPY_FOCUS");
|
||||||
|
}
|
||||||
|
|
||||||
|
add_incdir("-Iexternal/libz/include");
|
||||||
|
|
||||||
if (param_get("freetype2")) {
|
if (param_get("freetype2")) {
|
||||||
add_cflags("-DUSE_FREETYPE2");
|
add_cflags("-DUSE_FREETYPE2");
|
||||||
if ($cross) {
|
if (!$cross) {
|
||||||
add_libs("-lfreetype");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
add_cflags(`pkg-config --cflags freetype2`);
|
add_cflags(`pkg-config --cflags freetype2`);
|
||||||
add_libs(`pkg-config --libs freetype2`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (param_get("gdi-text")) {
|
||||||
|
add_cflags("-DUSE_GDI_TEXT");
|
||||||
|
}
|
||||||
|
|
||||||
if (param_get("vulkan") && param_get("vulkan-string-helper")) {
|
if (param_get("vulkan") && param_get("vulkan-string-helper")) {
|
||||||
add_cflags("-DHAS_VK_ENUM_STRING_HELPER");
|
add_cflags("-DHAS_VK_ENUM_STRING_HELPER");
|
||||||
}
|
}
|
||||||
|
|
@ -91,6 +150,7 @@ new_object("src/text/font/*.c");
|
||||||
|
|
||||||
new_object("src/widget/box.c");
|
new_object("src/widget/box.c");
|
||||||
new_object("src/widget/button.c");
|
new_object("src/widget/button.c");
|
||||||
|
new_object("src/widget/calendar.c");
|
||||||
new_object("src/widget/checkbox.c");
|
new_object("src/widget/checkbox.c");
|
||||||
new_object("src/widget/combobox.c");
|
new_object("src/widget/combobox.c");
|
||||||
new_object("src/widget/entry.c");
|
new_object("src/widget/entry.c");
|
||||||
|
|
@ -105,15 +165,21 @@ new_object("src/widget/radiobox.c");
|
||||||
new_object("src/widget/scrollbar.c");
|
new_object("src/widget/scrollbar.c");
|
||||||
new_object("src/widget/separator.c");
|
new_object("src/widget/separator.c");
|
||||||
new_object("src/widget/submenu.c");
|
new_object("src/widget/submenu.c");
|
||||||
|
new_object("src/widget/subwindow.c");
|
||||||
|
new_object("src/widget/tab.c");
|
||||||
|
new_object("src/widget/table.c");
|
||||||
new_object("src/widget/treeview.c");
|
new_object("src/widget/treeview.c");
|
||||||
new_object("src/widget/viewport.c");
|
new_object("src/widget/viewport.c");
|
||||||
new_object("src/widget/window.c");
|
new_object("src/widget/window.c");
|
||||||
|
|
||||||
|
new_object("src/widget/opengl.c");
|
||||||
|
new_object("src/widget/vulkan.c");
|
||||||
|
|
||||||
if (param_get("opengl")) {
|
if (param_get("opengl")) {
|
||||||
new_object("src/widget/opengl.c");
|
add_cflags("-DMW_OPENGL");
|
||||||
}
|
}
|
||||||
if (param_get("vulkan")) {
|
if (param_get("vulkan")) {
|
||||||
new_object("src/widget/vulkan.c");
|
add_cflags("-DMW_VULKAN");
|
||||||
}
|
}
|
||||||
|
|
||||||
new_object("src/dialog/*.c");
|
new_object("src/dialog/*.c");
|
||||||
|
|
@ -121,6 +187,7 @@ new_object("src/dialog/*.c");
|
||||||
new_object("src/abstract/*.c");
|
new_object("src/abstract/*.c");
|
||||||
|
|
||||||
new_object("external/*.c");
|
new_object("external/*.c");
|
||||||
|
new_object("external/libz/src/*.c");
|
||||||
|
|
||||||
new_example("examples/basic/example");
|
new_example("examples/basic/example");
|
||||||
new_example("examples/basic/rotate");
|
new_example("examples/basic/rotate");
|
||||||
|
|
@ -139,7 +206,10 @@ new_example("examples/basic/box");
|
||||||
new_example("examples/basic/clipboard");
|
new_example("examples/basic/clipboard");
|
||||||
new_example("examples/basic/sevensegment");
|
new_example("examples/basic/sevensegment");
|
||||||
new_example("examples/basic/calculator");
|
new_example("examples/basic/calculator");
|
||||||
|
new_example("examples/basic/filechooser");
|
||||||
new_example("examples/basic/periodic");
|
new_example("examples/basic/periodic");
|
||||||
|
new_example("examples/basic/subwindow");
|
||||||
|
new_example("examples/basic/tab");
|
||||||
|
|
||||||
if (param_get("opengl")) {
|
if (param_get("opengl")) {
|
||||||
new_example("examples/gldemos/boing", $gl_libs);
|
new_example("examples/gldemos/boing", $gl_libs);
|
||||||
|
|
|
||||||
42
pl/utils.pl
42
pl/utils.pl
|
|
@ -5,6 +5,13 @@ sub add_incdir {
|
||||||
$incdir = "${incdir} ${input}";
|
$incdir = "${incdir} ${input}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub add_incdir2 {
|
||||||
|
my $input = $_[0];
|
||||||
|
$input =~ s/\r?\n/ /g;
|
||||||
|
|
||||||
|
$incdir2 = "${incdir2} ${input}";
|
||||||
|
}
|
||||||
|
|
||||||
sub add_cflags {
|
sub add_cflags {
|
||||||
my $input = $_[0];
|
my $input = $_[0];
|
||||||
$input =~ s/\r?\n/ /g;
|
$input =~ s/\r?\n/ /g;
|
||||||
|
|
@ -47,7 +54,7 @@ sub set_shared_flag {
|
||||||
sub new_object {
|
sub new_object {
|
||||||
my @l = glob($_[0]);
|
my @l = glob($_[0]);
|
||||||
foreach my $e (@l) {
|
foreach my $e (@l) {
|
||||||
$e =~ s/\.(c|m)$/$object_suffix/;
|
$e =~ s/\.(cc|c|m)$/$object_suffix/;
|
||||||
push(@library_targets, $e);
|
push(@library_targets, $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +66,7 @@ sub use_backend {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub scan_wayland_protocol_core {
|
sub scan_wayland_protocol_core {
|
||||||
my $proto_c = "src/backend/wayland-core-protocol.c";
|
my $proto_c = "src/backend/wayland/wayland-core-protocol.c";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
system(
|
system(
|
||||||
|
|
@ -91,7 +98,7 @@ sub scan_wayland_protocol {
|
||||||
my $proto = $_[1];
|
my $proto = $_[1];
|
||||||
my $ver = $_[2];
|
my $ver = $_[2];
|
||||||
|
|
||||||
my $proto_c = "src/backend/wayland-${proto}-protocol.c";
|
my $proto_c = "src/backend/wayland/wayland-${proto}-protocol.c";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
system(
|
system(
|
||||||
|
|
@ -118,6 +125,35 @@ sub scan_wayland_protocol {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub scan_wayland_protocol_from_file {
|
||||||
|
my $proto = $_[0];
|
||||||
|
my $file = $_[1];
|
||||||
|
my $proto_c = "src/backend/wayland/wayland-${proto}-protocol.c";
|
||||||
|
|
||||||
|
if (
|
||||||
|
system(
|
||||||
|
"wayland-scanner private-code ./resource/wayland/${file} ${proto_c}"
|
||||||
|
) != 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
print(
|
||||||
|
"^ Error on getting private code for ./resource/wayland/${file}\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new_object($proto_c);
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
system(
|
||||||
|
"wayland-scanner client-header ./resource/wayland/${file} include/Mw/LowLevel/Wayland/${proto}-client-protocol.h"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
print(
|
||||||
|
"^ Error on getting client header for ./resource/wayland/${file}\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
our %params = ();
|
our %params = ();
|
||||||
|
|
||||||
sub param_set {
|
sub param_set {
|
||||||
|
|
|
||||||
BIN
resource/font/OpenSans-Bold.ttf
Normal file
BIN
resource/font/OpenSans-Bold.ttf
Normal file
Binary file not shown.
BIN
resource/font/OpenSans-Regular.ttf
Normal file
BIN
resource/font/OpenSans-Regular.ttf
Normal file
Binary file not shown.
3289
resource/font/cursor.bdf
Normal file
3289
resource/font/cursor.bdf
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
resource/logo/banner-nodejs.png
Normal file
BIN
resource/logo/banner-nodejs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 365 KiB |
|
|
@ -1,14 +1,41 @@
|
||||||
#declare BASE = 1;
|
#declare BASE = 1;
|
||||||
#include "resource/logo/logo.pov"
|
#include "resource/logo/logo.pov"
|
||||||
|
|
||||||
|
#ifdef(VERSION)
|
||||||
|
object {
|
||||||
|
text {
|
||||||
|
ttf "resource/font/IBMPlexSerif.ttf",
|
||||||
|
VERSION,
|
||||||
|
1, 0
|
||||||
|
}
|
||||||
|
scale 5
|
||||||
|
translate <7.5, 0, 1>
|
||||||
|
pigment {
|
||||||
|
color Red
|
||||||
|
}
|
||||||
|
finish {
|
||||||
|
phong 1
|
||||||
|
reflection 0.3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
object {
|
object {
|
||||||
text {
|
text {
|
||||||
ttf "resource/font/IBMPlexSerif.ttf",
|
ttf "resource/font/IBMPlexSerif.ttf",
|
||||||
|
#ifdef(NODEJS)
|
||||||
|
"for Node.JS",
|
||||||
|
#else
|
||||||
"Milsko Toolkit",
|
"Milsko Toolkit",
|
||||||
|
#end
|
||||||
1, 0
|
1, 0
|
||||||
}
|
}
|
||||||
scale 2
|
scale 2
|
||||||
|
#ifdef(NODEJS)
|
||||||
|
translate <5, -1, -1>
|
||||||
|
#else
|
||||||
translate <2.5, -1, -1>
|
translate <2.5, -1, -1>
|
||||||
|
#end
|
||||||
pigment {
|
pigment {
|
||||||
color White
|
color White
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
resource/logo/banner_10.pov
Normal file
2
resource/logo/banner_10.pov
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#declare VERSION="1.0";
|
||||||
|
#include "resource/logo/banner.pov"
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue