Adonthell  0.4
win_base Class Reference

Common properties for each win_base's object. More...

#include <win_base.h>

Inheritance diagram for win_base:
Collaboration diagram for win_base:

Public Member Functions

 win_base ()
 Default constructor: More...
 
s_int16 x () const
 Return the relative horizontal position of the win_*. More...
 
s_int16 y () const
 Return the relative vertical position of the win_*. More...
 
s_int16pad_x ()
 Return the pad horizontal position of the win_*. More...
 
s_int16pad_y ()
 Return the pad vertical position of the win_*. More...
 
s_int16 real_x () const
 Return the horizontal position of the win_*. More...
 
s_int16 real_y () const
 Return the vertical position of the win_*. More...
 
virtual void move (s_int16 tx, s_int16 ty)
 Move the win_*. More...
 
virtual void resize (u_int16 tl, u_int16 th)
 Rezise the win_*. More...
 
bool is_visible () const
 Test if win_* is visible. More...
 
void set_visible (const bool b)
 Set the visible parameter. More...
 
bool is_activate () const
 Test if win_* is activated. More...
 
void set_activate (const bool b)
 Set the activate parameter When a win_* is setup on, the keys queue is cleared. More...
 
bool is_focus () const
 Test if win_* has focus on. More...
 
void set_focus (const bool b)
 Set the focus parameter. More...
 
bool is_trans () const
 Test if win_* has focus on. More...
 
virtual void set_trans (const bool b)
 Set the transluency parameter. More...
 
bool is_brightness () const
 Test if win_* is in brightness. More...
 
virtual void set_brightness (const bool b)
 Set the transluency parameter. More...
 
void set_align (const u_int8 a)
 Set alignement of win_*. More...
 
u_int8 align () const
 Return alignment of win_*. More...
 
bool is_can_be_selected () const
 Test if win_* can be selected. More...
 
void set_can_be_selected (const bool b)
 Set the object to be selected A win_obj can be selectable or not when it is inside a win_select. More...
 
virtual bool update ()
 Update process. More...
 
virtual bool draw ()
 Draw process. More...
 
virtual bool input_update ()
 Input Update process . More...
 
void set_manager (win_manager *)
 
- Public Member Functions inherited from win_event
void set_return_code (int rc)
 
void set_signal_connect (const Functor0 &func, u_int8 signal)
 
void set_callback_destroy (const Functor0wRet< bool > &func)
 
void set_callback_quit (const Functor1< int > &func)
 
bool update ()
 
void py_signal_connect (PyObject *pyfunc, int signal, PyObject *args=NULL)
 
- Public Member Functions inherited from win_border
 win_border (win_base *wb)
 
 win_border (win_border &)
 
 win_border (char *rep, const char *size=WIN_BORDER_NORMAL_SIZE)
 
void load (char *, const char *)
 
void update ()
 
void destroy ()
 
void draw (drawing_area *da)
 
void set_visible_border (bool b)
 
void set_brightness_border (bool b)
 
void set_border (win_border &)
 
void set_border (win_theme &wth, u_int8 size=win_border::NORMAL)
 
void set_trans_border (bool b)
 
u_int16 length_border ()
 
u_int16 height_border ()
 
- Public Member Functions inherited from drawing_area
 drawing_area ()
 Default constructor. More...
 
 drawing_area (s_int16 px, s_int16 py, u_int16 pw, u_int16 ph)
 Builds a drawing_area from the parameters. More...
 
s_int16 x () const
 Returns the horizontal position of the drawing_area. More...
 
s_int16 y () const
 Returns the vertical position of the drawing_area. More...
 
u_int16 length () const
 Returns the length of the drawing_area. More...
 
u_int16 height () const
 Returns the height of the drawing_area. More...
 
void move (s_int16 nx, s_int16 ny)
 Move the drawing_area. More...
 
void resize (u_int16 nl, u_int16 nh)
 Resize the drawing_area. More...
 
void assign_drawing_area (const drawing_area *da)
 Assign a drawing_area to this drawing_area. More...
 
drawing_areaassigned_drawing_area () const
 Returns a pointer to the drawing_area assigned to this one. More...
 
void detach_drawing_area ()
 Detach (if needed) the drawing_area which was attached to this one. More...
 
drawing_areaoperator= (SDL_Rect &r)
 Convert an SDL_Rect into a drawing_area. More...
 
SDL_Rect setup_rects () const
 Gets the real parameters of this drawing_area. More...
 
