summaryrefslogtreecommitdiff
path: root/src/lib/ethumb/Ethumb_Plugin.h
blob: 3dd7c57a895c9572077fe0daa490888756f4fe08 (plain)
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
#ifndef _ETHUMB_PLUGIN_H_
#define _ETHUMB_PLUGIN_H_

#include <Evas.h>
#include <Ecore_Evas.h>
#include <Ethumb.h>

#ifdef EAPI
# undef EAPI
#endif

#ifdef _WIN32
# ifdef EFL_ETHUMB_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif /* ! DLL_EXPORT */
# else
#  define EAPI __declspec(dllimport)
# endif /* ! EFL_ETHUMB_BUILD */
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif /* ! _WIN32 */

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _Ethumb_Plugin Ethumb_Plugin;

struct _Ethumb_Plugin
{
#define ETHUMB_PLUGIN_API_VERSION (1U)
   unsigned int version;
   const char *name;
   const char **extensions;
   void *(*thumb_generate)(Ethumb *);
   void (*thumb_cancel)(Ethumb *, void *);
};

EAPI Eina_Bool ethumb_plugin_register(const Ethumb_Plugin *plugin);
EAPI Eina_Bool ethumb_plugin_unregister(const Ethumb_Plugin *plugin);

EAPI void ethumb_calculate_aspect_from_ratio(Ethumb *e, float ia, int *w, int *h);
EAPI void ethumb_calculate_aspect(Ethumb *e, int iw, int ih, int *w, int *h);
EAPI void ethumb_calculate_fill_from_ratio(Ethumb *e, float ia, int *fx, int *fy, int *fw, int *fh);
EAPI void ethumb_calculate_fill(Ethumb *e, int iw, int ih, int *fx, int *fy, int *fw, int *fh);
EAPI Eina_Bool ethumb_plugin_image_resize(Ethumb *e, int w, int h);
EAPI Eina_Bool ethumb_image_save(Ethumb *e);
EAPI void ethumb_finished_callback_call(Ethumb *e, int result);
EAPI Evas * ethumb_evas_get(const Ethumb *e);
EAPI Ecore_Evas * ethumb_ecore_evas_get(const Ethumb *e);

#ifdef __cplusplus
}
#endif

#undef EAPI
#define EAPI

#endif /* _ETHUMB_PLUGIN_H_ */