Browse files

Merge branch 'master' of git://github.com/etexteditor/e

  • Loading branch information...
2 parents bd190cb + 7f3635c commit f9c57dbf85e75643c1ec4318b6249740cfe0dcba @ajpalkovic ajpalkovic committed Oct 21, 2010
View
2 ecore/doc_byte_iter.h
@@ -35,7 +35,7 @@ class doc_byte_iter {
int compare(const unsigned char* string, int length) throw();
- bool operator==(void* nullptr) const throw() {return m_seg_ptr == (const unsigned char*)nullptr;};
+ bool operator==(void* aptr) const throw() {return m_seg_ptr == (const unsigned char*)aptr;};
bool operator<(int ndx) const throw() {return m_index < ndx;};
bool operator==(const doc_byte_iter& dbi) const throw() {return m_index == dbi.m_index;};
bool operator!=(const doc_byte_iter& dbi) const throw() {return m_index != dbi.m_index;};
View
2 external/get_externals_linux.sh
@@ -69,6 +69,8 @@ _extract_and_patch()
patch -Np0 -d webkit < patches/webkit/vis_hidden.patch
patch -Np1 -d webkit < patches/webkit/cancelledError.patch
patch -Np1 -d webkit < patches/webkit/local_sec.patch
+ patch -Np1 -d webkit < patches/webkit/icu-fix-56345.diff
+ patch -Np1 -d webkit < patches/webkit/wxtimerfix-gcc-4.5.diff
}
_next_steps()
View
93 external/patches/webkit/icu-fix-56345.diff
@@ -0,0 +1,93 @@
+--- WebKit-r43163/WebCore/platform/text/TextBreakIteratorICU.cpp 2009-04-30 04:04:21.000000000 +0400
++++ webkit/WebCore/platform/text/TextBreakIteratorICU.cpp 2010-10-18 11:51:16.993000240 +0400
+@@ -24,7 +24,6 @@
+
+ #include "PlatformString.h"
+ #include "TextBreakIteratorInternalICU.h"
+-
+ #include <unicode/ubrk.h>
+ #include <wtf/Assertions.h>
+
+@@ -38,7 +37,7 @@ static TextBreakIterator* setUpIterator(
+
+ if (!createdIterator) {
+ UErrorCode openStatus = U_ZERO_ERROR;
+- iterator = static_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
++ iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
+ createdIterator = true;
+ ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
+ }
+@@ -46,7 +45,7 @@ static TextBreakIterator* setUpIterator(
+ return 0;
+
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+- ubrk_setText(iterator, string, length, &setTextStatus);
++ ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
+ if (U_FAILURE(setTextStatus))
+ return 0;
+
+@@ -85,34 +84,34 @@ TextBreakIterator* sentenceBreakIterator
+ staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
+ }
+
+-int textBreakFirst(TextBreakIterator* bi)
++int textBreakFirst(TextBreakIterator* iterator)
+ {
+- return ubrk_first(bi);
++ return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator));
+ }
+
+-int textBreakNext(TextBreakIterator* bi)
++int textBreakNext(TextBreakIterator* iterator)
+ {
+- return ubrk_next(bi);
++ return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator));
+ }
+
+-int textBreakPreceding(TextBreakIterator* bi, int pos)
++int textBreakPreceding(TextBreakIterator* iterator, int pos)
+ {
+- return ubrk_preceding(bi, pos);
++ return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos);
+ }
+
+-int textBreakFollowing(TextBreakIterator* bi, int pos)
++int textBreakFollowing(TextBreakIterator* iterator, int pos)
+ {
+- return ubrk_following(bi, pos);
++ return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos);
+ }
+
+-int textBreakCurrent(TextBreakIterator* bi)
++int textBreakCurrent(TextBreakIterator* iterator)
+ {
+- return ubrk_current(bi);
++ return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator));
+ }
+
+-bool isTextBreak(TextBreakIterator* bi, int pos)
++bool isTextBreak(TextBreakIterator* iterator, int pos)
+ {
+- return ubrk_isBoundary(bi, pos);
++ return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), pos);
+ }
+
+ #ifndef BUILDING_ON_TIGER
+@@ -126,7 +125,7 @@ static TextBreakIterator* setUpIteratorW
+ UParseError parseStatus;
+ UErrorCode openStatus = U_ZERO_ERROR;
+ String rules(breakRules);
+- iterator = static_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
++ iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
+ createdIterator = true;
+ ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
+ }
+@@ -134,7 +133,7 @@ static TextBreakIterator* setUpIteratorW
+ return 0;
+
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+- ubrk_setText(iterator, string, length, &setTextStatus);
++ ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
+ if (U_FAILURE(setTextStatus))
+ return 0;
+
View
13 external/patches/webkit/wxtimerfix-gcc-4.5.diff
@@ -0,0 +1,13 @@
+--- webkit/WebCore/platform/wx/SharedTimerWx.cpp.orig 2010-10-18 12:56:48.170000242 +0400
++++ webkit/WebCore/platform/wx/SharedTimerWx.cpp 2010-10-18 12:57:03.796000241 +0400
+@@ -47,9 +47,8 @@ class WebKitTimer: public wxTimer
+ virtual void Notify();
+ };
+
+-WebKitTimer::WebKitTimer()
++WebKitTimer::WebKitTimer() : wxTimer()
+ {
+- wxTimer::wxTimer();
+ }
+
+ WebKitTimer::~WebKitTimer()
View
4 src/ApiHandler.cpp
@@ -77,7 +77,7 @@ void ApiHandler::OnIpcCall(wxCommandEvent& event) {
const string& m = call->GetMethod();
const wxString method(m.c_str(), wxConvUTF8, m.size());
- wxLogDebug(wxT("IPC: %s"), method);
+ wxLogDebug(wxT("IPC: %s"), method.c_str());
// Call the function (if it exists)
bool methodFound = true;
@@ -194,7 +194,7 @@ void ApiHandler::OnIpcClosed(wxCommandEvent& event) {
// Remove all notifiers from closed connection
map<unsigned int, IConnection*>::iterator p = m_notifiers.begin();
while (p != m_notifiers.end()) {
- if (p->second == conn) p = m_notifiers.erase(p);
+ if (p->second == conn) m_notifiers.erase(p++);
else ++p;
}
View
2 src/BundleMenu.cpp
@@ -15,7 +15,9 @@
#include "tmAction.h"
#ifdef __WXGTK__
+#define GSocket GlibGSocket
#include <gtk/gtk.h>
+#undef GSocket
void BundleMenuItem::AfterInsert(void) {
GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
View
4 src/CommandPanel.h
@@ -17,6 +17,8 @@
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include <wx/panel.h>
+#include <wx/textctrl.h>
+#include <wx/stattext.h>
#include <wx/string.h>
#endif
@@ -46,4 +48,4 @@ class CommandPanel : public wxPanel {
size_t m_selectionCount;
};
-#endif //__COMMANDPANEL_H__
+#endif //__COMMANDPANEL_H__
View
4 src/DiffBar.cpp
@@ -299,7 +299,7 @@ void DiffBar::OnMouseMotion(wxMouseEvent& evt) {
const unsigned int rightBracket = size.x - s_bracketWidth;
int highlight = -1;
- if (mpos.x <= s_bracketWidth) {
+ if (mpos.x <= (int)s_bracketWidth) {
std::vector<LineMatch>::const_iterator p = OnLeftBracket(mpos.y);
if( p != m_lineMatches.end()) highlight = p->left_start;
}
@@ -318,7 +318,7 @@ void DiffBar::OnMouseLeftUp(wxMouseEvent& evt) {
const wxSize size = GetClientSize();
const wxPoint mpos = evt.GetPosition();
- if (mpos.x <= s_bracketWidth) {
+ if (mpos.x <= (int)s_bracketWidth) {
// Have we clicked a bracket?
std::vector<LineMatch>::const_iterator p = OnLeftBracket(mpos.y);
if (p == m_lineMatches.end()) return;
View
24 src/DiffDirPane.cpp
@@ -32,18 +32,18 @@ enum {
WX_DECLARE_STRING_HASH_MAP( wxTreeItemId, NameToTreeIdHash );
BEGIN_EVENT_TABLE(DiffDirPane, wxPanel)
- EVT_TREE_ITEM_GETTOOLTIP(ID_DIFFTREE, OnTreeGetToolTip)
- EVT_TREE_ITEM_MENU(ID_DIFFTREE, OnTreeMenu)
- EVT_TREE_ITEM_ACTIVATED(ID_DIFFTREE, OnTreeActivated)
- EVT_TREE_ITEM_EXPANDING(ID_DIFFTREE, OnTreeExpanding)
- EVT_MENU(ID_MENU_COMPARE, OnMenuCompare)
- EVT_MENU(ID_MENU_OPEN, OnMenuOpen)
- EVT_MENU(ID_MENU_OPENLEFT, OnMenuOpenLeft)
- EVT_MENU(ID_MENU_OPENRIGHT, OnMenuOpenRight)
- EVT_MENU(ID_MENU_COPYLEFT, OnMenuCopyToLeft)
- EVT_MENU(ID_MENU_COPYRIGHT, OnMenuCopyToRight)
- EVT_MENU(ID_MENU_DELLEFT, OnMenuDelLeft)
- EVT_MENU(ID_MENU_DELRIGHT, OnMenuDelRight)
+ EVT_TREE_ITEM_GETTOOLTIP(ID_DIFFTREE, DiffDirPane::OnTreeGetToolTip)
+ EVT_TREE_ITEM_MENU(ID_DIFFTREE, DiffDirPane::OnTreeMenu)
+ EVT_TREE_ITEM_ACTIVATED(ID_DIFFTREE, DiffDirPane::OnTreeActivated)
+ EVT_TREE_ITEM_EXPANDING(ID_DIFFTREE, DiffDirPane::OnTreeExpanding)
+ EVT_MENU(ID_MENU_COMPARE, DiffDirPane::OnMenuCompare)
+ EVT_MENU(ID_MENU_OPEN, DiffDirPane::OnMenuOpen)
+ EVT_MENU(ID_MENU_OPENLEFT, DiffDirPane::OnMenuOpenLeft)
+ EVT_MENU(ID_MENU_OPENRIGHT, DiffDirPane::OnMenuOpenRight)
+ EVT_MENU(ID_MENU_COPYLEFT, DiffDirPane::OnMenuCopyToLeft)
+ EVT_MENU(ID_MENU_COPYRIGHT, DiffDirPane::OnMenuCopyToRight)
+ EVT_MENU(ID_MENU_DELLEFT, DiffDirPane::OnMenuDelLeft)
+ EVT_MENU(ID_MENU_DELRIGHT, DiffDirPane::OnMenuDelRight)
END_EVENT_TABLE()
DiffDirPane::DiffDirPane(EditorFrame& parent)
View
3 src/DiffDirPane.h
@@ -19,6 +19,7 @@
#include <wx/wx.h>
#endif
#include <wx/treectrl.h>
+#include <wx/imaglist.h>
WX_DECLARE_STRING_HASH_MAP( int, IconHash );
@@ -81,4 +82,4 @@ class DiffDirPane : public wxPanel {
wxTreeItemId m_menuItem;
};
-#endif //__DIFFDIRPANE_H__
+#endif //__DIFFDIRPANE_H__
View
2 src/Document.cpp
@@ -1342,7 +1342,7 @@ search_result Document::RegExFind(const pcre* re, const pcre_extra* study, int s
// Copy match info from ovector to result struct
sr.error_code = rc;
if (rc >= 0) {
- wxASSERT(ovector[0] >= 0 && ovector[1] <= (int)GetLength());
+ wxASSERT(ovector[0] >= 0 && ovector[0] <= (int)GetLength());
wxASSERT(ovector[1] >= ovector[0] && ovector[1] <= (int)GetLength());
sr.start = ovector[0];
sr.end = ovector[1];
View
11 src/EditorCtrl.cpp
@@ -358,7 +358,7 @@ void EditorCtrl::RestoreSettings(unsigned int page_id, eFrameSettings& settings,
vector<unsigned int> bookmarks;
// Retrieve the page info
- wxASSERT(0 <= page_id && page_id < (int)settings.GetPageCount());
+ wxASSERT(0 <= page_id && page_id < settings.GetPageCount());
settings.GetPageSettings(page_id, mirrorPath, di, newpos, topline, syntax, folds, bookmarks, (SubPage)subid);
if (eDocumentPath::IsRemotePath(mirrorPath)) {
@@ -3032,7 +3032,7 @@ bool EditorCtrl::SaveText(bool askforpath) {
if (askforpath || newpath.empty()) {
wxFileDialog dlg(this, _T("Save as..."), _T(""), _T(""), EditorFrame::DefaultFileFilters, wxSAVE|wxCHANGE_DIR);
- dlg.SetPath( newpath.empty() ? _("Untitled") : newpath );
+ dlg.SetPath( newpath.empty() ? wxString(_("Untitled")) : newpath );
dlg.Centre();
if (dlg.ShowModal() != wxID_OK) return false;
@@ -3633,7 +3633,7 @@ void EditorCtrl::DeleteSelections() {
interval& r = m_searchRanges[i];
if (end <= r.end) {
// Adjust cursor
- size_t& c = m_cursors[i];
+ unsigned int& c = m_cursors[i];
if (c == end) c = start;
else if (c > end) c -= len;
@@ -5019,7 +5019,8 @@ void EditorCtrl::AddSelection(unsigned int start, unsigned int end, bool allowEm
// The positions may come from unverified input
// So we have to make sure they are valid
cxLOCKDOC_READ(m_doc)
- start = doc.GetValidCharPos(start);
+ if (start > doc.GetLength()) start = doc.GetLength();
+ else if (start != doc.GetLength()) start = doc.GetValidCharPos(start);
if (end > doc.GetLength()) end = doc.GetLength();
else if (end != doc.GetLength()) end = doc.GetValidCharPos(end);
cxENDLOCK
@@ -10205,7 +10206,7 @@ wxVariant EditorCtrl::PlayCommand(const eMacroCmd& cmd) {
m_syntaxHandler.DoBundleAction(uuid, *this);
}
- else return wxVariant(NULL, wxT("Unknown method"));
+ else return wxVariant((wxVariantData*)NULL, wxT("Unknown method"));
return wxVariant();
}
View
8 src/EditorFrame.cpp
@@ -3071,7 +3071,7 @@ void EditorFrame::UpdateRecentFiles() {
for (unsigned int i = 0; i < m_recentFiles.GetCount(); i++) {
wxString filename = m_recentFiles[i];
if (i < 9)
- filename = wxString::Format(wxT("&%d %s"), i+1, filename);
+ filename = wxString::Format(wxT("&%d %s"), i+1, filename.c_str());
m_recentFilesMenu->Append(4000 + i, filename);
}
@@ -3082,7 +3082,7 @@ void EditorFrame::UpdateRecentFiles() {
for (unsigned int i = 0; i < m_recentProjects.GetCount(); i++) {
wxString filename = m_recentProjects[i];
if (i < 9)
- filename = wxString::Format(wxT("&%d %s"), i+1, filename);
+ filename = wxString::Format(wxT("&%d %s"), i+1, filename.c_str());
m_recentProjectsMenu->Append(4100 + i, filename);
}
@@ -4134,7 +4134,7 @@ void EditorFrame::OnDocChange(EditorFrame* self, void* data, int WXUNUSED(filter
void EditorFrame::OnOpenDoc(EditorFrame* self, void* data, int WXUNUSED(filter)) {
if (!self->editorCtrl) return;
- const uintptr_t docId = (uintptr_t)data;
+ const wxUIntPtr docId = (wxUIntPtr)data;
const doc_id di(DOCUMENT, docId, 0);
// If current doc is same just keep it
@@ -4229,4 +4229,4 @@ bool EditorFrame::HandleChord(wxKeyEvent& event) {
void EditorFrame::OnMenuCustomizeAccelerators(wxCommandEvent& WXUNUSED(event)) {
(AcceleratorsDialog(this)).ShowModal();
-}
+}
View
1 src/Env.cpp
@@ -4,6 +4,7 @@
#include <wx/filename.h>
#include <wx/file.h>
+#include <wx/utils.h>
void cxEnv::SetEnv(const wxString& key, const wxString& value) {
wxASSERT(!key.empty());
View
4 src/FixedLine.cpp
@@ -33,10 +33,10 @@ FixedLine::FixedLine(wxDC& dc, const DocumentWrapper& dw, const vector<interval>
m_tabChars(4),
lastpos(lastpos),
m_isSelShadow(isShadow),
- selections(sel),
m_brackets(brackets),
m_theme(theme),
m_sr(m_theme, (FastDC&)dc),
+ selections(sel),
m_wrapMode(cxWRAP_NONE),
m_showIndent(false),
m_indentWidth(0),
@@ -1106,4 +1106,4 @@ bool FixedLine::StylersOnIdle() {
ret = m_stylers[c]->OnIdle() || ret;
}
return ret;
-}
+}
View
4 src/GotoFileDlg.cpp
@@ -44,8 +44,8 @@ class DirState {
}
DirState(const wxString& path):
- walkingFiles(false),
- prefix(path + wxFILE_SEP_PATH)
+ prefix(path + wxFILE_SEP_PATH),
+ walkingFiles(false)
{
dir.Open(path);
}
View
62 src/InputPanel.cpp
@@ -0,0 +1,62 @@
+#include "InputPanel.h"
+#include "CloseButton.h"
+#include "EditorFrame.h"
+#include "EditorCtrl.h"
+
+// Ctrl id's
+enum {
+ INPUTP_CLOSE = 100,
+ INPUTP_BOX,
+};
+
+BEGIN_EVENT_TABLE(InputPanel, wxPanel)
+ EVT_BUTTON(INPUTP_CLOSE, InputPanel::OnCloseButton)
+END_EVENT_TABLE()
+
+InputPanel::InputPanel(EditorFrame& parentFrame, wxWindow* parent)
+: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxCLIP_CHILDREN|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE),
+ m_parentFrame(parentFrame) {
+ // Create the controls
+ CloseButton* closeButton = new CloseButton(this, INPUTP_CLOSE);
+ m_caption = new wxStaticText(this, wxID_ANY, _("Input: "));
+ m_inputbox = new wxTextCtrl(this, INPUTP_BOX, wxEmptyString, wxDefaultPosition, wxDefaultSize);
+
+ m_inputbox->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(InputPanel::OnInputChanged), NULL, this);
+ m_inputbox->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(InputPanel::OnInputEnter), NULL, this);
+
+ // Create the sizer layout
+ wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
+ sizer->AddSpacer(5);
+ sizer->Add(closeButton, 0, wxALIGN_CENTER|wxRIGHT, 2);
+ sizer->Add(m_caption, 0, wxALIGN_CENTER);
+ sizer->Add(m_inputbox, 3, wxALIGN_CENTER|wxEXPAND|wxTOP|wxBOTTOM, 2);
+ sizer->AddSpacer(5);
+
+ SetSizer(sizer);
+
+ // Set the correct size
+ const wxSize minsize = sizer->GetMinSize();
+ SetSize(minsize);
+
+ // Make sure sizes get the right min/max sizes
+ SetSizeHints(minsize.x, minsize.y, -1, minsize.y);
+}
+
+void InputPanel::Set(unsigned int notifier_id, const wxString& cmd) {
+ m_notifier_id = notifier_id;
+ m_caption->SetLabel(cmd);
+ m_inputbox->Clear();
+}
+
+void InputPanel::OnInputChanged(wxCommandEvent& evt) {
+ m_parentFrame.OnInputPanelChanged(m_notifier_id, evt.GetString());
+ evt.Skip();
+}
+
+void InputPanel::OnInputEnter(wxCommandEvent& WXUNUSED(evt)) {
+ m_parentFrame.HideInputPanel();
+}
+
+void InputPanel::OnCloseButton(wxCommandEvent& WXUNUSED(evt)) {
+ m_parentFrame.HideInputPanel();
+}
View
52 src/InputPanel.h
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ *
+ * Copyright (C) 2009, Alexander Stigsen, e-texteditor.com
+ *
+ * This software is licensed under the Open Company License as described
+ * in the file license.txt, which you should have received as part of this
+ * distribution. The terms are also available at http://opencompany.org/license.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ******************************************************************************/
+
+#ifndef __INPUTPANEL_H__
+#define __INPUTPANEL_H__
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+#include <wx/panel.h>
+#include <wx/textctrl.h>
+#include <wx/stattext.h>
+#include <wx/string.h>
+#endif
+
+// pre-definitions
+class EditorFrame;
+
+class InputPanel : public wxPanel {
+public:
+ InputPanel(EditorFrame& parentFrame, wxWindow* parent);
+ ~InputPanel() {};
+
+ void Set(unsigned int notifier_id, const wxString& cmd);
+ unsigned int GetNotifierId() const {return m_notifier_id;};
+
+private:
+ // Event handlers
+ void OnCloseButton(wxCommandEvent& evt);
+ void OnInputChanged(wxCommandEvent& evt);
+ void OnInputEnter(wxCommandEvent& evt);
+ DECLARE_EVENT_TABLE();
+
+ // Member Ctrls
+ wxTextCtrl* m_inputbox;
+ wxStaticText* m_caption;
+
+ // Member variables
+ EditorFrame& m_parentFrame;
+ unsigned int m_notifier_id;
+};
+
+#endif //__INPUTPANEL_H
View
28 src/Macro.h
@@ -46,29 +46,29 @@ class eMacroCmd {
const wxString& GetName() const {return m_cmd;};
size_t GetArgCount() const {return m_args.size();};
- const wxString& GetArgName(size_t ndx) const {return (ndx < m_argNames.size()) ? m_argNames[ndx] : wxEmptyString;};
+ const wxString& GetArgName(size_t ndx) const {return (ndx < m_argNames.size()) ? m_argNames[ndx] : wxGetEmptyString();};
const wxVariant& GetArg(size_t ndx) const {return m_args[ndx];};
wxVariant& GetArg(size_t ndx) {return m_args[ndx];};
const std::vector<wxVariant>& GetArgs() const {return m_args;};
- bool GetArgBool(size_t ndx, bool default=false) const {
- if (ndx >= m_args.size()) return default;
+ bool GetArgBool(size_t ndx, bool dflt=false) const {
+ if (ndx >= m_args.size()) return dflt;
const wxVariant& value = m_args[ndx];
- if (!value.IsType(_("bool"))) return default;
+ if (!value.IsType(_("bool"))) return dflt;
return value.GetBool();
}
- int GetArgInt(size_t ndx, int default=0) const {
- if (ndx >= m_args.size()) return default;
+ int GetArgInt(size_t ndx, int dflt=0) const {
+ if (ndx >= m_args.size()) return dflt;
const wxVariant& value = m_args[ndx];
- if (!value.IsType(_("long"))) return default;
+ if (!value.IsType(_("long"))) return dflt;
return value.GetLong();
}
- wxString GetArgString(size_t ndx, const wxString& default=wxEmptyString) const {
- if (ndx >= m_args.size()) return default;
+ wxString GetArgString(size_t ndx, const wxString& dflt=wxEmptyString) const {
+ if (ndx >= m_args.size()) return dflt;
const wxVariant& value = m_args[ndx];
- if (!value.IsType(_("string"))) return default;
+ if (!value.IsType(_("string"))) return dflt;
return value.GetString();
}
@@ -122,18 +122,18 @@ class eMacro {
const eMacroCmd& GetCommand(size_t ndx) const {return m_cmds[ndx];};
eMacroCmd& GetCommand(size_t ndx) {m_isModified = true; return m_cmds[ndx];};
- const eMacroCmd& Last() const {m_cmds.back();};
+ const void Last() const {m_cmds.back();};
eMacroCmd& Last() {m_isModified = true; return m_cmds.back();};
eMacroCmd& Add(const wxString& cmd) {
- wxLogDebug(wxT("Adding macro: %s"), cmd);
+ wxLogDebug(wxT("Adding macro: %s"), cmd.c_str());
m_cmds.push_back(new eMacroCmd(cmd));
m_isModified = true;
return m_cmds.back();
};
template<class T> eMacroCmd& Add(const wxString& cmd, const wxString& arg, T value) {
- wxLogDebug(wxT("Adding macro: %s"), cmd);
+ wxLogDebug(wxT("Adding macro: %s"), cmd.c_str());
m_cmds.push_back(new eMacroCmd(cmd));
m_cmds.back().AddArg(arg, value);
m_isModified = true;
@@ -149,4 +149,4 @@ class eMacro {
boost::ptr_vector<eMacroCmd> m_cmds;
};
-#endif //__EMACRO_H__
+#endif //__EMACRO_H__
View
6 src/Makefile
@@ -1,8 +1,8 @@
VERBOSE=0
DEBUG=0
-VERSION=1.0
-RELEASE=31
+VERSION=2.0
+RELEASE=1
ROOTDIR=..
ifeq ($(VERBOSE),0)
@@ -46,7 +46,7 @@ WXINCLUDES = $(shell $(EXT_DIR)/bin/wx-config --cppflags)
GTKINCLUDES = $(shell pkg-config --cflags gtk+-2.0 cairo pango atk glib-2.0)
-OURINCLUDES = -I$(EXT_DIR)/include
+OURINCLUDES = -I$(EXT_DIR)/include -I$(ROOTDIR)/external/pcre/
INCLUDES = $(WXINCLUDES) $(OURINCLUDES) $(GTKINCLUDES) -I$(ROOTDIR)/ecore -I.
View
4 src/MiniVersion.cpp
@@ -235,7 +235,7 @@ BOOL CMiniVersion::GetFixedInfo(VS_FIXEDFILEINFO& rFixedInfo)
///////////////////////////////////////////////////////////////////////////////
// GetStringInfo
-BOOL CMiniVersion::GetStringInfo(LPCSTR lpszKey, LPTSTR lpszReturnValue)
+BOOL CMiniVersion::GetStringInfo(LPCTSTR lpszKey, LPTSTR lpszReturnValue)
{
BOOL rc;
DWORD *pdwTranslation;
@@ -258,7 +258,7 @@ BOOL CMiniVersion::GetStringInfo(LPCSTR lpszKey, LPTSTR lpszReturnValue)
if (!rc)
return FALSE;
- char szKey[2000];
+ TCHAR szKey[2000];
wsprintf(szKey, _T("\\StringFileInfo\\%04x%04x\\%s"),
LOWORD (*pdwTranslation), HIWORD (*pdwTranslation),
lpszKey);
View
2 src/ProjectPane.cpp
@@ -1232,7 +1232,9 @@ void ProjectPane::OnTreeContextMenu(wxTreeEvent& event) {
wxTreeItemId item = event.GetItem();
if (!item) return;
+#ifdef __WXMSW__
bool showExtendedItems = wxGetKeyState(WXK_SHIFT);
+#endif
// Get the path of the item clicked
const DirItemData *data = (DirItemData*)m_prjTree->GetItemData(item);
View
24 src/ProjectSettings.cpp
@@ -100,16 +100,16 @@ ProjectSettings::ProjectSettings(wxWindow* parent, const cxProjectInfo& project,
}
if (projectToLoad) {
- const wxString ind = wxJoin(projectToLoad->includeDirs, wxT('\n'), NULL);
+ const wxString ind = wxJoin(projectToLoad->includeDirs, wxT('\n'), wxT('\0'));
m_includeDirs->SetValue(ind);
- const wxString inf = wxJoin(projectToLoad->includeFiles, wxT('\n'), NULL);
+ const wxString inf = wxJoin(projectToLoad->includeFiles, wxT('\n'), wxT('\0'));
m_includeFiles->SetValue(inf);
- const wxString exd = wxJoin(projectToLoad->excludeDirs, wxT('\n'), NULL);
+ const wxString exd = wxJoin(projectToLoad->excludeDirs, wxT('\n'), wxT('\0'));
m_excludeDirs->SetValue(exd);
- const wxString exf = wxJoin(projectToLoad->excludeFiles, wxT('\n'), NULL);
+ const wxString exf = wxJoin(projectToLoad->excludeFiles, wxT('\n'), wxT('\0'));
m_excludeFiles->SetValue(exf);
}
@@ -142,10 +142,10 @@ void ProjectSettings::GetSettings(cxProjectInfo& project) const {
project.ClearFilters();
if (!m_inheritCheck->GetValue()) {
- const wxArrayString ind = wxSplit(m_includeDirs->GetValue(), wxT('\n'), NULL);
- const wxArrayString exd = wxSplit(m_excludeDirs->GetValue(), wxT('\n'), NULL);
- const wxArrayString inf = wxSplit(m_includeFiles->GetValue(), wxT('\n'), NULL);
- const wxArrayString exf = wxSplit(m_excludeFiles->GetValue(), wxT('\n'), NULL);
+ const wxArrayString ind = wxSplit(m_includeDirs->GetValue(), wxT('\n'), wxT('\0'));
+ const wxArrayString exd = wxSplit(m_excludeDirs->GetValue(), wxT('\n'), wxT('\0'));
+ const wxArrayString inf = wxSplit(m_includeFiles->GetValue(), wxT('\n'), wxT('\0'));
+ const wxArrayString exf = wxSplit(m_excludeFiles->GetValue(), wxT('\n'), wxT('\0'));
project.SetFilters(ind, exd, inf, exf);
}
@@ -158,16 +158,16 @@ void ProjectSettings::GetSettings(cxProjectInfo& project) const {
void ProjectSettings::OnInheritCheck(wxCommandEvent& event) {
if (event.IsChecked()) {
- const wxString ind = wxJoin(m_parentProject.includeDirs, wxT('\n'), NULL);
+ const wxString ind = wxJoin(m_parentProject.includeDirs, wxT('\n'), wxT('\0'));
m_includeDirs->SetValue(ind);
- const wxString inf = wxJoin(m_parentProject.includeFiles, wxT('\n'), NULL);
+ const wxString inf = wxJoin(m_parentProject.includeFiles, wxT('\n'), wxT('\0'));
m_includeFiles->SetValue(inf);
- const wxString exd = wxJoin(m_parentProject.excludeDirs, wxT('\n'), NULL);
+ const wxString exd = wxJoin(m_parentProject.excludeDirs, wxT('\n'), wxT('\0'));
m_excludeDirs->SetValue(exd);
- const wxString exf = wxJoin(m_parentProject.excludeFiles, wxT('\n'), NULL);
+ const wxString exf = wxJoin(m_parentProject.excludeFiles, wxT('\n'), wxT('\0'));
m_excludeFiles->SetValue(exf);
View
6 src/RemoteProfileDlg.cpp
@@ -239,13 +239,13 @@ void RemoteProfileDlg::OnButtonDelete(wxCommandEvent& WXUNUSED(event)) {
EnableSettings(false);
// Delete profile
- const uintptr_t profile_id = (uintptr_t)m_profileList->GetClientData(item);
+ const wxUIntPtr profile_id = (wxUIntPtr)m_profileList->GetClientData(item);
m_settings.DeleteRemoteProfile(profile_id);
m_profileList->Delete(item);
// Adjust subsequent profile id's
for (unsigned int i = 0; i < m_profileList->GetCount(); ++i) {
- const uintptr_t id = (uintptr_t)m_profileList->GetClientData(i);
+ const wxUIntPtr id = (wxUIntPtr)m_profileList->GetClientData(i);
if (id > profile_id) {
m_profileList->SetClientData(i, (void*)(id-1));
}
@@ -277,7 +277,7 @@ void RemoteProfileDlg::OnTextName(wxCommandEvent& event) {
}
void RemoteProfileDlg::OnProfileList(wxCommandEvent& event) {
- const uintptr_t profile_id = (uintptr_t)m_profileList->GetClientData(event.GetInt());
+ const wxUIntPtr profile_id = (wxUIntPtr)m_profileList->GetClientData(event.GetInt());
SetProfile(profile_id);
}
View
7 src/SearchPanel.cpp
@@ -69,9 +69,8 @@ END_EVENT_TABLE()
SearchPanel::SearchPanel(IFrameSearchService& searchService, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size):
wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL|wxCLIP_CHILDREN|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE),
- m_searchService(searchService),
- m_use_regex(false), m_match_case(false), m_highlight(true), restart_next_search(false), nosearch(false),
- m_settings(eGetSettings())
+ m_searchService(searchService), m_settings(eGetSettings()),
+ m_use_regex(false), m_match_case(false), m_highlight(true), restart_next_search(false), nosearch(false)
{
InitAcceleratorTable();
@@ -245,7 +244,7 @@ void SearchPanel::SetState(cxFindResult result, int resultCount) {
}
searchbox->Refresh();
- wxString results = (0 <= resultCount) ? wxString::Format(wxT("%d results"), resultCount) : wxEmptyString;
+ wxString results = (0 <= resultCount) ? wxString::Format(wxT("%d results"), resultCount) : wxGetEmptyString();
commandResults->SetLabel(results);
}
View
4 src/Strings.cpp
@@ -258,14 +258,14 @@ bool DetectTextEncoding(const char* buffer, size_t len, wxFontEncoding& encoding
}
// Detect UTF-32 by scanning for newlines (and lack of null chars)
- if ((uintptr_t)buff_ptr % 4 == 0 && buff_ptr+4 <= buff_end) {
+ if ((wxUIntPtr)buff_ptr % 4 == 0 && buff_ptr+4 <= buff_end) {
if (*((wxUint32*)buff_ptr) == 0) ++bad_utf32_count;
if (*((wxUint32*)buff_ptr) == wxUINT32_SWAP_ON_BE(0x0A)) ++nl_utf32le_count;
if (*((wxUint32*)buff_ptr) == wxUINT32_SWAP_ON_LE(0x0A)) ++nl_utf32be_count;
}
// Detect UTF-16 by scanning for newlines (and lack of null chars)
- if ((uintptr_t)buff_ptr % 2 == 0 && buff_ptr+4 <= buff_end) {
+ if ((wxUIntPtr)buff_ptr % 2 == 0 && buff_ptr+4 <= buff_end) {
if (*((wxUint16*)buff_ptr) == 0) ++bad_utf16_count;
if (*((wxUint16*)buff_ptr) == wxUINT16_SWAP_ON_BE(0x0A)) ++nl_utf16le_count;
if (*((wxUint16*)buff_ptr) == wxUINT16_SWAP_ON_LE(0x0A)) ++nl_utf16be_count;
View
4 src/WebKitHtmlWnd.cpp
@@ -19,7 +19,9 @@ BEGIN_EVENT_TABLE(wxBrowser, wxWebView)
EVT_WEBVIEW_BEFORE_LOAD(wxID_ANY, wxBrowser::OnBeforeLoad)
END_EVENT_TABLE()
-wxBrowser::wxBrowser(wxWindow *parent, wxWindowID id) : wxWebView(parent, id), m_realLocation(wxT("")) {
+wxBrowser::wxBrowser(wxWindow *parent, wxWindowID id, const wxPoint& point, const wxSize& size) :
+ wxWebView(parent, id, point, size), m_realLocation(wxT(""))
+{
/* force JSC threading initialization until Webkit fix this */
wxWebView::SetPageSource(wxT("<html><head /><body /></html>"));
}
View
5 src/WebKitHtmlWnd.h
@@ -22,10 +22,11 @@
class wxBrowser : public wxWebView, public virtual IHtmlWnd {
DECLARE_EVENT_TABLE()
public:
- wxBrowser(wxWindow *parent, wxWindowID id);
+ wxBrowser(wxWindow *parent, wxWindowID id = wxID_ANY,
+ const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize);
virtual ~wxBrowser();
virtual wxWindow* GetWindow();
- virtual bool LoadString(wxString html);
+ virtual bool LoadString(const wxString& html);
virtual void LoadUrl(const wxString &_url, const wxString &_frame = wxEmptyString, bool keepHistory=false);
virtual bool Refresh(wxHtmlRefreshLevel level);
virtual bool GoBack();
View
5 src/cx_pcre_exec.cpp
@@ -4467,6 +4467,9 @@ real_pcre internal_re;
const real_pcre *external_re = (const real_pcre *)argument_re;
const real_pcre *re = external_re;
+/* Bound check */
+if (length < start_offset) return PCRE_ERROR_NOMATCH;
+
/* Plausibility checks */
if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
@@ -4611,7 +4614,7 @@ else
else
{
md->nllen = 1;
- md->nl[0] = newline;
+ md->nl[0] = (uschar)newline;
}
}
View
24 src/eConnection.cpp
@@ -1,34 +1,34 @@
-#include "eConnection.h"
-#include "IIpcHandler.h"
-
-eConnection::eConnection(boost::asio::io_service& io_service, hessian_ipc::connection_manager& manager, IIpcHandler& handler)
+#include "eConnection.h"
+#include "IIpcHandler.h"
+
+eIpcConnection::eIpcConnection(boost::asio::io_service& io_service, hessian_ipc::connection_manager& manager, IIpcHandler& handler)
: hessian_ipc::connection(io_service, manager), m_handler(handler)
{
}
-eConnection::~eConnection() {
+eIpcConnection::~eIpcConnection() {
}
-void eConnection::invoke_method() {
+void eIpcConnection::invoke_method() {
m_handler.handle_call(*this);
}
-void eConnection::on_close() {
+void eIpcConnection::on_close() {
m_handler.handle_close(*this);
}
-const hessian_ipc::Call* eConnection::get_call() {
+const hessian_ipc::Call* eIpcConnection::get_call() {
return request_;
}
-hessian_ipc::Writer& eConnection::get_reply_writer() {
+hessian_ipc::Writer& eIpcConnection::get_reply_writer() {
return writer_;
}
-void eConnection::reply_done() {
+void eIpcConnection::reply_done() {
connection::reply_done();
}
-void eConnection::notifier_done() {
+void eIpcConnection::notifier_done() {
connection::notifier_done();
-}
+}
View
6 src/eConnection.h
@@ -20,10 +20,10 @@
// Pre-definitions
class IIpcHandler;
-class eConnection : public hessian_ipc::connection, public IConnection {
+class eIpcConnection : public hessian_ipc::connection, public IConnection {
public:
- explicit eConnection(boost::asio::io_service& io_service, hessian_ipc::connection_manager& manager, IIpcHandler& handler);
- virtual ~eConnection();
+ explicit eIpcConnection(boost::asio::io_service& io_service, hessian_ipc::connection_manager& manager, IIpcHandler& handler);
+ virtual ~eIpcConnection();
// Method handling
void invoke_method();
View
4 src/eDockArt.cpp
@@ -174,7 +174,9 @@ void ModernDockArt::DrawPaneButton(wxDC& dc,
ModernTabArt::ModernTabArt() {
m_active_close_bmp = wxBitmap(close_xpm);
- m_hot_close_bmp = wxBitmap(close_hot_xpm);
+ /* FIXME:
+ The correct fix will be to modify the ModernTabArt class to also draw buttons on mouseover.
+ m_hot_close_bmp = wxBitmap(close_hot_xpm);*/
m_disabled_close_bmp = wxBitmap(close_disabled_xpm);
}
View
2 src/eDocumentPath.cpp
@@ -41,7 +41,7 @@ FILE_PERMISSIONS eDocumentPath::GetPermissions(const wxString& path) {
#else
// Get protection
struct stat s;
- int res = stat(path.mb_str(wxConvUTF8), &s);
+ stat(path.mb_str(wxConvUTF8), &s);
return s.st_mode;
#endif
}
View
4 src/eServer.cpp
@@ -19,9 +19,9 @@ void eServer::destroy() {
}
hessian_ipc::connection* eServer::new_connection() {
- return new eConnection(io_service_, connection_manager_, m_handler);
+ return new eIpcConnection(io_service_, connection_manager_, m_handler);
}
IIpcServer* NewIpcServer(IIpcHandler& handler) {
return new eServer(handler);
-}
+}
View
2 src/hessian_ipc/connection.h
@@ -70,7 +70,7 @@ class connection
boost::shared_ptr<connection> keep_alive_; // Ensure that conn is not deleted during calls
boost::mutex queue_lock_;
std::vector<unsigned char>* reply_ptr_; // Only one item in queue can be a reply
- boost::ptr_deque<std::vector<unsigned char>> queue_;
+ boost::ptr_deque< std::vector<unsigned char> > queue_;
bool write_in_progress_;
};
View
4 src/hessian_ipc/hessian_writers.h
@@ -47,7 +47,7 @@ template<class T> void Writer::write_notifier(unsigned int notifier_id, const T&
template<class T> void Writer::write(const vector<T>& value) {
out.push_back(0x57); // tag for variable-length untyped list
- for (vector<T>::const_iterator p = value.begin(); p != value.end(); ++p) {
+ for (typename vector<T>::const_iterator p = value.begin(); p != value.end(); ++p) {
write(*p);
}
out.push_back('Z');
@@ -57,7 +57,7 @@ template<class T1, class T2> void Writer::write(const map<T1,T2>& value) {
const size_t len = value.size();
out.push_back('H'); // tag for untyped map
- for (map<T1,T2>::const_iterator p = value.begin(); p != value.end(); ++p) {
+ for (typename map<T1,T2>::const_iterator p = value.begin(); p != value.end(); ++p) {
write(*(p->first));
write(*(p->second));
}
View
2 src/key_hook.h
@@ -10,9 +10,11 @@
#endif
#ifdef __WXGTK__
+#define GSocket GlibGSocket
#include <gtk/gtk.h>
//#include <gdk/gdkevents.h>
//#include <gdk/gdkwindow.h>
+#undef GSocket
#endif
#include <map>
View
5 src/plistHandler.cpp
@@ -224,13 +224,14 @@ PListHandler::PListHandler(const wxString& appPath, const wxString& appDataPath,
m_localBundleDir.AppendDir(wxT("Bundles"));
#ifdef __WXDEBUG__
- wxStartTimer();
+ wxStopWatch perftimer;
+ perftimer.Start();
#endif
Update(UPDATE_SYNTAXONLY);
#ifdef __WXDEBUG__
- wxLogDebug(wxT("Bundle Update Time: %d"), wxGetElapsedTime());
+ wxLogDebug(wxT("Bundle Update Time: %ld"), perftimer.Time());
#endif
}
View
2 src/wxactivex.cpp
@@ -2499,7 +2499,7 @@ bool GetSysErrMessage(int err, wxString& s)
err,0, buf, sizeof(buf), NULL) == 0)
return false;
- buf[sizeof(buf) - 1] = 0;
+ buf[sizeof(buf)/sizeof(buf[0]) - 1] = 0;
s = buf;
return true;
};

0 comments on commit f9c57db

Please sign in to comment.