New APIs for Panels and Ambient
  • Moderator
    Kronos
    Posts: 2448 from 2003/2/24
    This thread is supposed to help me defining/extending APIs for Panels and Ambient in a way that could at one point be merged into the SDK without having to rewrite it.

    For feature request and bug reports please use these threads:
    General Ambient stuff
    Panels

    This is an extension to workbench.library to make non Ambient Window get reports when an Icon is dragged above them:

    Code:

    #ifndef APPWINDOW_H
    #define APPWINDOW_H


    #ifndef UTILITY_TAGITEM_H
    # include <utility/tagitem.h>
    #endif

    /* tags for AddAppWindow */

    #define WB_AW_Dummy (TAG_USER + 0x200000)
    #define WB_AW_MouseReport (WB_AW_Dummy + 1)

    /* AppWindow message classes */

    #define AM_CLASS_MOUSEMOVE 0x00000001
    #define AM_CLASS_MOUSEENTER 0x00000002
    #define AM_CLASS_MOUSEEXIT 0x00000004

    #endif


    Implementation is simple, AddAppWindow() also has a unused parameter for tags, the internal ipc_appwindow structure gets extended by an ULONG to hold the CLASS(es) or set to 0 if no tag was found. In Ambient I extended MUIM_DragEvent to check for that ULONG and send "TT_AppMsg_Send_Type, AMTYPE_APPWINDOW," in the same way it was already done for DragDrop. Since those are in listviewlistclass.c and iconviewclass.c which don't share a super class I had to add the code twice.

    All in all this should be o.k. for submission pending issues with naming of those constants.


    I also created an Ambient.libray as a wrapper around prefspool.c/h MAIN_POOL and Panel files will be added to a List and can be looked/relased to avoid corruption. I also added a function to chance the ID of an prefs item as these determine the order of panelobjects. The new panelprefs class only interacts with this library but will signal the need to refresh a panel if PanelApp is running. In the long run I would move all prefs panes to external classes using this libray. Same goes for "client" classes like listers (in the very long run).
    I have also added functions to get a list of bookmarks and views but these might be better routed through the ARexx/LUA interface.
  • »29.06.25 - 15:28
    Profile