示例#1
0
文件: ewl_ps.c 项目: Limsik/e17
/**
 * @param ps the ps widget to get the file of
 * @return Returns the currently set file name
 * @brief get the file name this ps uses
 */
const char *
ewl_ps_file_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->filename, DLEVEL_STABLE);
}
示例#2
0
/**
 * @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);
}
示例#3
0
文件: ewl_ps.c 项目: Limsik/e17
/**
 * @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);
}
static int
string_is_keyword(Ecore_Hash *keys, const char *string)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(string, FALSE);

        DRETURN_INT(((ecore_hash_get(keys, string) != NULL) ? TRUE : FALSE),
                                                        DLEVEL_STABLE);
}
示例#5
0
/**
 * @param n: The Ewl_Notebook to get the alignment from
 * @return Returns the current alignment values of the widget
 * @brief Retrieves the alignment of the tabbar in the notebook widget
 */
unsigned int
ewl_notebook_tabbar_alignment_get(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, 0);
        DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, 0);

        DRETURN_INT(ewl_object_alignment_get(EWL_OBJECT(n->body.tabbar)),
                                                        DLEVEL_STABLE);
}
示例#6
0
/**
 * @param n: The Ewl_Notebook to get the tabbar visiblity of
 * @return Returns the visibility of the tabbar
 * @brief Retrieve if the tabbar is visible
 */
unsigned int
ewl_notebook_tabbar_visible_get(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, FALSE);
        DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, FALSE);

        DRETURN_INT(((VISIBLE(n->body.tabbar)) ? TRUE : FALSE),
                                                        DLEVEL_STABLE);
}
示例#7
0
/**
 * @param mime: The mime type to get the icon for
 * @return Returns the icon name for the given mime type or NULL if none found
 * @brief Retrives the icon name for the given mime type or NULL if none found
 */
const char *
ewl_io_manager_mime_type_icon_name_get(const char *mime)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(mime, NULL);

        DWARNING("NOT WRITTEN");

        DRETURN_PTR(NULL, DLEVEL_STABLE);
}
示例#8
0
/**
 * @param n: The Ewl_Notebook to check for homogeneous
 * @return Returns the homgeneous value of the notebook @a n
 * @brief Retrieves the homogeneous value of the notebook
 **/
unsigned int
ewl_notebook_tabbar_homogeneous_get(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, 0);
        DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, 0);

        DRETURN_INT(ewl_box_homogeneous_get(EWL_BOX(n->body.tabbar)),
                               DLEVEL_STABLE);
}
示例#9
0
/**
 * @param sp: The Ewl_Spectrum to init
 * @return Returns TRUE on success or FALSE on failure
 * @brief Initializes an Ewl_Specturm widget to default values
 */
int
ewl_spectrum_init(Ewl_Spectrum *sp)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(sp, FALSE);

        if (!ewl_container_init(EWL_CONTAINER(sp)))
        {
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        ewl_widget_appearance_set(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
        ewl_widget_inherit(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
        ewl_object_fill_policy_set(EWL_OBJECT(sp), EWL_FLAG_FILL_FILL);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_MOVE);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_DOWN);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_UP);

        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_DOWN,
                                ewl_spectrum_cb_mouse_down, NULL);
        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_UP,
                                ewl_spectrum_cb_mouse_up, NULL);

        sp->type = EWL_SPECTRUM_TYPE_SQUARE;

        /* create the canvas */
        sp->canvas = ewl_image_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->canvas);
        ewl_object_fill_policy_set(EWL_OBJECT(sp->canvas), EWL_FLAG_FILL_FILL);
        ewl_widget_internal_set(sp->canvas, TRUE);
        ewl_callback_append(EWL_WIDGET(sp->canvas), EWL_CALLBACK_REVEAL,
                                ewl_spectrum_canvas_cb_reveal, sp);
        ewl_widget_show(sp->canvas);

        /* create the cross hairs to draw on the spectrum */
        sp->cross_hairs.horizontal = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->cross_hairs.horizontal);
        ewl_widget_internal_set(sp->cross_hairs.horizontal, TRUE);
        ewl_widget_layer_priority_set(sp->cross_hairs.horizontal, 1);

        sp->cross_hairs.vertical = ewl_vseparator_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->cross_hairs.vertical);
        ewl_widget_internal_set(sp->cross_hairs.vertical, TRUE);
        ewl_widget_layer_priority_set(sp->cross_hairs.vertical, 1);

        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_CONFIGURE,
                        ewl_spectrum_cb_configure, NULL);

        ewl_spectrum_rgb_set(sp, 255, 255, 255);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
