#include <OSDLBasic.h>
Collaboration diagram for OSDL::CommonModule:
From this common module, all other modules can be triggered.
Definition at line 95 of file OSDLBasic.h.
Public Types | |
typedef Ceylan::Sint32 | BackendReturnCode |
Data type of back-end return code :. | |
Public Member Functions | |
virtual bool | hasVideoModule () const throw () |
Tells whether a video module is available. | |
virtual Video::VideoModule & | getVideoModule () const throw ( OSDL::Exception ) |
Returns current video module. | |
virtual bool | hasEventsModule () const throw () |
Tells whether a video module is available. | |
virtual Events::EventsModule & | getEventsModule () const throw ( OSDL::Exception ) |
Returns current events module. | |
virtual bool | hasAudioModule () const throw () |
Tells whether a video module is available. | |
virtual Audio::AudioModule & | getAudioModule () const throw ( OSDL::Exception ) |
Returns current audio module. | |
virtual Ceylan::Flags | getFlags () const throw () |
Returns flags used for this common module. | |
virtual bool | hasCDROMDriveHandler () const throw () |
Tells whether a CD-ROM drive handler is available. | |
virtual CDROMDriveHandler & | getCDROMDriveHandler () const throw ( OSDL::Exception ) |
Returns current CD-ROM handler. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw () |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static std::string | InterpretFlags (Ceylan::Flags flags) throw () |
Describes specified top-level flags used to initialize the SDL back-end. | |
static std::string | DescribeEnvironmentVariables () throw () |
Returns a summary about the possible use of general-purpose* environment variables, for the selected back-end, expressed in specified format. | |
static bool | IsBackendInitialized () throw () |
Static Public Attributes | |
static const BackendReturnCode | BackendSuccess |
Exported logical value for back-end success. | |
static const BackendReturnCode | BackendError |
Exported logical value for back-end success/. | |
static const Ceylan::Flags | UseTimer |
Initializes the timer subsystem. | |
static const Ceylan::Flags | UseAudio |
Initializes the audio subsystem. | |
static const Ceylan::Flags | UseVideo |
Initializes the video subsystem. | |
static const Ceylan::Flags | UseCDROM |
Initializes the CD-ROM subsystem. | |
static const Ceylan::Flags | UseJoystick |
Initializes the joystick subsystem, implies initializing the video (UseVideo). | |
static const Ceylan::Flags | UseKeyboard |
Initializes the keyboard subsystem, implies initializing the video (UseVideo). | |
static const Ceylan::Flags | UseMouse |
Initializes the mouse subsystem, implies initializing the video (UseVideo). | |
static const Ceylan::Flags | UseEverything |
Initializes all above subsystems. | |
static const Ceylan::Flags | NoParachute |
Do not catch fatal signals. | |
static const Ceylan::Flags | UseEventThread |
Initializes the event thread. | |
Static Protected Member Functions | |
static Ceylan::Flags | AutoCorrectFlags (Ceylan::Flags inputFlags) throw () |
Corrects the input flags, formatted as parameters used to create the common module, so that they can be retain directly, without further change. | |
Protected Attributes | |
Video::VideoModule * | _video |
Pointer to the current video module used, if any. | |
Events::EventsModule * | _events |
Pointer to the current events module used, if any. | |
Audio::AudioModule * | _audio |
Pointer to the current video module used, if any. | |
Ceylan::Flags | _flags |
Flags used for this common module. | |
CDROMDriveHandler * | _cdromHandler |
Pointer to the current CD-ROM drive handler used, if any. | |
Static Protected Attributes | |
static bool | _BackendInitialized |
Tells whether the back-end used by OSDL is initialized. | |
static CommonModule * | _CurrentCommonModule |
The common module being currently used, if any. | |
static std::string | _SDLEnvironmentVariables [] |
Array of all known general purpose environment variables, for SDL back-end. | |
Private Member Functions | |
CommonModule (Ceylan::Flags flags) throw ( OSDL::Exception ) | |
Initializes OSDL system common module. | |
virtual | ~CommonModule () throw () |
Stops OSDL system common module. | |
Friends | |
OSDL_DLL friend CommonModule & | getCommonModule (Ceylan::Flags flags) throw () |
This friend function is intended to be the initial means of getting a reference to the common module : this is the entry point to the whole OSDL system. | |
OSDL_DLL friend bool | hasExistingCommonModule () throw () |
Tells whether there already exists a common module. | |
OSDL_DLL friend CommonModule & | getExistingCommonModule () throw () |
This friend function is intended to be the usual means of getting a reference to the common module, which must already exist. | |
OSDL_DLL friend void | stop () throw () |
This friend function allows to shutdown all OSDL services. |
typedef Ceylan::Sint32 OSDL::CommonModule::BackendReturnCode |
OSDL::CommonModule::CommonModule | ( | Ceylan::Flags | flags | ) | throw ( OSDL::Exception ) [explicit, private] |
Initializes OSDL system common module.
flags | parameters to initialize SDL. |
CommonModule::~CommonModule | ( | ) | throw () [private, virtual] |
Stops OSDL system common module.
Definition at line 228 of file OSDLBasic.cc.
References _audio, _cdromHandler, _events, and _video.
bool CommonModule::hasVideoModule | ( | ) | const throw () [virtual] |
Tells whether a video module is available.
Definition at line 337 of file OSDLBasic.cc.
References _video.
Referenced by OSDL::Video::VideoModule::GetAntiAliasingState(), OSDL::Video::VideoModule::GetEndPointDrawState(), OSDL::Video::VideoModule::IsDisplayInitialized(), and OSDL::Video::Overlay::Overlay().
Video::VideoModule & CommonModule::getVideoModule | ( | ) | const throw ( OSDL::Exception ) [virtual] |
Returns current video module.
OSDL::Exception | is not video module is available. |
Definition at line 343 of file OSDLBasic.cc.
References _video.
Referenced by OSDL::Events::EventsModule::enterBasicMainLoop(), OSDL::Video::VideoModule::GetAntiAliasingState(), OSDL::Video::VideoModule::GetEndPointDrawState(), OSDL::Video::VideoModule::IsDisplayInitialized(), OSDL::Events::EventsModule::onResizedWindow(), OSDL::Events::EventsModule::onScreenNeedsRedraw(), OSDL::Video::Overlay::Overlay(), and OSDL::Engine::Scheduler::schedule().
bool CommonModule::hasEventsModule | ( | ) | const throw () [virtual] |
Tells whether a video module is available.
Definition at line 357 of file OSDLBasic.cc.
References _events.
Events::EventsModule & CommonModule::getEventsModule | ( | ) | const throw ( OSDL::Exception ) [virtual] |
Returns current events module.
OSDL::Exception | is not events module is available. |
Definition at line 363 of file OSDLBasic.cc.
References _events.
Referenced by OSDL::Engine::Scheduler::schedule().
bool CommonModule::hasAudioModule | ( | ) | const throw () [virtual] |
Tells whether a video module is available.
Definition at line 377 of file OSDLBasic.cc.
References _audio.
Audio::AudioModule & CommonModule::getAudioModule | ( | ) | const throw ( OSDL::Exception ) [virtual] |
Returns current audio module.
OSDL::Exception | is not audio module is available. |
Definition at line 383 of file OSDLBasic.cc.
References _audio.
Flags CommonModule::getFlags | ( | ) | const throw () [virtual] |
Returns flags used for this common module.
Definition at line 397 of file OSDLBasic.cc.
References _flags.
bool CommonModule::hasCDROMDriveHandler | ( | ) | const throw () [virtual] |
Tells whether a CD-ROM drive handler is available.
Definition at line 404 of file OSDLBasic.cc.
References _cdromHandler.
CDROMDriveHandler & CommonModule::getCDROMDriveHandler | ( | ) | const throw ( OSDL::Exception ) [virtual] |
Returns current CD-ROM handler.
OSDL::Exception | is not CD-ROM handler is available. |
Definition at line 410 of file OSDLBasic.cc.
References _cdromHandler.
const string CommonModule::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const throw () [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Definition at line 423 of file OSDLBasic.cc.
References OSDL::GetVersion(), and OSDL::Video::Pixels::toString().
static std::string OSDL::CommonModule::InterpretFlags | ( | Ceylan::Flags | flags | ) | throw () [static] |
Describes specified top-level flags used to initialize the SDL back-end.
flags |
string CommonModule::DescribeEnvironmentVariables | ( | ) | throw () [static] |
Returns a summary about the possible use of general-purpose* environment variables, for the selected back-end, expressed in specified format.
Definition at line 485 of file OSDLBasic.cc.
References _SDLEnvironmentVariables, and OSDL::Video::Pixels::toString().
bool CommonModule::IsBackendInitialized | ( | ) | throw () [static] |
Definition at line 537 of file OSDLBasic.cc.
References _BackendInitialized.
Referenced by OSDL::Events::EventsModule::enterMainLoop(), and OSDL::Events::EventsModule::GetMillisecondsSinceStartup().
static Ceylan::Flags OSDL::CommonModule::AutoCorrectFlags | ( | Ceylan::Flags | inputFlags | ) | throw () [static, protected] |
Corrects the input flags, formatted as parameters used to create the common module, so that they can be retain directly, without further change.
For example, if an event source such as a joystick is selected, then the video module must be activated, even if not explicitly selected, otherwise no event at all will be available. Thus the method will fix the flags so that they are consistent.
Referenced by OSDL::getCommonModule().
OSDL_DLL friend CommonModule& getCommonModule | ( | Ceylan::Flags | flags | ) | throw () [friend] |
This friend function is intended to be the initial means of getting a reference to the common module : this is the entry point to the whole OSDL system.
flags | The requested flags for this common root module, any OR'd combination of CommonModule static flags, so that associated subsystems are instanciated. |
This method is not static to avoid pitfalls of static initializer ordering.
OSDL_DLL friend bool hasExistingCommonModule | ( | ) | throw () [friend] |
OSDL_DLL friend CommonModule& getExistingCommonModule | ( | ) | throw () [friend] |
This friend function is intended to be the usual means of getting a reference to the common module, which must already exist.
If not, a fatal error will be triggered (not an exception to avoid handling it in all user methods).
Definition at line 664 of file OSDLBasic.cc.
OSDL_DLL friend void stop | ( | ) | throw () [friend] |
This friend function allows to shutdown all OSDL services.
Definition at line 676 of file OSDLBasic.cc.
const CommonModule::BackendReturnCode CommonModule::BackendSuccess [static] |
Exported logical value for back-end success.
Definition at line 164 of file OSDLBasic.h.
Referenced by OSDL::Audio::AudioModule::AudioModule(), OSDL::CDROMDriveHandler::CDROMDriveHandler(), and OSDL::Video::VideoModule::VideoModule().
const CommonModule::BackendReturnCode CommonModule::BackendError [static] |
Exported logical value for back-end success/.
Prefer only testing against SDLSuccess : if ( [...] != BackendSuccess ) ...
Definition at line 174 of file OSDLBasic.h.
const Ceylan::Flags CommonModule::UseTimer [static] |
const Ceylan::Flags CommonModule::UseAudio [static] |
Initializes the audio subsystem.
Definition at line 309 of file OSDLBasic.h.
Referenced by OSDL::Audio::AudioModule::AudioModule(), and OSDL::Audio::AudioModule::~AudioModule().
const Ceylan::Flags CommonModule::UseVideo [static] |
Initializes the video subsystem.
Definition at line 312 of file OSDLBasic.h.
Referenced by OSDL::Video::VideoModule::VideoModule(), and OSDL::Video::VideoModule::~VideoModule().
const Ceylan::Flags CommonModule::UseCDROM [static] |
Initializes the CD-ROM subsystem.
Definition at line 315 of file OSDLBasic.h.
Referenced by OSDL::CDROMDriveHandler::CDROMDriveHandler(), and OSDL::CDROMDriveHandler::~CDROMDriveHandler().
const Ceylan::Flags CommonModule::UseJoystick [static] |
Initializes the joystick subsystem, implies initializing the video (UseVideo).
Definition at line 323 of file OSDLBasic.h.
Referenced by OSDL::Events::JoystickHandler::~JoystickHandler().
const Ceylan::Flags CommonModule::UseKeyboard [static] |
Initializes the keyboard subsystem, implies initializing the video (UseVideo).
Definition at line 331 of file OSDLBasic.h.
const Ceylan::Flags CommonModule::UseMouse [static] |
Initializes the mouse subsystem, implies initializing the video (UseVideo).
Definition at line 339 of file OSDLBasic.h.
const Ceylan::Flags CommonModule::UseEverything [static] |
const Ceylan::Flags CommonModule::NoParachute [static] |
Do not catch fatal signals.
By default fatal signals are caught, so that if your program crashes, the resulting exception will be intercepted in order to clean up and return the display to a usable state.
However this system does not behave nicely with debuggers, so it might be disabled (mostly for debugging purpose) with this flag.
Definition at line 366 of file OSDLBasic.h.
const Ceylan::Flags CommonModule::UseEventThread [static] |
Video::VideoModule* OSDL::CommonModule::_video [protected] |
Pointer to the current video module used, if any.
Definition at line 395 of file OSDLBasic.h.
Referenced by getVideoModule(), hasVideoModule(), and ~CommonModule().
Events::EventsModule* OSDL::CommonModule::_events [protected] |
Pointer to the current events module used, if any.
Definition at line 398 of file OSDLBasic.h.
Referenced by getEventsModule(), hasEventsModule(), and ~CommonModule().
Audio::AudioModule* OSDL::CommonModule::_audio [protected] |
Pointer to the current video module used, if any.
Definition at line 401 of file OSDLBasic.h.
Referenced by getAudioModule(), hasAudioModule(), and ~CommonModule().
Ceylan::Flags OSDL::CommonModule::_flags [protected] |
Flags used for this common module.
Definition at line 404 of file OSDLBasic.h.
Referenced by getFlags().
CDROMDriveHandler* OSDL::CommonModule::_cdromHandler [protected] |
Pointer to the current CD-ROM drive handler used, if any.
Definition at line 407 of file OSDLBasic.h.
Referenced by getCDROMDriveHandler(), hasCDROMDriveHandler(), and ~CommonModule().
bool CommonModule::_BackendInitialized [static, protected] |
Tells whether the back-end used by OSDL is initialized.
Definition at line 414 of file OSDLBasic.h.
Referenced by IsBackendInitialized().
CommonModule * CommonModule::_CurrentCommonModule [static, protected] |
The common module being currently used, if any.
Definition at line 417 of file OSDLBasic.h.
Referenced by OSDL::getCommonModule(), OSDL::getExistingCommonModule(), OSDL::hasExistingCommonModule(), and OSDL::stop().
string CommonModule::_SDLEnvironmentVariables [static, protected] |
Array of all known general purpose environment variables, for SDL back-end.
Definition at line 425 of file OSDLBasic.h.
Referenced by DescribeEnvironmentVariables().