meltygui 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. meltygui/__init__.py +107 -0
  2. meltygui/accounts/__init__.py +0 -0
  3. meltygui/accounts/internet_accounts.py +1355 -0
  4. meltygui/chat/__init__.py +91 -0
  5. meltygui/chat/activity.py +75 -0
  6. meltygui/chat/backends.py +36 -0
  7. meltygui/chat/chat_interface.py +732 -0
  8. meltygui/chat/chat_proxy.py +352 -0
  9. meltygui/chat/codex_proxy.py +592 -0
  10. meltygui/chat/codex_settings.py +100 -0
  11. meltygui/chat/codex_transport.py +60 -0
  12. meltygui/chat/command_parser.py +204 -0
  13. meltygui/chat/images.py +227 -0
  14. meltygui/chat/messages.py +417 -0
  15. meltygui/chat/metadata.py +139 -0
  16. meltygui/chat/writer_locks.py +64 -0
  17. meltygui/code/__init__.py +0 -0
  18. meltygui/code/basic_converters.py +533 -0
  19. meltygui/code/chain_converters.py +2111 -0
  20. meltygui/code/code_checks.py +2209 -0
  21. meltygui/code/core_syntax.py +1430 -0
  22. meltygui/code/file_converters.py +1933 -0
  23. meltygui/code/fileref.py +702 -0
  24. meltygui/code/hotswap_guard.py +144 -0
  25. meltygui/code/libcst_conversion.py +9724 -0
  26. meltygui/code/live_instrument.py +392 -0
  27. meltygui/code/live_view.py +2490 -0
  28. meltygui/code/melty_scan.py +2684 -0
  29. meltygui/code/new_codecs.py +1255 -0
  30. meltygui/code/new_converters.py +3017 -0
  31. meltygui/code/project_code.py +278 -0
  32. meltygui/code/source_context.py +63 -0
  33. meltygui/code/symbol_roster.py +1588 -0
  34. meltygui/code/syntax_check.py +34 -0
  35. meltygui/code/syntax_check_worker.py +114 -0
  36. meltygui/completion/__init__.py +0 -0
  37. meltygui/completion/fim.py +1232 -0
  38. meltygui/completion/fim_context.py +481 -0
  39. meltygui/completion/providers/__init__.py +0 -0
  40. meltygui/completion/providers/anthropic_oauth.py +446 -0
  41. meltygui/completion/providers/anthropic_requests.py +69 -0
  42. meltygui/completion/providers/claude.py +203 -0
  43. meltygui/completion/providers/claude_usage.py +499 -0
  44. meltygui/completion/providers/codex_accounts.py +180 -0
  45. meltygui/completion/providers/copilot.py +617 -0
  46. meltygui/completion/providers/oauth_popup.py +220 -0
  47. meltygui/completion/providers/ollama.py +320 -0
  48. meltygui/completion/providers/profiles.py +23 -0
  49. meltygui/core/README.md +88 -0
  50. meltygui/core/__init__.py +1 -0
  51. meltygui/core/automation/__init__.py +1 -0
  52. meltygui/core/automation/action_core.py +153 -0
  53. meltygui/core/automation/collection_action.py +45 -0
  54. meltygui/core/automation/mcp_eval.py +167 -0
  55. meltygui/core/automation/mcp_hotswap.py +107 -0
  56. meltygui/core/automation/mcp_query.py +552 -0
  57. meltygui/core/automation/mcp_server.py +657 -0
  58. meltygui/core/automation/orchestration_core.py +2636 -0
  59. meltygui/core/automation/query_core.py +124 -0
  60. meltygui/core/automation/search_core.py +26 -0
  61. meltygui/core/automation/selector_core.py +340 -0
  62. meltygui/core/automation/value_core.py +1752 -0
  63. meltygui/core/cache/__init__.py +1 -0
  64. meltygui/core/cache/cache_diagnostics.py +0 -0
  65. meltygui/core/cache/invalidation_decoration.py +153 -0
  66. meltygui/core/cache/invalidation_tracker.py +43 -0
  67. meltygui/core/cache/tile_cache.py +5968 -0
  68. meltygui/core/conversion/__init__.py +1 -0
  69. meltygui/core/conversion/bubbling.py +599 -0
  70. meltygui/core/conversion/cache_tree.py +188 -0
  71. meltygui/core/conversion/chain.py +113 -0
  72. meltygui/core/conversion/converter_register.py +145 -0
  73. meltygui/core/conversion/data_decoration.py +67 -0
  74. meltygui/core/conversion/dict_conversion.py +1815 -0
  75. meltygui/core/conversion/dict_conversion_util.py +177 -0
  76. meltygui/core/conversion/dynamic_obj.py +89 -0
  77. meltygui/core/conversion/graph_compare.py +183 -0
  78. meltygui/core/conversion/load_save_v2.py +1032 -0
  79. meltygui/core/conversion/missing_saved_class.py +39 -0
  80. meltygui/core/conversion/path_finder.py +606 -0
  81. meltygui/core/conversion/render_host.py +1083 -0
  82. meltygui/core/core_render.py +6537 -0
  83. meltygui/core/definition_hotswap.py +231 -0
  84. meltygui/core/diagnostics/__init__.py +1 -0
  85. meltygui/core/diagnostics/attribute_churn.py +38 -0
  86. meltygui/core/diagnostics/fps_counter.py +39 -0
  87. meltygui/core/diagnostics/gpu_frame_timer.py +103 -0
  88. meltygui/core/diagnostics/inspection_core.py +169 -0
  89. meltygui/core/diagnostics/monitor_core.py +105 -0
  90. meltygui/core/diagnostics/notifications.py +706 -0
  91. meltygui/core/diagnostics/perf_trace.py +281 -0
  92. meltygui/core/diagnostics/profile_decoration.py +88 -0
  93. meltygui/core/diagnostics/resize_trace.py +62 -0
  94. meltygui/core/diagnostics/screenshot_core.py +247 -0
  95. meltygui/core/diagnostics/session_status.py +98 -0
  96. meltygui/core/diagnostics/trace_core.py +445 -0
  97. meltygui/core/files/__init__.py +1 -0
  98. meltygui/core/files/file_core.py +208 -0
  99. meltygui/core/files/file_explorer_core.py +104 -0
  100. meltygui/core/files/file_tree_core.py +198 -0
  101. meltygui/core/files/file_watch_core.py +43 -0
  102. meltygui/core/files/import_graph_core.py +43 -0
  103. meltygui/core/files/metadata_core.py +51 -0
  104. meltygui/core/graphics/__init__.py +1 -0
  105. meltygui/core/graphics/cuda_context_core.py +166 -0
  106. meltygui/core/graphics/cuda_interop_core.py +136 -0
  107. meltygui/core/graphics/cuda_kernel_core.py +91 -0
  108. meltygui/core/graphics/framebuffer_recorder.py +337 -0
  109. meltygui/core/graphics/gl_state.py +658 -0
  110. meltygui/core/graphics/lut_core.py +52 -0
  111. meltygui/core/graphics/overlay_renderer.py +984 -0
  112. meltygui/core/graphics/scene_target.py +180 -0
  113. meltygui/core/graphics/screenshot.py +439 -0
  114. meltygui/core/graphics/shader_func.py +478 -0
  115. meltygui/core/graphics/tensor_core.py +45 -0
  116. meltygui/core/graphics/text_texture.py +329 -0
  117. meltygui/core/graphics/wayland_color.py +635 -0
  118. meltygui/core/input/__init__.py +1 -0
  119. meltygui/core/input/collision.py +165 -0
  120. meltygui/core/input/drag_drop_core.py +1525 -0
  121. meltygui/core/input/hypr_left_drag.py +323 -0
  122. meltygui/core/input/input_core.py +245 -0
  123. meltygui/core/input/input_handler.py +1101 -0
  124. meltygui/core/input/mouse_cursor.py +355 -0
  125. meltygui/core/input/pynput_backend.py +1054 -0
  126. meltygui/core/input/space_mouse.py +338 -0
  127. meltygui/core/input/touchpad_backend.py +393 -0
  128. meltygui/core/input/view_selection.py +177 -0
  129. meltygui/core/layout/__init__.py +1 -0
  130. meltygui/core/layout/column_core.py +2153 -0
  131. meltygui/core/layout/cursor_core.py +161 -0
  132. meltygui/core/layout/dropdown_core.py +278 -0
  133. meltygui/core/layout/edge_constraints.py +155 -0
  134. meltygui/core/layout/grid_core.py +117 -0
  135. meltygui/core/layout/header_core.py +23 -0
  136. meltygui/core/layout/header_runtime.py +67 -0
  137. meltygui/core/layout/layout_core.py +87 -0
  138. meltygui/core/layout/tile_manager_core.py +591 -0
  139. meltygui/core/melty.py +6726 -0
  140. meltygui/core/module_map.json +896 -0
  141. meltygui/core/module_names.py +19 -0
  142. meltygui/core/rendering/__init__.py +1 -0
  143. meltygui/core/rendering/core_decoration.py +431 -0
  144. meltygui/core/rendering/core_render_helpers.py +328 -0
  145. meltygui/core/rendering/func_metadata.py +398 -0
  146. meltygui/core/rendering/mode.py +818 -0
  147. meltygui/core/rendering/mode_defaults.py +41 -0
  148. meltygui/core/rendering/modes.py +136 -0
  149. meltygui/core/rendering/parameter_core.py +1665 -0
  150. meltygui/core/rendering/render_dispatch.py +1891 -0
  151. meltygui/core/rendering/render_funcs.py +273 -0
  152. meltygui/core/rendering/shaped.py +312 -0
  153. meltygui/core/rendering/window_decoration.py +25 -0
  154. meltygui/core/runtime/__init__.py +1 -0
  155. meltygui/core/runtime/app.py +735 -0
  156. meltygui/core/runtime/app_session.py +140 -0
  157. meltygui/core/runtime/background.py +564 -0
  158. meltygui/core/runtime/extensions.py +53 -0
  159. meltygui/core/runtime/gc_manager.py +1163 -0
  160. meltygui/core/runtime/lifecycle.py +21 -0
  161. meltygui/core/runtime/paths.py +27 -0
  162. meltygui/core/runtime/settings.py +14 -0
  163. meltygui/core/runtime/singleton.py +16 -0
  164. meltygui/core/runtime/thread_safe_bool.py +24 -0
  165. meltygui/core/runtime/thread_signal.py +30 -0
  166. meltygui/core/runtime/toggles.py +3115 -0
  167. meltygui/core/services/__init__.py +1 -0
  168. meltygui/core/services/account_core.py +10 -0
  169. meltygui/core/services/chat_core.py +19 -0
  170. meltygui/core/services/claude_terminal_core.py +346 -0
  171. meltygui/core/services/terminal_core.py +458 -0
  172. meltygui/core/services/terminal_runtime.py +78 -0
  173. meltygui/core/styling/__init__.py +1 -0
  174. meltygui/core/styling/color_core.py +46 -0
  175. meltygui/core/styling/fonts.py +639 -0
  176. meltygui/core/styling/global_style.py +338 -0
  177. meltygui/core/styling/style.py +198 -0
  178. meltygui/core/styling/style_core.py +522 -0
  179. meltygui/core/styling/warm_start.py +149 -0
  180. meltygui/core/windowing/__init__.py +1 -0
  181. meltygui/core/windowing/backends/PYIMGUI_LICENSE +28 -0
  182. meltygui/core/windowing/backends/__init__.py +1 -0
  183. meltygui/core/windowing/backends/imgui_renderer.py +138 -0
  184. meltygui/core/windowing/backends/native_wayland.py +850 -0
  185. meltygui/core/windowing/backends/protocols/xdg-decoration-unstable-v1.xml +156 -0
  186. meltygui/core/windowing/backends/protocols/xdg-shell.xml +1420 -0
  187. meltygui/core/windowing/backends/wayland_protocol.py +101 -0
  188. meltygui/core/windowing/dock_core.py +182 -0
  189. meltygui/core/windowing/frame_geometry.py +42 -0
  190. meltygui/core/windowing/geometry_feed.py +864 -0
  191. meltygui/core/windowing/glfw_utils.py +1343 -0
  192. meltygui/core/windowing/os_frame.py +1552 -0
  193. meltygui/core/windowing/surface.py +643 -0
  194. meltygui/core/windowing/titlebar.py +1560 -0
  195. meltygui/core/windowing/titlebar_buttons.py +281 -0
  196. meltygui/core/windowing/wayland_move.py +932 -0
  197. meltygui/core/windowing/window_api.py +62 -0
  198. meltygui/core/windowing/window_constants.py +339 -0
  199. meltygui/core/windowing/window_visibility.py +162 -0
  200. meltygui/debug/__init__.py +0 -0
  201. meltygui/debug/app_view_utils.py +9 -0
  202. meltygui/editor/__init__.py +0 -0
  203. meltygui/editor/bash_syntax.py +30 -0
  204. meltygui/editor/code_line_fast.py +152 -0
  205. meltygui/editor/diff.py +139 -0
  206. meltygui/editor/external_changes.py +159 -0
  207. meltygui/editor/file_header.py +41 -0
  208. meltygui/editor/live_usage.py +169 -0
  209. meltygui/editor/live_view_views.py +1803 -0
  210. meltygui/editor/pending_save.py +1351 -0
  211. meltygui/editor/roster_tints.py +547 -0
  212. meltygui/editor/source_preview.py +16 -0
  213. meltygui/editor/source_tools.py +10 -0
  214. meltygui/editor/source_ui.py +70 -0
  215. meltygui/editor/spell_check.py +77 -0
  216. meltygui/editor/text_editor.py +9076 -0
  217. meltygui/editor/usage_picker.py +538 -0
  218. meltygui/events/__init__.py +0 -0
  219. meltygui/events/example.py +118 -0
  220. meltygui/examples/__init__.py +0 -0
  221. meltygui/examples/columns_demo.py +33 -0
  222. meltygui/examples/columns_window_demo.py +60 -0
  223. meltygui/examples/context_menu_demo.py +24 -0
  224. meltygui/examples/context_menu_window_demo.py +49 -0
  225. meltygui/examples/gui_playground.py +127 -0
  226. meltygui/examples/live_view_playground.py +256 -0
  227. meltygui/examples/lora.py +43 -0
  228. meltygui/examples/lora_data.py +59 -0
  229. meltygui/examples/lora_policies.py +67 -0
  230. meltygui/examples/mode_demo.py +49 -0
  231. meltygui/examples/modifies_demo.py +119 -0
  232. meltygui/examples/scalar_policies.py +60 -0
  233. meltygui/examples/style_layouts.py +149 -0
  234. meltygui/examples/tile_manager_demo.py +74 -0
  235. meltygui/examples/tint_demo.py +160 -0
  236. meltygui/examples/tint_functions.py +56 -0
  237. meltygui/examples/trace_demo.py +88 -0
  238. meltygui/examples/two_windows.py +36 -0
  239. meltygui/files/__init__.py +0 -0
  240. meltygui/files/fast_file_explorer.py +439 -0
  241. meltygui/gnome_extension/lsd-window-geometry@latent-descent/extension.js +237 -0
  242. meltygui/gnome_extension/lsd-window-geometry@latent-descent/lsd-window-geometry@latent-descent.iml +9 -0
  243. meltygui/gnome_extension/lsd-window-geometry@latent-descent/metadata.json +7 -0
  244. meltygui/graphics/__init__.py +6 -0
  245. meltygui/graphics/base.py +85 -0
  246. meltygui/graphics/examples.py +507 -0
  247. meltygui/graphics/executor.py +520 -0
  248. meltygui/graphics/filter.py +667 -0
  249. meltygui/graphics/filter.pyi +856 -0
  250. meltygui/graphics/generate_stubs.py +22 -0
  251. meltygui/graphics/registry.py +203 -0
  252. meltygui/graphics/shader_compiler.py +155 -0
  253. meltygui/graphics/shaders.py +1302 -0
  254. meltygui/graphics/stub_generator.py +250 -0
  255. meltygui/graphics/texture_manager.py +170 -0
  256. meltygui/graphics/texture_min_max.py +295 -0
  257. meltygui/hdr_color.py +757 -0
  258. meltygui/image_load.py +308 -0
  259. meltygui/model/__init__.py +1 -0
  260. meltygui/model/account_model.py +142 -0
  261. meltygui/model/camera_model.py +159 -0
  262. meltygui/model/chat_model.py +86 -0
  263. meltygui/model/code_model.py +62 -0
  264. meltygui/model/code_proxy_model.py +876 -0
  265. meltygui/model/collection_model.py +41 -0
  266. meltygui/model/color_model.py +127 -0
  267. meltygui/model/cuda_tensor_model.py +36 -0
  268. meltygui/model/cuda_texture_model.py +149 -0
  269. meltygui/model/dropdown_model.py +137 -0
  270. meltygui/model/file_metadata_model.py +73 -0
  271. meltygui/model/file_model.py +289 -0
  272. meltygui/model/format_model.py +390 -0
  273. meltygui/model/graph_model.py +98 -0
  274. meltygui/model/icon_model.py +1024 -0
  275. meltygui/model/import_graph_model.py +468 -0
  276. meltygui/model/layout_model.py +15 -0
  277. meltygui/model/lut_model.py +266 -0
  278. meltygui/model/search_model.py +173 -0
  279. meltygui/model/tensor_model.py +402 -0
  280. meltygui/model/terminal_model.py +329 -0
  281. meltygui/model/texture_model.py +146 -0
  282. meltygui/model/tile_model.py +24 -0
  283. meltygui/model/trace_model.py +198 -0
  284. meltygui/model/trace_report_model.py +146 -0
  285. meltygui/models/__init__.py +0 -0
  286. meltygui/models/file_meta.py +613 -0
  287. meltygui/models/function_console.py +184 -0
  288. meltygui/models/orchestration.py +48 -0
  289. meltygui/pbr.py +1576 -0
  290. meltygui/png_unfilter.c +49 -0
  291. meltygui/resources/JetBrainsMono-Regular.ttf +0 -0
  292. meltygui/resources/THIRD_PARTY_NOTICES.md +21 -0
  293. meltygui/resources/dejavu/DejaVuSans-Bold.ttf +0 -0
  294. meltygui/resources/dejavu/DejaVuSans-ExtraLight.ttf +0 -0
  295. meltygui/resources/dejavu/DejaVuSans.ttf +0 -0
  296. meltygui/resources/dejavu/LICENSE.txt +78 -0
  297. meltygui/resources/fontawesome-LICENSE.txt +121 -0
  298. meltygui/resources/fontawesome-webfont.ttf +0 -0
  299. meltygui/resources/hdri/studio_small_09_1k.hdr +0 -0
  300. meltygui/resources/jetbrains-weights/JetBrainsMono-Bold.ttf +0 -0
  301. meltygui/resources/jetbrains-weights/JetBrainsMono-ExtraBold.ttf +0 -0
  302. meltygui/resources/jetbrains-weights/JetBrainsMono-ExtraLight.ttf +0 -0
  303. meltygui/resources/jetbrains-weights/JetBrainsMono-Light.ttf +0 -0
  304. meltygui/resources/jetbrains-weights/JetBrainsMono-Medium.ttf +0 -0
  305. meltygui/resources/jetbrains-weights/JetBrainsMono-SemiBold.ttf +0 -0
  306. meltygui/resources/jetbrains-weights/JetBrainsMono-Thin.ttf +0 -0
  307. meltygui/resources/jetbrains-weights/OFL.txt +93 -0
  308. meltygui/resources/jetbrains-weights/README.md +2 -0
  309. meltygui/state/__init__.py +0 -0
  310. meltygui/state/account_state.py +22 -0
  311. meltygui/state/animation_state.py +97 -0
  312. meltygui/state/annotation_state.py +22 -0
  313. meltygui/state/chat_state.py +36 -0
  314. meltygui/state/code_state.py +10 -0
  315. meltygui/state/core_enums.py +59 -0
  316. meltygui/state/core_markers.py +115 -0
  317. meltygui/state/core_undo.py +1075 -0
  318. meltygui/state/file_state.py +75 -0
  319. meltygui/state/graph_state.py +26 -0
  320. meltygui/state/inspection_state.py +47 -0
  321. meltygui/state/menu_state.py +10 -0
  322. meltygui/state/model_enums.py +11 -0
  323. meltygui/state/new_core_model.py +2394 -0
  324. meltygui/state/orchestration_state.py +14 -0
  325. meltygui/state/query_state.py +24 -0
  326. meltygui/state/tensor_state.py +10 -0
  327. meltygui/state/terminal_state.py +23 -0
  328. meltygui/state/trace_state.py +32 -0
  329. meltygui/state/voxel_state.py +12 -0
  330. meltygui/text_index.py +816 -0
  331. meltygui/utils/__init__.py +0 -0
  332. meltygui/utils/jump_to_code.py +344 -0
  333. meltygui/utils/pkl_inspect.py +90 -0
  334. meltygui/utils/render_utils.py +1419 -0
  335. meltygui/view/__init__.py +1 -0
  336. meltygui/view/account_view.py +524 -0
  337. meltygui/view/action_view.py +73 -0
  338. meltygui/view/chat_decoration_view.py +112 -0
  339. meltygui/view/chat_view.py +1703 -0
  340. meltygui/view/code_view.py +2677 -0
  341. meltygui/view/collection_view.py +1185 -0
  342. meltygui/view/color_view.py +824 -0
  343. meltygui/view/control_view.py +559 -0
  344. meltygui/view/decoration_view.py +439 -0
  345. meltygui/view/diagnostic_view.py +177 -0
  346. meltygui/view/dropdown_view.py +1082 -0
  347. meltygui/view/file_view.py +1599 -0
  348. meltygui/view/graph_cuda_view.py +105 -0
  349. meltygui/view/graph_view.py +882 -0
  350. meltygui/view/header_view.py +848 -0
  351. meltygui/view/input_view.py +238 -0
  352. meltygui/view/inspection_view.py +1783 -0
  353. meltygui/view/layout_view.py +596 -0
  354. meltygui/view/lut_view.py +45 -0
  355. meltygui/view/menu_view.py +212 -0
  356. meltygui/view/orchestration_view.py +658 -0
  357. meltygui/view/query_view.py +118 -0
  358. meltygui/view/search_view.py +342 -0
  359. meltygui/view/tab_view.py +258 -0
  360. meltygui/view/tensor_view.py +430 -0
  361. meltygui/view/terminal_view.py +355 -0
  362. meltygui/view/text_view.py +8031 -0
  363. meltygui/view/texture_view.py +480 -0
  364. meltygui/view/tile_view.py +38 -0
  365. meltygui/view/trace_view.py +923 -0
  366. meltygui/view/voxel_cuda_view.py +824 -0
  367. meltygui/view/voxel_view.py +1860 -0
  368. meltygui/view/window_view.py +111 -0
  369. meltygui-0.1.0.dist-info/METADATA +143 -0
  370. meltygui-0.1.0.dist-info/RECORD +372 -0
  371. meltygui-0.1.0.dist-info/WHEEL +4 -0
  372. meltygui-0.1.0.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,49 @@
