summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2012-06-22 06:11:10 +0000
committerKai Huuhko <kai.huuhko@gmail.com>2012-06-22 06:11:10 +0000
commite90cfc7b068ec52c8a96ea3a81fb645971472e3d (patch)
tree8357878fc2165df8ed2fbb6e424dc7804fc7cbda
parent9e27cff59ed810967ad1b9390076298615a30230 (diff)
python-ethumb: Resurrection. Compiles but broken still.
SVN revision: 72685
-rw-r--r--INSTALL15
-rw-r--r--ethumb/__init__.py18
-rw-r--r--ethumb/ethumb.c_ethumb.pyx17
-rw-r--r--ethumb/ethumb.client.pyx26
-rwxr-xr-xexamples/01-simple.py2
-rw-r--r--include/ethumb/c_ethumb.pxd114
-rw-r--r--include/ethumb/client.pxd129
7 files changed, 234 insertions, 87 deletions
diff --git a/INSTALL b/INSTALL
index 7d1c323..6e90e07 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
1Installation Instructions 1Installation Instructions
2************************* 2*************************
3 3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 4Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
52006, 2007, 2008, 2009 Free Software Foundation, Inc. 5Inc.
6 6
7 Copying and distribution of this file, with or without modification, 7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright 8are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
226 226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX. 227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228 228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as 235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended 236a workaround. If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script). 309overridden in the site shell script).
305 310
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to 311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround: 312an Autoconf limitation. Until the limitation is lifted, you can use
313this workaround:
308 314
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
310 316
311`configure' Invocation 317`configure' Invocation
312====================== 318======================
@@ -362,4 +368,3 @@ operates.
362 368
363`configure' also accepts some other, not widely useful, options. Run 369`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details. 370`configure --help' for more details.
365
diff --git a/ethumb/__init__.py b/ethumb/__init__.py
index 8898d9b..d8d3e48 100644
--- a/ethumb/__init__.py
+++ b/ethumb/__init__.py
@@ -15,8 +15,16 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17 17
18from c_ethumb import shutdown, Ethumb, ETHUMB_THUMB_NORMAL, \ 18from c_ethumb import init, shutdown, PyEthumb
19 ETHUMB_THUMB_LARGE, ETHUMB_THUMB_FDO, ETHUMB_THUMB_JPEG, \ 19
20 ETHUMB_THUMB_EET, \ 20ETHUMB_THUMB_NORMAL = 0
21 ETHUMB_THUMB_KEEP_ASPECT, ETHUMB_THUMB_IGNORE_ASPECT, \ 21ETHUMB_THUMB_LARGE = 1
22 ETHUMB_THUMB_CROP 22
23ETHUMB_THUMB_FDO = 0
24ETHUMB_THUMB_JPEG = 1
25ETHUMB_THUMB_EET = 2
26
27ETHUMB_THUMB_KEEP_ASPECT = 0
28ETHUMB_THUMB_IGNORE_ASPECT = 1
29ETHUMB_THUMB_CROP = 2
30
diff --git a/ethumb/ethumb.c_ethumb.pyx b/ethumb/ethumb.c_ethumb.pyx
index dfd9d1a..80db58a 100644
--- a/ethumb/ethumb.c_ethumb.pyx
+++ b/ethumb/ethumb.c_ethumb.pyx
@@ -15,28 +15,13 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17 17
18__extra_epydoc_fields__ = (
19 ("parm", "Parameter", "Parameters"), # epydoc don't support pyrex properly
20 )
21
22def init(): 18def init():
23 return ethumb_init() 19 return ethumb_init()
24 20
25def shutdown(): 21def shutdown():
26 ethumb_shutdown() 22 ethumb_shutdown()
27 23
28ETHUMB_THUMB_NORMAL = 0 24cdef class PyEthumb:
29ETHUMB_THUMB_LARGE = 1
30
31ETHUMB_THUMB_FDO = 0
32ETHUMB_THUMB_JPEG = 1
33ETHUMB_THUMB_EET = 2
34
35ETHUMB_THUMB_KEEP_ASPECT = 0
36ETHUMB_THUMB_IGNORE_ASPECT = 1
37ETHUMB_THUMB_CROP = 2
38
39cdef class Ethumb:
40 """Ethumb thumbnail generator""" 25 """Ethumb thumbnail generator"""
41 def __init__(self): 26 def __init__(self):
42 """Ethumb constructor.""" 27 """Ethumb constructor."""
diff --git a/ethumb/ethumb.client.pyx b/ethumb/ethumb.client.pyx
index 63f05d0..b827926 100644
--- a/ethumb/ethumb.client.pyx
+++ b/ethumb/ethumb.client.pyx
@@ -18,10 +18,6 @@
18from cpython cimport PyObject, Py_INCREF, Py_DECREF 18from cpython cimport PyObject, Py_INCREF, Py_DECREF
19import traceback 19import traceback
20 20
21__extra_epydoc_fields__ = (
22 ("parm", "Parameter", "Parameters"), # epydoc don't support pyrex properly
23 )
24
25def shutdown(): 21def shutdown():
26 ethumb_client_shutdown() 22 ethumb_client_shutdown()
27 23
@@ -75,6 +71,10 @@ cdef void _generated_cb_free_data(void *data) with gil:
75 obj = <object>data 71 obj = <object>data
76 Py_DECREF(obj) 72 Py_DECREF(obj)
77 73
74cdef void _thumb_exists_cb(void *data, Ethumb_Client *client, Ethumb_Exists *thread, Eina_Bool exists) with gil:
75 #TODO
76 pass
77
78cdef char *str_to_c(object s): 78cdef char *str_to_c(object s):
79 cdef char *mystr 79 cdef char *mystr
80 if s is None: 80 if s is None:
@@ -163,7 +163,7 @@ cdef class Client:
163 return ("%s(file=(%r, %r), thumb=(%r, %r), exists=%s, size=%dx%d, " 163 return ("%s(file=(%r, %r), thumb=(%r, %r), exists=%s, size=%dx%d, "
164 "format=%s, aspect=%s, quality=%d, compress=%d, " 164 "format=%s, aspect=%s, quality=%d, compress=%d, "
165 "directory=%r, category=%r)") % \ 165 "directory=%r, category=%r)") % \
166 (self.__class__.__name__, f, k, tf, tk, self.exists(), 166 (self.__class__.__name__, f, k, tf, tk, self.thumb_exists(),
167 w, h, format, aspect, self.quality, self.compress, 167 w, h, format, aspect, self.quality, self.compress,
168 self.directory, self.category) 168 self.directory, self.category)
169 169
@@ -544,13 +544,25 @@ cdef class Client:
544 def document_page_set(self, int page): 544 def document_page_set(self, int page):
545 ethumb_client_document_page_set(self.obj, page) 545 ethumb_client_document_page_set(self.obj, page)
546 546
547 def exists(self): 547 def thumb_exists(self, callback = None, *args, **kwargs):
548 """Checks if thumbnail already exists. 548 """Checks if thumbnail already exists.
549 549
550 If you want to avoid regenerating thumbnails, check if they 550 If you want to avoid regenerating thumbnails, check if they
551 already exist with this function. 551 already exist with this function.
552
552 """ 553 """
553 return bool(ethumb_client_thumb_exists(self.obj)) 554 cdef Ethumb_Client_Thumb_Exists_Cb cb = NULL
555 cdef Ethumb_Exists *res
556
557 if callback:
558 if not callable(callback):
559 raise TypeError("callback is not callable")
560 cb = _thumb_exists_cb
561
562 data = (args, kwargs)
563 res = ethumb_client_thumb_exists(self.obj, cb, <void *>data)
564 return False
565 #TODO: handle return value
554 566
555 def generate(self, func, *args, **kargs): 567 def generate(self, func, *args, **kargs):
556 """Ask EThumb server to generate the specified thumbnail. 568 """Ask EThumb server to generate the specified thumbnail.
diff --git a/examples/01-simple.py b/examples/01-simple.py
index 4ecc7e9..8e8770a 100755
--- a/examples/01-simple.py
+++ b/examples/01-simple.py
@@ -13,7 +13,7 @@ def pop_existent(client, files):
13 f = files.pop() 13 f = files.pop()
14 client.file_set(f) 14 client.file_set(f)
15 print client 15 print client
16 if not client.exists(): 16 if not client.thumb_exists():
17 return f 17 return f
18 tf, tk = client.thumb_path 18 tf, tk = client.thumb_path
19 print "%s already thumbnailed %s, %s" % (f, tf, tk) 19 print "%s already thumbnailed %s, %s" % (f, tf, tk)
diff --git a/include/ethumb/c_ethumb.pxd b/include/ethumb/c_ethumb.pxd
index 6ae6883..856652b 100644
--- a/include/ethumb/c_ethumb.pxd
+++ b/include/ethumb/c_ethumb.pxd
@@ -15,15 +15,119 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17 17
18cdef extern from *:
19 ctypedef char* const_char_ptr "const_char_ptr "
20
21cdef extern from "Eina.h":
22 ctypedef int Eina_Bool
23 ctypedef void (*Eina_Free_Cb)(void *data)
24
18cdef extern from "Ethumb.h": 25cdef extern from "Ethumb.h":
19 cdef struct _Ethumb: 26 cdef struct Ethumb:
20 int tw 27 int tw
21 int th 28 int th
22 int format 29 int format
23 int aspect 30 int aspect
24 31
25 int ethumb_init() 32 ctypedef void (*Ethumb_Generate_Cb)(void *data, Ethumb *e, Eina_Bool success)
26 void ethumb_shutdown() 33
34 # Ethumb
35 int ethumb_init()
36 void ethumb_shutdown()
37 Ethumb *ethumb_new()
38 void ethumb_free(Ethumb *e)
39
40 # Setup
41 Eina_Bool ethumb_frame_set(Ethumb *e, const_char_ptr theme_file, const_char_ptr group, const_char_ptr swallow)
42 void ethumb_frame_get(Ethumb *e, const_char_ptr *theme_file, const_char_ptr *group, const_char_ptr *swallow)
43
44 void ethumb_thumb_dir_path_set(Ethumb *e, const_char_ptrpath)
45 const_char_ptr ethumb_thumb_dir_path_get(Ethumb *e)
46
47 void ethumb_thumb_category_set(Ethumb *e, const_char_ptrcategory)
48 const_char_ptr ethumb_thumb_category_get(Ethumb *e)
49
50 void ethumb_thumb_path_set(Ethumb *e, const_char_ptrpath, const_char_ptrkey)
51 void ethumb_thumb_path_get(Ethumb *e, const_char_ptr*path, const_char_ptr*key)
52 void ethumb_thumb_hash(Ethumb *e)
53 void ethumb_thumb_hash_copy(Ethumb *dst, Ethumb *src)
54
55 ctypedef enum Ethumb_Thumb_FDO_Size:
56 ETHUMB_THUMB_NORMAL
57 ETHUMB_THUMB_LARGE
58
59 ctypedef enum Ethumb_Thumb_Format:
60 ETHUMB_THUMB_FDO
61 ETHUMB_THUMB_JPEG
62 ETHUMB_THUMB_EET
63
64 ctypedef enum Ethumb_Thumb_Aspect:
65 ETHUMB_THUMB_KEEP_ASPECT
66 ETHUMB_THUMB_IGNORE_ASPECT
67 ETHUMB_THUMB_CROP
68
69 ctypedef enum Ethumb_Thumb_Orientation:
70 ETHUMB_THUMB_ORIENT_NONE
71 ETHUMB_THUMB_ROTATE_90_CW
72 ETHUMB_THUMB_ROTATE_180
73 ETHUMB_THUMB_ROTATE_90_CCW
74 ETHUMB_THUMB_FLIP_HORIZONTAL
75 ETHUMB_THUMB_FLIP_VERTICAL
76 ETHUMB_THUMB_FLIP_TRANSPOSE
77 ETHUMB_THUMB_FLIP_TRANSVERSE
78 ETHUMB_THUMB_ORIENT_ORIGINAL
79
80 void ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s)
81
82 void ethumb_thumb_size_set(Ethumb *e, int tw, int th)
83 void ethumb_thumb_size_get(Ethumb *e, int *tw, int *th)
84
85 void ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f)
86 Ethumb_Thumb_Format ethumb_thumb_format_get(Ethumb *e)
87
88 void ethumb_thumb_aspect_set(Ethumb *e, Ethumb_Thumb_Aspect a)
89 Ethumb_Thumb_Aspect ethumb_thumb_aspect_get(Ethumb *e)
90
91 void ethumb_thumb_orientation_set(Ethumb *e, Ethumb_Thumb_Orientation o)
92 Ethumb_Thumb_Orientation ethumb_thumb_orientation_get(Ethumb *e)
93
94 void ethumb_thumb_crop_align_set(Ethumb *e, float x, float y)
95 void ethumb_thumb_crop_align_get(Ethumb *e, float *x, float *y)
96
97 void ethumb_thumb_quality_set(Ethumb *e, int quality)
98 int ethumb_thumb_quality_get(Ethumb *e)
99
100 void ethumb_thumb_compress_set(Ethumb *e, int compress)
101 int ethumb_thumb_compress_get(Ethumb *e)
102
103 void ethumb_video_start_set(Ethumb *e, float start)
104 float ethumb_video_start_get(Ethumb *e)
105 void ethumb_video_time_set(Ethumb *e, float time)
106 float ethumb_video_time_get(Ethumb *e)
107 void ethumb_video_interval_set(Ethumb *e, float interval)
108 float ethumb_video_interval_get(Ethumb *e)
109 void ethumb_video_ntimes_set(Ethumb *e, unsigned int ntimes)
110 unsigned int ethumb_video_ntimes_get(Ethumb *e)
111 void ethumb_video_fps_set(Ethumb *e, unsigned int fps)
112 unsigned int ethumb_video_fps_get(Ethumb *e)
113
114 # Basics
115 void ethumb_document_page_set(Ethumb *e, unsigned int page)
116 unsigned int ethumb_document_page_get(Ethumb *e)
117
118 Eina_Bool ethumb_file_set(Ethumb *e, const_char_ptr path, const_char_ptr key)
119 void ethumb_file_get(Ethumb *e, const_char_ptr *path, const_char_ptr *key)
120 void ethumb_file_free(Ethumb *e)
121
122 Eina_Bool ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, void *data, Eina_Free_Cb free_data)
123 Eina_Bool ethumb_exists(Ethumb *e)
124
125 Ethumb *ethumb_dup(Ethumb *e)
126 Eina_Bool ethumb_cmp(Ethumb *e1, Ethumb *e2)
127 int ethumb_hash(void *key, int key_length)
128 int ethumb_key_cmp(void *key1, int key1_length, void *key2, int key2_length)
129 unsigned int ethumb_length(void *key)
130
27 131
28cdef class Ethumb: 132cdef class PyEthumb:
29 cdef _Ethumb *obj 133 cdef Ethumb *obj
diff --git a/include/ethumb/client.pxd b/include/ethumb/client.pxd
index 02d4dfc..9dab1c8 100644
--- a/include/ethumb/client.pxd
+++ b/include/ethumb/client.pxd
@@ -2,13 +2,13 @@
2# 2#
3# This file is part of Python-Ethumb. 3# This file is part of Python-Ethumb.
4# 4#
5# Python-Ethumb is free software; you can redistribute it and/or 5# Python-Ethumb is free software you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public 6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either 7# License as published by the Free Software Foundation either
8# version 2.1 of the License, or (at your option) any later version. 8# version 2.1 of the License, or (at your option) any later version.
9# 9#
10# Python-Ethumb is distributed in the hope that it will be useful, 10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# but WITHOUT ANY WARRANTY without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details. 13# Lesser General Public License for more details.
14# 14#
@@ -20,58 +20,91 @@ cdef extern from *:
20 20
21cdef extern from "Eina.h": 21cdef extern from "Eina.h":
22 ctypedef int Eina_Bool 22 ctypedef int Eina_Bool
23 ctypedef void (*Eina_Free_Cb)(void *data)
24
25cdef extern from "Ethumb.h":
26 ctypedef enum Ethumb_Thumb_Orientation:
27 ETHUMB_THUMB_ORIENT_NONE
28 ETHUMB_THUMB_ROTATE_90_CW
29 ETHUMB_THUMB_ROTATE_180
30 ETHUMB_THUMB_ROTATE_90_CCW
31 ETHUMB_THUMB_FLIP_HORIZONTAL
32 ETHUMB_THUMB_FLIP_VERTICAL
33 ETHUMB_THUMB_FLIP_TRANSPOSE
34 ETHUMB_THUMB_FLIP_TRANSVERSE
35 ETHUMB_THUMB_ORIENT_ORIGINAL
23 36
24cdef extern from "Ethumb_Client.h": 37cdef extern from "Ethumb_Client.h":
25 ctypedef struct Ethumb_Client 38 ctypedef struct Ethumb_Client
39 ctypedef struct Ethumb_Exists
26 ctypedef void (*Ethumb_Client_Connect_Cb)(void *data, Ethumb_Client *client, Eina_Bool success) 40 ctypedef void (*Ethumb_Client_Connect_Cb)(void *data, Ethumb_Client *client, Eina_Bool success)
27 ctypedef void (*Ethumb_Client_Die_Cb)(void *data, Ethumb_Client *client) 41 ctypedef void (*Ethumb_Client_Die_Cb)(void *data, Ethumb_Client *client)
28 ctypedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int id, char *file, char *key, char *thumb_path, char *thumb_key, Eina_Bool success) 42 ctypedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int id, const_char_ptr file, const_char_ptr key, const_char_ptr thumb_path, const_char_ptr thumb_key, Eina_Bool success)
43 ctypedef void (*Ethumb_Client_Thumb_Exists_Cb)(void *data, Ethumb_Client *client, Ethumb_Exists *thread, Eina_Bool exists)
29 ctypedef void (*Ethumb_Client_Generate_Cancel_Cb)(void *data, Eina_Bool success) 44 ctypedef void (*Ethumb_Client_Generate_Cancel_Cb)(void *data, Eina_Bool success)
30 ctypedef void (*Eina_Free_Cb)(void *data)
31 45
32 int ethumb_client_init() 46 int ethumb_client_init()
33 int ethumb_client_shutdown() 47 int ethumb_client_shutdown()
34 48
35 Ethumb_Client *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data) 49 Ethumb_Client *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data)
36 void ethumb_client_disconnect(Ethumb_Client *client) 50 void ethumb_client_disconnect(Ethumb_Client *client)
37 void ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb_Client_Die_Cb server_die_cb, void *data, Eina_Free_Cb free_data) 51 void ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb_Client_Die_Cb server_die_cb, void *data, Eina_Free_Cb free_data)
38 52
39 void ethumb_client_fdo_set(Ethumb_Client *client, int s) 53 void ethumb_client_fdo_set(Ethumb_Client *client, int s)
40 54
41 void ethumb_client_size_set(Ethumb_Client *client, int tw, int th) 55 void ethumb_client_size_set(Ethumb_Client *client, int tw, int th)
42 void ethumb_client_size_get(Ethumb_Client *client, int *tw, int *th) 56 void ethumb_client_size_get(Ethumb_Client *client, int *tw, int *th)
43 void ethumb_client_format_set(Ethumb_Client *client, int f) 57 void ethumb_client_format_set(Ethumb_Client *client, int f)
44 int ethumb_client_format_get(Ethumb_Client *client) 58 int ethumb_client_format_get(Ethumb_Client *client)
45 void ethumb_client_aspect_set(Ethumb_Client *client, int a) 59 void ethumb_client_aspect_set(Ethumb_Client *client, int a)
46 int ethumb_client_aspect_get(Ethumb_Client *client) 60 int ethumb_client_aspect_get(Ethumb_Client *client)
47 void ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y) 61 void ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o)
48 void ethumb_client_crop_align_get(Ethumb_Client *client, float *x, float *y) 62 Ethumb_Thumb_Orientation ethumb_client_orientation_get(Ethumb_Client *client)
49 void ethumb_client_quality_set(Ethumb_Client *client, int quality) 63 void ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y)
50 int ethumb_client_quality_get(Ethumb_Client *client) 64 void ethumb_client_crop_align_get(Ethumb_Client *client, float *x, float *y)
51 void ethumb_client_compress_set(Ethumb_Client *client, int compress) 65 void ethumb_client_quality_set(Ethumb_Client *client, int quality)
52 int ethumb_client_compress_get(Ethumb_Client *client) 66 int ethumb_client_quality_get(Ethumb_Client *client)
53 Eina_Bool ethumb_client_frame_set(Ethumb_Client *client, char *file, char *group, char *swallow) 67 void ethumb_client_compress_set(Ethumb_Client *client, int compress)
54 void ethumb_client_dir_path_set(Ethumb_Client *client, char *path) 68 int ethumb_client_compress_get(Ethumb_Client *client)
55 char * ethumb_client_dir_path_get(Ethumb_Client *client) 69 Eina_Bool ethumb_client_frame_set(Ethumb_Client *client, const_char_ptr file, const_char_ptr group, const_char_ptr swallow)
56 void ethumb_client_category_set(Ethumb_Client *client, char *category) 70 void ethumb_client_dir_path_set(Ethumb_Client *client, const_char_ptr path)
57 char * ethumb_client_category_get(Ethumb_Client *client) 71 const_char_ptr ethumb_client_dir_path_get(Ethumb_Client *client)
58 void ethumb_client_video_time_set(Ethumb_Client *client, float time) 72 void ethumb_client_category_set(Ethumb_Client *client, const_char_ptr category)
59 void ethumb_client_video_start_set(Ethumb_Client *client, float start) 73 const_char_ptr ethumb_client_category_get(Ethumb_Client *client)
60 void ethumb_client_video_interval_set(Ethumb_Client *client, float interval) 74 void ethumb_client_video_time_set(Ethumb_Client *client, float time)
61 void ethumb_client_video_ntimes_set(Ethumb_Client *client, int ntimes) 75 void ethumb_client_video_start_set(Ethumb_Client *client, float start)
62 void ethumb_client_video_fps_set(Ethumb_Client *client, int fps) 76 void ethumb_client_video_interval_set(Ethumb_Client *client, float interval)
63 void ethumb_client_document_page_set(Ethumb_Client *client, int page) 77 void ethumb_client_video_ntimes_set(Ethumb_Client *client, int ntimes)
64 78 void ethumb_client_video_fps_set(Ethumb_Client *client, int fps)
65 Eina_Bool ethumb_client_file_set(Ethumb_Client *client, char *path, char *key) 79 void ethumb_client_document_page_set(Ethumb_Client *client, int page)
66 void ethumb_client_file_get(Ethumb_Client *client, char **path, char **key) 80
67 void ethumb_client_file_free(Ethumb_Client *client) 81 void ethumb_client_ethumb_setup(Ethumb_Client *client)
68 82
69 void ethumb_client_thumb_path_set(Ethumb_Client *client, char *path, char *key) 83 void ethumb_client_thumb_path_set(Ethumb_Client *client, const_char_ptr path, const_char_ptr key)
70 void ethumb_client_thumb_path_get(Ethumb_Client *client, char **path, char **key) 84 void ethumb_client_thumb_path_get(Ethumb_Client *client, const_char_ptr *path, const_char_ptr *key)
71 Eina_Bool ethumb_client_thumb_exists(Ethumb_Client *client) 85
72 int ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, void *data, Eina_Free_Cb free_data) 86 Eina_Bool ethumb_client_file_set(Ethumb_Client *client, const_char_ptr path, const_char_ptr key)
73 void ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, void *data, Eina_Free_Cb free_data) 87 void ethumb_client_file_get(Ethumb_Client *client, const_char_ptr *path, const_char_ptr *key)
74 void ethumb_client_generate_cancel_all(Ethumb_Client *client) 88 void ethumb_client_file_free(Ethumb_Client *client)
89
90 Ethumb_Exists *ethumb_client_thumb_exists(Ethumb_Client *client, Ethumb_Client_Thumb_Exists_Cb exists_cb, void *data)
91 void ethumb_client_thumb_exists_cancel(Ethumb_Exists *exists)
92 Eina_Bool ethumb_client_thumb_exists_check(Ethumb_Exists *exists)
93 int ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, void *data, Eina_Free_Cb free_data)
94 void ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, void *data, Eina_Free_Cb free_data)
95 void ethumb_client_generate_cancel_all(Ethumb_Client *client)
96
97 ctypedef void (*Ethumb_Client_Async_Done_Cb)(Ethumb_Client *ethumbd, const_char_ptr thumb_path, const_char_ptr thumb_key, void *data)
98 ctypedef void (*Ethumb_Client_Async_Error_Cb)(Ethumb_Client *ethumbd, void *data)
99
100 ctypedef struct Ethumb_Client_Async
101
102 Ethumb_Client_Async *ethumb_client_thumb_async_get(Ethumb_Client *client,
103 Ethumb_Client_Async_Done_Cb done,
104 Ethumb_Client_Async_Error_Cb error,
105 void *data)
106
107 void ethumb_client_thumb_async_cancel(Ethumb_Client *client, Ethumb_Client_Async *request)
75 108
76cdef class Client: 109cdef class Client:
77 cdef Ethumb_Client *obj 110 cdef Ethumb_Client *obj