diff --git a/legacy/elementary/configure.in b/legacy/elementary/configure.in index 5d40425b35..17ec80cf03 100644 --- a/legacy/elementary/configure.in +++ b/legacy/elementary/configure.in @@ -57,4 +57,5 @@ data/Makefile data/themes/Makefile data/images/Makefile data/objects/Makefile +data/desktop/Makefile ]) diff --git a/legacy/elementary/data/Makefile.am b/legacy/elementary/data/Makefile.am index 74645f0565..08d4f01c30 100644 --- a/legacy/elementary/data/Makefile.am +++ b/legacy/elementary/data/Makefile.am @@ -1,3 +1,3 @@ AUTOMAKE_OPTIONS = 1.4 foreign MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = themes images objects +SUBDIRS = themes images objects desktop diff --git a/legacy/elementary/data/desktop/Makefile.am b/legacy/elementary/data/desktop/Makefile.am new file mode 100644 index 0000000000..f86bf8ed27 --- /dev/null +++ b/legacy/elementary/data/desktop/Makefile.am @@ -0,0 +1,10 @@ +4AUTOMAKE_OPTIONS = 1.4 foreign +MAINTAINERCLEANFILES = Makefile.in + +desktopdir = $(datadir)/applications +desktop_DATA = elementary_test.desktop + +icondir = $(datadir)/icons +icon_DATA = elementary.png + +EXTRA_DIST = elementary_test.desktop elementary.png diff --git a/legacy/elementary/data/desktop/elementary.png b/legacy/elementary/data/desktop/elementary.png new file mode 100644 index 0000000000..79754891f1 Binary files /dev/null and b/legacy/elementary/data/desktop/elementary.png differ diff --git a/legacy/elementary/data/desktop/elementary_test.desktop b/legacy/elementary/data/desktop/elementary_test.desktop new file mode 100644 index 0000000000..8f9e0c7530 --- /dev/null +++ b/legacy/elementary/data/desktop/elementary_test.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Elementary Test +Comment=Elementary Test Application +Exec=elementary_test +Icon=elementary +Terminal=false +Type=Application +Categories=Application;Utilities; diff --git a/legacy/elementary/data/themes/bubble_3.png b/legacy/elementary/data/themes/bubble_3.png new file mode 100644 index 0000000000..cbdcf9ca84 Binary files /dev/null and b/legacy/elementary/data/themes/bubble_3.png differ diff --git a/legacy/elementary/data/themes/bubble_4.png b/legacy/elementary/data/themes/bubble_4.png new file mode 100644 index 0000000000..5eefbff68c Binary files /dev/null and b/legacy/elementary/data/themes/bubble_4.png differ diff --git a/legacy/elementary/data/themes/bubble_shine3.png b/legacy/elementary/data/themes/bubble_shine3.png new file mode 100644 index 0000000000..398062f622 Binary files /dev/null and b/legacy/elementary/data/themes/bubble_shine3.png differ diff --git a/legacy/elementary/data/themes/bubble_shine4.png b/legacy/elementary/data/themes/bubble_shine4.png new file mode 100644 index 0000000000..9ab6fd0485 Binary files /dev/null and b/legacy/elementary/data/themes/bubble_shine4.png differ diff --git a/legacy/elementary/data/themes/default.edc b/legacy/elementary/data/themes/default.edc index 1d5366a1ca..43087a7e58 100644 --- a/legacy/elementary/data/themes/default.edc +++ b/legacy/elementary/data/themes/default.edc @@ -3078,132 +3078,511 @@ collections { } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/bubble/base/default"; - images { - image: "bubble_1.png" COMP; - image: "bubble_shine.png" COMP; + group { name: "elm/bubble/top_left/default"; + alias: "elm/bubble/base/default"; + images { + image: "bubble_3.png" COMP; + image: "bubble_shine3.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 4 -1; + } + } } - parts { - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.0 1.0; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - to_y: "elm.text"; - relative: 0.0 0.0; - offset: 4 0; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.0 1.0; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 1.0; - offset: 4 -5; - } - rel2 { - to_x: "elm.info"; - relative: 0.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 0 1; - max: 0 1; - align: 0.0 1.0; - } - } - } - part { name: "elm.info"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - rel1 { - relative: 1.0 1.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 64; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - max: 1 1; - align: 1.0 1.0; - } - } - } - part { name: "base0"; - mouse_events: 0; - description { state: "default" 0.0; - rel2 { - to_y: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: -1 -1; - } - image { - normal: "bubble_1.png"; - border: 36 11 10 19; - } - fill.smooth: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 9 8; - } - rel2 { - to: "base0"; - offset: -10 -17; - } - } - } - part { name: "shine"; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 5 4; - } - rel2 { - to: "base0"; - relative: 1.0 0.5; - offset: -6 -16; - } - image { - normal: "bubble_shine.png"; - border: 5 5 5 0; - } - fill.smooth: 0; - } - } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 0.0; + } + } } - } - + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 0.0; + offset: -5 4; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 0.0; + } + } + } + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: 0 0; + } + image { + normal: "bubble_3.png"; + border: 36 11 18 9; + } + fill.smooth: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 16; + } + rel2 { + to: "base0"; + offset: -10 -9; + } + } + } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 7; + } + image { + normal: "bubble_shine3.png"; + border: 36 5 14 0; + } + fill.smooth: 0; + } + } + } + } + + group { name: "elm/bubble/top_right/default"; + images { + image: "bubble_4.png" COMP; + image: "bubble_shine4.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 1.0 0.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + to_y: "elm.text"; + relative: 1.0 1.0; + offset: -5 -1; + } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 0.0; + } + } + } + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + to_x: "elm.swallow.icon"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 0.0; + } + } + } + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: 0 0; + } + image { + normal: "bubble_4.png"; + border: 11 36 18 9; + } + fill.smooth: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 16; + } + rel2 { + to: "base0"; + offset: -10 -9; + } + } + } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 7; + } + image { + normal: "bubble_shine4.png"; + border: 5 36 14 0; + } + fill.smooth: 0; + } + } + } + } + + group { name: "elm/bubble/bottom_left/default"; + images { + image: "bubble_1.png" COMP; + image: "bubble_shine.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 1.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + to_y: "elm.text"; + relative: 0.0 0.0; + offset: 4 0; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 1.0; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 1.0; + offset: 4 -5; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 1.0; + offset: -5 -5; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 1.0; + } + } + } + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 1.0; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 1.0; + } + } + } + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel2 { + to_y: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: -1 -1; + } + image { + normal: "bubble_1.png"; + border: 36 11 10 19; + } + fill.smooth: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 8; + } + rel2 { + to: "base0"; + offset: -10 -17; + } + } + } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 -16; + } + image { + normal: "bubble_shine.png"; + border: 5 5 5 0; + } + fill.smooth: 0; + } + } + } + } + + group { name: "elm/bubble/bottom_right/default"; + images { + image: "bubble_2.png" COMP; + image: "bubble_shine.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 1.0 1.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + to_y: "elm.text"; + relative: 1.0 0.0; + offset: -5 0; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 1.0; + fixed: 0 1; + rel1 { + relative: 0.0 1.0; + offset: 4 -5; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 1.0; + offset: -5 -5; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 1.0; + } + } + } + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 1.0; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + offset: -5 -5; + } + rel2 { + to_x: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: -5 -5; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 1.0; + } + } + } + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel2 { + to_y: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: -1 -1; + } + image { + normal: "bubble_2.png"; + border: 11 36 10 19; + } + fill.smooth: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 8; + } + rel2 { + to: "base0"; + offset: -10 -17; + } + } + } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 -16; + } + image { + normal: "bubble_shine.png"; + border: 5 5 5 0; + } + fill.smooth: 0; + } + } + } + } + /////////////////////////////////////////////////////////////////////////////// group { name: "elm/icon/home/default"; min: 32 32; images.image: "icon_home.png" COMP; parts { part { name: "base"; diff --git a/legacy/elementary/src/bin/test.c b/legacy/elementary/src/bin/test.c index 3312d215ab..f3f2a3c6c2 100644 --- a/legacy/elementary/src/bin/test.c +++ b/legacy/elementary/src/bin/test.c @@ -1249,219 +1249,219 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) static void my_win_main(void) { - Evas_Object *win, *bg, *bx0, *lb, *bx, *bt, *sc, *fr; - - /* 1 create an elm window - it returns an evas object. this is a little - * special as the object lives in the canvas that is inside the window - * so what is returned is really inside the window, but as you manipulate - * the evas object returned - the window will respond. elm_win makes sure - * of that so you can blindly treat it like any other evas object - * pretty much, just as long as you know it has special significance */ - /* the first parameter is a "parent" window - eg for a dialog you want to - * have a main window it is related to, here it is NULL meaning there - * is no parent. "main" is the name of the window - used by the window - * manager for identifying the window uniquely amongst all the windows - * within this application (and all instances of the application). the - * type is a basic window (the final parameter) */ - win = elm_win_add(NULL, "main", ELM_WIN_BASIC); - /* set the title of the window - this is in the titlebar */ - elm_win_title_set(win, "Elementary Tests"); - - /* set a callback on the window when "delete-request" is emitted as - * a callback. when this happens my_win_del() is called and the - * data pointer (first param) is passed the final param here (in this - * case it is NULL). This is how you can pass specific things to a - * callback like objects or data layered on top */ - evas_object_smart_callback_add(win, "delete-request", my_win_del, NULL); - - /* add a background to our window. this just uses the standard theme set - * background. without a backgorund, you could make a window seem - * transparent with elm_win_alpha_set(win, 1); for example. if you have - * a compositor running this will make the window able to be - * semi-transparent and any space not filled by object/widget pixels will - * be transparent or translucent based on alpha. if you do not have a - * comnpositor running this should fall back to using shaped windows - * (which have a mask). both these features will be slow and rely on - * a lot more resources, so only use it if you need it. */ - bg = elm_bg_add(win); - /* set weight to 1.0 x 1.0 == expand in both x and y direction */ - evas_object_size_hint_weight_set(bg, 1.0, 1.0); - /* tell the window that this object is to be resized along with the window. - * also as a result this object will be one of several objects that - * controls the minimum/maximum size of the window */ - elm_win_resize_object_add(win, bg); - /* and show the background */ - evas_object_show(bg); - - /* add a box layout widget to the window */ - bx0 = elm_box_add(win); - /* allow base box (bx0) to expand in x and y */ - evas_object_size_hint_weight_set(bx0, 1.0, 1.0); - /* tell the window that the box affects window size and also will be - * resized when the window is */ - elm_win_resize_object_add(win, bx0); - evas_object_show(bx0); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Information"); - elm_box_pack_end(bx0, fr); - evas_object_show(fr); - - lb = elm_label_add(win); - elm_label_label_set(lb, - "Please slect a test from the list below
" - "by clicking the test button to show the
" - "test window."); - elm_frame_content_set(fr, lb); - evas_object_show(lb); - - /* add a scroller object - anything inside is scrollable */ - sc = elm_scroller_add(win); - /* add scroller to main box */ - evas_object_size_hint_weight_set(sc, 1.0, 1.0); - evas_object_size_hint_align_set(sc, -1.0, -1.0); - elm_box_pack_end(bx0, sc); - evas_object_show(sc); - - /* add a box layout widget to the window */ - bx = elm_box_add(win); - /* set weight to 1.0 x 1.0 == expand in x and y) */ - evas_object_size_hint_weight_set(bx, 1.0, 0.0); - - /* set the box ad the content in the scrolled view*/ - elm_scroller_content_set(sc, bx); - /* show the box, scroller and main box */ - evas_object_show(bx); - - /* create a button */ - bt = elm_button_add(win); - /* set the button label */ - elm_button_label_set(bt, "Bg Plain"); - /* add a callback to be run when the button is clicked */ - evas_object_smart_callback_add(bt, "clicked", my_bt_1, NULL); - /* the button should fill any space it is given horizontally */ - evas_object_size_hint_align_set(bt, -1.0, 0.0); - /* put the button at the end of the box */ - elm_box_pack_end(bx, bt); - /* show the button */ - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Bg Image"); - evas_object_smart_callback_add(bt, "clicked", my_bt_2, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Icon Transparent"); - evas_object_smart_callback_add(bt, "clicked", my_bt_3, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Box Vert"); - evas_object_smart_callback_add(bt, "clicked", my_bt_4, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Box Horiz"); - evas_object_smart_callback_add(bt, "clicked", my_bt_5, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Buttons"); - evas_object_smart_callback_add(bt, "clicked", my_bt_6, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Toggles"); - evas_object_smart_callback_add(bt, "clicked", my_bt_7, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Table"); - evas_object_smart_callback_add(bt, "clicked", my_bt_8, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Clock"); - evas_object_smart_callback_add(bt, "clicked", my_bt_9, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Layout"); - evas_object_smart_callback_add(bt, "clicked", my_bt_10, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Hover"); - evas_object_smart_callback_add(bt, "clicked", my_bt_11, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Hover 2"); - evas_object_smart_callback_add(bt, "clicked", my_bt_12, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Entry"); - evas_object_smart_callback_add(bt, "clicked", my_bt_13, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Entry Scrolled"); - evas_object_smart_callback_add(bt, "clicked", my_bt_14, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Notepad"); - evas_object_smart_callback_add(bt, "clicked", my_bt_15, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Anchorview"); - evas_object_smart_callback_add(bt, "clicked", my_bt_16, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Anchorblock"); - evas_object_smart_callback_add(bt, "clicked", my_bt_17, NULL); - evas_object_size_hint_align_set(bt, -1.0, 0.0); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - /* set an initial window size */ - evas_object_resize(win, 320, 520); - /* show the window */ - evas_object_show(win); + Evas_Object *win, *bg, *bx0, *lb, *bx, *bt, *sc, *fr; + + /* 1 create an elm window - it returns an evas object. this is a little + * special as the object lives in the canvas that is inside the window + * so what is returned is really inside the window, but as you manipulate + * the evas object returned - the window will respond. elm_win makes sure + * of that so you can blindly treat it like any other evas object + * pretty much, just as long as you know it has special significance */ + /* the first parameter is a "parent" window - eg for a dialog you want to + * have a main window it is related to, here it is NULL meaning there + * is no parent. "main" is the name of the window - used by the window + * manager for identifying the window uniquely amongst all the windows + * within this application (and all instances of the application). the + * type is a basic window (the final parameter) */ + win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + /* set the title of the window - this is in the titlebar */ + elm_win_title_set(win, "Elementary Tests"); + + /* set a callback on the window when "delete-request" is emitted as + * a callback. when this happens my_win_del() is called and the + * data pointer (first param) is passed the final param here (in this + * case it is NULL). This is how you can pass specific things to a + * callback like objects or data layered on top */ + evas_object_smart_callback_add(win, "delete-request", my_win_del, NULL); + + /* add a background to our window. this just uses the standard theme set + * background. without a backgorund, you could make a window seem + * transparent with elm_win_alpha_set(win, 1); for example. if you have + * a compositor running this will make the window able to be + * semi-transparent and any space not filled by object/widget pixels will + * be transparent or translucent based on alpha. if you do not have a + * comnpositor running this should fall back to using shaped windows + * (which have a mask). both these features will be slow and rely on + * a lot more resources, so only use it if you need it. */ + bg = elm_bg_add(win); + /* set weight to 1.0 x 1.0 == expand in both x and y direction */ + evas_object_size_hint_weight_set(bg, 1.0, 1.0); + /* tell the window that this object is to be resized along with the window. + * also as a result this object will be one of several objects that + * controls the minimum/maximum size of the window */ + elm_win_resize_object_add(win, bg); + /* and show the background */ + evas_object_show(bg); + + /* add a box layout widget to the window */ + bx0 = elm_box_add(win); + /* allow base box (bx0) to expand in x and y */ + evas_object_size_hint_weight_set(bx0, 1.0, 1.0); + /* tell the window that the box affects window size and also will be + * resized when the window is */ + elm_win_resize_object_add(win, bx0); + evas_object_show(bx0); + + fr = elm_frame_add(win); + elm_frame_label_set(fr, "Information"); + elm_box_pack_end(bx0, fr); + evas_object_show(fr); + + lb = elm_label_add(win); + elm_label_label_set(lb, + "Please slect a test from the list below
" + "by clicking the test button to show the
" + "test window."); + elm_frame_content_set(fr, lb); + evas_object_show(lb); + + /* add a scroller object - anything inside is scrollable */ + sc = elm_scroller_add(win); + /* add scroller to main box */ + evas_object_size_hint_weight_set(sc, 1.0, 1.0); + evas_object_size_hint_align_set(sc, -1.0, -1.0); + elm_box_pack_end(bx0, sc); + evas_object_show(sc); + + /* add a box layout widget to the window */ + bx = elm_box_add(win); + /* set weight to 1.0 x 1.0 == expand in x and y) */ + evas_object_size_hint_weight_set(bx, 1.0, 0.0); + + /* set the box ad the content in the scrolled view*/ + elm_scroller_content_set(sc, bx); + /* show the box, scroller and main box */ + evas_object_show(bx); + + /* create a button */ + bt = elm_button_add(win); + /* set the button label */ + elm_button_label_set(bt, "Bg Plain"); + /* add a callback to be run when the button is clicked */ + evas_object_smart_callback_add(bt, "clicked", my_bt_1, NULL); + /* the button should fill any space it is given horizontally */ + evas_object_size_hint_align_set(bt, -1.0, 0.0); + /* put the button at the end of the box */ + elm_box_pack_end(bx, bt); + /* show the button */ + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Bg Image"); + evas_object_smart_callback_add(bt, "clicked", my_bt_2, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Icon Transparent"); + evas_object_smart_callback_add(bt, "clicked", my_bt_3, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Box Vert"); + evas_object_smart_callback_add(bt, "clicked", my_bt_4, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Box Horiz"); + evas_object_smart_callback_add(bt, "clicked", my_bt_5, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Buttons"); + evas_object_smart_callback_add(bt, "clicked", my_bt_6, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Toggles"); + evas_object_smart_callback_add(bt, "clicked", my_bt_7, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Table"); + evas_object_smart_callback_add(bt, "clicked", my_bt_8, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Clock"); + evas_object_smart_callback_add(bt, "clicked", my_bt_9, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Layout"); + evas_object_smart_callback_add(bt, "clicked", my_bt_10, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Hover"); + evas_object_smart_callback_add(bt, "clicked", my_bt_11, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Hover 2"); + evas_object_smart_callback_add(bt, "clicked", my_bt_12, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Entry"); + evas_object_smart_callback_add(bt, "clicked", my_bt_13, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Entry Scrolled"); + evas_object_smart_callback_add(bt, "clicked", my_bt_14, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Notepad"); + evas_object_smart_callback_add(bt, "clicked", my_bt_15, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Anchorview"); + evas_object_smart_callback_add(bt, "clicked", my_bt_16, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Anchorblock"); + evas_object_smart_callback_add(bt, "clicked", my_bt_17, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + /* set an initial window size */ + evas_object_resize(win, 320, 520); + /* show the window */ + evas_object_show(win); } int diff --git a/legacy/elementary/src/lib/Elementary.h b/legacy/elementary/src/lib/Elementary.h index 74720adecb..81bd94b283 100644 --- a/legacy/elementary/src/lib/Elementary.h +++ b/legacy/elementary/src/lib/Elementary.h @@ -283,9 +283,6 @@ extern "C" { // * scroller could do with page up/down/left/right buttons and and idea of // a page size // * tab widget focusing (not useful for touchscreen tho...) -// * frame needs to be able to use custom frame style -// * button needs to be able to use custom frame style -// * toggle needs to be able to use custom frame style // * entry has no way to show its focused vs other entries // * entry selection conflicts with finger scroll // * toolbar widget (edje + box + button + separators) @@ -307,5 +304,9 @@ extern "C" { // * need to get toplevel // * need "dialogbutton" widget (bigger button for bottom of wins) // * need dialog window widget +// * need a phone-number widget (hilight country dial prefixes, add flags, +// photos of contacts that match etc.) +// * need imageview widget (for large not iconic images) +// * labels with "" are 0x0 size, but with " " are correct vertically. check #endif