Adonthell  0.4
label Class Reference
Inheritance diagram for label:
Collaboration diagram for label:

Classes

struct  Scursor
 
struct  Sline_text
 

Public Member Functions

 label ()
 Constructor by default, cursor is not moveable, cursor is not visible, and the form is set as NOTHING, the default size is (0, 0) More...
 
 ~label ()
 Destructor. More...
 
void set_font (win_font &font)
 Set the font. More...
 
void set_text (const string &text)
 Set the text. More...
 
void add_text (const string &text)
 Add text. More...
 
void set_form (const u_int8 form)
 Set the form of the display NOTHING, AUTO_SIZE, AUTO_HEIGHT. More...
 
void set_cursor_visible (const bool b)
 Set visible cursor. More...
 
void set_cursor_moveable (const bool b)
 Set if the cursor can be moved with arrow key. More...
 
bool update ()
 Update the label. More...
 
bool input_update ()
 Update input label, you can move the cursor if the cursor is moveable. More...
 
const string text_string () const
 Get the text in string. More...
 
const char * text_char () const
 Get the text in char. More...
 
void resize (u_int16 l, u_int16 h)
 Resize the label. More...
 
- Public Member Functions inherited from image
 image ()
 Default constructor. More...
 
 image (u_int16 l, u_int16 h, bool mode=true)
 Creates an image with a specified size. More...
 
 image (SDL_Surface *s, const SDL_Color &color)
 Create image from SDL_Surface. More...
 
 ~image ()
 Destructor. More...
 
void resize (u_int16 l, u_int16 h)
 Resize this image. More...
 
void clear ()
 Resets the image to it's initial state, that is totally empty. More...
 
imageoperator= (const image &src)
 Image copy (similar to copy ()). More...
 
void copy (const image &src)
 Synonym of operator = to guarantee its access from Python. More...
 
s_int8 get (igzstream &file)
 Loads an image from an opened file, saved in game internal format, with alpha and mask values. More...
 
s_int8 load (string fname)
 Loads an image from a file name, in game internal format, with alpha and mask values. More...
 
s_int8 get_raw (igzstream &file)
 Loads an image from an opened file, saved in game internal format, without alpha and mask values. More...
 
s_int8 load_raw (string fname)
 Loads an image from a file name, in game internal format, without alpha and mask values. More...
 
s_int8 get_pnm (SDL_RWops *file)
 Loads an image from an opened file, in PNM format, without alpha and mask values. More...
 
s_int8 load_pnm (string fname)
 Loads an image from a file name, in PNM format, without alpha and mask values. More...
 
s_int8 put (ogzstream &file) const
 Saves an image into an opened file, in game format, with alpha and mask values. More...
 
s_int8 save (string fname) const
 Saves an image into an file, in game format, with alpha and mask values. More...
 
s_int8 put_raw (ogzstream &file) const
 Saves an image into an opened file, in game format, without alpha and mask values. More...
 
s_int8 save_raw (string fname) const
 Saves an image into an file, in game format, without alpha and mask values. More...
 
s_int8 put_pnm (SDL_RWops *file) const
 Saves an image into an opened file, in PNM format, without alpha and mask values. More...
 
s_int8 save_pnm (string fname) const
 Saves an image into an file, in PNM format, without alpha and mask values. More...
 
void zoom (const surface &src)
 Zooms a surface. More...
 
