]>
Commit | Line | Data |
---|---|---|
bd3239d2 MF |
1 | class QString { |
2 | public: | |
3 | inline QString(const char *ch) : d(fromAscii_helper(ch)) {} | |
4 | private: struct Data {}; | |
5 | Data *d; | |
6 | static Data *fromAscii_helper(const char *str, int size = -1); | |
7 | }; | |
8 | class QGenericArgument {}; | |
9 | class QObject {}; | |
10 | class QWebPage : public QObject { | |
11 | public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const {} | |
12 | class ExtensionOption {}; | |
13 | }; | |
14 | typedef struct {} PyObject; | |
15 | typedef struct {} PyTypeObject; | |
16 | ||
17 | namespace mpl_ { | |
18 | namespace aux {} | |
19 | template< bool C_ > struct bool_; | |
20 | typedef bool_<false> false_; | |
21 | template< bool C_ > struct bool_ { static const bool value = C_; }; | |
22 | template< typename T, T N > struct integral_c { static const T value = N; }; | |
23 | } | |
24 | namespace boost { | |
25 | typedef long long long_long_type; | |
26 | namespace mpl { using namespace mpl_; } | |
27 | } | |
28 | namespace boost { | |
29 | template <class T, T val> struct integral_constant : public mpl::integral_c<T, val> { | |
30 | }; | |
31 | namespace detail { | |
32 | template <typename T> struct cv_traits_imp { | |
33 | typedef T unqualified_type; | |
34 | }; | |
35 | } | |
36 | ||
37 | template< typename T > struct is_reference : ::boost::integral_constant<bool,false> {}; | |
38 | template< typename T > struct remove_cv { | |
39 | typedef typename boost::detail::cv_traits_imp<T*>::unqualified_type type; | |
40 | }; | |
41 | ||
42 | namespace python { | |
43 | namespace detail { | |
44 | typedef char* yes_convertible; | |
45 | typedef int* no_convertible; | |
46 | template <class Target> struct convertible {}; | |
47 | template <class Source, class Target> inline Target* upcast(Source* p, yes_convertible, no_convertible, Target*) {} | |
48 | } | |
49 | } | |
50 | } | |
51 | ||
52 | namespace boost { | |
53 | template< typename T > struct is_integral : ::boost::integral_constant<bool,false> {}; | |
54 | template< typename T > struct is_float : ::boost::integral_constant<bool,false> {}; | |
55 | namespace type_traits { | |
56 | template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false> struct ice_or; | |
57 | template <> struct ice_or<false, false, false, false, false, false, false> { | |
58 | static const bool value = false; | |
59 | }; | |
60 | } | |
61 | namespace detail { | |
62 | template< typename T > struct is_arithmetic_impl { | |
63 | static const bool value = (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_float<T>::value >::value) ; | |
64 | }; | |
65 | } | |
66 | template< typename T > struct is_arithmetic : ::boost::integral_constant<bool,::boost::detail::is_arithmetic_impl<T>::value> { | |
67 | }; | |
68 | namespace type_traits { | |
69 | template <typename T> struct is_mem_fun_pointer_impl { | |
70 | static const bool value = false; | |
71 | }; | |
72 | } | |
73 | template< typename T > struct is_member_function_pointer : ::boost::integral_constant<bool,::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value> { | |
74 | }; | |
75 | template< typename T > struct is_member_pointer : ::boost::integral_constant<bool,::boost::is_member_function_pointer<T>::value> { | |
76 | }; | |
77 | namespace type_traits { | |
78 | template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true> struct ice_and; | |
79 | template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7> struct ice_and { | |
80 | static const bool value = false; | |
81 | }; | |
82 | template <bool b> struct ice_not { | |
83 | static const bool value = true; | |
84 | }; | |
85 | } | |
86 | namespace detail { | |
87 | template< typename T > struct is_pointer_helper { | |
88 | static const bool value = false; | |
89 | }; | |
90 | template< typename T > struct is_pointer_impl { | |
91 | static const bool value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value , ::boost::type_traits::ice_not< ::boost::is_member_pointer<T>::value >::value >::value) ; | |
92 | }; | |
93 | } | |
94 | template< typename T > struct is_pointer : ::boost::integral_constant<bool,::boost::detail::is_pointer_impl<T>::value> { | |
95 | }; | |
96 | template<typename T> class unwrap_reference { | |
97 | }; | |
98 | struct na {}; | |
99 | } | |
100 | namespace boost { | |
101 | namespace mpl { | |
102 | template< bool C , typename T1 , typename T2 > struct if_c { typedef T2 type; }; | |
103 | template< typename T1 = na , typename T2 = na , typename T3 = na > struct if_ { | |
104 | private: typedef if_c< static_cast<bool>(T1::value) , T2 , T3 > almost_type_; | |
105 | public: typedef typename almost_type_::type type; | |
106 | }; | |
107 | } | |
108 | namespace detail { | |
109 | template <typename T> struct is_class_impl { | |
110 | }; | |
111 | } | |
112 | namespace python { | |
113 | namespace detail { | |
114 | template<class T> class borrowed { | |
115 | }; | |
116 | template<typename T> struct is_borrowed_ptr { | |
117 | static const bool value = false; | |
118 | }; | |
119 | } | |
120 | template <class T = PyObject> class handle; | |
121 | template <class T> inline T* incref(T* p) { | |
122 | } | |
123 | template <class T> struct null_ok; | |
124 | namespace detail { | |
125 | template <class T> inline T* manage_ptr(detail::borrowed<null_ok<T> >* p, int) { | |
126 | } | |
127 | } | |
128 | template <class T> class handle { | |
129 | }; | |
130 | template<typename T> class is_handle { | |
131 | public: static const bool value = false; | |
132 | }; | |
133 | } | |
134 | } | |
135 | namespace boost { | |
136 | namespace mpl { | |
137 | template< typename T , typename Base , int at_front = 0 > struct v_item : Base { | |
138 | }; | |
139 | } | |
140 | namespace mpl { | |
141 | template< typename Dummy = na > struct vector0; | |
142 | template< typename T0 > struct vector1 : v_item< T0 , vector0< > > { | |
143 | }; | |
144 | template< typename T0, typename T1 > struct vector2 : v_item< T1 , vector1<T0> > { | |
145 | }; | |
146 | template< typename T0, typename T1, typename T2 > struct vector3 : v_item< T2 , vector2< T0,T1 > > { | |
147 | }; | |
148 | template< typename T0, typename T1, typename T2, typename T3 > struct vector4 : v_item< T3 , vector3< T0,T1,T2 > > { | |
149 | }; | |
150 | template< typename T0, typename T1, typename T2, typename T3, typename T4 > struct vector5 : v_item< T4 , vector4< T0,T1,T2,T3 > > { | |
151 | }; | |
152 | template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct vector6 : v_item< T5 , vector5< T0,T1,T2,T3,T4 > > { | |
153 | }; | |
154 | template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6 > struct vector7 : v_item< T6 , vector6< T0,T1,T2,T3,T4,T5 > > { | |
155 | }; | |
156 | template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7 > struct vector8 : v_item< T7 , vector7< T0,T1,T2,T3,T4,T5,T6 > > { | |
157 | }; | |
158 | template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8 > struct vector9 : v_item< T8 , vector8< T0,T1,T2,T3,T4,T5,T6,T7 > > { | |
159 | }; | |
160 | } | |
161 | namespace noncopyable_ { | |
162 | class noncopyable { | |
163 | }; | |
164 | } | |
165 | typedef noncopyable_::noncopyable noncopyable; | |
166 | namespace detail { | |
167 | template <typename T> class empty_base { | |
168 | }; | |
169 | } | |
170 | template <class T, class U, class B = ::boost::detail::empty_base<T> > struct less_than_comparable2 : B { | |
171 | }; | |
172 | template <class T, class U, class B = ::boost::detail::empty_base<T> > struct equality_comparable2 : B { | |
173 | }; | |
174 | template <class T, class U, class B = ::boost::detail::empty_base<T> > struct totally_ordered2 : less_than_comparable2<T, U , equality_comparable2<T, U, B > > { | |
175 | }; | |
176 | namespace python { | |
177 | struct instance_holder : private noncopyable { | |
178 | }; | |
179 | namespace detail { | |
180 | template <class T> struct is_auto_ptr : mpl::false_ { | |
181 | }; | |
182 | } | |
183 | namespace detail { | |
184 | template <class T> struct copy_ctor_mutates_rhs : is_auto_ptr<T> { | |
185 | }; | |
186 | } | |
187 | } | |
188 | namespace python { | |
189 | namespace detail { | |
190 | template <bool is_ptr = true> struct pointee_impl { | |
191 | }; | |
192 | }; | |
193 | }; | |
194 | namespace python { | |
195 | namespace detail { | |
196 | } | |
197 | } | |
198 | namespace mpl { | |
199 | namespace aux { | |
200 | template< long C_ > struct not_impl : bool_<!C_> { | |
201 | }; | |
202 | } | |
203 | } | |
204 | namespace python { | |
205 | namespace objects { | |
206 | template <class Pointer, class Value> struct pointer_holder_back_reference : instance_holder { | |
207 | pointer_holder_back_reference(Pointer); | |
208 | private: Pointer m_p; | |
209 | }; | |
210 | template <class Pointer, class Value> inline pointer_holder_back_reference<Pointer,Value>::pointer_holder_back_reference(Pointer p) : m_p(p) { | |
211 | } | |
212 | } | |
213 | } | |
214 | namespace detail { | |
215 | class alignment_dummy; | |
216 | typedef void (*function_ptr)(); | |
217 | typedef int (alignment_dummy::*member_ptr); | |
218 | typedef int (alignment_dummy::*member_function_ptr)(); | |
219 | template <bool found, long unsigned int target, class TestType> struct lower_alignment_helper { | |
220 | }; | |
221 | template <typename T> struct has_one_T { | |
222 | }; | |
223 | template <long unsigned int target> union lower_alignment { | |
224 | }; | |
225 | } | |
226 | namespace python { | |
227 | namespace detail { | |
228 | template <long unsigned int size> union aligned_storage { | |
229 | }; | |
230 | } | |
231 | namespace converter { | |
232 | template <class T> struct rvalue_from_python_storage { | |
233 | }; | |
234 | template <class T> struct rvalue_from_python_data : rvalue_from_python_storage<T> { | |
235 | ~rvalue_from_python_data(); | |
236 | }; | |
237 | } | |
238 | } | |
239 | namespace python { | |
240 | template <class T, class MakeHolder> struct to_python_indirect { | |
241 | }; | |
242 | namespace converter { | |
243 | template <class Object, PyTypeObject* pytype> struct pyobject_type { | |
244 | static bool check(PyObject* x) { | |
245 | } | |
246 | }; | |
247 | template <class> struct pyobject_traits; | |
248 | template <class T> struct handle_object_manager_traits : pyobject_traits<typename T::element_type> { | |
249 | static null_ok<typename T::element_type>* adopt(PyObject* p) { | |
250 | } | |
251 | }; | |
252 | template <class T> struct default_object_manager_traits { | |
253 | static const bool is_specialized = python::detail::is_borrowed_ptr<T>::value ; | |
254 | }; | |
255 | template <class T> struct object_manager_traits : mpl::if_c< is_handle<T>::value , handle_object_manager_traits<T> , default_object_manager_traits<T> >::type { | |
256 | }; | |
257 | template <class T> struct is_object_manager : mpl::bool_<object_manager_traits<T>::is_specialized> { | |
258 | }; | |
259 | } | |
260 | namespace detail { | |
261 | template <class X_> struct value_is_shared_ptr { | |
262 | }; | |
263 | } | |
264 | } | |
265 | namespace python { | |
266 | namespace detail { | |
267 | struct signature_element { | |
268 | }; | |
269 | template <unsigned> struct signature_arity; | |
270 | template <> struct signature_arity<11> { | |
271 | template <class Sig> struct impl { | |
272 | }; | |
273 | }; | |
274 | } | |
275 | namespace api { | |
276 | class object; | |
277 | } | |
278 | using api::object; | |
279 | namespace detail { | |
280 | template <class T, class U> struct dependent { | |
281 | }; | |
282 | } | |
283 | } | |
284 | namespace detail{ | |
285 | template <typename T, bool isp, bool b1> struct ct_imp { | |
286 | typedef const T& param_type; | |
287 | }; | |
288 | } | |
289 | template <typename T> struct call_traits { | |
290 | typedef typename boost::detail::ct_imp< T, ::boost::is_pointer<T>::value, ::boost::is_arithmetic<T>::value >::param_type param_type; | |
291 | }; | |
292 | namespace python { | |
293 | namespace detail { | |
294 | } | |
295 | namespace converter { | |
296 | namespace detail { | |
297 | template <class T> struct return_object_manager_from_python { | |
298 | typedef T result_type; | |
299 | result_type operator()(PyObject*) const; | |
300 | }; | |
301 | template <class T> inline T return_object_manager_from_python<T>::operator()(PyObject* obj) const { | |
302 | } | |
303 | } | |
304 | } | |
305 | template <class DerivedVisitor> class def_visitor { | |
306 | }; | |
307 | namespace api { | |
308 | template <class U> class object_operators : public def_visitor<U> { | |
309 | template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12> typename detail::dependent<object, A0>::type operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12) const { | |
310 | } | |
311 | }; | |
312 | struct object_base : object_operators<object> { | |
313 | }; | |
314 | } | |
315 | namespace converter { | |
316 | template <class Ptr> struct extract_pointer { | |
317 | }; | |
318 | template <class Ref> struct extract_reference { | |
319 | }; | |
320 | template <class T> struct extract_rvalue : private noncopyable { | |
321 | typedef typename mpl::if_< python::detail::copy_ctor_mutates_rhs<T> , T& , typename call_traits<T>::param_type >::type result_type; | |
322 | mutable rvalue_from_python_data<T> m_data; | |
323 | }; | |
324 | template <class T> struct extract_object_manager { | |
325 | }; | |
326 | template <class T> struct select_extract { | |
327 | static const bool obj_mgr = is_object_manager<T>::value ; | |
328 | static const bool ptr = is_pointer<T>::value ; | |
329 | static const bool ref = is_reference<T>::value ; | |
330 | typedef typename mpl::if_c< obj_mgr , extract_object_manager<T> , typename mpl::if_c< ptr , extract_pointer<T> , typename mpl::if_c< ref , extract_reference<T> , extract_rvalue<T> >::type >::type >::type type; | |
331 | }; | |
332 | } | |
333 | template <class T> struct extract : converter::select_extract<T>::type { | |
334 | private: typedef typename converter::select_extract<T>::type base; | |
335 | public: typedef typename base::result_type result_type; | |
336 | operator result_type() const {} | |
337 | extract(api::object const&); | |
338 | }; | |
339 | } | |
340 | } | |
341 | ||
342 | struct QHashData { static QHashData shared_null; }; | |
343 | template <class Key, class T> class QHash { | |
344 | QHashData *d; | |
345 | public: inline QHash() : d(&QHashData::shared_null) {} | |
346 | T &operator[](const Key &key); | |
347 | }; | |
348 | ||
349 | namespace PySide { | |
350 | class wrapper {}; | |
351 | template<class T> inline boost::python::handle<> ptr(T* data, bool take_ownership = false) {} | |
352 | class type_details { | |
353 | typedef QGenericArgument(*func_python_to_cpp_type)(const boost::python::object&, const char*); | |
354 | public: template<typename T> static type_details* create_object_type_details(const char* type_name) {} | |
355 | template<typename T> static type_details* create_value_type_details(const char* type_name) { | |
356 | type_details* self = new type_details(); | |
357 | self->m_func_python_to_cpp = &python_to_value_type<T>; | |
358 | } | |
359 | func_python_to_cpp_type m_func_python_to_cpp; | |
360 | template <class T> static QGenericArgument python_to_value_type(const boost::python::object& obj, const char *type_name) { | |
361 | T* val = new T(boost::python::extract<T>(obj)); | |
362 | } | |
363 | }; | |
364 | ||
365 | class type_manager { | |
366 | public: static type_manager& instance(); | |
367 | template<typename T> void register_value_type(const char* type_name) { | |
368 | m_type_map[type_name] = type_details::create_value_type_details<T>(type_name); | |
369 | } | |
370 | QHash<QString, type_details* > m_type_map; | |
371 | }; | |
372 | } | |
373 | using namespace PySide; | |
374 | class qwebpage_extensionoption_wrapper : public QWebPage::ExtensionOption, public PySide::wrapper { | |
375 | static void define_python_class() throw(); | |
376 | }; | |
377 | void qwebpage_extensionoption_wrapper::define_python_class() throw() { | |
378 | type_manager::instance().register_value_type<QWebPage::ExtensionOption >("QWebPage::ExtensionOption"); | |
379 | } |