Implement wxDisplaySize() and wxClientDisplayRect() via wxDisplay
Instead of forwarding to these functions from wxDisplay implementation in wxUSE_DISPLAY==0 case, make the functions themselves wrappers around wxDisplay, which may, or not, depending on the platform, have a simpler implementation in wxUSE_DISPLAY==0 case, but is always available in any case. As part of this change, only use src/osx/core/display.cpp in macOS builds, not iOS ones and update the Xcode project accordingly too. This cuts down on code duplication, especially in wxGTK, and facilitates further additions to wxDisplay API.
This commit is contained in:
@@ -76,22 +76,6 @@ void *wxGetDisplay()
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxDisplaySize( int *width, int *height )
|
||||
{
|
||||
#ifdef __WXGTK4__
|
||||
GdkMonitor* monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
|
||||
GdkRectangle rect;
|
||||
gdk_monitor_get_geometry(monitor, &rect);
|
||||
if (width) *width = rect.width;
|
||||
if (height) *height = rect.height;
|
||||
#else
|
||||
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
|
||||
if (width) *width = gdk_screen_width();
|
||||
if (height) *height = gdk_screen_height();
|
||||
wxGCC_WARNING_RESTORE()
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxDisplaySizeMM( int *width, int *height )
|
||||
{
|
||||
#ifdef __WXGTK4__
|
||||
|
Reference in New Issue
Block a user