-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathosd.h
118 lines (89 loc) · 3.57 KB
/
osd.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef __DBUS2VDR_OSD_H
#define __DBUS2VDR_OSD_H
#include "object.h"
#include <vdr/osd.h>
class cDBusOsdProvider;
class cDBusOsd : public cOsd
{
private:
friend class cDBusOsdProvider;
static int osd_number;
cDBusOsdProvider& provider;
int osd_index;
cString osd_dir;
int counter;
protected:
cDBusOsd(cDBusOsdProvider& Provider, int Left, int Top, uint Level);
// virtual void SetActive(bool On) { cOsd::SetActive(On); }
public:
virtual ~cDBusOsd();
// virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
// virtual void DestroyPixmap(cPixmap *Pixmap);
// virtual void DrawImage(const cPoint &Point, const cImage &Image);
// virtual void DrawImage(const cPoint &Point, int ImageHandle);
// virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas) { return cOsd::CanHandleAreas(Areas, NumAreas); }
// virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
// virtual void SaveRegion(int x1, int y1, int x2, int y2);
// virtual void RestoreRegion(void);
// virtual eOsdError SetPalette(const cPalette &Palette, int Area);
// virtual void DrawPixel(int x, int y, tColor Color);
// virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
// virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
// virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
// virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
// virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
virtual void Flush(void);
///< Actually commits all data to the OSD hardware.
///< Flush() should return as soon as possible.
///< For a true color OSD using the default implementation with in memory
///< pixmaps, the Flush() function should basically do something like this:
///<
///< LOCK_PIXMAPS;
///< while (cPixmapMemory *pm = RenderPixmaps()) {
///< int w = pm->ViewPort().Width();
///< int h = pm->ViewPort().Height();
///< int d = w * sizeof(tColor);
///< MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d);
///< delete pm;
///< }
};
class cDbusOsdMsg : public cListObject
{
public:
const char *action;
cString file;
int left, top, vx, vy;
cDbusOsdMsg(const char *Action, const cString& File, int Left, int Top, int Vx, int Vy)
:action(Action),file(File),left(Left),top(Top),vx(Vx),vy(Vy)
{
}
virtual ~cDbusOsdMsg(void);
};
class cDBusOsdObjectHelper;
class cDBusOsdProvider : public cOsdProvider, public cThread
{
friend class cDBusOsdObjectHelper;
private:
static cDBusOsdProvider *_provider;
cDBusObject *_object;
cMutex msgMutex;
cCondVar msgCond;
cList<cDbusOsdMsg> msgQueue;
protected:
virtual cOsd *CreateOsd(int Left, int Top, uint Level);
virtual bool ProvidesTrueColor(void) { return true; }
// virtual int StoreImageData(const cImage &Image);
// virtual void DropImageData(int ImageHandle);
virtual void Action(void);
public:
cDBusOsdProvider(cDBusObject *Object);
virtual ~cDBusOsdProvider();
void SendMessage(cDbusOsdMsg *Msg);
};
class cDBusOsdObject : public cDBusObject
{
public:
cDBusOsdObject(void);
virtual ~cDBusOsdObject(void);
};
#endif