+++ /dev/null
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-#
-# Copyright 2012 Olaf Wintermann. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-$(WPF_OBJPRE)%.o: wpf/%.c
- $(CC) -o $@ -c $(CFLAGS) $<
-
-$(UI_LIB): $(OBJ) uiw
- $(AR) $(ARFLAGS) $(UI_LIB) $(OBJ)
-
-uiw:
- cd wpf/UIwrapper; $(MSBUILD)
- cp $(BUILD_ROOT)/build/UIwrapper/UIwrapper.dll $(BUILD_ROOT)/build/bin/
- cp $(BUILD_ROOT)/build/UIcore/UIcore.dll $(BUILD_ROOT)/build/bin/
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-\r
-namespace UI\r
-{ \r
- public class Application\r
- {\r
- private static Application instance;\r
-\r
- private System.Windows.Application application;\r
-\r
- private Thread thread;\r
-\r
- public String Name;\r
-\r
- public IApplicationCallbacks callbacks;\r
-\r
- public List<Window> Windows = new List<Window>();\r
- public ApplicationMenu Menu = new ApplicationMenu();\r
- public MainToolBar ToolBar = new MainToolBar();\r
- \r
- private Application() : base()\r
- {\r
- thread = new Thread(() => RunApplication());\r
- thread.SetApartmentState(ApartmentState.STA);\r
- }\r
-\r
- public static Application GetInstance()\r
- {\r
- if (instance == null)\r
- {\r
- instance = new Application();\r
- GC.KeepAlive(instance);\r
- }\r
- return instance;\r
- }\r
-\r
- public Thread Start()\r
- {\r
- thread.Start();\r
- return thread;\r
- }\r
-\r
- private void RunApplication()\r
- {\r
- application = new System.Windows.Application();\r
-\r
- if(callbacks != null)\r
- {\r
- callbacks.OnStartup();\r
- }\r
- application.Run();\r
- if(callbacks != null)\r
- {\r
- callbacks.OnExit();\r
- }\r
- }\r
-\r
- public void AddWindow(Window window)\r
- {\r
- Windows.Add(window);\r
- }\r
-\r
- public void RemoveWindow(Window window)\r
- {\r
- Windows.Remove(window);\r
- if (Windows.Count == 0)\r
- {\r
- application.Shutdown();\r
- }\r
- }\r
- }\r
-\r
- public class ResultExec<T>\r
- {\r
- public T Result;\r
- public Func<T> Func;\r
-\r
- public void Exec()\r
- {\r
- Result = Func.Invoke();\r
- }\r
- }\r
-\r
- public class VoidExec\r
- {\r
- public Action Action;\r
-\r
- public void Exec()\r
- {\r
- Action.Invoke();\r
- }\r
- }\r
-\r
- public interface IApplicationCallbacks\r
- {\r
- void OnStartup();\r
- void OnOpen();\r
- void OnExit();\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-\r
-namespace UI\r
-{\r
- public interface Container\r
- {\r
- Layout Layout { get; set; }\r
- \r
- void Add(UIElement control, bool fill);\r
- }\r
-\r
- public class Layout\r
- {\r
- public bool? Fill { get; set; }\r
- public bool Hexpand { get; set; }\r
- public bool Vexpand { get; set; }\r
- public bool NewLine { get; set; }\r
- public int GridWidth { get; set; }\r
- public String Label { get; set; }\r
-\r
- public Layout()\r
- {\r
- Reset();\r
- }\r
-\r
- public bool IsFill(bool fill)\r
- {\r
- if (Fill != null)\r
- {\r
- \r
- return (bool)Fill;\r
- }\r
- return fill;\r
- }\r
-\r
- public void Reset()\r
- {\r
- Fill = null;\r
- Hexpand = false;\r
- Vexpand = false;\r
- NewLine = false;\r
- GridWidth = 1;\r
- Label = null;\r
- }\r
- }\r
-\r
- public enum BoxOrientation\r
- {\r
- VERTICAL,\r
- HORIZONTAL\r
- }\r
-\r
- public class BoxContainer : Grid, Container\r
- {\r
- public Layout Layout { get; set; }\r
- \r
- private BoxOrientation Orientation;\r
- private int Spacing;\r
-\r
- private int x = 0;\r
- private int y = 0;\r
-\r
- private bool filled = false;\r
-\r
- public BoxContainer(BoxOrientation orientation, int margin, int spacing) : base()\r
- {\r
- Layout = new Layout();\r
- Margin = new Thickness(margin);\r
- Spacing = spacing;\r
- \r
- Orientation = orientation;\r
- if(Orientation == BoxOrientation.HORIZONTAL)\r
- {\r
- RowDefinition row = new RowDefinition();\r
- row.Height = new GridLength(1, GridUnitType.Star);\r
- RowDefinitions.Add(row);\r
- }\r
- else\r
- {\r
- ColumnDefinition col = new ColumnDefinition();\r
- col.Width = new GridLength(1, GridUnitType.Star);\r
- ColumnDefinitions.Add(col);\r
- }\r
- }\r
-\r
- public BoxContainer(Container parent, BoxOrientation orientation, int margin, int spacing) : this(orientation, margin, spacing)\r
- {\r
- parent.Add(this, true);\r
- }\r
- \r
- public void Add(UIElement control, bool fill)\r
- {\r
- fill = Layout.IsFill(fill);\r
- \r
- if(Orientation == BoxOrientation.HORIZONTAL)\r
- {\r
- if(Spacing > 0)\r
- {\r
- ColumnDefinition spaceCol = new ColumnDefinition();\r
- spaceCol.Width = new GridLength(Spacing, GridUnitType.Pixel);\r
- ColumnDefinitions.Add(spaceCol);\r
- x++;\r
- }\r
-\r
- ColumnDefinition col = new ColumnDefinition();\r
- if(filled && fill)\r
- {\r
- fill = false;\r
- Console.WriteLine("BoxContainer can only contain one filled control");\r
- }\r
- if(fill)\r
- {\r
- col.Width = new GridLength(1, GridUnitType.Star);\r
- filled = true;\r
- }\r
- else\r
- {\r
- col.Width = GridLength.Auto;\r
- }\r
- ColumnDefinitions.Add(col);\r
- }\r
- else\r
- {\r
- if (Spacing > 0)\r
- {\r
- RowDefinition spaceRow = new RowDefinition();\r
- spaceRow.Height = new GridLength(Spacing, GridUnitType.Pixel);\r
- RowDefinitions.Add(spaceRow);\r
- y++;\r
- }\r
-\r
- RowDefinition row = new RowDefinition();\r
- if (filled && fill)\r
- {\r
- fill = false;\r
- Console.WriteLine("BoxContainer can only contain one filled control");\r
- }\r
- if(fill)\r
- {\r
- row.Height = new GridLength(1, GridUnitType.Star);\r
- filled = true;\r
- }\r
- else\r
- {\r
- row.Height = GridLength.Auto;\r
- }\r
- RowDefinitions.Add(row);\r
- }\r
-\r
- Grid.SetColumn(control, x);\r
- Grid.SetRow(control, y);\r
- Children.Add(control);\r
-\r
- if(Orientation == BoxOrientation.HORIZONTAL)\r
- {\r
- x++;\r
- }\r
- else\r
- {\r
- y++;\r
- }\r
-\r
- Layout.Reset();\r
- }\r
- }\r
- \r
- public class GridContainer : Grid, Container\r
- {\r
- public Layout Layout { get; set; }\r
-\r
- private int X = 0;\r
- private int Y = 0;\r
- private int CurrentWidth = 0;\r
- private int CurrentHeight = 0;\r
-\r
- private int ColSpacing;\r
- private int RowSpacing;\r
-\r
- public GridContainer(Container parent, int margin, int colspacing, int rowspacing) : base()\r
- {\r
- Layout = new Layout();\r
-\r
- Margin = new Thickness(margin);\r
- ColSpacing = colspacing;\r
- RowSpacing = rowspacing;\r
-\r
- parent.Add(this, true);\r
- }\r
-\r
- public void Add(UIElement control, bool fill)\r
- {\r
- if(Layout.NewLine)\r
- {\r
- X = 0;\r
- Y++;\r
- }\r
-\r
- ColumnDefinition col;\r
- RowDefinition row;\r
- bool getcol = false;\r
- if(X >= CurrentWidth)\r
- {\r
- if (ColSpacing > 0 && X != 0)\r
- {\r
- ColumnDefinition spaceCol = new ColumnDefinition();\r
- spaceCol.Width = new GridLength(ColSpacing, GridUnitType.Pixel);\r
- ColumnDefinitions.Add(spaceCol);\r
- X++;\r
- }\r
-\r
- col = new ColumnDefinition();\r
- col.Width = GridLength.Auto;\r
- ColumnDefinitions.Add(col);\r
-\r
- CurrentWidth = X + 1;\r
- }\r
- else\r
- {\r
- if (ColSpacing > 0 && X % 2 > 0)\r
- {\r
- X++;\r
- }\r
- col = ColumnDefinitions.ElementAt(X);\r
- }\r
-\r
- if(getcol)\r
- {\r
- col = ColumnDefinitions.ElementAt(X);\r
- }\r
-\r
- if (Y >= CurrentHeight)\r
- {\r
- if (RowSpacing > 0 && Y != 0)\r
- {\r
- RowDefinition spaceRow = new RowDefinition();\r
- spaceRow.Height = new GridLength(RowSpacing, GridUnitType.Pixel);\r
- RowDefinitions.Add(spaceRow);\r
- Y++;\r
- }\r
-\r
- row = new RowDefinition();\r
- row.Height = GridLength.Auto;\r
- RowDefinitions.Add(row);\r
- CurrentHeight = Y + 1;\r
- }\r
- else\r
- {\r
- row = RowDefinitions.ElementAt(Y);\r
- }\r
-\r
- if(Layout.Hexpand)\r
- {\r
- col.Width = new GridLength(1, GridUnitType.Star);\r
- }\r
- if(Layout.Vexpand)\r
- {\r
- row.Height = new GridLength(1, GridUnitType.Star);\r
- }\r
-\r
- int gridwidth = Layout.GridWidth;\r
- if(gridwidth > 1)\r
- {\r
- gridwidth++;\r
- }\r
-\r
- Grid.SetColumn(control, X);\r
- Grid.SetRow(control, Y);\r
- Grid.SetColumnSpan(control, gridwidth);\r
- Children.Add(control);\r
-\r
- Layout.Reset();\r
- X += gridwidth;\r
- }\r
- }\r
-\r
- public class ScrollViewerContainer : ScrollViewer, Container\r
- {\r
- public Layout Layout { get; set; }\r
-\r
- public ScrollViewerContainer(Container parent) : base()\r
- {\r
- Layout = new Layout();\r
-\r
- HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;\r
- VerticalScrollBarVisibility = ScrollBarVisibility.Auto;\r
-\r
- parent.Add(this, true);\r
- }\r
-\r
- public void Add(UIElement control, bool fill)\r
- {\r
- Content = control;\r
- }\r
- }\r
-\r
- public class TabViewContainer : TabControl, Container\r
- {\r
- public Layout Layout { get; set; }\r
-\r
- public TabViewContainer(Container parent) : base()\r
- {\r
- Layout = new Layout();\r
- parent.Add(this, true);\r
- }\r
-\r
- public void Add(UIElement control, bool fill)\r
- {\r
- TabItem tab = new TabItem();\r
- tab.Header = Layout.Label != null ? Layout.Label : "New Tab";\r
- Items.Add(tab);\r
- tab.Content = control;\r
- Layout.Reset();\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-\r
-namespace UI\r
-{ \r
- public class Controls\r
- {\r
- public static Button Button(Container container, String label, RoutedEventHandler e)\r
- {\r
- Button button = new Button();\r
- button.Content = label;\r
- container.Add(button, false);\r
-\r
- button.Click += e;\r
-\r
- return button;\r
- }\r
-\r
- public static Label Label(Container container, String str, int alignment)\r
- {\r
- HorizontalAlignment a;\r
- switch (alignment)\r
- {\r
- case 0: a = HorizontalAlignment.Left; break;\r
- case 1: a = HorizontalAlignment.Right; break;\r
- case 2: a = HorizontalAlignment.Center; break;\r
- default: a = HorizontalAlignment.Left; break;\r
- }\r
-\r
- Label label = new Label();\r
- label.HorizontalAlignment = a;\r
- label.Content = str;\r
- container.Add(label, false);\r
-\r
- return label;\r
- }\r
-\r
- public static Label Space(Container container)\r
- {\r
- return Label(container, null, 2);\r
- }\r
-\r
- public static Separator Separator(Container container)\r
- {\r
- Separator separator = new Separator();\r
- container.Add(separator, false);\r
- return separator;\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-using System.Windows.Media;\r
-using System.Windows.Shapes;\r
-using System.Diagnostics;\r
-\r
-namespace UI\r
-{\r
- public class DrawingArea : System.Windows.Controls.Canvas\r
- {\r
- public Action<int,int> resizeCallback;\r
-\r
- public Color Color;\r
- private Brush Brush;\r
-\r
- public DrawingArea(Container container) : base()\r
- {\r
- this.SizeChanged += UpdateSize;\r
- ResetGraphics();\r
-\r
- container.Add(this, true);\r
- }\r
-\r
- public void UpdateSize(object sender, SizeChangedEventArgs e)\r
- {\r
- if(resizeCallback != null)\r
- {\r
- Children.Clear();\r
- ResetGraphics();\r
-\r
- Size s = e.NewSize;\r
- resizeCallback((int)s.Width, (int)s.Height);\r
- }\r
- }\r
-\r
- public void Redraw()\r
- {\r
- if (resizeCallback != null)\r
- {\r
- Children.Clear();\r
- ResetGraphics();\r
-\r
- resizeCallback((int)ActualWidth, (int)ActualHeight);\r
- }\r
-\r
- }\r
-\r
- private void ResetGraphics()\r
- {\r
- Color = Color.FromRgb(0, 0, 0);\r
- Brush = System.Windows.Media.Brushes.Black;\r
- }\r
-\r
- public void SetColor(int r, int g, int b)\r
- {\r
- Color = Color.FromRgb((byte)r, (byte)g, (byte)b);\r
- Brush = new SolidColorBrush(Color);\r
- }\r
-\r
- public void DrawLine(int x1, int y1, int x2, int y2)\r
- {\r
- Line line = new Line();\r
- line.Stroke = Brush;\r
- line.StrokeThickness = 1;\r
- line.SnapsToDevicePixels = true;\r
-\r
- line.X1 = x1;\r
- line.Y1 = y1;\r
- line.X2 = x2;\r
- line.Y2 = y2;\r
-\r
- Children.Add(line);\r
- }\r
-\r
- public void DrawRect(int x, int y, int w, int h, bool fill)\r
- {\r
- Rectangle rect = new Rectangle();\r
- rect.Stroke = Brush;\r
- rect.StrokeThickness = 1;\r
- rect.SnapsToDevicePixels = true;\r
- if(fill)\r
- {\r
- rect.Fill = Brush;\r
- }\r
-\r
- rect.Width = w;\r
- rect.Height = h;\r
- SetLeft(rect, x);\r
- SetTop(rect, y);\r
-\r
- Children.Add(rect);\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-using System.Windows.Media;\r
-\r
-namespace UI\r
-{\r
- public class MainToolBar\r
- {\r
- Dictionary<string, IToolItem> Items = new Dictionary<string, IToolItem>();\r
- List<string> Defaults = new List<string>();\r
-\r
- public MainToolBar()\r
- {\r
-\r
- }\r
-\r
- public bool HasItems()\r
- {\r
- return Defaults.Count > 0 ? true : false;\r
- }\r
-\r
- public void AddDefault(string itemName)\r
- {\r
- Defaults.Add(itemName);\r
- }\r
-\r
- public void AddToolItem(string name, string label, Action<IntPtr> action)\r
- {\r
- ToolItem item = new ToolItem();\r
- item.Label = label;\r
- item.Action = action;\r
- Items.Add(name, item);\r
- }\r
-\r
- public ToolBarTray CreateToolBarTray(IntPtr objptr)\r
- {\r
- ToolBarTray tray = new ToolBarTray();\r
- ToolBar toolbar = new ToolBar();\r
- tray.ToolBars.Add(toolbar);\r
- foreach(string s in Defaults)\r
- {\r
- IToolItem item = Items[s];\r
- item.AddTo(toolbar, objptr);\r
- }\r
-\r
- return tray;\r
- }\r
- }\r
-\r
- public interface IToolItem\r
- {\r
- void AddTo(System.Windows.Controls.ToolBar toolbar, IntPtr uiobj);\r
- }\r
-\r
- public class ToolItem : IToolItem\r
- {\r
- public string Label { get; set; }\r
- // TODO: icon\r
- public Action<IntPtr> Action { get; set; }\r
-\r
- public void AddTo(System.Windows.Controls.ToolBar toolbar, IntPtr uiobj)\r
- {\r
- Button button = new Button();\r
- button.Content = Label;\r
-\r
- EventCallback e = new EventCallback(uiobj, Action);\r
- button.Click += e.Callback;\r
-\r
- toolbar.Items.Add(button);\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-using System.Windows.Media;\r
-\r
-namespace UI\r
-{\r
- public class ApplicationMenu\r
- {\r
- private List<Menu> current = new List<Menu>();\r
-\r
- public List<Menu> Menus = new List<Menu>();\r
-\r
- public void AddMenu(String label)\r
- {\r
- current.Clear();\r
- Menu menu = new Menu(label);\r
- current.Add(menu);\r
- Menus.Add(menu);\r
- }\r
-\r
- public Boolean IsEmpty()\r
- {\r
- return Menus.Count == 0 ? true : false;\r
- }\r
-\r
- public void AddSubMenu(String label)\r
- {\r
- Menu menu = new Menu(label);\r
- current.Last().Items.Add(menu);\r
- current.Add(menu);\r
- }\r
-\r
- public void EndSubMenu()\r
- {\r
- current.Remove(current.Last());\r
- }\r
-\r
- public void AddMenuItem(String label, Action<IntPtr> action)\r
- {\r
- if(current.Count != 0)\r
- {\r
- MenuItem item = new MenuItem(label, action);\r
- current.Last().Items.Add(item);\r
- }\r
- }\r
-\r
- public System.Windows.Controls.Menu CreateMenu(IntPtr uiobj)\r
- {\r
- System.Windows.Controls.Menu menu = new System.Windows.Controls.Menu();\r
- menu.Background = new SolidColorBrush(Color.FromRgb(255, 255, 255));\r
- foreach (Menu m in Menus)\r
- {\r
- System.Windows.Controls.MenuItem i = new System.Windows.Controls.MenuItem();\r
- i.Header = m.Label;\r
- m.AddItems(i, uiobj);\r
- menu.Items.Add(i);\r
- }\r
- return menu;\r
- }\r
- }\r
-\r
- public interface IMenuItem\r
- {\r
- void AddTo(System.Windows.Controls.MenuItem menu, IntPtr uiobj);\r
- }\r
-\r
- public class Menu : IMenuItem\r
- {\r
- public String Label;\r
- public List<IMenuItem> Items = new List<IMenuItem>();\r
-\r
- public Menu(String label)\r
- {\r
- Label = label;\r
- }\r
-\r
- public void AddItems(System.Windows.Controls.MenuItem i, IntPtr uiobj)\r
- {\r
- foreach (IMenuItem item in Items)\r
- {\r
- item.AddTo(i, uiobj);\r
- }\r
- }\r
-\r
- void IMenuItem.AddTo(System.Windows.Controls.MenuItem menu, IntPtr uiobj)\r
- {\r
- System.Windows.Controls.MenuItem i = new System.Windows.Controls.MenuItem();\r
- i.Header = Label;\r
- AddItems(i, uiobj);\r
- menu.Items.Add(i);\r
- }\r
- }\r
-\r
- public class MenuItem : IMenuItem\r
- {\r
- String Label;\r
- Action<IntPtr> Action;\r
-\r
- public MenuItem(String label, Action<IntPtr> action)\r
- {\r
- Label = label;\r
- Action = action;\r
- }\r
-\r
- void IMenuItem.AddTo(System.Windows.Controls.MenuItem menu, IntPtr uiobj)\r
- {\r
- System.Windows.Controls.MenuItem i = new System.Windows.Controls.MenuItem();\r
- EventCallback cb = new EventCallback(uiobj, Action);\r
- i.Click += cb.Callback;\r
- i.Header = Label;\r
- menu.Items.Add(i);\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-\r
-// Allgemeine Informationen über eine Assembly werden über die folgenden \r
-// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,\r
-// die mit einer Assembly verknüpft sind.\r
-[assembly: AssemblyTitle("UIcore")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("UIcore")]\r
-[assembly: AssemblyCopyright("Copyright © 2015")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-\r
-// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar \r
-// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von \r
-// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.\r
-[assembly: ComVisible(false)]\r
-\r
-// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird\r
-[assembly: Guid("e93c93b6-d270-4178-998f-7e68d9591874")]\r
-\r
-// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:\r
-//\r
-// Hauptversion\r
-// Nebenversion \r
-// Buildnummer\r
-// Revision\r
-//\r
-// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern \r
-// übernehmen, indem Sie "*" eingeben:\r
-// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("1.0.0.0")]\r
-[assembly: AssemblyFileVersion("1.0.0.0")]\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-\r
-namespace UI\r
-{\r
- public class TextArea : System.Windows.Controls.TextBox\r
- {\r
- public TextArea(Container container, String text, bool textarea) : base()\r
- {\r
- bool fill = false;\r
- if (textarea)\r
- {\r
- AcceptsReturn = true;\r
- IsUndoEnabled = false; // we need our own undo stack\r
- VerticalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto;\r
- HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto;\r
- fill = true;\r
- }\r
- else\r
- {\r
- HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto;\r
- MinWidth = 15;\r
- }\r
-\r
- if (text != null)\r
- {\r
- Text = text;\r
- }\r
-\r
- container.Add(this, fill);\r
- }\r
-\r
-\r
- // ------------------ UiText methods ------------------\r
-\r
- public void SetText(String str)\r
- {\r
- Text = str;\r
- }\r
-\r
- public String GetText()\r
- {\r
- return Text;\r
- }\r
-\r
- public String GetSubString(int begin, int end)\r
- {\r
- return null;\r
- }\r
-\r
- public void Insert(int pos, String str)\r
- {\r
-\r
- }\r
-\r
- public int Position()\r
- {\r
- return CaretIndex;\r
- }\r
-\r
- public int Selection()\r
- {\r
- return 0;\r
- }\r
-\r
- public int Length()\r
- {\r
- return Text.Length;\r
- }\r
-\r
- public void Remove(int begin, int end)\r
- {\r
-\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-\r
-namespace UI\r
-{\r
- public class EventCallback\r
- {\r
- public IntPtr Object;\r
- public Action<IntPtr> Action;\r
-\r
- public EventCallback(IntPtr uiobj, Action<IntPtr> action)\r
- {\r
- Object = uiobj;\r
- Action = action;\r
- }\r
-\r
- public void Callback(object sender, RoutedEventArgs a)\r
- {\r
- Action.Invoke(Object);\r
- }\r
- }\r
-}\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProjectGuid>{8573F7D8-F05F-4195-9005-1C219B976146}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>UIcore</RootNamespace>\r
- <AssemblyName>UIcore</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>..\..\..\build\UIcore\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>..\..\..\build\UIcore\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="PresentationCore" />\r
- <Reference Include="PresentationFramework" />\r
- <Reference Include="System" />\r
- <Reference Include="System.Core" />\r
- <Reference Include="System.Windows" />\r
- <Reference Include="System.Windows.Controls.Ribbon" />\r
- <Reference Include="System.Xaml" />\r
- <Reference Include="System.Xml.Linq" />\r
- <Reference Include="System.Data.DataSetExtensions" />\r
- <Reference Include="Microsoft.CSharp" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="WindowsBase" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Container.cs" />\r
- <Compile Include="Controls.cs" />\r
- <Compile Include="DrawingArea.cs" />\r
- <Compile Include="MainToolBar.cs" />\r
- <Compile Include="Menu.cs" />\r
- <Compile Include="TextArea.cs" />\r
- <Compile Include="Toolkit.cs" />\r
- <Compile Include="Window.cs" />\r
- <Compile Include="Application.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading;\r
-using System.Threading.Tasks;\r
-using System.Windows;\r
-using System.Windows.Controls;\r
-\r
-namespace UI\r
-{\r
- public class MainWindow : Window, Container\r
- {\r
- public Layout Layout\r
- {\r
- get\r
- {\r
- return Container.Layout;\r
- }\r
- set\r
- {\r
- Container.Layout = value;\r
- }\r
- }\r
- \r
- public IntPtr Object;\r
- public Container Container;\r
- \r
- public MainWindow(String title, IntPtr uiobj)\r
- {\r
- Title = title;\r
- Object = uiobj;\r
- Width = 300;\r
- Height = 300;\r
-\r
- Grid windowGrid = new Grid();\r
- ColumnDefinition column = new ColumnDefinition();\r
- column.Width = new GridLength(1, GridUnitType.Star);\r
- windowGrid.ColumnDefinitions.Add(column);\r
- this.AddChild(windowGrid);\r
- int rowIndex = 0;\r
-\r
- // menu\r
- Application app = Application.GetInstance();\r
- System.Windows.Controls.Menu menu = null;\r
- if (!app.Menu.IsEmpty())\r
- {\r
- menu = app.Menu.CreateMenu(uiobj);\r
-\r
- RowDefinition menuRow = new RowDefinition();\r
- menuRow.Height = GridLength.Auto;\r
- windowGrid.RowDefinitions.Add(menuRow);\r
-\r
- Grid.SetRow(menu, rowIndex);\r
- Grid.SetColumn(menu, 0);\r
- windowGrid.Children.Add(menu);\r
- rowIndex++;\r
- }\r
-\r
- // toolbar\r
- if(app.ToolBar.HasItems())\r
- {\r
- System.Windows.Controls.ToolBarTray tray = app.ToolBar.CreateToolBarTray(uiobj);\r
- RowDefinition menuRow = new RowDefinition();\r
- menuRow.Height = GridLength.Auto;\r
- windowGrid.RowDefinitions.Add(menuRow);\r
-\r
- Grid.SetRow(tray, rowIndex);\r
- Grid.SetColumn(tray, 0);\r
- windowGrid.Children.Add(tray);\r
- rowIndex++;\r
-\r
- if(menu != null)\r
- {\r
- menu.Background = tray.Background;\r
- }\r
- }\r
-\r
- // content\r
- RowDefinition contentRow = new RowDefinition();\r
- contentRow.Height = new GridLength(1, GridUnitType.Star);\r
- windowGrid.RowDefinitions.Add(contentRow);\r
- BoxContainer vbox = new BoxContainer(BoxOrientation.VERTICAL, 0, 0);\r
- Grid.SetColumn(vbox, 0);\r
- Grid.SetRow(vbox, rowIndex);\r
- windowGrid.Children.Add(vbox);\r
- rowIndex++;\r
-\r
- Container = vbox;\r
-\r
- Closed += CloseEvent;\r
- }\r
-\r
- public void ShowWindow()\r
- {\r
- this.Show();\r
- Application.GetInstance().AddWindow(this);\r
- }\r
-\r
- public void CloseEvent(object sender, System.EventArgs e)\r
- {\r
- Application.GetInstance().RemoveWindow(this);\r
- }\r
-\r
- public void Add(UIElement control, bool fill)\r
- {\r
- Container.Add(control, fill);\r
- }\r
- }\r
-}\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 12.00\r
-# Visual Studio 14\r
-VisualStudioVersion = 14.0.25420.1\r
-MinimumVisualStudioVersion = 10.0.40219.1\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UIwrapper", "UIwrapper\UIwrapper.vcxproj", "{367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {8573F7D8-F05F-4195-9005-1C219B976146} = {8573F7D8-F05F-4195-9005-1C219B976146}\r
- EndProjectSection\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIcore", "..\UIcore\UIcore.csproj", "{8573F7D8-F05F-4195-9005-1C219B976146}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug|x64 = Debug|x64\r
- Release|Any CPU = Release|Any CPU\r
- Release|x64 = Release|x64\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Debug|Any CPU.ActiveCfg = Debug|x64\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Debug|Any CPU.Build.0 = Debug|x64\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Debug|x64.ActiveCfg = Debug|x64\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Debug|x64.Build.0 = Debug|x64\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Release|Any CPU.ActiveCfg = Release|Win32\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Release|x64.ActiveCfg = Release|x64\r
- {367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}.Release|x64.Build.0 = Release|x64\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Debug|x64.ActiveCfg = Debug|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Debug|x64.Build.0 = Debug|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Release|x64.ActiveCfg = Release|Any CPU\r
- {8573F7D8-F05F-4195-9005-1C219B976146}.Release|x64.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-#include "stdafx.h"\r
-\r
-using namespace System;\r
-using namespace System::Reflection;\r
-using namespace System::Runtime::CompilerServices;\r
-using namespace System::Runtime::InteropServices;\r
-using namespace System::Security::Permissions;\r
-\r
-//\r
-// Allgemeine Informationen über eine Assembly werden über die folgenden\r
-// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,\r
-// die mit einer Assembly verknüpft sind.\r
-//\r
-[assembly:AssemblyTitleAttribute(L"UIwrapper")];\r
-[assembly:AssemblyDescriptionAttribute(L"")];\r
-[assembly:AssemblyConfigurationAttribute(L"")];\r
-[assembly:AssemblyCompanyAttribute(L"")];\r
-[assembly:AssemblyProductAttribute(L"UIwrapper")];\r
-[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2015")];\r
-[assembly:AssemblyTrademarkAttribute(L"")];\r
-[assembly:AssemblyCultureAttribute(L"")];\r
-\r
-//\r
-// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:\r
-//\r
-// Hauptversion\r
-// Nebenversion\r
-// Buildnummer\r
-// Revision\r
-//\r
-// Sie können alle Werte angeben oder für die Revisions- und Buildnummer den Standard\r
-// übernehmen, indem Sie "*" eingeben:\r
-\r
-[assembly:AssemblyVersionAttribute("1.0.*")];\r
-\r
-[assembly:ComVisible(false)];\r
-\r
-[assembly:CLSCompliantAttribute(true)];
\ No newline at end of file
+++ /dev/null
-========================================================================\r
- DYNAMIC LINK LIBRARY: UIwrapper-Projektübersicht\r
-========================================================================\r
-\r
-Diese UIwrapper-DLL wurde vom Anwendungs-Assistenten für Sie erstellt. \r
-\r
-Diese Datei bietet eine Übersicht über den Inhalt der einzelnen Dateien, aus\r
-denen Ihre UIwrapper-Anwendung besteht.\r
-\r
-UIwrapper.vcxproj\r
- Dies ist die Hauptprojektdatei für VC++-Projekte, die mit dem Anwendungs-Assistenten generiert werden. Sie enthält Informationen über die Version von Visual C++, mit der die Datei generiert wurde, sowie über die Plattformen, Konfigurationen und Projektfunktionen, die im Anwendungs-Assistenten ausgewählt wurden.\r
-\r
-UIwrapper.vcxproj.filters\r
- Dies ist die Filterdatei für VC++-Projekte, die mithilfe eines Anwendungs-Assistenten erstellt werden. Sie enthält Informationen über die Zuordnung zwischen den Dateien im Projekt und den Filtern. Diese Zuordnung wird in der IDE zur Darstellung der Gruppierung von Dateien mit ähnlichen Erweiterungen unter einem bestimmten Knoten verwendet (z. B. sind CPP-Dateien dem Filter "Quelldateien" zugeordnet).\r
-\r
-UIwrapper.cpp\r
- Dies ist die Hauptquelldatei der DLL.\r
-\r
-UIwrapper.h\r
- Diese Datei enthält eine Klassendeklaration.\r
-\r
-AssemblyInfo.cpp\r
- Enthält benutzerdefinierte Attribute zum Ändern von Assemblymetadaten.\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-Weitere Hinweise:\r
-\r
-Der Anwendungs-Assistent weist Sie mit "TODO:" auf Teile des Quellcodes hin, die Sie ergänzen oder anpassen sollten.\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
+++ /dev/null
-// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.\r
-// UIwrapper.pch ist der vorkompilierte Header.\r
-// stdafx.obj enthält die vorkompilierten Typinformationen.\r
-\r
-#include "stdafx.h"\r
+++ /dev/null
-// stdafx.h : Includedatei für Standardsystem-Includedateien\r
-// oder häufig verwendete projektspezifische Includedateien,\r
-// die nur in unregelmäßigen Abständen geändert werden.\r
-\r
-#pragma once\r
-\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{367C474F-D7EA-44E3-9CB7-A4A35DCE9CC5}</ProjectGuid>\r
- <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>\r
- <Keyword>ManagedCProj</Keyword>\r
- <RootNamespace>UIwrapper</RootNamespace>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseDebugLibraries>true</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CLRSupport>true</CLRSupport>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseDebugLibraries>true</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CLRSupport>true</CLRSupport>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseDebugLibraries>false</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CLRSupport>true</CLRSupport>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseDebugLibraries>false</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CLRSupport>true</CLRSupport>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <LinkIncremental>true</LinkIncremental>\r
- <OutDir>$(SolutionDir)..\..\..\build\UIwrapper\</OutDir>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <LinkIncremental>true</LinkIncremental>\r
- <OutDir>$(SolutionDir)..\..\..\build\UIwrapper\</OutDir>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <LinkIncremental>false</LinkIncremental>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <LinkIncremental>false</LinkIncremental>\r
- <OutDir>$(SolutionDir)..\..\..\build\UIwrapper\</OutDir>\r
- <IntDir>$(SolutionDir)..\..\..\build\UIwrapper\$(Configuration)\</IntDir>\r
- <LibraryPath>$(LibraryPath)</LibraryPath>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PrecompiledHeader>Use</PrecompiledHeader>\r
- <AdditionalUsingDirectories>$(SolutionDir)..\..\..\build\UIcore\;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>\r
- </ClCompile>\r
- <Link>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies />\r
- <AdditionalLibraryDirectories>C:\Users\Olaf\Projekte\toolkit\build\UIcore\</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PrecompiledHeader>Use</PrecompiledHeader>\r
- <AdditionalUsingDirectories>$(SolutionDir)..\..\..\build\UIcore\;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>\r
- </ClCompile>\r
- <Link>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>\r
- </AdditionalDependencies>\r
- <AdditionalLibraryDirectories>\r
- </AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PrecompiledHeader>Use</PrecompiledHeader>\r
- </ClCompile>\r
- <Link>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies />\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PrecompiledHeader>Use</PrecompiledHeader>\r
- <AdditionalUsingDirectories>$(SolutionDir)..\..\..\build\UIcore\;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>\r
- <DebugInformationFormat>None</DebugInformationFormat>\r
- </ClCompile>\r
- <Link>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>\r
- </AdditionalDependencies>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <Reference Include="PresentationCore" />\r
- <Reference Include="PresentationFramework" />\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Windows" />\r
- <Reference Include="System.Windows.Controls.Ribbon" />\r
- <Reference Include="System.Xaml" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="WindowsBase" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="controls.h" />\r
- <ClInclude Include="container.h" />\r
- <ClInclude Include="graphics.h" />\r
- <ClInclude Include="menu.h" />\r
- <ClInclude Include="resource.h" />\r
- <ClInclude Include="Stdafx.h" />\r
- <ClInclude Include="toolbar.h" />\r
- <ClInclude Include="toolkit.h" />\r
- <ClInclude Include="window.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="AssemblyInfo.cpp" />\r
- <ClCompile Include="controls.cpp" />\r
- <ClCompile Include="graphics.cpp" />\r
- <ClCompile Include="menu.cpp" />\r
- <ClCompile Include="container.cpp" />\r
- <ClCompile Include="toolbar.cpp" />\r
- <ClCompile Include="window.cpp" />\r
- <ClCompile Include="Stdafx.cpp">\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>\r
- </ClCompile>\r
- <ClCompile Include="toolkit.cpp" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Text Include="ReadMe.txt" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="app.rc" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Image Include="app.ico" />\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup>\r
- <Filter Include="Quelldateien">\r
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
- </Filter>\r
- <Filter Include="Headerdateien">\r
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
- <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
- </Filter>\r
- <Filter Include="Ressourcendateien">\r
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r
- </Filter>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="Stdafx.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="resource.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="toolkit.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="window.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="menu.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="controls.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="container.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="toolbar.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- <ClInclude Include="graphics.h">\r
- <Filter>Headerdateien</Filter>\r
- </ClInclude>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="AssemblyInfo.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="Stdafx.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="window.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="toolkit.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="menu.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="controls.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="container.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="toolbar.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- <ClCompile Include="graphics.cpp">\r
- <Filter>Quelldateien</Filter>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Text Include="ReadMe.txt" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="app.rc">\r
- <Filter>Ressourcendateien</Filter>\r
- </ResourceCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Image Include="app.ico">\r
- <Filter>Ressourcendateien</Filter>\r
- </Image>\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup />\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "container.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-UI_EXPORT void* __stdcall UIvbox(gcroot<UI::Container^> *parent, int margin, int spacing) {\r
- UI::BoxContainer ^vbox = gcnew UI::BoxContainer(*parent, UI::BoxOrientation::VERTICAL, margin, spacing);\r
- gcroot<UI::BoxContainer^> *container = new gcroot<UI::BoxContainer^>();\r
- *container = vbox;\r
- return container;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UIhbox(gcroot<UI::Container^> *parent, int margin, int spacing) {\r
- UI::BoxContainer ^hbox = gcnew UI::BoxContainer(*parent, UI::BoxOrientation::HORIZONTAL, margin, spacing);\r
- gcroot<UI::BoxContainer^> *container = new gcroot<UI::BoxContainer^>();\r
- *container = hbox;\r
- return container;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UIgrid(gcroot<UI::Container^> *parent, int margin, int columnspacing, int rowspacing) {\r
- UI::GridContainer ^grid = gcnew UI::GridContainer(*parent, margin, columnspacing, rowspacing);\r
- gcroot<UI::GridContainer^> *container = new gcroot<UI::GridContainer^>();\r
- *container = grid;\r
- return container;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UIscrolledwindow(gcroot<UI::Container^> *parent) {\r
- UI::ScrollViewerContainer ^scrollviewer = gcnew UI::ScrollViewerContainer(*parent);\r
- gcroot<UI::ScrollViewerContainer^> *container = new gcroot<UI::ScrollViewerContainer^>();\r
- *container = scrollviewer;\r
- return container;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UItabview(gcroot<UI::Container^> *parent) {\r
- UI::TabViewContainer ^tabview = gcnew UI::TabViewContainer(*parent);\r
- gcroot<UI::TabViewContainer^> *container = new gcroot<UI::TabViewContainer^>();\r
- *container = tabview;\r
- return container;\r
-}\r
-\r
-UI_EXPORT void __stdcall UItab(gcroot<UI::Container^> *container, char *label) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->Label = gcnew String(label);\r
-}\r
-\r
-\r
-\r
-/* ------------------- layout functions ------------------- */\r
-\r
-UI_EXPORT void __stdcall UIlayout_fill(gcroot<UI::Container^> *container, int fill) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->Fill = fill != 0;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIlayout_hexpand(gcroot<UI::Container^> *container, int expand) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->Hexpand = expand != 0;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIlayout_vexpand(gcroot<UI::Container^> *container, int expand) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->Vexpand = expand != 0;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIlayout_gridwidth(gcroot<UI::Container^> *container, int width) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->GridWidth = width;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIlayout_newline(gcroot<UI::Container^> *container) {\r
- UI::Container ^ct = *container;\r
- ct->Layout->NewLine = true;\r
-}\r
-\r
+++ /dev/null
-\r
-\r
-#pragma once\r
-\r
-#include "toolkit.h"\r
+++ /dev/null
-\r
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "controls.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-/* ------------------------------ Buttons ------------------------------ */\r
-\r
-UI_EXPORT void* __stdcall UIbutton(gcroot<UI::Container^> *container, char *label, UIcallback f, void *eventdata) {\r
- gcroot<Button^> *button = new gcroot<Button^>();\r
-\r
- EventWrapper ^evt = gcnew EventWrapper(f, eventdata);\r
- RoutedEventHandler ^handler = gcnew RoutedEventHandler(evt, &EventWrapper::Callback);\r
-\r
- *button = UI::Controls::Button(*container, gcnew String(label), handler);\r
- return button;\r
-}\r
-\r
-\r
-/* ------------------------------ Labels ------------------------------ */\r
-\r
-UI_EXPORT void* __stdcall UIlabel(gcroot<UI::Container^> *container, char *label, int alignment) {\r
- gcroot<Label^> *control = new gcroot<Label^>();\r
- *control = UI::Controls::Label(*container, gcnew String(label), alignment);\r
- return control;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UIspace(gcroot<UI::Container^> *container) {\r
- gcroot<Label^> *control = new gcroot<Label^>();\r
- *control = UI::Controls::Space(*container);\r
- return control;\r
-}\r
-\r
-UI_EXPORT void* __stdcall UIseparator(gcroot<UI::Container^> *container) {\r
- gcroot<Separator^> *control = new gcroot<Separator^>();\r
- *control = UI::Controls::Separator(*container);\r
- return control;\r
-}\r
-\r
-\r
-\r
-/* ------------------------------ Textarea ------------------------------ */\r
-\r
-UI_EXPORT void* __stdcall UItextarea(gcroot<UI::Container^> *container, char *text) {\r
- String ^str = nullptr;\r
- if (text) {\r
- str = gcnew String(text);\r
- }\r
- \r
- gcroot<UI::TextArea^> *textarea = new gcroot<UI::TextArea^>();\r
- *textarea = gcnew UI::TextArea(*container, str, true);\r
-\r
- return textarea;\r
-}\r
-\r
-UI_EXPORT void __stdcall UItextarea_set(gcroot<UI::TextArea^> *textarea, char *str) {\r
- (*textarea)->SetText(gcnew String(str));\r
-}\r
-\r
-UI_EXPORT char* __stdcall UItextarea_get(gcroot<UI::TextArea^> *textarea) {\r
- String ^str = (*textarea)->GetText();\r
- return (char*)(void*)Marshal::StringToHGlobalAnsi(str);\r
-}\r
-\r
-UI_EXPORT char* __stdcall UItextarea_getsubstr(gcroot<UI::TextArea^> *textarea, int begin, int end) {\r
- String ^str = (*textarea)->GetSubString(begin, end);\r
- return (char*)(void*)Marshal::StringToHGlobalAnsi(str);\r
-}\r
-\r
-UI_EXPORT void __stdcall UItextarea_insert(gcroot<UI::TextArea^> *textarea, int position, char *str) {\r
- // TODO\r
-}\r
-\r
-UI_EXPORT int __stdcall UItextarea_position(gcroot<UI::TextArea^> *textarea) {\r
- return (*textarea)->Position();\r
-}\r
-\r
-UI_EXPORT void __stdcall UItextarea_selection(gcroot<UI::TextArea^> *textarea, int *begin, int *end) {\r
- // TODO\r
-}\r
-\r
-UI_EXPORT int __stdcall UItextarea_length(gcroot<UI::TextArea^> *textarea) {\r
- return (*textarea)->Length();\r
-}\r
-\r
-UI_EXPORT void __stdcall UItextarea_remove(gcroot<UI::TextArea^> *textarea, int begin, int end) {\r
- // TODO\r
-}\r
-\r
-UI_EXPORT void __stdcall UIfreestr(char *str) {\r
- Marshal::FreeHGlobal((IntPtr)(void*)str);\r
-}\r
-\r
-\r
-/* ------------------------------ Textfield ------------------------------ */\r
-\r
-UI_EXPORT void* __stdcall UItextfield(gcroot<UI::Container^> *container, char *text) {\r
- String ^str = nullptr;\r
- if (text) {\r
- str = gcnew String(text);\r
- }\r
-\r
- gcroot<UI::TextArea^> *textfield = new gcroot<UI::TextArea^>();\r
- *textfield = gcnew UI::TextArea(*container, str, false);\r
-\r
- return textfield;\r
-}
\ No newline at end of file
+++ /dev/null
-\r
-\r
-#pragma once\r
-\r
-#include "toolkit.h"\r
-\r
+++ /dev/null
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "graphics.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-\r
-DrawEventWrapper::DrawEventWrapper(void *gc, UIdrawfunc callback, void *eventdata) {\r
- this->callback = callback;\r
- this->eventdata = eventdata;\r
- this->gc = gc;\r
- action = gcnew Action<int,int>(this, &DrawEventWrapper::Callback);\r
-}\r
-\r
-\r
-void DrawEventWrapper::Callback(int width, int height)\r
-{\r
- if (callback)\r
- {\r
- UI::DrawingArea ^d = (UI::DrawingArea^)PtrToObject(gc);\r
- callback(gc, eventdata, width, height);\r
- }\r
-}\r
-\r
-\r
-UI_EXPORT void* __stdcall UIdrawingarea(gcroot<UI::Container^> *container, UIdrawfunc f, void *data)\r
-{\r
- gcroot<UI::DrawingArea^> *canvas = new gcroot<UI::DrawingArea^>();\r
- *canvas = gcnew UI::DrawingArea(*container);\r
-\r
- DrawEventWrapper ^ev = gcnew DrawEventWrapper(ObjectToPtr(*canvas), f, data);\r
- (*canvas)->resizeCallback = ev->action;\r
-\r
- return canvas;\r
-}\r
-\r
-\r
-UI_EXPORT void __stdcall UIdrawingarea_redraw(gcroot<UI::DrawingArea^> *drawingarea)\r
-{\r
- (*drawingarea)->Redraw();\r
-}\r
-\r
-\r
-/* ------------------------- drawing functions ------------------------- */\r
-\r
-UI_EXPORT void __stdcall UIgraphics_color(void *g, int red, int green, int blue)\r
-{\r
- UI::DrawingArea ^d = (UI::DrawingArea^)PtrToObject(g);\r
- d->SetColor(red, green, blue);\r
-}\r
-\r
-UI_EXPORT void __stdcall UIdraw_line(void *g, int x1, int y1, int x2, int y2)\r
-{\r
- UI::DrawingArea ^d = (UI::DrawingArea^)PtrToObject(g);\r
- d->DrawLine(x1, y1, x2, y2);\r
-}\r
-\r
-UI_EXPORT void __stdcall UIdraw_rect(void *g, int x, int y, int w, int h, int fill)\r
-{\r
- UI::DrawingArea ^d = (UI::DrawingArea^)PtrToObject(g);\r
- d->DrawRect(x, y, w, h, fill ? true : false);\r
-}\r
+++ /dev/null
-#pragma once\r
-\r
-#include "toolkit.h"\r
-\r
-typedef void(*UIdrawfunc)(void *gc, void *event, int width, int height);\r
-\r
-public ref class DrawEventWrapper {\r
-public:\r
- UIdrawfunc callback = NULL;\r
- void *eventdata = NULL;\r
- void *gc;\r
- Action<int,int> ^action;\r
-\r
- DrawEventWrapper(void *gc, UIdrawfunc callback, void *eventdata);\r
-\r
- void Callback(int width, int height);\r
-};\r
+++ /dev/null
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "menu.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-UI_EXPORT void __stdcall UImenu(char *label) {\r
- UI::Application::GetInstance()->Menu->AddMenu(gcnew String(label));\r
-}\r
-\r
-UI_EXPORT void __stdcall UIsubmenu(char *label) {\r
- UI::Application::GetInstance()->Menu->AddSubMenu(gcnew String(label));\r
-}\r
-\r
-UI_EXPORT void __stdcall UIsubmenu_end() {\r
- UI::Application::GetInstance()->Menu->EndSubMenu();\r
-}\r
-\r
-\r
-UI_EXPORT void __stdcall UImenuitem(char *label, UIcallback f, void *eventdata) {\r
- ObjEventWrapper ^e = gcnew ObjEventWrapper(f, eventdata);\r
- UI::Application::GetInstance()->Menu->AddMenuItem(gcnew String(label), e->GetAction());\r
-}\r
-\r
+++ /dev/null
-\r
-#pragma once\r
-\r
-#include "toolkit.h"
\ No newline at end of file
+++ /dev/null
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by app.rc\r
+++ /dev/null
-/*\r
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
-*\r
-* Copyright 2015 Olaf Wintermann. All rights reserved.\r
-*\r
-* Redistribution and use in source and binary forms, with or without\r
-* modification, are permitted provided that the following conditions are met:\r
-*\r
-* 1. Redistributions of source code must retain the above copyright\r
-* notice, this list of conditions and the following disclaimer.\r
-*\r
-* 2. Redistributions in binary form must reproduce the above copyright\r
-* notice, this list of conditions and the following disclaimer in the\r
-* documentation and/or other materials provided with the distribution.\r
-*\r
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
-* POSSIBILITY OF SUCH DAMAGE.\r
-*/\r
-\r
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "toolbar.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-UI_EXPORT void __stdcall UItoolitem(char *name, char *label, UIcallback f, void *eventdata) {\r
- ObjEventWrapper ^e = gcnew ObjEventWrapper(f, eventdata);\r
- UI::Application::GetInstance()->ToolBar->AddToolItem(gcnew String(name), gcnew String(label), e->GetAction());\r
-}\r
-\r
-\r
-\r
-\r
-\r
-UI_EXPORT void __stdcall UItoolbar_add_default(char *name) {\r
- UI::Application::GetInstance()->ToolBar->AddDefault(gcnew String(name));\r
-}\r
-\r
+++ /dev/null
-/*\r
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
-*\r
-* Copyright 2015 Olaf Wintermann. All rights reserved.\r
-*\r
-* Redistribution and use in source and binary forms, with or without\r
-* modification, are permitted provided that the following conditions are met:\r
-*\r
-* 1. Redistributions of source code must retain the above copyright\r
-* notice, this list of conditions and the following disclaimer.\r
-*\r
-* 2. Redistributions in binary form must reproduce the above copyright\r
-* notice, this list of conditions and the following disclaimer in the\r
-* documentation and/or other materials provided with the distribution.\r
-*\r
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
-* POSSIBILITY OF SUCH DAMAGE.\r
-*/\r
-\r
-\r
-#pragma once\r
-\r
-#include "toolkit.h"\r
+++ /dev/null
-// Dies ist die Haupt-DLL.\r
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "toolkit.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-static UIcallback startup_func;\r
-void *startup_data;\r
-static UIcallback open_func;\r
-void *open_data;\r
-static UIcallback exit_func;\r
-void *exit_data;\r
-\r
-public ref class AppCallbacks : public UI::IApplicationCallbacks {\r
-public:\r
- UIcallback startupFunc = NULL;\r
- void *startupData = NULL;\r
- UIcallback openFunc = NULL;\r
- void *openData = NULL;\r
- UIcallback exitFunc = NULL;\r
- void *exitData = NULL;\r
-\r
- virtual void __clrcall OnStartup() {\r
- if (startupFunc) {\r
- startupFunc(NULL, startupData);\r
- }\r
- }\r
- virtual void __clrcall OnOpen() {\r
- if (openFunc) {\r
- openFunc(NULL, openData);\r
- }\r
- }\r
- virtual void __clrcall OnExit() {\r
- if (exitFunc) {\r
- exitFunc(NULL, exitData);\r
- }\r
- }\r
-};\r
-\r
-\r
-void* ObjectToPtr(Object ^obj) {\r
- GCHandle handle = GCHandle::Alloc(obj);\r
- IntPtr pointer = GCHandle::ToIntPtr(handle);\r
- return pointer.ToPointer();\r
-}\r
-\r
-Object^ PtrToObject(void *ptr) {\r
- GCHandle h = GCHandle::FromIntPtr(IntPtr(ptr));\r
- Object^ object = h.Target;\r
- //h.Free();\r
- return object;\r
-}\r
-\r
-// EventWrapper\r
-\r
-ObjEventWrapper::ObjEventWrapper(UIcallback callback, void *eventdata) {\r
- this->callback = callback;\r
- this->eventdata = eventdata;\r
- action = gcnew Action<IntPtr>(this, &ObjEventWrapper::Callback);\r
-}\r
-\r
-Action<IntPtr>^ ObjEventWrapper::GetAction() {\r
- return action;\r
-}\r
-\r
-void ObjEventWrapper::Callback(IntPtr uiobj) {\r
- if (callback) {\r
- callback(uiobj.ToPointer(), eventdata);\r
- }\r
-}\r
-\r
-\r
-EventWrapper::EventWrapper(UIcallback callback, void *eventdata) {\r
- this->callback = callback;\r
- this->eventdata = eventdata;\r
-}\r
-\r
-void EventWrapper::Callback(Object ^sender, RoutedEventArgs ^e) {\r
- if (callback) {\r
- callback(NULL, eventdata);\r
- }\r
-}\r
-\r
-\r
-\r
-UI_EXPORT void __stdcall UIinit(char *appname) {\r
- UI::Application ^app = UI::Application::GetInstance();\r
- app->Name = gcnew String(appname);\r
-}\r
-\r
-UI_EXPORT void __stdcall UIonstartup(UIcallback f, void *userdata) {\r
- startup_func = f;\r
- startup_data = userdata;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIonopen(UIcallback f, void *userdata) {\r
- open_func = f;\r
- open_data = userdata;\r
-}\r
-\r
-UI_EXPORT void __stdcall UIonexit(UIcallback f, void *userdata) {\r
- exit_func = f;\r
- exit_data = userdata;\r
-}\r
-\r
-UI_EXPORT void __stdcall UImain() {\r
- AppCallbacks ^ac = gcnew AppCallbacks();\r
- ac->startupFunc = startup_func;\r
- ac->startupData = startup_data;\r
- ac->openFunc = open_func;\r
- ac->openData = open_data;\r
- ac->exitFunc = exit_func;\r
- ac->exitData = exit_data;\r
- \r
- UI::Application ^app = UI::Application::GetInstance();\r
- app->callbacks = ac;\r
-\r
- Thread ^thread = app->Start();\r
- thread->Join();\r
-}\r
-\r
-UI_EXPORT void __stdcall UIshow(gcroot<UI::MainWindow^> *window) {\r
- (*window)->ShowWindow();\r
-}\r
+++ /dev/null
-// UIwrapper.h\r
-\r
-#pragma once\r
-\r
-#include <vcclr.h>\r
-\r
-using namespace System;\r
-using namespace System::Runtime::InteropServices;\r
-using namespace System::Threading;\r
-using namespace System::Windows;\r
-using namespace System::Windows::Controls;\r
-\r
-#define UI_EXPORT extern "C" __declspec(dllexport)\r
-\r
-extern "C" typedef void(*UIcallback)(void*, void*);\r
-\r
-void* ObjectToPtr(Object ^obj);\r
-Object^ PtrToObject(void *ptr);\r
-\r
-public ref class ObjEventWrapper {\r
- UIcallback callback = NULL;\r
- void *eventdata = NULL;\r
- Action<IntPtr> ^action;\r
-\r
-public:\r
- ObjEventWrapper(UIcallback callback, void *eventdata);\r
-\r
- Action<IntPtr>^ GetAction();\r
-\r
- void Callback(IntPtr uiobj);\r
-};\r
-\r
-public ref class EventWrapper {\r
- UIcallback callback = NULL;\r
- void *eventdata = NULL;\r
- \r
-\r
-public:\r
- EventWrapper(UIcallback callback, void *eventdata);\r
- void Callback(Object ^sender, RoutedEventArgs ^e);\r
-};\r
-\r
+++ /dev/null
-\r
-\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-\r
-#include "window.h"\r
-\r
-#using "UIcore.dll"\r
-\r
-UI_EXPORT void* __stdcall UIwindow(char *title, void *uiobj) {\r
- UI::MainWindow ^window = gcnew UI::MainWindow(gcnew String(title), IntPtr(uiobj));\r
- gcroot<UI::MainWindow^> *ptr = new gcroot<UI::MainWindow^>();\r
- *ptr = window;\r
- return ptr;\r
-}\r
-\r
-\r
+++ /dev/null
-\r
-\r
-#pragma once\r
-\r
-#include "toolkit.h"\r
-\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "button.h"\r
-#include "../common/object.h"\r
-\r
-UIWIDGET ui_button(UiObject *obj, char *label, ui_callback f, void *data) {\r
- UiEventData *event = NULL;\r
- ui_callback callback = NULL;\r
- if(f) {\r
- event = malloc(sizeof(UiEventData));\r
- event->obj = obj;\r
- event->callback = f;\r
- event->user_data = data;\r
- event->value = 0;\r
- callback = (ui_callback)ui_button_callback;\r
- }\r
- \r
- UiContainer *container = uic_get_current_container(obj);\r
- return UIbutton(container, label, callback, event);\r
-}\r
-\r
-void ui_button_callback(UiObject *obj, UiEventData *e) {\r
- UiEvent event;\r
- event.obj = e->obj;\r
- event.document = event.obj->ctx->document;\r
- event.window = event.obj->window;\r
- event.intval = 0;\r
- e->callback(&event, e->user_data);\r
-}\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#ifndef BUTTON_H\r
-#define BUTTON_H\r
-\r
-#include "../ui/button.h"\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT UIWIDGET __stdcall UIbutton(void *container, char *label, ui_callback f, void *event);\r
-\r
-void ui_button_callback(UiObject *obj, UiEventData *e);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* BUTTON_H */\r
-\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "container.h"\r
-#include "../common/object.h"\r
-\r
-UIWIDGET ui_vbox(UiObject *obj) {\r
- return ui_vbox_sp(obj, 0, 0);\r
-}\r
-\r
-UIWIDGET ui_hbox(UiObject *obj) {\r
- return ui_hbox_sp(obj, 0, 0);\r
-}\r
-\r
-UIWIDGET ui_vbox_sp(UiObject *obj, int margin, int spacing) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- \r
- UIWIDGET vbox = UIvbox(ct, margin, spacing);\r
- \r
- UiObject *newobj = uic_object_new(obj, vbox);\r
- newobj->container = (UiContainer*)vbox;\r
- uic_obj_add(obj, newobj);\r
- \r
- return vbox;\r
-}\r
-\r
-UIWIDGET ui_hbox_sp(UiObject *obj, int margin, int spacing) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- \r
- UIWIDGET hbox = UIhbox(ct, margin, spacing);\r
- \r
- UiObject *newobj = uic_object_new(obj, hbox);\r
- newobj->container = (UiContainer*)hbox;\r
- uic_obj_add(obj, newobj);\r
- \r
- return hbox;\r
-}\r
-\r
-UIWIDGET ui_grid(UiObject *obj) {\r
- return ui_grid_sp(obj, 0, 0, 0);\r
-}\r
-\r
-UIWIDGET ui_grid_sp(UiObject *obj, int margin, int columnspacing, int rowspacing) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- \r
- UIWIDGET grid = UIgrid(ct, margin, columnspacing, rowspacing);\r
- \r
- UiObject *newobj = uic_object_new(obj, grid);\r
- newobj->container = (UiContainer*)grid;\r
- uic_obj_add(obj, newobj);\r
- \r
- return grid;\r
-}\r
-\r
-UIWIDGET ui_scrolledwindow(UiObject *obj) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- \r
- UIWIDGET scrolledwindow = UIscrolledwindow(ct);\r
- \r
- UiObject *newobj = uic_object_new(obj, scrolledwindow);\r
- newobj->container = (UiContainer*)scrolledwindow;\r
- uic_obj_add(obj, newobj);\r
- \r
- return scrolledwindow;\r
-}\r
-\r
-/*\r
- * TODO: sidebar\r
- */\r
-\r
-UIWIDGET ui_tabview(UiObject *obj) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- \r
- UIWIDGET tabview = UItabview(ct);\r
- \r
- UiObject *newobj = uic_object_new(obj, tabview);\r
- newobj->container = (UiContainer*)tabview;\r
- uic_obj_add(obj, newobj);\r
- \r
- return tabview;\r
-}\r
-\r
-void ui_tab(UiObject *obj, char *title) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UItab(ct, title);\r
-}\r
-\r
-\r
-/*\r
- * -------------------- Layout Functions --------------------\r
- * \r
- * functions for setting layout attributes for the current container\r
- *\r
- */\r
-\r
-void ui_layout_fill(UiObject *obj, UiBool fill) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UIlayout_fill(ct, fill);\r
-}\r
-\r
-void ui_layout_hexpand(UiObject *obj, UiBool expand) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UIlayout_hexpand(ct, expand);\r
-}\r
-\r
-void ui_layout_vexpand(UiObject *obj, UiBool expand) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UIlayout_vexpand(ct, expand);\r
-}\r
-\r
-void ui_layout_gridwidth(UiObject *obj, int width) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UIlayout_gridwidth(ct, width);\r
-}\r
-\r
-void ui_newline(UiObject *obj) {\r
- UiContainer *ct = uic_get_current_container(obj);\r
- UIlayout_newline(ct);\r
-}
\ No newline at end of file
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#ifndef CONTAINER_H\r
-#define CONTAINER_H\r
-\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT void* __stdcall UIvbox(UiContainer *parent, int margin, int spacing);\r
-UI_IMPORT void* __stdcall UIhbox(UiContainer *parent, int margin, int spacing);\r
-UI_IMPORT void* __stdcall UIgrid(UiContainer *parent, int margin, int columnspacing, int rowspacing);\r
-\r
-UI_IMPORT void* __stdcall UIscrolledwindow(UiContainer *parent);\r
-\r
-UI_IMPORT void* __stdcall UItabview(UiContainer *parent);\r
-UI_IMPORT void __stdcall UItab(UiContainer *container, char *label);\r
-\r
-UI_IMPORT void __stdcall UIlayout_fill(UiContainer *container, int fill);\r
-UI_IMPORT void __stdcall UIlayout_hexpand(UiContainer *container, int expand);\r
-UI_IMPORT void __stdcall UIlayout_vexpand(UiContainer *container, int expand);\r
-UI_IMPORT void __stdcall UIlayout_gridwidth(UiContainer *container, int width);\r
-\r
-UI_IMPORT void __stdcall UIlayout_newline(UiContainer *container);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* CONTAINER_H */\r
-\r
+++ /dev/null
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "graphics.h"\r
-#include "container.h"\r
-#include "../../ucx/mempool.h"\r
-#include "../common/context.h"\r
-#include "../common/object.h"\r
-\r
-UIWIDGET ui_drawingarea(UiObject *obj, ui_drawfunc f, void *userdata) {\r
- UiDrawEvent *eventdata = NULL;\r
- ui_draw_callback cb = NULL;\r
- if(f) {\r
- eventdata = malloc(sizeof(UiDrawEvent));\r
- eventdata->obj = obj;\r
- eventdata->draw = f;\r
- eventdata->userdata = userdata;\r
- cb = ui_draw_event;\r
- }\r
- \r
- UiContainer *container = uic_get_current_container(obj);\r
- return UIdrawingarea(container, cb, eventdata);\r
-}\r
-\r
-void ui_draw_event(void *gc, UiDrawEvent *event, int width, int height) {\r
- UiEvent e;\r
- e.obj = event->obj;\r
- e.window = e.obj->window;\r
- e.document = e.obj->ctx->document;\r
- e.eventdata = NULL;\r
- e.intval = 0;\r
- \r
- UiWPFGraphics g;\r
- g.g.width = width;\r
- g.g.height = height;\r
- g.gc = gc;\r
- \r
- event->draw(&e, &g.g, event->userdata);\r
-}\r
-\r
-\r
-void ui_drawingarea_mousehandler(UiObject *obj, UIWIDGET widget, ui_callback f, void *u) {\r
- \r
-}\r
-\r
-void ui_drawingarea_getsize(UIWIDGET drawingarea, int *width, int *height) {\r
- \r
-}\r
-\r
-void ui_drawingarea_redraw(UIWIDGET drawingarea) {\r
- UIdrawingarea_redraw(drawingarea);\r
-}\r
-\r
-\r
-/* ------------------------- drawing functions ------------------------- */\r
-\r
-void ui_graphics_color(UiGraphics *g, int red, int green, int blue) {\r
- UiWPFGraphics *wg = (UiWPFGraphics*)g;\r
- UIgraphics_color(wg->gc, red, green, blue);\r
-}\r
-\r
-void ui_draw_line(UiGraphics *g, int x1, int y1, int x2, int y2) {\r
- UiWPFGraphics *wg = (UiWPFGraphics*)g;\r
- UIdraw_line(wg->gc, x1, y1, x2, y2);\r
-}\r
-\r
-void ui_draw_rect(UiGraphics *g, int x, int y, int w, int h, int fill) {\r
- UiWPFGraphics *wg = (UiWPFGraphics*)g;\r
- UIdraw_rect(wg->gc, x, y, w, h, fill);\r
-}\r
-\r
-void ui_draw_text(UiGraphics *g, int x, int y, UiTextLayout *text) {\r
- \r
-}\r
+++ /dev/null
-/*\r
- * To change this license header, choose License Headers in Project Properties.\r
- * To change this template file, choose Tools | Templates\r
- * and open the template in the editor.\r
- */\r
-\r
-/* \r
- * File: graphics.h\r
- * Author: Olaf\r
- *\r
- * Created on 22. Januar 2017, 18:34\r
- */\r
-\r
-#ifndef GRAPHICS_H\r
-#define GRAPHICS_H\r
-\r
-#include "toolkit.h"\r
-#include "../ui/graphics.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
- \r
-typedef struct UiDrawEvent {\r
- UiObject *obj;\r
- ui_drawfunc draw;\r
- void *userdata;\r
-} UiDrawEvent;\r
-\r
-typedef struct UiWPFGraphics {\r
- UiGraphics g;\r
- void *gc;\r
-} UiWPFGraphics;\r
-\r
-typedef void(*ui_draw_callback)(void *gc, UiDrawEvent *event, int width, int height);\r
- \r
-UI_IMPORT UIWIDGET __stdcall UIdrawingarea(void *container, ui_draw_callback f, void *userdata);\r
-\r
-UI_IMPORT void __stdcall UIdrawingarea_redraw(UIWIDGET drawingarea);\r
-\r
-void ui_draw_event(void *gc, UiDrawEvent *event, int width, int height);\r
-\r
-// drawing functions\r
-\r
-UI_IMPORT void __stdcall UIgraphics_color(UiGraphics *g, int red, int green, int blue);\r
-UI_IMPORT void __stdcall UIdraw_line(UiGraphics *g, int x1, int y1, int x2, int y2);\r
-UI_IMPORT void __stdcall UIdraw_rect(UiGraphics *g, int x, int y, int w, int h, int fill);\r
-//void UIdraw_text(UiGraphics *g, int x, int y, UiTextLayout *text);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* GRAPHICS_H */\r
-\r
+++ /dev/null
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "label.h"\r
-#include "container.h"\r
-#include "../../ucx/mempool.h"\r
-#include "../common/context.h"\r
-#include "../common/object.h"\r
-\r
-UIWIDGET ui_label(UiObject *obj, char *label) {\r
- return UIlabel(uic_get_current_container(obj), label, 2);\r
-}\r
-\r
-UIWIDGET ui_llabel(UiObject *obj, char *label) {\r
- return UIlabel(uic_get_current_container(obj), label, 0);\r
-}\r
-\r
-UIWIDGET ui_rlabel(UiObject *obj, char *label) {\r
- return UIlabel(uic_get_current_container(obj), label, 1);\r
-}\r
-\r
-UIWIDGET ui_space(UiObject *obj) {\r
- return UIspace(uic_get_current_container(obj));\r
-}\r
-\r
-UIWIDGET ui_separator(UiObject *obj) {\r
- return UIseparator(uic_get_current_container(obj));\r
-}\r
+++ /dev/null
-/* \r
- * File: label.h\r
- * Author: Olaf\r
- *\r
- * Created on 19. Januar 2016, 18:12\r
- */\r
-\r
-#ifndef LABEL_H\r
-#define LABEL_H\r
-\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT UIWIDGET __stdcall UIlabel(void *container, char *label, int alignment);\r
-\r
-UI_IMPORT UIWIDGET __stdcall UIspace(void *container);\r
-\r
-UI_IMPORT UIWIDGET __stdcall UIseparator(void *container);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* LABEL_H */\r
-\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2014 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <unistd.h>\r
-\r
-#include "menu.h"\r
-\r
-void ui_menu(char *label) {\r
- UImenu(label);\r
-}\r
-\r
-void ui_submenu(char *label) {\r
- UIsubmenu(label);\r
-}\r
-\r
-void ui_submenu_end() {\r
- UIsubmenu_end();\r
-}\r
-\r
-void ui_menuitem(char *label, ui_callback f, void *userdata) {\r
- UIcallback cb = NULL;\r
- void *e = NULL;\r
- if (f) {\r
- UiEventData *event = malloc(sizeof(UiEventData));\r
- event->obj = NULL;\r
- event->user_data = userdata;\r
- event->callback = f;\r
- event->value = 0;\r
- cb = (UIcallback)ui_obj_callback;\r
- e = event;\r
- }\r
- \r
- UImenuitem(label, cb, e);\r
-}\r
-\r
-\r
-void ui_obj_callback(UiObject *obj, UiEventData *e) {\r
- UiEvent event;\r
- event.obj = obj;\r
- event.window = obj->window;\r
- event.intval = 0;\r
- event.eventdata = NULL;\r
- event.document = obj->ctx->document;\r
- e->callback(&event, e->user_data);\r
-}\r
+++ /dev/null
-/* \r
- * File: menu.h\r
- * Author: Olaf\r
- *\r
- * Created on 25. Januar 2015, 13:37\r
- */\r
-\r
-#ifndef MENU_H\r
-#define MENU_H\r
-\r
-#include "../ui/menu.h"\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT void __stdcall UImenu(char *label);\r
-UI_IMPORT void __stdcall UIsubmenu(char *label);\r
-UI_IMPORT void __stdcall UIsubmenu_end();\r
-UI_IMPORT void __stdcall UImenuitem(char *label, UIcallback f, void *udata);\r
-\r
-\r
-\r
-void ui_obj_callback(UiObject *obj, UiEventData *e);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* MENU_H */\r
-\r
+++ /dev/null
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-#
-# Copyright 2012 Olaf Wintermann. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-WPF_SRC_DIR = ui/wpf/
-WPF_OBJPRE = $(OBJ_DIR)$(WPF_SRC_DIR)
-
-WPFOBJ = toolkit.o
-WPFOBJ += window.o
-WPFOBJ += container.o
-WPFOBJ += menu.o
-WPFOBJ += toolbar.o
-WPFOBJ += button.o
-WPFOBJ += label.o
-WPFOBJ += text.o
-WPFOBJ += graphics.o
-
-TOOLKITOBJS += $(WPFOBJ:%=$(WPF_OBJPRE)%)
-TOOLKITSOURCE += $(WPFOBJ:%.o=wpf/%.c)
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "text.h"\r
-\r
-UIWIDGET ui_textarea(UiObject *obj, UiText *value) {\r
- UiContainer *container = uic_get_current_container(obj); \r
- UIWIDGET textarea = UItextarea(container, value ? value->value : NULL);\r
- \r
- if(value) {\r
- value->get = ui_textarea_get;\r
- value->set = ui_textarea_set;\r
- value->getsubstr = ui_textarea_getsubstr;\r
- value->insert = ui_textarea_insert;\r
- value->position = ui_textarea_position;\r
- value->selection = ui_textarea_selection;\r
- value->length = ui_textarea_length;\r
- value->remove = ui_textarea_remove;\r
- value->value = NULL;\r
- value->obj = textarea;\r
- if(!value->undomgr) {\r
- //value->undomgr = ;\r
- }\r
- }\r
- \r
- return textarea;\r
-}\r
-\r
-UIWIDGET ui_textarea_nv(UiObject *obj, char *varname) {\r
- UiVar *var = uic_connect_var(obj->ctx, varname, UI_VAR_TEXT);\r
- if(var) {\r
- UiText *value = var->value;\r
- return ui_textarea(obj, value);\r
- } else {\r
- // TODO: error\r
- }\r
- return NULL;\r
-}\r
-\r
-char* ui_textarea_get(UiText *text) {\r
- if(text->value) {\r
- UIfreestr(text->value);\r
- }\r
- text->value = UItextarea_get(text->obj);\r
- return text->value;\r
-}\r
-\r
-void ui_textarea_set(UiText *text, char *str) {\r
- if(text->value) {\r
- UIfreestr(text->value);\r
- text->value = NULL;\r
- }\r
- UItextarea_set(text->obj, str);\r
-}\r
-\r
-char* ui_textarea_getsubstr(UiText *text, int begin, int end) {\r
- if(text->value) {\r
- UIfreestr(text->value);\r
- }\r
- text->value = UItextarea_getsubstr(text->obj, begin, end);\r
- return text->value;\r
-}\r
-\r
-void ui_textarea_insert(UiText *text, int pos, char *str) {\r
- if(text->value) {\r
- UIfreestr(text->value);\r
- text->value = NULL;\r
- }\r
- UItextarea_insert(text->obj, pos, str);\r
-}\r
-\r
-int ui_textarea_position(UiText *text) {\r
- return UItextarea_position(text->obj);\r
-}\r
-\r
-void ui_textarea_selection(UiText *text, int *begin, int *end) {\r
- UItextarea_selection(text->obj, begin, end);\r
-}\r
-\r
-int ui_textarea_length(UiText *text) {\r
- return UItextarea_length(text->obj);\r
-}\r
-\r
-void ui_textarea_remove(UiText *text, int begin, int end) {\r
- if(text->value) {\r
- UIfreestr(text->value);\r
- text->value = NULL;\r
- }\r
- UItextarea_remove(text->obj, begin, end);\r
-}\r
-\r
-\r
-UIWIDGET ui_textfield(UiObject *obj, UiString *value) {\r
- UiContainer *container = uic_get_current_container(obj); \r
- UIWIDGET textfield = UItextfield(container, value ? value->value : NULL);\r
- \r
- if(value) {\r
- // TODO\r
- }\r
- return textfield;\r
-}\r
-\r
-UIWIDGET ui_textfield_nv(UiObject *obj, char *varname) {\r
- UiVar *var = uic_connect_var(obj->ctx, varname, UI_VAR_STRING);\r
- if(var) {\r
- UiString *value = var->value;\r
- return ui_textfield(obj, value);\r
- } else {\r
- // TODO: error\r
- }\r
- return NULL;\r
-}\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#ifndef TEXT_H\r
-#define TEXT_H\r
-\r
-#include "../ui/text.h"\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT UIWIDGET __stdcall UItextarea(void *container, char *text);\r
-\r
-char* ui_textarea_get(UiText *text);\r
-void ui_textarea_set(UiText *text, char *str);\r
-char* ui_textarea_getsubstr(UiText *text, int begin, int end);\r
-void ui_textarea_insert(UiText *text, int pos, char *str);\r
-int ui_textarea_position(UiText *text);\r
-void ui_textarea_selection(UiText *text, int *begin, int *end);\r
-int ui_textarea_length(UiText *text);\r
-void ui_textarea_remove(UiText *text, int begin, int end);\r
-\r
-UI_IMPORT void __stdcall UItextarea_set(UIWIDGET textarea, char *str);\r
-UI_IMPORT char* __stdcall UItextarea_get(UIWIDGET textarea);\r
-UI_IMPORT char* __stdcall UItextarea_getsubstr(UIWIDGET textarea, int begin, int end);\r
-UI_IMPORT void __stdcall UItextarea_insert(UIWIDGET textarea, int pos, char *str);\r
-UI_IMPORT int __stdcall UItextarea_position(UIWIDGET textarea);\r
-UI_IMPORT void __stdcall UItextarea_selection(UIWIDGET textarea, int *begin, int *end);\r
-UI_IMPORT int __stdcall UItextarea_length(UIWIDGET textarea);\r
-UI_IMPORT void __stdcall UItextarea_remove(UIWIDGET textarea, int begin, int end);\r
-\r
-UI_IMPORT void __stdcall UIfreestr(char *str);\r
-\r
-\r
-UI_IMPORT UIWIDGET __stdcall UItextfield(void *container, char *text);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* TEXT_H */\r
-\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include "toolbar.h"\r
-#include "menu.h"\r
-#include "../common/context.h"\r
-\r
-void ui_toolitem(char *name, char *label, ui_callback f, void *udata) {\r
- UIcallback cb = NULL;\r
- void *e = NULL;\r
- if (f) {\r
- UiEventData *event = malloc(sizeof(UiEventData));\r
- event->obj = NULL;\r
- event->user_data = udata;\r
- event->callback = f;\r
- event->value = 0;\r
- cb = (UIcallback)ui_obj_callback;\r
- e = event;\r
- }\r
- \r
- UItoolitem(name, label, cb, e);\r
-}\r
-\r
-void ui_toolbar_add_default(char *name) {\r
- UItoolbar_add_default(name);\r
-}\r
-\r
-\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#ifndef TOOLBAR_H\r
-#define TOOLBAR_H\r
-\r
-#include "../ui/toolbar.h"\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT void __stdcall UItoolitem(char *name, char *label, UIcallback callback, void *eventdata);\r
-\r
-\r
-UI_IMPORT void __stdcall UItoolbar_add_default(char *name);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* TOOLBAR_H */\r
-\r
+++ /dev/null
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2014 Olaf Wintermann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "toolkit.h"
-
-
-void ui_init(char *appname, int argc, char **argv) {
- UIinit(appname);
-}
-
-void ui_onstartup(ui_callback f, void *userdata) {
- UIonstartup(f, userdata);
-}
-
-void ui_onopen(ui_callback f, void *userdata) {
- UIonopen(f, userdata);
-}
-
-void ui_onexit(ui_callback f, void *userdata) {
- UIonexit(f, userdata);
-}
-
-void ui_main() {
- UImain();
-}
-
-void ui_show(UiObject *obj) {
- UIshow(obj->widget);
-}
-
-void ui_set_enabled(UIWIDGET widget, int enabled) {
-
-}
-
-void ui_set_show_all(UIWIDGET widget, int value) {
-
-}
\ No newline at end of file
+++ /dev/null
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2014 Olaf Wintermann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TOOLKIT_H
-#define TOOLKIT_H
-
-#include <inttypes.h>
-#include "../ui/toolkit.h"
-#include "../common/context.h"
-#include "../common/object.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UI_IMPORT __declspec(dllimport)
-__declspec(dllimport) int __stdcall myfunc(char *str);
-
-typedef struct UiEventData {
- UiObject *obj;
- ui_callback callback;
- void *user_data;
- int value;
-} UiEventData;
-
-typedef void(*UIcallback)(void*,void*);
-
-UI_IMPORT void __stdcall UIinit(char *appname);
-
-UI_IMPORT void __stdcall UIonstartup(ui_callback f, void *userdata);
-UI_IMPORT void __stdcall UIonopen(ui_callback f, void *userdata);
-UI_IMPORT void __stdcall UIonexit(ui_callback f, void *userdata);
-UI_IMPORT void __stdcall UImain();
-UI_IMPORT void __stdcall UIshow(UIWIDGET widget);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TOOLKIT_H */
-
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-\r
-#include "../ui/window.h"\r
-#include "../ui/properties.h"\r
-#include "../common/context.h"\r
-\r
-#include "window.h"\r
-\r
-UiObject* ui_window(char *title, void *window_data) {\r
- UcxMempool *mp = ucx_mempool_new(256);\r
- UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); \r
- obj->widget = UIwindow(title, obj);\r
- obj->ctx = uic_context(obj, mp);\r
- obj->container = (UiContainer*)obj->widget;\r
- //obj->window = window_data;\r
- //obj->next = NULL;\r
- \r
- return obj;\r
-}\r
+++ /dev/null
-/*\r
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\r
- *\r
- * Copyright 2015 Olaf Wintermann. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#ifndef WINDOW_H\r
-#define WINDOW_H\r
-\r
-#include "toolkit.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-UI_IMPORT UIWIDGET __stdcall UIwindow(char *title, void *uiobj);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* WINDOW_H */\r
-\r