19#ifdef SDL2_PLAIN_INCLUDE
76 ret = (*baseclass_redraw)(
edt->pwidget);
114 dest.x - 1, dest.y + (
edt->bg->h / 8),
115 dest.x - 1, dest.y +
edt->bg->h - (
edt->bg->h / 4),
185 rdest.y += (pedit->h - text->h) / 2;
188 rdest.x += (pedit->w - text->w) / 2;
249 for (
i = 0;
i <
len - 1;
i++) {
282 for (j = 1; (
text_in[j] & (128 + 64)) == 128; j++) {
288 for (
i = 1;
i <
len;
i += j) {
291 for (j = 1; (
text_in[
i + j] & (128 + 64)) == 128; j++) {
319 for (
i = 0;
i <
len;
i++) {
357 pedit->
theme2 = background;
377 pedit->
size.w = length;
394 pedit->
size.x = start_x;
447 if (
edt->input_chain->next) {
453 edt->input_chain =
edt->input_chain->next;
467 if (
edt->input_chain->prev) {
468 edt->input_chain =
edt->input_chain->prev;
469 if ((
edt->input_chain_x <=
475 edt->start_x += (
edt->input_chain->tsurf->w);
490 edt->input_chain =
edt->begin_text_chain;
504 edt->input_chain =
edt->end_text_chain;
507 if (
edt->pwidget->size.w -
edt->true_length < 0) {
515 if (
edt->input_chain->prev) {
516 if ((
edt->input_chain_x <=
521 edt->start_x += (
edt->input_chain->prev->tsurf->w);
524 if (
edt->input_chain->prev->prev) {
525 edt->input_chain->prev->prev->next =
edt->input_chain;
527 edt->true_length -=
edt->input_chain->prev->tsurf->w;
532 edt->true_length -=
edt->input_chain->prev->tsurf->w;
535 edt->begin_text_chain =
edt->input_chain;
552 if (
edt->input_chain->next &&
edt->input_chain->prev) {
553 edt->input_chain->prev->next =
edt->input_chain->next;
554 edt->input_chain->next->prev =
edt->input_chain->prev;
556 edt->true_length -=
edt->input_chain->tsurf->w;
564 if (
edt->input_chain->next && !
edt->input_chain->prev) {
565 edt->input_chain =
edt->input_chain->next;
566 edt->true_length -=
edt->input_chain->prev->tsurf->w;
569 edt->begin_text_chain =
edt->input_chain;
595 for (
i = 0; text[
i] !=
'\0';) {
602 if (
edt->input_chain !=
edt->begin_text_chain) {
605 edt->input_chain->prev->next =
edt->input_chain;
610 edt->input_chain->prev->next =
edt->input_chain;
611 edt->begin_text_chain =
edt->input_chain->prev;
617 edt->input_chain->prev->chr[
charlen++] = text[
i++];
627 edt->input_chain->prev->tsurf =
630 edt->pwidget->string_utf8->fgcol);
632 edt->input_chain->prev->tsurf =
634 edt->input_chain->prev->chr,
635 edt->pwidget->string_utf8->fgcol);
637 edt->true_length +=
edt->input_chain->prev->tsurf->w;
640 if (
edt->input_chain ==
edt->end_text_chain) {
643 edt->start_x -=
edt->input_chain->prev->tsurf->w -
693 edt.input_chain_x = 0;
710 edt.end_text_chain =
edt.input_chain;
711 edt.end_text_chain->chr[0] = 32;
712 edt.end_text_chain->chr[1] = 0;
713 edt.end_text_chain->next =
NULL;
714 edt.end_text_chain->prev =
NULL;
722 edt.end_text_chain->tsurf =
724 edt.end_text_chain->chr,
728 if (
edt.begin_text_chain) {
761 edt.begin_text_chain =
edt.input_chain;
773 if (
edt.begin_text_chain ==
edt.end_text_chain) {
SDL_Color * get_theme_color(enum theme_color themecolor)
void create_line(SDL_Surface *dest, Sint16 x0, Sint16 y0, Sint16 x1, Sint16 y1, SDL_Color *pcolor)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
struct gui_layer * add_gui_layer(int width, int height)
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)(const 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))
void utf8_str_size(utf8_str *pstr, SDL_Rect *fill)
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
@ COLOR_THEME_EDITFIELD_CARET
#define fc_calloc(n, esz)
struct utf8_char * begin_text_chain
struct utf8_char * end_text_chain
struct utf8_char * input_chain