highgui: drop obsolete Carbon API

https://en.wikipedia.org/wiki/Carbon_(API)

In 2012, with the release of OS X 10.8 Mountain Lion, most Carbon APIs were considered deprecated.
pull/13073/head
Alexander Alekhin 6 years ago
parent b17e1531d2
commit b059a361dd
  1. 9
      CMakeLists.txt
  2. 6
      cmake/OpenCVFindLibsGUI.cmake
  3. 3
      cmake/templates/cvconfig.h.in
  4. 3
      modules/highgui/CMakeLists.txt
  5. 3
      modules/highgui/src/precomp.hpp
  6. 11
      modules/highgui/src/window.cpp
  7. 2
      modules/highgui/src/window_QT.cpp
  8. 1155
      modules/highgui/src/window_carbon.cpp
  9. 2
      modules/highgui/test/test_gui.cpp

@ -220,7 +220,6 @@ OCV_OPTION(BUILD_ITT "Build Intel ITT from source" NOT MIN
# ===================================================
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON IF APPLE)
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa (OBSOLETE)" OFF IF APPLE )
OCV_OPTION(WITH_CAROTENE "Use NVidia carotene acceleration library for ARM platform" ON IF (ARM OR AARCH64) AND NOT IOS AND NOT (CMAKE_VERSION VERSION_LESS "2.8.11"))
OCV_OPTION(WITH_CPUFEATURES "Use cpufeatures Android library" ON IF ANDROID)
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT CMAKE_CROSSCOMPILING) )
@ -1157,12 +1156,8 @@ if(WITH_WIN32UI)
status(" Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
endif()
if(APPLE)
if(WITH_CARBON)
status(" Carbon:" YES)
else()
status(" Cocoa:" YES)
endif()
if(HAVE_COCOA) # APPLE
status(" Cocoa:" YES)
endif()
if(WITH_GTK OR HAVE_GTK)

@ -80,11 +80,9 @@ if(WITH_OPENGL)
endif()
endif(WITH_OPENGL)
# --- Carbon & Cocoa ---
# --- Cocoa ---
if(APPLE)
if(WITH_CARBON)
set(HAVE_CARBON YES)
elseif(NOT IOS AND CV_CLANG)
if(NOT IOS AND CV_CLANG)
set(HAVE_COCOA YES)
endif()
endif()

@ -31,9 +31,6 @@
/* V4L2 capturing support */
#cmakedefine HAVE_CAMV4L2
/* Carbon windowing environment */
#cmakedefine HAVE_CARBON
/* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS

@ -120,9 +120,6 @@ elseif(HAVE_WIN32UI)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_w32.cpp)
elseif(HAVE_GTK OR HAVE_GTK3)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_gtk.cpp)
elseif(HAVE_CARBON)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_carbon.cpp)
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime")
elseif(HAVE_COCOA)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_cocoa.mm)
list(APPEND HIGHGUI_LIBRARIES "-framework Cocoa")

@ -86,18 +86,15 @@
//Yannick Verdie 2010, Max Kostin 2015
void cvSetModeWindow_W32(const char* name, double prop_value);
void cvSetModeWindow_GTK(const char* name, double prop_value);
void cvSetModeWindow_CARBON(const char* name, double prop_value);
void cvSetModeWindow_COCOA(const char* name, double prop_value);
void cvSetModeWindow_WinRT(const char* name, double prop_value);
CvRect cvGetWindowRect_W32(const char* name);
CvRect cvGetWindowRect_GTK(const char* name);
CvRect cvGetWindowRect_CARBON(const char* name);
CvRect cvGetWindowRect_COCOA(const char* name);
double cvGetModeWindow_W32(const char* name);
double cvGetModeWindow_GTK(const char* name);
double cvGetModeWindow_CARBON(const char* name);
double cvGetModeWindow_COCOA(const char* name);
double cvGetModeWindow_WinRT(const char* name);

@ -61,8 +61,6 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
cvSetModeWindow_W32(name,prop_value);
#elif defined (HAVE_GTK)
cvSetModeWindow_GTK(name,prop_value);
#elif defined (HAVE_CARBON)
cvSetModeWindow_CARBON(name,prop_value);
#elif defined (HAVE_COCOA)
cvSetModeWindow_COCOA(name,prop_value);
#elif defined (WINRT)
@ -103,8 +101,6 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
return cvGetModeWindow_W32(name);
#elif defined (HAVE_GTK)
return cvGetModeWindow_GTK(name);
#elif defined (HAVE_CARBON)
return cvGetModeWindow_CARBON(name);
#elif defined (HAVE_COCOA)
return cvGetModeWindow_COCOA(name);
#elif defined (WINRT)
@ -176,8 +172,6 @@ cv::Rect cvGetWindowImageRect(const char* name)
return cvGetWindowRect_W32(name);
#elif defined (HAVE_GTK)
return cvGetWindowRect_GTK(name);
#elif defined (HAVE_CARBON)
return cvGetWindowRect_CARBON(name);
#elif defined (HAVE_COCOA)
return cvGetWindowRect_COCOA(name);
#else
@ -582,7 +576,6 @@ int cv::createButton(const String&, ButtonCallback, void*, int , bool )
#if defined (HAVE_WIN32UI) // see window_w32.cpp
#elif defined (HAVE_GTK) // see window_gtk.cpp
#elif defined (HAVE_COCOA) // see window_cocoa.mm
#elif defined (HAVE_CARBON) // see window_carbon.cpp
#elif defined (HAVE_QT) // see window_QT.cpp
#elif defined (WINRT) && !defined (WINRT_8_0) // see window_winrt.cpp
@ -598,14 +591,14 @@ int cv::createButton(const String&, ButtonCallback, void*, int , bool )
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 Carbon support. "
"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. " \
"Rebuild the library with Windows, GTK+ 2.x or Carbon support. "\
"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", \
funcname, __FILE__, __LINE__)

@ -1039,7 +1039,7 @@ void GuiReceiver::showImage(QString name, void* arr)
{
QPointer<CvWindow> w = icvFindWindowByName(name);
if (!w) //as observed in the previous implementation (W32, GTK or Carbon), create a new window is the pointer returned is null
if (!w) //as observed in the previous implementation (W32, GTK), create a new window is the pointer returned is null
{
cvNamedWindow(name.toLatin1().data());
w = icvFindWindowByName(name);

File diff suppressed because it is too large Load Diff

@ -44,7 +44,7 @@
namespace opencv_test { namespace {
#if defined HAVE_GTK || defined HAVE_QT || defined HAVE_WIN32UI || defined HAVE_CARBON || defined HAVE_COCOA
#if defined HAVE_GTK || defined HAVE_QT || defined HAVE_WIN32UI || defined HAVE_COCOA
class CV_HighGuiOnlyGuiTest : public cvtest::BaseTest
{

Loading…
Cancel
Save