]>
Commit | Line | Data |
---|---|---|
1 | class QString { | |
2 | public: inline QString(const char *ch) : d(fromAscii_helper(ch)) { | |
3 | } | |
4 | private: struct Data { | |
5 | }; | |
6 | Data *d; | |
7 | static Data *fromAscii_helper(const char *str, int size = -1); | |
8 | }; | |
9 | class QGenericArgument { | |
10 | }; | |
11 | class QObject { | |
12 | }; | |
13 | class QWebPage : public QObject { | |
14 | public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { | |
15 | } | |
16 | class ExtensionOption { | |
17 | }; | |
18 | } | |
19 | PyObject; | |
20 | namespace mpl_ { | |
21 | template< bool C_ > struct bool_; | |
22 | typedef bool_<false> false_; | |
23 | template< bool C_ > struct bool_ { | |
24 | static const bool value = C_; | |
25 | }; | |
26 | template< typename T, T N > struct integral_c { | |
27 | static const T value = N; | |
28 | }; | |
29 | } | |
30 | namespace boost { | |
31 | namespace mpl { | |
32 | using namespace mpl_; | |
33 | } | |
34 | template <class T, T val> struct integral_constant : public mpl::integral_c<T, val> { | |
35 | }; | |
36 | namespace detail { | |
37 | template <typename T> struct cv_traits_imp { | |
38 | typedef T unqualified_type; | |
39 | }; | |
40 | } | |
41 | template< typename T > struct is_reference : ::boost::integral_constant<bool,false> { | |
42 | }; | |
43 | template< typename T > struct remove_cv { | |
44 | typedef typename boost::detail::cv_traits_imp<T*>::unqualified_type type; | |
45 | }; | |
46 | template< typename T > struct is_integral : ::boost::integral_constant<bool,false> { | |
47 | }; | |
48 | template< typename T > struct is_float : ::boost::integral_constant<bool,false> { | |
49 | }; | |
50 | namespace type_traits { | |
51 | template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false> struct ice_or; | |
52 | template <> struct ice_or<false, false, false, false, false, false, false> { | |
53 | static const bool value = false; | |
54 | }; | |
55 | } | |
56 | namespace detail { | |
57 | template< typename T > struct is_arithmetic_impl { | |
58 | static const bool value = (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_float<T>::value >::value) ; | |
59 | }; | |
60 | } | |
61 | template< typename T > struct is_arithmetic : ::boost::integral_constant<bool,::boost::detail::is_arithmetic_impl<T>::value> { | |
62 | }; | |
63 | namespace type_traits { | |
64 | template <typename T> struct is_mem_fun_pointer_impl { | |
65 | static const bool value = false; | |
66 | }; | |
67 | } | |
68 | 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> { | |
69 | }; | |
70 | template< typename T > struct is_member_pointer : ::boost::integral_constant<bool,::boost::is_member_function_pointer<T>::value> { | |
71 | }; | |
72 | namespace type_traits { | |
73 | template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true> struct ice_and; | |
74 | template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7> struct ice_and { | |
75 | static const bool value = false; | |
76 | }; | |
77 | template <bool b> struct ice_not { | |
78 | static const bool value = true; | |
79 | }; | |
80 | } | |
81 | namespace detail { | |
82 | template< typename T > struct is_pointer_helper { | |
83 | static const bool value = false; | |
84 | }; | |
85 | template< typename T > struct is_pointer_impl { | |
86 | 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) ; | |
87 | }; | |
88 | } | |
89 | template< typename T > struct is_pointer : ::boost::integral_constant<bool,::boost::detail::is_pointer_impl<T>::value> { | |
90 | }; | |
91 | struct na { | |
92 | }; | |
93 | namespace mpl { | |
94 | template< bool C , typename T1 , typename T2 > struct if_c { | |
95 | typedef T2 type; | |
96 | }; | |
97 | template< typename T1 = na , typename T2 = na , typename T3 = na > struct if_ { | |
98 | private: typedef if_c< static_cast<bool>(T1::value) , T2 , T3 > almost_type_; | |
99 | public: typedef typename almost_type_::type type; | |
100 | }; | |
101 | } | |
102 | namespace python { | |
103 | namespace detail { | |
104 | template<typename T> struct is_borrowed_ptr { | |
105 | static const bool value = false; | |
106 | }; | |
107 | } | |
108 | template<typename T> class is_handle { | |
109 | public: static const bool value = false; | |
110 | }; | |
111 | } | |
112 | namespace noncopyable_ { | |
113 | class noncopyable { | |
114 | }; | |
115 | } | |
116 | typedef noncopyable_::noncopyable noncopyable; | |
117 | namespace python { | |
118 | namespace detail { | |
119 | template <class T> struct is_auto_ptr : mpl::false_ { | |
120 | }; | |
121 | template <class T> struct copy_ctor_mutates_rhs : is_auto_ptr<T> { | |
122 | }; | |
123 | } | |
124 | namespace converter { | |
125 | template <class T> struct rvalue_from_python_storage { | |
126 | }; | |
127 | template <class T> struct rvalue_from_python_data : rvalue_from_python_storage<T> { | |
128 | ~rvalue_from_python_data(); | |
129 | }; | |
130 | template <class> struct pyobject_traits; | |
131 | template <class T> struct handle_object_manager_traits : pyobject_traits<typename T::element_type> { | |
132 | }; | |
133 | template <class T> struct default_object_manager_traits { | |
134 | static const bool is_specialized = python::detail::is_borrowed_ptr<T>::value ; | |
135 | }; | |
136 | 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 { | |
137 | }; | |
138 | template <class T> struct is_object_manager : mpl::bool_<object_manager_traits<T>::is_specialized> { | |
139 | }; | |
140 | } | |
141 | namespace api { | |
142 | class object; | |
143 | } | |
144 | using api::object; | |
145 | } | |
146 | namespace detail{ | |
147 | template <typename T, bool isp, bool b1> struct ct_imp { | |
148 | typedef const T& param_type; | |
149 | }; | |
150 | } | |
151 | template <typename T> struct call_traits { | |
152 | typedef typename boost::detail::ct_imp< T, ::boost::is_pointer<T>::value, ::boost::is_arithmetic<T>::value >::param_type param_type; | |
153 | }; | |
154 | namespace python { | |
155 | namespace converter { | |
156 | template <class Ptr> struct extract_pointer { | |
157 | }; | |
158 | template <class Ref> struct extract_reference { | |
159 | }; | |
160 | template <class T> struct extract_rvalue : private noncopyable { | |
161 | typedef typename mpl::if_< python::detail::copy_ctor_mutates_rhs<T> , T& , typename call_traits<T>::param_type >::type result_type; | |
162 | mutable rvalue_from_python_data<T> m_data; | |
163 | }; | |
164 | template <class T> struct extract_object_manager { | |
165 | }; | |
166 | template <class T> struct select_extract { | |
167 | static const bool obj_mgr = is_object_manager<T>::value ; | |
168 | static const bool ptr = is_pointer<T>::value ; | |
169 | static const bool ref = is_reference<T>::value ; | |
170 | 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; | |
171 | }; | |
172 | } | |
173 | template <class T> struct extract : converter::select_extract<T>::type { | |
174 | private: typedef typename converter::select_extract<T>::type base; | |
175 | public: typedef typename base::result_type result_type; | |
176 | operator result_type() const { | |
177 | } | |
178 | extract(api::object const&); | |
179 | }; | |
180 | } | |
181 | } | |
182 | struct QHashData { | |
183 | static QHashData shared_null; | |
184 | }; | |
185 | template <class Key, class T> class QHash { | |
186 | QHashData *d; | |
187 | public: inline QHash() : d(&QHashData::shared_null) { | |
188 | } | |
189 | T &operator[](const Key &key); | |
190 | }; | |
191 | namespace PySide { | |
192 | class wrapper { | |
193 | }; | |
194 | class type_details { | |
195 | typedef QGenericArgument(*func_python_to_cpp_type)(const boost::python::object&, const char*); | |
196 | public: template<typename T> static type_details* create_object_type_details(const char* type_name) { | |
197 | } | |
198 | template<typename T> static type_details* create_value_type_details(const char* type_name) { | |
199 | type_details* self = new type_details(); | |
200 | self->m_func_python_to_cpp = &python_to_value_type<T>; | |
201 | } | |
202 | func_python_to_cpp_type m_func_python_to_cpp; | |
203 | template <class T> static QGenericArgument python_to_value_type(const boost::python::object& obj, const char *type_name) { | |
204 | T* val = new T(boost::python::extract<T>(obj)); | |
205 | } | |
206 | }; | |
207 | class type_manager { | |
208 | public: static type_manager& instance(); | |
209 | template<typename T> void register_value_type(const char* type_name) { | |
210 | m_type_map[type_name] = type_details::create_value_type_details<T>(type_name); | |
211 | } | |
212 | QHash<QString, type_details* > m_type_map; | |
213 | }; | |
214 | } | |
215 | using namespace PySide; | |
216 | class qwebpage_extensionoption_wrapper : public QWebPage::ExtensionOption, public PySide::wrapper { | |
217 | static void define_python_class() throw(); | |
218 | }; | |
219 | void qwebpage_extensionoption_wrapper::define_python_class() throw() { | |
220 | type_manager::instance().register_value_type<QWebPage::ExtensionOption >("QWebPage::ExtensionOption"); | |
221 | } |