summaryrefslogtreecommitdiff
path: root/include/efl.ethumb_client.pxd
blob: 7f99043730967386ddf52a17c45bbac1fa8f93c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
#
# This file is part of Python-EFL.
#
# Python-EFL is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# Python-EFL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.

from efl.eina cimport Eina_Bool, Eina_Free_Cb


cdef extern from "Ethumb_Client.h":

    ####################################################################
    # Enums
    #
    cpdef enum Ethumb_Thumb_Orientation:
        ETHUMB_THUMB_ORIENT_NONE
        ETHUMB_THUMB_ROTATE_90_CW
        ETHUMB_THUMB_ROTATE_180
        ETHUMB_THUMB_ROTATE_90_CCW
        ETHUMB_THUMB_FLIP_HORIZONTAL
        ETHUMB_THUMB_FLIP_VERTICAL
        ETHUMB_THUMB_FLIP_TRANSPOSE
        ETHUMB_THUMB_FLIP_TRANSVERSE
        ETHUMB_THUMB_ORIENT_ORIGINAL
    ctypedef enum Ethumb_Thumb_Orientation:
        pass

    cpdef enum Ethumb_Thumb_FDO_Size:
        ETHUMB_THUMB_NORMAL
        ETHUMB_THUMB_LARGE
    ctypedef enum Ethumb_Thumb_FDO_Size:
        pass

    cpdef enum Ethumb_Thumb_Format:
        ETHUMB_THUMB_FDO
        ETHUMB_THUMB_JPEG
        ETHUMB_THUMB_EET
    ctypedef enum Ethumb_Thumb_Format:
        pass

    cpdef enum Ethumb_Thumb_Aspect:
        ETHUMB_THUMB_KEEP_ASPECT
        ETHUMB_THUMB_IGNORE_ASPECT
        ETHUMB_THUMB_CROP
    ctypedef enum Ethumb_Thumb_Aspect:
        pass

    ####################################################################
    # Structs
    #
    ctypedef struct Ethumb_Client
    ctypedef struct Ethumb_Exists

    ####################################################################
    # Other typedefs
    #
    ctypedef void (*Ethumb_Client_Connect_Cb)(void *data, Ethumb_Client *client, Eina_Bool success)
    ctypedef void (*Ethumb_Client_Die_Cb)(void *data, Ethumb_Client *client)
    ctypedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int id, const char *file, const char *key, const char *thumb_path, const char *thumb_key, Eina_Bool success)
    ctypedef void (*Ethumb_Client_Thumb_Exists_Cb)(void *data, Ethumb_Client *client, Ethumb_Exists *thread, Eina_Bool exists)
    ctypedef void (*Ethumb_Client_Generate_Cancel_Cb)(void *data, Eina_Bool success)

    ####################################################################
    # Functions
    #
    int             ethumb_client_init()
    int             ethumb_client_shutdown()

    Ethumb_Client   *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data)
    void            ethumb_client_disconnect(Ethumb_Client *client)
    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)

    void            ethumb_client_fdo_set(Ethumb_Client *client, int s)

    void            ethumb_client_size_set(Ethumb_Client *client, int tw, int th)
    void            ethumb_client_size_get(Ethumb_Client *client, int *tw, int *th)
    void            ethumb_client_format_set(Ethumb_Client *client, int f)
    int             ethumb_client_format_get(Ethumb_Client *client)
    void            ethumb_client_aspect_set(Ethumb_Client *client, int a)
    int             ethumb_client_aspect_get(Ethumb_Client *client)
    void            ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o)
    Ethumb_Thumb_Orientation ethumb_client_orientation_get(Ethumb_Client *client)
    void            ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y)
    void            ethumb_client_crop_align_get(Ethumb_Client *client, float *x, float *y)
    void            ethumb_client_quality_set(Ethumb_Client *client, int quality)
    int             ethumb_client_quality_get(Ethumb_Client *client)
    void            ethumb_client_compress_set(Ethumb_Client *client, int compress)
    int             ethumb_client_compress_get(Ethumb_Client *client)
    Eina_Bool       ethumb_client_frame_set(Ethumb_Client *client, const char *file, const char *group, const char *swallow)
    void            ethumb_client_dir_path_set(Ethumb_Client *client, const char *path)
    const char * ethumb_client_dir_path_get(Ethumb_Client *client)
    void            ethumb_client_category_set(Ethumb_Client *client, const char *category)
    const char * ethumb_client_category_get(Ethumb_Client *client)
    void            ethumb_client_video_time_set(Ethumb_Client *client, float time)
    void            ethumb_client_video_start_set(Ethumb_Client *client, float start)
    void            ethumb_client_video_interval_set(Ethumb_Client *client, float interval)
    void            ethumb_client_video_ntimes_set(Ethumb_Client *client, int ntimes)
    void            ethumb_client_video_fps_set(Ethumb_Client *client, int fps)
    void            ethumb_client_document_page_set(Ethumb_Client *client, int page)

    void            ethumb_client_ethumb_setup(Ethumb_Client *client)

    void            ethumb_client_thumb_path_set(Ethumb_Client *client, const char *path, const char *key)
    void            ethumb_client_thumb_path_get(Ethumb_Client *client, const char **path, const char **key)

    Eina_Bool       ethumb_client_file_set(Ethumb_Client *client, const char *path, const char *key)
    void            ethumb_client_file_get(Ethumb_Client *client, const char **path, const char **key)
    void            ethumb_client_file_free(Ethumb_Client *client)

    Ethumb_Exists   *ethumb_client_thumb_exists(Ethumb_Client *client, Ethumb_Client_Thumb_Exists_Cb exists_cb, void *data)
    void            ethumb_client_thumb_exists_cancel(Ethumb_Exists *exists)
    Eina_Bool       ethumb_client_thumb_exists_check(Ethumb_Exists *exists)
    int             ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, void *data, Eina_Free_Cb free_data)
    void            ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, void *data, Eina_Free_Cb free_data)
    void            ethumb_client_generate_cancel_all(Ethumb_Client *client)

    ctypedef void (*Ethumb_Client_Async_Done_Cb)(Ethumb_Client *ethumbd, const char *thumb_path, const char *thumb_key, void *data)
    ctypedef void (*Ethumb_Client_Async_Error_Cb)(Ethumb_Client *ethumbd, void *data)

    ctypedef struct Ethumb_Client_Async

    Ethumb_Client_Async *ethumb_client_thumb_async_get(Ethumb_Client *client,
                            Ethumb_Client_Async_Done_Cb done,
                            Ethumb_Client_Async_Error_Cb error,
                            void *data)

    void            ethumb_client_thumb_async_cancel(Ethumb_Client *client, Ethumb_Client_Async *request)


cdef class EthumbClient:
    cdef Ethumb_Client *obj
    cdef object _on_connect_callback
    cdef object _on_server_die_callback