zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Window Class Reference

The Window Management Singleton. More...

#include <Window.h>

Inherits Zeni::Singleton< Window >.

Public Types

enum  Mouse_State {
  MOUSE_NORMAL, MOUSE_GRABBED = 1, MOUSE_HIDDEN = 2, MOUSE_GRABBED_AND_HIDDEN = 3,
  MOUSE_RELATIVE = 7
}
 

Public Member Functions

void alert_window_resized (const Point2i &resolution)
 Tell Window that it has been resized. More...
 
Mouse_State get_mouse_state () const
 Find out if the mouse cursor is grabbed/hidden/relative. More...
 
const std::vector< Point2i > & get_resolutions () const
 Get available full screen resolutions. More...
 
const Stringget_taskmsg () const
 Get the taskbar message. More...
 
const Stringget_title () const
 Get the window title. More...
 
void set_mouse_state (const Mouse_State &mouse_state)
 
- Public Member Functions inherited from Zeni::Singleton< Window >
void fax_post_reinit (Event::Handler *const &handler)
 
void fax_pre_uninit (Event::Handler *const &handler)
 
void give_post_reinit (Event::Handler *const &handler)
 
void give_pre_uninit (Event::Handler *const &handler)
 
void lend_post_reinit (Event::Handler *const &handler)
 
void lend_pre_uninit (Event::Handler *const &handler)
 

Static Public Member Functions

static const intget_height ()
 Get the height of the window. More...
 
static const bool & get_opengl_flag ()
 
static const Point2iget_size ()
 
static const intget_width ()
 Get the size of the window. More...
 
static const bool & is_enabled ()
 Determine whether the use of rendering is desired. More...
 
static const bool & is_frame_visible ()
 Determine whether the frame is visible (windowed only) More...
 
static const bool & is_full_screen ()
 Determine whether the window is windowed or full screen. More...
 
static const bool & is_resizable ()
 Determine whether the frame is resizable (windowed only) More...
 
static void preinit_from_xml (const XML_Element_c &video)
 Set rendering options from an XML data structure. More...
 
static void preinit_full_screen (const bool &full_screen=false)
 Set the rendering window to be full screen at launch. More...
 
static void preinit_resizable (const bool &resizable_=true)
 Allow the frame to be dynamically resized when in windows mode. More...
 
static void preinit_resolution (const Point2i &resolution=Point2i(800, 600))
 Set the rendering window to have a given resolution. More...
 
static void preinit_show_frame (const bool &show_frame_=true)
 Show a frame around the rendering window when in windowed mode. More...
 
static void set_enabled (const bool &enabled)
 Enable/Disable the use of rendering; This will not close the rendering window once it is open. More...
 
static void set_failsafe_defaults ()
 Set failsafe default options. More...
 
static bool set_icon (const String &filename)
 Set the window icon. More...
 
static void set_opengl_flag (const bool &on=true)
 
static void set_taskmsg (const String &taskmsg)
 Set the taskbar message. More...
 
static void set_title (const String &title)
 Set the window title. More...
 
static void set_tt (const String &title, const String &taskmsg)
 Set the window title and taskbar message. More...
 
- Static Public Member Functions inherited from Zeni::Singleton< Window >
static void completely_destroy ()
 
static void destroy ()
 
static Windowget ()
 
static bool is_initialized ()
 
static void remove_post_reinit (Event::Handler *const &handler)
 
static void remove_pre_uninit (Event::Handler *const &handler)
 

Protected Member Functions

 Window ()
 
 ~Window ()
 
SDL_Surfaceget_display_surface ()
 
- Protected Member Functions inherited from Zeni::Singleton< Window >
 Singleton ()
 
virtual ~Singleton ()
 

Friends

class Singleton< Window >
 

Detailed Description

The Window Management Singleton.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 53 of file Window.h.

Member Enumeration Documentation

Enumerator
MOUSE_NORMAL 
MOUSE_GRABBED 
MOUSE_HIDDEN 
MOUSE_GRABBED_AND_HIDDEN 
MOUSE_RELATIVE 

Definition at line 98 of file Window.h.

Constructor & Destructor Documentation

Member Function Documentation

SDL_Surface * Zeni::Window::get_display_surface ( )
inlineprotected

Definition at line 75 of file Window.hxx.

const int & Zeni::Window::get_height ( )
inlinestatic

Get the height of the window.

Definition at line 37 of file Window.hxx.

References Zeni::Point2i::y.

Referenced by android_main(), Zeni::Video::change_resolution(), Zeni::Game::run(), and Zeni::Video::save().

