Current release is v0.4.2
Author: Benoît GILON
HTMLEdit v3 logo
Back to the !AddressB description page

Inter-application data communication

In order to let the four applications communicate together, a set of WIMP messages have been defined; as those messages are not broadcasted but only to be sent to specific and well known tasks, there's no need to officially register their action code.
enum    {
        Wimp_MAdBCloseDown= 0x200,
        Wimp_MAdBDragNotify,
        Wimp_MAdBFetch,
        Wimp_MAdBFetchReply,
        Wimp_MAdBSeeDetail,
        Wimp_MAdBSeeDetailReply,
        Wimp_MAdBCheckForParent,
        Wimp_MAdBCheckForParentReply,
        Wimp_MAdBCheckForChild,
        Wimp_MAdBCheckForChildReply,
        Wimp_MAdBDeleteCascade
        };

typedef struct
        {
        int key;
        } WimpAdBFetchMessage, WimpAdBSeeDetailMessage, WimpAdBCheckForParentKeyMessage;

typedef struct
        {
        int key;
        int itask;
        } WimpAdBCheckForChildMessage, WimpAdBDeleteCascadeMessage;

typedef struct
        {
        int key;
        int reply;
        } WimpAdBCheckForParentKeyReplyMessage, WimpAdBCheckForChildReplyMessage;

typedef struct
        {
        int reply;
        char string[232];
        } WimpAdBFetchReplyMessage, WimpAdBSeeDetailReplyMessage;

typedef struct
        {
        int window_handle;
        int icon_handle;
        int key;
        } WimpAdBDragNotifyMessage;

typedef struct
        {
        struct 
                {
                int    size;
                int    sender;
                int    my_ref;
                int    your_ref;
                int    action_code;
                } hdr;
        union
                {
                int words[59];
                char bytes[236];
                WimpAdBFetchMessage      adb_fetch;
                WimpAdBFetchReplyMessage adb_fetch_reply;
                WimpAdBSeeDetailMessage  adb_see_detail;
                WimpAdBSeeDetailReplyMessage adb_see_detail_reply;
                WimpAdBDragNotifyMessage drag_notify;
                WimpAdBCheckForParentKeyMessage adb_check_for_parent;
                WimpAdBCheckForParentKeyReplyMessage adb_check_for_parent_reply;
                WimpAdBCheckForChildMessage adb_check_for_child;
                WimpAdBCheckForChildReplyMessage adb_check_for_child_reply;
                WimpAdBDeleteCascadeMessage adb_delete_cascade;
                } data;
        } MWimpMessage;
Wimp_MAdBCloseDown
This message is sent as the !Address0 application, as having launched the !AddressB and !AddressG applications (if not already running) just quits but before ask the launched applications to commit suicide.
Wimp_MAdBFetch et Wimp_MAdBFetchReply
These messages are transmitted between the !Address0 application and each of the !AddressB and !AddressG as the former requests to get some details to display in its own window. The latter applications retrieve details from inside the data file they manage and return the result to the message sender (here !Address0)
Wimp_MAdBSeeDetail et WimpAdBSeeDetailReply
A similar message communication exists between the !AddressI and !AddressB applications. These messages are transmited between the !Address0 application and one of the applications !AddressB or !AddressG as the user clicks on one of the action buttons labeled "Details" from within the !Address0 main window. This action triggers the display of the data reffered to in the main window of the relevant application (according to which button was clicked).
Wimp_MAdBDragNotify
Message sent by one of the !AddressB or !AddressG as a user drag operation completes. This message is processed by the !Address0 application. Typically, the latter sends a WimpAdbFetch as a result after having identified the originator (here either !AddressB or !AddressG).
Wimp_MAdBCheckForChild et Wimp_MAdBCheckForChildReply
The former message is transmitted by one of the applications !AddressB or !AddressG as, having to delete local data, they check that no data from another application (here !AddressG or !AddressI) refer to the data to be removed. The latter message is bounced back as the result of such lookup: if such lookup give a positive result then the reffering key is also returned as part of the message body.
Wimp_MAdBCheckForParent et Wimp_MAdBCheckForParentReply
Those two messages play a symmetical role to the preceding ones. The former is transmitted by an application (!Address0 or !AddressI) before inserting or updating new values into the database, to ensure that the reffered data exist in the parent tables (managed by !AddressB or !AddressG). Again the latter message is the answer to the former.