|
Abstract
Any external process can control embryo from remote, or can get the internal information of the embryo process surely with low costs, by sending the WM_SAKURAAPI to the Sakura process.
WM_SAKURAAPI is defined by giving the char-string "Sakura" to RegisterWindowMessage API.
WM_SAKURAAPI = RegisterWindowMessage("Sakura");
The SAKURA API uses only the windiwmessage WM_SAKURAAPI, and the concrete commands are given by the control parameter "wparam" and "lparam".
The control parameters "wparam 0-127" are categorized into EXECUTE request. Embryo executes directed command.
The control parameters "wparam 128-255" are categorized into GET request. Embryo returns the requested data to the client.
The control parameters "wparam 256-384" are categorized into NOTIFY request. Embryo receives an event request.
API list
| EXECUTE |
| |
| SA_EXECUTEREMAKEMENU | 0 |
| SA_EXECUTEREWRITEFMO | 1 |
| SA_EXECUTEWINDOWSTATESWITCH | 2 |
| SA_EXECUTERELOADSHIORI | 3 |
| SA_EXECUTENOTIFYOTHERGHOSTNAME | 4 |
| |
| GET |
| |
| SA_GETHEADCOLLISIONRECTSAKURA | 128 |
| SA_GETFACECOLLISIONRECTSAKURA | 129 |
| SA_GETBUSTCOLLISIONRECTSAKURA | 130 |
| SA_GETCENTERPOINTSAKURA | 131 |
| SA_GETABSOLUTEKINOKOFIELDCENTERPOINTSAKURA | 132 |
| SA_GETHEADCOLLISIONRECTKERO | 133 |
| SA_GETFACECOLLISIONRECTKERO | 134 |
| SA_GETBUSTCOLLISIONRECTKERO | 135 |
| SA_GETCENTERPOINTKERO | 136 |
| SA_GETABSOLUTEKINOKOFIELDCENTERPOINTKERO | 137 |
| SA_GETPROCESSID | 138 |
| SA_GETSHAREDMEMORY | 139 |
| SA_GETGHOSTSTATE | 140 |
| |
| NOTIFY |
| |
| SA_NOTIFYEVENT | 256 |
SAKURA API/1.0
SAKURA API/1.0 is the request to handle the general EXECUTE command request.
- SA_EXECUTEREMAKEMENU / wparam = 0 / lparam = n/a
This API uses to rebuild the pop-up menu. The menu tree of embryo is not correspond when you move file components of shells or ghosts etc, but you can direct to reload the menu tree by sending this command.
- SA_EXECUTEREWRITEFMO / wparam = 1 / lparam = n/a
This API is used to rewrite FMO. That is for internal usage only.
- SA_EXECUTENOTIFYOTHERGHOSTNAME / wparam = 4 / lparam = n/a
This API EXECUTE NOTIFY otherghostname.
SAKURA API/1.1
SAKURA API/1.1 is the request to handle the general GET command request.
- SA_GETHEADCOLLISIONRECTSAKURA / wparam = 128 / lparam = 0 - 3
SA_GETFACECOLLISIONRECTSAKURA / wparam = 129 / lparam = 0 - 3
SA_GETBUSTCOLLISIONRECTSAKURA / wparam = 130 / lparam = 0 - 3
These APIs are used to return the decision area of colliding with head/face/bust of current displayed surface of main body (Sakura body) by rectangle coordinates.
| lparam |
| 0 | left |
| 1 | top |
| 2 | right |
| 3 | bottom |
- SA_GETCENTERPOINTSAKURA / wparam = 131 / lparam = 0 - 1
This API is used to return the value of x and y coordinates of the center of the current displayed surface of main body (Sakura body).
- SA_GETHEADCOLLISIONRECTKERO / wparam = 133 / lparam = 0 - 3
SA_GETFACECOLLISIONRECTKERO / wparam = 134 / lparam = 0 - 3
SA_GETBUSTCOLLISIONRECTKERO / wparam = 135 / lparam = 0 - 3
These APIs are used to return the decision area of colliding with head/face/bust of current displayed surface of sub body (Unyu body) by rectangle coordinates. The specifications of control parameters "lparam" are similar to the control code 128.
- SA_GETCENTERPOINTKERO / wparam = 136 / lparam = 0 - 1
This API is used to return the value of x and y coordinates of the center of the current displayed surface of sub body (Unyu body).
- SA_GETGHOSTSTATE / wparam = 140 / lparam = n/a
This API is used to return current state of the ghost. The return value means as follows.
| result |
| GS_NONE | 0 | no enevts, idle state |
| GS_TALKING | 1 | now talking |
| GS_TIMECRITICALSESSION | 2 | time critical session |
SAKURA API/1.2
SAKURA API/1.2 is the request to get the coordinate of the absolute KINOKO field(AKF).
- SA_GETABSOLUTEKINOKOFIELDCENTERPOINTSAKURA / wparam = 132 / lparam = 0 - 1
This API is used to return the value of x and y coordinates of the center of the absolute KINOKO field of the current displayed surface of main body (Sakura body).
| lparam |
| 0 | kinoko.centerx |
| 1 | kinoko.centery |
- SA_GETABSOLUTEKINOKOFIELDCENTERPOINTKERO / wparam = 137 / lparam = 0 - 1
These APIs are used to return the decision area of colliding with head/face/bust of current displayed surface of sub body (Unyu body) by rectangle coordinates. The specification of control parameters "lparam" are similar to the control code 132.
SAKURA API/1.3
SAKURA API/1.3 is the request to notify the events.
- SA_GETPROCESSID / wparam = 138 / lparam = n/a
This API returns the ID of the Sakura process.
- SA_GETSHAREDMEMORY / wparam = 139 / lparam = -1 - 7
This API returns a pointer that points the 8192bytes static memory area, which exists in the process space permanently. The pointers exist as memory slots. The number of slots are 9(8192×9bytes) and you can get the value of the pointer which points each slot.
The external processes notify the event to Sakura by using two types of information shown above. In details, first, the external process which wants to notify an event must get the "processid" by using SA_GETPROCESSID API. And next, open the process directed by processid, by using the function "openprocess", following, write the required information to the pointer given by SA_GETSHAREDMEMORY, by using the function writeprocessmemory, and finally, send the message of event defined as follows to Sakura. When the Sakura received event request, it recognize the event itself, and run appropriately (In this occasion, Sakura mainly notice events to SHIORI.) according to the getting information from each slots of SHAREDMEMORY.
The slot numbered -1 is used for the special purpose. For example, in occasion of that you use SAKURA API/1.3 to notify events to SHIORI/2.2, slots 0〜7 is correspond to the Reference0〜7 that depends on SHIORI spec, and slot -1 is used for the event identifier.
- SA_NOTIFYEVENT / wparam = 256 / lparam = n/a
This API notifies the triggered event to Sakura. This message have no information except that the event is triggered. The sender must set the correct value into the SHAREDMEMORY before send this message.
SAKURA API/1.4
- SA_EXECUTEWINDOWSTATESWITCH / wparam = 2 / lparam = n/a
Execute minimize. If already minimize, Execute restore.
SAKURA API/1.5
- SA_EXECUTERELOADSHIORI / wparam = 3 / lparam = n/a
Reload SHIORI module for current ghost.
|