home *** CD-ROM | disk | FTP | other *** search
- #ifndef CPP_WORKBENCH_WORKBENCH_H
- #define CPP_WORKBENCH_WORKBENCH_H
-
- // Klassen für Workbenchapplikationen
- //
- // Autor: Jochen Becher
- //
- // Historie:
- // Version 1.0 am 27. Februar 94
-
- #ifndef WORKBENCH_STARTUP_H
- #include <workbench/startup.h>
- #endif
-
- #ifndef WORKBENCH_WORKBENCH_H
- #include <workbench/workbench.h>
- #endif
-
- #ifndef CPP_EXEC_LISTS_H
- #include <classes/exec/lists.h>
- #endif
-
- #ifndef CPP_WORKBENCH_ICON_H
- #include <classes/workbench/icon.h>
- #endif
-
- #ifndef CPP_EXEC_PORTS_H
- #include <classes/exec/ports.h>
- #endif
-
- #ifndef CPP_INTUITION_WINDOW_H
- #include <classes/intuition/window.h>
- #endif
-
- class WBArgC : public NodeC, public DiskObjectNewC {
- public:
- WBArgC(struct WBArg *arg = NULL, WBArgC *def = NULL);
- ~WBArgC();
- STRPTR name();
- BPTR lock();
- private:
- struct WBArg *argument;
- WBArgC *default_arg;
- };
-
- class WBArgListC : protected ListC {
- friend class WBArgListCursorC;
- public:
- WBArgListC(LONG argNum, struct WBArg *args, WBArgC *def = NULL);
- ~WBArgListC();
- WBArgC *remHead() { return (WBArgC *) ListC::remHead(); };
- WBArgC *remTail() { return (WBArgC *) ListC::remTail(); };
- };
-
- class WBArgListCursorC : public ListCursorC {
- public:
- WBArgListCursorC(WBArgListC &l)
- : ListCursorC(l) { };
- WBArgC *item() { return (WBArgC *) ListCursorC::item(); };
- };
-
- class WBStartupC {
- public:
- WBStartupC(struct WBStartup &);
- ~WBStartupC();
- WBArgC &tool() { return wbtool; };
- WBArgListC &arguments() { return projekts; };
- private:
- WBArgC wbtool;
- WBArgListC projekts;
- };
-
- // *************************************************************
-
- class AppMessageC : public MessageC {
- public:
- UWORD am_Type;
- ULONG am_UserData;
- ULONG am_ID;
- LONG am_NumArgs;
- struct WBArg *am_ArgList;
- UWORD am_Version;
- UWORD am_Class;
- WORD am_MouseX;
- WORD am_MouseY;
- ULONG am_Seconds;
- ULONG am_Micros;
- ULONG am_Reserved [8];
- };
-
- class AppEventHandlerC : public MessageHandlerC {
- public:
- AppEventHandlerC(UWORD apptype);
- UWORD appType() const { return aType; };
- BOOL handle(MessageC &);
- BOOL forMe(MessageC &);
- protected:
- virtual BOOL _handle(AppMessageC &msg);
- virtual BOOL _forMe(AppMessageC &msg);
- private:
- UWORD aType;
- };
-
- class AppEventHandlerChainC : public AppEventHandlerC, public HandlerChainC {
- public:
- AppEventHandlerChainC(UWORD apptype)
- : AppEventHandlerC(apptype), HandlerChainC() { };
- VOID add(AppEventHandlerC &h) { HandlerChainC::add(h); };
- BOOL handle(MessageC &msg) { return HandlerChainC::handle(msg); };
- BOOL exit() { return HandlerChainC::exit(); };
- };
-
- class AppPortC : public HandlerPortC {
- public:
- AppPortC() : HandlerPortC() { };
- AppPortC(STRPTR name, BYTE pri = 0) : HandlerPortC(name,pri) { };
- AppPortC(struct MsgPort *port) : HandlerPortC(port) { };
- VOID add(AppEventHandlerC &h) { HandlerPortC::add(h); };
- };
-
- // *************************************************************
-
- class AppWindowC {
- public:
- AppWindowC(AppPortC &, WindowC &, ULONG id, Tag tag1type, ...);
- AppWindowC(AppPortC &, WindowC &, ULONG id = 0, struct TagItem * = NULL);
- AppWindowC(const AppWindowC &);
- ~AppWindowC();
- AppWindowC &operator= (const AppWindowC &);
- ULONG id() const { return aID; };
- AppPortC *port() const { return aPort; };
- WindowC *window() const { return aWindow; };
- BOOL attach(Tag tag1type, ...);
- virtual BOOL attach(struct TagItem * = NULL);
- virtual VOID detach();
- private:
- AppPortC *aPort;
- WindowC *aWindow;
- ULONG aID;
- TagItemC inittags;
- struct AppWindow *aWin;
- };
-
- class AppWindowHandlerC : public AppEventHandlerC {
- public:
- AppWindowHandlerC(AppWindowC &);
- AppWindowHandlerC(AppEventHandlerChainC &);
- AppWindowC *appWindow() const { return aWindow; };
- virtual VOID drop(AppMessageC &) { };
- protected:
- virtual BOOL _handle(AppMessageC &msg);
- virtual BOOL _forMe(AppMessageC &msg);
- private:
- AppWindowC *aWindow;
- };
-
- class AppWindowHandlerChainC : public AppWindowHandlerC, public HandlerChainC {
- public:
- AppWindowHandlerChainC(AppWindowC &w)
- : AppWindowHandlerC(w), HandlerChainC() { };
- VOID add(AppWindowHandlerC &h) { HandlerChainC::add(h); };
- BOOL handle(MessageC &msg) { return HandlerChainC::handle(msg); };
- BOOL exit() { return HandlerChainC::exit(); };
- };
-
- // *************************************************************
-
- class AppMenuItemC {
- };
-
- class AppIconC {
- };
-
- #endif
-