From ddb13f269b056aa782e760675faf0ed567095fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Thu, 28 Jul 2011 12:11:14 +0000 Subject: [PATCH] Inwin docs. No example. SVN revision: 61852 --- legacy/elementary/doc/Makefile.am | 5 +- legacy/elementary/doc/index.doxy | 3 + legacy/elementary/doc/widgets/Makefile.am | 8 +- .../doc/widgets/widget_preview_inwin1.c | 17 ++++ .../doc/widgets/widget_preview_inwin2.c | 18 ++++ .../doc/widgets/widget_preview_inwin3.c | 18 ++++ legacy/elementary/src/lib/Elementary.h.in | 99 ++++++++++++++++++- legacy/elementary/src/lib/elm_win.c | 44 --------- 8 files changed, 162 insertions(+), 50 deletions(-) create mode 100644 legacy/elementary/doc/widgets/widget_preview_inwin1.c create mode 100644 legacy/elementary/doc/widgets/widget_preview_inwin2.c create mode 100644 legacy/elementary/doc/widgets/widget_preview_inwin3.c diff --git a/legacy/elementary/doc/Makefile.am b/legacy/elementary/doc/Makefile.am index 5ad98d8f02..74706c2c2b 100644 --- a/legacy/elementary/doc/Makefile.am +++ b/legacy/elementary/doc/Makefile.am @@ -62,7 +62,10 @@ WGT_PREVIEW = \ box:preview-00.png:widget_preview_box:200:160 \ notify:preview-00.png:widget_preview_notify:60:30 \ slideshow:preview-00.png:widget_preview_slideshow:50:50 \ - photocam:preview-00.png:widget_preview_photocam:243:162 + photocam:preview-00.png:widget_preview_photocam:243:162 \ + inwin:preview-00.png:widget_preview_inwin1:200:160 \ + inwin:preview-01.png:widget_preview_inwin2:200:160 \ + inwin:preview-02.png:widget_preview_inwin3:200:160 widget-build: @$(MAKE) -C widgets diff --git a/legacy/elementary/doc/index.doxy b/legacy/elementary/doc/index.doxy index f47c294412..7b3e6156d7 100644 --- a/legacy/elementary/doc/index.doxy +++ b/legacy/elementary/doc/index.doxy @@ -128,6 +128,9 @@ * @image html img/widget/index/preview-00.png * @image latex img/widget/index/preview-00.eps * @li @ref Inwin + * + * @image html img/widget/inwin/preview-00.png + * @image latex img/widget/inwin/preview-00.eps * @li @ref Label * * @image html img/widget/label/preview-00.png diff --git a/legacy/elementary/doc/widgets/Makefile.am b/legacy/elementary/doc/widgets/Makefile.am index b71d073940..04bc51192b 100644 --- a/legacy/elementary/doc/widgets/Makefile.am +++ b/legacy/elementary/doc/widgets/Makefile.am @@ -78,7 +78,10 @@ widget_preview_progressbar \ widget_preview_box \ widget_preview_notify \ widget_preview_slideshow \ -widget_preview_photocam +widget_preview_photocam \ +widget_preview_inwin1 \ +widget_preview_inwin2 \ +widget_preview_inwin3 LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_EMAP_LIBS@ @ELEMENTARY_LIBS@ @EIO_LIBS@ @my_libs@ @@ -138,5 +141,8 @@ EXTRA_DIST = \ widget_preview_notify.c \ widget_preview_slideshow.c \ widget_preview_photocam.c \ + widget_preview_inwin1.c \ + widget_preview_inwin2.c \ + widget_preview_inwin3.c \ widget_preview_tmpl_foot.c \ widget_preview_tmpl_head.c diff --git a/legacy/elementary/doc/widgets/widget_preview_inwin1.c b/legacy/elementary/doc/widgets/widget_preview_inwin1.c new file mode 100644 index 0000000000..a5195feed9 --- /dev/null +++ b/legacy/elementary/doc/widgets/widget_preview_inwin1.c @@ -0,0 +1,17 @@ +#include "widget_preview_tmpl_head.c" + +Evas_Object *inwin, *lbl; + +inwin = elm_win_inwin_add(win); +evas_object_show(inwin); + +lbl = elm_label_add(win); +elm_object_text_set(lbl, "The content of an inwin" + "can be anything that" + "may be shown in a popup." + "This one we are in is" + "using the default style."); +elm_win_inwin_content_set(inwin, lbl); +evas_object_show(lbl); + +#include "widget_preview_tmpl_foot.c" diff --git a/legacy/elementary/doc/widgets/widget_preview_inwin2.c b/legacy/elementary/doc/widgets/widget_preview_inwin2.c new file mode 100644 index 0000000000..cdca36398e --- /dev/null +++ b/legacy/elementary/doc/widgets/widget_preview_inwin2.c @@ -0,0 +1,18 @@ +#include "widget_preview_tmpl_head.c" + +Evas_Object *inwin, *lbl; + +inwin = elm_win_inwin_add(win); +elm_object_style_set(inwin, "minimal"); +evas_object_show(inwin); + +lbl = elm_label_add(win); +elm_object_text_set(lbl, "The content of an inwin" + "can be anything that" + "may be shown in a popup." + "This one we are in is" + "using the minimal style."); +elm_win_inwin_content_set(inwin, lbl); +evas_object_show(lbl); + +#include "widget_preview_tmpl_foot.c" diff --git a/legacy/elementary/doc/widgets/widget_preview_inwin3.c b/legacy/elementary/doc/widgets/widget_preview_inwin3.c new file mode 100644 index 0000000000..fc468b8a1a --- /dev/null +++ b/legacy/elementary/doc/widgets/widget_preview_inwin3.c @@ -0,0 +1,18 @@ +#include "widget_preview_tmpl_head.c" + +Evas_Object *inwin, *lbl; + +inwin = elm_win_inwin_add(win); +elm_object_style_set(inwin, "minimal_vertical"); +evas_object_show(inwin); + +lbl = elm_label_add(win); +elm_object_text_set(lbl, "The content of an inwin" + "can be anything that" + "may be shown in a popup." + "This one we are in is" + "using the minimal_vertical style."); +elm_win_inwin_content_set(inwin, lbl); +evas_object_show(lbl); + +#include "widget_preview_tmpl_foot.c" diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index 2258d98a61..d5eae27660 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -1714,15 +1714,106 @@ extern "C" { EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y) EINA_ARG_NONNULL(1); + /** + * @defgroup Inwin Inwin + * + * @image html img/widget/inwin/preview-00.png + * @image latex img/widget/inwin/preview-00.eps + * @image html img/widget/inwin/preview-01.png + * @image latex img/widget/inwin/preview-01.eps + * @image html img/widget/inwin/preview-02.png + * @image latex img/widget/inwin/preview-02.eps + * + * An inwin is a window inside a window that is useful for a quick popup. + * It does not hover. + * + * It works by creating an object that will occupy the entire window, so it + * must be created using an @ref Win "elm_win" as parent only. The inwin + * object can be hidden or restacked below every other object if it's + * needed to show what's behind it without destroying it. If this is done, + * the elm_win_inwin_activate() function can be used to bring it back to + * full visibility again. + * + * There are three styles available in the default theme. These are: + * @li default: The inwin is sized to take over most of the window it's + * placed in. + * @li minimal: The size of the inwin will be the minimum necessary to show + * its contents. + * @li minimal_vertical: Horizontally, the inwin takes as much space as + * possible, but it's sized vertically the most it needs to fit its\ + * contents. + * + * @{ + */ + /** + * Adds an inwin to the current window + * + * The @p obj used as parent @b MUST be an @ref Win "Elementary Window". + * Never call this function with anything other than the top-most window + * as its parameter, unless you are fond of undefined behavior. + * + * After creating the object, the widget will set itself as resize object + * for the window with elm_win_resize_object_add(), so when shown it will + * appear to cover almost the entire window (how much of it depends on its + * content and the style used). It must not be added into other container + * objects and it needs not be moved or resized manually. + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + */ EAPI Evas_Object *elm_win_inwin_add(Evas_Object *obj) EINA_ARG_NONNULL(1); + /** + * Activates an inwin object, ensuring its visibility + * + * This function will make sure that the inwin @p obj is completely visible + * by calling evas_object_show() and evas_object_raise() on it, to bring it + * to the front. It also sets the keyboard focus to it, which will be passed + * onto its content. + * + * The object's theme will also receive the signal "elm,action,show" with + * source "elm". + * + * @param obj The inwin to activate + */ EAPI void elm_win_inwin_activate(Evas_Object *obj) EINA_ARG_NONNULL(1); + /** + * Set the content of an inwin object. + * + * Once the content object is set, a previously set one will be deleted. + * If you want to keep that old content object, use the + * elm_win_inwin_content_unset() function. + * + * @param obj The inwin object + * @param content The object to set as content + */ EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); + /** + * Get the content of an inwin object. + * + * Return the content object which is set for this widget. + * + * The returned object is valid as long as the inwin is still alive and no + * other content is set on it. Deleting the object will notify the inwin + * about it and this one will be left empty. + * + * If you need to remove an inwin's content to be reused somewhere else, + * see elm_win_inwin_content_unset(). + * + * @param obj The inwin object + * @return The content that is being used + */ EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + /** + * Unset the content of an inwin object. + * + * Unparent and return the content object which was set for this widget. + * + * @param obj The inwin object + * @return The content that was being used + */ EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - /* available styles: - * default - * minimal - * minimal_vertical + /** + * @} */ /* X specific calls - won't work on non-x engines (return 0) */ EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index 3a88b54313..cdbdc7f060 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -3032,11 +3032,6 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) } } -/** - * @defgroup Inwin Inwin - * - * An inwin is a window inside a window that is useful for a quick popup. It does not hover. - */ EAPI Evas_Object * elm_win_inwin_add(Evas_Object *obj) { @@ -3073,13 +3068,6 @@ elm_win_inwin_add(Evas_Object *obj) return obj2; } -/** - * Activates an inwin object - * - * @param obj The inwin to activate - * - * @ingroup Inwin - */ EAPI void elm_win_inwin_activate(Evas_Object *obj) { @@ -3092,18 +3080,6 @@ elm_win_inwin_activate(Evas_Object *obj) elm_object_focus(obj); } -/** - * Set the content of an inwin object. - * - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_win_inwin_content_unset() function. - * - * @param obj The inwin object - * @param content The object to set as content - * - * @ingroup Inwin - */ EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) { @@ -3123,16 +3099,6 @@ elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) _sizing_eval(obj); } -/** - * Get the content of an inwin object. - * - * Return the content object which is set for this widget. - * - * @param obj The inwin object - * @return The content that is being used - * - * @ingroup Inwin - */ EAPI Evas_Object * elm_win_inwin_content_get(const Evas_Object *obj) { @@ -3142,16 +3108,6 @@ elm_win_inwin_content_get(const Evas_Object *obj) return wd->content; } -/** - * Unset the content of an inwin object. - * - * Unparent and return the content object which was set for this widget. - * - * @param obj The inwin object - * @return The content that was being used - * - * @ingroup Inwin - */ EAPI Evas_Object * elm_win_inwin_content_unset(Evas_Object *obj) {