void zoom (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Zooms a surface. More...
 
void zoom_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Synonym of zoom () to guarantee its access from Python. More...
 
void tile (const surface &src)
 Tiles a surface. More...
 
void tile (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Tiles a surface. More...
 
void tile_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Synonym of tile () to guarantee its access from Python. More...
 
void brightness (const surface &src, u_int8 cont, bool proceed_mask=false)
 Applies a "brightness" to a surface. More...
 
- Public Member Functions inherited from surface
 surface (bool mode=true)
 Default constructor. More...
 
virtual ~surface ()
 Destructor. More...
 
surfaceoperator= (surface &src)
 Surface copy (similar to copy ()). More...
 
void copy (surface &src)
 Synonym of operator = to guarantee its access from Python. More...
 
bool is_masked () const
 Returns whether a surface is masked or not. More...
 
void set_mask (bool m)
 Sets the mask parameter of the surface. More...
 
u_int8 alpha () const
 Returns the alpha value of the surface. More...
 
void set_alpha (u_int8 a)
 Sets the alpha value of the surface. More...
 
bool is_dbl_mode () const
 
void set_dbl_mode (bool mode)
 
void draw (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Draw the surface. More...
 
void draw (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Draw a part of the surface. More...
 
void draw_part (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Synonym of draw () to guarantee its access from Python. More...
 
void fillrect (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int32 col, drawing_area *da_opt=NULL)
 Fills an area of the surface with a given color. More...
 
void fillrect (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int8 r, u_int8 g, u_int8 b, drawing_area *da_opt=NULL)
 Fills an area of the surface with a given color. More...
 
void fillrect_rgb (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int8 r, u_int8 g, u_int8 b, drawing_area *da_opt=NULL)
 Synonym of fillrect () to guarantee its access from Python. More...
 
void lock () const
 Locks the surface. More...
 
void unlock () const
 Unlock the surface after you've worked on it's pixels with the get_pix () and put_pix () methods. More...
 
void put_pix (u_int16 x, u_int16 y, u_int32 col)
 Puts a pixel of a given color. More...
 
void put_pix (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
 Puts a pixel of a given color. More...
 
void put_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
 Synonym of put_pix () to guarantee its access from Python. More...
 
void get_pix (u_int16 x, u_int16 y, u_int32 &col) const
 Gets a pixel from the surface. More...
 
void get_pix (u_int16 x, u_int16 y, u_int8 &r, u_int8 &g, u_int8 &b) const
 Gets a pixel from a surface. More...
 
void get_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) const
 Synonym of get_pix () to guarantee its access from Python. More...
 
- Public Member Functions inherited from drawable
 drawable ()
 Default constructor. More...
 
virtual ~drawable ()
 Destructor. More...
 
u_int16 length () const
 Returns the length of the drawable. More...
 
u_int16 height () const
 Returns the height of the drawable. More...
 

Static Public Attributes

static const u_int8 NOTHING = 0
 
static const u_int8 AUTO_HEIGHT = 1
 
static const u_int8 AUTO_SIZE = 2
 
static const SDLKey KEY_CURSOR_NEXT = SDLK_RIGHT
 
static const SDLKey KEY_CURSOR_PREVIOUS = SDLK_LEFT
 

Protected Member Functions

u_int16 ucd (u_int16 &idx)
 
void init_vec_cursor ()
 Init vector and cursor, don't erase my_text_. More...
 
void build (const bool erase_all)
 Build label. More...
 
void build_form_nothing ()
 Build the label when the form set top nothing. More...
 
void build_form_auto_height ()
 
void build_form_auto_size ()
 
void clean_surface (const bool erase_all)
 
u_int8 find_word (u_int16 &index, u_int16 &wlength, u_int16 &wlengthpix, const u_int16 rlength)
 
void draw_string (const bool at_cursor)
 
void update_cursor ()
 
void cursor_next ()
 
void cursor_previous ()
 
void cursor_draw ()
 
void cursor_undraw ()
 
bool last_letter (u_int16 idx)
 

Protected Attributes

win_fontmy_font_
 
string my_text_
 
string new_text_
 
u_int8 my_form_
 
bool visible_cursor_
 
bool moveable_cursor_
 
u_int16 cursor_cur_blink_
 
Scursor my_cursor_
 
Scursor my_old_cursor_
 
vector< Sline_textmy_vect_
 
u_int16 start_line_
 

Static Protected Attributes

static u_int16 cursor_blink_cycle = 75
 

Additional Inherited Members

- Public Attributes inherited from surface
SDL_Surface * vis
 The actual surface. More...
 

Detailed Description

Definition at line 25 of file label.h.

Constructor & Destructor Documentation

label::label ( )

Constructor by default, cursor is not moveable, cursor is not visible, and the form is set as NOTHING, the default size is (0, 0)

Constructor.

Definition at line 22 of file label.cc.

label::~label ( )

Destructor.

Definition at line 47 of file label.cc.

Member Function Documentation

void label::set_font ( win_font font)

Set the font.

Definition at line 55 of file label.cc.

void label::set_text ( const string &  text)

Set the text.

Definition at line 65 of file label.cc.

void label::add_text ( const string &  text)

Add text.

Definition at line 85 of file label.cc.

void label::set_form ( const u_int8  form)

Set the form of the display NOTHING, AUTO_SIZE, AUTO_HEIGHT.

Set the form.

Definition at line 121 of file label.cc.

void label::set_cursor_visible ( const bool  b)

Set visible cursor.

Set if cursor is visible.

Definition at line 189 of file label.cc.

void label::set_cursor_moveable ( const bool  b)

Set if the cursor can be moved with arrow key.

Set the cursor moveable with arrow.

Definition at line 198 of file label.cc.

bool label::update ( )
virtual

Update the label.

Reimplemented from drawable.

Definition at line 543 of file label.cc.

bool label::input_update ( )
virtual

Update input label, you can move the cursor if the cursor is moveable.

Reimplemented from drawable.

Reimplemented in label_input.

Definition at line 596 of file label.cc.

const string label::text_string ( ) const

Get the text in string.

Definition at line 648 of file label.cc.

const char * label::text_char ( ) const

Get the text in char.

Definition at line 653 of file label.cc.

void label::resize ( u_int16  l,
u_int16  h 
)

Resize the label.

REsize the label.

Definition at line 111 of file label.cc.

void label::init_vec_cursor ( )
protected

Init vector and cursor, don't erase my_text_.

Init vector and cursor.

Definition at line 131 of file label.cc.

void label::build ( const bool  erase_all)
protected

Build label.

Update the vector start : it's the index where the function must start to update.

Definition at line 157 of file label.cc.

void label::build_form_nothing ( )
protected

Build the label when the form set top nothing.

Definition at line 207 of file label.cc.


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