Freeciv-3.3
Loading...
Searching...
No Matches
Functions | Variables
widget_checkbox.c File Reference
#include <SDL3/SDL.h>
#include "log.h"
#include "colors.h"
#include "graphics.h"
#include "gui_tilespec.h"
#include "themespec.h"
#include "widget.h"
#include "widget_p.h"

Go to the source code of this file.

Functions

static int redraw_checkbox (struct widget *icon)
 
static int redraw_textcheckbox (struct widget *cbox)
 
struct widgetcreate_checkbox (struct gui_layer *pdest, bool state, Uint32 flags)
 
struct widgetcreate_textcheckbox (struct gui_layer *pdest, bool state, utf8_str *pstr, Uint32 flags)
 
int set_new_checkbox_theme (struct widget *cbox, SDL_Surface *true_surf, SDL_Surface *false_surf)
 
void toggle_checkbox (struct widget *cbox)
 
bool get_checkbox_state (struct widget *cbox)
 

Variables

static int(* checkbox_baseclass_redraw )(struct widget *pwidget)
 
static int(* textcheckbox_baseclass_redraw )(struct widget *pwidget)
 

Function Documentation

◆ create_checkbox()

struct widget * create_checkbox ( struct gui_layer pdest,
bool  state,
Uint32  flags 
)

Create a new checkbox widget.

Definition at line 111 of file widget_checkbox.c.

◆ create_textcheckbox()

struct widget * create_textcheckbox ( struct gui_layer pdest,
bool  state,
utf8_str pstr,
Uint32  flags 
)

Create a new checkbox-with-text widget.

Definition at line 145 of file widget_checkbox.c.

◆ get_checkbox_state()

bool get_checkbox_state ( struct widget cbox)

Check state of the checkbox.

Definition at line 235 of file widget_checkbox.c.

◆ redraw_checkbox()

static int redraw_checkbox ( struct widget icon)
static

Blit checkbox gfx to surface its on.

Definition at line 39 of file widget_checkbox.c.

◆ redraw_textcheckbox()

static int redraw_textcheckbox ( struct widget cbox)
static

Blit checkbox-with-text gfx to surface its on.

Returns
0 on success

Definition at line 74 of file widget_checkbox.c.

◆ set_new_checkbox_theme()

int set_new_checkbox_theme ( struct widget cbox,
SDL_Surface true_surf,
SDL_Surface false_surf 
)

Set theme surfaces for a checkbox.

Definition at line 191 of file widget_checkbox.c.

◆ toggle_checkbox()

void toggle_checkbox ( struct widget cbox)

Change the state of the checkbox.

Definition at line 221 of file widget_checkbox.c.

Variable Documentation

◆ checkbox_baseclass_redraw

int(* checkbox_baseclass_redraw) (struct widget *pwidget) ( struct widget pwidget)
static

Definition at line 33 of file widget_checkbox.c.

◆ textcheckbox_baseclass_redraw

int(* textcheckbox_baseclass_redraw) (struct widget *pwidget) ( struct widget pwidget)
static

Definition at line 34 of file widget_checkbox.c.