int
ewl_io_manager_plugin_string_write(Ewl_Widget *data, const char **string)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(data, FALSE);
        DCHECK_TYPE_RET(data, EWL_TEXT_TYPE, FALSE);

        *string = ewl_text_text_get(EWL_TEXT(data));

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
示例#11
0
文件: ewl_dvi.c 项目: Limsik/e17
/**
 * @param dvi: the dvi widget to change the displayed dvi
 * @param filename: the path to the new dvi to be displayed by @a dvi
 * @return Returns no value.
 * @brief Change the dvi file displayed by an dvi widget
 *
 * Set the dvi displayed by @a dvi to the one found at the path @a filename. If an
 * edje is used, a minimum size should be specified in the edje or the code.
 */
int
ewl_dvi_file_set(Ewl_Dvi *dvi, const char *filename)
{
        Ewl_Widget *w;
        Ewl_Embed *emb;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(dvi, FALSE);
        DCHECK_TYPE(dvi, EWL_DVI_TYPE);

        w = EWL_WIDGET(dvi);
        emb = ewl_embed_widget_find(w);

        if (!filename || (filename[0] == '\0'))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        if (dvi->filename != filename) {
                IF_FREE(dvi->filename);
        }

        if (dvi->dvi_page) {
                edvi_page_delete(dvi->dvi_page);
                dvi->dvi_page = NULL;
        }

        if (dvi->dvi_document) {
                edvi_document_delete(dvi->dvi_document);
                dvi->dvi_document = NULL;
        }

        dvi->filename = strdup(filename);

        /*
         * Load the new dvi if widget has been realized
         */

        dvi->dvi_document = edvi_document_new(dvi->filename, dvi->dvi_device, dvi->dvi_property);
        if (!dvi->dvi_document)
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        dvi->dvi_page = edvi_page_new(dvi->dvi_document);
        if (!dvi->dvi_page) {
                edvi_document_delete(dvi->dvi_document);
                dvi->dvi_document = NULL;
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        if (REALIZED(w)) {
                ewl_widget_obscure(w);
                ewl_widget_reveal(w);
        }

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
示例#12
0
文件: ewl_ps.c 项目: Limsik/e17
/**
 * @param ps: the ps widget to get the page of
 * @return Returns the currently set page
 * @brief get the page this ps uses
 */
int
ewl_ps_page_get(Ewl_Ps *ps)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(ps, 0);
        DCHECK_TYPE_RET(ps, EWL_PS_TYPE, 0);

        if (!ps->ps_page)
                DRETURN_INT(0, DLEVEL_STABLE);

        DRETURN_INT(eps_page_page_get(ps->ps_page), DLEVEL_STABLE);
}
示例#13
0
/**
 * @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);
}
示例#14
0
/**
 * @param pdf the pdf widget to get the page of
 * @return Returns the currently set page
 * @brief get the page this pdf uses
 */
int
ewl_pdf_page_get(Ewl_Pdf *pdf)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(pdf, 0);
        DCHECK_TYPE_RET(pdf, EWL_PDF_TYPE, 0);

        if (!pdf->pdf_page)
                DRETURN_INT(0, DLEVEL_STABLE);

        DRETURN_INT(epdf_page_page_get(pdf->pdf_page), DLEVEL_STABLE);
}
示例#15
0
文件: ewl_ps.c 项目: Limsik/e17
/**
 * @param ps: the ps widget to get the orientation of
 * @return Returns the orientation of the document.
 * @brief get the orientation of the document @p ps. If @p ps
 * is NULL, return EPS_PAGE_ORIENTATION_PORTRAIT
 */
