From: Dirk B. <db...@us...> - 2005-09-03 10:13:22
|
Update of /cvsroot/win32forth/win32forth-extsrc/extsrc/w32fScintilla/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30133/extsrc/w32fScintilla/gtk Modified Files: PlatGTK.cxx ScintillaGTK.cxx makefile scintilla.mak Log Message: w32fScintilla.dll updated to use the latest Version 1.66 of the scintilla control. Index: PlatGTK.cxx =================================================================== RCS file: /cvsroot/win32forth/win32forth-extsrc/extsrc/w32fScintilla/gtk/PlatGTK.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlatGTK.cxx 22 Dec 2004 20:25:53 -0000 1.1 --- PlatGTK.cxx 3 Sep 2005 10:13:13 -0000 1.2 *************** *** 287,290 **** --- 287,292 ---- case SC_CHARSET_RUSSIAN: return "*-r"; + case SC_CHARSET_CYRILLIC: + return "*-cp1251"; case SC_CHARSET_SHIFTJIS: return "jisx0208.1983-*"; *************** *** 303,306 **** --- 305,310 ---- case SC_CHARSET_THAI: return "*-1"; + case SC_CHARSET_8859_15: + return "iso8859-15"; default: return "*-*"; *************** *** 743,746 **** --- 747,752 ---- case SC_CHARSET_RUSSIAN: return "KOI8-R"; + case SC_CHARSET_CYRILLIC: + return "CP1251"; case SC_CHARSET_SHIFTJIS: return "SHIFT-JIS"; *************** *** 759,762 **** --- 765,770 ---- case SC_CHARSET_THAI: return "ISO-8859-1"; + case SC_CHARSET_8859_15: + return "ISO-8859-15"; default: return ""; *************** *** 1251,1254 **** --- 1259,1263 ---- int totalWidth = 0; #ifdef USE_PANGO + const int lenPositions = len; if (PFont(font_)->pfd) { if (len == 1) { *************** *** 1264,1278 **** // Simple and direct as UTF-8 is native Pango encoding pango_layout_set_text(layout, s, len); ! PangoLayoutIter *iter = pango_layout_get_iter (layout); int i = 0; ! while (pango_layout_iter_next_cluster (iter)) { pango_layout_iter_get_cluster_extents(iter, NULL, &pos); int position = PANGO_PIXELS(pos.x); ! int curIndex = pango_layout_iter_get_index (iter); while (i < curIndex) { positions[i++] = position; } } ! pango_layout_iter_free (iter); } else { int positionsCalculated = 0; --- 1273,1291 ---- // Simple and direct as UTF-8 is native Pango encoding pango_layout_set_text(layout, s, len); ! PangoLayoutIter *iter = pango_layout_get_iter(layout); ! pango_layout_iter_get_cluster_extents(iter, NULL, &pos); int i = 0; ! while (pango_layout_iter_next_cluster(iter)) { pango_layout_iter_get_cluster_extents(iter, NULL, &pos); int position = PANGO_PIXELS(pos.x); ! int curIndex = pango_layout_iter_get_index(iter); while (i < curIndex) { positions[i++] = position; } } ! while (i < lenPositions) ! positions[i++] = PANGO_PIXELS(pos.x + pos.width); ! pango_layout_iter_free(iter); ! PLATFORM_ASSERT(i == lenPositions); } else { int positionsCalculated = 0; *************** *** 1288,1296 **** int i = 0; int utfIndex = 0; ! PangoLayoutIter *iter = pango_layout_get_iter (layout); ! while (pango_layout_iter_next_cluster (iter)) { pango_layout_iter_get_cluster_extents (iter, NULL, &pos); int position = PANGO_PIXELS(pos.x); ! int utfIndexNext = pango_layout_iter_get_index (iter); while (utfIndex < utfIndexNext) { size_t lenChar = MultiByteLenFromIconv(convMeasure, s+i, len-i); --- 1301,1310 ---- int i = 0; int utfIndex = 0; ! PangoLayoutIter *iter = pango_layout_get_iter(layout); ! pango_layout_iter_get_cluster_extents(iter, NULL, &pos); ! while (pango_layout_iter_next_cluster(iter)) { pango_layout_iter_get_cluster_extents (iter, NULL, &pos); int position = PANGO_PIXELS(pos.x); ! int utfIndexNext = pango_layout_iter_get_index(iter); while (utfIndex < utfIndexNext) { size_t lenChar = MultiByteLenFromIconv(convMeasure, s+i, len-i); *************** *** 1303,1308 **** } } ! pango_layout_iter_free (iter); delete []utfForm; } } --- 1317,1325 ---- } } ! while (i < lenPositions) ! positions[i++] = PANGO_PIXELS(pos.x + pos.width); ! pango_layout_iter_free(iter); delete []utfForm; + PLATFORM_ASSERT(i == lenPositions); } } *************** *** 1317,1325 **** pango_layout_set_text(layout, utfForm, len); int i = 0; ! PangoLayoutIter *iter = pango_layout_get_iter (layout); ! while (pango_layout_iter_next_cluster (iter)) { pango_layout_iter_get_cluster_extents(iter, NULL, &pos); positions[i++] = PANGO_PIXELS(pos.x); } pango_layout_iter_free(iter); if (useGFree) { --- 1334,1345 ---- pango_layout_set_text(layout, utfForm, len); int i = 0; ! PangoLayoutIter *iter = pango_layout_get_iter(layout); ! pango_layout_iter_get_cluster_extents(iter, NULL, &pos); ! while (pango_layout_iter_next_cluster(iter)) { pango_layout_iter_get_cluster_extents(iter, NULL, &pos); positions[i++] = PANGO_PIXELS(pos.x); } + while (i < lenPositions) + positions[i++] = PANGO_PIXELS(pos.x + pos.width); pango_layout_iter_free(iter); if (useGFree) { *************** *** 1328,1331 **** --- 1348,1352 ---- delete []utfForm; } + PLATFORM_ASSERT(i == lenPositions); } } *************** *** 1464,1471 **** // This string contains a good range of characters to test for size. ! const char largeSizeString[] = "ÂÃÅÄ `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" ! "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; const char sizeString[] = "`~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int SurfaceImpl::Ascent(Font &font_) { --- 1485,1494 ---- // This string contains a good range of characters to test for size. ! //const char largeSizeString[] = "ÂÃÅÄ `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" ! // "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; ! #ifndef FAST_WAY const char sizeString[] = "`~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + #endif int SurfaceImpl::Ascent(Font &font_) { *************** *** 1718,1722 **** } ! gdk_window_set_cursor(PWidget(id)->window, gdkCurs); gdk_cursor_destroy(gdkCurs); } --- 1741,1746 ---- } ! if (PWidget(id)->window) ! gdk_window_set_cursor(PWidget(id)->window, gdkCurs); gdk_cursor_destroy(gdkCurs); } *************** *** 1794,1800 **** } virtual void SetFont(Font &font); ! virtual void Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); --- 1818,1825 ---- } virtual void SetFont(Font &font); ! virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); + virtual int GetVisibleRows() const; virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); *************** *** 1812,1815 **** --- 1837,1841 ---- doubleClickActionData = data; } + virtual void SetList(const char* list, char separator, char typesep); }; *************** *** 1842,1846 **** } ! void ListBoxX::Create(Window &, int, int, bool) { id = gtk_window_new(GTK_WINDOW_POPUP); --- 1868,1872 ---- } ! void ListBoxX::Create(Window &, int, Point, int, bool) { id = gtk_window_new(GTK_WINDOW_POPUP); *************** *** 1936,1939 **** --- 1962,1969 ---- } + int ListBoxX::GetVisibleRows() const { + return desiredVisibleRows; + } + PRectangle ListBoxX::GetDesiredRect() { // Before any size allocated pretend its 100 wide so not scrolled *************** *** 2280,2283 **** --- 2310,2343 ---- } + void ListBoxX::SetList(const char* list, char separator, char typesep) { + Clear(); + int count = strlen(list) + 1; + char *words = new char[count]; + if (words) { + memcpy(words, list, count); + char *startword = words; + char *numword = NULL; + int i = 0; + for (; words[i]; i++) { + if (words[i] == separator) { + words[i] = '\0'; + if (numword) + *numword = '\0'; + Append(startword, numword?atoi(numword + 1):-1); + startword = words + i + 1; + numword = NULL; + } else if (words[i] == typesep) { + numword = words + i; + } + } + if (startword) { + if (numword) + *numword = '\0'; + Append(startword, numword?atoi(numword + 1):-1); + } + delete []words; + } + } + Menu::Menu() : id(0) {} *************** *** 2307,2311 **** pt.y = screenHeight - requisition.height; } ! gtk_item_factory_popup(factory, pt.x - 4, pt.y, 3, 0); } --- 2367,2376 ---- pt.y = screenHeight - requisition.height; } ! #if GTK_MAJOR_VERSION >= 2 ! gtk_item_factory_popup(factory, pt.x - 4, pt.y - 4, 3, ! gtk_get_current_event_time()); ! #else ! gtk_item_factory_popup(factory, pt.x - 4, pt.y - 4, 3, 0); ! #endif } Index: makefile =================================================================== RCS file: /cvsroot/win32forth/win32forth-extsrc/extsrc/w32fScintilla/gtk/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** makefile 22 Dec 2004 20:25:54 -0000 1.1 --- makefile 3 Sep 2005 10:13:13 -0000 1.2 *************** *** 24,28 **** INCLUDEDIRS=-I ../include -I ../src ! CXXBASEFLAGS=-W -Wall -Wno-char-subscripts -DGTK -DSCI_LEXER $(INCLUDEDIRS) ifdef NOTHREADS --- 24,28 ---- INCLUDEDIRS=-I ../include -I ../src ! CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -DGTK -DSCI_LEXER $(INCLUDEDIRS) ifdef NOTHREADS *************** *** 65,74 **** LEXOBJS=\ LexAda.o LexAPDL.o LexAsm.o LexAsn1.o LexAU3.o LexAVE.o LexBaan.o LexBash.o \ ! LexBullant.o LexCLW.o LexConf.o LexCPP.o LexCrontab.o LexCSS.o LexEiffel.o \ ! LexErlang.o LexEScript.o LexForth.o LexFortran.o LexGui4Cli.o LexHTML.o \ ! LexKix.o LexLisp.o LexLout.o LexLua.o LexMatlab.o LexMetapost.o LexMMIXAL.o \ ! LexMPT.o LexMSSQL.o LexNsis.o LexOthers.o LexPascal.o LexPB.o LexPerl.o \ ! LexPOV.o LexPS.o LexPython.o LexRuby.o LexScriptol.o LexSpecman.o LexSQL.o \ ! LexTeX.o LexVB.o LexVerilog.o LexVHDL.o LexYAML.o #--Autogenerated -- end of automatically generated section --- 65,75 ---- LEXOBJS=\ LexAda.o LexAPDL.o LexAsm.o LexAsn1.o LexAU3.o LexAVE.o LexBaan.o LexBash.o \ ! LexBasic.o LexBullant.o LexCaml.o LexCLW.o LexConf.o LexCPP.o LexCrontab.o \ ! LexCsound.o LexCSS.o LexEiffel.o LexErlang.o LexEScript.o LexFlagship.o \ ! LexForth.o LexFortran.o LexGui4Cli.o LexHaskell.o LexHTML.o LexKix.o LexLisp.o \ ! LexLout.o LexLua.o LexMatlab.o LexMetapost.o LexMMIXAL.o LexMPT.o LexMSSQL.o \ ! LexNsis.o LexOthers.o LexPascal.o LexPB.o LexPerl.o LexPOV.o LexPS.o \ ! LexPython.o LexRebol.o LexRuby.o LexScriptol.o LexSmalltalk.o LexSpecman.o \ ! LexSQL.o LexTADS3.o LexTeX.o LexVB.o LexVerilog.o LexVHDL.o LexYAML.o #--Autogenerated -- end of automatically generated section Index: ScintillaGTK.cxx =================================================================== RCS file: /cvsroot/win32forth/win32forth-extsrc/extsrc/w32fScintilla/gtk/ScintillaGTK.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScintillaGTK.cxx 22 Dec 2004 20:25:53 -0000 1.1 --- ScintillaGTK.cxx 3 Sep 2005 10:13:13 -0000 1.2 *************** *** 480,483 **** --- 480,484 ---- gtk_widget_unrealize(PWidget(wPreeditDraw)); g_object_unref(im_context); + im_context = NULL; #endif #endif *************** *** 586,599 **** gdk_im_begin(sciThis->ic, widget->window); #else ! gchar *str; ! gint cursor_pos; ! gtk_im_context_get_preedit_string(sciThis->im_context, &str, NULL, &cursor_pos); ! if (strlen(str) > 0){ ! gtk_widget_show(PWidget(sciThis->wPreedit)); ! } else{ ! gtk_widget_hide(PWidget(sciThis->wPreedit)); } - g_free(str); - gtk_im_context_focus_in(sciThis->im_context); #endif #endif --- 587,605 ---- gdk_im_begin(sciThis->ic, widget->window); #else ! if (sciThis->im_context != NULL) { ! gchar *str = NULL; ! gint cursor_pos; ! ! gtk_im_context_get_preedit_string(sciThis->im_context, &str, NULL, &cursor_pos); ! if (PWidget(sciThis->wPreedit) != NULL) { ! if (strlen(str) > 0) { ! gtk_widget_show(PWidget(sciThis->wPreedit)); ! } else { ! gtk_widget_hide(PWidget(sciThis->wPreedit)); ! } ! } ! g_free(str); ! gtk_im_context_focus_in(sciThis->im_context); } #endif #endif *************** *** 612,617 **** gdk_im_end(); #else ! gtk_widget_hide(PWidget(sciThis->wPreedit)); ! gtk_im_context_focus_out(sciThis->im_context); #endif #endif --- 618,625 ---- gdk_im_end(); #else ! if (PWidget(sciThis->wPreedit) != NULL) ! gtk_widget_hide(PWidget(sciThis->wPreedit)); ! if (sciThis->im_context != NULL) ! gtk_im_context_focus_out(sciThis->im_context); #endif #endif *************** *** 622,626 **** void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) { requisition->width = 600; ! requisition->height = 2000; ScintillaGTK *sciThis = ScintillaFromWidget(widget); GtkRequisition child_requisition; --- 630,634 ---- void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) { requisition->width = 600; ! requisition->height = gdk_screen_height(); ScintillaGTK *sciThis = ScintillaFromWidget(widget); GtkRequisition child_requisition; *************** *** 826,830 **** // Return the length of the result in bytes. int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) { ! int inputLength = lengthForEncode ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) { --- 834,838 ---- // Return the length of the result in bytes. int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) { ! int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) { *************** *** 882,886 **** case SCI_ENCODEDFROMUTF8: ! return EncodedFromUTF8(reinterpret_cast<char*>(wParam), reinterpret_cast<char*>(lParam)); --- 890,894 ---- case SCI_ENCODEDFROMUTF8: ! return EncodedFromUTF8(reinterpret_cast<char*>(wParam), reinterpret_cast<char*>(lParam)); *************** *** 1052,1059 **** --- 1060,1069 ---- void ScintillaGTK::SetVerticalScrollPos() { + DwellEnd(true); gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmentv), topLine); } void ScintillaGTK::SetHorizontalScrollPos() { + DwellEnd(true); gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmenth), xOffset / 2); } *************** *** 1111,1115 **** void ScintillaGTK::NotifyKey(int key, int modifiers) { ! SCNotification scn; scn.nmhdr.code = SCN_KEY; scn.ch = key; --- 1121,1125 ---- void ScintillaGTK::NotifyKey(int key, int modifiers) { ! SCNotification scn = {0}; scn.nmhdr.code = SCN_KEY; scn.ch = key; *************** *** 1120,1124 **** void ScintillaGTK::NotifyURIDropped(const char *list) { ! SCNotification scn; scn.nmhdr.code = SCN_URIDROPPED; scn.text = list; --- 1130,1134 ---- void ScintillaGTK::NotifyURIDropped(const char *list) { ! SCNotification scn = {0}; scn.nmhdr.code = SCN_URIDROPPED; scn.text = list; *************** *** 1449,1456 **** pdoc->BeginUndoAction(); - int selStart = SelectionStart(); if (selection_data->selection != GDK_SELECTION_PRIMARY) { ClearSelection(); } if (selText.rectangular) { --- 1459,1466 ---- pdoc->BeginUndoAction(); if (selection_data->selection != GDK_SELECTION_PRIMARY) { ClearSelection(); } + int selStart = SelectionStart(); if (selText.rectangular) { *************** *** 2406,2411 **** extern void Platform_Finalise(); ! guint scintilla_get_type() { ! static guint scintilla_type = 0; if (!scintilla_type) { --- 2416,2421 ---- extern void Platform_Finalise(); ! GtkType scintilla_get_type() { ! static GtkType scintilla_type = 0; if (!scintilla_type) { Index: scintilla.mak =================================================================== RCS file: /cvsroot/win32forth/win32forth-extsrc/extsrc/w32fScintilla/gtk/scintilla.mak,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scintilla.mak 22 Dec 2004 20:25:55 -0000 1.1 --- scintilla.mak 3 Sep 2005 10:13:13 -0000 1.2 *************** *** 148,163 **** --- 148,168 ---- $(DIR_O)\LexBaan.obj \ $(DIR_O)\LexBash.obj \ + $(DIR_O)\LexBasic.obj \ $(DIR_O)\LexBullant.obj \ + $(DIR_O)\LexCaml.obj \ $(DIR_O)\LexCLW.obj \ $(DIR_O)\LexConf.obj \ $(DIR_O)\LexCPP.obj \ $(DIR_O)\LexCrontab.obj \ + $(DIR_O)\LexCsound.obj \ $(DIR_O)\LexCSS.obj \ $(DIR_O)\LexEiffel.obj \ $(DIR_O)\LexErlang.obj \ $(DIR_O)\LexEScript.obj \ + $(DIR_O)\LexFlagship.obj \ $(DIR_O)\LexForth.obj \ $(DIR_O)\LexFortran.obj \ $(DIR_O)\LexGui4Cli.obj \ + $(DIR_O)\LexHaskell.obj \ $(DIR_O)\LexHTML.obj \ $(DIR_O)\LexKix.obj \ *************** *** 178,185 **** --- 183,193 ---- $(DIR_O)\LexPS.obj \ $(DIR_O)\LexPython.obj \ + $(DIR_O)\LexRebol.obj \ $(DIR_O)\LexRuby.obj \ $(DIR_O)\LexScriptol.obj \ + $(DIR_O)\LexSmalltalk.obj \ $(DIR_O)\LexSpecman.obj \ $(DIR_O)\LexSQL.obj \ + $(DIR_O)\LexTADS3.obj \ $(DIR_O)\LexTeX.obj \ $(DIR_O)\LexVB.obj \ *************** *** 319,324 **** --- 327,336 ---- $(DIR_O)\LexBash.obj: ..\src\LexBash.cxx $(LEX_HEADERS) + $(DIR_O)\LexBasic.obj: ..\src\LexBasic.cxx $(LEX_HEADERS) + $(DIR_O)\LexBullant.obj: ..\src\LexBullant.cxx $(LEX_HEADERS) + $(DIR_O)\LexCaml.obj: ..\src\LexCaml.cxx $(LEX_HEADERS) + $(DIR_O)\LexCLW.obj: ..\src\LexCLW.cxx $(LEX_HEADERS) *************** *** 329,332 **** --- 341,346 ---- $(DIR_O)\LexCrontab.obj: ..\src\LexCrontab.cxx $(LEX_HEADERS) + $(DIR_O)\LexCsound.obj: ..\src\LexCsound.cxx $(LEX_HEADERS) + $(DIR_O)\LexCSS.obj: ..\src\LexCSS.cxx $(LEX_HEADERS) *************** *** 337,340 **** --- 351,356 ---- $(DIR_O)\LexEScript.obj: ..\src\LexEScript.cxx $(LEX_HEADERS) + $(DIR_O)\LexFlagship.obj: ..\src\LexFlagship.cxx $(LEX_HEADERS) + $(DIR_O)\LexForth.obj: ..\src\LexForth.cxx $(LEX_HEADERS) *************** *** 343,346 **** --- 359,364 ---- $(DIR_O)\LexGui4Cli.obj: ..\src\LexGui4Cli.cxx $(LEX_HEADERS) + $(DIR_O)\LexHaskell.obj: ..\src\LexHaskell.cxx $(LEX_HEADERS) + $(DIR_O)\LexHTML.obj: ..\src\LexHTML.cxx $(LEX_HEADERS) *************** *** 379,390 **** --- 397,414 ---- $(DIR_O)\LexPython.obj: ..\src\LexPython.cxx $(LEX_HEADERS) + $(DIR_O)\LexRebol.obj: ..\src\LexRebol.cxx $(LEX_HEADERS) + $(DIR_O)\LexRuby.obj: ..\src\LexRuby.cxx $(LEX_HEADERS) $(DIR_O)\LexScriptol.obj: ..\src\LexScriptol.cxx $(LEX_HEADERS) + $(DIR_O)\LexSmalltalk.obj: ..\src\LexSmalltalk.cxx $(LEX_HEADERS) + $(DIR_O)\LexSpecman.obj: ..\src\LexSpecman.cxx $(LEX_HEADERS) $(DIR_O)\LexSQL.obj: ..\src\LexSQL.cxx $(LEX_HEADERS) + $(DIR_O)\LexTADS3.obj: ..\src\LexTADS3.cxx $(LEX_HEADERS) + $(DIR_O)\LexTeX.obj: ..\src\LexTeX.cxx $(LEX_HEADERS) |