Remove Qt surface

It's disabled by default, and unsupported as it depends on Qt4, which
has been EOL since 2015.
This commit is contained in:
Emmanuele Bassi 2021-04-17 23:41:13 +01:00
parent 4fc72919e1
commit 64ece6d545
15 changed files with 0 additions and 2012 deletions

View file

@ -27,7 +27,6 @@ cairo_boilerplate_wgl_sources = cairo-boilerplate-wgl.c
cairo_boilerplate_egl_sources = cairo-boilerplate-egl.c
cairo_boilerplate_pdf_sources = cairo-boilerplate-pdf.c
cairo_boilerplate_ps_sources = cairo-boilerplate-ps.c
cairo_boilerplate_qt_cxx_sources = cairo-boilerplate-qt.cpp
cairo_boilerplate_quartz_sources = cairo-boilerplate-quartz.c
cairo_boilerplate_script_sources = cairo-boilerplate-script.c
cairo_boilerplate_skia_sources = cairo-boilerplate-skia.c

View file

@ -79,18 +79,6 @@ enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_shm_cxx_sources
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_shm_sources)
endif
unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
all_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
all_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
all_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
ifeq ($(CAIRO_HAS_QT_SURFACE),1)
enabled_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
enabled_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
endif
supported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_private)

View file

@ -1,114 +0,0 @@
/* Cairo - a vector graphics library with display and print output
*
* Copyright © 2009 Chris Wilson
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* (the "LGPL") or, at your option, under the terms of the Mozilla
* Public License Version 1.1 (the "MPL"). If you do not alter this
* notice, a recipient may use your version of this file under either
* the MPL or the LGPL.
*
* You should have received a copy of the LGPL along with this library
* in the file COPYING-LGPL-2.1; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
* You should have received a copy of the MPL along with this library
* in the file COPYING-MPL-1.1
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
* the specific language governing rights and limitations.
*
* The Original Code is the cairo graphics library.
*
* The Initial Developer of the Original Code is Chris Wilson.
*/
#include "cairo-boilerplate-private.h"
#include <cairo-qt.h>
#include <qapplication.h>
#include <X11/Xlib.h>
typedef struct _qt_closure {
Display *dpy;
QApplication *app;
} qt_closure_t;
static void
_cairo_boilerplate_qt_cleanup (void *closure)
{
qt_closure_t *qtc = (qt_closure_t *) closure;
delete qtc->app;
XCloseDisplay (qtc->dpy);
free (qtc);
}
static cairo_surface_t *
_cairo_boilerplate_qt_create_surface (const char *name,
cairo_content_t content,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
void **closure)
{
qt_closure_t *qtc;
qtc = (qt_closure_t *) xcalloc (1, sizeof (qt_closure_t));
qtc->dpy = XOpenDisplay (NULL);
if (qtc->dpy == NULL) {
free (qtc);
return NULL;
}
if (mode == CAIRO_BOILERPLATE_MODE_TEST)
XSynchronize (qtc->dpy, True);
qtc->app = new QApplication (qtc->dpy);
*closure = qtc;
return cairo_qt_surface_create_with_qpixmap (content, width, height);
}
static void
_cairo_boilerplate_qt_synchronize (void *closure)
{
qt_closure_t *qtc = (qt_closure_t *) closure;
qtc->app->flush (); /* not sure if this is sufficient */
}
static const cairo_boilerplate_target_t targets[] = {
{
"qt", "qt", NULL, NULL,
CAIRO_SURFACE_TYPE_QT, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_qt_surface_create",
_cairo_boilerplate_qt_create_surface,
NULL, NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
_cairo_boilerplate_qt_cleanup
},
{
"qt", "qt", NULL, NULL,
CAIRO_SURFACE_TYPE_QT, CAIRO_CONTENT_COLOR, 0,
"cairo_qt_surface_create",
_cairo_boilerplate_qt_create_surface,
NULL, NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
_cairo_boilerplate_qt_cleanup
},
};
extern "C" {
CAIRO_BOILERPLATE (qt, targets)
}

View file

