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