My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include "CtrlCore.h"

#ifdef GUI_X11

NAMESPACE_UPP

void Ctrl::GuiPlatformConstruct()
{
}

void Ctrl::GuiPlatformDestruct()
{
}

void Ctrl::GuiPlatformRemove()
{
if(popupgrab) {
EndPopupGrab();
popupgrab = false;
}
}

void Ctrl::GuiPlatformGetTopRect(Rect& r) const
{
}

String Ctrl::Name() const {
GuiLock __;
#ifdef CPU_64
String s = String(typeid(*this).name()) + " : 0x" + FormatIntHex(this);
#else
String s = String(typeid(*this).name()) + " : " + Format("0x%x", (int) this);
#endif
if(IsChild())
s << "(parent " << String(typeid(*parent).name()) << ")";
else
s << Format("(window 0x%x)", (int)(intptr_t) GetWindow());
return s;
}

bool Ctrl::GuiPlatformRefreshFrameSpecial(const Rect&)
{
return false;
}


bool Ctrl::GuiPlatformSetFullRefreshSpecial()
{
return false;
}

String GuiPlatformGetKeyDesc(dword key)
{
static struct {
dword key;
const char *name;
} nkey[] = {
{ 0x10060, "[`]" }, { 0x1002d, "[-]" }, { 0x1003d, "[=]" }, { 0x1005c, "[\\]" },
{ 0x1005b, "[[]" }, { 0x1005d, "[]]" },
{ 0x1003b, "[;]" }, { 0x10027, "[']" },
{ 0x1002c, "[,]" }, { 0x1002e, "[.]" }, { 0x1005f, "[/]" },
{ 0, NULL }
};
for(int i = 0; nkey[i].key; i++)
if(nkey[i].key == key)
return nkey[i].name;
return Null;
}

void Ctrl::GuiPlatformSelection(PasteClip& d)
{
d.fmt.Clear();
d.type = 2;
}

void GuiPlatformAdjustDragImage(ImageBuffer& b)
{
if(Ctrl::IsCompositedGui()) {
Image h = Rescale(b, 64, 64);
b = h;
}
}

bool GuiPlatformHasSizeGrip()
{
return _NET_Supported().Find(XAtom("_NET_WM_MOVERESIZE")) >= 0;
}

void GuiPlatformGripResize(TopWindow *q)
{
if(_NET_Supported().Find(XAtom("_NET_WM_MOVERESIZE")) >= 0) {
XUngrabPointer(Xdisplay, CurrentTime); // 2008-02-25 cxl/mdelfe... compiz fix... who has grabbed it anyway?...
XClientMessageEvent m;
m.type = ClientMessage;
m.serial = 0;
m.send_event = XTrue;
m.window = q->GetWindow();
m.message_type = XAtom("_NET_WM_MOVERESIZE");
m.format = 32;
Point p = GetMousePos();
m.data.l[0] = p.x;
m.data.l[1] = p.y;
m.data.l[2] = 4;
m.data.l[3] = 0;
m.data.l[4] = 0;
XSendEvent(Xdisplay, Xroot, 0, SubstructureNotifyMask|SubstructureRedirectMask,
(XEvent*)&m);
}
}

Color GuiPlatformGetScreenPixel(int x, int y)
{
// TODO
return Black;
}

void GuiPlatformAfterMenuPopUp()
{
XSync(Xdisplay, false);
Ctrl::ProcessEvents();
}

void Ctrl::PaintCaret(SystemDraw& w)
{
GuiLock __;
if(this == caretCtrl && WndCaretVisible)
w.DrawRect(caretx, carety, caretcx, caretcy, InvertColor);
}

void Ctrl::SetCaret(int x, int y, int cx, int cy)
{
GuiLock __;
if(this == caretCtrl)
RefreshCaret();
caretx = x;
carety = y;
caretcx = cx;
caretcy = cy;
WndCaretTime = GetTickCount();
if(this == caretCtrl)
RefreshCaret();
}

void Ctrl::SyncCaret() {
GuiLock __;
if(focusCtrl != caretCtrl) {
RefreshCaret();
caretCtrl = focusCtrl;
RefreshCaret();
}
}

END_UPP_NAMESPACE

#endif

Change log

r4307 by cxl on Dec 16, 2011   Diff
*CtrlLib: Fixed ColorPopUp issue in X11
Go to: 
Project members, sign in to write a code review

Older revisions

r3527 by cxl on Jun 13, 2011   Diff
CtrlCore, CtrlLib: Rainbow
r3525 by cxl on Jun 13, 2011   Diff
.developing rainbow
r3523 by cxl on Jun 13, 2011   Diff
Draw: AdjustColors fixed w.r.t.
premultiplied alpha images
All revisions of this file

File info

Size: 2922 bytes, 155 lines
Powered by Google Project Hosting