From: Enlightenment S. <no-...@en...> - 2009-08-06 23:48:39
|
Log: * Port text and font stuff * Some work on the toolbar * A new frames theme Author: davemds Date: 2009-08-06 16:48:31 -0700 (Thu, 06 Aug 2009) New Revision: 41628 Added: branches/edje_editor_elm/src/bin/edje_editor_fonts.c branches/edje_editor_elm/src/bin/edje_editor_fonts.h Modified: branches/edje_editor_elm/data/blank.edc branches/edje_editor_elm/data/edje_editor.edc branches/edje_editor_elm/data/elemele.edc branches/edje_editor_elm/src/bin/Makefile.am branches/edje_editor_elm/src/bin/edje_editor_dialogs.c branches/edje_editor_elm/src/bin/edje_editor_group.c branches/edje_editor_elm/src/bin/edje_editor_part.c branches/edje_editor_elm/src/bin/edje_editor_state.c branches/edje_editor_elm/src/bin/edje_editor_text.c branches/edje_editor_elm/src/bin/edje_editor_text.h branches/edje_editor_elm/src/bin/edje_editor_toolbar.c branches/edje_editor_elm/src/bin/edje_editor_toolbar.h branches/edje_editor_elm/src/bin/edje_editor_window.c branches/edje_editor_elm/src/bin/edje_editor_window.h branches/edje_editor_elm/src/bin/main.h Modified: branches/edje_editor_elm/data/blank.edc =================================================================== --- branches/edje_editor_elm/data/blank.edc 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/data/blank.edc 2009-08-06 23:48:31 UTC (rev 41628) @@ -1,3 +1,7 @@ +/*** + * This is the edje template used by edje_editor as a new file + ***/ + images { } @@ -6,16 +10,14 @@ } spectra { - spectrum{ - name: "Abstract 1"; + spectrum { name: "Abstract 1"; color: 65 76 254 255 292; color: 14 209 159 255 26; color: 141 89 249 255 23; color: 255 15 240 255 18; color: 255 254 10 255 18; } - spectrum{ - name: "Abstract 2"; + spectrum { name: "Abstract 2"; color: 255 1 14 255 237; color: 234 114 251 255 102; color: 30 83 149 255 52; @@ -24,8 +26,7 @@ color: 243 121 255 255 31; color: 60 49 255 255 13; } - spectrum{ - name: "Abstract 3"; + spectrum { name: "Abstract 3"; color: 7 110 20 255 50; color: 250 182 109 255 197; color: 29 63 166 255 120; @@ -33,22 +34,19 @@ color: 84 215 252 255 20; color: 5 252 20 255 21; } - spectrum{ - name: "Aneurism"; + spectrum { name: "Aneurism"; color: 0 0 0 0 111; color: 73 1 96 200 64; color: 173 0 9 255 32; color: 73 1 96 200 85; color: 0 0 0 0 85; } - spectrum{ - name: "Blue Green"; + spectrum { name: "Blue Green"; color: 0 123 255 255 1; color: 71 224 255 255 2; color: 0 255 162 255 1; } - spectrum{ - name: "Browns"; + spectrum { name: "Browns"; color: 141 91 49 255 1; color: 187 117 42 255 1; color: 140 84 6 255 1; @@ -61,8 +59,7 @@ color: 173 133 93 255 1; color: 141 91 50 255 1; } - spectrum{ - name: "Burning Paper"; + spectrum { name: "Burning Paper"; color: 255 255 255 255 485; color: 255 255 255 255 123; color: 0 0 0 255 48; @@ -71,8 +68,7 @@ color: 226 131 5 255 72; color: 186 34 37 255 65; } - spectrum{ - name: "Burning Trasparency"; + spectrum { name: "Burning Trasparency"; color: 255 255 255 0 485; color: 255 255 255 0 123; color: 0 0 0 255 48; @@ -81,15 +77,13 @@ color: 226 131 5 255 72; color: 186 34 37 0 65; } - spectrum{ - name: "Caribbean Blue"; + spectrum { name: "Caribbean Blue"; color: 0 33 149 255 373; color: 50 209 185 255 159; color: 254 252 219 255 107; color: 0 110 0 255 258; } - spectrum{ - name: "CD Half"; + spectrum { name: "CD Half"; color: 209 209 209 255 42; color: 225 225 225 255 56; color: 253 253 253 255 63; @@ -101,19 +95,16 @@ color: 209 209 209 255 122; color: 225 225 225 255 205; } - spectrum{ - name: "Coffee"; + spectrum { name: "Coffee"; color: 0 0 0 0 17; color: 77 59 42 255 1; } - spectrum{ - name: "Deep Sea"; + spectrum { name: "Deep Sea"; color: 0 3 43 255 511; color: 46 99 158 255 160; color: 0 247 247 255 123; } - spectrum{ - name: "Four Bars"; + spectrum { name: "Four Bars"; color: 0 0 0 255 1; color: 255 255 255 255 1; color: 0 0 0 255 1; @@ -124,14 +115,12 @@ color: 255 255 255 255 1; color: 0 0 0 255 1; } - spectrum{ - name: "French Flag Smooth"; + spectrum { name: "French Flag Smooth"; color: 1 1 255 255 1; color: 255 255 255 255 1; color: 255 1 1 255 1; } - spectrum{ - name: "Full Saturation Spectrum"; + spectrum { name: "Full Saturation Spectrum"; color: 255 0 0 255 1; color: 255 255 0 255 1; color: 0 255 0 255 1; @@ -140,8 +129,7 @@ color: 255 0 255 255 1; color: 255 0 0 255 1; } - spectrum{ - name: "Golden"; + spectrum { name: "Golden"; color: 36 40 3 255 94; color: 134 105 22 255 90; color: 165 139 41 255 46; @@ -158,8 +146,7 @@ color: 138 109 26 255 62; color: 35 40 3 255 65; } - spectrum{ - name: "Greens"; + spectrum { name: "Greens"; color: 37 100 34 255 1; color: 51 77 35 255 1; color: 104 156 70 255 1; @@ -171,8 +158,7 @@ color: 93 106 86 255 1; color: 25 67 1 255 1; } - spectrum{ - name: "Horizon"; + spectrum { name: "Horizon"; color: 13 92 146 255 589; color: 255 255 255 255 39; color: 66 31 9 255 27; @@ -181,16 +167,14 @@ color: 90 42 15 255 37; color: 248 138 54 255 33; } - spectrum{ - name: "Incandescent"; + spectrum { name: "Incandescent"; color: 0 0 0 255 349; color: 187 0 0 255 215; color: 255 139 50 255 195; color: 248 249 23 255 96; color: 249 247 212 255 70; } - spectrum{ - name: "Neon Cyan"; + spectrum { name: "Neon Cyan"; color: 0 255 242 0 611; color: 0 255 242 0 58; color: 2 255 233 200 46; @@ -199,8 +183,7 @@ color: 0 255 242 0 33; color: 0 255 242 0 99; } - spectrum{ - name: "Neon Green"; + spectrum { name: "Neon Green"; color: 0 255 0 0 611; color: 0 255 0 0 58; color: 0 255 0 200 46; @@ -209,8 +192,7 @@ color: 0 255 0 0 33; color: 0 255 0 0 99; } - spectrum{ - name: "Neon Yellow"; + spectrum { name: "Neon Yellow"; color: 255 242 0 0 611; color: 255 242 0 0 58; color: 255 242 0 200 46; @@ -219,8 +201,7 @@ color: 255 242 0 0 33; color: 255 242 0 0 99; } - spectrum{ - name: "Pastel Rainbow"; + spectrum { name: "Pastel Rainbow"; color: 255 192 191 255 1; color: 255 254 191 255 1; color: 191 255 199 255 1; @@ -229,8 +210,7 @@ color: 255 191 255 255 1; color: 255 191 191 255 1; } - spectrum{ - name: "Pastels"; + spectrum { name: "Pastels"; color: 245 224 177 255 80; color: 245 189 237 255 61; color: 194 207 246 255 56; @@ -247,8 +227,7 @@ color: 254 234 243 255 62; color: 255 191 221 255 62; } - spectrum{ - name: "Tropical Colors"; + spectrum { name: "Tropical Colors"; color: 9 41 4 255 85; color: 4 82 1 255 72; color: 48 145 21 255 88; @@ -260,8 +239,7 @@ color: 104 222 71 255 81; color: 93 131 3 255 46; } - spectrum{ - name: "Yellow Orange"; + spectrum { name: "Yellow Orange"; color: 255 227 0 255 1; color: 255 136 0 255 1; color: 230 109 29 255 1; @@ -269,18 +247,28 @@ } collections { - group{ - name: "The first group"; - parts{ - part{ - name: "A rectangle"; - type: RECT; - description{ - state: "default" 0.0; - rel1 {relative: 0.1 0.1;} - rel2 {relative: 0.9 0.9;} - } - } + group { name: "The first group"; + parts { + part { name: "A rectangle"; + type: RECT; + description { state: "default" 0.0; + rel1 { relative: 0.1 0.1; } + rel2 { relative: 0.9 0.9; } + } + } + part { name: "A text"; + type: TEXT; + description { state: "default" 0.0; + color: 0 0 0 255; + rel1 { relative: 0.1 0.1; } + rel2 { relative: 0.9 0.9; } + text { + font: "Sans"; + size: 14; + text: "Hallo World !! :)"; + } + } + } } } } Modified: branches/edje_editor_elm/data/edje_editor.edc =================================================================== --- branches/edje_editor_elm/data/edje_editor.edc 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/data/edje_editor.edc 2009-08-06 23:48:31 UTC (rev 41628) @@ -15,73 +15,87 @@ * along with Edje_editor. If not, see <http://www.gnu.org/licenses/>. */ -#define FRAME(NAME, W, H, IMAGE_NAME, IW, IH, PLACE_AFTER) \ - part { \ - name: NAME"_frame"; \ - type: IMAGE; \ - description { \ - state: "default" 0.0; \ - rel1 {relative: 1.0 1.0; offset: 0 0; to_y: PLACE_AFTER;} \ - rel2 {relative: 1.0 1.0; offset: W 0; to_y: PLACE_AFTER;} \ +#define FONT_SIZE 10 +#define BIG_FONT_SIZE 13 + +#define FRAME(NAME, W, H, IW, IH, PLACE_AFTER) \ + part { name: NAME"_frame"; \ + description { state: "default" 0.0; \ + rel1 {relative: 1.0 1.0; offset: -W 0; to_y: PLACE_AFTER;} \ + rel2 {relative: 1.0 1.0; offset: 0 -1; to_y: PLACE_AFTER;} \ image {normal: "frame_bg.png"; border: 2 2 2 2;} \ } \ - description { \ - state: "big" 0.0; \ - rel1 {relative: 1.0 1.0; offset: -W 0; to_y: PLACE_AFTER;} \ + description { state: "big" 0.0; \ + rel1 {relative: 1.0 1.0; offset: -W 20; to_y: PLACE_AFTER;} \ rel2 {relative: 1.0 1.0; offset: 0 H; to_y: PLACE_AFTER;} \ image {normal: "frame_bg.png"; border: 2 2 2 2;} \ } \ - description { \ - state: "small" 0.0; \ - rel1 {relative: 1.0 1.0; offset: 0 0; to_y: PLACE_AFTER;} \ - rel2 {relative: 1.0 1.0; offset: W 5+IH; to_y: PLACE_AFTER;} \ + description { state: "small" 0.0; \ + rel1 {relative: 1.0 1.0; offset: -W 20; to_y: PLACE_AFTER;} \ + rel2 {relative: 1.0 1.0; offset: 0 20; to_y: PLACE_AFTER;} \ image {normal: "frame_bg.png"; border: 2 2 2 2;} \ } \ } \ - part { \ - name: NAME"_frame_swallow"; \ + part { name: NAME"_frame_swallow_clip"; \ + description { state: "default" 0.0; \ + rel1 {relative: 0.0 0.0; offset: 3 3; to: NAME"_frame";} \ + rel2 {relative: 1.0 1.0; offset: -3 -3; to: NAME"_frame";} \ + } \ + } \ + part { name: NAME"_frame_swallow"; \ type: SWALLOW; \ mouse_events: 1; \ - description { \ - state: "default" 0.0; \ + clip_to: NAME"_frame_swallow_clip"; \ + description { state: "default" 0.0; \ color: 0 0 0 0; \ - rel1 {relative: 0.0 0.0; offset: 5 5; to: NAME"_frame";} \ - rel2 {relative: 1.0 1.0; offset: -5 -5; to: NAME"_frame";} \ + rel1 {relative: 0.0 0.0; offset: 3 3; to: NAME"_frame";} \ + rel2 {relative: 1.0 1.0; offset: -3 -3; to: NAME"_frame";} \ } \ } \ - part { \ - name: NAME"_frame_label_bg"; \ + part { name: NAME"_frame_label_bg"; \ type: IMAGE; \ mouse_events: 1; \ - description { \ - state: "default" 0.0; \ - rel1 {relative: 0.0 0.0; offset: -20 1; to: NAME"_frame";} \ - rel2 {relative: 0.0 1.0; offset: -1 -2; to: NAME"_frame";} \ - image {normal: "frame_bg_label.png"; border: 1 1 1 1;} \ + description { state: "default" 0.0; \ + rel1 {relative: 0.0 0.0; to: NAME"_frame";} \ + rel2 {relative: 1.0 0.0; to: NAME"_frame";} \ + image {normal: "frame_bg_label.png"; border: 1 1 1 1;} \ + visible: 0; \ } \ - } \ - part { \ - name: NAME"_frame_label_clip"; \ - type: RECT; \ - mouse_events: 0; \ - description { \ - state: "default" 0.0; \ - rel1 {relative: 0.0 0.0; offset: 0 0; to: NAME"_frame_label_bg";} \ - rel2 {relative: 1.0 1.0; offset: 0 0; to: NAME"_frame_label_bg";} \ + description { state: "big" 0.0; \ + rel1 {relative: 0.0 0.0; offset: 0 -20; to: NAME"_frame";} \ + rel2 {relative: 1.0 0.0; to: NAME"_frame";} \ + image {normal: "frame_bg_label.png"; border: 1 1 1 1;} \ } \ } \ - part { \ - name: NAME"_frame_label_text"; \ - type: IMAGE; \ + part { name: NAME"_frame_label"; \ + type: TEXT; \ mouse_events: 0; \ - clip_to: NAME"_frame_label_clip"; \ - description { \ - state: "default" 0.0; \ - rel1 {relative: 1.0 1.0; offset: -3-IW -IH; to: NAME"_frame_label_bg";} \ - rel2 {relative: 1.0 1.0; offset: -3 0; to: NAME"_frame_label_bg";} \ - image {normal: IMAGE_NAME;} \ + effect: FAR_SHADOW; \ + description { state: "default" 0.0; \ + rel1 {to: NAME"_frame_label_bg";} \ + rel2 {to: NAME"_frame_label_bg";} \ + color2: 255 255 255 255; \ + color3: 55 55 55 55; \ + text { \ + text: NAME; \ + font: "Sans:style=Bold"; \ + size: BIG_FONT_SIZE; \ + } \ + visible: 0; \ } \ + description { state: "big" 0.0; \ + rel1 {to: NAME"_frame_label_bg";} \ + rel2 {to: NAME"_frame_label_bg";} \ + color2: 255 255 255 255; \ + color3: 55 55 55 55; \ + text { \ + text: NAME; \ + font: "Sans:style=Bold"; \ + size: BIG_FONT_SIZE; \ + } \ + } \ } + #define FRAME_PROG(NAME) \ program{ \ @@ -107,6 +121,8 @@ action: STATE_SET "default" 0.0; \ transition: SINUSOIDAL 0.5; \ target: NAME"_frame"; \ + target: NAME"_frame_label_bg"; \ + target: NAME"_frame_label"; \ } \ program{ \ name: NAME"_frame_show"; \ @@ -115,6 +131,8 @@ action: STATE_SET "big" 0.0; \ transition: SINUSOIDAL 0.5; \ target: NAME"_frame"; \ + target: NAME"_frame_label_bg"; \ + target: NAME"_frame_label"; \ } \ program{ \ name: NAME"_frame_show_small"; \ @@ -123,6 +141,8 @@ action: STATE_SET "small" 0.0; \ transition: SINUSOIDAL 0.5; \ target: NAME"_frame"; \ + target: NAME"_frame_label_bg"; \ + target: NAME"_frame_label"; \ } #define STATIC_IMAGE(NAME, FILE, W, H, EVENTS) \ @@ -138,11 +158,7 @@ state: "default" 0.0; \ aspect: 1.0 1.0; \ aspect_preference: BOTH; \ - image {normal: FILE;} \ - } \ - } \ - } \ - } + image {normal: FILE;} } } } } #define LINE(NAME, ALPHA, Y) \ part { name: NAME; \ @@ -156,27 +172,8 @@ text: ""; \ font: "vera.ttf"; \ size: 10; \ - align: 0.0 0.5; \ - } \ - } \ - } + align: 0.0 0.5; } } } - //~ part { name: "line2"; - //~ type: TEXT; - //~ mouse_events: 0; - //~ description { state: "default" 0.0; - //~ color: 80 80 80 190; - //~ rel1 {relative: 0.0 0.6; offset: 5 0; to: "con_bg";} - //~ rel2 {relative: 1.0 0.8; to: "con_bg";} - //~ text{ - //~ text: ""; - //~ font: "vera.ttf"; - //~ size: 10; - //~ align: 0.0 0.5; - //~ } - //~ } - //~ } - images { image: "backdrop.png" LOSSY 95; image: "bg1.png" LOSSY 95; @@ -190,17 +187,6 @@ image: "logo.png" LOSSY 95; image: "frame_bg.png" LOSSY 95; image: "frame_bg_label.png" LOSSY 95; - image: "lbl_group.png" LOSSY 95; - image: "lbl_part.png" LOSSY 95; - image: "lbl_desc.png" LOSSY 95; - image: "lbl_rect.png" LOSSY 95; - image: "lbl_text.png" LOSSY 95; - image: "lbl_image.png" LOSSY 95; - image: "lbl_pos.png" LOSSY 95; - image: "lbl_prog.png" LOSSY 95; - image: "lbl_script.png" LOSSY 95; - image: "lbl_grad.png" LOSSY 95; - image: "lbl_fill.png" LOSSY 95; image: "image.png" LOSSY 95; image: "rect.png" LOSSY 95; image: "text.png" LOSSY 95; @@ -236,6 +222,7 @@ image: "add.png" LOSSY 95; image: "remove.png" LOSSY 95; image: "dia_warning.png" LOSSY 95; + image: "exit.png" LOSSY 95; } fonts { @@ -283,6 +270,7 @@ STATIC_IMAGE("ADD.PNG", "add.png", 10, 10, 0); STATIC_IMAGE("REMOVE.PNG", "remove.png", 10, 10, 0); STATIC_IMAGE("WARN.PNG", "dia_warning.png", 48, 48, 0); + STATIC_IMAGE("EXIT.PNG", "exit.png", 48, 48, 1); group{ name: "BG3_I.PNG"; @@ -344,15 +332,15 @@ } } /* toolbar swallow */ - part { name: "toolbar"; + part { name: "toolbar_swallow"; type: SWALLOW; description { state: "default" 0.0; rel1 {relative: 0.0 0.0; offset: 150 0;} - rel2 {relative: 1.0 0.0; offset: 0 45;} + rel2 {relative: 1.0 0.0; offset: -7 45;} } } /* tree swallow */ - part { name: "tree"; + part { name: "tree_swallow"; type: SWALLOW; description { state: "default" 0.0; rel1 {relative: 0.0 0.0; offset: 3 55;} @@ -365,7 +353,7 @@ mouse_events: 0; description { state: "default" 0.0; color: 255 255 0 0; - rel1 {relative: 1.0 1.0; offset: 0 -100; to: "tree";} + rel1 {relative: 1.0 1.0; offset: 0 -100; to: "tree_swallow";} rel2 {relative: 1.0 1.0; offset: 0 -5;} } } @@ -391,17 +379,17 @@ } } //EXAMPLE: FRAME (name, w, h, img_name, place_after) - FRAME("group", 200, 70, "lbl_group.png", 14, 50, "frames_starter") - FRAME("part", 200, 55, "lbl_part.png", 14, 35,"group_frame") - FRAME("state", 200, 133, "lbl_desc.png", 14, 42, "part_frame") - FRAME("rect", 120, 77, "lbl_rect.png", 14, 72, "state_frame") - FRAME("text", 250, 180, "lbl_text.png", 14, 36, "rect_frame") - FRAME("image", 250, 230, "lbl_image.png", 14, 46, "text_frame") - FRAME("gradient", 250, 135, "lbl_grad.png", 14, 67, "image_frame") - FRAME("fill", 250, 45, "lbl_fill.png", 14, 30, "gradient_frame") - FRAME("position", 200, 200, "lbl_pos.png", 14, 60, "fill_frame") - FRAME("program", 250, 250, "lbl_prog.png", 14, 60, "position_frame") - FRAME("script", 250, 250, "lbl_script.png", 14, 45, "program_frame") + FRAME("group", 200, 90, 14, 50, "frames_starter") + FRAME("part", 200, 75, 14, 35,"group_frame") + FRAME("state", 200, 153, 14, 42, "part_frame") + FRAME("rect", 120, 97, 14, 72, "state_frame") + FRAME("text", 200, 200, 14, 36, "rect_frame") + FRAME("image", 200, 250, 14, 46, "text_frame") + FRAME("gradient", 250, 155, 14, 67, "image_frame") + FRAME("fill", 200, 65, 14, 30, "gradient_frame") + FRAME("position", 200, 220, 14, 60, "fill_frame") + FRAME("program", 250, 270, 14, 60, "position_frame") + FRAME("script", 250, 270, 14, 45, "program_frame") } programs { program{ Modified: branches/edje_editor_elm/data/elemele.edc =================================================================== --- branches/edje_editor_elm/data/elemele.edc 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/data/elemele.edc 2009-08-06 23:48:31 UTC (rev 41628) @@ -1,4 +1,3 @@ -#define FONT_SIZE 10 /**** Background *** * @@ -75,137 +74,137 @@ * styles: * -hoversel_vertical //TODO more styles */ - group { name: "elm/button/base/default"; - parts { - part { name: "button_image"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 200 200 0 200; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 0; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.offset: 3 -5; - rel2.relative: 0.0 1.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - fixed: 0 0; - visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel2.offset: -5 -5; - rel2.relative: 1.0 1.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 4; - rel2.offset: -5 -5; - color: 80 80 80 255; - text { - font: "Sans"; - size: FONT_SIZE; - min: 0 0; - align: 0.5 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } - } - } - programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "button_image"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "button_image"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "button_unclick2"; - } - program { - name: "button_unclick2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "icononly", 0.0); - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - } - } + //~ group { name: "elm/button/base/default"; + //~ parts { + //~ part { name: "button_image"; + //~ type: RECT; + //~ mouse_events: 1; + //~ description { state: "default" 0.0; + //~ color: 200 200 0 200; + //~ } + //~ description { state: "clicked" 0.0; + //~ inherit: "default" 0.0; + //~ } + //~ } + //~ part { name: "elm.swallow.content"; + //~ type: SWALLOW; + //~ description { state: "default" 0.0; + //~ fixed: 1 0; + //~ visible: 0; + //~ align: 0.0 0.5; + //~ rel1.offset: 4 4; + //~ rel2.offset: 3 -5; + //~ rel2.relative: 0.0 1.0; + //~ } + //~ description { state: "visible" 0.0; + //~ inherit: "default" 0.0; + //~ fixed: 1 0; + //~ visible: 1; + //~ aspect: 1.0 1.0; + //~ aspect_preference: VERTICAL; + //~ rel2.offset: 4 -5; + //~ } + //~ description { state: "icononly" 0.0; + //~ inherit: "default" 0.0; + //~ fixed: 0 0; + //~ visible: 1; + //~ align: 0.5 0.5; + //~ aspect: 1.0 1.0; + //~ rel2.offset: -5 -5; + //~ rel2.relative: 1.0 1.0; + //~ aspect_preference: VERTICAL; + //~ } + //~ } + //~ part { name: "elm.text"; + //~ type: TEXT; + //~ mouse_events: 0; + //~ scale: 1; + //~ description { state: "default" 0.0; + //~ visible: 0; + //~ rel1.to_x: "elm.swallow.content"; + //~ rel1.relative: 1.0 0.0; + //~ rel1.offset: 0 4; + //~ rel2.offset: -5 -5; + //~ color: 80 80 80 255; + //~ text { + //~ font: "Sans"; + //~ size: FONT_SIZE; + //~ min: 0 0; + //~ align: 0.5 0.5; + //~ } + //~ } + //~ description { state: "visible" 0.0; + //~ inherit: "default" 0.0; + //~ visible: 1; + //~ text.min: 1 1; + //~ } + //~ } + //~ } + //~ programs { + //~ program { + //~ name: "button_click"; + //~ signal: "mouse,down,1"; + //~ source: "button_image"; + //~ action: STATE_SET "clicked" 0.0; + //~ target: "button_image"; + //~ } + //~ program { + //~ name: "button_unclick"; + //~ signal: "mouse,up,1"; + //~ source: "button_image"; + //~ action: STATE_SET "default" 0.0; + //~ target: "button_image"; + //~ after: "button_unclick2"; + //~ } + //~ program { + //~ name: "button_unclick2"; + //~ action: SIGNAL_EMIT "elm,action,click" ""; + //~ } + //~ program { name: "text_show"; + //~ signal: "elm,state,text,visible"; + //~ source: "elm"; + //~ script { + //~ new st[31]; + //~ new Float:vl; + //~ get_state(PART:"elm.swallow.content", st, 30, vl); + //~ if (!strcmp(st, "icononly")) + //~ set_state(PART:"elm.swallow.content", "visible", 0.0); + //~ set_state(PART:"elm.text", "visible", 0.0); + //~ } + //~ } + //~ program { name: "text_hide"; + //~ signal: "elm,state,text,hidden"; + //~ source: "elm"; + //~ script { + //~ new st[31]; + //~ new Float:vl; + //~ get_state(PART:"elm.swallow.content", st, 30, vl); + //~ if (!strcmp(st, "visible")) + //~ set_state(PART:"elm.swallow.content", "icononly", 0.0); + //~ set_state(PART:"elm.text", "default", 0.0); + //~ } + //~ } + //~ program { name: "icon_show"; + //~ signal: "elm,state,icon,visible"; + //~ source: "elm"; + //~ script { + //~ new st[31]; + //~ new Float:vl; + //~ get_state(PART:"elm.text", st, 30, vl); + //~ if (!strcmp(st, "visible")) + //~ set_state(PART:"elm.swallow.content", "visible", 0.0); + //~ else + //~ set_state(PART:"elm.swallow.content", "icononly", 0.0); + //~ } + //~ } + //~ program { name: "icon_hide"; + //~ signal: "elm,state,icon,hidden"; + //~ source: "elm"; + //~ action: STATE_SET "default" 0.0; + //~ target: "elm.swallow.content"; + //~ } + //~ } + //~ } group { name: "elm/button/base/hoversel_vertical"; images { image: "elm_frame.png" COMP; Modified: branches/edje_editor_elm/src/bin/Makefile.am =================================================================== --- branches/edje_editor_elm/src/bin/Makefile.am 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/Makefile.am 2009-08-06 23:48:31 UTC (rev 41628) @@ -29,6 +29,10 @@ edje_editor_position.h \ edje_editor_state.c \ edje_editor_state.h \ +edje_editor_text.c \ +edje_editor_text.h \ +edje_editor_fonts.c \ +edje_editor_fonts.h \ main.c \ main.h Modified: branches/edje_editor_elm/src/bin/edje_editor_dialogs.c =================================================================== --- branches/edje_editor_elm/src/bin/edje_editor_dialogs.c 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/edje_editor_dialogs.c 2009-08-06 23:48:31 UTC (rev 41628) @@ -85,19 +85,13 @@ //~ etk_iconbox_icon_select(icon); //~ //~ break; - //~ case FILECHOOSER_FONT: - //~ snprintf(cmd, 4096, "%s/%s", - //~ etk_filechooser_widget_current_folder_get(ETK_FILECHOOSER_WIDGET(UI_FileChooser)), - //~ etk_filechooser_widget_selected_file_get(ETK_FILECHOOSER_WIDGET(UI_FileChooser))); - //~ if (!edje_edit_font_add(edje_o, cmd)) - //~ { - //~ dialog_alert_show("ERROR: Can't import font file."); - //~ break; - //~ } - //~ text_font_combo_populate(); - //~ etk_combobox_active_item_set(ETK_COMBOBOX(UI_FontComboBox), - //~ etk_combobox_last_item_get(ETK_COMBOBOX(UI_FontComboBox))); - //~ break; + case FILECHOOSER_FONT: + if (!ecore_str_has_suffix(selected, ".ttf") || + (!edje_edit_font_add(ui.edje_o, selected))) + dialog_alert_show("ERROR: Can't import font file."); + evas_object_del(data); + fonts_browser_show(ui.win); + break; } } Added: branches/edje_editor_elm/src/bin/edje_editor_fonts.c Added: branches/edje_editor_elm/src/bin/edje_editor_fonts.h Modified: branches/edje_editor_elm/src/bin/edje_editor_group.c =================================================================== --- branches/edje_editor_elm/src/bin/edje_editor_group.c 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/edje_editor_group.c 2009-08-06 23:48:31 UTC (rev 41628) @@ -100,10 +100,10 @@ tb = elm_table_add(parent); evas_object_show(tb); - NEW_ENTRY_TO_TABLE("name:", 0, 0, _name_entry, EINA_TRUE) - NEW_ENTRY_TO_TABLE("min:", 0, 1, _min_entry, EINA_TRUE) - NEW_ENTRY_TO_TABLE("max:", 0, 2, _max_entry, EINA_TRUE) - NEW_ENTRY_TO_TABLE("current:", 0, 3, _current_entry, EINA_FALSE) + NEW_ENTRY_TO_TABLE("name:", 0, 0, 1, _name_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("min:", 0, 1, 1, _min_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("max:", 0, 2, 1, _max_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("current:", 0, 3, 1, _current_entry, EINA_FALSE) return tb; } Modified: branches/edje_editor_elm/src/bin/edje_editor_part.c =================================================================== --- branches/edje_editor_elm/src/bin/edje_editor_part.c 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/edje_editor_part.c 2009-08-06 23:48:31 UTC (rev 41628) @@ -131,7 +131,7 @@ tb = elm_table_add(parent); evas_object_show(tb); - NEW_ENTRY_TO_TABLE("name:", 0, 0, _name_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("name:", 0, 0, 1, _name_entry, EINA_TRUE) NEW_COMBO_TO_TABLE(_clipto_combo, "clip to:", 0, 1, 1, part_populate_combo_with_parts, _clipto_combo_sel) NEW_COMBO_TO_TABLE( _events_combo, "events:", 0, 2, 1, NULL, NULL) Modified: branches/edje_editor_elm/src/bin/edje_editor_state.c =================================================================== --- branches/edje_editor_elm/src/bin/edje_editor_state.c 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/edje_editor_state.c 2009-08-06 23:48:31 UTC (rev 41628) @@ -183,12 +183,12 @@ Evas_Object* state_frame_create(Evas_Object *parent) { - Evas_Object *tb, *_o, *p; + Evas_Object *tb, *_o; tb = elm_table_add(parent); evas_object_show(tb); - NEW_ENTRY_TO_TABLE("name:", 0, 0, _name_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("name:", 0, 0, 2, _name_entry, EINA_TRUE) NEW_DOUBLE_ENTRY_TO_TABLE("aspect:", 0, 1, _aspect_min_entry, _aspect_max_entry, EINA_TRUE) NEW_COMBO_TO_TABLE(_aspect_combo,"preference:", 0, 2, 2, NULL, NULL); elm_hoversel_item_add(_aspect_combo, "None", NULL, ELM_ICON_NONE, @@ -200,37 +200,26 @@ elm_hoversel_item_add(_aspect_combo, "Both", NULL, ELM_ICON_NONE, _aspect_combo_sel, (void*)EDJE_ASPECT_PREFER_BOTH); - NEW_ENTRY_TO_TABLE("min:", 0, 3, _size_min_entry, EINA_TRUE) - NEW_ENTRY_TO_TABLE("max:", 0, 4, _size_max_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("min:", 0, 3, 2, _size_min_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("max:", 0, 4, 2, _size_max_entry, EINA_TRUE) NEW_DOUBLE_ENTRY_TO_TABLE("align:", 0, 5, _align_x_entry, _align_y_entry, EINA_TRUE) //// NEW_TOGGLE_TO_TABLE // TODO _o = elm_label_add(parent); elm_label_label_set(_o, "visible: "); - evas_object_size_hint_weight_set(_o, 0.0, 0.0); evas_object_size_hint_align_set(_o, 1.0, 0.0); elm_table_pack(tb, _o, 0, 6, 1, 1); evas_object_show(_o); - - p = elm_frame_add(parent); - elm_frame_style_set(p, "pad_small"); - evas_object_size_hint_weight_set(p, 1.0, 1.0); - evas_object_size_hint_align_set(p, 0.0, 0.0); - elm_table_pack(tb, p, 1, 6, 2, 1); - evas_object_show(p); _o = elm_toggle_add(parent); elm_toggle_states_labels_set(_o, "visible", "hidden"); - - evas_object_size_hint_weight_set(_o, 1.0, 0.0); - evas_object_size_hint_align_set(_o, 0.0, 0.0); - elm_frame_content_set(p, _o); + elm_table_pack(tb, _o, 1, 6, 2, 1); _visible_toggle = _o; evas_object_show(_o); evas_object_smart_callback_add(_o, "changed", _visible_toggle_changed, NULL); //// - NEW_ENTRY_TO_TABLE("color class:", 0, 7, _color_class_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("color class:", 0, 7, 2, _color_class_entry, EINA_TRUE) return tb; } @@ -299,8 +288,8 @@ edje_edit_state_align_y_get(ui.edje_o, cur.part, cur.state)); //Set visible checkbox - elm_toggle_state_set(_visible_toggle, - edje_edit_state_visible_get(ui.edje_o, cur.part, cur.state)); + //~ elm_toggle_state_set(_visible_toggle, + //~ edje_edit_state_visible_get(ui.edje_o, cur.part, cur.state)); //Set Color Class Entry cc = edje_edit_state_color_class_get(ui.edje_o, cur.part, cur.state); Modified: branches/edje_editor_elm/src/bin/edje_editor_text.c =================================================================== --- branches/edje_editor_elm/src/bin/edje_editor_text.c 2009-08-06 23:37:34 UTC (rev 41627) +++ branches/edje_editor_elm/src/bin/edje_editor_text.c 2009-08-06 23:48:31 UTC (rev 41628) @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2008 Davide Andreoli (see AUTHORS) +/* Copyright (C) 2006-2009 Davide Andreoli (see AUTHORS) * * This file is part of Edje_editor. * Edje_editor is free software: you can redistribute it and/or modify @@ -15,460 +15,305 @@ * along with Edje_editor. If not, see <http://www.gnu.org/licenses/>. */ -#include <string.h> -#include <Etk.h> -#include <Edje.h> -#include <Edje_Edit.h> #include "main.h" +static Evas_Object *_text_entry; +static Evas_Object *_font_entry; +static Evas_Object *_size_entry; +static Evas_Object *_alignx_entry; +static Evas_Object *_aligny_entry; +static Evas_Object *_fit_combo; +static Evas_Object *_effect_combo; +static Evas_Object *_color_entry; +static Evas_Object *_color2_entry; +static Evas_Object *_color3_entry; +static Evas_Object *_elipsis_entry; -/*** Implementation ***/ -Etk_Widget* -text_frame_create(Evas *evas) +/*** Callbacks ***/ +static void +_entry_apply(Evas_Object *o) { - Etk_Widget *vbox; - Etk_Widget *hbox; - Etk_Widget *label; - Etk_Widget *table; - Etk_Combobox_Item *ComboItem; + char *txt; + int i, r, g, b, a; + double f; - //vbox - vbox = etk_vbox_new(ETK_FALSE, 5); + /* TODO FIX THIS IN ELM */ + /* I get a <br> at the end of the line */ + /* Need to fix elm for this, probably a single_line entry must take care of this*/ + const char *to_fix; + to_fix = elm_entry_entry_get(o); + txt = strdup(to_fix); + if (ecore_str_has_suffix(txt, "<br>")) + txt[strlen(txt) - 4] = '\0'; + printf("Apply entry [%s]\n", txt); - //table - table = etk_table_new(5, 5, ETK_TABLE_NOT_HOMOGENEOUS); - etk_box_append(ETK_BOX(vbox), table, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - label = etk_label_new("Text"); - etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL); - etk_table_attach_default(ETK_TABLE(table),label, 0, 0, 0,0); - - //Text Entry - UI_TextEntry = etk_entry_new (); - //etk_widget_size_request_set(UI_TextEntry,30, 30); - etk_table_attach_default(ETK_TABLE(table),UI_TextEntry, 1, 4, 0,0); - - label = etk_label_new("Font"); - etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL); - etk_table_attach_default(ETK_TABLE(table),label, 0, 0, 1,1); - - //FontComboBox - UI_FontComboBox = etk_combobox_new(); - etk_combobox_column_add(ETK_COMBOBOX(UI_FontComboBox), - ETK_COMBOBOX_IMAGE, 20, ETK_COMBOBOX_NONE, 0.0); - etk_combobox_column_add(ETK_COMBOBOX(UI_FontComboBox), - ETK_COMBOBOX_LABEL, 75, ETK_COMBOBOX_NONE, 0.0); - etk_combobox_build(ETK_COMBOBOX(UI_FontComboBox)); - etk_table_attach_default(ETK_TABLE(table),UI_FontComboBox, 1, 1, 1, 1); - - //FontAddButton - UI_FontAddButton = etk_button_new_from_stock(ETK_STOCK_DOCUMENT_OPEN); - etk_object_properties_set(ETK_OBJECT(UI_FontAddButton), "label","",NULL); - etk_table_attach_default(ETK_TABLE(table),UI_FontAddButton, 2, 2, 1, 1); - - - label = etk_label_new("Size"); - etk_object_properties_set(ETK_OBJECT(label), "xalign",0.5,NULL); - etk_table_attach_default(ETK_TABLE(table),label, 3, 3, 1,1); - - //FontSizeSpinner - UI_FontSizeSpinner = etk_spinner_new(0, 200, 0, 1, 10); - etk_widget_size_request_set(UI_FontSizeSpinner, 45, 20); - etk_table_attach_default(ETK_TABLE(table),UI_FontSizeSpinner, 4, 4, 1,1); - - hbox = etk_hbox_new(ETK_FALSE, 0); - etk_table_attach_default(ETK_TABLE(table),hbox, 0, 5, 2,2); - - //FontAlignHSpinner - label = etk_label_new("Align"); - etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - UI_FontAlignHSpinner = etk_spinner_new(0, 1, 0, 0.01, 0.1); - etk_spinner_digits_set(ETK_SPINNER(UI_FontAlignHSpinner), 2); - etk_widget_size_request_set(UI_FontAlignHSpinner, 45, 20); - etk_box_append(ETK_BOX(hbox), UI_FontAlignHSpinner, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //FontAlignVSpinner - label = etk_label_new("Valign"); - etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - UI_FontAlignVSpinner = etk_spinner_new (0, 1, 0, 0.01, 0.1); - etk_spinner_digits_set(ETK_SPINNER(UI_FontAlignVSpinner), 2); - etk_widget_size_request_set(UI_FontAlignVSpinner, 45, 20); - etk_box_append(ETK_BOX(hbox), UI_FontAlignVSpinner, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //FontElipsis - label = etk_label_new("Elipsis"); - etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - UI_FontElipsisSpinner = etk_spinner_new (0, 1, 0, 0.1, 0.4); - etk_spinner_digits_set(ETK_SPINNER(UI_FontElipsisSpinner), 1); - etk_widget_size_request_set(UI_FontElipsisSpinner, 45, 20); - etk_box_append(ETK_BOX(hbox), UI_FontElipsisSpinner, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //Fit + min max - hbox = etk_hbox_new(ETK_FALSE, 0); - etk_table_attach_default(ETK_TABLE(table),hbox, 0, 5, 3,3); - - UI_FontFitXCheck = etk_check_button_new_with_label("Fit X"); - etk_box_append(ETK_BOX(hbox), UI_FontFitXCheck, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - UI_FontFitYCheck = etk_check_button_new_with_label("Fit Y"); - etk_box_append(ETK_BOX(hbox), UI_FontFitYCheck, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //~ label = etk_check_button_new_with_label("Min X"); - //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + if (!txt || !cur.part || !cur.state) return; - //~ label = etk_check_button_new_with_label("Min Y"); - //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //~ label = etk_check_button_new_with_label("Max X"); - //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //~ label = etk_check_button_new_with_label("Max Y"); - //~ etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //PartEffectComboBox - label = etk_label_new("Effect"); - etk_table_attach_default(ETK_TABLE(table),label, 0, 0, 4, 4); - - UI_EffectComboBox = etk_combobox_new(); - etk_combobox_column_add(ETK_COMBOBOX(UI_EffectComboBox), - ETK_COMBOBOX_IMAGE, 24, ETK_COMBOBOX_NONE, 0.0); - etk_combobox_column_add(ETK_COMBOBOX(UI_EffectComboBox), - ETK_COMBOBOX_LABEL, 75, ETK_COMBOBOX_NONE, 0.0); - etk_combobox_build(ETK_COMBOBOX(UI_EffectComboBox)); - - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Plain"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_PLAIN); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Outline"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_OUTLINE); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Soft Outline"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_SOFT_OUTLINE); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Soft Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_SOFT_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Outline Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_OUTLINE_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Outline Soft Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Far Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_FAR_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Far Soft Shadow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW); - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_EffectComboBox), - etk_image_new_from_edje(EdjeFile,"NONE.PNG"), "Glow"); - etk_combobox_item_data_set(ComboItem, (void*)EDJE_TEXT_EFFECT_GLOW); - - etk_table_attach_default(ETK_TABLE(table), UI_EffectComboBox, 1, 4, 4, 4); - - //hbox - hbox = etk_hbox_new(ETK_FALSE, 0); - etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); - - //Color buttons - etk_box_append(ETK_BOX(hbox), - window_color_button_create("Text", - COLOR_OBJECT_TEXT, 30, 30, evas), - ETK_BOX_START, ETK_BOX_EXPAND, 0); - etk_box_append(ETK_BOX(hbox), - window_color_button_create("Shadow", - COLOR_OBJECT_SHADOW, 30, 30, evas), - ETK_BOX_START, ETK_BOX_EXPAND, 0); - etk_box_append(ETK_BOX(hbox), - window_color_button_create("Outline", - COLOR_OBJECT_OUTLINE, 30, 30, evas), - ETK_BOX_START, ETK_BOX_EXPAND, 0); - - etk_signal_connect("clicked", ETK_OBJECT(UI_FontAddButton), - ETK_CALLBACK(_window_all_button_click_cb), - (void*)TOOLBAR_FONT_FILE_ADD); - etk_signal_connect("item-activated", ETK_OBJECT(UI_FontComboBox), - ETK_CALLBACK(_text_FontComboBox_item_activated_cb), NULL); - etk_signal_connect("active-item-changed", ETK_OBJECT(UI_EffectComboBox), - ETK_CALLBACK(_text_EffectComboBox_changed_cb), NULL); - etk_signal_connect("value-changed", ETK_OBJECT(UI_FontSizeSpinner), - ETK_CALLBACK(_text_FontSizeSpinner_value_changed_cb), NULL); - etk_signal_connect("text-changed", ETK_OBJECT(UI_TextEntry), - ETK_CALLBACK(_text_Entry_text_changed_cb), NULL); - etk_signal_connect("value-changed", ETK_OBJECT(UI_FontAlignVSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), - (void*)TEXT_ALIGNV_SPINNER); - etk_signal_connect("value-changed", ETK_OBJECT(UI_FontAlignHSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), - (void*)TEXT_ALIGNH_SPINNER); - etk_signal_connect("value-changed", ETK_OBJECT(UI_FontElipsisSpinner), - ETK_CALLBACK(_text_FontElipsisSpinner_value_changed_cb), - NULL); - etk_signal_connect("toggled", ETK_OBJECT(UI_FontFitXCheck), - ETK_CALLBACK(_text_FitXCheck_toggled_cb), NULL); - etk_signal_connect("toggled", ETK_OBJECT(UI_FontFitYCheck), - ETK_CALLBACK(_text_FitYCheck_toggled_cb), NULL); - - return vbox; + /* Apply Text */ + if (o == _text_entry) + { + if (ecore_str_equal(txt, "unset")) + edje_edit_state_text_set(ui.edje_o, cur.part, cur.state, ""); + else + edje_edit_state_text_set(ui.edje_o, cur.part, cur.state, txt); + } + /* Apply Font */ + else if (o == _font_entry) + edje_edit_state_font_set(ui.edje_o, cur.part, cur.state, txt); + /* Apply Font Size */ + else if (o == _size_entry) + { + if (sscanf(txt, "%d", &i) != 1) + dialog_alert_show(MSG_INT); + else + edje_edit_state_text_size_set(ui.edje_o, cur.part, cur.state, i); + } + /* Apply AlignX */ + else if (o == _alignx_entry) + { + if (sscanf(txt, "%lf", &f) != 1) + dialog_alert_show(MSG_FLOAT); + else + edje_edit_state_text_align_x_set(ui.edje_o, cur.part, cur.state, f); + } + /* Apply AlignY */ + else if (o == _aligny_entry) + { + if (sscanf(txt, "%lf", &f) != 1) + dialog_alert_show(MSG_FLOAT); + else + edje_edit_state_text_align_y_set(ui.edje_o, cur.part, cur.state, f); + } + /* Apply Colors*/ + else if (o == _color_entry) + { + if (sscanf(txt, "%d %d %d %d", &r, &g, &b, &a) != 4) + dialog_alert_show(MSG_COLOR); + else + edje_edit_state_color_set(ui.edje_o, cur.part, cur.state, r, g, b, a); + } + else if (o == _color2_entry) + { + if (sscanf(txt, "%d %d %d %d", &r, &g, &b, &a) != 4) + dialog_alert_show(MSG_COLOR); + else + edje_edit_state_color2_set(ui.edje_o, cur.part, cur.state, r, g, b, a); + } + else if (o == _color3_entry) + { + if (sscanf(txt, "%d %d %d %d", &r, &g, &b, &a) != 4) + dialog_alert_show(MSG_COLOR); + else + edje_edit_state_color3_set(ui.edje_o, cur.part, cur.state, r, g, b, a); + } + /* Apply Elipsis*/ + else if (o == _elipsis_entry) + { + if (sscanf(txt, "%lf", &f) != 1) + dialog_alert_show(MSG_FLOAT); + else + edje_edit_state_text_elipsis_set(ui.edje_o, cur.part, cur.state, f); + } + canvas_redraw(); + text_frame_update(); } -void -text_font_combo_populate(void) +static void +_entry_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { - Eina_List *l; - Etk_Combobox_Item *ComboItem; - - //Stop signal propagation - etk_signal_disconnect("item-activated", ETK_OBJECT(UI_FontComboBox), - ETK_CALLBACK(_text_FontComboBox_item_activated_cb), NULL); - - printf("Populate Fonts Combo\n"); - - etk_combobox_clear(ETK_COMBOBOX(UI_FontComboBox)); - - Eina_List *fonts; - fonts = l = edje_edit_fonts_list_get(edje_o); - while (l) + Evas_Event_Key_Down *ev = event_info; + + //~ printf("KEY DOWN %s\n", ev->key); + if (ecore_str_equal(ev->key, "Return")) { - ComboItem = etk_combobox_item_append(ETK_COMBOBOX(UI_FontComboBox), - etk_image_new_from_stock(ETK_STOCK_PREFERENCES_DESKTOP_FONT,ETK_STOCK_SMALL), - l->data); - l = l->next; + _entry_apply(obj); } - edje_edit_string_list_free(fonts); - - //Renable signal propagation - etk_signal_connect("item-activated", ETK_OBJECT(UI_FontComboBox), - ETK_CALLBACK(_text_FontComboBox_item_activated_cb), NULL); - + else if(ecore_str_equal(ev->key, "Escape")) + { + text_frame_update(); + } } -void -text_frame_update(void) +static void +_fit_combo_sel(void *data, Evas_Object *obj, void *event_info) { - int eff_num = 0; - //int alpha; - int r, g, b; - Etk_Combobox_Item *item = NULL; - char *combo_data; - const char *t; - const char *font; - - if (!etk_string_length_get(Cur.state)) return; - if (!etk_string_length_get(Cur.part)) return; - - printf("Update Text Frame: %s\n",Cur.state->string); - - //Stop signal propagation - etk_signal_block("text-changed", ETK_OBJECT(UI_TextEntry), - _text_Entry_text_changed_cb, NULL); - etk_signal_block("item-activated", ETK_OBJECT(UI_FontComboBox), - ETK_CALLBACK(_text_FontComboBox_item_activated_cb), NULL); - etk_signal_block("value-changed", ETK_OBJECT(UI_FontAlignHSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), NULL); - etk_signal_block("value-changed", ETK_OBJECT(UI_FontAlignVSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), NULL); - etk_signal_block("toggled", ETK_OBJECT(UI_FontFitXCheck), - ETK_CALLBACK(_text_FitXCheck_toggled_cb), NULL); - etk_signal_block("toggled", ETK_OBJECT(UI_FontFitYCheck), - ETK_CALLBACK(_text_FitYCheck_toggled_cb), NULL); - etk_signal_block("value-changed", ETK_OBJECT(UI_FontElipsisSpinner), - ETK_CALLBACK(_text_FontElipsisSpinner_value_changed_cb), - NULL); - - //Set Text Text in Cur.eps - t = edje_edit_state_text_get(edje_o,Cur.part->string,Cur.state->string); - printf("TEXT: %s\n",t); - etk_entry_text_set(ETK_ENTRY(UI_TextEntry), t); - edje_edit_string_free(t); - - //Set the font size spinner - etk_range_value_set(ETK_RANGE(UI_FontSizeSpinner), - (float)edje_edit_state_text_size_get(edje_o, Cur.part->string, Cur.state->string)); - - //Set the font align spinners - etk_range_value_set(ETK_RANGE(UI_FontAlignHSpinner), - edje_edit_state_text_align_x_get(edje_o, - Cur.part->string, - Cur.state->string)); - etk_range_value_set(ETK_RANGE(UI_FontAlignVSpinner), - edje_edit_state_text_align_y_get(edje_o, - Cur.part->string, - Cur.state->string)); - - //Set Elipsis - etk_range_value_set(ETK_RANGE(UI_FontElipsisSpinner), - edje_edit_state_text_elipsis_get(edje_o, - Cur.part->string, - Cur.state->string)); - - //Set the font combobox - font = edje_edit_state_font_get(edje_o, Cur.part->string, Cur.state->string); - if (font) + switch ((int)(long)data) { - //Loop for all the item in the Combobox - item = etk_combobox_first_item_get(ETK_COMBOBOX(UI_FontComboBox)); - while (item) - { - combo_data = etk_combobox_item_field_get(item, 1); - printf("COMBODATA: %s\n",combo_data); - if (combo_data && (strcmp(combo_data, font) == 0)) - { - //If we found the item set active and break - etk_combobox_active_item_set(ETK_COMBOBOX(UI_FontComboBox),item); - break; - } - item = etk_combobox_item_next_get(item); - } + case FIT_X: + edje_edit_state_text_fit_x_set(ui.edje_o, cur.part, cur.state, 1); + edje_edit_state_text_fit_y_set(ui.edje_o, cur.part, cur.state, 0); + break; + case FIT_Y: + edje_edit_state_text_fit_x_set(ui.edje_o, cur.part, cur.state, 0); + edje_edit_state_text_fit_y_set(ui.edje_o, cur.part, cur.state, 1); + break; + case FIT_BOTH: + edje_edit_state_text_fit_x_set(ui.edje_o, cur.part, cur.state, 1); + edje_edit_state_text_fit_y_set(ui.edje_o, cur.part, cur.state, 1); + break; + case FIT_NONE: default: + edje_edit_state_text_fit_x_set(ui.edje_o, cur.part, cur.state, 0); + edje_edit_state_text_fit_y_set(ui.edje_o, cur.part, cur.state, 0); + break; } - else - etk_combobox_active_item_set(ETK_COMBOBOX(UI_FontComboBox), - etk_combobox_first_item_get(ETK_COMBOBOX(UI_FontComboBox)));//TODO change all combobox like this one + canvas_redraw(); + text_frame_update(); +} - edje_edit_string_free(font); +static void +_effect_combo_sel(void *data, Evas_Object *obj, void *event_info) +{ + if (!cur.part) return; + edje_edit_part_effect_set(ui.edje_o, cur.part,(int)(long)data); + canvas_redraw(); + text_frame_update(); +} - //Set Effect ComboBox - eff_num = edje_edit_part_effect_get(edje_o, Cur.part->string); - eff_num--; - if (eff_num < 0) eff_num = 0; - - etk_combobox_active_item_set(ETK_COMBOBOX(UI_EffectComboBox), - etk_combobox_nth_item_get(ETK_COMBOBOX(UI_EffectComboBox), eff_num)); - - //Set Fit XY Checkbutton - etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_FontFitXCheck), - edje_edit_state_text_fit_x_get(edje_o, Cur.part->string, Cur.state->string)); - etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_FontFitYCheck), - edje_edit_state_text_fit_y_get(edje_o, Cur.part->string, Cur.state->string)); - - //Set Text color Rects - edje_edit_state_color_get(edje_o, Cur.part->string, Cur.state->string,&r,&g,&b,NULL); - evas_object_color_set(TextColorObject, r, g, b, 255); - edje_edit_state_color2_get(edje_o, Cur.part->string, Cur.state->string,&r,&g,&b,NULL); - evas_object_color_set(ShadowColorObject, r, g, b, 255); - edje_edit_state_color3_get(edje_o, Cur.part->string, Cur.state->string,&r,&g,&b,NULL); - evas_object_color_set(OutlineColorObject, r, g, b, 255); - - //Renable signal propagation - etk_signal_unblock("text-changed", ETK_OBJECT(UI_TextEntry), - ETK_CALLBACK(_text_Entry_text_changed_cb), NULL); - etk_signal_unblock("item-activated", ETK_OBJECT(UI_FontComboBox), - ETK_CALLBACK(_text_FontComboBox_item_activated_cb), NULL); - etk_signal_unblock("value-changed", ETK_OBJECT(UI_FontAlignHSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), NULL); - etk_signal_unblock("value-changed", ETK_OBJECT(UI_FontAlignVSpinner), - ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), NULL); - etk_signal_unblock("toggled", ETK_OBJECT(UI_FontFitXCheck), - ETK_CALLBACK(_text_FitXCheck_toggled_cb), NULL); - etk_signal_unblock("toggled", ETK_OBJECT(UI_FontFitYCheck), - ETK_CALLBACK(_text_FitYCheck_toggled_cb), NULL); - etk_signal_unblock("value-changed", ETK_OBJECT(UI_FontElipsisSpinner), - ETK_CALLBACK(_text_FontElipsisSpinner_value_changed_cb), - NULL); +static void +_fonts_button_clicked(void *data, Evas_Object *obj, void *event_info) +{ + fonts_browser_show(ui.win); } - -/*** Callbacks ***/ -Etk_Bool -_text_FontComboBox_item_activated_cb(Etk_Combobox *combobox, Etk_Combobox_Item *item, void *data) +/*** Implementation ***/ +Evas_Object* +text_frame_create(Evas_Object *parent) { - printf("Changed Signal on FontComboBox EMITTED \n"); + Evas_Object *tb, *bt, *_o; - char *font; - if (!etk_string_length_get(Cur.part)) return ETK_TRUE; - if (!etk_string_length_get(Cur.state)) return ETK_TRUE; + tb = elm_table_add(parent); + evas_object_show(tb); - font = etk_combobox_item_field_get(item, 1); + NEW_ENTRY_TO_TABLE("font:", 0, 0, 1, _font_entry, EINA_TRUE) - edje_edit_state_font_set(edje_o, Cur.part->string, Cur.state->string, font); + bt = elm_button_add(parent); + elm_button_label_set(bt, "browse"); + evas_object_size_hint_align_set(bt, 1.0, 0.5); + elm_table_pack(tb, bt, 2, 0, 1, 1); + evas_object_smart_callback_add(bt, "clicked", _fonts_button_clicked, NULL); + evas_object_show(bt); + + NEW_ENTRY_TO_TABLE("size:", 0, 1, 2, _size_entry, EINA_TRUE) + NEW_DOUBLE_ENTRY_TO_TABLE("align:", 0, 2, _alignx_entry, _aligny_entry, EINA_TRUE) + NEW_COMBO_TO_TABLE( _fit_combo, "fit:", 0, 3, 2, NULL, NULL) + elm_hoversel_item_add(_fit_combo, "none", NULL, ELM_ICON_NONE, + _fit_combo_sel, (void*)FIT_NONE); + elm_hoversel_item_add(_fit_combo, "horizontal", NULL, ELM_ICON_NONE, + _fit_combo_sel, (void*)FIT_X); + elm_hoversel_item_add(_fit_combo, "vertical", NULL, ELM_ICON_NONE, + _fit_combo_sel, (void*)FIT_Y); + elm_hoversel_item_add(_fit_combo, "both", NULL, ELM_ICON_NONE, + _fit_combo_sel, (void*)FIT_BOTH); + + NEW_COMBO_TO_TABLE( _effect_combo, "effect:", 0, 4, 2, NULL, NULL) + elm_hoversel_item_add(_effect_combo, "plain", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_PLAIN); + elm_hoversel_item_add(_effect_combo, "outline", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_OUTLINE); + elm_hoversel_item_add(_effect_combo, "outline (soft)", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_SOFT_OUTLINE); + elm_hoversel_item_add(_effect_combo, "shadow", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_SHADOW); + elm_hoversel_item_add(_effect_combo, "shadow (soft)", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_SOFT_SHADOW); + elm_hoversel_item_add(_effect_combo, "outline + shadow", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_OUTLINE_SHADOW); + elm_hoversel_item_add(_effect_combo, "outline + shadow (soft)", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW); + elm_hoversel_item_add(_effect_combo, "far shadow", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_FAR_SHADOW); + elm_hoversel_item_add(_effect_combo, "far shadow (soft)", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW); + elm_hoversel_item_add(_effect_combo, "glow", NULL, ELM_ICON_NONE, + _effect_combo_sel, (void*)EDJE_TEXT_EFFECT_GLOW); - return ETK_TRUE; + NEW_ENTRY_TO_TABLE("elipsis:", 0, 5, 2, _elipsis_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("text:", 0, 6, 2, _text_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("text color:", 0, 7, 2, _color_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("shadow color:", 0, 8, 2, _color2_entry, EINA_TRUE) + NEW_ENTRY_TO_TABLE("outline color:", 0, 9, 2, _color3_entry, EINA_TRUE) + + return tb; } -Etk_Bool -_text_EffectComboBox_changed_cb(Etk_Combobox *combobox, void *data) +void +text_frame_update(void) { - if (!etk_string_length_get(Cur.part)) return ETK_TRUE; + int eff = 0; + int r, g, b, a; + const char *t; + Eina_Bool fx, fy; - edje_edit_part_effect_set(edje_o, Cur.part->string, - (int)(long)etk_combobox_item_data_get(etk_combobox_active_item_get(combobox))); + if (!cur.part || !cur.state) return; + + //Set font + t = edje_edit_state_font_get(ui.edje_o, cur.part, cur.state); + elm_entry_entry_set(_font_entry, t); + edje_edit_string_free(t); - canvas_redraw(); + //Set font size + elm_entry_printf(_size_entry, "%d",... [truncated message content] |