Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GApp Class Reference

Singleton class for handling application wide settings and methods. More...

#include <LgiClasses.h>

List of all members.

Public Member Functions

bool IsOk ()
 Returns true if the GApp object initialized correctly.
OsProcessId GetProcessId ()
 Returns this processes ID.
OsThreadId GetGuiThread ()
 Returns the thread currently running the active message loop.
 GApp (char *MimeType, OsAppArguments &AppArgs)
 Construct the object.
virtual ~GApp ()
 Destroys the object.
virtual void SetAppArgs (OsAppArguments &AppArgs)
 Resets the arguments.
virtual OsAppArguments * GetAppArgs ()
 Returns the arguemnts.
virtual char * GetArgumentAt (int n)
 Returns the n'th argument as a heap string. Free with DeleteArray(...).
virtual bool Run (bool Loop=true)
 Enters the message loop.
virtual void OnCommandLine ()
 Event called to process the command line.
virtual void OnReceiveFiles (List< char > &Files)
 Event called to process files dropped on the application.
virtual void Exit (int Code=0)
 Exits the event loop with the code specified.
bool GetOption (char *Option, GArray< char > &Buf)
 Parses the command line for a switch.
bool GetOption (char *Option, char *Dst=0, int DstSize=0)
 Parses the command line for a switch.
XmlTagGetConfig (char *Tag)
 Gets the application conf stored in lgi.conf.
void SetConfig (XmlTag *Tag)
 Sets a single tag in the config. (Not written to disk).
GViewGetFocus ()
 Gets the control with the keyboard focus.
bool GetFileMimeType (char *File, char *Mime, int BufLen)
 Gets the MIME type of a file.
int32 GetMetric (int Metric)
 Get a system metric.
GMouseHookGetMouseHook ()
 Get the mouse hook instance.

Static Public Member Functions

static GAppObjInstance ()
 Use 'LgiApp' to return a pointer to the GApp object.

Public Attributes

GFontSystemNormal
 The system font.
GFontSystemBold
 The system font in bold.
GWindowAppWnd
 Pointer to the applications main window.

Friends

class GView
class GMouseHook


Detailed Description

Singleton class for handling application wide settings and methods.

This should be the first class you create, passing in the arguments from the operating system. And once your initialization is complete the 'Run' method is called to enter the main application loop that processes messages for the life time of the application.


Constructor & Destructor Documentation

GApp::GApp char *  MimeType,
OsAppArguments &  AppArgs
 

Construct the object.

Parameters:
MimeType  The application's mime type. Typically 'application/x-[appname]'. This is mostly ignored on Win32 and Linux, but is useful on BeOS.
AppArgs  The arguments passed in by the OS.


Member Function Documentation

void GApp::Exit int  Code = 0  )  [virtual]
 

Exits the event loop with the code specified.

Parameters:
Code  The application exit code.

bool GApp::GetFileMimeType char *  File,
char *  Mime,
int  BufLen
 

Gets the MIME type of a file.

Parameters:
File  The file to identify
Mime  The detected MIME type.
BufLen  The size of Mime

int32 GApp::GetMetric int  Metric  ) 
 

Get a system metric.

Parameters:
Metric  One of LGI_MET_DECOR_X, LGI_MET_DECOR_Y

bool GApp::GetOption char *  Option,
char *  Dst = 0,
int  DstSize = 0
 

Parses the command line for a switch.

Returns:
true if the option exists.
Parameters:
Option  The option to look for.
Dest  The buffer to receive the value of the command line parameter or NULL if you don't care.
DestLen  The buffer size in bytes

bool GApp::GetOption char *  Option,
GArray< char > &  Buf
 

Parses the command line for a switch.

Returns:
true if the option exists.
Parameters:
Option  The option to look for.
Buf  The buffer to receive the value.

bool GApp::Run bool  Loop = true  )  [virtual]
 

Enters the message loop.

Parameters:
Loop  If true this function will return when the application exits (with LgiCloseApp()). Otherwise if false only pending events will be processed and then the function returns.


The documentation for this class was generated from the following files:
Generated on Wed Oct 26 14:46:55 2005 for Lgi by  doxygen 1.4.1