- Public Member Functions inherited from win_background
 win_background (win_base *)
 
 win_background (win_background &)
 
 win_background (char *rep)
 
void load (char *)
 
void update ()
 
void destroy ()
 
void draw (drawing_area *da=NULL)
 
void set_visible_background (bool b)
 
void set_background (win_background &)
 
void set_background (win_theme &wt)
 
void set_brightness_background (bool b)
 
void set_trans_background (bool b)
 

Static Public Attributes

static const u_int8 ALIGN_NONE = 0
 
static const u_int8 ALIGN_LEFT = 1
 
static const u_int8 ALIGN_CENTER = 2
 
static const u_int8 ALIGN_RIGHT = 3
 
- Static Public Attributes inherited from win_event
static const u_int8 ACTIVATE =1
 
static const u_int8 UNACTIVATE = 2
 
static const u_int8 UPDATE = 3
 
static const u_int8 DRAW = 4
 
static const u_int8 DRAW_ON_VISIBLE = 5
 
static const u_int8 ACTIVATE_KEY = 6
 
static const u_int8 SELECT = 7
 
static const u_int8 UNSELECT = 8
 
static const u_int8 KEYBOARD = 9
 
static const u_int8 SCROLL_UP = 10
 
static const u_int8 SCROLL_DOWN = 11
 
static const u_int8 NEXT = 12
 
static const u_int8 PREVIOUS = 13
 
static const u_int8 CLOSE = 14
 
static const u_int8 DESTROY = 15
 
- Static Public Attributes inherited from win_border
static const u_int8 MINI = 0
 
static const u_int8 NORMAL = 1
 

Protected Member Functions

virtual void update_position ()
 
void update_align ()
 
void set_container (win_container *wc)
 
- Protected Member Functions inherited from win_event
virtual void on_activate ()
 
virtual void on_unactivate ()
 
virtual void on_update ()
 
virtual void on_draw_visible ()
 
virtual void on_draw ()
 
virtual void on_activate_key ()
 
virtual void on_select ()
 
virtual void on_unselect ()
 
virtual void on_up ()
 
virtual void on_down ()
 
virtual void on_next ()
 
virtual void on_previous ()
 

Protected Attributes

s_int16 x_
 
s_int16 y_
 
s_int16 pad_x_
 
s_int16 pad_y_
 
u_int8 align_
 
bool visible_
 
bool focus_
 
bool activate_
 
bool brightness_
 
bool trans_
 
bool can_be_selected_
 
win_containerwb_father_
 
win_managermanager_
 
- Protected Attributes inherited from win_event
vector< py_callback * > py_callbacks
 
Functor0 callback_ [20]
 
Functor0wRet< bool > callback_destroy_
 
Functor1< int > callback_quit_
 
int return_code_
 

Friends

class win_container
 
class win_scroll
 
class win_select
 

Detailed Description

Common properties for each win_base's object.

Bug:
It's currently impossible to render a windowed object anywhere else than the screen. Windows should be capable of being assigned a target parameter, which is a pointer to the surface they should be drawn.

Definition at line 51 of file win_base.h.

Constructor & Destructor Documentation

◆ win_base()

win_base::win_base ( )

Default constructor:

  • not visible
  • x,y equals to 0
  • not focus
  • not activate
  • not brightness
  • not transluency
  • can be selected
  • alignement is ALIGN_NONE

Definition at line 24 of file win_base.cc.

Member Function Documentation

◆ x()

s_int16 win_base::x ( ) const
inline

Return the relative horizontal position of the win_*.

Returns
horizontal position of the win_*.

Definition at line 72 of file win_base.h.

◆ y()

s_int16 win_base::y ( ) const
inline

Return the relative vertical position of the win_*.

Returns
vertical position of the win_*.

Definition at line 80 of file win_base.h.

◆ pad_x()

s_int16& win_base::pad_x ( )
inline

Return the pad horizontal position of the win_*.

Returns
the pad horizontal position of the win_*.

Definition at line 88 of file win_base.h.

◆ pad_y()

s_int16& win_base::pad_y ( )
inline

Return the pad vertical position of the win_*.

Returns
the pad vertical position of the win_*.

Definition at line 96 of file win_base.h.

◆ real_x()

s_int16 win_base::real_x ( ) const
inline

Return the horizontal position of the win_*.

Returns
the horizontal position of the win_*.

Definition at line 104 of file win_base.h.

◆ real_y()

s_int16 win_base::real_y ( ) const
inline

