ui/wpf/graphics.h

Fri, 11 Dec 2020 18:32:54 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 11 Dec 2020 18:32:54 +0100
changeset 4
d8e8f34e65ee
parent 0
804d8803eade
permissions
-rw-r--r--

add sqlite dependency

0
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * To change this license header, choose License Headers in Project Properties.
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 * To change this template file, choose Tools | Templates
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * and open the template in the editor.
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 */
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 /*
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 * File: graphics.h
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * Author: Olaf
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 *
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 * Created on 22. Januar 2017, 18:34
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 */
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 #ifndef GRAPHICS_H
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 #define GRAPHICS_H
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 #include "toolkit.h"
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 #include "../ui/graphics.h"
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 #ifdef __cplusplus
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 extern "C" {
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 #endif
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 typedef struct UiDrawEvent {
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 UiObject *obj;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 ui_drawfunc draw;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 void *userdata;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 } UiDrawEvent;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 typedef struct UiWPFGraphics {
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 UiGraphics g;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 void *gc;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 } UiWPFGraphics;
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 typedef void(*ui_draw_callback)(void *gc, UiDrawEvent *event, int width, int height);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 UI_IMPORT UIWIDGET __stdcall UIdrawingarea(void *container, ui_draw_callback f, void *userdata);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 UI_IMPORT void __stdcall UIdrawingarea_redraw(UIWIDGET drawingarea);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 void ui_draw_event(void *gc, UiDrawEvent *event, int width, int height);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 // drawing functions
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 UI_IMPORT void __stdcall UIgraphics_color(UiGraphics *g, int red, int green, int blue);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 UI_IMPORT void __stdcall UIdraw_line(UiGraphics *g, int x1, int y1, int x2, int y2);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 UI_IMPORT void __stdcall UIdraw_rect(UiGraphics *g, int x, int y, int w, int h, int fill);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 //void UIdraw_text(UiGraphics *g, int x, int y, UiTextLayout *text);
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 #ifdef __cplusplus
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 }
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 #endif
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 #endif /* GRAPHICS_H */
804d8803eade add existing toolkit source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56

mercurial