Changeset 2cf8f994 in mainline
- Timestamp:
- 2024-09-19T22:04:13Z (4 months ago)
- Branches:
- master
- Children:
- 3fcea34
- Parents:
- 84cc190
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/terminal/terminal.c
r84cc190 r2cf8f994 302 302 static void term_render(terminal_t *term) 303 303 { 304 gfx_coord2_t pos = { .x = 4, .y = 26 }; 305 (void) gfx_bitmap_render(term->bmp, &term->update, &pos); 304 (void) gfx_bitmap_render(term->bmp, &term->update, &term->off); 306 305 307 306 term->update.p0.x = 0; … … 816 815 as_area_destroy(term->ubuf); 817 816 817 ui_destroy(term->ui); 818 818 free(term); 819 819 } … … 939 939 return; 940 940 941 sysarg_t sx = -term->off.x;942 sysarg_t sy = -term->off.y;941 sysarg_t sx = term->off.x; 942 sysarg_t sy = term->off.y; 943 943 944 944 if (event->hpos < sx || event->vpos < sy) … … 1005 1005 gfx_rect_t wrect; 1006 1006 1007 errno_t rc = ui_create(display_spec, &term->ui); 1008 if (rc != EOK) { 1009 printf("Error creating UI on %s.\n", display_spec); 1010 return rc; 1011 } 1012 1007 1013 ui_wnd_params_t wparams; 1008 1014 ui_wnd_params_init(&wparams); 1009 1015 wparams.caption = "Terminal"; 1010 1016 wparams.style |= ui_wds_maximize_btn | ui_wds_resizable; 1017 1011 1018 if ((flags & tf_topleft) != 0) 1012 1019 wparams.placement = ui_wnd_place_top_left; 1013 1020 1014 errno_t rc = ui_create(display_spec, &term->ui); 1015 if (rc != EOK) { 1016 printf("Error creating UI on %s.\n", display_spec); 1017 return rc; 1021 if (ui_is_fullscreen(term->ui)) { 1022 wparams.placement = ui_wnd_place_full_screen; 1023 wparams.style &= ~ui_wds_decorated; 1018 1024 } 1019 1025 … … 1025 1031 gfx_rect_t rect = { { 0, 0 }, { width, height } }; 1026 1032 ui_wdecor_rect_from_app(term->ui, wparams.style, &rect, &rect); 1027 term->off = rect.p0; 1028 gfx_rect_rtranslate(&term->off, &rect, &wparams.rect); 1033 term->off.x = -rect.p0.x; 1034 term->off.y = -rect.p0.y; 1035 printf("off=%d,%d\n", term->off.x, term->off.y); 1036 gfx_rect_translate(&term->off, &rect, &wparams.rect); 1037 printf("wparams.rect=%d,%d,%d,%d\n", 1038 wparams.rect.p0.x, 1039 wparams.rect.p1.x, 1040 wparams.rect.p0.y, 1041 wparams.rect.p1.y); 1029 1042 1030 1043 rc = ui_window_create(term->ui, &wparams, &term->window); … … 1063 1076 term->selection_bgcolor = termui_color_from_pixel(_basic_colors[COLOR_RED | COLOR_BRIGHT]); 1064 1077 term->selection_fgcolor = termui_color_from_pixel(_basic_colors[COLOR_WHITE | COLOR_BRIGHT]); 1065 1066 term->termui = termui_create(width / FONT_WIDTH, height / FONT_SCANLINES,1067 SCROLLBACK_MAX_LINES);1068 if (!term->termui) {1069 printf("Error creating terminal UI.\n");1070 rc = ENOMEM;1071 goto error;1072 }1073 1074 termui_set_refresh_cb(term->termui, termui_refresh_cb, term);1075 termui_set_scroll_cb(term->termui, termui_scroll_cb, term);1076 termui_set_update_cb(term->termui, termui_update_cb, term);1077 1078 1078 1079 rc = term_init_window(term, display_spec, width, height, … … 1082 1083 goto error; 1083 1084 } 1085 1086 term->termui = termui_create(term->w / FONT_WIDTH, 1087 term->h / FONT_SCANLINES, SCROLLBACK_MAX_LINES); 1088 if (!term->termui) { 1089 printf("Error creating terminal UI.\n"); 1090 rc = ENOMEM; 1091 goto error; 1092 } 1093 1094 termui_set_refresh_cb(term->termui, termui_refresh_cb, term); 1095 termui_set_scroll_cb(term->termui, termui_scroll_cb, term); 1096 termui_set_update_cb(term->termui, termui_update_cb, term); 1084 1097 1085 1098 async_set_fallback_port_handler(term_connection, NULL); -
uspace/lib/termui/src/termui.c
r84cc190 r2cf8f994 190 190 } 191 191 192 termui->row++; 192 if (termui->rows > 1) 193 termui->row++; 193 194 194 195 if (termui->row >= termui->used_rows)
Note:
See TracChangeset
for help on using the changeset viewer.