buttons.h

Data Structures

struct  BIMAGESPTR
struct  BTEXTPTR
struct  BDATAPTR
struct  BUTTONPTR

Defines

#define BPRESSED_CALL   2345
#define CBANIMATION_CALL   6574
#define BCOLOR(r, g, b, a)   al_map_rgba(r, g, b, a)
#define TDEFAULT   al_map_rgba(0, 0, 0, 255)
#define BDEFAULT   al_map_rgba(255, 255, 255, 255)
#define BRED   al_map_rgba(255, 0, 0, 255)
#define BGREEN   al_map_rgba(0, 255, 0, 255)
#define BBLUE   al_map_rgba(0, 0, 255, 255)
#define BBLACK   al_map_rgba(0, 0, 0, 255)
#define BWHITE   al_map_rgba(255, 255, 255, 255)
#define BHTRANSPARENT   al_map_rgba(255, 255, 255, 127)
#define BQTRANSPARENT   al_map_rgba(255, 255, 255, 191)
#define WHTRANSPARENT   al_map_rgba(0, 0, 0, 127)
#define WQTRANSPARENT   al_map_rgba(0, 0, 0, 191)

Typedefs

typedef void *(* BUTTON_CALLBACK )(BUTTONPTR, void *, int)

Enumerations

enum  BPROPERTIES {
  BVISIBLE = 0x1, BMOUSEOVER = 0x2, BLPRESSED = 0x4, BLRELEASED = 0x8,
  BRPRESSED = 0x10, BRRELEASED = 0x20, BMPRESSED = 0x40, BMRELEASED = 0x80,
  BDRAW = 0x100
}
enum  SBANIMATIONS {
  BSHIFTRIGHT, BBOUNCEVERT, BBOUNCEHORZ, BSHIFTLEFT,
  SBNONE, SBRIGHT, SBLEFT, SBUP,
  SBDOWN
}
enum  CBANIMATIONS {
  BRIGHT, BLEFT, BUP, BDOWN,
  BNONE
}

Functions

BUTTONPTR get_first_element_from_button_list (void)
BIMAGESPTR get_first_element_from_button_image_list (void)
BUTTONPTR set_first_element_in_button_list (BUTTONPTR *newfirst)
BUTTONPTR create_new_button (char *label, char *bimage_label, char *text, ALLEGRO_FONT *font, ALLEGRO_COLOR text_color, ALLEGRO_COLOR button_color, float x, float y, float limit, CBANIMATIONS aflags, BPROPERTIES bflags, _Bool add_to_list)
BUTTONPTR add_element_to_button_list (BUTTONPTR *button)
BUTTONPTR remove_element_from_button_list (BUTTONPTR *currentptr)
BUTTONPTR search_button_list_for_element (BUTTONPTR *firstptr, char *label)
BUTTONPTR set_bflags_on_button (BUTTONPTR button, BPROPERTIES bflags)
BUTTONPTR remove_bflags_on_button (BUTTONPTR button, BPROPERTIES bflags)
_Bool empty_button_list (BUTTONPTR firstptr)
BIMAGESPTR create_new_button_image_list (char *labels[], char *images[], int num_elements)
BIMAGESPTR add_element_to_button_image_list (BIMAGESPTR *firstptr, BIMAGESPTR *newptr)
BIMAGESPTR remove_element_from_button_image_list (BIMAGESPTR *firstptr, BIMAGESPTR *currentptr)
BIMAGESPTR search_button_image_list_for_element (BIMAGESPTR firstptr, char *label)
_Bool empty_button_image_list (BIMAGESPTR firstptr)
BUTTON_CALLBACK set_button_callback (BUTTON_CALLBACK bcallb_func)
BUTTON_CALLBACK get_button_callback (void)
void buttoncheck (BUTTON_CALLBACK bcallb_func, void *data)
_Bool is_mouse_over_button (ALLEGRO_MOUSE_STATE *mouse, BUTTONPTR currentptr)
_Bool is_point_over_button (int x, int y, BUTTONPTR currentptr)
void check_for_button_events (BUTTONPTR currentptr)
void render_buttons (void)
void draw_button (BUTTONPTR currentptr)
SBANIMATIONS set_standard_button_animation (SBANIMATIONS sb_new)
SBANIMATIONS get_standard_button_animation (void)
BUTTONPTR standard_button_animations (BUTTONPTR button)
BUTTONPTR custom_button_animations (BUTTONPTR button, CBANIMATIONS cb, float limit, BUTTON_CALLBACK bcall, void *data)

Detailed Description

Routines to create and manage the buttons linked list. Handles all mouse events related to buttons.


Define Documentation

#define BBLACK   al_map_rgba(0, 0, 0, 255)

Definition at line 27 of file buttons.h.

#define BBLUE   al_map_rgba(0, 0, 255, 255)

Definition at line 26 of file buttons.h.

#define BCOLOR ( r,
g,
b,
 )     al_map_rgba(r, g, b, a)

Definition at line 18 of file buttons.h.

#define BDEFAULT   al_map_rgba(255, 255, 255, 255)

Definition at line 23 of file buttons.h.

#define BGREEN   al_map_rgba(0, 255, 0, 255)

Definition at line 25 of file buttons.h.

#define BHTRANSPARENT   al_map_rgba(255, 255, 255, 127)

Definition at line 29 of file buttons.h.

#define BPRESSED_CALL   2345

Definition at line 13 of file buttons.h.

#define BQTRANSPARENT   al_map_rgba(255, 255, 255, 191)

Definition at line 30 of file buttons.h.

#define BRED   al_map_rgba(255, 0, 0, 255)

