From 0e2d49ca976de99068f1fa89ca27a7c748644fa2 Mon Sep 17 00:00:00 2001 From: Paul Manias Date: Tue, 22 Oct 2024 00:29:00 +0100 Subject: [PATCH 1/4] [Core] Removed unnecessary Custom parameter from the SubscribeEvent() function --- docs/xml/modules/classes/compressedstream.xml | 4 +- docs/xml/modules/core.xml | 15 +++--- include/parasol/modules/core.h | 14 +++--- src/audio/class_audio.cpp | 4 -- src/core/data_functions.c | 2 +- src/core/defs/core.fdl | 8 ++-- src/core/fs_volumes.cpp | 9 ++-- src/core/lib_events.cpp | 16 +++---- src/core/prototypes.h | 2 +- src/fluid/fluid_functions.cpp | 25 +++++----- src/fluid/fluid_input.cpp | 15 +++--- src/scintilla/class_scintilla.cxx | 8 ++-- src/vector/scene/scene.cpp | 8 ++-- src/vector/vectors/text.cpp | 46 +++++++++---------- 14 files changed, 85 insertions(+), 91 deletions(-) diff --git a/docs/xml/modules/classes/compressedstream.xml b/docs/xml/modules/classes/compressedstream.xml index 13c15d7a..93193155 100644 --- a/docs/xml/modules/classes/compressedstream.xml +++ b/docs/xml/modules/classes/compressedstream.xml @@ -354,10 +354,10 @@ - Hides the volume so that it will not show up when reading the root folder. + Hides the volume so that it will not show up when reading volumes from the root path :. If the volume already exists, the path will be inserted at the beginning of the path list so that it has priority over the others. If the volume already exists, all paths that are attached to it will be replaced with the new path setting. - Identifies the volume as being created by the system, is immutable and persistent between sessions. + Identifies the volume as being created by the system (this flag is not for client use). diff --git a/docs/xml/modules/core.xml b/docs/xml/modules/core.xml index 5cd5200f..9ac995d6 100644 --- a/docs/xml/modules/core.xml +++ b/docs/xml/modules/core.xml @@ -1756,18 +1756,18 @@ SetField(Object, FID_Statement|TSTR, "string"); SetVolume Files - Adds a new volume name to the system. + Create or modify a filesystem volume. ERR SetVolume(CSTRING Name, CSTRING Path, CSTRING Icon, CSTRING Label, CSTRING Device, VOLUME Flags) Required. The name of the volume. Required. The path to be associated with the volume. If setting multiple paths, separate each path with a semi-colon character. Each path must terminate with a forward slash to denote a folder. An icon can be associated with the volume so that it has graphical representation when viewed in the UI. The required icon string format is category/name. An optional label or short comment may be applied to the volume. This may be useful if the volume name has little meaning to the user (e.g. drive1, drive2 ...). - If the volume references the root of a device, specify a code of disk, hd, cd, network or usb. + If the volume references the root of a device, specify a device name of disk, hd, cd, network or usb. Optional flags. -

The SetVolume() function is used to create a volume that is associated with one or more paths. If the volume already exists, it possible to append more paths or replace them entirely.

+

SetVolume() is used to create or modify a volume that is associated with one or more paths. If the named volume already exists, it possible to append more paths or replace them entirely. Volume changes that are made with this function will only apply to the current process, and are lost after the program closes.

Flags that may be passed are as follows:

@@ -1820,17 +1820,16 @@ SetField(Object, FID_Statement|TSTR, "string"); SubscribeEvent Events Subscribe to a system event. - ERR SubscribeEvent(LARGE Event, FUNCTION * Callback, APTR Custom, APTR * Handle) + ERR SubscribeEvent(LARGE Event, FUNCTION * Callback, APTR * Handle) An event identifier. The function that will be subscribed to the event. - A custom pointer that will be sent to the callback function, set to NULL if not required. Pointer to an address that will receive the event handle.

Use the SubscribeEvent() function to listen for system events. An event ID (obtainable from GetEventID) must be provided, as well as a reference to a function that will be called each time that the event is broadcast.

An event handle will be returned in the Handle parameter to identify the subscription. This must be retained to later unsubscribe from the event with the UnsubscribeEvent function.

-

The prototype for the Callback function is Function(APTR Custom, APTR Event, LONG Size), where Event is the event structure that matches to the subscribed EventID.

+

The prototype for the Callback function is Function(APTR Event, LONG Size, APTR CallbackMeta), where Event is the event structure that matches to the subscribed EventID.

