home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / devkit / c / include / cl_mui.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-12  |  14.1 KB  |  418 lines

  1. #ifndef _CL_MUI_H
  2. #define _CL_MUI_H
  3.  
  4. #include <libraries/mui.h>
  5. #include <proto/muimaster.h>
  6.  
  7. /*
  8.  *      Connectline 13.0 "cl_mui.library"
  9.  *      and custom class definitions.
  10.  */
  11.  
  12. extern struct Library *CLMUIBase;
  13.  
  14. /*
  15.  *  SAS/C specific pragmas
  16.  */
  17.  
  18. #pragma libcall CLMUIBase CLMUI_NewObjectA 1e 9802
  19. #pragma tagcall CLMUIBase CLMUI_NewObject 1e 9802
  20. #pragma libcall CLMUIBase CLMUI_ErrorRequest 24 0
  21. #pragma libcall CLMUIBase CLMUI_SCF_String 2a 0802
  22. #pragma libcall CLMUIBase CLMUI_SCF_KeyString 30 10803
  23. #pragma libcall CLMUIBase CLMUI_SCF_CheckMark 36 001
  24. #pragma libcall CLMUIBase CLMUI_SCF_KeyCheckMark 3c 1002
  25. #pragma libcall CLMUIBase CLMUI_SCF_SimpleButton 42 801
  26. #pragma libcall CLMUIBase CLMUI_SCF_KeyButton 48 0802
  27. #pragma libcall CLMUIBase CLMUI_SCF_Cycle 4e 801
  28. #pragma libcall CLMUIBase CLMUI_SCF_KeyCycle 54 0802
  29. #pragma libcall CLMUIBase CLMUI_SCF_Radio 5a 9802
  30. #pragma libcall CLMUIBase CLMUI_SCF_KeyRadio 60 09803
  31. #pragma libcall CLMUIBase CLMUI_SCF_Slider 66 21003
  32. #pragma libcall CLMUIBase CLMUI_SCF_KeySlider 6c 321004
  33. #pragma libcall CLMUIBase CLMUI_SCF_PopButton 72 001
  34. #pragma libcall CLMUIBase CLMUI_SCF_Label 78 801
  35. #pragma libcall CLMUIBase CLMUI_SCF_Label1 7e 801
  36. #pragma libcall CLMUIBase CLMUI_SCF_Label2 84 801
  37. #pragma libcall CLMUIBase CLMUI_SCF_LLabel 8a 801
  38. #pragma libcall CLMUIBase CLMUI_SCF_LLabel1 90 801
  39. #pragma libcall CLMUIBase CLMUI_SCF_LLabel2 96 801
  40. #pragma libcall CLMUIBase CLMUI_SCF_KeyLabel 9c 0802
  41. #pragma libcall CLMUIBase CLMUI_SCF_KeyLabel1 a2 0802
  42. #pragma libcall CLMUIBase CLMUI_SCF_KeyLabel2 a8 0802
  43. #pragma libcall CLMUIBase CLMUI_SCF_KeyLLabel ae 0802
  44. #pragma libcall CLMUIBase CLMUI_SCF_KeyLLabel1 b4 0802
  45. #pragma libcall CLMUIBase CLMUI_SCF_KeyLLabel2 ba 0802
  46. #pragma libcall CLMUIBase CLMUI_Info c0 801
  47. #pragma libcall CLMUIBase CLMUI_Boards2lv c6 0802
  48. #pragma libcall CLMUIBase CLMUI_Links2lv cc 801
  49. #pragma libcall CLMUIBase CLMUI_lv2Gruppen d2 09803
  50. #pragma libcall CLMUIBase CLMUI_Gruppen2lv d8 9802
  51. #pragma libcall CLMUIBase CLMUI_lv2Verteiler de 09803
  52. #pragma libcall CLMUIBase CLMUI_Verteiler2lv e4 9802
  53. #pragma libcall CLMUIBase CLMUI_FindIn_lv ea 9802
  54. #pragma libcall CLMUIBase CLMUI_FindDel f0 9802
  55. #pragma libcall CLMUIBase CLMUI_Copy_lv_Active f6 9802
  56. #pragma libcall CLMUIBase CLMUI_str2lv fc 9802
  57. #pragma libcall CLMUIBase CLMUI_WildcardSelect 102 09803
  58. #pragma libcall CLMUIBase CLMUI_CheckmarkExcludeA 108 801
  59. #pragma tagcall CLMUIBase CLMUI_CheckmarkExclude 108 801
  60. #pragma libcall CLMUIBase CLMUI_SetCycleChainA 10e 9802
  61. #pragma tagcall CLMUIBase CLMUI_SetCycleChain 10e 9802
  62. #pragma libcall CLMUIBase CLMUI_HelpFileName 114 9802
  63. #pragma libcall CLMUIBase CLMUI_TickDelay 11a 0802
  64. #pragma libcall CLMUIBase CLMUI_DisableA 120 8002
  65. #pragma tagcall CLMUIBase CLMUI_Disable 120 8002
  66. #pragma libcall CLMUIBase CLMUI_SCF_Set 126 10803
  67. #pragma libcall CLMUIBase CLMUI_SCF_Get 12c 90803
  68. #pragma libcall CLMUIBase CLMUI_SCF_SetString 132 9802
  69. #pragma libcall CLMUIBase CLMUI_SCF_GetString 138 9802
  70. #pragma libcall CLMUIBase CLMUI_SCF_SetText 13e 9802
  71. #pragma libcall CLMUIBase CLMUI_SCF_SetInteger 144 0802
  72. #pragma libcall CLMUIBase CLMUI_SCF_GetInteger 14a 9802
  73. #pragma libcall CLMUIBase CLMUI_SCF_SetCycle 150 0802
  74. #pragma libcall CLMUIBase CLMUI_SCF_GetCycle 156 9802
  75. #pragma libcall CLMUIBase CLMUI_SCF_SetCheckmark 15c 0802
  76. #pragma libcall CLMUIBase CLMUI_SCF_GetCheckmark 162 9802
  77. #pragma libcall CLMUIBase CLMUI_SetKeyID 168 801
  78. #pragma libcall CLMUIBase CLMUI_SetDoubleStart 16e 9802
  79. #pragma libcall CLMUIBase CLMUI_MakeButtonSendID 174 0802
  80. #pragma libcall CLMUIBase CLMUI_KeyTimedout 17a 0
  81. #pragma libcall CLMUIBase CLMUI_KeyNoPermission 180 801
  82.  
  83. /*
  84.  *   ANSI Prototypes
  85.  */
  86.  
  87. APTR CLMUI_NewObjectA( STRPTR classname, struct TagItem *tags );
  88. APTR CLMUI_NewObject( STRPTR classname, ... );
  89. LONG CLMUI_ErrorRequest( void );
  90. APTR CLMUI_SCF_String( STRPTR, ULONG );
  91. APTR CLMUI_SCF_KeyString( STRPTR, ULONG, ULONG );
  92. APTR CLMUI_SCF_CheckMark( ULONG );
  93. APTR CLMUI_SCF_KeyCheckMark( ULONG, ULONG );
  94. APTR CLMUI_SCF_SimpleButton( STRPTR );
  95. APTR CLMUI_SCF_KeyButton( STRPTR, ULONG );
  96. APTR CLMUI_SCF_Cycle( STRPTR * );
  97. APTR CLMUI_SCF_KeyCycle( STRPTR *, ULONG );
  98. APTR CLMUI_SCF_Radio( STRPTR, STRPTR * );
  99. APTR CLMUI_SCF_KeyRadio( STRPTR, STRPTR *, ULONG );
  100. APTR CLMUI_SCF_Slider( ULONG, ULONG, ULONG );
  101. APTR CLMUI_SCF_KeySlider( ULONG, ULONG, ULONG, ULONG );
  102. APTR CLMUI_SCF_PopButton( ULONG );
  103. APTR CLMUI_SCF_Label( STRPTR );
  104. APTR CLMUI_SCF_Label1( STRPTR );
  105. APTR CLMUI_SCF_Label2( STRPTR );
  106. APTR CLMUI_SCF_LLabel( STRPTR );
  107. APTR CLMUI_SCF_LLabel1( STRPTR );
  108. APTR CLMUI_SCF_LLabel2( STRPTR );
  109. APTR CLMUI_SCF_KeyLabel( STRPTR, ULONG );
  110. APTR CLMUI_SCF_KeyLabel1( STRPTR, ULONG );
  111. APTR CLMUI_SCF_KeyLabel2( STRPTR, ULONG );
  112. APTR CLMUI_SCF_KeyLLabel( STRPTR, ULONG );
  113. APTR CLMUI_SCF_KeyLLabel1( STRPTR, ULONG );
  114. APTR CLMUI_SCF_KeyLLabel2( STRPTR, ULONG );
  115. void CLMUI_Info( APTR applicationobject );
  116.  
  117. void CLMUI_Boards2lv(APTR , BOOL );
  118. void CLMUI_Links2lv(APTR );
  119. void CLMUI_lv2Gruppen(APTR , char *, ULONG );
  120. void CLMUI_Gruppen2lv(char * , APTR );
  121. void CLMUI_lv2Verteiler(APTR , struct Brett *, ULONG );
  122. void CLMUI_Verteiler2lv(struct Brett * , APTR );
  123. long CLMUI_FindIn_lv(APTR , char * );
  124. void CLMUI_FindDel(APTR , char * );
  125. void CLMUI_Copy_lv_Active(APTR , APTR );
  126. void CLMUI_str2lv(APTR , APTR );
  127. void CLMUI_WildcardSelect(APTR , APTR , LONG );
  128. void CLMUI_CheckmarkExcludeA( APTR * );
  129. void CLMUI_CheckmarkExclude(...);
  130.  
  131. void CLMUI_SetCycleChainA( APTR window, APTR *objlist );
  132. void CLMUI_SetCycleChain( APTR window, ... );
  133.  
  134. void CLMUI_HelpFileName( STRPTR appname, STRPTR to );
  135.  
  136. void CLMUI_TickDelay( APTR appobject, LONG ticks );
  137.  
  138. void CLMUI_DisableA( LONG state, APTR *objlist );
  139. void CLMUI_Disable( LONG state, ... );
  140.  
  141. void CLMUI_SCF_Set( APTR obj, ULONG attr, ULONG val );
  142. void CLMUI_SCF_Get( APTR obj, ULONG attr, ULONG *valptr );
  143. void CLMUI_SCF_SetString( APTR obj, STRPTR val );
  144. void CLMUI_SCF_GetString( APTR obj, STRPTR *valptr );
  145. void CLMUI_SCF_SetText( APTR obj, STRPTR val );
  146. void CLMUI_SCF_SetInteger( APTR obj, ULONG val );
  147. void CLMUI_SCF_GetInteger( APTR obj, ULONG *valptr );
  148. void CLMUI_SCF_SetCycle( APTR obj, ULONG val );
  149. void CLMUI_SCF_GetCycle( APTR obj, ULONG *valptr );
  150. void CLMUI_SCF_SetCheckmark( APTR obj, ULONG val );
  151. void CLMUI_SCF_GetCheckmark( APTR obj, ULONG *valptr );
  152.  
  153. void CLMUI_SetKeyID( APTR );
  154. void CLMUI_SetDoubleStart( APTR app, APTR win );
  155. void CLMUI_MakeButtonSendID( APTR but, LONG id );
  156.  
  157. void CLMUI_KeyTimedout( void );
  158. void CLMUI_KeyNoPermission( STRPTR subsystem );
  159.  
  160. /*
  161.  *  Redefine MUI macros
  162.  */
  163.  
  164. //#ifdef _CLMUI_MACROFUNC
  165. #undef String
  166. #define String CLMUI_SCF_String
  167. #undef KeyString
  168. #define KeyString CLMUI_SCF_KeyString
  169. #undef CheckMark
  170. #define CheckMark CLMUI_SCF_CheckMark
  171. #undef KeyCheckMark
  172. #define KeyCheckMark CLMUI_SCF_KeyCheckMark
  173. #undef SimpleButton
  174. #define SimpleButton CLMUI_SCF_SimpleButton
  175. #undef KeyButton
  176. #define KeyButton CLMUI_SCF_KeyButton
  177. #undef Cycle
  178. #define Cycle CLMUI_SCF_Cycle
  179. #undef KeyCycle
  180. #define KeyCycle CLMUI_SCF_KeyCycle
  181. #undef Radio
  182. #define Radio CLMUI_SCF_Radio
  183. #undef KeyRadio
  184. #define KeyRadio CLMUI_SCF_KeyRadio
  185. #undef Slider
  186. #define Slider CLMUI_SCF_Slider
  187. #undef KeySlider
  188. #define KeySlider CLMUI_SCF_KeySlider
  189. #undef PopButton
  190. #define PopButton CLMUI_SCF_PopButton
  191. #undef Label
  192. #define Label CLMUI_SCF_Label
  193. #undef Label1
  194. #define Label1 CLMUI_SCF_Label1
  195. #undef Label2
  196. #define Label2 CLMUI_SCF_Label2
  197. #undef LLabel
  198. #define LLabel CLMUI_SCF_LLabel
  199. #undef LLabel1
  200. #define LLabel1 CLMUI_SCF_LLabel1
  201. #undef LLabel2
  202. #define LLabel2 CLMUI_SCF_LLabel2
  203. #undef KeyLabel
  204. #define KeyLabel CLMUI_SCF_KeyLabel
  205. #undef KeyLabel1
  206. #define KeyLabel1 CLMUI_SCF_KeyLabel1
  207. #undef KeyLabel2
  208. #define KeyLabel2 CLMUI_SCF_KeyLabel2
  209. #undef KeyLLabel
  210. #define KeyLLabel CLMUI_SCF_KeyLLabel
  211. #undef KeyLLabel1
  212. #define KeyLLabel1 CLMUI_SCF_KeyLLabel1
  213. #undef KeyLLabel2
  214. #define KeyLLabel2 CLMUI_SCF_KeyLLabel2
  215.  
  216. // Set/Get stuff
  217.  
  218. #undef set
  219. #undef get
  220. #undef setcycle
  221. #undef setstring
  222. #undef setcheckmark
  223.  
  224. #define set(o,a,v) CLMUI_SCF_Set(o,a,(ULONG)(v))
  225. #define get(o,a,v) CLMUI_SCF_Get(o,a,(ULONG*)(v))
  226. #define setstring(o,v) CLMUI_SCF_SetString(o,v)
  227. #define getstring(o,v) CLMUI_SCF_GetString(o,v)
  228. #define settext(o,v) CLMUI_SCF_SetText(o,v)
  229. #define setinteger(o,v) CLMUI_SCF_SetInteger(o,v)
  230. #define getinteger(o,v) CLMUI_SCF_GetInteger(o,v)
  231. #define setcycle(o,v) CLMUI_SCF_SetCycle(o,v)
  232. #define getcycle(o,v) CLMUI_SCF_GetCycle(o,v)
  233. #define setcheckmark(o,v) CLMUI_SCF_SetCheckmark(o,v)
  234. #define getcheckmark(o,v) CLMUI_SCF_GetCheckmark(o,v)
  235.  
  236. //#endif
  237.  
  238. /******************************************************************/
  239. /* Misc */
  240. /******************************************************************/
  241.  
  242. /*
  243.  *      This magic value ends a CLMUI_SetCycleChain
  244.  *      object list.
  245.  */
  246.  
  247. #define CLMUI_SCCEND ((APTR)-1)
  248.  
  249.  
  250. /********************************************************************
  251.  ********* Custom Classes *******************************************
  252.  ********************************************************************/
  253.  
  254. #define CLMUIA_TB (TAG_USER|(222<<16))
  255.  
  256. /*
  257.  * Console 1.1
  258.  * -----------
  259.  *
  260.  * Subclass of Areaclass, allows integrating of console device
  261.  * in a MUI friendly manner.
  262.  *
  263.  */
  264.  
  265. #define CLC_CONSOLE "cl_console.clmui"
  266.  
  267. /*
  268.  *  Attributes
  269.  */
  270.  
  271. #define CLMUIA_Console_IOWrite                          (CLMUIA_TB+66)  // [I.G] Console write request
  272. #define CLMUIA_Console_IOWritePort                      (CLMUIA_TB+68)  // [I.G] Console write msgport
  273. #define CLMUIA_Console_Query                            (CLMUIA_TB+71)  // [..G] number of chars avaible in input buffer
  274. #define CLMUIA_Console_ReadChar                         (CLMUIA_TB+73)  // [..G] read current char
  275. #define CLMUIA_Console_Cursor                           (CLMUIA_TB+75)  // [ISG] cursor?
  276.  
  277. /*
  278.  *  New Methods
  279.  */
  280.  
  281. #define CLMUIM_Console_Write                            (CLMUIA_TB+70)  // New Method: Write Text [buffer,len]
  282. #define CLMUIM_Console_Read                             (CLMUIA_TB+72)  // New Method: Read text [buffer,len]
  283.  
  284. /*
  285.  *  Macros
  286.  */
  287.  
  288. #define CLConsoleObject CLMUI_NewObject(CLC_CONSOLE
  289.  
  290.  
  291. /*************************************************************************/
  292.  
  293. /*
  294.  * PopstringList 3.1
  295.  * -----------------
  296.  *
  297.  * A subclass of MUI's PopObjectClass. Creates a PopupObject
  298.  * with properly set up String, Button and a Popup Listview.
  299.  * Possible choices are given as a NULL terminated array of
  300.  * STRPTRs or a magic value designating a User, Board or
  301.  * System list.
  302.  */
  303.  
  304. #define CLC_POPSTRINGLIST "cl_popstringlist.clmui"
  305.  
  306. /*
  307.  *  Attributes
  308.  */
  309.  
  310. #define CLMUIA_Popstringlist_MaxLen             (CLMUIA_TB+1)   // [I..] length of string object (40)
  311. #define CLMUIA_Popstringlist_ButtonImage        (CLMUIA_TB+2)   // [I..] ImageID of button to generate (MUII_PopUp)
  312. #define CLMUIA_Popstringlist_Contents           (CLMUIA_TB+3)   // [ISG] string contents (Empty)
  313. #define CLMUIA_Popstringlist_Entries            (CLMUIA_TB+4)   // [I..] NULL terminated array of popup selections or a magic value (Empty)
  314. #define CLMUIA_Popstringlist_StringObject       (CLMUIA_TB+5)   // [I.G] (APTR) embedded String Object
  315. #define CLMUIA_Popstringlist_Integer            (CLMUIA_TB+6)   // [ISG] string contents, integer form (Empty)
  316. #define CLMUIA_Popstringlist_FilterHook         (CLMUIA_TB+7)   // [I..] filter hook for Use/Board/Syslist
  317.  
  318. /*
  319.  *  Magic values fuer CLMUIA_Popstringlist_Entries
  320.  */
  321.  
  322. #define CLMUIV_Popstringlist_Userlist           (-1)                    // Show Userlist
  323. #define CLMUIV_Popstringlist_Boardlist          (-2)                    // Show Boardlist
  324. #define CLMUIV_Popstringlist_UserBoardlist      (-3)                    // Show User and Boardlist
  325. #define CLMUIV_Popstringlist_Systemlist         (-4)                    // Show Systemlist
  326.  
  327. /*
  328.  *  Your filter hook is called with a pointer to your hook
  329.  *  in A0, one of the values below in A1 (read: A1 contains
  330.  *  the value, not a pointer to it!) and the hook object
  331.  *  in A2. If the hook returns TRUE, the object is added
  332.  *  to the list.
  333.  *
  334.  *  [Note: Some older documentation had A1 / A2 exchanged
  335.  *   in above description!]
  336.  */
  337.  
  338. #define CLMUIV_Popstringlist_HookObjectUser   (0)                       // Hook object is struct User
  339. #define CLMUIV_Popstringlist_HookObjectBoard  (1)                       // Hook object is struct Board
  340. #define CLMUIV_Popstringlist_HookObjectSystem (2)                       // Hook object is struct System
  341.  
  342. /*
  343.  *  Macros
  344.  */
  345.  
  346. #define CLPopstringlistObject CLMUI_NewObject(CLC_POPSTRINGLIST
  347. #define CLPopstringlist(default,len,array) \
  348.         CLPopstringlistObject, \
  349.                 CLMUIA_Popstringlist_Contents,  default, \
  350.                 CLMUIA_Popstringlist_MaxLen,    len,\
  351.                 CLMUIA_Popstringlist_Entries,   array,\
  352.                 End
  353.  
  354. #define CLPopstringlistM(default,list) \
  355.         CLPopstringlistObject, \
  356.                 CLMUIA_Popstringlist_Contents,  default, \
  357.                 CLMUIA_Popstringlist_MaxLen,    80,\
  358.                 CLMUIA_Popstringlist_Entries,   list,\
  359.                 End
  360.  
  361. /*************************************************************************/
  362.  
  363. /*
  364.  * Groupselect 1.0
  365.  * -----------------
  366.  *
  367.  * A subclass of MUI's Listview class. Allows group selection.
  368.  */
  369.  
  370. #define CLC_GROUPSELECT "cl_groupselect.clmui"
  371.  
  372. /*
  373.  *  Attributes
  374.  */
  375.  
  376. #define CLMUIA_Groupselect_Groups    (CLMUIA_TB+9487)    // [ISG] Group array
  377.  
  378.  
  379. /*
  380.  * Integer 1.0
  381.  * -----------------
  382.  *
  383.  * A subclass of MUI's String class. Allows setting min & max values
  384.  * with automatic range checking, and allows notifications on
  385.  * MUIA_String_Integer
  386.  */
  387.  
  388. #define CLC_INTEGER "cl_integer.clmui"
  389.  
  390. /*
  391.  *  Attributes
  392.  */
  393.  
  394. #define CLMUIA_Integer_Min    (CLMUIA_TB+7731)    // [I..] Minimum value (defaults to 0)
  395. #define CLMUIA_Integer_Max    (CLMUIA_TB+7732)    // [I..] Maximum value (defaults to MAXINT)
  396.  
  397. /*
  398.  *  Macros
  399.  */
  400.  
  401. #define CLInteger(current,min,max) CLMUI_NewObject(CLC_INTEGER,MUIA_String_Integer,current,CLMUIA_Integer_Min,min,CLMUIA_Integer_Max,max,StringFrame,NULL)
  402. #define CLIntegerNR(current) CLMUI_NewObject(CLC_INTEGER,MUIA_String_Integer,current,StringFrame,NULL)
  403.  
  404. // Popimage bei Button
  405.  
  406. #define PopImageKeyButton(control)\
  407.         ImageObject,\
  408.                 ImageButtonFrame,\
  409.                 MUIA_InputMode        , MUIV_InputMode_RelVerify,\
  410.                 MUIA_Image_Spec       , MUII_PopUp,\
  411.                 MUIA_Image_FreeVert   , TRUE,\
  412.                 MUIA_Background       , MUII_ButtonBack,\
  413.                 MUIA_ShowSelState     , FALSE,\
  414.                 MUIA_ControlChar      , control,\
  415.                 End
  416.  
  417. #endif
  418.