Definition at line 24 of file buttons.h.

#define BWHITE   al_map_rgba(255, 255, 255, 255)

Definition at line 28 of file buttons.h.

#define CBANIMATION_CALL   6574

Definition at line 14 of file buttons.h.

#define TDEFAULT   al_map_rgba(0, 0, 0, 255)

Definition at line 22 of file buttons.h.

#define WHTRANSPARENT   al_map_rgba(0, 0, 0, 127)

Definition at line 31 of file buttons.h.

#define WQTRANSPARENT   al_map_rgba(0, 0, 0, 191)

Definition at line 32 of file buttons.h.


Typedef Documentation

typedef void*(* BUTTON_CALLBACK)(BUTTONPTR, void *, int)

Definition at line 119 of file buttons.h.


Enumeration Type Documentation

Enumerator:
BVISIBLE 
BMOUSEOVER 
BLPRESSED 
BLRELEASED 
BRPRESSED 
BRRELEASED 
BMPRESSED 
BMRELEASED 
BDRAW 

Definition at line 36 of file buttons.h.

Enumerator:
BRIGHT 
BLEFT 
BUP 
BDOWN 
BNONE 

Definition at line 64 of file buttons.h.

Enumerator:
BSHIFTRIGHT 
BBOUNCEVERT 
BBOUNCEHORZ 
BSHIFTLEFT 
SBNONE 
SBRIGHT 
SBLEFT 
SBUP 
SBDOWN 

Definition at line 50 of file buttons.h.


Function Documentation

BIMAGESPTR add_element_to_button_image_list ( BIMAGESPTR *  firstptr,
BIMAGESPTR *  newptr 
)

Definition at line 655 of file buttons.c.

BUTTONPTR add_element_to_button_list ( BUTTONPTR *  button  ) 

Definition at line 285 of file buttons.c.

void buttoncheck ( BUTTON_CALLBACK  bcallb_func,
void *  data 
)

Definition at line 93 of file buttons.c.

void check_for_button_events ( BUTTONPTR  currentptr  ) 

Definition at line 185 of file buttons.c.

BUTTONPTR create_new_button ( char *  label,
char *  bimage_label,
char *  text,
ALLEGRO_FONT *  font,
ALLEGRO_COLOR  text_color,
ALLEGRO_COLOR  button_color,
float  x,
float  y,
float  limit,
CBANIMATIONS  aflags,
BPROPERTIES  bflags,
_Bool  add_to_list 
)

Definition at line 246 of file buttons.c.

BIMAGESPTR create_new_button_image_list ( char *  labels[],
char *  images[],
int  num_elements 
)

Definition at line 636 of file buttons.c.

BUTTONPTR custom_button_animations ( BUTTONPTR  button,
CBANIMATIONS  cb,
float  limit,
BUTTON_CALLBACK  bcall,
void *  data 
)

Definition at line 531 of file buttons.c.

void draw_button ( BUTTONPTR  currentptr  ) 

Definition at line 132 of file buttons.c.

_Bool empty_button_image_list ( BIMAGESPTR  firstptr  ) 

Definition at line 366 of file buttons.c.

_Bool empty_button_list ( BUTTONPTR  firstptr  ) 

Definition at line 329 of file buttons.c.

BUTTON_CALLBACK get_button_callback ( void   ) 

Definition at line 78 of file buttons.c.

BIMAGESPTR get_first_element_from_button_image_list ( void   ) 

Definition at line 63 of file buttons.c.

BUTTONPTR get_first_element_from_button_list ( void   ) 

Definition at line 56 of file buttons.c.

SBANIMATIONS get_standard_button_animation ( void   ) 

Definition at line 607 of file buttons.c.

_Bool is_mouse_over_button ( ALLEGRO_MOUSE_STATE *  mouse,
BUTTONPTR  currentptr 
)

Definition at line 614 of file buttons.c.

_Bool is_point_over_button ( int  x,
int  y,
BUTTONPTR  currentptr 
)

Definition at line 625 of file buttons.c.

BUTTONPTR remove_bflags_on_button ( BUTTONPTR  button,
BPROPERTIES  bflags 
)

Definition at line 429 of file buttons.c.

BIMAGESPTR remove_element_from_button_image_list ( BIMAGESPTR *  firstptr,
BIMAGESPTR *  currentptr 
)
BUTTONPTR remove_element_from_button_list ( BUTTONPTR *  currentptr  ) 

Definition at line 307 of file buttons.c.

void render_buttons ( void   ) 

Definition at line 112 of file buttons.c.

BIMAGESPTR search_button_image_list_for_element ( BIMAGESPTR  firstptr,
char *  label 
)

Definition at line 677 of file buttons.c.

BUTTONPTR search_button_list_for_element ( BUTTONPTR *  firstptr,
char *  label 
)

Definition at line 230 of file buttons.c.

BUTTONPTR set_bflags_on_button ( BUTTONPTR  button,
BPROPERTIES  bflags 
)

Definition at line 403 of file buttons.c.

BUTTON_CALLBACK set_button_callback ( BUTTON_CALLBACK  bcallb_func  ) 

Definition at line 85 of file buttons.c.

BUTTONPTR set_first_element_in_button_list ( BUTTONPTR *  newfirst  ) 

Definition at line 70 of file buttons.c.

SBANIMATIONS set_standard_button_animation ( SBANIMATIONS  sb_new  ) 

Definition at line 599 of file buttons.c.

BUTTONPTR standard_button_animations ( BUTTONPTR  button  ) 

Definition at line 455 of file buttons.c.

Generated on Fri Sep 24 21:36:14 2010 for SpeedRun! by  doxygen 1.6.3