diff --git a/include/SFML/Network/Socket.hpp b/include/SFML/Network/Socket.hpp index 34e2f2254..db91d7e4d 100644 --- a/include/SFML/Network/Socket.hpp +++ b/include/SFML/Network/Socket.hpp @@ -155,7 +155,7 @@ protected: /// \return The internal (OS-specific) handle of the socket /// //////////////////////////////////////////////////////////// - SocketHandle getHandle() const; + SocketHandle getNativeHandle() const; //////////////////////////////////////////////////////////// /// \brief Create the internal representation of the socket diff --git a/include/SFML/Window/WindowBase.hpp b/include/SFML/Window/WindowBase.hpp index 792bfcb28..26a60294b 100644 --- a/include/SFML/Window/WindowBase.hpp +++ b/include/SFML/Window/WindowBase.hpp @@ -424,7 +424,7 @@ public: /// \return System handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const; + WindowHandle getNativeHandle() const; //////////////////////////////////////////////////////////// /// \brief Create a Vulkan rendering surface diff --git a/include/SFML/Window/WindowHandle.hpp b/include/SFML/Window/WindowHandle.hpp index 041424d4e..9b8331c56 100644 --- a/include/SFML/Window/WindowHandle.hpp +++ b/include/SFML/Window/WindowHandle.hpp @@ -92,7 +92,7 @@ using WindowHandle = "platform-specific"; /// On macOS, a sf::Window can be created either from an /// existing \p NSWindow* or an \p NSView*. When the window /// is created from a window, SFML will use its content view -/// as the OpenGL area. sf::Window::getSystemHandle() will +/// as the OpenGL area. sf::Window::getNativeHandle() will /// return the handle that was used to create the window, /// which is a \p NSWindow* by default. /// diff --git a/src/SFML/Network/Socket.cpp b/src/SFML/Network/Socket.cpp index 1e85202a0..226a174f5 100644 --- a/src/SFML/Network/Socket.cpp +++ b/src/SFML/Network/Socket.cpp @@ -91,7 +91,7 @@ bool Socket::isBlocking() const //////////////////////////////////////////////////////////// -SocketHandle Socket::getHandle() const +SocketHandle Socket::getNativeHandle() const { return m_socket; } diff --git a/src/SFML/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp index f42d13a1c..6f5fefbf2 100644 --- a/src/SFML/Network/SocketSelector.cpp +++ b/src/SFML/Network/SocketSelector.cpp @@ -90,7 +90,7 @@ SocketSelector& SocketSelector::operator=(SocketSelector&&) noexcept = default; //////////////////////////////////////////////////////////// void SocketSelector::add(Socket& socket) { - const SocketHandle handle = socket.getHandle(); + const SocketHandle handle = socket.getNativeHandle(); if (handle != priv::SocketImpl::invalidSocket()) { @@ -132,7 +132,7 @@ void SocketSelector::add(Socket& socket) //////////////////////////////////////////////////////////// void SocketSelector::remove(Socket& socket) { - const SocketHandle handle = socket.getHandle(); + const SocketHandle handle = socket.getNativeHandle(); if (handle != priv::SocketImpl::invalidSocket()) { @@ -189,7 +189,7 @@ bool SocketSelector::wait(Time timeout) //////////////////////////////////////////////////////////// bool SocketSelector::isReady(Socket& socket) const { - const SocketHandle handle = socket.getHandle(); + const SocketHandle handle = socket.getNativeHandle(); if (handle != priv::SocketImpl::invalidSocket()) { diff --git a/src/SFML/Network/TcpListener.cpp b/src/SFML/Network/TcpListener.cpp index 55802eb91..3a5e08bd7 100644 --- a/src/SFML/Network/TcpListener.cpp +++ b/src/SFML/Network/TcpListener.cpp @@ -45,12 +45,12 @@ TcpListener::TcpListener() : Socket(Type::Tcp) //////////////////////////////////////////////////////////// unsigned short TcpListener::getLocalPort() const { - if (getHandle() != priv::SocketImpl::invalidSocket()) + if (getNativeHandle() != priv::SocketImpl::invalidSocket()) { // Retrieve information about the local end of the socket sockaddr_in address; priv::SocketImpl::AddrLength size = sizeof(address); - if (getsockname(getHandle(), reinterpret_cast(&address), &size) != -1) + if (getsockname(getNativeHandle(), reinterpret_cast(&address), &size) != -1) { return ntohs(address.sin_port); } @@ -76,7 +76,7 @@ Socket::Status TcpListener::listen(unsigned short port, const IpAddress& address // Bind the socket to the specified port sockaddr_in addr = priv::SocketImpl::createAddress(address.toInteger(), port); - if (bind(getHandle(), reinterpret_cast(&addr), sizeof(addr)) == -1) + if (bind(getNativeHandle(), reinterpret_cast(&addr), sizeof(addr)) == -1) { // Not likely to happen, but... err() << "Failed to bind listener socket to port " << port << std::endl; @@ -84,7 +84,7 @@ Socket::Status TcpListener::listen(unsigned short port, const IpAddress& address } // Listen to the bound port - if (::listen(getHandle(), SOMAXCONN) == -1) + if (::listen(getNativeHandle(), SOMAXCONN) == -1) { // Oops, socket is deaf err() << "Failed to listen to port " << port << std::endl; @@ -107,7 +107,7 @@ void TcpListener::close() Socket::Status TcpListener::accept(TcpSocket& socket) { // Make sure that we're listening - if (getHandle() == priv::SocketImpl::invalidSocket()) + if (getNativeHandle() == priv::SocketImpl::invalidSocket()) { err() << "Failed to accept a new connection, the socket is not listening" << std::endl; return Status::Error; @@ -116,7 +116,7 @@ Socket::Status TcpListener::accept(TcpSocket& socket) // Accept a new connection sockaddr_in address; priv::SocketImpl::AddrLength length = sizeof(address); - const SocketHandle remote = ::accept(getHandle(), reinterpret_cast(&address), &length); + const SocketHandle remote = ::accept(getNativeHandle(), reinterpret_cast(&address), &length); // Check for errors if (remote == priv::SocketImpl::invalidSocket()) diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 63440dd9f..cc8c03df0 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -63,12 +63,12 @@ TcpSocket::TcpSocket() : Socket(Type::Tcp) //////////////////////////////////////////////////////////// unsigned short TcpSocket::getLocalPort() const { - if (getHandle() != priv::SocketImpl::invalidSocket()) + if (getNativeHandle() != priv::SocketImpl::invalidSocket()) { // Retrieve information about the local end of the socket sockaddr_in address; priv::SocketImpl::AddrLength size = sizeof(address); - if (getsockname(getHandle(), reinterpret_cast(&address), &size) != -1) + if (getsockname(getNativeHandle(), reinterpret_cast(&address), &size) != -1) { return ntohs(address.sin_port); } @@ -82,12 +82,12 @@ unsigned short TcpSocket::getLocalPort() const //////////////////////////////////////////////////////////// std::optional TcpSocket::getRemoteAddress() const { - if (getHandle() != priv::SocketImpl::invalidSocket()) + if (getNativeHandle() != priv::SocketImpl::invalidSocket()) { // Retrieve information about the remote end of the socket sockaddr_in address; priv::SocketImpl::AddrLength size = sizeof(address); - if (getpeername(getHandle(), reinterpret_cast(&address), &size) != -1) + if (getpeername(getNativeHandle(), reinterpret_cast(&address), &size) != -1) { return IpAddress(ntohl(address.sin_addr.s_addr)); } @@ -101,12 +101,12 @@ std::optional TcpSocket::getRemoteAddress() const //////////////////////////////////////////////////////////// unsigned short TcpSocket::getRemotePort() const { - if (getHandle() != priv::SocketImpl::invalidSocket()) + if (getNativeHandle() != priv::SocketImpl::invalidSocket()) { // Retrieve information about the remote end of the socket sockaddr_in address; priv::SocketImpl::AddrLength size = sizeof(address); - if (getpeername(getHandle(), reinterpret_cast(&address), &size) != -1) + if (getpeername(getNativeHandle(), reinterpret_cast(&address), &size) != -1) { return ntohs(address.sin_port); } @@ -134,7 +134,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short // ----- We're not using a timeout: just try to connect ----- // Connect the socket - if (::connect(getHandle(), reinterpret_cast(&address), sizeof(address)) == -1) + if (::connect(getNativeHandle(), reinterpret_cast(&address), sizeof(address)) == -1) return priv::SocketImpl::getErrorStatus(); // Connection succeeded @@ -152,7 +152,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short setBlocking(false); // Try to connect to the remote address - if (::connect(getHandle(), reinterpret_cast(&address), sizeof(address)) >= 0) + if (::connect(getNativeHandle(), reinterpret_cast(&address), sizeof(address)) >= 0) { // We got instantly connected! (it may no happen a lot...) setBlocking(blocking); @@ -172,7 +172,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short // Setup the selector fd_set selector; FD_ZERO(&selector); - FD_SET(getHandle(), &selector); + FD_SET(getNativeHandle(), &selector); // Setup the timeout timeval time; @@ -180,7 +180,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short time.tv_usec = static_cast(timeout.asMicroseconds() % 1000000); // Wait for something to write on our socket (which means that the connection request has returned) - if (select(static_cast(getHandle() + 1), nullptr, &selector, nullptr, &time) > 0) + if (select(static_cast(getNativeHandle() + 1), nullptr, &selector, nullptr, &time) > 0) { // At this point the connection may have been either accepted or refused. // To know whether it's a success or a failure, we must check the address of the connected peer @@ -250,8 +250,10 @@ Socket::Status TcpSocket::send(const void* data, std::size_t size, std::size_t& #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wuseless-cast" // Send a chunk of data - result = static_cast( - ::send(getHandle(), static_cast(data) + sent, static_cast(size - sent), flags)); + result = static_cast(::send(getNativeHandle(), + static_cast(data) + sent, + static_cast(size - sent), + flags)); #pragma GCC diagnostic pop // Check for errors @@ -287,7 +289,7 @@ Socket::Status TcpSocket::receive(void* data, std::size_t size, std::size_t& rec #pragma GCC diagnostic ignored "-Wuseless-cast" // Receive a chunk of bytes const int sizeReceived = static_cast( - recv(getHandle(), static_cast(data), static_cast(size), flags)); + recv(getNativeHandle(), static_cast(data), static_cast(size), flags)); #pragma GCC diagnostic pop // Check the number of bytes received diff --git a/src/SFML/Network/UdpSocket.cpp b/src/SFML/Network/UdpSocket.cpp index e9c885415..7972172e7 100644 --- a/src/SFML/Network/UdpSocket.cpp +++ b/src/SFML/Network/UdpSocket.cpp @@ -48,12 +48,12 @@ UdpSocket::UdpSocket() : Socket(Type::Udp) //////////////////////////////////////////////////////////// unsigned short UdpSocket::getLocalPort() const { - if (getHandle() != priv::SocketImpl::invalidSocket()) + if (getNativeHandle() != priv::SocketImpl::invalidSocket()) { // Retrieve information about the local end of the socket sockaddr_in address; priv::SocketImpl::AddrLength size = sizeof(address); - if (getsockname(getHandle(), reinterpret_cast(&address), &size) != -1) + if (getsockname(getNativeHandle(), reinterpret_cast(&address), &size) != -1) { return ntohs(address.sin_port); } @@ -79,7 +79,7 @@ Socket::Status UdpSocket::bind(unsigned short port, const IpAddress& address) // Bind the socket sockaddr_in addr = priv::SocketImpl::createAddress(address.toInteger(), port); - if (::bind(getHandle(), reinterpret_cast(&addr), sizeof(addr)) == -1) + if (::bind(getNativeHandle(), reinterpret_cast(&addr), sizeof(addr)) == -1) { err() << "Failed to bind socket to port " << port << std::endl; return Status::Error; @@ -118,7 +118,7 @@ Socket::Status UdpSocket::send(const void* data, std::size_t size, const IpAddre #pragma GCC diagnostic ignored "-Wuseless-cast" // Send the data (unlike TCP, all the data is always sent in one call) const int sent = static_cast( - sendto(getHandle(), + sendto(getNativeHandle(), static_cast(data), static_cast(size), 0, @@ -161,7 +161,7 @@ Socket::Status UdpSocket::receive(void* data, // Receive a chunk of bytes priv::SocketImpl::AddrLength addressSize = sizeof(address); const int sizeReceived = static_cast( - recvfrom(getHandle(), + recvfrom(getNativeHandle(), static_cast(data), static_cast(size), 0, diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 038c80127..2bbe18261 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -87,7 +87,7 @@ WindowImplAndroid::~WindowImplAndroid() //////////////////////////////////////////////////////////// -WindowHandle WindowImplAndroid::getSystemHandle() const +WindowHandle WindowImplAndroid::getNativeHandle() const { ActivityStates& states = getActivity(); std::lock_guard lock(states.mutex); diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp index 62c345c50..b6c03dbe3 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.hpp +++ b/src/SFML/Window/Android/WindowImplAndroid.hpp @@ -76,7 +76,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/DRM/WindowImplDRM.cpp b/src/SFML/Window/DRM/WindowImplDRM.cpp index ba4d9978d..9dccd07ce 100644 --- a/src/SFML/Window/DRM/WindowImplDRM.cpp +++ b/src/SFML/Window/DRM/WindowImplDRM.cpp @@ -59,7 +59,7 @@ WindowImplDRM::~WindowImplDRM() //////////////////////////////////////////////////////////// -WindowHandle WindowImplDRM::getSystemHandle() const +WindowHandle WindowImplDRM::getNativeHandle() const { const Drm& drm = sf::priv::DRMContext::getDRM(); return static_cast(drm.fileDescriptor); diff --git a/src/SFML/Window/DRM/WindowImplDRM.hpp b/src/SFML/Window/DRM/WindowImplDRM.hpp index 4d4bb5c0a..390909cdd 100644 --- a/src/SFML/Window/DRM/WindowImplDRM.hpp +++ b/src/SFML/Window/DRM/WindowImplDRM.hpp @@ -70,7 +70,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index ce8a48c5f..ec62e8025 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -166,7 +166,7 @@ EglContext::EglContext(EglContext* shared, #if !defined(SFML_SYSTEM_ANDROID) // Create EGL surface (except on Android because the window is created // asynchronously, its activity manager will call it for us) - createSurface(owner.getSystemHandle()); + createSurface(owner.getNativeHandle()); #endif } diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp index 534a15804..60458c5a6 100644 --- a/src/SFML/Window/Unix/GlxContext.cpp +++ b/src/SFML/Window/Unix/GlxContext.cpp @@ -138,7 +138,7 @@ GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, cons ensureExtensionsInit(m_display, DefaultScreen(m_display)); // Create the rendering surface from the owner window - createSurface(owner.getSystemHandle()); + createSurface(owner.getNativeHandle()); // Create the context createContext(shared); diff --git a/src/SFML/Window/Unix/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp index e86d0c0a0..0ce5e8a72 100644 --- a/src/SFML/Window/Unix/InputImpl.cpp +++ b/src/SFML/Window/Unix/InputImpl.cpp @@ -145,7 +145,7 @@ Vector2i InputImpl::getMousePosition() //////////////////////////////////////////////////////////// Vector2i InputImpl::getMousePosition(const WindowBase& relativeTo) { - const WindowHandle handle = relativeTo.getSystemHandle(); + const WindowHandle handle = relativeTo.getNativeHandle(); if (handle) { // Open a connection with the X server @@ -194,7 +194,7 @@ void InputImpl::setMousePosition(const Vector2i& position, const WindowBase& rel // Open a connection with the X server Display* display = openDisplay(); - const WindowHandle handle = relativeTo.getSystemHandle(); + const WindowHandle handle = relativeTo.getNativeHandle(); if (handle) { XWarpPointer(display, None, handle, 0, 0, 0, 0, position.x, position.y); diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index 3e9d7be1f..7bbc8f836 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -720,7 +720,7 @@ WindowImplX11::~WindowImplX11() //////////////////////////////////////////////////////////// -WindowHandle WindowImplX11::getSystemHandle() const +WindowHandle WindowImplX11::getNativeHandle() const { return m_window; } diff --git a/src/SFML/Window/Unix/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp index 6522fe854..3fb938311 100644 --- a/src/SFML/Window/Unix/WindowImplX11.hpp +++ b/src/SFML/Window/Unix/WindowImplX11.hpp @@ -77,7 +77,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index eadda8361..e5d61bdce 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -654,7 +654,7 @@ Vector2i InputImpl::getMousePosition() //////////////////////////////////////////////////////////// Vector2i InputImpl::getMousePosition(const WindowBase& relativeTo) { - WindowHandle handle = relativeTo.getSystemHandle(); + WindowHandle handle = relativeTo.getNativeHandle(); if (handle) { POINT point; @@ -679,7 +679,7 @@ void InputImpl::setMousePosition(const Vector2i& position) //////////////////////////////////////////////////////////// void InputImpl::setMousePosition(const Vector2i& position, const WindowBase& relativeTo) { - WindowHandle handle = relativeTo.getSystemHandle(); + WindowHandle handle = relativeTo.getNativeHandle(); if (handle) { POINT point = {position.x, position.y}; diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp index 1796af072..7dce9411c 100644 --- a/src/SFML/Window/Win32/WglContext.cpp +++ b/src/SFML/Window/Win32/WglContext.cpp @@ -135,7 +135,7 @@ WglContext::WglContext(WglContext* shared, const ContextSettings& settings, cons m_settings = settings; // Create the rendering surface from the owner window - createSurface(owner.getSystemHandle(), bitsPerPixel); + createSurface(owner.getNativeHandle(), bitsPerPixel); // Create the context createContext(shared); diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index af80467ed..a6bbaa903 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -274,7 +274,7 @@ WindowImplWin32::~WindowImplWin32() //////////////////////////////////////////////////////////// -WindowHandle WindowImplWin32::getSystemHandle() const +WindowHandle WindowImplWin32::getNativeHandle() const { return m_handle; } diff --git a/src/SFML/Window/Win32/WindowImplWin32.hpp b/src/SFML/Window/Win32/WindowImplWin32.hpp index a4a4ab65a..32da11960 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.hpp +++ b/src/SFML/Window/Win32/WindowImplWin32.hpp @@ -77,7 +77,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/WindowBase.cpp b/src/SFML/Window/WindowBase.cpp index 7892017f8..453927a65 100644 --- a/src/SFML/Window/WindowBase.cpp +++ b/src/SFML/Window/WindowBase.cpp @@ -352,9 +352,9 @@ bool WindowBase::hasFocus() const //////////////////////////////////////////////////////////// -WindowHandle WindowBase::getSystemHandle() const +WindowHandle WindowBase::getNativeHandle() const { - return m_impl ? m_impl->getSystemHandle() : WindowHandle{}; + return m_impl ? m_impl->getNativeHandle() : WindowHandle{}; } diff --git a/src/SFML/Window/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp index 6f2046e30..49129c5e7 100644 --- a/src/SFML/Window/WindowImpl.cpp +++ b/src/SFML/Window/WindowImpl.cpp @@ -333,7 +333,7 @@ bool WindowImpl::createVulkanSurface([[maybe_unused]] const VkInstance& #else - return VulkanImplType::createVulkanSurface(instance, getSystemHandle(), surface, allocator); + return VulkanImplType::createVulkanSurface(instance, getNativeHandle(), surface, allocator); #endif } diff --git a/src/SFML/Window/WindowImpl.hpp b/src/SFML/Window/WindowImpl.hpp index b3f81cbdc..1e38b9179 100644 --- a/src/SFML/Window/WindowImpl.hpp +++ b/src/SFML/Window/WindowImpl.hpp @@ -133,7 +133,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const = 0; + virtual WindowHandle getNativeHandle() const = 0; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/iOS/SFAppDelegate.mm b/src/SFML/Window/iOS/SFAppDelegate.mm index 27bc92319..d443809b4 100644 --- a/src/SFML/Window/iOS/SFAppDelegate.mm +++ b/src/SFML/Window/iOS/SFAppDelegate.mm @@ -179,7 +179,7 @@ std::vector touchPositions; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" - UIViewController* rootViewController = [((__bridge UIWindow*)(self.sfWindow->getSystemHandle())) rootViewController]; + UIViewController* rootViewController = [((__bridge UIWindow*)(self.sfWindow->getNativeHandle())) rootViewController]; #pragma GCC diagnostic pop diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp index 0bcd94062..ed88de1c4 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.hpp +++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp @@ -71,7 +71,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/iOS/WindowImplUIKit.mm b/src/SFML/Window/iOS/WindowImplUIKit.mm index fbdb24252..e40ec668b 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.mm +++ b/src/SFML/Window/iOS/WindowImplUIKit.mm @@ -94,7 +94,7 @@ void WindowImplUIKit::processEvents() //////////////////////////////////////////////////////////// -WindowHandle WindowImplUIKit::getSystemHandle() const +WindowHandle WindowImplUIKit::getNativeHandle() const { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" diff --git a/src/SFML/Window/macOS/InputImpl.mm b/src/SFML/Window/macOS/InputImpl.mm index 6890ad037..d60c6c27a 100644 --- a/src/SFML/Window/macOS/InputImpl.mm +++ b/src/SFML/Window/macOS/InputImpl.mm @@ -55,7 +55,7 @@ namespace sf::priv //////////////////////////////////////////////////////////// SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const WindowBase& window) { - const id nsHandle = static_cast(window.getSystemHandle()); + const id nsHandle = static_cast(window.getNativeHandle()); // Get our SFOpenGLView from ... SFOpenGLView* view = nil; diff --git a/src/SFML/Window/macOS/SFViewController.mm b/src/SFML/Window/macOS/SFViewController.mm index 1194996cb..542071527 100644 --- a/src/SFML/Window/macOS/SFViewController.mm +++ b/src/SFML/Window/macOS/SFViewController.mm @@ -111,7 +111,7 @@ //////////////////////////////////////////////////////// -- (sf::WindowHandle)getSystemHandle +- (sf::WindowHandle)getNativeHandle { return m_view; } diff --git a/src/SFML/Window/macOS/SFWindowController.mm b/src/SFML/Window/macOS/SFWindowController.mm index 05e4ca438..17f8d5884 100644 --- a/src/SFML/Window/macOS/SFWindowController.mm +++ b/src/SFML/Window/macOS/SFWindowController.mm @@ -336,7 +336,7 @@ //////////////////////////////////////////////////////// -- (sf::WindowHandle)getSystemHandle +- (sf::WindowHandle)getNativeHandle { return m_window; } diff --git a/src/SFML/Window/macOS/WindowImplCocoa.hpp b/src/SFML/Window/macOS/WindowImplCocoa.hpp index f46086be5..8d3dd14c3 100644 --- a/src/SFML/Window/macOS/WindowImplCocoa.hpp +++ b/src/SFML/Window/macOS/WindowImplCocoa.hpp @@ -245,7 +245,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - WindowHandle getSystemHandle() const override; + WindowHandle getNativeHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window diff --git a/src/SFML/Window/macOS/WindowImplCocoa.mm b/src/SFML/Window/macOS/WindowImplCocoa.mm index c23df56b4..36876b894 100644 --- a/src/SFML/Window/macOS/WindowImplCocoa.mm +++ b/src/SFML/Window/macOS/WindowImplCocoa.mm @@ -390,10 +390,10 @@ void WindowImplCocoa::processEvents() #pragma mark WindowImplCocoa's private methods //////////////////////////////////////////////////////////// -WindowHandle WindowImplCocoa::getSystemHandle() const +WindowHandle WindowImplCocoa::getNativeHandle() const { const AutoreleasePool pool; - return [m_delegate getSystemHandle]; + return [m_delegate getNativeHandle]; } diff --git a/src/SFML/Window/macOS/WindowImplDelegateProtocol.h b/src/SFML/Window/macOS/WindowImplDelegateProtocol.h index 3d0bb456b..b51ab7d1e 100644 --- a/src/SFML/Window/macOS/WindowImplDelegateProtocol.h +++ b/src/SFML/Window/macOS/WindowImplDelegateProtocol.h @@ -91,7 +91,7 @@ class WindowImplCocoa; /// \return Return the main view or window. /// //////////////////////////////////////////////////////////// -- (sf::WindowHandle)getSystemHandle; +- (sf::WindowHandle)getNativeHandle; //////////////////////////////////////////////////////////// /// \brief Determine where the mouse is diff --git a/test/Network/Socket.test.cpp b/test/Network/Socket.test.cpp index 4cd3d788b..09773ae98 100644 --- a/test/Network/Socket.test.cpp +++ b/test/Network/Socket.test.cpp @@ -13,7 +13,7 @@ public: using sf::Socket::close; using sf::Socket::create; - using sf::Socket::getHandle; + using sf::Socket::getNativeHandle; }; TEST_CASE("[Network] sf::Socket") @@ -38,7 +38,7 @@ TEST_CASE("[Network] sf::Socket") { const TestSocket testSocket; CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() == invalidHandle); + CHECK(testSocket.getNativeHandle() == invalidHandle); } SECTION("Move semantics") @@ -50,7 +50,7 @@ TEST_CASE("[Network] sf::Socket") movedTestSocket.create(); const TestSocket testSocket(std::move(movedTestSocket)); CHECK(!testSocket.isBlocking()); - CHECK(testSocket.getHandle() != invalidHandle); + CHECK(testSocket.getNativeHandle() != invalidHandle); } SECTION("Assignment") @@ -61,7 +61,7 @@ TEST_CASE("[Network] sf::Socket") TestSocket testSocket; testSocket = std::move(movedTestSocket); CHECK(!testSocket.isBlocking()); - CHECK(testSocket.getHandle() != invalidHandle); + CHECK(testSocket.getNativeHandle() != invalidHandle); } } @@ -77,12 +77,12 @@ TEST_CASE("[Network] sf::Socket") TestSocket testSocket; testSocket.create(); CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() != invalidHandle); + CHECK(testSocket.getNativeHandle() != invalidHandle); // Recreate socket to ensure nothing changed testSocket.create(); CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() != invalidHandle); + CHECK(testSocket.getNativeHandle() != invalidHandle); } SECTION("close()") @@ -90,14 +90,14 @@ TEST_CASE("[Network] sf::Socket") TestSocket testSocket; testSocket.create(); CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() != invalidHandle); + CHECK(testSocket.getNativeHandle() != invalidHandle); testSocket.close(); CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() == invalidHandle); + CHECK(testSocket.getNativeHandle() == invalidHandle); // Reclose socket to ensure nothing changed testSocket.close(); CHECK(testSocket.isBlocking()); - CHECK(testSocket.getHandle() == invalidHandle); + CHECK(testSocket.getNativeHandle() == invalidHandle); } } diff --git a/test/Window/WindowBase.test.cpp b/test/Window/WindowBase.test.cpp index 6d39ebf68..dcab1e7d5 100644 --- a/test/Window/WindowBase.test.cpp +++ b/test/Window/WindowBase.test.cpp @@ -30,7 +30,7 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests()) CHECK(windowBase.getPosition() == sf::Vector2i()); CHECK(windowBase.getSize() == sf::Vector2u()); CHECK(!windowBase.hasFocus()); - CHECK(windowBase.getSystemHandle() == sf::WindowHandle()); + CHECK(windowBase.getNativeHandle() == sf::WindowHandle()); } SECTION("Mode and title constructor") @@ -38,7 +38,7 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests()) const sf::WindowBase windowBase(sf::VideoMode({360, 240}), "WindowBase Tests"); CHECK(windowBase.isOpen()); CHECK(windowBase.getSize() == sf::Vector2u(360, 240)); - CHECK(windowBase.getSystemHandle() != sf::WindowHandle()); + CHECK(windowBase.getNativeHandle() != sf::WindowHandle()); } SECTION("Mode, title, and style constructor") @@ -46,7 +46,7 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests()) const sf::WindowBase windowBase(sf::VideoMode({360, 240}), "WindowBase Tests", sf::Style::Resize); CHECK(windowBase.isOpen()); CHECK(windowBase.getSize() == sf::Vector2u(360, 240)); - CHECK(windowBase.getSystemHandle() != sf::WindowHandle()); + CHECK(windowBase.getNativeHandle() != sf::WindowHandle()); } } @@ -59,7 +59,7 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests()) windowBase.create(sf::VideoMode({240, 360}), "WindowBase Tests"); CHECK(windowBase.isOpen()); CHECK(windowBase.getSize() == sf::Vector2u(240, 360)); - CHECK(windowBase.getSystemHandle() != sf::WindowHandle()); + CHECK(windowBase.getNativeHandle() != sf::WindowHandle()); } SECTION("Mode, title, and style") @@ -67,7 +67,7 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests()) windowBase.create(sf::VideoMode({240, 360}), "WindowBase Tests", sf::Style::Resize); CHECK(windowBase.isOpen()); CHECK(windowBase.getSize() == sf::Vector2u(240, 360)); - CHECK(windowBase.getSystemHandle() != sf::WindowHandle()); + CHECK(windowBase.getNativeHandle() != sf::WindowHandle()); } }