Commit Graph

85 Commits

Author SHA1 Message Date
hayodea 3503cce0db CMake: Check for libDl, conditionally check for libXCB 2025-07-22 05:19:26 -04:00
hayodea 065b2593f4 Add new CMake build system 2025-07-22 02:46:16 -04:00
hayodea e7974db324 Add Marionette 2025-07-22 02:03:45 -04:00
hayodea 336094ef90 Marionette: Create include dir and move body map headers in 2025-07-22 02:03:45 -04:00
hayodea 1450d745ab SenseApiDesc: use CPP concat to reduce typos 2025-07-22 02:03:45 -04:00
hayodea 76141e3a92 Fix indentation 2025-07-22 02:03:45 -04:00
hayodea 36592293dd DevSpec:lex: fix indentation 2025-07-22 02:03:45 -04:00
hayodea f1696f8272 DevSpec:lex: Remove annotation comment by GPT 2025-07-22 02:03:45 -04:00
hayodea 99c126a08c DevSpec:lex: Fix whitespace around EQUALS, fix backslash at EOF
* We had a prior issue where EQUALS would require that there be no
  whitespace between itself and its operands on either side. We got
  a bad solution from ChatGPT 4o. We got a proper solution now from
  o1.
* Previously, if a string ended with a backslash right before EOF, the
  backslash would be included. Now it will be dropped.
* Merge the two regexes for ignoring whitespace into one.
2025-07-22 02:03:45 -04:00
hayodea 293c1054d1 ComponentThreads: Add 2 new threads: body, world; comment threads.
We add 2 new threads for handling the interoceptors and extrospector
events. Also add comments explaining the purpose and role of each of
these major threads.
2025-07-22 02:03:45 -04:00
hayodea 38298a8ef8 DevSpec:Lex: silence warning about yyinput 2025-07-22 02:03:45 -04:00
hayodea 76e465bd1d devSpec:lex: Allow backslash escaping of strings
Now we can escape special characters without issue.
2025-07-22 02:03:45 -04:00
hayodea 7b79636681 devSpec:yacc: Put param after params 2025-01-14 23:14:19 -04:00
hayodea 4dee8c62c9 devSpec:yacc: We now print out the current lex token string
We used some preprocessor logic to enable access to yytext and now
we can have verbose, useful error messages from the parser :)
2025-01-14 23:13:02 -04:00
hayodea 9a9f5058ed devSpec: allow backslash escaped whitespace in STRING tokens
This allows us to use spaces when specifying window name selectors.
Which is very convenient and cool.
2025-01-14 23:11:30 -04:00
hayodea 091d7ceeba xcbXorg: Parse devSpec params, connect to Xorg displays
This patch adds some nicely weighty code for connecting to X displays
and managing those connections. Attaching devices will automatically
connect to their required X display. Removing all devices dependent
on a given X display connection will also disconnect from that
Xdisplay.
2025-01-14 14:17:05 -04:00
hayodea cfdeb17639 SenseApiMgr: Add doxygen comment explaining the lib search priorities 2025-01-14 14:17:05 -04:00
hayodea aaae3dcbb2 DevSpec: Grammar now parses params as key[=[val]]
* Updated docs to reflect this.
* This was important in allowing us to write the xcbXorg connection
 code.
2025-01-14 14:17:05 -04:00
hayodea 4eb0ef75bc DevSpec: Yacc: Silence unused warning about yyunput() 2025-01-13 22:01:17 -04:00
hayodea 09caf314f1 Eliminate the C FFI; Namespace lib API and DeviceManager
We decided to get rid of the C FFI for libs. It was becoming too intricate
and complicated. It was becoming a technical burden and expanding into
too much extra code. It's unfortunate, but we'll have to give up on getting
out-of-tree hot-loadable libraries the easy way.

It's possible to still do it with cross compilation or by keeping track
of the libstdc++ version that the running harikoff binary was compiled
against. Then we can ensure that our loadable lib code is linked against
that same libstdc++ code and this should ensure ABI stability.
2025-01-13 21:57:11 -04:00
hayodea a4f96c8dfa Senselib FFI: Use devDesc object in SenseApiLib, also add per-device metadata to xcbXorg
We also had to write conversion constructors and so on to CSenseDeviceDesc.
The technical debt that's being piled up from this C FFI is excessive.
I think we'll end it here. API Libs will have to be written in C++
from now on. API Lib interfaces will be in C++.

We'll use cross compilers to ensure stability for out-of-tree lib
development.
2025-01-13 11:53:38 -04:00
hayodea 660f0f0e73 DevMgr: Make vectors hold sh_ptr and not uniq_ptr
This allows us to mirror the contents of the two lists into the unified
list much more easily.
2025-01-13 08:02:59 -04:00
hayodea edf51a4441 DevSpecp.yy: Fix mirror list use of std::move()d objects
We were building a list of mirrored items filled with the memory
pointed to by unique_ptrs which had already been std::move()d into
other unique_ptrs.
2025-01-13 07:06:28 -04:00
hayodea 8e94e829d0 SenseDevSpec: add NULL checks stringify, ostream::<< 2025-01-13 07:05:05 -04:00
hayodea 0a36f7d370 Build: Add XCB_LIBS; Skeleton: mlo_initializeInd, mlo_attachDeviceReq
* Renamed some of the Sense API lib classes
  (CSensorDeviceDesc=>CSenseDeviceDesc,
  SensorDeviceDesc=>SenseDeviceDesc).
