-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Add cv::currentUIFramework #25354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cv::currentUIFramework #25354
Conversation
|
@opencv-alalek |
modules/highgui/src/backend.hpp
Outdated
|
|
||
| virtual int waitKeyEx(int delay /*= 0*/) = 0; | ||
| virtual int pollKey() = 0; | ||
| virtual std::string currentUIFramework() = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual const std::string getName() const = 0;
modules/highgui/src/window.cpp
Outdated
| { | ||
| return backend->currentUIFramework(); | ||
| } | ||
| return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return std::string(); instead of ""
Anyway where should be large #if switch for COCOA / QT and others "builtin" backends.
Check cv::setWindowTitle implementation as reference.
|
|
||
| std::string currentUIFramework() | ||
| { | ||
| return "WIN32"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be implemented for GTK2/3 too.
| */ | ||
| CV_EXPORTS_W void destroyAllWindows(); | ||
|
|
||
| CV_EXPORTS_W std::string currentUIFramework(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::string
|
Finally I wonder why not used getBuildInformation output to create a dictionnary? |
| CV_Error(Error::StsNotImplemented, "The function is not implemented with this GUI. "); | ||
| return std::string(); | ||
| #elif defined(HAVE_WIN32UI) | ||
| auto backend = getCurrentUIBackend(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the problem with scheme similar to setWindowTitle?
Only one branch should try "plugin" interface. Other are builtins and they are pre-defined constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope I understang plugins well
|
Added test, fixes, and rebased on 4.x branch. |
Add cv::currentUIFramework opencv#25354 issue opencv#25329 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Pull Request Readiness Checklist
issue #25329
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.