mono-examples: adapt to latest bindings syntax

devs/lauromoura/cv
Xavi Artigas 3 years ago
parent 17609ba6bf
commit 5472a77fb3
  1. 2
      apps/csharp/life/src/life_board.cs
  2. 16
      apps/csharp/life/src/life_main.cs
  3. 24
      apps/csharp/texteditor/src/texteditor_main.cs
  4. 4
      reference/csharp/core/src/core_event.cs
  5. 8
      reference/csharp/core/src/core_idler.cs
  6. 8
      reference/csharp/core/src/core_poll.cs
  7. 4
      reference/csharp/snippets/Efl.Ui.Win.cs
  8. 12
      reference/csharp/ui/src/focus_main.cs
  9. 4
      reference/csharp/ui/src/ui_container.cs
  10. 4
      reference/csharp/ui/src/ui_custom_widget.cs
  11. 2
      reference/csharp/ui/src/ui_sizing.cs
  12. 6
      tutorial/csharp/hello-gui/src/gui_main.cs
  13. 4
      unsorted/elementary/efl_ui_slider_mono.cs
  14. 6
      unsorted/elementary/efl_ui_unit_converter.cs
  15. 2
      unsorted/evas/evas_mono_rectangle.cs
  16. 4
      unsorted/evas/evas_mono_text.cs

