os::Application Class Reference
[Various utillity classes.]

Singleton class representing an application. More...

Inheritance diagram for os::Application:

os::Looper os::Handler List of all members.

Public Member Functions

 Application (const char *pzMimeType)
virtual ~Application ()
uint32 GetQualifiers ()
 Returnes the current state of keyboards qualifiers.
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler.
virtual void __reserved1__ ()
virtual void __reserved2__ ()
virtual void __reserved3__ ()
virtual void __reserved4__ ()
virtual void __reserved5__ ()
virtual void __reserved6__ ()
virtual void __reserved7__ ()
virtual void __reserved8__ ()
virtual void __reserved9__ ()
virtual void __reserved10__ ()
void PushCursor (mouse_ptr_mode eMode, void *pImage, int nWidth, int nHeight, const IPoint &cHotSpot=IPoint(0, 0))
void PopCursor ()
bigtime_t GetIdleTime ()
void GetKeyboardConfig (String *pcKeymapName, int *pnKeyDelay, int *pnKeyRepeat)
status_t SetKeymap (const char *pzName)
status_t SetKeyboardTimings (int nDelay, int nRepeat)
int GetScreenModeCount ()
int GetScreenModeInfo (int nIndex, screen_mode *psMode)
void SetWindowDecorator (const char *pzPath)
void CommitColorConfig ()
thread_id Run ()
 Entry point for the message loop.
port_id GetServerPort () const
port_id GetAppPort () const
 Return the appserver message port.
const CatalogGetCatalog () const
 Get the default string catalog.
void SetCatalog (Catalog *pcCatalog)
 Set the default string catalog.
bool SetCatalog (const String &cCatalogName)
 Set the default string catalog.
LocaleGetApplicationLocale () const
 Get current locale.
void SetApplicationLocale (const Locale &pcLocale)
 Change current locale.
void RegisterKeyEvent (const os::KeyboardEvent &)
void UnregisterKeyEvent (const os::String &cEvent)
int GetCurrentKeyShortcuts (std::vector< os::KeyboardEvent > *pcTable)

Static Public Member Functions

static ApplicationGetInstance ()
 Get the (one and only) instance of the Application class.

Friends

class Window
class Desktop
class Bitmap
class Sprite
class View
class Font
class AppserverConfig

Classes

class  Private

Detailed Description

Description:
Before you can use any of the classes in the AtheOS API you must instantiate an application object. The application object establish the connection with the appserver, and are responcible for all application level comunication after the connection is established.
os::Application inherit from Looper, but it does behave different from other loopers in the way that it does not spawn a new thread when the Run() member is called. Insetead it steel the thread calling the run member (normally the main thread) and let it run the message loop.

See also:
os::Window, os::View, os::Looper
Author:
Kurt Skauen ([email protected])


Constructor & Destructor Documentation

Application::Application ( const char *  pzMimeType  ) 

Application::~Application (  )  [virtual]


Member Function Documentation

Application * Application::GetInstance (  )  [static]

When the Application class is instantiated it will assign a pointer to the instance to a static member that can be obtained through this function. Many other classes expect this function to return a valid pointer, so it is importen that you instantiate the Application class once (and only once) before calling any other functions in the native AtheOS API.

Returns:
Pointer to the global instance of the Application drived class.
See also:
Author:
Kurt Skauen ([email protected])

uint32 Application::GetQualifiers (  ) 

Sends a requester to the appserver to obtain the current state of keyboard qualifiers.

Returns:
A bit mask composed from os::qualifiers decribing which qualifiers currently pressed
See also:
Author:
Kurt Skauen ([email protected])

void Application::HandleMessage ( Message pcMessage  )  [virtual]

Description:
Overload this member to dispatch messages sendt to this handler. When a looper receives a message for one of it's handlers it will call the taget handlers HandleMessage() to allow the handler to dispatch the message.
The message passed in pcMessage is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage().
The looper will be locked when this member is called. The default implementation of this member will pass the message on to the next handler if one was set with SetNextHandler().
Note:
Never do any lenthy operations in any hook members that are called from the looper thread if the looper is involved with the GUI (for example if the looper is a os::Window). The looper will not be able to dispatch messages until the hook returns so spending a long time in this members will make the GUI feel unresponsive.
Parameters:
pcMessage The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(),
See also:
os::Looper::DispatchMessage(), os::Looper::DetachCurrentMessage()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Handler.