Window::Mouse_State Zeni::Window::get_mouse_state ( ) const
const bool & Zeni::Window::get_opengl_flag ( )
static

Definition at line 429 of file Window.cpp.

const std::vector< Point2i > & Zeni::Window::get_resolutions ( ) const
inline

Get available full screen resolutions.

Definition at line 66 of file Window.hxx.

const String & Zeni::Window::get_taskmsg ( ) const
inline

Get the taskbar message.

Definition at line 84 of file Window.hxx.

const String & Zeni::Window::get_title ( ) const
inline

Get the window title.

Definition at line 80 of file Window.hxx.

const int & Zeni::Window::get_width ( )
inlinestatic

Get the size of the window.

Get the width of the window

Definition at line 33 of file Window.hxx.

References Zeni::Point2i::x.

Referenced by android_main(), Zeni::Video::change_resolution(), Zeni::Game::run(), and Zeni::Video::save().

const bool & Zeni::Window::is_enabled ( )
inlinestatic

Determine whether the use of rendering is desired.

Definition at line 25 of file Window.hxx.

Referenced by engine_draw_frame(), and main2().

const bool & Zeni::Window::is_frame_visible ( )
inlinestatic

Determine whether the frame is visible (windowed only)

Definition at line 58 of file Window.hxx.

const bool & Zeni::Window::is_full_screen ( )
inlinestatic

Determine whether the window is windowed or full screen.

Definition at line 54 of file Window.hxx.

Referenced by Zeni::Video::save().

const bool & Zeni::Window::is_resizable ( )
inlinestatic

Determine whether the frame is resizable (windowed only)

Definition at line 62 of file Window.hxx.

void Zeni::Window::preinit_from_xml ( const XML_Element_c video)
static

Set rendering options from an XML data structure.

Definition at line 417 of file Window.cpp.

References preinit_full_screen(), and preinit_resolution().

Referenced by Zeni::Video::preinit_from_file().

void Zeni::Window::preinit_full_screen ( const bool &  full_screen = false)
static

Set the rendering window to be full screen at launch.

Definition at line 405 of file Window.cpp.

Referenced by load_config(), and preinit_from_xml().

void Zeni::Window::preinit_resizable ( const bool &  resizable_ = true)
static

Allow the frame to be dynamically resized when in windows mode.

Definition at line 413 of file Window.cpp.

void Zeni::Window::preinit_resolution ( const Point2i resolution = Point2i(800, 600))
static

Set the rendering window to have a given resolution.

Definition at line 401 of file Window.cpp.

Referenced by load_config(), and preinit_from_xml().

void Zeni::Window::preinit_show_frame ( const bool &  show_frame_ = true)
static

Show a frame around the rendering window when in windowed mode.

Definition at line 409 of file Window.cpp.

Referenced by load_config().

void Zeni::Window::set_enabled ( const bool &  enabled)
static

Enable/Disable the use of rendering; This will not close the rendering window once it is open.

Definition at line 396 of file Window.cpp.

Referenced by engine_handle_cmd(), engine_term_display(), and load_config().

void Zeni::Window::set_failsafe_defaults ( )
static

Set failsafe default options.

Definition at line 423 of file Window.cpp.

References FAILSAFE_SCREEN_HEIGHT, FAILSAFE_SCREEN_WIDTH, Zeni::Point2i::x, and Zeni::Point2i::y.

Referenced by Zeni::Video::set_failsafe_defaults().

bool Zeni::Window::set_icon ( const String filename)
static

Set the window icon.

Definition at line 459 of file Window.cpp.

References sort_controllers::filename, Zeni::Singleton< Window >::is_initialized(), and set_icon().

Referenced by alert_window_resized(), and set_icon().

void Zeni::Window::set_opengl_flag ( const bool &  on = true)
static

Definition at line 433 of file Window.cpp.

void Zeni::Window::set_taskmsg ( const String taskmsg)
static

Set the taskbar message.

Definition at line 452 of file Window.cpp.

References Zeni::Singleton< Window >::is_initialized(), and set_tt().

void Zeni::Window::set_title ( const String title)
static
void Zeni::Window::set_tt ( const String title,
const String taskmsg 
)
static

Set the window title and taskbar message.

Definition at line 437 of file Window.cpp.

References Zeni::Singleton< Window >::is_initialized(), and set_tt().

Referenced by alert_window_resized(), set_taskmsg(), set_title(), and set_tt().

Friends And Related Function Documentation

friend class Singleton< Window >
friend

Definition at line 54 of file Window.h.


The documentation for this class was generated from the following files: