ui/wpf/graphics.h

Sun, 17 Nov 2024 15:21:50 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 17 Nov 2024 15:21:50 +0100
branch
newapi
changeset 387
80edb1a93f7a
parent 137
c9b8b9e0cfe8
permissions
-rw-r--r--

add public function for getting the UiContext UCX mempool

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* 
 * File:   graphics.h
 * Author: Olaf
 *
 * Created on 22. Januar 2017, 18:34
 */

#ifndef GRAPHICS_H
#define GRAPHICS_H

#include "toolkit.h"
#include "../ui/graphics.h"

#ifdef __cplusplus
extern "C" {
#endif
    
typedef struct UiDrawEvent {
    UiObject    *obj;
    ui_drawfunc draw;
    void        *userdata;
} UiDrawEvent;

typedef struct UiWPFGraphics {
    UiGraphics g;
    void       *gc;
} UiWPFGraphics;

typedef void(*ui_draw_callback)(void *gc, UiDrawEvent *event, int width, int height);
    
UI_IMPORT UIWIDGET __stdcall UIdrawingarea(void *container, ui_draw_callback f, void *userdata);

UI_IMPORT void __stdcall UIdrawingarea_redraw(UIWIDGET drawingarea);

void ui_draw_event(void *gc, UiDrawEvent *event, int width, int height);

// drawing functions

UI_IMPORT void __stdcall UIgraphics_color(UiGraphics *g, int red, int green, int blue);
UI_IMPORT void __stdcall UIdraw_line(UiGraphics *g, int x1, int y1, int x2, int y2);
UI_IMPORT void __stdcall UIdraw_rect(UiGraphics *g, int x, int y, int w, int h, int fill);
//void UIdraw_text(UiGraphics *g, int x, int y, UiTextLayout *text);


#ifdef __cplusplus
}
#endif

#endif /* GRAPHICS_H */

mercurial