home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / Workbench / workbench.h < prev   
Encoding:
C/C++ Source or Header  |  1995-01-31  |  4.1 KB  |  175 lines

  1. #ifndef CPP_WORKBENCH_WORKBENCH_H
  2. #define CPP_WORKBENCH_WORKBENCH_H
  3.  
  4. // Klassen für Workbenchapplikationen
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0 am 27. Februar 94
  10.  
  11. #ifndef WORKBENCH_STARTUP_H
  12. #include <workbench/startup.h>
  13. #endif
  14.  
  15. #ifndef WORKBENCH_WORKBENCH_H
  16. #include <workbench/workbench.h>
  17. #endif
  18.  
  19. #ifndef CPP_EXEC_LISTS_H
  20. #include <classes/exec/lists.h>
  21. #endif
  22.  
  23. #ifndef CPP_WORKBENCH_ICON_H
  24. #include <classes/workbench/icon.h>
  25. #endif
  26.  
  27. #ifndef CPP_EXEC_PORTS_H
  28. #include <classes/exec/ports.h>
  29. #endif
  30.  
  31. #ifndef CPP_INTUITION_WINDOW_H
  32. #include <classes/intuition/window.h>
  33. #endif
  34.  
  35. class WBArgC : public NodeC, public DiskObjectNewC {
  36. public:
  37.     WBArgC(struct WBArg *arg = NULL, WBArgC *def = NULL);
  38.     ~WBArgC();
  39.     STRPTR name();
  40.     BPTR lock();
  41. private:
  42.     struct WBArg *argument;
  43.     WBArgC *default_arg;
  44. };
  45.  
  46. class WBArgListC : protected ListC {
  47. friend class WBArgListCursorC;
  48. public:
  49.     WBArgListC(LONG argNum, struct WBArg *args, WBArgC *def = NULL);
  50.     ~WBArgListC();
  51.     WBArgC *remHead() { return (WBArgC *) ListC::remHead(); };
  52.     WBArgC *remTail() { return (WBArgC *) ListC::remTail(); };
  53. };
  54.  
  55. class WBArgListCursorC : public ListCursorC {
  56. public:
  57.     WBArgListCursorC(WBArgListC &l)
  58.         : ListCursorC(l) { };
  59.     WBArgC *item() { return (WBArgC *) ListCursorC::item(); };
  60. };
  61.  
  62. class WBStartupC {
  63. public:
  64.     WBStartupC(struct WBStartup &);
  65.     ~WBStartupC();
  66.     WBArgC &tool() { return wbtool; };
  67.     WBArgListC &arguments() { return projekts; };
  68. private:
  69.     WBArgC wbtool;
  70.     WBArgListC projekts;
  71. };
  72.  
  73. // *************************************************************
  74.  
  75. class AppMessageC : public MessageC {
  76. public:
  77.     UWORD am_Type;
  78.     ULONG am_UserData;
  79.     ULONG am_ID;
  80.     LONG am_NumArgs;
  81.     struct WBArg *am_ArgList;
  82.     UWORD am_Version;
  83.     UWORD am_Class;
  84.     WORD am_MouseX;
  85.     WORD am_MouseY;
  86.     ULONG am_Seconds;
  87.     ULONG am_Micros;
  88.     ULONG am_Reserved [8];
  89. };
  90.  
  91. class AppEventHandlerC : public MessageHandlerC {
  92. public:
  93.     AppEventHandlerC(UWORD apptype);
  94.     UWORD appType() const { return aType; };
  95.     BOOL handle(MessageC &);
  96.     BOOL forMe(MessageC &);
  97. protected:
  98.     virtual BOOL _handle(AppMessageC &msg);
  99.     virtual BOOL _forMe(AppMessageC &msg);
  100. private:
  101.     UWORD aType;
  102. };
  103.  
  104. class AppEventHandlerChainC : public AppEventHandlerC, public HandlerChainC {
  105. public:
  106.     AppEventHandlerChainC(UWORD apptype)
  107.         : AppEventHandlerC(apptype), HandlerChainC() { };
  108.     VOID add(AppEventHandlerC &h) { HandlerChainC::add(h); };
  109.     BOOL handle(MessageC &msg) { return HandlerChainC::handle(msg); };
  110.     BOOL exit() { return HandlerChainC::exit(); };
  111. };
  112.  
  113. class AppPortC : public HandlerPortC {
  114. public:
  115.     AppPortC() : HandlerPortC() { };
  116.     AppPortC(STRPTR name, BYTE pri = 0) : HandlerPortC(name,pri) { };
  117.     AppPortC(struct MsgPort *port) : HandlerPortC(port) { };
  118.     VOID add(AppEventHandlerC &h) { HandlerPortC::add(h); };
  119. };
  120.  
  121. // *************************************************************
  122.  
  123. class AppWindowC {
  124. public:
  125.     AppWindowC(AppPortC &, WindowC &, ULONG id, Tag tag1type, ...);
  126.     AppWindowC(AppPortC &, WindowC &, ULONG id = 0, struct TagItem * = NULL);
  127.     AppWindowC(const AppWindowC &);
  128.     ~AppWindowC();
  129.     AppWindowC &operator= (const AppWindowC &);
  130.     ULONG id() const { return aID; };
  131.     AppPortC *port() const { return aPort; };
  132.     WindowC *window() const { return aWindow; };
  133.     BOOL attach(Tag tag1type, ...);
  134.     virtual BOOL attach(struct TagItem * = NULL);
  135.     virtual VOID detach();
  136. private:
  137.     AppPortC *aPort;
  138.     WindowC *aWindow;
  139.     ULONG aID;
  140.     TagItemC inittags;
  141.     struct AppWindow *aWin;
  142. };
  143.  
  144. class AppWindowHandlerC : public AppEventHandlerC {
  145. public:
  146.     AppWindowHandlerC(AppWindowC &);
  147.     AppWindowHandlerC(AppEventHandlerChainC &);
  148.     AppWindowC *appWindow() const { return aWindow; };
  149.     virtual VOID drop(AppMessageC &) { };
  150. protected:
  151.     virtual BOOL _handle(AppMessageC &msg);
  152.     virtual BOOL _forMe(AppMessageC &msg);
  153. private:
  154.     AppWindowC *aWindow;
  155. };
  156.  
  157. class AppWindowHandlerChainC : public AppWindowHandlerC, public HandlerChainC {
  158. public:
  159.     AppWindowHandlerChainC(AppWindowC &w)
  160.         : AppWindowHandlerC(w), HandlerChainC() { };
  161.     VOID add(AppWindowHandlerC &h) { HandlerChainC::add(h); };
  162.     BOOL handle(MessageC &msg) { return HandlerChainC::handle(msg); };
  163.     BOOL exit() { return HandlerChainC::exit(); };
  164. };
  165.  
  166. // *************************************************************
  167.  
  168. class AppMenuItemC {
  169. };
  170.  
  171. class AppIconC {
  172. };
  173.  
  174. #endif
  175.