Commit Graph

481 Commits

Author SHA1 Message Date
Takase c0c2e7222e fix(process): check for HANDLE_INVALID (#1475) 2023-08-07 15:26:38 +01:00
Jan bd93e5a4b6 Make `system.path_compare` more digit-aware (#1474)
This allows a human friendly sorting filenames with numbers in them
So
- asd1
- asd10
- asd2
becomes
- asd1
- asd2
- asd10
2023-08-07 15:26:38 +01:00
Takase e667b16099 Process API improvements (again) (#1370)
* feat(process): add push_error
* refactor(process): use push_error for better errors
* style(process): consistent error messages
* refactor(process): reimplement process.strerror() with push_error
* refactor(process): implement close_fd only once
* refactor(process): rename process_handle to process_handle_t
* fix(process): prevent errors from a NULL error message
* refactor(process): refactor push_error into 2 functions
* fix(process): fix wrong error message
* fix(process): check if push_error_string actually pushed something
* refactor(process): make error messages descriptive
* fix(process): check for empty table instead of aborting
* refactor(process): make error messages descriptive on Windows
* refactor(process): rename process_stream_handle to process_stream_t
* refactor(process): fix wrong usage of process_handle_t
* fix(process): fix wrong type name
* refactor(process): incoporate kill_list_thread into process_kill_list_t
* refactor(process): make kill_list per-state data
2023-08-07 15:26:38 +01:00
Guldoman 10bd794d8a Show error message in crash message box (#1461)
* Save to `error.txt` the same traceback shown on stdout
* Show error message in crash message box
2023-08-07 15:26:38 +01:00
Jefferson González d16dce4fb6 Fix for api_require wrong macro && conditions (#1465)
This mistake escaped my eyes when reviewing #1437 and causes
some symbols to not be exported, because the preprocessor macros
are expecting multiple LUA versions to evaluate as true at once.
The fix is to replace `&&` with `||`.
2023-08-07 15:26:38 +01:00
Guldoman 637064d351 Make `system.path_compare` more case-aware (#1457)
* Use Lua-provided string lengths for `system.path_compare`
* Make `system.path_compare` more case-aware
   Before, strings like `README.md` would be sorted before `changelog.md`, 
   because we only looked at the raw ascii values.
   Now the character case is considered as a secondary sorting key.
2023-08-07 15:26:38 +01:00
Takase 688bcaf707 Update api_require to expose more symbols (#1437)
* feat(system): update api_require for more symbols
* fix(system): fix missing 5.1 symbols
* fix(system): add more missing symbols
* fix(system): add all symbols
   We got'em this time. I swear.
* fix(system): fix undefined symbols due to conditional compilation
   There is only pain and suffering.
   Turns out some of the symbols are only exported when the options are enabled.
   We need to preprocess the header.
2023-08-07 15:26:38 +01:00
Takase b623ad9b35 fix: fix differing stacktrace on stdout and file (#1404)
* fix(c-bootstrap): produce identical stack traces
2023-08-07 15:26:38 +01:00
Takase 612ebebb1f Fix invalid EXEFILE and EXEDIR on Windows (#1396)
* fix(main): fix get_exe_filename returning invalid result on Windows
* fix(main): fix bootstrap not intepreting UTF-8 properly
2023-08-07 15:26:38 +01:00
Adam 9634715618 Added in support for foreground and background events. (#1395) 2023-08-07 15:26:38 +01:00
Adam acbd8715f4 Added in explicit touchscreen keyboard support. (#1389) 2023-08-07 15:26:38 +01:00
Takase ef70faa2fd Asynchronous process reaping (#1412)
* refactor(process): introduce process_stream_handle separate from process_handle

* feat(process): introduce process_handle helper functions

* feat(process): add asynchronous process reaping

* feat(process): wait for shorter period if possible

* style(process): remove unecessary brackets

* style(process): fix parentheses

* refactor(process): remove useless setvbuf call

* style(process): remove unecessary value

* refactor(process): add size field into kill_list

* refactor(process): use SDL_Delay for sleeping

* style(process): remove trailing whitespace

* fix(main): destroy window before closing lua

* fix(process): check for timeout correctly

* refactor(process): remove unecessary if check

* refactor(process): remove size from the list

* fix(process): fix invalid delay calculation

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-07 15:26:37 +01:00
Guldoman 71e4adbd6f Aggregate `SDL_Surface`s and their scale in `RenSurface` (#1429) 2023-08-07 15:26:06 +01:00
Guldoman 94e2df991c Use clipping functions provided by SDL (#1426) 2023-08-07 15:26:06 +01:00
Guldoman ca29728e34 Improve text width calculation precision (#1408)
In some extreme cases (~30000 chars) text width precision takes a hit.
Using double instead of float fixes that.
2023-08-07 15:25:46 +01:00
Takase d31f128ef9 refactor(main): move SetProcessDPIAware to manifests (#1413) 2023-08-07 15:25:46 +01:00
Guldoman 703b14170b Split `Command` struct into different structs for each command type (#1407)
This reduces the space needed for each command.
2023-08-07 15:25:30 +01:00
Takase d27bd6b14d Add manifest on Windows (#1405)
* fix(gitignore): add exclusion for manifest files

* feat(windows): add application manifest

* feat(build): use application manifest on windows

* refactor(build): use genrate_file to generate the manifest

* style(manifest): remove trailing whitespace
2023-08-07 15:25:30 +01:00
Adam 9284e92291 Added in ability to specify prefix via env variable. (#1388) 2023-08-07 15:25:30 +01:00
Takase 0423611a99 fix: exec() error not returned to parent (#1363)
* fix: exec() error not returned to parent

* chore: remove accidental lua.h inclusion
2023-08-07 15:02:06 +01:00
Jan 66815b24b0 pass RenWindow by argument (#1321)
* pass RenWindow to all renderer functions that need it

* pass RenWindow to all rencache functions that need it
2023-08-07 15:02:06 +01:00
Guldoman 920d3ef1e3 Avoid drawing hidden text in `DocView:draw_line_text` (#1298)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`

* Don't add draw commands if they fall outside the latest clip

The check was previously done with the window rect, so this will reduce 
a bit more the number of commands sent.
2023-08-07 15:01:50 +01:00
Adam Harrison b676314b1a Updated dummy method signature to match prototypes. 2023-08-07 15:01:50 +01:00
Guldoman 757b906ca2 Make empty groups in `regex.gmatch` return their offset (#1325)
This makes `regex.gmatch` behave like `string.gmatch`.
2023-08-07 15:01:50 +01:00
adityaraj 9a831cb206 Create Renderer Only When It Doesn't Exist (#1315) 2023-08-07 15:01:50 +01:00
Jan 4d35dc4969 replace uses of SDL_Window with RenWindow (#1319)
Since Renwindow contains our instance of SDL_Window we can use this
to simplify future logic to create separate window instances
2023-08-07 15:01:31 +01:00
George Sokianos e4f3f1b744 Prepare 2.1.1r1 release 2023-01-29 12:58:56 +00:00
George Sokianos 62adafb59d Updates to make latest code compile and work under OS4 2023-01-09 00:45:37 +00:00
George Sokianos 65d95c7f40 Merge branch 'master' into amiga2.1 2023-01-08 21:04:04 +00:00
George Sokianos f6784d2530 innosetup changes 2023-01-08 20:52:15 +00:00
Jan aa503665e0
defer lua error until after cleanup (#1310) 2023-01-06 14:31:44 -04:00
Julien Voisin 6c6e5e9b99
Handle readlink errors (#1292) 2023-01-05 15:59:45 -05:00
Julien Voisin b3937b0380
Don't set a value twice (#1306) 2023-01-05 15:48:49 -05:00
Julien Voisin 7133ea5419
Fix a memory leak (#1305)
`font` was not freed upon error.
2023-01-05 15:48:01 -05:00
Julien Voisin 81b8747d80
Make api_require's nodes const (#1296) 2023-01-05 15:46:26 -05:00
Takase b7e9ca6585
do not allow users to create an empty font group (#1303) 2023-01-04 16:46:08 +01:00
Guldoman 2638e9636b
Allow command buffer to be expanded (#1297) 2023-01-01 21:12:14 -05:00
jgmdev 79908baed6 regex: properly call pcre2_jit_compile 2022-12-28 19:40:20 -04:00
Quinten Kock 3fda8c0a09
Fix userdata APIs for Lua 5.4 in native plugin interface (#1188)
* Reintroduce some missing Lua API's from native plugin API

* Add new upvalue functions to header

* Fix things that are actually macros in current lua

* Introduce lua_insert,replace,remove macros from lua5.4
2022-12-27 23:39:28 -05:00
Jefferson González 141d00795c
dirmonitor: use pipes on fsevents (#1274)
As suggested by Guldoman this change introduces the usage
of pipes to allow blocking the get changes call until any
file system changes are received, which now properly reduces
the cpu usage on idle to 0%.

This change better fixes #1237
2022-12-27 23:07:12 -04:00
Jefferson González 5fa7dabd34
dirmonitor: fix high cpu usage, fixes #1237 (#1271) 2022-12-27 18:23:39 -05:00
Guldoman c29b1c2cb9
Use Lua string length instead of relying on `strlen` (#1262)
This allows us to render `NULL` byte sequences and not truncate strings 
that contain them.
2022-12-26 13:49:07 -04:00
jgmdev 0ab7fe9311 core regex: use backward compatible lua_newuserdata 2022-12-21 00:54:12 -04:00
Guldoman 24179bbb23
Merge pull request #1245 from Jan200101/PR/touch-event
add touch events
2022-12-21 00:13:52 +01:00
Jan b584f1fe35
Simplify SDL message boxes (#1249)
It has what we needs and needs less abstraction, overall simplifying the code
2022-12-20 18:36:18 -04:00
Takase 6d0e7f3046
Fix some syntax errors (#1243)
* move signal.h inclusion outside of if-else block
not sure if this change is appropriate, we need to make sure SIG_IGN
is only set on POSIX targets. To verify this we might need to include
unistd.h,

* fix syntax error
this is often overlooked when compiling for normal platforms
2022-12-20 18:11:05 -04:00
Jefferson González 3c64c32379
core: ported regex.gsub to faster native version (#1233)
* added regex.gmatch iterator and other fixes
* fixed issues reported by Guldoman
* push strings with fixed len just in case for binary safety
* added limit to regex.gsub and use pushinteger
* added description to regex.gsub limits param
* replaced substitutions regex description for correctness
* ignore negative limits on regex.gsub
2022-12-20 17:46:37 -04:00
Jan200101 b137d77183
add touch events 2022-12-20 09:30:58 +01:00
Adam Harrison 5ab8dc0275 Converted from bytes to characters, as this is what windows is expecting. 2022-12-18 14:49:59 -05:00
Delta-official 5db5512663
Fix native plugins not reloading upon core:restart (#1219)
* Fix native plugins not reloading upon core:restart

* Move the metatable name definition to api.h

* Replace metatable name with const
2022-12-02 17:06:35 -05:00