You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Markus R. <rol...@us...> - 2007-06-23 13:37:02
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit Modified Files: aboutDlg.cpp agentframe.cpp constants.h mainframe.cpp mainframe.h propertyframe.cpp rsgedit.vcproj rsgedit.wxg Added Files: sparkedit.cpp sparkedit.h Log Message: - merged RSGEDIT_SCINTILLA branch Index: constants.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/constants.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** constants.h 15 Jun 2007 10:42:40 -0000 1.8 --- constants.h 23 Jun 2007 13:36:28 -0000 1.9 *************** *** 61,65 **** ID_LOG_CHANNEL_NORMAL = (wxID_HIGHEST+37), ID_LOG_CHANNEL_WARNING = (wxID_HIGHEST+38), ! ID_LOG_CHANNEL_ERROR = (wxID_HIGHEST+39) }; --- 61,67 ---- ID_LOG_CHANNEL_NORMAL = (wxID_HIGHEST+37), ID_LOG_CHANNEL_WARNING = (wxID_HIGHEST+38), ! ID_LOG_CHANNEL_ERROR = (wxID_HIGHEST+39), ! ! ID_FILE_SAVE = (wxID_HIGHEST+40) }; Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mainframe.h 15 Jun 2007 10:42:40 -0000 1.15 --- mainframe.h 23 Jun 2007 13:36:28 -0000 1.16 *************** *** 23,28 **** --- 23,33 ---- #endif + #ifndef MAINFRAME_H + #define MAINFRAME_H + #include <wx/wx.h> #include <wx/image.h> + #include <wx/wxflatnotebook/wxflatnotebook.h> + #include <wx/wxscintilla.h> #include "constants.h" #include "sparktree.h" *************** *** 30,36 **** #include <oxygen/sceneserver/scenedict.h> - #ifndef MAINFRAME_H - #define MAINFRAME_H - class SparkGLCanvas; class SparkContextEvent; --- 35,38 ---- *************** *** 99,102 **** --- 101,107 ---- void OnUpdateFileOpen(wxUpdateUIEvent& event); + void OnFileSave(wxCommandEvent& event); + void OnUpdateFileSave(wxUpdateUIEvent& event); + void OnFileReload(wxCommandEvent& event); void OnUpdateFileReload(wxUpdateUIEvent& event); *************** *** 143,146 **** --- 148,153 ---- void UpdateLogChannelState(); void InitTreeNodeProperties(); + void SelectCanvasTab(); + void SaveModified(); void OnTreeItemExpanding(wxTreeEvent& event); *************** *** 149,152 **** --- 156,165 ---- void OnTreeItemRightClick(wxTreeEvent& event); + void OnTabClosing(wxFlatNotebookEvent& event); + void OnTabChanged(wxFlatNotebookEvent& event); + + void OnEditSavePointReached(wxScintillaEvent& event); + void OnEditSavePointLeft(wxScintillaEvent& event); + void OnSparkContext(SparkContextEvent& event); *************** *** 179,183 **** wxSplitterWindow* window_1; wxPanel* mLeftPane; ! SparkGLCanvas* mCanvas; wxPanel* mTopPane; wxTextCtrl* mCtrLog; --- 192,196 ---- wxSplitterWindow* window_1; wxPanel* mLeftPane; ! wxFlatNotebook* mCtrNotebook; wxPanel* mTopPane; wxTextCtrl* mCtrLog; *************** *** 212,219 **** int mLastVertSashPosition; ! /** the filename of the current simulation (i.e. the corresponding ! startup .rb script) ! */ ! wxString mSimFName; DECLARE_EVENT_TABLE() --- 225,229 ---- int mLastVertSashPosition; ! SparkGLCanvas* mCanvas; DECLARE_EVENT_TABLE() --- NEW FILE: sparkedit.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: sparkedit.h,v 1.2 2007/06/23 13:36:28 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef SPARKEDIT_H__ #define SPARKEDIT_H__ #include <wx/string.h> #include <wx/wxscintilla.h> #include <wx/wxflatnotebook/wxflatnotebook.h> #include <map> class SparkEdit { public: enum EEditType { ET_NONE, ET_RSG, ET_RB, ET_C, ET_TEXT }; enum EImgIndex { II_NONE = -1, II_SIMSPARK = 0, II_STARTSCRIPT, II_RUBY, II_RSG }; struct EditEntry { public: EEditType type; wxString fname; int page; public: EditEntry() : type(ET_RSG), page(-1) { } }; typedef std::map<wxScintilla*, EditEntry > TEditMap; public: static wxScintilla* GetEdit(const wxString& fname, wxFlatNotebook* notebook, bool select); static void PutEdit(wxScintilla* edit); static void UpdateTitles(wxFlatNotebook* notebook); static void UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit); static void UpdateIcons(wxFlatNotebook* notebook); static void SaveFile(wxScintilla* edit); static void SaveModified(); static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit); static wxScintilla* GetStartScript(); static EEditType GetFileType(wxScintilla* edit); static wxString GetFile(wxScintilla* edit); static wxString GetStartScriptFile(); static void PrepareImageList(wxFlatNotebook* notebook); static void SelectEdit(wxFlatNotebook* notebook, wxScintilla* edit); protected: static wxScintilla* Create(wxWindow* parent); static bool LoadFile(wxScintilla* edit, EditEntry& entry); static void PrepareEdit(wxScintilla* edit, const EditEntry& entry); static wxString GetTitle(wxScintilla* edit, const EditEntry& entry); static void UpdateIcon(wxFlatNotebook* notebook, const wxScintilla* edit, const EditEntry& entry); static int GetImageIndex(const wxScintilla* edit, const EditEntry& entry); static void SaveFile(wxScintilla* edit, const EditEntry& entry); protected: static TEditMap mEditMap; static wxFlatNotebookImageList mNotebookImgList; //! the editor holding the simulation start script static wxScintilla* mStartScript; }; #endif // SPARKEDIT_H__ Index: propertyframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/propertyframe.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** propertyframe.cpp 17 May 2007 17:49:23 -0000 1.4 --- propertyframe.cpp 23 Jun 2007 13:36:28 -0000 1.5 *************** *** 36,40 **** { // begin wxGlade: propertyframe::propertyframe ! mCtrPropList = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); set_properties(); --- 36,40 ---- { // begin wxGlade: propertyframe::propertyframe ! mCtrPropList = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); set_properties(); *************** *** 58,62 **** wxBoxSizer* sizer_3 = new wxBoxSizer(wxVERTICAL); sizer_3->Add(mCtrPropList, 1, wxEXPAND, 0); - SetAutoLayout(true); SetSizer(sizer_3); Layout(); --- 58,61 ---- Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rsgedit.wxg 15 Jun 2007 10:42:40 -0000 1.9 --- rsgedit.wxg 23 Jun 2007 13:36:28 -0000 1.10 *************** *** 1,6 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 12:41:21 2007 --> ! <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> --- 1,6 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.5 on Thu Jun 21 21:17:25 2007 --> ! <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6" is_template="0"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> *************** *** 8,28 **** <menubar>1</menubar> <statusbar>1</statusbar> ! <size>1024, 770</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> <menu name="" label="&File"> <item> ! <label>&Open</label> <id>ID_FILE_OPEN</id> </item> <item> ! <label>Start &Agent</label> ! <id>ID_AGENT_OPEN</id> </item> <item> ! <label>&Reload</label> <id>ID_FILE_RELOAD</id> </item> <item> <label>&Exit</label> <id>wxID_EXIT</id> --- 8,37 ---- <menubar>1</menubar> <statusbar>1</statusbar> ! <size>1076, 786</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> <menu name="" label="&File"> <item> ! <label>&Open\tctrl+o</label> <id>ID_FILE_OPEN</id> </item> <item> ! <label>&Save\tctrl+s</label> ! <id>ID_FILE_SAVE</id> </item> <item> ! <label>&Reload\tctrl+r</label> <id>ID_FILE_RELOAD</id> </item> <item> + <label>---</label> + <id>---</id> + <name>---</name> + </item> + <item> + <label>Start &Agent</label> + <id>ID_AGENT_OPEN</id> + </item> + <item> <label>&Exit</label> <id>wxID_EXIT</id> *************** *** 150,154 **** <border>0</border> <option>1</option> ! <object class="SparkGLCanvas" name="mCanvas" base="CustomWidget"> <arguments> <argument>$parent</argument> --- 159,163 ---- <border>0</border> <option>1</option> ! <object class="wxFlatNotebook" name="mCtrNotebook" base="CustomWidget"> <arguments> <argument>$parent</argument> *************** *** 177,181 **** <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxALL|wxEXPAND|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 186,190 ---- <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxALL|wxEXPAND</flag> <border>5</border> <option>0</option> *************** *** 186,190 **** </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 195,199 ---- </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND</flag> <border>5</border> <option>0</option> *************** *** 204,208 **** </object> <object class="sizeritem"> ! <flag>wxALL|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 213,217 ---- </object> <object class="sizeritem"> ! <flag>wxALL</flag> <border>5</border> <option>0</option> *************** *** 213,217 **** </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 222,226 ---- </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> <border>5</border> <option>0</option> *************** *** 222,226 **** </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 231,235 ---- </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> <border>5</border> <option>0</option> *************** *** 231,235 **** </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 240,244 ---- </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> <border>5</border> <option>0</option> *************** *** 240,244 **** </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 249,253 ---- </object> <object class="sizeritem"> ! <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> <border>5</border> <option>0</option> *************** *** 282,286 **** <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 291,295 ---- <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag> <border>5</border> <option>0</option> *************** *** 291,295 **** </object> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 300,304 ---- </object> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag> <border>5</border> <option>0</option> *************** *** 300,304 **** </object> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> <border>5</border> <option>0</option> --- 309,313 ---- </object> <object class="sizeritem"> ! <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag> <border>5</border> <option>0</option> *************** *** 317,321 **** <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxEXPAND|wxADJUST_MINSIZE</flag> <border>0</border> <option>1</option> --- 326,330 ---- <orient>wxVERTICAL</orient> <object class="sizeritem"> ! <flag>wxEXPAND</flag> <border>0</border> <option>1</option> Index: agentframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/agentframe.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** agentframe.cpp 15 Mar 2007 07:26:24 -0000 1.2 --- agentframe.cpp 23 Jun 2007 13:36:28 -0000 1.3 *************** *** 49,53 **** // begin wxGlade: agentframe::agentframe ! mCtrLog = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); set_properties(); --- 49,53 ---- // begin wxGlade: agentframe::agentframe ! mCtrLog = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); set_properties(); *************** *** 81,86 **** // begin wxGlade: agentframe::do_layout wxBoxSizer* sizer_10 = new wxBoxSizer(wxVERTICAL); ! sizer_10->Add(mCtrLog, 1, wxEXPAND|wxADJUST_MINSIZE, 0); ! SetAutoLayout(true); SetSizer(sizer_10); Layout(); --- 81,85 ---- // begin wxGlade: agentframe::do_layout wxBoxSizer* sizer_10 = new wxBoxSizer(wxVERTICAL); ! sizer_10->Add(mCtrLog, 1, wxEXPAND, 0); SetSizer(sizer_10); Layout(); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mainframe.cpp 15 Jun 2007 10:42:40 -0000 1.21 --- mainframe.cpp 23 Jun 2007 13:36:28 -0000 1.22 *************** *** 24,27 **** --- 24,28 ---- #include "propertyframe.h" #include "agentframe.h" + #include "sparkedit.h" #include <wx/filename.h> *************** *** 34,37 **** --- 35,39 ---- #include <rsgedit/res/xpm_pause.xpm> #include <rsgedit/res/xpm_open.xpm> + #include <rsgedit/res/xpm_save.xpm> #include <rsgedit/res/xpm_reload.xpm> #include <rsgedit/res/xpm_agent.xpm> *************** *** 75,78 **** --- 77,83 ---- EVT_UPDATE_UI(ID_FILE_OPEN, mainframe::OnUpdateFileOpen) + EVT_MENU(ID_FILE_SAVE, mainframe::OnFileSave) + EVT_UPDATE_UI(ID_FILE_SAVE, mainframe::OnUpdateFileSave) + EVT_MENU(ID_AGENT_OPEN, mainframe::OnAgentOpen) *************** *** 102,105 **** --- 107,116 ---- EVT_TREE_ITEM_RIGHT_CLICK(1, mainframe::OnTreeItemRightClick) + EVT_FLATNOTEBOOK_PAGE_CLOSING(wxID_ANY, mainframe::OnTabClosing) + EVT_FLATNOTEBOOK_PAGE_CHANGED(wxID_ANY, mainframe::OnTabChanged) + + EVT_SCI_SAVEPOINTREACHED(wxID_ANY, mainframe::OnEditSavePointReached) + EVT_SCI_SAVEPOINTLEFT(wxID_ANY, mainframe::OnEditSavePointLeft) + EVT_SPARK_CONTEXT(ID_SPARK_CONTEXT, mainframe::OnSparkContext) END_EVENT_TABLE() *************** *** 117,136 **** // begin wxGlade: mainframe::mainframe ! mCtrVertSplitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mRightPane = new wxPanel(mCtrVertSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! mCtrHorSplitter = new wxSplitterWindow(mRightPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mBottomPane = new wxPanel(mCtrHorSplitter, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mTopPane = new wxPanel(mCtrHorSplitter, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mLeftPane = new wxPanel(mCtrVertSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER|wxSP_BORDER); ! window_1_pane_2 = new wxPanel(window_1, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! window_1_pane_1 = new wxPanel(window_1, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); ! wxglade_tmp_menu_1->Append(ID_FILE_OPEN, wxT("&Open"), wxT(""), wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(ID_AGENT_OPEN, wxT("Start &Agent"), wxT(""), wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(ID_FILE_RELOAD, wxT("&Reload"), wxT(""), wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxT(""), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_1, wxT("&File")); wxMenu* wxglade_tmp_menu_2 = new wxMenu(); --- 128,149 ---- // begin wxGlade: mainframe::mainframe ! mCtrVertSplitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mRightPane = new wxPanel(mCtrVertSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! mCtrHorSplitter = new wxSplitterWindow(mRightPane, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mBottomPane = new wxPanel(mCtrHorSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mTopPane = new wxPanel(mCtrHorSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mLeftPane = new wxPanel(mCtrVertSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! window_1 = new wxSplitterWindow(mLeftPane, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER|wxSP_BORDER); ! window_1_pane_2 = new wxPanel(window_1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! window_1_pane_1 = new wxPanel(window_1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); ! wxglade_tmp_menu_1->Append(ID_FILE_OPEN, wxT("&Open\tctrl+o"), wxEmptyString, wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(ID_FILE_SAVE, wxT("&Save\tctrl+s"), wxEmptyString, wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(ID_FILE_RELOAD, wxT("&Reload\tctrl+r"), wxEmptyString, wxITEM_NORMAL); ! wxglade_tmp_menu_1->AppendSeparator(); ! wxglade_tmp_menu_1->Append(ID_AGENT_OPEN, wxT("Start &Agent"), wxEmptyString, wxITEM_NORMAL); ! wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxEmptyString, wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_1, wxT("&File")); wxMenu* wxglade_tmp_menu_2 = new wxMenu(); *************** *** 139,158 **** MainFrame_menubar->Append(wxglade_tmp_menu_2, wxT("&View")); wxMenu* wxglade_tmp_menu_3 = new wxMenu(); ! wxglade_tmp_menu_3->Append(ID_SIM_STEP, wxT("St&ep"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_START, wxT("&Start"), wxT("Start simulation"), wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_PAUSE, wxT("&Pause"), wxT("Pause Simulation"), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); wxMenu* wxglade_tmp_menu_4 = new wxMenu(); ! wxglade_tmp_menu_4->Append(ID_HELP_ABOUT, wxT("&About"), wxT(""), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_4, wxT("&Help")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(window_1_pane_1, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSIMPLE_BORDER); mCtrTree = new wxTreeCtrl(window_1_pane_2, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSIMPLE_BORDER); ! mCanvas = new SparkGLCanvas(mTopPane, -1); ! mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxNO_BORDER); button_2 = new wxButton(mBottomPane, ID_LOG_CLEAR, wxT("Clear")); button_3 = new wxButton(mBottomPane, ID_LOG_COPY, wxT("Copy")); ! static_line_1 = new wxStaticLine(mBottomPane, -1); ! label_2 = new wxStaticText(mBottomPane, -1, wxT("Log Channels")); mCtrLogChannelDebug = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_DEBUG, wxT("Debug")); mCtrLogChannelNormal = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_NORMAL, wxT("Normal")); --- 152,171 ---- MainFrame_menubar->Append(wxglade_tmp_menu_2, wxT("&View")); wxMenu* wxglade_tmp_menu_3 = new wxMenu(); ! wxglade_tmp_menu_3->Append(ID_SIM_STEP, wxT("St&ep"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_START, wxT("&Start"), wxT("Start simulation"), wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_PAUSE, wxT("&Pause"), wxT("Pause Simulation"), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); wxMenu* wxglade_tmp_menu_4 = new wxMenu(); ! wxglade_tmp_menu_4->Append(ID_HELP_ABOUT, wxT("&About"), wxEmptyString, wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_4, wxT("&Help")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(window_1_pane_1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSIMPLE_BORDER); mCtrTree = new wxTreeCtrl(window_1_pane_2, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSIMPLE_BORDER); ! mCtrNotebook = new wxFlatNotebook(mTopPane, wxID_ANY); ! mCtrLog = new wxTextCtrl(mBottomPane, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxNO_BORDER); button_2 = new wxButton(mBottomPane, ID_LOG_CLEAR, wxT("Clear")); button_3 = new wxButton(mBottomPane, ID_LOG_COPY, wxT("Copy")); ! static_line_1 = new wxStaticLine(mBottomPane, wxID_ANY); ! label_2 = new wxStaticText(mBottomPane, wxID_ANY, wxT("Log Channels")); mCtrLogChannelDebug = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_DEBUG, wxT("Debug")); mCtrLogChannelNormal = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_NORMAL, wxT("Normal")); *************** *** 164,167 **** --- 177,195 ---- // end wxGlade + mCtrNotebook->SetWindowStyleFlag + (mCtrNotebook->GetWindowStyleFlag() + | wxFNB_DROPDOWN_TABS_LIST + | wxFNB_X_ON_TAB + | wxFNB_MOUSE_MIDDLE_CLOSES_TABS + | wxFNB_VC8 + ); + + mCanvas = new SparkGLCanvas(mCtrNotebook, wxID_ANY); + mCanvas->SetLabel("simulation window"); + mCtrNotebook->AddPage(mCanvas, wxT("Canvas")); + + SparkEdit::PrepareImageList(mCtrNotebook); + mCtrNotebook->SetPageImageIndex(0, SparkEdit::II_SIMSPARK); + // create toolbar mToolBar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY ); *************** *** 169,172 **** --- 197,201 ---- mToolBar->AddTool(ID_FILE_OPEN, wxT("Open"), wxBitmap(xpm_open)); mToolBar->AddTool(ID_FILE_RELOAD, wxT("Reload"), wxBitmap(xpm_reload)); + mToolBar->AddTool(ID_FILE_SAVE, wxT("Save"), wxBitmap(xpm_save)); mToolBar->AddSeparator(); mToolBar->AddTool(ID_AGENT_OPEN, wxT("Start Agent"), wxBitmap(xpm_agent)); *************** *** 217,223 **** { wxString title(wxT("SimSpark")); ! if (! mSimFName.empty()) { ! title += wxT(" <") + mSimFName + wxT(">"); } --- 246,252 ---- { wxString title(wxT("SimSpark")); ! if (SparkEdit::GetStartScript() != 0) { ! title += wxT(" <") + SparkEdit::GetStartScriptFile() + wxT(">"); } *************** *** 248,252 **** // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(1024, 770)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); --- 277,281 ---- // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(1076, 786)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); *************** *** 272,318 **** wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL); sizer_4->Add(mCtrPropList, 1, wxEXPAND, 0); - window_1_pane_1->SetAutoLayout(true); window_1_pane_1->SetSizer(sizer_4); - sizer_4->Fit(window_1_pane_1); - sizer_4->SetSizeHints(window_1_pane_1); sizer_8->Add(mCtrTree, 1, wxEXPAND, 0); - window_1_pane_2->SetAutoLayout(true); window_1_pane_2->SetSizer(sizer_8); - sizer_8->Fit(window_1_pane_2); - sizer_8->SetSizeHints(window_1_pane_2); window_1->SplitHorizontally(window_1_pane_1, window_1_pane_2); sizer_7->Add(window_1, 1, wxEXPAND, 0); - mLeftPane->SetAutoLayout(true); mLeftPane->SetSizer(sizer_7); ! sizer_7->Fit(mLeftPane); ! sizer_7->SetSizeHints(mLeftPane); ! sizer_5->Add(mCanvas, 1, wxEXPAND, 0); ! mTopPane->SetAutoLayout(true); mTopPane->SetSizer(sizer_5); - sizer_5->Fit(mTopPane); - sizer_5->SetSizeHints(mTopPane); sizer_6->Add(mCtrLog, 1, wxEXPAND, 0); ! sizer_11->Add(button_2, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 5); ! sizer_11->Add(button_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxADJUST_MINSIZE, 5); sizer_11->Add(static_line_1, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5); ! sizer_11->Add(label_2, 0, wxALL|wxADJUST_MINSIZE, 5); ! sizer_11->Add(mCtrLogChannelDebug, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); ! sizer_11->Add(mCtrLogChannelNormal, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); ! sizer_11->Add(mCtrLogChannelWarning, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); ! sizer_11->Add(mCtrLogChannelError, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); sizer_6->Add(sizer_11, 0, 0, 0); - mBottomPane->SetAutoLayout(true); mBottomPane->SetSizer(sizer_6); - sizer_6->Fit(mBottomPane); - sizer_6->SetSizeHints(mBottomPane); mCtrHorSplitter->SplitHorizontally(mTopPane, mBottomPane); sizer_2->Add(mCtrHorSplitter, 1, wxEXPAND, 0); - mRightPane->SetAutoLayout(true); mRightPane->SetSizer(sizer_2); - sizer_2->Fit(mRightPane); - sizer_2->SetSizeHints(mRightPane); mCtrVertSplitter->SplitVertically(mLeftPane, mRightPane); sizer_1->Add(mCtrVertSplitter, 1, wxEXPAND, 0); - SetAutoLayout(true); SetSizer(sizer_1); Layout(); --- 301,328 ---- wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL); sizer_4->Add(mCtrPropList, 1, wxEXPAND, 0); window_1_pane_1->SetSizer(sizer_4); sizer_8->Add(mCtrTree, 1, wxEXPAND, 0); window_1_pane_2->SetSizer(sizer_8); window_1->SplitHorizontally(window_1_pane_1, window_1_pane_2); sizer_7->Add(window_1, 1, wxEXPAND, 0); mLeftPane->SetSizer(sizer_7); ! sizer_5->Add(mCtrNotebook, 1, wxEXPAND, 0); mTopPane->SetSizer(sizer_5); sizer_6->Add(mCtrLog, 1, wxEXPAND, 0); ! sizer_11->Add(button_2, 0, wxALL|wxEXPAND, 5); ! sizer_11->Add(button_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5); sizer_11->Add(static_line_1, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5); ! sizer_11->Add(label_2, 0, wxALL, 5); ! sizer_11->Add(mCtrLogChannelDebug, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5); ! sizer_11->Add(mCtrLogChannelNormal, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5); ! sizer_11->Add(mCtrLogChannelWarning, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5); ! sizer_11->Add(mCtrLogChannelError, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5); sizer_6->Add(sizer_11, 0, 0, 0); mBottomPane->SetSizer(sizer_6); mCtrHorSplitter->SplitHorizontally(mTopPane, mBottomPane); sizer_2->Add(mCtrHorSplitter, 1, wxEXPAND, 0); mRightPane->SetSizer(sizer_2); mCtrVertSplitter->SplitVertically(mLeftPane, mRightPane); sizer_1->Add(mCtrVertSplitter, 1, wxEXPAND, 0); SetSizer(sizer_1); Layout(); *************** *** 356,359 **** --- 366,386 ---- } + int n = mCtrNotebook->GetPageCount(); + + for (int i=(n-1);i>=0;--i) + { + wxWindow* page = mCtrNotebook->GetPage(i); + if (page == mCanvas) + { + continue; + } + + if (! mCtrNotebook->RemovePage(i)) + { + event.Veto(); + return; + } + } + // close agentframes wxWindowList& children = GetChildren(); *************** *** 754,757 **** --- 781,785 ---- void mainframe::EditFile(const wxString& fname, int line) { + #if 0 wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromMimeType("text/plain"); if (ft == 0) *************** *** 770,773 **** --- 798,816 ---- wxExecute(cmd); + #endif + + bool select = true; + wxScintilla* edit = SparkEdit::GetEdit(fname,mCtrNotebook,select); + if (edit != 0) + { + edit->GotoLine(line); + } + + if (edit == 0) + { + return; + } + + edit->GotoLine(line); } *************** *** 898,915 **** DoneSimulation(sim); - - mSimFName = fname; - UpdateTitle(); PrintSimState(); return true; } void mainframe::OnFileOpen(wxCommandEvent& event) { ! wxString message(wxT("Choose a ruby script to run")); wxString default_path(wxT("./rsg")); wxString default_filename(wxT("")); wxString default_extension(wxT("")); ! wxString wildcard(wxT("ruby scripts (*.rb)|*.rb")); wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); --- 941,992 ---- DoneSimulation(sim); PrintSimState(); + return true; } + void mainframe::SaveModified() + { + SparkEdit::SaveModified(); + SparkEdit::UpdateTitles(mCtrNotebook); + } + + void mainframe::OnUpdateFileSave(wxUpdateUIEvent& event) + { + wxScintilla* edit = dynamic_cast<wxScintilla*>(mCtrNotebook->GetCurrentPage()); + event.Enable(edit != 0); + } + + void mainframe::OnFileSave(wxCommandEvent& event) + { + wxScintilla* edit = dynamic_cast<wxScintilla*>(mCtrNotebook->GetCurrentPage()); + if (edit == 0) + { + return; + } + + SparkEdit::SaveFile(edit); + } + + void mainframe::SelectCanvasTab() + { + int idx = mCtrNotebook->GetPageIndex(mCanvas); + if (idx < 0) + { + assert(false); + return; + } + + mCtrNotebook->SetSelection(idx); + mCanvas->SetFocus(); + } + void mainframe::OnFileOpen(wxCommandEvent& event) { ! wxString message(wxT("Choose a file to open")); wxString default_path(wxT("./rsg")); wxString default_filename(wxT("")); wxString default_extension(wxT("")); ! wxString wildcard(wxT("simspark files (*.rsg, *.rb)|*.rb;*.rsg")); wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); *************** *** 919,922 **** --- 996,1014 ---- } + bool select = false; + wxScintilla* edit = SparkEdit::GetEdit(filename, mCtrNotebook, select); + + if ( + (SparkEdit::GetStartScript() != 0) || + (SparkEdit::GetFileType(edit) != SparkEdit::ET_RB) + ) + { + SparkEdit::SelectEdit(mCtrNotebook, edit); + return; + } + + SelectCanvasTab(); + SparkEdit::SetStartScript(mCtrNotebook, edit); + UpdateTitle(); OpenSimulation(filename); } *************** *** 926,930 **** event.Enable( (GetSimState() == S_PAUSED) && ! (! mSimFName.empty()) ); } --- 1018,1022 ---- event.Enable( (GetSimState() == S_PAUSED) && ! (SparkEdit::GetStartScript() != 0) ); } *************** *** 932,936 **** void mainframe::OnFileReload(wxCommandEvent& event) { ! OpenSimulation(mSimFName); } --- 1024,1036 ---- void mainframe::OnFileReload(wxCommandEvent& event) { ! wxString simName = SparkEdit::GetStartScriptFile(); ! if (simName.IsEmpty()) ! { ! return; ! } ! ! SaveModified(); ! SelectCanvasTab(); ! OpenSimulation(simName); } *************** *** 1075,1076 **** --- 1175,1251 ---- spark->SetLogPriority(mask); } + + void mainframe::OnTabClosing(wxFlatNotebookEvent& event) + { + wxWindow* page = mCtrNotebook->GetPage(event.GetSelection()); + if (page == mCanvas) + { + event.Veto(); + return; + } + + wxScintilla* edit = dynamic_cast<wxScintilla*>(page); + if (edit == 0) + { + event.Skip(); + return; + } + + if (edit->GetModify()) + { + int res = wxMessageBox("The file '"+SparkEdit::GetFile(edit)+"' is modified.\n" + "Do you want to save your changes?", + "rsgedit", + wxYES_NO|wxCANCEL|wxICON_QUESTION + ); + + switch (res) + { + default: + assert(false); + // fall through + + case wxCANCEL: + event.Veto(); + return; + + case wxYES: + SparkEdit::SaveFile(edit); + break; + + case wxNO: + break; + } + } + + if (edit != 0) + { + SparkEdit::PutEdit(edit); + UpdateTitle(); + } + + event.Skip(); + } + + void mainframe::OnTabChanged(wxFlatNotebookEvent& event) + { + wxWindow* page = mCtrNotebook->GetPage(event.GetSelection()); + if (page == mCanvas) + { + mCanvas->SetFocus(); + } + + event.Skip(); + } + + void mainframe::OnEditSavePointReached(wxScintillaEvent& event) + { + SparkEdit::UpdateTitle(mCtrNotebook,static_cast<wxScintilla*>(event.GetEventObject())); + event.Skip(); + } + + void mainframe::OnEditSavePointLeft(wxScintillaEvent& event) + { + SparkEdit::UpdateTitle(mCtrNotebook,static_cast<wxScintilla*>(event.GetEventObject())); + event.Skip(); + } Index: aboutDlg.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/aboutDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** aboutDlg.cpp 15 Mar 2007 07:26:24 -0000 1.2 --- aboutDlg.cpp 23 Jun 2007 13:36:28 -0000 1.3 *************** *** 8,13 **** { // begin wxGlade: aboutDlg::aboutDlg ! mBitmap = new wxStaticBitmap(this, -1, wxNullBitmap); ! label_1 = new wxStaticText(this, -1, wxT("SimSpark Copyright (C) RoboCup Soccer Server 3D Maintenance Group")); button_1 = new wxButton(this, wxID_OK, wxT("&Ok")); --- 8,13 ---- { // begin wxGlade: aboutDlg::aboutDlg ! mBitmap = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap); ! label_1 = new wxStaticText(this, wxID_ANY, wxT("SimSpark Copyright (C) RoboCup Soccer Server 3D Maintenance Group")); button_1 = new wxButton(this, wxID_OK, wxT("&Ok")); *************** *** 33,43 **** // begin wxGlade: aboutDlg::do_layout wxBoxSizer* sizer_9 = new wxBoxSizer(wxVERTICAL); ! sizer_9->Add(mBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); ! sizer_9->Add(label_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); ! sizer_9->Add(button_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); ! SetAutoLayout(true); SetSizer(sizer_9); sizer_9->Fit(this); - sizer_9->SetSizeHints(this); Layout(); // end wxGlade --- 33,41 ---- // begin wxGlade: aboutDlg::do_layout wxBoxSizer* sizer_9 = new wxBoxSizer(wxVERTICAL); ! sizer_9->Add(mBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); ! sizer_9->Add(label_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); ! sizer_9->Add(button_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); SetSizer(sizer_9); sizer_9->Fit(this); Layout(); // end wxGlade Index: rsgedit.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rsgedit.vcproj 15 Apr 2007 11:17:53 -0000 1.4 --- rsgedit.vcproj 23 Jun 2007 13:36:28 -0000 1.5 *************** *** 2,6 **** <VisualStudioProject ProjectType="Visual C++" ! Version="8,00" Name="rsgedit" ProjectGUID="{38B680B0-B535-40F0-B5DB-FC307C40C7D6}" --- 2,6 ---- <VisualStudioProject ProjectType="Visual C++" ! Version="8.00" Name="rsgedit" ProjectGUID="{38B680B0-B535-40F0-B5DB-FC307C40C7D6}" *************** *** 41,46 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" ! PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" --- 41,46 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\;wxscintilla\include;wxscintilla\src\scintilla\include;wxscintilla\src\scintilla\src;wxflatnotebook\include;wxflatnotebook\isrc" ! PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;SCI_LEXER" MinimalRebuild="true" BasicRuntimeChecks="3" *************** *** 120,124 **** Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" ! PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" --- 120,124 ---- Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" ! PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;SCI_LEXER" RuntimeLibrary="2" UsePrecompiledHeader="0" *************** *** 175,178 **** --- 175,698 ---- </References> <Files> + <Filter + Name="wxscintilla" + > + <File + RelativePath=".\wxscintilla\src\PlatWX.cpp" + > + </File> + <File + RelativePath=".\wxscintilla\src\PlatWX.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\ScintillaWX.cpp" + > + </File> + <File + RelativePath=".\wxscintilla\src\ScintillaWX.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\wxscintilla.cpp" + > + </File> + <File + RelativePath=".\wxscintilla\include\wx\wxscintilla.h" + > + </File> + <Filter + Name="scintilla" + > + <File + RelativePath=".\wxscintilla\src\scintilla\include\Accessor.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\AutoComplete.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\AutoComplete.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CallTip.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CallTip.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CellBuffer.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CellBuffer.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CharClassify.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\CharClassify.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ContractionState.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ContractionState.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Document.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Document.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\DocumentAccessor.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\DocumentAccessor.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Editor.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Editor.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ExternalLexer.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ExternalLexer.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Indicator.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Indicator.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\KeyMap.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\KeyMap.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\KeyWords.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\KeyWords.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAda.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAPDL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAsm.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAsn1.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAU3.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexAVE.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexBaan.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexBash.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexBasic.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexBullant.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCaml.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCLW.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexConf.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCPP.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCrontab.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCsound.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexCSS.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexEiffel.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexErlang.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexEScript.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexFlagship.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexForth.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexFortran.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexGui4Cli.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexHaskell.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexHTML.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexInno.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexKix.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexLisp.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexLout.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexLua.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexMatlab.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexMetapost.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexMMIXAL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexMPT.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexMSSQL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexNsis.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexOpal.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexOthers.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPascal.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPB.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPerl.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPOV.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPS.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexPython.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexRebol.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexRuby.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexScriptol.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexSmalltalk.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexSpecman.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexSpice.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexSQL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexTADS3.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexTCL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexTeX.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexVB.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexVerilog.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexVHDL.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LexYAML.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LineMarker.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\LineMarker.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\Platform.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\PropSet.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\PropSet.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\RESearch.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\RESearch.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\SciLexer.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\Scintilla.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ScintillaBase.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ScintillaBase.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\ScintillaWidget.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\SString.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Style.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\Style.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\StyleContext.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\StyleContext.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\SVector.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\UniConversion.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\UniConversion.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ViewStyle.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\ViewStyle.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\WindowAccessor.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\include\WindowAccessor.h" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\XPM.cxx" + > + </File> + <File + RelativePath=".\wxscintilla\src\scintilla\src\XPM.h" + > + </File> + </Filter> + </Filter> + <Filter + Name="wxflatnotebook" + > + <File + RelativePath=".\wxflatnotebook\src\wxflatnotebook\fnb_resources.cpp" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\fnb_resources.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\src\wxflatnotebook\popup_dlg.cpp" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\popup_dlg.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\src\wxflatnotebook\renderer.cpp" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\renderer.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\singleton.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\smart_ptr.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\src\wxflatnotebook\wxFlatNotebook.cpp" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\wxflatnotebook.h" + > + </File> + <File + RelativePath=".\wxflatnotebook\include\wx\wxflatnotebook\wxfnbdroptarget.h" + > + </File> + </Filter> <File RelativePath=".\aboutDlg.cpp" *************** *** 280,283 **** --- 800,811 ---- </File> <File + RelativePath=".\sparkedit.cpp" + > + </File> + <File + RelativePath=".\sparkedit.h" + > + </File> + <File RelativePath=".\sparkglcanvas.cpp" > --- NEW FILE: sparkedit.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: sparkedit.cpp,v 1.2 2007/06/23 13:36:28 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "sparkedit.h" #include <wx/colour.h> #include <wx/filename.h> #include <rsgedit/res/xpm_play.xpm> #include <rsgedit/res/xpm_spark.xpm> #include <rsgedit/res/xpm_ruby.xpm> #include <rsgedit/res/xpm_rsg.xpm> static wxColour COL_COMMENT(0,128,0); static wxColour COL_KEYWORD(0,0,255); SparkEdit::TEditMap SparkEdit::mEditMap; wxFlatNotebookImageList Sp... [truncated message content] |
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxscintilla/src/scintilla/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxscintilla/src/scintilla/src Added Files: AutoComplete.cxx AutoComplete.h CallTip.cxx CallTip.h CellBuffer.cxx CellBuffer.h CharClassify.cxx CharClassify.h ContractionState.cxx ContractionState.h Document.cxx Document.h DocumentAccessor.cxx DocumentAccessor.h Editor.cxx Editor.h ExternalLexer.cxx ExternalLexer.h Indicator.cxx Indicator.h KeyMap.cxx KeyMap.h KeyWords.cxx LexAPDL.cxx LexAU3.cxx LexAVE.cxx LexAda.cxx LexAsm.cxx LexAsn1.cxx LexBaan.cxx LexBash.cxx LexBasic.cxx LexBullant.cxx LexCLW.cxx LexCPP.cxx LexCSS.cxx LexCaml.cxx LexConf.cxx LexCrontab.cxx LexCsound.cxx LexEScript.cxx LexEiffel.cxx LexErlang.cxx LexFlagship.cxx LexForth.cxx LexFortran.cxx LexGen.py LexGui4Cli.cxx LexHTML.cxx LexHaskell.cxx LexInno.cxx LexKix.cxx LexLisp.cxx LexLout.cxx LexLua.cxx LexMMIXAL.cxx LexMPT.cxx LexMSSQL.cxx LexMatlab.cxx LexMetapost.cxx LexNsis.cxx LexOpal.cxx LexOthers.cxx LexPB.cxx LexPOV.cxx LexPS.cxx LexPascal.cxx LexPerl.cxx LexPython.cxx LexRebol.cxx LexRuby.cxx LexSQL.cxx LexScriptol.cxx LexSmalltalk.cxx LexSpecman.cxx LexSpice.cxx LexTADS3.cxx LexTCL.cxx LexTeX.cxx LexVB.cxx LexVHDL.cxx LexVerilog.cxx LexYAML.cxx LineMarker.cxx LineMarker.h PropSet.cxx RESearch.cxx RESearch.h SVector.h SciTE.properties ScintillaBase.cxx ScintillaBase.h Style.cxx Style.h StyleContext.cxx StyleContext.h UniConversion.cxx UniConversion.h ViewStyle.cxx ViewStyle.h WindowAccessor.cxx XPM.cxx XPM.h Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: KeyMap.cxx --- // Scintilla source code edit control /** @file KeyMap.cxx ** Defines a mapping between keystrokes and commands. **/ // Copyright 1998-2003 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #include "Platform.h" #include "Scintilla.h" #include "KeyMap.h" KeyMap::KeyMap() : kmap(0), len(0), alloc(0) { for (int i = 0; MapDefault[i].key; i++) { AssignCmdKey(MapDefault[i].key, MapDefault[i].modifiers, MapDefault[i].msg); } } KeyMap::~KeyMap() { Clear(); } void KeyMap::Clear() { delete []kmap; kmap = 0; len = 0; alloc = 0; } void KeyMap::AssignCmdKey(int key, int modifiers, unsigned int msg) { if ((len+1) >= alloc) { KeyToCommand *ktcNew = new KeyToCommand[alloc + 5]; if (!ktcNew) return; for (int k = 0; k < len; k++) ktcNew[k] = kmap[k]; alloc += 5; delete []kmap; kmap = ktcNew; } for (int keyIndex = 0; keyIndex < len; keyIndex++) { if ((key == kmap[keyIndex].key) && (modifiers == kmap[keyIndex].modifiers)) { kmap[keyIndex].msg = msg; return; } } kmap[len].key = key; kmap[len].modifiers = modifiers; kmap[len].msg = msg; len++; } unsigned int KeyMap::Find(int key, int modifiers) { for (int i = 0; i < len; i++) { if ((key == kmap[i].key) && (modifiers == kmap[i].modifiers)) { return kmap[i].msg; } } return 0; } const KeyToCommand KeyMap::MapDefault[] = { {SCK_DOWN, SCI_NORM, SCI_LINEDOWN}, {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND}, {SCK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN}, {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND}, {SCK_UP, SCI_NORM, SCI_LINEUP}, {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND}, {SCK_UP, SCI_CTRL, SCI_LINESCROLLUP}, {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND}, {'[', SCI_CTRL, SCI_PARAUP}, {'[', SCI_CSHIFT, SCI_PARAUPEXTEND}, {']', SCI_CTRL, SCI_PARADOWN}, {']', SCI_CSHIFT, SCI_PARADOWNEXTEND}, {SCK_LEFT, SCI_NORM, SCI_CHARLEFT}, {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND}, {SCK_LEFT, SCI_CTRL, SCI_WORDLEFT}, {SCK_LEFT, SCI_CSHIFT, SCI_WORDLEFTEXTEND}, {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND}, {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT}, {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND}, {SCK_RIGHT, SCI_CTRL, SCI_WORDRIGHT}, {SCK_RIGHT, SCI_CSHIFT, SCI_WORDRIGHTEXTEND}, {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND}, {'/', SCI_CTRL, SCI_WORDPARTLEFT}, {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND}, {'\\', SCI_CTRL, SCI_WORDPARTRIGHT}, {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND}, {SCK_HOME, SCI_NORM, SCI_VCHOME}, {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND}, {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART}, {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY}, // {SCK_HOME, SCI_ASHIFT, SCI_HOMEDISPLAYEXTEND}, {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND}, {SCK_END, SCI_NORM, SCI_LINEEND}, {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND}, {SCK_END, SCI_CTRL, SCI_DOCUMENTEND}, {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY}, // {SCK_END, SCI_ASHIFT, SCI_LINEENDDISPLAYEXTEND}, {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND}, {SCK_PRIOR, SCI_NORM, SCI_PAGEUP}, {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND}, {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND}, {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN}, {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND}, {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND}, {SCK_DELETE, SCI_NORM, SCI_CLEAR}, {SCK_DELETE, SCI_SHIFT, SCI_CUT}, {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT}, {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT}, {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE}, {SCK_INSERT, SCI_SHIFT, SCI_PASTE}, {SCK_INSERT, SCI_CTRL, SCI_COPY}, {SCK_ESCAPE, SCI_NORM, SCI_CANCEL}, {SCK_BACK, SCI_NORM, SCI_DELETEBACK}, {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK}, {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT}, {SCK_BACK, SCI_ALT, SCI_UNDO}, {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT}, {'Z', SCI_CTRL, SCI_UNDO}, {'Y', SCI_CTRL, SCI_REDO}, {'X', SCI_CTRL, SCI_CUT}, {'C', SCI_CTRL, SCI_COPY}, {'V', SCI_CTRL, SCI_PASTE}, {'A', SCI_CTRL, SCI_SELECTALL}, {SCK_TAB, SCI_NORM, SCI_TAB}, {SCK_TAB, SCI_SHIFT, SCI_BACKTAB}, {SCK_RETURN, SCI_NORM, SCI_NEWLINE}, {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE}, {SCK_ADD, SCI_CTRL, SCI_ZOOMIN}, {SCK_SUBTRACT, SCI_CTRL, SCI_ZOOMOUT}, {SCK_DIVIDE, SCI_CTRL, SCI_SETZOOM}, //'L', SCI_CTRL, SCI_FORMFEED, {'L', SCI_CTRL, SCI_LINECUT}, {'L', SCI_CSHIFT, SCI_LINEDELETE}, {'T', SCI_CSHIFT, SCI_LINECOPY}, {'T', SCI_CTRL, SCI_LINETRANSPOSE}, {'D', SCI_CTRL, SCI_SELECTIONDUPLICATE}, {'U', SCI_CTRL, SCI_LOWERCASE}, {'U', SCI_CSHIFT, SCI_UPPERCASE}, {0,0,0}, }; --- NEW FILE: LexGui4Cli.cxx --- // Scintilla source code edit control // Copyright 1998-2002 by Neil Hodgson <ne...@sc...> /* This is the Lexer for Gui4Cli, included in SciLexer.dll - by d. Keletsekis, 2/10/2003 To add to SciLexer.dll: 1. Add the values below to INCLUDE\Scintilla.iface 2. Run the include/HFacer.py script 3. Run the src/lexGen.py script val SCE_GC_DEFAULT=0 val SCE_GC_COMMENTLINE=1 val SCE_GC_COMMENTBLOCK=2 val SCE_GC_GLOBAL=3 val SCE_GC_EVENT=4 val SCE_GC_ATTRIBUTE=5 val SCE_GC_CONTROL=6 val SCE_GC_COMMAND=7 val SCE_GC_STRING=8 val SCE_GC_OPERATOR=9 */ #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #define debug Platform::DebugPrintf static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'); } inline bool isGCOperator(int ch) { if (isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '%' || ch == '[' || ch == ']' || ch == '<' || ch == '>' || ch == ',' || ch == ';' || ch == ':') return true; return false; } #define isSpace(x) ((x)==' ' || (x)=='\t') #define isNL(x) ((x)=='\n' || (x)=='\r') #define isSpaceOrNL(x) (isSpace(x) || isNL(x)) #define BUFFSIZE 500 #define isFoldPoint(x) ((styler.LevelAt(x) & SC_FOLDLEVELNUMBERMASK) == 1024) static void colorFirstWord(WordList *keywordlists[], Accessor &styler, StyleContext *sc, char *buff, int length, int) { int c = 0; while (sc->More() && isSpaceOrNL(sc->ch)) { sc->Forward(); } styler.ColourTo(sc->currentPos - 1, sc->state); if (!IsAWordChar(sc->ch)) // comment, marker, etc.. return; while (sc->More() && !isSpaceOrNL(sc->ch) && (c < length-1) && !isGCOperator(sc->ch)) { buff[c] = static_cast<char>(sc->ch); ++c; sc->Forward(); } buff[c] = '\0'; char *p = buff; while (*p) // capitalize.. { if (islower(*p)) *p = static_cast<char>(toupper(*p)); ++p; } WordList &kGlobal = *keywordlists[0]; // keyword lists set by the user WordList &kEvent = *keywordlists[1]; WordList &kAttribute = *keywordlists[2]; WordList &kControl = *keywordlists[3]; WordList &kCommand = *keywordlists[4]; int state = 0; // int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK; // debug ("line = %d, level = %d", line, level); if (kGlobal.InList(buff)) state = SCE_GC_GLOBAL; else if (kAttribute.InList(buff)) state = SCE_GC_ATTRIBUTE; else if (kControl.InList(buff)) state = SCE_GC_CONTROL; else if (kCommand.InList(buff)) state = SCE_GC_COMMAND; else if (kEvent.InList(buff)) state = SCE_GC_EVENT; if (state) { sc->ChangeState(state); styler.ColourTo(sc->currentPos - 1, sc->state); sc->ChangeState(SCE_GC_DEFAULT); } else { sc->ChangeState(SCE_GC_DEFAULT); styler.ColourTo(sc->currentPos - 1, sc->state); } } // Main colorizing function called by Scintilla static void ColouriseGui4CliDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); int quotestart = 0, oldstate, currentline = styler.GetLine(startPos); styler.StartSegment(startPos); bool noforward; char buff[BUFFSIZE+1]; // buffer for command name StyleContext sc(startPos, length, initStyle, styler); buff[0] = '\0'; // cbuff = 0; if (sc.state != SCE_GC_COMMENTBLOCK) // colorize 1st word.. colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); while (sc.More()) { noforward = 0; switch (sc.ch) { case '/': if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_STRING) break; if (sc.chNext == '/') // line comment { sc.SetState (SCE_GC_COMMENTLINE); sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); } else if (sc.chNext == '*') // block comment { sc.SetState(SCE_GC_COMMENTBLOCK); sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); } else styler.ColourTo(sc.currentPos, sc.state); break; case '*': // end of comment block, or operator.. if (sc.state == SCE_GC_STRING) break; if (sc.state == SCE_GC_COMMENTBLOCK && sc.chNext == '/') { sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState (SCE_GC_DEFAULT); } else styler.ColourTo(sc.currentPos, sc.state); break; case '\'': case '\"': // strings.. if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_COMMENTLINE) break; if (sc.state == SCE_GC_STRING) { if (sc.ch == quotestart) // match same quote char.. { styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState(SCE_GC_DEFAULT); quotestart = 0; } } else { styler.ColourTo(sc.currentPos - 1, sc.state); sc.ChangeState(SCE_GC_STRING); quotestart = sc.ch; } break; case ';': // end of commandline character if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && sc.state != SCE_GC_STRING) { styler.ColourTo(sc.currentPos - 1, sc.state); styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(SCE_GC_DEFAULT); sc.Forward(); colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); noforward = 1; // don't move forward - already positioned at next char.. } break; case '+': case '-': case '=': case '!': // operators.. case '<': case '>': case '&': case '|': case '$': if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && sc.state != SCE_GC_STRING) { styler.ColourTo(sc.currentPos - 1, sc.state); styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(SCE_GC_DEFAULT); } break; case '\\': // escape - same as operator, but also mark in strings.. if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE) { oldstate = sc.state; styler.ColourTo(sc.currentPos - 1, sc.state); sc.Forward(); // mark also the next char.. styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(oldstate); } break; case '\n': case '\r': ++currentline; if (sc.state == SCE_GC_COMMENTLINE) { styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState (SCE_GC_DEFAULT); } else if (sc.state != SCE_GC_COMMENTBLOCK) { colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); noforward = 1; // don't move forward - already positioned at next char.. } break; // case ' ': case '\t': // default : } if (!noforward) sc.Forward(); } sc.Complete(); } // Main folding function called by Scintilla - (based on props (.ini) files function) static void FoldGui4Cli(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); bool headerPoint = false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler[i+1]; int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_GC_EVENT || style == SCE_GC_GLOBAL) { headerPoint = true; // fold at events and globals } if (atEOL) { int lev = SC_FOLDLEVELBASE+1; if (headerPoint) lev = SC_FOLDLEVELBASE; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (headerPoint) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) // set level, if not already correct { styler.SetLevel(lineCurrent, lev); } lineCurrent++; // re-initialize our flags visibleChars = 0; headerPoint = false; } if (!(isspacechar(ch))) // || (style == SCE_GC_COMMENTLINE) || (style != SCE_GC_COMMENTBLOCK))) visibleChars++; } int lev = headerPoint ? SC_FOLDLEVELBASE : SC_FOLDLEVELBASE+1; int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, lev | flagsNext); } // I have no idea what these are for.. probably accessible by some message. static const char * const gui4cliWordListDesc[] = { "Globals", "Events", "Attributes", "Control", "Commands", 0 }; // Declare language & pass our function pointers to Scintilla LexerModule lmGui4Cli(SCLEX_GUI4CLI, ColouriseGui4CliDoc, "gui4cli", FoldGui4Cli, gui4cliWordListDesc); #undef debug --- NEW FILE: LexAsm.cxx --- // Scintilla source code edit control /** @file LexAsm.cxx ** Lexer for Assembler, just for the MASM syntax ** Written by The Black Horus ** Enhancements and NASM stuff by Kein-Hong Man, 2003-10 ** SCE_ASM_COMMENTBLOCK and SCE_ASM_CHARACTER are for future GNU as colouring **/ // Copyright 1998-2003 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '?'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || ch == '%' || ch == '@' || ch == '$' || ch == '?'); } static inline bool IsAsmOperator(char ch) { if (isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '^' || ch == '[' || ch == ']' || ch == '<' || ch == '&' || ch == '>' || ch == ',' || ch == '|' || ch == '~' || ch == '%' || ch == ':') return true; return false; } static void ColouriseAsmDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &cpuInstruction = *keywordlists[0]; WordList &mathInstruction = *keywordlists[1]; WordList ®isters = *keywordlists[2]; WordList &directive = *keywordlists[3]; WordList &directiveOperand = *keywordlists[4]; WordList &extInstruction = *keywordlists[5]; // Do not leak onto next line if (initStyle == SCE_ASM_STRINGEOL) initStyle = SCE_ASM_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Prevent SCE_ASM_STRINGEOL from leaking back to previous line if (sc.atLineStart && (sc.state == SCE_ASM_STRING)) { sc.SetState(SCE_ASM_STRING); } else if (sc.atLineStart && (sc.state == SCE_ASM_CHARACTER)) { sc.SetState(SCE_ASM_CHARACTER); } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_ASM_OPERATOR) { if (!IsAsmOperator(static_cast<char>(sc.ch))) { sc.SetState(SCE_ASM_DEFAULT); } }else if (sc.state == SCE_ASM_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_IDENTIFIER) { if (!IsAWordChar(sc.ch) ) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (cpuInstruction.InList(s)) { sc.ChangeState(SCE_ASM_CPUINSTRUCTION); } else if (mathInstruction.InList(s)) { sc.ChangeState(SCE_ASM_MATHINSTRUCTION); } else if (registers.InList(s)) { sc.ChangeState(SCE_ASM_REGISTER); } else if (directive.InList(s)) { sc.ChangeState(SCE_ASM_DIRECTIVE); } else if (directiveOperand.InList(s)) { sc.ChangeState(SCE_ASM_DIRECTIVEOPERAND); } else if (extInstruction.InList(s)) { sc.ChangeState(SCE_ASM_EXTINSTRUCTION); } sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_COMMENT ) { if (sc.atLineEnd) { sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_ASM_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_ASM_STRINGEOL); sc.ForwardSetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_CHARACTER) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ASM_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_ASM_STRINGEOL); sc.ForwardSetState(SCE_ASM_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_ASM_DEFAULT) { if (sc.ch == ';'){ sc.SetState(SCE_ASM_COMMENT); } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { sc.SetState(SCE_ASM_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_ASM_IDENTIFIER); } else if (sc.ch == '\"') { sc.SetState(SCE_ASM_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_ASM_CHARACTER); } else if (IsAsmOperator(static_cast<char>(sc.ch))) { sc.SetState(SCE_ASM_OPERATOR); } } } sc.Complete(); } static const char * const asmWordListDesc[] = { "CPU instructions", "FPU instructions", "Registers", "Directives", "Directive operands", "Extended instructions", 0 }; LexerModule lmAsm(SCLEX_ASM, ColouriseAsmDoc, "asm", 0, asmWordListDesc); --- NEW FILE: CallTip.h --- // Scintilla source code edit control /** @file CallTip.h ** Interface to the call tip control. **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #ifndef CALLTIP_H #define CALLTIP_H /** */ class CallTip { int startHighlight; // character offset to start and... int endHighlight; // ...end of highlighted text char *val; Font font; PRectangle rectUp; // rectangle of last up angle in the tip PRectangle rectDown; // rectangle of last down arrow in the tip int lineHeight; // vertical line spacing int offsetMain; // The alignment point of the call tip int tabSize; // Tab size in pixels, <=0 no TAB expand bool useStyleCallTip; // if true, STYLE_CALLTIP should be used // Private so CallTip objects can not be copied CallTip(const CallTip &) {} CallTip &operator=(const CallTip &) { return *this; } void DrawChunk(Surface *surface, int &x, const char *s, int posStart, int posEnd, int ytext, PRectangle rcClient, bool highlight, bool draw); int PaintContents(Surface *surfaceWindow, bool draw); bool IsTabCharacter(char c); int NextTabPos(int x); public: Window wCallTip; Window wDraw; bool inCallTipMode; int posStartCallTip; ColourPair colourBG; ColourPair colourUnSel; ColourPair colourSel; ColourPair colourShade; ColourPair colourLight; int codePage; int clickPlace; CallTip(); ~CallTip(); /// Claim or accept palette entries for the colours required to paint a calltip. void RefreshColourPalette(Palette &pal, bool want); void PaintCT(Surface *surfaceWindow); void MouseClick(Point pt); /// Setup the calltip and return a rectangle of the area required. PRectangle CallTipStart(int pos, Point pt, const char *defn, const char *faceName, int size, int codePage_, int characterSet, Window &wParent); void CallTipCancel(); /// Set a range of characters to be displayed in a highlight style. /// Commonly used to highlight the current parameter. void SetHighlight(int start, int end); /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand. void SetTabSize(int tabSz); /// Used to determine which STYLE_xxxx to use for call tip information bool UseStyleCallTip() const { return useStyleCallTip;} // Modify foreground and background colours void SetForeBack(const ColourPair &fore, const ColourPair &back); }; #endif --- NEW FILE: LexKix.cxx --- // Scintilla source code edit control /** @file LexKix.cxx ** Lexer for KIX-Scripts. **/ // Copyright 2004 by Manfred Becker <ma...@be...> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || isalnum(ch) || ch == '_'; } static inline bool IsOperator(const int ch) { return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '&' || ch == '|' || ch == '<' || ch == '>' || ch == '='); } static void ColouriseKixDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; // WordList &keywords4 = *keywordlists[3]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_KIX_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_STRING1) { // This is a doubles quotes string if (sc.ch == '\"') { sc.ForwardSetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_STRING2) { // This is a single quote string if (sc.ch == '\'') { sc.ForwardSetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_NUMBER) { if (!IsADigit(sc.ch)) { sc.SetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_VAR) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_MACRO) { if (!IsAWordChar(sc.ch) && !IsADigit(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (!keywords3.InList(&s[1])) { sc.ChangeState(SCE_KIX_DEFAULT); } sc.SetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_OPERATOR) { if (!IsOperator(sc.ch)) { sc.SetState(SCE_KIX_DEFAULT); } } else if (sc.state == SCE_KIX_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_KIX_KEYWORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_KIX_FUNCTIONS); } sc.SetState(SCE_KIX_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_KIX_DEFAULT) { if (sc.ch == ';') { sc.SetState(SCE_KIX_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_KIX_STRING1); } else if (sc.ch == '\'') { sc.SetState(SCE_KIX_STRING2); } else if (sc.ch == '$') { sc.SetState(SCE_KIX_VAR); } else if (sc.ch == '@') { sc.SetState(SCE_KIX_MACRO); } else if (IsADigit(sc.ch) || ((sc.ch == '.' || sc.ch == '&') && IsADigit(sc.chNext))) { sc.SetState(SCE_KIX_NUMBER); } else if (IsOperator(sc.ch)) { sc.SetState(SCE_KIX_OPERATOR); } else if (IsAWordChar(sc.ch)) { sc.SetState(SCE_KIX_IDENTIFIER); } } } sc.Complete(); } LexerModule lmKix(SCLEX_KIX, ColouriseKixDoc, "kix"); --- NEW FILE: Document.h --- // Scintilla source code edit control /** @file Document.h ** Text document that handles notifications, DBCS, styling, words and end of line. **/ // Copyright 1998-2003 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #ifndef DOCUMENT_H #define DOCUMENT_H /** * A Position is a position within a document between two characters or at the beginning or end. * Sometimes used as a character index where it identifies the character after the position. */ typedef int Position; const Position invalidPosition = -1; /** * The range class represents a range of text in a document. * The two values are not sorted as one end may be more significant than the other * as is the case for the selection where the end position is the position of the caret. * If either position is invalidPosition then the range is invalid and most operations will fail. */ class Range { public: Position start; Position end; Range(Position pos=0) : start(pos), end(pos) { }; Range(Position start_, Position end_) : start(start_), end(end_) { }; bool Valid() const { return (start != invalidPosition) && (end != invalidPosition); } // Is the position within the range? bool Contains(Position pos) const { if (start < end) { return (pos >= start && pos <= end); } else { return (pos <= start && pos >= end); } } // Is the character after pos within the range? bool ContainsCharacter(Position pos) const { if (start < end) { return (pos >= start && pos < end); } else { return (pos < start && pos >= end); } } bool Contains(Range other) const { return Contains(other.start) && Contains(other.end); } bool Overlaps(Range other) const { return Contains(other.start) || Contains(other.end) || other.Contains(start) || other.Contains(end); } }; class DocWatcher; class DocModification; class RESearch; /** */ class Document { public: /** Used to pair watcher pointer with user data. */ class WatcherWithUserData { public: DocWatcher *watcher; void *userData; WatcherWithUserData() { watcher = 0; userData = 0; } }; enum charClassification { ccSpace, ccNewLine, ccWord, ccPunctuation }; private: int refCount; CellBuffer cb; CharClassify charClass; char stylingMask; int endStyled; int styleClock; int enteredCount; int enteredReadOnlyCount; WatcherWithUserData *watchers; int lenWatchers; bool matchesValid; RESearch *pre; char *substituted; public: int stylingBits; int stylingBitsMask; int eolMode; /// Can also be SC_CP_UTF8 to enable UTF-8 mode int dbcsCodePage; int tabInChars; int indentInChars; int actualIndentInChars; bool useTabs; bool tabIndents; bool backspaceUnindents; Document(); virtual ~Document(); int AddRef(); int Release(); int LineFromPosition(int pos); int ClampPositionIntoDocument(int pos); bool IsCrLf(int pos); int LenChar(int pos); int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); // Gateways to modifying document void ModifiedAt(int pos); bool DeleteChars(int pos, int len); bool InsertStyledString(int position, char *s, int insertLength); int Undo(); int Redo(); bool CanUndo() { return cb.CanUndo(); } bool CanRedo() { return cb.CanRedo(); } void DeleteUndoHistory() { cb.DeleteUndoHistory(); } bool SetUndoCollection(bool collectUndo) { return cb.SetUndoCollection(collectUndo); } bool IsCollectingUndo() { return cb.IsCollectingUndo(); } void BeginUndoAction() { cb.BeginUndoAction(); } void EndUndoAction() { cb.EndUndoAction(); } void SetSavePoint(); bool IsSavePoint() { return cb.IsSavePoint(); } int GetLineIndentation(int line); void SetLineIndentation(int line, int indent); int GetLineIndentPosition(int line); int GetColumn(int position); int FindColumn(int line, int column); void Indent(bool forwards, int lineBottom, int lineTop); static char *TransformLineEnds(int *pLenOut, const char *s, size_t len, int eolMode); void ConvertLineEnds(int eolModeSet); void SetReadOnly(bool set) { cb.SetReadOnly(set); } bool IsReadOnly() { return cb.IsReadOnly(); } bool InsertChar(int pos, char ch); bool InsertString(int position, const char *s); bool InsertString(int position, const char *s, size_t insertLength); void ChangeChar(int pos, char ch); void DelChar(int pos); void DelCharBack(int pos); char CharAt(int position) { return cb.CharAt(position); } void GetCharRange(char *buffer, int position, int lengthRetrieve) { cb.GetCharRange(buffer, position, lengthRetrieve); } char StyleAt(int position) { return cb.StyleAt(position); } int GetMark(int line) { return cb.GetMark(line); } int AddMark(int line, int markerNum); void AddMarkSet(int line, int valueSet); void DeleteMark(int line, int markerNum); void DeleteMarkFromHandle(int markerHandle); void DeleteAllMarks(int markerNum); int LineFromHandle(int markerHandle) { return cb.LineFromHandle(markerHandle); } int LineStart(int line); int LineEnd(int line); int LineEndPosition(int position); int VCHomePosition(int position); int SetLevel(int line, int level); int GetLevel(int line) { return cb.GetLevel(line); } void ClearLevels() { cb.ClearLevels(); } int GetLastChild(int lineParent, int level=-1); int GetFoldParent(int line); void Indent(bool forwards); int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false); int NextWordStart(int pos, int delta); int NextWordEnd(int pos, int delta); int Length() { return cb.Length(); } void Allocate(int newSize) { cb.Allocate(newSize*2); } long FindText(int minPos, int maxPos, const char *s, bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, int *length); long FindText(int iMessage, unsigned long wParam, long lParam); const char *SubstituteByPosition(const char *text, int *length); int LinesTotal(); void ChangeCase(Range r, bool makeUpperCase); void SetDefaultCharClasses(bool includeWordClass); void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass); void SetStylingBits(int bits); void StartStyling(int position, char mask); bool SetStyleFor(int length, char style); bool SetStyles(int length, char *styles); int GetEndStyled() { return endStyled; } bool EnsureStyledTo(int pos); int GetStyleClock() { return styleClock; } void IncrementStyleClock(); int SetLineState(int line, int state) { return cb.SetLineState(line, state); } int GetLineState(int line) { return cb.GetLineState(line); } int GetMaxLineState() { return cb.GetMaxLineState(); } bool AddWatcher(DocWatcher *watcher, void *userData); bool RemoveWatcher(DocWatcher *watcher, void *userData); const WatcherWithUserData *GetWatchers() const { return watchers; } int GetLenWatchers() const { return lenWatchers; } bool IsWordPartSeparator(char ch); int WordPartLeft(int pos); int WordPartRight(int pos); int ExtendStyleRange(int pos, int delta, bool singleLine = false); bool IsWhiteLine(int line); int ParaUp(int pos); int ParaDown(int pos); int IndentSize() { return actualIndentInChars; } int BraceMatch(int position, int maxReStyle); private: void CheckReadOnly(); CharClassify::cc WordCharClass(unsigned char ch); bool IsWordStartAt(int pos); bool IsWordEndAt(int pos); bool IsWordAt(int start, int end); void NotifyModifyAttempt(); void NotifySavePoint(bool atSavePoint); void NotifyModified(DocModification mh); }; /** * To optimise processing of document modifications by DocWatchers, a hint is passed indicating the * scope of the change. * If the DocWatcher is a document view then this can be used to optimise screen updating. */ class DocModification { public: int modificationType; int position; int length; int linesAdded; /**< Negative if lines deleted. */ const char *text; /**< Only valid for changes to text, not for changes to style. */ int line; int foldLevelNow; int foldLevelPrev; DocModification(int modificationType_, int position_=0, int length_=0, int linesAdded_=0, const char *text_=0, int line_=0) : modificationType(modificationType_), position(position_), length(length_), linesAdded(linesAdded_), text(text_), line(line_), foldLevelNow(0), foldLevelPrev(0) {} DocModification(int modificationType_, const Action &act, int linesAdded_=0) : modificationType(modificationType_), position(act.position), length(act.lenData), linesAdded(linesAdded_), text(act.data), line(0), foldLevelNow(0), foldLevelPrev(0) {} }; /** * A class that wants to receive notifications from a Document must be derived from DocWatcher * and implement the notification methods. It can then be added to the watcher list with AddWatcher. */ class DocWatcher { public: virtual ~DocWatcher() {} virtual void NotifyModifyAttempt(Document *doc, void *userData) = 0; virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0; virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0; virtual void NotifyDeleted(Document *doc, void *userData) = 0; virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0; }; #endif --- NEW FILE: LexAVE.cxx --- // SciTE - Scintilla based Text Editor /** @file LexAVE.cxx ** Lexer for Avenue. ** ** Written by Alexey Yutkin <yu...@ge...>. **/ // Copyright 1998-2002 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdarg.h> #include <stdio.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsEnumChar(const int ch) { return (ch < 0x80) && (isalnum(ch)|| ch == '_'); } static inline bool IsANumberChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' ); } inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } inline bool isAveOperator(char ch) { if (isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '{' || ch == '}' || ch == '[' || ch == ']' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || ch == '.' ) return true; return false; } static void ColouriseAveDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; // Do not leak onto next line if (initStyle == SCE_AVE_STRINGEOL) { initStyle = SCE_AVE_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineEnd) { // Update the line state, so it can be seen by next line int currentLine = styler.GetLine(sc.currentPos); styler.SetLineState(currentLine, 0); } if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) { // Prevent SCE_AVE_STRINGEOL from leaking back to previous line sc.SetState(SCE_AVE_STRING); } // Determine if the current state should terminate. if (sc.state == SCE_AVE_OPERATOR) { sc.SetState(SCE_AVE_DEFAULT); } else if (sc.state == SCE_AVE_NUMBER) { if (!IsANumberChar(sc.ch)) { sc.SetState(SCE_AVE_DEFAULT); } } else if (sc.state == SCE_AVE_ENUM) { if (!IsEnumChar(sc.ch)) { sc.SetState(SCE_AVE_DEFAULT); } } else if (sc.state == SCE_AVE_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; //sc.GetCurrent(s, sizeof(s)); sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_AVE_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_AVE_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_AVE_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_AVE_WORD4); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_AVE_WORD5); } else if (keywords6.InList(s)) { sc.ChangeState(SCE_AVE_WORD6); } sc.SetState(SCE_AVE_DEFAULT); } } else if (sc.state == SCE_AVE_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_AVE_DEFAULT); } } else if (sc.state == SCE_AVE_STRING) { if (sc.ch == '\"') { sc.ForwardSetState(SCE_AVE_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_AVE_STRINGEOL); sc.ForwardSetState(SCE_AVE_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_AVE_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_AVE_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_AVE_IDENTIFIER); } else if (sc.Match('\"')) { sc.SetState(SCE_AVE_STRING); } else if (sc.Match('\'')) { sc.SetState(SCE_AVE_COMMENT); sc.Forward(); } else if (isAveOperator(static_cast<char>(sc.ch))) { sc.SetState(SCE_AVE_OPERATOR); } else if (sc.Match('#')) { sc.SetState(SCE_AVE_ENUM); sc.Forward(); } } } sc.Complete(); } static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[], Accessor &styler) { unsigned int lengthDoc = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = static_cast<char>(tolower(styler[startPos])); bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; int styleNext = styler.StyleAt(startPos); char s[10]; for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = static_cast<char>(tolower(chNext)); chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1))); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_AVE_WORD) { if (ch == 't' || ch == 'f' || ch == 'w' || ch == 'e') { for (unsigned int j = 0; j < 6; j++) { if (!iswordchar(styler[i + j])) { break; } s[j] = static_cast<char>(tolower(styler[i + j])); s[j + 1] = '\0'; } if ((strcmp(s, "then") == 0) || (strcmp(s, "for") == 0) || (strcmp(s, "while") == 0)) { levelCurrent++; } if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) { // Normally "elseif" and "then" will be on the same line and will cancel // each other out. // As implemented, this does not support fold.at.else. levelCurrent--; } } } else if (style == SCE_AVE_OPERATOR) { if (ch == '{' || ch == '(') { levelCurrent++; } else if (ch == '}' || ch == ')') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) { lev |= SC_FOLDLEVELWHITEFLAG; } if ((levelCurrent > levelPrev) && (visibleChars > 0)) { lev |= SC_FOLDLEVELHEADERFLAG; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) { visibleChars++; } } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } LexerModule lmAVE(SCLEX_AVE, ColouriseAveDoc, "ave", FoldAveDoc); --- NEW FILE: LexPascal.cxx --- // Scintilla source code edit control /** @file LexPascal.cxx ** Lexer for Pascal. ** Written by Laurent le Tynevez ** Updated by Simon Steele <s.s...@pn...> September 2002 ** Updated by Mathias Rauen <sc...@ma...> May 2003 (Delphi adjustments) **/ #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #include "StyleContext.h" static void getRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast<char>(tolower(styler[start + i])); i++; } s[i] = '\0'; } static bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; } static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) { if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) { styler.ColourTo(end, SCE_C_REGEX); } else styler.ColourTo(end, attr); } // returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm" static int classifyWordPascal(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInClass, bool bInAsm) { int ret = 0; WordList& keywords = *keywordlists[0]; WordList& classwords = *keywordlists[1]; char s[100]; getRange(start, end, styler, s, sizeof(s)); char chAttr = SCE_C_IDENTIFIER; if (isdigit(s[0]) || (s[0] == '.') ||(s[0] == '$')) { chAttr = SCE_C_NUMBER; } else { if (s[0] == '#') { chAttr = SCE_C_CHARACTER; } else { if (keywords.InList(s)) { chAttr = SCE_C_WORD; if(strcmp(s, "class") == 0) { ret = 1; } else if (strcmp(s, "asm") == 0) { ret = 2; } else if (strcmp(s, "end") == 0) { ret = -1; } } else if (bInClass) { if (classwords.InList(s)) { chAttr = SCE_C_WORD; } } } } ColourTo(styler, end, chAttr, (bInAsm && ret != -1)); return ret; } static int classifyFoldPointPascal(const char* s) { int lev = 0; if (!(isdigit(s[0]) || (s[0] == '.'))) { if (strcmp(s, "begin") == 0 || strcmp(s, "object") == 0 || strcmp(s, "case") == 0 || strcmp(s, "class") == 0 || strcmp(s, "record") == 0 || strcmp(s, "try") == 0) { lev=1; } else if (strcmp(s, "end") == 0) { lev=-1; } } return lev; } static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); int state = initStyle; if (state == SCE_C_CHARACTER) // Does not leak onto next line state = SCE_C_DEFAULT; char chPrev = ' '; char chNext = styler[startPos]; unsigned int lengthDoc = startPos + length; bool bInClassDefinition; int currentLine = styler.GetLine(startPos); if (currentLine > 0) { styler.SetLineState(currentLine, styler.GetLineState(currentLine-1)); bInClassDefinition = (styler.GetLineState(currentLine) == 1); } else { styler.SetLineState(currentLine, 0); bInClassDefinition = false; } bool bInAsm = (state == SCE_C_REGEX); if (bInAsm) state = SCE_C_DEFAULT; styler.StartSegment(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // End of line if (state == SCE_C_CHARACTER) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } currentLine++; styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0)); } if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } if (state == SCE_C_DEFAULT) { if (iswordstart(ch) || ch == '#' || ch == '$' || (ch == '@' && bInAsm)) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_IDENTIFIER; } else if (ch == '{' && chNext != '$' && chNext != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENT; } else if (ch == '(' && chNext == '*' && styler.SafeGetCharAt(i + 2) != '$' && styler.SafeGetCharAt(i + 2) != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '/' && chNext == '/') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTLINE; } else if (ch == '\'') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_CHARACTER; } else if (ch == '{' && (chNext == '$' || chNext=='&')) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_PREPROCESSOR; } else if (isoperator(ch)) { ColourTo(styler, i-1, state, bInAsm); ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } else if (state == SCE_C_IDENTIFIER) { bool bDoublePoint = ((ch == '.') && (chPrev == '.')); if ((!iswordchar(ch) && ch != '$' && ch != '#' && (ch != '@' || !bInAsm)) || bDoublePoint) { if (bDoublePoint) i--; int lStateChange = classifyWordPascal(styler.GetStartSegment(), i - 1, keywordlists, styler, bInClassDefinition, bInAsm); if(lStateChange == 1) { styler.SetLineState(currentLine, 1); bInClassDefinition = true; } else if(lStateChange == 2) { bInAsm = true; } else if(lStateChange == -1) { styler.SetLineState(currentLine, 0); bInClassDefinition = false; bInAsm = false; } if (bDoublePoint) { i++; ColourTo(styler, i-1, SCE_C_DEFAULT, bInAsm); } state = SCE_C_DEFAULT; chNext = styler.SafeGetCharAt(i + 1); if (ch == '{' && chNext != '$' && chNext != '&') { state = SCE_C_COMMENT; } else if (ch == '(' && chNext == '*' && styler.SafeGetCharAt(i + 2) != '$' && styler.SafeGetCharAt(i + 2) != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '/' && chNext == '/') { state = SCE_C_COMMENTLINE; } else if (ch == '\'') { state = SCE_C_CHARACTER; } else if (isoperator(ch)) { ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } } else { if (state == SCE_C_PREPROCESSOR) { if (ch=='}'){ ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } else { if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } } else if (state == SCE_C_COMMENT) { if (ch == '}' ) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_COMMENTDOC) { if (ch == ')' && chPrev == '*') { if (((i > styler.GetStartSegment() + 2) || ( (initStyle == SCE_C_COMMENTDOC) && (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } else if (state == SCE_C_COMMENTLINE) { if (ch == '\r' || ch == '\n') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_CHARACTER) { if (ch == '\'') { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } chPrev = ch; } ColourTo(styler, lengthDoc - 1, state, bInAsm); } static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; int lastStart = 0; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (stylePrev == SCE_C_DEFAULT && style == SCE_C_WORD) { // Store last word start point. lastStart = i; } if (stylePrev == SCE_C_WORD) { if(iswordchar(ch) && !iswordchar(chNext)) { char s[100]; getRange(lastStart, i, styler, s, sizeof(s)); levelCurrent += classifyFoldPointPascal(s); } } if (foldComment && (style == SCE_C_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '{' && chNext == '$') { unsigned int j=i+2; // skip {$ while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "region") || styler.Match(j, "if")) { levelCurrent++; } else if (styler.Match(j, "end")) { levelCurrent--; } } } if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelCurrent++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const pascalWordListDesc[] = { "Keywords", "Classwords", 0 }; LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc, pascalWordListDesc); --- NEW FILE: LexMatlab.cxx --- (This appears to be a binary file; contents omitted.) --- NEW FILE: LexHTML.cxx --- // Scintilla source code edit control /** @file LexHTML.cxx ** Lexer for HTML. **/ // Copyright 1998-2005 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" [...2003 lines suppressed...] "SGML and DTD keywords", 0, }; static const char * const phpscriptWordListDesc[] = { "", //Unused "", //Unused "", //Unused "", //Unused "PHP keywords", "", //Unused 0, }; LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc, 7); LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc, 7); // SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead. LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 7); LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 7); LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 7); --- NEW FILE: LexConf.cxx --- // Scintilla source code edit control /** @file LexConf.cxx ** Lexer for Apache Configuration Files. ** ** First working version contributed by Ahmad Zawawi <zeu...@ho...> on October 28, 2000. ** i created this lexer because i needed something pretty when dealing ** when Apache Configuration files... **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_CONF_DEFAULT; char chNext = styler[startPos]; int lengthDoc = startPos + length; // create a buffer large enough to take the largest chunk... char *buffer = new char[length]; int bufferCount = 0; // this assumes that we have 2 keyword list in conf.properties WordList &directives = *keywordLists[0]; WordList ¶ms = *keywordLists[1]; // go through all provided text segment // using the hand-written state machine shown below styler.StartAt(startPos); styler.StartSegment(startPos); for (int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); i++; continue; } switch(state) { case SCE_CONF_DEFAULT: if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { // whitespace is simply ignored here... styler.ColourTo(i,SCE_CONF_DEFAULT); break; } else if( ch == '#' ) { // signals the start of a comment... state = SCE_CONF_COMMENT; styler.ColourTo(i,SCE_CONF_COMMENT); } else if( ch == '.' /*|| ch == '/'*/) { // signals the start of a file... state = SCE_CONF_EXTENSION; styler.ColourTo(i,SCE_CONF_EXTENSION); } else if( ch == '"') { state = SCE_CONF_STRING; styler.ColourTo(i,SCE_CONF_STRING); } else if( ispunct(ch) ) { // signals an operator... // no state jump necessary for this // simple case... styler.ColourTo(i,SCE_CONF_OPERATOR); } else if( isalpha(ch) ) { // signals the start of an identifier bufferCount = 0; buffer[bufferCount++] = static_cast<char>(tolower(ch)); state = SCE_CONF_IDENTIFIER; } else if( isdigit(ch) ) { // signals the start of a number bufferCount = 0; buffer[bufferCount++] = ch; //styler.ColourTo(i,SCE_CONF_NUMBER); state = SCE_CONF_NUMBER; } else { // style it the default style.. styler.ColourTo(i,SCE_CONF_DEFAULT); } break; case SCE_CONF_COMMENT: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_CONF_DEFAULT; } else { styler.ColourTo(i,SCE_CONF_COMMENT); } break; case SCE_CONF_EXTENSION: // if we find a non-alphanumeric char, // we simply go to default state // else we're still dealing with an extension... if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '$') || (ch == '/') || (ch == '.') || (ch == '*') ) { styler.ColourTo(i,SCE_CONF_EXTENSION); } else { state = SCE_CONF_DEFAULT; chNext = styler[i--]; } break; case SCE_CONF_STRING: // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) { state = SCE_CONF_DEFAULT; } styler.ColourTo(i,SCE_CONF_STRING); break; case SCE_CONF_IDENTIFIER: // stay in CONF_IDENTIFIER state until we find a non-alphanumeric if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) { buffer[bufferCount++] = static_cast<char>(tolower(ch)); } else { state = SCE_CONF_DEFAULT; buffer[bufferCount] = '\0'; // check if the buffer contains a keyword, and highlight it if it is a keyword... if(directives.InList(buffer)) { styler.ColourTo(i-1,SCE_CONF_DIRECTIVE ); } else if(params.InList(buffer)) { styler.ColourTo(i-1,SCE_CONF_PARAMETER ); } else if(strchr(buffer,'/') || strchr(buffer,'.')) { styler.ColourTo(i-1,SCE_CONF_EXTENSION); } else { styler.ColourTo(i-1,SCE_CONF_DEFAULT); } // push back the faulty character chNext = styler[i--]; } break; case SCE_CONF_NUMBER: // stay in CONF_NUMBER state until we find a non-numeric if( isdigit(ch) || ch == '.') { buffer[bufferCount++] = ch; } else { state = SCE_CONF_DEFAULT; buffer[bufferCount] = '\0'; // Colourize here... if( strchr(buffer,'.') ) { // it is an IP address... styler.ColourTo(i-1,SCE_CONF_IP); } else { // normal number styler.ColourTo(i-1,SCE_CONF_NUMBER); } // push back a character chNext = styler[i--]; } break; } } delete []buffer; } static const char * const confWordListDesc[] = { "Directives", "Parameters", 0 }; LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc); --- NEW FILE: LexLua.cxx --- // Scintilla source code edit control /** @file LexLua.cxx ** Lexer for Lua language. ** ** Written by Paul Winwood. ** Folder by Alexey Yutkin. ** Modified by Marcos E. Wurzius & Philippe Lhoste **/ #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdarg.h> #include <stdio.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(int ch) { return ch >= 0x80 || (isalpha(ch) || ch == '_'); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but p... [truncated message content] |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxscintilla/src/scintilla In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxscintilla/src/scintilla Added Files: License.txt README.txt Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: License.txt --- License for Scintilla and SciTE Copyright 1998-2003 by Neil Hodgson <ne...@sc...> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- NEW FILE: README.txt --- This directory contains copies of the scintilla/src and scintilla/include directories from the Scintilla source distribution. The current version of the Scintilla code is 1.62 |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxflatnotebook/src/wxflatnotebook In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxflatnotebook/src/wxflatnotebook Added Files: fnb_resources.cpp popup_dlg.cpp renderer.cpp wxFlatNotebook.cpp Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: fnb_resources.cpp --- #include <stdlib.h> /////////////////////////////////////////////////////////////////////////////// // // XPM Images required by this control // /////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Images used by the control //////////////////////////////////////////////////////////// /* XPM */ char *signpost_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 104 2", " c Black", "M c #3FB524", "3 c #4CBAFF", "{ c #004C00", "1 c #006BE9", "P c #007200", "! c #0065DD", "- c #003FE5", "Q c #0056BC", "* c #0062E4", "t c #0945A7", "7 c #2BBF1F", "W c #0050B8", ") c #D59700", "L c #0E8508", "A c #0047B0", "u c #3D93E5", "x c #0044AD", ": c #46C733", "( c #B18800", "X c #E3C247", "O. c #D69B00", "E c #0041B1", "` c #824400", "| c #C59200", ".. c #7B4000", "*. c #763C00", "G c #056ED4", "f c #088806", "[ c #005100", "p c #006DDF", "g c #007700", "U c #6D6A00", "< c #4A4357", "Z c #0038B7", "% c #E1B024", "K c #16A40B", " . c #986500", "h c #007100", "e c #002C9F", "J c #018101", "C c #4A3D58", "; c #009400", "v c #078BF0", "$. c #AC6F00", "F c #0055BC", "s c #36B01A", "D c #0052B8", ", c #138E00", "= c #0058D3", "5 c #47A9FF", "~ c #006500", "S c #004CB2", "n c #047F02", "T c #572E17", "m c #37BA1A", "X. c #D89D00", "} c #E49C00", "6 c #0084FF", "+ c #D3990C", "l c #0040A6", "a c #008200", "_ c #9C6700", "d c #86EA4D", "O c #DCC042", "# c #C7C334", "&. c #835000", "B c #007900", "k c #0037A9", "#. c #7B3F00", "y c #3879CB", "%. c #A26F00", "N c #007300", ". c #D0A000", "& c #626651", "j c #594855", "' c #0031B3", "q c #007000", "2 c #31AAFF", "Y c #A96700", "] c #0034C6", "R c #0028A7", "@. c #9B6800", "o c #EAD96A", "V c #006700", "4 c #4CACFB", "9 c #9EFF63", "^ c #006400", "o. c #7A4000", "b c #0080E5", "z c #0045AC", "> c #66DD42", "I c #005E00", "c c #125EBE", "H c #0080F5", "w c #584955", "8 c #8BF35A", "@ c #8E9300", "/ c #005800", "+. c #CA9700", "i c #0071DE", "0 c #2DA51D", "$ c #FFDE65", "r c #003098", /* pixels */ " ", " ", " . X o O + ", " @ # $ % & * = - ", " ; : > , < 1 2 3 4 5 6 ", " 7 8 9 0 q w e r t y u i p ", " a s d f g h j k l z x c v b ", " n m M N B V C Z A S D F G H ", " J K L P I U Y T R E W Q ! ", " h ~ ^ / ( ) _ ` ' ] ", " [ { } | ... ", " X.| .o. ", " O.+.@.#. ", " $.%.&.*. ", " ", " " }; unsigned char signpost_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 174, 240, 238, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 254, 255, 255, 253, 104, 48, 4, 0, 0, 0, 0, 0, 0, 0, 60, 221, 255, 255, 255, 254, 254, 254, 244, 193, 51, 0, 0, 0, 0, 126, 252, 255, 255, 255, 255, 255, 255, 254, 254, 254, 224, 20, 0, 0, 33, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 183, 0, 0, 137, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 128, 0, 0, 211, 254, 254, 255, 255, 255, 255, 246, 147, 216, 254, 225, 81, 0, 0, 0, 20, 162, 246, 234, 248, 255, 255, 238, 0, 0, 29, 11, 0, 0, 0, 0, 0, 0, 11, 20, 231, 255, 255, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 255, 255, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 255, 255, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 240, 236, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* XPM */ char *left_arrow_disabled_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````.```````", "```````..```````", "``````.`.```````", "`````.``.```````", "````.```.```````", "`````.``.```````", "``````.`.```````", "```````..```````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ char *x_button_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.############.`", "`.###aa####aa#.`", "`.####aa##aa##.`", "`.#####aaaa###.`", "`.######aa####.`", "`.#####aaaa###.`", "`.####aa##aa##.`", "`.###aa####aa#.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *left_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````.```````", "```````..```````", "``````...```````", "`````....```````", "````.....```````", "`````....```````", "``````...```````", "```````..```````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ char *x_button_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.##aa####aa##.`", "`.###aa##aa###.`", "`.####aaaa####.`", "`.#####aa#####.`", "`.####aaaa####.`", "`.###aa##aa###.`", "`.##aa####aa##.`", "`.############.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *x_button_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````````````", "````..````..````", "`````..``..`````", "``````....``````", "```````..```````", "``````....``````", "`````..``..`````", "````..````..````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ char *left_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.#######a####.`", "`.######aa####.`", "`.#####aaa####.`", "`.####aaaa####.`", "`.###aaaaa####.`", "`.####aaaa####.`", "`.#####aaa####.`", "`.######aa####.`", "`.#######a####.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *left_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.######a#####.`", "`.#####aa#####.`", "`.####aaa#####.`", "`.###aaaa#####.`", "`.##aaaaa#####.`", "`.###aaaa#####.`", "`.####aaa#####.`", "`.#####aa#####.`", "`.######a#####.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *right_arrow_disabled_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "```````.````````", "```````..```````", "```````.`.``````", "```````.``.`````", "```````.```.````", "```````.``.`````", "```````.`.``````", "```````..```````", "```````.````````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ char *right_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.####a#######.`", "`.####aa######.`", "`.####aaa#####.`", "`.####aaaa####.`", "`.####aaaaa###.`", "`.####aaaa####.`", "`.####aaa#####.`", "`.####aa######.`", "`.####a#######.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *right_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.#####a######.`", "`.#####aa#####.`", "`.#####aaa####.`", "`.#####aaaa###.`", "`.#####aaaaa##.`", "`.#####aaaa###.`", "`.#####aaa####.`", "`.#####aa#####.`", "`.#####a######.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ char *right_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "```````.````````", "```````..```````", "```````...``````", "```````....`````", "```````.....````", "```````....`````", "```````...``````", "```````..```````", "```````.````````", "````````````````", "````````````````", "````````````````", "````````````````" }; // Arrow down bitmaps /* XPM */ char *down_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "``.............`", "``.###########.`", "``.###########.`", "``.###########.`", "``.#aaaaaaaaa#.`", "``.##aaaaaaa##.`", "``.###aaaaa###.`", "``.####aaa####.`", "``.#####a#####.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.............`", "````````````````", "````````````````" }; /* XPM */ char *down_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "``.............`", "``.###########.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.#aaaaaaaaa#.`", "``.##aaaaaaa##.`", "``.###aaaaa###.`", "``.####aaa####.`", "``.#####a#####.`", "``.###########.`", "``.............`", "````````````````", "````````````````" }; /* XPM */ char *down_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #000000", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````", "````.........```", "`````.......````", "``````.....`````", "```````...``````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````" }; // Arrow down bitmaps const int tab_x_size = 9; // arrow_down_blue.xpm 16x16 unsigned char arrow_down_blue_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 250, 250, 248, 246, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 2, 11, 11, 0, 255, 255, 255, 255, 255, 255, 0, 11, 11, 2, 0, 0, 7, 190, 254, 254, 255, 255, 255, 255, 255, 255, 254, 254, 186, 5, 0, 0, 0, 15, 209, 255, 255, 255, 255, 255, 255, 255, 255, 206, 13, 0, 0, 0, 0, 0, 28, 226, 255, 255, 255, 255, 255, 255, 223, 25, 0, 0, 0, 0, 0, 0, 0, 43, 238, 255, 255, 255, 255, 236, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 247, 255, 255, 245, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 253, 252, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* XPM */ char *arrow_down_blue_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 99 2", "a c #3E8FDC", " c Black", "+. c #0068E2", "Y c #77B5F4", "# c #206BC4", " . c #0065E7", "I c #0F68CE", ", c #1C7AD3", ": c #217ED9", "` c #0F62C4", "o. c #377FCB", "U c #89C2FA", "N c #0050B8", "u c #84BBF1", "d c #004DB4", "( c #7DBAF7", "& c #338BE0", "c c #539DE8", "E c #62A9EE", "X. c #3A7DC4", "[ c #2E84DF", "! c #0053E1", "M c #0D56B4", "k c #1F6FCA", "@ c #003BA2", "D c #60A6EB", "o c #0345AC", "w c #1054AA", "A c #8DC4F8", "x c #8DC1F2", "e c #000087", ".. c #006AEC", "b c #4893DD", "g c #00008E", "V c #0067E5", "* c #177BD5", "O. c #0067EA", "] c #0064E8", "9 c #3C8EE0", "% c #4B9AE4", "' c #0061E1", "< c #074DA7", "~ c #0064EC", "s c #1155AA", "> c #217DD8", "G c #559FE9", "F c #5AA3EA", "3 c #3086DD", "X c #074AAF", "^ c #1C73D5", "W c #508CC5", "P c #005BE7", "| c #1C6DC6", "5 c #2982D6", "/ c #91C9FE", "l c #3077CB", "= c #034AA7", "Q c #065ABF", "Z c #8AC5FD", "+ c #0347AC", "- c #246CC4", "p c #4594E4", "J c #4084C2", "L c #0043D9", "K c #0454BA", "q c #3488D9", "@. c #0069E0", "} c #79A7D3", "H c #52A0EB", "j c #005AC2", "m c #115AB4", "y c #2F78CE", "f c #0057C0", "1 c #2A71C9", "2 c #70AFEC", "8 c #7AB7EF", "h c #005AD6", "C c #0D66CA", "6 c #0A50A9", "v c #4E9AE6", "_ c #6498C9", "r c #0054DD", "4 c #2E85DB", "{ c #9BD0FF", "O c #0546A9", "T c #6CAFF0", "R c #67ABF0", ". c #0042AA", ") c #76B7F7", "i c #4796E4", "; c #60A7E7", "B c #003FAF", "t c #0048D1", "n c #246BBA", "7 c #2E76CC", "$ c #7EBCF0", "z c #5696DD", "S c #79B5F0", "0 c #398EE0", /* pixels */ " ", " ", " . X o O + @ ", " # $ % & * = ", " - ; : > , < ", " 1 2 3 4 5 6 ", " 7 8 9 0 q w ", " e r t y u i p a s d f g ", " h j k l z x c v b n m M N B ", " V C Z A S D F G H J K L ", " P I U Y T R E W Q ! ", " ~ ^ / ( ) _ ` ' ", " ] [ { } | . ", " ..X.o.O. ", " +.@. ", " " }; // arrow_up_blue.xpm 16x16 unsigned char arrow_up_blue_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 250, 252, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 242, 255, 255, 247, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 232, 255, 255, 255, 255, 238, 44, 0, 0, 0, 0, 0, 0, 0, 21, 218, 255, 255, 255, 255, 255, 255, 226, 28, 0, 0, 0, 0, 0, 11, 200, 255, 255, 255, 255, 255, 255, 255, 255, 210, 16, 0, 0, 0, 4, 180, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 192, 7, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 244, 245, 243, 241, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* XPM */ char *arrow_up_blue_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 93 2", " c Black", "n c #2262AB", "@ c #006BED", "! c #237ED9", "# c #006BF2", "G c #81BAF0", "( c #4B9EE8", "/ c #1B67C2", ": c #BFE1FF", "{ c #0444A8", "B c #005CD7", "2 c #005CDF", "N c #0050B8", ") c #1F81DC", "D c #145AAC", "I c #73B2EC", "T c #2983D9", "> c #7DBAF5", "O c #4998EA", "z c #3F8ADB", "9 c #62A9EC", "5 c #B6DAFD", "h c #004DD2", "s c #519DE5", "t c #B4DAFE", "L c #1057AD", "C c #8FC1F3", "4 c #0768CF", "< c #79B7F5", "a c #549EE7", "* c #257DDA", "J c #398DDF", "R c #0E54A9", ", c #72B3F4", "% c #C6E4FF", "; c #1471D3", "$ c #2881DE", "i c #61A7EB", "m c #115BB5", "u c #66ABEF", "Q c #2681D9", "c c #559FE8", "3 c #0061EC", "- c #0061ED", "K c #358ADC", "k c #1C70CD", "r c #0666CD", "` c #1378D5", "Y c #2E86DD", "[ c #054AAF", "W c #67A9E8", "^ c #084EA6", "q c #0B61C7", "f c #065AC3", " . c #003AA0", "H c #3B8FE1", "8 c #65A9ED", "y c #94C7F8", "v c #4F9CE6", "6 c #7EBAF5", ". c #006FE6", "_ c #197DDB", "F c #2773CB", "} c #0141A0", "E c #1D68C5", "o c #006FF1", "& c #9CCFFF", "j c #0060C2", "| c #013EA0", "0 c #61A9EF", "= c #0066E9", "7 c #6BAEEF", "S c #4191E0", "w c #0060DD", "l c #2373CE", "+ c #509DEC", "U c #3088DD", "M c #0F5DBC", "p c #5AA2E9", "A c #4495E4", "' c #054CA7", "~ c #1F7CD5", "b c #4996E0", "1 c #156ED0", "d c #51A1EC", "Z c #4796E4", "e c #004EE0", "V c #2975CC", "g c #0048D5", "P c #226EC8", "x c #6DB0EE", "X c #006BE1", "] c #0143A8", /* pixels */ " ", " . X ", " o O + @ ", " # $ % & * = ", " - ; : > , < 1 2 ", " 3 4 5 6 7 8 9 0 q w ", " e r t y u i p a s d f g ", " h j k l z x c v b n m M N B ", " V C Z A S D ", " F G H J K L ", " P I U Y T R ", " E W Q ! ~ ^ ", " / ( ) _ ` ' ", " ] [ { } | . ", " ", " " }; ////////////////////////////////////////////////////////////////////////////////////////////////// // // End of XPM Images // ////////////////////////////////////////////////////////////////////////////////////////////////// --- NEW FILE: renderer.cpp --- #include <wx/wxFlatNotebook/renderer.h> #include <wx/wxFlatNotebook/wxFlatNotebook.h> // for the styles #include <wx/wxFlatNotebook/fnb_resources.h> #include <wx/image.h> wxFNBRenderer::wxFNBRenderer() : m_tabXBgBmp(16, 16) , m_xBgBmp(16, 14) , m_leftBgBmp(16, 14) , m_rightBgBmp(16, 14) { } wxFNBRenderer::~wxFNBRenderer() { } int wxFNBRenderer::GetLeftButtonPos(wxWindow* pageContainer) { [...1618 lines suppressed...] int posx = ((wxFlatNotebook *)pc->m_pParent)->GetPadding(); if( from < 0 ) from = pc->m_nFrom; for(int i = from; i<(int)pc->GetPageInfoVector().GetCount(); i++) { int vc8glitch = tabHeight + wxFNB_HEIGHT_SPACER; int tabWidth = CalcTabWidth( pageContainer, i, tabHeight ); if(posx + tabWidth + vc8glitch + GetButtonsAreaLength( pc ) >= clientWidth) break; /// Add a result to the returned vector wxRect tabRect(posx, VERTICAL_BORDER_PADDING, tabWidth , tabHeight); vTabInfo.push_back(tabRect); /// Advance posx posx += tabWidth + wxFNB_HEIGHT_SPACER; } } --- NEW FILE: popup_dlg.cpp --- #include <wx/wxFlatNotebook/popup_dlg.h> #include <wx/listctrl.h> #include <wx/wxFlatNotebook/wxFlatNotebook.h> #include <wx/wxFlatNotebook/renderer.h> #include <wx/listbox.h> #include <wx/image.h> //#include <wx/mstream.h> #include <wx/wxFlatNotebook/fnb_resources.h> wxBitmap wxTabNavigatorWindow::m_bmp; wxTabNavigatorWindow::wxTabNavigatorWindow(wxWindow* parent) : m_listBox(NULL) , m_selectedItem(-1) , m_panel(NULL) { Create(parent); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); GetSizer()->Layout(); Centre(); } wxTabNavigatorWindow::wxTabNavigatorWindow() : wxDialog() , m_listBox(NULL) , m_selectedItem(-1) , m_panel(NULL) { } wxTabNavigatorWindow::~wxTabNavigatorWindow() { } void wxTabNavigatorWindow::Create(wxWindow* parent) { long style = 0; if( !wxDialog::Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, style) ) return; wxBoxSizer *sz = new wxBoxSizer( wxVERTICAL ); SetSizer( sz ); long flags = wxLB_SINGLE | wxNO_BORDER ; m_listBox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(200, 150), 0, NULL, flags); static int panelHeight = 0; if( panelHeight == 0 ) { wxMemoryDC mem_dc; // bitmap must be set before it can be used for anything wxBitmap bmp(10, 10); mem_dc.SelectObject(bmp); wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); font.SetWeight( wxBOLD ); mem_dc.SetFont(font); int w; mem_dc.GetTextExtent(wxT("Tp"), &w, &panelHeight); panelHeight += 4; // Place a spacer of 2 pixels // Out signpost bitmap is 24 pixels if( panelHeight < 24 ) panelHeight = 24; } m_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize(200, panelHeight)); sz->Add( m_panel ); sz->Add( m_listBox, 1, wxEXPAND ); SetSizer( sz ); // Connect events to the list box m_listBox->Connect(wxID_ANY, wxEVT_KEY_UP, wxKeyEventHandler(wxTabNavigatorWindow::OnKeyUp), NULL, this); m_listBox->Connect(wxID_ANY, wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(wxTabNavigatorWindow::OnNavigationKey), NULL, this); m_listBox->Connect(wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(wxTabNavigatorWindow::OnItemSelected), NULL, this); // Connect paint event to the panel m_panel->Connect(wxID_ANY, wxEVT_PAINT, wxPaintEventHandler(wxTabNavigatorWindow::OnPanelPaint), NULL, this); m_panel->Connect(wxID_ANY, wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxTabNavigatorWindow::OnPanelEraseBg), NULL, this); SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) ); m_listBox->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); PopulateListControl( static_cast<wxFlatNotebook*>( parent ) ); // Create the bitmap, only once if( !m_bmp.Ok() ) { wxImage img(signpost_xpm); img.SetAlpha(signpost_alpha, true); m_bmp = wxBitmap(img); } } void wxTabNavigatorWindow::OnKeyUp(wxKeyEvent &event) { if( event.GetKeyCode() == WXK_CONTROL ) { CloseDialog(); } } void wxTabNavigatorWindow::OnNavigationKey(wxNavigationKeyEvent &event) { long selected = m_listBox->GetSelection(); wxFlatNotebook* bk = static_cast<wxFlatNotebook*>(GetParent()); long maxItems = bk->GetPageCount(); long itemToSelect; if( event.GetDirection() ) { // Select next page if (selected == maxItems - 1) itemToSelect = 0; else itemToSelect = selected + 1; } else { // Previous page if( selected == 0 ) itemToSelect = maxItems - 1; else itemToSelect = selected - 1; } m_listBox->SetSelection( itemToSelect ); } void wxTabNavigatorWindow::PopulateListControl(wxFlatNotebook *book) { int selection = book->GetSelection(); int count = book->GetPageCount(); m_listBox->Append( book->GetPageText(static_cast<int>(selection)) ); m_indexMap[0] = selection; int itemIdx(1); int prevSel = book->GetPreviousSelection(); if( prevSel != wxNOT_FOUND ) { // Insert the previous selection as second entry m_listBox->Append( book->GetPageText(static_cast<int>(prevSel)) ); m_indexMap[1] = prevSel; itemIdx++; } for(int c=0; c<count; c++) { // Skip selected page if( c == selection ) continue; // Skip previous selected page as well if( c == prevSel ) continue; m_listBox->Append( book->GetPageText(static_cast<int>(c)) ); m_indexMap[itemIdx] = c; itemIdx++; } // Select the next entry after the current selection m_listBox->SetSelection( 0 ); wxNavigationKeyEvent dummy; dummy.SetDirection(true); OnNavigationKey(dummy); } void wxTabNavigatorWindow::OnItemSelected(wxCommandEvent & event ) { wxUnusedVar( event ); CloseDialog(); } void wxTabNavigatorWindow::CloseDialog() { wxFlatNotebook* bk = static_cast<wxFlatNotebook*>(GetParent()); m_selectedItem = m_listBox->GetSelection(); std::map<int, int>::iterator iter = m_indexMap.find(m_selectedItem); bk->SetSelection( iter->second ); EndModal( wxID_OK ); } void wxTabNavigatorWindow::OnPanelPaint(wxPaintEvent &event) { wxUnusedVar(event); wxPaintDC dc(m_panel); wxRect rect = m_panel->GetClientRect(); static bool first = true; static wxBitmap bmp( rect.width, rect.height ); if( first ) { first = false; wxMemoryDC mem_dc; mem_dc.SelectObject( bmp ); wxColour endColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW) ); wxColour startColour( wxFNBRenderer::LightColour(endColour, 50) ); wxFNBRenderer::PaintStraightGradientBox(mem_dc, rect, startColour, endColour); // Draw the caption title and place the bitmap wxPoint bmpPt; wxPoint txtPt; // get the bitmap optimal position, and draw it bmpPt.y = (rect.height - m_bmp.GetHeight()) / 2; bmpPt.x = 3; mem_dc.DrawBitmap( m_bmp, bmpPt, true ); // get the text position, and draw it int fontHeight(0), w(0); wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); font.SetWeight( wxBOLD ); mem_dc.SetFont( font ); mem_dc.GetTextExtent( wxT("Tp"), &w, &fontHeight ); txtPt.x = bmpPt.x + m_bmp.GetWidth() + 4; txtPt.y = (rect.height - fontHeight)/2; mem_dc.SetTextForeground( *wxWHITE ); mem_dc.DrawText( wxT("Opened tabs:"), txtPt ); mem_dc.SelectObject( wxNullBitmap ); } dc.DrawBitmap( bmp, 0, 0 ); } void wxTabNavigatorWindow::OnPanelEraseBg(wxEraseEvent &event) { wxUnusedVar(event); } --- NEW FILE: wxFlatNotebook.cpp --- /////////////////////////////////////////////////////////////////////////////// // Name: wxFlatNotebook.cpp // Purpose: generic implementation of flat style notebook class. // Author: Eran Ifrah <er...@be...> // Modified by: Priyank Bolia <so...@pr...> // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license <http://www.wxwidgets.org/licence3.txt> /////////////////////////////////////////////////////////////////////////////// #include <wx/wxflatnotebook/wxflatnotebook.h> #include <wx/wxflatnotebook/renderer.h> #include <wx/wxflatnotebook/popup_dlg.h> #include <algorithm> #include <wx/tooltip.h> #include <wx/tipwin.h> #include <wx/arrimpl.cpp> [...1697 lines suppressed...] PopupMenu( &popupMenu ); } void wxPageContainer::OnTabMenuSelection(wxCommandEvent &event) { int selection = event.GetId(); static_cast<wxFlatNotebook*>(m_pParent)->SetSelection( (size_t)selection ); } // Draw small arrow at the place that the tab will be placed void wxPageContainer::DrawDragHint() { // get the index of tab that will be replaced with the dragged tab wxPageInfo info; int tabIdx; wxPoint pt = ::wxGetMousePosition(); wxPoint client_pt = ScreenToClient(pt); HitTest(client_pt, info, tabIdx); wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() )->DrawDragHint(this, tabIdx); } |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxflatnotebook/include/wx/wxflatnotebook In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxflatnotebook/include/wx/wxflatnotebook Added Files: fnb_resources.h popup_dlg.h renderer.h singleton.h smart_ptr.h wxflatnotebook.h wxfnbdroptarget.h Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: popup_dlg.h --- #ifndef FNB_POPUPDLG_H #define FNB_POPUPDLG_H #include <wx/dialog.h> #include <map> #include <wx/bitmap.h> class wxListBox; class wxFlatNotebook; class wxPanel; class wxTabNavigatorWindow : public wxDialog { protected: wxListBox *m_listBox; long m_selectedItem; std::map<int, int> m_indexMap; wxPanel *m_panel; static wxBitmap m_bmp; protected: void CloseDialog(); public: /** * Parameterized constructor * \param parent dialog parent window */ wxTabNavigatorWindow(wxWindow* parent); /** * Default constructor */ wxTabNavigatorWindow(); /** * Destructor */ virtual ~wxTabNavigatorWindow(); /** * Create the dialog, usually part of the two steps construction of a * dialog * \param parent dialog parent window */ void Create(wxWindow* parent); /// Event handling void OnKeyUp(wxKeyEvent &event); void OnNavigationKey(wxNavigationKeyEvent &event); void OnItemSelected(wxCommandEvent &event); void OnPanelPaint(wxPaintEvent &event); void OnPanelEraseBg(wxEraseEvent &event); void PopulateListControl(wxFlatNotebook *book); }; #endif // FNB_POPUPDLG_H --- NEW FILE: wxflatnotebook.h --- /////////////////////////////////////////////////////////////////////////////// // Name: wxFlatNotebook.cpp // Purpose: generic implementation of flat style notebook class. // Author: Eran Ifrah <er...@be...> // Modified by: Priyank Bolia <so...@pr...> // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license <http://www.wxwidgets.org/licence3.txt> /////////////////////////////////////////////////////////////////////////////// #ifndef WXFLATNOTEBOOK_H #define WXFLATNOTEBOOK_H #include <wx/wx.h> #include <wx/frame.h> #include <wx/dynarray.h> #ifdef __WXMSW__ #ifdef _DEBUG //#include <crtdbg.h> #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__) #else #define DEBUG_NEW new #endif #endif // __WXMSW__ #ifdef WXMAKINGDLL_FNB # define WXDLLIMPEXP_FNB WXEXPORT #elif defined(WXUSINGDLL_FNB) # define WXDLLIMPEXP_FNB WXIMPORT #else /* not making nor using FNB as DLL */ # define WXDLLIMPEXP_FNB #endif // WXMAKINGDLL_FNB #include <wx/dcbuffer.h> #include <wx/dataobj.h> #include <wx/dnd.h> #include <wx/wxflatnotebook/wxfnbdroptarget.h> class wxPageContainer; #ifndef M_PI #define M_PI 3.14159265358979 #endif #ifndef wxFNB_HEIGHT_SPACER #define wxFNB_HEIGHT_SPACER 10 #endif // forward declerations class wxFNBRenderer; class wxFNBRendererDefault; class wxFNBRendererVC71; class wxFNBRendererVC8; class wxTabNavigatorWindow; class wxMenu; // Since some compiler complains about std::min, we define our own macro #define FNB_MIN(a, b) ((a > b) ? b : a) WX_DECLARE_USER_EXPORTED_OBJARRAY(wxBitmap, wxFlatNotebookImageList, WXDLLIMPEXP_FNB); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxWindow*, wxWindowPtrArray, WXDLLIMPEXP_FNB); /// wxFlatNotebook styles #define wxFNB_DEFAULT_STYLE wxFNB_MOUSE_MIDDLE_CLOSES_TABS #define wxFNB_VC71 0x00000001 #define wxFNB_FANCY_TABS 0x00000002 #define wxFNB_TABS_BORDER_SIMPLE 0x00000004 #define wxFNB_NO_X_BUTTON 0x00000008 #define wxFNB_NO_NAV_BUTTONS 0x00000010 #define wxFNB_MOUSE_MIDDLE_CLOSES_TABS 0x00000020 #define wxFNB_BOTTOM 0x00000040 #define wxFNB_NODRAG 0x00000080 #define wxFNB_VC8 0x00000100 #define wxFNB_X_ON_TAB 0x00000200 #define wxFNB_BACKGROUND_GRADIENT 0x00000400 #define wxFNB_COLORFUL_TABS 0x00000800 #define wxFNB_DCLICK_CLOSES_TABS 0x00001000 #define wxFNB_SMART_TABS 0x00002000 #define wxFNB_DROPDOWN_TABS_LIST 0x00004000 #define wxFNB_ALLOW_FOREIGN_DND 0x00008000 /// General macros #define VERTICAL_BORDER_PADDING 4 #define BUTTON_SPACE 16 #define VC8_SHAPE_LEN 16 #define MASK_COLOR wxColor(0, 128, 128) /** * \brief Nice cross-platform flat notebook with X-button, navigation arrows and much more */ class WXDLLIMPEXP_FNB wxFlatNotebook : public wxPanel { private: friend class wxPageContainer; public: ///Default constructor wxFlatNotebook() : m_popupWin(NULL) {} /// Parametrized constructor /** \param parent - parent window \param id - window ID \param pos - window position \param size - window size \param style - window style \param name - window class name */ wxFlatNotebook(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("Flat Notebook")); /// Destructor virtual ~wxFlatNotebook(void); /// Advances the selection /** \param bForward - if set to true then selection should be advanced forward otherwise - backward */ void AdvanceSelection(bool bForward); /// Apends new notebook page /** \param windows - window to be appended \param caption - tab caption \param selected - determines if new page should be selected automatically \param imgindex - page image index */ bool AddPage(wxWindow* windows, const wxString& caption, const bool selected = false, const int imgindex = -1); /// Inserts new notebook page /** \param index - page index \param page - window to be appended \param text - tab caption \param select - determines if new page should be selected automatically \param imgindex - page image index */ bool InsertPage(size_t index, wxWindow* page, const wxString& text, bool select = false, const int imgindex = -1); /// Changes the selection from currently visible/selected page to the page given by index. /** \param page - index of page to be selected */ void SetSelection(size_t page); /// Removes the window from the notebook, and destroys the window associated with that notebook page. /** * \param page - index of page to be deleted * \param notify - by default wxFlatNotebook fires two events: * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING * to disable this functionality set notify to false */ void DeletePage(size_t page, bool notify = true); /// Deletes all notebook pages and destroys all windows associated with pages bool DeleteAllPages(); /// Returns the total number of pages in the notebook. int GetPageCount() const; /// Returns the window object associated with selected notebook page. wxWindow * GetCurrentPage() const; /// Returns the window object associated with a notebook page. /** \param page - page index */ wxWindow * GetPage(size_t page) const; /// Returns the page index of the window object. /** \param win - window object */ int GetPageIndex(wxWindow* win) const; /// Returns the currently visible/selected notebook page 0 based index. int GetSelection() const; /** * Return the previous selection, useful when implementing smart tabulation * \return previous selection, or wxNOT_FOUND */ int GetPreviousSelection() const; /// Returns tab header inclination angle of specified page /** \param page_index - page index \param result - pointer to the variable that receives the result */ bool GetPageShapeAngle(int page_index, unsigned int * result); /// Sets tab header inclination angle of specified page /** \param page_index - page index \param angle - new value of tab header inclination angle */ void SetPageShapeAngle(int page_index, unsigned int angle); /// Sets tab header inclination angle for all pages /** \param angle - new value of tab header inclination angle */ void SetAllPagesShapeAngle(unsigned int angle); /// Returns the best size for a page wxSize GetPageBestSize(); /// Sets the caption/text of the notebook page /** \param page - page index \param text - new value of tab caption */ bool SetPageText(size_t page, const wxString& text); /** * Removes the window from the notebook, and destroys the window associated with that notebook page. * \param page - index of page to be deleted * \param notify - by default wxFlatNotebook fires two events: * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING * to disable this functionality set notify to false */ bool RemovePage(size_t page, bool notify = true); /// Sets the amount of space around each page's icon and label, in pixels. /** NB: The vertical padding cannot be changed in for wxFlatNotebook. \param padding - new amount of space around each page's icon and label */ void SetPadding(const wxSize& padding); /// Alters the notebook style /** \param style - new value of notebook style */ virtual void SetWindowStyleFlag(long style); /// Sets a right click menu to the notebook /** \param menu - right click menu object */ void SetRightClickMenu(wxMenu* menu); /// Returns the page text /** \param page - page index */ wxString GetPageText(size_t page); /// Sets an image index of specified page /** \param page - page index \param imgindex - new image index */ void SetPageImageIndex(size_t page, int imgindex); /// Returns an image index of specified page /** \param page - page index */ int GetPageImageIndex(size_t page); /// Sets gradient colors (only applicable when using the wxFNB_FANCY_TABS) /** \param from - first gradient colour \param to - second gradient colour \param border - page border colour */ void SetGradientColors(const wxColour& from, const wxColour& to, const wxColour& border); /// Sets first gradient colour /** \param from - new value of first gradient colour */ void SetGradientColorFrom(const wxColour& from); /// Sets second gradient colour /** \param to - new value of second gradient colour */ void SetGradientColorTo(const wxColour& to); /// Sets the colour of page border /** \param border - new value of the colour of page border */ void SetGradientColorBorder(const wxColour& border); /// Sets an image list associated with notebook pages /** \param imglist - image list object. Image list assigned with this method will not be deleted by wxFlatNotebook's destructor, you must delete it yourself. */ void SetImageList(wxFlatNotebookImageList * imglist); /// Returns an image list object associated with wxFlatNotebook wxFlatNotebookImageList * GetImageList(); /** * \brief Drop event handler, to be passed as function pointer to CTextDropTarget class. * \param x X coordinate where the drop take place * \param y Y coordinate where the drop take place * \param nTabPage page index * \param wnd_oldContainer pointer to wxPageContainer object that contained dragged page * \return Drag operation identifier */ wxDragResult OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer); /// Enable / Disable page /** \param page - page to enable/diable \param enabled - set to true to enable the tab, false otherwise */ void Enable(size_t page, bool enabled); /// Return Returns true if if the page is enabled /** \param page - page index */ bool GetEnabled(size_t page); /// Set the active tab text /** \param textColour - the active tab text colour */ void SetActiveTabTextColour(const wxColour& textColour); /// Gets first gradient colour const wxColour& GetGradientColorFrom(); /// Gets second gradient colour const wxColour& GetGradientColorTo(); /// Gets the tab border colour const wxColour& SetGradientColorBorder(); /// Get the active tab text const wxColour& GetActiveTabTextColour(); /// Get the non-active tab text color const wxColour& GetNonActiveTabTextColour(); /// Set the non-active tab text color void SetNonActiveTabTextColour(const wxColour& color); /// Return the tab area panel wxPanel* GetTabArea() { return (wxPanel*)m_pages; } /// Get the tab area background colour const wxColour& GetTabAreaColour(); /// Set the tab area background colour void SetTabAreaColour(const wxColour& color); /// Get the active tab color const wxColour& GetActiveTabColour(); /// Set the active tab color void SetActiveTabColour(const wxColour& color); /** * Return the padding used between the text and icons, text and borders, etc. * \return padding in pixels */ int GetPadding() { return m_nPadding; } protected: /// Initialization function, called internally virtual void Init(); wxPageContainer *m_pages; private: /// Internal flag to force selection of page, /// even if this page is disabled. /// used incase such that the book itself need to update its selection. /// e.g. after DeletePage() bool m_bForceSelection; wxBoxSizer* m_mainSizer; /// vector of all the windows associated with the notebook pages. wxWindowPtrArray m_windows; wxFNBDropTarget<wxFlatNotebook> *m_pDropTarget; int m_nFrom; int m_nPadding; wxTabNavigatorWindow *m_popupWin; bool m_sendPageChangeEvent; ///< Ugly but needed to allow SetSelection to send / dont send event DECLARE_DYNAMIC_CLASS(wxFlatNotebook) DECLARE_EVENT_TABLE() void OnNavigationKey(wxNavigationKeyEvent& event); }; /** * \brief Contains parameters of notebook page */ class WXDLLIMPEXP_FNB wxPageInfo { private: // Members /// Page caption wxString m_strCaption; /// Page position wxPoint m_pos; /// Page size wxSize m_size; /// Page region wxRegion m_region; /// Angle for painting tab unsigned int m_TabAngle; /// Page image index int m_ImageIndex; /// Page enable/disabled flag bool m_bEnabled; /// Tab 'x' button rectangle wxRect m_xRect; /// Tab color wxColor m_color; public: /// Default constructor wxPageInfo(): m_strCaption(wxEmptyString), m_TabAngle(0), m_ImageIndex(-1), m_bEnabled(true){}; /// Parametrized constructor /** \param caption - page caption \param imgindex - image index */ wxPageInfo(const wxString& caption, int imgindex) : m_strCaption(caption), m_pos(-1, -1), m_size(-1, -1), m_TabAngle(0), m_ImageIndex(imgindex), m_bEnabled(true){} /// Destructor ~wxPageInfo(){}; /// Sets page caption /** \param value - new page caption */ void SetCaption(wxString value) {m_strCaption = value;} ///Returns page caption wxString GetCaption() {return m_strCaption;} /// Sets page position /** \param value - new page position */ void SetPosition(wxPoint value) {m_pos = value;} ///Returns page position const wxPoint & GetPosition() {return m_pos;} /// Sets page size /** \param value - new page size */ void SetSize(wxSize value) {m_size = value;} ///Returns page size const wxSize & GetSize() {return m_size;} /// Sets the tab header inclination angle /** \param value - new tab header inclination angle */ void SetTabAngle(unsigned int value) {m_TabAngle = FNB_MIN((unsigned int)(45), (unsigned int)(value));} /// Returns an inclination of tab header borders unsigned int GetTabAngle() {return m_TabAngle;} /// Sets page image index /** \param value - new image index */ void SetImageIndex(int value) {m_ImageIndex = value;} /// Returns an image index int GetImageIndex() {return m_ImageIndex;} /// Return true if the page is enabled bool GetEnabled() { return m_bEnabled; } /// Set the page enable/disable flag /** \param enabled - new page enable status */ void Enable(bool enabled) { m_bEnabled = enabled; } /// Set the page region /** \param n - number of points \param points - array of points that construct the region */ void SetRegion(const size_t n, const wxPoint points[]) { m_region = wxRegion(n, points); } /// Get the page region wxRegion& GetRegion() { return m_region ; } /// Set the 'x' button rectangle area /** \param xrect - the 'x' button rectangle */ void SetXRect(const wxRect& xrect) { m_xRect = xrect; } /// Get the 'x' button rectangle wxRect& GetXRect() { return m_xRect; } /** * * \return The tab color */ wxColor GetColor() { return m_color; } /** * * \param color Tab face color */ void SetColor(wxColor& color) { m_color = color; } }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPageInfo, wxPageInfoArray, WXDLLIMPEXP_FNB); /// Button status enum { wxFNB_BTN_PRESSED, wxFNB_BTN_HOVER, wxFNB_BTN_NONE }; /// Hit Test results enum { wxFNB_TAB, ///< On a tab wxFNB_X, ///< On the X button wxFNB_TAB_X, ///< On the 'X' button (tab's X button) wxFNB_LEFT_ARROW, ///< On the rotate left arrow button wxFNB_RIGHT_ARROW, ///< On the rotate right arrow button wxFNB_DROP_DOWN_ARROW, ///< On the drop down arrow button wxFNB_NOWHERE ///< Anywhere else }; /** * \brief Notebook page */ class WXDLLIMPEXP_FNB wxPageContainer : public wxPanel { protected: friend class wxFlatNotebook; friend class wxFNBRenderer; friend class wxFNBRendererDefault; friend class wxFNBRendererVC71; friend class wxFNBRendererVC8; wxFlatNotebookImageList * m_ImageList; public: /// Parametrized constructor /** \param parent - parent window \param id - window ID \param pos - window position \param size - window size \param style - window style */ wxPageContainer(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Destructor virtual ~wxPageContainer(void); /// Sets an image list associated with notebook pages /** \param imglist - image list object. Image list assigned with this method will not be deleted by wxFlatNotebook's destructor, you must delete it yourself. */ virtual void SetImageList(wxFlatNotebookImageList * imglist) {m_ImageList = imglist;} /// Returns an image list object associated with wxFlatNotebook virtual wxFlatNotebookImageList * GetImageList() {return m_ImageList;} /// Apends new notebook page /** \param caption - tab caption \param selected - determines if new page should be selected automatically \param imgindex - page image index */ virtual bool AddPage(const wxString& caption, const bool selected = false, const int imgindex = -1); /// Inserts new notebook page /** \param index - page index \param page - window to be appended \param text - tab caption \param select - determines if new page should be selected automatically \param imgindex - page image index */ virtual bool InsertPage(size_t index, wxWindow* page, const wxString& text, bool select = false, const int imgindex = -1); /// Changes the selection from currently visible/selected page to the page given by index. /** \param page - index of page to be selected */ virtual void SetSelection(size_t page); /// Returns the current selection page index virtual int GetSelection() { return m_iActivePage; } /// Advances the selection /** \param bForward - if set to true then selection should be advanced forward otherwise - backward */ virtual void AdvanceSelection(bool bForward); /// Return the number of pages virtual size_t GetPageCount() { return m_pagesInfoVec.size(); } /// Returns the page caption /** \param page - page index */ virtual wxString GetPageText(size_t page) { return m_pagesInfoVec[page].GetCaption(); } /// Set the caption of the page /** \param page - page index \param text - new page caption */ virtual bool SetPageText(size_t page, const wxString& text) { m_pagesInfoVec[page].SetCaption(text); return true; } /// Sets an image index of specified page /** \param page - page index \param imgindex - new image index */ virtual void SetPageImageIndex(size_t page, int imgindex); /// Returns an image index of specified page /** \param page - page index */ virtual int GetPageImageIndex(size_t page); /// Enable / Disable page /** \param page - page to enable/diable \param enabled - set to true to enable the tab, false otherwise */ virtual void Enable(size_t page, bool enabled); /// Return Returns true if if the page is enabled /** \param page - page index */ virtual bool GetEnabled(size_t page); /// Style helper methods bool HasFlag(int flag); /** * Return a vector containing the tabs informations (used by the redereres) * \return tabs info vector */ wxPageInfoArray& GetPageInfoVector() { return m_pagesInfoVec; } /** * Return the first graident colour ("from") * \return gradient colour 1 */ const wxColour& GetGradientColourFrom() const { return m_colorFrom; } /** * Return the second graident colour ("to") * \return gradient colour 2 */ const wxColour& GetGradientColourTo() const { return m_colorTo; } /** * Return tab's border colour * \return border colour */ const wxColour& GetBorderColour() const { return m_colorBorder; } /** * Return non active tab's text colour * \return non active tab's text colour */ const wxColour& GetNonoActiveTextColor() const { return m_nonActiveTextColor; } /** * Return the active tab colour * \return tab colour */ const wxColour& GetActiveTabColour() const { return m_activeTabColor; } /** * Get the previous selected tab, wxNOT_FOUND if none * \return index of previous selected tab */ int GetPreviousSelection() const { return m_iPreviousActivePage; } /** * Draw a tab preview */ void DrawDragHint(); DECLARE_EVENT_TABLE() // Event handlers virtual void OnPaint(wxPaintEvent& event); virtual void OnSize(wxSizeEvent& WXUNUSED(event)); virtual void OnMouseMove(wxMouseEvent& event); virtual void OnLeftDown(wxMouseEvent& event); virtual void OnLeftUp(wxMouseEvent& event); virtual void OnRightDown(wxMouseEvent& event); virtual void OnMiddleDown(wxMouseEvent& event); virtual void OnEraseBackground(wxEraseEvent& WXUNUSED(event)) { } virtual void OnMouseLeave(wxMouseEvent& event); virtual void OnMouseEnterWindow(wxMouseEvent& event); virtual void OnLeftDClick(wxMouseEvent &event); virtual void OnTabMenuSelection(wxCommandEvent &event); protected: /** * Popup a menu that contains all the tabs to be selected by user */ void PopupTabsMenu(); void ClearFlag(int flag); /// return true if tabIdx has image bool TabHasImage(int tabIdx); /// Check whether the style is set to default virtual bool IsDefaultTabs(); /// Return the color of the single line border virtual wxColor GetSingleLineBorderColor(); /// Return true if page is visible virtual bool IsTabVisible(size_t page); /// Return if pt is anywhere on a tab, button or anywhere else virtual int HitTest(const wxPoint& pt, wxPageInfo& pageInfo, int &tabIdx); /// Display tool tip when mouse is hovering a tab virtual void ShowTabTooltip(int tabIdx); /// A wrapper from calling the DoDeletePage() virtual void DeletePage(size_t page); /// Remove all pages from the container (it also deletes them) virtual void DeleteAllPages(); /// Perform the actual deletion of a tab from the container /// The window is also deleted using this function virtual void DoDeletePage(size_t page); /// Preform the actual page selection virtual void DoSetSelection(size_t page); /// Return the index of the last visible index virtual int GetLastVisibleTab(); /// Return the number of tabs that can be scrolled left /// starting from the first visible tab (i.e. m_nFrom) virtual int GetNumTabsCanScrollLeft(); /// Return the number of visible tabs virtual int GetNumOfVisibleTabs(); /** * \brief Drop event handler, to be passed as function pointer to CTextDropTarget class. * \param x X coordinate where the drop take place * \param y Y coordinate where the drop take place * \param nTabPage page index * \param wnd_oldContainer pointer to wxPageContainer object that contained dragged page * \return Drag operation identifier */ virtual wxDragResult OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer); /** * \brief Moves the tab page from one location to another * \param nMove The index of the tab page to be moved. * \param nMoveTo The index for the tab page, where it has to be moved */ virtual void MoveTabPage(int nMove, int nMoveTo); /// Check whether page can fit to the current /// screen or a scrolling is required /** \param page - page index */ virtual bool CanFitToScreen(size_t page); protected: wxPageInfoArray m_pagesInfoVec; int m_iActivePage; int m_nFrom; /// Drop target for enabling drag'n'drop of tabs wxFNBDropTarget<wxPageContainer> *m_pDropTarget; /// Pointer to the parent window wxWindow *m_pParent; /// The right click menu wxMenu* m_pRightClickMenu; /// Gradient colors wxColour m_colorFrom, m_colorTo, m_colorBorder, m_activeTextColor, m_nonActiveTextColor, m_tabAreaColor, m_activeTabColor; /// X,>,< buttons status, can be one of /// - Pressed /// - Hover /// - None int m_nXButtonStatus, m_nLeftButtonStatus, m_nRightButtonStatus, m_nTabXButtonStatus; /// holds the button id in case a left click is done on one of them int m_nLeftClickZone; int m_iPreviousActivePage; int m_nArrowDownButtonStatus; }; /** * \brief Holds information about events associated with wxFlatNotebook objects */ class WXDLLIMPEXP_FNB wxFlatNotebookEvent : public wxNotifyEvent { DECLARE_DYNAMIC_CLASS(wxFlatNotebookEvent) size_t sel, oldsel; public: /// Constructor /** \param commandType - event type \param winid - window ID \param nSel - current selection \param nOldSel - old selection */ wxFlatNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, int nSel = -1, int nOldSel = -1) : wxNotifyEvent(commandType, winid), sel(nSel), oldsel(nOldSel) {} /// Sets the value of current selection /** \param s - index of currently selected page */ void SetSelection(int s) { sel = s; } /// Sets the value of previous selection /** \param s - index of previously selected page */ void SetOldSelection(int s) { oldsel = s; } /// Returns the index of currently selected page int GetSelection() { return (int)sel; } /// Returns the index of previously selected page int GetOldSelection() { return (int)oldsel; } }; BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, 50000) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, 50001) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, 50002) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, 50003) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, 50004) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxFlatNotebookEventFunction)(wxFlatNotebookEvent&); #define wxFlatNotebookEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFlatNotebookEventFunction, &func) #define EVT_FLATNOTEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CHANGING(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CLOSING(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_CONTEXT_MENU(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CLOSED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, winid, wxFlatNotebookEventHandler(fn)) #endif // WXFLATNOTEBOOK_H --- NEW FILE: renderer.h --- #ifndef RENDERE_H #define RENDERE_H #include <wx/dc.h> #include <wx/string.h> #include <wx/wxflatnotebook/singleton.h> #include <wx/wxflatnotebook/smart_ptr.h> #include <map> #include <vector> #include <wx/event.h> class wxFNBRenderer { protected: // A bitmap that holds the background of the // x button which is drawn on a tab wxBitmap m_tabXBgBmp, m_xBgBmp, m_leftBgBmp, m_rightBgBmp; wxBitmap m_arrowDown, m_arrowUp; public: wxFNBRenderer(); virtual ~wxFNBRenderer(); /** * Generic function that draws the tabs and updates values in the page container * MAC requires that the event will be skipped, so we must pass it * \param pageContainer window that contains the tabs drawing * \param dc device context */ virtual void DrawTabs(wxWindow* pageContainer, wxDC &dc, wxEvent &event); /** * Draw a small 'x' button on top of the tab * \param pageContainer parent window on which to draw * \param dc device context to use * \param rect button rectangle * \param tabIdx tab index * \param btnStatus button status, can be one of * - wxFNB_BTN_PRESSED * - wxFNB_BTN_HOVER * - wxFNB_BTN_NONE * \param tabXBgBmp [output] background bitmap of the area of the button (just before it is painted) */ virtual void DrawTabX(wxWindow* pageContainer, wxDC& dc, const wxRect& rect, const int& tabIdx, const int btnStatus); /** * Draw tab * \param pageContainer parent window on which to draw * \param dc device context to use * \param posx tab x coordinate * \param tabIdx tab index * \param tabWidth tab width * \param tabHeight tab height * \param btnStatus btnStatus the little 'x' button (on top of the active tab) status, can be one of * - wxFNB_BTN_PRESSED * - wxFNB_BTN_HOVER * - wxFNB_BTN_NONE */ virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) = 0; /** * Calculate tab width , based on its index (for image, x button on tab) * \param pageContainer pageContainer parent window on which to draw * \param tabIdx tab index * \param tabHeight the tab height (used for tan() function calculations) * \return tab bouding rectangle size */ virtual int CalcTabWidth (wxWindow* pageContainer, int tabIdx, int tabHeight); /** * Calculate tab height * \param pageContainer pageContainer parent window on which to draw * \return tab bouding rectangle size */ virtual int CalcTabHeight(wxWindow* pageContainer); /** * Get a bitmap from device context, with rect size * \param dc device context * \param rect bitmap rectangle * \param bmp [output] bitmap */ virtual void GetBitmap(wxDC& dc, const wxRect &rect, wxBitmap &bmp); /** * Draw a bottom line for the tabs area */ void DrawTabsLine(wxWindow *pageContainer, wxDC& dc); /** * Brighten a given colour with amount * \param color starting colour * \param percent percent, 0 - no change, 100 - white * \return brighten colour */ static wxColor LightColour(const wxColour& color, int percent); /** * Paint rectangle with gradient colouring * \param dc device context * \param rect rectangle * \param startColor gradient colour 1 * \param endColor gradient colour 2 * \param vertical use vertical gradient or horizontal */ static void PaintStraightGradientBox(wxDC& dc, const wxRect& rect, const wxColour& startColor, const wxColour& endColor, bool vertical = true); // Navigation buttons position int GetLeftButtonPos(wxWindow *pageContainer); int GetRightButtonPos(wxWindow *pageContainer); int GetXPos(wxWindow *pageContainer); int GetButtonsAreaLength(wxWindow *pageContainer); int GetDropArrowButtonPos(wxWindow *pageContainer); /// Draw right arrow button to the right area of the tabs virtual void DrawRightArrow(wxWindow *pageContainer, wxDC &dc); /// Draw left arrow button to the right area of the tabs virtual void DrawLeftArrow (wxWindow *pageContainer, wxDC &dc); /// Draw 'x' button to the right area of the tabs virtual void DrawX (wxWindow *pageContainer, wxDC &dc); /** * Draw tab drag hint, the default implementation is to do nothing ... * u can override this function to provide a nice feedback to user * \param pageContainer a pointer to the owner wxPageContainer * \param tabIdx index of the tab that will be replaced with the dragged tab */ virtual void DrawDragHint(wxWindow *pageContainer, int tabIdx); /** * Draw drop down arrow on the right corner * \param pageContainer window tabs container * \param dc device context */ void DrawDropDownArrow(wxWindow* pageContainer, wxDC& dc); /** * Return an array of tabs info that can fit to screen starting from 'from' * \param pageContainer * \param [output] vTabInfo * \param from */ virtual void NumberTabsCanFit(wxWindow *pageContainer, std::vector<wxRect> &vTabInfo, int from = -1); protected: /** * Generate random colour * \return random colour */ wxColour RandomColor(); }; typedef SmartPtr<wxFNBRenderer> wxFNBRendererPtr; class wxFNBRendererDefault : public wxFNBRenderer { public: wxFNBRendererDefault(){} virtual ~wxFNBRendererDefault(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererVC71 : public wxFNBRenderer { public: wxFNBRendererVC71(){} virtual ~wxFNBRendererVC71(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererFancy : public wxFNBRenderer { public: wxFNBRendererFancy(){} virtual ~wxFNBRendererFancy(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererVC8 : public wxFNBRenderer { int m_factor; bool m_first; public: wxFNBRendererVC8() : m_factor(1), m_first(true) {} virtual ~wxFNBRendererVC8(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); virtual void DrawTabs(wxWindow *pageContainer, wxDC &dc, wxEvent &event); void NumberTabsCanFit(wxWindow *pageContainer, std::vector<wxRect> &vTabInfo, int from = -1); private: void FillVC8GradientColor(wxWindow* pageContainer, wxDC &dc, const wxPoint tabPoints[], const bool bSelectedTab, const int tabIdx); int GetEndX(const wxPoint tabPoints[], const int &y, long style); int GetStartX(const wxPoint tabPoints[], const int &y, long style); }; //----------------------------------- // Renderer manager class //----------------------------------- class wxFNBRendererMgr { friend class Singleton<wxFNBRendererMgr>; std::map<int, wxFNBRendererPtr> m_renderers; public: /** * Return the renderer according to the style flag, the returned pointer should not be * deleted by caller, it is owned by this class * \param style window style flag * \return wxFNBRenderer */ wxFNBRendererPtr GetRenderer(long style); private: wxFNBRendererMgr(); virtual ~wxFNBRendererMgr(); }; typedef Singleton<wxFNBRendererMgr> wxFNBRendererMgrST; #endif // RENDERE_H --- NEW FILE: smart_ptr.h --- #ifndef CODELITE_SMART_PTR_H #define CODELITE_SMART_PTR_H /** * A smart pointer class that provides a reference counting and auto delete memory. * * This class is similar to std::auto_ptr, with 2 exceptions: * - This class uses reference counting * - We dont provide a release() function (because of the reference counting) * It is recommended to use this class instead of using raw pointer wherever possible. * * \note smart pointer to NULL is valid. * * \ingroup CodeLite * \version 1.0 * first version * \date 09-17-2006 * \author Eran */ template <typename T> class SmartPtr { typedef T* type_ptr; /** * The reference counting class * * \ingroup CodeLite * \version 1.0 * first version * * \date 09-17-2006 * \author Eran */ class SmartPtrRef { type_ptr m_data; int m_refCount; public: /** * Construct a reference counting class for row pointer data * \param data pointer */ SmartPtrRef(type_ptr data) : m_data( data ) , m_refCount( 1 ) { } /** * Destructor */ virtual ~SmartPtrRef() { delete m_data; } /** * \return Pointer to the row data */ type_ptr GetData() { return m_data; } /** * Increase reference counting by 1 */ void IncRef() { m_refCount ++ ; } /** * Decrease reference counting by 1 */ void DecRef() { m_refCount -- ; } /** * Return the current reference counting * \return current reference counting */ int GetRefCount() { return m_refCount; } }; SmartPtrRef *m_ref; public: /** * Construct smart pointer from ptr * \param ptr pointer */ SmartPtr(type_ptr ptr) { // create a fresh copy CreateFresh( ptr ); } /** * Default constructor */ SmartPtr() : m_ref(NULL) { } /** * Copy constructor * \param rhs right hand side */ SmartPtr(const SmartPtr& rhs) : m_ref(NULL) { *this = rhs; } /** * Assignment operator * \param rhs right hand side * \return reference to this */ SmartPtr& operator=(const SmartPtr& rhs) { // increase the reference count if( m_ref == rhs.m_ref ) return *this; // Delete previous reference DeleteRefCount(); if( !rhs.m_ref ) return *this; m_ref = rhs.m_ref; m_ref->IncRef(); return *this; } /** * Destructor */ virtual ~SmartPtr() { DeleteRefCount(); } /** * Replace the current pointer with ptr * if the current ptr is not NULL, it will be freed (reference counting free) before assingning the new ptr * \param ptr new pointer */ void Reset(type_ptr ptr) { DeleteRefCount(); CreateFresh( ptr ); } /** * Return pointer the row data pointer * \return pointer to the row data pointer */ type_ptr Get() { return m_ref->GetData(); } /** * Overload the '->' operator * \return pointer to the row data pointer */ type_ptr operator->() const { return m_ref->GetData(); } /** * Dereference operator * \return dereference the row data */ T& operator*() const { return *(m_ref->GetData()); } /** * Test for NULL operator * \return true if the internal row data or the reference counting class are NULL false otherwise */ bool operator!() const { if( !m_ref ) return true; return m_ref->GetData() == NULL; } private: void DeleteRefCount() { // decrease the ref count (or delete pointer if it is 1) if( m_ref ) { if( m_ref->GetRefCount() == 1 ) { delete m_ref; m_ref = NULL; } else m_ref->DecRef(); } }; void CreateFresh(type_ptr ptr) { m_ref = new SmartPtrRef( ptr ); } }; #endif // CODELITE_SMART_PTR_H --- NEW FILE: singleton.h --- #ifndef CODELITE_SINGLETON_H #define CODELITE_SINGLETON_H /** * A template class that implements the Singleton pattern. * * \date 08-23-2006 * \author eran */ template <typename T> class Singleton { static T* ms_instance; public: /** * Static method to access the only pointer of this instance. * \return a pointer to the only instance of this */ static T* Get(); /** * Release resources. */ static void Free(); protected: /** * Default constructor. */ Singleton(); /** * Destructor. */ virtual ~Singleton(); }; template <typename T> T* Singleton<T>::ms_instance = 0; template <typename T> Singleton<T>::Singleton() { } template <typename T> Singleton<T>::~Singleton() { } template <typename T> T* Singleton<T>::Get() { if(!ms_instance) ms_instance = new T(); return ms_instance; } template <typename T> void Singleton<T>::Free() { if( ms_instance ) { delete ms_instance; ms_instance = 0; } } #endif // CODELITE_SINGLETON_H --- NEW FILE: fnb_resources.h --- #ifndef FNB_RESOURCES_H #define FNB_RESOURCES_H extern size_t tab_selection_png_size; extern unsigned char tab_selection_png[]; // Control left arrow images extern char *left_arrow_disabled_xpm[]; extern char *left_arrow_hilite_xpm[]; extern char *left_arrow_xpm[]; extern char *left_arrow_pressed_xpm[]; // Control right arrow extern char *right_arrow_hilite_xpm[]; extern char *right_arrow_pressed_xpm[]; extern char *right_arrow_xpm[]; extern char *right_arrow_disabled_xpm[]; // Cotrol down arrow extern char *down_arrow_hilite_xpm[]; extern char *down_arrow_pressed_xpm[]; extern char *down_arrow_xpm[]; // X button extern char *x_button_hilite_xpm[]; extern char *x_button_pressed_xpm[]; extern char *x_button_xpm[]; // Popup dialog xpm extern unsigned char signpost_alpha[]; extern char *signpost_xpm[]; // Drag hint arrows extern char *arrow_down_blue_xpm[]; extern char *arrow_up_blue_xpm[]; extern unsigned char arrow_down_blue_alpha[]; extern unsigned char arrow_up_blue_alpha[]; #endif // FNB_RESOURCES_H --- NEW FILE: wxfnbdroptarget.h --- #ifndef _WX_FNB_DROP_TARGET_H #define _WX_FNB_DROP_TARGET_H #include <wx/wx.h> #include <wx/dnd.h> /** \brief Contains the information about dragged page (page index and container). */ class wxFNBDragInfo { wxWindow * m_Container; int m_PageIndex; public: /** Constructor \param container - pointer to wxPageContainer object which contains dragged page \param pageindex - index of dragged page */ wxFNBDragInfo(wxWindow * container, int pageindex) : m_Container(container), m_PageIndex(pageindex){} /** * \brief default constructor */ wxFNBDragInfo() : m_Container(0), m_PageIndex(0){} /** Returns wxPageContainer object which contains dragged page */ wxWindow * GetContainer() {return m_Container;} /** Returns the index of dragged page */ int GetPageIndex() {return m_PageIndex;} }; class wxFNBDragInfoDataObject : public wxDataObjectSimple { public: wxFNBDragInfoDataObject(const wxDataFormat& format):wxDataObjectSimple(format) {} wxFNBDragInfo DragInfo; wxFNBDragInfo *GetData() { return &DragInfo; } // get the size of our data virtual size_t GetDataSize() const { return sizeof(wxFNBDragInfo); } // copy our data to the buffer virtual bool GetDataHere(void *buf) const { memcpy(buf, &DragInfo, sizeof(wxFNBDragInfo)); return true; } // copy data from buffer to our data virtual bool SetData(size_t WXUNUSED(len), const void *buf) { // don't check the len. Under Win98 the value of 'len' == 0 memcpy(&DragInfo, buf, sizeof(wxFNBDragInfo)); return true; } }; /** \brief Used for processing drag-n-drop opeartions */ template <class T> class wxFNBDropTarget : public wxDropTarget { private: typedef wxDragResult (T::*pt2Func)(wxCoord, wxCoord, int, wxWindow *); T* m_pParent; pt2Func m_pt2CallbackFunc; wxFNBDragInfoDataObject * m_DataObject; public: /** \brief Constructor \param pParent - Object that will handle drag-n-drop operation \param pt2CallbackFunc - Pointer to callback method which should be called after dragging the notebook page */ wxFNBDropTarget(T* pParent, pt2Func pt2CallbackFunc) : m_pParent(pParent) , m_pt2CallbackFunc(pt2CallbackFunc) , m_DataObject(NULL) { m_DataObject = new wxFNBDragInfoDataObject(wxDataFormat(wxT("wxFNB"))); SetDataObject(m_DataObject); } /** \brief Virtual Destructor */ virtual ~wxFNBDropTarget(void) {} /** \brief Used for processing drop operation \param x - X-coordinate \param y - Y-coordinate \param def - Result of drag-n-drop operation */ virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult WXUNUSED(def)) { GetData(); wxFNBDragInfo * draginfo = (wxFNBDragInfo *)m_DataObject->GetData(); if(!draginfo) { return wxDragNone; } return (m_pParent->*m_pt2CallbackFunc)(x, y, draginfo->GetPageIndex(), (T *)draginfo->GetContainer()); } }; /** * \ingroup wxFlatNotebook * This class represents a source for a drag and drop operation * We override wxDropSource class to provide user with a feedback * * \version 1.0 * first version * * \date 10-11-2006 * * \author Eran */ class wxFNBDropSource : public wxDropSource { wxWindow* m_win; public: /** * Parameterized constructor * \param win * \param iconCopy * \param iconMove * \param iconNone */ wxFNBDropSource(wxWindow* win = NULL) : wxDropSource(win) , m_win( win ) { } /** * Destructor */ virtual ~wxFNBDropSource() { } /** * give some custom UI feedback during the drag and drop operation in this function. It is called on each mouse move, so your implementation must not be too slow * \param effect The effect to implement. One of wxDragCopy, wxDragMove, wxDragLink and wxDragNone * \return */ virtual bool GiveFeedback(wxDragResult effect); }; #endif |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxscintilla/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxscintilla/src Added Files: PlatWX.cpp PlatWX.h ScintillaWX.cpp ScintillaWX.h wxscintilla.cpp Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: PlatWX.h --- wxRect wxRectFromPRectangle(PRectangle prc); PRectangle PRectangleFromwxRect(wxRect rc); wxColour wxColourFromCA(const ColourAllocated& ca); --- NEW FILE: PlatWX.cpp --- // Scintilla source code edit control // PlatWX.cxx - implementation of platform facilities on wxWidgets // Copyright 1998-1999 by Neil Hodgson <ne...@sc...> // Robin Dunn <ro...@al...> // The License.txt file describes the conditions under which this software may be distributed. #include <ctype.h> #include <wx/wx.h> #include <wx/encconv.h> #include <wx/listctrl.h> #include <wx/mstream.h> #include <wx/image.h> #include <wx/imaglist.h> #include <wx/tokenzr.h> #include "Platform.h" #include "PlatWX.h" #include "wx/wxscintilla.h" [...1407 lines suppressed...] size_t actualLen = UCS2FromUTF8(str, len, buffer.data(), wclen+1); return wxString(buffer.data(), actualLen); } const wxWX2MBbuf wx2stc(const wxString& str) { const wchar_t* wcstr = str.c_str(); size_t wclen = str.length(); size_t len = UTF8Length(wcstr, wclen); wxCharBuffer buffer(len+1); UTF8FromUCS2(wcstr, wclen, buffer.data(), len); // TODO check NULL termination!! return buffer; } #endif --- NEW FILE: wxscintilla.cpp --- //////////////////////////////////////////////////////////////////////////// // Name: wxscintilla.cpp // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, but instead // delegates most things to the real Scintilla class. // This allows the use of Scintilla without polluting the // namespace with all the classes and identifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: wxscintilla.cpp,v 1.2 2007/06/23 13:36:29 rollmark Exp $ // Copyright: (c) 2004 wxCode // Licence: wxWindows ///////////////////////////////////////////////////////////////////////////// #include <ctype.h> [...3305 lines suppressed...] m_linesAdded = event.m_linesAdded; m_line = event.m_line; m_foldLevelNow = event.m_foldLevelNow; m_foldLevelPrev = event.m_foldLevelPrev; m_margin = event.m_margin; m_message = event.m_message; m_wParam = event.m_wParam; m_lParam = event.m_lParam; m_listType = event.m_listType; m_x = event.m_x; m_y = event.m_y; m_dragText = event.m_dragText; m_dragAllowMove = event.m_dragAllowMove; #if wxUSE_DRAG_AND_DROP m_dragResult = event.m_dragResult; #endif } //---------------------------------------------------------------------- //---------------------------------------------------------------------- --- NEW FILE: ScintillaWX.cpp --- //////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.cxx // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatformWX.cxx This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintilla to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: ScintillaWX.cpp,v 1.2 2007/06/23 13:36:29 rollmark Exp $ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #include "ScintillaWX.h" //?#include "ExternalLexer.h" #include "PlatWX.h" [...1140 lines suppressed...] dc.SetClippingRegion(rgn); #endif } #else void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect)) { } #endif void ScintillaWX::SetUseAntiAliasing(bool useAA) { vs.extraFontFlag = useAA; InvalidateStyleRedraw(); } bool ScintillaWX::GetUseAntiAliasing() { return vs.extraFontFlag; } //---------------------------------------------------------------------- //---------------------------------------------------------------------- --- NEW FILE: ScintillaWX.h --- //////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.h // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatWX.cpp. This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintilla to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: ScintillaWX.h,v 1.2 2007/06/23 13:36:29 rollmark Exp $ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef __ScintillaWX_h__ #define __ScintillaWX_h__ //---------------------------------------------------------------------- #include <ctype.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "Platform.h" #include "Scintilla.h" #include "XPM.h" #ifdef SCI_LEXER #include "SciLexer.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #endif #include "ContractionState.h" #include "SVector.h" #include "CellBuffer.h" #include "CallTip.h" #include "KeyMap.h" #include "Indicator.h" #include "LineMarker.h" #include "Style.h" #include "ViewStyle.h" #include "AutoComplete.h" #include "CharClassify.h" #include "RESearch.h" #include "Document.h" #include "Editor.h" #include "ScintillaBase.h" #include <wx/wx.h> #include <wx/dataobj.h> #include <wx/clipbrd.h> #include <wx/dnd.h> //---------------------------------------------------------------------- #ifdef WXMAKINGDLL_SCI #define WXDLLIMPEXP_SCI WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_SCI WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_SCI #endif class WXDLLIMPEXP_SCI wxScintilla; // forward class ScintillaWX; //---------------------------------------------------------------------- // Helper classes #if wxUSE_DRAG_AND_DROP class wxSCIDropTarget : public wxTextDropTarget { public: void SetScintilla(ScintillaWX* swx) { this->swx = swx; } bool OnDropText(wxCoord x, wxCoord y, const wxString& data); wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); void OnLeave(); private: ScintillaWX* swx; }; #endif //---------------------------------------------------------------------- class ScintillaWX : public ScintillaBase { public: ScintillaWX(wxScintilla* win); ~ScintillaWX(); // base class virtuals virtual void Initialise(); virtual void Finalise(); virtual void StartDrag(); virtual bool SetIdle(bool on); virtual void SetTicking(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); virtual void ScrollText(int linesToMove); virtual void SetVerticalScrollPos(); virtual void SetHorizontalScrollPos(); virtual bool ModifyScrollBars(int nMax, int nPage); virtual void Copy(); virtual void Paste(); virtual void CopyToClipboard(const SelectionText &selectedText); virtual void CreateCallTipWindow(PRectangle rc); virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); virtual void ClaimSelection(); virtual long DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam); virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam); virtual void NotifyChange(); virtual void NotifyParent(SCNotification scn); virtual void CancelModes(); virtual void UpdateSystemCaret(); // Event delegates void DoPaint(wxDC* dc, wxRect rect); void DoHScroll(int type, int pos); void DoVScroll(int type, int pos); void DoSize(int width, int height); void DoLoseFocus(); void DoGainFocus(); void DoSysColourChange(); void DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); void DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl); void DoLeftButtonMove(Point pt); void DoMiddleButtonUp(Point pt); void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll); void DoAddChar(int key); int DoKeyDown(const wxKeyEvent& event, bool* consumed); void DoTick() { Tick(); } void DoOnIdle(wxIdleEvent& evt); void DoStartDrag(); #if wxUSE_DRAG_AND_DROP bool DoDropText(long x, long y, const wxString& data); wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); void DoDragLeave(); #endif void DoCommand(int ID); void DoContextMenu(Point pt); void DoOnListBox(); // helpers void FullPaint(); bool CanPaste(); bool GetHideSelection() { return hideSelection; } void DoScrollToLine(int line); void DoScrollToColumn(int column); void ClipChildren(wxDC& dc, PRectangle rect); void SetUseAntiAliasing(bool useAA); bool GetUseAntiAliasing(); private: bool capturedMouse; bool focusEvent; wxScintilla* sci; #if wxUSE_DRAG_AND_DROP wxSCIDropTarget* dropTarget; wxDragResult dragResult; bool dragRectangle; wxTimer* startDragTimer; #endif int wheelRotation; // For use in creating a system caret bool HasCaretSizeChanged(); bool CreateSystemCaret(); bool DestroySystemCaret(); #ifdef __WXMSW__ #if wxCHECK_VERSION(2, 5, 0) HBITMAP sysCaretBitmap; int sysCaretWidth; int sysCaretHeight; #endif #endif friend class wxSCICallTip; }; //---------------------------------------------------------------------- #endif |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxscintilla/src/scintilla/include In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxscintilla/src/scintilla/include Added Files: Accessor.h Face.py HFacer.py KeyWords.h Platform.h PropSet.h SString.h SciLexer.h Scintilla.h Scintilla.iface ScintillaWidget.h WindowAccessor.h Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: WindowAccessor.h --- // Scintilla source code edit control /** @file WindowAccessor.h ** Implementation of BufferAccess and StylingAccess on a Scintilla ** rapid easy access to contents of a Scintilla. **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. /** */ class WindowAccessor : public Accessor { // Private so WindowAccessor objects can not be copied WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {} WindowAccessor &operator=(const WindowAccessor &) { return *this; } protected: WindowID id; PropSet &props; int lenDoc; char styleBuf[bufferSize]; int validLen; char chFlags; char chWhile; unsigned int startSeg; bool InternalIsLeadByte(char ch); void Fill(int position); public: WindowAccessor(WindowID id_, PropSet &props_) : Accessor(), id(id_), props(props_), lenDoc(-1), validLen(0), chFlags(0), chWhile(0) { } ~WindowAccessor(); bool Match(int pos, const char *s); char StyleAt(int position); int GetLine(int position); int LineStart(int line); int LevelAt(int line); int Length(); void Flush(); int GetLineState(int line); int SetLineState(int line, int state); int GetPropertyInt(const char *key, int defaultValue=0) { return props.GetInt(key, defaultValue); } char *GetProperties() { return props.ToString(); } void StartAt(unsigned int start, char chMask=31); void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }; unsigned int GetStartSegment() { return startSeg; } void StartSegment(unsigned int pos); void ColourTo(unsigned int pos, int chAttr); void SetLevel(int line, int level); int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); }; --- NEW FILE: Face.py --- # Module for reading and parsing Scintilla.iface file import string def sanitiseLine(line): if line[-1:] == '\n': line = line[:-1] if string.find(line, "##") != -1: line = line[:string.find(line, "##")] line = string.strip(line) return line def decodeFunction(featureVal): retType, rest = string.split(featureVal, " ", 1) nameIdent, params = string.split(rest, "(") name, value = string.split(nameIdent, "=") params, rest = string.split(params, ")") param1, param2 = string.split(params, ",")[0:2] return retType, name, value, param1, param2 def decodeEvent(featureVal): retType, rest = string.split(featureVal, " ", 1) nameIdent, params = string.split(rest, "(") name, value = string.split(nameIdent, "=") return retType, name, value def decodeParam(p): param = string.strip(p) type = "" name = "" value = "" if " " in param: type, nv = string.split(param, " ") if "=" in nv: name, value = string.split(nv, "=") else: name = nv return type, name, value class Face: def __init__(self): self.order = [] self.features = {} self.values = {} self.events = {} def ReadFromFile(self, name): currentCategory = "" currentComment = [] currentCommentFinished = 0 file = open(name) for line in file.readlines(): line = sanitiseLine(line) if line: if line[0] == "#": if line[1] == " ": if currentCommentFinished: currentComment = [] currentCommentFinished = 0 currentComment.append(line[2:]) else: currentCommentFinished = 1 featureType, featureVal = string.split(line, " ", 1) if featureType in ["fun", "get", "set"]: retType, name, value, param1, param2 = decodeFunction(featureVal) p1 = decodeParam(param1) p2 = decodeParam(param2) self.features[name] = { "FeatureType": featureType, "ReturnType": retType, "Value": value, "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2], "Param2Type": p2[0], "Param2Name": p2[1], "Param2Value": p2[2], "Category": currentCategory, "Comment": currentComment } if self.values.has_key(value): raise "Duplicate value " + value + " " + name self.values[value] = 1 self.order.append(name) elif featureType == "evt": retType, name, value = decodeEvent(featureVal) self.features[name] = { "FeatureType": featureType, "ReturnType": retType, "Value": value, "Category": currentCategory, "Comment": currentComment } if self.events.has_key(value): raise "Duplicate event " + value + " " + name self.events[value] = 1 self.order.append(name) elif featureType == "cat": currentCategory = featureVal elif featureType == "val": name, value = string.split(featureVal, "=", 1) self.features[name] = { "FeatureType": featureType, "Category": currentCategory, "Value": value } self.order.append(name) elif featureType == "enu" or featureType == "lex": name, value = string.split(featureVal, "=", 1) self.features[name] = { "FeatureType": featureType, "Category": currentCategory, "Value": value } self.order.append(name) --- NEW FILE: HFacer.py --- # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface # definition file. # The header files are copied to a temporary file apart from the section between a //++Autogenerated # comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile # functions. After the temporary file is created, it is copied back to the original file name. import string import sys import os import Face def Contains(s,sub): return string.find(s, sub) != -1 def printLexHFile(f,out): for name in f.order: v = f.features[name] if v["FeatureType"] in ["val"]: if Contains(name, "SCE_") or Contains(name, "SCLEX_"): out.write("#define " + name + " " + v["Value"] + "\n") def printHFile(f,out): for name in f.order: v = f.features[name] if v["Category"] != "Deprecated": if v["FeatureType"] in ["fun", "get", "set"]: featureDefineName = "SCI_" + string.upper(name) out.write("#define " + featureDefineName + " " + v["Value"] + "\n") elif v["FeatureType"] in ["evt"]: featureDefineName = "SCN_" + string.upper(name) out.write("#define " + featureDefineName + " " + v["Value"] + "\n") elif v["FeatureType"] in ["val"]: if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): out.write("#define " + name + " " + v["Value"] + "\n") def CopyWithInsertion(input, output, genfn, definition): copying = 1 for line in input.readlines(): if copying: output.write(line) if Contains(line, "//++Autogenerated"): copying = 0 genfn(definition, output) if Contains(line, "//--Autogenerated"): copying = 1 output.write(line) def contents(filename): f = file(filename) t = f.read() f.close() return t def Regenerate(filename, genfn, definition): inText = contents(filename) tempname = "HFacer.tmp" out = open(tempname,"w") hfile = open(filename) CopyWithInsertion(hfile, out, genfn, definition) out.close() hfile.close() outText = contents(tempname) if inText == outText: os.unlink(tempname) else: os.unlink(filename) os.rename(tempname, filename) f = Face.Face() try: f.ReadFromFile("Scintilla.iface") Regenerate("Scintilla.h", printHFile, f) Regenerate("SciLexer.h", printLexHFile, f) print "Maximum ID is", max(x for x in f.values if int(x) < 3000) except: raise --- NEW FILE: Platform.h --- // Scintilla source code edit control /** @file Platform.h ** Interface to platform facilities. Also includes some basic utilities. ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. **/ // Copyright 1998-2003 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATFORM_H #define PLATFORM_H // PLAT_GTK = GTK+ on Linux or Win32 // PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 // PLAT_WIN = Win32 API on Win32 OS // PLAT_WX is wxWindows on any supported platform #define PLAT_GTK 0 #define PLAT_GTK_WIN32 0 #define PLAT_WIN 0 #define PLAT_WX 1 #define PLAT_FOX 0 #if defined(FOX) #undef PLAT_FOX #define PLAT_FOX 1 #elif defined(__WX__) #undef PLAT_WX #define PLAT_WX 1 #undef PLAT_WIN #define PLAT_WIN 1 #elif defined(GTK) #undef PLAT_GTK #define PLAT_GTK 1 #undef PLAT_WX #define PLAT_WX 1 #ifdef _MSC_VER #undef PLAT_GTK_WIN32 #define PLAT_GTK_WIN32 1 #endif #else #undef PLAT_WIN #define PLAT_WIN 1 #endif // Underlying the implementation of the platform classes are platform specific types. // Sometimes these need to be passed around by client code so they are defined here typedef void *FontID; typedef void *SurfaceID; typedef void *WindowID; typedef void *MenuID; typedef void *TickerID; typedef void *Function; typedef void *IdlerID; /** * A geometric point class. * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably. */ class Point { public: int x; int y; explicit Point(int x_=0, int y_=0) : x(x_), y(y_) { } // Other automatically defined methods (assignment, copy constructor, destructor) are fine static Point FromLong(long lpoint); }; /** * A geometric rectangle class. * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably. * PRectangles contain their top and left sides, but not their right and bottom sides. */ class PRectangle { public: int left; int top; int right; int bottom; PRectangle(int left_=0, int top_=0, int right_=0, int bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } // Other automatically defined methods (assignment, copy constructor, destructor) are fine bool operator==(PRectangle &rc) { return (rc.left == left) && (rc.right == right) && (rc.top == top) && (rc.bottom == bottom); } bool Contains(Point pt) { return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); } bool Contains(PRectangle rc) { return (rc.left >= left) && (rc.right <= right) && (rc.top >= top) && (rc.bottom <= bottom); } bool Intersects(PRectangle other) { return (right > other.left) && (left < other.right) && (bottom > other.top) && (top < other.bottom); } void Move(int xDelta, int yDelta) { left += xDelta; top += yDelta; right += xDelta; bottom += yDelta; } int Width() { return right - left; } int Height() { return bottom - top; } }; /** * In some circumstances, including Win32 in paletted mode and GTK+, each colour * must be allocated before use. The desired colours are held in the ColourDesired class, * and after allocation the allocation entry is stored in the ColourAllocated class. In other * circumstances, such as Win32 in true colour mode, the allocation process just copies * the RGB values from the desired to the allocated class. * As each desired colour requires allocation before it can be used, the ColourPair class * holds both a ColourDesired and a ColourAllocated * The Palette class is responsible for managing the palette of colours which contains a * list of ColourPair objects and performs the allocation. */ /** * Holds a desired RGB colour. */ class ColourDesired { long co; public: ColourDesired(long lcol=0) { co = lcol; } ColourDesired(unsigned int red, unsigned int green, unsigned int blue) { Set(red, green, blue); } bool operator==(const ColourDesired &other) const { return co == other.co; } void Set(long lcol) { co = lcol; } void Set(unsigned int red, unsigned int green, unsigned int blue) { co = red | (green << 8) | (blue << 16); } static inline unsigned int ValueOfHex(const char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; else if (ch >= 'A' && ch <= 'F') return ch - 'A' + 10; else if (ch >= 'a' && ch <= 'f') return ch - 'a' + 10; else return 0; } void Set(const char *val) { if (*val == '#') { val++; } unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]); unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]); unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]); Set(r, g, b); } long AsLong() const { return co; } unsigned int GetRed() { return co & 0xff; } unsigned int GetGreen() { return (co >> 8) & 0xff; } unsigned int GetBlue() { return (co >> 16) & 0xff; } }; /** * Holds an allocated RGB colour which may be an approximation to the desired colour. */ class ColourAllocated { long coAllocated; public: ColourAllocated(long lcol=0) { coAllocated = lcol; } void Set(long lcol) { coAllocated = lcol; } long AsLong() const { return coAllocated; } }; /** * Colour pairs hold a desired colour and an allocated colour. */ struct ColourPair { ColourDesired desired; ColourAllocated allocated; ColourPair(ColourDesired desired_=ColourDesired(0,0,0)) { desired = desired_; allocated.Set(desired.AsLong()); } void Copy() { allocated.Set(desired.AsLong()); } }; class Window; // Forward declaration for Palette /** * Colour palette management. */ class Palette { int used; int size; ColourPair *entries; #if PLAT_GTK void *allocatedPalette; // GdkColor * int allocatedLen; #endif // Private so Palette objects can not be copied Palette(const Palette &) {} Palette &operator=(const Palette &) { return *this; } public: #if PLAT_WIN void *hpal; #endif bool allowRealization; Palette(); ~Palette(); void Release(); /** * This method either adds a colour to the list of wanted colours (want==true) * or retrieves the allocated colour back to the ColourPair. * This is one method to make it easier to keep the code for wanting and retrieving in sync. */ void WantFind(ColourPair &cp, bool want); void Allocate(Window &w); }; /** * Font management. */ class Font { protected: FontID id; #if PLAT_WX int ascent; #endif // Private so Font objects can not be copied Font(const Font &) {} Font &operator=(const Font &) { id=0; return *this; } public: Font(); virtual ~Font(); virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic, bool extraFontFlag=false); virtual void Release(); FontID GetID() { return id; } // Alias another font - caller guarantees not to Release void SetID(FontID id_) { id = id_; } friend class Surface; friend class SurfaceImpl; }; /** * A surface abstracts a place to draw. */ class Surface { private: // Private so Surface objects can not be copied Surface(const Surface &) {} Surface &operator=(const Surface &) { return *this; } public: Surface() {}; virtual ~Surface() {}; static Surface *Allocate(); virtual void Init(WindowID wid)=0; virtual void Init(SurfaceID sid, WindowID wid)=0; virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0; virtual void Release()=0; virtual bool Initialised()=0; virtual void PenColour(ColourAllocated fore)=0; virtual int LogPixelsY()=0; virtual int DeviceHeightFont(int points)=0; virtual void MoveTo(int x_, int y_)=0; virtual void LineTo(int x_, int y_)=0; virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back)=0; virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int flags)=0; virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0; virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0; virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore)=0; virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions)=0; virtual int WidthText(Font &font_, const char *s, int len)=0; virtual int WidthChar(Font &font_, char ch)=0; virtual int Ascent(Font &font_)=0; virtual int Descent(Font &font_)=0; virtual int InternalLeading(Font &font_)=0; virtual int ExternalLeading(Font &font_)=0; virtual int Height(Font &font_)=0; virtual int AverageCharWidth(Font &font_)=0; virtual int SetPalette(Palette *pal, bool inBackGround)=0; virtual void SetClip(PRectangle rc)=0; virtual void FlushCachedState()=0; virtual void SetUnicodeMode(bool unicodeMode_)=0; virtual void SetDBCSMode(int codePage)=0; }; /** * A simple callback action passing one piece of untyped user data. */ typedef void (*CallBackAction)(void*); /** * Class to hide the details of window manipulation. * Does not own the window which will normally have a longer life than this object. */ class Window { protected: WindowID id; public: Window() : id(0), cursorLast(cursorInvalid) {} Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {} virtual ~Window(); Window &operator=(WindowID id_) { id = id_; return *this; } WindowID GetID() const { return id; } bool Created() const { return id != 0; } void Destroy(); bool HasFocus(); PRectangle GetPosition(); void SetPosition(PRectangle rc); void SetPositionRelative(PRectangle rc, Window relativeTo); PRectangle GetClientPosition(); void Show(bool show=true); void InvalidateAll(); void InvalidateRectangle(PRectangle rc); virtual void SetFont(Font &font); enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; void SetCursor(Cursor curs); void SetTitle(const char *s); private: Cursor cursorLast; }; /** * Listbox management. */ class ListBox : public Window { public: ListBox(); virtual ~ListBox(); static ListBox *Allocate(); virtual void SetFont(Font &font)=0; virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_)=0; virtual void SetAverageCharWidth(int width)=0; virtual void SetVisibleRows(int rows)=0; virtual int GetVisibleRows() const=0; virtual PRectangle GetDesiredRect()=0; virtual int CaretFromEdge()=0; virtual void Clear()=0; virtual void Append(char *s, int type = -1)=0; virtual int Length()=0; virtual void Select(int n)=0; virtual int GetSelection()=0; virtual int Find(const char *prefix)=0; virtual void GetValue(int n, char *value, int len)=0; virtual void RegisterImage(int type, const char *xpm_data)=0; virtual void ClearRegisteredImages()=0; virtual void SetDoubleClickAction(CallBackAction, void *)=0; virtual void SetList(const char* list, char separator, char typesep)=0; }; /** * Menu management. */ class Menu { MenuID id; public: Menu(); MenuID GetID() { return id; } void CreatePopUp(); void Destroy(); void Show(Point pt, Window &w); }; class ElapsedTime { long bigBit; long littleBit; public: ElapsedTime(); double Duration(bool reset=false); }; /** * Dynamic Library (DLL/SO/...) loading */ class DynamicLibrary { public: virtual ~DynamicLibrary() {}; /// @return Pointer to function "name", or NULL on failure. virtual Function FindFunction(const char *name) = 0; /// @return true if the library was loaded successfully. virtual bool IsValid() = 0; /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded. static DynamicLibrary *Load(const char *modulePath); }; /** * Platform class used to retrieve system wide parameters such as double click speed * and chrome colour. Not a creatable object, more of a module with several functions. */ class Platform { // Private so Platform objects can not be copied Platform(const Platform &) {} Platform &operator=(const Platform &) { return *this; } public: // Should be private because no new Platforms are ever created // but gcc warns about this Platform() {} ~Platform() {} static ColourDesired Chrome(); static ColourDesired ChromeHighlight(); static const char *DefaultFont(); static int DefaultFontSize(); static unsigned int DoubleClickTime(); static bool MouseButtonBounce(); static void DebugDisplay(const char *s); static bool IsKeyDown(int key); static long SendScintilla( WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); static long SendScintillaPointer( WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0); static bool IsDBCSLeadByte(int codePage, char ch); static int DBCSCharLength(int codePage, const char *s); static int DBCSCharMaxLength(); // These are utility functions not really tied to a platform static int Minimum(int a, int b); static int Maximum(int a, int b); // Next three assume 16 bit shorts and 32 bit longs static long LongFromTwoShorts(short a,short b) { return (a) | ((b) << 16); } static short HighShortFromLong(long x) { return static_cast<short>(x >> 16); } static short LowShortFromLong(long x) { return static_cast<short>(x & 0xffff); } static void DebugPrintf(const char *format, ...); static bool ShowAssertionPopUps(bool assertionPopUps_); static void Assert(const char *c, const char *file, int line); static int Clamp(int val, int minVal, int maxVal); }; #ifdef NDEBUG #define PLATFORM_ASSERT(c) ((void)0) #else #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) #endif // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER #pragma warning(disable: 4244 4309 4514 4710) #endif #endif --- NEW FILE: SString.h --- // SciTE - Scintilla based Text Editor /** @file SString.h ** A simple string class. **/ // Copyright 1998-2004 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #ifndef SSTRING_H #define SSTRING_H // These functions are implemented because each platform calls them something different. int CompareCaseInsensitive(const char *a, const char *b); int CompareNCaseInsensitive(const char *a, const char *b, size_t len); bool EqualCaseInsensitive(const char *a, const char *b); // Define another string class. // While it would be 'better' to use std::string, that doubles the executable size. // An SString may contain embedded nul characters. /** * Base class from which the two other classes (SBuffer & SString) * are derived. */ class SContainer { public: /** Type of string lengths (sizes) and positions (indexes). */ typedef size_t lenpos_t; /** Out of bounds value indicating that the string argument should be measured. */ enum { measure_length=0xffffffffU}; protected: char *s; ///< The C string lenpos_t sSize; ///< The size of the buffer, less 1: ie. the maximum size of the string SContainer() : s(0), sSize(0) {} ~SContainer() { delete []s; // Suppose it was allocated using StringAllocate s = 0; sSize = 0; } /** Size of buffer. */ lenpos_t size() const { if (s) { return sSize; } else { return 0; } } public: /** * Allocate uninitialized memory big enough to fit a string of the given length. * @return the pointer to the new string */ static char *StringAllocate(lenpos_t len); /** * Duplicate a buffer/C string. * Allocate memory of the given size, or big enough to fit the string if length isn't given; * then copy the given string in the allocated memory. * @return the pointer to the new string */ static char *StringAllocate( const char *s, ///< The string to duplicate lenpos_t len=measure_length); ///< The length of memory to allocate. Optional. }; /** * @brief A string buffer class. * * Main use is to ask an API the length of a string it can provide, * then to allocate a buffer of the given size, and to provide this buffer * to the API to put the string. * This class is intended to be shortlived, to be transformed as SString * as soon as it holds the string, so it has little members. * Note: we assume the buffer is filled by the API. If the length can be shorter, * we should set sLen to strlen(sb.ptr()) in related SString constructor and assignment. */ class SBuffer : protected SContainer { public: SBuffer(lenpos_t len) { s = StringAllocate(len); if (s) { *s = '\0'; sSize = len; } else { sSize = 0; } } private: /// Copy constructor // Here only to be on the safe size, user should avoid returning SBuffer values. SBuffer(const SBuffer &source) : SContainer() { s = StringAllocate(source.s, source.sSize); sSize = (s) ? source.sSize : 0; } /// Default assignment operator // Same here, shouldn't be used SBuffer &operator=(const SBuffer &source) { if (this != &source) { delete []s; s = StringAllocate(source.s, source.sSize); sSize = (s) ? source.sSize : 0; } return *this; } public: /** Provide direct read/write access to buffer. */ char *ptr() { return s; } /** Ownership of the buffer have been taken, so release it. */ void reset() { s = 0; sSize = 0; } /** Size of buffer. */ lenpos_t size() const { return SContainer::size(); } }; /** * @brief A simple string class. * * Hold the length of the string for quick operations, * can have a buffer bigger than the string to avoid too many memory allocations and copies. * May have embedded zeroes as a result of @a substitute, but relies too heavily on C string * functions to allow reliable manipulations of these strings, other than simple appends, etc. */ class SString : protected SContainer { lenpos_t sLen; ///< The size of the string in s lenpos_t sizeGrowth; ///< Minimum growth size when appending strings enum { sizeGrowthDefault = 64 }; bool grow(lenpos_t lenNew); SString &assign(const char *sOther, lenpos_t sSize_=measure_length); public: SString() : sLen(0), sizeGrowth(sizeGrowthDefault) {} SString(const SString &source) : SContainer(), sizeGrowth(sizeGrowthDefault) { s = StringAllocate(source.s, source.sLen); sSize = sLen = (s) ? source.sLen : 0; } SString(const char *s_) : sizeGrowth(sizeGrowthDefault) { s = StringAllocate(s_); sSize = sLen = (s) ? strlen(s) : 0; } SString(SBuffer &buf) : sizeGrowth(sizeGrowthDefault) { s = buf.ptr(); sSize = sLen = buf.size(); // Consumes the given buffer! buf.reset(); } SString(const char *s_, lenpos_t first, lenpos_t last) : sizeGrowth(sizeGrowthDefault) { // note: expects the "last" argument to point one beyond the range end (a la STL iterators) s = StringAllocate(s_ + first, last - first); sSize = sLen = (s) ? last - first : 0; } SString(int i); SString(double d, int precision); ~SString() { sLen = 0; } void clear() { if (s) { *s = '\0'; } sLen = 0; } /** Size of buffer. */ lenpos_t size() const { return SContainer::size(); } /** Size of string in buffer. */ lenpos_t length() const { return sLen; } /** Read access to a character of the string. */ char operator[](lenpos_t i) const { return (s && i < sSize) ? s[i] : '\0'; } SString &operator=(const char *source) { return assign(source); } SString &operator=(const SString &source) { if (this != &source) { assign(source.s, source.sLen); } return *this; } bool operator==(const SString &sOther) const; bool operator!=(const SString &sOther) const { return !operator==(sOther); } bool operator==(const char *sOther) const; bool operator!=(const char *sOther) const { return !operator==(sOther); } bool contains(char ch) const { return (s && *s) ? strchr(s, ch) != 0 : false; } void setsizegrowth(lenpos_t sizeGrowth_) { sizeGrowth = sizeGrowth_; } const char *c_str() const { return s ? s : ""; } /** Give ownership of buffer to caller which must use delete[] to free buffer. */ char *detach() { char *sRet = s; s = 0; sSize = 0; sLen = 0; return sRet; } SString substr(lenpos_t subPos, lenpos_t subLen=measure_length) const; SString &lowercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length); SString &uppercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length); SString &append(const char *sOther, lenpos_t sLenOther=measure_length, char sep = '\0'); SString &operator+=(const char *sOther) { return append(sOther, static_cast<lenpos_t>(measure_length)); } SString &operator+=(const SString &sOther) { return append(sOther.s, sOther.sLen); } SString &operator+=(char ch) { return append(&ch, 1); } SString &appendwithseparator(const char *sOther, char sep) { return append(sOther, strlen(sOther), sep); } SString &insert(lenpos_t pos, const char *sOther, lenpos_t sLenOther=measure_length); /** * Remove @a len characters from the @a pos position, included. * Characters at pos + len and beyond replace characters at pos. * If @a len is 0, or greater than the length of the string * starting at @a pos, the string is just truncated at @a pos. */ void remove(lenpos_t pos, lenpos_t len); SString &change(lenpos_t pos, char ch) { if (pos < sLen) { // character changed must be in string bounds *(s + pos) = ch; } return *this; } /** Read an integral numeric value from the string. */ int value() const { return s ? atoi(s) : 0; } bool startswith(const char *prefix); bool endswith(const char *suffix); int search(const char *sFind, lenpos_t start=0) const; bool contains(const char *sFind) const { return search(sFind) >= 0; } int substitute(char chFind, char chReplace); int substitute(const char *sFind, const char *sReplace); int remove(const char *sFind) { return substitute(sFind, ""); } }; /** * Duplicate a C string. * Allocate memory of the given size, or big enough to fit the string if length isn't given; * then copy the given string in the allocated memory. * @return the pointer to the new string */ inline char *StringDup( const char *s, ///< The string to duplicate SContainer::lenpos_t len=SContainer::measure_length) ///< The length of memory to allocate. Optional. { return SContainer::StringAllocate(s, len); } #endif --- NEW FILE: KeyWords.h --- // Scintilla source code edit control /** @file KeyWords.h ** Colourise for particular languages. **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler); /** * A LexerModule is responsible for lexing and folding a particular language. * The class maintains a list of LexerModules which can be searched to find a * module appropriate to a particular language. */ class LexerModule { protected: const LexerModule *next; int language; LexerFunction fnLexer; LexerFunction fnFolder; const char * const * wordListDescriptions; int styleBits; static const LexerModule *base; static int nextLanguage; public: const char *languageName; LexerModule(int language_, LexerFunction fnLexer_, const char *languageName_=0, LexerFunction fnFolder_=0, const char * const wordListDescriptions_[] = NULL, int styleBits_=5); virtual ~LexerModule() { } int GetLanguage() const { return language; } // -1 is returned if no WordList information is available int GetNumWordLists() const; const char *GetWordListDescription(int index) const; int GetStyleBitsNeeded() const; virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler) const; virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler) const; static const LexerModule *Find(int language); static const LexerModule *Find(const char *languageName); }; /** * Check if a character is a space. * This is ASCII specific but is safe with chars >= 0x80. */ inline bool isspacechar(unsigned char ch) { return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); } inline bool iswordchar(char ch) { return isascii(ch) && (isalnum(ch) || ch == '.' || ch == '_'); } inline bool iswordstart(char ch) { return isascii(ch) && (isalnum(ch) || ch == '_'); } inline bool isoperator(char ch) { if (isascii(ch) && isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '(' || ch == ')' || ch == '-' || ch == '+' || ch == '=' || ch == '|' || ch == '{' || ch == '}' || ch == '[' || ch == ']' || ch == ':' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || ch == '/' || ch == '?' || ch == '!' || ch == '.' || ch == '~') return true; return false; } --- NEW FILE: ScintillaWidget.h --- // Scintilla source code edit control /** @file ScintillaWidget.h ** Definition of Scintilla widget for GTK+. ** Only needed by GTK+ code but is harmless on other platforms. **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. #ifndef SCINTILLAWIDGET_H #define SCINTILLAWIDGET_H #if PLAT_GTK #ifdef __cplusplus extern "C" { #endif #define SCINTILLA(obj) GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject) #define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) #define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ()) typedef struct _ScintillaObject ScintillaObject; typedef struct _ScintillaClass ScintillaClass; struct _ScintillaObject { GtkContainer cont; void *pscin; }; struct _ScintillaClass { GtkContainerClass parent_class; void (* command) (ScintillaObject *ttt); void (* notify) (ScintillaObject *ttt); }; #if GLIB_MAJOR_VERSION < 2 GtkType scintilla_get_type (void); #else GType scintilla_get_type (void); #endif GtkWidget* scintilla_new (void); void scintilla_set_id (ScintillaObject *sci, uptr_t id); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); void scintilla_release_resources(void); #if GTK_MAJOR_VERSION < 2 #define SCINTILLA_NOTIFY "notify" #else #define SCINTILLA_NOTIFY "sci-notify" #endif #ifdef __cplusplus } #endif #endif #endif --- NEW FILE: Scintilla.h --- // Scintilla source code edit control /** @file Scintilla.h ** Interface to the edit control. **/ // Copyright 1998-2003 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. // Most of this file is automatically generated from the Scintilla.iface interface definition // file which contains any comments about the definitions. HFacer.py does the generation. #ifndef SCINTILLA_H #define SCINTILLA_H #if LCCWIN typedef BOOL bool; #endif #if PLAT_WIN // Return false on failure: bool Scintilla_RegisterClasses(void *hInstance); bool Scintilla_ReleaseResources(); #endif int Scintilla_LinkLexers(); // Here should be placed typedefs for uptr_t, an unsigned integer type large enough to // hold a pointer and sptr_t, a signed integer large enough to hold a pointer. // May need to be changed for 64 bit platforms. #if _MSC_VER >= 1300 #include <BaseTsd.h> #endif #ifdef MAXULONG_PTR typedef ULONG_PTR uptr_t; typedef LONG_PTR sptr_t; #else typedef unsigned long uptr_t; typedef long sptr_t; #endif typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); //++Autogenerated -- start of section automatically generated from Scintilla.iface #define INVALID_POSITION -1 #define SCI_START 2000 #define SCI_OPTIONAL_START 3000 #define SCI_LEXER_START 4000 #define SCI_ADDTEXT 2001 #define SCI_ADDSTYLEDTEXT 2002 #define SCI_INSERTTEXT 2003 #define SCI_CLEARALL 2004 #define SCI_CLEARDOCUMENTSTYLE 2005 #define SCI_GETLENGTH 2006 #define SCI_GETCHARAT 2007 #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 #define SCWS_VISIBLEAFTERINDENT 2 #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 #define SCI_POSITIONFROMPOINT 2022 #define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 #define SCI_GOTOPOS 2025 #define SCI_SETANCHOR 2026 #define SCI_GETCURLINE 2027 #define SCI_GETENDSTYLED 2028 #define SC_EOL_CRLF 0 #define SC_EOL_CR 1 #define SC_EOL_LF 2 #define SCI_CONVERTEOLS 2029 #define SCI_GETEOLMODE 2030 #define SCI_SETEOLMODE 2031 #define SCI_STARTSTYLING 2032 #define SCI_SETSTYLING 2033 #define SCI_GETBUFFEREDDRAW 2034 #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 #define SC_CP_UTF8 65001 #define SC_CP_DBCS 1 #define SCI_SETCODEPAGE 2037 #define SCI_SETUSEPALETTE 2039 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 #define SC_MARK_ARROW 2 #define SC_MARK_SMALLRECT 3 #define SC_MARK_SHORTARROW 4 #define SC_MARK_EMPTY 5 #define SC_MARK_ARROWDOWN 6 #define SC_MARK_MINUS 7 #define SC_MARK_PLUS 8 #define SC_MARK_VLINE 9 #define SC_MARK_LCORNER 10 #define SC_MARK_TCORNER 11 #define SC_MARK_BOXPLUS 12 #define SC_MARK_BOXPLUSCONNECTED 13 #define SC_MARK_BOXMINUS 14 #define SC_MARK_BOXMINUSCONNECTED 15 #define SC_MARK_LCORNERCURVE 16 #define SC_MARK_TCORNERCURVE 17 #define SC_MARK_CIRCLEPLUS 18 #define SC_MARK_CIRCLEPLUSCONNECTED 19 #define SC_MARK_CIRCLEMINUS 20 #define SC_MARK_CIRCLEMINUSCONNECTED 21 #define SC_MARK_BACKGROUND 22 #define SC_MARK_DOTDOTDOT 23 #define SC_MARK_ARROWS 24 #define SC_MARK_PIXMAP 25 #define SC_MARK_FULLRECT 26 #define SC_MARK_CHARACTER 10000 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 #define SC_MARKNUM_FOLDERTAIL 28 #define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 #define SC_MASK_FOLDERS 0xFE000000 #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 #define SCI_MARKERDELETEALL 2045 #define SCI_MARKERGET 2046 #define SCI_MARKERNEXT 2047 #define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 #define SCI_SETMARGINTYPEN 2240 #define SCI_GETMARGINTYPEN 2241 #define SCI_SETMARGINWIDTHN 2242 #define SCI_GETMARGINWIDTHN 2243 #define SCI_SETMARGINMASKN 2244 #define SCI_GETMARGINMASKN 2245 #define SCI_SETMARGINSENSITIVEN 2246 #define SCI_GETMARGINSENSITIVEN 2247 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 #define STYLE_BRACEBAD 35 #define STYLE_CONTROLCHAR 36 #define STYLE_INDENTGUIDE 37 #define STYLE_CALLTIP 38 #define STYLE_LASTPREDEFINED 39 #define STYLE_MAX 127 #define SC_CHARSET_ANSI 0 #define SC_CHARSET_DEFAULT 1 #define SC_CHARSET_BALTIC 186 #define SC_CHARSET_CHINESEBIG5 136 #define SC_CHARSET_EASTEUROPE 238 #define SC_CHARSET_GB2312 134 #define SC_CHARSET_GREEK 161 #define SC_CHARSET_HANGUL 129 #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 #define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 #define SC_CHARSET_TURKISH 162 #define SC_CHARSET_JOHAB 130 #define SC_CHARSET_HEBREW 177 #define SC_CHARSET_ARABIC 178 #define SC_CHARSET_VIETNAMESE 163 #define SC_CHARSET_THAI 222 #define SC_CHARSET_8859_15 1000 #define SCI_STYLECLEARALL 2050 #define SCI_STYLESETFORE 2051 #define SCI_STYLESETBACK 2052 #define SCI_STYLESETBOLD 2053 #define SCI_STYLESETITALIC 2054 #define SCI_STYLESETSIZE 2055 #define SCI_STYLESETFONT 2056 #define SCI_STYLESETEOLFILLED 2057 #define SCI_STYLERESETDEFAULT 2058 #define SCI_STYLESETUNDERLINE 2059 #define SC_CASE_MIXED 0 #define SC_CASE_UPPER 1 #define SC_CASE_LOWER 2 #define SCI_STYLESETCASE 2060 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 #define SCI_CLEARALLCMDKEYS 2072 #define SCI_SETSTYLINGEX 2073 #define SCI_STYLESETVISIBLE 2074 #define SCI_GETCARETPERIOD 2075 #define SCI_SETCARETPERIOD 2076 #define SCI_SETWORDCHARS 2077 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 #define INDIC_MAX 7 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 #define INDIC_DIAGONAL 3 #define INDIC_STRIKE 4 #define INDIC_HIDDEN 5 #define INDIC_BOX 6 #define INDIC_ROUNDBOX 7 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 #define INDIC2_MASK 0x80 #define INDICS_MASK 0xE0 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 #define SCI_INDICGETFORE 2083 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETSTYLEBITS 2090 #define SCI_GETSTYLEBITS 2091 #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 #define SCI_GETCARETLINEVISIBLE 2095 #define SCI_SETCARETLINEVISIBLE 2096 #define SCI_GETCARETLINEBACK 2097 #define SCI_SETCARETLINEBACK 2098 #define SCI_STYLESETCHANGEABLE 2099 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 #define SCI_AUTOCACTIVE 2102 #define SCI_AUTOCPOSSTART 2103 #define SCI_AUTOCCOMPLETE 2104 #define SCI_AUTOCSTOPS 2105 #define SCI_AUTOCSETSEPARATOR 2106 #define SCI_AUTOCGETSEPARATOR 2107 #define SCI_AUTOCSELECT 2108 #define SCI_AUTOCSETCANCELATSTART 2110 #define SCI_AUTOCGETCANCELATSTART 2111 #define SCI_AUTOCSETFILLUPS 2112 #define SCI_AUTOCSETCHOOSESINGLE 2113 #define SCI_AUTOCGETCHOOSESINGLE 2114 #define SCI_AUTOCSETIGNORECASE 2115 #define SCI_AUTOCGETIGNORECASE 2116 #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 #define SCI_CLEARREGISTEREDIMAGES 2408 #define SCI_AUTOCGETTYPESEPARATOR 2285 #define SCI_AUTOCSETTYPESEPARATOR 2286 #define SCI_AUTOCSETMAXWIDTH 2208 #define SCI_AUTOCGETMAXWIDTH 2209 #define SCI_AUTOCSETMAXHEIGHT 2210 #define SCI_AUTOCGETMAXHEIGHT 2211 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 #define SCI_GETUSETABS 2125 #define SCI_SETLINEINDENTATION 2126 #define SCI_GETLINEINDENTATION 2127 #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SCI_SETINDENTATIONGUIDES 2132 #define SCI_GETINDENTATIONGUIDES 2133 #define SCI_SETHIGHLIGHTGUIDE 2134 #define SCI_GETHIGHLIGHTGUIDE 2135 #define SCI_GETLINEENDPOSITION 2136 #define SCI_GETCODEPAGE 2137 #define SCI_GETCARETFORE 2138 #define SCI_GETUSEPALETTE 2139 #define SCI_GETREADONLY 2140 #define SCI_SETCURRENTPOS 2141 #define SCI_SETSELECTIONSTART 2142 #define SCI_GETSELECTIONSTART 2143 #define SCI_SETSELECTIONEND 2144 #define SCI_GETSELECTIONEND 2145 #define SCI_SETPRINTMAGNIFICATION 2146 #define SCI_GETPRINTMAGNIFICATION 2147 #define SC_PRINT_NORMAL 0 #define SC_PRINT_INVERTLIGHT 1 #define SC_PRINT_BLACKONWHITE 2 #define SC_PRINT_COLOURONWHITE 3 #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 #define SCFIND_WHOLEWORD 2 #define SCFIND_MATCHCASE 4 #define SCFIND_WORDSTART 0x00100000 #define SCFIND_REGEXP 0x00200000 #define SCFIND_POSIX 0x00400000 #define SCI_FINDTEXT 2150 #define SCI_FORMATRANGE 2151 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 #define SCI_GETMARGINRIGHT 2158 #define SCI_GETMODIFY 2159 #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 #define SCI_POSITIONFROMLINE 2167 #define SCI_LINESCROLL 2168 #define SCI_SCROLLCARET 2169 #define SCI_REPLACESEL 2170 #define SCI_SETREADONLY 2171 #define SCI_NULL 2172 #define SCI_CANPASTE 2173 #define SCI_CANUNDO 2174 #define SCI_EMPTYUNDOBUFFER 2175 #define SCI_UNDO 2176 #define SCI_CUT 2177 #define SCI_COPY 2178 #define SCI_PASTE 2179 #define SCI_CLEAR 2180 #define SCI_SETTEXT 2181 #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 #define SCI_SETCARETWIDTH 2188 #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 #define SCI_CALLTIPSHOW 2200 #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 #define SCI_CALLTIPPOSSTART 2203 #define SCI_CALLTIPSETHLT 2204 #define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPUSESTYLE 2212 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 #define SC_FOLDLEVELBOXHEADERFLAG 0x4000 #define SC_FOLDLEVELBOXFOOTERFLAG 0x8000 #define SC_FOLDLEVELCONTRACTED 0x10000 #define SC_FOLDLEVELUNINDENT 0x20000 #define SC_FOLDLEVELNUMBERMASK 0x0FFF #define SCI_SETFOLDLEVEL 2222 #define SCI_GETFOLDLEVEL 2223 #define SCI_GETLASTCHILD 2224 #define SCI_GETFOLDPARENT 2225 #define SCI_SHOWLINES 2226 #define SCI_HIDELINES 2227 #define SCI_GETLINEVISIBLE 2228 #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 #define SCI_ENSUREVISIBLE 2232 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 #define SC_FOLDFLAG_BOX 0x0001 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 #define SCI_GETTABINDENTS 2261 #define SCI_SETBACKSPACEUNINDENTS 2262 #define SCI_GETBACKSPACEUNINDENTS 2263 #define SC_TIME_FOREVER 10000000 #define SCI_SETMOUSEDWELLTIME 2264 #define SCI_GETMOUSEDWELLTIME 2265 #define SCI_WORDSTARTPOSITION 2266 #define SCI_WORDENDPOSITION 2267 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 #define SC_WRAPVISUALFLAG_END 0x0001 #define SC_WRAPVISUALFLAG_START 0x0002 #define SCI_SETWRAPVISUALFLAGS 2460 #define SCI_GETWRAPVISUALFLAGS 2461 #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define SCI_SETWRAPVISUALFLAGSLOCATION 2462 #define SCI_GETWRAPVISUALFLAGSLOCATION 2463 #define SCI_SETWRAPSTARTINDENT 2464 #define SCI_GETWRAPSTARTINDENT 2465 #define SC_CACHE_NONE 0 #define SC_CACHE_CARET 1 #define SC_CACHE_PAGE 2 #define SC_CACHE_DOCUMENT 3 #define SCI_SETLAYOUTCACHE 2272 #define SCI_GETLAYOUTCACHE 2273 #define SCI_SETSCROLLWIDTH 2274 #define SCI_GETSCROLLWIDTH 2275 #define SCI_TEXTWIDTH 2276 #define SCI_SETENDATLASTLINE 2277 #define SCI_GETENDATLASTLINE 2278 #define SCI_TEXTHEIGHT 2279 #define SCI_SETVSCROLLBAR 2280 #define SCI_GETVSCROLLBAR 2281 #define SCI_APPENDTEXT 2282 #define SCI_GETTWOPHASEDRAW 2283 #define SCI_SETTWOPHASEDRAW 2284 #define SCI_TARGETFROMSELECTION 2287 #define SCI_LINESJOIN 2288 #define SCI_LINESSPLIT 2289 #define SCI_SETFOLDMARGINCOLOUR 2290 #define SCI_SETFOLDMARGINHICOLOUR 2291 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 #define SCI_LINEUPEXTEND 2303 #define SCI_CHARLEFT 2304 #define SCI_CHARLEFTEXTEND 2305 #define SCI_CHARRIGHT 2306 #define SCI_CHARRIGHTEXTEND 2307 #define SCI_WORDLEFT 2308 #define SCI_WORDLEFTEXTEND 2309 #define SCI_WORDRIGHT 2310 #define SCI_WORDRIGHTEXTEND 2311 #define SCI_HOME 2312 #define SCI_HOMEEXTEND 2313 #define SCI_LINEEND 2314 #define SCI_LINEENDEXTEND 2315 #define SCI_DOCUMENTSTART 2316 #define SCI_DOCUMENTSTARTEXTEND 2317 #define SCI_DOCUMENTEND 2318 #define SCI_DOCUMENTENDEXTEND 2319 #define SCI_PAGEUP 2320 #define SCI_PAGEUPEXTEND 2321 #define SCI_PAGEDOWN 2322 #define SCI_PAGEDOWNEXTEND 2323 #define SCI_EDITTOGGLEOVERTYPE 2324 #define SCI_CANCEL 2325 #define SCI_DELETEBACK 2326 #define SCI_TAB 2327 #define SCI_BACKTAB 2328 #define SCI_NEWLINE 2329 #define SCI_FORMFEED 2330 #define SCI_VCHOME 2331 #define SCI_VCHOMEEXTEND 2332 #define SCI_ZOOMIN 2333 #define SCI_ZOOMOUT 2334 #define SCI_DELWORDLEFT 2335 #define SCI_DELWORDRIGHT 2336 #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 #define SCI_LINEDUPLICATE 2404 #define SCI_LOWERCASE 2340 #define SCI_UPPERCASE 2341 #define SCI_LINESCROLLDOWN 2342 #define SCI_LINESCROLLUP 2343 #define SCI_DELETEBACKNOTLINE 2344 #define SCI_HOMEDISPLAY 2345 #define SCI_HOMEDISPLAYEXTEND 2346 #define SCI_LINEENDDISPLAY 2347 #define SCI_LINEENDDISPLAYEXTEND 2348 #define SCI_HOMEWRAP 2349 #define SCI_HOMEWRAPEXTEND 2450 #define SCI_LINEENDWRAP 2451 #define SCI_LINEENDWRAPEXTEND 2452 #define SCI_VCHOMEWRAP 2453 #define SCI_VCHOMEWRAPEXTEND 2454 #define SCI_LINECOPY 2455 #define SCI_MOVECARETINSIDEVIEW 2401 #define SCI_LINELENGTH 2350 #define SCI_BRACEHIGHLIGHT 2351 #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEMATCH 2353 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 #define SCI_SETDOCPOINTER 2358 #define SCI_SETMODEVENTMASK 2359 #define EDGE_NONE 0 #define EDGE_LINE 1 #define EDGE_BACKGROUND 2 #define SCI_GETEDGECOLUMN 2360 #define SCI_SETEDGECOLUMN 2361 #define SCI_GETEDGEMODE 2362 #define SCI_SETEDGEMODE 2363 #define SCI_GETEDGECOLOUR 2364 #define SCI_SETEDGECOLOUR 2365 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 #define SCI_LINESONSCREEN 2370 #define SCI_USEPOPUP 2371 #define SCI_SELECTIONISRECTANGLE 2372 #define SCI_SETZOOM 2373 #define SCI_GETZOOM 2374 #define SCI_CREATEDOCUMENT 2375 #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 #define SCI_GETMODEVENTMASK 2378 #define SCI_SETFOCUS 2380 #define SCI_GETFOCUS 2381 #define SCI_SETSTATUS 2382 #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SC_CURSORNORMAL -1 #define SC_CURSORWAIT 4 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 #define SCI_GETCONTROLCHARSYMBOL 2389 #define SCI_WORDPARTLEFT 2390 #define SCI_WORDPARTLEFTEXTEND 2391 #define SCI_WORDPARTRIGHT 2392 #define SCI_WORDPARTRIGHTEXTEND 2393 #define VISIBLE_SLOP 0x01 #define VISIBLE_STRICT 0x04 #define SCI_SETVISIBLEPOLICY 2394 #define SCI_DELLINELEFT 2395 #define SCI_DELLINERIGHT 2396 #define SCI_SETXOFFSET 2397 #define SCI_GETXOFFSET 2398 #define SCI_CHOOSECARETX 2399 #define SCI_GRABFOCUS 2400 #define CARET_SLOP 0x01 #define CARET_STRICT 0x04 #define CARET_JUMPS 0x10 #define CARET_EVEN 0x08 #define SCI_SETXCARETPOLICY 2402 #define SCI_SETYCARETPOLICY 2403 #define SCI_SETPRINTWRAPMODE 2406 #define SCI_GETPRINTWRAPMODE 2407 #define SCI_SETHOTSPOTACTIVEFORE 2410 #define SCI_SETHOTSPOTACTIVEBACK 2411 #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 #define SCI_SETHOTSPOTSINGLELINE 2421 #define SCI_PARADOWN 2413 #define SCI_PARADOWNEXTEND 2414 #define SCI_PARAUP 2415 #define SCI_PARAUPEXTEND 2416 #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 #define SC_SEL_RECTANGLE 1 #define SC_SEL_LINES 2 #define SCI_SETSELECTIONMODE 2422 #define SCI_GETSELECTIONMODE 2423 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 #define SCI_LINEUPRECTEXTEND 2427 #define SCI_CHARLEFTRECTEXTEND 2428 #define SCI_CHARRIGHTRECTEXTEND 2429 #define SCI_HOMERECTEXTEND 2430 #define SCI_VCHOMERECTEXTEND 2431 #define SCI_LINEENDRECTEXTEND 2432 #define SCI_PAGEUPRECTEXTEND 2433 #define SCI_PAGEDOWNRECTEXTEND 2434 #define SCI_STUTTEREDPAGEUP 2435 #define SCI_STUTTEREDPAGEUPEXTEND 2436 #define SCI_STUTTEREDPAGEDOWN 2437 #define SCI_STUTTEREDPAGEDOWNEXTEND 2438 #define SCI_WORDLEFTEND 2439 #define SCI_WORDLEFTENDEXTEND 2440 #define SCI_WORDRIGHTEND 2441 #define SCI_WORDRIGHTENDEXTEND 2442 #define SCI_SETWHITESPACECHARS 2443 #define SCI_SETCHARSDEFAULT 2444 #define SCI_AUTOCGETCURRENT 2445 #define SCI_ALLOCATE 2446 #define SCI_TARGETASUTF8 2447 #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 #define SCI_GETCARETSTICKY 2457 #define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 #define SC_ALPHA_TRANSPARENT 0 #define SC_ALPHA_OPAQUE 255 #define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 #define KEYWORDSET_MAX 8 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 #define SCI_GETSTYLEBITSNEEDED 4011 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 #define SC_MOD_CHANGEFOLD 0x8 #define SC_PERFORMED_USER 0x10 #define SC_PERFORMED_UNDO 0x20 #define SC_PERFORMED_REDO 0x40 #define SC_MULTISTEPUNDOREDO 0x80 #define SC_LASTSTEPINUNDOREDO 0x100 #define SC_MOD_CHANGEMARKER 0x200 #define SC_MOD_BEFOREINSERT 0x400 #define SC_MOD_BEFOREDELETE 0x800 #define SC_MULTILINEUNDOREDO 0x1000 #define SC_MODEVENTMASKALL 0x1FFF #define SCEN_CHANGE 768 #define SCEN_SETFOCUS 512 #define SCEN_KILLFOCUS 256 #define SCK_DOWN 300 #define SCK_UP 301 #define SCK_LEFT 302 #define SCK_RIGHT 303 #define SCK_HOME 304 #define SCK_END 305 #define SCK_PRIOR 306 #define SCK_NEXT 307 #define SCK_DELETE 308 #define SCK_INSERT 309 #define SCK_ESCAPE 7 #define SCK_BACK 8 #define SCK_TAB 9 #define SCK_RETURN 13 #define SCK_ADD 310 #define SCK_SUBTRACT 311 #define SCK_DIVIDE 312 #define SCMOD_NORM 0 #define SCMOD_SHIFT 1 #define SCMOD_CTRL 2 #define SCMOD_ALT 4 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 #define SCN_SAVEPOINTLEFT 2003 #define SCN_MODIFYATTEMPTRO 2004 #define SCN_KEY 2005 #define SCN_DOUBLECLICK 2006 #define SCN_UPDATEUI 2007 #define SCN_MODIFIED 2008 #define SCN_MACRORECORD 2009 #define SCN_MARGINCLICK 2010 #define SCN_NEEDSHOWN 2011 #define SCN_PAINTED 2013 #define SCN_USERLISTSELECTION 2014 #define SCN_URIDROPPED 2015 #define SCN_DWELLSTART 2016 #define SCN_DWELLEND 2017 #define SCN_ZOOM 2018 #define SCN_HOTSPOTCLICK 2019 #define SCN_HOTSPOTDOUBLECLICK 2020 #define SCN_CALLTIPCLICK 2021 #define SCN_AUTOCSELECTION 2022 //--Autogenerated -- end of section automatically generated from Scintilla.iface // These structures are defined to be exactly the same shape as the Win32 // CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. // So older code that treats Scintilla as a RichEdit will work. struct CharacterRange { long cpMin; long cpMax; }; struct TextRange { struct CharacterRange chrg; char *lpstrText; }; struct TextToFind { struct CharacterRange chrg; char *lpstrText; struct CharacterRange chrgText; }; #ifdef PLATFORM_H // This structure is used in printing and requires some of the graphics types // from Platform.h. Not needed by most client code. struct RangeToFormat { SurfaceID hdc; SurfaceID hdcTarget; PRectangle rc; PRectangle rcPage; CharacterRange chrg; }; #endif struct NotifyHeader { // Compatible with Windows NMHDR. // hwndFrom is really an environment specific window handle or pointer // but most clients of Scintilla.h do not have this type visible. void *hwndFrom; uptr_t idFrom; unsigned int code; }; struct SCNotification { struct NotifyHeader nmhdr; int position; // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND int ch; // SCN_CHARADDED, SCN_KEY int modifiers; // SCN_KEY int modificationType; // SCN_MODIFIED const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION int length; // SCN_MODIFIED int linesAdded; // SCN_MODIFIED int message; // SCN_MACRORECORD uptr_t wParam; // SCN_MACRORECORD sptr_t lParam; // SCN_MACRORECORD int line; // SCN_MODIFIED int foldLevelNow; // SCN_MODIFIED int foldLevelPrev; // SCN_MODIFIED int margin; // SCN_MARGINCLICK int listType; // SCN_USERLISTSELECTION int x; // SCN_DWELLSTART, SCN_DWELLEND int y; // SCN_DWELLSTART, SCN_DWELLEND }; // Deprecation section listing all API features that are deprecated and will // will be removed completely in a future version. // To enable these features define INCLUDE_DEPRECATED_FEATURES #ifdef INCLUDE_DEPRECATED_FEATURES #define SCI_SETCARETPOLICY 2369 #define CARET_CENTER 0x02 #define CARET_XEVEN 0x08 #define CARET_XJUMPS 0x10 #define SCN_POSCHANGED 2012 #define SCN_CHECKBRACE 2007 #endif #endif --- NEW FILE: Accessor.h --- // Scintilla source code edit control /** @file Accessor.h ** Rapid easy access to contents of a Scintilla. **/ // Copyright 1998-2001 by Neil Hodgson <ne...@sc...> // The License.txt file describes the conditions under which this software may be distributed. enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; class Accessor; typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); /** * Interface to data in a Scintilla. */ class Accessor { protected: enum {extremePosition=0x7FFFFFFF}; /** @a bufferSize is a trade off between time taken to copy the characters * and retrieval overhead. * @a slopSize positions the buffer before the desired position * in case there is some backtracking. */ enum {bufferSize=4000, slopSize=bufferSize/8}; char buf[bufferSize+1]; int startPos; int endPos; int codePage; virtual bool InternalIsLeadByte(char ch)=0; virtual void Fill(int position)=0; public: Accessor() : startPos(extremePosition), endPos(0), codePage(0) {} virtual ~Accessor() {} char operator[](int position) { if (position < startPos || position >= endPos) { Fill(position); } return buf[position - startPos]; } /** Safe version of operator[], returning a defined value for invalid position. */ char SafeGetCharAt(int position, char chDefault=' ') { if (position < startPos || position >= endPos) { Fill(position); if (position < startPos || position >= endPos) { // Position is outside range of document return chDefault; } } return buf[position - startPos]; } bool IsLeadByte(char ch) { return codePage && InternalIsLeadByte(ch); } void SetCodePage(int codePage_) { codePage = codePage_; } virtual bool Match(int pos, const char *s)=0; virtual char StyleAt(int position)=0; virtual int GetLine(int position)=0; virtual int LineStart(int line)=0; virtual int LevelAt(int line)=0; virtual int Length()=0; virtual void Flush()=0; virtual int GetLineState(int line)=0; virtual int SetLineState(int line, int state)=0; virtual int GetPropertyInt(const char *key, int defaultValue=0)=0; virtual char *GetProperties()=0; // Style setting virtual void StartAt(unsigned int start, char chMask=31)=0; virtual void SetFlags(char chFlags_,... [truncated message content] |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:36:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/wxscintilla/include/wx In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29374/contrib/rsgedit/wxscintilla/include/wx Added Files: wxscintilla.h Log Message: - merged RSGEDIT_SCINTILLA branch --- NEW FILE: wxscintilla.h --- ///////////////////////////////////////////////////////////////////////////// // Name: wxscintilla.h // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, and in fact there // is no mention of Scintilla classes at all in this header. // This class delegates all method calls and events to the // Scintilla objects and so forth. This allows the use of // Scintilla without polluting the namespace with all the // classes and itentifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: wxscintilla.h,v 1.2 2007/06/23 13:36:29 rollmark Exp $ // Copyright: (c) 2004 wxCode // Licence: wxWindows ///////////////////////////////////////////////////////////////////////////// [...3636 lines suppressed...] return wxString (str, len); } #endif #if wxUSE_UNICODE inline const wxWX2MBbuf wx2sci (const wxString& str) { return str.mb_str (wxConvUTF8); } #else inline const wxWX2MBbuf wx2sci (const wxString& str) { return str.mbc_str(); } #endif #endif //---------------------------------------------------------------------- #endif // __WXSCINTILLA_H__ |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:13:03
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20637 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp Log Message: - notify user when closing modified tabs Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.12 retrieving revision 1.21.2.13 diff -C2 -d -r1.21.2.12 -r1.21.2.13 *** mainframe.cpp 23 Jun 2007 11:11:14 -0000 1.21.2.12 --- mainframe.cpp 23 Jun 2007 13:13:00 -0000 1.21.2.13 *************** *** 246,254 **** { wxString title(wxT("SimSpark")); ! ! wxString simFName = SparkEdit::GetStartScriptFile(); ! if (! simFName.empty()) { ! title += wxT(" <") + simFName + wxT(">"); } --- 246,252 ---- { wxString title(wxT("SimSpark")); ! if (SparkEdit::GetStartScript() != 0) { ! title += wxT(" <") + SparkEdit::GetStartScriptFile() + wxT(">"); } *************** *** 368,371 **** --- 366,386 ---- } + int n = mCtrNotebook->GetPageCount(); + + for (int i=(n-1);i>=0;--i) + { + wxWindow* page = mCtrNotebook->GetPage(i); + if (page == mCanvas) + { + continue; + } + + if (! mCtrNotebook->RemovePage(i)) + { + event.Veto(); + return; + } + } + // close agentframes wxWindowList& children = GetChildren(); *************** *** 1014,1019 **** return; } ! ! SaveModified(); SelectCanvasTab(); OpenSimulation(simName); --- 1029,1034 ---- return; } ! ! SaveModified(); SelectCanvasTab(); OpenSimulation(simName); *************** *** 1171,1180 **** wxScintilla* edit = dynamic_cast<wxScintilla*>(page); ! if (edit != 0) { ! SparkEdit::PutEdit(edit); ! UpdateTitle(); } event.Skip(); } --- 1186,1228 ---- wxScintilla* edit = dynamic_cast<wxScintilla*>(page); ! if (edit == 0) { ! event.Skip(); ! return; } + if (edit->GetModify()) + { + int res = wxMessageBox("The file '"+SparkEdit::GetFile(edit)+"' is modified.\n" + "Do you want to save your changes?", + "rsgedit", + wxYES_NO|wxCANCEL|wxICON_QUESTION + ); + + switch (res) + { + default: + assert(false); + // fall through + + case wxCANCEL: + event.Veto(); + return; + + case wxYES: + SparkEdit::SaveFile(edit); + break; + + case wxNO: + break; + } + } + + if (edit != 0) + { + SparkEdit::PutEdit(edit); + UpdateTitle(); + } + event.Skip(); } |
|
From: Markus R. <rol...@us...> - 2007-06-23 13:11:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20207 Modified Files: Tag: RSGEDIT_SCINTILLA sparkedit.cpp sparkedit.h Log Message: - refactor method GetStartScriptFile - added method GetFile Index: sparkedit.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -C2 -d -r1.1.2.11 -r1.1.2.12 *** sparkedit.cpp 23 Jun 2007 11:09:45 -0000 1.1.2.11 --- sparkedit.cpp 23 Jun 2007 13:11:34 -0000 1.1.2.12 *************** *** 397,403 **** } ! wxString SparkEdit::GetStartScriptFile() { ! TEditMap::iterator iter = mEditMap.find(mStartScript); if (iter == mEditMap.end()) { --- 397,409 ---- } ! wxString SparkEdit::GetFile(wxScintilla* edit) { ! if (edit == 0) ! { ! assert(false); ! return wxString(); ! } ! ! TEditMap::iterator iter = mEditMap.find(edit); if (iter == mEditMap.end()) { *************** *** 409,412 **** --- 415,423 ---- } + wxString SparkEdit::GetStartScriptFile() + { + return GetFile(mStartScript); + } + SparkEdit::EEditType SparkEdit::GetFileType(wxScintilla* edit) { Index: sparkedit.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** sparkedit.h 23 Jun 2007 11:09:45 -0000 1.1.2.8 --- sparkedit.h 23 Jun 2007 13:11:34 -0000 1.1.2.9 *************** *** 75,78 **** --- 75,79 ---- static wxScintilla* GetStartScript(); static EEditType GetFileType(wxScintilla* edit); + static wxString GetFile(wxScintilla* edit); static wxString GetStartScriptFile(); static void PrepareImageList(wxFlatNotebook* notebook); |
|
From: Markus R. <rol...@us...> - 2007-06-23 11:41:19
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17059 Modified Files: Tag: RSGEDIT_SCINTILLA inputcontrol.cpp inputcontrol.h Log Message: - use the CachedPath class to manage FpsController and InputServer references. Previously the InputControl class never release references to the InputServer and the FPScontroller. This lead to problems when rebuilding a simulation Index: inputcontrol.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputcontrol.h,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** inputcontrol.h 31 Mar 2007 13:18:16 -0000 1.3 --- inputcontrol.h 23 Jun 2007 11:41:16 -0000 1.3.6.1 *************** *** 22,25 **** --- 22,26 ---- #include <oxygen/simulationserver/simcontrolnode.h> + #include <oxygen/sceneserver/fpscontroller.h> #include <kerosin/inputserver/inputserver.h> *************** *** 72,78 **** boost::shared_ptr<oxygen::FPSController> GetFPSController(); - /** sets the FPSController to be used */ - void SetFPSController(boost::shared_ptr<oxygen::FPSController> controller); - /** sets the horizontal mouse sensitivity */ void SetHorizontalSensitivity(float s); --- 73,76 ---- *************** *** 114,120 **** bool RegisterInputItem(const std::string& inputItem, const std::string& name); - /** update variables from a script */ - virtual void UpdateCached(); - protected: virtual void OnLink(); --- 112,115 ---- *************** *** 123,130 **** protected: /** the controlled FPSController */ ! boost::shared_ptr<oxygen::FPSController> mFPSController; /** cached reference to the InputServer */ ! boost::shared_ptr<kerosin::InputServer> mInputServer; /** the size of the last time step */ --- 118,125 ---- protected: /** the controlled FPSController */ ! CachedPath<oxygen::FPSController> mFPSController; /** cached reference to the InputServer */ ! CachedPath<kerosin::InputServer> mInputServer; /** the size of the last time step */ Index: inputcontrol.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputcontrol.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** inputcontrol.cpp 17 Jun 2007 13:38:30 -0000 1.5 --- inputcontrol.cpp 23 Jun 2007 11:41:16 -0000 1.5.2.1 *************** *** 21,25 **** #include "inputitem.h" #include <oxygen/simulationserver/simulationserver.h> - #include <oxygen/sceneserver/fpscontroller.h> #include <zeitgeist/logserver/logserver.h> #include <zeitgeist/scriptserver/scriptserver.h> --- 21,24 ---- *************** *** 46,76 **** bool InputControl::SetFPSController(const std::string& path) { ! if (path.empty()) ! { ! mFPSController.reset(); ! return true; ! } ! ! shared_ptr<Leaf> leaf = GetCore()->Get(path); ! ! if (leaf.get() == 0) ! { ! GetLog()->Error() ! << "(InputControl) ERROR: invalid path " ! << path << "'\n"; ! return false; ! } ! ! mFPSController = shared_dynamic_cast<FPSController> ! (GetCore()->Get(path)); ! ! if (mFPSController.get() == 0) ! { ! // the path is valid but doesn't point to an FPSController; ! // for convenience search below for a controller ! mFPSController = ! leaf->FindChildSupportingClass<FPSController>(true); ! } ! if (mFPSController.get() == 0) { --- 45,49 ---- bool InputControl::SetFPSController(const std::string& path) { ! RegisterCachedPath(mFPSController, path); if (mFPSController.get() == 0) { *************** *** 86,95 **** shared_ptr<FPSController> InputControl::GetFPSController() { ! return mFPSController; ! } ! ! void InputControl::SetFPSController(shared_ptr<FPSController> controller) ! { ! mFPSController = controller; } --- 59,63 ---- shared_ptr<FPSController> InputControl::GetFPSController() { ! return mFPSController.get(); } *************** *** 111,116 **** scriptServer->CreateVariable("Command.Mouselook", CmdMouseLook); ! mInputServer = shared_dynamic_cast<InputServer> ! (GetCore()->Get("/sys/server/input")); if (mInputServer.get() == 0) --- 79,83 ---- scriptServer->CreateVariable("Command.Mouselook", CmdMouseLook); ! RegisterCachedPath(mInputServer, "/sys/server/input"); if (mInputServer.get() == 0) *************** *** 269,273 **** } ! float InputControl::GetDeltaTime() { --- 236,240 ---- } ! float InputControl::GetDeltaTime() { *************** *** 275,279 **** } ! void InputControl::SetAdvanceTime(bool advance) { --- 242,246 ---- } ! void InputControl::SetAdvanceTime(bool advance) { *************** *** 281,285 **** } ! bool InputControl::GetAdvanceTime() { --- 248,252 ---- } ! bool InputControl::GetAdvanceTime() { *************** *** 287,291 **** } ! bool InputControl::RegisterInputItem(const string& inputItemName, const string& name) { --- 254,258 ---- } ! bool InputControl::RegisterInputItem(const string& inputItemName, const string& name) { *************** *** 325,331 **** } - void - InputControl::UpdateCached() - { - // mFPSController.reset(); - } --- 292,293 ---- |
|
From: Markus R. <rol...@us...> - 2007-06-23 11:11:20
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5262 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp mainframe.h Log Message: - added method SaveModified() - automatically save modified files when reverting a simulation Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.15.2.6 retrieving revision 1.15.2.7 diff -C2 -d -r1.15.2.6 -r1.15.2.7 *** mainframe.h 23 Jun 2007 10:17:25 -0000 1.15.2.6 --- mainframe.h 23 Jun 2007 11:11:14 -0000 1.15.2.7 *************** *** 149,152 **** --- 149,153 ---- void InitTreeNodeProperties(); void SelectCanvasTab(); + void SaveModified(); void OnTreeItemExpanding(wxTreeEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.11 retrieving revision 1.21.2.12 diff -C2 -d -r1.21.2.11 -r1.21.2.12 *** mainframe.cpp 23 Jun 2007 10:17:25 -0000 1.21.2.11 --- mainframe.cpp 23 Jun 2007 11:11:14 -0000 1.21.2.12 *************** *** 931,934 **** --- 931,940 ---- } + void mainframe::SaveModified() + { + SparkEdit::SaveModified(); + SparkEdit::UpdateTitles(mCtrNotebook); + } + void mainframe::OnUpdateFileSave(wxUpdateUIEvent& event) { *************** *** 1004,1011 **** { wxString simName = SparkEdit::GetStartScriptFile(); ! if (! simName.IsEmpty()) { ! OpenSimulation(simName); } } --- 1010,1021 ---- { wxString simName = SparkEdit::GetStartScriptFile(); ! if (simName.IsEmpty()) { ! return; } + + SaveModified(); + SelectCanvasTab(); + OpenSimulation(simName); } |
|
From: Markus R. <rol...@us...> - 2007-06-23 11:09:48
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4460 Modified Files: Tag: RSGEDIT_SCINTILLA sparkedit.cpp sparkedit.h Log Message: - added method UpdateTitles() and Savemodified() Index: sparkedit.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** sparkedit.cpp 23 Jun 2007 10:13:45 -0000 1.1.2.10 --- sparkedit.cpp 23 Jun 2007 11:09:45 -0000 1.1.2.11 *************** *** 313,316 **** --- 313,329 ---- } + void SparkEdit::UpdateTitles(wxFlatNotebook* notebook) + { + for ( + TEditMap::iterator iter = mEditMap.begin(); + iter != mEditMap.end(); + ++iter + ) + { + wxScintilla* edit = (*iter).first; + UpdateTitle(notebook, edit); + } + } + void SparkEdit::UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit) { *************** *** 331,334 **** --- 344,377 ---- } + void SparkEdit::SaveModified() + { + for ( + TEditMap::iterator iter = mEditMap.begin(); + iter != mEditMap.end(); + ++iter + ) + { + wxScintilla* edit = (*iter).first; + if (! edit->GetModify()) + { + continue; + } + + EditEntry& entry = (*iter).second; + SaveFile(edit, entry); + } + } + + void SparkEdit::SaveFile(wxScintilla* edit, const EditEntry& entry) + { + if (edit == 0) + { + assert(false); + return; + } + + edit->SaveFile(entry.fname); + } + void SparkEdit::SaveFile(wxScintilla* edit) { *************** *** 338,344 **** return; } ! const EditEntry& entry = (*iter).second; ! edit->SaveFile(entry.fname); } --- 381,387 ---- return; } ! const EditEntry& entry = (*iter).second; ! SaveFile(edit, entry); } Index: sparkedit.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** sparkedit.h 23 Jun 2007 10:13:45 -0000 1.1.2.7 --- sparkedit.h 23 Jun 2007 11:09:45 -0000 1.1.2.8 *************** *** 67,73 **** --- 67,75 ---- static wxScintilla* GetEdit(const wxString& fname, wxFlatNotebook* notebook, bool select); static void PutEdit(wxScintilla* edit); + static void UpdateTitles(wxFlatNotebook* notebook); static void UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit); static void UpdateIcons(wxFlatNotebook* notebook); static void SaveFile(wxScintilla* edit); + static void SaveModified(); static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit); static wxScintilla* GetStartScript(); *************** *** 86,89 **** --- 88,93 ---- static int GetImageIndex(const wxScintilla* edit, const EditEntry& entry); + static void SaveFile(wxScintilla* edit, const EditEntry& entry); + protected: static TEditMap mEditMap; |
|
From: Markus R. <rol...@us...> - 2007-06-23 10:17:31
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14819 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp mainframe.h Log Message: - added method SelectCanvasTab() - changed file open dialog to allow selection of ruby and rsg files - first opened .rb is implicitly the start script Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.15.2.5 retrieving revision 1.15.2.6 diff -C2 -d -r1.15.2.5 -r1.15.2.6 *** mainframe.h 23 Jun 2007 09:32:51 -0000 1.15.2.5 --- mainframe.h 23 Jun 2007 10:17:25 -0000 1.15.2.6 *************** *** 148,151 **** --- 148,152 ---- void UpdateLogChannelState(); void InitTreeNodeProperties(); + void SelectCanvasTab(); void OnTreeItemExpanding(wxTreeEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.10 retrieving revision 1.21.2.11 diff -C2 -d -r1.21.2.10 -r1.21.2.11 *** mainframe.cpp 23 Jun 2007 09:32:51 -0000 1.21.2.10 --- mainframe.cpp 23 Jun 2007 10:17:25 -0000 1.21.2.11 *************** *** 906,912 **** } - bool select = false; - SparkEdit::SetStartScript(mCtrNotebook, SparkEdit::GetEdit(fname, mCtrNotebook, select)); - UpdateCached(); --- 906,909 ---- *************** *** 929,933 **** DoneSimulation(sim); - UpdateTitle(); PrintSimState(); --- 926,929 ---- *************** *** 952,962 **** } void mainframe::OnFileOpen(wxCommandEvent& event) { ! wxString message(wxT("Choose a ruby script to run")); wxString default_path(wxT("./rsg")); wxString default_filename(wxT("")); wxString default_extension(wxT("")); ! wxString wildcard(wxT("ruby scripts (*.rb)|*.rb")); wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); --- 948,971 ---- } + void mainframe::SelectCanvasTab() + { + int idx = mCtrNotebook->GetPageIndex(mCanvas); + if (idx < 0) + { + assert(false); + return; + } + + mCtrNotebook->SetSelection(idx); + mCanvas->SetFocus(); + } + void mainframe::OnFileOpen(wxCommandEvent& event) { ! wxString message(wxT("Choose a file to open")); wxString default_path(wxT("./rsg")); wxString default_filename(wxT("")); wxString default_extension(wxT("")); ! wxString wildcard(wxT("simspark files (*.rsg, *.rb)|*.rb;*.rsg")); wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); *************** *** 966,969 **** --- 975,993 ---- } + bool select = false; + wxScintilla* edit = SparkEdit::GetEdit(filename, mCtrNotebook, select); + + if ( + (SparkEdit::GetStartScript() != 0) || + (SparkEdit::GetFileType(edit) != SparkEdit::ET_RB) + ) + { + SparkEdit::SelectEdit(mCtrNotebook, edit); + return; + } + + SelectCanvasTab(); + SparkEdit::SetStartScript(mCtrNotebook, edit); + UpdateTitle(); OpenSimulation(filename); } |
|
From: Markus R. <rol...@us...> - 2007-06-23 10:13:48
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13200 Modified Files: Tag: RSGEDIT_SCINTILLA sparkedit.cpp sparkedit.h Log Message: - addedd method GetFileType() and SelectEdit() Index: sparkedit.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** sparkedit.cpp 23 Jun 2007 09:22:27 -0000 1.1.2.9 --- sparkedit.cpp 23 Jun 2007 10:13:45 -0000 1.1.2.10 *************** *** 289,292 **** --- 289,293 ---- } + notebook->SetPageImageIndex(entry.page, -1); notebook->SetPageImageIndex(entry.page, GetImageIndex(edit, entry)); } *************** *** 365,366 **** --- 366,398 ---- } + SparkEdit::EEditType SparkEdit::GetFileType(wxScintilla* edit) + { + TEditMap::iterator iter = mEditMap.find(edit); + if (iter == mEditMap.end()) + { + return ET_NONE; + } + + const EditEntry& entry = (*iter).second; + return entry.type; + } + + void SparkEdit::SelectEdit(wxFlatNotebook* notebook, wxScintilla* edit) + { + if (notebook == 0) + { + assert(false); + return; + } + + TEditMap::iterator iter = mEditMap.find(edit); + if (iter == mEditMap.end()) + { + assert(false); + return; + } + + const EditEntry& entry = (*iter).second; + notebook->SetSelection(entry.page); + edit->SetFocus(); + } Index: sparkedit.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** sparkedit.h 23 Jun 2007 09:22:27 -0000 1.1.2.6 --- sparkedit.h 23 Jun 2007 10:13:45 -0000 1.1.2.7 *************** *** 32,35 **** --- 32,36 ---- enum EEditType { + ET_NONE, ET_RSG, ET_RB, *************** *** 71,76 **** --- 72,79 ---- static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit); static wxScintilla* GetStartScript(); + static EEditType GetFileType(wxScintilla* edit); static wxString GetStartScriptFile(); static void PrepareImageList(wxFlatNotebook* notebook); + static void SelectEdit(wxFlatNotebook* notebook, wxScintilla* edit); protected: |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:32:54
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29520 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp mainframe.h Log Message: - make sure that the OpenGL canvas receives the input focus if when its tab is selected Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.15.2.4 retrieving revision 1.15.2.5 diff -C2 -d -r1.15.2.4 -r1.15.2.5 *** mainframe.h 23 Jun 2007 09:24:06 -0000 1.15.2.4 --- mainframe.h 23 Jun 2007 09:32:51 -0000 1.15.2.5 *************** *** 155,158 **** --- 155,159 ---- void OnTabClosing(wxFlatNotebookEvent& event); + void OnTabChanged(wxFlatNotebookEvent& event); void OnEditSavePointReached(wxScintillaEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.9 retrieving revision 1.21.2.10 diff -C2 -d -r1.21.2.9 -r1.21.2.10 *** mainframe.cpp 23 Jun 2007 09:28:05 -0000 1.21.2.9 --- mainframe.cpp 23 Jun 2007 09:32:51 -0000 1.21.2.10 *************** *** 108,111 **** --- 108,112 ---- EVT_FLATNOTEBOOK_PAGE_CLOSING(wxID_ANY, mainframe::OnTabClosing) + EVT_FLATNOTEBOOK_PAGE_CHANGED(wxID_ANY, mainframe::OnTabChanged) EVT_SCI_SAVEPOINTREACHED(wxID_ANY, mainframe::OnEditSavePointReached) *************** *** 1145,1148 **** --- 1146,1160 ---- } + void mainframe::OnTabChanged(wxFlatNotebookEvent& event) + { + wxWindow* page = mCtrNotebook->GetPage(event.GetSelection()); + if (page == mCanvas) + { + mCanvas->SetFocus(); + } + + event.Skip(); + } + void mainframe::OnEditSavePointReached(wxScintillaEvent& event) { |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:28:12
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27505 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp Log Message: - Update application title after a tab is closed Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.8 retrieving revision 1.21.2.9 diff -C2 -d -r1.21.2.8 -r1.21.2.9 *** mainframe.cpp 23 Jun 2007 09:24:06 -0000 1.21.2.8 --- mainframe.cpp 23 Jun 2007 09:28:05 -0000 1.21.2.9 *************** *** 1139,1142 **** --- 1139,1143 ---- { SparkEdit::PutEdit(edit); + UpdateTitle(); } |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:24:10
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25990 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp mainframe.h Log Message: - removed member mSimFName - entierly depend on SparkEdit class to track current start script Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.15.2.3 retrieving revision 1.15.2.4 diff -C2 -d -r1.15.2.3 -r1.15.2.4 *** mainframe.h 21 Jun 2007 19:18:48 -0000 1.15.2.3 --- mainframe.h 23 Jun 2007 09:24:06 -0000 1.15.2.4 *************** *** 222,230 **** int mLastVertSashPosition; - /** the filename of the current simulation (i.e. the corresponding - startup .rb script) - */ - wxString mSimFName; - SparkGLCanvas* mCanvas; --- 222,225 ---- Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.7 retrieving revision 1.21.2.8 diff -C2 -d -r1.21.2.7 -r1.21.2.8 *** mainframe.cpp 23 Jun 2007 09:12:57 -0000 1.21.2.7 --- mainframe.cpp 23 Jun 2007 09:24:06 -0000 1.21.2.8 *************** *** 245,251 **** { wxString title(wxT("SimSpark")); ! if (! mSimFName.empty()) { ! title += wxT(" <") + mSimFName + wxT(">"); } --- 245,253 ---- { wxString title(wxT("SimSpark")); ! ! wxString simFName = SparkEdit::GetStartScriptFile(); ! if (! simFName.empty()) { ! title += wxT(" <") + simFName + wxT(">"); } *************** *** 926,933 **** DoneSimulation(sim); - - mSimFName = fname; UpdateTitle(); PrintSimState(); return true; } --- 928,934 ---- DoneSimulation(sim); UpdateTitle(); PrintSimState(); + return true; } *************** *** 971,975 **** event.Enable( (GetSimState() == S_PAUSED) && ! (! mSimFName.empty()) ); } --- 972,976 ---- event.Enable( (GetSimState() == S_PAUSED) && ! (SparkEdit::GetStartScript() != 0) ); } *************** *** 977,981 **** void mainframe::OnFileReload(wxCommandEvent& event) { ! OpenSimulation(mSimFName); } --- 978,986 ---- void mainframe::OnFileReload(wxCommandEvent& event) { ! wxString simName = SparkEdit::GetStartScriptFile(); ! if (! simName.IsEmpty()) ! { ! OpenSimulation(simName); ! } } *************** *** 1150,1152 **** event.Skip(); } - --- 1155,1156 ---- |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:22:33
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25478 Modified Files: Tag: RSGEDIT_SCINTILLA sparkedit.cpp sparkedit.h Log Message: - added method GetStartScript() to get the current start script edit control - added method GetStartScriptFile() to get the file name of the current start script Index: sparkedit.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** sparkedit.cpp 23 Jun 2007 09:11:36 -0000 1.1.2.8 --- sparkedit.cpp 23 Jun 2007 09:22:27 -0000 1.1.2.9 *************** *** 347,348 **** --- 347,366 ---- UpdateIcons(notebook); } + + wxScintilla* SparkEdit::GetStartScript() + { + return mStartScript; + } + + wxString SparkEdit::GetStartScriptFile() + { + TEditMap::iterator iter = mEditMap.find(mStartScript); + if (iter == mEditMap.end()) + { + return wxString(); + } + + const EditEntry& entry = (*iter).second; + return entry.fname; + } + Index: sparkedit.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** sparkedit.h 23 Jun 2007 09:11:36 -0000 1.1.2.5 --- sparkedit.h 23 Jun 2007 09:22:27 -0000 1.1.2.6 *************** *** 70,73 **** --- 70,75 ---- static void SaveFile(wxScintilla* edit); static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit); + static wxScintilla* GetStartScript(); + static wxString GetStartScriptFile(); static void PrepareImageList(wxFlatNotebook* notebook); |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:12:59
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21610 Modified Files: Tag: RSGEDIT_SCINTILLA mainframe.cpp Log Message: - prepare SparkEdit image list - track current start script in SparkEdit class Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.21.2.6 retrieving revision 1.21.2.7 diff -C2 -d -r1.21.2.6 -r1.21.2.7 *** mainframe.cpp 23 Jun 2007 07:28:04 -0000 1.21.2.6 --- mainframe.cpp 23 Jun 2007 09:12:57 -0000 1.21.2.7 *************** *** 184,192 **** ); - mCtrNotebook->RemovePage(0); mCanvas = new SparkGLCanvas(mCtrNotebook, wxID_ANY); mCanvas->SetLabel("simulation window"); mCtrNotebook->AddPage(mCanvas, wxT("Canvas")); // create toolbar mToolBar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY ); --- 184,194 ---- ); mCanvas = new SparkGLCanvas(mCtrNotebook, wxID_ANY); mCanvas->SetLabel("simulation window"); mCtrNotebook->AddPage(mCanvas, wxT("Canvas")); + SparkEdit::PrepareImageList(mCtrNotebook); + mCtrNotebook->SetPageImageIndex(0, SparkEdit::II_SIMSPARK); + // create toolbar mToolBar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY ); *************** *** 902,906 **** bool select = false; ! SparkEdit::GetEdit(fname, mCtrNotebook, select); UpdateCached(); --- 904,909 ---- bool select = false; ! SparkEdit::SetStartScript(mCtrNotebook, SparkEdit::GetEdit(fname, mCtrNotebook, select)); ! UpdateCached(); |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:11:40
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21173 Modified Files: Tag: RSGEDIT_SCINTILLA sparkedit.cpp sparkedit.h Log Message: - add the concept of a start script; associate a special icon - associate an icon with each edit control Index: sparkedit.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.cpp,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** sparkedit.cpp 23 Jun 2007 07:28:04 -0000 1.1.2.7 --- sparkedit.cpp 23 Jun 2007 09:11:36 -0000 1.1.2.8 *************** *** 22,29 **** --- 22,36 ---- #include <wx/filename.h> + #include <rsgedit/res/xpm_play.xpm> + #include <rsgedit/res/xpm_spark.xpm> + #include <rsgedit/res/xpm_ruby.xpm> + #include <rsgedit/res/xpm_rsg.xpm> + static wxColour COL_COMMENT(0,128,0); static wxColour COL_KEYWORD(0,0,255); SparkEdit::TEditMap SparkEdit::mEditMap; + wxFlatNotebookImageList SparkEdit::mNotebookImgList; + wxScintilla* SparkEdit::mStartScript = 0; wxScintilla* SparkEdit::Create(wxWindow* parent) *************** *** 111,116 **** entry.page = static_cast<int>(notebook->GetPageCount() - 1); - mEditMap[edit] = entry; return edit; } --- 118,124 ---- entry.page = static_cast<int>(notebook->GetPageCount() - 1); mEditMap[edit] = entry; + + UpdateIcon(notebook, edit, entry); return edit; } *************** *** 226,232 **** --- 234,315 ---- } + if (edit == mStartScript) + { + mStartScript = 0; + } + mEditMap.erase(iter); } + int SparkEdit::GetImageIndex(const wxScintilla* edit, const EditEntry& entry) + { + if (edit == mStartScript) + { + return II_STARTSCRIPT; + } + + switch (entry.type) + { + default: + return -1; + + case ET_RB: + return II_RUBY; + + case ET_RSG: + return II_RSG; + } + } + + void SparkEdit::PrepareImageList(wxFlatNotebook* notebook) + { + if (notebook == 0) + { + assert(false); + return; + } + + mNotebookImgList.Clear(); + mNotebookImgList.Add(wxBitmap(xpm_spark)); // II_SIMSPARK + mNotebookImgList.Add(wxBitmap(xpm_play)); // II_STARTSCRIPT + mNotebookImgList.Add(wxBitmap(xpm_ruby)); // II_RUBY + mNotebookImgList.Add(wxBitmap(xpm_rsg)); // II_RSG + notebook->SetImageList(&mNotebookImgList); + } + + void SparkEdit::UpdateIcon(wxFlatNotebook* notebook, const wxScintilla* edit, const EditEntry& entry) + { + if ( + (notebook == 0) || + (edit == 0) + ) + { + assert(false); + return; + } + + notebook->SetPageImageIndex(entry.page, GetImageIndex(edit, entry)); + } + + void SparkEdit::UpdateIcons(wxFlatNotebook* notebook) + { + if (notebook == 0) + { + assert(false); + return; + } + + for ( + TEditMap::const_iterator iter = mEditMap.begin(); + iter != mEditMap.end(); + ++iter + ) + { + const EditEntry& entry = (*iter).second; + const wxScintilla* edit = (*iter).first; + UpdateIcon(notebook, edit, entry); + } + } + void SparkEdit::UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit) { *************** *** 258,259 **** --- 341,348 ---- edit->SaveFile(entry.fname); } + + void SparkEdit::SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit) + { + mStartScript = edit; + UpdateIcons(notebook); + } Index: sparkedit.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/sparkedit.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** sparkedit.h 21 Jun 2007 19:26:38 -0000 1.1.2.4 --- sparkedit.h 23 Jun 2007 09:11:36 -0000 1.1.2.5 *************** *** 38,46 **** --- 38,62 ---- }; + enum EImgIndex + { + II_NONE = -1, + II_SIMSPARK = 0, + II_STARTSCRIPT, + II_RUBY, + II_RSG + }; + struct EditEntry { + public: EEditType type; wxString fname; int page; + + public: + EditEntry() + : type(ET_RSG), page(-1) + { + } }; *************** *** 51,55 **** --- 67,74 ---- static void PutEdit(wxScintilla* edit); static void UpdateTitle(wxFlatNotebook* notebook, wxScintilla* edit); + static void UpdateIcons(wxFlatNotebook* notebook); static void SaveFile(wxScintilla* edit); + static void SetStartScript(wxFlatNotebook* notebook, wxScintilla* edit); + static void PrepareImageList(wxFlatNotebook* notebook); protected: *************** *** 59,64 **** --- 78,90 ---- static wxString GetTitle(wxScintilla* edit, const EditEntry& entry); + static void UpdateIcon(wxFlatNotebook* notebook, const wxScintilla* edit, const EditEntry& entry); + static int GetImageIndex(const wxScintilla* edit, const EditEntry& entry); + protected: static TEditMap mEditMap; + static wxFlatNotebookImageList mNotebookImgList; + + //! the editor holding the simulation start script + static wxScintilla* mStartScript; }; |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:08:03
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19583 Added Files: Tag: RSGEDIT_SCINTILLA xpm_spark.xpm Log Message: - added simspark icon --- NEW FILE: xpm_spark.xpm --- /* XPM */ static char *xpm_spark[] = { /* columns rows colors chars-per-pixel */ "16 16 102 2", "a c #F7F7F6", "e c #A8B29F", "[ c #FFA33B", "` c #9CA791", "m c #728162", "$ c #3A3C3B", "z c #FAFBFA", "G c #D0D5CB", "# c #FFFFFF", "X c #767876", "N c #7B7C7C", "( c #FFF9F2", "9 c #B2B4B1", "i c #2E312C", "$. c #656962", "| c #EEF0EC", "O c #333532", "c c #F3F4F1", "g c #7F8D71", "= c #AEB7A5", "] c #FFDEB9", "E c #6E7E5E", "k c #9DA892", "% c #D1D6CC", "x c #7C7D7D", "O. c #2A2E28", "& c #EAEDE8", "_ c #EFF1ED", "} c #343633", "Z c #7B8A6C", "j c #70726F", "q c #808E72", "L c #859277", "Q c #CDD3C8", "S c #A3AD99", "K c #88967C", "I c #2B2F29", "P c #929E86", "F c #6C6F6B", "+. c #A8ABA4", "d c #818F74", "R c #B0B9A8", "#. c #292C25", "; c #E9EBE6", "V c #708061", "o. c #EEE9DD", "B c #DDE0D9", "{ c #FFE0BD", "t c #939F88", "3 c #C2C9BB", ". c #313430", "D c #98A38D", "J c #9DA792", "8 c #F6F7F5", "> c #3B3C3B", "4 c #FBFBFA", "r c #829074", "5 c #B1BAA8", "v c #879479", "2 c #BBC2B3", "! c #EAECE8", "A c #718162", "h c #D4D9CF", "u c #7B896D", "' c #AAB3A1", "/ c #FFBC71", ".. c #FFB968", "X. c #FFB96A", "o c #7F8080", "l c #94A088", ": c #F7F8F6", "f c #88957B", "M c #C1C7BA", "y c #A1AC97", "0 c #F0F1EE", ", c #D5DAD0", "n c #7C8A6E", "H c #DFE2DB", " . c #FFF7EE", "6 c #667755", "< c #667756", " c None", "@. c #F8F9F8", "w c #9FA995", "p c #FDFDFD", "T c #ABAEA8", "^ c #FEBA6E", "s c #89967C", ") c #2C2F29", "+ c #B5B6B4", "C c #ECEEEA", "1 c #788769", "W c #A7B19E", "Y c #677856", "* c #F9FAF8", "- c #A0AA96", "@ c #FEFEFE", "%. c #757775", "7 c #859378", "~ c #CFCEBB", "b c #8F9B83", "U c #EDEFEB", /* pixels */ " . X o o X . ", " O + @ # # # # @ + O ", " $ % & # # # * = - ; : > ", " . , < 1 2 3 4 5 6 6 7 # 8 . ", " 9 0 q w e r t y 6 6 u # # 9 ", "i p # # a s 6 6 d f g h # # p i ", "j # # # k 6 6 6 6 l z # # # # j ", "x # c v b n 6 6 6 m M # # # # x ", "N # B 6 V C Z 6 A S D # # # # N ", "F # # G H J K L P r & # # # # F ", "I 4 # @ U Y Y U r 6 G # # # 4 I ", " T # R E W Q # ! ~ ^ / ( # T ", " ) _ p ` ' # # # ] [ [ { _ ) ", " } | p 0 # # # ...X.o.} ", " O.+.@.# # # # @.+.O. ", " #.$.%.%.$.#. " }; |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:07:39
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19559 Added Files: Tag: RSGEDIT_SCINTILLA xpm_ruby.xpm Log Message: - added ruby file icon --- NEW FILE: xpm_ruby.xpm --- /* XPM */ static char *xpm_ruby[] = { /* columns rows colors chars-per-pixel */ "16 16 13 1", "X c #C02040", " c None", "@ c #C04040", "o c #E02040", "O c #E04040", "& c #FFFBF0", "$ c #E08080", "= c #800000", "% c #C0C0C0", "* c #A02000", "# c #C02000", ". c #A02040", "+ c #C00040", /* pixels */ " ", " ", " . ", " XoO ", " .X+++ ", " @o#### ", " $%X#### ", " &&O#### ", " $$ $#*#* ", " @O$$X++# ", " O+O$O+## ", " =+#o$O### ", " =**+OXX#* ", " ", " ", " " }; |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:07:14
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19490 Added Files: Tag: RSGEDIT_SCINTILLA xpm_rsg.xpm Log Message: - added rsg file icon --- NEW FILE: xpm_rsg.xpm --- /* XPM */ static char *xpm_rsg[] = { /* columns rows colors chars-per-pixel */ "16 16 10 1", "o c Black", " c None", "@ c #008000", "+ c #FFFF00", ". c #004080", "X c #00FFFF", "$ c #800000", "% c #FF0000", "O c #808000", "# c #00FF00", /* pixels */ " ... ", " ... ", " .X. ", " ... ", " o ", " o OOO ", " oooO+O ", " o OOO ", " o o ", " o o @@@ ", " o ooo@#@ ", " o o @@@ ", " o o ", " $$$ o @@@ ", " $%$ ooo@#@ ", " $$$ @@@ " }; |
|
From: Markus R. <rol...@us...> - 2007-06-23 09:05:21
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18725 Modified Files: Tag: RSGEDIT_SCINTILLA xpm_pause.xpm xpm_play.xpm xpm_step.xpm Log Message: - fix transparency Index: xpm_pause.xpm =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/res/xpm_pause.xpm,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** xpm_pause.xpm 8 Jan 2006 14:15:27 -0000 1.1 --- xpm_pause.xpm 23 Jun 2007 09:05:17 -0000 1.1.8.1 *************** *** 3,7 **** /* columns rows colors chars-per-pixel */ "16 16 2 1", ! " c gray100", ". c black", /* pixels */ --- 3,7 ---- /* columns rows colors chars-per-pixel */ "16 16 2 1", ! " c None", ". c black", /* pixels */ Index: xpm_step.xpm =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/res/xpm_step.xpm,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** xpm_step.xpm 15 Jun 2007 09:44:57 -0000 1.1 --- xpm_step.xpm 23 Jun 2007 09:05:18 -0000 1.1.2.1 *************** *** 4,8 **** "16 16 2 1", ". c Black", ! " c #FFFFFF", /* pixels */ " ", --- 4,8 ---- "16 16 2 1", ". c Black", ! " c None", /* pixels */ " ", Index: xpm_play.xpm =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/res/xpm_play.xpm,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** xpm_play.xpm 8 Jan 2006 14:15:27 -0000 1.1 --- xpm_play.xpm 23 Jun 2007 09:05:18 -0000 1.1.8.1 *************** *** 3,7 **** /* columns rows colors chars-per-pixel */ "16 16 2 1", ! " c gray100", ". c black", /* pixels */ --- 3,7 ---- /* columns rows colors chars-per-pixel */ "16 16 2 1", ! " c None", ". c black", /* pixels */ |