diff options
author | Kai Huuhko <kai.huuhko@gmail.com> | 2016-08-16 09:54:59 +0300 |
---|---|---|
committer | Kai Huuhko <kai.huuhko@gmail.com> | 2016-08-16 10:11:34 +0300 |
commit | b2af779d7d416df654c690f2de077f5eeb6e72b9 (patch) | |
tree | 1ff847124c16fbd1f48603c677ecf43b1e3ebf51 /include/efl.ecore_con.pxd | |
parent | 4bd421562d2c2403ef2000ce3d903b991eae7f6e (diff) |
Switch enums to use the old system we had previously
This allows us to support Cython 0.23+
Diffstat (limited to 'include/efl.ecore_con.pxd')
-rw-r--r-- | include/efl.ecore_con.pxd | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/include/efl.ecore_con.pxd b/include/efl.ecore_con.pxd new file mode 100644 index 0000000..3617c6d --- /dev/null +++ b/include/efl.ecore_con.pxd | |||
@@ -0,0 +1,147 @@ | |||
1 | # Copyright (C) 2007-2016 various contributors (see AUTHORS) | ||
2 | # | ||
3 | # This file is part of Python-EFL. | ||
4 | # | ||
5 | # Python-EFL is free software; you can redistribute it and/or | ||
6 | # modify it under the terms of the GNU Lesser General Public | ||
7 | # License as published by the Free Software Foundation; either | ||
8 | # version 3 of the License, or (at your option) any later version. | ||
9 | # | ||
10 | # Python-EFL is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | # Lesser General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU Lesser General Public License | ||
16 | # along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | |||
19 | from efl.eina cimport * | ||
20 | from efl.c_eo cimport Eo as cEo | ||
21 | from efl.eo cimport Eo, object_from_instance | ||
22 | from efl.ecore cimport Ecore_Event_Handler, Event | ||
23 | from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list | ||
24 | |||
25 | from efl.ecore_con.enums cimport Ecore_Con_Type, Ecore_Con_Url_Time, \ | ||
26 | Ecore_Con_Url_Http_Version | ||
27 | |||
28 | cdef extern from "Ecore_Con.h": | ||
29 | |||
30 | # where is this defined in real ? | ||
31 | cdef struct sockaddr: | ||
32 | pass | ||
33 | |||
34 | # defines | ||
35 | int ECORE_CON_EVENT_URL_COMPLETE | ||
36 | int ECORE_CON_EVENT_URL_PROGRESS | ||
37 | int ECORE_CON_EVENT_URL_DATA | ||
38 | |||
39 | # typedefs | ||
40 | ctypedef cEo Ecore_Con_Url | ||
41 | |||
42 | ctypedef struct Ecore_Con_Event_Url_Progress_SubParam: | ||
43 | double total | ||
44 | double now | ||
45 | |||
46 | ctypedef struct Ecore_Con_Event_Url_Progress: | ||
47 | Ecore_Con_Url *url_con | ||
48 | Ecore_Con_Event_Url_Progress_SubParam down | ||
49 | Ecore_Con_Event_Url_Progress_SubParam up | ||
50 | |||
51 | ctypedef struct Ecore_Con_Event_Url_Data: | ||
52 | Ecore_Con_Url *url_con | ||
53 | int size | ||
54 | unsigned char *data | ||
55 | |||
56 | ctypedef struct Ecore_Con_Event_Url_Complete: | ||
57 | Ecore_Con_Url *url_con | ||
58 | int status | ||
59 | |||
60 | ctypedef void (*Ecore_Con_Dns_Cb)(const char *canonname, const char *ip, | ||
61 | sockaddr *addr, int addrlen, void *data) | ||
62 | |||
63 | |||
64 | # functions | ||
65 | int ecore_con_init() | ||
66 | int ecore_con_shutdown() | ||
67 | # Ecore_Con_Server *ecore_con_server_connect(Ecore_Con_Type type, const char *name, int port, const void *data) | ||
68 | |||
69 | int ecore_con_url_init() | ||
70 | int ecore_con_url_shutdown() | ||
71 | void ecore_con_url_pipeline_set(Eina_Bool enable) | ||
72 | Eina_Bool ecore_con_url_pipeline_get() | ||
73 | Eina_Bool ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done_cb, const void *data) | ||
74 | |||
75 | Ecore_Con_Url *ecore_con_url_new(const char *url) | ||
76 | void ecore_con_url_free(Ecore_Con_Url *url_obj) | ||
77 | Ecore_Con_Url * ecore_con_url_custom_new(const char *url, const char *custom_request) | ||
78 | void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, Eina_Bool verbose) | ||
79 | Eina_Bool ecore_con_url_http_version_set(Ecore_Con_Url *url_con, Ecore_Con_Url_Http_Version version) | ||
80 | void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout) | ||
81 | int ecore_con_url_status_code_get(Ecore_Con_Url *url_con) | ||
82 | Eina_Bool ecore_con_url_get(Ecore_Con_Url *url_con) | ||
83 | Eina_Bool ecore_con_url_head(Ecore_Con_Url *url_con) | ||
84 | Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, const void *data, long length, const char *content_type) | ||
85 | Eina_Bool ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, const char *filename, const char *user, const char *passwd, const char *upload_dir) | ||
86 | void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, Eina_Bool use_epsv) | ||
87 | |||
88 | Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *obj, const char *url) | ||
89 | const char *ecore_con_url_url_get(const Ecore_Con_Url *obj) | ||
90 | void ecore_con_url_fd_set(Ecore_Con_Url *url_con, int fd) | ||
91 | |||
92 | void ecore_con_url_additional_header_add(Ecore_Con_Url *url_con, const char *key, const char *value) | ||
93 | void ecore_con_url_additional_headers_clear(Ecore_Con_Url *url_con) | ||
94 | const Eina_List *ecore_con_url_response_headers_get(Ecore_Con_Url *url_con) | ||
95 | int ecore_con_url_received_bytes_get(Ecore_Con_Url *url_con) | ||
96 | Eina_Bool ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const char *username, const char *password, Eina_Bool safe) | ||
97 | void ecore_con_url_time(Ecore_Con_Url *url_con, Ecore_Con_Url_Time time_condition, double timestamp) | ||
98 | |||
99 | void ecore_con_url_cookies_init(Ecore_Con_Url *url_con) | ||
100 | void ecore_con_url_cookies_clear(Ecore_Con_Url *url_con) | ||
101 | void ecore_con_url_cookies_session_clear(Ecore_Con_Url *url_con) | ||
102 | void ecore_con_url_cookies_ignore_old_session_set(Ecore_Con_Url *url_con, Eina_Bool ignore) | ||
103 | void ecore_con_url_cookies_file_add(Ecore_Con_Url *url_con, const char *file_name) | ||
104 | Eina_Bool ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con, const char *cookiejar_file) | ||
105 | void ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_con) | ||
106 | |||
107 | void ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con, Eina_Bool verify) | ||
108 | int ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, const char *ca_path) | ||
109 | |||
110 | Eina_Bool ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char *proxy) | ||
111 | Eina_Bool ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, const char *username) | ||
112 | Eina_Bool ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password) | ||
113 | |||
114 | |||
115 | cdef class Url(Eo): | ||
116 | pass | ||
117 | |||
118 | cdef class Lookup(object): | ||
119 | cdef object done_cb | ||
120 | cdef tuple args | ||
121 | cdef dict kargs | ||
122 | |||
123 | cdef class EventUrlComplete(Event): | ||
124 | cdef readonly Url url | ||
125 | cdef readonly int status | ||
126 | |||
127 | |||
128 | cdef class EventUrlProgress(Event): | ||
129 | cdef readonly Url url | ||
130 | cdef readonly double down_total | ||
131 | cdef readonly double down_now | ||
132 | cdef readonly double up_total | ||
133 | cdef readonly double up_now | ||
134 | |||
135 | |||
136 | cdef class EventUrlData(Event): | ||
137 | cdef readonly Url url | ||
138 | cdef readonly int size | ||
139 | cdef readonly bytes data | ||
140 | |||
141 | |||
142 | cdef class ConEventFilter(object): | ||
143 | cdef dict callbacks | ||
144 | cdef dict handlers | ||
145 | cdef callback_add(self, int ev_type, Eo obj, object func, tuple args, dict kargs) | ||
146 | cdef callback_del(self, int ev_type, Eo obj, object func, tuple args, dict kargs) | ||
147 | cdef callback_del_full(self, Eo obj) | ||