ui-layout.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. #ifndef UI_LAYOUT_H_GUARD_
  2. #define UI_LAYOUT_H_GUARD_
  3. #include "raylib.h"
  4. typedef struct UILayout
  5. {
  6. char * layoutname;
  7. int screenWidth;
  8. int screenHeight;
  9. int textureW;
  10. int textureH;
  11. unsigned shortnamelen;
  12. /* Common elements */
  13. Rectangle statusbar;
  14. Rectangle line;
  15. Rectangle helphint;
  16. Rectangle helppanel;
  17. /* Ready screen */
  18. Rectangle dragndropprompt;
  19. Rectangle dragndropbox;
  20. Rectangle buttonLaunch;
  21. Rectangle buttonReset;
  22. /* Options */
  23. Rectangle optiongroup;
  24. Rectangle optionrecursive;
  25. Rectangle optiondhash256;
  26. Rectangle optionbiggerbetter;
  27. Rectangle optionthreshold;
  28. Rectangle optionresolution;
  29. Rectangle optionapply;
  30. Rectangle optionthreads;
  31. /* Sorting screen */
  32. Rectangle leftImage;
  33. Rectangle rightImage;
  34. Rectangle leftTopMeta;
  35. Rectangle rightTopMeta;
  36. Rectangle leftBottomMeta;
  37. Rectangle rightBottomMeta;
  38. Rectangle statsGroupSize;
  39. Rectangle statsGroupCount;
  40. Rectangle statsTotalDupes;
  41. Rectangle imagepaths;
  42. Rectangle buttonNext;
  43. Rectangle buttonDelLeft;
  44. Rectangle buttonDelRight;
  45. Rectangle buttonDelBoth;
  46. Rectangle buttonStopSorting;
  47. Rectangle compareRes;
  48. Rectangle compareResLeft;
  49. Rectangle compareResRight;
  50. Rectangle compareFsize;
  51. Rectangle compareFsizeLeft;
  52. Rectangle compareFsizeRight;
  53. Rectangle compareFtype;
  54. /* Processing screen */
  55. Rectangle progressbar;
  56. Rectangle progreessdesc;
  57. Rectangle buttonPause;
  58. } UILayout;
  59. const UILayout Ui720p =
  60. {
  61. #define L_W 1280
  62. #define L_H 720
  63. #define L_PICW 500
  64. #define L_PICH 500
  65. #define L_PROGRESS_HEIGHT 40
  66. #define L_STATUS_HEIGHT 25
  67. #define L_HELP_CORNER 10
  68. #define L_HELP_W 500
  69. #define L_HELP_H 310
  70. /* Meta */
  71. .layoutname = "1280x720",
  72. .screenWidth = L_W,
  73. .screenHeight = L_H,
  74. .textureW = L_PICW,
  75. .textureH = L_PICH,
  76. .shortnamelen = 100,
  77. /* Common elements */
  78. .statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
  79. .line = { 0, 125, L_W, 10 },
  80. .helphint = { L_W - 95, 50, 57, 39 },
  81. .helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },
  82. /* Ready screen */
  83. .dragndropprompt = { 10, 140, L_W - 20, 25 },
  84. .dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
  85. .buttonLaunch = { L_W - 495, 35, 180, 80 },
  86. .buttonReset = { L_W - 300, 35, 180, 80 },
  87. /* Options */
  88. .optiongroup = { 10, 35, 600, 85 },
  89. .optionrecursive = { 20, 45, 15, 15 },
  90. .optiondhash256 = { 20, 70, 15, 15 },
  91. .optionbiggerbetter = { 20, 95, 15, 15 },
  92. .optionthreshold = { 200, 45, 400, 25 },
  93. .optionresolution = { 390, 85, 150, 25 },
  94. .optionapply = { 545, 85, 55, 25 },
  95. .optionthreads = { 260, 85, 125, 25 },
  96. /* Sorting screen: images */
  97. .leftImage = { 25, 160, L_PICW, L_PICH },
  98. .rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
  99. .leftTopMeta = { 25, 135, L_PICW, 25 },
  100. .rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
  101. .leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
  102. .rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },
  103. /* Sorting screen: stats */
  104. .statsGroupSize = { 20, 30, 180, 25 },
  105. .statsGroupCount = { 20, 60, 180, 25 },
  106. .statsTotalDupes = { 20, 90, 180, 25 },
  107. .imagepaths = { 215, 30, 750, 85 },
  108. /* Sorting screen: buttons */
  109. .buttonNext = { L_PICW + 30, 310, 220, 50 },
  110. .buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
  111. .buttonDelRight = { L_PICW + 160, 375, 90, 50 },
  112. .buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
  113. .buttonStopSorting = { L_W - 300, 35, 180, 80 },
  114. /* Sorting screen: comparing */
  115. .compareRes = { L_PICW + 30, 160, 220, 20 },
  116. .compareResLeft = { L_PICW + 30, 160, 20, 20 },
  117. .compareResRight = { L_PICW + 230, 160, 20, 20 },
  118. .compareFsize = { L_PICW + 30, 190, 220, 20 },
  119. .compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
  120. .compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
  121. .compareFtype = { L_PICW + 32, 220, 216, 20 },
  122. /* Progress */
  123. .progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
  124. .progreessdesc = { 0, L_H / 2, L_W, 50 },
  125. .buttonPause = { L_W / 2 - 100, 35, 200, 80 },
  126. #undef L_W
  127. #undef L_H
  128. #undef L_PICW
  129. #undef L_PICH
  130. #undef L_PROGRESS_HEIGHT
  131. #undef L_STATUS_HEIGHT
  132. #undef L_HELP_CORNER
  133. #undef L_HELP_W
  134. #undef L_HELP_H
  135. };
  136. const UILayout Ui900p =
  137. {
  138. #define L_W 1600
  139. #define L_H 900
  140. #define L_PICW 663
  141. #define L_PICH 680
  142. #define L_PROGRESS_HEIGHT 40
  143. #define L_STATUS_HEIGHT 25
  144. #define L_HELP_CORNER 10
  145. #define L_HELP_W 500
  146. #define L_HELP_H 310
  147. /* Meta */
  148. .layoutname = "1600x900",
  149. .screenWidth = L_W,
  150. .screenHeight = L_H,
  151. .textureW = L_PICW,
  152. .textureH = L_PICH,
  153. .shortnamelen = 100,
  154. /* Common elements */
  155. .statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
  156. .line = { 0, 125, L_W, 10 },
  157. .helphint = { L_W - 95, 50, 57, 39 },
  158. .helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },
  159. /* Ready screen */
  160. .dragndropprompt = { 10, 140, L_W - 20, 25 },
  161. .dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
  162. .buttonLaunch = { L_W - 495, 35, 180, 80 },
  163. .buttonReset = { L_W - 300, 35, 180, 80 },
  164. /* Options */
  165. .optiongroup = { 10, 35, 600, 85 },
  166. .optionrecursive = { 20, 45, 15, 15 },
  167. .optiondhash256 = { 20, 70, 15, 15 },
  168. .optionbiggerbetter = { 20, 95, 15, 15 },
  169. .optionthreshold = { 200, 45, 400, 25 },
  170. .optionresolution = { 390, 85, 150, 25 },
  171. .optionapply = { 545, 85, 55, 25 },
  172. .optionthreads = { 260, 85, 125, 25 },
  173. /* Sorting screen: images */
  174. .leftImage = { 25, 160, L_PICW, L_PICH },
  175. .rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
  176. .leftTopMeta = { 25, 135, L_PICW, 25 },
  177. .rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
  178. .leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
  179. .rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },
  180. /* Sorting screen: stats */
  181. .statsGroupSize = { 20, 30, 180, 25 },
  182. .statsGroupCount = { 20, 60, 180, 25 },
  183. .statsTotalDupes = { 20, 90, 180, 25 },
  184. .imagepaths = { 215, 30, 750, 85 },
  185. /* Sorting screen: buttons */
  186. .buttonNext = { L_PICW + 30, 310, 220, 50 },
  187. .buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
  188. .buttonDelRight = { L_PICW + 160, 375, 90, 50 },
  189. .buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
  190. .buttonStopSorting = { L_W - 300, 35, 180, 80 },
  191. /* Sorting screen: comparing */
  192. .compareRes = { L_PICW + 30, 160, 220, 20 },
  193. .compareResLeft = { L_PICW + 30, 160, 20, 20 },
  194. .compareResRight = { L_PICW + 230, 160, 20, 20 },
  195. .compareFsize = { L_PICW + 30, 190, 220, 20 },
  196. .compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
  197. .compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
  198. .compareFtype = { L_PICW + 32, 220, 216, 20 },
  199. /* Progress */
  200. .progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
  201. .progreessdesc = { 0, L_H / 2, L_W, 50 },
  202. .buttonPause = { L_W / 2 - 100, 35, 200, 80 },
  203. #undef L_W
  204. #undef L_H
  205. #undef L_PICW
  206. #undef L_PICH
  207. #undef L_PROGRESS_HEIGHT
  208. #undef L_STATUS_HEIGHT
  209. #undef L_HELP_CORNER
  210. #undef L_HELP_W
  211. #undef L_HELP_H
  212. };
  213. const UILayout Ui1000p =
  214. {
  215. #define L_W 1900
  216. #define L_H 1000
  217. #define L_PICW 808
  218. #define L_PICH 780
  219. #define L_PROGRESS_HEIGHT 40
  220. #define L_STATUS_HEIGHT 25
  221. #define L_HELP_CORNER 10
  222. #define L_HELP_W 500
  223. #define L_HELP_H 310
  224. /* Meta */
  225. .layoutname = "1900x1000",
  226. .screenWidth = L_W,
  227. .screenHeight = L_H,
  228. .textureW = L_PICW,
  229. .textureH = L_PICH,
  230. .shortnamelen = 100,
  231. /* Common elements */
  232. .statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
  233. .line = { 0, 125, L_W, 10 },
  234. .helphint = { L_W - 95, 50, 57, 39 },
  235. .helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },
  236. /* Ready screen */
  237. .dragndropprompt = { 10, 140, L_W - 20, 25 },
  238. .dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
  239. .buttonLaunch = { L_W - 495, 35, 180, 80 },
  240. .buttonReset = { L_W - 300, 35, 180, 80 },
  241. /* Options */
  242. .optiongroup = { 10, 35, 600, 85 },
  243. .optionrecursive = { 20, 45, 15, 15 },
  244. .optiondhash256 = { 20, 70, 15, 15 },
  245. .optionbiggerbetter = { 20, 95, 15, 15 },
  246. .optionthreshold = { 200, 45, 400, 25 },
  247. .optionresolution = { 390, 85, 150, 25 },
  248. .optionapply = { 545, 85, 55, 25 },
  249. .optionthreads = { 260, 85, 125, 25 },
  250. /* Sorting screen: images */
  251. .leftImage = { 25, 160, L_PICW, L_PICH },
  252. .rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
  253. .leftTopMeta = { 25, 135, L_PICW, 25 },
  254. .rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
  255. .leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
  256. .rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },
  257. /* Sorting screen: stats */
  258. .statsGroupSize = { 20, 30, 180, 25 },
  259. .statsGroupCount = { 20, 60, 180, 25 },
  260. .statsTotalDupes = { 20, 90, 180, 25 },
  261. .imagepaths = { 215, 30, 750, 85 },
  262. /* Sorting screen: buttons */
  263. .buttonNext = { L_PICW + 30, 310, 220, 50 },
  264. .buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
  265. .buttonDelRight = { L_PICW + 160, 375, 90, 50 },
  266. .buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
  267. .buttonStopSorting = { L_W - 300, 35, 180, 80 },
  268. /* Sorting screen: comparing */
  269. .compareRes = { L_PICW + 30, 160, 220, 20 },
  270. .compareResLeft = { L_PICW + 30, 160, 20, 20 },
  271. .compareResRight = { L_PICW + 230, 160, 20, 20 },
  272. .compareFsize = { L_PICW + 30, 190, 220, 20 },
  273. .compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
  274. .compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
  275. .compareFtype = { L_PICW + 32, 220, 216, 20 },
  276. /* Progress */
  277. .progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
  278. .progreessdesc = { 0, L_H / 2, L_W, 50 },
  279. .buttonPause = { L_W / 2 - 100, 35, 200, 80 },
  280. #undef L_W
  281. #undef L_H
  282. #undef L_PICW
  283. #undef L_PICH
  284. #undef L_PROGRESS_HEIGHT
  285. #undef L_STATUS_HEIGHT
  286. #undef L_HELP_CORNER
  287. #undef L_HELP_W
  288. #undef L_HELP_H
  289. };
  290. const UILayout Ui1000w =
  291. {
  292. #define L_W 2500
  293. #define L_H 1000
  294. #define L_PICW 1110
  295. #define L_PICH 780
  296. #define L_PROGRESS_HEIGHT 40
  297. #define L_STATUS_HEIGHT 25
  298. #define L_HELP_CORNER 10
  299. #define L_HELP_W 500
  300. #define L_HELP_H 310
  301. /* Meta */
  302. .layoutname = "2500x1000",
  303. .screenWidth = L_W,
  304. .screenHeight = L_H,
  305. .textureW = L_PICW,
  306. .textureH = L_PICH,
  307. .shortnamelen = 100,
  308. /* Common elements */
  309. .statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
  310. .line = { 0, 125, L_W, 10 },
  311. .helphint = { L_W - 95, 50, 57, 39 },
  312. .helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },
  313. /* Ready screen */
  314. .dragndropprompt = { 10, 140, L_W - 20, 25 },
  315. .dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
  316. .buttonLaunch = { L_W - 495, 35, 180, 80 },
  317. .buttonReset = { L_W - 300, 35, 180, 80 },
  318. /* Options */
  319. .optiongroup = { 10, 35, 600, 85 },
  320. .optionrecursive = { 20, 45, 15, 15 },
  321. .optiondhash256 = { 20, 70, 15, 15 },
  322. .optionbiggerbetter = { 20, 95, 15, 15 },
  323. .optionthreshold = { 200, 45, 400, 25 },
  324. .optionresolution = { 390, 85, 150, 25 },
  325. .optionapply = { 545, 85, 55, 25 },
  326. .optionthreads = { 260, 85, 125, 25 },
  327. /* Sorting screen: images */
  328. .leftImage = { 25, 160, L_PICW, L_PICH },
  329. .rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
  330. .leftTopMeta = { 25, 135, L_PICW, 25 },
  331. .rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
  332. .leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
  333. .rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },
  334. /* Sorting screen: stats */
  335. .statsGroupSize = { 20, 30, 180, 25 },
  336. .statsGroupCount = { 20, 60, 180, 25 },
  337. .statsTotalDupes = { 20, 90, 180, 25 },
  338. .imagepaths = { 215, 30, 750, 85 },
  339. /* Sorting screen: buttons */
  340. .buttonNext = { L_PICW + 30, 310, 220, 50 },
  341. .buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
  342. .buttonDelRight = { L_PICW + 160, 375, 90, 50 },
  343. .buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
  344. .buttonStopSorting = { L_W - 300, 35, 180, 80 },
  345. /* Sorting screen: comparing */
  346. .compareRes = { L_PICW + 30, 160, 220, 20 },
  347. .compareResLeft = { L_PICW + 30, 160, 20, 20 },
  348. .compareResRight = { L_PICW + 230, 160, 20, 20 },
  349. .compareFsize = { L_PICW + 30, 190, 220, 20 },
  350. .compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
  351. .compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
  352. .compareFtype = { L_PICW + 32, 220, 216, 20 },
  353. /* Progress */
  354. .progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
  355. .progreessdesc = { 0, L_H / 2, L_W, 50 },
  356. .buttonPause = { L_W / 2 - 100, 35, 200, 80 },
  357. #undef L_W
  358. #undef L_H
  359. #undef L_PICW
  360. #undef L_PICH
  361. #undef L_PROGRESS_HEIGHT
  362. #undef L_STATUS_HEIGHT
  363. #undef L_HELP_CORNER
  364. #undef L_HELP_W
  365. #undef L_HELP_H
  366. };
  367. #define LAYOUTSDEF const UILayout AvailableLayouts[] = { Ui720p, Ui900p, Ui1000p, Ui1000w };
  368. #endif