Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #892477 ยป 0026-sdl2-Rename-pDest-as-pdest.patch

Marko Lindqvist, 2020-10-23 02:59 PM

View differences:

client/gui-sdl2/citydlg.c
/**********************************************************************//**
Popup buy productions dlg.
**************************************************************************/
void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pDest)
void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pdest)
{
char tBuf[512], cBuf[512];
struct widget *pBuf = NULL, *pwindow;
client/gui-sdl2/citydlg.h
void free_city_units_lists(void);
void enable_city_dlg_widgets(void);
void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pDest);
void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pdest);
SDL_Surface * get_scaled_city_map(struct city *pCity);
void refresh_city_resource_map(SDL_Surface *pDest, int x, int y,
void refresh_city_resource_map(SDL_Surface *pdest, int x, int y,
const struct city *pCity,
bool (*worker_check) (const struct city *,
int, int));
client/gui-sdl2/dialogs.c
/**********************************************************************//**
Popup terrain information dialog.
**************************************************************************/
static void popup_terrain_info_dialog(SDL_Surface *pDest, struct tile *ptile)
static void popup_terrain_info_dialog(SDL_Surface *pdest, struct tile *ptile)
{
SDL_Surface *pSurf;
struct widget *pBuf, *pwindow;
client/gui-sdl2/gotodlg.c
static int goto_city_callback(struct widget *pWidget)
{
if (PRESSED_EVENT(Main.event)) {
struct city *pDestcity = game_city_by_number(MAX_ID - pWidget->ID);
struct city *pdestcity = game_city_by_number(MAX_ID - pWidget->ID);
if (pDestcity) {
if (pdestcity) {
struct unit *pUnit = head_of_units_in_focus();
if (pUnit) {
if (GOTO) {
send_goto_tile(pUnit, pDestcity->tile);
send_goto_tile(pUnit, pdestcity->tile);
} else {
request_unit_airlift(pUnit, pDestcity);
request_unit_airlift(pUnit, pdestcity);
}
}
}
client/gui-sdl2/graphics.c
SDL_Surface *mask_surface(SDL_Surface *pSrc, SDL_Surface *pMask,
int mask_offset_x, int mask_offset_y)
{
SDL_Surface *pDest = NULL;
SDL_Surface *pdest = NULL;
int row, col;
Uint32 *pSrc_Pixel = NULL;
Uint32 *pDest_Pixel = NULL;
Uint32 *pdest_pixel = NULL;
Uint32 *pMask_Pixel = NULL;
unsigned char src_alpha, mask_alpha;
pDest = copy_surface(pSrc);
pdest = copy_surface(pSrc);
lock_surf(pSrc);
lock_surf(pMask);
lock_surf(pDest);
lock_surf(pdest);
pSrc_Pixel = (Uint32 *)pSrc->pixels;
pDest_Pixel = (Uint32 *)pDest->pixels;
pdest_pixel = (Uint32 *)pdest->pixels;
for (row = 0; row < pSrc->h; row++) {
pMask_Pixel = (Uint32 *)pMask->pixels
......
src_alpha = (*pSrc_Pixel & pSrc->format->Amask) >> pSrc->format->Ashift;
mask_alpha = (*pMask_Pixel & pMask->format->Amask) >> pMask->format->Ashift;
*pDest_Pixel = (*pSrc_Pixel & ~pSrc->format->Amask)
| (((src_alpha * mask_alpha) / 255) << pDest->format->Ashift);
*pdest_pixel = (*pSrc_Pixel & ~pSrc->format->Amask)
| (((src_alpha * mask_alpha) / 255) << pdest->format->Ashift);
pSrc_Pixel++; pDest_Pixel++; pMask_Pixel++;
pSrc_Pixel++; pdest_pixel++; pMask_Pixel++;
}
}
unlock_surf(pDest);
unlock_surf(pdest);
unlock_surf(pMask);
unlock_surf(pSrc);
return pDest;
return pdest;
}
/**********************************************************************//**
......
on position : [iDest_x],[iDest_y] using it's actual alpha and
color key settings.
**************************************************************************/
int blit_entire_src(SDL_Surface *pSrc, SDL_Surface *pDest,
int blit_entire_src(SDL_Surface *pSrc, SDL_Surface *pdest,
Sint16 iDest_x, Sint16 iDest_y)
{
SDL_Rect dest_rect = { iDest_x, iDest_y, 0, 0 };
return alphablit(pSrc, NULL, pDest, &dest_rect, 255);
return alphablit(pSrc, NULL, pdest, &dest_rect, 255);
}
/**********************************************************************//**
client/gui-sdl2/graphics.h
SDL_Surface *copy_surface(SDL_Surface *src);
int blit_entire_src(SDL_Surface *pSrc,
SDL_Surface *pDest, Sint16 iDest_x, Sint16 iDest_y);
SDL_Surface *pdest, Sint16 iDest_x, Sint16 iDest_y);
Uint32 getpixel(SDL_Surface *pSurface, Sint16 x, Sint16 y);
Uint32 get_first_pixel(SDL_Surface *pSurface);
client/gui-sdl2/sprite.c
{
SDL_Rect src_rect = {(Sint16) x, (Sint16) y, (Uint16) width, (Uint16) height};
SDL_Surface *pSrc = crop_rect_from_surface(GET_SURF(source), &src_rect);
SDL_Surface *pDest = NULL;
SDL_Surface *pdest = NULL;
if (mask) {
pDest = mask_surface(pSrc, mask->psurface, x - mask_offset_x, y - mask_offset_y);
pdest = mask_surface(pSrc, mask->psurface, x - mask_offset_x, y - mask_offset_y);
FREESURFACE(pSrc);
return ctor_sprite(pDest);
return ctor_sprite(pdest);
}
return ctor_sprite(pSrc);
client/gui-sdl2/widget.c
/**********************************************************************//**
Draw Themed Frame.
**************************************************************************/
void draw_frame(SDL_Surface *pDest, Sint16 start_x, Sint16 start_y,
void draw_frame(SDL_Surface *pdest, Sint16 start_x, Sint16 start_y,
Uint16 w, Uint16 h)
{
SDL_Surface *pTmpLeft =
......
SDL_Rect tmp,dst = {start_x, start_y, 0, 0};
tmp = dst;
alphablit(pTmpLeft, NULL, pDest, &tmp, 255);
alphablit(pTmpLeft, NULL, pdest, &tmp, 255);
dst.x += w - pTmpRight->w;
tmp = dst;
alphablit(pTmpRight, NULL, pDest, &tmp, 255);
alphablit(pTmpRight, NULL, pdest, &tmp, 255);
dst.x = start_x;
tmp = dst;
alphablit(pTmpTop, NULL, pDest, &tmp, 255);
alphablit(pTmpTop, NULL, pdest, &tmp, 255);
dst.y += h - pTmpBottom->h;
tmp = dst;
alphablit(pTmpBottom, NULL, pDest, &tmp, 255);
alphablit(pTmpBottom, NULL, pdest, &tmp, 255);
FREESURFACE(pTmpLeft);
FREESURFACE(pTmpRight);
client/gui-sdl2/widget.h
widget_free(&pWidget); \
} while (FALSE)
#define draw_frame_inside_widget_on_surface(pWidget , pDest) \
#define draw_frame_inside_widget_on_surface(pWidget , pdest) \
do { \
draw_frame(pDest, pWidget->size.x, pWidget->size.y, pWidget->size.w, pWidget->size.h); \
draw_frame(pdest, pWidget->size.x, pWidget->size.y, pWidget->size.w, pWidget->size.h); \
} while (FALSE);
#define draw_frame_inside_widget(pWidget) \
draw_frame_inside_widget_on_surface(pWidget , pWidget->dst->surface)
#define draw_frame_around_widget_on_surface(pWidget , pDest) \
#define draw_frame_around_widget_on_surface(pWidget , pdest) \
do { \
draw_frame(pDest, pWidget->size.x - pTheme->FR_Left->w, pWidget->size.y - pTheme->FR_Top->h, \
draw_frame(pdest, pWidget->size.x - pTheme->FR_Left->w, pWidget->size.y - pTheme->FR_Top->h, \
pWidget->size.w + pTheme->FR_Left->w + pTheme->FR_Right->w,\
pWidget->size.h + pTheme->FR_Top->h + pTheme->FR_Bottom->h); \
} while (FALSE);
......
/* misc */
SDL_Surface *create_bcgnd_surf(SDL_Surface *ptheme, Uint8 state,
Uint16 width, Uint16 height);
void draw_frame(SDL_Surface *pDest, Sint16 start_x, Sint16 start_y,
void draw_frame(SDL_Surface *pdest, Sint16 start_x, Sint16 start_y,
Uint16 w, Uint16 h);
#include "widget_button.h"
client/gui-sdl2/widget_button.c
/**********************************************************************//**
Create Icon Button image with text and Icon then blit to Dest(ination)
on positon pIButton->size.x , pIButton->size.y.
WARNING: pDest must exist.
WARNING: pdest must exist.
Text with attributes is taken from pIButton->string_utf8 parameter.
......
/**********************************************************************//**
Create Icon Button image with text and Icon then blit to Dest(ination)
on positon pTIButton->size.x , pTIButton->size.y. WARRING: pDest must
on positon pTIButton->size.x , pTIButton->size.y. WARRING: pdest must
exist.
Text with atributes is taken from pTIButton->string_utf8 parameter.
......
function return pointer to allocated Button Widget.
**************************************************************************/
struct widget *create_icon_button(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_icon_button(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *pstr, Uint32 flags)
{
SDL_Rect buf = {0, 0, 0, 0};
......
set_wstate(pButton, FC_WS_DISABLED);
set_wtype(pButton, WT_I_BUTTON);
pButton->mod = KMOD_NONE;
pButton->dst = pDest;
pButton->dst = pdest;
baseclass_redraw = pButton->redraw;
pButton->redraw = redraw_ibutton;
......
function return pointer to allocated Button Widget.
**************************************************************************/
struct widget *create_themeicon_button(SDL_Surface *pIcon_theme,
struct gui_layer *pDest,
struct gui_layer *pdest,
utf8_str *pstr,
Uint32 flags)
{
/* extract a single icon */
SDL_Surface *pIcon = create_icon_from_theme(pIcon_theme, 1);
struct widget *pButton = create_icon_button(pIcon, pDest, pstr, flags);
struct widget *pButton = create_icon_button(pIcon, pdest, pstr, flags);
FREESURFACE(pButton->theme2);
pButton->theme2 = pIcon_theme;
client/gui-sdl2/widget_button.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
#ifndef FC__WIDGET_BUTTON_H
#define FC__WIDGET_BUTTON_H
#define create_icon_button_from_chars(pIcon, pDest, pCharString, iPtsize, flags) \
create_icon_button(pIcon, pDest, \
create_utf8_from_char(pCharString, iPtsize), \
flags)
#define create_icon_button_from_chars(pIcon, pdest, pCharString, iPtsize, flags) \
create_icon_button(pIcon, pdest, \
create_utf8_from_char(pCharString, iPtsize), \
flags)
#define create_themeicon_button_from_unichar(pIcon_theme, pDest, pUniChar, pUniCharSize, iPtsize, flags) \
create_themeicon_button(pIcon, pDest, create_utf8(pUniChar, pUniCharSize, iPtsize), \
flags)
#define create_themeicon_button_from_unichar(pIcon_theme, pdest, pUniChar, pUniCharSize, iPtsize, flags) \
create_themeicon_button(pIcon, pdest, create_utf8(pUniChar, pUniCharSize, iPtsize), \
flags)
#define create_themeicon_button_from_chars(pIcon_theme, pDest, pCharString, iPtsize, flags) \
create_themeicon_button(pIcon_theme, pDest, \
create_utf8_from_char(pCharString, \
iPtsize), \
flags)
#define create_themeicon_button_from_chars(pIcon_theme, pdest, pCharString, iPtsize, flags) \
create_themeicon_button(pIcon_theme, pdest, \
create_utf8_from_char(pCharString, \
iPtsize), \
flags)
struct widget *create_icon_button(SDL_Surface *pIcon,
struct gui_layer *pDest, utf8_str *pstr,
struct gui_layer *pdest, utf8_str *pstr,
Uint32 flags);
struct widget *create_themeicon_button(SDL_Surface *pIcon_theme,
struct gui_layer *pDest, utf8_str *pstr,
struct gui_layer *pdest, utf8_str *pstr,
Uint32 flags);
int draw_tibutton(struct widget *pButton, Sint16 start_x, Sint16 start_y);
client/gui-sdl2/widget_checkbox.c
/**********************************************************************//**
Create a new checkbox widget.
**************************************************************************/
struct widget *create_checkbox(struct gui_layer *pDest, bool state,
struct widget *create_checkbox(struct gui_layer *pdest, bool state,
Uint32 flags)
{
struct widget *pCBox = widget_new();
......
set_wstate(pCBox, FC_WS_DISABLED);
set_wtype(pCBox, WT_CHECKBOX);
pCBox->mod = KMOD_NONE;
pCBox->dst = pDest;
pCBox->dst = pdest;
pTmp->state = state;
pTmp->pTRUE_Theme = current_theme->CBOX_Sell_Icon;
pTmp->pFALSE_Theme = current_theme->CBOX_Unsell_Icon;
......
/**********************************************************************//**
Create a new checkbox-with-text widget.
**************************************************************************/
struct widget *create_textcheckbox(struct gui_layer *pDest, bool state,
struct widget *create_textcheckbox(struct gui_layer *pdest, bool state,
utf8_str *pstr, Uint32 flags)
{
struct widget *pCBox;
......
struct widget *pTmpWidget;
if (pstr == NULL) {
return create_checkbox(pDest, state, flags);
return create_checkbox(pdest, state, flags);
}
pTmp = fc_calloc(1, sizeof(struct CHECKBOX));
......
}
pIcon = create_icon_from_theme(pSurf, 0);
pCBox = create_iconlabel(pIcon, pDest, pstr, (flags | WF_FREE_PRIVATE_DATA));
pCBox = create_iconlabel(pIcon, pdest, pstr, (flags | WF_FREE_PRIVATE_DATA));
pstr->style &= ~SF_CENTER;
client/gui-sdl2/widget_checkbox.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
bool state;
};
struct widget *create_textcheckbox(struct gui_layer *pDest, bool state,
struct widget *create_textcheckbox(struct gui_layer *pdest, bool state,
utf8_str *pstr, Uint32 flags);
struct widget *create_checkbox(struct gui_layer *pDest, bool state, Uint32 flags);
struct widget *create_checkbox(struct gui_layer *pdest, bool state, Uint32 flags);
void toggle_checkbox(struct widget *pCBox);
bool get_checkbox_state(struct widget *pCBox);
int set_new_checkbox_theme(struct widget *pCBox,
client/gui-sdl2/widget_edit.c
function return pointer to allocated Edit Widget.
**************************************************************************/
struct widget *create_edit(SDL_Surface *pBackground, struct gui_layer *pDest,
struct widget *create_edit(SDL_Surface *pBackground, struct gui_layer *pdest,
utf8_str *pstr, int length, Uint32 flags)
{
SDL_Rect buf = {0, 0, 0, 0};
......
pEdit->size.w = length;
pEdit->size.h = buf.h;
if (pDest) {
pEdit->dst = pDest;
if (pdest) {
pEdit->dst = pdest;
} else {
pEdit->dst = add_gui_layer(pEdit->size.w, pEdit->size.h);
}
client/gui-sdl2/widget_edit.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
ED_FORCE_EXIT = 4
};
#define create_edit_from_chars(pBackground, pDest, pCharString, iPtsize, length, flags) \
create_edit(pBackground, pDest, \
#define create_edit_from_chars(pBackground, pdest, pCharString, iPtsize, length, flags) \
create_edit(pBackground, pdest, \
create_utf8_from_char(pCharString, iPtsize), \
length, flags)
#define edit(pEdit) edit_field(pEdit)
struct widget *create_edit(SDL_Surface *pBackground, struct gui_layer *pDest,
struct widget *create_edit(SDL_Surface *pBackground, struct gui_layer *pdest,
utf8_str *pstr, int length,
Uint32 flags);
enum Edit_Return_Codes edit_field(struct widget *pEdit_Widget);
client/gui-sdl2/widget_icon.c
Create ( malloc ) Icon Widget ( flat Button )
**************************************************************************/
struct widget *create_themeicon(SDL_Surface *pIcon_theme,
struct gui_layer *pDest,
struct gui_layer *pdest,
Uint32 flags)
{
struct widget *pIcon_Widget = widget_new();
......
set_wstate(pIcon_Widget, FC_WS_DISABLED);
set_wtype(pIcon_Widget, WT_ICON);
pIcon_Widget->mod = KMOD_NONE;
pIcon_Widget->dst = pDest;
pIcon_Widget->dst = pdest;
baseclass_redraw = pIcon_Widget->redraw;
pIcon_Widget->redraw = redraw_icon;
......
}
/**********************************************************************//**
Blit Icon image to pDest(ination) on positon
start_x , start_y. WARRING: pDest must exist.
Blit Icon image to pdest(ination) on positon
start_x , start_y. WARRING: pdest must exist.
Graphic is taken from pIcon_theme surface.
......
std return of alphablit(...) function.
**************************************************************************/
int draw_icon_from_theme(SDL_Surface *pIcon_theme, Uint8 state,
struct gui_layer *pDest, Sint16 start_x, Sint16 start_y)
struct gui_layer *pdest, Sint16 start_x, Sint16 start_y)
{
SDL_Rect src, des = {start_x, start_y, 0, 0};
......
src.w = pIcon_theme->w / 4;
src.h = pIcon_theme->h;
return alphablit(pIcon_theme, &src, pDest->surface, &des, 255);
return alphablit(pIcon_theme, &src, pdest->surface, &des, 255);
}
/**********************************************************************//**
......
/**********************************************************************//**
Create ( malloc ) Icon2 Widget ( flat Button )
**************************************************************************/
struct widget *create_icon2(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_icon2(SDL_Surface *pIcon, struct gui_layer *pdest,
Uint32 flags)
{
struct widget *pIcon_Widget = widget_new();
......
set_wstate(pIcon_Widget, FC_WS_DISABLED);
set_wtype(pIcon_Widget, WT_ICON2);
pIcon_Widget->mod = KMOD_NONE;
pIcon_Widget->dst = pDest;
pIcon_Widget->dst = pdest;
baseclass_redraw = pIcon_Widget->redraw;
pIcon_Widget->redraw = redraw_icon2;
client/gui-sdl2/widget_icon.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
SDL_Surface *pNew_Theme);
SDL_Surface *create_icon_theme_surf(SDL_Surface *pIcon);
struct widget *create_themeicon(SDL_Surface *pIcon_theme,
struct gui_layer *pDest, Uint32 flags);
struct gui_layer *pdest, Uint32 flags);
SDL_Surface *create_icon_from_theme(SDL_Surface *pIcon_theme,
Uint8 state);
int draw_icon_from_theme(SDL_Surface *pIcon_theme, Uint8 state,
struct gui_layer *pDest, Sint16 start_x,
struct gui_layer *pdest, Sint16 start_x,
Sint16 start_y);
int draw_icon(struct widget *pIcon, Sint16 start_x, Sint16 start_y);
/* ICON2 */
void set_new_icon2_theme(struct widget *pIcon_Widget, SDL_Surface *pNew_Theme,
bool free_old_theme);
struct widget *create_icon2(SDL_Surface *pIcon, struct gui_layer *pDest, Uint32 flags);
struct widget *create_icon2(SDL_Surface *pIcon, struct gui_layer *pdest, Uint32 flags);
#endif /* FC__WIDGET_ICON_H */
client/gui-sdl2/widget_label.c
/**********************************************************************//**
ThemeLabel is utf8_str with Background ( pIcon ).
**************************************************************************/
struct widget *create_themelabel(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_themelabel(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *pstr, Uint16 w, Uint16 h,
Uint32 flags)
{
......
set_wstate(pLabel, FC_WS_DISABLED);
set_wtype(pLabel, WT_T_LABEL);
pLabel->mod = KMOD_NONE;
pLabel->dst = pDest;
pLabel->dst = pdest;
baseclass_redraw = pLabel->redraw;
pLabel->redraw = redraw_label;
......
/**********************************************************************//**
This Label is UTF8 string with Icon.
**************************************************************************/
struct widget *create_iconlabel(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_iconlabel(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *pstr, Uint32 flags)
{
struct widget *pILabel = NULL;
......
set_wstate(pILabel, FC_WS_DISABLED);
set_wtype(pILabel, WT_I_LABEL);
pILabel->mod = KMOD_NONE;
pILabel->dst = pDest;
pILabel->dst = pdest;
baseclass_redraw = pILabel->redraw;
pILabel->redraw = redraw_label;
......
/**********************************************************************//**
ThemeLabel is UTF8 string with Background ( pIcon ).
**************************************************************************/
struct widget *create_themelabel2(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_themelabel2(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *pstr, Uint16 w, Uint16 h,
Uint32 flags)
{
......
}
pLabel->theme = ptheme;
FC_FREE(pLabel->dst);
pLabel->dst = pDest;
pLabel->dst = pdest;
return pLabel;
}
......
SDL_Color store = {0, 0, 0, 0};
SDL_Color bg_color = *get_theme_color(COLOR_THEME_THEMELABEL2_BG);
Uint32 colorkey, flags = get_wflags(pIconLabel);
SDL_Surface *pDest;
SDL_Surface *pdest;
SDL_Surface *ptheme = create_surf(pIconLabel->size.w,
pIconLabel->size.h * 2, SDL_SWSURFACE);
......
pIconLabel->size.x = 0;
pIconLabel->size.y = 0;
area = start;
pDest = pIconLabel->dst->surface;
pdest = pIconLabel->dst->surface;
pIconLabel->dst->surface = ptheme;
/* normal */
......
if (flags & WF_FREE_STRING) {
FREEUTF8STR(pIconLabel->string_utf8);
}
pIconLabel->dst->surface = pDest;
pIconLabel->dst->surface = pdest;
set_wtype(pIconLabel, WT_T2_LABEL);
pIconLabel->redraw = redraw_label;
client/gui-sdl2/widget_label.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
#define FC__WIDGET_LABEL_H
#define create_iconlabel_from_chars(picon, pdest, chars, ptsize, flags) \
create_iconlabel(picon, pdest, create_utf8_from_char(chars, ptsize), flags)
create_iconlabel(picon, pdest, create_utf8_from_char(chars, ptsize), flags)
#define create_active_iconlabel(pBuf, pDest, pstr, pString, pCallback) \
#define create_active_iconlabel(pBuf, pdest, pstr, pString, pCallback) \
do { \
pstr = create_utf8_from_char(pString, 10); \
pstr->style |= TTF_STYLE_BOLD; \
pBuf = create_iconlabel(NULL, pDest, pstr, \
pBuf = create_iconlabel(NULL, pdest, pstr, \
(WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); \
pBuf->action = pCallback; \
} while (FALSE)
struct widget *create_themelabel(SDL_Surface *pBackground, struct gui_layer *pDest,
struct widget *create_themelabel(SDL_Surface *pBackground, struct gui_layer *pdest,
utf8_str *pstr, Uint16 w, Uint16 h,
Uint32 flags);
struct widget *create_themelabel2(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_themelabel2(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *pstr, Uint16 w, Uint16 h, Uint32 flags);
struct widget *create_iconlabel(SDL_Surface *pIcon, struct gui_layer *pDest,
struct widget *create_iconlabel(SDL_Surface *pIcon, struct gui_layer *pdest,
utf8_str *text, Uint32 flags);
struct widget *convert_iconlabel_to_themeiconlabel2(struct widget *pIconLabel);
int draw_label(struct widget *pLabel, Sint16 start_x, Sint16 start_y);
client/gui-sdl2/widget_scrollbar.c
Return pointer to created Widget.
**************************************************************************/
struct widget *create_vertical(SDL_Surface *pVert_theme, struct gui_layer *pDest,
struct widget *create_vertical(SDL_Surface *pVert_theme, struct gui_layer *pdest,
Uint16 high, Uint32 flags)
{
struct widget *pVer = widget_new();
......
set_wstate(pVer, FC_WS_DISABLED);
set_wtype(pVer, WT_VSCROLLBAR);
pVer->mod = KMOD_NONE;
pVer->dst = pDest;
pVer->dst = pdest;
baseclass_redraw = pVer->redraw;
pVer->redraw = redraw_vert;
......
Return pointer to created Widget.
**************************************************************************/
struct widget *create_horizontal(SDL_Surface *pHoriz_theme,
struct gui_layer *pDest,
struct gui_layer *pdest,
Uint16 width, Uint32 flags)
{
struct widget *pHor = widget_new();
......
set_wstate(pHor, FC_WS_DISABLED);
set_wtype(pHor, WT_HSCROLLBAR);
pHor->mod = KMOD_NONE;
pHor->dst = pDest;
pHor->dst = pdest;
baseclass_redraw = pHor->redraw;
pHor->redraw = redraw_horiz;
client/gui-sdl2/widget_scrollbar.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2006 - The Freeciv Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
} while (FALSE)
/* VERTICAL */
struct widget *create_vertical(SDL_Surface *pVert_theme, struct gui_layer *pDest,
struct widget *create_vertical(SDL_Surface *pVert_theme, struct gui_layer *pdest,
Uint16 high, Uint32 flags);
int draw_vert(struct widget *pVert, Sint16 x, Sint16 y);
......
void setup_vertical_scrollbar_default_callbacks(struct ScrollBar *pScroll);
/* HORIZONTAL */
struct widget *create_horizontal(SDL_Surface *pHoriz_theme, struct gui_layer *pDest,
struct widget *create_horizontal(SDL_Surface *pHoriz_theme, struct gui_layer *pdest,
Uint16 width, Uint32 flags);
int draw_horiz(struct widget *pHoriz, Sint16 x, Sint16 y);
client/gui-sdl2/widget_window.c
Allocate Window Widget Structute.
Text to titelbar is taken from 'pTitle'.
**************************************************************************/
struct widget *create_window_skeleton(struct gui_layer *pDest,
struct widget *create_window_skeleton(struct gui_layer *pdest,
utf8_str *title, Uint32 flags)
{
int w = 0, h = 0;
......
set_client_area(pwindow);
if (pDest) {
pwindow->dst = pDest;
if (pdest) {
pwindow->dst = pdest;
} else {
pwindow->dst = add_gui_layer(w, h);
}
......
/**********************************************************************//**
Create window widget
**************************************************************************/
struct widget *create_window(struct gui_layer *pDest, utf8_str *title,
struct widget *create_window(struct gui_layer *pdest, utf8_str *title,
Uint16 w, Uint16 h, Uint32 flags)
{
struct widget *pwindow = create_window_skeleton(pDest, title, flags);
struct widget *pwindow = create_window_skeleton(pdest, title, flags);
resize_window(pwindow, NULL, NULL, w, h);
client/gui-sdl2/widget_window.h
#ifndef FC__WIDGET_WINDOW_H
#define FC__WIDGET_WINDOW_H
struct widget *create_window(struct gui_layer *pDest, utf8_str *title,
struct widget *create_window(struct gui_layer *pdest, utf8_str *title,
Uint16 w, Uint16 h, Uint32 flags);
struct widget *create_window_skeleton(struct gui_layer *pDest,
struct widget *create_window_skeleton(struct gui_layer *pdest,
utf8_str *title, Uint32 flags);
int resize_window(struct widget *pwindow, SDL_Surface *pBcgd,
    (1-1/1)