diff options
-rw-r--r-- | gtk/ScintillaGTK.cxx | 22 | ||||
-rw-r--r-- | include/Scintilla.h | 15 | ||||
-rw-r--r-- | include/ScintillaWidget.h | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/Editor.h | 4 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 2 | ||||
-rw-r--r-- | src/ScintillaBase.h | 2 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 44 |
8 files changed, 51 insertions, 42 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 42146be98..bd7262601 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -78,9 +78,9 @@ private: virtual void Finalise(); virtual void StartDrag(); public: // Public for scintilla_send_message - virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam); + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); private: - virtual long DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam); + virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual void SetTicking(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); @@ -156,8 +156,8 @@ private: static gint TimeOut(ScintillaGTK *sciThis); static void PopUpCB(ScintillaGTK *sciThis, guint action, GtkWidget *widget); static gint ExposeCT(GtkWidget *widget, GdkEventExpose *ose, CallTip *ct); - static long DirectFunction(ScintillaGTK *sciThis, - unsigned int iMessage, unsigned long wParam, long lParam); + static sptr_t DirectFunction(ScintillaGTK *sciThis, + unsigned int iMessage, uptr_t wParam, sptr_t lParam); }; enum { @@ -496,7 +496,7 @@ void ScintillaGTK::StartDrag() { reinterpret_cast<GdkEvent *>(&evbtn)); } -long ScintillaGTK::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { switch (iMessage) { case SCI_GRABFOCUS: @@ -504,10 +504,10 @@ long ScintillaGTK::WndProc(unsigned int iMessage, unsigned long wParam, long lPa break; case SCI_GETDIRECTFUNCTION: - return reinterpret_cast<long>(DirectFunction); + return reinterpret_cast<sptr_t>(DirectFunction); case SCI_GETDIRECTPOINTER: - return reinterpret_cast<long>(this); + return reinterpret_cast<sptr_t>(this); default: return ScintillaBase::WndProc(iMessage,wParam,lParam); @@ -515,7 +515,7 @@ long ScintillaGTK::WndProc(unsigned int iMessage, unsigned long wParam, long lPa return 0l; } -long ScintillaGTK::DefWndProc(unsigned int, unsigned long, long) { +sptr_t ScintillaGTK::DefWndProc(unsigned int, uptr_t, sptr_t) { return 0; } @@ -1295,12 +1295,12 @@ gint ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip return TRUE; } -long ScintillaGTK::DirectFunction( - ScintillaGTK *sciThis, unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t ScintillaGTK::DirectFunction( + ScintillaGTK *sciThis, unsigned int iMessage, sptr_t wParam, sptr_t lParam) { return sciThis->WndProc(iMessage, wParam, lParam); } -long scintilla_send_message(ScintillaObject *sci, int iMessage, int wParam, int lParam) { +sptr_t scintilla_send_message(ScintillaObject *sci, int iMessage, uptr_t wParam, sptr_t lParam) { ScintillaGTK *psci = reinterpret_cast<ScintillaGTK *>(sci->pscin); return psci->WndProc(iMessage, wParam, lParam); } diff --git a/include/Scintilla.h b/include/Scintilla.h index 802a160bf..429b7a9d7 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -18,7 +18,16 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance); #endif #endif -typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wParam, long lParam); +// 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. +#ifndef POINTER_TYPES +#define POINTER_TYPES +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 @@ -507,8 +516,8 @@ struct SCNotification { int linesAdded; // SCN_MODIFIED #ifdef MACRO_SUPPORT int message; // SCN_MACRORECORD - int wParam; // SCN_MACRORECORD - int lParam; // SCN_MACRORECORD + uptr_t wParam; // SCN_MACRORECORD + sptr_t lParam; // SCN_MACRORECORD #endif int line; // SCN_MODIFIED int foldLevelNow; // SCN_MODIFIED diff --git a/include/ScintillaWidget.h b/include/ScintillaWidget.h index 70e26dbce..9ac743573 100644 --- a/include/ScintillaWidget.h +++ b/include/ScintillaWidget.h @@ -35,7 +35,7 @@ struct _ScintillaClass { guint scintilla_get_type (void); GtkWidget* scintilla_new (void); void scintilla_set_id (ScintillaObject *sci,int id); -long scintilla_send_message (ScintillaObject *sci,int iMessage,int wParam,int lParam); +sptr_t scintilla_send_message (ScintillaObject *sci,int iMessage, uptr_t wParam, sptr_t lParam); #ifdef __cplusplus } diff --git a/src/Editor.cxx b/src/Editor.cxx index 67d8ea856..2b759c96c 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3200,7 +3200,7 @@ static bool ValidMargin(unsigned long wParam) { return wParam < ViewStyle::margins; } -long Editor::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { //Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam); // Optional macro recording hook diff --git a/src/Editor.h b/src/Editor.h index 4e1ffc782..81806ba77 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -308,11 +308,11 @@ protected: // ScintillaBase subclass needs access to much of Editor void ToggleContraction(int line); void EnsureLineVisible(int line); - virtual long DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam) = 0; + virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; public: // Public so scintilla_send_message can use it - virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam); + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); // Public so scintilla_set_id can use it int ctrlID; }; diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 29fad12d0..eb769923c 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -367,7 +367,7 @@ void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) { Editor::NotifyStyleToNeeded(endStyleNeeded); } -long ScintillaBase::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { switch (iMessage) { case SCI_AUTOCSHOW: listType = 0; diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h index 5978ca9bc..04abbd10f 100644 --- a/src/ScintillaBase.h +++ b/src/ScintillaBase.h @@ -70,7 +70,7 @@ protected: virtual void NotifyStyleToNeeded(int endStyleNeeded); public: // Public so scintilla_send_message can use it - virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam); + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); }; #endif diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index bec1ad1a1..664b94b00 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -118,17 +118,17 @@ class ScintillaWin : virtual void Initialise(); virtual void Finalise(); - static LRESULT DirectFunction( - ScintillaWin *sci, UINT iMessage, WPARAM wParam, LPARAM lParam); - static LRESULT PASCAL SWndProc( - HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam); - static LRESULT PASCAL CTWndProc( - HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam); + static sptr_t DirectFunction( + ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam); + static sptr_t PASCAL SWndProc( + HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam); + static sptr_t PASCAL CTWndProc( + HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam); virtual void StartDrag(); - LRESULT WndPaint(unsigned long wParam); - virtual LRESULT WndProc(unsigned int iMessage, unsigned long wParam, long lParam); - virtual LRESULT DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam); + sptr_t WndPaint(unsigned long wParam); + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); + virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual void SetTicking(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); @@ -349,7 +349,7 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) { return 0l; } -LRESULT ScintillaWin::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { //Platform::DebugPrintf("S M:%x WP:%x L:%x\n", iMessage, wParam, lParam); switch (iMessage) { @@ -606,10 +606,10 @@ LRESULT ScintillaWin::WndProc(unsigned int iMessage, unsigned long wParam, long return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); case SCI_GETDIRECTFUNCTION: - return reinterpret_cast<LRESULT>(DirectFunction); + return reinterpret_cast<sptr_t>(DirectFunction); case SCI_GETDIRECTPOINTER: - return reinterpret_cast<LRESULT>(this); + return reinterpret_cast<sptr_t>(this); case SCI_GRABFOCUS: ::SetFocus(wMain.GetID()); @@ -621,7 +621,7 @@ LRESULT ScintillaWin::WndProc(unsigned int iMessage, unsigned long wParam, long return 0l; } -long ScintillaWin::DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam) { +sptr_t ScintillaWin::DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); } @@ -1589,8 +1589,8 @@ void ScintillaWin::Register(HINSTANCE hInstance_) { } } -LRESULT PASCAL ScintillaWin::CTWndProc( - HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { +sptr_t PASCAL ScintillaWin::CTWndProc( + HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) { // Find C++ object associated with window. CallTip *ctp = reinterpret_cast<CallTip *>(GetWindowLong(hWnd, 0)); @@ -1624,17 +1624,17 @@ LRESULT PASCAL ScintillaWin::CTWndProc( } } -LRESULT ScintillaWin::DirectFunction( - ScintillaWin *sci, UINT iMessage, WPARAM wParam, LPARAM lParam) { +sptr_t ScintillaWin::DirectFunction( + ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) { return sci->WndProc(iMessage, wParam, lParam); } -LRESULT PASCAL ScintillaWin::SWndProc( - HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { +sptr_t PASCAL ScintillaWin::SWndProc( + HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) { //Platform::DebugPrintf("S W:%x M:%x WP:%x L:%x\n", hWnd, iMessage, wParam, lParam); // Find C++ object associated with window. - ScintillaWin *sci = reinterpret_cast<ScintillaWin *>(GetWindowLong(hWnd, 0)); + ScintillaWin *sci = reinterpret_cast<ScintillaWin *>(::GetWindowLong(hWnd, 0)); // sci will be zero if WM_CREATE not seen yet if (sci == 0) { if (iMessage == WM_CREATE) { @@ -1643,14 +1643,14 @@ LRESULT PASCAL ScintillaWin::SWndProc( SetWindowLong(hWnd, 0, reinterpret_cast<LONG>(sci)); return sci->WndProc(iMessage, wParam, lParam); } else { - return ::DefWindowProc(hWnd, iMessage, wParam, lParam); + return ::DefWindowProc(hWnd, iMessage, wParam, lParam); } } else { if (iMessage == WM_DESTROY) { sci->Finalise(); delete sci; SetWindowLong(hWnd, 0, 0); - return ::DefWindowProc(hWnd, iMessage, wParam, lParam); + return ::DefWindowProc(hWnd, iMessage, wParam, lParam); } else { return sci->WndProc(iMessage, wParam, lParam); } |