Rename wxExternalField methods to not mention "Window"

This class doesn't have to be used with wxWindow or similar as object
type, so use a more neutral "Object" instead of "Window".
This commit is contained in:
Vadim Zeitlin
2017-11-22 00:16:45 +01:00
parent 1863f494f3
commit 020c598c18
3 changed files with 20 additions and 20 deletions

View File

@@ -39,8 +39,8 @@ public:
// existing one, if any.
//
// This method takes ownership of the field pointer which will be destroyed
// by EraseForWindow().
static void StoreForWindow(ObjectType* obj, FieldType* field)
// by EraseForObject().
static void StoreForObject(ObjectType* obj, FieldType* field)
{
const typename MapType::iterator it = ms_map.find(obj);
if ( it != ms_map.end() )
@@ -55,7 +55,7 @@ public:
}
// Find the object for the corresponding window.
static FieldType* FromWindow(ObjectType* obj)
static FieldType* FromObject(ObjectType* obj)
{
const typename MapType::const_iterator it = ms_map.find(obj);
return it == ms_map.end() ? NULL : it->second;
@@ -63,7 +63,7 @@ public:
// Erase the object used for the corresponding window, return true if there
// was one or false otherwise.
static bool EraseForWindow(ObjectType* obj)
static bool EraseForObject(ObjectType* obj)
{
const typename MapType::iterator it = ms_map.find(obj);
if ( it == ms_map.end() )

View File

@@ -2687,7 +2687,7 @@ wxWindowGTK::~wxWindowGTK()
#endif
#ifdef wxGTK_HAS_GESTURES_SUPPORT
wxWindowGestures::EraseForWindow(this);
wxWindowGestures::EraseForObject(this);
#endif // wxGTK_HAS_GESTURES_SUPPORT
if (m_widget)
@@ -2923,7 +2923,7 @@ pan_gesture_begin_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUN
static void
horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequence, wxWindowGTK* win)
{
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -2954,7 +2954,7 @@ horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* seque
static void
vertical_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequence, wxWindowGTK* win)
{
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3006,7 +3006,7 @@ pan_gesture_callback(GtkGesture* gesture, GtkPanDirection direction, gdouble off
event.SetEventObject(win);
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3070,7 +3070,7 @@ zoom_gesture_callback(GtkGesture* gesture, gdouble scale, wxWindowGTK* win)
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
event.SetZoomFactor(scale);
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3210,7 +3210,7 @@ wxEmitTwoFingerTapEvent(GdkEventTouch* gdk_event, wxWindowGTK* win)
event.SetEventObject(win);
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3241,7 +3241,7 @@ wxEmitPressAndTapEvent(GdkEventTouch* gdk_event, wxWindowGTK* win)
event.SetEventObject(win);
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3273,7 +3273,7 @@ wxEmitPressAndTapEvent(GdkEventTouch* gdk_event, wxWindowGTK* win)
static void
touch_callback(GtkWidget* WXUNUSED(widget), GdkEventTouch* gdk_event, wxWindowGTK* win)
{
wxWindowGesturesData* const data = wxWindowGestures::FromWindow(win);
wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
if ( !data )
return;
@@ -3528,11 +3528,11 @@ bool wxWindowGTK::EnableTouchEvents(int eventsMask)
{
if ( eventsMask == wxTOUCH_NONE )
{
wxWindowGestures::EraseForWindow(this);
wxWindowGestures::EraseForObject(this);
}
else
{
wxWindowGestures::StoreForWindow
wxWindowGestures::StoreForObject
(
this,
new wxWindowGesturesData(this, GetConnectWidget(), eventsMask)

View File

@@ -1836,7 +1836,7 @@ enum TrackedGestures
void wxWidgetCocoaImpl::TouchesBegan(WX_NSEvent event)
{
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromWindow(this) )
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromObject(this) )
gestures->TouchesBegan(event);
}
@@ -1893,7 +1893,7 @@ void wxCocoaGesturesImpl::TouchesBegan(NSEvent* event)
void wxWidgetCocoaImpl::TouchesMoved(WX_NSEvent event)
{
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromWindow(this) )
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromObject(this) )
gestures->TouchesMoved(event);
}
@@ -1949,7 +1949,7 @@ void wxCocoaGesturesImpl::TouchesMoved(NSEvent* event)
void wxWidgetCocoaImpl::TouchesEnded(WX_NSEvent event)
{
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromWindow(this) )
if ( wxCocoaGesturesImpl* gestures = wxCocoaGestures::FromObject(this) )
gestures->TouchesEnded(event);
}
@@ -2501,7 +2501,7 @@ wxWidgetCocoaImpl::~wxWidgetCocoaImpl()
CFRelease(m_osxView);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
wxCocoaGestures::EraseForWindow(this);
wxCocoaGestures::EraseForObject(this);
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
}
@@ -3430,7 +3430,7 @@ bool wxWidgetCocoaImpl::EnableTouchEvents(int eventsMask)
{
if ( eventsMask == wxTOUCH_NONE )
{
if ( wxCocoaGestures::EraseForWindow(this) )
if ( wxCocoaGestures::EraseForObject(this) )
{
[m_osxView setAcceptsTouchEvents:NO];
}
@@ -3438,7 +3438,7 @@ bool wxWidgetCocoaImpl::EnableTouchEvents(int eventsMask)
}
else // We do want to have gesture events.
{
wxCocoaGestures::StoreForWindow
wxCocoaGestures::StoreForObject
(
this,
new wxCocoaGesturesImpl(this, m_osxView, eventsMask)