home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / c / asap / window.h < prev   
C/C++ Source or Header  |  1998-04-23  |  15KB  |  367 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AWindow wrapper class                                                     *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_AWindow_H
  12. #define ASAP_AWindow_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/DataTypes.h>
  19.  #include <Proto/GadTools.h>
  20.  #include <Proto/Intuition.h>
  21. }
  22.  
  23. class AViewPort;
  24.  
  25. class AWindow : public Window
  26. {
  27.  public:
  28.  inline void ActivateWindow();
  29.  inline LONG AddDTObject(Requester * req, Object * o, long pos);
  30.  inline UWORD AddGList(Gadget * gadget, unsigned long position, long numGad, Requester * requester);
  31.  inline UWORD AddGadget(Gadget * gadget, unsigned long position);
  32.  inline BOOL AutoRequest(IntuiText * body, IntuiText * posText, IntuiText * negText, unsigned long pFlag, unsigned long nFlag, unsigned long width, unsigned long height);
  33.  inline void BeginRefresh();
  34.  inline AWindow * BuildEasyRequest(EasyStruct * easyStruct, unsigned long idcmp, APTR arg1 = NULL, ...);
  35.  inline AWindow * BuildEasyRequestArgs(EasyStruct * easyStruct, unsigned long idcmp, APTR args);
  36.  inline AWindow * BuildSysRequest(IntuiText * body, IntuiText * posText, IntuiText * negText, unsigned long flags, unsigned long width, unsigned long height);
  37.  inline void ChangeWindowBox(long left, long top, long width, long height);
  38.  inline BOOL ClearDMRequest();
  39.  inline void ClearMenuStrip();
  40.  inline void ClearPointer();
  41.  inline void CloseWindow();
  42.  inline void operator delete(void *);
  43.  inline LONG EasyRequest(EasyStruct * easyStruct, ULONG * idcmpPtr, APTR arg1 = NULL, ...);
  44.  inline LONG EasyRequestArgs(EasyStruct * easyStruct, ULONG * idcmpPtr, APTR args);
  45.  inline void EndRefresh(long complete);
  46.  inline void FreeSysRequest();
  47.  inline void GT_BeginRefresh();
  48.  inline void GT_EndRefresh(long complete);
  49.  inline void GT_RefreshWindow(Requester * req);
  50.  inline void HelpControl(unsigned long flags);
  51.  inline void LendMenus(Window * towindow);
  52.  inline BOOL ModifyIDCMP(unsigned long flags);
  53.  inline void MoveWindow(long dx, long dy);
  54.  inline void MoveWindowInFrontOf(Window * behindWindow);
  55.  inline void OffMenu(unsigned long menuNumber);
  56.  inline void OnMenu(unsigned long menuNumber);
  57.  inline static AWindow * OpenWindow(NewWindow *);
  58.  inline void * operator new(size_t, NewWindow *);
  59.  inline static AWindow * OpenWindowTagList(NewWindow *, TagItem * tagList);
  60.  inline void * operator new(size_t, NewWindow *, TagItem * tagList);
  61.  inline static AWindow * OpenWindowTags(NewWindow *, unsigned long tag1Type,  ...);
  62.  inline void * operator new(size_t, NewWindow *, unsigned long tag1Type,  ...);
  63.  inline void RefreshWindowFrame();
  64.  inline LONG RemoveDTObject(Object * o);
  65.  inline UWORD RemoveGList(Gadget * gadget, long numGad);
  66.  inline UWORD RemoveGadget(Gadget * gadget);
  67.  inline void ReportMouse1(long flag);
  68.  inline BOOL ResetMenuStrip(Menu * menu);
  69.  inline void ScrollWindowRaster(long dx, long dy, long xMin, long yMin, long xMax, long yMax);
  70.  inline BOOL SetDMRequest(Requester * requester);
  71.  inline BOOL SetMenuStrip(Menu * menu);
  72.  inline LONG SetMouseQueue(unsigned long queueLength);
  73.  inline void SetPointer(UWORD * pointer, long height, long width, long xOffset, long yOffset);
  74.  inline void SetWindowPointer(unsigned long tag1,  ...);
  75.  inline void SetWindowPointerA(TagItem * taglist);
  76.  inline void SetWindowTitles(UBYTE * windowTitle, UBYTE * screenTitle);
  77.  inline void SizeWindow(long dx, long dy);
  78.  inline LONG SysReqHandler(ULONG * idcmpPtr, long waitInput);
  79.  inline AViewPort * ViewPortAddress();
  80.  inline BOOL WindowLimits(long widthMin, long heightMin, unsigned long widthMax, unsigned long heightMax);
  81.  inline void WindowToBack();
  82.  inline void WindowToFront();
  83.  inline void ZipWindow();
  84. };
  85. //----------------------------------------------------------------------------
  86. void AWindow::ActivateWindow ()
  87. {
  88.  ::ActivateWindow(this);
  89. }
  90. //----------------------------------------------------------------------------
  91. LONG AWindow::AddDTObject (Requester * req, Object * o, long pos)
  92. {
  93.  return ::AddDTObject(this, req, o, pos);
  94. }
  95. //----------------------------------------------------------------------------
  96. UWORD AWindow::AddGList (Gadget * gadget, unsigned long position, long numGad, Requester * requester)
  97. {
  98.  return ::AddGList(this, gadget, position, numGad, requester);
  99. }
  100. //----------------------------------------------------------------------------
  101. UWORD AWindow::AddGadget (Gadget * gadget, unsigned long position)
  102. {
  103.  return ::AddGadget(this, gadget, position);
  104. }
  105. //----------------------------------------------------------------------------
  106. BOOL AWindow::AutoRequest (IntuiText * body, IntuiText * posText, IntuiText * negText, unsigned long pFlag, unsigned long nFlag, unsigned long width, unsigned long height)
  107. {
  108.  return ::AutoRequest(this, body, posText, negText, pFlag, nFlag, width, height);
  109. }
  110. //----------------------------------------------------------------------------
  111. void AWindow::BeginRefresh ()
  112. {
  113.  ::BeginRefresh(this);
  114. }
  115. //----------------------------------------------------------------------------
  116. AWindow * AWindow::BuildEasyRequest (EasyStruct * easyStruct, unsigned long idcmp, APTR arg1, ...)
  117. {
  118.  return AWindow::BuildEasyRequestArgs(easyStruct, idcmp, (APTR) &arg1);
  119. }
  120. //----------------------------------------------------------------------------
  121. AWindow * AWindow::BuildEasyRequestArgs (EasyStruct * easyStruct, unsigned long idcmp, APTR args)
  122. {
  123.  return (AWindow *) ::BuildEasyRequestArgs(this, easyStruct, idcmp, args);
  124. }
  125. //----------------------------------------------------------------------------
  126. AWindow * AWindow::BuildSysRequest (IntuiText * body, IntuiText * posText, IntuiText * negText, unsigned long flags, unsigned long width, unsigned long height)
  127. {
  128.  return (AWindow *) ::BuildSysRequest(this, body, posText, negText, flags, width, height);
  129. }
  130. //----------------------------------------------------------------------------
  131. void AWindow::ChangeWindowBox (long left, long top, long width, long height)
  132. {
  133.  ::ChangeWindowBox(this, left, top, width, height);
  134. }
  135. //----------------------------------------------------------------------------
  136. BOOL AWindow::ClearDMRequest ()
  137. {
  138.  return ::ClearDMRequest(this);
  139. }
  140. //----------------------------------------------------------------------------
  141. void AWindow::ClearMenuStrip ()
  142. {
  143.  ::ClearMenuStrip(this);
  144. }
  145. //----------------------------------------------------------------------------
  146. void AWindow::ClearPointer ()
  147. {
  148.  ::ClearPointer(this);
  149. }
  150. //----------------------------------------------------------------------------
  151. void AWindow::CloseWindow ()
  152. {
  153.  ::CloseWindow(this);
  154. }
  155. //----------------------------------------------------------------------------
  156. void AWindow::operator delete (void *win)
  157. {
  158.  ((AWindow *) win)->CloseWindow();
  159. }
  160. //----------------------------------------------------------------------------
  161. LONG AWindow::EasyRequest (EasyStruct * easyStruct, ULONG * idcmpPtr, APTR arg1, ...)
  162. {
  163.  return ::EasyRequest(this, easyStruct, idcmpPtr, (APTR) &arg1);
  164. }
  165. //----------------------------------------------------------------------------
  166. LONG AWindow::EasyRequestArgs (EasyStruct * easyStruct, ULONG * idcmpPtr, APTR args)
  167. {
  168.  return ::EasyRequestArgs(this, easyStruct, idcmpPtr, args);
  169. }
  170. //----------------------------------------------------------------------------
  171. void AWindow::EndRefresh (long complete)
  172. {
  173.  ::EndRefresh(this, complete);
  174. }
  175. //----------------------------------------------------------------------------
  176. void AWindow::FreeSysRequest ()
  177. {
  178.  ::FreeSysRequest(this);
  179. }
  180. //----------------------------------------------------------------------------
  181. void AWindow::GT_BeginRefresh ()
  182. {
  183.  ::GT_BeginRefresh(this);
  184. }
  185. //----------------------------------------------------------------------------
  186. void AWindow::GT_EndRefresh (long complete)
  187. {
  188.  ::GT_EndRefresh(this, complete);
  189. }
  190. //----------------------------------------------------------------------------
  191. void AWindow::GT_RefreshWindow (Requester * req)
  192. {
  193.  ::GT_RefreshWindow(this, req);
  194. }
  195. //----------------------------------------------------------------------------
  196. void AWindow::HelpControl (unsigned long flags)
  197. {
  198.  ::HelpControl(this, flags);
  199. }
  200. //----------------------------------------------------------------------------
  201. void AWindow::LendMenus (Window * towindow)
  202. {
  203.  ::LendMenus(this, towindow);
  204. }
  205. //----------------------------------------------------------------------------
  206. BOOL AWindow::ModifyIDCMP (unsigned long flags)
  207. {
  208.  return ::ModifyIDCMP(this, flags);
  209. }
  210. //----------------------------------------------------------------------------
  211. void AWindow::MoveWindow (long dx, long dy)
  212. {
  213.  ::MoveWindow(this, dx, dy);
  214. }
  215. //----------------------------------------------------------------------------
  216. void AWindow::MoveWindowInFrontOf (Window * behindWindow)
  217. {
  218.  ::MoveWindowInFrontOf(this, behindWindow);
  219. }
  220. //----------------------------------------------------------------------------
  221. void AWindow::OffMenu (unsigned long menuNumber)
  222. {
  223.  ::OffMenu(this, menuNumber);
  224. }
  225. //----------------------------------------------------------------------------
  226. void AWindow::OnMenu (unsigned long menuNumber)
  227. {
  228.  ::OnMenu(this, menuNumber);
  229. }
  230. //----------------------------------------------------------------------------
  231. AWindow * AWindow::OpenWindow (NewWindow *newWindow)
  232. {
  233.  return (AWindow *) ::OpenWindow(newWindow);
  234. }
  235. //----------------------------------------------------------------------------
  236. void * AWindow::operator new(size_t, NewWindow *newWindow)
  237. {
  238.  return AWindow::OpenWindow(newWindow);
  239. }
  240. //----------------------------------------------------------------------------
  241. AWindow * AWindow::OpenWindowTagList (NewWindow *newWindow, TagItem * tagList)
  242. {
  243.  return (AWindow *) ::OpenWindowTagList(newWindow, tagList);
  244. }
  245. //----------------------------------------------------------------------------
  246. void * AWindow::operator new(size_t, NewWindow *newWindow, TagItem *tagList)
  247. {
  248.  return AWindow::OpenWindowTagList(newWindow, tagList);
  249. }
  250. //----------------------------------------------------------------------------
  251. AWindow * AWindow::OpenWindowTags (NewWindow *newWindow, unsigned long tag1Type,  ...)
  252. {
  253.  return (AWindow *) ::OpenWindowTagList(newWindow, (TagItem *) &tag1Type);
  254. }
  255. //----------------------------------------------------------------------------
  256. void * AWindow::operator new(size_t, NewWindow *newWindow, unsigned long tag1Type,  ...)
  257. {
  258.  return AWindow::OpenWindowTagList(newWindow, (TagItem *) &tag1Type);
  259. }
  260. //----------------------------------------------------------------------------
  261. void AWindow::RefreshWindowFrame ()
  262. {
  263.  ::RefreshWindowFrame(this);
  264. }
  265. //----------------------------------------------------------------------------
  266. LONG AWindow::RemoveDTObject (Object * o)
  267. {
  268.  return ::RemoveDTObject(this, o);
  269. }
  270. //----------------------------------------------------------------------------
  271. UWORD AWindow::RemoveGList (Gadget * gadget, long numGad)
  272. {
  273.  return ::RemoveGList(this, gadget, numGad);
  274. }
  275. //----------------------------------------------------------------------------
  276. UWORD AWindow::RemoveGadget (Gadget * gadget)
  277. {
  278.  return ::RemoveGadget(this, gadget);
  279. }
  280. //----------------------------------------------------------------------------
  281. void AWindow::ReportMouse1 (long flag)
  282. {
  283.  ::ReportMouse1(this, flag);
  284. }
  285. //----------------------------------------------------------------------------
  286. BOOL AWindow::ResetMenuStrip (Menu * menu)
  287. {
  288.  return ::ResetMenuStrip(this, menu);
  289. }
  290. //----------------------------------------------------------------------------
  291. void AWindow::ScrollWindowRaster (long dx, long dy, long xMin, long yMin, long xMax, long yMax)
  292. {
  293.  ::ScrollWindowRaster(this, dx, dy, xMin, yMin, xMax, yMax);
  294. }
  295. //----------------------------------------------------------------------------
  296. BOOL AWindow::SetDMRequest (Requester * requester)
  297. {
  298.  return ::SetDMRequest(this, requester);
  299. }
  300. //----------------------------------------------------------------------------
  301. BOOL AWindow::SetMenuStrip (Menu * menu)
  302. {
  303.  return ::SetMenuStrip(this, menu);
  304. }
  305. //----------------------------------------------------------------------------
  306. LONG AWindow::SetMouseQueue (unsigned long queueLength)
  307. {
  308.  return ::SetMouseQueue(this, queueLength);
  309. }
  310. //----------------------------------------------------------------------------
  311. void AWindow::SetPointer (UWORD * pointer, long height, long width, long xOffset, long yOffset)
  312. {
  313.  ::SetPointer(this, pointer, height, width, xOffset, yOffset);
  314. }
  315. //----------------------------------------------------------------------------
  316. void AWindow::SetWindowPointer (unsigned long tag1,  ...)
  317. {
  318.  SetWindowPointerA((TagItem *) &tag1);
  319. }
  320. //----------------------------------------------------------------------------
  321. void AWindow::SetWindowPointerA (TagItem * taglist)
  322. {
  323.  ::SetWindowPointerA(this, taglist);
  324. }
  325. //----------------------------------------------------------------------------
  326. void AWindow::SetWindowTitles (UBYTE * windowTitle, UBYTE * screenTitle)
  327. {
  328.  ::SetWindowTitles(this, windowTitle, screenTitle);
  329. }
  330. //----------------------------------------------------------------------------
  331. void AWindow::SizeWindow (long dx, long dy)
  332. {
  333.  ::SizeWindow(this, dx, dy);
  334. }
  335. //----------------------------------------------------------------------------
  336. LONG AWindow::SysReqHandler (ULONG * idcmpPtr, long waitInput)
  337. {
  338.  return ::SysReqHandler(this, idcmpPtr, waitInput);
  339. }
  340. //----------------------------------------------------------------------------
  341. AViewPort * AWindow::ViewPortAddress ()
  342. {
  343.  return (AViewPort *) ::ViewPortAddress(this);
  344. }
  345. //----------------------------------------------------------------------------
  346. BOOL AWindow::WindowLimits (long widthMin, long heightMin, unsigned long widthMax, unsigned long heightMax)
  347. {
  348.  return ::WindowLimits(this, widthMin, heightMin, widthMax, heightMax);
  349. }
  350. //----------------------------------------------------------------------------
  351. void AWindow::WindowToBack ()
  352. {
  353.  ::WindowToBack(this);
  354. }
  355. //----------------------------------------------------------------------------
  356. void AWindow::WindowToFront ()
  357. {
  358.  ::WindowToFront(this);
  359. }
  360. //----------------------------------------------------------------------------
  361. void AWindow::ZipWindow ()
  362. {
  363.  ::ZipWindow(this);
  364. }
  365.  
  366. #endif
  367.