Eps_Page_Orientation
ewl_ps_orientation_get(Ewl_Ps *ps)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(ps, EPS_PAGE_ORIENTATION_PORTRAIT);
        DCHECK_TYPE_RET(ps, EWL_PS_TYPE, EPS_PAGE_ORIENTATION_PORTRAIT);

        if (!ps->ps_page)
                DRETURN_INT(EPS_PAGE_ORIENTATION_PORTRAIT, DLEVEL_STABLE);

        DRETURN_INT(eps_page_orientation_get(ps->ps_page), DLEVEL_STABLE);
}
示例#16
0
文件: ewl_dvi.c 项目: Limsik/e17
/**
 * @param dvi: the dvi widget to get the page of
 * @return Returns the currently set page
 * @brief get the page this dvi uses
 */
int
ewl_dvi_page_get(Ewl_Dvi *dvi)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(dvi, 0);
        DCHECK_TYPE_RET(dvi, EWL_DVI_TYPE, 0);

        if (!dvi->dvi_page)
                DRETURN_INT(0, DLEVEL_STABLE);

        DRETURN_INT(edvi_page_page_get(dvi->dvi_page), DLEVEL_STABLE);
}
示例#17
0
文件: ewl_dvi.c 项目: Limsik/e17
/**
 * @param dvi: the dvi widget to get the orientation of
 * @return Returns the orientation of the document.
 * @brief get the orientation of the document @p dvi. If @p dvi
 * is NULL, return EDVI_PAGE_ORIENTATION_PORTRAIT
 */
Edvi_Page_Orientation
ewl_dvi_orientation_get(Ewl_Dvi *dvi)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(dvi, EDVI_PAGE_ORIENTATION_PORTRAIT);
        DCHECK_TYPE_RET(dvi, EWL_DVI_TYPE, EDVI_PAGE_ORIENTATION_PORTRAIT);

        if (!dvi->dvi_page)
                DRETURN_INT(EDVI_PAGE_ORIENTATION_PORTRAIT, DLEVEL_STABLE);

        DRETURN_INT(edvi_page_orientation_get(dvi->dvi_page), DLEVEL_STABLE);
}
示例#18
0
/**
 * @param pdf: the pdf widget to get the orientation of
 * @return Returns the orientation of the document.
 * @brief get the orientation of the document @p pdf. If @p pdf
 * is NULL, return EPDF_PAGE_ORIENTATION_PORTRAIT
 */
Epdf_Page_Orientation
ewl_pdf_orientation_get(Ewl_Pdf *pdf)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(pdf, EPDF_PAGE_ORIENTATION_PORTRAIT);
        DCHECK_TYPE_RET(pdf, EWL_PDF_TYPE, EPDF_PAGE_ORIENTATION_PORTRAIT);

        if (!pdf->pdf_page)
                DRETURN_INT(EPDF_PAGE_ORIENTATION_PORTRAIT, DLEVEL_STABLE);

        DRETURN_INT(epdf_page_orientation_get(pdf->pdf_page), DLEVEL_STABLE);
}
示例#19
0
/**
 * @param string: The string to read
 * @param mime: The mime type to interpret the string as
 * @return Returns a widget representing the string in the given mime type
 * @brief Reads the given string and interprets it as the given mime type
 */
Ewl_Widget *
ewl_io_manager_string_read(const char *string, const char *mime)
{
        Ewl_IO_Manager_Plugin *plugin = NULL;
        Ewl_Widget *ret = NULL;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(string, NULL);
        DCHECK_PARAM_PTR_RET(mime, NULL);

        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->string_read(string);

        DRETURN_PTR(ret, DLEVEL_STABLE);
}
示例#20
0
/**
 * @param b: The Ewl_Border to get the alignment from
 * @return Returns the alignment of the label for the border.
 * @brief Retruns the alignment setting of the label for this border container
 */