* Moved SenseApiDesc into /include/user/senseApiDesc.
* Add conversion constructor to convert from SenseDeviceDesc
  to
* Wireframe mlo_initializeInd to call xcb_connect().
* Add $(XCB_LIBS) to libxcbXorg_LDFLAGS.
* Wireframe mlo_attachDeviceReq().
2025-01-12 14:31:33 -04:00
hayodea b85d6f76a6 SenseApiMgr: add initialize/finalizeAllSenseApiLibs()
Also, SenseApiDesc: initializeInd() now takes void. We no longer
try to pass a struct of marionette-role ops into the libs. We'll
be using message queueing for the handshake side of async calls now.
2025-01-12 09:44:49 -04:00
hayodea c8a7a6678f Fix annoying build warning 2025-01-12 09:44:08 -04:00
hayodea c6577b1155 Add stringifiers to SenseApi related classes 2025-01-11 06:40:43 -04:00
hayodea 8aa28a877e Marionette: Post initializeHarikoff() as a lambda 2025-01-11 06:19:11 -04:00
hayodea bffc32519b ComponentThreads: now basics are working.
Next step is to get the unified event loops working generically
and then we can begin region-splitting up the data in harikoff.

We'll assign all the global resource managers to Marionette and
then assign the Mind components to the respective component threads.
2025-01-11 04:35:11 -04:00
hayodea 876526364b Build: Added -Wall,extra,-pedantic, fixed warnings and peeves. 2025-01-10 18:27:10 -04:00
hayodea 870b8de249 Marionette: Introduce concept and add other 3 component threads
We introduce the 4 main component threads of execution for Harikoff:
* Marionette: This is the resident hijacking module that makes Harikoff
  instances non-persons, if configured to allow hijacking.
* Director: :)
* Canvas: :)
* Subconscious: DB, storage and recall.
2025-01-10 17:37:49 -04:00
hayodea 9e35748d9a Rename Csal_lmo=>Csal_mlo, and introduce a Csal_mho role
* Introduce the hk end of the management role for the senseApiLibs.
* Implement a basic set of operations and callbacks for this role.
2025-01-09 17:18:24 -04:00
hayodea 53583e5735 SenseApiLib, SenseApiDesc improvements, new Sense API Mgmt Lib Ops role
SenseApiDesc:
* Use a number count for num exported implexor APIs instead of
  NULL-terminated list.
* Add sanity checker functions for structs.

SenseApiLib:
* Invoke the new sanity checkers on new Lib objects.
* SenseApiDesc is now a member object instead of being
  pointed to.

SenseApiManager:
* loadSenseApiLib now calls the SenseApiDesc getter function.
* loadSenseApiLib now fills out the SenseApiLib class object.

New Sense API Mgmt Sub-API:

This sub-api (metalanguage, some might call it) is used to initialize
the lib's connection to the provider. After this call, the lib should
be ready to attach new devices to its provider on behalf of Hk.
2025-01-09 06:03:43 -04:00
hayodea 62db724246 senseApiMgr: Fix formatting 2025-01-08 17:58:08 -04:00
hayodea d14cef5328 Move senseApi libs into their own outer subdir 2025-01-08 17:28:21 -04:00
hayodea 988e84a545 Pretty up exception message 2025-01-08 15:09:18 -04:00
hayodea 4f2fbaa255 Fix NULL ptr use from dlerror() 2025-01-08 15:08:51 -04:00
hayodea 01ddb6d842 Only search in senseApiLibPath if it's actually set 2025-01-08 15:08:23 -04:00
hayodea 1178970728 cmd:opts: Now set OptionParser::argv0 to argv[0] 2025-01-08 15:07:42 -04:00
hayodea 090f0d3b02 senseApiMgr: new method: loadAllSenseApisFromOptions
This method dlopens() all senseApi libs that were referenced by
device specs.
2025-01-08 15:06:31 -04:00
hayodea 04db7bf76c Fix build warning about decltype(dlclose) 2025-01-08 15:05:56 -04:00
hayodea 2dc3083cdb whitespace 2025-01-08 13:47:16 -04:00
hayodea bffa2b837c Opts: Make singleton; senseApi: check senseApiLibPath, get senseApiDescFn pointer.
* OptionsParser now has a singleton.
* We now use the cmdline opt -p <senseApiLibPath>, and search for
  the specified library in:
  * senseApiLibPath, then CWD, then the place where our executable
    is running from, and then finally we let the hosting OS do
    its own search.
* We now call dlsym() on dlopen()'d libs to to get the senseApiDescFn
  pointer.
2025-01-08 13:43:44 -04:00
hayodea b40790ee4a Whitespace 2025-01-08 11:50:16 -04:00
hayodea c864bcfdd2 SenseApis: Define descriptors exported by libs 2025-01-08 11:49:28 -04:00
hayodea f5e3986644 DeviceSpec:parser: improve exception messages 2025-01-08 11:46:59 -04:00
hayodea 5a5e2fa25f Fix const_cast and rearrange logic in senseApi method 2025-01-08 07:56:10 -04:00
hayodea b9aa53822f Indentation 2025-01-08 07:27:48 -04:00
hayodea fe3f911db4 SenseApis: New senseApiManager and X11XcbApi
Still fleshing these out but ultimately senseApiMgr will manage
sense apis, and the X11XcbApi is where we'll connect to Xcb and
read the screen.
2025-01-08 06:26:36 -04:00