CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

awsecomp.h

00001 /**************************************************************************
00002     Copyright (C) 2001 by Christopher Nelson
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 *****************************************************************************/
00018 
00019 #ifndef __CS_AWS_EMBEDDED_COMPONENT_H__
00020 #define __CS_AWS_EMBEDDED_COMPONENT_H__
00021 
00022 #include "csutil/ref.h"
00023 #include "iaws/aws.h"
00024 #include "iaws/awsparm.h"
00025 #include "iutil/event.h"
00026 #include "iaws/awsdefs.h"
00027 #include "csutil/event.h"
00028 
00042 class awsEmbeddedComponent : public iAwsComponent
00043 {
00044   csRef<iAwsComponent> comp;
00045 
00046 public:
00047   awsEmbeddedComponent() { }
00048   virtual ~awsEmbeddedComponent() 
00049   { 
00050     comp->WindowManager()->ComponentDestroyed( this );
00051   }
00052 
00053 public:
00055   virtual iAwsComponent *GetComponent ()
00056   { return this; }
00057 
00059   virtual bool RegisterSlot (iAwsSlot *slot, unsigned long signal)
00060   { return comp->RegisterSlot (slot, signal); }
00061 
00063   virtual bool UnregisterSlot (iAwsSlot *slot, unsigned long signal)
00064   { return comp->UnregisterSlot (slot, signal); }
00065 
00067   virtual void Broadcast (unsigned long signal)
00068   { comp->Broadcast (signal); }
00069 
00070 public:
00072   virtual void Initialize (iAwsComponent *component)
00073   { 
00074     comp = component; 
00075   }
00076 
00094   virtual bool Create (iAws *m, iAwsComponent *parent,
00095         iAwsComponentNode *settings)
00096   {
00097     return comp->Create(m, parent, settings);
00098   }
00099     
00101   virtual bool Setup (iAws *wmgr, iAwsComponentNode *settings)
00102   { return comp->Setup (wmgr, settings); }
00103     
00108   virtual bool HandleEvent(iEvent& Event)
00109   {
00110     return comp->HandleEvent(Event);
00111   }
00112  
00117   virtual bool GetProperty (const char *name, intptr_t *parm)
00118   { return comp->GetProperty (name, parm); }
00119 
00120 #ifndef AWS_VOIDP_IS_ERROR
00121 
00127   AWS_VOIDP_IS_WARNING
00128   virtual bool GetProperty(const char* name, void **parm)
00129   { return comp->GetProperty (name, (intptr_t*)parm); }
00130 #endif
00131 
00136   virtual bool SetProperty (const char *name, intptr_t parm)
00137   { return comp->SetProperty (name, parm); }
00138 
00139 #ifndef AWS_VOIDP_IS_ERROR
00140 
00146   AWS_VOIDP_IS_WARNING
00147   virtual bool SetProperty(const char* name, void *parm)
00148   { return comp->SetProperty (name, (intptr_t)parm); }
00149 #endif
00150 
00152   virtual bool Execute (const char *action, iAwsParmList* parmlist)
00153   { return comp->Execute (action, parmlist); }
00154 
00156   virtual void SetFlag (unsigned int flag)
00157   { comp->SetFlag (flag); }
00158 
00160   virtual void ClearFlag (unsigned int flag)
00161   { comp->ClearFlag (flag); }
00162 
00164   virtual unsigned int Flags ()
00165   { return comp->Flags (); }
00166 
00168   virtual void Invalidate ()
00169   { comp->Invalidate (); }
00170 
00172   virtual void Invalidate (csRect area)
00173   { comp->Invalidate (area); }
00174 
00176   virtual csRect Frame ()
00177   { return comp->Frame (); }
00178 
00180   virtual csRect ClientFrame ()
00181   { return comp->ClientFrame (); }
00182 
00187   virtual const char *Type ()
00188   { return comp->Type (); }
00189 
00191   virtual bool Overlaps (csRect &r)
00192   { return comp->Overlaps (r); }
00193 
00195   virtual bool isHidden ()
00196   { return comp->isHidden (); }
00197 
00199   virtual void Hide ()
00200   { comp->Hide (); }
00201 
00203   virtual void Show ()
00204   { comp->Show (); }
00205 
00207   virtual void Move (int delta_x, int delta_y)
00208   { comp->Move (delta_x, delta_y); }
00209 
00211   virtual void MoveTo (int x, int y)
00212   { comp->MoveTo (x, y); }
00213 
00215   virtual void Resize (int width, int height)
00216   { comp->Resize (width, height); }
00217 
00219   virtual void ResizeTo (csRect newFrame)
00220   { comp->ResizeTo (newFrame); }
00221 
00223   virtual unsigned long GetID ()
00224   { return comp->GetID (); }
00225 
00230   virtual void SetID (unsigned long id)
00231   { comp->SetID (id); }
00232 
00233   virtual iAwsComponent* FindChild (const char* name)
00234   { return comp->FindChild (name); }
00235 
00236   virtual iAwsComponent* DoFindChild (unsigned int id)
00237   { return comp->DoFindChild (id); }
00238 
00239   virtual bool IsMaximized()
00240   { return comp->IsMaximized(); }
00241 
00242   virtual void Maximize()
00243   { comp->Maximize(); }
00244 
00245   virtual void UnMaximize()
00246   { comp->UnMaximize(); }
00247 
00249   virtual void LayoutChildren ()
00250   { comp->LayoutChildren (); }
00251 
00252   virtual void AddToLayout (iAwsComponent *cmp, iAwsComponentNode* settings)
00253   { comp->AddToLayout (cmp, settings); }
00254 
00256   virtual void SetFocusable (bool focusable)
00257   { comp->SetFocusable (focusable); }
00258 
00260   virtual bool Focusable ()
00261   { return comp->Focusable (); }
00262 
00264   virtual bool isFocused ()
00265   { return comp->isFocused (); }
00266 
00268   virtual void SetFocus ()
00269   { comp->SetFocus (); }
00270 
00272   virtual void UnsetFocus ()
00273   { comp->UnsetFocus (); }
00274 
00276   virtual bool AddToTabOrder (iAwsComponent *cmp)
00277   { return comp->AddToTabOrder (cmp); }
00278 
00280   virtual iAwsComponent *TabNext (iAwsComponent *cmp)
00281   { return comp->TabNext (cmp); }
00282 
00284   virtual iAwsComponent *TabPrev (iAwsComponent *cmp)
00285   { return comp->TabPrev (cmp); }
00286 
00288   virtual int GetTabLength ()
00289   { return comp->GetTabLength (); }
00290 
00292   virtual iAwsComponent *GetTabComponent (int index)
00293   { return comp->GetTabComponent (index); }
00294 
00296   virtual iAwsComponent *GetFirstFocusableChild (iAwsComponent *comp)
00297   { return comp->GetFirstFocusableChild (comp); }
00298 
00300   virtual void AddChild(iAwsComponent* child)
00301   { comp->AddChild(child); }
00302 
00304   virtual void RemoveChild(iAwsComponent *child)
00305   { comp->RemoveChild(child); }
00306 
00308   virtual int GetChildCount()
00309   { return comp->GetChildCount(); }
00310 
00312   virtual iAwsComponent *GetTopChild()
00313   { return comp->GetTopChild(); }
00314 
00316   virtual bool HasChildren()
00317   { return comp->HasChildren(); }
00318 
00319   virtual iAwsComponent *ChildAt(int x, int y)
00320   { return comp->ChildAt(x,y); }
00321 
00327   iAws *WindowManager()
00328   { return comp->Window()->WindowManager(); }
00329 
00331   iAwsComponent *Window()
00332   { return comp->Window(); }
00333 
00335   iAwsComponent *Parent()
00336   { return comp->Parent(); }
00337 
00339   virtual void SetParent(iAwsComponent *parent)
00340   { comp->SetParent(parent); }
00341 
00343   virtual iAwsComponent *ComponentAbove()
00344   { return comp->ComponentAbove(); }
00345 
00347   virtual iAwsComponent *ComponentBelow()
00348   { return comp->ComponentBelow(); }
00349 
00351   virtual void SetComponentAbove(iAwsComponent *cmp)
00352   { comp->SetComponentAbove(cmp); }
00353 
00355   virtual void SetComponentBelow(iAwsComponent *cmp)
00356   { comp->SetComponentBelow(cmp); }
00357 
00359   virtual void Raise()
00360   { comp->Raise (); }
00361 
00363   virtual void Lower()
00364   { comp->Lower (); }
00365 
00367   virtual void SetRedrawTag(unsigned int tag)
00368   { comp->SetRedrawTag (tag); }
00369 
00371   virtual unsigned int RedrawTag()
00372   { return comp->RedrawTag (); }
00373 
00375   virtual void OnDraw(csRect clip)
00376   { comp->OnDraw (clip); }
00377 
00379   virtual bool OnMouseDown(int button, int x, int y)
00380   { return comp->OnMouseDown (button, x, y); }
00381 
00383   virtual bool OnMouseUp(int button, int x, int y)
00384   { return comp->OnMouseUp (button, x, y); }
00385 
00387   virtual bool OnMouseMove(int button, int x, int y)
00388   { return comp->OnMouseMove (button, x, y); }
00389 
00391   virtual bool OnMouseClick(int button, int x, int y)
00392   { return comp->OnMouseClick (button, x, y); }
00393 
00395   virtual bool OnMouseDoubleClick(int button, int x, int y)
00396   { return comp->OnMouseDoubleClick (button, x, y); }
00397 
00399   virtual bool OnMouseExit()
00400   { return comp->OnMouseExit (); }
00401 
00403   virtual bool OnMouseEnter()
00404   { return comp->OnMouseEnter (); }
00405 
00407   virtual bool OnKeyboard (const csKeyEventData& eventData)
00408   { return comp->OnKeyboard (eventData); }
00409 
00411   virtual bool OnLostFocus()
00412   { return comp->OnLostFocus (); }
00413 
00415   virtual bool OnGainFocus()
00416   { return comp->OnGainFocus (); }
00417 
00419   virtual iAwsLayoutManager *Layout()
00420   { return comp->Layout ();}
00421 
00423   virtual void SetLayout(iAwsLayoutManager *layoutMgr)
00424   { comp->SetLayout(layoutMgr); }
00425 
00427   virtual csRect getPreferredSize()
00428   { return comp->getPreferredSize (); }
00429 
00431   virtual void setPreferredSize (const csRect& size)
00432   { comp->setPreferredSize(size); }
00433 
00435   virtual void clearPreferredSize ()
00436   { comp->clearPreferredSize(); }
00437 
00439   virtual csRect getMinimumSize()
00440   { return comp->getMinimumSize (); }
00441 
00443   virtual csRect getInsets()
00444   { return comp->getInsets (); }
00445 
00447   virtual bool isDeaf()
00448   { return comp->isDeaf (); }
00449 
00451   virtual void SetDeaf (bool isDeaf)
00452   { comp->SetDeaf (isDeaf); }
00453 
00455   virtual bool OnFrame()
00456   { return comp->OnFrame ();}
00457 
00459   virtual void OnAdded()
00460   { comp->OnAdded ();}
00461 
00463   virtual void OnResized()
00464   { comp->OnResized ();}
00465 
00467   virtual void OnChildMoved()
00468   { comp->OnChildMoved(); }
00469 
00471   virtual void OnRaise()
00472   { comp->OnRaise(); }
00473 
00475   virtual void OnLower()
00476   { comp->OnLower(); }
00477 
00479   virtual void OnChildHide()
00480   { comp->OnChildHide(); }
00481 
00483   virtual void OnChildShow()
00484   { comp->OnChildShow(); }
00485 
00487   virtual void Unlink()
00488   { comp->Unlink(); }
00489 
00491   void LinkBelow (iAwsComponent *c)
00492   { comp->LinkBelow(c); }
00493 
00495   void LinkAbove (iAwsComponent *c)
00496   { comp->LinkAbove(c); }
00497 
00499   virtual void SetTopChild(iAwsComponent* child)
00500   { comp->SetTopChild(child); }
00501 
00503   virtual void OnSetFocus()
00504   { comp->OnSetFocus(); }
00505 
00507   virtual void OnUnsetFocus()
00508   { comp->OnUnsetFocus(); }
00509 
00511   virtual void MarkToDelete()
00512   { comp->MarkToDelete(); }
00513 
00515   virtual bool GetMarkToDelete()
00516   { return comp->GetMarkToDelete(); }
00517 };
00518 
00522 class awsEmbeddedComponentFactory : public iAwsComponentFactory
00523 {
00524 protected:
00525   iAws *wmgr;
00526 
00527 public:
00532   awsEmbeddedComponentFactory(iAws *_wmgr)
00533   {
00534     wmgr = _wmgr;
00535   }
00536 
00538   virtual ~awsEmbeddedComponentFactory()
00539   {
00540   }
00541 
00543   iAws *WindowManager() { return wmgr; }
00544 
00546   virtual void Register(const char *type)
00547   {
00548     wmgr->RegisterComponentFactory(this, type);
00549   }
00550 
00552   virtual void RegisterConstant(const char *name, int value)
00553   {
00554     wmgr->GetPrefMgr()->RegisterConstant(name, value);
00555   }
00556 };
00557 
00558 #endif // __CS_AWS_EMBEDDED_COMPONENT_H__
00559 

Generated for Crystal Space by doxygen 1.4.4