aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtHttpServer
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/QtHttpServer')
-rw-r--r--sources/pyside6/PySide6/QtHttpServer/CMakeLists.txt40
-rw-r--r--sources/pyside6/PySide6/QtHttpServer/typesystem_httpserver.xml38
2 files changed, 78 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtHttpServer/CMakeLists.txt b/sources/pyside6/PySide6/QtHttpServer/CMakeLists.txt
new file mode 100644
index 000000000..c931f064f
--- /dev/null
+++ b/sources/pyside6/PySide6/QtHttpServer/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+project(QtHttpServer)
+
+set(QtHttpServer_SRC
+ ${QtHttpServer_GEN_DIR}/qabstracthttpserver_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qfuturehttpserverresponse_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserver_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserverresponder_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserverrequest_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserverresponse_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserverrouter_wrapper.cpp
+ ${QtHttpServer_GEN_DIR}/qhttpserverrouterrule_wrapper.cpp
+# module is always needed
+ ${QtHttpServer_GEN_DIR}/qthttpserver_module_wrapper.cpp)
+
+set(QtHttpServer_include_dirs ${QtHttpServer_SOURCE_DIR}
+ ${QtHttpServer_BINARY_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Concurrent_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}WebSockets_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtConcurrent_GEN_DIR}
+ ${QtNetwork_GEN_DIR}
+ ${QtWebSockets_GEN_DIR})
+
+set(QtHttpServer_libraries pyside6
+ ${Qt${QT_MAJOR_VERSION}HttpServer_LIBRARIES})
+
+set(QtHttpServer_deps QtCore QtConcurrent QtNetwork QtWebSockets)
+
+create_pyside_module(NAME QtHttpServer
+ INCLUDE_DIRS QtHttpServer_include_dirs
+ LIBRARIES QtHttpServer_libraries
+ DEPS QtHttpServer_deps
+ TYPESYSTEM_PATH QtHttpServer_SOURCE_DIR
+ SOURCES QtHttpServer_SRC)
diff --git a/sources/pyside6/PySide6/QtHttpServer/typesystem_httpserver.xml b/sources/pyside6/PySide6/QtHttpServer/typesystem_httpserver.xml
new file mode 100644
index 000000000..026a8758a
--- /dev/null
+++ b/sources/pyside6/PySide6/QtHttpServer/typesystem_httpserver.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+-->
+<typesystem package="PySide6.QtHttpServer"
+ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
+ <load-typesystem name="QtConcurrent/typesystem_concurrent.xml" generate="no"/>
+ <load-typesystem name="QtWebSockets/typesystem_websockets.xml" generate="no"/>
+
+ <typedef-type name="QFutureHttpServerResponse" source="QFuture&lt;QHttpServerResponse&gt;"/>
+ <!-- virtual void missingHandler(const QHttpServerRequest &, QHttpServerResponder &&) = 0 -->
+ <object-type name="QAbstractHttpServer" disable-wrapper="yes"/>
+ <object-type name="QHttpServer">
+ <extra-includes>
+ <include file-name="QtHttpServer/QHttpServerRequest" location="global"/>
+ <include file-name="QtHttpServer/QHttpServerRouterRule" location="global"/>
+ </extra-includes>
+ <add-function signature="route(const QString &amp;@rule@, PyCallable @callback@)"
+ return-type="bool">
+ <inject-code class="target" position="beginning" file="../glue/qhttpserver.cpp"
+ snippet="qhttpserver-route"/>
+ </add-function>
+ <add-function signature="afterRequest(PyCallable @callback@)">
+ <inject-code class="target" position="beginning" file="../glue/qhttpserver.cpp"
+ snippet="qhttpserver-afterrequest"/>
+ </add-function>
+ </object-type>
+ <object-type name="QHttpServerResponder">
+ <enum-type name="StatusCode"/>
+ </object-type>
+ <object-type name="QHttpServerRequest">
+ <enum-type name="Method" flags="Methods"/>
+ </object-type>
+ <object-type name="QHttpServerResponse"/>
+ <object-type name="QHttpServerRouter"/>
+ <object-type name="QHttpServerRouterRule"/>
+</typesystem>