static inline void _config_init(void) { Eet_Data_Descriptor_Class eddc; if (_config_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Config); _config_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "allow_popup", allow_popup, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_auto_load_images", enable_auto_load_images, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_auto_shrink_images", enable_auto_shrink_images, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_javascript", enable_javascript, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_mouse_cursor", enable_mouse_cursor, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_plugins", enable_plugins, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_private_mode", enable_private_mode, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "enable_touch_interface", enable_touch_interface, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "home_page", home_page, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "proxy", proxy, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "restore_state", restore_state, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "user_agent", user_agent, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "frame_flattening", frame_flattening, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "text_zoom", text_zoom, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "minimum_font_size", minimum_font_size, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "cookie_policy", cookie_policy, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "backing_store", backing_store, EET_T_INT); }
static void _my_conf_descriptor_init(void) { Eet_Data_Descriptor_Class eddc; // The class describe the functions to use to create the type and its // full allocated size. // // Eina types are very convenient, so use them to create the descriptor, // so we get eina_list, eina_hash and eina_stringshare automatically! // // The STREAM variant is better for configuration files as the values // will likely change a lot. // // The other variant, FILE, is good for caches and things that are just // appended, but needs to take care when changing strings and files must // be kept open so mmap()ed strings will be kept alive. EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, My_Conf_Type); _my_conf_descriptor = eet_data_descriptor_stream_new(&eddc); // Describe the members to be saved: // Use a temporary macro so we don't type a lot, also avoid errors: #define MY_CONF_ADD_BASIC(member, eet_type) \ EET_DATA_DESCRIPTOR_ADD_BASIC \ (_my_conf_descriptor, My_Conf_Type, # member, member, eet_type) MY_CONF_ADD_BASIC(version, EET_T_UINT); MY_CONF_ADD_BASIC(name, EET_T_STRING); MY_CONF_ADD_BASIC(id, EET_T_INT); MY_CONF_ADD_BASIC(enabled, EET_T_UCHAR); #undef MY_CONF_ADD_BASIC } /* _my_conf_descriptor_init */
void config_init(void) { Eet_Data_Descriptor_Class eddc; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Jesus_Config); edd = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_HASH_STRING(edd, Jesus_Config, "mime_type_open", mime_type_open); _config_read(); }
static inline void _fav_init(void) { Eet_Data_Descriptor_Class eddc; if (_fav_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Fav); _fav_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_HASH(_fav_descriptor, Fav, "items", items, _fav_item_descriptor); }
static inline void _session_init(void) { Eet_Data_Descriptor_Class eddc; if (_session_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Session); _session_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_LIST(_session_descriptor, Session, "windows", windows, _session_window_descriptor); }
static inline void _session_window_init(void) { Eet_Data_Descriptor_Class eddc; if (_session_window_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Session_Window); _session_window_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_LIST(_session_window_descriptor, Session_Window, "tabs", tabs, _session_item_descriptor); EET_DATA_DESCRIPTOR_ADD_BASIC(_session_window_descriptor, Session_Window, "focused", focused, EET_T_UCHAR); }
static inline void _fav_item_init(void) { Eet_Data_Descriptor_Class eddc; if (_fav_item_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Fav_Item); _fav_item_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "url", url, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "title", title, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "visit_count", visit_count, EET_T_UINT); }
static inline void _session_item_init(void) { Eet_Data_Descriptor_Class eddc; if (_session_item_descriptor) return; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Session_Item); _session_item_descriptor = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_session_item_descriptor, Session_Item, "url", url, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_session_item_descriptor, Session_Item, "focused", focused, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_session_item_descriptor, Session_Item, "scroll_x", scroll_x, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_session_item_descriptor, Session_Item, "scroll_y", scroll_y, EET_T_INT); }
void ece_example_descriptor_init(void) { Eet_Data_Descriptor_Class eddc; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, ECE_Example); _ece_example_descriptor = eet_data_descriptor_stream_new(&eddc); #define ECE_EXAMPLE_ADD_BASIC(member, eet_type) \ EET_DATA_DESCRIPTOR_ADD_BASIC \ (_ece_example_descriptor, ECE_Example, # member, member, eet_type) ECE_EXAMPLE_ADD_BASIC(id, EET_T_INT); ECE_EXAMPLE_ADD_BASIC(message, EET_T_STRING); /* not_sending is not being added to the descriptor to show that, * only those parameters which have been added are sent in the * communication. */ #undef ECE_EXAMPLE_ADD_BASIC }