@ -6,7 +6,6 @@ cairo_boilerplate_sources = [
cairo_boilerplate_feature_sources = {
'cairo-xlib': ['cairo-boilerplate-xlib.c'],
'cairo-qt': ['cairo-boilerplate-qt.cpp'],
'cairo-quartz': ['cairo-boilerplate-quartz.c'],
'cairo-xcb': ['cairo-boilerplate-xcb.c'],
'cairo-win32': ['cairo-boilerplate-win32.c', 'cairo-boilerplate-win32-printing.c'],

View file

@ -5,7 +5,6 @@ CAIRO_HAS_XLIB_XRENDER_SURFACE=0
CAIRO_HAS_XCB_SURFACE=0
CAIRO_HAS_XLIB_XCB_FUNCTIONS=0
CAIRO_HAS_XCB_SHM_FUNCTIONS=0
CAIRO_HAS_QT_SURFACE=0
CAIRO_HAS_QUARTZ_SURFACE=0
CAIRO_HAS_QUARTZ_FONT=0
CAIRO_HAS_QUARTZ_IMAGE_SURFACE=0

View file

@ -20,9 +20,6 @@ endif
ifeq ($(CAIRO_HAS_XCB_SHM_FUNCTIONS),1)
@echo "#define CAIRO_HAS_XCB_SHM_FUNCTIONS 1" >> $(top_srcdir)/src/cairo-features.h
endif
ifeq ($(CAIRO_HAS_QT_SURFACE),1)
@echo "#define CAIRO_HAS_QT_SURFACE 1" >> $(top_srcdir)/src/cairo-features.h
endif
ifeq ($(CAIRO_HAS_QUARTZ_SURFACE),1)
@echo "#define CAIRO_HAS_QUARTZ_SURFACE 1" >> $(top_srcdir)/src/cairo-features.h
endif

View file

@ -374,7 +374,6 @@ AC_DEFUN([CAIRO_REPORT],
#echo " Skia: $use_skia"
echo " Xlib: $use_xlib"
echo " Xlib Xrender: $use_xlib_xrender"
echo " Qt: $use_qt"
echo " Quartz: $use_quartz"
echo " Quartz-image: $use_quartz_image"
echo " XCB: $use_xcb"

View file

@ -190,18 +190,6 @@ CAIRO_ENABLE_FUNCTIONS(xcb_shm, XCB/SHM, auto, [
dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(qt, Qt, no, [
dnl Keep in sync with meson.build!
qt_REQUIRES="QtGui >= 4.4.0"
PKG_CHECK_MODULES(qt, $qt_REQUIRES, ,
[qt_REQUIRES=""
use_qt="no (requires Qt4 development libraries)"
])
qt_NONPKGCONFIG_LIBS="-lstdc++"
])
dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(quartz, Quartz, auto, [
dnl There is no pkgconfig for quartz; lets do a header check
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, , [use_quartz="no (requires ApplicationServices framework)"])
@ -882,7 +870,6 @@ dnl ===========================================================================
dnl Extra stuff we need to do when building C++ code
need_cxx="no"
AS_IF([test "x$use_qt" = "xyes"], [need_cxx="yes"])
AS_IF([test "x$use_beos" = "xyes"], [need_cxx="yes"])
AM_CONDITIONAL(BUILD_CXX, test "x$need_cxx" = "xyes")

View file

@ -10,7 +10,6 @@ fontconfig_required_version = '>= 2.2.95'
xrender_required_version = '>= 0.6'
xcb_required_version = '>= 1.6'
xcb_render_required_version = '>= 1.6'
qtgui_required_version = '>= 4.4.0'
libudev_required_version = '>= 136'
libdrm_required_version = '>= 2.4'
glib_required_version = '>= 2.14'
@ -450,20 +449,6 @@ if feature_conf.get('CAIRO_HAS_XCB_SURFACE', 0) == 1
endif
endif
# Tests crash and burn
qtgui_dep = dependency('QtGui', required: get_option('qt'),
version: qtgui_required_version)
if qtgui_dep.found() and false
feature_conf.set('CAIRO_HAS_QT_SURFACE', 1)
built_features += [{
'name': 'cairo-qt',
'description': 'Qt surface backend',
'deps': [qtgui_dep],
}]
deps += [qtgui_dep]
endif
if host_machine.system() == 'darwin' and not get_option('quartz').disabled()
quartz_deps = dependency('appleframeworks', modules : ['CoreFoundation', 'ApplicationServices'], required: get_option('quartz'))
@ -1003,7 +988,6 @@ summary({
'XML': feature_conf.get('CAIRO_HAS_XML_SURFACE', 0) == 1,
'Xlib': feature_conf.get('CAIRO_HAS_XLIB_SURFACE', 0) == 1,
'Xlib Xrender': feature_conf.get('CAIRO_HAS_XLIB_XRENDER_SURFACE', 0) == 1,
'Qt': feature_conf.get('CAIRO_HAS_QT_SURFACE', 0) == 1,
'Quartz': feature_conf.get('CAIRO_HAS_QUARTZ_SURFACE', 0) == 1,
'Quartz-image': feature_conf.get('CAIRO_HAS_QUARTZ_IMAGE_SURFACE', 0) == 1,
'XCB': feature_conf.get('CAIRO_HAS_XCB_SURFACE', 0) == 1,

View file

@ -14,7 +14,6 @@ option('drm', type : 'feature', value : 'disabled')
option('openvg', type : 'feature', value : 'disabled')
option('png', type : 'feature', value : 'auto') # png and svg surfaces
option('quartz', type : 'feature', value : 'auto')
option('qt', type : 'feature', value : 'disabled')
option('tee', type : 'feature', value : 'disabled')
option('xcb', type : 'feature', value : 'auto')
option('xlib', type : 'feature', value : 'auto')

View file

@ -337,9 +337,6 @@ cairo_xcb_sources = \
cairo-xcb-resources.c \
$(NULL)
cairo_qt_headers = cairo-qt.h
cairo_qt_cxx_sources = cairo-qt-surface.cpp
cairo_quartz_headers = cairo-quartz.h
cairo_quartz_private = cairo-quartz-private.h
cairo_quartz_sources = cairo-quartz-surface.c

View file

@ -101,22 +101,6 @@ ifeq ($(CAIRO_HAS_XCB_SHM_FUNCTIONS),1)
enabled_cairo_pkgconf += cairo-xcb-shm.pc
endif
unsupported_cairo_headers += $(cairo_qt_headers)
all_cairo_headers += $(cairo_qt_headers)
all_cairo_private += $(cairo_qt_private)
all_cairo_cxx_sources += $(cairo_qt_cxx_sources)
all_cairo_sources += $(cairo_qt_sources)
ifeq ($(CAIRO_HAS_QT_SURFACE),1)
enabled_cairo_headers += $(cairo_qt_headers)
enabled_cairo_private += $(cairo_qt_private)
enabled_cairo_cxx_sources += $(cairo_qt_cxx_sources)
enabled_cairo_sources += $(cairo_qt_sources)
endif
all_cairo_pkgconf += cairo-qt.pc
ifeq ($(CAIRO_HAS_QT_SURFACE),1)
enabled_cairo_pkgconf += cairo-qt.pc
endif
supported_cairo_headers += $(cairo_quartz_headers)
all_cairo_headers += $(cairo_quartz_headers)
all_cairo_private += $(cairo_quartz_private)

File diff suppressed because it is too large Load diff

View file

@ -1,85 +0,0 @@
/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
/* cairo - a vector graphics library with display and print output
*
* Copyright © 2008 Mozilla Corporation
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* (the "LGPL") or, at your option, under the terms of the Mozilla
* Public License Version 1.1 (the "MPL"). If you do not alter this
* notice, a recipient may use your version of this file under either
* the MPL or the LGPL.
*
* You should have received a copy of the LGPL along with this library
* in the file COPYING-LGPL-2.1; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
* You should have received a copy of the MPL along with this library
* in the file COPYING-MPL-1.1
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
* the specific language governing rights and limitations.
*
* The Original Code is the cairo graphics library.
*
* The Initial Developer of the Original Code is Mozilla Corporation.
*
* Contributor(s):
* Vladimir Vukicevic <vladimir@mozilla.com>
*/
#ifndef CAIRO_QT_H
#define CAIRO_QT_H
#include "cairo.h"
#if CAIRO_HAS_QT_SURFACE
#include <QtGui/QImage>
#include <QtGui/QPainter>
CAIRO_BEGIN_DECLS
cairo_public cairo_surface_t *
cairo_qt_surface_create (QPainter *painter);
cairo_public cairo_surface_t *
cairo_qt_surface_create_with_qimage (cairo_format_t format,
int width,
int height);
cairo_public cairo_surface_t *
cairo_qt_surface_create_with_qpixmap (cairo_content_t content,
int width,
int height);
cairo_public QPainter *
cairo_qt_surface_get_qpainter (cairo_surface_t *surface);
/* XXX needs hooking to generic surface layer, my vote is for
cairo_public cairo_surface_t *
cairo_surface_map_image (cairo_surface_t *surface);
cairo_public void
cairo_surface_unmap_image (cairo_surface_t *surface, cairo_surface_t *image);
*/
cairo_public cairo_surface_t *
cairo_qt_surface_get_image (cairo_surface_t *surface);
cairo_public QImage *
cairo_qt_surface_get_qimage (cairo_surface_t *surface);
CAIRO_END_DECLS
#else /* CAIRO_HAS_QT_SURFACE */
# error Cairo was not compiled with support for the Qt backend
#endif /* CAIRO_HAS_QT_SURFACE */
#endif /* CAIRO_QT_H */

View file

@ -156,9 +156,6 @@ cairo_feature_sources = {
'cairo-xcb-surface-render.c',
'cairo-xcb-resources.c',
],
'cairo-qt': [
'cairo-qt-surface.cpp',
],
'cairo-quartz': [
'cairo-quartz-surface.c',
],
@ -264,7 +261,6 @@ cairo_feature_headers = {
'cairo-xlib': ['cairo-xlib.h'],
'cairo-xlib-xrender': ['cairo-xlib-xrender.h'],
'cairo-xcb': ['cairo-xcb.h'],
'cairo-qt': ['cairo-qt.h'],
'cairo-quartz': ['cairo-quartz.h'],
'cairo-quartz-image': ['cairo-quartz-image.h'],
'cairo-win32': ['cairo-win32.h'],