Refactor replicant system a bit

This commit is contained in:
Sasha Koshka
2023-11-14 00:18:51 -05:00
parent a6fa746ef3
commit 192aa666ca
3 changed files with 64 additions and 57 deletions

View File

@@ -15,7 +15,7 @@ typedef int (*XmdReplicantFnVersion) ();
typedef void (*XmdReplicantFnConstruct) ();
typedef void (*XmdReplicantFnDestruct) ();
typedef Widget (*XmdReplicantFnCreate) (
Widget parent, XmdReplicantState *state);
XtAppContext application, Widget parent, XmdReplicantState *state);
/* XmdReplicantOpen opens a replicant from the file located at path. Replicant
files hold state and point to shared object files containing their code.
@@ -41,15 +41,16 @@ typedef Widget (*XmdReplicantFnCreate) (
different API version will refuse to load it.
void NAME_XmdReplicantConstruct ();
Construct is called when the shared object is loaded.
Optional. Construct is called when the shared object is loaded.
void NAME_XmdReplicantDestruct ();
Descruct is called before the shared object is unloaded.
Optional. Descruct is called before the shared object is unloaded.
Widget NAME_XmdReplicantCreate (Widget parent, XmdReplicantState *state);
Widget NAME_XmdReplicantCreate (
XtAppContext application, Widget parent, XmdReplicantState *state);
Create instantiates a new widget representing the replicant given by state.
*/
Widget XmdReplicantOpen (Widget parent, ConstString path);
Widget XmdReplicantOpen (XtAppContext app, Widget parent, ConstString path);
/* XmdReplicantResolveName returns the file path of the given replicant shared
object name according to $XMD_REPLICANT_PATH. The returned string must be