From 6f183d62c2eb57b0f257bb6910ce17d782b2273b Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Fri, 13 Dec 2019 13:27:06 +0100 Subject: [PATCH] Adapt to latest changes Including removal of the manual inclusion of text headers! --- apps/c/calculator/src/calculator.c | 15 ++++++--------- apps/c/texteditor/src/texteditor_main.c | 3 --- apps/csharp/calculator/src/calculator.cs | 20 +++++++++++--------- reference/c/ui/src/focus_main.c | 3 --- reference/c/ui/src/ui_container.c | 2 -- tutorial/c/hello-gui/src/gui_main.c | 3 --- 6 files changed, 17 insertions(+), 29 deletions(-) diff --git a/apps/c/calculator/src/calculator.c b/apps/c/calculator/src/calculator.c index 6bc55944..b6bc49e6 100644 --- a/apps/c/calculator/src/calculator.c +++ b/apps/c/calculator/src/calculator.c @@ -2,11 +2,8 @@ #include #include -// Temporary workaround until Unified Text stops using Legacy classes internally -#include -#include -static Efl_Ui_Text *_screen = NULL; // Text widget showing current value +static Efl_Ui_Textbox *_screen = NULL; // Text widget showing current value static int _prev_value = 0; // Value introduced before an operation (first operand static int _curr_value = 0; // Value currently being introduced (second operand) static char _operation = '='; // Last operation button pressed @@ -138,8 +135,8 @@ _button_add(Efl_Ui_Table *table, const char *text, const char *command, int posx // Buttons can only have simple text (no font, styles or markup) but can swallow // any other object we want. // Therefore we create a more complex Efl_Ui_Text object and use it as content for the button. - Efl_Ui_Text *label = - efl_add(EFL_UI_TEXT_CLASS, button, + Efl_Ui_Textbox *label = + efl_add(EFL_UI_TEXTBOX_CLASS, button, efl_text_interactive_editable_set(efl_added, EINA_FALSE), efl_text_horizontal_align_set(efl_added, 0.5), efl_text_vertical_align_set(efl_added, 0.5), @@ -189,8 +186,8 @@ _gui_setup() _button_add(table, "=", "=", 2, 4, 128, 128, 128); _button_add(table, "C", "C", 0, 4, 0, 0, 0); - // Create a big Efl.Ui.Text screen to display the current input - _screen = efl_add(EFL_UI_TEXT_CLASS, table, + // Create a big Efl.Ui.Textbox screen to display the current input + _screen = efl_add(EFL_UI_TEXTBOX_CLASS, table, efl_text_set(efl_added, "0"), efl_text_multiline_set(efl_added, EINA_FALSE), efl_text_interactive_editable_set(efl_added, EINA_FALSE), @@ -200,7 +197,7 @@ _gui_setup() efl_text_vertical_align_set(efl_added, 0.5), efl_text_effect_type_set(efl_added, EFL_TEXT_STYLE_EFFECT_TYPE_GLOW), efl_text_glow_color_set(efl_added, 128, 128, 128, 128), - efl_event_callback_add(efl_added, EFL_UI_TEXT_EVENT_CHANGED, + efl_event_callback_add(efl_added, EFL_UI_TEXTBOX_EVENT_CHANGED, _screen_changed_cb, NULL)); efl_text_font_family_set(_screen, "Sans"); efl_text_font_size_set(_screen, 48); diff --git a/apps/c/texteditor/src/texteditor_main.c b/apps/c/texteditor/src/texteditor_main.c index 20fbd5f1..751fb8f6 100644 --- a/apps/c/texteditor/src/texteditor_main.c +++ b/apps/c/texteditor/src/texteditor_main.c @@ -2,9 +2,6 @@ #include #include -// Temporary workaround until Unified Text stops using Legacy classes internally -#include -#include Efl_Ui_Textbox *_editor; Efl_Ui_Button *_toolbar_new; diff --git a/apps/csharp/calculator/src/calculator.cs b/apps/csharp/calculator/src/calculator.cs index e4711c00..a9fa0463 100644 --- a/apps/csharp/calculator/src/calculator.cs +++ b/apps/csharp/calculator/src/calculator.cs @@ -4,7 +4,7 @@ using System; public class Calculator : Efl.Csharp.Application { - private Efl.Ui.Text screen; // Text widget showing current value + private Efl.Ui.Textbox screen; // Text widget showing current value private int prevValue = 0; // Value introduced before an operation (first operand) private int currValue = 0; // Value currently being introduced (second operand) private char operation = '='; // Last operation button pressed @@ -123,13 +123,14 @@ public class Calculator : Efl.Csharp.Application // Buttons can only have simple text (no font, styles or markup) but can swallow // any other object we want. // Therefore we create a more complex Efl.Ui.Text object and use it as content for the button. - var label = new Efl.Ui.Text(table); + var label = new Efl.Ui.Textbox(table); label.Editable = false; - label.Halign = 0.5; - label.Valign = 0.5; + label.HorizontalAlign = 0.5; + label.VerticalAlign = 0.5; label.Color = (r, g, b, 255); label.SetText(text); - label.Font = ("Sans", (Efl.Font.Size)36); + label.FontFamily = "Sans"; + label.FontSize = 36; button.Content = label; } @@ -167,15 +168,16 @@ public class Calculator : Efl.Csharp.Application AddButton(table, "C", 'C', 0, 4, 0, 0, 0); // Create a big Efl.Ui.Text screen to display the current input - screen = new Efl.Ui.Text(table); + screen = new Efl.Ui.Textbox(table); screen.SetText("0"); - screen.Font = ("Sans", (Efl.Font.Size)48); + screen.FontFamily = "Sans"; + screen.FontSize = 48; screen.Multiline = false; screen.Editable = false; screen.SelectionAllowed = false; table.PackTable(screen, 0, 0, 4, 1); - screen.Halign = 0.9; - screen.Valign = 0.5; + screen.HorizontalAlign = 0.9; + screen.VerticalAlign = 0.5; screen.EffectType = Efl.TextStyleEffectType.Glow; screen.GlowColor = (128, 128, 128, 128); screen.ChangedEvent += ScreenChangedCb; diff --git a/reference/c/ui/src/focus_main.c b/reference/c/ui/src/focus_main.c index 8db43e19..50e83d03 100644 --- a/reference/c/ui/src/focus_main.c +++ b/reference/c/ui/src/focus_main.c @@ -2,9 +2,6 @@ #include #include -// Temporary workaround until Unified Text stops using Legacy classes internally -#include -#include static void _gui_about_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) diff --git a/reference/c/ui/src/ui_container.c b/reference/c/ui/src/ui_container.c index 1c32fdd9..dc7ca992 100644 --- a/reference/c/ui/src/ui_container.c +++ b/reference/c/ui/src/ui_container.c @@ -2,8 +2,6 @@ #include #include -// Temporary workaround until Unified Text stops using Legacy classes internally -#include /* * Efl.UI container examples. diff --git a/tutorial/c/hello-gui/src/gui_main.c b/tutorial/c/hello-gui/src/gui_main.c index fa9eeab2..cc3b3d34 100644 --- a/tutorial/c/hello-gui/src/gui_main.c +++ b/tutorial/c/hello-gui/src/gui_main.c @@ -2,9 +2,6 @@ #include #include -// Temporary workaround until Unified Text stops using Legacy classes internally -#include -#include static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)