19#ifdef SDL2_PLAIN_INCLUDE
52#define widget_add_next(new_widget, add_dock) \
54 new_widget->prev = add_dock; \
55 new_widget->next = add_dock->next; \
56 if (add_dock->next) { \
57 add_dock->next->prev = new_widget; \
59 add_dock->next = new_widget; \
137 ret = (*baseclass_redraw)(
vert);
274 ret = (*baseclass_redraw)(horiz);
346 (
float)scroll->
count);
393 struct widget *begin_active_widget_list,
394 struct widget *begin_widget_list,
395 struct widget *end_widget_list);
398 struct widget *begin_active_widget_list,
399 struct widget *begin_widget_list,
400 struct widget *end_widget_list);
403 struct widget *begin_active_widget_list,
404 struct widget *begin_widget_list,
405 struct widget *end_widget_list);
523 buf->private_data.adv_dlg = dlg;
538 buf->private_data.adv_dlg = dlg;
553 buf->private_data.adv_dlg = dlg;
639 struct widget *begin_widget_list,
640 struct widget *end_widget_list,
641 int active,
int step,
int dir)
643 struct widget *begin = active_widget_list;
653 if (
buf != end_widget_list) {
697 buf->size.x =
tmp->size.x;
698 buf->size.y =
tmp->size.y;
701 if ((
buf->size.w !=
tmp->size.w) || (
buf->size.h !=
tmp->size.h)) {
714 if (
tmp == begin_widget_list) {
731 buf->size.y +=
buf->size.h;
735 buf->size.y =
buf->next->size.y;
750 count = active *
step;
763 while (count &&
buf != begin_widget_list->
prev) {
768 if (!count &&
buf != begin_widget_list->
prev) {
836 buf->size.x =
tmp->size.x;
837 buf->size.y =
tmp->size.y;
840 if ((
buf->size.w !=
tmp->size.w) || (
buf->size.h !=
tmp->size.h)) {
973 yrel = motion_event->y - motion->
prev_y;
974 motion->
prev_x = motion_event->x;
975 motion->
prev_y = motion_event->y;
979 normalized_y = (y - motion->
offset);
983 scroll_step = (float)net_slider_area / net_count;
1029 ((round((motion->
old_y - motion->
vscroll->
min) / scroll_step) + count) * scroll_step);
1060 struct widget *begin_active_widget_list,
1061 struct widget *begin_widget_list,
1062 struct widget *end_widget_list)
1065 struct widget *begin = begin_active_widget_list;
1069 begin = begin->
prev;
1073 down.begin = begin_active_widget_list;
1075 down.begin_widget_list = begin_widget_list;
1076 down.end_widget_list = end_widget_list;
1077 down.vscroll = vscroll;
1089 struct widget *begin_active_widget_list,
1090 struct widget *begin_widget_list,
1091 struct widget *end_widget_list)
1096 up.
begin = begin_active_widget_list;
1111 struct widget *begin_active_widget_list,
1112 struct widget *begin_widget_list,
1113 struct widget *end_widget_list)
1118 motion.
begin = begin_active_widget_list;
1130 gui_event_loop((
void *)&motion, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1133 SDL_SetEventFilter(NULL, NULL);
1137 return motion.
begin;
1152 struct widget *new_widget,
1155 Sint16 start_x, Sint16 start_y)
1268 buf->size.x =
buf->next->size.x;
1269 buf->size.y =
buf->next->size.y;
1270 buf->gfx =
buf->next->gfx;
1299 buf->size.x =
tmp->size.x;
1300 buf->size.y =
tmp->size.y +
tmp->size.h;
1304 buf->size.x =
buf->prev->size.x;
1305 buf->size.y =
buf->prev->size.y;
1306 buf->gfx =
buf->prev->gfx;
1412 if (
buf == pwidget) {
1423 while (
buf != pwidget) {
1424 buf->gfx =
buf->prev->gfx;
1426 buf->size.x =
buf->prev->size.x;
1427 buf->size.y =
buf->prev->size.y;
1442std:
while (
buf != pwidget) {
1443 buf->gfx =
buf->next->gfx;
1445 buf->size.x =
buf->next->size.x;
1446 buf->size.y =
buf->next->size.y;
1475 while (
buf != pwidget) {
1476 buf->gfx =
buf->next->gfx;
1478 buf->size.x =
buf->next->size.x;
1479 buf->size.y =
buf->next->size.y;
1582 buf->data.ptr = (
void *)dlg;
1585 buf->size.x = start_x;
1597 count =
buf->size.h;
1603 buf->data.ptr = (
void *)dlg;
1625 buf->data.ptr = (
void *)dlg;
1642 buf->size.x = start_x;
1652 count =
buf->size.h;
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
SDL_Surface * crop_rect_from_surface(SDL_Surface *psource, SDL_Rect *prect)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
struct sdl2_data main_data
int blit_entire_src(SDL_Surface *psrc, SDL_Surface *pdest, Sint16 dest_x, Sint16 dest_y)
SDL_Surface * create_surf(int width, int height, Uint32 flags)
int FilterMouseMotionEvents(void *data, SDL_Event *event)
Uint16 gui_event_loop(void *data, void(*loop_action)(void *data), Uint16(*key_down_handler)(SDL_Keysym key, void *data), Uint16(*key_up_handler)(SDL_Keysym key, void *data), Uint16(*textinput_handler)(char *text, void *data), Uint16(*finger_down_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_up_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_motion_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*mouse_button_down_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_button_up_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_motion_handler)(SDL_MouseMotionEvent *motion_event, void *data))
struct widget * selected_widget
#define DEFAULT_MOVE_STEP
#define PRESSED_EVENT(event)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define fc_calloc(n, esz)
struct widget * end_widget_list
struct widget * begin_widget_list
struct scroll_bar * vscroll
struct widget * active_widget_list
struct widget * end_widget_list
struct widget * begin_widget_list
struct widget * begin_active_widget_list
struct widget * end_active_widget_list
struct scroll_bar * scroll