Changeset a3f63ac in mainline


Ignore:
Timestamp:
2019-09-24T11:13:18Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aac5069
Parents:
00e8290
git-author:
Jiri Svoboda <jiri@…> (2019-08-23 17:43:11)
git-committer:
Jiri Svoboda <jiri@…> (2019-09-24 11:13:18)
Message:

Move canvas GC and console GC out of libgfx

We need libgfx not to have any dependencies, it's just a protocol/API

Location:
uspace
Files:
4 added
6 edited
8 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/gfxdemo/gfxdemo.c

    r00e8290 ra3f63ac  
    3434
    3535#include <canvas.h>
     36#include <congfx/console.h>
    3637#include <draw/surface.h>
    3738#include <fibril.h>
    38 #include <gfx/backend/canvas.h>
    39 #include <gfx/backend/console.h>
     39#include <guigfx/canvas.h>
    4040#include <gfx/color.h>
    4141#include <gfx/render.h>
     
    161161        }
    162162
    163 //      sig_connect(&canvas->keyboard_event, NULL, wnd_keyboard_event);
    164 
    165163        window_resize(window, 0, 0, vw + 10, vh + 30, WINDOW_PLACEMENT_ANY);
    166164        window_exec(window);
  • uspace/app/gfxdemo/meson.build

    r00e8290 ra3f63ac  
    2727#
    2828
    29 deps = [ 'gfx' ]
     29deps = [ 'gfx', 'guigfx', 'congfx' ]
    3030src = files(
    3131        'gfxdemo.c',
  • uspace/lib/congfx/include/congfx/console.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libcongfx
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #ifndef _GFX_BACKEND_CONSOLE_H
    37 #define _GFX_BACKEND_CONSOLE_H
     36#ifndef _CONGFX_CONSOLE_H
     37#define _CONGFX_CONSOLE_H
    3838
    3939#include <io/console.h>
    4040#include <stdio.h>
    41 #include <types/gfx/backend/console.h>
     41#include <types/congfx/console.h>
    4242#include <types/gfx/context.h>
    4343#include <types/gfx/ops/context.h>
  • uspace/lib/congfx/include/types/congfx/console.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libcongfx
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #ifndef _GFX_TYPES_BACKEND_CONSOLE_H
    37 #define _GFX_TYPES_BACKEND_CONSOLE_H
     36#ifndef _CONGFX_TYPES_CONSOLE_H
     37#define _CONGFX_TYPES_CONSOLE_H
    3838
    3939struct console_gc;
  • uspace/lib/congfx/private/console.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libcongfx
    3030 * @{
    3131 */
     
    3535 */
    3636
    37 #ifndef _GFX_PRIVATE_BACKEND_CONSOLE_H
    38 #define _GFX_PRIVATE_BACKEND_CONSOLE_H
     37#ifndef _CONGFX_PRIVATE_CONSOLE_H
     38#define _CONGFX_PRIVATE_CONSOLE_H
    3939
     40#include <gfx/context.h>
    4041#include <io/console.h>
    4142#include <stdio.h>
    42 #include "../context.h"
    4343
    4444/** Actual structure of graphics context.
    4545 *
    46  * This is private to libgfx. It is not visible to clients nor backends.
     46 * This is private to libcongfx. It is not visible to clients nor backends.
    4747 */
    4848struct console_gc {
  • uspace/lib/congfx/src/console.c

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libcongfx
    3030 * @{
    3131 */
     
    3838 */
    3939
    40 #include <gfx/backend/console.h>
     40#include <congfx/console.h>
    4141#include <gfx/context.h>
    4242#include <gfx/render.h>
    4343#include <io/pixel.h>
    4444#include <stdlib.h>
    45 #include "../../private/backend/console.h"
    46 #include "../../private/color.h"
     45#include "../private/console.h"
     46#include "../private/color.h"
    4747
    4848static errno_t console_gc_set_color(void *, gfx_color_t *);
  • uspace/lib/gfx/include/gfx/color.h

    r00e8290 ra3f63ac  
    4444    uint16_t, gfx_color_t **);
    4545extern void gfx_color_delete(gfx_color_t *);
     46extern void gfx_color_get_rgb_i16(gfx_color_t *, uint16_t *, uint16_t *,
     47    uint16_t *);
    4648
    4749#endif
  • uspace/lib/gfx/meson.build

    r00e8290 ra3f63ac  
    2727#
    2828
    29 deps = [ 'gui' ]
    3029src = files(
    31         'src/backend/canvas.c',
    32         'src/backend/console.c',
    3330        'src/color.c',
    3431        'src/context.c',
  • uspace/lib/gfx/src/color.c

    r00e8290 ra3f63ac  
    7878}
    7979
     80/** Convert color to 16-bit RGB coordinates.
     81 *
     82 * @param color Color
     83 * @param r Place to store red coordinate
     84 * @param g Place to store green coordinate
     85 * @param b Place to store blue coordinate
     86 */
     87void gfx_color_get_rgb_i16(gfx_color_t *color, uint16_t *r, uint16_t *g,
     88    uint16_t *b)
     89{
     90        *r = color->r;
     91        *g = color->g;
     92        *b = color->b;
     93}
     94
    8095/** @}
    8196 */
  • uspace/lib/guigfx/include/guigfx/canvas.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libguigfx
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #ifndef _GFX_BACKEND_CANVAS_H
    37 #define _GFX_BACKEND_CANVAS_H
     36#ifndef _GUIGFX_CANVAS_H
     37#define _GUIGFX_CANVAS_H
    3838
    3939#include <canvas.h>
    40 #include <types/gfx/backend/canvas.h>
    4140#include <types/gfx/context.h>
    4241#include <types/gfx/ops/context.h>
     42#include <types/guigfx/canvas.h>
    4343
    4444extern gfx_context_ops_t canvas_gc_ops;
  • uspace/lib/guigfx/include/types/guigfx/canvas.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libguigfx
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #ifndef _GFX_TYPES_BACKEND_CANVAS_H
    37 #define _GFX_TYPES_BACKEND_CANVAS_H
     36#ifndef _GUIGFX_TYPES_CANVAS_H
     37#define _GUIGFX_TYPES_CANVAS_H
    3838
    3939struct canvas_gc;
  • uspace/lib/guigfx/private/canvas.h

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libguigfx
    3030 * @{
    3131 */
     
    3535 */
    3636
    37 #ifndef _GFX_PRIVATE_BACKEND_CANVAS_H
    38 #define _GFX_PRIVATE_BACKEND_CANVAS_H
     37#ifndef _GUIGFX_PRIVATE_CANVAS_H
     38#define _GUIGFX_PRIVATE_CANVAS_H
    3939
    4040#include <canvas.h>
    4141#include <draw/surface.h>
     42#include <gfx/context.h>
    4243#include <io/pixel.h>
    43 #include "../context.h"
    4444
    4545/** Actual structure of graphics context.
    4646 *
    47  * This is private to libgfx. It is not visible to clients nor backends.
     47 * This is private to libguigfx. It is not visible to clients nor backends.
    4848 */
    4949struct canvas_gc {
  • uspace/lib/guigfx/src/canvas.c

    r00e8290 ra3f63ac  
    2727 */
    2828
    29 /** @addtogroup libgfx
     29/** @addtogroup libguigfx
    3030 * @{
    3131 */
     
    3737 */
    3838
    39 #include <gfx/backend/canvas.h>
     39#include <gfx/color.h>
    4040#include <gfx/context.h>
    4141#include <gfx/render.h>
     42#include <guigfx/canvas.h>
    4243#include <io/pixel.h>
    4344#include <stdlib.h>
    44 #include "../../private/backend/canvas.h"
    45 #include "../../private/color.h"
     45#include "../private/canvas.h"
     46//#include "../../private/color.h"
    4647
    4748static errno_t canvas_gc_set_color(void *, gfx_color_t *);
     
    6566{
    6667        canvas_gc_t *cgc = (canvas_gc_t *) arg;
     68        uint16_t r, g, b;
    6769
    68         cgc->color = PIXEL(0, color->r >> 8, color->g >> 8, color->b >> 8);
     70        gfx_color_get_rgb_i16(color, &r, &g, &b);
     71        cgc->color = PIXEL(0, r >> 8, g >> 8, b >> 8);
    6972        return EOK;
    7073}
  • uspace/lib/meson.build

    r00e8290 ra3f63ac  
    5252        'fmtutil',
    5353        'fs',
     54        'gfx',
    5455        'graph',
    5556        'http',
     
    8283        'virtio',
    8384
    84         'gfx',
     85        'congfx',
     86        'guigfx',
    8587        'ieee80211',
    8688]
Note: See TracChangeset for help on using the changeset viewer.