Ignore:
Timestamp:
2020-12-07T00:08:37Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
25f26600
Parents:
7a873f0 (diff), 8596474 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'jxsvoboda-gfx' into master

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/include/types/ui/wdecor.h

    r7a873f0 r7e38970d  
    11/*
    2  * Copyright (c) 2011 Martin Decky
    3  * Copyright (c) 2012 Petr Koupy
     2 * Copyright (c) 2020 Jiri Svoboda
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup draw
     29/** @addtogroup libui
    3130 * @{
    3231 */
    3332/**
    34  * @file
     33 * @file Window decoration
    3534 */
    3635
    37 #ifndef DRAW_SURFACE_H_
    38 #define DRAW_SURFACE_H_
     36#ifndef _UI_TYPES_WDECOR_H
     37#define _UI_TYPES_WDECOR_H
    3938
    40 #include <stdbool.h>
    41 #include <io/pixelmap.h>
     39#include <gfx/coord.h>
     40#include <types/ui/cursor.h>
    4241
    43 struct surface;
    44 typedef struct surface surface_t;
     42struct ui_wdecor;
     43typedef struct ui_wdecor ui_wdecor_t;
    4544
    46 typedef sysarg_t surface_coord_t;
     45/** Window decoration style */
     46typedef enum {
     47        /** No style bits */
     48        ui_wds_none = 0x0,
     49        /** Window has a frame */
     50        ui_wds_frame = 0x1,
     51        /** Window has a title bar */
     52        ui_wds_titlebar = 0x2,
     53        /** Window has a close button */
     54        ui_wds_close_btn = 0x4,
     55        /** Window is resizable */
     56        ui_wds_resizable = 0x8,
     57        /** Window is decorated (default decoration) */
     58        ui_wds_decorated = ui_wds_frame | ui_wds_titlebar | ui_wds_close_btn
     59} ui_wdecor_style_t;
    4760
     61/** Window resize type */
    4862typedef enum {
    49         SURFACE_FLAG_NONE = 0,
    50         SURFACE_FLAG_SHARED = 1
    51 } surface_flags_t;
     63        ui_wr_none = 0,
    5264
    53 extern surface_t *surface_create(surface_coord_t, surface_coord_t, pixel_t *, surface_flags_t);
    54 extern void surface_destroy(surface_t *);
     65        ui_wr_top = 0x1,
     66        ui_wr_left = 0x2,
     67        ui_wr_bottom = 0x4,
     68        ui_wr_right = 0x8,
    5569
    56 extern bool surface_is_shared(surface_t *);
    57 extern pixel_t *surface_direct_access(surface_t *);
    58 extern pixelmap_t *surface_pixmap_access(surface_t *);
    59 extern void surface_get_resolution(surface_t *, surface_coord_t *, surface_coord_t *);
    60 extern void surface_get_damaged_region(surface_t *, surface_coord_t *, surface_coord_t *,
    61     surface_coord_t *, surface_coord_t *);
    62 extern void surface_add_damaged_region(surface_t *, surface_coord_t, surface_coord_t,
    63     surface_coord_t, surface_coord_t);
    64 extern void surface_reset_damaged_region(surface_t *);
     70        ui_wr_top_left = ui_wr_top | ui_wr_left,
     71        ui_wr_bottom_left = ui_wr_bottom | ui_wr_left,
     72        ui_wr_bottom_right = ui_wr_bottom | ui_wr_right,
     73        ui_wr_top_right = ui_wr_top | ui_wr_right
     74} ui_wdecor_rsztype_t;
    6575
    66 extern void surface_put_pixel(surface_t *, surface_coord_t, surface_coord_t, pixel_t);
    67 extern pixel_t surface_get_pixel(surface_t *, surface_coord_t, surface_coord_t);
     76/** Window decoration callbacks */
     77typedef struct ui_wdecor_cb {
     78        void (*close)(ui_wdecor_t *, void *);
     79        void (*move)(ui_wdecor_t *, void *, gfx_coord2_t *);
     80        void (*resize)(ui_wdecor_t *, void *, ui_wdecor_rsztype_t,
     81            gfx_coord2_t *);
     82        void (*set_cursor)(ui_wdecor_t *, void *, ui_stock_cursor_t);
     83} ui_wdecor_cb_t;
    6884
    6985#endif
Note: See TracChangeset for help on using the changeset viewer.