diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index 574eaba7731e6c7076e08b5d2962a38278860f50..9f0ea59b6044bf62a2099622fb626f27c97e4a39 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -114,6 +114,7 @@ double cvGetOpenGlProp_W32(const char* name); double cvGetOpenGlProp_GTK(const char* name); double cvGetPropVisible_W32(const char* name); +double cvGetPropVisible_COCOA(const char* name); double cvGetPropTopmost_W32(const char* name); double cvGetPropTopmost_COCOA(const char* name); diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index dd70fd2456ba896cfe367ded0a749cd22088145b..2e528fe8e58381b54b0aa6233a2ed97c6d4d92ad 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -366,6 +366,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) return cvGetPropVisible_QT(name); #elif defined(HAVE_WIN32UI) return cvGetPropVisible_W32(name); + #elif defined(HAVE_COCOA) + return cvGetPropVisible_COCOA(name); #else return -1; #endif diff --git a/modules/highgui/src/window_cocoa.mm b/modules/highgui/src/window_cocoa.mm index 3f46d47de7b51d574e052461745f31966fd57378..07c1ed86d2a658950e5a6eeef2a453477273d8a4 100644 --- a/modules/highgui/src/window_cocoa.mm +++ b/modules/highgui/src/window_cocoa.mm @@ -740,6 +740,31 @@ void cvSetModeWindow_COCOA( const char* name, double prop_value ) __END__; } +double cvGetPropVisible_COCOA(const char* name) +{ + double result = -1; + CVWindow* window = nil; + + CV_FUNCNAME("cvGetPropVisible_COCOA"); + + __BEGIN__; + if (name == NULL) + { + CV_ERROR(CV_StsNullPtr, "NULL name string"); + } + + window = cvGetWindow(name); + if (window == NULL) + { + CV_ERROR(CV_StsNullPtr, "NULL window"); + } + + result = window.isVisible ? 1 : 0; + + __END__; + return result; +} + double cvGetPropTopmost_COCOA(const char* name) { double result = -1;