1 #ifndef ECTOR_H_ 2 #define ECTOR_H_ 3 4 #include <Eina.h> 5 #include <Eo.h> 6 #ifdef EFL_BETA_API_SUPPORT 7 #include <Efl.h> 8 #endif 9 #ifdef EAPI 10 # undef EAPI 11 #endif 12 13 #ifdef _WIN32 14 # ifdef EFL_BUILD 15 # ifdef DLL_EXPORT 16 # define EAPI __declspec(dllexport) 17 # else 18 # define EAPI 19 # endif 20 # else 21 # define EAPI __declspec(dllimport) 22 # endif 23 #else 24 # ifdef __GNUC__ 25 # if __GNUC__ >= 4 26 # define EAPI __attribute__ ((visibility("default"))) 27 # else 28 # define EAPI 29 # endif 30 # else 31 # define EAPI 32 # endif 33 #endif 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 /** 40 * @page ector_main Ector 41 * 42 * @date 2014 (created) 43 * 44 * @section ector_toc Table of Contents 45 * 46 * @li @ref ector_main_intro 47 * @li @ref ector_main_compiling 48 * @li @ref ector_main_next_steps 49 * @li @ref ector_main_intro_example 50 * 51 * @section ector_main_intro Introduction 52 * 53 * Ector is a retained mode drawing library designed to work 54 * for and with a scenegraph such as Evas, which supports several 55 * types of rendering surface including software and gl. 56 * 57 * @section ector_main_compiling How to compile the library 58 * 59 * Ector compiles automatically within EFL's build system, and is 60 * automatically linked with other components that need it. But it can 61 * also be built and used standalone, by compiling and linking your 62 * application with the compiler flags indicated by @c pkg-config. For 63 * example: 64 * 65 * @verbatim 66 * gcc -c -o my_main.o my_main.c `pkg-config --cflags ector` 67 * 68 * gcc -o my_application my_main.o `pkg-config --libs ector` 69 * @endverbatim 70 * 71 * See @ref pkgconfig 72 * 73 * @section ector_main_next_steps Recommended reading: 74 * 75 * @li @ref Ector_Surface 76 * @li @ref Ector_Renderer 77 * 78 * @section ector_main_intro_example Introductory Example 79 * 80 * @ref Ector_Tutorial 81 * 82 * 83 * @addtogroup Ector 84 * @{ 85 */ 86 87 #ifdef EFL_BETA_API_SUPPORT 88 89 /** 90 * @typedef Ector_Surface 91 * The base type to render content into. 92 */ 93 typedef Eo Ector_Surface; 94 95 /** 96 * @typedef Ector_Renderer 97 * The base type describing what to render. 98 */ 99 typedef Eo Ector_Renderer; 100 101 /** 102 * @typedef Ector_Colorspace 103 * The definition of colorspace. 104 */ 105 // FIXME: Enable this when we have merged Emile 106 /* typedef Evas_Colorspace Ector_Colorspace; */ 107 108 /** 109 * Priorities 110 */ 111 typedef enum _Ector_Priority 112 { 113 ECTOR_PRIORITY_NONE = 0, 114 ECTOR_PRIORITY_MARGINAL = 64, 115 ECTOR_PRIORITY_SECONDARY = 128, 116 ECTOR_PRIORITY_PRIMARY = 256, 117 } Ector_Priority; 118 119 /** 120 * What kind of update is being pushed 121 */ 122 typedef enum _Ector_Update_Type 123 { 124 ECTOR_UPDATE_BACKGROUND = 1, /* All the previous state in that area is reset to the new updated profile */ 125 ECTOR_UPDATE_EMPTY = 2, /* Pushing empty area (no visible pixels at all, no need to read this surface to render it) */ 126 ECTOR_UPDATE_ALPHA = 4, /* Pushing some transparent pixels (this impacts the under layer and will require reading back the surface where this surface is blitted) */ 127 ECTOR_UPDATE_OPAQUE = 8 /* Pushing some opaque pixels (this means that there is no need to read the under layer when blitting this surface) */ 128 } Ector_Update_Type; 129 130 /** 131 * @brief Init the ector subsystem 132 * @return @c EINA_TRUE on success. 133 * 134 * @see ector_shutfown() 135 */ 136 EAPI int ector_init(void); 137 138 /** 139 * @brief Shutdown the ector subsystem 140 * @return @c EINA_TRUE on success. 141 * 142 * @see ector_init() 143 */ 144 EAPI int ector_shutdown(void); 145 146 /** 147 * @brief Registers OpenGL API calls with the internal Ector_GL_API. 148 * 149 * @param glsym Function to use for looking up dynamically loaded symbols 150 * @param lib Dynamically loaded shared object, or RTLD_DEFAULT or RTLD_NEXT 151 * @return EINA_TRUE if call succeeded, EINA_FALSE if glsym was undefined or an error occurred 152 * 153 * The RTLD_DEFAULT and RTLD_NEXT pseudo-handles can be passed as lib to 154 * look up the first or next occurrence of the desired symbol in the dynamic 155 * library search order. 156 * 157 * @see dlsym() 158 */ 159 EAPI Eina_Bool ector_glsym_set(void *(*glsym)(void *lib, const char *name), void *lib); 160 161 /* Avoid redefinition of types */ 162 #define _ECTOR_SURFACE_EO_CLASS_TYPE 163 #define _ECTOR_RENDERER_EO_CLASS_TYPE 164 165 #include "ector_surface.h" 166 #include "ector_renderer.h" 167 #include "ector_util.h" 168 169 #endif 170 171 /** 172 * @} 173 */ 174 175 176 #ifdef __cplusplus 177 } 178 #endif 179 180 #undef EAPI 181 #define EAPI 182 183 #endif 184