/** * @param win: window to set transient * @param forwin: the window to be transient for * @return Returns no value. * @brief Sets a window to be transient for another window. */ void ewl_window_transient_for(Ewl_Window *win, Ewl_Window *forwin) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(win); DCHECK_TYPE(win, EWL_WINDOW_TYPE); DCHECK_TYPE(forwin, EWL_WINDOW_TYPE); win->transient.ewl = forwin; win->flags &= ~EWL_WINDOW_TRANSIENT_FOREIGN; /* if there is no forwin remove the transient for state * and update the window, if it already exists */ if (!forwin) { win->flags &= ~EWL_WINDOW_TRANSIENT; if (win->window) ewl_engine_window_transient_for(win); DRETURN(DLEVEL_STABLE); } win->flags |= EWL_WINDOW_TRANSIENT; if (win->window) { if (forwin->window) ewl_engine_window_transient_for(win); else ewl_callback_append(EWL_WIDGET(forwin), EWL_CALLBACK_REALIZE, ewl_window_cb_realize_parent, win); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param c: The container to work with * @param w: The widget to work with * @return Returns no value * @brief The child add callback */ void ewl_notebook_cb_child_add(Ewl_Container *c, Ewl_Widget *w) { Ewl_Notebook *n; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(c); DCHECK_PARAM_PTR(w); DCHECK_TYPE(c, EWL_CONTAINER_TYPE); DCHECK_TYPE(w, EWL_WIDGET_TYPE); n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent); /* stick a null tab in there so that it at least shows up */ ewl_notebook_page_tab_widget_set(n, w, NULL); /* we have no current page, make it this one */ if (!n->cur_page) { ewl_notebook_visible_page_set(n, w); ewl_widget_show(w); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param c: The container to work with * @param w: The widget to work with * @param rem_idx: UNUSED * @return Returns no value * @brief The child remove callback */ void ewl_notebook_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx) { Ewl_Widget *t; Ewl_Notebook *n; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(c); DCHECK_PARAM_PTR(w); DCHECK_TYPE(c, EWL_CONTAINER_TYPE); DCHECK_TYPE(w, EWL_WIDGET_TYPE); n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent); /* we still have a tab, delete it */ t = ewl_attach_widget_association_get(w); if (t) ewl_widget_destroy(t); /* change visible pages if needed */ if (w == n->cur_page) { Ewl_Widget *page, *new_tab; int count; count = ewl_container_child_count_get( EWL_CONTAINER(n->body.tabbar)); if (count <= 0) n->cur_page = NULL; else { /* make sure we aren't off the end of the list */ if (idx >= count) idx = count - 1; new_tab = ewl_container_child_get( EWL_CONTAINER(n->body.tabbar), idx); if (new_tab) { page = ewl_attach_widget_association_get( new_tab); if (page) ewl_notebook_visible_page_set( EWL_NOTEBOOK(n), page); } } } DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param w: The widget to work with * @ev_data: The Ewl_Event_Mouse_Down data * @param data: The scrollport * @return Returns no value * @brief The mouse down function for kinetic scrolling */ static void ewl_scrollport_kinetic_cb_mouse_down_embedded(Ewl_Widget *w, void *ev, void *data) { Ewl_Scrollport *s; Ewl_Event_Mouse *md; Ewl_Scrollport_Kinetic_Info_Embedded *info; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(ev); DCHECK_PARAM_PTR(data); DCHECK_TYPE(w, EWL_WIDGET_TYPE); s = EWL_SCROLLPORT(data); md = EWL_EVENT_MOUSE(ev); info = s->kinfo->extra; s->kinfo->clicked = !!TRUE; s->kinfo->active = !!FALSE; memset(&(info->back[0]), 0, sizeof(info->back[0]) * HIST_NUM); info->back[0].x = md->x; info->back[0].y = md->y; info->back[0].time = ecore_time_get(); info->xs = md->x; info->ys = md->y; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param menu: the menu to work with * @return Returns no value * @brief Expand the popup portion of the menu */ void ewl_menu_expand(Ewl_Menu *menu) { Ewl_Menu_Item *item; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(menu); DCHECK_TYPE(menu, EWL_MENU_TYPE); item = EWL_MENU_ITEM(menu); /* nothing to do if the popup is already visible */ if (VISIBLE(menu->popup)) DRETURN(DLEVEL_STABLE); ewl_widget_show(menu->popup); ewl_window_raise(EWL_WINDOW(menu->popup)); if (item->inmenu) { Ewl_Context_Menu *cm; cm = EWL_CONTEXT_MENU(item->inmenu); cm->open_menu = EWL_WIDGET(menu); } else ewl_widget_focus_send(menu->popup); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param e: The Ewl_Entry to set the editable status of * @param editable: The value to set for the editable flag * @return Returns no value * @brief Set if the entry is editable or not */ void ewl_entry_editable_set(Ewl_Entry *e, unsigned int editable) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(e); DCHECK_TYPE(e, EWL_ENTRY_TYPE); if (e->editable == !!editable) DRETURN(DLEVEL_STABLE); e->editable = !!editable; if (e->editable) { ewl_callback_append(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN, ewl_entry_cb_key_down, NULL); if (ewl_widget_state_has(EWL_WIDGET(e), EWL_STATE_FOCUSED)) ewl_widget_show(e->cursor); ewl_widget_state_add(EWL_WIDGET(e), EWL_STATE_ON); } else { ewl_callback_del(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN, ewl_entry_cb_key_down); if (ewl_widget_state_has(EWL_WIDGET(e), EWL_STATE_FOCUSED)) ewl_widget_hide(e->cursor); ewl_widget_state_remove(EWL_WIDGET(e), EWL_STATE_ON); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param s: The separator to set the orientation on * @param o: The orientation to set on the separator * @return Returns no value * @brief Set the orientation of the separator */ void ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(s); DCHECK_TYPE(s, EWL_SEPARATOR_TYPE); if (s->orientation == o) DRETURN(DLEVEL_STABLE); s->orientation = o; if (o == EWL_ORIENTATION_HORIZONTAL) { ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator"); ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINKABLE); } else { ewl_widget_appearance_set(EWL_WIDGET(s), "vseparator"); ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINKABLE); } ewl_widget_configure(EWL_WIDGET(s)); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param menu: The menu to setup * @param info: The info to set into the menu * @return Returns no value * @brief Initializes @a menu with @a info */ void ewl_menu_from_info(Ewl_Menu *menu, Ewl_Menu_Info *info) { int i; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(menu); DCHECK_PARAM_PTR(info); DCHECK_TYPE(menu, EWL_MENU_TYPE); for (i = 0; info[i].name != NULL; i++) { Ewl_Widget *item; item = ewl_menu_item_new(); ewl_button_label_set(EWL_BUTTON(item), info[i].name); ewl_button_image_set(EWL_BUTTON(item), info[i].img, NULL); ewl_container_child_append(EWL_CONTAINER(menu), item); if (info[i].cb) ewl_callback_append(item, EWL_CALLBACK_CLICKED, info[i].cb, NULL); ewl_widget_show(item); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param p: The popup to set the follow widget * @param w: The widget to follow * @return Returns no value * @brief Set the follow widget of the popup */ void ewl_popup_follow_set(Ewl_Popup *p, Ewl_Widget *w) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(p); DCHECK_TYPE(p, EWL_POPUP_TYPE); if (p->follow == w) DRETURN(DLEVEL_STABLE); if (p->follow) { ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY, ewl_popup_cb_follow_destroy, p); ewl_callback_del_with_data(p->follow, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_follow_configure, p); } if (w) { ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_follow_destroy, p); ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_follow_configure, p); } p->follow = w; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param sp: The Ewl_Spectrum to set the hsv value into * @param h: The hue to set * @param s: The saturation to set * @param v: The value to set * @return Returns no value * @brief Set the HSV values for the spectrum */ void ewl_spectrum_hsv_set(Ewl_Spectrum *sp, double h, double s, double v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(sp); DCHECK_TYPE(sp, EWL_SPECTRUM_TYPE); sp->hsv.h = h; sp->hsv.s = s; sp->hsv.v = v; if (sp->hsv.h > 360) sp->hsv.h = 360.0; if (sp->hsv.h <= 0) sp->hsv.h = 360.0; if (sp->hsv.s > 1.0) sp->hsv.s = 1.0; if (sp->hsv.s < 0.0) sp->hsv.s = 0.0; if (sp->hsv.v > 1.0) sp->hsv.v = 1.0; if (sp->hsv.v < 0.0) sp->hsv.v = 0.0; ewl_spectrum_rgb_from_hsv(sp); sp->dirty = TRUE; ewl_widget_configure(EWL_WIDGET(sp)); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param n: The Ewl_Notebook to set the tab into * @param page: The page to associate the tab with * @param tab: The contents of the tab * @return Returns no value. * @brief Set the widget to use as the tab for the page @p page to widget @p tab */ void ewl_notebook_page_tab_widget_set(Ewl_Notebook *n, Ewl_Widget *page, Ewl_Widget *tab) { Ewl_Widget *t; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(n); DCHECK_PARAM_PTR(page); DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE); DCHECK_TYPE(page, EWL_WIDGET_TYPE); if (!tab) { tab = ewl_label_new(); ewl_widget_show(tab); } t = ewl_attach_widget_association_get(page); if (!t) { int idx = 0; t = ewl_hbox_new(); ewl_widget_appearance_set(t, "tab"); ewl_attach_widget_association_set(page, t); ewl_attach_widget_association_set(t, page); ewl_widget_show(t); ewl_callback_append(t, EWL_CALLBACK_CLICKED, ewl_notebook_cb_tab_clicked, n); idx = ewl_container_child_index_get(EWL_CONTAINER(n), page); ewl_container_child_insert(EWL_CONTAINER(n->body.tabbar), t, idx); } else ewl_container_reset(EWL_CONTAINER(t)); /* if this is the current page set it's tab to selected */ if (n->cur_page == page) ewl_widget_state_add(t, EWL_STATE_SELECTED); ewl_container_child_append(EWL_CONTAINER(t), tab); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param c: The container to work with * @param w: The widget to work with * @return Returns no value * @brief The child hide callback */ void ewl_notebook_cb_child_hide(Ewl_Container *c, Ewl_Widget *w) { Ewl_Notebook *n; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(c); DCHECK_PARAM_PTR(w); DCHECK_TYPE(c, EWL_CONTAINER_TYPE); DCHECK_TYPE(w, EWL_WIDGET_TYPE); n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent); if (n->cur_page == w) ewl_widget_show(w); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param c: The container to work with * @param w: The widget to work with * @return Returns no value * @brief The child add callback */ void ewl_toolbar_cb_child_add(Ewl_Container *c, Ewl_Widget *w) { Ewl_Toolbar *t; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(c); DCHECK_PARAM_PTR(w); DCHECK_TYPE(c, EWL_CONTAINER_TYPE); DCHECK_TYPE(w, EWL_WIDGET_TYPE); ewl_menubar_cb_child_add(c, w); t = EWL_TOOLBAR(EWL_WIDGET(c)->parent); if (EWL_ICON_IS(w)) ewl_icon_part_hide(EWL_ICON(w), t->hidden); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param b: the border widget to change the text * @param t: the text to set for the border label * @return Returns no value. * @brief Set the label for the border * * Change the text of the border label to the string @a t. */ void ewl_border_label_set(Ewl_Border *b, const char *t) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(b); DCHECK_TYPE(b, EWL_BORDER_TYPE); ewl_label_text_set(EWL_LABEL(b->label), t); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param n: The Ewl_Notebook to make homogeneous * @param h: Boolean value to set the notebook's homogeneous value * @return Returns no value * @brief Sets the tabs in the notebook to be the same size **/ void ewl_notebook_tabbar_homogeneous_set(Ewl_Notebook *n, unsigned int h) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(n); DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE); ewl_box_homogeneous_set(EWL_BOX(n->body.tabbar), !!h); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param e: The Ewl_Entry to set the multiline status * @param multiline: The multiline status to set * @return Returns no value * @brief Set if the entry is multiline or not */ void ewl_entry_multiline_set(Ewl_Entry *e, unsigned int multiline) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(e); DCHECK_TYPE(e, EWL_ENTRY_TYPE); e->multiline = !!multiline; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param win: the window to lower. * @return Returns no value. * @brief Lower a window. * * Lower the window @a win if it is realized. */ void ewl_window_lower(Ewl_Window *win) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(win); DCHECK_TYPE(win, EWL_WINDOW_TYPE); ewl_engine_window_lower(win); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param b: The Ewl_Border to set the alignment on * @param align: The alignment to set on the label * @return Retruns no value * @brief alters the alignment setting of the label on the border */ void ewl_border_label_alignment_set(Ewl_Border *b, unsigned int align) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(b); DCHECK_TYPE(b, EWL_BORDER_TYPE); ewl_object_alignment_set(EWL_OBJECT(b->label), align); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param p: The popup * @param fit: TRUE or FALSE * @return Returns no value * @brief */ void ewl_popup_fit_to_follow_set(Ewl_Popup *p, int fit) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(p); DCHECK_TYPE(p, EWL_POPUP_TYPE); p->fit_to_follow = !!fit; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @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); }
/** * @param menu: the menu to work with * @return Returns no value * @brief Collapses the popup portion of the menu */ void ewl_menu_collapse(Ewl_Menu *menu) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(menu); DCHECK_TYPE(menu, EWL_MENU_TYPE); ewl_widget_hide(menu->popup); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param s: The scrollport to work with * @param fps: The desired frames per second * @return Returns no value * @brief Sets the number of times per second to recalculate velocity and update the tree */ void ewl_scrollport_kinetic_fps_set(Ewl_Scrollport *s, int fps) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(s); DCHECK_TYPE(s, EWL_SCROLLPORT_TYPE); s->kinfo->fps = fps; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param s: The scrollport to work with * @param d: The multiplier to reduce velocity * @return Returns no value * @brief Sets the multiplier to reduce the velocity of kinetic scrolling */ void ewl_scrollport_kinetic_dampen_set(Ewl_Scrollport *s, double d) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(s); DCHECK_TYPE(s, EWL_SCROLLPORT_TYPE); s->kinfo->dampen = d; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param s: The scrollport to work with * @param v: The minimum velocity * @return Returns no value * @brief Sets the minimum velocity for kinetic scrolling */ void ewl_scrollport_kinetic_min_velocity_set(Ewl_Scrollport *s, double v) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(s); DCHECK_TYPE(s, EWL_SCROLLPORT_TYPE); s->kinfo->vmin = v; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param n: The Ewl_Notebook to set the tabbar alignment of * @param align: The Ewl_Alignment to set the alignment too * @return Returns no value. * @brief Set the alignment of the tabbar in the notebook widget */ void ewl_notebook_tabbar_alignment_set(Ewl_Notebook *n, unsigned int align) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(n); DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE); ewl_object_alignment_set(EWL_OBJECT(n->body.tabbar), align); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param p: The popup to set the offset for * @param x: the x offset * @param y: the y offset * @return Returns no value * @brief This is to set the offset to where the popup will be placed */ void ewl_popup_offset_set(Ewl_Popup *p, int x, int y) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(p); DCHECK_TYPE(p, EWL_POPUP_TYPE); p->offset.x = x; p->offset.y = y; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param sp: The Ewl_Spectrum to set the type on * @param type: The type to set the spectrum too * @return Returns no value * @brief Set the type of the spectrum */ void ewl_spectrum_type_set(Ewl_Spectrum *sp, Ewl_Spectrum_Type type) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(sp); DCHECK_TYPE(sp, EWL_SPECTRUM_TYPE); sp->type = type; ewl_widget_configure(EWL_WIDGET(sp)); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param win: the window to work with. * @return Returns no value. * @brief Request the WM to pay attention to the window * * Demand attention for the window @a win if it is realized. * The window manager will then try to draw attention to the * window, e.g. a blinking taskbar entry. When the window * got the wanted attention the window manager will stop * this action itself. */ void ewl_window_attention_demand(Ewl_Window *win) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(win); DCHECK_TYPE(win, EWL_WINDOW_TYPE); win->flags |= EWL_WINDOW_DEMANDS_ATTENTION; ewl_engine_window_states_set(win); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param p: The popup to set the mouse position for * @param x: the x coordinate * @param y: the y coordinate * @return Returns no value * @brief This is to set the mouse coordinates to the popup, * where it get placed relative to. */ void ewl_popup_mouse_position_set(Ewl_Popup *p, int x, int y) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(p); DCHECK_TYPE(p, EWL_POPUP_TYPE); p->mouse.x = x; p->mouse.y = y; DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param p: The popup to set the type for * @param type: the new type of the popup * @return Returns no value * @brief This is to set the type of the popup. The type defines how the * popup will handle the positioning. */ void ewl_popup_type_set(Ewl_Popup *p, Ewl_Popup_Type type) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(p); DCHECK_TYPE(p, EWL_POPUP_TYPE); p->type = type; /* XXX: Do we need a configure here? */ DLEAVE_FUNCTION(DLEVEL_STABLE); }