Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
widget_window.c File Reference
#include <SDL3/SDL.h>
#include "log.h"
#include "colors.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_tilespec.h"
#include "mapview.h"
#include "themespec.h"
#include "widget.h"
#include "widget_p.h"

Go to the source code of this file.

Data Structures

struct  move
 

Functions

static int redraw_window (struct widget *pwindow)
 
static void window_set_position (struct widget *pwindow, int x, int y)
 
static void window_select (struct widget *pwindow)
 
static void window_unselect (struct widget *pwindow)
 
static void set_client_area (struct widget *pwindow)
 
struct widgetcreate_window_skeleton (struct gui_layer *pdest, utf8_str *title, Uint32 flags)
 
struct widgetcreate_window (struct gui_layer *pdest, utf8_str *title, Uint16 w, Uint16 h, Uint32 flags)
 
bool resize_window (struct widget *pwindow, SDL_Surface *bcgd, SDL_Color *pcolor, Uint16 new_w, Uint16 new_h)
 
static Uint16 move_window_motion (SDL_MouseMotionEvent *motion_event, void *data)
 
static Uint16 move_window_button_up (SDL_MouseButtonEvent *button_event, void *data)
 
bool move_window (struct widget *pwindow)
 

Variables

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

Function Documentation

◆ create_window()

struct widget * create_window ( struct gui_layer pdest,
utf8_str title,
Uint16  w,
Uint16  h,
Uint32  flags 
)

Create window widget

Definition at line 227 of file widget_window.c.

◆ create_window_skeleton()

struct widget * create_window_skeleton ( struct gui_layer pdest,
utf8_str title,
Uint32  flags 
)

Allocate Window Widget Structure. Text to titlebar is taken from 'title'.

Definition at line 176 of file widget_window.c.

◆ move_window()

bool move_window ( struct widget pwindow)

Move window in a event loop.

Definition at line 348 of file widget_window.c.

◆ move_window_button_up()

static Uint16 move_window_button_up ( SDL_MouseButtonEvent button_event,
void data 
)
static

Button up event handler for the window moving event loop.

Definition at line 333 of file widget_window.c.

◆ move_window_motion()

static Uint16 move_window_motion ( SDL_MouseMotionEvent motion_event,
void data 
)
static

Move window as event instructs.

Definition at line 303 of file widget_window.c.

◆ redraw_window()

static int redraw_window ( struct widget pwindow)
static

Redraw Window Graphic ( without other Widgets )

Definition at line 47 of file widget_window.c.

◆ resize_window()

bool resize_window ( struct widget pwindow,
SDL_Surface bcgd,
SDL_Color pcolor,
Uint16  new_w,
Uint16  new_h 
)

Resize Window 'pwindow' to 'new_w' and 'new_h'. and refresh window background ( save screen under window ).

If bcgd == NULL then theme is set to white transparent ( ALPHA = 128 ).

Exp. if (resize_window(pwindow, bcgd, new_w, new_h)) { FREESURFACE(bcgd); }

Returns
Was a new surface allocated, which caller should free

Definition at line 251 of file widget_window.c.

◆ set_client_area()

static void set_client_area ( struct widget pwindow)
static

Set area for the window widget.

Definition at line 151 of file widget_window.c.

◆ window_select()

static void window_select ( struct widget pwindow)
static

Selected callback for the window widget.

Definition at line 135 of file widget_window.c.

◆ window_set_position()

static void window_set_position ( struct widget pwindow,
int  x,
int  y 
)
static

Set position for the window.

Definition at line 120 of file widget_window.c.

◆ window_unselect()

static void window_unselect ( struct widget pwindow)
static

Unselected callback for the window widget.

Definition at line 143 of file widget_window.c.

Variable Documentation

◆ baseclass_redraw

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

Definition at line 42 of file widget_window.c.