1
+ /* Undo PNG scanline filters (RFC 2083 §6). Compiled on first use by image_load.py.
2
+ raw: h rows of (1 + stride) bytes, filter type byte first.
3
+ out: h rows of stride bytes. bpp = bytes per complete pixel. */
4
+ #include <stdint.h>
5
+ #include <stdlib.h>
6
+
7
+ static inline int paeth(int a, int b, int c) {
8
+ int p = a + b - c, pa = abs(p - a), pb = abs(p - b), pc = abs(p - c);
9
+ return (pa <= pb && pa <= pc) ? a : (pb <= pc ? b : c);
10
+ }
11
+
12
+ int png_unfilter(const uint8_t *raw, uint8_t *out, int h, int stride, int bpp) {
13
+ const uint8_t *prior = NULL;
14
+ for (int y = 0; y < h; y++) {
15
+ const uint8_t *in = raw + (size_t)y * (stride + 1);
16
+ uint8_t *cur = out + (size_t)y * stride;
17
+ int kind = in[0];
18
+ in++;
19
+ switch (kind) {
20
+ case 0:
21
+ for (int i = 0; i < stride; i++) cur[i] = in[i];
22
+ break;
23
+ case 1:
24
+ for (int i = 0; i < stride; i++) cur[i] = in[i] + (i >= bpp ? cur[i - bpp] : 0);
25
+ break;
26
+ case 2:
27
+ for (int i = 0; i < stride; i++) cur[i] = in[i] + (prior ? prior[i] : 0);
28
+ break;
29
+ case 3:
30
+ for (int i = 0; i < stride; i++) {
31
+ int a = i >= bpp ? cur[i - bpp] : 0, b = prior ? prior[i] : 0;
32
+ cur[i] = in[i] + ((a + b) >> 1);
33
+ }
34
+ break;
35
+ case 4:
36
+ for (int i = 0; i < stride; i++) {
37
+ int a = i >= bpp ? cur[i - bpp] : 0;
38
+ int b = prior ? prior[i] : 0;
39
+ int c = (prior && i >= bpp) ? prior[i - bpp] : 0;
40
+ cur[i] = in[i] + paeth(a, b, c);
41
+ }
42
+ break;
43
+ default:
44
+ return -1;
45
+ }
46
+ prior = cur;
47
+ }
48
+ return 0;
49
+ }
@@ -0,0 +1,21 @@
1
+ # Bundled resources
2
+
3
+ - JetBrains Mono: JetBrains s.r.o., SIL Open Font License 1.1.
4
+ License: `jetbrains-weights/OFL.txt`. Source: https://github.com/JetBrains/JetBrainsMono
5
+ - DejaVu Sans: Bitstream copyright and DejaVu public-domain changes.
6
+ License: `dejavu/LICENSE.txt`. Source: https://dejavu-fonts.github.io/
7
+ - Font Awesome 5.15.4 font (stored under the historical filename
8
+ `fontawesome-webfont.ttf`): Fonticons, Inc., SIL Open Font License 1.1.
9
+ License: `fontawesome-LICENSE.txt`.
10
+ Source: https://github.com/FortAwesome/Font-Awesome/tree/5.15.4
11
+ - Studio Small 09 HDR environment: Poly Haven, CC0.
12
+ Source: https://polyhaven.com/a/studio_small_09
13
+ License: https://polyhaven.com/license
14
+
15
+ The adapted pyimgui window integration retains its license in
16
+ `meltygui/windows/backends/PYIMGUI_LICENSE`.
17
+
18
+ Native support distributions carry their own licenses. In particular, the
19
+ GL-enabled PyCUDA wheel includes NVIDIA's cuRAND runtime and its CUDA 12.1 EULA;
20
+ that runtime is not covered by MeltyGUI's project license. The NVIDIA driver
21
+ and CUDA compiler/toolkit are not bundled in MeltyGUI wheels.
Binary file
@@ -0,0 +1,78 @@
1
+ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
+ Upstream-Name: DejaVu fonts
3
+ Upstream-Author: Stepan Roh <src@users.sourceforge.net> (original author),
4
+ see /usr/share/doc/fonts-dejavu-core/AUTHORS for full list
5
+ Source: https://dejavu-fonts.github.io/
6
+
7
+ Files: *
8
+ Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.
9
+ Bitstream Vera is a trademark of Bitstream, Inc.
10
+ DejaVu changes are in public domain.
11
+ License: bitstream-vera
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of the fonts accompanying this license ("Fonts") and associated
14
+ documentation files (the "Font Software"), to reproduce and distribute the
15
+ Font Software, including without limitation the rights to use, copy, merge,
16
+ publish, distribute, and/or sell copies of the Font Software, and to permit
17
+ persons to whom the Font Software is furnished to do so, subject to the
18
+ following conditions:
19
+ .
20
+ The above copyright and trademark notices and this permission notice shall
21
+ be included in all copies of one or more of the Font Software typefaces.
22
+ .
23
+ The Font Software may be modified, altered, or added to, and in particular
24
+ the designs of glyphs or characters in the Fonts may be modified and
25
+ additional glyphs or characters may be added to the Fonts, only if the fonts
26
+ are renamed to names not containing either the words "Bitstream" or the word
27
+ "Vera".
28
+ .
29
+ This License becomes null and void to the extent applicable to Fonts or Font
30
+ Software that has been modified and is distributed under the "Bitstream
31
+ Vera" names.
32
+ .
33
+ The Font Software may be sold as part of a larger software package but no
34
+ copy of one or more of the Font Software typefaces may be sold by itself.
35
+ .
36
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
38
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
39
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
40
+ FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
41
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
42
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
43
+ THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
44
+ FONT SOFTWARE.
45
+ .
46
+ Except as contained in this notice, the names of Gnome, the Gnome
47
+ Foundation, and Bitstream Inc., shall not be used in advertising or
48
+ otherwise to promote the sale, use or other dealings in this Font Software
49
+ without prior written authorization from the Gnome Foundation or Bitstream
50
+ Inc., respectively. For further information, contact: fonts at gnome dot
51
+ org.
52
+
53
+ Files: debian/*
54
+ Copyright: (C) 2005-2006 Peter Cernak <pce@users.sourceforge.net>
55
+ (C) 2006-2011 Davide Viti <zinosat@tiscali.it>
56
+ (C) 2011-2013 Christian Perrier <bubulle@debian.org>
57
+ (C) 2013 Fabian Greffrath <fabian+debian@greffrath.com>
58
+ License: GPL-2+
59
+ This program is free software; you can redistribute it
60
+ and/or modify it under the terms of the GNU General Public
61
+ License as published by the Free Software Foundation; either
62
+ version 2 of the License, or (at your option) any later
63
+ version.
64
+ .
65
+ This program is distributed in the hope that it will be
66
+ useful, but WITHOUT ANY WARRANTY; without even the implied
67
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
68
+ PURPOSE. See the GNU General Public License for more
69
+ details.
70
+ .
71
+ You should have received a copy of the GNU General Public
72
+ License along with this package; if not, write to the Free
73
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
74
+ Boston, MA 02110-1301 USA
75
+ .
76
+ On Debian systems, the full text of the GNU General Public
77
+ License version 2 can be found in the file
78
+ /usr/share/common-licenses/GPL-2'.
@@ -0,0 +1,121 @@
1
+ Font Awesome Free License
2
+ -------------------------
3
+
4
+ Font Awesome Free is free, open source, and GPL friendly. You can use it for
5
+ commercial projects, open source projects, or really almost whatever you want.
6
+ Full Font Awesome Free license: https://fontawesome.com/license/free.
7
+
8
+ # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
9
+ In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
10
+ packaged as SVG and JS file types.
11
+
12
+ # Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
13
+ In the Font Awesome Free download, the SIL OFL license applies to all icons
14
+ packaged as web and desktop font files.
15
+
16
+ # Code: MIT License (https://opensource.org/licenses/MIT)
17
+ In the Font Awesome Free download, the MIT license applies to all non-font and
18
+ non-icon files.
19
+
20
+ # Attribution
21
+ Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
22
+ Awesome Free files already contain embedded comments with sufficient
23
+ attribution, so you shouldn't need to do anything additional when using these
24
+ files normally.
25
+
26
+ We've kept attribution comments terse, so we ask that you do not actively work
27
+ to remove them from files, especially code. They're a great way for folks to
28
+ learn about Font Awesome.
29
+
30
+ # Brand Icons
31
+ All brand icons are trademarks of their respective owners. The use of these
32
+ trademarks does not indicate endorsement of the trademark holder by Font
33
+ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
34
+ to represent the company, product, or service to which they refer.**
35
+
36
+
37
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
38
+ -----------------------------------------------------------
39
+
40
+ PREAMBLE
41
+ The goals of the Open Font License (OFL) are to stimulate worldwide
42
+ development of collaborative font projects, to support the font creation
43
+ efforts of academic and linguistic communities, and to provide a free and
44
+ open framework in which fonts may be shared and improved in partnership
45
+ with others.
46
+
47
+ The OFL allows the licensed fonts to be used, studied, modified and
48
+ redistributed freely as long as they are not sold by themselves. The
49
+ fonts, including any derivative works, can be bundled, embedded,
50
+ redistributed and/or sold with any software provided that any reserved
51
+ names are not used by derivative works. The fonts and derivatives,
52
+ however, cannot be released under any other type of license. The
53
+ requirement for fonts to remain under this license does not apply
54
+ to any document created using the fonts or their derivatives.
55
+
56
+ DEFINITIONS
57
+ "Font Software" refers to the set of files released by the Copyright
58
+ Holder(s) under this license and clearly marked as such. This may
59
+ include source files, build scripts and documentation.
60
+
61
+ "Reserved Font Name" refers to any names specified as such after the
62
+ copyright statement(s).
63
+
64
+ "Original Version" refers to the collection of Font Software components as
65
+ distributed by the Copyright Holder(s).
66
+
67
+ "Modified Version" refers to any derivative made by adding to, deleting,
68
+ or substituting -- in part or in whole -- any of the components of the
69
+ Original Version, by changing formats or by porting the Font Software to a
70
+ new environment.
71
+
72
+ "Author" refers to any designer, engineer, programmer, technical
73
+ writer or other person who contributed to the Font Software.
74
+
75
+ PERMISSION & CONDITIONS
76
+ Permission is hereby granted, free of charge, to any person obtaining
77
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
78
+ redistribute, and sell modified and unmodified copies of the Font
79
+ Software, subject to the following conditions:
80
+
81
+ 1) Neither the Font Software nor any of its individual components,
82
+ in Original or Modified Versions, may be sold by itself.
83
+
84
+ 2) Original or Modified Versions of the Font Software may be bundled,
85
+ redistributed and/or sold with any software, provided that each copy
86
+ contains the above copyright notice and this license. These can be
87
+ included either as stand-alone text files, human-readable headers or
88
+ in the appropriate machine-readable metadata fields within text or
89
+ binary files as long as those fields can be easily viewed by the user.
90
+
91
+ 3) No Modified Version of the Font Software may use the Reserved Font
92
+ Name(s) unless explicit written permission is granted by the corresponding
93
+ Copyright Holder. This restriction only applies to the primary font name as
94
+ presented to the users.
95
+
96
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
97
+ Software shall not be used to promote, endorse or advertise any
98
+ Modified Version, except to acknowledge the contribution(s) of the
99
+ Copyright Holder(s) and the Author(s) or with their explicit written
100
+ permission.
101
+
102
+ 5) The Font Software, modified or unmodified, in part or in whole,
103
+ must be distributed entirely under this license, and must not be
104
+ distributed under any other license. The requirement for fonts to
105
+ remain under this license does not apply to any document created
106
+ using the Font Software.
107
+
108
+ TERMINATION
109
+ This license becomes null and void if any of the above conditions are
110
+ not met.
111
+
112
+ DISCLAIMER
113
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
114
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
115
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
116
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
117
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
118
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
119
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
120
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
121
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,2 @@
1
+ JetBrains Mono weight faces from https://github.com/JetBrains/JetBrainsMono/tree/v2.304/fonts/ttf
2
+ Licensed under the included SIL Open Font License. Regular remains the existing bundled face.
File without changes
@@ -0,0 +1,22 @@
1
+ """Injected state for account views."""
2
+ from meltygui.core.conversion.dict_conversion import DictConversion
3
+
4
+
5
+ class AccountsPanelState(DictConversion):
6
+ """Which per-account panels are open — the usage limits (▾), Ollama's
7
+ model list, the Edit fields — persisted with the window's draw_state
8
+ (injected as `panel_state: AccountsPanelState = None`, the TabState
9
+ pattern) so the window reopens the way it was left. The kinds keep
10
+ toggling the account dicts' runtime keys (`_usage_open`, …); the window
11
+ restores those from here on a fresh store (boot / restart) and mirrors
12
+ them back after every frame. `open` maps "<account id><key>" → True.
13
+ `usage` maps account id → the Claude plan numbers last fetched
14
+ (`AnthropicKind.usage_cache_entry`: rows, summary, fetched_wall, email)
15
+ — restored into a fresh account dict by `restore_usage`, so the panel
16
+ shows last session's bars until the delayed fetch replaces them."""
17
+ PANEL_KEYS = ("_usage_open", "_models_open", "_edit")
18
+
19
+ def __init__(self):
20
+ super().__init__()
21
+ self.open = {}
22
+ self.usage = {}
@@ -0,0 +1,97 @@
1
+ import time
2
+ import meltygui.core.windowing.window_api as glfw
3
+ from typing import Callable, Union, Tuple
4
+ from enum import Enum
5
+
6
+ from meltygui.core.windowing.glfw_utils import request_render
7
+
8
+
9
+ class EaseType(Enum):
10
+ LINEAR = 'linear'
11
+ EASE_IN = 'ease_in'
12
+ EASE_OUT = 'ease_out'
13
+ EASE_IN_OUT = 'ease_in_out'
14
+
15
+
16
+ AnimValue = Union[float, Tuple[float, ...]]
17
+
18
+
19
+ class Animator:
20
+ def __init__(self):
21
+ self.start_value: AnimValue = 0
22
+ self.end_value: AnimValue = 0
23
+ self.duration = 0
24
+ self.start_time = 0
25
+ self.is_animating = False
26
+ self.on_update: Callable[[AnimValue], None] = lambda x: None
27
+ self.ease_type = EaseType.LINEAR
28
+
29
+ def _ease(self, t: float) -> float:
30
+ if self.ease_type == EaseType.LINEAR:
31
+ return t
32
+ elif self.ease_type == EaseType.EASE_IN:
33
+ return t * t
34
+ elif self.ease_type == EaseType.EASE_OUT:
35
+ return 1 - (1 - t) * (1 - t)
36
+ elif self.ease_type == EaseType.EASE_IN_OUT:
37
+ if t < 0.5:
38
+ return 2 * t * t
39
+ return 1 - (-2 * t + 2) ** 2 / 2
40
+ return t
41
+
42
+ def _interpolate(self, start: AnimValue, end: AnimValue, progress: float) -> AnimValue:
43
+ """Interpolate between start and end values, handling both floats and tuples."""
44
+ if isinstance(start, tuple) and isinstance(end, tuple):
45
+ # Interpolate each component of the tuple
46
+ return tuple(
47
+ start[i] + (end[i] - start[i]) * progress
48
+ for i in range(len(start))
49
+ )
50
+ else:
51
+ # Handle as float
52
+ return start + (end - start) * progress
53
+
54
+ def stop(self):
55
+ """Stop the current animation."""
56
+ self.is_animating = False
57
+
58
+ def animate(self, start: AnimValue, end: AnimValue, duration: float,
59
+ on_update: Callable[[AnimValue], None], ease_type: EaseType = EaseType.EASE_IN_OUT):
60
+ """
61
+ Start animation with support for both float and tuple values.
62
+
63
+ Args:
64
+ start: Starting value (float or tuple of floats)
65
+ end: Ending value (float or tuple of floats)
66
+ duration: Animation duration in seconds
67
+ on_update: Callback function that accepts either float or tuple
68
+ ease_type: Type of easing function to use
69
+ """
70
+ if isinstance(start, tuple) != isinstance(end, tuple):
71
+ raise ValueError("Start and end values must be the same type (both float or both tuple)")
72
+ if isinstance(start, tuple) and len(start) != len(end):
73
+ raise ValueError("Start and end tuples must have the same length")
74
+
75
+ self.start_value = start
76
+ self.end_value = end
77
+ self.duration = duration
78
+ self.start_time = time.time()
79
+ self.is_animating = True
80
+ self.on_update = on_update
81
+ self.ease_type = ease_type
82
+
83
+ def update(self):
84
+ if not self.is_animating:
85
+ return
86
+
87
+ elapsed = time.time() - self.start_time
88
+ if elapsed >= self.duration:
89
+ self.is_animating = False
90
+ self.on_update(self.end_value)
91
+ return
92
+
93
+ progress = self._ease(elapsed / self.duration)
94
+ current = self._interpolate(self.start_value, self.end_value, progress)
95
+
96
+ self.on_update(current)
97
+ request_render() # Request next frame
@@ -0,0 +1,22 @@
1
+ from enum import Enum
2
+ from typing import Any
3
+
4
+ from meltygui.core.rendering.core_decoration import Core
5
+
6
+
7
+ class AnnotationOverride:
8
+ """Carrier produced when a ``@render_func`` view function is used as a field
9
+ annotation, e.g. ``alpha: draw_float(min_value=15.0)`` or ``tint: draw_tuple``.
10
+
11
+ It just holds the view function and any per-field kwarg overrides captured at
12
+ class-definition time. ``FieldMeta`` extracts these and registers them into
13
+ Melty's ``default_funcs_by_name_type`` / ``default_kwargs_by_attrib_type``
14
+ maps, keyed by (owning class, attribute) — the same place ``@defaults``
15
+ writes. Nothing reads the carrier after that."""
16
+
17
+ is_annotation_override = True
18
+
19
+ def __init__(self, view_function=None, kwargs=None):
20
+ self.view_function = view_function
21
+ self.kwargs = dict(kwargs or {})
22
+
@@ -0,0 +1,36 @@
1
+ """Injected state for chat views."""
2
+ from meltygui.core.rendering.core_decoration import no_save
3
+ from meltygui.core.conversion.dict_conversion import DictConversion
4
+
5
+
6
+ @no_save("revision", "viewports", "text_layouts", "rename")
7
+ class ChatInterfaceState(DictConversion):
8
+ def __init__(self):
9
+ super().__init__()
10
+ self.provider = ""
11
+ self.account = ""
12
+ self.selected = {}
13
+ self.drafts = {}
14
+ self.draft_generations = {}
15
+ self.projects = {}
16
+ self.follow = True
17
+ self.answers = {}
18
+ self.revision = 0
19
+ self.viewports = {}
20
+ self.text_layouts = {}
21
+ self.rename = None
22
+ self.chat_menu = None
23
+ self.message_expanded = {}
24
+ self.concise = False
25
+ self.action_groups = {}
26
+ self.output_expanded = {}
27
+ self.image_sizes = {}
28
+ # The sidebar's age filter: conversations active within this many
29
+ # hours (0 = all). AGE_FILTERS lists the choices.
30
+ self.age_hours = 0
31
+ # The sources (account ids) whose conversations the sidebar shows -
32
+ # the tabs lit in the source bar: empty = just `account`.
33
+ self.sources = []
34
+ self.folder_expanded = {}
35
+ self.folders_default_expanded = True
36
+ self.sections_expanded = {"recent": True, "all": True, "accounts": True}
@@ -0,0 +1,10 @@
1
+ """Injected state for code views."""
2
+ from meltygui.core.conversion.dict_conversion import DictConversion
3
+
4
+
5
+ class SourcePreviewState(DictConversion):
6
+ def __init__(self):
7
+ super().__init__()
8
+ self.path = None
9
+ self.line = None
10
+ self.token = None
@@ -0,0 +1,59 @@
1
+ import itertools
2
+ import random
3
+ import uuid
4
+
5
+ from meltygui.state.model_enums import RelaxedEnum
6
+ from meltygui.core.rendering.core_decoration import defaults
7
+
8
+ # Monotonic id source: a per-process RANDOM start + a counter. next() on an
9
+ # itertools.count is atomic under the GIL (thread-safe). The random start keeps
10
+ # ids from separate runs apart (a bare counter would restart at 0 each run and
11
+ # collide with loaded ids); the counter makes ids collision-free WITHIN a run
12
+ # (the old uuid4[0:6] = 24 random bits actually collides for long graphs).
13
+ _id_counter = itertools.count(random.getrandbits(24))
14
+
15
+
16
+ class OffscreenDebugMode(RelaxedEnum):
17
+ OFF = "Off"
18
+ SHOW_LAYERS = "Show Layers"
19
+ SHOW_MASK = "Show Mask"
20
+
21
+
22
+ class OffscreenDebugMode(RelaxedEnum):
23
+ OFF = "Off"
24
+ SHOW_LAYERS = "layer"
25
+ SHOW_MASK = "mask"
26
+ SHOW_UV = "uv"
27
+ SHOW_SRC_PX = "srcpx"
28
+ SHOW_CHECKER = "checker"
29
+ SHOW_SOLID = "solid"
30
+
31
+
32
+ class ViewMode(RelaxedEnum):
33
+ NONE = "None"
34
+ IMGUI_WINDOW = "imgui-window"
35
+
36
+
37
+ class ProfileMode(RelaxedEnum):
38
+ OFF = "Off"
39
+ LIGHT = "Light"
40
+ ON = "On"
41
+
42
+
43
+
44
+ class PendingAction(RelaxedEnum):
45
+ APPLY = "apply"
46
+ REVERT = "revert"
47
+ LOAD = "load"
48
+
49
+
50
+ def generate_id():
51
+ """
52
+ Generates a unique identifier for use in ImGui elements.
53
+ This is useful to ensure that elements can be uniquely identified across frames.
54
+ :return: A unique identifier string (6+ hex chars; survives the [0:8] id trunc).
55
+
56
+ ~11x faster than the old uuid4[0:6] (no /dev/urandom read per call), and
57
+ collision-free within a process.
58
+ """
59
+ return format(next(_id_counter), "06x")