Implemented support to MSG type on windows.
This commit is contained in:
parent
3e88ef1c54
commit
23d1e497d8
6 changed files with 144 additions and 2 deletions
|
|
@ -36,6 +36,17 @@ else()
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_WIN)
|
||||||
|
set(QtCore_typesystem "typesystem_core_win.xml")
|
||||||
|
set(QtCore_extra_SRC
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/msg_wrapper.cpp
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/point_wrapper.cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(QtCore_typesystem "typesystem_core.xml")
|
||||||
|
set(QtCore_extra_SRC "")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(QtCore_SRC
|
set(QtCore_SRC
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractfileengine_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractfileengine_wrapper.cpp
|
||||||
|
|
@ -135,6 +146,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamreader_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamwriter_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamwriter_wrapper.cpp
|
||||||
${QtCore_46_SRC}
|
${QtCore_46_SRC}
|
||||||
${QtCore_47_SRC}
|
${QtCore_47_SRC}
|
||||||
|
${QtCore_extra_SRC}
|
||||||
)
|
)
|
||||||
|
|
||||||
set(QtCore_typesystem_path "")
|
set(QtCore_typesystem_path "")
|
||||||
|
|
@ -155,4 +167,5 @@ create_pyside_module(QtCore
|
||||||
""
|
""
|
||||||
QtCore_typesystem_path
|
QtCore_typesystem_path
|
||||||
QtCore_SRC
|
QtCore_SRC
|
||||||
QtCore_gluecode)
|
QtCore_gluecode
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/${QtCore_typesystem})
|
||||||
|
|
|
||||||
32
PySide/QtCore/glue/hwnd_conversions.h
Normal file
32
PySide/QtCore/glue/hwnd_conversions.h
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
namespace Shiboken {
|
||||||
|
template <>
|
||||||
|
struct Converter<HWND__>
|
||||||
|
{
|
||||||
|
static bool checkType(PyObject* pyObj)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isConvertible(PyObject* pyobj)
|
||||||
|
{
|
||||||
|
return PyCObject_Check(pyobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline PyObject* toPython(void* cppobj)
|
||||||
|
{
|
||||||
|
// not supported
|
||||||
|
Q_ASSERT(true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject* toPython(HWND__ cppobj)
|
||||||
|
{
|
||||||
|
return PyCObject_FromVoidPtr(&cppobj, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HWND__ toCpp(PyObject* pyobj)
|
||||||
|
{
|
||||||
|
return *((HWND__*) PyCObject_AsVoidPtr(pyobj));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2477,6 +2477,29 @@
|
||||||
<define-ownership owner="c++"/>
|
<define-ownership owner="c++"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
|
<modify-function signature="winEventFilter(MSG*, long*)">
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument />
|
||||||
|
<conversion-rule class="native">
|
||||||
|
long *%out = new long;
|
||||||
|
%out = 0;
|
||||||
|
</conversion-rule>
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="return">
|
||||||
|
<replace-type modified-type="PyObject"/>
|
||||||
|
<conversion-rule class="native">
|
||||||
|
%RETURN_TYPE %out = false;
|
||||||
|
if (PySequence_Check(%PYARG_0) && (PySequence_Size(%PYARG_0) == 2)) {
|
||||||
|
Shiboken::AutoDecRef pyResult(PySequence_GetItem(%PYARG_0, 0));
|
||||||
|
%out = %CONVERTTOCPP[bool](pyResult);
|
||||||
|
}
|
||||||
|
</conversion-rule>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code position="end">
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(%0, *result_out);
|
||||||
|
delete result_out;
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
</object-type>
|
</object-type>
|
||||||
<object-type name="QSettings">
|
<object-type name="QSettings">
|
||||||
<enum-type name="Format"/>
|
<enum-type name="Format"/>
|
||||||
|
|
@ -3243,7 +3266,6 @@
|
||||||
<suppress-warning text="Unable to decide type of property: 'QLibrary::LoadHints' in class 'QPluginLoader'" />
|
<suppress-warning text="Unable to decide type of property: 'QLibrary::LoadHints' in class 'QPluginLoader'" />
|
||||||
<suppress-warning text="enum '_ISalnum' does not have a type entry or is not an enum" />
|
<suppress-warning text="enum '_ISalnum' does not have a type entry or is not an enum" />
|
||||||
<suppress-warning text="enum 'Qt::Initialization' does not have a type entry or is not an enum" />
|
<suppress-warning text="enum 'Qt::Initialization' does not have a type entry or is not an enum" />
|
||||||
<suppress-warning text="skipping function '*'"/>
|
|
||||||
<suppress-warning text="visibility of function '*' modified in class '*'"/>
|
<suppress-warning text="visibility of function '*' modified in class '*'"/>
|
||||||
<suppress-warning text="hiding of function '*' in class '*'"/>
|
<suppress-warning text="hiding of function '*' in class '*'"/>
|
||||||
<suppress-warning text="namespace '*' does not have a type entry"/>
|
<suppress-warning text="namespace '*' does not have a type entry"/>
|
||||||
|
|
@ -3272,4 +3294,16 @@
|
||||||
|
|
||||||
<!-- this enum is defined on Qt global header but only used in QtGui module -->
|
<!-- this enum is defined on Qt global header but only used in QtGui module -->
|
||||||
<suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum" />
|
<suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum" />
|
||||||
|
|
||||||
|
<!-- this function only exists on Windows -->
|
||||||
|
<suppress-warning text="signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found. Possible candidates:*"/>
|
||||||
|
|
||||||
|
<!-- this is necessary to avoid warning on other modules -->
|
||||||
|
<suppress-warning text="signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found. Possible candidates: *"/>
|
||||||
|
<suppress-warning text="signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found. Possible candidates: *"/>
|
||||||
|
|
||||||
|
<!-- TODO: this need be removed -->
|
||||||
|
<suppress-warning text="skipping function '*', unmatched return type '*'"/>
|
||||||
|
<suppress-warning text="skipping function '*', unmatched parameter type '*'"/>
|
||||||
|
|
||||||
</typesystem>
|
</typesystem>
|
||||||
|
|
|
||||||
35
PySide/QtCore/typesystem_core_win.xml
Normal file
35
PySide/QtCore/typesystem_core_win.xml
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
This file is part of PySide project.
|
||||||
|
Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
Contact: PySide team <contact@pyside.org>
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
-->
|
||||||
|
<typesystem package="PySide.QtCore">
|
||||||
|
<primitive-type name="HWND__">
|
||||||
|
<conversion-rule file="glue/hwnd_conversions.h"/>
|
||||||
|
</primitive-type>
|
||||||
|
<value-type name="POINT">
|
||||||
|
<include file-name="wtypes.h" location="global"/>
|
||||||
|
</value-type>
|
||||||
|
<value-type name="MSG">
|
||||||
|
<include file-name="wtypes.h" location="global"/>
|
||||||
|
</value-type>
|
||||||
|
<suppress-warning text="class 'MSG' inherits from unknown base class 'tagMSG'"/>
|
||||||
|
<suppress-warning text="class not found for setup inheritance 'tagMSG'"/>
|
||||||
|
<load-typesystem name="typesystem_core.xml" generate="yes"/>
|
||||||
|
</typesystem>
|
||||||
|
|
||||||
|
|
@ -319,6 +319,7 @@ QT_END_HEADER
|
||||||
#elif @ENABLE_MAC@
|
#elif @ENABLE_MAC@
|
||||||
#define Q_WS_MAC
|
#define Q_WS_MAC
|
||||||
#elif @ENABLE_WIN@
|
#elif @ENABLE_WIN@
|
||||||
|
#include "pysidewtypes.h"
|
||||||
#define Q_WS_WIN
|
#define Q_WS_WIN
|
||||||
#elif @ENABLE_SIMULATOR@
|
#elif @ENABLE_SIMULATOR@
|
||||||
#define Q_WS_SIMULATOR
|
#define Q_WS_SIMULATOR
|
||||||
|
|
|
||||||
27
PySide/pysidewtypes.h
Normal file
27
PySide/pysidewtypes.h
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef __PYSIDEWTYPES__
|
||||||
|
#define __PYSIDEWTYPES__
|
||||||
|
|
||||||
|
typedef struct HWND__ *HWND;
|
||||||
|
typedef unsigned UINT;
|
||||||
|
typedef long LONG;
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
typedef UINT WPARAM;
|
||||||
|
typedef LONG LPARAM;
|
||||||
|
|
||||||
|
struct POINT
|
||||||
|
{
|
||||||
|
LONG x;
|
||||||
|
LONG y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MSG
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
UINT message;
|
||||||
|
WPARAM wParam;
|
||||||
|
LPARAM lParam;
|
||||||
|
DWORD time;
|
||||||
|
POINT pt;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue