summaryrefslogtreecommitdiff
path: root/libs/litehtml/containers/windows/cairo/windows_container.h
blob: daae519cab5ac8470e26d8a8557e7607e983b8f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <mlang.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <vector>
#include "cairo.h"
#include "cairo-win32.h"
#include <litehtml.h>
#include <dib.h>
#include <txdib.h>
#include "../../libs/litehtml/containers/cairo/container_cairo.h"

class windows_container :	public container_cairo
{
protected:
	cairo_surface_t*			m_temp_surface;
	cairo_t*					m_temp_cr;
	IMLangFontLink2*			m_font_link;
public:
	windows_container(void);
	virtual ~windows_container(void);

	litehtml::uint_ptr			create_font(const char* faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm) override;
	void						delete_font(litehtml::uint_ptr hFont) override;
	int							text_width(const char* text, litehtml::uint_ptr hFont) override;
	void						draw_text(litehtml::uint_ptr hdc, const char* text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos) override;
    litehtml::string			resolve_color(const litehtml::string& color) const override;

	cairo_surface_t* get_image(const std::string& url)  override;
	double get_screen_dpi() const override;
	int get_screen_width() const override;
	int get_screen_height() const override;
};