@ -62,7 +62,7 @@ public class LifeBoard
{
lifeTimer = new Efl.LoopTimer(win, 0.1);
lifeTimer.TimerTickEvt += (object sender, EventArgs ev) => {
lifeTimer.TimerTickEvent += (object sender, EventArgs ev) => {
Nextgen();
if (this.lifeRender != null)
this.lifeRender.Refresh(win);

@ -6,19 +6,19 @@ public class LifeWindow : Efl.Csharp.Application
private LifeRender lifeRender;
private Efl.Ui.Win win;
void ResizeEvt(object sender, EventArgs ev)
void ResizeEvent(object sender, EventArgs ev)
{
lifeRender.RenderLayout((Efl.Ui.Win)sender);
}
void QuitEvt(object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args ev)
void QuitEvent(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ev)
{
// quit the mainloop
if (ev.arg == false)
Efl.App.AppMain.Quit(0);
}
void TouchEvt(object sender, Efl.Input.IInterfacePointerDownEvt_Args ev)
void TouchEvent(object sender, Efl.Input.IInterfacePointerDownEventArgs ev)
{
int cellx, celly;
var position = ev.arg.GetPosition();
@ -29,7 +29,7 @@ public class LifeWindow : Efl.Csharp.Application
lifeRender.RenderCell(win, cellx, celly);
}
void KeyDownEvt(object sender, Efl.Input.IInterfaceKeyDownEvt_Args ev)
void KeyDownEvent(object sender, Efl.Input.IInterfaceKeyDownEventArgs ev)
{
if (ev.arg.GetKeySym() == "space")
lifeBoard.TogglePause(win);
@ -42,7 +42,7 @@ public class LifeWindow : Efl.Csharp.Application
win.SetAutohide(true);
// when the user clicks "close" on a window there is a request to hide
((Efl.Gfx.IEntity)win).VisibilityChangedEvt += QuitEvt;
((Efl.Gfx.IEntity)win).VisibilityChangedEvent += QuitEvent;
Eina.Size2D sz;
sz.W = (int)(10 * LifeBoard.Width * win.GetScale());
@ -52,9 +52,9 @@ public class LifeWindow : Efl.Csharp.Application
lifeRender = new LifeRender(win, lifeBoard);
lifeRender.Refresh(win);
((Efl.Gfx.IEntity)win).SizeChangedEvt += ResizeEvt;
((Efl.Input.IInterface)win).PointerDownEvt += TouchEvt;
((Efl.Input.IInterface)win).KeyDownEvt += KeyDownEvt;
((Efl.Gfx.IEntity)win).SizeChangedEvent += ResizeEvent;
((Efl.Input.IInterface)win).PointerDownEvent += TouchEvent;
((Efl.Input.IInterface)win).KeyDownEvent += KeyDownEvent;
win.SetSize(sz);

@ -32,7 +32,7 @@ public class TextEditor : Efl.Csharp.Application
"texteditor_example.txt");
// Quits the application
private void GUIQuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args ea)
private void GUIQuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ea)
{
if (ea.arg == false)
Efl.App.AppMain.Quit(0);
@ -63,8 +63,8 @@ public class TextEditor : Efl.Csharp.Application
popup.SetScrollableText(message);
popup.SetHintSizeMax(new Eina.Size2D(200, 200));
popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "OK", null);
popup.ButtonClickedEvt +=
(object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args ea) => {
popup.ButtonClickedEvent +=
(object sender, Efl.Ui.AlertPopupButtonClickedEventArgs ea) => {
// Dismiss popup when the button is clicked
((Efl.Ui.AlertPopup)sender).SetParent(null);
};
@ -72,11 +72,11 @@ public class TextEditor : Efl.Csharp.Application
// Adds a button to the toolbar, with the given text, icon and click event handler
private Efl.Ui.Button GUIToolbarButtonAdd(Efl.Ui.Box toolbar, string name,
string iconName, EventHandler<Efl.Input.IClickableClickedEvt_Args> func)
string iconName, EventHandler<Efl.Input.IClickableClickedEventArgs> func)
{
var button = new Efl.Ui.Button(toolbar);
button.SetText(name);
button.ClickedEvt += func;
button.ClickedEvent += func;
button.SetHintWeight(0, 1);
// Set the content of the button, which is an image
@ -102,7 +102,7 @@ public class TextEditor : Efl.Csharp.Application
// "New" button
toolbarButtonNew = GUIToolbarButtonAdd(bar, "New", "document-new",
(object sender, Efl.Input.IClickableClickedEvt_Args ea) => {
(object sender, Efl.Input.IClickableClickedEventArgs ea) => {
// When this button is clicked, remove content and refresh toolbar
editorTextBox.SetText("");
GUIToolbarRefresh();
@ -110,7 +110,7 @@ public class TextEditor : Efl.Csharp.Application
// "Save" button
toolbarButtonSave = GUIToolbarButtonAdd(bar, "Save", "document-save",
(object sender, Efl.Input.IClickableClickedEvt_Args ea) => {
(object sender, Efl.Input.IClickableClickedEventArgs ea) => {
// When this button is clicked, try to save content and refresh toolbar
try {
System.IO.File.WriteAllText(filename, editorTextBox.GetText());
@ -125,7 +125,7 @@ public class TextEditor : Efl.Csharp.Application
// "Load" button
toolbarButtonLoad = GUIToolbarButtonAdd(bar, "Load", "document-open",
(object sender, Efl.Input.IClickableClickedEvt_Args ea) => {
(object sender, Efl.Input.IClickableClickedEventArgs ea) => {
// When this button is clicked, try to load content and refresh toolbar
try {
editorTextBox.SetText(System.IO.File.ReadAllText(filename));
@ -147,7 +147,7 @@ public class TextEditor : Efl.Csharp.Application
bar.Pack(box);
// "Quit" button
GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.IClickableClickedEvt_Args e) => { Efl.Ui.Config.Exit(); } );
GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.IClickableClickedEventArgs e) => { Efl.Ui.Config.Exit(); } );
}
// Builds the user interface for the text editor
@ -157,7 +157,7 @@ public class TextEditor : Efl.Csharp.Application
win = new Efl.Ui.Win(parent: Efl.App.AppMain);
win.SetText("Text Editor");
win.SetAutohide(true);
win.VisibilityChangedEvt += GUIQuitCb;
win.VisibilityChangedEvent += GUIQuitCb;
// Create a vertical box container
Efl.Ui.Box box = new Efl.Ui.Box(win);
@ -173,8 +173,8 @@ public class TextEditor : Efl.Csharp.Application
editorTextBox.Editable = true;
editorTextBox.Scrollable = true;
editorTextBox.SetHintSizeMin(new Eina.Size2D(360, 240));
editorTextBox.ChangedEvt += EditorChangedCb;
editorTextBox.ChangedUserEvt += EditorChangedCb;
editorTextBox.ChangedEvent += EditorChangedCb;
editorTextBox.ChangedUserEvent += EditorChangedCb;
box.Pack(editorTextBox);
// Initial refresh of the toolbar buttons

@ -22,14 +22,14 @@ public class Example : Efl.Csharp.Application
mainloop.SetName("Mainloop");
// This event gets triggered continuously
mainloop.PollHighEvt += PollCb;
mainloop.PollHighEvent += PollCb;
// This timer will control events fired by the main loop
var timer = new Efl.LoopTimer(mainloop, 0.1);
timer.SetName("Timer");
// To count number of timer triggers
int tick_count = 0;
timer.TimerTickEvt += (object sender, EventArgs e) => {
timer.TimerTickEvent += (object sender, EventArgs e) => {
string message = "Tick {0} from {1}: ";
// Depending on the number of timer ticks, it does a different thing
switch (tick_count) {

@ -17,19 +17,19 @@ public class Example : Efl.Csharp.Application
var mainloop = Efl.App.AppMain;
// Register to all Idle events
mainloop.IdleEnterEvt += (object sender, EventArgs e) => {
mainloop.IdleEnterEvent += (object sender, EventArgs e) => {
Console.WriteLine("IDLE ENTER: Entering idle state.");
};
mainloop.IdleEvt += (object sender, EventArgs e) => {
mainloop.IdleEvent += (object sender, EventArgs e) => {
Console.WriteLine("IDLE: Executing idler callback while in idle state.");
};
mainloop.IdleExitEvt += (object sender, EventArgs e) => {
mainloop.IdleExitEvent += (object sender, EventArgs e) => {
Console.WriteLine("IDLE EXIT: Leaving idle state.");
};
// Use a timer to exit the application
var timer = new Efl.LoopTimer(mainloop, 0.02);
timer.TimerTickEvt += (object sender, EventArgs e) => {
timer.TimerTickEvent += (object sender, EventArgs e) => {
Console.WriteLine("TIMER: timer callback called, exiting.");
mainloop.Quit(0);
};

@ -16,19 +16,19 @@ public class Example : Efl.Csharp.Application
var mainloop = Efl.App.AppMain;
// Register to all Poll events
mainloop.PollLowEvt += (object sender, EventArgs e) => {
mainloop.PollLowEvent += (object sender, EventArgs e) => {
Console.Write("L");
};
mainloop.PollMediumEvt += (object sender, EventArgs e) => {
mainloop.PollMediumEvent += (object sender, EventArgs e) => {
Console.Write("M");
};
mainloop.PollHighEvt += (object sender, EventArgs e) => {
mainloop.PollHighEvent += (object sender, EventArgs e) => {
Console.Write(".");
};
// Use a timer to exit the application
var timer = new Efl.LoopTimer(mainloop, 30);
timer.TimerTickEvt += (object sender, EventArgs e) => {
timer.TimerTickEvent += (object sender, EventArgs e) => {
Console.WriteLine("\nTIMER: timer callback called, exiting.");
mainloop.Quit(0);
};

@ -1,6 +1,6 @@
var win = new Efl.Ui.Win(Efl.App.AppMain);
win.SetText("Hello World");
win.SetAutohide(true);
win.VisibilityChangedEvt +=
(object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e) => {};
win.VisibilityChangedEvent +=
(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {};

@ -13,7 +13,7 @@ public class Example : Efl.Csharp.Application
var win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
win.SetText("Focus example");
win.SetAutohide(true);
win.VisibilityChangedEvt += (object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e) => {
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
Efl.Ui.Config.Exit();
@ -32,7 +32,7 @@ public class Example : Efl.Csharp.Application
checkbox.SetText("Check " + i);
checkbox.SetHintFill(false, false);
checkbox.SetHintAlign(0.5, 0.5);
checkbox.FocusChangedEvt += FocusChangedCb;
checkbox.FocusChangedEvent += FocusChangedCb;
vbox.Pack(checkbox);
if (i == 0) first_checkbox = checkbox;
};
@ -45,8 +45,8 @@ public class Example : Efl.Csharp.Application
// Create a "Focus Mover" button
var button = new Efl.Ui.Button(hbox);
button.SetText("Focus mover");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, Efl.Input.IClickableClickedEvt_Args e) => {
button.FocusChangedEvent += FocusChangedCb;
button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
Console.WriteLine("Clicked Focus Mover");
// Manually transfer focus to the first check box
Efl.Ui.Focus.Util.Focus(first_checkbox);
@ -56,8 +56,8 @@ public class Example : Efl.Csharp.Application
// Create a Quit button
button = new Efl.Ui.Button(hbox);
button.SetText("Quit");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, Efl.Input.IClickableClickedEvt_Args e) => {
button.FocusChangedEvent += FocusChangedCb;
button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
Console.WriteLine("Clicked Quit");
Efl.Ui.Config.Exit();
};

@ -63,7 +63,7 @@ public class Example : Efl.Csharp.Application
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
win.SetText("Container demo");
win.SetAutohide(true);
win.VisibilityChangedEvt += (object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e) => {
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
Efl.Ui.Config.Exit();
@ -98,7 +98,7 @@ public class Example : Efl.Csharp.Application
Efl.Ui.Button quit_btn = new Efl.Ui.Button(win);
quit_btn.SetText("Quit");
quit_btn.SetHintSizeMax(new Eina.Size2D(150, 30));
quit_btn.ClickedEvt += (object sender, Efl.Input.IClickableClickedEvt_Args e) => {
quit_btn.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};

@ -36,7 +36,7 @@ public class Example : Efl.Csharp.Application
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
win.SetText("Custom widget demo");
win.SetAutohide(true);
win.VisibilityChangedEvt += (object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e) => {
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop when the window is closed
if (e.arg == false)
Efl.Ui.Config.Exit();
@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
// Instantiate our custom button widget
MyButton btn = new MyButton(win, 99);
btn.ClickedEvt += (object sender, Efl.Input.IClickableClickedEvt_Args e) => {
btn.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
// When the button is clicked, change its text
MyButton b = (MyButton)sender;
b.SetText("Hello!");

@ -16,7 +16,7 @@ public class Example : Efl.Csharp.Application
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
win.SetText("Size Control");
win.SetAutohide(true);
win.VisibilityChangedEvt += (object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e) => {
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
Efl.Ui.Config.Exit();

@ -3,7 +3,7 @@ using System;
public class Example : Efl.Csharp.Application
{
// Callback to quit the application
public static void QuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEvt_Args e)
public static void QuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e)
{
// Exit the EFL main loop
if (e.arg == false)
@ -20,7 +20,7 @@ public class Example : Efl.Csharp.Application
// button is pressed
win.SetAutohide(true);
// Hook to the Hide event
win.VisibilityChangedEvt += QuitCb;
win.VisibilityChangedEvent += QuitCb;
// Create a box container
var box = new Efl.Ui.Box(win);
@ -48,7 +48,7 @@ public class Example : Efl.Csharp.Application
button.SetText("Quit");
button.SetHintWeight(1.0, 0.1);
// Set the method to be called when the button is pressed
button.ClickedEvt += (object sender, Efl.Input.IClickableClickedEvt_Args e) => { Efl.App.AppMain.Quit(0); };
button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { Efl.App.AppMain.Quit(0); };
// Add the button to the box container
box.Pack(button);
}

@ -10,7 +10,7 @@ public class Example
button.SetText(text);
button.SetSize(new Eina.Size2D(w, h));
button.ClickedEvt += callback;
button.ClickedEvent += callback;
return button;
}
@ -56,7 +56,7 @@ public class Example
Efl.Ui.Slider slider = new Efl.Ui.Slider(box);
slider.SetSize(new Eina.Size2D(W, H));
slider.ChangedEvt += (object sender, EventArgs e) => {
slider.ChangedEvent += (object sender, EventArgs e) => {
bar.SetRangeValue(slider.GetRangeValue());
};

@ -23,7 +23,7 @@ public class Example
popup.SetVisible(true);
popup.SetButton(Efl.Ui.Popup_Alert_Button.Positive, "Ok");
popup.SetSize(new Eina.Size2D(150, 30));
popup.ButtonClickedEvt += (object sender, Efl.Ui.Popup_Alert.ButtonClickedEvt_Args e) => {
popup.ButtonClickedEvent += (object sender, Efl.Ui.Popup_Alert.ButtonClickedEventArgs e) => {
popup.SetParent(null);
popup.Invalidate();
};
@ -99,7 +99,7 @@ public class Example
kms_box.DoPack(kms_input);
kms_box.DoPack(kms_button);
kms_button.ClickedEvt += (object sender, EventArgs e) => {
kms_button.ClickedEvent += (object sender, EventArgs e) => {
try
{
string text = kms_input.GetText();
@ -115,7 +115,7 @@ public class Example
}
};
miles_button.ClickedEvt += (object sender, EventArgs e) => {
miles_button.ClickedEvent += (object sender, EventArgs e) => {
try
{
string text = miles_input.GetText();

@ -30,7 +30,7 @@ class TestMain
rect.SetSize(size);
rect.SetVisible(true);
canvas.KeyDownEvt += (object sender, Efl.Input.Interface.KeyDownEvt_Args e) => {
canvas.KeyDownEvent += (object sender, Efl.Input.Interface.KeyDownEventArgs e) => {
color_index = (color_index + 1) % 3;
Console.WriteLine("Key Down");
Console.WriteLine("Got key obj at {0}", e.arg.raw_handle.ToString("X"));

@ -45,7 +45,7 @@ class TestMain
bg.SetVisible(true);
bg.SetKeyFocus(true);
bg.KeyDownEvt += On_KeyDown;
bg.KeyDownEvent += On_KeyDown;
text = new evas.Text(canvas);
text.SetStyle(evas.Text_Style_Type.OutlineSoftShadow);
@ -87,7 +87,7 @@ class TestMain
}
private void On_KeyDown(object sender, Efl.Input.Interface.KeyDownEvt_Args e)
private void On_KeyDown(object sender, Efl.Input.Interface.KeyDownEventArgs e)
{
var key = e.arg.GetKey();

Loading…
Cancel
Save