From bfa6fcc206a50a7df160da7dbb4500abab034eb4 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 23 Oct 2011 11:59:49 +0000 Subject: [PATCH] .uppweb: developing git-svn-id: svn://ultimatepp.org/upp/trunk@4091 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- rainbow/Skeleton/Keys.h | 218 ++++++++++++++--------------- rainbow/Skeleton/Skeleton.h | 267 ++++++++++++++++++------------------ 2 files changed, 242 insertions(+), 243 deletions(-) diff --git a/rainbow/Skeleton/Keys.h b/rainbow/Skeleton/Keys.h index 000cea433..65bf2f058 100644 --- a/rainbow/Skeleton/Keys.h +++ b/rainbow/Skeleton/Keys.h @@ -1,109 +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, +K_BACK = 53000, +K_BACKSPACE, + +K_TAB, + +K_SPACE, + +K_RETURN, +K_ENTER, + +K_SHIFT_KEY, +K_CTRL_KEY, +K_ALT_KEY, +K_CAPSLOCK, +K_ESCAPE, +K_PRIOR, +K_PAGEUP, +K_NEXT, +K_PAGEDOWN, +K_END, +K_HOME, +K_LEFT, +K_UP, +K_RIGHT, +K_DOWN, +K_INSERT, +K_DELETE, + +K_NUMPAD0, +K_NUMPAD1, +K_NUMPAD2, +K_NUMPAD3, +K_NUMPAD4, +K_NUMPAD5, +K_NUMPAD6, +K_NUMPAD7, +K_NUMPAD8, +K_NUMPAD9, +K_MULTIPLY, +K_ADD, +K_SEPARATOR, +K_SUBTRACT, +K_DECIMAL, +K_DIVIDE, +K_SCROLL, + +K_F1, +K_F2, +K_F3, +K_F4, +K_F5, +K_F6, +K_F7, +K_F8, +K_F9, +K_F10, +K_F11, +K_F12, + +K_A, +K_B, +K_C, +K_D, +K_E, +K_F, +K_G, +K_H, +K_I, +K_J, +K_K, +K_L, +K_M, +K_N, +K_O, +K_P, +K_Q, +K_R, +K_S, +K_T, +K_U, +K_V, +K_W, +K_X, +K_Y, +K_Z, +K_0, +K_1, +K_2, +K_3, +K_4, +K_5, +K_6, +K_7, +K_8, +K_9, + +K_CTRL_LBRACKET, +K_CTRL_RBRACKET, +K_CTRL_MINUS, +K_CTRL_GRAVE, +K_CTRL_SLASH, +K_CTRL_BACKSLASH, +K_CTRL_COMMA, +K_CTRL_PERIOD, +K_CTRL_SEMICOLON, +K_CTRL_EQUAL, +K_CTRL_APOSTROPHE, + +K_BREAK, diff --git a/rainbow/Skeleton/Skeleton.h b/rainbow/Skeleton/Skeleton.h index 4b0860501..d5ba26bd8 100644 --- a/rainbow/Skeleton/Skeleton.h +++ b/rainbow/Skeleton/Skeleton.h @@ -1,134 +1,133 @@ -#define GUI_SKELETON - -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); - -#ifndef PLATFORM_WIN32 -#include -#include "../LinuxFb/vkcodes.h" //FIXME -#endif - -#define GUIPLATFORM_KEYCODES_INCLUDE - -#define GUIPLATFORM_CTRL_TOP_DECLS - -#define GUIPLATFORM_CTRL_DECLS_INCLUDE - -#define GUIPLATFORM_PASTECLIP_DECLS - -#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE - -class PrinterJob { - NilDraw nil; - Vector pages; - -public: - Draw& GetDraw() { return nil; } - operator Draw&() { return GetDraw(); } - const Vector& 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 +#define GUI_SKELETON + +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); + +#ifndef PLATFORM_WIN32 +#include +#endif + +#define GUIPLATFORM_KEYCODES_INCLUDE + +#define GUIPLATFORM_CTRL_TOP_DECLS + +#define GUIPLATFORM_CTRL_DECLS_INCLUDE + +#define GUIPLATFORM_PASTECLIP_DECLS + +#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE + +class PrinterJob { + NilDraw nil; + Vector pages; + +public: + Draw& GetDraw() { return nil; } + operator Draw&() { return GetDraw(); } + const Vector& 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