/** * @param uri: The URI to read * @return Returns a widget displaying the URI contents or NULL on error * @brief Creates a widget to display the URI contents. Returns NULL on error */ Ewl_Widget * ewl_io_manager_uri_read(const char *uri) { Ewl_Widget *ret = NULL; Ewl_IO_Manager_Plugin *plugin = NULL; const char *mime; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(uri, NULL); mime = ewl_io_manager_uri_mime_type_get(uri); if (!mime) { DWARNING("Unable to determine mime type for %s.", uri); DRETURN_PTR(NULL, DLEVEL_STABLE); } plugin = ewl_io_manager_plugin_get(mime); if (!plugin) { DWARNING("No plugin available to read mime type: %s.", mime); DRETURN_PTR(NULL, DLEVEL_STABLE); } ret = plugin->uri_read(uri); DRETURN_PTR(ret, DLEVEL_STABLE); }
/** * @param win: window to get leader for * @return Returns the leader of this window or NULL * @brief Gets the leader of this window * * @note this function returns even NULL if the leader * is a ewl window */ Ewl_Embed_Window * ewl_window_leader_foreign_get(Ewl_Window *win) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(win, NULL); DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, NULL); if (win->flags & EWL_WINDOW_LEADER_FOREIGN) DRETURN_PTR(win->leader.foreign, DLEVEL_STABLE); DRETURN_PTR(NULL, DLEVEL_STABLE); }
/** * @param ext: The extension to look up * @return Returns the icon name for the given extension or NULL if none found * @brief Retrieve the icon name for the given extension or NULL if none found */ const char * ewl_io_manager_extension_icon_name_get(const char *ext) { char *ret = NULL; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(ext, NULL); ret = ecore_hash_get(ewl_io_manager_ext_icon_map, ext); if (ret) DRETURN_PTR(ret, DLEVEL_STABLE); DRETURN_PTR(NULL, DLEVEL_STABLE); }
/** * @param window: the X window to search for on the list of ewl window's * @return Returns the found ewl window on success, NULL on failure. * @brief Find an ewl window by it's X window */ Ewl_Window * ewl_window_window_find(void *window) { Ewl_Window *retwin; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(window, NULL); ecore_list_first_goto(ewl_window_list); while ((retwin = ecore_list_next(ewl_window_list))) if (retwin->window == window) DRETURN_PTR(retwin, DLEVEL_STABLE); DRETURN_PTR(NULL, DLEVEL_STABLE); }
Ewl_Widget * ewl_io_manager_plugin_uri_read(const char *uri) { Ewl_Widget *ret = NULL; FILE *file; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(uri, NULL); if (!key1) setup_hash(); file = fopen(uri, "r"); if (file) { struct stat buf; char *str; ret = ewl_text_new(); ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace"); stat(uri, &buf); str = malloc(sizeof(char) * (buf.st_size + 1)); fread(str, buf.st_size, 1, file); str[buf.st_size] = '\0'; fclose(file); text_set(EWL_TEXT(ret), str); FREE(str); } DRETURN_PTR(ret, DLEVEL_STABLE); }
/** * @return Returns a new Ewl_View object on success or NULL on failure * @brief Creates a new Ewl_View object */ Ewl_View * ewl_view_new(void) { Ewl_View *view; DENTER_FUNCTION(DLEVEL_STABLE); view = NEW(Ewl_View, 1); if (!ewl_view_init(view)) { FREE(view); DRETURN_PTR(NULL, DLEVEL_STABLE); } DRETURN_PTR(view, DLEVEL_STABLE); }
/** * @return Returns pointer to new toolbar widget on success, NULL on failure. * @brief Allocate a new toolbar widget with horizontal orientation */ Ewl_Widget * ewl_htoolbar_new(void) { DENTER_FUNCTION(DLEVEL_STABLE); DRETURN_PTR(ewl_toolbar_new(), DLEVEL_STABLE); }
static const char * ewl_icon_theme_icon_path_get_helper(const char *icon, unsigned int size, const char *theme, const char *key, Ecore_Hash *cache) { char *ret; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(icon, EWL_THEME_KEY_NOMATCH); #if BUILD_EFREET_SUPPORT ret = ecore_hash_get(cache, key); if (!ret) { /* XXX: How to store NOMATCH in the cache? The cache is strings which must be free'd */ ret = efreet_icon_path_find(theme, icon, size); if (!ret) ret = EWL_THEME_KEY_NOMATCH; else ecore_hash_set(cache, strdup(key), (void *)ret); } #else ret = EWL_THEME_KEY_NOMATCH; #endif DRETURN_PTR(ret, DLEVEL_STABLE); }
/** * @param v: The Ewl_View to get the Ewl_View_Expansion_View_Fetch function from * @return Returns the Ewl_View_Expansion_View_Fetch callback set on the view, * or NULL on failure. * @brief Gets the expansion view fetch callback from the view */ Ewl_View_Expansion_View_Fetch ewl_view_expansion_view_fetch_get(const Ewl_View *v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(v, NULL); DRETURN_PTR(v->expansion, DLEVEL_STABLE); }
/** * @param v: The Ewl_View to get the Ewl_View_Header_Fetch function from * @return Returns the Ewl_View_Header_Fetch callback set on the view, or * NULL on failure. * @brief Gets the header fetch callback from the view */ Ewl_View_Header_Fetch ewl_view_header_fetch_get(const Ewl_View *v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(v, NULL); DRETURN_PTR(v->header_fetch, DLEVEL_STABLE); }
/** * @param v: The Ewl_View to get the assign callback from * @return Returns the Ewl_View_Widget_Assign set into the view or NULL if * none set. * @brief Get the assign callback set on this view */ Ewl_View_Widget_Assign ewl_view_widget_Assign_get(const Ewl_View *v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(v, NULL); DRETURN_PTR(v->assign, DLEVEL_STABLE); }
/** * @param v: The Ewl_View to get the constructor from * @return Returns the Ewl_View_Constructor set into the view or NULL if * none set. * @brief Get the constructor set on this view */ Ewl_View_Widget_Constructor ewl_view_widget_constructor_get(const Ewl_View *v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(v, NULL); DRETURN_PTR(v->constructor, DLEVEL_STABLE); }
/** * @param dvi: the dvi widget to get the current page of * @return Returns the current page of the dvi (NULL on failure) * @brief get the current page of the dvi */ const Edvi_Page *ewl_dvi_dvi_page_get (Ewl_Dvi *dvi) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(dvi, NULL); DCHECK_TYPE_RET(dvi, EWL_DVI_TYPE, NULL); DRETURN_PTR(dvi->dvi_page, DLEVEL_STABLE); }
/** * @return Returns a pointer to a new dvi widget on success, NULL on failure. * @brief Load an dvi widget with specified dvi contents */ Ewl_Widget * ewl_dvi_new(void) { Ewl_Dvi *dvi; DENTER_FUNCTION(DLEVEL_STABLE); dvi = NEW(Ewl_Dvi, 1); if (!dvi) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_dvi_init(dvi)) { ewl_widget_destroy(EWL_WIDGET(dvi)); dvi = NULL; } DRETURN_PTR(EWL_WIDGET(dvi), DLEVEL_STABLE); }
/** * @param dvi the dvi widget to get the file of * @return Returns the currently set file name * @brief get the file name this dvi uses */ const char * ewl_dvi_file_get(Ewl_Dvi *dvi) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(dvi, NULL); DCHECK_TYPE_RET(dvi, EWL_DVI_TYPE, NULL); DRETURN_PTR(dvi->filename, DLEVEL_STABLE); }
/** * @param pdf the pdf widget to get the index of * @return Returns the poppler index of the pdf (NULL on failure) * @brief get the poppler index of the pdf */ Ecore_List * ewl_pdf_pdf_index_get(Ewl_Pdf *pdf) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(pdf, NULL); DCHECK_TYPE_RET(pdf, EWL_PDF_TYPE, NULL); DRETURN_PTR(pdf->pdf_index, DLEVEL_STABLE); }
/** * @return Returns a pointer to a new pdf widget on success, NULL on failure. * @brief Load an pdf widget with specified pdf contents */ Ewl_Widget * ewl_pdf_new(void) { Ewl_Pdf *pdf; DENTER_FUNCTION(DLEVEL_STABLE); pdf = NEW(Ewl_Pdf, 1); if (!pdf) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_pdf_init(pdf)) { ewl_widget_destroy(EWL_WIDGET(pdf)); pdf = NULL; } DRETURN_PTR(EWL_WIDGET(pdf), DLEVEL_STABLE); }
/** * @param n: The Ewl_Notebook to get the visible page of * @return Returns the visible page of the notebook * @brief Get the current visible page of the notebook */ Ewl_Widget * ewl_notebook_visible_page_get(Ewl_Notebook *n) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(n, NULL); DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, NULL); DRETURN_PTR(n->cur_page, DLEVEL_STABLE); }
/** * @return Returns pointer to new popup widget on success, NULL on failure. * @brief Allocate a new popup widget */ Ewl_Widget * ewl_popup_new(void) { Ewl_Popup *p; DENTER_FUNCTION(DLEVEL_STABLE); p = NEW(Ewl_Popup, 1); if (!p) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_popup_init(p)) { ewl_widget_destroy(EWL_WIDGET(p)); p = NULL; } DRETURN_PTR(EWL_WIDGET(p), DLEVEL_STABLE); }
/** * @return Returns a pointer to a new menu on success, NULL on failure. * @brief Create a new internal menu */ Ewl_Widget * ewl_menu_new(void) { Ewl_Menu *menu; DENTER_FUNCTION(DLEVEL_STABLE); menu = NEW(Ewl_Menu, 1); if (!menu) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_menu_init(menu)) { ewl_widget_destroy(EWL_WIDGET(menu)); menu = NULL; } DRETURN_PTR(EWL_WIDGET(menu), DLEVEL_STABLE); }
/** * @param p: The popup to get the follow from * @return Returns the follow of the popup * @brief */ Ewl_Widget * ewl_popup_follow_get(Ewl_Popup *p) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(p, NULL); DCHECK_TYPE_RET(p, EWL_POPUP_TYPE, NULL); DRETURN_PTR(p->follow, DLEVEL_STABLE); }
/** * @return Returns pointer to new separator widget on success, NULL on failure. * @brief Allocate a new separator widget with default (horizontal) orientation */ Ewl_Widget * ewl_separator_new(void) { Ewl_Separator *s; DENTER_FUNCTION(DLEVEL_STABLE); s = NEW(Ewl_Separator, 1); if (!s) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_separator_init(s)) { ewl_widget_destroy(EWL_WIDGET(s)); s = NULL; } DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); }
/** * @return Returns a new overlay container on success, or NULL on failure. * @brief Allocate and initialize a new overlay container */ Ewl_Widget * ewl_overlay_new(void) { Ewl_Overlay *w; DENTER_FUNCTION(DLEVEL_STABLE); w = NEW(Ewl_Overlay, 1); if (!w) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_overlay_init(w)) { ewl_widget_destroy(EWL_WIDGET(w)); w = NULL; } DRETURN_PTR(EWL_WIDGET(w), DLEVEL_STABLE); }
/** * @param win: the window to retrieve the window * @return Returns a pointer to a new copy of the class, NULL on failure. * @brief Retrieve the class of the specified window * * The returned class should not be freed, and should be copied immediately if * needed for extended use. */ const char * ewl_window_class_get(Ewl_Window *win) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(win, NULL); DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, NULL); DRETURN_PTR(win->classname, DLEVEL_STABLE); }
/** * @return Returns pointer to new toolbar widget on success, NULL on failure. * @brief Allocate a new toolbar widget with default (horizontal) orientation */ Ewl_Widget * ewl_toolbar_new(void) { Ewl_Toolbar *t; DENTER_FUNCTION(DLEVEL_STABLE); t = NEW(Ewl_Toolbar, 1); if (!t) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_toolbar_init(t)) { ewl_widget_destroy(EWL_WIDGET(t)); t = NULL; } DRETURN_PTR(EWL_WIDGET(t), DLEVEL_STABLE); }
/** * @param ps: the ps widget to get the current page of * @return Returns the current page of the ps (NULL on failure) * @brief get the current page of the ps * * Get the current page of @p ps. The returned value must not * be freed. */ const Eps_Page * ewl_ps_ps_page_get(Ewl_Ps *ps) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(ps, NULL); DCHECK_TYPE_RET(ps, EWL_PS_TYPE, NULL); DRETURN_PTR(ps->ps_page, DLEVEL_STABLE); }
/** * @param pdf the pdf widget to get the file of * @return Returns the currently set file name * @brief get the file name this pdf uses */ const char * ewl_pdf_file_get(Ewl_Pdf *pdf) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(pdf, NULL); DCHECK_TYPE_RET(pdf, EWL_PDF_TYPE, NULL); DRETURN_PTR(pdf->filename, DLEVEL_STABLE); }
/** * @param b: the border to retrieve the label text * @return Returns the border label text on success, NULL on failure. * @brief Get the label from a border widget */ const char * ewl_border_label_get(Ewl_Border *b) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(b, NULL); DCHECK_TYPE_RET(b, EWL_BORDER_TYPE, NULL); DRETURN_PTR(ewl_label_text_get(EWL_LABEL(b->label)), DLEVEL_STABLE); }
/** * @return Returns a pointer to a new ps widget on success, NULL on failure. * @brief Create a ps widget */ Ewl_Widget * ewl_ps_new(void) { Ewl_Ps *ps; DENTER_FUNCTION(DLEVEL_STABLE); ps = NEW(Ewl_Ps, 1); if (!ps) DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_ps_init(ps)) { ewl_widget_destroy(EWL_WIDGET(ps)); ps = NULL; } DRETURN_PTR(EWL_WIDGET(ps), DLEVEL_STABLE); }
/** * @param pdf the pdf widget to get the current page of * @return Returns the current page of the pdf (NULL on failure) * @brief get the current page of the pdf */ Epdf_Page * ewl_pdf_pdf_page_get(Ewl_Pdf *pdf) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(pdf, NULL); DCHECK_TYPE_RET(pdf, EWL_PDF_TYPE, NULL); DRETURN_PTR(pdf->pdf_page, DLEVEL_STABLE); }