Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/congfx/src/console.c

    ra4e4e29 rbc52b5b  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    9191        uint8_t attr;
    9292
    93         if ((clr >> 24) == 0xff) {
     93        if ((clr >> 24) == 0) {
    9494                /* RGB (no text) */
    9595                ch->ch = 0;
    9696                ch->flags = CHAR_FLAG_DIRTY;
    9797                ch->attrs.type = CHAR_ATTR_RGB;
    98                 ch->attrs.val.rgb.fgcolor = clr;
     98                ch->attrs.val.rgb.fgcolor = clr ^ 0xffffff;
    9999                ch->attrs.val.rgb.bgcolor = clr;
    100100        } else {
     
    281281}
    282282
    283 /** Free up console for other users, suspending GC operation.
    284  *
    285  * @param cgc Console GC
    286  * @return EOK on success or an error code
    287  */
    288 errno_t console_gc_suspend(console_gc_t *cgc)
    289 {
    290         console_unmap(cgc->con, cgc->buf);
    291         cgc->buf = NULL;
    292 
    293         console_clear(cgc->con);
    294         console_cursor_visibility(cgc->con, true);
    295         return EOK;
    296 }
    297 
    298 /** Resume GC operation after suspend.
    299  *
    300  * @param cgc Console GC
    301  * @return EOK on success or an error code
    302  */
    303 errno_t console_gc_resume(console_gc_t *cgc)
    304 {
    305         errno_t rc;
    306 
    307         console_clear(cgc->con);
    308 
    309         rc = console_map(cgc->con, cgc->rect.p1.x, cgc->rect.p1.y, &cgc->buf);
    310         if (rc != EOK)
    311                 return rc;
    312 
    313         return EOK;
    314 }
    315 
    316 /** Update console GC size after console resize.
    317  *
    318  * @param con Console object
    319  *
    320  * @return EOK on success or an error code
    321  */
    322 errno_t console_gc_resize(console_gc_t *cgc)
    323 {
    324         sysarg_t rows;
    325         sysarg_t cols;
    326         charfield_t *buf = NULL;
    327         errno_t rc;
    328 
    329         console_unmap(cgc->con, cgc->buf);
    330         cgc->buf = NULL;
    331 
    332         rc = console_get_size(cgc->con, &cols, &rows);
    333         if (rc != EOK)
    334                 goto error;
    335 
    336         rc = console_map(cgc->con, cols, rows, &buf);
    337         if (rc != EOK)
    338                 goto error;
    339 
    340         cgc->rect.p0.x = 0;
    341         cgc->rect.p0.y = 0;
    342         cgc->rect.p1.x = cols;
    343         cgc->rect.p1.y = rows;
    344         cgc->clip_rect = cgc->rect;
    345         cgc->buf = buf;
    346         return EOK;
    347 error:
    348         return rc;
    349 }
    350 
    351 
    352283/** Get generic graphic context from console GC.
    353284 *
Note: See TracChangeset for help on using the changeset viewer.