Freeciv-3.2
Loading...
Searching...
No Matches
Functions
widget_icon.h File Reference

Go to the source code of this file.

Functions

void set_new_icon_theme (struct widget *icon_widget, SDL_Surface *new_theme)
 
SDL_Surfacecreate_icon_theme_surf (SDL_Surface *icon)
 
struct widgetcreate_themeicon (SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
 
SDL_Surfacecreate_icon_from_theme (SDL_Surface *icon_theme, Uint8 state)
 
int draw_icon_from_theme (SDL_Surface *icon_theme, Uint8 state, struct gui_layer *pdest, Sint16 start_x, Sint16 start_y)
 
int draw_icon (struct widget *icon, Sint16 start_x, Sint16 start_y)
 
void set_new_icon2_theme (struct widget *icon_widget, SDL_Surface *new_theme, bool free_old_theme)
 
struct widgetcreate_icon2 (SDL_Surface *icon, struct gui_layer *pdest, Uint32 flags)
 

Function Documentation

◆ create_icon2()

struct widget * create_icon2 ( SDL_Surface icon,
struct gui_layer pdest,
Uint32  flags 
)

Create ( malloc ) Icon2 Widget ( flat Button )

Definition at line 337 of file widget_icon.c.

◆ create_icon_from_theme()

SDL_Surface * create_icon_from_theme ( SDL_Surface icon_theme,
Uint8  state 
)

Create Icon image then return pointer to this image.

Graphic is take from icon_theme surface and blit to new created image.

Type of Icon depend of "state" parameter. state = 0 - normal state = 1 - selected state = 2 - pressed state = 3 - disabled

Function return NULL if icon_theme is NULL or blit fail.

Definition at line 298 of file widget_icon.c.

◆ create_icon_theme_surf()

SDL_Surface * create_icon_theme_surf ( SDL_Surface icon)

Ugly hack to create 4-state icon theme from static icon.

Definition at line 158 of file widget_icon.c.

◆ create_themeicon()

struct widget * create_themeicon ( SDL_Surface icon_theme,
struct gui_layer pdest,
Uint32  flags 
)

Create ( malloc ) Icon Widget ( flat Button )

Definition at line 212 of file widget_icon.c.

◆ draw_icon()

int draw_icon ( struct widget icon,
Sint16  start_x,
Sint16  start_y 
)

Draw the icon.

Definition at line 240 of file widget_icon.c.

◆ draw_icon_from_theme()

int draw_icon_from_theme ( SDL_Surface icon_theme,
Uint8  state,
struct gui_layer pdest,
Sint16  start_x,
Sint16  start_y 
)

Blit Icon image to pdest(ination) on position start_x, start_y. WARNING: pdest must exist.

Graphic is taken from icon_theme surface.

Type of Icon depend of "state" parameter. state = 0 - normal state = 1 - selected state = 2 - pressed state = 3 - disabled

Function return: -3 if icon_theme is NULL. std return of alphablit(...) function.

Definition at line 268 of file widget_icon.c.

◆ set_new_icon2_theme()

void set_new_icon2_theme ( struct widget icon_widget,
SDL_Surface new_theme,
bool  free_old_theme 
)

Set new theme and calculate new size.

Definition at line 321 of file widget_icon.c.

◆ set_new_icon_theme()

void set_new_icon_theme ( struct widget icon_widget,
SDL_Surface new_theme 
)

Set new theme and callculate new size.

Definition at line 145 of file widget_icon.c.