Pyro higlevel API
|
Singleton class representing an application. More...
Classes | |
class | Private |
Public Member Functions | |
Application (const char *pzMimeType) | |
Application (const char *pzMimeType, AppType_t nType) | |
virtual | ~Application () |
uint32 | GetQualifiers () |
Returnes the current state of keyboards qualifiers. More... | |
virtual void | HandleMessage (Message *pcMessage) |
Handle a message targeted at this handler. More... | |
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. More... | |
port_id | GetServerPort () const |
port_id | GetAppPort () const |
Return the appserver message port. More... | |
const Catalog * | GetCatalog () const |
Get the default string catalog. More... | |
void | SetCatalog (Catalog *pcCatalog) |
Set the default string catalog. More... | |
bool | SetCatalog (const String &cCatalogName) |
Set the default string catalog. More... | |
Locale * | GetApplicationLocale () const |
Get current locale. More... | |
void | SetApplicationLocale (const Locale &pcLocale) |
Change current locale. More... | |
void | RegisterKeyEvent (const os::KeyboardEvent &) |
void | UnregisterKeyEvent (const os::String &cEvent) |
int | GetCurrentKeyShortcuts (std::vector< os::KeyboardEvent > *pcTable) |
AppType_t | GetApplicationType () const |
Public Member Functions inherited from os::Looper | |
Looper (const String &cName, int nPriority=NORMAL_PRIORITY, int nPortSize=DEFAULT_PORT_SIZE) | |
The looper constructor. More... | |
virtual | ~Looper () |
Looper destructor. More... | |
void | SetName (const String &cName) |
Rename the looper. More... | |
String | GetName () const |
Get the loopers name. More... | |
bool | IsPublic () const |
See if the looper's message port is public. More... | |
void | SetPublic (bool bPublic) |
Make port public/private. More... | |
port_id | GetMsgPort () const |
Obtain the low-level message port used by this looper. More... | |
thread_id | GetThread () const |
Obtain the thread id of the looper thread. More... | |
proc_id | GetProcess () const |
Obtain the process ID of the loopers thread. More... | |
status_t | Lock () |
Lock the looper object. More... | |
status_t | Lock (bigtime_t nTimeout) |
Lock the looper with a timeout. More... | |
status_t | SafeLock () |
Attempt to lock the looper. More... | |
status_t | Unlock () |
Unlock the looper. More... | |
void | SetMutex (Locker *pcMutex) |
Set a custom mutex to be used by the looper. More... | |
Locker * | GetMutex () const |
Get a pointer to the loopers mutex. More... | |
int | GetLockCount () const |
Obtain the number of locks held on the looper. More... | |
thread_id | GetLockingThread () const |
Obtaing the owner of the looper lock. More... | |
bool | IsLocked () const |
Check if the looper lock is owned by the calling thread. More... | |
int | Wait () const |
Wait for the looper thread to die. More... | |
status_t | PostMessage (uint32 nCode) |
Deliver a message to the looper. More... | |
status_t | PostMessage (Message *pcMsg) |
Deliver a message to the looper. More... | |
status_t | PostMessage (uint32 cCode, Handler *pcHandler, Handler *pcReplyTo=NULL) |
Deliver a message to the looper. More... | |
status_t | PostMessage (Message *pcMsg, Handler *pcHandler, Handler *pcReplyTo=NULL) |
Deliver a message to the looper. More... | |
void | SpoolMessages () |
Drain the low-level message port. More... | |
Message * | GetCurrentMessage () const |
Obtain the message currently being processed. More... | |
Message * | DetachCurrentMessage () |
Steal the current message. More... | |
virtual void | DispatchMessage (Message *pcMessage, Handler *pcHandler) |
The loopers message handling callback. More... | |
virtual void | Started () |
Called by the looper thread before entering the message loop. More... | |
virtual bool | Idle () |
Hook called each time the message queue is drained. More... | |
MessageQueue * | GetMessageQueue () const |
Obtain the internal message queue used by the looper. More... | |
virtual bool | OkToQuit () |
Check if it is ok to break the loop. More... | |
virtual void | Quit () |
Unconditionally terminate the looper. More... | |
void | Terminate () |
Unconditionally terminate the looper. More... | |
void | AddTimer (Handler *pcTarget, int nID, bigtime_t nTimeout, bool bOneShot=true) |
Add a timer to the looper. More... | |
bool | RemoveTimer (Handler *pcTarget, int nID) |
Delete a timer. More... | |
const handler_map & | GetHandlerMap () const |
Get the internal handler list. More... | |
void | AddHandler (Handler *pcHandler) |
Add a handler to the looper. More... | |
bool | RemoveHandler (Handler *pcHandler) |
Remove a handler previously added by AddHandler() More... | |
Handler * | FindHandler (const String &cName) const |
Search the looper for a named handler. More... | |
int | GetHandlerCount () const |
Obtain the count of handlers added to this looper. More... | |
void | SetDefaultHandler (Handler *pcHandler) |
Set the default target for incomming messages. More... | |
Handler * | GetDefaultHandler () const |
Obtain the default handler for the looper. More... | |
void | AddCommonFilter (MessageFilter *pcFilter) |
void | RemoveCommonFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetCommonFilterList () const |
Public Member Functions inherited from os::Handler | |
Handler (const String &cName) | |
Construct a handler. More... | |
virtual | ~Handler () |
Destructor. More... | |
virtual void | TimerTick (int nID) |
Timer dispatch member. More... | |
String | GetName () const |
Get the handlers name. More... | |
void | SetName (const String &cName) |
Rename the handler. More... | |
Looper * | GetLooper () const |
Get a pointer to the looper this handler belongs to. More... | |
void | SetNextHandler (Handler *pcNextHandler) |
Set a handler that should handle messages this handler is not interrested in. More... | |
Handler * | GetNextHandler () const |
Get the next handler in a handler chain. More... | |
void | AddFilter (MessageFilter *pcFilter) |
void | RemoveFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetFilterList () const |
const uint32 | GetToken () |
Get the handlers token. More... | |
Static Public Member Functions | |
static Application * | GetInstance () |
Get the (one and only) instance of the Application class. More... | |
static os::String | GetApplicationPath () |
Static Public Member Functions inherited from os::Looper | |
static Looper * | GetLooperForThread (thread_id hThread) |
Friends | |
class | Window |
class | Desktop |
class | Bitmap |
class | Sprite |
class | View |
class | Font |
class | AppserverConfig |
Additional Inherited Members | |
Public Types inherited from os::Looper | |
typedef std::map< int, Handler * > | handler_map |
Protected Member Functions inherited from os::Looper | |
bool | FilterMessage (Message *pcMsg, Handler **ppcTarget, std::list< MessageFilter * > *pcFilterList) |
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.
Application::Application | ( | const char * | pzMimeType | ) |
References os::__set_default_color(), os::Message::AddInt32(), os::Message::AddString(), os::COL_COUNT, os::Message::FindColor32(), os::Message::FindInt(), os::Looper::GetMsgPort(), os::Application::Private::m_hReplyPort, os::Application::Private::m_hServerPort, os::Application::Private::m_hSrvAppPort, os::Application::Private::m_pcCatalog, and os::Looper::Messenger.
os::Application::Application | ( | const char * | pzMimeType, |
AppType_t | nType | ||
) |
|
virtual |
References os::Message::AddObject(), os::Message::AddString(), os::Looper::GetName(), os::Looper::Lock(), os::Application::Private::m_cKeyEvents, os::Application::Private::m_cWindows, os::Application::Private::m_hReplyPort, os::Application::Private::m_hServerPort, os::Application::Private::m_hSrvAppPort, os::Application::Private::m_pcCatalog, os::M_QUIT, os::Looper::Messenger, Resource::Release(), os::Looper::Terminate(), and os::Looper::Unlock().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
void Application::CommitColorConfig | ( | ) |
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).
References os::Application::Private::m_cLocale.
Referenced by os::FileRequester::FileRequester(), os::IconDirectoryView::IconDirectoryView(), InfoWin::InfoWin(), MountDialogWin::MountDialogWin(), NewDirWin::NewDirWin(), RenameFileWin::RenameFileWin(), and UnmountThread().
|
static |
AppType_t os::Application::GetApplicationType | ( | ) | 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
References os::Application::Private::m_hSrvAppPort.
Referenced by os::Font::GetSupportedCharacters(), and os::Font::SetFamilyAndStyle().
const Catalog * Application::GetCatalog | ( | ) | const |
This function returns the string catalog that was set with SetCatalog().
References os::Application::Private::m_pcCatalog.
Referenced by os::LString::LString().
int Application::GetCurrentKeyShortcuts | ( | std::vector< os::KeyboardEvent > * | pcTable | ) |
bigtime_t Application::GetIdleTime | ( | ) |
|
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.
Referenced by os::Desktop::Activate(), os::Font::AddDefaultFont(), os::AppserverConfig::AppserverConfig(), os::Bitmap::Bitmap(), os::CalendarView::CalendarView(), os::AppserverConfig::Commit(), os::DateView::DateView(), os::Desktop::Desktop(), os::Event::Event(), os::FileRequester::FileRequester(), os::Settings::Private::GetAppName(), os::Font::GetBitmapSizes(), os::Font::GetConfigNames(), os::Font::GetDefaultFont(), os::Font::GetFamilyCount(), os::Font::GetFamilyInfo(), os::View::GetQualifiers(), os::Font::GetStringLengths(), os::Font::GetStringWidths(), os::Font::GetStyleCount(), os::Font::GetStyleInfo(), os::Font::GetSupportedCharacters(), os::Font::GetTextExtents(), os::IconView::Private::GetViewFrame(), os::IconDirectoryView::IconDirectoryView(), InfoWin::InfoWin(), os::LString::LString(), os::Desktop::MinimizeAll(), MountDialogWin::MountDialogWin(), os::TextEdit::MouseMove(), os_priv::SplitterSeparator::MouseMove(), os::IconDirectoryView::MouseUp(), os::Sprite::MoveTo(), NewDirWin::NewDirWin(), os::InputBox::Private::Private(), os::ColorRequester::Private::Private(), RenameFileWin::RenameFileWin(), os::Font::Rescan(), os::Desktop::SetColorSpace(), os::Font::SetDefaultFont(), os::Font::SetFamilyAndStyle(), os::DateView::SetMessageTarget(), os::Desktop::SetRefreshRate(), os::Desktop::SetResolution(), os::Desktop::SetScreenMode(), os::Sprite::Sprite(), UnmountThread(), os::Window::Window(), os::Bitmap::~Bitmap(), os::Sprite::~Sprite(), and os::TextEdit::~TextEdit().
void Application::GetKeyboardConfig | ( | String * | pcKeymapName, |
int * | pnKeyDelay, | ||
int * | pnKeyRepeat | ||
) |
uint32 Application::GetQualifiers | ( | ) |
Sends a requester to the appserver to obtain the current state of keyboard qualifiers.
References os::Looper::Lock(), os::Application::Private::m_hReplyPort, os::Application::Private::m_hSrvAppPort, and os::Looper::Unlock().
Referenced by os::IconDirectoryView::MouseUp().
int Application::GetScreenModeCount | ( | ) |
int Application::GetScreenModeInfo | ( | int | nIndex, |
screen_mode * | psMode | ||
) |
References os::Message::AddInt32(), os::Message::FindFloat(), os::Message::FindInt(), os::Message::FindIPoint(), screen_mode::m_eColorSpace, os::Application::Private::m_hSrvAppPort, screen_mode::m_nBytesPerLine, screen_mode::m_nHeight, screen_mode::m_nWidth, screen_mode::m_vRefreshRate, os::Looper::Messenger, os::IPoint::x, and os::IPoint::y.
port_id Application::GetServerPort | ( | ) | const |
References os::Application::Private::m_hServerPort.
Referenced by os::Event::Event(), os::IconView::Private::GetViewFrame(), and os::Desktop::MinimizeAll().
|
virtual |
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(). 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(), |
Reimplemented from os::Handler.
References os::__set_default_color(), os::COL_COUNT, os::Message::FindColor32(), os::Message::GetCode(), os::Handler::HandleMessage(), and os::M_COLOR_CONFIG_CHANGED.
void Application::PopCursor | ( | ) |
References os::Application::Private::m_hSrvAppPort, and os::Looper::Messenger.
Referenced by os::TextEdit::MouseMove(), os_priv::SplitterSeparator::MouseMove(), and os::TextEdit::~TextEdit().
void Application::PushCursor | ( | mouse_ptr_mode | eMode, |
void * | pImage, | ||
int | nWidth, | ||
int | nHeight, | ||
const IPoint & | cHotSpot = IPoint(0,0) |
||
) |
void Application::RegisterKeyEvent | ( | const os::KeyboardEvent & | event | ) |
|
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.
Reimplemented from os::Looper.
References os::Looper::Unlock().
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).
References os::Application::Private::m_cLocale.
void Application::SetCatalog | ( | Catalog * | pcCatalog | ) |
This function sets the string catalog that is returned by GetCatalog().
References Resource::AddRef(), os::Looper::Lock(), os::Application::Private::m_pcCatalog, Resource::Release(), and os::Looper::Unlock().
Referenced by SetCatalog().
bool Application::SetCatalog | ( | const String & | cCatalogName | ) |
This function sets the string catalog that is returned by GetCatalog().
References os::String::c_str(), os::Locale::GetLocalizedCatalog(), os::Application::Private::m_cLocale, and SetCatalog().
status_t Application::SetKeyboardTimings | ( | int | nDelay, |
int | nRepeat | ||
) |
status_t Application::SetKeymap | ( | const char * | pzName | ) |
void Application::SetWindowDecorator | ( | const char * | pzPath | ) |
References os::Application::Private::m_hServerPort.
void Application::UnregisterKeyEvent | ( | const os::String & | cEvent | ) |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |