|
|
|
@ -586,6 +586,46 @@ void cv::moveWindow( const String& winname, int x, int y ) |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void cv::setWindowTitle(const String& winname, const String& title) |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
cv::AutoLock lock(cv::getWindowMutex()); |
|
|
|
|
auto window = findWindow_(winname); |
|
|
|
|
if (window) |
|
|
|
|
{ |
|
|
|
|
return window->setTitle(title); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if defined(OPENCV_HIGHGUI_WITHOUT_BUILTIN_BACKEND) && defined(ENABLE_PLUGINS) |
|
|
|
|
auto backend = getCurrentUIBackend(); |
|
|
|
|
if (backend) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "Can't find window with name: '" << winname << "'. Do nothing"); |
|
|
|
|
CV_NOT_FOUND_DEPRECATION; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "No UI backends available. Use OPENCV_LOG_LEVEL=DEBUG for investigation"); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
#elif defined(HAVE_WIN32UI) |
|
|
|
|
return setWindowTitle_W32(winname, title); |
|
|
|
|
#elif defined (HAVE_GTK) |
|
|
|
|
return setWindowTitle_GTK(winname, title); |
|
|
|
|
#elif defined (HAVE_QT) |
|
|
|
|
return setWindowTitle_QT(winname, title); |
|
|
|
|
#elif defined (HAVE_COCOA) |
|
|
|
|
return setWindowTitle_COCOA(winname, title); |
|
|
|
|
#else |
|
|
|
|
CV_Error(Error::StsNotImplemented, "The function is not implemented. " |
|
|
|
|
"Rebuild the library with Windows, GTK+ 2.x or Cocoa support. " |
|
|
|
|
"If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void cv::setWindowProperty(const String& winname, int prop_id, double prop_value) |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
@ -630,9 +670,9 @@ int cv::waitKey(int delay) |
|
|
|
|
return (code != -1) ? (code & 0xff) : -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if defined(HAVE_QT) || (defined (WINRT) && !defined (WINRT_8_0)) || \ |
|
|
|
|
!defined(HAVE_WIN32UI) && (defined(HAVE_GTK) || defined(HAVE_COCOA)) |
|
|
|
|
// pollKey() fallback implementation
|
|
|
|
|
/*
|
|
|
|
|
* process until queue is empty but don't wait. |
|
|
|
|
*/ |
|
|
|
|
int cv::pollKey() |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
@ -646,12 +686,13 @@ int cv::pollKey() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if defined(HAVE_WIN32UI) |
|
|
|
|
return pollKey_W32(); |
|
|
|
|
#else |
|
|
|
|
// fallback. please implement a proper polling function
|
|
|
|
|
return cvWaitKey(1); |
|
|
|
|
} |
|
|
|
|
#elif defined(HAVE_WIN32UI) |
|
|
|
|
// pollKey() implemented in window_w32.cpp
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int cv::createTrackbar(const String& trackbarName, const String& winName, |
|
|
|
|
int* value, int count, TrackbarCallback callback, |
|
|
|
@ -1203,13 +1244,6 @@ int cv::createButton(const String&, ButtonCallback, void*, int , bool ) |
|
|
|
|
// version with a more capable one without a need to recompile dependent
|
|
|
|
|
// applications or libraries.
|
|
|
|
|
|
|
|
|
|
void cv::setWindowTitle(const String&, const String&) |
|
|
|
|
{ |
|
|
|
|
CV_Error(Error::StsNotImplemented, "The function is not implemented. " |
|
|
|
|
"Rebuild the library with Windows, GTK+ 2.x or Cocoa support. " |
|
|
|
|
"If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#define CV_NO_GUI_ERROR(funcname) \ |
|
|
|
|
cv::error(cv::Error::StsError, \
|
|
|
|
|
"The function is not implemented. " \
|
|
|
|
@ -1360,11 +1394,6 @@ CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int) |
|
|
|
|
CV_NO_GUI_ERROR("cvCreateButton"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int cv::pollKey() |
|
|
|
|
{ |
|
|
|
|
CV_NO_GUI_ERROR("cv::pollKey()"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* End of file. */ |
|
|
|
|