1 #ifndef INTUITION_SCREENBAR_H
    2 #define INTUITION_SCREENBAR_H
    3 
    4 /*
    5 	intuition screenbar plugin definitions
    6 
    7 	Copyright © 2007-2010 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 # include <exec/types.h>
   12 #endif
   13 
   14 #ifndef UTILITY_TAGITEM_H
   15 # include <utility/tagitem.h>
   16 #endif
   17 
   18 #ifndef LIBRARIES_MUI_H
   19 # include <libraries/mui.h>
   20 #endif
   21 
   22 /* Creates a cfgid x from your tagbase. Set isstring to 1 if the config item is textual 
   23 ** Otherwise it will be stored as ULONG (4 bytes) */
   24 #define MUI_CFGID(tagbase,isstring,x) ( (((tagbase)<<16) & 0x7fffffff) | 0x00008000 | ((isstring)<<14) | (x) )
   25 
   26 /* Please obtain your own MUI serial number if you wish to develop screenbar classes! */
   27 #define MUISERIALNO_INTUITION 0xFECF
   28 #define TAGBASE_SCREENBAR ((TAG_USER | (MUISERIALNO_INTUITION << 16)) + 3000)
   29 
   30 #define MUIA_Screenbar_DisplayedName      (TAGBASE_SCREENBAR + 2)
   31 /* Returns a CONST_STRPTR containing a displayable name of the sbar. This is optional. If missing,
   32 ** the class name will be used. You should generally localise this string. The result will be copied. */
   33 
   34 #define MUIA_Screenbar_DisplayedImage     (TAGBASE_SCREENBAR + 3)
   35 /* Returns an image object that will be used to draw the image in the Settings window. This is exactly
   36 ** the same as implementing the MCC_Query(2) call in your MCC. The object will be disposed when it's
   37 ** no longer needed, no later than the last instance of the class is disposed */
   38 
   39 /* In order to support user preferences in your screenbar plugin, implement all of the following methods: */
   40 
   41 #define MUIM_Screenbar_BuildSettingsPanel (TAGBASE_SCREENBAR + 20)
   42 /* Builds a settings panel, inheriting from MUIC_Mccprefs and returns the pointer to the
   43 ** prefs object. All classes must implement this, even if it's just to hold the (C) info. */
   44 
   45 #define MUIM_Screenbar_KnowsConfigItem    (TAGBASE_SCREENBAR + 21)
   46 /* Return TRUE if msg->cfgid is one of your prefs CFGIDs, otherwise false */
   47 
   48 #define MUIM_Screenbar_DefaultConfigItem  (TAGBASE_SCREENBAR + 22)
   49 /* Return a default value for a cfgid */
   50 
   51 #define MUIM_Screenbar_UpdateConfigItem   MUIM_UpdateConfig
   52 /* This method will be called whenever preferences are updated */
   53 
   54 #define MUIM_Screenbar_Lock               (TAGBASE_SCREENBAR + 24)
   55 /* Locks the screenbar so that it does not disappear when you need it
   56 ** you should generally always lock it if you pop a context menu up, 
   57 ** open a popup window, etc */
   58 
   59 #define MUIM_Screenbar_Unlock             (TAGBASE_SCREENBAR + 25)
   60 
   61 #define MUIM_Screenbar_Signal             (TAGBASE_SCREENBAR + 26)
   62 /* Implement this if you need to handle signals in your sbar plugin.
   63 ** The method is called on all sbar instances when a common signal
   64 ** arrives to the application controlling the screenbars.
   65 ** Check screens.h to find out how to get the common signal bit. */
   66 
   67 struct MUIP_Screenbar_BuildSettingsPanel {ULONG id;};
   68 struct MUIP_Screenbar_KnowsConfigItem {ULONG id; ULONG cfgid;};
   69 struct MUIP_Screenbar_DefaultConfigItem {ULONG id; ULONG cfgid;};
   70 #define MUIP_Screenbar_UpdateConfigItem MUIP_UpdateConfig
   71 struct MUIP_Screenbar_Lock {ULONG id;};
   72 struct MUIP_Screenbar_Unlock {ULONG id;};
   73 struct MUIP_Screenbar_Signal {ULONG id;};
   74 
   75 /* ScreenbarControl tags */
   76 #define SBCT_Dummy                    (TAG_USER + 0x60500)
   77 #define SBCT_InstallPlugin            (SBCT_Dummy + 1)
   78 
   79 /* struct MUI_CustomClass *,mcc_Class->cl_ID must contain a valid name
   80 ** with ascii letters only */
   81 
   82 #define SBCT_UninstallPlugin          (SBCT_Dummy + 2)
   83 /* struct MUI_CustomClass * */
   84 
   85 #endif /* INTUITION_SCREENBAR_H */