Return the vertical position of the win_*.

Returns
the vertical position of the win_*.

Definition at line 112 of file win_base.h.

◆ move()

void win_base::move ( s_int16  tx,
s_int16  ty 
)
virtual

Move the win_*.

Parameters
txnew horizontal position.
tynew vertical position.

Reimplemented in win_container.

Definition at line 75 of file win_base.cc.

◆ resize()

void win_base::resize ( u_int16  tl,
u_int16  th 
)
virtual

Rezise the win_*.

Parameters
tlnew horizontal position.
thnew vertical position.

Reimplemented in win_scroll, and win_container.

Definition at line 85 of file win_base.cc.

◆ is_visible()

bool win_base::is_visible ( ) const
inline

Test if win_* is visible.

Returns
true if visible else false

Definition at line 133 of file win_base.h.

◆ set_visible()

void win_base::set_visible ( const bool  b)
inline

Set the visible parameter.

Parameters
btrue if the win_* should be visible, false otherwise

Definition at line 140 of file win_base.h.

◆ is_activate()

bool win_base::is_activate ( ) const
inline

Test if win_* is activated.

Returns
true if activate else false

Definition at line 147 of file win_base.h.

◆ set_activate()

void win_base::set_activate ( const bool  b)
inline

Set the activate parameter When a win_* is setup on, the keys queue is cleared.

Parameters
btrue if the win_* should be visible, false otherwise

Definition at line 156 of file win_base.h.

◆ is_focus()

bool win_base::is_focus ( ) const
inline

Test if win_* has focus on.

Returns
true if focus on else false

Definition at line 163 of file win_base.h.

◆ set_focus()

void win_base::set_focus ( const bool  b)
inline

Set the focus parameter.

Parameters
btrue if the win_* should be focus on, false otherwise

Definition at line 170 of file win_base.h.

◆ is_trans()

bool win_base::is_trans ( ) const
inline

Test if win_* has focus on.

Returns
true if focus on else false

Definition at line 177 of file win_base.h.

◆ set_trans()

virtual void win_base::set_trans ( const bool  b)
inlinevirtual

Set the transluency parameter.

Parameters
btrue if the win_* should be ins transluency, false otherwise

Reimplemented in win_scroll, win_container, win_object< T >, and win_object< mapview >.

Definition at line 184 of file win_base.h.

◆ is_brightness()

bool win_base::is_brightness ( ) const
inline

Test if win_* is in brightness.

Returns
true if in brightness else false

Definition at line 191 of file win_base.h.

◆ set_brightness()

virtual void win_base::set_brightness ( const bool  b)
inlinevirtual

Set the transluency parameter.

Parameters
btrue if the win_* should be in transluency, false otherwise

Reimplemented in win_scroll, win_container, win_object< T >, and win_object< mapview >.

Definition at line 198 of file win_base.h.

◆ set_align()

void win_base::set_align ( const u_int8  a)
inline

Set alignement of win_*.

Parameters
acan be, ALIGN_NONE, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT

Definition at line 205 of file win_base.h.

◆ align()

u_int8 win_base::align ( ) const
inline

Return alignment of win_*.

Returns
align_ parameter

Definition at line 212 of file win_base.h.

◆ is_can_be_selected()

bool win_base::is_can_be_selected ( ) const
inline

Test if win_* can be selected.

Returns
true if it can be selected, false otherwise

Definition at line 218 of file win_base.h.

◆ set_can_be_selected()

void win_base::set_can_be_selected ( const bool  b)
inline

Set the object to be selected A win_obj can be selectable or not when it is inside a win_select.

Parameters
btrue if the object can be selected inside a win_select., false otherwise

Definition at line 226 of file win_base.h.

◆ update()

bool win_base::update ( )
virtual

Update process.

Returns
true if update is successful, false otherwise

Reimplemented in dialog_screen, text_bubble, data_screen, win_select, win_container, win_scroll, win_object< T >, and win_object< mapview >.

Definition at line 94 of file win_base.cc.

◆ draw()

bool win_base::draw ( )
virtual

Draw process.

Returns
true if draw is successful, false otherwise

Reimplemented in win_container, win_scroll, win_object< T >, and win_object< mapview >.

Definition at line 111 of file win_base.cc.

◆ input_update()

bool win_base::input_update ( )
virtual

Input Update process .

Reimplemented in win_container, win_scroll, win_object< T >, win_object< mapview >, and win_select.

Definition at line 106 of file win_base.cc.


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