diff --git a/uppsrc/CodeEditor/CodeEditor.h b/uppsrc/CodeEditor/CodeEditor.h index aa2ba3d75..5e9e95ce0 100644 --- a/uppsrc/CodeEditor/CodeEditor.h +++ b/uppsrc/CodeEditor/CodeEditor.h @@ -180,6 +180,7 @@ public: enum { HIGHLIGHT_NONE = -1, HIGHLIGHT_CPP = 0, HIGHLIGHT_USC, HIGHLIGHT_JAVA, HIGHLIGHT_T, HIGHLIGHT_CALC, HIGHLIGHT_LAY, HIGHLIGHT_SCH, HIGHLIGHT_SQL, HIGHLIGHT_JAVASCRIPT, + HIGHLIGHT_CSS, HIGHLIGHT_COUNT }; diff --git a/uppsrc/CodeEditor/Highlight.cpp b/uppsrc/CodeEditor/Highlight.cpp index ded71ec78..e67ae28fa 100644 --- a/uppsrc/CodeEditor/Highlight.cpp +++ b/uppsrc/CodeEditor/Highlight.cpp @@ -328,6 +328,26 @@ void CodeEditor::InitKeywords() "debugger", "super", "true", "false", "undefined", NULL }; + static const char *css[] = { + "azimuth", "background-attachment", "background-color", "background-image", "background-position", + "background-repeat", "background", "border-collapse", "border-color", "border-spacing", "border-style", + "border-top", "border-right", "border-bottom", "border-left", "border-top-color", "border-right-color", + "border-bottom-color", "border-left-color", "border-top-style", "border-right-style", "border-bottom-style", + "border-left-style", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", + "border-width", "border", "bottom", "caption-side", "clear", "clip", "color", "content", "counter-increment", + "counter-reset", "cue-after", "cue-before", "cue", "cursor", "direction", "display", "elevation", "empty-cells", + "float", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "height", "left", + "letter-spacing", "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", + "margin-right", "margin-left", "margin-top", "margin-bottom", "margin", "max-height", "max-width", "min-height", + "min-width", "orphans", "outline-color", "outline-style", "outline-width", "outline", "overflow", "padding-top", + "padding-right", "padding-bottom", "padding-left", "padding", "page-break-after", "page-break-before", + "page-break-inside", "pause-after", "pause-before", "pause", "pitch-range", "pitch", "play-during", "position", + "quotes", "richness", "right", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", + "stress", "table-layout", "text-align", "text-decoration", "text-indent", "text-transform", "top", + "unicode-bidi", "vertical-align", "visibility", "voice-family", "volume", "white-space", "widows", "width", + "word-spacing", "z-index", + NULL + }; static const char *upp_macros[] = { "CLASSNAME", "THISBACK", "THISBACK1", "THISBACK2", "THISBACK3", "THISBACK4", "PTEBACK", "PTEBACK1", "PTEBACK2", "PTEBACK3", "PTEBACK4", @@ -431,10 +451,10 @@ void CodeEditor::InitKeywords() NULL }; static const char **kw[HIGHLIGHT_COUNT] = { - cpp, usc, java, tfile, usc, lay, sch, sql, javascript + cpp, usc, java, tfile, usc, lay, sch, sql, javascript, css, }; static const char **nm[HIGHLIGHT_COUNT] = { - upp, usclib, javan, tlng, usclib, javan, javan, javan, javascriptn + upp, usclib, javan, tlng, usclib, javan, javan, javan, javascriptn, javan, }; const char **q = NULL; for(int i = 0; i < HIGHLIGHT_COUNT; i++) { @@ -503,7 +523,7 @@ void CodeEditor::HighlightLine(int line, Vector& hl, int po p++; hls.Put(hl_style[INK_NORMAL]); } - if(*p == '#' && highlight != HIGHLIGHT_JAVASCRIPT) { + if(*p == '#' && highlight != HIGHLIGHT_JAVASCRIPT && highlight != HIGHLIGHT_CSS) { static const char *pd[] = { "define", "error", "if", "elif", "else", "endif", "ifdef", "ifndef", "include", "line", "undef", "pragma", diff --git a/uppsrc/CtrlCore/Win32Wnd.cpp b/uppsrc/CtrlCore/Win32Wnd.cpp index 4e129208f..3e6c28fd3 100644 --- a/uppsrc/CtrlCore/Win32Wnd.cpp +++ b/uppsrc/CtrlCore/Win32Wnd.cpp @@ -219,8 +219,11 @@ void WakeUpGuiThread() ::PostThreadMessage(sMainThreadId, WM_NULL, 0, 0); } +void AvoidPaintingCheck__(); + static void Win32PanicMessageBox(const char *title, const char *text) { + AvoidPaintingCheck__(); #ifdef PLATFORM_WINCE static wchar wtext[256], wtitle[256]; ToUnicode(wtext, text, strlen(text), CHARSET_DEFAULT); diff --git a/uppsrc/PostgreSQL/PostgreSQL.cpp b/uppsrc/PostgreSQL/PostgreSQL.cpp index 3cfa65932..e3cbd965e 100644 --- a/uppsrc/PostgreSQL/PostgreSQL.cpp +++ b/uppsrc/PostgreSQL/PostgreSQL.cpp @@ -371,7 +371,12 @@ bool PostgreSQLSession::Open(const char *connect) DoKeepAlive(); LLOG( String("Postgresql client encoding: ") + pg_encoding_to_char( PQclientEncoding(conn) ) ); - + + + Sql sql(*this); + if(sql.Execute("select setting from pg_settings where name = 'bytea_output'") && sql[0] == "hex") + hex_blobs = true; + return true; } @@ -627,10 +632,14 @@ void PostgreSQLConnection::GetColumn(int i, Ref f) const break; default: { if(oid[i] == PGSQL_BYTEAOID) { - size_t len; - unsigned char *q = PQunescapeBytea((const unsigned char *)s, &len); - f.SetValue(String(q, len)); - PQfreemem(q); + if(session.hex_blobs) + f.SetValue(ScanHexString(s, strlen(s))); + else { + size_t len; + unsigned char *q = PQunescapeBytea((const unsigned char *)s, &len); + f.SetValue(String(q, len)); + PQfreemem(q); + } } else f.SetValue(FromCharset(String(s))); diff --git a/uppsrc/PostgreSQL/PostgreSQL.h b/uppsrc/PostgreSQL/PostgreSQL.h index 363b7b9a7..96974a136 100644 --- a/uppsrc/PostgreSQL/PostgreSQL.h +++ b/uppsrc/PostgreSQL/PostgreSQL.h @@ -54,6 +54,7 @@ private: String conns; bool keepalive; + bool hex_blobs; void ExecTrans(const char * statement); Vector EnumData(char type, const char *schema = NULL); @@ -88,7 +89,7 @@ public: virtual void Rollback(); virtual int GetTransactionLevel() const; - PostgreSQLSession() { conn = NULL; Dialect(PGSQL); level = 0; keepalive = false; } + PostgreSQLSession() { conn = NULL; Dialect(PGSQL); level = 0; keepalive = hex_blobs = false; } ~PostgreSQLSession() { Close(); } PGconn * GetPGConn() { return conn; } }; diff --git a/uppsrc/ide/idefile.cpp b/uppsrc/ide/idefile.cpp index 73f0b6b7e..d8732dc3c 100644 --- a/uppsrc/ide/idefile.cpp +++ b/uppsrc/ide/idefile.cpp @@ -26,6 +26,9 @@ void Ide::SetupEditor(int f, String hl, String fn) if(hl == "js") editor.Highlight(CodeEditor::HIGHLIGHT_JAVASCRIPT); else + if(hl == "css") + editor.Highlight(CodeEditor::HIGHLIGHT_CSS); + else if(hl == "t" || hl == "jt") editor.Highlight(CodeEditor::HIGHLIGHT_T); else @@ -123,6 +126,7 @@ void Ide::FileProperties() d.highlight.Add("cpp", "C++"); d.highlight.Add("java", "Java"); d.highlight.Add("js", "JavaScript"); + d.highlight.Add("css", "CSS"); d.highlight.Add("sql", "SQL"); d.highlight.Add("usc", "Esc"); d.highlight.Add("sch", "DB schema"); diff --git a/uppsrc/ide/init b/uppsrc/ide/init index eae532253..c1fe1e9f4 100644 --- a/uppsrc/ide/init +++ b/uppsrc/ide/init @@ -17,6 +17,6 @@ #include "usvn/init" #include "TextDiffCtrl/init" #include "TabBar/init" -#include "ide\SrcUpdater/init" #include "ide\Img/init" +#include "ide\SrcUpdater/init" #endif