unsigned int
ewl_border_label_alignment_get(Ewl_Border *b)
{
        unsigned int align;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(b, 0);
        DCHECK_TYPE_RET(b, EWL_BORDER_TYPE, 0);

        align = ewl_object_alignment_get(EWL_OBJECT(b->label));

        DRETURN_INT(align, DLEVEL_STABLE);
}
示例#21
0
/**
 * @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);
}
示例#22
0
/**
 * @param n: The Ewl_Notebook to get the tab widget from
 * @param page: The page to get the tab from
 * @return Returns the tab widget associated with the given page
 * @brief Retrieve the widget used as the tab for the page @p page
 */
Ewl_Widget *
ewl_notebook_page_tab_widget_get(Ewl_Notebook *n, Ewl_Widget *page)
{
        Ewl_Widget *t, *o;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, NULL);
        DCHECK_PARAM_PTR_RET(page, NULL);
        DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, NULL);
        DCHECK_TYPE_RET(page, EWL_WIDGET_TYPE, NULL);

        t = ewl_attach_widget_association_get(page);
        if (!t)
        {
                DWARNING("We have a notebook page with no tab, bad, very bad.");
                DRETURN_PTR(NULL, DLEVEL_STABLE);
        }

        o = ewl_container_child_get(EWL_CONTAINER(t), 0);

        DRETURN_PTR(o, DLEVEL_STABLE);
}
示例#23
0
文件: ewl_ps.c 项目: Limsik/e17
/**
 * @param ps: the ps widget to change the displayed ps
 * @param filename: the path to the new postscript file to be displayed by @a ps
 * @return 0 on failure, 1 otherwise.
 * @brief Change the postscript file displayed by a ps widget
 *
 * Set the postscript file displayed by @a ps to the one found at the path
 * @a filename.
 */
int
ewl_ps_file_set(Ewl_Ps *ps, const char *filename)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(ps, FALSE);
        DCHECK_TYPE(ps, EWL_PS_TYPE);

        w = EWL_WIDGET(ps);

        if (ps->filename != filename) {
                IF_FREE(ps->filename);
        }
        if (!filename || (filename[0] == '\0'))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        if (ps->ps_page) {
                eps_page_delete(ps->ps_page);
                ps->ps_page = NULL;
        }

        if (ps->ps_document) {
                eps_document_delete(ps->ps_document);
                ps->ps_document = NULL;
        }

        ps->filename = strdup(filename);

        /*
         * Load the new Postscript document
         */

        ps->ps_document = eps_document_new(filename);
        if (!ps->ps_document)
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ps->ps_page = eps_page_new(ps->ps_document);
        if (!ps->ps_page) {
                eps_document_delete(ps->ps_document);
                ps->ps_document = NULL;
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        if (REALIZED(w)) {
                ewl_widget_unrealize(w);
                ewl_widget_reveal(w);
        }

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
示例#24
0
/**
 * @param pdf the pdf widget to initialize
 * @return Returns no value.
 * @brief Initialize an pdf widget to default values and callbacks
 *
 * Sets the fields and callbacks of @a pdf to their default values.
 */
int
ewl_pdf_init(Ewl_Pdf *pdf)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(pdf, FALSE);

        if (!epdf_init()) 
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        w = EWL_WIDGET(pdf);

        if (!ewl_widget_init(w))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_appearance_set(w, EWL_PDF_TYPE);
        ewl_widget_inherit(w, EWL_PDF_TYPE);

        ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);

        /*
         * Append necessary callbacks.
         */
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_pdf_configure_cb,
                            NULL);
        ewl_callback_append(w, EWL_CALLBACK_REVEAL, ewl_pdf_reveal_cb,
                            NULL);
        ewl_callback_append(w, EWL_CALLBACK_OBSCURE, ewl_pdf_obscure_cb,
                            NULL);
        ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_pdf_destroy_cb,
                            NULL);

        pdf->filename = NULL;

        pdf->pdf_document = NULL;
        pdf->pdf_page = NULL;
        pdf->pdf_index = NULL;

        pdf->dirty = 1;

        pdf->search.o = NULL;
        pdf->search.text = NULL;
        pdf->search.list = NULL;
        pdf->search.page = -1;
        pdf->search.is_case_sensitive = FALSE;
        pdf->search.is_circular = FALSE;

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
示例#25
0
/**
 * @param data: The data to write
 * @param string: Where to write
 * @param mime: The mime type to write as
 * @return Returns TRUE if the write is successful, FALSE otherwise
 * @brief Writes the given data into the given string pointer
 */