Operation successful. @@ -2955,10 +2954,10 @@ SetField(Object, FID_Statement|TSTR, "string"); - Hides the volume so that it will not show up when reading the root folder. + Hides the volume so that it will not show up when reading volumes from the root path :. If the volume already exists, the path will be inserted at the beginning of the path list so that it has priority over the others. If the volume already exists, all paths that are attached to it will be replaced with the new path setting. - Identifies the volume as being created by the system, is immutable and persistent between sessions. + Identifies the volume as being created by the system (this flag is not for client use). diff --git a/include/parasol/modules/core.h b/include/parasol/modules/core.h index 573142eb..d2d1e1ed 100644 --- a/include/parasol/modules/core.h +++ b/include/parasol/modules/core.h @@ -2052,7 +2052,7 @@ struct CoreBase { ERR (*_SetName)(OBJECTPTR Object, CSTRING Name); void (*_LogReturn)(void); ERR (*_SubscribeAction)(OBJECTPTR Object, AC Action, FUNCTION *Callback); - ERR (*_SubscribeEvent)(LARGE Event, FUNCTION *Callback, APTR Custom, APTR *Handle); + ERR (*_SubscribeEvent)(LARGE Event, FUNCTION *Callback, APTR *Handle); ERR (*_SubscribeTimer)(DOUBLE Interval, FUNCTION *Callback, APTR *Subscription); ERR (*_UpdateTimer)(APTR Subscription, DOUBLE Interval); ERR (*_UnsubscribeAction)(OBJECTPTR Object, AC Action); @@ -2151,7 +2151,7 @@ inline ERR ScanDir(struct DirInfo *Info) { return CoreBase->_ScanDir(Info); } inline ERR SetName(OBJECTPTR Object, CSTRING Name) { return CoreBase->_SetName(Object,Name); } inline void LogReturn(void) { return CoreBase->_LogReturn(); } inline ERR SubscribeAction(OBJECTPTR Object, AC Action, FUNCTION *Callback) { return CoreBase->_SubscribeAction(Object,Action,Callback); } -inline ERR SubscribeEvent(LARGE Event, FUNCTION *Callback, APTR Custom, APTR *Handle) { return CoreBase->_SubscribeEvent(Event,Callback,Custom,Handle); } +inline ERR SubscribeEvent(LARGE Event, FUNCTION *Callback, APTR *Handle) { return CoreBase->_SubscribeEvent(Event,Callback,Handle); } inline ERR SubscribeTimer(DOUBLE Interval, FUNCTION *Callback, APTR *Subscription) { return CoreBase->_SubscribeTimer(Interval,Callback,Subscription); } inline ERR UpdateTimer(APTR Subscription, DOUBLE Interval) { return CoreBase->_UpdateTimer(Subscription,Interval); } inline ERR UnsubscribeAction(OBJECTPTR Object, AC Action) { return CoreBase->_UnsubscribeAction(Object,Action); } @@ -2244,7 +2244,7 @@ extern "C" ERR ScanDir(struct DirInfo *Info); extern "C" ERR SetName(OBJECTPTR Object, CSTRING Name); extern "C" void LogReturn(void); extern "C" ERR SubscribeAction(OBJECTPTR Object, AC Action, FUNCTION *Callback); -extern "C" ERR SubscribeEvent(LARGE Event, FUNCTION *Callback, APTR Custom, APTR *Handle); +extern "C" ERR SubscribeEvent(LARGE Event, FUNCTION *Callback, APTR *Handle); extern "C" ERR SubscribeTimer(DOUBLE Interval, FUNCTION *Callback, APTR *Subscription); extern "C" ERR UpdateTimer(APTR Subscription, DOUBLE Interval); extern "C" ERR UnsubscribeAction(OBJECTPTR Object, AC Action); @@ -2315,8 +2315,8 @@ inline ERR SubscribeAction(OBJECTPTR Object, AC Action, FUNCTION Callback) { return SubscribeAction(Object,Action,&Callback); } -inline ERR SubscribeEvent(LARGE Event, FUNCTION Callback, APTR Custom, APTR *Handle) { - return SubscribeEvent(Event,&Callback,Custom,Handle); +inline ERR SubscribeEvent(LARGE Event, FUNCTION Callback, APTR *Handle) { + return SubscribeEvent(Event,&Callback,Handle); } inline ERR SubscribeTimer(DOUBLE Interval, FUNCTION Callback, APTR *Subscription) { @@ -4561,11 +4561,11 @@ template ERR ReadBE(OBJECTPTR Object, T *Result) // Function construction (refer types.h) -template FUNCTION C_FUNCTION(T *pRoutine, APTR pMeta = NULL) { +template FUNCTION C_FUNCTION(T *pRoutine, X pMeta = 0) { auto func = FUNCTION(CALL::STD_C); func.Context = CurrentContext(); func.Routine = (APTR)pRoutine; - func.Meta = pMeta; + func.Meta = reinterpret_cast(pMeta); return func; }; diff --git a/src/audio/class_audio.cpp b/src/audio/class_audio.cpp index 2fbe47b1..279072ad 100644 --- a/src/audio/class_audio.cpp +++ b/src/audio/class_audio.cpp @@ -60,10 +60,6 @@ static ERR AUDIO_Activate(extAudio *Self) return error; } - // Save the audio settings to disk post-initialisation - - acSaveSettings(Self); - // Calculate one mixing element size for the hardware driver (not our floating point mixer). if (Self->BitDepth IS 16) Self->DriverBitSize = sizeof(WORD); diff --git a/src/core/data_functions.c b/src/core/data_functions.c index d0439cc2..1820d7b3 100644 --- a/src/core/data_functions.c +++ b/src/core/data_functions.c @@ -86,7 +86,7 @@ FDEF argsSetResource[] = { { "Result", FD_LARGE }, { "Resource", FD_LONG }, { "V FDEF argsSetResourcePath[] = { { "Error", FD_LONG|FD_ERROR }, { "PathType", FD_LONG }, { "Path", FD_STR }, { 0, 0 } }; FDEF argsSetVolume[] = { { "Error", FD_LONG|FD_ERROR }, { "Name", FD_STR }, { "Path", FD_STR }, { "Icon", FD_STR }, { "Label", FD_STR }, { "Device", FD_STR }, { "Flags", FD_LONG }, { 0, 0 } }; FDEF argsSubscribeAction[] = { { "Error", FD_LONG|FD_ERROR }, { "Object", FD_OBJECTPTR }, { "Action", FD_LONG }, { "Callback", FD_FUNCTIONPTR }, { 0, 0 } }; -FDEF argsSubscribeEvent[] = { { "Error", FD_LONG|FD_ERROR }, { "Event", FD_LARGE }, { "Callback", FD_FUNCTIONPTR }, { "Custom", FD_PTR }, { "Handle", FD_PTR|FD_RESULT }, { 0, 0 } }; +FDEF argsSubscribeEvent[] = { { "Error", FD_LONG|FD_ERROR }, { "Event", FD_LARGE }, { "Callback", FD_FUNCTIONPTR }, { "Handle", FD_PTR|FD_RESULT }, { 0, 0 } }; FDEF argsSubscribeTimer[] = { { "Error", FD_LONG|FD_ERROR }, { "Interval", FD_DOUBLE }, { "Callback", FD_FUNCTIONPTR }, { "Subscription", FD_PTR|FD_RESULT }, { 0, 0 } }; FDEF argsUnloadFile[] = { { "Void", FD_VOID }, { "CacheFile:Cache", FD_PTR|FD_STRUCT|FD_RESOURCE }, { 0, 0 } }; FDEF argsUnsubscribeAction[] = { { "Error", FD_LONG|FD_ERROR }, { "Object", FD_OBJECTPTR }, { "Action", FD_LONG }, { 0, 0 } }; diff --git a/src/core/defs/core.fdl b/src/core/defs/core.fdl index 5275b193..3528c79c 100644 --- a/src/core/defs/core.fdl +++ b/src/core/defs/core.fdl @@ -1213,8 +1213,8 @@ inline ERR SubscribeAction(OBJECTPTR Object, AC Action, FUNCTION Callback) { return SubscribeAction(Object,Action,&Callback); } -inline ERR SubscribeEvent(LARGE Event, FUNCTION Callback, APTR Custom, APTR *Handle) { - return SubscribeEvent(Event,&Callback,Custom,Handle); +inline ERR SubscribeEvent(LARGE Event, FUNCTION Callback, APTR *Handle) { + return SubscribeEvent(Event,&Callback,Handle); } inline ERR SubscribeTimer(DOUBLE Interval, FUNCTION Callback, APTR *Subscription) { @@ -2412,11 +2412,11 @@ template ERR ReadBE(OBJECTPTR Object, T *Result) // Function construction (refer types.h) -template FUNCTION C_FUNCTION(T *pRoutine, APTR pMeta = NULL) { +template FUNCTION C_FUNCTION(T *pRoutine, X pMeta = 0) { auto func = FUNCTION(CALL::STD_C); func.Context = CurrentContext(); func.Routine = (APTR)pRoutine; - func.Meta = pMeta; + func.Meta = reinterpret_cast(pMeta); return func; }; diff --git a/src/core/fs_volumes.cpp b/src/core/fs_volumes.cpp index eda5e0ce..339a28ea 100644 --- a/src/core/fs_volumes.cpp +++ b/src/core/fs_volumes.cpp @@ -96,10 +96,11 @@ ERR RenameVolume(CSTRING Volume, CSTRING Name) /********************************************************************************************************************* -FUNCTION- -SetVolume: Adds a new volume name to the system. +SetVolume: Create or modify a filesystem volume. -The SetVolume() function is used to create a volume that is associated with one or more paths. If the volume already -exists, it possible to append more paths or replace them entirely. +SetVolume() is used to create or modify a volume that is associated with one or more paths. If the named volume +already exists, it possible to append more paths or replace them entirely. Volume changes that are made with this +function will only apply to the current process, and are lost after the program closes. Flags that may be passed are as follows: @@ -110,7 +111,7 @@ cstr Name: Required. The name of the volume. cstr Path: Required. The path to be associated with the volume. If setting multiple paths, separate each path with a semi-colon character. Each path must terminate with a forward slash to denote a folder. cstr Icon: An icon can be associated with the volume so that it has graphical representation when viewed in the UI. The required icon string format is `category/name`. cstr Label: An optional label or short comment may be applied to the volume. This may be useful if the volume name has little meaning to the user (e.g. `drive1`, `drive2` ...). -cstr Device: If the volume references the root of a device, specify a code of `disk`, `hd`, `cd`, `network` or `usb`. +cstr Device: If the volume references the root of a device, specify a device name of `disk`, `hd`, `cd`, `network` or `usb`. int(VOLUME) Flags: Optional flags. -ERRORS- diff --git a/src/core/lib_events.cpp b/src/core/lib_events.cpp index 7464b4cc..44127d08 100644 --- a/src/core/lib_events.cpp +++ b/src/core/lib_events.cpp @@ -31,16 +31,14 @@ static const std::array glEventGroups = { }; struct eventsub { - struct eventsub *Next; - struct eventsub *Prev; + struct eventsub *Next, *Prev; EVENTID EventID; EVENTID EventMask; - void (*Callback)(APTR Custom, APTR Info, LONG Size, APTR Meta); + void (*Callback)(APTR Info, LONG Size, APTR Meta); APTR CallbackMeta; EVG Group; UBYTE Called; OBJECTID ContextID; - APTR Custom; inline CSTRING groupName() { return glEventGroups[UBYTE(Group)]; @@ -176,13 +174,12 @@ must be provided, as well as a reference to a function that will be called each An event handle will be returned in the `Handle` parameter to identify the subscription. This must be retained to later unsubscribe from the event with the ~UnsubscribeEvent() function. -The prototype for the `Callback` function is `Function(APTR Custom, APTR Event, LONG Size)`, where `Event` is the +The prototype for the `Callback` function is `Function(APTR Event, LONG Size, APTR CallbackMeta)`, where `Event` is the event structure that matches to the subscribed EventID. -INPUT- large Event: An event identifier. ptr(func) Callback: The function that will be subscribed to the event. -ptr Custom: A custom pointer that will be sent to the callback function, set to `NULL` if not required. &ptr Handle: Pointer to an address that will receive the event handle. -ERRORS- @@ -192,7 +189,7 @@ AllocMemory *********************************************************************************************************************/ -ERR SubscribeEvent(LARGE EventID, FUNCTION *Callback, APTR Custom, APTR *Handle) +ERR SubscribeEvent(LARGE EventID, FUNCTION *Callback, APTR *Handle) { pf::Log log(__FUNCTION__); @@ -213,13 +210,12 @@ ERR SubscribeEvent(LARGE EventID, FUNCTION *Callback, APTR Custom, APTR *Handle) OBJECTPTR context = CurrentContext(); event->EventID = EventID; - event->Callback = (void (*)(APTR, APTR, LONG, APTR))Callback->Routine; + event->Callback = (void (*)(APTR, LONG, APTR))Callback->Routine; event->CallbackMeta = Callback->Meta; event->Group = gid; event->ContextID = context->UID; event->Next = glEventList; event->Prev = NULL; - event->Custom = Custom; event->EventMask = mask; if (glEventList) glEventList->Prev = event; @@ -321,7 +317,7 @@ ERR msg_event(APTR Custom, LONG MsgID, LONG MsgType, APTR Message, LONG MsgSize) pf::ScopedObjectLock lock(event->ContextID, 3000); if (lock.granted()) { pf::SwitchContext ctx(lock.obj); - event->Callback(event->Custom, Message, MsgSize, event->CallbackMeta); + event->Callback(Message, MsgSize, event->CallbackMeta); } if (glEventListAltered) goto restart; diff --git a/src/core/prototypes.h b/src/core/prototypes.h index e4bf8d58..87d6411b 100644 --- a/src/core/prototypes.h +++ b/src/core/prototypes.h @@ -50,7 +50,7 @@ extern "C" ERR ScanDir(struct DirInfo * Info); extern "C" ERR SetName(OBJECTPTR Object, CSTRING Name); extern "C" void LogReturn(); extern "C" ERR SubscribeAction(OBJECTPTR Object, AC Action, FUNCTION * Callback); -extern "C" ERR SubscribeEvent(LARGE Event, FUNCTION * Callback, APTR Custom, APTR * Handle); +extern "C" ERR SubscribeEvent(LARGE Event, FUNCTION * Callback, APTR * Handle); extern "C" ERR SubscribeTimer(DOUBLE Interval, FUNCTION * Callback, APTR * Subscription); extern "C" ERR UpdateTimer(APTR Subscription, DOUBLE Interval); extern "C" ERR UnsubscribeAction(OBJECTPTR Object, AC Action); diff --git a/src/fluid/fluid_functions.cpp b/src/fluid/fluid_functions.cpp index f64185cc..5fb5588d 100644 --- a/src/fluid/fluid_functions.cpp +++ b/src/fluid/fluid_functions.cpp @@ -113,7 +113,7 @@ int fcmd_catch(lua_State *Lua) auto prv = (prvFluid *)Lua->Script->ChildPrivate; if (lua_gettop(Lua) >= 2) { - LONG type = lua_type(Lua, 1); + auto type = lua_type(Lua, 1); if (type IS LUA_TFUNCTION) { LONG catch_filter = 0; type = lua_type(Lua, 2); @@ -202,14 +202,14 @@ int fcmd_catch(lua_State *Lua) else luaL_argerror(Lua, 1, "Expected function."); } else { // In single-function mode, exceptions are returned as a result. - LONG type = lua_type(Lua, 1); + auto type = lua_type(Lua, 1); if (type IS LUA_TFUNCTION) { prv->Catch++; // Indicate to other routines that errors must be converted to exceptions. prv->CaughtError = ERR::Okay; lua_pushcfunction(Lua, fcmd_catch_handler); lua_pushvalue(Lua, 1); // Parameter #1 is the function to call. - LONG result_top = lua_gettop(Lua); + auto result_top = lua_gettop(Lua); if (lua_pcall(Lua, 0, LUA_MULTRET, -2)) { prv->Catch--; @@ -242,7 +242,7 @@ int fcmd_catch(lua_State *Lua) else { prv->Catch--; // Successful call lua_pushnil(Lua); // Use nil to indicate that no exception occurred - LONG result_count = lua_gettop(Lua) - result_top + 1; + auto result_count = lua_gettop(Lua) - result_top + 1; lua_insert(Lua, -result_count); // Push the error code in front of any other results return result_count; } @@ -261,18 +261,18 @@ int fcmd_catch(lua_State *Lua) // Where Args is a named array containing the event parameters. If the event is not known to Fluid, then no Args will // be provided. -static void receive_event(eventsub *Event, APTR Info, LONG InfoSize) +static void receive_event(rkEvent *Info, LONG InfoSize, APTR CallbackMeta) { auto Script = (objScript *)CurrentContext(); auto prv = (prvFluid *)Script->ChildPrivate; if (!prv) return; pf::Log log(__FUNCTION__); - log.trace("Received event $%.8x%.8x", (LONG)((Event->EventID>>32) & 0xffffffff), (LONG)(Event->EventID & 0xffffffff)); + log.trace("Received event $%.8x%.8x", (LONG)((Info->EventID>>32) & 0xffffffff), (LONG)(Info->EventID & 0xffffffff)); - lua_rawgeti(prv->Lua, LUA_REGISTRYINDEX, Event->Function); + lua_rawgeti(prv->Lua, LUA_REGISTRYINDEX, intptr_t(CallbackMeta)); - lua_pushnumber(prv->Lua, ((rkEvent *)Info)->EventID); + lua_pushnumber(prv->Lua, Info->EventID); if (lua_pcall(prv->Lua, 1, 0, 0)) { process_error(Script, "Event Subscription"); } @@ -354,7 +354,7 @@ int fcmd_subscribe_event(lua_State *Lua) } } - EVG group_id = EVG::NIL; + auto group_id = EVG::NIL; if ((group_hash) and (subgroup_hash)) { switch (group_hash) { case HASH_FILESYSTEM: group_id = EVG::FILESYSTEM; break; @@ -386,10 +386,11 @@ int fcmd_subscribe_event(lua_State *Lua) } else { APTR handle; - if (auto error = SubscribeEvent(event_id, C_FUNCTION(receive_event), NULL, &handle); error IS ERR::Okay) { + lua_settop(Lua, 2); + auto client_function = luaL_ref(Lua, LUA_REGISTRYINDEX); + if (auto error = SubscribeEvent(event_id, C_FUNCTION(receive_event, client_function), &handle); error IS ERR::Okay) { auto prv = (prvFluid *)Lua->Script->ChildPrivate; - lua_settop(Lua, 2); - prv->EventList.emplace_back(luaL_ref(Lua, LUA_REGISTRYINDEX), event_id, handle); + prv->EventList.emplace_back(client_function, event_id, handle); lua_pushlightuserdata(Lua, handle); // 1: Handle lua_pushinteger(Lua, LONG(error)); // 2: Error code } diff --git a/src/fluid/fluid_input.cpp b/src/fluid/fluid_input.cpp index 317bae44..2e93e0d4 100644 --- a/src/fluid/fluid_input.cpp +++ b/src/fluid/fluid_input.cpp @@ -45,8 +45,8 @@ extern "C" { JUMPTABLE_DISPLAY static int input_unsubscribe(lua_State *Lua); -static void focus_event(lua_State *, evFocus *, LONG); -static void key_event(struct finput *, evKey *, LONG); +static void focus_event(evFocus *, LONG, lua_State *); +static void key_event(evKey *, LONG, struct finput *); //******************************************************************************************************************** @@ -147,7 +147,7 @@ static int input_keyboard(lua_State *Lua) bool sub_keyevent = false; if (object_id) { if (!prv->FocusEventHandle) { // Monitor the focus state of the target surface with a global function. - SubscribeEvent(EVID_GUI_SURFACE_FOCUS, C_FUNCTION(focus_event), Lua, &prv->FocusEventHandle); + SubscribeEvent(EVID_GUI_SURFACE_FOCUS, C_FUNCTION(focus_event, Lua), &prv->FocusEventHandle); } if (ScopedObjectLock surface(object_id, 5000); surface.granted()) { @@ -166,7 +166,7 @@ static int input_keyboard(lua_State *Lua) lua_setmetatable(Lua, -2); APTR event = NULL; - if (sub_keyevent) SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event), input, &event); + if (sub_keyevent) SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event, input), &event); input->InputHandle = 0; input->Script = Lua->Script; @@ -412,7 +412,7 @@ static int input_destruct(lua_State *Lua) //******************************************************************************************************************** // Key events should only be received when a monitored surface has the focus. -static void key_event(struct finput *Input, evKey *Event, LONG Size) +static void key_event(evKey *Event, LONG Size, struct finput *Input) { pf::Log log("input.key_event"); objScript *script = Input->Script; @@ -448,7 +448,7 @@ static void key_event(struct finput *Input, evKey *Event, LONG Size) //******************************************************************************************************************** // This is a global function for monitoring the focus of surfaces that we want to filter on for keyboard input. -static void focus_event(lua_State *Lua, evFocus *Event, LONG Size) +static void focus_event(evFocus *Event, LONG Size, lua_State *Lua) { pf::Log log(__FUNCTION__); auto prv = (prvFluid *)Lua->Script->ChildPrivate; @@ -465,10 +465,11 @@ static void focus_event(lua_State *Lua, evFocus *Event, LONG Size) if (input->Mode != FIM_KEYBOARD) continue; if (input->KeyEvent) continue; + auto callback = C_FUNCTION(key_event, input); for (LONG i=0; i < Event->TotalWithFocus; i++) { if (input->SurfaceID IS Event->FocusList[i]) { log.trace("Focus notification received for key events on surface #%d.", input->SurfaceID); - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event), input, &input->KeyEvent); + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, callback, &input->KeyEvent); break; } } diff --git a/src/scintilla/class_scintilla.cxx b/src/scintilla/class_scintilla.cxx index a2074d85..1ed2c033 100644 --- a/src/scintilla/class_scintilla.cxx +++ b/src/scintilla/class_scintilla.cxx @@ -211,7 +211,7 @@ static ERR create_scintilla(void); static void draw_scintilla(extScintilla *, objSurface *, objBitmap *); static ERR load_file(extScintilla *, CSTRING); static void calc_longest_line(extScintilla *); -static void key_event(extScintilla *, evKey *, LONG); +static void key_event(evKey *, LONG, extScintilla *); static void report_event(extScintilla *, SEF Event); static ERR idle_timer(extScintilla *Self, LARGE Elapsed, LARGE CurrentTime); extern ERR init_search(void); @@ -307,7 +307,7 @@ static void notify_focus(OBJECTPTR Object, ACTIONID ActionID, ERR Result, APTR A if (Result != ERR::Okay) return; if (!Self->prvKeyEvent) { - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event), Self, &Self->prvKeyEvent); + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event, Self), &Self->prvKeyEvent); } if ((Self->Visible) and ((Self->Flags & SCIF::DISABLED) IS SCIF::NIL)) { @@ -808,7 +808,7 @@ static ERR SCINTILLA_Init(extScintilla *Self, APTR) SubscribeAction(*surface, AC::Show, C_FUNCTION(notify_show)); if (surface->hasFocus()) { - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event), Self, &Self->prvKeyEvent); + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event, Self), &Self->prvKeyEvent); } } else return log.warning(ERR::AccessObject); @@ -2260,7 +2260,7 @@ static ERR load_file(extScintilla *Self, CSTRING Path) //******************************************************************************************************************** -static void key_event(extScintilla *Self, evKey *Event, LONG Size) +static void key_event(evKey *Event, LONG Size, extScintilla *Self) { pf::Log log; diff --git a/src/vector/scene/scene.cpp b/src/vector/scene/scene.cpp index 801880ac..c4226142 100644 --- a/src/vector/scene/scene.cpp +++ b/src/vector/scene/scene.cpp @@ -64,7 +64,7 @@ static void fill_pattern(VectorState &, const TClipRectangle &, agg::pat static ERR VECTORSCENE_Reset(extVectorScene *); void apply_focus(extVectorScene *, extVector *); -static void scene_key_event(extVectorScene *, evKey *, LONG); +static void scene_key_event(evKey *, LONG, extVectorScene *); static void process_resize_msgs(extVectorScene *); static void render_to_surface(extVectorScene *Self, objSurface *Surface, objBitmap *Bitmap) @@ -144,7 +144,7 @@ static void notify_focus(OBJECTPTR Object, ACTIONID ActionID, ERR Result, APTR A { auto Self = (extVectorScene *)CurrentContext(); if (!Self->KeyHandle) { - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(scene_key_event), Self, &Self->KeyHandle); + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(scene_key_event, Self), &Self->KeyHandle); } } @@ -431,7 +431,7 @@ static ERR VECTORSCENE_Init(extVectorScene *Self) SubscribeAction(*surface, AC::LostFocus, C_FUNCTION(notify_lostfocus)); if (surface->hasFocus()) { - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(scene_key_event), Self, &Self->KeyHandle); + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(scene_key_event, Self), &Self->KeyHandle); } } @@ -865,7 +865,7 @@ static ERR vector_keyboard_events(extVector *Vector, const evKey *Event) //******************************************************************************************************************** // Distribute input events to any vectors that have subscribed and have the focus -static void scene_key_event(extVectorScene *Self, evKey *Event, LONG Size) +static void scene_key_event(evKey *Event, LONG Size, extVectorScene *Self) { const std::lock_guard lock(glVectorFocusLock); diff --git a/src/vector/vectors/text.cpp b/src/vector/vectors/text.cpp index 2f4b44de..0525a116 100644 --- a/src/vector/vectors/text.cpp +++ b/src/vector/vectors/text.cpp @@ -218,7 +218,7 @@ static void delete_selection(extVectorText *); static void insert_char(extVectorText *, LONG, LONG); static void generate_text(extVectorText *, agg::path_storage &Path); static void raster_text_to_bitmap(extVectorText *); -static void key_event(extVectorText *, evKey *, LONG); +static void key_event(evKey *, LONG, extVectorText *); static ERR reset_font(extVectorText *, bool = false); static ERR text_input_events(extVector *, const InputEvent *); static ERR text_focus_event(extVector *, FM, OBJECTPTR, APTR); @@ -246,7 +246,7 @@ inline void get_kerning_xy(FT_Face Face, LONG Glyph, LONG PrevGlyph, DOUBLE &X, inline DOUBLE get_kerning(FT_Face Face, LONG Glyph, LONG PrevGlyph) { - if ((!Glyph) or (!PrevGlyph)) return 0; + if ((not Glyph) or (not PrevGlyph)) return 0; FT_Vector delta; FT_Get_Kerning(Face, PrevGlyph, Glyph, FT_KERNING_DEFAULT, &delta); @@ -325,7 +325,7 @@ static ERR VECTORTEXT_DeleteLine(extVectorText *Self, struct vt::DeleteLine *Arg { if (Self->txLines.empty()) return ERR::Okay; - if ((!Args) or (Args->Line < 0)) Self->txLines.pop_back(); + if ((not Args) or (Args->Line < 0)) Self->txLines.pop_back(); else if ((size_t)Args->Line < Self->txLines.size()) Self->txLines.erase(Self->txLines.begin() + Args->Line); else return ERR::Args; @@ -379,7 +379,7 @@ static ERR VECTORTEXT_Free(extVectorText *Self) static ERR VECTORTEXT_Init(extVectorText *Self) { if ((Self->txFlags & VTXF::EDITABLE) != VTXF::NIL) { - if (!Self->txFocusID) { + if (not Self->txFocusID) { if (Self->ParentView) Self->txFocusID = Self->ParentView->UID; } @@ -534,7 +534,7 @@ taken into account. static ERR TEXT_GET_Descent(extVectorText *Self, LONG *Value) { - if (!Self->txHandle) { + if (not Self->txHandle) { if (auto error = reset_font(Self); error != ERR::Okay) return error; } @@ -557,7 +557,7 @@ account. The height includes the top region reserved for accents, but excludes static ERR TEXT_GET_DisplayHeight(extVectorText *Self, LONG *Value) { - if (!Self->txHandle) { + if (not Self->txHandle) { if (auto error = reset_font(Self); error != ERR::Okay) return error; } @@ -581,7 +581,7 @@ calculation `16 * 72 / 96`. static ERR TEXT_GET_DisplaySize(extVectorText *Self, LONG *Value) { - if (!Self->txHandle) { + if (not Self->txHandle) { if (auto error = reset_font(Self); error != ERR::Okay) return error; } @@ -913,7 +913,7 @@ static ERR TEXT_GET_FontStyle(extVectorText *Self, CSTRING *Value) static ERR TEXT_SET_FontStyle(extVectorText *Self, CSTRING Value) { - if ((!Value) or (!Value[0])) strcopy("Regular", Self->txFontStyle, sizeof(Self->txFontStyle)); + if ((not Value) or (not Value[0])) strcopy("Regular", Self->txFontStyle, sizeof(Self->txFontStyle)); else strcopy(Value, Self->txFontStyle, sizeof(Self->txFontStyle)); return ERR::Okay; } @@ -994,7 +994,7 @@ This field can be queried for the amount of space between each line, measured in static ERR TEXT_GET_LineSpacing(extVectorText *Self, LONG *Value) { - if (!Self->txHandle) { + if (not Self->txHandle) { if (auto error = reset_font(Self); error != ERR::Okay) return error; } @@ -1329,9 +1329,9 @@ transforms. static ERR TEXT_GET_TextWidth(extVectorText *Self, LONG *Value) { - if (!Self->initialised()) return ERR::NotInitialised; + if (not Self->initialised()) return ERR::NotInitialised; - if (!Self->txHandle) { + if (not Self->txHandle) { if (auto error = reset_font(Self); error != ERR::Okay) return error; } @@ -1447,7 +1447,7 @@ extern void set_text_final_xy(extVectorText *Vector) static ERR reset_font(extVectorText *Vector, bool Force) { - if ((!Vector->initialised()) and (!Force)) return ERR::NotInitialised; + if ((not Vector->initialised()) and (not Force)) return ERR::NotInitialised; pf::Log log; if (auto error = get_font(log, Vector->txFamily, Vector->txFontStyle, Vector->txWeight, Vector->txFontSize, &Vector->txHandle); error IS ERR::Okay) { @@ -1519,8 +1519,8 @@ static ERR text_focus_event(extVector *Vector, FM Event, OBJECTPTR EventObject, else { SubscribeTimer(0.8, C_FUNCTION(cursor_timer), &Self->txCursor.timer); - if (!Self->txKeyEvent) { - SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event), Self, &Self->txKeyEvent); + if (not Self->txKeyEvent) { + SubscribeEvent(EVID_IO_KEYBOARD_KEYPRESS, C_FUNCTION(key_event, Self), &Self->txKeyEvent); } } @@ -1645,7 +1645,7 @@ static ERR text_input_events(extVector *Vector, const InputEvent *Events) //******************************************************************************************************************** -static void key_event(extVectorText *Self, evKey *Event, LONG Size) +static void key_event(evKey *Event, LONG Size, extVectorText *Self) { if ((Event->Qualifiers & KQ::PRESSED) IS KQ::NIL) return; @@ -1717,7 +1717,7 @@ static void key_event(extVectorText *Self, evKey *Event, LONG Size) Self->txLines[Self->txCursor.row()].replace(offset, Self->txLines[Self->txCursor.row()].charLength(offset), ""); } else if (Self->txCursor.row() > 0) { // The current line will be shifted up into the line above it - if ((!Self->txLines[Self->txCursor.row()-1].empty()) or (!Self->txLines[Self->txCursor.row()].empty())) { + if ((not Self->txLines[Self->txCursor.row()-1].empty()) or (not Self->txLines[Self->txCursor.row()].empty())) { Self->txLines[Self->txCursor.row()-1] += Self->txLines[Self->txCursor.row()]; Self->txLines.erase(Self->txLines.begin() + Self->txCursor.row()); Self->txCursor.move(Self, Self->txCursor.row()-1, Self->txLines[Self->txCursor.row()].utf8Length()); @@ -1777,7 +1777,7 @@ static void key_event(extVectorText *Self, evKey *Event, LONG Size) Self->txCursor.move(Self, row + 1, 0); add_line(Self, Self->txLines[row], offset, Self->txLines[row].length() - offset, row+1); - if (!offset) Self->txLines[row].clear(); + if (not offset) Self->txLines[row].clear(); else Self->txLines[row].replace(offset, Self->txLines[row].length() - offset, ""); mark_dirty(Self, RC::BASE_PATH); acDraw(Self); @@ -1804,7 +1804,7 @@ static void key_event(extVectorText *Self, evKey *Event, LONG Size) case KEY::RIGHT: Self->txCursor.resetFlash(); Self->txCursor.vector->setVisibility(VIS::VISIBLE); - if (!Self->txLines.empty()) { + if (not Self->txLines.empty()) { if (Self->txCursor.column() < Self->txLines[Self->txCursor.row()].utf8Length()) { Self->txCursor.move(Self, Self->txCursor.row(), Self->txCursor.column()+1); } @@ -1904,12 +1904,12 @@ void TextCursor::move(extVectorText *Vector, LONG Row, LONG Column, bool Validat if (Row < 0) Row = 0; else if ((size_t)Row >= Vector->txLines.size()) { - if (!Vector->txLines.empty()) Row = (LONG)Vector->txLines.size() - 1; + if (not Vector->txLines.empty()) Row = (LONG)Vector->txLines.size() - 1; } if (Column < 0) Column = 0; else if (ValidateWidth) { - if (!Vector->txLines.empty()) { + if (not Vector->txLines.empty()) { LONG max_col = Vector->txLines[mRow].utf8Length(); if (Column > max_col) Column = max_col; } @@ -1930,7 +1930,7 @@ void TextCursor::reset_vector(extVectorText *Vector) const if (Vector->txCursor.vector) { auto &line = Vector->txLines[mRow]; - if (!line.chars.empty()) { + if (not line.chars.empty()) { auto col = mColumn; if ((size_t)col >= line.chars.size()) col = line.chars.size() - 1; Vector->txCursor.vector->Points[0].X = line.chars[col].x1 + 0.5; @@ -1942,7 +1942,7 @@ void TextCursor::reset_vector(extVectorText *Vector) const // If the cursor X,Y lies outside of the parent viewport, offset the text so that it remains visible to // the user. - if ((!Vector->Morph) and (Vector->ParentView)) { + if ((not Vector->Morph) and (Vector->ParentView)) { auto p_width = Vector->ParentView->vpFixedWidth; DOUBLE xo = 0; const DOUBLE CURSOR_MARGIN = Vector->txFontSize * 0.5; @@ -1995,7 +1995,7 @@ void TextCursor::validate_position(extVectorText *Self) const static void insert_char(extVectorText *Self, LONG Unicode, LONG Column) { - if ((!Self) or (!Unicode)) return; + if ((not Self) or (not Unicode)) return; mark_dirty(Self, RC::BASE_PATH); From c767760dd5145edf8a64fb08d15d8c3e9ffaab18 Mon Sep 17 00:00:00 2001 From: Paul Manias Date: Wed, 30 Oct 2024 10:20:01 +0000 Subject: [PATCH 2/4] [Icons] Added new_bookmark icon, improved existing bookmark icon --- data/icons/Default/items/bookmark.svg | 10 +++++----- data/icons/Default/items/new_bookmark.svg | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 data/icons/Default/items/new_bookmark.svg diff --git a/data/icons/Default/items/bookmark.svg b/data/icons/Default/items/bookmark.svg index 8ae4fe04..9af9091b 100644 --- a/data/icons/Default/items/bookmark.svg +++ b/data/icons/Default/items/bookmark.svg @@ -1,5 +1,5 @@ - - - - - + + + + + diff --git a/data/icons/Default/items/new_bookmark.svg b/data/icons/Default/items/new_bookmark.svg new file mode 100644 index 00000000..da7c2941 --- /dev/null +++ b/data/icons/Default/items/new_bookmark.svg @@ -0,0 +1,5 @@ + + + + + From 97329ec782979b3079fd73744d83fa9d3b9a7426 Mon Sep 17 00:00:00 2001 From: Paul Manias Date: Wed, 30 Oct 2024 10:22:40 +0000 Subject: [PATCH 3/4] [Scripts] FileView script now supports bookmarking (volume creation) --- scripts/gui/fileview.fluid | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/gui/fileview.fluid b/scripts/gui/fileview.fluid index 424327c7..f8a60e44 100644 --- a/scripts/gui/fileview.fluid +++ b/scripts/gui/fileview.fluid @@ -1483,14 +1483,10 @@ gui.fileview = function(View, Options) self.browse(nil) end) - Bar.addItem(2, 'Parent', 'Parent Folder', 'arrows/arrow_nw', function() + Bar.addItem(2, 'Parent', 'Parent Folder', 'folders/parent', function() self.parentFolder() end) - Bar.addItem(3, 'Bookmark', 'Bookmarks', 'items/bookmark', function() - -- TODO: Add the current folder as a new volume. - end) - Bar.addItem(4, 'Prev', 'Previous File', 'arrows/fat_left', function() self.view.selectPrev(function (Item) if Item.type == 'file' then return true end end) end) @@ -1504,6 +1500,30 @@ gui.fileview = function(View, Options) displayFilters(self) end) end + + Bar.addItem(3, 'Bookmark', 'Bookmarks', 'items/new_bookmark', function() + if (string.len(self.path) < 3) then return end + + local current_path = self.path + + gui.dialog.message({ + modal = true, + image = 'items/bookmark', + title = 'Create New Volume', + message = 'Enter a new volume name for the path ' .. self.path, + userInput = '', + options = { + { id=2, text='Cancel', icon='items/cancel' }, + { id=1, text='Create Volume', icon='items/checkmark' } + }, + feedback = function(Dialog, Response, State) + if Response and Response.id == 1 and string.len(State.input) > 0 then + mSys.SetVolume(State.input, current_path, 'items/bookmark', nil, nil, VOLUME_REPLACE) + end + end + }) + end) + end }) From a89e74f511eb7f1e48efa61fdff9bcd0f5861ce9 Mon Sep 17 00:00:00 2001 From: Paul Manias Date: Sun, 17 Nov 2024 11:24:30 +0000 Subject: [PATCH 4/4] [Core] Moved the rkEvent structure to the pf namespace --- include/parasol/modules/core.h | 24 +++++++++++++----------- src/core/defs/core.fdl | 24 +++++++++++++----------- src/core/lib_events.cpp | 12 ++++++------ src/fluid/fluid_functions.cpp | 2 +- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/include/parasol/modules/core.h b/include/parasol/modules/core.h index d2d1e1ed..dfd59c70 100644 --- a/include/parasol/modules/core.h +++ b/include/parasol/modules/core.h @@ -1611,7 +1611,7 @@ struct OpenInfo { #define FDF_SYNONYM FD_SYNONYM #define FDF_UNSIGNED FD_UNSIGNED -#define FDF_FUNCTION FD_FUNCTION // sizeof(struct rkFunction) - use FDF_FUNCTIONPTR for sizeof(APTR) +#define FDF_FUNCTION FD_FUNCTION // sizeof(FUNCTION) - use FDF_FUNCTIONPTR for sizeof(APTR) #define FDF_FUNCTIONPTR (FD_FUNCTION|FD_POINTER) #define FDF_STRUCT FD_STRUCT #define FDF_RESOURCE FD_RESOURCE @@ -4419,22 +4419,22 @@ class objCompressedStream : public Object { #include #endif -#ifdef __system__ - -struct ActionMessage { - OBJECTID ObjectID; // The object that is to receive the action - LONG Time; - AC ActionID; // ID of the action or method to execute - bool SendArgs; +namespace pf { - // Action arguments follow this structure in a buffer -}; +#ifdef __system__ + struct ActionMessage { + OBJECTID ObjectID; // The object that is to receive the action + LONG Time; + AC ActionID; // ID of the action or method to execute + bool SendArgs; + // Action arguments follow this structure in a buffer + }; #endif // Event support -struct rkEvent { +struct Event { EVENTID EventID; // Data follows }; @@ -4505,6 +4505,8 @@ struct evHotplug { char Vendor[40]; // Name of vendor }; +} // namespace + namespace fl { // Read endian values from files and objects. diff --git a/src/core/defs/core.fdl b/src/core/defs/core.fdl index 3528c79c..19c54644 100644 --- a/src/core/defs/core.fdl +++ b/src/core/defs/core.fdl @@ -681,7 +681,7 @@ struct OpenInfo { #define FDF_SYNONYM FD_SYNONYM #define FDF_UNSIGNED FD_UNSIGNED -#define FDF_FUNCTION FD_FUNCTION // sizeof(struct rkFunction) - use FDF_FUNCTIONPTR for sizeof(APTR) +#define FDF_FUNCTION FD_FUNCTION // sizeof(FUNCTION) - use FDF_FUNCTIONPTR for sizeof(APTR) #define FDF_FUNCTIONPTR (FD_FUNCTION|FD_POINTER) #define FDF_STRUCT FD_STRUCT #define FDF_RESOURCE FD_RESOURCE @@ -2270,22 +2270,22 @@ inline ERR Call(const FUNCTION &Function, ERR &Result) noexcept { #include #endif -#ifdef __system__ - -struct ActionMessage { - OBJECTID ObjectID; // The object that is to receive the action - LONG Time; - AC ActionID; // ID of the action or method to execute - bool SendArgs; +namespace pf { - // Action arguments follow this structure in a buffer -}; +#ifdef __system__ + struct ActionMessage { + OBJECTID ObjectID; // The object that is to receive the action + LONG Time; + AC ActionID; // ID of the action or method to execute + bool SendArgs; + // Action arguments follow this structure in a buffer + }; #endif // Event support -struct rkEvent { +struct Event { EVENTID EventID; // Data follows }; @@ -2356,6 +2356,8 @@ struct evHotplug { char Vendor[40]; // Name of vendor }; +} // namespace + namespace fl { // Read endian values from files and objects. diff --git a/src/core/lib_events.cpp b/src/core/lib_events.cpp index 44127d08..afa82146 100644 --- a/src/core/lib_events.cpp +++ b/src/core/lib_events.cpp @@ -99,14 +99,14 @@ ERR BroadcastEvent(APTR Event, LONG EventSize) { pf::Log log(__FUNCTION__); - if ((!Event) or ((size_t)EventSize < sizeof(rkEvent))) return ERR::NullArgs; + if ((!Event) or ((size_t)EventSize < sizeof(pf::Event))) return ERR::NullArgs; - LONG groupmask = 1<<((((rkEvent *)Event)->EventID>>56) & 0xff); + LONG groupmask = 1<<((((pf::Event *)Event)->EventID>>56) & 0xff); if (glEventMask & groupmask) { log.trace("Broadcasting event $%.8x%.8x", - (ULONG)(((rkEvent *)Event)->EventID>>32 & 0xffffffff), - (ULONG)(((rkEvent *)Event)->EventID)); + (ULONG)(((pf::Event *)Event)->EventID>>32 & 0xffffffff), + (ULONG)(((pf::Event *)Event)->EventID)); SendMessage(MSGID_EVENT, MSF::NIL, Event, EventSize); } @@ -294,9 +294,9 @@ ERR msg_event(APTR Custom, LONG MsgID, LONG MsgType, APTR Message, LONG MsgSize) { pf::Log log(__FUNCTION__); - if ((!Message) or ((size_t)MsgSize < sizeof(rkEvent))) return ERR::Okay; + if ((!Message) or ((size_t)MsgSize < sizeof(pf::Event))) return ERR::Okay; - rkEvent *eventmsg = (rkEvent *)Message; + pf::Event *eventmsg = (pf::Event *)Message; log.msg(VLF::DETAIL|VLF::BRANCH, "Event $%.8x%8x has been received.", (LONG)((eventmsg->EventID>>32)& 0xffffffff), (LONG)(eventmsg->EventID & 0xffffffff)); diff --git a/src/fluid/fluid_functions.cpp b/src/fluid/fluid_functions.cpp index 5fb5588d..de18d36e 100644 --- a/src/fluid/fluid_functions.cpp +++ b/src/fluid/fluid_functions.cpp @@ -261,7 +261,7 @@ int fcmd_catch(lua_State *Lua) // Where Args is a named array containing the event parameters. If the event is not known to Fluid, then no Args will // be provided. -static void receive_event(rkEvent *Info, LONG InfoSize, APTR CallbackMeta) +static void receive_event(pf::Event *Info, LONG InfoSize, APTR CallbackMeta) { auto Script = (objScript *)CurrentContext(); auto prv = (prvFluid *)Script->ChildPrivate;