void Application::__reserved1__ (  )  [virtual]

void Application::__reserved2__ (  )  [virtual]

void Application::__reserved3__ (  )  [virtual]

void Application::__reserved4__ (  )  [virtual]

void Application::__reserved5__ (  )  [virtual]

void Application::__reserved6__ (  )  [virtual]

void Application::__reserved7__ (  )  [virtual]

void Application::__reserved8__ (  )  [virtual]

void Application::__reserved9__ (  )  [virtual]

void Application::__reserved10__ (  )  [virtual]

void Application::PushCursor ( mouse_ptr_mode  eMode,
void *  pImage,
int  nWidth,
int  nHeight,
const IPoint cHotSpot = IPoint(0, 0) 
)

void Application::PopCursor (  ) 

bigtime_t Application::GetIdleTime (  ) 

void Application::GetKeyboardConfig ( String pcKeymapName,
int *  pnKeyDelay,
int *  pnKeyRepeat 
)

status_t Application::SetKeymap ( const char *  pzName  ) 

status_t Application::SetKeyboardTimings ( int  nDelay,
int  nRepeat 
)

int Application::GetScreenModeCount (  ) 

int Application::GetScreenModeInfo ( int  nIndex,
screen_mode psMode 
)

void Application::SetWindowDecorator ( const char *  pzPath  ) 

void Application::CommitColorConfig (  ) 

thread_id Application::Run ( void   )  [virtual]

The Application class is different from other loopers in that it does not spawn a new thread when the Run() member is called. Instead the Run() member directly enter the message loop, and does not return until the message loop quits.

Returns:
The thread id of the thread calling it.
See also:
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Looper.

port_id Application::GetServerPort (  )  const

port_id Application::GetAppPort (  )  const

When contructed the Application class will establish a connection to the application server. The appserver will create an message port and spawn a thread that will handle application-level operation on behave of the Application class. This function returnes the message port that connect the Application object with the corresponding thread in the application server

Returns:
The message port id for the server side message port connecting this object to the application server.
See also:
Author:
Kurt Skauen ([email protected])

const Catalog * Application::GetCatalog (  )  const

This function returns the string catalog that was set with SetCatalog().

Returns:
Pointer to the application's default string catalog
See also:
SetCatalog()
Author:
Henrik Isaksson ([email protected])

void Application::SetCatalog ( Catalog pcCatalog  ) 

This function sets the string catalog that is returned by GetCatalog().

See also:
GetCatalog()
Author:
Henrik Isaksson ([email protected])

bool Application::SetCatalog ( const String cCatalogName  ) 

This function sets the string catalog that is returned by GetCatalog().

See also:
GetCatalog()
Author:
Henrik Isaksson ([email protected])

Locale * Application::GetApplicationLocale (  )  const

This function returns the default locale that is used by this application. Unless you change it using SetApplicationLocale, the application locale will be the same as the system's default locale (as set by Locale prefs).

See also:
SetApplicationLocale()
Author:
Henrik Isaksson ([email protected])

void Application::SetApplicationLocale ( const Locale cLocale  ) 

This function changes the default locale that is used by this application. Normally, you shouldn't use this function, as the locale will be set automatically to the system's default locale (as set by Locale prefs).

See also:
GetApplicationLocale()
Author:
Henrik Isaksson ([email protected])

void Application::RegisterKeyEvent ( const os::KeyboardEvent  ) 

void Application::UnregisterKeyEvent ( const os::String cEvent  ) 

int Application::GetCurrentKeyShortcuts ( std::vector< os::KeyboardEvent > *  pcTable  ) 


Friends And Related Function Documentation

friend class Window [friend]

Reimplemented from os::Looper.

friend class Desktop [friend]

friend class Bitmap [friend]

friend class Sprite [friend]

friend class View [friend]

friend class Font [friend]

friend class AppserverConfig [friend]


Generated on Sat May 9 22:51:06 2009 for Syllable higlevel API by  doxygen 1.5.1