int
ewl_io_manager_string_write(Ewl_Widget *data, char **string,
                                                const char *mime)
{
        Ewl_IO_Manager_Plugin *plugin = NULL;
        int ret = 0;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(data, FALSE);
        DCHECK_PARAM_PTR_RET(mime, FALSE);
        DCHECK_TYPE_RET(data, EWL_WIDGET_TYPE, FALSE);

        plugin = ewl_io_manager_plugin_get(mime);
        if (!plugin)
        {
                DWARNING("No plugin available to write mime type: %s.", mime);
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        ret = plugin->string_write(data, string);

        DRETURN_INT(ret, DLEVEL_STABLE);
}
示例#26
0
文件: ewl_dvi.c 项目: Limsik/e17
/**
 * @param dvi: the dvi widget to get the orientation of
 * @return Returns the magnification.
 * @brief get the magnification of the document @p dvi. If @p dvi
 * is NULL, their values are 1.0
 */
double
ewl_dvi_mag_get(Ewl_Dvi *dvi)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(dvi, 1.0);
        DCHECK_TYPE_RET(dvi, EWL_DVI_TYPE, 1.0);

        if (!dvi->dvi_page)
        {
                DRETURN_INT(1.0, DLEVEL_STABLE);
        }

        DRETURN_INT(edvi_page_mag_get(dvi->dvi_page), DLEVEL_STABLE);
}
示例#27
0
/**
 * @param n: The Ewl_Notebook widget to initialize
 * @return Returns TRUE on success or NULL on failure.
 * @brief Initialize a notebook to default values and callbacks
 */
int
ewl_notebook_init(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, FALSE);

        if (!ewl_box_init(EWL_BOX(n)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_VERTICAL);

        ewl_widget_appearance_set(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);
        ewl_widget_inherit(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);

        n->tabbar_position = EWL_POSITION_TOP;

        n->body.tabbar = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.tabbar),
                                EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(n->body.tabbar),
                                                EWL_FLAG_ALIGN_CENTER);
        ewl_widget_internal_set(n->body.tabbar, TRUE);
        ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
        ewl_widget_show(n->body.tabbar);

        n->body.pages = ewl_vbox_new();
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.pages),
                                   EWL_FLAG_FILL_ALL);
        ewl_container_child_append(EWL_CONTAINER(n), n->body.pages);
        ewl_widget_internal_set(n->body.pages, TRUE);
        ewl_widget_layer_priority_set(n->body.pages, -1);
        ewl_widget_appearance_set(n->body.pages, "pages");
        ewl_widget_show(n->body.pages);

        ewl_container_redirect_set(EWL_CONTAINER(n),
                                        EWL_CONTAINER(n->body.pages));

        ewl_container_show_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_show);
        ewl_container_hide_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_hide);
        ewl_container_add_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_add);
        ewl_container_remove_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_remove);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
示例#28
0
/**
 * @param uri: The URI to look up the mime type for
 * @return Returns the mime type for the given URI or NULL on error
 * @brief Retrives the mime type for the given URI or NULL on error
 */
const char *
ewl_io_manager_uri_mime_type_get(const char *uri)
{
        const char *mime = NULL;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(uri, NULL);
#if BUILD_EFREET_SUPPORT
        mime = efreet_mime_type_get(uri);
#else
        mime = "application/octet-stream";
#endif

        DRETURN_PTR(mime, DLEVEL_STABLE);
}
示例#29
0
/**
 * @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);
}
示例#30
0
/**
 * @param win: window to retrieve pointer grab state
 * @return Returns TRUE if window is grabbing pointer, FALSE otherwise.
 * @brief Retrieves the current pointer grab state on a window.
 */
int
ewl_window_pointer_grab_get(Ewl_Window *win)
{
        int grab;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(win, FALSE);
        DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, FALSE);

        if (win->flags & EWL_WINDOW_GRAB_POINTER)
                grab = TRUE;
        else
                grab = FALSE;

        DRETURN_INT(grab, DLEVEL_STABLE);
}