acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
context.h
1//
2// Created by camilo on 31/01/2022 14:35 <3ThomasBorregaardSorensen!!
3//
4#pragma once
5
6
7#include "acme/operating_system/x11/_.h"
8#include "acme/prototype/prototype/particle.h"
9#include "acme/prototype/geometry2d/size.h"
10
11
12namespace nano
13{
14
15
16 namespace graphics
17 {
18
19
20
21
22 class CLASS_DECL_ACME context :
23 virtual public ::particle
24 {
25 public:
26
27
28 ::i32_size m_size;
29
30
31 context();
32
33 ~context() override;
34
35
36 virtual ::pointer < ::nano::graphics::image > create_bitmap_context(void * pdata,
37 const ::i32_size & size, int iBytesPerRow);
38
39 virtual void update_bitmap_context_image(::pointer < ::nano::graphics::image > & pimage);
40
41 virtual void set_pen(::nano::graphics::pen * ppen);
42 virtual void set_brush(::nano::graphics::brush * pbrush);
43 virtual void set_font(::nano::graphics::font * pfont);
44
45 virtual void set_blend_mode(enum_blend_mode eblendmode);
46
47 virtual void set_smoothing_mode(enum_smoothing_mode esmoothingmode);
48
49 virtual void set_text_rendering_hint(enum_text_rendering_hint etextrenderinghint);
50
51 virtual void clear(const ::color::color & color);
52
53#ifdef HAS_X11
54 virtual void create_for_x11(const ::x11::handle_t & handle, ::i32 w, ::i32 h);
55#endif
56
57 virtual void create(const ::i32_size & size);
58
59 virtual void resize(const ::i32_size & size);
60
61 virtual void attach(void * posdata, const ::i32_size & size, ::i32 iType);
62
63
64 virtual void on_begin_draw();
65
66 virtual void on_end_draw();
67
68
69 virtual void draw_text123(const ::scoped_string & scopedstr, const ::f64_rectangle & rectangleText, const ::e_draw_text & edrawtext, const ::e_align & ealign);
70
71 virtual void _draw_text(const ::scoped_string & scopedstr, const ::f64_rectangle & rectangleText, const ::e_draw_text & edrawtext, const ::e_align & ealign);
72
73 virtual ::f64_size get_text_extents(const ::scoped_string & scopedstr);
74
75
76 virtual void rectangle(const ::f64_rectangle & rectangle);
77 virtual void ellipse(const ::f64_rectangle &rectangle);
78 virtual void line(const ::f64_point &point1, const ::f64_point &point2);
79
80 virtual void draw_icon(::f64 x, ::f64 y, ::f64 cx, ::f64 cy, ::nano::graphics::icon * picon);
81
82 virtual void draw_image(const ::f64_rectangle &rectangle, ::nano::graphics::image * pimage);
83
84 virtual void draw_image(const ::f64_point & point, const ::f64_rectangle &rectangle, ::nano::graphics::image * pimage);
85
86 virtual ::pixmap pixmap();
87 //void set_antialias(bool bAntialiasOn);
88
89 virtual void translate(::f64 x, ::f64 y);
90
91 virtual void do_path(::nano::graphics::path *ppath);
92
93// virtual void draw_path(::nano::graphics::path *ppath, ::nano::graphics::pen *ppen);
94
95
96 };
97
98
99 } // namespace graphics
100
101
102} // namespace nano
103
104
105
Definition brush.h:18
Definition font.h:18
Definition icon.h:14
Definition image.h:22
Definition path.h:20
Definition pen.h:17