mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-01 07:42:40 -06:00
rainbow: Skeleton
git-svn-id: svn://ultimatepp.org/upp/trunk@3534 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ffa5c67249
commit
e97ed8bbab
27 changed files with 1958 additions and 8 deletions
27
rainbow/Skeleton/After.h
Normal file
27
rainbow/Skeleton/After.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
class ViewDraw : public SystemDraw {
|
||||
public:
|
||||
ViewDraw(Ctrl *ctrl);
|
||||
~ViewDraw();
|
||||
};
|
||||
|
||||
Vector<WString>& coreCmdLine__();
|
||||
Vector<WString> SplitCmdLine__(const char *cmd);
|
||||
|
||||
#define GUI_APP_MAIN \
|
||||
void GuiMainFn_();\
|
||||
\
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow) \
|
||||
{ \
|
||||
UPP::coreCmdLine__() = UPP::SplitCmdLine__(UPP::FromSystemCharset(lpCmdLine)); \
|
||||
UPP::AppInitEnvironment__(); \
|
||||
GuiMainFn_(); \
|
||||
UPP::Ctrl::CloseTopCtrls(); \
|
||||
UPP::UsrLog("---------- About to delete this log..."); \
|
||||
UPP::DeleteUsrLog(); \
|
||||
return UPP::GetExitCode(); \
|
||||
} \
|
||||
\
|
||||
void GuiMainFn_()
|
||||
|
||||
|
||||
class DHCtrl : Ctrl {};
|
||||
16
rainbow/Skeleton/ChSysInit.cpp
Normal file
16
rainbow/Skeleton/ChSysInit.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
void ChSysInit()
|
||||
{
|
||||
CtrlImg::Reset();
|
||||
CtrlsImg::Reset();
|
||||
ChReset();
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
241
rainbow/Skeleton/Clip.cpp
Normal file
241
rainbow/Skeleton/Clip.cpp
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
#include <plugin/bmp/bmp.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
void ClearClipboard()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void AppendClipboard(int format, const byte *data, int length)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void AppendClipboard(const char *format, const byte *data, int length)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void AppendClipboard(const char *format, const String& data)
|
||||
{
|
||||
GuiLock __;
|
||||
AppendClipboard(format, data, data.GetLength());
|
||||
}
|
||||
|
||||
void AppendClipboard(const char *format, const Value& data, String (*render)(const Value&))
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
String ReadClipboard(const char *format)
|
||||
{
|
||||
GuiLock __;
|
||||
return Null;
|
||||
}
|
||||
|
||||
void AppendClipboardText(const String& s)
|
||||
{
|
||||
AppendClipboard("text", ToSystemCharset(s));
|
||||
}
|
||||
|
||||
void AppendClipboardUnicodeText(const WString& s)
|
||||
{
|
||||
AppendClipboard("wtext", (byte *)~s, 2 * s.GetLength());
|
||||
}
|
||||
|
||||
const char *ClipFmtsText()
|
||||
{
|
||||
return "wtext;text";
|
||||
}
|
||||
|
||||
String GetString(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
if(clip.Accept("wtext")) {
|
||||
String s = ~clip;
|
||||
return WString((const wchar *)~s, wstrlen((const wchar *)~s)).ToString();
|
||||
}
|
||||
if(clip.IsAvailable("text"))
|
||||
return ~clip;
|
||||
return Null;
|
||||
}
|
||||
|
||||
WString GetWString(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
if(clip.Accept("wtext")) {
|
||||
String s = ~clip;
|
||||
return WString((const wchar *)~s, wstrlen((const wchar *)~s));
|
||||
}
|
||||
if(clip.IsAvailable("text"))
|
||||
return (~clip).ToWString();
|
||||
return Null;
|
||||
}
|
||||
|
||||
|
||||
bool AcceptText(PasteClip& clip)
|
||||
{
|
||||
return clip.Accept(ClipFmtsText());
|
||||
}
|
||||
|
||||
static String sText(const Value& data)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
static String sWText(const Value& data)
|
||||
{
|
||||
return Unicode__(WString(data));
|
||||
}
|
||||
|
||||
void Append(VectorMap<String, ClipData>& data, const String& text)
|
||||
{
|
||||
data.GetAdd("text", ClipData(text, sText));
|
||||
data.GetAdd("wtext", ClipData(text, sWText));
|
||||
}
|
||||
|
||||
void Append(VectorMap<String, ClipData>& data, const WString& text)
|
||||
{
|
||||
data.GetAdd("text", ClipData(text, sText));
|
||||
data.GetAdd("wtext", ClipData(text, sWText));
|
||||
}
|
||||
|
||||
String GetTextClip(const WString& text, const String& fmt)
|
||||
{
|
||||
if(fmt == "text")
|
||||
return text.ToString();
|
||||
if(fmt == "wtext")
|
||||
return Unicode__(text);
|
||||
return Null;
|
||||
}
|
||||
|
||||
String GetTextClip(const String& text, const String& fmt)
|
||||
{
|
||||
if(fmt == "text")
|
||||
return text;
|
||||
if(fmt == "wtext")
|
||||
return Unicode__(text.ToWString());
|
||||
return Null;
|
||||
}
|
||||
|
||||
String ReadClipboardText()
|
||||
{
|
||||
return ReadClipboardUnicodeText().ToString();
|
||||
}
|
||||
|
||||
WString ReadClipboardUnicodeText()
|
||||
{
|
||||
return Null;
|
||||
}
|
||||
|
||||
bool IsClipboardAvailable(const char *id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsClipboardAvailableText()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *ClipFmtsImage()
|
||||
{
|
||||
static const char *q;
|
||||
ONCELOCK {
|
||||
static String s = "dib;" + ClipFmt<Image>();
|
||||
q = s;
|
||||
}
|
||||
return q;
|
||||
}
|
||||
|
||||
bool AcceptImage(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
return clip.Accept(ClipFmtsImage());
|
||||
}
|
||||
|
||||
Image GetImage(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
Image m;
|
||||
if(Accept<Image>(clip)) {
|
||||
LoadFromString(m, ~clip);
|
||||
if(!m.IsEmpty())
|
||||
return m;
|
||||
}
|
||||
return Null;
|
||||
}
|
||||
|
||||
Image ReadClipboardImage()
|
||||
{
|
||||
GuiLock __;
|
||||
PasteClip d = Ctrl::Clipboard();
|
||||
return GetImage(d);
|
||||
}
|
||||
|
||||
String sImage(const Value& image)
|
||||
{
|
||||
Image img = image;
|
||||
return StoreAsString(const_cast<Image&>(img));
|
||||
}
|
||||
|
||||
String GetImageClip(const Image& img, const String& fmt)
|
||||
{
|
||||
GuiLock __;
|
||||
if(img.IsEmpty()) return Null;
|
||||
if(fmt == ClipFmt<Image>())
|
||||
return sImage(img);
|
||||
return Null;
|
||||
}
|
||||
|
||||
void AppendClipboardImage(const Image& img)
|
||||
{
|
||||
GuiLock __;
|
||||
if(img.IsEmpty()) return;
|
||||
AppendClipboard(ClipFmt<Image>(), img, sImage);
|
||||
}
|
||||
|
||||
bool AcceptFiles(PasteClip& clip)
|
||||
{
|
||||
if(clip.Accept("files")) {
|
||||
clip.SetAction(DND_COPY);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAvailableFiles(PasteClip& clip)
|
||||
{
|
||||
return clip.IsAvailable("files");
|
||||
}
|
||||
|
||||
Vector<String> GetFiles(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
Vector<String> f;
|
||||
return f;
|
||||
}
|
||||
|
||||
bool PasteClip::IsAvailable(const char *fmt) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
String PasteClip::Get(const char *fmt) const
|
||||
{
|
||||
return Null;
|
||||
}
|
||||
|
||||
void PasteClip::GuiPlatformConstruct()
|
||||
{
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
99
rainbow/Skeleton/Ctrl.cpp
Normal file
99
rainbow/Skeleton/Ctrl.cpp
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
void Ctrl::GuiPlatformConstruct()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformDestruct()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformRemove()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformGetTopRect(Rect& r) const
|
||||
{
|
||||
}
|
||||
|
||||
bool Ctrl::GuiPlatformRefreshFrameSpecial(const Rect& r)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::GuiPlatformSetFullRefreshSpecial()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Ctrl::PaintCaret(SystemDraw& w)
|
||||
{
|
||||
}
|
||||
|
||||
String GuiPlatformGetKeyDesc(dword key)
|
||||
{
|
||||
return Null;
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformSelection(PasteClip&)
|
||||
{
|
||||
}
|
||||
|
||||
void GuiPlatformAdjustDragImage(ImageBuffer&)
|
||||
{
|
||||
}
|
||||
|
||||
bool GuiPlatformHasSizeGrip()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void GuiPlatformGripResize(TopWindow *q)
|
||||
{
|
||||
}
|
||||
|
||||
Color GuiPlatformGetScreenPixel(int x, int y)
|
||||
{
|
||||
return Black;
|
||||
}
|
||||
|
||||
void GuiPlatformAfterMenuPopUp()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::SetCaret(int x, int y, int cx, int cy)
|
||||
{
|
||||
GuiLock __;
|
||||
caretx = x;
|
||||
carety = y;
|
||||
caretcx = cx;
|
||||
caretcy = cy;
|
||||
SyncCaret();
|
||||
}
|
||||
|
||||
void Ctrl::SyncCaret() {
|
||||
GuiLock __;
|
||||
|
||||
}
|
||||
|
||||
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()) << ")";
|
||||
return s;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
3
rainbow/Skeleton/Ctrl.h
Normal file
3
rainbow/Skeleton/Ctrl.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
//$ class Ctrl {
|
||||
|
||||
//$ };
|
||||
38
rainbow/Skeleton/DnD.cpp
Normal file
38
rainbow/Skeleton/DnD.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
Ptr<Ctrl> sDnDSource;
|
||||
|
||||
Ctrl * Ctrl::GetDragAndDropSource()
|
||||
{
|
||||
return sDnDSource;
|
||||
}
|
||||
|
||||
Image MakeDragImage(const Image& arrow, Image sample);
|
||||
|
||||
Image MakeDragImage(const Image& arrow, const Image& arrow98, Image sample)
|
||||
{
|
||||
if(IsWin2K())
|
||||
return MakeDragImage(arrow, sample);
|
||||
else
|
||||
return arrow98;
|
||||
}
|
||||
|
||||
int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions,
|
||||
const VectorMap<String, ClipData>& data)
|
||||
{
|
||||
return DND_NONE;
|
||||
}
|
||||
|
||||
void Ctrl::SetSelectionSource(const char *fmts) {}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
62
rainbow/Skeleton/Draw.cpp
Normal file
62
rainbow/Skeleton/Draw.cpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
/*Rect SystemDraw::GetVirtualScreenArea()
|
||||
{
|
||||
GuiLock __;
|
||||
}*/
|
||||
|
||||
dword SystemDraw::GetInfo() const
|
||||
{
|
||||
return NATIVE;
|
||||
}
|
||||
|
||||
Size SystemDraw::GetPageSize() const
|
||||
{
|
||||
return Size(0, 0);
|
||||
}
|
||||
|
||||
Size SystemDraw::GetNativeDpi() const
|
||||
{
|
||||
return Size(96, 96);
|
||||
}
|
||||
|
||||
void SystemDraw::BeginNative()
|
||||
{
|
||||
}
|
||||
|
||||
void SystemDraw::EndNative()
|
||||
{
|
||||
}
|
||||
|
||||
int SystemDraw::GetCloffLevel() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SystemDraw::~SystemDraw() {
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void BackDraw::Destroy()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void BackDraw::Create(SystemDraw& w, int cx, int cy) {
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void BackDraw::Put(SystemDraw& w, int x, int y) {
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
99
rainbow/Skeleton/DrawOp.cpp
Normal file
99
rainbow/Skeleton/DrawOp.cpp
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
void SystemDraw::BeginOp()
|
||||
{
|
||||
LTIMING("Begin");
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::OffsetOp(Point p)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
bool SystemDraw::ClipOp(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SystemDraw::ClipoffOp(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SystemDraw::EndOp()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
bool SystemDraw::ExcludeClipOp(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SystemDraw::IntersectClipOp(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SystemDraw::IsPaintingOp(const Rect& r) const
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
Rect SystemDraw::GetPaintRect() const
|
||||
{
|
||||
GuiLock __;
|
||||
return Rect(0, 0, 10000, 1000);
|
||||
}
|
||||
|
||||
void SystemDraw::DrawRectOp(int x, int y, int cx, int cy, Color color)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::DrawPolyPolylineOp(const Point *vertices, int vertex_count,
|
||||
const int *counts, int count_count,
|
||||
int width, Color color, Color doxor)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count,
|
||||
const int *subpolygon_counts, int subpolygon_count_count,
|
||||
const int *disjunct_polygon_counts, int disjunct_polygon_count_count,
|
||||
Color color, int width, Color outline, uint64 pattern, Color doxor)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SystemDraw::DrawEllipseOp(const Rect& r, Color color, int width, Color pencolor)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
16
rainbow/Skeleton/DrawText.cpp
Normal file
16
rainbow/Skeleton/DrawText.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
void SystemDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink,
|
||||
int n, const int *dx) {
|
||||
Std(font);
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
358
rainbow/Skeleton/Gui.h
Normal file
358
rainbow/Skeleton/Gui.h
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
#define GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class SystemDraw : public Draw {
|
||||
public:
|
||||
virtual dword GetInfo() const;
|
||||
virtual Size GetPageSize() const;
|
||||
|
||||
virtual void BeginOp();
|
||||
virtual void EndOp();
|
||||
virtual void OffsetOp(Point p);
|
||||
virtual bool ClipOp(const Rect& r);
|
||||
virtual bool ClipoffOp(const Rect& r);
|
||||
virtual bool ExcludeClipOp(const Rect& r);
|
||||
virtual bool IntersectClipOp(const Rect& r);
|
||||
virtual bool IsPaintingOp(const Rect& r) const;
|
||||
virtual Rect GetPaintRect() const;
|
||||
|
||||
virtual void DrawRectOp(int x, int y, int cx, int cy, Color color);
|
||||
virtual void DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color);
|
||||
virtual void DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color);
|
||||
|
||||
virtual void DrawPolyPolylineOp(const Point *vertices, int vertex_count,
|
||||
const int *counts, int count_count,
|
||||
int width, Color color, Color doxor);
|
||||
virtual void DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count,
|
||||
const int *subpolygon_counts, int scc,
|
||||
const int *disjunct_polygon_counts, int dpcc,
|
||||
Color color, int width, Color outline,
|
||||
uint64 pattern, Color doxor);
|
||||
virtual void DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color);
|
||||
|
||||
virtual void DrawEllipseOp(const Rect& r, Color color, int pen, Color pencolor);
|
||||
virtual void DrawTextOp(int x, int y, int angle, const wchar *text, Font font,
|
||||
Color ink, int n, const int *dx);
|
||||
|
||||
virtual Size GetNativeDpi() const;
|
||||
virtual void BeginNative();
|
||||
virtual void EndNative();
|
||||
|
||||
virtual int GetCloffLevel() const;
|
||||
|
||||
private:
|
||||
Size pageSize;
|
||||
Size nativeSize;
|
||||
Size nativeDpi;
|
||||
bool palette:1;
|
||||
bool color16:1;
|
||||
bool is_mono:1;
|
||||
int native;
|
||||
|
||||
friend class ImageDraw;
|
||||
friend class FontInfo;
|
||||
friend class Font;
|
||||
|
||||
friend void StaticExitDraw_();
|
||||
|
||||
Point actual_offset_bak;
|
||||
|
||||
struct Cloff : Moveable<Cloff> {
|
||||
Point org;
|
||||
HRGN hrgn;
|
||||
Rect drawingclip;
|
||||
};
|
||||
|
||||
Array<Cloff> cloff;
|
||||
Rect drawingclip;
|
||||
|
||||
COLORREF lastTextColor;
|
||||
Color lastColor;
|
||||
HBRUSH orgBrush;
|
||||
HBRUSH actBrush;
|
||||
HPEN orgPen;
|
||||
HPEN actPen;
|
||||
int lastPen;
|
||||
Color lastPenColor;
|
||||
|
||||
void Unselect0();
|
||||
void Cinit();
|
||||
|
||||
void LoadCaps();
|
||||
void SetPrinterMode();
|
||||
void Reset();
|
||||
void SetOrg();
|
||||
friend HPALETTE GetQlibPalette();
|
||||
void DotsMode();
|
||||
|
||||
static void InitColors();
|
||||
|
||||
friend class BackDraw;
|
||||
friend class ScreenDraw;
|
||||
friend class PrintDraw;
|
||||
|
||||
protected:
|
||||
dword style;
|
||||
HDC handle;
|
||||
Point actual_offset;
|
||||
|
||||
SystemDraw();
|
||||
void Init();
|
||||
void InitClip(const Rect& clip);
|
||||
|
||||
public:
|
||||
static Rect GetVirtualScreenArea();
|
||||
|
||||
static void SetAutoPalette(bool ap);
|
||||
static bool AutoPalette();
|
||||
bool PaletteMode() { return palette; }
|
||||
|
||||
static void Flush() { GdiFlush(); }
|
||||
|
||||
COLORREF GetColor(Color color) const;
|
||||
|
||||
Point GetOffset() const { return actual_offset; }
|
||||
|
||||
#ifndef PLATFORM_WINCE
|
||||
Point LPtoDP(Point p) const;
|
||||
Point DPtoLP(Point p) const;
|
||||
Rect LPtoDP(const Rect& r) const;
|
||||
Rect DPtoLP(const Rect& r) const;
|
||||
#endif
|
||||
|
||||
void SetColor(Color color);
|
||||
void SetDrawPen(int width, Color color);
|
||||
|
||||
Size GetSizeCaps(int i, int j) const;
|
||||
HDC BeginGdi();
|
||||
void EndGdi();
|
||||
HDC GetHandle() { return handle; }
|
||||
operator HDC() const { return handle; }
|
||||
void Unselect();
|
||||
void Attach(HDC ahandle) { handle = ahandle; Init(); }
|
||||
HDC Detach() { Unselect(); HDC h = handle; handle = NULL; return h; }
|
||||
|
||||
SystemDraw(HDC hdc);
|
||||
virtual ~SystemDraw();
|
||||
|
||||
bool CanSetSurface() { return IsGui() && IsWinNT(); }
|
||||
};
|
||||
|
||||
#ifndef PLATFORM_WINCE
|
||||
class WinMetaFile {
|
||||
Size size;
|
||||
HENHMETAFILE hemf;
|
||||
|
||||
void Init();
|
||||
|
||||
public:
|
||||
void Attach(HENHMETAFILE emf);
|
||||
HENHMETAFILE Detach();
|
||||
|
||||
void Set(const void *data, dword len);
|
||||
void Set(const String& data) { Set(~data, data.GetCount()); }
|
||||
|
||||
String Get() const;
|
||||
|
||||
operator bool() const { return hemf; }
|
||||
void SetSize(const Size& sz) { size = sz; }
|
||||
Size GetSize() const { return hemf ? size : Size(0, 0); }
|
||||
|
||||
void Clear();
|
||||
|
||||
void Paint(Draw& w, const Rect& r) const;
|
||||
void Paint(Draw& w, int x, int y, int cx, int cy) const;
|
||||
|
||||
void Serialize(Stream& s);
|
||||
|
||||
void ReadClipboard();
|
||||
void WriteClipboard() const;
|
||||
void Load(const char *file) { Set(LoadFile(file)); }
|
||||
|
||||
WinMetaFile() { Init(); }
|
||||
WinMetaFile(HENHMETAFILE hemf);
|
||||
WinMetaFile(HENHMETAFILE hemf, Size sz);
|
||||
WinMetaFile(const char *file);
|
||||
WinMetaFile(void *data, int len);
|
||||
WinMetaFile(const String& data);
|
||||
|
||||
~WinMetaFile() { Clear(); }
|
||||
|
||||
HENHMETAFILE GetHEMF() const { return hemf; }
|
||||
};
|
||||
|
||||
class WinMetaFileDraw : public SystemDraw {
|
||||
Size size;
|
||||
|
||||
public:
|
||||
bool Create(HDC hdc, int cx, int cy, const char *app = NULL, const char *name = NULL, const char *file = NULL);
|
||||
bool Create(int cx, int cy, const char *app = NULL, const char *name = NULL, const char *file = NULL);
|
||||
WinMetaFile Close();
|
||||
|
||||
WinMetaFileDraw() {}
|
||||
WinMetaFileDraw(HDC hdc, int cx, int cy, const char *app = NULL, const char *name = NULL, const char *file = NULL);
|
||||
WinMetaFileDraw(int cx, int cy, const char *app = NULL, const char *name = NULL, const char *file = NULL);
|
||||
~WinMetaFileDraw();
|
||||
};
|
||||
|
||||
void DrawWMF(Draw& w, int x, int y, int cx, int cy, const String& wmf);
|
||||
void DrawWMF(Draw& w, int x, int y, const String& wmf);
|
||||
Drawing LoadWMF(const char *path, int cx, int cy);
|
||||
Drawing LoadWMF(const char *path);
|
||||
|
||||
String AsWMF(const Drawing& iw);
|
||||
|
||||
#endif
|
||||
|
||||
class ScreenDraw : public SystemDraw {
|
||||
public:
|
||||
ScreenDraw(bool ic = false);
|
||||
~ScreenDraw();
|
||||
};
|
||||
|
||||
#ifndef PLATFORM_WINCE
|
||||
class PrintDraw : public SystemDraw {
|
||||
public:
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
private:
|
||||
bool aborted;
|
||||
|
||||
void InitPrinter();
|
||||
public:
|
||||
PrintDraw(HDC hdc, const char *jobname);
|
||||
~PrintDraw();
|
||||
};
|
||||
#endif
|
||||
|
||||
inline bool BitBlt(HDC ddc, Point d, HDC sdc, const Rect& s, dword rop = SRCCOPY)
|
||||
{ return BitBlt(ddc, d.x, d.y, s.Width(), s.Height(), sdc, s.left, s.top, rop); }
|
||||
|
||||
inline bool StretchBlt(HDC ddc, const Rect& r, HDC sdc, const Rect& s, dword rop = SRCCOPY)
|
||||
{ return StretchBlt(ddc, r.left, r.top, r.Width(), r.Height(), sdc, s.left, s.top, s.Width(), s.Height(), rop); }
|
||||
|
||||
inline bool PatBlt(HDC dc, const Rect& r, dword rop = PATCOPY)
|
||||
{ return PatBlt(dc, r.left, r.top, r.Width(), r.Height(), rop); }
|
||||
|
||||
inline void MoveTo(HDC hdc, Point pt) { MoveToEx(hdc, pt.x, pt.y, 0); }
|
||||
inline void LineTo(HDC hdc, Point pt) { LineTo(hdc, pt.x, pt.y); }
|
||||
|
||||
inline void DrawLine(HDC hdc, Point p, Point q) { MoveTo(hdc, p); LineTo(hdc, q); }
|
||||
inline void DrawLine(HDC hdc, int px, int py, int qx, int qy) { MoveToEx(hdc, px, py, 0); LineTo(hdc, qx, qy); }
|
||||
|
||||
#ifndef PLATFORM_WINCE
|
||||
inline void DrawArc(HDC hdc, const Rect& rc, Point p, Point q){ Arc(hdc, rc.left, rc.top, rc.right, rc.bottom, p.x, p.y, q.x, q.y); }
|
||||
#endif
|
||||
inline void DrawCircle(HDC hdc, int x, int y, int radius) { Ellipse(hdc, x - radius, y - radius, x + radius + 1, y + radius + 1); }
|
||||
inline void DrawCircle(HDC hdc, Point centre, int radius) { DrawCircle(hdc, centre.x, centre.y, radius); }
|
||||
inline void DrawEllipse(HDC hdc, const Rect& rc) { Ellipse(hdc, rc.left, rc.top, rc.right, rc.bottom); }
|
||||
|
||||
inline void DrawRect(HDC hdc, const Rect& rc) { Rectangle(hdc, rc.left, rc.top, rc.right, rc.bottom); }
|
||||
|
||||
HDC ScreenHDC();
|
||||
HPALETTE GetQlibPalette();
|
||||
|
||||
Image Win32Icon(LPCSTR id, int iconsize = 0);
|
||||
Image Win32Icon(int id, int iconsize = 0);
|
||||
Image Win32Cursor(LPCSTR id);
|
||||
Image Win32Cursor(int id);
|
||||
HICON IconWin32(const Image& img, bool cursor = false);
|
||||
Image Win32DllIcon(const char *dll, int ii, bool large);
|
||||
|
||||
class BackDraw : public SystemDraw {
|
||||
public:
|
||||
virtual bool IsPaintingOp(const Rect& r) const;
|
||||
|
||||
protected:
|
||||
HBITMAP hbmpold;
|
||||
HBITMAP hbmp;
|
||||
|
||||
Size size;
|
||||
Draw *painting;
|
||||
Point painting_offset;
|
||||
|
||||
public:
|
||||
void Put(SystemDraw& w, int x, int y);
|
||||
void Put(SystemDraw& w, Point p) { Put(w, p.x, p.y); }
|
||||
|
||||
void Create(SystemDraw& w, int cx, int cy);
|
||||
void Create(SystemDraw& w, Size sz) { Create(w, sz.cx, sz.cy); }
|
||||
void Destroy();
|
||||
|
||||
void SetPaintingDraw(Draw& w, Point off) { painting = &w; painting_offset = off; }
|
||||
|
||||
BackDraw();
|
||||
~BackDraw();
|
||||
};
|
||||
|
||||
class ImageDraw : public SystemDraw {
|
||||
Size size;
|
||||
|
||||
struct Section {
|
||||
HDC dc;
|
||||
HBITMAP hbmp, hbmpOld;
|
||||
RGBA *pixels;
|
||||
|
||||
void Init(int cx, int cy);
|
||||
~Section();
|
||||
};
|
||||
|
||||
Section rgb;
|
||||
Section a;
|
||||
SystemDraw alpha;
|
||||
|
||||
|
||||
bool has_alpha;
|
||||
|
||||
void Init();
|
||||
Image Get(bool pm) const;
|
||||
|
||||
public:
|
||||
Draw& Alpha();
|
||||
|
||||
operator Image() const;
|
||||
|
||||
Image GetStraight() const;
|
||||
|
||||
ImageDraw(Size sz);
|
||||
ImageDraw(int cx, int cy);
|
||||
~ImageDraw();
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#define GUIPLATFORM_KEYCODES_INCLUDE "Win32Keys.h"
|
||||
|
||||
|
||||
#define GUIPLATFORM_CTRL_TOP_DECLS \
|
||||
HWND hwnd; \
|
||||
UDropTarget *dndtgt; \
|
||||
|
||||
|
||||
#define GUIPLATFORM_CTRL_DECLS_INCLUDE "Win32Ctrl.h"
|
||||
|
||||
|
||||
#define GUIPLATFORM_PASTECLIP_DECLS \
|
||||
UDropTarget *dt; \
|
||||
|
||||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE "Win32Top.h"
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
inline unsigned GetHashValue(const HWND& hwnd)
|
||||
{
|
||||
return (unsigned)(intptr_t)hwnd;
|
||||
}
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
#ifndef PLATFORM_WINCE
|
||||
|
||||
#include <ShellAPI.h>
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define GUIPLATFORM_INCLUDE_AFTER "Win32GuiA.h"
|
||||
92
rainbow/Skeleton/Image.cpp
Normal file
92
rainbow/Skeleton/Image.cpp
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
#include <shellapi.h>
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
void SetSurface(SystemDraw& w, int x, int y, int cx, int cy, const RGBA *pixels)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SetSurface(SystemDraw& w, const Rect& dest, const RGBA *pixels, Size psz, Point poff)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
struct Image::Data::SystemData {
|
||||
};
|
||||
|
||||
void Image::Data::SysInitImp()
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
void Image::Data::SysReleaseImp()
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
Image::Data::SystemData& Image::Data::Sys() const
|
||||
{
|
||||
ASSERT(sizeof(system_buffer) >= sizeof(SystemData));
|
||||
return *(SystemData *)system_buffer;
|
||||
}
|
||||
|
||||
int Image::Data::GetResCountImp() const
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Image::Data::PaintImp(SystemDraw& w, int x, int y, const Rect& src, Color c)
|
||||
{
|
||||
GuiLock __;
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
ImageDraw::operator Image() const
|
||||
{
|
||||
return Image();
|
||||
}
|
||||
|
||||
Image ImageDraw::GetStraight() const
|
||||
{
|
||||
return Image();
|
||||
}
|
||||
|
||||
ImageDraw::ImageDraw(Size sz)
|
||||
{
|
||||
}
|
||||
|
||||
ImageDraw::ImageDraw(int cx, int cy)
|
||||
{
|
||||
}
|
||||
|
||||
ImageDraw::~ImageDraw()
|
||||
{
|
||||
}
|
||||
|
||||
Image Image::Arrow() { return Null; }
|
||||
Image Image::Wait() { return Null; }
|
||||
Image Image::IBeam() { return Null; }
|
||||
Image Image::No() { return Null; }
|
||||
Image Image::SizeAll() { return Null; }
|
||||
Image Image::SizeHorz() { return Null; }
|
||||
Image Image::SizeVert() { return Null; }
|
||||
Image Image::SizeTopLeft() { return Null; }
|
||||
Image Image::SizeTop() { return Null; }
|
||||
Image Image::SizeTopRight() { return Null; }
|
||||
Image Image::SizeLeft() { return Null; }
|
||||
Image Image::SizeRight() { return Null; }
|
||||
Image Image::SizeBottomLeft() { return Null; }
|
||||
Image Image::SizeBottom() { return Null; }
|
||||
Image Image::SizeBottomRight() { return Null; }
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
109
rainbow/Skeleton/Keys.h
Normal file
109
rainbow/Skeleton/Keys.h
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
K_BACK = VK_BACK + K_DELTA,
|
||||
K_BACKSPACE = VK_BACK + K_DELTA,
|
||||
|
||||
K_TAB = 9,
|
||||
|
||||
K_SPACE = 32,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_ENTER = K_RETURN,
|
||||
|
||||
K_SHIFT_KEY = VK_SHIFT + K_DELTA,
|
||||
K_CTRL_KEY = VK_CONTROL + K_DELTA,
|
||||
K_ALT_KEY = VK_MENU + K_DELTA,
|
||||
K_CAPSLOCK = VK_CAPITAL + K_DELTA,
|
||||
K_ESCAPE = VK_ESCAPE + K_DELTA,
|
||||
K_PRIOR = VK_PRIOR + K_DELTA,
|
||||
K_PAGEUP = VK_PRIOR + K_DELTA,
|
||||
K_NEXT = VK_NEXT + K_DELTA,
|
||||
K_PAGEDOWN = VK_NEXT + K_DELTA,
|
||||
K_END = VK_END + K_DELTA,
|
||||
K_HOME = VK_HOME + K_DELTA,
|
||||
K_LEFT = VK_LEFT + K_DELTA,
|
||||
K_UP = VK_UP + K_DELTA,
|
||||
K_RIGHT = VK_RIGHT + K_DELTA,
|
||||
K_DOWN = VK_DOWN + K_DELTA,
|
||||
K_INSERT = VK_INSERT + K_DELTA,
|
||||
K_DELETE = VK_DELETE + K_DELTA,
|
||||
|
||||
K_NUMPAD0 = VK_NUMPAD0 + K_DELTA,
|
||||
K_NUMPAD1 = VK_NUMPAD1 + K_DELTA,
|
||||
K_NUMPAD2 = VK_NUMPAD2 + K_DELTA,
|
||||
K_NUMPAD3 = VK_NUMPAD3 + K_DELTA,
|
||||
K_NUMPAD4 = VK_NUMPAD4 + K_DELTA,
|
||||
K_NUMPAD5 = VK_NUMPAD5 + K_DELTA,
|
||||
K_NUMPAD6 = VK_NUMPAD6 + K_DELTA,
|
||||
K_NUMPAD7 = VK_NUMPAD7 + K_DELTA,
|
||||
K_NUMPAD8 = VK_NUMPAD8 + K_DELTA,
|
||||
K_NUMPAD9 = VK_NUMPAD9 + K_DELTA,
|
||||
K_MULTIPLY = VK_MULTIPLY + K_DELTA,
|
||||
K_ADD = VK_ADD + K_DELTA,
|
||||
K_SEPARATOR = VK_SEPARATOR + K_DELTA,
|
||||
K_SUBTRACT = VK_SUBTRACT + K_DELTA,
|
||||
K_DECIMAL = VK_DECIMAL + K_DELTA,
|
||||
K_DIVIDE = VK_DIVIDE + K_DELTA,
|
||||
K_SCROLL = VK_SCROLL + K_DELTA,
|
||||
|
||||
K_F1 = VK_F1 + K_DELTA,
|
||||
K_F2 = VK_F2 + K_DELTA,
|
||||
K_F3 = VK_F3 + K_DELTA,
|
||||
K_F4 = VK_F4 + K_DELTA,
|
||||
K_F5 = VK_F5 + K_DELTA,
|
||||
K_F6 = VK_F6 + K_DELTA,
|
||||
K_F7 = VK_F7 + K_DELTA,
|
||||
K_F8 = VK_F8 + K_DELTA,
|
||||
K_F9 = VK_F9 + K_DELTA,
|
||||
K_F10 = VK_F10 + K_DELTA,
|
||||
K_F11 = VK_F11 + K_DELTA,
|
||||
K_F12 = VK_F12 + K_DELTA,
|
||||
|
||||
K_A = 'A' + K_DELTA,
|
||||
K_B = 'B' + K_DELTA,
|
||||
K_C = 'C' + K_DELTA,
|
||||
K_D = 'D' + K_DELTA,
|
||||
K_E = 'E' + K_DELTA,
|
||||
K_F = 'F' + K_DELTA,
|
||||
K_G = 'G' + K_DELTA,
|
||||
K_H = 'H' + K_DELTA,
|
||||
K_I = 'I' + K_DELTA,
|
||||
K_J = 'J' + K_DELTA,
|
||||
K_K = 'K' + K_DELTA,
|
||||
K_L = 'L' + K_DELTA,
|
||||
K_M = 'M' + K_DELTA,
|
||||
K_N = 'N' + K_DELTA,
|
||||
K_O = 'O' + K_DELTA,
|
||||
K_P = 'P' + K_DELTA,
|
||||
K_Q = 'Q' + K_DELTA,
|
||||
K_R = 'R' + K_DELTA,
|
||||
K_S = 'S' + K_DELTA,
|
||||
K_T = 'T' + K_DELTA,
|
||||
K_U = 'U' + K_DELTA,
|
||||
K_V = 'V' + K_DELTA,
|
||||
K_W = 'W' + K_DELTA,
|
||||
K_X = 'X' + K_DELTA,
|
||||
K_Y = 'Y' + K_DELTA,
|
||||
K_Z = 'Z' + K_DELTA,
|
||||
K_0 = '0' + K_DELTA,
|
||||
K_1 = '1' + K_DELTA,
|
||||
K_2 = '2' + K_DELTA,
|
||||
K_3 = '3' + K_DELTA,
|
||||
K_4 = '4' + K_DELTA,
|
||||
K_5 = '5' + K_DELTA,
|
||||
K_6 = '6' + K_DELTA,
|
||||
K_7 = '7' + K_DELTA,
|
||||
K_8 = '8' + K_DELTA,
|
||||
K_9 = '9' + K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET = K_CTRL|219|K_DELTA,
|
||||
K_CTRL_RBRACKET = K_CTRL|221|K_DELTA,
|
||||
K_CTRL_MINUS = K_CTRL|0xbd|K_DELTA,
|
||||
K_CTRL_GRAVE = K_CTRL|0xc0|K_DELTA,
|
||||
K_CTRL_SLASH = K_CTRL|0xbf|K_DELTA,
|
||||
K_CTRL_BACKSLASH = K_CTRL|0xdc|K_DELTA,
|
||||
K_CTRL_COMMA = K_CTRL|0xbc|K_DELTA,
|
||||
K_CTRL_PERIOD = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_SEMICOLON = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_EQUAL = K_CTRL|0xbb|K_DELTA,
|
||||
K_CTRL_APOSTROPHE= K_CTRL|0xde|K_DELTA,
|
||||
|
||||
K_BREAK = VK_CANCEL + K_DELTA,
|
||||
126
rainbow/Skeleton/Msg.i
Normal file
126
rainbow/Skeleton/Msg.i
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
#pragma BLITZ_APPROVE
|
||||
|
||||
x_MSG(WM_CREATE)
|
||||
x_MSG(WM_DESTROY)
|
||||
x_MSG(WM_MOVE)
|
||||
x_MSG(WM_SIZE)
|
||||
x_MSG(WM_ACTIVATE)
|
||||
x_MSG(WM_SETFOCUS)
|
||||
x_MSG(WM_KILLFOCUS)
|
||||
x_MSG(WM_ENABLE)
|
||||
x_MSG(WM_SETREDRAW)
|
||||
x_MSG(WM_SETTEXT)
|
||||
x_MSG(WM_GETTEXT)
|
||||
x_MSG(WM_GETTEXTLENGTH)
|
||||
x_MSG(WM_PAINT)
|
||||
x_MSG(WM_CLOSE)
|
||||
x_MSG(WM_QUIT)
|
||||
x_MSG(WM_ERASEBKGND)
|
||||
x_MSG(WM_SYSCOLORCHANGE)
|
||||
x_MSG(WM_SHOWWINDOW)
|
||||
x_MSG(WM_WININICHANGE)
|
||||
x_MSG(WM_FONTCHANGE)
|
||||
x_MSG(WM_NEXTDLGCTL)
|
||||
x_MSG(WM_DRAWITEM)
|
||||
x_MSG(WM_MEASUREITEM)
|
||||
x_MSG(WM_DELETEITEM)
|
||||
x_MSG(WM_VKEYTOITEM)
|
||||
x_MSG(WM_CHARTOITEM)
|
||||
x_MSG(WM_SETFONT)
|
||||
x_MSG(WM_GETFONT)
|
||||
x_MSG(WM_QUERYDRAGICON)
|
||||
x_MSG(WM_COMPAREITEM)
|
||||
x_MSG(WM_GETDLGCODE)
|
||||
x_MSG(WM_KEYDOWN)
|
||||
x_MSG(WM_KEYUP)
|
||||
x_MSG(WM_CHAR)
|
||||
x_MSG(WM_DEADCHAR)
|
||||
x_MSG(WM_SYSKEYDOWN)
|
||||
x_MSG(WM_SYSKEYUP)
|
||||
x_MSG(WM_SYSCHAR)
|
||||
x_MSG(WM_SYSDEADCHAR)
|
||||
x_MSG(WM_KEYLAST)
|
||||
x_MSG(WM_INITDIALOG)
|
||||
x_MSG(WM_COMMAND)
|
||||
x_MSG(WM_SYSCOMMAND)
|
||||
x_MSG(WM_TIMER)
|
||||
x_MSG(WM_HSCROLL)
|
||||
x_MSG(WM_VSCROLL)
|
||||
x_MSG(WM_INITMENUPOPUP)
|
||||
x_MSG(WM_MENUCHAR)
|
||||
x_MSG(WM_LBUTTONDOWN)
|
||||
x_MSG(WM_LBUTTONUP)
|
||||
x_MSG(WM_LBUTTONDBLCLK)
|
||||
x_MSG(WM_RBUTTONDOWN)
|
||||
x_MSG(WM_RBUTTONUP)
|
||||
x_MSG(WM_RBUTTONDBLCLK)
|
||||
x_MSG(WM_MBUTTONDOWN)
|
||||
x_MSG(WM_MBUTTONUP)
|
||||
x_MSG(WM_MBUTTONDBLCLK)
|
||||
x_MSG(WM_MOUSEMOVE)
|
||||
x_MSG(WM_CUT)
|
||||
x_MSG(WM_COPY)
|
||||
x_MSG(WM_PASTE)
|
||||
x_MSG(WM_CLEAR)
|
||||
x_MSG(WM_UNDO)
|
||||
x_MSG(WM_RENDERFORMAT)
|
||||
x_MSG(WM_RENDERALLFORMATS)
|
||||
x_MSG(WM_DESTROYCLIPBOARD)
|
||||
x_MSG(WM_QUERYNEWPALETTE)
|
||||
x_MSG(WM_PALETTECHANGED)
|
||||
x_MSG(WM_WINDOWPOSCHANGED)
|
||||
|
||||
#ifndef PLATFORM_WINCE
|
||||
x_MSG(WM_QUERYENDSESSION)
|
||||
x_MSG(WM_ENDSESSION)
|
||||
x_MSG(WM_QUERYOPEN)
|
||||
x_MSG(WM_DEVMODECHANGE)
|
||||
x_MSG(WM_ACTIVATEAPP)
|
||||
x_MSG(WM_TIMECHANGE)
|
||||
x_MSG(WM_MOUSEACTIVATE)
|
||||
x_MSG(WM_CHILDACTIVATE)
|
||||
x_MSG(WM_QUEUESYNC)
|
||||
x_MSG(WM_GETMINMAXINFO)
|
||||
x_MSG(WM_ICONERASEBKGND)
|
||||
x_MSG(WM_SPOOLERSTATUS)
|
||||
x_MSG(WM_COMPACTING)
|
||||
x_MSG(WM_NCLBUTTONDOWN)
|
||||
x_MSG(WM_NCLBUTTONUP)
|
||||
x_MSG(WM_NCLBUTTONDBLCLK)
|
||||
x_MSG(WM_NCRBUTTONDOWN)
|
||||
x_MSG(WM_NCRBUTTONUP)
|
||||
x_MSG(WM_NCRBUTTONDBLCLK)
|
||||
x_MSG(WM_NCMBUTTONDOWN)
|
||||
x_MSG(WM_NCMBUTTONUP)
|
||||
x_MSG(WM_NCMBUTTONDBLCLK)
|
||||
x_MSG(WM_NCCREATE)
|
||||
x_MSG(WM_NCDESTROY)
|
||||
x_MSG(WM_NCCALCSIZE)
|
||||
x_MSG(WM_NCPAINT)
|
||||
x_MSG(WM_NCACTIVATE)
|
||||
x_MSG(WM_INITMENU)
|
||||
x_MSG(WM_MENUSELECT)
|
||||
x_MSG(WM_PARENTNOTIFY)
|
||||
x_MSG(WM_MDICREATE)
|
||||
x_MSG(WM_MDIDESTROY)
|
||||
x_MSG(WM_MDIACTIVATE)
|
||||
x_MSG(WM_MDIRESTORE)
|
||||
x_MSG(WM_MDINEXT)
|
||||
x_MSG(WM_MDIMAXIMIZE)
|
||||
x_MSG(WM_MDITILE)
|
||||
x_MSG(WM_MDICASCADE)
|
||||
x_MSG(WM_MDIICONARRANGE)
|
||||
x_MSG(WM_MDIGETACTIVE)
|
||||
x_MSG(WM_MDISETMENU)
|
||||
x_MSG(WM_DRAWCLIPBOARD)
|
||||
x_MSG(WM_PAINTCLIPBOARD)
|
||||
x_MSG(WM_VSCROLLCLIPBOARD)
|
||||
x_MSG(WM_SIZECLIPBOARD)
|
||||
x_MSG(WM_ASKCBFORMATNAME)
|
||||
x_MSG(WM_CHANGECBCHAIN)
|
||||
x_MSG(WM_HSCROLLCLIPBOARD)
|
||||
x_MSG(WM_PALETTEISCHANGING)
|
||||
x_MSG(WM_DROPFILES)
|
||||
x_MSG(WM_POWER)
|
||||
x_MSG(WM_WINDOWPOSCHANGING)
|
||||
#endif
|
||||
24
rainbow/Skeleton/Proc.cpp
Normal file
24
rainbow/Skeleton/Proc.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
#include <winnls.h>
|
||||
|
||||
//#include "imm.h"
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
bool GetShift() { return false; }
|
||||
bool GetCtrl() { return false; }
|
||||
bool GetAlt() { return false; }
|
||||
bool GetCapsLock() { return false; }
|
||||
bool GetMouseLeft() { return false; }
|
||||
bool GetMouseRight() { return false; }
|
||||
bool GetMouseMiddle() { return false; }
|
||||
Point GetMousePos() { return Point(0, 0); }
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
129
rainbow/Skeleton/Skeleton.h
Normal file
129
rainbow/Skeleton/Skeleton.h
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
#define GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class SystemDraw : public Draw {
|
||||
public:
|
||||
virtual dword GetInfo() const;
|
||||
virtual Size GetPageSize() const;
|
||||
|
||||
virtual void BeginOp();
|
||||
virtual void EndOp();
|
||||
virtual void OffsetOp(Point p);
|
||||
virtual bool ClipOp(const Rect& r);
|
||||
virtual bool ClipoffOp(const Rect& r);
|
||||
virtual bool ExcludeClipOp(const Rect& r);
|
||||
virtual bool IntersectClipOp(const Rect& r);
|
||||
virtual bool IsPaintingOp(const Rect& r) const;
|
||||
virtual Rect GetPaintRect() const;
|
||||
|
||||
virtual void DrawRectOp(int x, int y, int cx, int cy, Color color);
|
||||
virtual void DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color);
|
||||
virtual void DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color);
|
||||
|
||||
virtual void DrawPolyPolylineOp(const Point *vertices, int vertex_count,
|
||||
const int *counts, int count_count,
|
||||
int width, Color color, Color doxor);
|
||||
virtual void DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count,
|
||||
const int *subpolygon_counts, int scc,
|
||||
const int *disjunct_polygon_counts, int dpcc,
|
||||
Color color, int width, Color outline,
|
||||
uint64 pattern, Color doxor);
|
||||
virtual void DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color);
|
||||
|
||||
virtual void DrawEllipseOp(const Rect& r, Color color, int pen, Color pencolor);
|
||||
virtual void DrawTextOp(int x, int y, int angle, const wchar *text, Font font,
|
||||
Color ink, int n, const int *dx);
|
||||
|
||||
virtual Size GetNativeDpi() const;
|
||||
virtual void BeginNative();
|
||||
virtual void EndNative();
|
||||
|
||||
virtual int GetCloffLevel() const;
|
||||
|
||||
|
||||
virtual ~SystemDraw();
|
||||
|
||||
Point GetOffset() const { return Point(0, 0); }
|
||||
bool CanSetSurface() { return false; }
|
||||
static void Flush() {}
|
||||
};
|
||||
|
||||
class BackDraw : public SystemDraw {
|
||||
Size size;
|
||||
Draw *painting;
|
||||
Point painting_offset;
|
||||
|
||||
public:
|
||||
virtual bool IsPaintingOp(const Rect& r) const;
|
||||
|
||||
public:
|
||||
void Put(SystemDraw& w, int x, int y);
|
||||
void Put(SystemDraw& w, Point p) { Put(w, p.x, p.y); }
|
||||
|
||||
void Create(SystemDraw& w, int cx, int cy);
|
||||
void Create(SystemDraw& w, Size sz) { Create(w, sz.cx, sz.cy); }
|
||||
void Destroy();
|
||||
|
||||
void SetPaintingDraw(Draw& w, Point off) { painting = &w; painting_offset = off; }
|
||||
|
||||
BackDraw();
|
||||
~BackDraw();
|
||||
};
|
||||
|
||||
class ImageDraw : public SystemDraw {
|
||||
SystemDraw alpha;
|
||||
bool has_alpha;
|
||||
Size size;
|
||||
|
||||
public:
|
||||
Draw& Alpha();
|
||||
|
||||
operator Image() const;
|
||||
|
||||
Image GetStraight() const;
|
||||
|
||||
ImageDraw(Size sz);
|
||||
ImageDraw(int cx, int cy);
|
||||
~ImageDraw();
|
||||
};
|
||||
|
||||
void DrawDragRect(SystemDraw& w, const Rect& rect1, const Rect& rect2, const Rect& clip, int n,
|
||||
Color color, uint64 pattern);
|
||||
|
||||
#define GUIPLATFORM_KEYCODES_INCLUDE <Skeleton/Keys.h>
|
||||
|
||||
#define GUIPLATFORM_CTRL_TOP_DECLS
|
||||
|
||||
#define GUIPLATFORM_CTRL_DECLS_INCLUDE <Skeleton/Ctrl.h>
|
||||
|
||||
#define GUIPLATFORM_PASTECLIP_DECLS
|
||||
|
||||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE <Skeleton/Top.h>
|
||||
|
||||
class PrinterJob {
|
||||
NilDraw nil;
|
||||
Vector<int> pages;
|
||||
|
||||
public:
|
||||
Draw& GetDraw() { return nil; }
|
||||
operator Draw&() { return GetDraw(); }
|
||||
const Vector<int>& GetPages() const { return pages; }
|
||||
int operator[](int i) const { return 0; }
|
||||
int GetPageCount() const { return 0; }
|
||||
|
||||
bool Execute() { return false; }
|
||||
|
||||
PrinterJob& Landscape(bool b = true) { return *this; }
|
||||
PrinterJob& MinMaxPage(int minpage, int maxpage) { return *this; }
|
||||
PrinterJob& PageCount(int n) { return *this; }
|
||||
PrinterJob& CurrentPage(int currentpage) { return *this; }
|
||||
PrinterJob& Name(const char *_name) { return *this; }
|
||||
|
||||
PrinterJob(const char *name = NULL) {}
|
||||
~PrinterJob() {}
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#define GUIPLATFORM_INCLUDE_AFTER <Skeleton/After.h>
|
||||
20
rainbow/Skeleton/Skeleton.upp
Normal file
20
rainbow/Skeleton/Skeleton.upp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
file
|
||||
Skeleton.h,
|
||||
After.h,
|
||||
Keys.h,
|
||||
DrawOp.cpp,
|
||||
DrawText.cpp,
|
||||
Draw.cpp,
|
||||
Image.cpp,
|
||||
Util.cpp,
|
||||
Ctrl.h,
|
||||
Ctrl.cpp,
|
||||
Wnd.cpp,
|
||||
Proc.cpp,
|
||||
Top.h,
|
||||
Top.cpp,
|
||||
Clip.cpp,
|
||||
DnD.cpp,
|
||||
ChSysInit.cpp,
|
||||
Msg.i;
|
||||
|
||||
81
rainbow/Skeleton/Top.cpp
Normal file
81
rainbow/Skeleton/Top.cpp
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
void TopWindow::SyncSizeHints() {}
|
||||
|
||||
void TopWindow::SyncTitle0()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void TopWindow::SyncCaption0()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void TopWindow::Open(Ctrl *owner)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void TopWindow::Open()
|
||||
{
|
||||
}
|
||||
|
||||
void TopWindow::OpenMain()
|
||||
{
|
||||
}
|
||||
|
||||
void TopWindow::Minimize(bool effect)
|
||||
{
|
||||
state = MINIMIZED;
|
||||
}
|
||||
|
||||
TopWindow& TopWindow::FullScreen(bool b)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
void TopWindow::Maximize(bool effect)
|
||||
{
|
||||
state = MAXIMIZED;
|
||||
}
|
||||
|
||||
void TopWindow::Overlap(bool effect)
|
||||
{
|
||||
GuiLock __;
|
||||
state = OVERLAPPED;
|
||||
}
|
||||
|
||||
TopWindow& TopWindow::TopMost(bool b, bool stay_top)
|
||||
{
|
||||
GuiLock __;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool TopWindow::IsTopMost() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void TopWindow::GuiPlatformConstruct()
|
||||
{
|
||||
}
|
||||
|
||||
void TopWindow::GuiPlatformDestruct()
|
||||
{
|
||||
}
|
||||
|
||||
void TopWindow::SerializePlacement(Stream& s, bool reminimize)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
3
rainbow/Skeleton/Top.h
Normal file
3
rainbow/Skeleton/Top.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
//$ class TopWindow {
|
||||
|
||||
//$ };
|
||||
20
rainbow/Skeleton/Util.cpp
Normal file
20
rainbow/Skeleton/Util.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
void DrawDragRect(SystemDraw& w, const Rect& rect1, const Rect& rect2, const Rect& clip, int n, Color color, uint64 pattern)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Size GetScreenSize()
|
||||
{
|
||||
return ScreenInfo().GetPageSize();
|
||||
}
|
||||
*/
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
375
rainbow/Skeleton/Wnd.cpp
Normal file
375
rainbow/Skeleton/Wnd.cpp
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_EMPTY
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LOGTIMING 0
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define LOGMESSAGES 0
|
||||
#endif
|
||||
|
||||
#define ELOGW(x) // RLOG(GetSysTime() << ": " << x) // Only activate in MT!
|
||||
#define ELOG(x) // RLOG(GetSysTime() << ": " << x)
|
||||
|
||||
bool Ctrl::IsAlphaSupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::IsCompositedGui()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector<Ctrl *> Ctrl::GetTopCtrls()
|
||||
{
|
||||
Vector<Ctrl *> h;
|
||||
return h;
|
||||
}
|
||||
|
||||
void Ctrl::SetMouseCursor(const Image& image)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
Ctrl *Ctrl::GetOwner()
|
||||
{
|
||||
GuiLock __;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Ctrl *Ctrl::GetActiveCtrl()
|
||||
{
|
||||
GuiLock __;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Vector<Callback> Ctrl::hotkey;
|
||||
|
||||
int Ctrl::RegisterSystemHotKey(dword key, Callback cb)
|
||||
{
|
||||
/* ASSERT(key >= K_DELTA);
|
||||
int q = hotkey.GetCount();
|
||||
for(int i = 0; i < hotkey.GetCount(); i++)
|
||||
if(!hotkey[i]) {
|
||||
q = i;
|
||||
break;
|
||||
}
|
||||
hotkey.At(q) = cb;
|
||||
dword mod = 0;
|
||||
if(key & K_ALT)
|
||||
mod |= MOD_ALT;
|
||||
if(key & K_SHIFT)
|
||||
mod |= MOD_SHIFT;
|
||||
if(key & K_CTRL)
|
||||
mod |= MOD_CONTROL;
|
||||
|
||||
return RegisterHotKey(NULL, q, mod, key & 0xffff) ? q : -1;*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Ctrl::UnregisterSystemHotKey(int id)
|
||||
{
|
||||
/* if(id >= 0 && id < hotkey.GetCount()) {
|
||||
UnregisterHotKey(NULL, id);
|
||||
hotkey[id].Clear();
|
||||
}*/
|
||||
}
|
||||
|
||||
bool Ctrl::IsWaitingEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::ProcessEvent(bool *quit)
|
||||
{
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
}
|
||||
|
||||
void SweepMkImageCache();
|
||||
|
||||
bool Ctrl::ProcessEvents(bool *quit)
|
||||
{
|
||||
/* if(ProcessEvent(quit)) {
|
||||
while(ProcessEvent(quit) && (!LoopCtrl || LoopCtrl->InLoop())); // LoopCtrl-MF 071008
|
||||
TimerProc(GetTickCount());
|
||||
SweepMkImageCache();
|
||||
return true;
|
||||
}
|
||||
SweepMkImageCache();
|
||||
TimerProc(GetTickCount());*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Ctrl::EventLoop0(Ctrl *ctrl)
|
||||
{
|
||||
GuiLock __;
|
||||
/* ASSERT(IsMainThread());
|
||||
ASSERT(LoopLevel == 0 || ctrl);
|
||||
LoopLevel++;
|
||||
LLOG("Entering event loop at level " << LoopLevel << BeginIndent);
|
||||
Ptr<Ctrl> ploop;
|
||||
if(ctrl) {
|
||||
ploop = LoopCtrl;
|
||||
LoopCtrl = ctrl;
|
||||
ctrl->inloop = true;
|
||||
}
|
||||
|
||||
bool quit = false;
|
||||
ProcessEvents(&quit);
|
||||
while(!EndSession() && !quit && ctrl ? ctrl->IsOpen() && ctrl->InLoop() : GetTopCtrls().GetCount())
|
||||
{
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / GuiSleep");
|
||||
SyncCaret();
|
||||
GuiSleep(1000);
|
||||
if(EndSession()) break;
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / ProcessEvents");
|
||||
ProcessEvents(&quit);
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / after ProcessEvents");
|
||||
}
|
||||
|
||||
if(ctrl)
|
||||
LoopCtrl = ploop;
|
||||
LoopLevel--;
|
||||
LLOG(EndIndent << "Leaving event loop ");*/
|
||||
}
|
||||
|
||||
void Ctrl::GuiSleep0(int ms)
|
||||
{
|
||||
GuiLock __;
|
||||
/* ASSERT(IsMainThread());
|
||||
ELOG("GuiSleep");
|
||||
if(EndSession())
|
||||
return;
|
||||
ELOG("GuiSleep 2");
|
||||
int level = LeaveGMutexAll();
|
||||
#if !defined(flagDLL) && !defined(PLATFORM_WINCE)
|
||||
if(!OverwatchThread) {
|
||||
DWORD dummy;
|
||||
OverwatchThread = CreateThread(NULL, 0x100000, Win32OverwatchThread, NULL, 0, &dummy);
|
||||
ELOG("ExitLoopEventWait 1");
|
||||
ExitLoopEvent.Wait();
|
||||
}
|
||||
HANDLE h[1];
|
||||
*h = ExitLoopEvent.GetHandle();
|
||||
ELOG("ExitLoopEventWait 2 " << (void *)*h);
|
||||
MsgWaitForMultipleObjects(1, h, FALSE, ms, QS_ALLINPUT);
|
||||
#else
|
||||
MsgWaitForMultipleObjects(0, NULL, FALSE, ms, QS_ALLINPUT);
|
||||
#endif
|
||||
EnterGMutex(level);*/
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWndUpdateRect() const
|
||||
{
|
||||
GuiLock __;
|
||||
Rect r;
|
||||
return r;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWndScreenRect() const
|
||||
{
|
||||
GuiLock __;
|
||||
Rect r;
|
||||
return r;
|
||||
}
|
||||
|
||||
void Ctrl::WndShow0(bool b)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void Ctrl::WndUpdate0()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
bool Ctrl::IsWndOpen() const {
|
||||
GuiLock __;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Ctrl::SetAlpha(byte alpha)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWorkArea() const
|
||||
{
|
||||
GuiLock __;
|
||||
return Rect();
|
||||
}
|
||||
|
||||
void Ctrl::GetWorkArea(Array<Rect>& rc)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetVirtualWorkArea()
|
||||
{
|
||||
Rect out = GetPrimaryWorkArea();
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
for(int i = 0; i < rc.GetCount(); i++)
|
||||
out |= rc[i];
|
||||
return out;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWorkArea(Point pt)
|
||||
{
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
for(int i = 0; i < rc.GetCount(); i++)
|
||||
if(rc[i].Contains(pt))
|
||||
return rc[i];
|
||||
return GetPrimaryWorkArea();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetVirtualScreenArea()
|
||||
{
|
||||
GuiLock __;
|
||||
return Rect();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetPrimaryWorkArea()
|
||||
{
|
||||
Rect r;
|
||||
return r;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetPrimaryScreenArea()
|
||||
{
|
||||
return Size();
|
||||
}
|
||||
|
||||
int Ctrl::GetKbdDelay()
|
||||
{
|
||||
GuiLock __;
|
||||
return 500;
|
||||
}
|
||||
|
||||
int Ctrl::GetKbdSpeed()
|
||||
{
|
||||
GuiLock __;
|
||||
return 1000 / 32;
|
||||
}
|
||||
|
||||
void Ctrl::WndDestroy0()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::SetWndForeground0()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
bool Ctrl::IsWndForeground() const
|
||||
{
|
||||
GuiLock __;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Ctrl::WndEnable0(bool *b)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void Ctrl::SetWndFocus0(bool *b)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
bool Ctrl::HasWndFocus() const
|
||||
{
|
||||
GuiLock __;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::SetWndCapture()
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::ReleaseWndCapture()
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::HasWndCapture() const
|
||||
{
|
||||
GuiLock __;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Ctrl::WndInvalidateRect0(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void Ctrl::WndSetPos0(const Rect& rect)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void Ctrl::WndUpdate0r(const Rect& r)
|
||||
{
|
||||
GuiLock __;
|
||||
|
||||
}
|
||||
|
||||
void Ctrl::WndScrollView0(const Rect& r, int dx, int dy)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void Ctrl::PopUp(Ctrl *owner, bool savebits, bool activate, bool dropshadow, bool topmost)
|
||||
{
|
||||
}
|
||||
|
||||
Rect Ctrl::GetDefaultWindowRect() {
|
||||
return Rect(0, 0, 100, 100);
|
||||
}
|
||||
|
||||
ViewDraw::ViewDraw(Ctrl *ctrl)
|
||||
{
|
||||
EnterGuiMutex();
|
||||
}
|
||||
|
||||
ViewDraw::~ViewDraw()
|
||||
{
|
||||
LeaveGuiMutex();
|
||||
}
|
||||
|
||||
Vector<WString> SplitCmdLine__(const char *cmd)
|
||||
{
|
||||
Vector<WString> out;
|
||||
while(*cmd)
|
||||
if((byte)*cmd <= ' ')
|
||||
cmd++;
|
||||
else if(*cmd == '\"') {
|
||||
WString quoted;
|
||||
while(*++cmd && (*cmd != '\"' || *++cmd == '\"'))
|
||||
quoted.Cat(FromSystemCharset(String(cmd, 1)).ToWString());
|
||||
out.Add(quoted);
|
||||
}
|
||||
else {
|
||||
const char *begin = cmd;
|
||||
while((byte)*cmd > ' ')
|
||||
cmd++;
|
||||
out.Add(String(begin, cmd).ToWString());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
3
rainbow/Skeleton/init
Normal file
3
rainbow/Skeleton/init
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#ifndef _Skeleton_icpp_init_stub
|
||||
#define _Skeleton_icpp_init_stub
|
||||
#endif
|
||||
|
|
@ -5,13 +5,14 @@ uses
|
|||
RichEdit,
|
||||
PdfDraw,
|
||||
plugin\jpg,
|
||||
WinAlt;
|
||||
WinAlt,
|
||||
Skeleton;
|
||||
|
||||
file
|
||||
UWord.cpp,
|
||||
UWord.iml;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI",
|
||||
"" = "GUI .NOGTK";
|
||||
"" = "GUI WINALT",
|
||||
"" = "GUI SKELETON";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
#include "PdfDraw/init"
|
||||
#include "plugin\jpg/init"
|
||||
#include "WinAlt/init"
|
||||
#include "Skeleton/init"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ HFONT GetWin32Font(Font fnt, int angle);
|
|||
void SystemDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink,
|
||||
int n, const int *dx) {
|
||||
Std(font);
|
||||
font.Bold();
|
||||
while(n > 30000) {
|
||||
DrawTextOp(x, y, angle, text, font, ink, 30000, dx);
|
||||
if(dx)
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ public:
|
|||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#define GUIPLATFORM_KEYCODES_INCLUDE "Win32Keys.h"
|
||||
#define GUIPLATFORM_KEYCODES_INCLUDE <WinAlt/WinAltKeys.h>
|
||||
|
||||
|
||||
#define GUIPLATFORM_CTRL_TOP_DECLS \
|
||||
|
|
@ -331,13 +331,13 @@ END_UPP_NAMESPACE
|
|||
UDropTarget *dndtgt; \
|
||||
|
||||
|
||||
#define GUIPLATFORM_CTRL_DECLS_INCLUDE "Win32Ctrl.h"
|
||||
#define GUIPLATFORM_CTRL_DECLS_INCLUDE <WinAlt/WinAltCtrl.h>
|
||||
|
||||
|
||||
#define GUIPLATFORM_PASTECLIP_DECLS \
|
||||
UDropTarget *dt; \
|
||||
|
||||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE "Win32Top.h"
|
||||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE <WinAlt/WinAltTop.h>
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ file
|
|||
TopWinAlt.cpp,
|
||||
WinAltClip.cpp,
|
||||
WinAltDnD.cpp,
|
||||
ChSysInit.cpp;
|
||||
ChSysInit.cpp,
|
||||
WinAltMsg.i;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
#define GUIPLATFORM_INCLUDE <WinAlt/WinAlt.h>
|
||||
#ifdef flagSKELETON
|
||||
#define GUIPLATFORM_INCLUDE <Skeleton/Skeleton.h>
|
||||
#endif
|
||||
|
||||
#ifdef flagWINALT
|
||||
#define GUIPLATFORM_INCLUDE <WinAlt/WinAlt.h>
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue