diff options
| author | j-p <jp.bruyere@live.be> | 2018-12-11 23:20:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-11 23:20:54 +0100 |
| commit | eef19b533a0e2ce17f2762d3acfc5990496eaaa0 (patch) | |
| tree | 6f09101bd8097c1a4ca6a216597bb5d4941453fa | |
| parent | 65820f61457262b631eba35283c55135aecbc5f2 (diff) | |
| parent | f6732851fe211e22ff91716ac83dffc0cf09d620 (diff) | |
Merge pull request #44 from jpbruyere/xlib
Xlib
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | Crow.NetStd.sln | 54 | ||||
| -rw-r--r-- | Crow.OpenTK.nuspec | 62 | ||||
| -rw-r--r-- | Crow.Test/Crow.Test.csproj | 87 | ||||
| -rw-r--r-- | Crow.Test/ExpectedOutputs/0.png | bin | 1733 -> 0 bytes | |||
| -rw-r--r-- | Crow.Test/ExpectedOutputs/1.png | bin | 2205 -> 0 bytes | |||
| -rw-r--r-- | Crow.Test/ExpectedOutputs/3.png | bin | 7850 -> 0 bytes | |||
| -rw-r--r-- | Crow.Test/ExpectedOutputs/4.png | bin | 94681 -> 0 bytes | |||
| -rw-r--r-- | Crow.Test/ExpectedOutputs/5.png | bin | 11456 -> 0 bytes | |||
| -rwxr-xr-x | Crow.Test/Interfaces/0.crow | 2 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/1.crow | 7 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/2.crow | 7 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/3.crow | 84 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/4.crow | 81 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/5.crow | 64 | ||||
| -rwxr-xr-x | Crow.Test/Interfaces/testButton.crow | 322 | ||||
| -rw-r--r-- | Crow.Test/Test.cs | 72 | ||||
| -rw-r--r-- | Crow.Test/packages.config | 4 | ||||
| -rw-r--r-- | Crow.csproj | 399 | ||||
| -rw-r--r-- | Crow.sln | 8 | ||||
| -rw-r--r-- | Crow/Crow.NetStd.csproj | 60 | ||||
| -rw-r--r-- | Crow/Crow.csproj | 183 | ||||
| -rw-r--r-- | Crow/Crow.dll.config (renamed from Crow.dll.config) | 1 | ||||
| -rw-r--r-- | Crow/Default.style (renamed from Default.style) | 86 | ||||
| -rwxr-xr-x | Crow/Icons/IconAlerte.svg (renamed from Images/Icons/IconAlerte.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/Icon_no.svg (renamed from Icons/Icon_no.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/assembly.svg (renamed from Icons/assembly.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/checkbox.svg (renamed from Images/Icons/checkbox.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/compiler_error.svg (renamed from Icons/compiler_error.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/compiler_warning.svg (renamed from Icons/compiler_warning.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/compiler_warning_orange.svg (renamed from Icons/compiler_warning_orange.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/copy-file.svg (renamed from Icons/copy-file.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/crow.svg (renamed from Images/Icons/crow.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/crowproj.svg (renamed from Icons/crowproj.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/exit-symbol.svg (renamed from Icons/exit-symbol.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/exit2.svg (renamed from Images/Icons/exit2.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/expandable.svg (renamed from Images/Icons/expandable.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/file.svg (renamed from Icons/file.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/folder.svg (renamed from Icons/folder.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/frame.svg (renamed from Icons/frame.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/iconInfo.svg (renamed from Images/Icons/iconInfo.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/level-up.svg (renamed from Icons/level-up.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/maximize.svg (renamed from Images/Icons/maximize.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/minimize.svg (renamed from Images/Icons/minimize.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/normalize.svg (renamed from Images/Icons/normalize.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/open-file.svg (renamed from Icons/open-file.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/paste-on-document.svg (renamed from Icons/paste-on-document.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/project.svg (renamed from Icons/project.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/projectRef.svg (renamed from Icons/projectRef.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/question.svg (renamed from Icons/question.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/radiobutton.svg (renamed from Images/Icons/radiobutton.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/scissors.svg (renamed from Icons/scissors.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/updown.svg (renamed from Images/Icons/updown.svg) | 0 | ||||
| -rw-r--r-- | Crow/Icons/warning_construction.svg (renamed from Icons/warning_construction.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/Cursors/arrow (renamed from Images/Icons/Cursors/arrow) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/bottom_left_corner (renamed from Images/Icons/Cursors/bottom_left_corner) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/bottom_right_corner (renamed from Images/Icons/Cursors/bottom_right_corner) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/cross (renamed from Images/Icons/Cursors/cross) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/hand (renamed from Images/Icons/Cursors/hand) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/help (renamed from Images/Icons/Cursors/help) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/ibeam (renamed from Images/Icons/Cursors/ibeam) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/move (renamed from Images/Icons/Cursors/move) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/sb_h_double_arrow (renamed from Images/Icons/Cursors/sb_h_double_arrow) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/sb_v_double_arrow (renamed from Images/Icons/Cursors/sb_v_double_arrow) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/top_left_corner (renamed from Images/Icons/Cursors/top_left_corner) | bin | 69120 -> 69120 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/Cursors/top_right_corner (renamed from Images/Icons/Cursors/top_right_corner) | bin | 69120 -> 69120 bytes | |||
| -rwxr-xr-x | Crow/Images/Icons/buttonB.svg (renamed from Images/Icons/buttonB.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/crow.png (renamed from Images/Icons/crow.png) | bin | 8452 -> 8452 bytes | |||
| -rw-r--r-- | Crow/Images/Icons/exit.svg (renamed from Images/Icons/exit.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/file.svg (renamed from Images/Icons/file.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/folder.svg (renamed from Images/Icons/folder.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/member.svg (renamed from Images/Icons/member.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/Icons/tetra.png (renamed from Images/Icons/tetra.png) | bin | 10133 -> 10133 bytes | |||
| -rw-r--r-- | Crow/Images/button.svg (renamed from Images/button.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/crow0.svg (renamed from Images/crow0.svg) | 0 | ||||
| -rwxr-xr-x | Crow/Images/meter.svg (renamed from Images/meter.svg) | 0 | ||||
| -rw-r--r-- | Crow/Images/screenshot.png (renamed from Images/screenshot.png) | bin | 164256 -> 164256 bytes | |||
| -rw-r--r-- | Crow/Images/screenshot2.png (renamed from Images/screenshot2.png) | bin | 120135 -> 120135 bytes | |||
| -rwxr-xr-x | Crow/Templates/ArrowBut.template | 9 | ||||
| -rwxr-xr-x | Crow/Templates/Button.template (renamed from Templates/Button.template) | 10 | ||||
| -rwxr-xr-x | Crow/Templates/CheckBox.template (renamed from Templates/CheckBox.template) | 2 | ||||
| -rw-r--r-- | Crow/Templates/CheckBox2.template (renamed from Templates/CheckBox2.template) | 2 | ||||
| -rwxr-xr-x | Crow/Templates/ColorPicker.template (renamed from Templates/ColorPicker.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/ComboBox.template (renamed from Templates/ComboBox.template) | 8 | ||||
| -rw-r--r-- | Crow/Templates/ContextMenu.template (renamed from Templates/ContextMenu.template) | 10 | ||||
| -rwxr-xr-x | Crow/Templates/DefaultItem.template (renamed from Templates/DefaultItem.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/DirectoryView.template (renamed from Templates/DirectoryView.template) | 6 | ||||
| -rwxr-xr-x | Crow/Templates/DockWindow.template (renamed from Templates/DockWindow.template) | 11 | ||||
| -rwxr-xr-x | Crow/Templates/Expandable.template (renamed from Templates/Expandable.template) | 8 | ||||
| -rw-r--r-- | Crow/Templates/FileDialog.template (renamed from Templates/FileDialog.template) | 4 | ||||
| -rw-r--r-- | Crow/Templates/FileItems.template (renamed from Templates/FileItems.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/GroupBox.template (renamed from Templates/GroupBox.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/HScrollBar.template | 20 | ||||
| -rwxr-xr-x | Crow/Templates/ListBox.template (renamed from Templates/ListBox.template) | 0 | ||||
| -rw-r--r-- | Crow/Templates/Menu.template (renamed from Templates/Menu.template) | 0 | ||||
| -rw-r--r-- | Crow/Templates/MenuItem.template (renamed from Templates/MenuItem.template) | 9 | ||||
| -rw-r--r-- | Crow/Templates/MessageBox.template (renamed from Templates/MessageBox.template) | 6 | ||||
| -rwxr-xr-x | Crow/Templates/Popper.template (renamed from Templates/Popper.template) | 2 | ||||
| -rwxr-xr-x | Crow/Templates/RadioButton.template (renamed from Templates/RadioButton.template) | 2 | ||||
| -rwxr-xr-x | Crow/Templates/ScrollBar.template | 20 | ||||
| -rw-r--r-- | Crow/Templates/ScrollingListBox.template (renamed from Templates/ScrollingListBox.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/Slider.template (renamed from Templates/Slider.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/Spinner.template (renamed from Templates/Spinner.template) | 0 | ||||
| -rw-r--r-- | Crow/Templates/TabItem.template (renamed from Templates/TabItem.template) | 6 | ||||
| -rwxr-xr-x | Crow/Templates/ToolWindow.template (renamed from Templates/ToolWindow.template) | 2 | ||||
| -rw-r--r-- | Crow/Templates/Tooltip.template | 4 | ||||
| -rw-r--r-- | Crow/Templates/TreeView.template (renamed from Templates/TreeView.template) | 3 | ||||
| -rwxr-xr-x | Crow/Templates/Window.template (renamed from Templates/Window.template) | 10 | ||||
| -rwxr-xr-x | Crow/Templates/imgItem.template (renamed from Templates/imgItem.template) | 0 | ||||
| -rwxr-xr-x | Crow/Templates/treeList.template (renamed from Templates/treeList.template) | 0 | ||||
| -rw-r--r-- | Crow/crow.key (renamed from crow.key) | bin | 596 -> 596 bytes | |||
| -rw-r--r-- | Crow/src/BmpPicture.cs (renamed from src/BmpPicture.cs) | 19 | ||||
| -rw-r--r-- | Crow/src/BubblingMouseButtonEventArgs.cs (renamed from src/BubblingMouseButtonEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Cairo/CairoHelpers.cs (renamed from src/Cairo/CairoHelpers.cs) | 6 | ||||
| -rw-r--r-- | Crow/src/Colors.cs (renamed from src/Colors.cs) | 19 | ||||
| -rw-r--r-- | Crow/src/Command.cs (renamed from src/Command.cs) | 6 | ||||
| -rw-r--r-- | Crow/src/CompilerServices/CompilerServices.cs (renamed from src/CompilerServices/CompilerServices.cs) | 71 | ||||
| -rw-r--r-- | Crow/src/Configuration.cs (renamed from src/Configuration.cs) | 21 | ||||
| -rw-r--r-- | Crow/src/CrowThread.cs (renamed from src/CrowThread.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/DragDropEventArgs.cs (renamed from src/DragDropEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/DynAttribute.cs (renamed from src/DynAttribute.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Enums.cs (renamed from src/Enums.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/ExtensionsMethods.cs (renamed from src/ExtensionsMethods.cs) | 3 | ||||
| -rw-r--r-- | Crow/src/Fill/Fill.cs (renamed from src/Fill/Fill.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Font.cs (renamed from src/Font.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Gradient.cs (renamed from src/Gradient.cs) | 5 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Border.cs (renamed from src/GraphicObjects/Border.cs) | 12 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Button.cs (renamed from src/GraphicObjects/Button.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/CheckBox.cs (renamed from src/GraphicObjects/CheckBox.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ColorPicker.cs (renamed from src/GraphicObjects/ColorPicker.cs) | 18 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ColorSelector.cs (renamed from src/GraphicObjects/ColorSelector.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ComboBox.cs (renamed from src/GraphicObjects/ComboBox.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Container.cs (renamed from src/GraphicObjects/Container.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/DataSourceChangeEventArgs.cs (renamed from src/GraphicObjects/DataSourceChangeEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/DirectoryView.cs (renamed from src/GraphicObjects/DirectoryView.cs) | 8 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/DockStack.cs (renamed from src/GraphicObjects/DockStack.cs) | 126 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/DockWindow.cs (renamed from src/GraphicObjects/DockWindow.cs) | 30 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Expandable.cs (renamed from src/GraphicObjects/Expandable.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/FileDialog.cs (renamed from src/GraphicObjects/FileDialog.cs) | 12 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/GenericStack.cs (renamed from src/GraphicObjects/GenericStack.cs) | 10 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/GraduatedSlider.cs (renamed from src/GraphicObjects/GraduatedSlider.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/GraphicObject.cs (renamed from src/GraphicObjects/GraphicObject.cs) | 270 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Grid.cs (renamed from src/GraphicObjects/Grid.cs) | 6 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Group.cs (renamed from src/GraphicObjects/Group.cs) | 8 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/GroupBox.cs (renamed from src/GraphicObjects/GroupBox.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/HorizontalStack.cs (renamed from src/GraphicObjects/HorizontalStack.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/HueSelector.cs (renamed from src/GraphicObjects/HueSelector.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ILayoutable.cs (renamed from src/GraphicObjects/ILayoutable.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/IMLContainer.cs (renamed from src/GraphicObjects/IMLContainer.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/IValueChange.cs (renamed from src/GraphicObjects/IValueChange.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Image.cs (renamed from src/GraphicObjects/Image.cs) | 14 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Label.cs (renamed from src/GraphicObjects/Label.cs) | 27 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ListBox.cs (renamed from src/GraphicObjects/ListBox.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Menu.cs (renamed from src/GraphicObjects/Menu.cs) | 13 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/MenuItem.cs (renamed from src/GraphicObjects/MenuItem.cs) | 25 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/MessageBox.cs (renamed from src/GraphicObjects/MessageBox.cs) | 8 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/NumericControl.cs (renamed from src/GraphicObjects/NumericControl.cs) | 10 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Popper.cs (renamed from src/GraphicObjects/Popper.cs) | 10 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/PrivateContainer.cs (renamed from src/GraphicObjects/PrivateContainer.cs) | 9 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ProgressBar.cs (renamed from src/GraphicObjects/ProgressBar.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/RadioButton.cs (renamed from src/GraphicObjects/RadioButton.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/SaturationValueSelector.cs (renamed from src/GraphicObjects/SaturationValueSelector.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ScrollBar.cs (renamed from src/GraphicObjects/ScrollBar.cs) | 11 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Scroller.cs (renamed from src/GraphicObjects/Scroller.cs) | 14 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/ScrollingObject.cs (renamed from src/GraphicObjects/ScrollingObject.cs) | 18 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Shape.cs (renamed from src/GraphicObjects/Shape.cs) | 62 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Slider.cs (renamed from src/GraphicObjects/Slider.cs) | 15 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Spinner.cs (renamed from src/GraphicObjects/Spinner.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Splitter.cs (renamed from src/GraphicObjects/Splitter.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TabItem.cs (renamed from src/GraphicObjects/TabItem.cs) | 40 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TabView.cs (renamed from src/GraphicObjects/TabView.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TemplatedContainer.cs (renamed from src/GraphicObjects/TemplatedContainer.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TemplatedControl.cs (renamed from src/GraphicObjects/TemplatedControl.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TemplatedGroup.cs (renamed from src/GraphicObjects/TemplatedGroup.cs) | 20 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TestCairoPatch.cs (renamed from src/GraphicObjects/TestCairoPatch.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TextBox.cs (renamed from src/GraphicObjects/TextBox.cs) | 51 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TextRun.cs (renamed from src/GraphicObjects/TextRun.cs) | 12 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/TreeView.cs (renamed from src/GraphicObjects/TreeView.cs) | 10 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Trend.cs (renamed from src/GraphicObjects/Trend.cs) | 14 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/VerticalStack.cs (renamed from src/GraphicObjects/VerticalStack.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Window.cs (renamed from src/GraphicObjects/Window.cs) | 18 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/Wrapper.cs (renamed from src/GraphicObjects/Wrapper.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/GraphicObjects/XmlIgnoreAttribute.cs (renamed from Tests/Tutorials/T2_IML.cs) | 30 | ||||
| -rw-r--r-- | Crow/src/IListChanged.cs (renamed from src/IListChanged.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/BindingDefinition.cs (renamed from src/IML/BindingDefinition.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/BindingMember.cs (renamed from src/IML/BindingMember.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/IML/EventBinding.cs (renamed from src/IML/EventBinding.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/IMLContext.cs (renamed from src/IML/IMLContext.cs) | 6 | ||||
| -rw-r--r-- | Crow/src/IML/MemberAddress.cs (renamed from src/IML/MemberAddress.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/Node.cs (renamed from src/IML/Node.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/NodeAddress.cs (renamed from src/IML/NodeAddress.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IML/NodeStack.cs (renamed from src/IML/NodeStack.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/IMLAttributes.cs (renamed from src/IMLAttributes.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/ButtonState.cs (renamed from src/Input/ButtonState.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/Buttons.cs (renamed from src/Input/Buttons.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/Key.cs | 2442 | ||||
| -rw-r--r-- | Crow/src/Input/KeyEventArgs.cs | 64 | ||||
| -rw-r--r-- | Crow/src/Input/KeyPressEventArgs.cs (renamed from src/Input/KeyPressEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/MouseButton.cs (renamed from src/Input/MouseButton.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/MouseEventArgs.cs (renamed from src/Input/MouseEventArgs.cs) | 3 | ||||
| -rw-r--r-- | Crow/src/Input/MouseScroll.cs (renamed from src/Input/MouseScroll.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Input/MouseState.cs (renamed from src/Input/MouseState.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Instantiator.cs (renamed from src/Instantiator.cs) | 60 | ||||
| -rw-r--r-- | Crow/src/Interface.cs (renamed from src/Interface.cs) | 489 | ||||
| -rw-r--r-- | Crow/src/ItemTemplate.cs (renamed from src/ItemTemplate.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/LayoutingEventArgs.cs (renamed from src/LayoutingEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/LayoutingQueueItem.cs (renamed from src/LayoutingQueueItem.cs) | 58 | ||||
| -rw-r--r-- | Crow/src/Measure.cs (renamed from src/Measure.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Antialias.cs (renamed from src/Mono.Cairo/Antialias.cs) | 6 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Cairo.cs (renamed from src/Mono.Cairo/Cairo.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/CairoDebug.cs (renamed from src/Mono.Cairo/CairoDebug.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Content.cs (renamed from src/Mono.Cairo/Content.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Context.cs (renamed from src/Mono.Cairo/Context.cs) | 40 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/DRMDevice.cs (renamed from src/Mono.Cairo/DRMDevice.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/DRMSurface.cs (renamed from src/Mono.Cairo/DRMSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Device.cs (renamed from src/Mono.Cairo/Device.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/DirectFBSurface.cs (renamed from src/Mono.Cairo/DirectFBSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Distance.cs (renamed from src/Mono.Cairo/Distance.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/EGLDevice.cs (renamed from src/Mono.Cairo/EGLDevice.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Extend.cs (renamed from src/Mono.Cairo/Extend.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FillRule.cs (renamed from src/Mono.Cairo/FillRule.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Filter.cs (renamed from src/Mono.Cairo/Filter.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontExtents.cs (renamed from src/Mono.Cairo/FontExtents.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontFace.cs (renamed from src/Mono.Cairo/FontFace.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontOptions.cs (renamed from src/Mono.Cairo/FontOptions.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontSlant.cs (renamed from src/Mono.Cairo/FontSlant.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontType.cs (renamed from src/Mono.Cairo/FontType.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/FontWeight.cs (renamed from src/Mono.Cairo/FontWeight.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Format.cs (renamed from src/Mono.Cairo/Format.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/GLSurface.cs (renamed from src/Mono.Cairo/GLSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/GLXDevice.cs (renamed from src/Mono.Cairo/GLXDevice.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/GlitzSurface.cs (renamed from src/Mono.Cairo/GlitzSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Glyph.cs (renamed from src/Mono.Cairo/Glyph.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Gradient.cs (renamed from src/Mono.Cairo/Gradient.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/HintMetrics.cs (renamed from src/Mono.Cairo/HintMetrics.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/HintStyle.cs (renamed from src/Mono.Cairo/HintStyle.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/ImageSurface.cs (renamed from src/Mono.Cairo/ImageSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/LineCap.cs (renamed from src/Mono.Cairo/LineCap.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/LineJoin.cs (renamed from src/Mono.Cairo/LineJoin.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/LinearGradient.cs (renamed from src/Mono.Cairo/LinearGradient.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Matrix.cs (renamed from src/Mono.Cairo/Matrix.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/MeshPattern.cs (renamed from src/Mono.Cairo/MeshPattern.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/NativeMethods-internal.cs | 1026 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/NativeMethods.cs (renamed from src/Mono.Cairo/NativeMethods.cs) | 12 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Operator.cs (renamed from src/Mono.Cairo/Operator.cs) | 10 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/PSSurface.cs (renamed from src/Mono.Cairo/PSSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Path.cs (renamed from src/Mono.Cairo/Path.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Pattern.cs (renamed from src/Mono.Cairo/Pattern.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/PatternType.cs (renamed from src/Mono.Cairo/PatternType.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/PdfSurface.cs (renamed from src/Mono.Cairo/PdfSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Point.cs (renamed from src/Mono.Cairo/Point.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/PointD.cs (renamed from src/Mono.Cairo/PointD.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/RadialGradient.cs (renamed from src/Mono.Cairo/RadialGradient.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Region.cs (renamed from src/Mono.Cairo/Region.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/ScaledFont.cs (renamed from src/Mono.Cairo/ScaledFont.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SolidPattern.cs (renamed from src/Mono.Cairo/SolidPattern.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Status.cs (renamed from src/Mono.Cairo/Status.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SubpixelOrder.cs (renamed from src/Mono.Cairo/SubpixelOrder.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Surface.cs (renamed from src/Mono.Cairo/Surface.cs) | 7 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SurfacePattern.cs (renamed from src/Mono.Cairo/SurfacePattern.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SurfaceType.cs (renamed from src/Mono.Cairo/SurfaceType.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SvgSurface.cs (renamed from src/Mono.Cairo/SvgSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/SvgVersion.cs (renamed from src/Mono.Cairo/SvgVersion.cs) | 4 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/TextExtents.cs (renamed from src/Mono.Cairo/TextExtents.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/WGLDevice.cs (renamed from src/Mono.Cairo/WGLDevice.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/Win32Surface.cs (renamed from src/Mono.Cairo/Win32Surface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/XcbSurface.cs (renamed from src/Mono.Cairo/XcbSurface.cs) | 5 | ||||
| -rw-r--r-- | Crow/src/Mono.Cairo/XlibSurface.cs (renamed from src/Mono.Cairo/XlibSurface.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/MouseCursorChangedEventArgs.cs (renamed from src/MouseCursorChangedEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/ObservableList.cs (renamed from src/ObservableList.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/ParsingException.cs (renamed from src/ParsingException.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/PerformanceMeasure.cs (renamed from src/PerformanceMeasure.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Picture.cs (renamed from src/Picture.cs) | 2 | ||||
| -rw-r--r-- | Crow/src/Point.cs (renamed from src/Point.cs) | 8 | ||||
| -rw-r--r-- | Crow/src/Rectangle.cs (renamed from src/Rectangle.cs) | 8 | ||||
| -rw-r--r-- | Crow/src/ReflexionExtensions.cs (renamed from src/ReflexionExtensions.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/ScrollingEventArgs.cs (renamed from src/ScrollingEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/SelectionChangeEventArgs.cs (renamed from src/SelectionChangeEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Size.cs (renamed from src/Size.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/SolidColor.cs (renamed from src/SolidColor.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/Style.cs (renamed from src/Style.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/StyleReader.cs (renamed from src/StyleReader.cs) | 14 | ||||
| -rw-r--r-- | Crow/src/SvgPicture.cs (renamed from src/SvgPicture.cs) | 17 | ||||
| -rw-r--r-- | Crow/src/TextChangeEventArgs.cs (renamed from src/TextChangeEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/ValueChangeEventArgs.cs (renamed from src/ValueChangeEventArgs.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/XCursor.cs (renamed from src/XCursor.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/backends/IBackend.cs (renamed from Tests/HelloWorld.cs) | 40 | ||||
| -rw-r--r-- | Crow/src/backends/IKeyboard.cs (renamed from Tests/Tutorials/T1_HelloWorld.cs) | 41 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Cursor.cs | 170 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Delegates/TimerProc.cs | 25 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Delegates/WindowProc.cs | 31 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Device.cs | 61 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/DeviceContext.cs | 213 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs | 53 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/CursorName.cs | 88 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs | 43 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs | 165 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DeviceNotification.cs | 28 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs | 48 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs | 19 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplayFlags.cs | 21 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs | 20 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs | 29 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs | 76 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs | 24 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs | 193 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs | 21 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs | 19 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs | 25 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs | 50 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/IconName.cs | 38 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs | 39 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs | 26 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs | 48 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterColor.cs | 18 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs | 84 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs | 66 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs | 23 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs | 38 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs | 33 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs | 28 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs | 18 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs | 18 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs | 600 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs | 29 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs | 28 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs | 96 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs | 75 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs | 23 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs | 38 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs | 101 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs | 31 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs | 98 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs | 32 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs | 83 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs | 51 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/VirtualKey.cs | 874 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs | 97 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/WindowMessage.cs | 1661 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs | 34 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Enums/WindowStyles.cs | 179 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Icon.cs | 159 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Keyboard.cs | 93 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Message.cs | 307 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Monitor.cs | 70 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Mouse.cs | 133 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/RawInput.cs | 423 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs | 58 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/CreateStruct.cs | 92 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/DeviceMode.cs | 334 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/DisplayDevice.cs | 55 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs | 98 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/IconInfo.cs | 49 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/MonitorInfo.cs | 42 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs | 36 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/Msg.cs | 50 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/Point.cs | 49 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawHid.cs | 66 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInput.cs | 26 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputData.cs | 34 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDevice.cs | 83 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs | 49 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs | 33 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs | 41 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs | 34 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs | 29 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawInputHeader.cs | 37 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawKeyboard.cs | 39 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/RawMouse.cs | 67 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/Rect.cs | 102 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/StyleStruct.cs | 19 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs | 44 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/WindowClass.cs | 78 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/WindowInfo.cs | 66 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Structs/WindowPosition.cs | 49 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Timer.cs | 88 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/User32.cs | 13 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/Window.cs | 969 | ||||
| -rw-r--r-- | Crow/src/backends/win32/User32/WindowClass.cs | 210 | ||||
| -rwxr-xr-x | Crow/src/backends/win32/WinBackend.cs | 469 | ||||
| -rw-r--r-- | Crow/src/backends/xcb/XCBBackend.cs | 503 | ||||
| -rw-r--r-- | Crow/src/backends/xcb/XCBKeyboard.cs | 2605 | ||||
| -rw-r--r-- | Crow/src/backends/xlib/X11Keyboard.cs | 120 | ||||
| -rw-r--r-- | Crow/src/backends/xlib/X11Structs.cs | 1821 | ||||
| -rw-r--r-- | Crow/src/backends/xlib/XKeySym.cs | 2109 | ||||
| -rw-r--r-- | Crow/src/backends/xlib/XLibBackend.cs | 203 | ||||
| -rw-r--r-- | Crow/src/debug/DbgEventTypeColors.cs (renamed from Tests/Tutorials/T4_Gauge.cs) | 71 | ||||
| -rw-r--r-- | Crow/src/debug/DbgLogViewer.cs | 646 | ||||
| -rw-r--r-- | Crow/src/debug/DebugLogger.cs | 177 | ||||
| -rw-r--r-- | Crow/src/rsvg/DimensionData.cs (renamed from src/rsvg/DimensionData.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/rsvg/Global.cs (renamed from src/rsvg/Global.cs) | 0 | ||||
| -rw-r--r-- | Crow/src/rsvg/Handle.cs (renamed from src/rsvg/Handle.cs) | 0 | ||||
| -rwxr-xr-x | Properties/AssemblyInfo.cs | 4 | ||||
| -rwxr-xr-x | Templates/ArrowBut.template | 9 | ||||
| -rwxr-xr-x | Templates/HScrollBar.template | 18 | ||||
| -rwxr-xr-x | Templates/ScrollBar.template | 18 | ||||
| -rw-r--r-- | Templates/Tooltip.template | 4 | ||||
| -rw-r--r-- | Tests/BasicTests.cs | 491 | ||||
| -rw-r--r-- | Tests/CrowWindow.cs | 411 | ||||
| -rw-r--r-- | Tests/GOLIBTest_DirViewer.cs | 101 | ||||
| -rw-r--r-- | Tests/GOLIBTest_Listbox.cs | 127 | ||||
| -rw-r--r-- | Tests/GOLIBTest_TypeViewer.cs | 84 | ||||
| -rw-r--r-- | Tests/GOLIBTest_Window.cs | 125 | ||||
| -rw-r--r-- | Tests/GOLIBTest_deviceOffset.cs | 88 | ||||
| -rw-r--r-- | Tests/GraphicObjects/LaggingGraphicObject.cs | 86 | ||||
| -rw-r--r-- | Tests/Hello3D.cs | 154 | ||||
| -rw-r--r-- | Tests/IValueChange.cs | 23 | ||||
| -rw-r--r-- | Tests/InterfaceControler.cs | 268 | ||||
| -rw-r--r-- | Tests/Interfaces/CheckBox2.imlt | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/Container/0.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Container/3.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/0.crow | 42 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/3.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/5.crow | 12 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/6.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/clip0.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/clip1.crow | 6 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/clip2.crow | 6 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/clip3.crow | 14 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/clip4.crow | 58 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/colorPicker.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/perfMeasures.crow | 2 | ||||
| -rw-r--r-- | Tests/Interfaces/Divers/testDisable.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testFocus.crow | 82 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testImage.crow | 28 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testMenu.crow | 6 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testOutOfClipUpdate.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testPropLess.crow | 2 | ||||
| -rw-r--r-- | Tests/Interfaces/Divers/testShape.crow | 6 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testStacks.crow | 38 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testTextBox.crow | 32 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/testVisibility.crow | 8 | ||||
| -rw-r--r-- | Tests/Interfaces/Divers/welcome.crow | 8 | ||||
| -rwxr-xr-x | Tests/Interfaces/DragAndDrop/0.crow | 16 | ||||
| -rwxr-xr-x | Tests/Interfaces/Experimental/DockWindow.template | 39 | ||||
| -rw-r--r-- | Tests/Interfaces/Experimental/testDock.crow | 23 | ||||
| -rw-r--r-- | Tests/Interfaces/Experimental/testDock2.crow | 16 | ||||
| -rw-r--r-- | Tests/Interfaces/Experimental/testStack.crow | 18 | ||||
| -rwxr-xr-x | Tests/Interfaces/GraphicObject/0.crow | 3 | ||||
| -rwxr-xr-x | Tests/Interfaces/Group/0.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Group/1.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Group/2.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Group/3.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Group/4.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Splitter/1.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/0.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/0h.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/1.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/1h.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/2.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/2h.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/3.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/3h.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Stack/4.crow | 4 | ||||
| -rw-r--r-- | Tests/Interfaces/TabItem.template | 8 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedContainer/0.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedContainer/6.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedContainer/7.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedContainer/testGroupBox.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedContainer/testPopper.crow | 2 | ||||
| -rw-r--r-- | Tests/Interfaces/TemplatedContainer/testTabView.crow | 12 | ||||
| -rw-r--r-- | Tests/Interfaces/TemplatedContainer/testTabView2.crow | 20 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testButton.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testCheckbox.crow | 18 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testCombobox.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testRadioButton.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testScrollbar.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/TemplatedControl/testSpinner.crow | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/basicTests/7.crow | 6 | ||||
| -rwxr-xr-x | Tests/Interfaces/colorItem2.crow | 10 | ||||
| -rwxr-xr-x | Tests/Interfaces/perfMsr.crow | 7 | ||||
| -rw-r--r-- | Tests/Interfaces/testBorder.goml.cs | 31 | ||||
| -rw-r--r-- | Tests/OpenGL/Extensions.cs | 41 | ||||
| -rw-r--r-- | Tests/OpenGL/Shader.cs | 336 | ||||
| -rw-r--r-- | Tests/OpenGL/Texture.cs | 94 | ||||
| -rw-r--r-- | Tests/OpenGL/vaoMesh.cs | 221 | ||||
| -rw-r--r-- | Tests/Showcase.cs | 99 | ||||
| -rw-r--r-- | Tests/Tests.NetStd.csproj | 39 | ||||
| -rw-r--r-- | Tests/Tests.csproj | 69 | ||||
| -rw-r--r-- | Tests/Tutorials/T3_OpenGLCube.cs | 87 | ||||
| -rwxr-xr-x | Tests/Tutorials/test.crow | 3 | ||||
| -rw-r--r-- | Tests/image/blank-file.svg | 6 | ||||
| -rw-r--r-- | Tests/keysyms.cs | 85 | ||||
| -rw-r--r-- | Tests/packages.config | 4 | ||||
| -rw-r--r-- | Tests/test.style | 15 | ||||
| -rw-r--r-- | Tests/ui/LabelButton.style | 8 | ||||
| -rw-r--r-- | Tests/ui/MenuItem.style | 8 | ||||
| -rw-r--r-- | Tests/ui/MenuItem.template | 25 | ||||
| -rwxr-xr-x | Tests/ui/dbgLog.crow | 34 | ||||
| -rwxr-xr-x | Tests/ui/dbgLogColors.crow | 60 | ||||
| -rwxr-xr-x | Tests/ui/showcase.crow | 2 | ||||
| -rwxr-xr-x | Tests/ui/test.crow | 4 | ||||
| -rw-r--r-- | Tests/ui/test.style | 2 | ||||
| -rw-r--r-- | libs/OpenTK.dll | bin | 5518848 -> 0 bytes | |||
| -rw-r--r-- | libs/OpenTK.dll.config | 25 | ||||
| -rw-r--r-- | src/IML/Reader.cs | 223 | ||||
| -rw-r--r-- | src/Input/Key.cs | 380 | ||||
| -rw-r--r-- | src/Input/KeyModifiers.cs | 63 | ||||
| -rw-r--r-- | src/Input/KeyboardKeyEventArgs.cs | 167 | ||||
| -rw-r--r-- | src/Input/KeyboardState.cs | 316 | ||||
| -rw-r--r-- | src/LayoutingQueue.cs | 110 | ||||
| -rw-r--r-- | src/Mono.Cairo/Color.cs | 75 | ||||
| -rw-r--r-- | src/Mono.Cairo/Rectangle.cs | 99 | ||||
| -rw-r--r-- | src/win32/Win32.cs | 62 | ||||
| -rwxr-xr-x | src/win32/winApi.cs | 1238 |
505 files changed, 25169 insertions, 7777 deletions
@@ -4,13 +4,16 @@ Crow.userprefs Debug packages *.nupkg +*.user +.vs/ /GOLib.suo /tmp /bin/* /obj/* /GOLib.userprefs /Tests/obj/* -/OTKCrow/obj +CrowIDE/obj +Crow/obj /Tests/bin/* /UnitTest/obj /UnitTest/bin diff --git a/Crow.NetStd.sln b/Crow.NetStd.sln new file mode 100644 index 00000000..c12c637c --- /dev/null +++ b/Crow.NetStd.sln @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.NetStd", "Crow\Crow.NetStd.csproj", "{75BDE4C7-4BAF-4A03-B697-5D1370775E20}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.NetStd", "Tests\Tests.NetStd.csproj", "{28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE.NetStd", "CrowIDE\CrowIDE.NetStd.csproj", "{A01B3151-BC81-437C-B526-CC8DBB808638}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Release|Any CPU.Build.0 = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|x64.ActiveCfg = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|x64.Build.0 = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|x86.ActiveCfg = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|x86.Build.0 = Debug|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|Any CPU.Build.0 = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|x64.ActiveCfg = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|x64.Build.0 = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|x86.ActiveCfg = Release|Any CPU + {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|x86.Build.0 = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|x64.ActiveCfg = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|x64.Build.0 = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|x86.ActiveCfg = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|x86.Build.0 = Debug|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|Any CPU.Build.0 = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|x64.ActiveCfg = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|x64.Build.0 = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|x86.ActiveCfg = Release|Any CPU + {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Crow.OpenTK.nuspec b/Crow.OpenTK.nuspec deleted file mode 100644 index 845f6556..00000000 --- a/Crow.OpenTK.nuspec +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0"?> -<package > - <metadata> - <id>Crow.OpenTK</id> - <version>0.7.1</version> - <title>C# Rapid Open Widget Toolkit</title> - <authors>JP Bruyere</authors> - <owners>Grand Tetras Software</owners> - <licenseUrl>https://opensource.org/licenses/MIT</licenseUrl> - <projectUrl>https://github.com/jpbruyere/Crow/wiki</projectUrl> - <iconUrl>https://jpbruyere.github.io/Crow/images/crow.png</iconUrl> - <requireLicenseAcceptance>false</requireLicenseAcceptance> - <description> -C.R.O.W. is a widget toolkit and rendering engine entirely developed in C# with templates, styles, compositing, and bindings. -Crow.OpenTK is the OpenTK ready version. - </description> - <summary> - - </summary> - <releaseNotes> -- 0.7.1: implement ReaderWriterLock for solving threading problems - -- new mouse move handling, improve perf, introduce new recursive method in GraphicObject 'PointIsIn (ref Point p)' -- new TemplatedGroup architecture: in hierarchical group, TemplatedGroup are no longer required on each node, only a container with 'ItemsContainer' should be provided in ItemTemplates with sub data fetching. -- Delete and Remove widget differentiation in group. -- Drag and Drop basics implemented, not fully tested. -- binding address starting with '/' start search at current node, not in template. -- Fit measure units changed from Pixel to Percent. -- prevent mouse evt on label not selectable. -- crowIDE wip, need CrowEdit reference (available on GitHub). -- CheckBox reused as base in several template which need 2 states inherited from it. -- FocusParent internal variable, allow easyer popup parenting while keeping logical parenting usefull for other things. -- InstantiatorException with file name. -- load all assemblies in bin dir at startup to allow usage of several Widget assemblies. -- Context menu basic mechanic, may be improved. -- ObservableList that could be used as data source for TempletedGroups. -- Configuration no longer static to allow multiple config files handling in single application. -- styling is no longer static in iface to allow different styling context between ifaces. - - </releaseNotes> - <copyright>Copyright 2013-2018</copyright> - <dependencies> - <dependency id="OpenTK" version="2.0.0" /> - </dependencies> - <tags>Crow OpenTK OpenGL Widget Interface GUI C# .Net Mono</tags> - <references> - <reference file="Crow.dll" /> - </references> - <frameworkAssemblies> - <frameworkAssembly assemblyName="System" /> - <frameworkAssembly assemblyName="System.Drawing" /> - <frameworkAssembly assemblyName="System.Xml" /> - </frameworkAssemblies> - </metadata> - <files> - <file src="Tests/CrowWindow.cs" target="content" /> - <file src="Tests/InterfaceControler.cs" target="content" /> - <file src="Tests/OpenGL/*.cs" target="content/OpenGL" /> - <file src="build/Release/Crow.dll" target="lib/net45" /> - <file src="build/Release/Crow.dll.config" target="content" /> - </files> -</package> diff --git a/Crow.Test/Crow.Test.csproj b/Crow.Test/Crow.Test.csproj deleted file mode 100644 index cf7b10a0..00000000 --- a/Crow.Test/Crow.Test.csproj +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.30703</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}</ProjectGuid> - <OutputType>Library</OutputType> - <RootNamespace>Crow.Test</RootNamespace> - <AssemblyName>Crow.Test</AssemblyName> - <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> - <ReleaseVersion>0.7</ReleaseVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <DefineConstants>DEBUG;</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <Optimize>true</Optimize> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="nunit.framework"> - <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="Test.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="packages.config" /> - <None Include="ExpectedOutputs\0.png"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="ExpectedOutputs\1.png"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="ExpectedOutputs\3.png"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="ExpectedOutputs\4.png"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="ExpectedOutputs\5.png"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\0.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\1.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\2.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\3.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\4.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\5.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Interfaces\testButton.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\Crow.csproj"> - <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project> - <Name>Crow</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Folder Include="ExpectedOutputs\" /> - <Folder Include="Interfaces\" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file diff --git a/Crow.Test/ExpectedOutputs/0.png b/Crow.Test/ExpectedOutputs/0.png Binary files differdeleted file mode 100644 index 153a3641..00000000 --- a/Crow.Test/ExpectedOutputs/0.png +++ /dev/null diff --git a/Crow.Test/ExpectedOutputs/1.png b/Crow.Test/ExpectedOutputs/1.png Binary files differdeleted file mode 100644 index 57fcf77e..00000000 --- a/Crow.Test/ExpectedOutputs/1.png +++ /dev/null diff --git a/Crow.Test/ExpectedOutputs/3.png b/Crow.Test/ExpectedOutputs/3.png Binary files differdeleted file mode 100644 index c4ba81ca..00000000 --- a/Crow.Test/ExpectedOutputs/3.png +++ /dev/null diff --git a/Crow.Test/ExpectedOutputs/4.png b/Crow.Test/ExpectedOutputs/4.png Binary files differdeleted file mode 100644 index c2e97e7a..00000000 --- a/Crow.Test/ExpectedOutputs/4.png +++ /dev/null diff --git a/Crow.Test/ExpectedOutputs/5.png b/Crow.Test/ExpectedOutputs/5.png Binary files differdeleted file mode 100644 index 7eec095b..00000000 --- a/Crow.Test/ExpectedOutputs/5.png +++ /dev/null diff --git a/Crow.Test/Interfaces/0.crow b/Crow.Test/Interfaces/0.crow deleted file mode 100755 index fdcc11d1..00000000 --- a/Crow.Test/Interfaces/0.crow +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0"?> -<GraphicObject Width="100" Height="100" Background="Green"/> diff --git a/Crow.Test/Interfaces/1.crow b/Crow.Test/Interfaces/1.crow deleted file mode 100755 index 142d0721..00000000 --- a/Crow.Test/Interfaces/1.crow +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0"?> -<Container Width="300" Height="300" Margin="20" Background="Yellow"> - <Container Width="0" Height="0" Margin="20" Background="Green"> - <GraphicObject VerticalAlignment="Bottom" Width="50" Height="50" - Background="Red"/> - </Container> -</Container>
\ No newline at end of file diff --git a/Crow.Test/Interfaces/2.crow b/Crow.Test/Interfaces/2.crow deleted file mode 100755 index dcccba04..00000000 --- a/Crow.Test/Interfaces/2.crow +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Fit="true"> - <HorizontalStack Fit="true"> - <Label Text="label1"/> - <TextRun Text="textrun1"/> - </HorizontalStack> -</VerticalStack>
\ No newline at end of file diff --git a/Crow.Test/Interfaces/3.crow b/Crow.Test/Interfaces/3.crow deleted file mode 100755 index e9c88920..00000000 --- a/Crow.Test/Interfaces/3.crow +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<HorizontalStack Margin="5" Background="DimGray"> - <VerticalStack Width="200" Margin="5" Background="Gray"> - <VerticalStack Fit="true" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </VerticalStack> - <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun Background="SkyBlue" Height="Stretched"/> - </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - </VerticalStack> - <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Gray"> - <VerticalStack Fit="true" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </VerticalStack> - <VerticalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun TextAlignment="Center" Background="SkyBlue" Width="Stretched" Height="Stretched"/> - </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - </VerticalStack> - <VerticalStack Width="Fit" Margin="5" Background="Gray"> - <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue" HorizontalAlignment="Left"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </VerticalStack> - <VerticalStack Width="0" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun Background="SkyBlue" Height="Stretched"/> - </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> - <TextRun Background="SkyBlue"/> - <TextRun Background="SkyBlue" Width="Stretched"/> - <TextRun Background="SkyBlue"/> - </HorizontalStack> - </VerticalStack> -</HorizontalStack>
\ No newline at end of file diff --git a/Crow.Test/Interfaces/4.crow b/Crow.Test/Interfaces/4.crow deleted file mode 100755 index 6546a9a3..00000000 --- a/Crow.Test/Interfaces/4.crow +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Fit="true" Spacing="0"> - <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed" Width="0"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" > - <Image Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg"/> - <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" /> - <Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - </HorizontalStack> - <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" > - <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - </HorizontalStack> - <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" > - <Image Scaled="false" Background="Blue" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" /> - </HorizontalStack> - <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent"> - <Image Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - </HorizontalStack> - <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent"> - <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - </HorizontalStack> - <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/> - <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" > - <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - </HorizontalStack> -</VerticalStack>
\ No newline at end of file diff --git a/Crow.Test/Interfaces/5.crow b/Crow.Test/Interfaces/5.crow deleted file mode 100755 index 7238ae45..00000000 --- a/Crow.Test/Interfaces/5.crow +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0"?> -<HorizontalStack Fit="true" Margin="5"> - <VerticalStack Fit="true" Margin="2" Spacing="2"> - <TextRun Text="text run test"/> - <Label Text="label test"/> - <TextBox Text="text box test"/> - <Button Caption="test button"/> - <CheckBox Caption="test checkbox"/> - <RadioButton Caption="test radiobutton"/> - <ComboBox/> - <Popper Caption="test popper"> - <Label Text="label test"/> - </Popper> - <Expandable Caption="test expandable"> - <Label Text="label test"/> - </Expandable> - <Border > - <Label Text="border test" Margin="3"/> - </Border> - <GroupBox Caption="Group box" > - <Label Text="border test" Margin="3"/> - </GroupBox> - <Container Fit="true" Background="DimGray" Margin="3"> - <GraphicObject Width="20" Height="20" Background="LightGray"/> - </Container> - <ProgressBar Height="10" Width="150" Background="DimGray" Value="50" /> - <Slider Value="5" Width="150" Height="10"/> - <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/> - <Spinner Value="100"/> - </VerticalStack> - <VerticalStack Width="150" Height="Fit" Margin="2" Spacing="2"> - <TextRun Text="text run test" Width="0"/> - <Label Text="label test" Width="0"/> - <TextBox Text="text box test" Width="0"/> - <Button Caption="test button" Width="0"/> - <CheckBox Caption="test checkbox" Width="0"/> - <RadioButton Caption="test radiobutton" Width="0"/> - <ComboBox Width="0"/> - <Popper Caption="test popper" Width="0"> - <Label Text="label test"/> - </Popper> - <Expandable Caption="test expandable" Width="0"> - <Label Text="label test"/> - </Expandable> - <Border Width="0"> - <Label Text="border test" Margin="3"/> - </Border> - <GroupBox Caption="Group box" Width="0"> - <Label Text="border test" Margin="3"/> - </GroupBox> - <Container Height="Fit" Width="0" Background="DimGray" Margin="3"> - <GraphicObject Width="20" Height="20" Background="LightGray"/> - </Container> - <ProgressBar Height="10" Width="0" Background="DimGray" Value="50" /> - <Slider Value="5" Width="0" Height="10"/> - <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="0"/> - <Spinner Value="100" Width="0"/> - </VerticalStack> -</HorizontalStack> -<!--<HorizontalStack Fit="true" Background="RoyalBlue" Margin="5"> - <GraphicObject Background="Red" Width="30" Height="20"/> - <Spinner Maximum="10000000000" SmallIncrement="10" Value="0"/> - <GraphicObject Background="Green" Width="30" Height="20"/> -</HorizontalStack>-->
\ No newline at end of file diff --git a/Crow.Test/Interfaces/testButton.crow b/Crow.Test/Interfaces/testButton.crow deleted file mode 100755 index 5e4c5a5c..00000000 --- a/Crow.Test/Interfaces/testButton.crow +++ /dev/null @@ -1,322 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Fit="true"> - <HorizontalStack Fit="True"> - <Button Caption="but" MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> - <HorizontalStack Fit="True"> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - <Button MouseClick="onButClick"/> - </HorizontalStack> -</VerticalStack>
\ No newline at end of file diff --git a/Crow.Test/Test.cs b/Crow.Test/Test.cs deleted file mode 100644 index d4d97856..00000000 --- a/Crow.Test/Test.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Test.cs -// -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2016 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -using NUnit.Framework; -using System; -using Crow; -using System.IO; -[assembly: Description ("Assembly description here")] -namespace UnitTest -{ - [TestFixture, Description ("Fixture description here")] - public class Test - { - Interface iface; - Rectangle bounds = new Rectangle (0, 0, 600, 600); - - - [SetUp] - public void Init () - { - iface = new Interface (); - iface.Init (); - iface.ProcessResize (bounds); - } - - [Test , Description("My really cool test")] - public void GraphicObject () - { - string [] tests = new string [] { "0", "1", "3", "4", "5" }; - - foreach (string s in tests) { - string fileName = Path.Combine ("Interfaces", s + ".crow"); - iface.AddWidget (fileName); - - iface.Update (); - iface.Update (); - - using (Cairo.Surface surf = new Cairo.ImageSurface (iface.bmp, - Cairo.Format.Argb32, iface.ClientRectangle.Width, iface.ClientRectangle.Height, iface.ClientRectangle.Width * 4)) { - surf.WriteToPng (@"tmp.png"); - surf.WriteToPng (fileName + ".png"); - } - - - byte [] model = File.ReadAllBytes ("ExpectedOutputs/" + s + ".png"); - byte [] result = File.ReadAllBytes (@"tmp.png"); - - //CollectionAssert.AreEqual (model, result); - - iface.ClearInterface (); - } - } - } -} - diff --git a/Crow.Test/packages.config b/Crow.Test/packages.config deleted file mode 100644 index 01c187cc..00000000 --- a/Crow.Test/packages.config +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="NUnit" version="2.6.4" targetFramework="net461" /> -</packages>
\ No newline at end of file diff --git a/Crow.csproj b/Crow.csproj deleted file mode 100644 index 1b5b3406..00000000 --- a/Crow.csproj +++ /dev/null @@ -1,399 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Crow</RootNamespace> - <AssemblyName>Crow</AssemblyName> - <FileAlignment>512</FileAlignment> - <AllowUnsafeBlocks>True</AllowUnsafeBlocks> - <NoStdLib>False</NoStdLib> - <TreatWarningsAsErrors>False</TreatWarningsAsErrors> - <WarningLevel>4</WarningLevel> - <NoWin32Manifest>False</NoWin32Manifest> - <SignAssembly>true</SignAssembly> - <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <Description>C# Rapid Open Widget</Description> - <BaseAddress>4194304</BaseAddress> - <OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath> - <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath> - <AssemblyOriginatorKeyFile>crow.key</AssemblyOriginatorKeyFile> - <ProductVersion>8.0.30703</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ReleaseVersion>0.5</ReleaseVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> - <Optimize>false</Optimize> - <OutputPath>$(SolutionDir)build\Debug</OutputPath> - <DefineConstants>DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <Optimize>true</Optimize> - <DefineConstants>DESIGN_MODE</DefineConstants> - <OutputPath>$(SolutionDir)build\Release</OutputPath> - </PropertyGroup> - <ItemGroup> - <Compile Include="src\Colors.cs" /> - <Compile Include="src\Point.cs" /> - <Compile Include="src\Rectangle.cs" /> - <Compile Include="src\Size.cs" /> - <Compile Include="src\GraphicObjects\GraphicObject.cs" /> - <Compile Include="src\GraphicObjects\Container.cs" /> - <Compile Include="src\GraphicObjects\Group.cs" /> - <Compile Include="src\GraphicObjects\HorizontalStack.cs" /> - <Compile Include="src\GraphicObjects\Image.cs" /> - <Compile Include="src\GraphicObjects\Label.cs" /> - <Compile Include="src\GraphicObjects\TextBox.cs" /> - <Compile Include="src\GraphicObjects\ProgressBar.cs" /> - <Compile Include="src\GraphicObjects\VerticalStack.cs" /> - <Compile Include="src\Cairo\CairoHelpers.cs" /> - <Compile Include="src\win32\Win32.cs" /> - <Compile Include="src\win32\winApi.cs" /> - <Compile Include="src\GraphicObjects\Button.cs" /> - <Compile Include="src\GraphicObjects\GraduatedSlider.cs" /> - <Compile Include="src\GraphicObjects\Slider.cs" /> - <Compile Include="src\GraphicObjects\NumericControl.cs" /> - <Compile Include="src\GraphicObjects\Scroller.cs" /> - <Compile Include="src\GraphicObjects\ILayoutable.cs" /> - <Compile Include="src\Enums.cs" /> - <Compile Include="src\GraphicObjects\GenericStack.cs" /> - <Compile Include="src\CompilerServices\CompilerServices.cs" /> - <Compile Include="src\GraphicObjects\Border.cs" /> - <Compile Include="src\Font.cs" /> - <Compile Include="src\GraphicObjects\Window.cs" /> - <Compile Include="src\GraphicObjects\ListBox.cs" /> - <Compile Include="src\ExtensionsMethods.cs" /> - <Compile Include="src\Interface.cs" /> - <Compile Include="src\LayoutingQueueItem.cs" /> - <Compile Include="src\GraphicObjects\Spinner.cs" /> - <Compile Include="src\DynAttribute.cs" /> - <Compile Include="src\GraphicObjects\IValueChange.cs" /> - <Compile Include="src\Picture.cs" /> - <Compile Include="src\SvgPicture.cs" /> - <Compile Include="src\BmpPicture.cs" /> - <Compile Include="src\GraphicObjects\TemplatedControl.cs" /> - <Compile Include="src\GraphicObjects\RadioButton.cs" /> - <Compile Include="src\GraphicObjects\Expandable.cs" /> - <Compile Include="src\GraphicObjects\PrivateContainer.cs" /> - <Compile Include="src\GraphicObjects\TemplatedContainer.cs" /> - <Compile Include="src\GraphicObjects\Popper.cs" /> - <Compile Include="src\TextChangeEventArgs.cs" /> - <Compile Include="src\ReflexionExtensions.cs" /> - <Compile Include="src\XCursor.cs" /> - <Compile Include="src\GraphicObjects\Grid.cs" /> - <Compile Include="src\GraphicObjects\TextRun.cs" /> - <Compile Include="src\GraphicObjects\MessageBox.cs" /> - <Compile Include="src\SelectionChangeEventArgs.cs" /> - <Compile Include="src\ValueChangeEventArgs.cs" /> - <Compile Include="src\GraphicObjects\FileDialog.cs" /> - <Compile Include="src\GraphicObjects\CheckBox.cs" /> - <Compile Include="src\GraphicObjects\ComboBox.cs" /> - <Compile Include="src\GraphicObjects\GroupBox.cs" /> - <Compile Include="src\GraphicObjects\ScrollBar.cs" /> - <Compile Include="src\BubblingMouseButtonEventArgs.cs" /> - <Compile Include="src\SolidColor.cs" /> - <Compile Include="src\Gradient.cs" /> - <Compile Include="src\Fill\Fill.cs" /> - <Compile Include="src\LayoutingEventArgs.cs" /> - <Compile Include="src\ScrollingEventArgs.cs" /> - <Compile Include="src\GraphicObjects\Trend.cs" /> - <Compile Include="src\GraphicObjects\Splitter.cs" /> - <Compile Include="src\GraphicObjects\TreeView.cs" /> - <Compile Include="src\GraphicObjects\TabView.cs" /> - <Compile Include="src\GraphicObjects\TabItem.cs" /> - <Compile Include="src\Input\KeyboardKeyEventArgs.cs" /> - <Compile Include="src\Input\Buttons.cs" /> - <Compile Include="src\Input\ButtonState.cs" /> - <Compile Include="src\Input\Key.cs" /> - <Compile Include="src\Input\KeyboardState.cs" /> - <Compile Include="src\Input\KeyModifiers.cs" /> - <Compile Include="src\Input\MouseButton.cs" /> - <Compile Include="src\Input\MouseEventArgs.cs" /> - <Compile Include="src\Input\MouseScroll.cs" /> - <Compile Include="src\Input\MouseState.cs" /> - <Compile Include="src\rsvg\DimensionData.cs" /> - <Compile Include="src\rsvg\Global.cs" /> - <Compile Include="src\rsvg\Handle.cs" /> - <Compile Include="src\MouseCursorChangedEventArgs.cs" /> - <Compile Include="src\Input\KeyPressEventArgs.cs" /> - <Compile Include="src\Configuration.cs" /> - <Compile Include="src\Measure.cs" /> - <Compile Include="src\StyleReader.cs" /> - <Compile Include="src\GraphicObjects\DirectoryView.cs" /> - <Compile Include="src\Instantiator.cs" /> - <Compile Include="src\ItemTemplate.cs" /> - <Compile Include="src\Style.cs" /> - <Compile Include="src\GraphicObjects\Wrapper.cs" /> - <Compile Include="src\GraphicObjects\TemplatedGroup.cs" /> - <Compile Include="src\GraphicObjects\MenuItem.cs" /> - <Compile Include="src\GraphicObjects\Menu.cs" /> - <Compile Include="src\Command.cs" /> - <Compile Include="src\GraphicObjects\DataSourceChangeEventArgs.cs" /> - <Compile Include="src\IML\NodeAddress.cs" /> - <Compile Include="src\IML\Node.cs" /> - <Compile Include="src\IML\MemberAddress.cs" /> - <Compile Include="src\IML\NodeStack.cs" /> - <Compile Include="src\IML\BindingDefinition.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="src\GraphicObjects\ColorPicker.cs" /> - <Compile Include="src\GraphicObjects\ColorSelector.cs" /> - <Compile Include="src\GraphicObjects\HueSelector.cs" /> - <Compile Include="src\GraphicObjects\SaturationValueSelector.cs" /> - <Compile Include="src\IML\EventBinding.cs" /> - <Compile Include="src\PerformanceMeasure.cs" /> - <Compile Include="src\IML\BindingMember.cs" /> - <Compile Include="src\CrowThread.cs" /> - <Compile Include="src\GraphicObjects\ScrollingObject.cs" /> - <Compile Include="src\Mono.Cairo\Antialias.cs" /> - <Compile Include="src\Mono.Cairo\Cairo.cs" /> - <Compile Include="src\Mono.Cairo\CairoDebug.cs" /> - <Compile Include="src\Mono.Cairo\Color.cs" /> - <Compile Include="src\Mono.Cairo\Content.cs" /> - <Compile Include="src\Mono.Cairo\Context.cs" /> - <Compile Include="src\Mono.Cairo\DRMDevice.cs" /> - <Compile Include="src\Mono.Cairo\DRMSurface.cs" /> - <Compile Include="src\Mono.Cairo\Device.cs" /> - <Compile Include="src\Mono.Cairo\DirectFBSurface.cs" /> - <Compile Include="src\Mono.Cairo\Distance.cs" /> - <Compile Include="src\Mono.Cairo\EGLDevice.cs" /> - <Compile Include="src\Mono.Cairo\Extend.cs" /> - <Compile Include="src\Mono.Cairo\FillRule.cs" /> - <Compile Include="src\Mono.Cairo\Filter.cs" /> - <Compile Include="src\Mono.Cairo\FontExtents.cs" /> - <Compile Include="src\Mono.Cairo\FontFace.cs" /> - <Compile Include="src\Mono.Cairo\FontOptions.cs" /> - <Compile Include="src\Mono.Cairo\FontSlant.cs" /> - <Compile Include="src\Mono.Cairo\FontType.cs" /> - <Compile Include="src\Mono.Cairo\FontWeight.cs" /> - <Compile Include="src\Mono.Cairo\Format.cs" /> - <Compile Include="src\Mono.Cairo\GLSurface.cs" /> - <Compile Include="src\Mono.Cairo\GLXDevice.cs" /> - <Compile Include="src\Mono.Cairo\GlitzSurface.cs" /> - <Compile Include="src\Mono.Cairo\Glyph.cs" /> - <Compile Include="src\Mono.Cairo\Gradient.cs" /> - <Compile Include="src\Mono.Cairo\HintMetrics.cs" /> - <Compile Include="src\Mono.Cairo\HintStyle.cs" /> - <Compile Include="src\Mono.Cairo\ImageSurface.cs" /> - <Compile Include="src\Mono.Cairo\LineCap.cs" /> - <Compile Include="src\Mono.Cairo\LineJoin.cs" /> - <Compile Include="src\Mono.Cairo\LinearGradient.cs" /> - <Compile Include="src\Mono.Cairo\Matrix.cs" /> - <Compile Include="src\Mono.Cairo\NativeMethods.cs" /> - <Compile Include="src\Mono.Cairo\Operator.cs" /> - <Compile Include="src\Mono.Cairo\PSSurface.cs" /> - <Compile Include="src\Mono.Cairo\Path.cs" /> - <Compile Include="src\Mono.Cairo\Pattern.cs" /> - <Compile Include="src\Mono.Cairo\PatternType.cs" /> - <Compile Include="src\Mono.Cairo\PdfSurface.cs" /> - <Compile Include="src\Mono.Cairo\Point.cs" /> - <Compile Include="src\Mono.Cairo\PointD.cs" /> - <Compile Include="src\Mono.Cairo\RadialGradient.cs" /> - <Compile Include="src\Mono.Cairo\Rectangle.cs" /> - <Compile Include="src\Mono.Cairo\Region.cs" /> - <Compile Include="src\Mono.Cairo\ScaledFont.cs" /> - <Compile Include="src\Mono.Cairo\SolidPattern.cs" /> - <Compile Include="src\Mono.Cairo\Status.cs" /> - <Compile Include="src\Mono.Cairo\SubpixelOrder.cs" /> - <Compile Include="src\Mono.Cairo\Surface.cs" /> - <Compile Include="src\Mono.Cairo\SurfacePattern.cs" /> - <Compile Include="src\Mono.Cairo\SurfaceType.cs" /> - <Compile Include="src\Mono.Cairo\SvgSurface.cs" /> - <Compile Include="src\Mono.Cairo\SvgVersion.cs" /> - <Compile Include="src\Mono.Cairo\TextExtents.cs" /> - <Compile Include="src\Mono.Cairo\WGLDevice.cs" /> - <Compile Include="src\Mono.Cairo\Win32Surface.cs" /> - <Compile Include="src\Mono.Cairo\XcbSurface.cs" /> - <Compile Include="src\Mono.Cairo\XlibSurface.cs" /> - <Compile Include="src\IML\IMLContext.cs" /> - <Compile Include="src\Mono.Cairo\MeshPattern.cs" /> - <Compile Include="src\GraphicObjects\Shape.cs" /> - <Compile Include="src\IListChanged.cs" /> - <Compile Include="src\ObservableList.cs" /> - <Compile Include="src\GraphicObjects\IMLContainer.cs" /> - <Compile Include="src\DragDropEventArgs.cs" /> - <Compile Include="src\GraphicObjects\DockWindow.cs" /> - <Compile Include="src\ParsingException.cs" /> - <Compile Include="src\IMLAttributes.cs" /> - <Compile Include="src\GraphicObjects\DockStack.cs" /> - </ItemGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Drawing" /> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ItemGroup /> - <ItemGroup> - <Folder Include="src\GraphicObjects\" /> - <Folder Include="src\Cairo\" /> - <Folder Include="src\win32\" /> - <Folder Include="Images\" /> - <Folder Include="Images\Icons\" /> - <Folder Include="src\CompilerServices\" /> - <Folder Include="src\Fill\" /> - <Folder Include="src\Input\" /> - <Folder Include="src\rsvg\" /> - <Folder Include="src\IML\" /> - <Folder Include="Icons\" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Images\Icons\updown.svg" /> - <EmbeddedResource Include="Images\Icons\IconAlerte.svg" /> - <EmbeddedResource Include="Images\Icons\buttonB.svg" /> - <EmbeddedResource Include="Images\Icons\checkbox.svg" /> - <EmbeddedResource Include="Images\Icons\radiobutton.svg" /> - <EmbeddedResource Include="Images\Icons\expandable.svg" /> - <EmbeddedResource Include="Images\Icons\tetra.png" /> - <EmbeddedResource Include="Images\Icons\exit.svg" /> - <EmbeddedResource Include="Images\meter.svg" /> - <EmbeddedResource Include="Images\Icons\member.svg" /> - <EmbeddedResource Include="Images\Icons\exit2.svg" /> - <EmbeddedResource Include="Images\button.svg" /> - <EmbeddedResource Include="Images\Icons\iconInfo.svg"> - <LogicalName>Crow.Images.Icons.Informations.svg</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Images\Icons\Cursors\cross" /> - <EmbeddedResource Include="Images\Icons\Cursors\bottom_left_corner" /> - <EmbeddedResource Include="Images\Icons\Cursors\bottom_right_corner" /> - <EmbeddedResource Include="Images\Icons\Cursors\top_left_corner" /> - <EmbeddedResource Include="Images\Icons\Cursors\top_right_corner" /> - <EmbeddedResource Include="Images\Icons\Cursors\arrow" /> - <EmbeddedResource Include="Images\Icons\Cursors\sb_h_double_arrow" /> - <EmbeddedResource Include="Images\Icons\Cursors\sb_v_double_arrow" /> - <EmbeddedResource Include="Images\Icons\Cursors\hand" /> - <EmbeddedResource Include="Images\Icons\Cursors\help" /> - <EmbeddedResource Include="Images\Icons\Cursors\move" /> - <EmbeddedResource Include="Images\crow0.svg" /> - <EmbeddedResource Include="Images\Icons\crow.png" /> - <EmbeddedResource Include="Images\Icons\crow.svg" /> - <EmbeddedResource Include="Default.style" /> - <EmbeddedResource Include="Images\Icons\folder.svg" /> - <EmbeddedResource Include="Images\Icons\file.svg" /> - <EmbeddedResource Include="Templates\Button.template"> - <LogicalName>Crow.Button.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\CheckBox.template"> - <LogicalName>Crow.CheckBox.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ComboBox.template"> - <LogicalName>Crow.ComboBox.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Expandable.template"> - <LogicalName>Crow.Expandable.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\DirectoryView.template"> - <LogicalName>Crow.DirectoryView.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\FileDialog.template"> - <LogicalName>Crow.FileDialog.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\GroupBox.template"> - <LogicalName>Crow.GroupBox.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ListBox.template"> - <LogicalName>Crow.ListBox.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\MessageBox.template"> - <LogicalName>Crow.MessageBox.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Popper.template"> - <LogicalName>Crow.Popper.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\RadioButton.template"> - <LogicalName>Crow.RadioButton.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ScrollBar.template"> - <LogicalName>Crow.ScrollBar.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Slider.template"> - <LogicalName>Crow.Slider.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Spinner.template"> - <LogicalName>Crow.Spinner.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\TabItem.template"> - <LogicalName>Crow.TabItem.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\TreeView.template"> - <LogicalName>Crow.TreeView.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Window.template"> - <LogicalName>Crow.Window.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Images\Icons\Cursors\ibeam" /> - <EmbeddedResource Include="Templates\MenuItem.template"> - <LogicalName>Crow.MenuItem.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\Menu.template"> - <LogicalName>Crow.Menu.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ColorPicker.template"> - <LogicalName>Crow.ColorPicker.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ToolWindow.template"> - <LogicalName>Crow.ToolWindow.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Images\Icons\maximize.svg" /> - <EmbeddedResource Include="Images\Icons\minimize.svg" /> - <EmbeddedResource Include="Images\Icons\normalize.svg" /> - <EmbeddedResource Include="Icons\open-file.svg" /> - <EmbeddedResource Include="Icons\scissors.svg" /> - <EmbeddedResource Include="Icons\copy-file.svg" /> - <EmbeddedResource Include="Icons\exit-symbol.svg" /> - <EmbeddedResource Include="Icons\paste-on-document.svg" /> - <EmbeddedResource Include="Icons\question.svg" /> - <EmbeddedResource Include="Icons\folder.svg" /> - <EmbeddedResource Include="Icons\file.svg" /> - <EmbeddedResource Include="Icons\level-up.svg" /> - <EmbeddedResource Include="Icons\frame.svg" /> - <EmbeddedResource Include="Templates\FileItems.template" /> - <EmbeddedResource Include="Templates\DefaultItem.template"> - <LogicalName>Crow.DefaultItem.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ScrollingListBox.template" /> - <EmbeddedResource Include="Templates\imgItem.template" /> - <EmbeddedResource Include="Templates\ArrowBut.template" /> - <EmbeddedResource Include="Templates\treeList.template" /> - <EmbeddedResource Include="Templates\CheckBox2.template" /> - <EmbeddedResource Include="Icons\assembly.svg" /> - <EmbeddedResource Include="Templates\Tooltip.template"> - <LogicalName>Crow.Tooltip.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\ContextMenu.template"> - <LogicalName>Crow.ContextMenu.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Icons\compiler_error.svg" /> - <EmbeddedResource Include="Icons\project.svg" /> - <EmbeddedResource Include="Icons\crowproj.svg" /> - <EmbeddedResource Include="Icons\projectRef.svg" /> - <EmbeddedResource Include="Templates\DockWindow.template"> - <LogicalName>Crow.DockWindow.template</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="Templates\HScrollBar.template"> - <LogicalName>Crow.HScrollBar.template</LogicalName> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <None Include="Crow.dll.config"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="Icons\compiler_warning.svg" /> - <None Include="Icons\compiler_warning_orange.svg" /> - </ItemGroup> -</Project> @@ -1,12 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{74289092-9F70-4941-AFCB-DFD7BE2140B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Test", "Crow.Test\Crow.Test.csproj", "{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}" EndProject Global @@ -15,8 +13,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}.Release|Any CPU.ActiveCfg = Release|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -59,6 +55,6 @@ Global $6.Wrap = False $5.inheritsSet = Mono description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n - version = 0.5 + version = 0.8.0 EndGlobalSection EndGlobal diff --git a/Crow/Crow.NetStd.csproj b/Crow/Crow.NetStd.csproj new file mode 100644 index 00000000..3bbd2408 --- /dev/null +++ b/Crow/Crow.NetStd.csproj @@ -0,0 +1,60 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <RootNamespace>Crow</RootNamespace> + <Description>C.R.O.W. is a widget toolkit and rendering engine entirely developed in C# with templates, styles, compositing, and bindings.</Description> + +<!-- <TargetFramework>netstandard2.0</TargetFramework>--> + <TargetFramework>netcoreapp2.0</TargetFramework> + + <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath> + <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath> + + <DefineConstants>DESIGN_MODE</DefineConstants> + + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <EnableDefaultItems>false</EnableDefaultItems> + <EnableDefaultCompileItems>false</EnableDefaultCompileItems> + <PackOnBuild>true</PackOnBuild> + <PackageId>Crow</PackageId> + <PackageVersion>0.8</PackageVersion> + <Authors>JP Bruyère</Authors> + <Title>C# Rapid Open Widget Toolkit</Title> + <PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl> + <PackageIconUrl>https://jpbruyere.github.io/Crow/images/crow.png</PackageIconUrl> + <PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl> + <PackageTags>Crow Widget Interface GUI C# .Net Mono</PackageTags> + <PackageCopyright>Copyright 2013-2018</PackageCopyright> + <Owners>JP Bruyère</Owners> + </PropertyGroup> + + + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DefineConstants>TRACE;DESIGN_MODE;DEBUG</DefineConstants> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" /> + <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" /> + + <Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs" /> + + <EmbeddedResource Include="Templates\*.*"> + <LogicalName>Crow.%(Filename).template</LogicalName> + </EmbeddedResource> + + <EmbeddedResource Include="Default.style" /> + <EmbeddedResource Include="Icons\*.*" /> + + <PackageReference Include="NuGet.Build.Packaging" Version="0.2.2" /> + </ItemGroup> + <ItemGroup> + <Folder Include="src\backends\win32\" /> + </ItemGroup> + <ItemGroup> + <Compile Remove="src\backends\win32\User32\Structs\RawInputDevice.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="src\backends\win32\User32\Structs\RawInputDevice.cs" /> + </ItemGroup> +</Project> diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj new file mode 100644 index 00000000..656c9da9 --- /dev/null +++ b/Crow/Crow.csproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Crow</RootNamespace> + <AssemblyName>Crow</AssemblyName> + <FileAlignment>512</FileAlignment> + <AllowUnsafeBlocks>True</AllowUnsafeBlocks> + <NoStdLib>False</NoStdLib> + <TreatWarningsAsErrors>False</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <NoWin32Manifest>False</NoWin32Manifest> + <SignAssembly>false</SignAssembly> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <Description>C# Rapid Open Widget</Description> + <BaseAddress>4194304</BaseAddress> + <OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath> + <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath> + <AssemblyOriginatorKeyFile>crow.key</AssemblyOriginatorKeyFile> + <ReleaseVersion>0.8.0</ReleaseVersion> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> + <Optimize>false</Optimize> + <OutputPath>$(SolutionDir)build\Debug</OutputPath> + <DefineConstants>DEBUG_DRAGNDROP0;DEBUG_LOG0;XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants> + <EnvironmentVariables> + <EnvironmentVariables> + <Variable name="MONO_CAIRO_DEBUG_DISPOSE" value="1" /> + </EnvironmentVariables> + </EnvironmentVariables> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <Optimize>true</Optimize> + <DefineConstants>DESIGN_MODE</DefineConstants> + <OutputPath>$(SolutionDir)build\Release</OutputPath> + </PropertyGroup> + <ItemGroup> + <Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs;src\backends\win32\User32\Structs\RawInputDevice.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Drawing" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup /> + <ItemGroup> + <Folder Include="src\GraphicObjects\" /> + <Folder Include="src\Cairo\" /> + <Folder Include="src\win32\" /> + <Folder Include="Images\" /> + <Folder Include="Images\Icons\" /> + <Folder Include="src\CompilerServices\" /> + <Folder Include="src\Fill\" /> + <Folder Include="src\Input\" /> + <Folder Include="src\rsvg\" /> + <Folder Include="src\IML\" /> + <Folder Include="Icons\" /> + <Folder Include="src\debug\" /> + <Folder Include="src\backends\" /> + <Folder Include="src\backends\xlib\" /> + <Folder Include="src\backends\xcb\" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Icons\*.*" /> + <EmbeddedResource Include="Default.style" /> + <EmbeddedResource Include="Templates\Button.template"> + <LogicalName>Crow.Button.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\CheckBox.template"> + <LogicalName>Crow.CheckBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ComboBox.template"> + <LogicalName>Crow.ComboBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Expandable.template"> + <LogicalName>Crow.Expandable.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\DirectoryView.template"> + <LogicalName>Crow.DirectoryView.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\FileDialog.template"> + <LogicalName>Crow.FileDialog.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\GroupBox.template"> + <LogicalName>Crow.GroupBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ListBox.template"> + <LogicalName>Crow.ListBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\MessageBox.template"> + <LogicalName>Crow.MessageBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Popper.template"> + <LogicalName>Crow.Popper.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\RadioButton.template"> + <LogicalName>Crow.RadioButton.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ScrollBar.template"> + <LogicalName>Crow.ScrollBar.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Slider.template"> + <LogicalName>Crow.Slider.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Spinner.template"> + <LogicalName>Crow.Spinner.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\TabItem.template"> + <LogicalName>Crow.TabItem.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\TreeView.template"> + <LogicalName>Crow.TreeView.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Window.template"> + <LogicalName>Crow.Window.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Images\Icons\Cursors\ibeam" /> + <EmbeddedResource Include="Templates\MenuItem.template"> + <LogicalName>Crow.MenuItem.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Menu.template"> + <LogicalName>Crow.Menu.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ColorPicker.template"> + <LogicalName>Crow.ColorPicker.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ToolWindow.template"> + <LogicalName>Crow.ToolWindow.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\FileItems.template"> + <LogicalName>Crow.FileItems.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\DefaultItem.template"> + <LogicalName>Crow.DefaultItem.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ScrollingListBox.template"> + <LogicalName>Crow.ScrollingListBox.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\imgItem.template" /> + <EmbeddedResource Include="Templates\ArrowBut.template"> + <LogicalName>Crow.ArrowBut.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\treeList.template" /> + <EmbeddedResource Include="Templates\CheckBox2.template"> + <LogicalName>Crow.CheckBox2.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\Tooltip.template"> + <LogicalName>Crow.Tooltip.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\ContextMenu.template"> + <LogicalName>Crow.ContextMenu.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\DockWindow.template"> + <LogicalName>Crow.DockWindow.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="Templates\HScrollBar.template"> + <LogicalName>Crow.HScrollBar.template</LogicalName> + </EmbeddedResource> + <None Include="Crow.dll.config"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> +</Project> diff --git a/Crow.dll.config b/Crow/Crow.dll.config index 6341771d..43004762 100644 --- a/Crow.dll.config +++ b/Crow/Crow.dll.config @@ -10,6 +10,7 @@ <dllmap os="windows" dll="rsvg-2" target="librsvg-2-2.dll"/> + <dllmap os="windows" dll="cairo" target="libcairo-2.dll"/> <dllmap os="osx" dll="libgio-2.0-0.dll" target="libgio-2.0.0.dylib"/> <dllmap os="osx" dll="libgio-2.0-0.dll" target="libgio-2.0.0.dylib"/> diff --git a/Default.style b/Crow/Default.style index 5b36bc2d..5343c09f 100644 --- a/Default.style +++ b/Crow/Default.style @@ -4,7 +4,7 @@ MessageBox, Popper, Slider, Spinner, TextBox { Height = "Fit"; } Border { - Foreground = "Gray"; + Foreground = "Grey"; } CheckBox { Caption = "CheckBox"; } RadioButton { Caption = "RadioButton"; } @@ -14,13 +14,13 @@ GroupBox { Caption = "Group Box"; } ControlBorder { BorderWidth = "1"; - Foreground = "DimGray"; + Foreground = "DimGrey"; Background = "Transparent"; } ControlCaption { - Foreground = "Gray"; + Foreground = "Grey"; MouseEnter = "{Foreground=White}"; - MouseLeave = "{Foreground=Gray}"; + MouseLeave = "{Foreground=Grey}"; } Icon { Margin = "1"; @@ -42,7 +42,8 @@ Label { } Menu { Margin = "1"; - Background = "vgradient|0:DimGray|1:Black"; + Background = "vgradient|0:DimGrey|1:Black"; + //Background = "Transparent"; Height = "Fit"; Width = "Stretched"; VerticalAlignment = "Top"; @@ -52,10 +53,13 @@ MenuItem { Caption = "MenuItem"; Width = "Stretched"; Height = "Fit"; - Background = "Transparent"; - Foreground = "LightGray"; - MouseEnter = "{Background = vgradient|0:SteelBlue|1:Jet;Foreground=White;}"; - MouseLeave = "{Foreground=LightGray;Background=Transparent;}"; + //Background = "vgradient|0:DimGrey|1:Black"; + //Background = "Transparent"; + Foreground = "LightGrey"; + //MouseEnter = "{Background=SteelBlue;}"; + //MouseLeave = "{Background=Transparent;}"; + //MouseEnter = "{Background = vgradient|0:SteelBlue|1:Jet;Foreground=White;}"; + //MouseLeave = "{Foreground=LightGrey;Background=Transparent;}"; SelectionBackground = "Transparent"; } MessageBox { @@ -67,18 +71,18 @@ MessageBox { AlwaysOnTop = "true"; } Slider { - Background = "vgradient|0:Black|0.1:Gray|0.9:Gray|1:LightGray"; - Foreground = "Gray"; + Background = "vgradient|0:Black|0.1:Grey|0.9:Grey|1:LightGrey"; + Foreground = "Grey"; Height = "10"; Value="5"; } Splitter { Focusable = "true"; Margin = "1"; - Background = "Gray"; + Background = "Grey"; } Spinner { - Foreground = "DimGray"; + Foreground = "DimGrey"; } TabView { CacheEnabled = "false"; @@ -89,7 +93,7 @@ TabItem { Focusable = "true"; CacheEnabled = "true"; //MouseEnter = "{Background = Cobalt;Foreground=White;}"; - //MouseLeave = "{Foreground=LightGray;Background=Jet;}"; + //MouseLeave = "{Foreground=LightGrey;Background=Jet;}"; AllowDrag = "true"; } TextBox { @@ -128,13 +132,14 @@ DockStack { //EndDrag="{Background=Jet}"; } DockWindow { - Background = "Onyx"; + //Background = "Onyx"; Focusable = "true"; AllowDrag = "true"; AlwaysOnTop = "true"; Margin="0"; Width="200"; Height="200"; + //MinimumSize="50,50"; } FileDialog { Template = "#Crow.FileDialog.template"; @@ -147,15 +152,6 @@ FileDialog { ProgressBar { Foreground = "vgradient|0:DarkBlue|0.5:SkyBlue|1:DarkBlue"; } -ScrollBar { - Maximum = "0"; - Value = "0"; -} -HScrollBar { - Template = "#Crow.HScrollBar.template"; - Maximum = "0"; - Value = "0"; -} Scroller { CacheEnabled = "false"; } @@ -184,33 +180,45 @@ TxtInFileDialog { Font = "droid, 12"; } CheckBoxAlt { - Template= "#Crow.Templates.CheckBox2.template"; + Template= "#Crow.CheckBox2.template"; Background = "Transparent"; - Checked="{Background=Gray;Foreground=LightGray;}"; - Unchecked = "{Background=Transparent;Foreground=DimGray;}"; + Checked="{Background=Grey;Foreground=LightGrey;}"; + Unchecked = "{Background=Transparent;Foreground=DimGrey;}"; } ArrowBut { - MouseRepeat="true"; - Height="Fit"; - Width="Fit"; + MouseRepeat="true"; Focusable="true"; Foreground="Onyx"; - Background="hgradient|0:Gray|1:Jet"; + Background="hgradient|0:Grey|1:Jet"; MouseDown="{Background=hgradient|0:White|0.4:CornflowerBlue|1:Jet}"; - MouseUp="{Background=hgradient|0:Gray|1:DimGray}"; + MouseUp="{Background=hgradient|0:Grey|1:DimGrey}"; MouseEnter="{Foreground=Black}"; MouseLeave="{Foreground=Onyx}"; } HArrowBut { MouseRepeat="true"; - Height="Fit"; - Width="Fit"; - Focusable="true"; - Foreground="Jet"; - Background="vgradient|0:Gray|1:DimGray"; + Focusable="true"; + Foreground="Onyx"; + Background="vgradient|0:Grey|1:DimGrey"; MouseDown="{Background=vgradient|0:White|0.4:DarkBlue|1:Jet}"; - MouseUp="{Background=vgradient|0:Gray|1:DimGray}"; + MouseUp="{Background=vgradient|0:Grey|1:DimGrey}"; MouseEnter="{Foreground=Black}"; - MouseLeave="{Foreground=DimGray}"; + MouseLeave="{Foreground=DimGrey}"; +} +ScrollBar { + Maximum = "0"; + Value = "0"; + Background = "Silver"; + Foreground = "DimGrey"; + Width = "12"; + CornerRadius = "0"; + Margin="0"; +} +HScrollBar { + Template = "#Crow.HScrollBar.template"; + Maximum = "0"; + Value = "0"; + Height = "12"; + Width = "Stretched"; }
\ No newline at end of file diff --git a/Images/Icons/IconAlerte.svg b/Crow/Icons/IconAlerte.svg index 286dbf3a..286dbf3a 100755 --- a/Images/Icons/IconAlerte.svg +++ b/Crow/Icons/IconAlerte.svg diff --git a/Icons/Icon_no.svg b/Crow/Icons/Icon_no.svg index c7613fbc..c7613fbc 100644 --- a/Icons/Icon_no.svg +++ b/Crow/Icons/Icon_no.svg diff --git a/Icons/assembly.svg b/Crow/Icons/assembly.svg index 5ac3643a..5ac3643a 100644 --- a/Icons/assembly.svg +++ b/Crow/Icons/assembly.svg diff --git a/Images/Icons/checkbox.svg b/Crow/Icons/checkbox.svg index 6b6914ae..6b6914ae 100644 --- a/Images/Icons/checkbox.svg +++ b/Crow/Icons/checkbox.svg diff --git a/Icons/compiler_error.svg b/Crow/Icons/compiler_error.svg index 1b505681..1b505681 100644 --- a/Icons/compiler_error.svg +++ b/Crow/Icons/compiler_error.svg diff --git a/Icons/compiler_warning.svg b/Crow/Icons/compiler_warning.svg index 9dac3772..9dac3772 100644 --- a/Icons/compiler_warning.svg +++ b/Crow/Icons/compiler_warning.svg diff --git a/Icons/compiler_warning_orange.svg b/Crow/Icons/compiler_warning_orange.svg index 233437ff..233437ff 100644 --- a/Icons/compiler_warning_orange.svg +++ b/Crow/Icons/compiler_warning_orange.svg diff --git a/Icons/copy-file.svg b/Crow/Icons/copy-file.svg index 63c2dd37..63c2dd37 100644 --- a/Icons/copy-file.svg +++ b/Crow/Icons/copy-file.svg diff --git a/Images/Icons/crow.svg b/Crow/Icons/crow.svg index 4904e68e..4904e68e 100644 --- a/Images/Icons/crow.svg +++ b/Crow/Icons/crow.svg diff --git a/Icons/crowproj.svg b/Crow/Icons/crowproj.svg index b0f6b860..b0f6b860 100644 --- a/Icons/crowproj.svg +++ b/Crow/Icons/crowproj.svg diff --git a/Icons/exit-symbol.svg b/Crow/Icons/exit-symbol.svg index 3fbaa0d2..3fbaa0d2 100644 --- a/Icons/exit-symbol.svg +++ b/Crow/Icons/exit-symbol.svg diff --git a/Images/Icons/exit2.svg b/Crow/Icons/exit2.svg index 2361ba89..2361ba89 100644 --- a/Images/Icons/exit2.svg +++ b/Crow/Icons/exit2.svg diff --git a/Images/Icons/expandable.svg b/Crow/Icons/expandable.svg index 134d02e8..134d02e8 100644 --- a/Images/Icons/expandable.svg +++ b/Crow/Icons/expandable.svg diff --git a/Icons/file.svg b/Crow/Icons/file.svg index b156b0ab..b156b0ab 100644 --- a/Icons/file.svg +++ b/Crow/Icons/file.svg diff --git a/Icons/folder.svg b/Crow/Icons/folder.svg index 84caa4fb..84caa4fb 100644 --- a/Icons/folder.svg +++ b/Crow/Icons/folder.svg diff --git a/Icons/frame.svg b/Crow/Icons/frame.svg index 576d418f..576d418f 100644 --- a/Icons/frame.svg +++ b/Crow/Icons/frame.svg diff --git a/Images/Icons/iconInfo.svg b/Crow/Icons/iconInfo.svg index 82345509..82345509 100644 --- a/Images/Icons/iconInfo.svg +++ b/Crow/Icons/iconInfo.svg diff --git a/Icons/level-up.svg b/Crow/Icons/level-up.svg index 86d7c784..86d7c784 100644 --- a/Icons/level-up.svg +++ b/Crow/Icons/level-up.svg diff --git a/Images/Icons/maximize.svg b/Crow/Icons/maximize.svg index b70604a6..b70604a6 100644 --- a/Images/Icons/maximize.svg +++ b/Crow/Icons/maximize.svg diff --git a/Images/Icons/minimize.svg b/Crow/Icons/minimize.svg index dc3dcd2e..dc3dcd2e 100644 --- a/Images/Icons/minimize.svg +++ b/Crow/Icons/minimize.svg diff --git a/Images/Icons/normalize.svg b/Crow/Icons/normalize.svg index b8b44bd5..b8b44bd5 100644 --- a/Images/Icons/normalize.svg +++ b/Crow/Icons/normalize.svg diff --git a/Icons/open-file.svg b/Crow/Icons/open-file.svg index d5c6a84d..d5c6a84d 100644 --- a/Icons/open-file.svg +++ b/Crow/Icons/open-file.svg diff --git a/Icons/paste-on-document.svg b/Crow/Icons/paste-on-document.svg index b0a705ee..b0a705ee 100644 --- a/Icons/paste-on-document.svg +++ b/Crow/Icons/paste-on-document.svg diff --git a/Icons/project.svg b/Crow/Icons/project.svg index 7522605c..7522605c 100644 --- a/Icons/project.svg +++ b/Crow/Icons/project.svg diff --git a/Icons/projectRef.svg b/Crow/Icons/projectRef.svg index 3ebd7b5f..3ebd7b5f 100644 --- a/Icons/projectRef.svg +++ b/Crow/Icons/projectRef.svg diff --git a/Icons/question.svg b/Crow/Icons/question.svg index fb8e3d3f..fb8e3d3f 100644 --- a/Icons/question.svg +++ b/Crow/Icons/question.svg diff --git a/Images/Icons/radiobutton.svg b/Crow/Icons/radiobutton.svg index b102b3e1..b102b3e1 100644 --- a/Images/Icons/radiobutton.svg +++ b/Crow/Icons/radiobutton.svg diff --git a/Icons/scissors.svg b/Crow/Icons/scissors.svg index 4b5a2255..4b5a2255 100644 --- a/Icons/scissors.svg +++ b/Crow/Icons/scissors.svg diff --git a/Images/Icons/updown.svg b/Crow/Icons/updown.svg index 0df81756..0df81756 100644 --- a/Images/Icons/updown.svg +++ b/Crow/Icons/updown.svg diff --git a/Icons/warning_construction.svg b/Crow/Icons/warning_construction.svg index 4c101ec0..4c101ec0 100644 --- a/Icons/warning_construction.svg +++ b/Crow/Icons/warning_construction.svg diff --git a/Images/Icons/Cursors/arrow b/Crow/Images/Icons/Cursors/arrow Binary files differindex 61f968ef..61f968ef 100644 --- a/Images/Icons/Cursors/arrow +++ b/Crow/Images/Icons/Cursors/arrow diff --git a/Images/Icons/Cursors/bottom_left_corner b/Crow/Images/Icons/Cursors/bottom_left_corner Binary files differindex e9a41a20..e9a41a20 100644 --- a/Images/Icons/Cursors/bottom_left_corner +++ b/Crow/Images/Icons/Cursors/bottom_left_corner diff --git a/Images/Icons/Cursors/bottom_right_corner b/Crow/Images/Icons/Cursors/bottom_right_corner Binary files differindex 208faf48..208faf48 100644 --- a/Images/Icons/Cursors/bottom_right_corner +++ b/Crow/Images/Icons/Cursors/bottom_right_corner diff --git a/Images/Icons/Cursors/cross b/Crow/Images/Icons/Cursors/cross Binary files differindex 4596b480..4596b480 100644 --- a/Images/Icons/Cursors/cross +++ b/Crow/Images/Icons/Cursors/cross diff --git a/Images/Icons/Cursors/hand b/Crow/Images/Icons/Cursors/hand Binary files differindex 23939b74..23939b74 100644 --- a/Images/Icons/Cursors/hand +++ b/Crow/Images/Icons/Cursors/hand diff --git a/Images/Icons/Cursors/help b/Crow/Images/Icons/Cursors/help Binary files differindex cd7ec277..cd7ec277 100644 --- a/Images/Icons/Cursors/help +++ b/Crow/Images/Icons/Cursors/help diff --git a/Images/Icons/Cursors/ibeam b/Crow/Images/Icons/Cursors/ibeam Binary files differindex ccbdcb5c..ccbdcb5c 100644 --- a/Images/Icons/Cursors/ibeam +++ b/Crow/Images/Icons/Cursors/ibeam diff --git a/Images/Icons/Cursors/move b/Crow/Images/Icons/Cursors/move Binary files differindex ab98f6a3..ab98f6a3 100644 --- a/Images/Icons/Cursors/move +++ b/Crow/Images/Icons/Cursors/move diff --git a/Images/Icons/Cursors/sb_h_double_arrow b/Crow/Images/Icons/Cursors/sb_h_double_arrow Binary files differindex 1768b6a0..1768b6a0 100644 --- a/Images/Icons/Cursors/sb_h_double_arrow +++ b/Crow/Images/Icons/Cursors/sb_h_double_arrow diff --git a/Images/Icons/Cursors/sb_v_double_arrow b/Crow/Images/Icons/Cursors/sb_v_double_arrow Binary files differindex a36abd4b..a36abd4b 100644 --- a/Images/Icons/Cursors/sb_v_double_arrow +++ b/Crow/Images/Icons/Cursors/sb_v_double_arrow diff --git a/Images/Icons/Cursors/top_left_corner b/Crow/Images/Icons/Cursors/top_left_corner Binary files differindex 3493adc6..3493adc6 100644 --- a/Images/Icons/Cursors/top_left_corner +++ b/Crow/Images/Icons/Cursors/top_left_corner diff --git a/Images/Icons/Cursors/top_right_corner b/Crow/Images/Icons/Cursors/top_right_corner Binary files differindex 264cc577..264cc577 100644 --- a/Images/Icons/Cursors/top_right_corner +++ b/Crow/Images/Icons/Cursors/top_right_corner diff --git a/Images/Icons/buttonB.svg b/Crow/Images/Icons/buttonB.svg index 56bc8d9c..56bc8d9c 100755 --- a/Images/Icons/buttonB.svg +++ b/Crow/Images/Icons/buttonB.svg diff --git a/Images/Icons/crow.png b/Crow/Images/Icons/crow.png Binary files differindex 7b737d04..7b737d04 100644 --- a/Images/Icons/crow.png +++ b/Crow/Images/Icons/crow.png diff --git a/Images/Icons/exit.svg b/Crow/Images/Icons/exit.svg index cb8d1c27..cb8d1c27 100644 --- a/Images/Icons/exit.svg +++ b/Crow/Images/Icons/exit.svg diff --git a/Images/Icons/file.svg b/Crow/Images/Icons/file.svg index a31c367e..a31c367e 100644 --- a/Images/Icons/file.svg +++ b/Crow/Images/Icons/file.svg diff --git a/Images/Icons/folder.svg b/Crow/Images/Icons/folder.svg index beac8a1b..beac8a1b 100644 --- a/Images/Icons/folder.svg +++ b/Crow/Images/Icons/folder.svg diff --git a/Images/Icons/member.svg b/Crow/Images/Icons/member.svg index af654a94..af654a94 100644 --- a/Images/Icons/member.svg +++ b/Crow/Images/Icons/member.svg diff --git a/Images/Icons/tetra.png b/Crow/Images/Icons/tetra.png Binary files differindex b0c855aa..b0c855aa 100644 --- a/Images/Icons/tetra.png +++ b/Crow/Images/Icons/tetra.png diff --git a/Images/button.svg b/Crow/Images/button.svg index 314f63fb..314f63fb 100644 --- a/Images/button.svg +++ b/Crow/Images/button.svg diff --git a/Images/crow0.svg b/Crow/Images/crow0.svg index c6211302..c6211302 100644 --- a/Images/crow0.svg +++ b/Crow/Images/crow0.svg diff --git a/Images/meter.svg b/Crow/Images/meter.svg index cc3d4e90..cc3d4e90 100755 --- a/Images/meter.svg +++ b/Crow/Images/meter.svg diff --git a/Images/screenshot.png b/Crow/Images/screenshot.png Binary files differindex 3540d6b1..3540d6b1 100644 --- a/Images/screenshot.png +++ b/Crow/Images/screenshot.png diff --git a/Images/screenshot2.png b/Crow/Images/screenshot2.png Binary files differindex 46a7bec2..46a7bec2 100644 --- a/Images/screenshot2.png +++ b/Crow/Images/screenshot2.png diff --git a/Crow/Templates/ArrowBut.template b/Crow/Templates/ArrowBut.template new file mode 100755 index 00000000..2d3bb292 --- /dev/null +++ b/Crow/Templates/ArrowBut.template @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<Border Name="Content" + Background="vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black" Foreground="DarkGrey" + MouseEnter="{Foreground=White}" + MouseLeave="{Foreground=DarkGrey}" + MouseDown="{Background=vgradient|0:Black|0.1:LightGrey|0.9:LightGrey|1:White}" + MouseUp="{Background=vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black}" + > +</Border> diff --git a/Templates/Button.template b/Crow/Templates/Button.template index 92ddb39c..d2f6c602 100755 --- a/Templates/Button.template +++ b/Crow/Templates/Button.template @@ -1,10 +1,10 @@ <?xml version="1.0"?> <Border Background="{./Background}" MinimumSize="50,20" Name="Content" Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1" - MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black;caption.Foreground=White}" - MouseLeave="{Foreground=Transparent;caption.Foreground=LightGray}" - MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}" - MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}" + MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black;caption.Foreground=White}" + MouseLeave="{Foreground=Transparent;caption.Foreground=LightGrey}" + MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}" + MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}" > - <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGray" Text="{./Caption}"/> + <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/> </Border> diff --git a/Templates/CheckBox.template b/Crow/Templates/CheckBox.template index a9a62a4a..f24b50a7 100755 --- a/Templates/CheckBox.template +++ b/Crow/Templates/CheckBox.template @@ -1,6 +1,6 @@ <?xml version="1.0"?> <HorizontalStack Style="Control" Background="{./Background}"> - <Image Style="Icon" Path="#Crow.Images.Icons.checkbox.svg" + <Image Style="Icon" Path="#Crow.Icons.checkbox.svg" SvgSub="{./IsChecked}"/> <Label Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/> </HorizontalStack>
\ No newline at end of file diff --git a/Templates/CheckBox2.template b/Crow/Templates/CheckBox2.template index db61dd1a..0fa0ffef 100644 --- a/Templates/CheckBox2.template +++ b/Crow/Templates/CheckBox2.template @@ -1,4 +1,4 @@ -<Border Foreground="Transparent" MouseEnter="{Foreground=Gray}" MouseLeave="{Foreground=Transparent}"> +<Border Foreground="Transparent" MouseEnter="{Foreground=Grey}" MouseLeave="{Foreground=Transparent}"> <Label Font="{./Font}" Text="{./Caption}" Margin="1" Background="{./Background}" diff --git a/Templates/ColorPicker.template b/Crow/Templates/ColorPicker.template index 71965850..71965850 100755 --- a/Templates/ColorPicker.template +++ b/Crow/Templates/ColorPicker.template diff --git a/Templates/ComboBox.template b/Crow/Templates/ComboBox.template index 7b7e8392..f08a8393 100755 --- a/Templates/ComboBox.template +++ b/Crow/Templates/ComboBox.template @@ -3,20 +3,20 @@ <Template> <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}"> <Template> - <Border CornerRadius="0" Foreground="LightGray"> + <Border CornerRadius="0" Foreground="LightGrey"> <HorizontalStack Margin="0" Spacing="1"> <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White" Text="{./Caption}"/> <Button Width="14" Height="14" Focusable="false" - Template="#Crow.Templates.ArrowBut.template"> - <Image Margin="0" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/> + Template="#Crow.ArrowBut.template"> + <Image Margin="0" Path="#Crow.Icons.updown.svg" SvgSub="down"/> </Button> </HorizontalStack> </Border> </Template> </CheckBox> </Template> - <Border Background="DimGray" BorderWidth="1" Margin="1" + <Border Background="DimGrey" BorderWidth="1" Margin="1" MinimumSize="{../../MinimumPopupSize}" Fit="true"> <Scroller Name="scroller1" Margin="2" MaximumSize="0,200" diff --git a/Templates/ContextMenu.template b/Crow/Templates/ContextMenu.template index 06dbc4b9..7fc8dcc9 100644 --- a/Templates/ContextMenu.template +++ b/Crow/Templates/ContextMenu.template @@ -4,7 +4,7 @@ Background="Red"> <Template> <HorizontalStack> - <Border Background="DimGray" Foreground="DimGray" CornerRadius="5"> + <Border Background="DimGrey" Foreground="DimGrey" CornerRadius="5"> <GenericStack Orientation="{./Orientation}" Name="ItemsContainer" Margin="2"/> </Border> @@ -19,10 +19,10 @@ <Template> <Border Name="border1" CornerRadius="2" - MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}" + MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}" MouseLeave="{Foreground=Transparent}" - MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}" - MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}" + MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}" + MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}" MinimumSize = "60,0" Foreground="Transparent" Background="{./Background}"> @@ -32,7 +32,7 @@ Font="{./Font}" /> </Border> </Template> - <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGray"> + <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGrey"> <VerticalStack Name="ItemsContainer"/> </Border> </Popper> diff --git a/Templates/DefaultItem.template b/Crow/Templates/DefaultItem.template index fc13ab4d..fc13ab4d 100755 --- a/Templates/DefaultItem.template +++ b/Crow/Templates/DefaultItem.template diff --git a/Templates/DirectoryView.template b/Crow/Templates/DirectoryView.template index 2e42ae91..9faab17b 100755 --- a/Templates/DirectoryView.template +++ b/Crow/Templates/DirectoryView.template @@ -3,7 +3,7 @@ SelectedItemChanged="./onSelectedItemChanged"> <ItemTemplate DataType="System.IO.FileInfo"> <Border CornerRadius="2" Margin="0" Focusable="true" Height="Fit" Width="Stretched" Foreground="Transparent" - MouseEnter="{Foreground=DimGray}" + MouseEnter="{Foreground=DimGrey}" MouseLeave="{Foreground=Transparent}"> <HorizontalStack> <Image Margin="1" Width="14" Height="14" @@ -18,14 +18,14 @@ <VerticalStack> <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand" Foreground="Transparent" - MouseEnter="{Foreground=DimGray}" + MouseEnter="{Foreground=DimGrey}" MouseLeave="{Foreground=Transparent}"> <HorizontalStack Spacing="1"> <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand" Path="{./Image}" Visible="{./IsExpandable}" SvgSub="{./IsExpanded}" - MouseEnter="{Background=LightGray}" + MouseEnter="{Background=LightGrey}" MouseLeave="{Background=Transparent}"/> <Image Margin="1" Width="14" Height="14" Path="#Crow.Icons.folder.svg"/> diff --git a/Templates/DockWindow.template b/Crow/Templates/DockWindow.template index 71685a16..1763b08f 100755 --- a/Templates/DockWindow.template +++ b/Crow/Templates/DockWindow.template @@ -5,11 +5,14 @@ MouseEnter="./onBorderMouseEnter" MouseLeave="./onBorderMouseLeave"> <VerticalStack Spacing="0"> - <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Gray"> + <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="vgradient|0:0.3,0.5,0.8,0.9|1:0.1,0.1,0.1,0.9"> <Label Text="{./Caption}" TextAlignment="Left" Width="Stretched" - Foreground="Black" /> - <Image Width="10" Height="10" Focusable="true" Margin="0" Path="#Crow.Images.Icons.exit2.svg" + Foreground="White" /> + <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="10" Width="10" + MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> + <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> + </Border> </HorizontalStack> <HorizontalStack Background="vgradient|0:0.5,0.6,0.5,0.5|1:0.2,0.3,0.3,0.7" Name="hs" Margin="0" Spacing="0" Height="Fit" Visible="{./IsFloating}"> @@ -18,7 +21,7 @@ <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Left" Text="{./Caption}" /> <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="10" Width="10" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> </Border> <GraphicObject Width="5"/> diff --git a/Templates/Expandable.template b/Crow/Templates/Expandable.template index a36958d5..e0ba29b8 100755 --- a/Templates/Expandable.template +++ b/Crow/Templates/Expandable.template @@ -1,12 +1,12 @@ <?xml version="1.0"?> <Border Style="ControlBorder" Foreground="{./Foreground}" Background="{./Background}"> <VerticalStack> - <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand"> - <Container Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand" - MouseEnter="{Background=LightGray}" + <HorizontalStack Spacing="1" Height="Fit" Focusable="true" MouseDoubleClick="./onClickForExpand"> + <Container Margin="1" Width="9" Height="9" MouseDown="./onClickForExpand" + MouseEnter="{Background=LightGrey}" MouseLeave="{Background=Transparent}"> <Image - Path="#Crow.Images.Icons.expandable.svg" + Path="#Crow.Icons.expandable.svg" Visible="{./IsExpandable}" SvgSub="{./IsExpanded}"/> </Container> diff --git a/Templates/FileDialog.template b/Crow/Templates/FileDialog.template index 42b5ec0c..50be2198 100644 --- a/Templates/FileDialog.template +++ b/Crow/Templates/FileDialog.template @@ -11,7 +11,7 @@ <Label Width="Stretched" Foreground="{./TitleBarForeground}" Margin="1" TextAlignment="Center" Text="{./Caption}" /> <Border CornerRadius="0" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> </Border> <GraphicObject Width="5"/> @@ -28,7 +28,7 @@ <DirectoryView ShowHidden="{²../cbShowHidden.IsChecked}" FileMask="{²../txtFileMask.Text}" ShowFiles="{²../cbShowFiles.IsChecked}" Name="fv" CurrentDirectory="{./CurrentDirectory}" SelectedItemChanged="./onFVSelectedItemChanged" Width="100%" Margin="0" MouseDoubleClick="./onFileSelect"> <Template> - <ListBox ItemTemplate="#Crow.Templates.FileItems.template" Name="fileView" Data="{./FileSystemEntries}" + <ListBox ItemTemplate="#Crow.FileItems.template" Name="fileView" Data="{./FileSystemEntries}" SelectedItemChanged="./onSelectedItemChanged"> <Template> <HorizontalStack> diff --git a/Templates/FileItems.template b/Crow/Templates/FileItems.template index 452a402a..452a402a 100644 --- a/Templates/FileItems.template +++ b/Crow/Templates/FileItems.template diff --git a/Templates/GroupBox.template b/Crow/Templates/GroupBox.template index 199cfe9b..199cfe9b 100755 --- a/Templates/GroupBox.template +++ b/Crow/Templates/GroupBox.template diff --git a/Crow/Templates/HScrollBar.template b/Crow/Templates/HScrollBar.template new file mode 100755 index 00000000..a4ab6416 --- /dev/null +++ b/Crow/Templates/HScrollBar.template @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}"> + <GenericStack Orientation="{./Orientation}" Spacing="0"> + <Shape Style="HArrowBut" MouseDown="./onScrollBack" + Margin="1" Width="6" Size="10,10" Path="M 0.5,4.5 L 9.5,0.5 L 9.5,9.5 Z"/> + <Slider Name="Slider" + Orientation="{./Orientation}" + Value="{²./Value}" + Maximum="{./Maximum}" + CursorSize="{./CursorSize}" + Height="{./HeightPolicy}" Width="{./WidthPolicy}" + LargeIncrement="{./LargeIncrement}" + SmallIncrement="{./SmallIncrement}" + CursorColor="vgradient|0:Silver|1:Grey" + Background="Transparent" + Foreground="{./Foreground}"/> + <Shape Style="HArrowBut" MouseDown="./onScrollForth" + Margin="1" Width="6" Size="10,10" Path="M 0.5,0.5 L 9.5,4.5 L 0.5,9.5 Z"/> + </GenericStack> +</Border>
\ No newline at end of file diff --git a/Templates/ListBox.template b/Crow/Templates/ListBox.template index a1aea50f..a1aea50f 100755 --- a/Templates/ListBox.template +++ b/Crow/Templates/ListBox.template diff --git a/Templates/Menu.template b/Crow/Templates/Menu.template index 99ae5545..99ae5545 100644 --- a/Templates/Menu.template +++ b/Crow/Templates/Menu.template diff --git a/Templates/MenuItem.template b/Crow/Templates/MenuItem.template index c0a1fbf7..4f77fb46 100644 --- a/Templates/MenuItem.template +++ b/Crow/Templates/MenuItem.template @@ -1,4 +1,5 @@ <?xml version="1.0"?> +<HorizontalStack> <Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}" Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click" IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}"> @@ -6,10 +7,6 @@ <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}"> <Template> <Border Name="border1" - MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}" - MouseLeave="{Foreground=Transparent}" - MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}" - MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}" MinimumSize = "60,0" Foreground="Transparent" Background="{./Background}"> @@ -21,7 +18,9 @@ </Template> </CheckBox> </Template> - <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Jet"> + <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="vgradient|0:DimGrey|1:Black"> <VerticalStack Name="ItemsContainer"/> </Border> </Popper> +<GraphicObject Background="Green" Width="5" Height="5" Visible="{./AutomaticOpening}"/> +</HorizontalStack> diff --git a/Templates/MessageBox.template b/Crow/Templates/MessageBox.template index e8b58ad1..54016de6 100644 --- a/Templates/MessageBox.template +++ b/Crow/Templates/MessageBox.template @@ -11,15 +11,15 @@ <Label Width="Stretched" Foreground="{./TitleBarForeground}" Margin="1" TextAlignment="Center" Text="{./Caption}" /> <Border CornerRadius="3" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> </Border> <GraphicObject Width="5" Height="5"/> </HorizontalStack> </Border> - <HorizontalStack Margin="5" > + <HorizontalStack Margin="5" Width="Stretched"> <Image Name="Image" Width="50" Height="30" Path="{./MsgIcon}" /> - <Label Margin="5" Font="{./Font}" Width="Fit" Text="{./Message}" + <Label Margin="5" Font="{./Font}" Width="Stretched" Text="{./Message}" TextAlignment="Center" Multiline="true" /> </HorizontalStack> diff --git a/Templates/Popper.template b/Crow/Templates/Popper.template index 78a60842..47c6034c 100755 --- a/Templates/Popper.template +++ b/Crow/Templates/Popper.template @@ -6,7 +6,7 @@ <Image Style="Icon" Margin="1" Width="9" Height="9" MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}" Background="{./Background}" - Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsChecked}"/> + Path="#Crow.Icons.expandable.svg" SvgSub="{./IsChecked}"/> <Label Style="ControlCaption" Text="{./Caption}" /> </HorizontalStack> </Border> diff --git a/Templates/RadioButton.template b/Crow/Templates/RadioButton.template index b96eec2c..8e97a788 100755 --- a/Templates/RadioButton.template +++ b/Crow/Templates/RadioButton.template @@ -1,6 +1,6 @@ <?xml version="1.0"?> <HorizontalStack Style="Control" Background="{./Background}"> - <Image Style="Icon" Path="#Crow.Images.Icons.radiobutton.svg" + <Image Style="Icon" Path="#Crow.Icons.radiobutton.svg" SvgSub="{./IsChecked}"/> <Label Text="{./Caption}"/> </HorizontalStack>
\ No newline at end of file diff --git a/Crow/Templates/ScrollBar.template b/Crow/Templates/ScrollBar.template new file mode 100755 index 00000000..158671e5 --- /dev/null +++ b/Crow/Templates/ScrollBar.template @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}"> + <GenericStack Orientation="{./Orientation}" Spacing="0"> + <Shape Style="ArrowBut" MouseDown="./onScrollBack" + Margin="1" Height="6" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z"/> + <Slider Name="Slider" + Orientation="{./Orientation}" + Value="{²./Value}" + Maximum="{./Maximum}" + CursorSize="{./CursorSize}" + Height="{./HeightPolicy}" Width="{./WidthPolicy}" + LargeIncrement="{./LargeIncrement}" + SmallIncrement="{./SmallIncrement}" + CursorColor="hgradient|0:Silver|1:Grey" + Foreground="{./Foreground}" + Background="Transparent"/> + <Shape Style="ArrowBut" MouseDown="./onScrollForth" + Margin="1" Height="6" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z"/> + </GenericStack> +</Border>
\ No newline at end of file diff --git a/Templates/ScrollingListBox.template b/Crow/Templates/ScrollingListBox.template index 1e7304f0..1e7304f0 100644 --- a/Templates/ScrollingListBox.template +++ b/Crow/Templates/ScrollingListBox.template diff --git a/Templates/Slider.template b/Crow/Templates/Slider.template index 9c7bb705..9c7bb705 100755 --- a/Templates/Slider.template +++ b/Crow/Templates/Slider.template diff --git a/Templates/Spinner.template b/Crow/Templates/Spinner.template index 60d7ccf9..60d7ccf9 100755 --- a/Templates/Spinner.template +++ b/Crow/Templates/Spinner.template diff --git a/Templates/TabItem.template b/Crow/Templates/TabItem.template index 55498533..b06c9e42 100644 --- a/Templates/TabItem.template +++ b/Crow/Templates/TabItem.template @@ -2,16 +2,16 @@ <GenericStack Orientation="Vertical" Spacing="0" Background="{./Background}" MouseEnter="{/caption.Foreground=White}" - MouseLeave="{/caption.Foreground=Gray}"> + MouseLeave="{/caption.Foreground=Grey}"> <HorizontalStack Margin="2" Left="{./TabOffset}" Name="TabTitle" HorizontalAlignment="Left" Height="{./TabHeight}" Width="{./TabWidth}"> - <Label Name="caption" Text="{./Caption}" Foreground="Gray"/> + <Label Name="caption" Text="{./Caption}" Foreground="Grey"/> <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" MouseClick="./butCloseTabClick"/> </Border> </HorizontalStack> diff --git a/Templates/ToolWindow.template b/Crow/Templates/ToolWindow.template index 2fcb7309..16f0c71a 100755 --- a/Templates/ToolWindow.template +++ b/Crow/Templates/ToolWindow.template @@ -13,7 +13,7 @@ <Label Width="Stretched" Foreground="{./TitleBarForeground}" Margin="1" TextAlignment="Center" Text="{./Caption}" /> <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> </Border> <GraphicObject Width="5"/> diff --git a/Crow/Templates/Tooltip.template b/Crow/Templates/Tooltip.template new file mode 100644 index 00000000..277ac7cd --- /dev/null +++ b/Crow/Templates/Tooltip.template @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<Border Fit="true" Foreground="DimGrey" Background="Khaki"> + <Label Margin="3" Foreground="DimGrey" Multiline="true" Text="{Tooltip}"/> +</Border> diff --git a/Templates/TreeView.template b/Crow/Templates/TreeView.template index 9c18120e..0f4d9ebd 100644 --- a/Templates/TreeView.template +++ b/Crow/Templates/TreeView.template @@ -11,6 +11,5 @@ LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" CursorSize="{../scroller1.ChildHeightRatio}" Value="{²../scroller1.ScrollY}" - Maximum="{../scroller1.MaxScrollY}" - Width="14" Orientation="Vertical"/> + Maximum="{../scroller1.MaxScrollY}" Orientation="Vertical"/> </HorizontalStack> diff --git a/Templates/Window.template b/Crow/Templates/Window.template index 770d5c2c..1e66a6da 100755 --- a/Templates/Window.template +++ b/Crow/Templates/Window.template @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}" +<Border BorderWidth="1" Foreground="Grey" CornerRadius="{./CornerRadius}" Background="{./Background}" MouseEnter="./onBorderMouseEnter" MouseLeave="./onBorderMouseLeave"> @@ -13,22 +13,22 @@ <Label Width="Stretched" Foreground="{./TitleBarForeground}" Margin="2" TextAlignment="Center" Text="{./Caption}" /> <Border Visible="{./ShowMinimize}" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Path="#Crow.Images.Icons.minimize.svg" + <Image Focusable="true" Path="#Crow.Icons.minimize.svg" MouseClick="./onMinimized"/> </Border> <Border Visible="{./ShowNormal}" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Path="#Crow.Images.Icons.normalize.svg" + <Image Focusable="true" Path="#Crow.Icons.normalize.svg" MouseClick="./onUnmaximized"/> </Border> <Border Visible="{./ShowMaximize}" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Path="#Crow.Images.Icons.maximize.svg" + <Image Focusable="true" Path="#Crow.Icons.maximize.svg" MouseClick="./onMaximized"/> </Border> <Border BorderWidth="1" Foreground="Transparent" Height="14" Width="14" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Path="#Crow.Icons.exit2.svg" MouseClick="./butQuitPress"/> </Border> <GraphicObject Width="5"/> diff --git a/Templates/imgItem.template b/Crow/Templates/imgItem.template index 9dbf23d5..9dbf23d5 100755 --- a/Templates/imgItem.template +++ b/Crow/Templates/imgItem.template diff --git a/Templates/treeList.template b/Crow/Templates/treeList.template index d47621af..d47621af 100755 --- a/Templates/treeList.template +++ b/Crow/Templates/treeList.template diff --git a/crow.key b/Crow/crow.key Binary files differindex b69aa3e7..b69aa3e7 100644 --- a/crow.key +++ b/Crow/crow.key diff --git a/src/BmpPicture.cs b/Crow/src/BmpPicture.cs index e3af9c79..98c2a016 100644 --- a/src/BmpPicture.cs +++ b/Crow/src/BmpPicture.cs @@ -55,23 +55,22 @@ namespace Crow /// load the image for rendering from the path given as argument /// </summary> /// <param name="path">image path, may be embedded</param> - public override void Load (Interface iface, string path) - { - Path = path; - if (sharedResources.ContainsKey (path)) { - sharedPicture sp = sharedResources [path]; + void Load () + { + if (sharedResources.ContainsKey (Path)) { + sharedPicture sp = sharedResources [Path]; image = (byte[])sp.Data; Dimensions = sp.Dims; return; } - using (Stream stream = iface.GetStreamFromPath (path)) { - loadBitmap (new System.Drawing.Bitmap (stream)); + using (Stream stream = Interface.StaticGetStreamFromPath (Path)) { + //loadBitmap (new System.Drawing.Bitmap (stream)); } - sharedResources [path] = new sharedPicture (image, Dimensions); + sharedResources [Path] = new sharedPicture (image, Dimensions); } //load image via System.Drawing.Bitmap, cairo load png only - void loadBitmap (System.Drawing.Bitmap bitmap) + /*void loadBitmap (System.Drawing.Bitmap bitmap) { if (bitmap == null) return; @@ -89,7 +88,7 @@ namespace Crow System.Runtime.InteropServices.Marshal.Copy (data.Scan0, image, 0, bitmapSize); bitmap.UnlockBits (data); - } + }*/ #region implemented abstract members of Fill diff --git a/src/BubblingMouseButtonEventArgs.cs b/Crow/src/BubblingMouseButtonEventArgs.cs index e81a6f74..e81a6f74 100644 --- a/src/BubblingMouseButtonEventArgs.cs +++ b/Crow/src/BubblingMouseButtonEventArgs.cs diff --git a/src/Cairo/CairoHelpers.cs b/Crow/src/Cairo/CairoHelpers.cs index 44060259..032980d0 100644 --- a/src/Cairo/CairoHelpers.cs +++ b/Crow/src/Cairo/CairoHelpers.cs @@ -73,7 +73,7 @@ namespace Crow if (stroke>0.0) { gr.LineWidth = stroke; double hsw = stroke / 2.0; - DrawRoundedRectangle (gr, r.X + hsw, r.Y + hsw, r.Width - stroke, r.Height - stroke, radius); + DrawRoundedRectangle (gr, hsw + r.X, hsw + r.Y, (double)r.Width - stroke, (double)r.Height - stroke, radius); gr.Stroke (); }else DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius); @@ -107,7 +107,7 @@ namespace Crow gr.LineTo(r.TopRight); gr.Stroke(); - gr.SetSourceColor(Color.DarkGray); + gr.SetSourceColor(Color.DarkGrey); gr.MoveTo(r.TopRight); gr.LineTo(r.BottomRight); gr.LineTo(r.BottomLeft); @@ -120,7 +120,7 @@ namespace Crow gr.Save(); r.Inflate((int)-width / 2, (int)-width / 2); gr.LineWidth = width; - gr.SetSourceColor(Color.DarkGray); + gr.SetSourceColor(Color.DarkGrey); gr.MoveTo(r.BottomLeft); gr.LineTo(r.TopLeft); gr.LineTo(r.TopRight); diff --git a/src/Colors.cs b/Crow/src/Colors.cs index 0b1b3ad7..1da99135 100644 --- a/src/Colors.cs +++ b/Crow/src/Colors.cs @@ -130,16 +130,6 @@ namespace Crow double.Parse(c[3])); } -// public static implicit operator OpenTK.Vector4(Color c) -// { -// return new OpenTK.Vector4 ((float)c.R, (float)c.G, (float)c.B, (float)c.A); -// } -// public static implicit operator Color(OpenTK.Vector4 v) -// { -// return new Color (v.X, v.Y, v.Z, v.W); -// } - - public static bool operator ==(Color left, Color right) { if (left.predefinied & right.predefinied) @@ -202,7 +192,7 @@ namespace Crow double max = Math.Max (R, Math.Max (G, B)); //Max. value of RGB double diff = max - min; //Delta RGB value - if ( diff == 0 )//This is a gray, no chroma... + if ( diff == 0 )//This is a grey, no chroma... return 0; double h = 0.0, s = diff / max; @@ -302,7 +292,6 @@ namespace Crow public static readonly Color DarkBlue = new Color(0,0,139,"DarkBlue","#00008B"); public static readonly Color DarkCyan = new Color(0,139,139,"DarkCyan","#008B8B"); public static readonly Color DarkGoldenRod = new Color(184,134,11,"DarkGoldenRod","#B8860B"); - public static readonly Color DarkGray = new Color(169,169,169,"DarkGray","#A9A9A9"); public static readonly Color DarkGrey = new Color(169,169,169,"DarkGrey","#A9A9A9"); public static readonly Color DarkGreen = new Color(0,100,0,"DarkGreen","#006400"); public static readonly Color DarkKhaki = new Color(189,183,107,"DarkKhaki","#BDB76B"); @@ -314,13 +303,11 @@ namespace Crow public static readonly Color DarkSalmon = new Color(233,150,122,"DarkSalmon","#E9967A"); public static readonly Color DarkSeaGreen = new Color(143,188,143,"DarkSeaGreen","#8FBC8F"); public static readonly Color DarkSlateBlue = new Color(72,61,139,"DarkSlateBlue","#483D8B"); - public static readonly Color DarkSlateGray = new Color(47,79,79,"DarkSlateGray","#2F4F4F"); public static readonly Color DarkSlateGrey = new Color(47,79,79,"DarkSlateGrey","#2F4F4F"); public static readonly Color DarkTurquoise = new Color(0,206,209,"DarkTurquoise","#00CED1"); public static readonly Color DarkViolet = new Color(148,0,211,"DarkViolet","#9400D3"); public static readonly Color DeepPink = new Color(255,20,147,"DeepPink","#FF1493"); public static readonly Color DeepSkyBlue = new Color(0,191,255,"DeepSkyBlue","#00BFFF"); - public static readonly Color DimGray = new Color(105,105,105,"DimGray","#696969"); public static readonly Color DimGrey = new Color(105,105,105,"DimGrey","#696969"); public static readonly Color DodgerBlue = new Color(30,144,255,"DodgerBlue","#1E90FF"); public static readonly Color FireBrick = new Color(178,34,34,"FireBrick","#B22222"); @@ -331,7 +318,6 @@ namespace Crow public static readonly Color GhostWhite = new Color(248,248,255,"GhostWhite","#F8F8FF"); public static readonly Color Gold = new Color(255,215,0,"Gold","#FFD700"); public static readonly Color GoldenRod = new Color(218,165,32,"GoldenRod","#DAA520"); - public static readonly Color Gray = new Color(128,128,128,"Gray","#808080"); public static readonly Color Grey = new Color(128,128,128,"Grey","#808080"); public static readonly Color Green = new Color(0,128,0,"Green","#008000"); public static readonly Color GreenYellow = new Color(173,255,47,"GreenYellow","#ADFF2F"); @@ -350,14 +336,12 @@ namespace Crow public static readonly Color LightCoral = new Color(240,128,128,"LightCoral","#F08080"); public static readonly Color LightCyan = new Color(224,255,255,"LightCyan","#E0FFFF"); public static readonly Color LightGoldenRodYellow = new Color(250,250,210,"LightGoldenRodYellow","#FAFAD2"); - public static readonly Color LightGray = new Color(211,211,211,"LightGray","#D3D3D3"); public static readonly Color LightGrey = new Color(211,211,211,"LightGrey","#D3D3D3"); public static readonly Color LightGreen = new Color(144,238,144,"LightGreen","#90EE90"); public static readonly Color LightPink = new Color(255,182,193,"LightPink","#FFB6C1"); public static readonly Color LightSalmon = new Color(255,160,122,"LightSalmon","#FFA07A"); public static readonly Color LightSeaGreen = new Color(32,178,170,"LightSeaGreen","#20B2AA"); public static readonly Color LightSkyBlue = new Color(135,206,250,"LightSkyBlue","#87CEFA"); - public static readonly Color LightSlateGray = new Color(119,136,153,"LightSlateGray","#778899"); public static readonly Color LightSlateGrey = new Color(119,136,153,"LightSlateGrey","#778899"); public static readonly Color LightSteelBlue = new Color(176,196,222,"LightSteelBlue","#B0C4DE"); public static readonly Color LightYellow = new Color(255,255,224,"LightYellow","#FFFFE0"); @@ -412,7 +396,6 @@ namespace Crow public static readonly Color Silver = new Color(192,192,192,"Silver","#C0C0C0"); public static readonly Color SkyBlue = new Color(135,206,235,"SkyBlue","#87CEEB"); public static readonly Color SlateBlue = new Color(106,90,205,"SlateBlue","#6A5ACD"); - public static readonly Color SlateGray = new Color(112,128,144,"SlateGray","#708090"); public static readonly Color SlateGrey = new Color(112,128,144,"SlateGrey","#708090"); public static readonly Color Snow = new Color(255,250,250,"Snow","#FFFAFA"); public static readonly Color SpringGreen = new Color(0,255,127,"SpringGreen","#00FF7F"); diff --git a/src/Command.cs b/Crow/src/Command.cs index ba95acc9..5d5f85e4 100644 --- a/src/Command.cs +++ b/Crow/src/Command.cs @@ -64,7 +64,7 @@ namespace Crow /// <summary> /// if true, action defined in this command may be executed, /// </summary> - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public virtual bool CanExecute { get { return canExecute; } set { @@ -77,7 +77,7 @@ namespace Crow /// <summary> /// label to display in the bound control /// </summary> - [XmlAttributeAttribute][DefaultValue("Unamed Command")] + [DefaultValue("Unamed Command")] public virtual string Caption { get { return caption; } set { @@ -91,7 +91,7 @@ namespace Crow /// <summary> /// Icon to display in the bound control /// </summary> - [XmlAttributeAttribute] + public Picture Icon { get { return icon; } set { diff --git a/src/CompilerServices/CompilerServices.cs b/Crow/src/CompilerServices/CompilerServices.cs index e315f761..5112fb12 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/Crow/src/CompilerServices/CompilerServices.cs @@ -150,9 +150,9 @@ namespace Crow.IML } Type dvType = val.GetType (); - if (dvType.IsValueType) { + if (dvType.IsValueType) { if (pi.PropertyType.IsValueType) { - if (pi.PropertyType.IsEnum) { + if (pi.PropertyType.IsEnum) { if (pi.PropertyType != dvType) throw new Exception ("Enum mismatch in default values: " + pi.PropertyType.FullName); il.Emit (OpCodes.Ldc_I4, Convert.ToInt32 (val)); @@ -224,7 +224,7 @@ namespace Crow.IML il.Emit (OpCodes.Ldstr, Convert.ToString (val));//TODO:implement here string format? //load false il.Emit (OpCodes.Ldc_I4_0); - il.Emit (OpCodes.Callvirt, CompilerServices.miParseEnum); + il.Emit (OpCodes.Call, CompilerServices.miParseEnum); if (CompilerServices.miParseEnum.ReturnType != pi.PropertyType) il.Emit (OpCodes.Unbox_Any, pi.PropertyType); @@ -236,13 +236,13 @@ namespace Crow.IML throw new Exception ("no Parse method found for: " + pi.PropertyType.FullName); il.Emit (OpCodes.Ldstr, Convert.ToString (val));//TODO:is this convert required? - il.Emit (OpCodes.Callvirt, miParse); + il.Emit (OpCodes.Call, miParse); if (miParse.ReturnType != pi.PropertyType) il.Emit (OpCodes.Unbox_Any, pi.PropertyType); } } - il.Emit (OpCodes.Callvirt, pi.GetSetMethod ()); + il.Emit (OpCodes.Callvirt, pi.GetSetMethod ()); } #region conversions @@ -535,23 +535,31 @@ namespace Crow.IML }else if (origType.IsValueType) { if (destType != origType) { MethodInfo miIO = getImplicitOp (origType, destType); - if (miIO != null) { - System.Reflection.Emit.Label emitCreateDefault = il.DefineLabel (); - System.Reflection.Emit.Label emitContinue = il.DefineLabel (); - LocalBuilder lbStruct = il.DeclareLocal (origType); - il.Emit (OpCodes.Dup); - il.Emit (OpCodes.Brfalse, emitCreateDefault); - il.Emit (OpCodes.Unbox_Any, origType); - il.Emit (OpCodes.Br, emitContinue); - il.MarkLabel (emitCreateDefault); - il.Emit (OpCodes.Pop);//pop null value - il.Emit (OpCodes.Ldloca, lbStruct); - il.Emit (OpCodes.Initobj, origType); - il.Emit (OpCodes.Ldloc, lbStruct); - il.MarkLabel (emitContinue); - il.Emit (OpCodes.Call, miIO); - }else - il.Emit (OpCodes.Callvirt, CompilerServices.GetConvertMethod (destType)); + if (miIO != null) + { + System.Reflection.Emit.Label emitCreateDefault = il.DefineLabel(); + System.Reflection.Emit.Label emitContinue = il.DefineLabel(); + LocalBuilder lbStruct = il.DeclareLocal(origType); + il.Emit(OpCodes.Dup); + il.Emit(OpCodes.Brfalse, emitCreateDefault); + il.Emit(OpCodes.Unbox_Any, origType); + il.Emit(OpCodes.Br, emitContinue); + il.MarkLabel(emitCreateDefault); + il.Emit(OpCodes.Pop);//pop null value + il.Emit(OpCodes.Ldloca, lbStruct); + il.Emit(OpCodes.Initobj, origType); + il.Emit(OpCodes.Ldloc, lbStruct); + il.MarkLabel(emitContinue); + il.Emit(OpCodes.Call, miIO); + } + else + { + MethodInfo miconv = CompilerServices.GetConvertMethod(destType); + if (miconv.IsStatic) + il.Emit(OpCodes.Call, miconv); + else + il.Emit(OpCodes.Callvirt, miconv); + } }else il.Emit (OpCodes.Unbox_Any, destType);//TODO:double check this } else { @@ -622,8 +630,12 @@ namespace Crow.IML il.Emit (OpCodes.Pop);//remove null string from stack il.Emit (OpCodes.Ldstr, "");//replace with empty string } else if (dstType.IsPrimitive) { - //il.Emit (OpCodes.Unbox_Any, dstType); - il.Emit (OpCodes.Callvirt, CompilerServices.GetConvertMethod (dstType)); + //il.Emit (OpCodes.Unbox_Any, dstType); + MethodInfo miconv = CompilerServices.GetConvertMethod(dstType); + if (miconv.IsStatic) + il.Emit(OpCodes.Call, miconv); + else + il.Emit(OpCodes.Callvirt, miconv); } else if (dstType.IsValueType) { il.Emit (OpCodes.Unbox_Any, dstType); } else{ @@ -803,10 +815,13 @@ namespace Crow.IML il.Emit (OpCodes.Ldstr, operandes [1].Trim ()); } - il.Emit (OpCodes.Callvirt, lopParseMi); - il.Emit (OpCodes.Unbox_Any, lopPI.PropertyType); - //emit left operand assignment - il.Emit (OpCodes.Callvirt, lopPI.GetSetMethod()); + if (lopParseMi.IsStatic) + il.Emit (OpCodes.Call, lopParseMi); + else + il.Emit(OpCodes.Callvirt, lopParseMi); + //il.Emit (OpCodes.Unbox_Any, lopPI.PropertyType); + //emit left operand assignment + il.Emit (OpCodes.Callvirt, lopPI.GetSetMethod()); } else {//tree parsing and propert gets il.Emit (OpCodes.Ldarg_0); //load sender ref onto the stack, the current node diff --git a/src/Configuration.cs b/Crow/src/Configuration.cs index a6328c0a..b8112be4 100644 --- a/src/Configuration.cs +++ b/Crow/src/Configuration.cs @@ -29,6 +29,7 @@ using System.Reflection; using System.IO; using System.Collections.Generic; using System.Threading; +using System.Linq; namespace Crow { @@ -102,10 +103,12 @@ namespace Crow } startSavingThread (); } + static Configuration () { string configRoot = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config"); @@ -128,6 +131,13 @@ namespace Crow } globalConfig = new Configuration (globalConfigPath); } + + public string[] Names { + get { + return items.Keys.ToArray (); + } + } + void startSavingThread(){ Thread t = new Thread (savingThread); t.IsBackground = true; @@ -135,11 +145,9 @@ namespace Crow } void savingThread(){ while(true){ - if (isDirty) { - save (); - isDirty = false; - } - Thread.Sleep (1000); + if (isDirty) + Save (); + Thread.Sleep (100); } } /// <summary> @@ -164,7 +172,7 @@ namespace Crow items[key].Set (value); isDirty = true; } - void save(){ + public void Save(){ using (Stream s = new FileStream(configPath,FileMode.Create)){ using (StreamWriter sw = new StreamWriter (s)) { lock (items) { @@ -175,6 +183,7 @@ namespace Crow } } } + isDirty = false; } void load(Stream s){ using (StreamReader sr = new StreamReader (s)) { diff --git a/src/CrowThread.cs b/Crow/src/CrowThread.cs index a1b4c38e..a1b4c38e 100644 --- a/src/CrowThread.cs +++ b/Crow/src/CrowThread.cs diff --git a/src/DragDropEventArgs.cs b/Crow/src/DragDropEventArgs.cs index 428a7363..428a7363 100644 --- a/src/DragDropEventArgs.cs +++ b/Crow/src/DragDropEventArgs.cs diff --git a/src/DynAttribute.cs b/Crow/src/DynAttribute.cs index 174eec2e..174eec2e 100644 --- a/src/DynAttribute.cs +++ b/Crow/src/DynAttribute.cs diff --git a/src/Enums.cs b/Crow/src/Enums.cs index 8b90d6ea..8b90d6ea 100644 --- a/src/Enums.cs +++ b/Crow/src/Enums.cs diff --git a/src/ExtensionsMethods.cs b/Crow/src/ExtensionsMethods.cs index 340a8ceb..ecbc8a72 100644 --- a/src/ExtensionsMethods.cs +++ b/Crow/src/ExtensionsMethods.cs @@ -153,13 +153,14 @@ namespace Crow ctx.LineWidth = stroke; ctx.Stroke (); } + public static void SetSourceColor(this Cairo.Context ctx, Color c) { ctx.SetSourceRGBA(c.R,c.G,c.B,c.A); } public static void AddColorStop(this Cairo.Gradient grad, double offset, Color c) { - grad.AddColorStop (offset, new Cairo.Color (c.R, c.G, c.B, c.A)); + grad.AddColorStop (offset, c); } #endregion diff --git a/src/Fill/Fill.cs b/Crow/src/Fill/Fill.cs index d98e47cf..d98e47cf 100644 --- a/src/Fill/Fill.cs +++ b/Crow/src/Fill/Fill.cs diff --git a/src/Font.cs b/Crow/src/Font.cs index bab2c853..4314222b 100644 --- a/src/Font.cs +++ b/Crow/src/Font.cs @@ -44,8 +44,8 @@ namespace Crow } #endregion - string _name = "droid"; - int _size = 12; + string _name = "sans"; + int _size = 10; FontStyle _style = FontStyle.Normal; public string Name { diff --git a/src/Gradient.cs b/Crow/src/Gradient.cs index 0806e885..2630c42a 100644 --- a/src/Gradient.cs +++ b/Crow/src/Gradient.cs @@ -96,8 +96,11 @@ namespace Crow throw new NotImplementedException (); } - foreach (ColorStop cs in Stops) + foreach (ColorStop cs in Stops) { + if (cs == null) + continue; grad.AddColorStop (cs.Offset, cs.Color); + } ctx.SetSource (grad); grad.Dispose (); diff --git a/src/GraphicObjects/Border.cs b/Crow/src/GraphicObjects/Border.cs index adeb32e7..9379c26a 100644 --- a/src/GraphicObjects/Border.cs +++ b/Crow/src/GraphicObjects/Border.cs @@ -54,15 +54,15 @@ namespace Crow #region private fields int _borderWidth; BorderStyle _borderStyle; - Fill raisedColor = Color.Gray; - Fill sunkenColor = Color.DimGray; + Fill raisedColor = Color.Grey; + Fill sunkenColor = Color.DimGrey; #endregion #region public properties /// <summary> /// use to define the colors of the 3d border /// </summary> - [XmlAttributeAttribute] + public virtual Fill RaisedColor { get { return raisedColor; } set { @@ -76,7 +76,7 @@ namespace Crow /// <summary> /// use to define the colors of the 3d border /// </summary> - [XmlAttributeAttribute] + public virtual Fill SunkenColor { get { return sunkenColor; } set { @@ -90,7 +90,7 @@ namespace Crow /// <summary> /// border width in pixels /// </summary> - [XmlAttributeAttribute()][DefaultValue(1)] + [DefaultValue(1)] public virtual int BorderWidth { get { return _borderWidth; } set { @@ -101,7 +101,7 @@ namespace Crow /// <summary> /// allow 3d border effects /// </summary> - [XmlAttributeAttribute][DefaultValue(BorderStyle.Normal)] + [DefaultValue(BorderStyle.Normal)] public virtual BorderStyle BorderStyle { get { return _borderStyle; } set { diff --git a/src/GraphicObjects/Button.cs b/Crow/src/GraphicObjects/Button.cs index 8b60dcb9..30612512 100644 --- a/src/GraphicObjects/Button.cs +++ b/Crow/src/GraphicObjects/Button.cs @@ -75,7 +75,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute][DefaultValue("#Crow.Images.button.svg")] + [DefaultValue("#Crow.Images.button.svg")] public string Image { get { return image; } set { @@ -85,7 +85,7 @@ namespace Crow NotifyValueChanged ("Image", image); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool IsPressed { get { return isPressed; } diff --git a/src/GraphicObjects/CheckBox.cs b/Crow/src/GraphicObjects/CheckBox.cs index 646a8577..4860d604 100644 --- a/src/GraphicObjects/CheckBox.cs +++ b/Crow/src/GraphicObjects/CheckBox.cs @@ -45,7 +45,7 @@ namespace Crow public event EventHandler Checked; public event EventHandler Unchecked; - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsChecked { get { return isChecked; } diff --git a/src/GraphicObjects/ColorPicker.cs b/Crow/src/GraphicObjects/ColorPicker.cs index cc955191..dd45023c 100644 --- a/src/GraphicObjects/ColorPicker.cs +++ b/Crow/src/GraphicObjects/ColorPicker.cs @@ -46,7 +46,7 @@ namespace Crow Color curColor; double h,s,v; - [XmlAttributeAttribute()] + public virtual double R { get { return Math.Round(curColor.R * div); } set { @@ -58,7 +58,7 @@ namespace Crow notifyCurColorHasChanged (); } } - [XmlAttributeAttribute()] + public virtual double G { get { return Math.Round(curColor.G * div); } set { @@ -70,7 +70,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double B { get { return Math.Round(curColor.B * div); } set { @@ -82,7 +82,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double A { get { return Math.Round(curColor.A * div); } set { @@ -94,7 +94,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double H { get { return Math.Round (h, 3); } set { @@ -105,7 +105,7 @@ namespace Crow rgbFromHSV (); } } - [XmlAttributeAttribute()] + public virtual double S { get { return Math.Round (s, 2); } set { @@ -116,7 +116,7 @@ namespace Crow rgbFromHSV (); } } - [XmlAttributeAttribute()] + public virtual double V { get { return Math.Round (v, 2); } set { @@ -128,7 +128,7 @@ namespace Crow } } - [XmlAttributeAttribute] + public virtual Fill SelectedColor { get { return new SolidColor(curColor); } set { @@ -145,7 +145,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute] + public virtual Color SelectedRawColor { get { return curColor; } set { diff --git a/src/GraphicObjects/ColorSelector.cs b/Crow/src/GraphicObjects/ColorSelector.cs index ee57a262..ee57a262 100644 --- a/src/GraphicObjects/ColorSelector.cs +++ b/Crow/src/GraphicObjects/ColorSelector.cs diff --git a/src/GraphicObjects/ComboBox.cs b/Crow/src/GraphicObjects/ComboBox.cs index 61227055..61227055 100644 --- a/src/GraphicObjects/ComboBox.cs +++ b/Crow/src/GraphicObjects/ComboBox.cs diff --git a/src/GraphicObjects/Container.cs b/Crow/src/GraphicObjects/Container.cs index 364bad83..364bad83 100644 --- a/src/GraphicObjects/Container.cs +++ b/Crow/src/GraphicObjects/Container.cs diff --git a/src/GraphicObjects/DataSourceChangeEventArgs.cs b/Crow/src/GraphicObjects/DataSourceChangeEventArgs.cs index a2519356..a2519356 100644 --- a/src/GraphicObjects/DataSourceChangeEventArgs.cs +++ b/Crow/src/GraphicObjects/DataSourceChangeEventArgs.cs diff --git a/src/GraphicObjects/DirectoryView.cs b/Crow/src/GraphicObjects/DirectoryView.cs index d530f0cb..b0217896 100644 --- a/src/GraphicObjects/DirectoryView.cs +++ b/Crow/src/GraphicObjects/DirectoryView.cs @@ -63,7 +63,7 @@ namespace Crow NotifyValueChanged ("SelectedItem", _selectedItem); } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public virtual bool ShowFiles { get { return showFiles; } set { @@ -74,7 +74,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool ShowHidden { get { return showHidden; } set { @@ -85,7 +85,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute][DefaultValue("*.*")] + [DefaultValue("*.*")] public virtual string FileMask { get { return fileMask; } set { @@ -96,7 +96,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute][DefaultValue("/")] + [DefaultValue("/")] public virtual string CurrentDirectory { get { return currentDirectory; } set { diff --git a/src/GraphicObjects/DockStack.cs b/Crow/src/GraphicObjects/DockStack.cs index ae8b9c89..75f0d2bb 100644 --- a/src/GraphicObjects/DockStack.cs +++ b/Crow/src/GraphicObjects/DockStack.cs @@ -25,6 +25,9 @@ // THE SOFTWARE. using System; using Crow.IML; +using System.Linq; +using System.Text; +using System.IO; namespace Crow { @@ -36,6 +39,13 @@ namespace Crow public DockStack (Interface iface) : base (iface) {} #endregion + /*static int color = 10; + + protected override void onInitialized (object sender, EventArgs e) + { + base.onInitialized (sender, e); + Background = Color.ColorDic.Values.ToList()[color++]; + }*/ public override void AddChild (GraphicObject g) { base.AddChild (g); @@ -68,8 +78,9 @@ namespace Crow return false; } } + childrenRWLock.ExitReadLock (); } - childrenRWLock.ExitReadLock (); + return Slot.ContainsOrIsEqual(m); } @@ -105,9 +116,9 @@ namespace Crow { if (IsDropTarget) { DockWindow dw = IFace.DragAndDropOperation.DragSource as DockWindow; - if (dw.IsDocked) { - base.onMouseMove (sender, e); - return; + if (dw == null || dw.IsDocked) { + base.onMouseMove (sender, e); + return; } Alignment curDockPos = dw.DockingPosition; @@ -172,8 +183,8 @@ namespace Crow protected override void onDragLeave (object sender, DragDropEventArgs e) { DockWindow dw = e.DragSource as DockWindow; - if (dw != null) - dw.DockingPosition = Alignment.Undefined; + //if (dw != null) + // dw.DockingPosition = Alignment.Undefined; base.onDragLeave (sender, e); RegisterForGraphicUpdate (); } @@ -307,14 +318,16 @@ namespace Crow break; } } - public void Undock (DockWindow dw){ + public void Undock (DockWindow dw){ int idx = Children.IndexOf(dw); + Console.WriteLine ("undocking child index: {0} ; name={1}; pos:{2} ; childcount:{3}",idx, dw.Name, dw.DockingPosition, Children.Count); + RemoveChild(dw); if (Children.Count == 0) return; - + if (dw.DockingPosition == Alignment.Left || dw.DockingPosition == Alignment.Top) { RemoveChild (idx); if (stretchedChild == dw) { @@ -358,6 +371,103 @@ namespace Crow if (dw != null) dw.DockingPosition = (Orientation == Orientation.Horizontal ? Alignment.Right : Alignment.Bottom); } + + //read next value in config string until next ';' + string getConfAttrib (string conf, ref int i) { + int nextI = conf.Substring (i).IndexOf (';'); + string tmp = conf.Substring (i, nextI); + i += nextI + 1; + return tmp; + } + /// <summary> + /// Imports the config. + /// </summary> + /// <param name="conf">Conf.</param> + /// <param name="dataSource">Data source for the docked windows</param> + public void ImportConfig (string conf, object dataSource = null) { + lock (IFace.UpdateMutex) { + ClearChildren (); + stretchedChild = null; + int i = 0; + Orientation = (Orientation)Enum.Parse (typeof(Orientation), getConfAttrib (conf, ref i)); + importConfig (conf, ref i, dataSource); + } + } + public string ExportConfig () { + return Orientation.ToString() + ";" + exportConfig(); + } + void importConfig (string conf, ref int i, object dataSource) { + if (conf [i++] != '(') + return; + while (i < conf.Length - 4) { + string sc = conf.Substring (i, 4); + i += 4; + switch (sc) { + case "WIN;": + DockWindow dw = null; + string wName = getConfAttrib (conf, ref i); + try { + dw = IFace.Load (wName) as DockWindow; + } catch { + dw = new DockWindow (IFace); + } + + dw.Name = wName; + dw.Width = Measure.Parse (getConfAttrib (conf, ref i)); + dw.Height = Measure.Parse (getConfAttrib (conf, ref i)); + dw.DockingPosition = (Alignment)Enum.Parse (typeof(Alignment), getConfAttrib (conf, ref i)); + dw.savedSlot = Rectangle.Parse (getConfAttrib (conf, ref i)); + dw.wasResizable = Boolean.Parse (getConfAttrib (conf, ref i)); + + dw.IsDocked = true; + dw.DataSource = dataSource; + this.AddChild (dw); + + break; + case "STK;": + DockStack ds = new DockStack (IFace); + ds.Width = Measure.Parse (getConfAttrib (conf, ref i)); + ds.Height = Measure.Parse (getConfAttrib (conf, ref i)); + ds.Orientation = (Orientation)Enum.Parse (typeof(Orientation), getConfAttrib (conf, ref i)); + + this.AddChild (ds); + + ds.importConfig (conf, ref i, dataSource); + break; + case "SPL;": + Splitter sp = new Splitter (IFace); + sp.Width = Measure.Parse (getConfAttrib (conf, ref i)); + sp.Height = Measure.Parse (getConfAttrib (conf, ref i)); + sp.Thickness = int.Parse (getConfAttrib (conf, ref i)); + this.AddChild (sp); + break; + } + char nextC = conf [i++]; + if (nextC == ')') + break; + } + } + string exportConfig () { + StringBuilder tmp = new StringBuilder("("); + + for (int i = 0; i < Children.Count; i++) { + if (Children [i] is DockWindow) { + DockWindow dw = Children [i] as DockWindow; + tmp.Append (string.Format("WIN;{0};{1};{2};{3};{4};{5};",dw.Name, dw.Width, dw.Height, dw.DockingPosition, dw.savedSlot, dw.wasResizable)); + } else if (Children [i] is DockStack) { + DockStack ds = Children [i] as DockStack; + tmp.Append (string.Format("STK;{0};{1};{2};{3}", ds.Width, ds.Height, ds.Orientation, ds.exportConfig())); + } else if (Children [i] is Splitter) { + Splitter sp = Children [i] as Splitter; + tmp.Append (string.Format("SPL;{0};{1};{2};", sp.Width, sp.Height, sp.Thickness)); + } + if (i < Children.Count - 1) + tmp.Append ("|"); + } + + tmp.Append (")"); + return tmp.ToString (); + } } } diff --git a/src/GraphicObjects/DockWindow.cs b/Crow/src/GraphicObjects/DockWindow.cs index ca4b93f4..e368db51 100644 --- a/src/GraphicObjects/DockWindow.cs +++ b/Crow/src/GraphicObjects/DockWindow.cs @@ -31,18 +31,17 @@ namespace Crow public class DockWindow : Window { #region CTOR - public DockWindow () : base () - { - } + public DockWindow () {} + public DockWindow (Interface iface) : base (iface) {} #endregion - int undockThreshold = 4; + int undockThreshold = 10; bool isDocked = false; Alignment docking = Alignment.Undefined; Point undockingMousePosOrig; //mouse pos when docking was donne, use for undocking on mouse move - Rectangle savedSlot; //last undocked slot recalled when view is undocked - bool wasResizable; + internal Rectangle savedSlot; //last undocked slot recalled when view is undocked + internal bool wasResizable; public bool IsDocked { get { return isDocked; } @@ -65,7 +64,6 @@ namespace Crow NotifyValueChanged ("DockingPosition", DockingPosition); } } - public override bool PointIsIn (ref Point m) { if (!base.PointIsIn(ref m)) @@ -109,8 +107,8 @@ namespace Crow undockingMousePosOrig = e.Position; } public bool CheckUndock (Point mousePos) { - if (DockingPosition == Alignment.Center) - return false; + //if (DockingPosition == Alignment.Center) + // return false; if (Math.Abs (mousePos.X - undockingMousePosOrig.X) < undockThreshold || Math.Abs (mousePos.X - undockingMousePosOrig.X) < undockThreshold) return false; @@ -126,7 +124,7 @@ namespace Crow } protected override void onDrop (object sender, DragDropEventArgs e) { - if (!isDocked && DockingPosition != Alignment.Undefined) + if (!isDocked && DockingPosition != Alignment.Undefined && e.DropTarget is DockStack) Dock (e.DropTarget as DockStack); base.onDrop (sender, e); } @@ -137,10 +135,10 @@ namespace Crow IFace.AddWidget (this); - this.Left = savedSlot.Left; - this.Top = savedSlot.Top; - this.Width = savedSlot.Width; - this.Height = savedSlot.Height; + Left = savedSlot.Left; + Top = savedSlot.Top; + Width = savedSlot.Width; + Height = savedSlot.Height; IsDocked = false; DockingPosition = Alignment.Undefined; @@ -170,10 +168,6 @@ namespace Crow Undock (); base.close (); } - - public string ExportWinConfigs () { - return string.Format ("{0};{1};{2}", this.Name, DockingPosition, savedSlot); - } } } diff --git a/src/GraphicObjects/Expandable.cs b/Crow/src/GraphicObjects/Expandable.cs index 1920a8fe..3a480b24 100644 --- a/src/GraphicObjects/Expandable.cs +++ b/Crow/src/GraphicObjects/Expandable.cs @@ -67,7 +67,7 @@ namespace Crow } #region Public properties - [XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.expandable.svg")] + [DefaultValue("#Crow.Icons.expandable.svg")] public string Image { get { return image; } set { diff --git a/src/GraphicObjects/FileDialog.cs b/Crow/src/GraphicObjects/FileDialog.cs index 8069b8a7..db66ae9e 100644 --- a/src/GraphicObjects/FileDialog.cs +++ b/Crow/src/GraphicObjects/FileDialog.cs @@ -55,7 +55,7 @@ namespace Crow public string SelectedFileFullPath { get { return Path.Combine (SelectedDirectory, SelectedFile); } } - [XmlAttributeAttribute][DefaultValue("/home")] + [DefaultValue("/home")] public virtual string CurrentDirectory { get { return curDir; } set { @@ -67,7 +67,7 @@ namespace Crow } } - [XmlAttributeAttribute][DefaultValue("*")] + [DefaultValue("*")] public virtual string SearchPattern { get { return searchPattern; } set { @@ -78,7 +78,7 @@ namespace Crow } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool ShowHidden { get { return showHidden; } set { @@ -88,7 +88,7 @@ namespace Crow NotifyValueChanged ("ShowHidden", showHidden); } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public virtual bool ShowFiles { get { return showFiles; } set { @@ -98,7 +98,7 @@ namespace Crow NotifyValueChanged ("ShowFiles", showFiles); } } - [XmlAttributeAttribute]public string SelectedFile { + public string SelectedFile { get { return _selectedFile; } set { if (value == _selectedFile) @@ -107,7 +107,7 @@ namespace Crow NotifyValueChanged ("SelectedFile", _selectedFile); } } - [XmlAttributeAttribute]public string SelectedDirectory { + public string SelectedDirectory { get { return _selectedDir; } set { if (value == _selectedDir) diff --git a/src/GraphicObjects/GenericStack.cs b/Crow/src/GraphicObjects/GenericStack.cs index 64841d4b..50c66c3e 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/Crow/src/GraphicObjects/GenericStack.cs @@ -48,7 +48,7 @@ namespace Crow #endregion #region Public Properties - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public int Spacing { get { return _spacing; } @@ -60,7 +60,7 @@ namespace Crow RegisterForLayouting (LayoutingType.Sizing|LayoutingType.ArrangeChildren); } } - [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public virtual Orientation Orientation { get { return _orientation; } @@ -242,5 +242,11 @@ namespace Crow else adjustStretchedGo (LayoutingType.Height); } + + public override void ClearChildren () + { + base.ClearChildren (); + stretchedGO = null; + } } } diff --git a/src/GraphicObjects/GraduatedSlider.cs b/Crow/src/GraphicObjects/GraduatedSlider.cs index e1d4dd46..e1d4dd46 100644 --- a/src/GraphicObjects/GraduatedSlider.cs +++ b/Crow/src/GraphicObjects/GraduatedSlider.cs diff --git a/src/GraphicObjects/GraphicObject.cs b/Crow/src/GraphicObjects/GraphicObject.cs index bc955368..f4445908 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/Crow/src/GraphicObjects/GraphicObject.cs @@ -50,7 +50,13 @@ namespace Crow public class GraphicObject : ILayoutable, IValueChange, IDisposable { internal ReaderWriterLockSlim parentRWLock = new ReaderWriterLockSlim(); - + #if DEBUG_LOG + //0 is the main graphic tree, for other obj tree not added to main tree, it range from 1->n + //useful to track events for obj shown later, not on start, or never added to main tree + public int treeIndex; + public int yIndex;//absolute index in the graphic tree for debug draw + public int xLevel;//x increment for debug draw + #endif #if DESIGN_MODE static MethodInfo miDesignAddDefLoc = typeof(GraphicObject).GetMethod("design_add_style_location", BindingFlags.Instance | BindingFlags.NonPublic); @@ -188,8 +194,9 @@ namespace Crow } #endregion - internal static ulong currentUid = 0; - internal ulong uid = 0; + #if DEBUG_LOG + internal static List<GraphicObject> GraphicObjects = new List<GraphicObject>(); + #endif internal bool isPopup = false; public GraphicObject focusParent { @@ -234,9 +241,9 @@ namespace Crow /// </summary> protected GraphicObject () { Clipping = new Region (); - #if DEBUG - uid = currentUid; - currentUid++; + #if DEBUG_LOG + GraphicObjects.Add (this); + DebugLog.AddEvent(DbgEvtType.GOClassCreation, this); #endif } /// <summary> @@ -261,7 +268,6 @@ namespace Crow /// </summary> public virtual void Initialize(){ loadDefaultValues (); - //initialized = true; } #region private fields LayoutingType registeredLayoutings = LayoutingType.All; @@ -270,15 +276,15 @@ namespace Crow string name; Fill background = Color.Transparent; Fill foreground = Color.White; - Font font = "droid, 10"; - Measure width, height; + Font font = "sans, 10"; + protected Measure width, height; int left, top; double cornerRadius = 0; int margin = 0; bool focusable = false; bool hasFocus = false; bool isActive = false; - bool isHover = false; + //bool isHover = false; bool mouseRepeat; protected bool isVisible = true; bool isEnabled = true; @@ -420,9 +426,9 @@ namespace Crow /// <summary>Occurs when mouse leave this object</summary> public event EventHandler<MouseMoveEventArgs> MouseLeave; /// <summary>Occurs when key is pressed when this object is active</summary> - public event EventHandler<KeyboardKeyEventArgs> KeyDown; + public event EventHandler<KeyEventArgs> KeyDown; /// <summary>Occurs when key is released when this object is active</summary> - public event EventHandler<KeyboardKeyEventArgs> KeyUp; + public event EventHandler<KeyEventArgs> KeyUp; /// <summary>Occurs when translated key event occurs in the host when this object is active</summary> public event EventHandler<KeyPressEventArgs> KeyPress; /// <summary>Occurs when this object received focus</summary> @@ -430,9 +436,9 @@ namespace Crow /// <summary>Occurs when this object loose focus</summary> public event EventHandler Unfocused; /// <summary>Occurs when mouse is over</summary> - public event EventHandler Hover; + //public event EventHandler Hover; /// <summary>Occurs when this control is no longer the Hover one</summary> - public event EventHandler UnHover; + //public event EventHandler UnHover; /// <summary>Occurs when this object loose focus</summary> public event EventHandler Enabled; /// <summary>Occurs when the enabled state this object is set to false</summary> @@ -502,9 +508,9 @@ namespace Crow this.RegisterForRedraw (); } } - #if DEBUG + #if DEBUG_LOG [XmlIgnore]public string TreePath { - get { return this.GetType().Name + uid.ToString (); } + get { return this.GetType().Name + GraphicObjects.IndexOf(this).ToString (); } } #endif /// <summary> @@ -515,8 +521,8 @@ namespace Crow [DesignCategory ("Divers")][DefaultValue(null)] public virtual string Name { get { - #if DEBUG - return string.IsNullOrEmpty(name) ? this.GetType().Name + uid.ToString () : name; + #if DEBUG_LOG + return string.IsNullOrEmpty(name) ? this.GetType().Name + GraphicObjects.IndexOf(this).ToString () : name; #else return name; #endif @@ -738,7 +744,7 @@ namespace Crow /// <summary> /// true if this control has the pointer hover /// </summary> - [XmlIgnore]public virtual bool IsHover { + /*[XmlIgnore]public virtual bool IsHover { get { return isHover; } set { if (value == isHover) @@ -753,7 +759,7 @@ namespace Crow NotifyValueChanged ("IsHover", isHover); } - } + }*/ /// <summary> /// true if holding mouse button down should trigger multiple click events /// </summary> @@ -806,7 +812,7 @@ namespace Crow /// <summary> /// Font being used in many controls, it is defined in the base GraphicObject class. /// </summary> - [DesignCategory ("Appearance")][DefaultValue("sans,10")] + [DesignCategory ("Appearance")][DefaultValue("sans, 10")] public virtual Font Font { get { return font; } set { @@ -860,8 +866,12 @@ namespace Crow RegisterForLayouting (LayoutingType.Sizing); - if (!isVisible) - unshownPostActions (); + if (!isVisible && IFace.HoverWidget != null) { + if (IFace.HoverWidget.IsOrIsInside (this)) { + //IFace.HoverWidget = null; + IFace.ProcessMouseMove (IFace.Mouse.X, IFace.Mouse.Y); + } + } NotifyValueChanged ("Visible", isVisible); } @@ -939,11 +949,17 @@ namespace Crow if (value != null) rootDataLevel = true; - + + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOLockLayouting, this); + #endif lock (IFace.LayoutMutex) { OnDataSourceChanged (this, dse); NotifyValueChanged ("DataSource", DataSource); } + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } get { return rootDataLevel ? dataSource : dataSource == null ? @@ -975,6 +991,10 @@ namespace Crow public virtual void OnDataSourceChanged(object sender, DataSourceChangeEventArgs e){ DataSourceChanged.Raise (this, e); + #if DEBUG_LOG + DebugLog.AddEvent(DbgEvtType.GONewDataSource, this); + #endif + #if DEBUG_BINDING Debug.WriteLine("New DataSource for => {0} \n\t{1}=>{2}", this.ToString(),e.OldDataSource,e.NewDataSource); #endif @@ -1020,9 +1040,9 @@ namespace Crow /// <summary> Loads the default values from XML attributes default </summary> public void loadDefaultValues() { -// #if DEBUG_LOAD -// Debug.WriteLine ("LoadDefValues for " + this.ToString ()); -// #endif + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOInitialization, this); + #endif Type thisType = this.GetType (); @@ -1078,12 +1098,14 @@ namespace Crow DynamicMethod dm = null; ILGenerator il = null; - dm = new DynamicMethod("dyn_loadDefValues", + /*dm = new DynamicMethod("dyn_loadDefValues", MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot, CallingConventions.Standard, - typeof(void),new Type[] {CompilerServices.TObject},thisType,true); + typeof(void),new Type[] {CompilerServices.TObject}, thisType, true);*/ + + dm = new DynamicMethod("dyn_loadDefValues", null, new Type[] {CompilerServices.TObject}, thisType, true); - il = dm.GetILGenerator(256); + il = dm.GetILGenerator(256); il.DeclareLocal(CompilerServices.TObject); il.Emit(OpCodes.Nop); //set local GraphicObject to root object passed as 1st argument @@ -1109,9 +1131,9 @@ namespace Crow il.Emit (OpCodes.Ldstr, trimed.Substring (1, trimed.Length - 2)); //push null as 3rd arg, currentNode, not known when instanciing il.Emit (OpCodes.Ldnull); - il.Emit (OpCodes.Callvirt, CompilerServices.miCompileDynEventHandler); + il.Emit (OpCodes.Call, CompilerServices.miCompileDynEventHandler); il.Emit (OpCodes.Castclass, ei.EventHandlerType); - il.Emit (OpCodes.Callvirt, ei.AddMethod); + il.Emit (OpCodes.Call, ei.AddMethod); }else Debug.WriteLine("error in styling, event not handled : " + trimed); } @@ -1186,6 +1208,11 @@ namespace Crow } catch (Exception ex) { throw new Exception ("Error applying style <" + styleKey + ">:", ex); } + + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif + onInitialized (this, null); } protected virtual void onInitialized (object sender, EventArgs e){ @@ -1323,25 +1350,33 @@ namespace Crow /// Register old and new slot for clipping /// </summary> public virtual void ClippingRegistration(){ - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ())); - #endif + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOClippingRegistration, this); + #endif parentRWLock.EnterReadLock (); if (parent != null) { Parent.RegisterClip (LastPaintedSlot); Parent.RegisterClip (Slot); } parentRWLock.ExitReadLock (); + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } /// <summary> /// Add clip rectangle to this.clipping and propagate up to root /// </summary> /// <param name="clip">Clip rectangle</param> public virtual void RegisterClip(Rectangle clip){ - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("RegisterClip -> {1}:{0}", clip, this.ToString ())); + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GORegisterClip, this); #endif - Rectangle r = clip + ClientRectangle.Position; + Rectangle cb = ClientRectangle; + Rectangle r = clip + cb.Position; + if (r.Right > cb.Right) + r.Width -= r.Right - cb.Right; + if (r.Bottom > cb.Bottom) + r.Height -= r.Bottom - cb.Bottom; if (CacheEnabled && !IsDirty) Clipping.UnionRectangle (r); if (Parent == null) @@ -1350,27 +1385,24 @@ namespace Crow if (p?.IsDirty == true && p?.CacheEnabled == true) return; Parent.RegisterClip (r + Slot.Position); + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } - /// <summary> Full update, taking care of sizing policy </summary> + /// <summary> Full update, content and layouting, taking care of sizing policy </summary> [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RegisterForGraphicUpdate () { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("RegisterForGraphicUpdate (IsDirty set)-> {0}", this.ToString ())); - #endif IsDirty = true; if (Width.IsFit || Height.IsFit) RegisterForLayouting (LayoutingType.Sizing); else if (RegisteredLayoutings == LayoutingType.None) IFace.EnqueueForRepaint (this); } - /// <summary> query an update of the content, a redraw </summary> + /// <summary> query an update of the content without layouting changes</summary> [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RegisterForRedraw () { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("RegisterForRedraw (IsDirty set)-> {0}", this.ToString ())); - #endif IsDirty = true; if (RegisteredLayoutings == LayoutingType.None) IFace.EnqueueForRepaint (this); @@ -1411,7 +1443,7 @@ namespace Crow (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType); // //prevent queueing same LayoutingType for this -// layoutType &= (~RegisteredLayoutings); + layoutType &= (~RegisteredLayoutings); if (layoutType == LayoutingType.None) return; @@ -1453,9 +1485,6 @@ namespace Crow /// met and LQI has to be re-queued</returns> public virtual bool UpdateLayout (LayoutingType layoutType) { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("UpdateLayout ({1})-> {0}", this.ToString (), layoutType)); - #endif //unset bit, it would be reset if LQI is re-queued registeredLayoutings &= (~layoutType); @@ -1606,8 +1635,8 @@ namespace Crow /// <summary> This is the common overridable drawing routine to create new widget </summary> protected virtual void onDraw(Context gr) { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("OnDraw -> {0}", this.ToString ())); + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GODraw, this); #endif Rectangle rBack = new Rectangle (Slot.Size); @@ -1615,6 +1644,10 @@ namespace Crow Background.SetAsSource (gr, rBack); CairoHelpers.CairoRectangle (gr, rBack, cornerRadius); gr.Fill (); + + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } /// <summary> @@ -1622,23 +1655,33 @@ namespace Crow /// this trigger the effective drawing routine </summary> protected virtual void RecreateCache () { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("RecreateCache -> {0}", this.ToString ())); + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GORecreateCache, this); #endif - IsDirty = false; - if (bmp != null) - bmp.Dispose (); - bmp = new ImageSurface (Format.Argb32, Slot.Width, Slot.Height); + + /*if (bmp == null) + bmp = IFace.surf.CreateSimilar (Content.ColorAlpha, Slot.Width, Slot.Height); + else if (LastPaintedSlot.Width != Slot.Width || LastPaintedSlot.Height != Slot.Height) + bmp.SetSize (Slot.Width, Slot.Height);*/ + bmp?.Dispose (); + bmp = new ImageSurface(Format.Argb32, Slot.Width, Slot.Height); + using (Context gr = new Context (bmp)) { gr.Antialias = Interface.Antialias; onDraw (gr); } - bmp.Flush (); + + IsDirty = false; + + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } protected virtual void UpdateCache(Context ctx){ - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("UpdateCache -> {0}", this.ToString ())); + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOUpdateCacheAndPaintOnCTX, this); #endif + Rectangle rb = Slot + Parent.ClientRectangle.Position; if (clearBackground) { ctx.Save (); @@ -1647,17 +1690,21 @@ namespace Crow ctx.Fill (); ctx.Restore (); } + ctx.SetSourceSurface (bmp, rb.X, rb.Y); ctx.Paint (); Clipping.Dispose (); Clipping = new Region (); + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; + #endif } /// <summary> Chained painting routine on the parent context of the actual cached version /// of the widget </summary> public virtual void Paint (ref Context ctx) { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("Paint -> {0}", this.ToString ())); + #if DEBUG_LOG + DebugLog.AddEvent(DbgEvtType.GOPaint, this); #endif //TODO:this test should not be necessary if (Slot.Height < 0 || Slot.Width < 0 || parent == null) @@ -1673,8 +1720,8 @@ namespace Crow RecreateCache (); UpdateCache (ctx); - if (!isEnabled) - paintDisabled (ctx, Slot + Parent.ClientRectangle.Position); + if (!isEnabled) + paintDisabled (ctx, Slot + Parent.ClientRectangle.Position); } else { Rectangle rb = Slot + Parent.ClientRectangle.Position; ctx.Save (); @@ -1700,14 +1747,14 @@ namespace Crow #endregion #region Keyboard handling - public virtual void onKeyDown(object sender, KeyboardKeyEventArgs e){ - KeyDown.Raise (sender, e); + public virtual void onKeyDown(object sender, KeyEventArgs e){ + KeyDown.Raise (this, e); } - public virtual void onKeyUp(object sender, KeyboardKeyEventArgs e){ - KeyUp.Raise (sender, e); + public virtual void onKeyUp(object sender, KeyEventArgs e){ + KeyUp.Raise (this, e); } public virtual void onKeyPress(object sender, KeyPressEventArgs e){ - KeyPress.Raise (sender, e); + KeyPress.Raise (this, e); } #endregion @@ -1719,7 +1766,9 @@ namespace Crow /// <returns>return true, if point is in the bounds of this control</returns> /// <param name="m">by ref point to test, init value is not kept</param> public virtual bool PointIsIn(ref Point m) - { + { + if (parent == null) + return false; if (!(Visible & isEnabled)||IsDragged) return false; if (!parent.PointIsIn(ref m)) @@ -1766,8 +1815,6 @@ namespace Crow Debug.WriteLine("MOUSE DOWN => " + this.ToString()); #endif - if (IFace.ActiveWidget == null) - IFace.ActiveWidget = this; if (this.Focusable && !Interface.FocusOnHover) { BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg; if (be.Focused == null) { @@ -1807,49 +1854,47 @@ namespace Crow MouseUp.Raise (this, e); } public virtual void onMouseClick(object sender, MouseButtonEventArgs e){ - #if DEBUG_FOCUS +#if DEBUG_FOCUS Debug.WriteLine("CLICK => " + this.ToString()); - #endif +#endif + if (MouseClick != null) + { + MouseClick.Raise(this, e); + return; + } GraphicObject p = focusParent; if (p != null) - p.onMouseClick(sender,e); - MouseClick.Raise (this, e); + p.onMouseClick(sender,e); } public virtual void onMouseDoubleClick(object sender, MouseButtonEventArgs e){ - #if DEBUG_FOCUS +#if DEBUG_FOCUS Debug.WriteLine("DOUBLE CLICK => " + this.ToString()); - #endif - GraphicObject p = focusParent; +#endif + if (MouseDoubleClick != null) + { + MouseDoubleClick.Raise(this, e); + return; + } + GraphicObject p = focusParent; if (p != null) - p.onMouseDoubleClick(sender,e); - MouseDoubleClick.Raise (this, e); + p.onMouseDoubleClick(sender,e); } public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){ - GraphicObject p = focusParent; + if (MouseWheelChanged != null) + { + MouseWheelChanged.Raise(this, e); + return; + } + GraphicObject p = focusParent; if (p != null) p.onMouseWheel(sender,e); - - MouseWheelChanged.Raise (this, e); } public virtual void onMouseEnter(object sender, MouseMoveEventArgs e) { #if DEBUG_FOCUS Debug.WriteLine("MouseEnter => " + this.ToString()); #endif - MouseEnter.Raise (this, e); - } - public virtual void onMouseLeave(object sender, MouseMoveEventArgs e) - { - #if DEBUG_FOCUS - Debug.WriteLine("MouseLeave => " + this.ToString()); - #endif - MouseLeave.Raise (this, e); - } - public virtual void onHover(object sender, EventArgs e) - { - #if DEBUG_FOCUS - Debug.WriteLine("MouseHover => " + this.ToString()); - #endif + if (IFace.DragAndDropOperation != null) { GraphicObject g = this; while (g != null) { @@ -1864,15 +1909,18 @@ namespace Crow g = g.focusParent; } } - Hover.Raise (this, e); + + MouseEnter.Raise (this, e); } - public virtual void onUnHover(object sender, EventArgs e) + public virtual void onMouseLeave(object sender, MouseMoveEventArgs e) { #if DEBUG_FOCUS - Debug.WriteLine("MouseUnHover => " + this.ToString()); + Debug.WriteLine("MouseLeave => " + this.ToString()); #endif - UnHover.Raise (this, e); + + MouseLeave.Raise (this, e); } + #endregion protected virtual void onFocused(object sender, EventArgs e){ @@ -1931,15 +1979,21 @@ namespace Crow if (Parent != null) tmp = Parent.ToString () + tmp; #if DEBUG_LAYOUTING - return Name == "unamed" ? tmp + "." + this.GetType ().Name + uid.ToString(): tmp + "." + Name; + return Name == "unamed" ? tmp + "." + this.GetType ().Name + GraphicObjects.IndexOf(this).ToString(): tmp + "." + Name; #else - return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name; + return string.IsNullOrEmpty(Name) ? tmp + "." + this.GetType ().Name : tmp + "." + Name; #endif } /// <summary> /// Checks to handle when widget is removed from the visible graphic tree /// </summary> void unshownPostActions () { + if (IFace.HoverWidget != null) { + if (IFace.HoverWidget.IsOrIsInside (this)) { + IFace.HoverWidget = null; + IFace.ProcessMouseMove (IFace.Mouse.X, IFace.Mouse.Y); + } + } if (IFace.ActiveWidget != null) { if (IFace.ActiveWidget.IsOrIsInside (this)) IFace.ActiveWidget = null; @@ -1948,12 +2002,6 @@ namespace Crow if (IFace.FocusedWidget.IsOrIsInside (this)) IFace.FocusedWidget = null; } - if (IFace.HoverWidget != null) { - if (IFace.HoverWidget.IsOrIsInside (this)) { - IFace.HoverWidget = null; - IFace.ProcessMouseMove (IFace.Mouse.X, IFace.Mouse.Y); - } - } } } } diff --git a/src/GraphicObjects/Grid.cs b/Crow/src/GraphicObjects/Grid.cs index 4ae906a7..71e89bde 100644 --- a/src/GraphicObjects/Grid.cs +++ b/Crow/src/GraphicObjects/Grid.cs @@ -56,13 +56,13 @@ namespace Crow #endregion #region Public Properties - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public int Spacing { get { return _spacing; } set { _spacing = value; } } - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public virtual int ColumnCount { get { return _columnCount; } @@ -76,7 +76,7 @@ namespace Crow this.RegisterForLayouting (LayoutingType.ArrangeChildren); } } - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public virtual int RowCount { get { return _rowCount; } diff --git a/src/GraphicObjects/Group.cs b/Crow/src/GraphicObjects/Group.cs index a90947a5..13fdcd49 100644 --- a/src/GraphicObjects/Group.cs +++ b/Crow/src/GraphicObjects/Group.cs @@ -84,7 +84,7 @@ namespace Crow public virtual List<GraphicObject> Children { get { return children; } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool MultiSelect { get { return _multiSelect; } @@ -340,7 +340,11 @@ namespace Crow childrenRWLock.ExitReadLock (); #if DEBUG_CLIP_RECTANGLE - Clipping.stroke (gr, Color.Amaranth.AdjustAlpha (0.8)); + /*gr.LineWidth = 1; + gr.SetSourceColor(Color.DarkMagenta.AdjustAlpha (0.8)); + for (int i = 0; i < Clipping.NumRectangles; i++) + gr.Rectangle(Clipping.GetRectangle(i)); + gr.Stroke ();*/ #endif } gr.Dispose (); diff --git a/src/GraphicObjects/GroupBox.cs b/Crow/src/GraphicObjects/GroupBox.cs index 2e32ddd5..2e32ddd5 100644 --- a/src/GraphicObjects/GroupBox.cs +++ b/Crow/src/GraphicObjects/GroupBox.cs diff --git a/src/GraphicObjects/HorizontalStack.cs b/Crow/src/GraphicObjects/HorizontalStack.cs index 64d7cae5..64d7cae5 100644 --- a/src/GraphicObjects/HorizontalStack.cs +++ b/Crow/src/GraphicObjects/HorizontalStack.cs diff --git a/src/GraphicObjects/HueSelector.cs b/Crow/src/GraphicObjects/HueSelector.cs index 67f4ec6e..d8218fee 100644 --- a/src/GraphicObjects/HueSelector.cs +++ b/Crow/src/GraphicObjects/HueSelector.cs @@ -44,7 +44,7 @@ namespace Crow Orientation _orientation; double hue; - [XmlAttributeAttribute][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public virtual Orientation Orientation { get { return _orientation; } @@ -56,7 +56,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()] + public virtual double Hue { get { return hue; } set { diff --git a/src/GraphicObjects/ILayoutable.cs b/Crow/src/GraphicObjects/ILayoutable.cs index c8aa38fb..c8aa38fb 100644 --- a/src/GraphicObjects/ILayoutable.cs +++ b/Crow/src/GraphicObjects/ILayoutable.cs diff --git a/src/GraphicObjects/IMLContainer.cs b/Crow/src/GraphicObjects/IMLContainer.cs index 84692284..84692284 100644 --- a/src/GraphicObjects/IMLContainer.cs +++ b/Crow/src/GraphicObjects/IMLContainer.cs diff --git a/src/GraphicObjects/IValueChange.cs b/Crow/src/GraphicObjects/IValueChange.cs index 7e18e5e5..7e18e5e5 100644 --- a/src/GraphicObjects/IValueChange.cs +++ b/Crow/src/GraphicObjects/IValueChange.cs diff --git a/src/GraphicObjects/Image.cs b/Crow/src/GraphicObjects/Image.cs index e83183c0..21a83f90 100644 --- a/src/GraphicObjects/Image.cs +++ b/Crow/src/GraphicObjects/Image.cs @@ -49,7 +49,7 @@ namespace Crow /// <summary> /// If false, original size will be kept in any case. /// </summary> - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public virtual bool Scaled { get { return scaled; } set { @@ -66,7 +66,7 @@ namespace Crow /// <summary> /// If image is scaled, proportions will be preserved. /// </summary> - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public virtual bool KeepProportions { get { return keepProps; } set { @@ -83,7 +83,7 @@ namespace Crow /// <summary> /// Image file path, may be on disk or embedded. Accepts bitmaps or SVG drawings. /// </summary> - [XmlAttributeAttribute] + public string Path { get { return _pic == null ? "" : _pic.Path; } set { @@ -108,7 +108,7 @@ namespace Crow /// Used only for svg images, repaint only node named referenced in SvgSub. /// If null, all the svg is rendered /// </summary> - [XmlAttributeAttribute] + public string SvgSub { get { return _svgSub; } set { @@ -122,7 +122,7 @@ namespace Crow /// Object holding the image data once loaded, may be used directely to pupulate this control without /// specifying a path. /// </summary> - [XmlAttributeAttribute] + public Picture Picture { get { return _pic; } set { @@ -137,7 +137,7 @@ namespace Crow /// Opacity parameter for the image /// </summary> // TODO:could be moved in GraphicObject - [XmlAttributeAttribute()][DefaultValue(1.0)] + [DefaultValue(1.0)] public virtual double Opacity { get { return opacity; } set { @@ -173,7 +173,7 @@ namespace Crow else pic = new BmpPicture (path); - pic.Load (IFace, path); + pic.Scaled = scaled; pic.KeepProportions = keepProps; diff --git a/src/GraphicObjects/Label.cs b/Crow/src/GraphicObjects/Label.cs index 0e0d9fe1..6aba6ee0 100644 --- a/src/GraphicObjects/Label.cs +++ b/Crow/src/GraphicObjects/Label.cs @@ -87,7 +87,7 @@ namespace Crow protected TextExtents te; #endregion - [XmlAttributeAttribute][DefaultValue("SteelBlue")] + [DefaultValue("SteelBlue")] public virtual Color SelectionBackground { get { return selBackground; } set { @@ -98,7 +98,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Color SelectionForeground { get { return selForeground; } set { @@ -109,7 +109,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(Alignment.Left)] + [DefaultValue(Alignment.Left)] public Alignment TextAlignment { get { return _textAlignment; } @@ -121,7 +121,7 @@ namespace Crow NotifyValueChanged ("TextAlignment", _textAlignment); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public virtual bool HorizontalStretch { get { return horizontalStretch; } set { @@ -132,7 +132,7 @@ namespace Crow NotifyValueChanged ("HorizontalStretch", horizontalStretch); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public virtual bool VerticalStretch { get { return verticalStretch; } set { @@ -143,7 +143,7 @@ namespace Crow NotifyValueChanged ("VerticalStretch", verticalStretch); } } - [XmlAttributeAttribute][DefaultValue("label")] + [DefaultValue("label")] public string Text { get { @@ -166,7 +166,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Selectable { get { return _selectable; } @@ -181,7 +181,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Multiline { get { return _multiline; } @@ -194,7 +194,7 @@ namespace Crow RegisterForGraphicUpdate(); } } - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public int CurrentColumn{ get { return _currentCol; } set { @@ -209,7 +209,7 @@ namespace Crow NotifyValueChanged ("CurrentColumn", _currentCol); } } - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public int CurrentLine{ get { return _currentLine; } set { @@ -235,7 +235,7 @@ namespace Crow /// <summary> /// Selection begin position in char units /// </summary> - [XmlAttributeAttribute][DefaultValue("-1")] + [DefaultValue("-1")] public Point SelBegin { get { return _selBegin; @@ -248,7 +248,7 @@ namespace Crow NotifyValueChanged ("SelectedText", SelectedText); } } - [XmlAttributeAttribute][DefaultValue("-1")] + [DefaultValue("-1")] public Point SelRelease { get { return _selRelease; @@ -640,7 +640,8 @@ namespace Crow Foreground.SetAsSource (gr); gr.MoveTo (lineRect.X,(double)rText.Y + fe.Ascent + (fe.Ascent+fe.Descent) * i) ; - gr.ShowText (l); + + gr.ShowText (l); gr.Fill (); if (Selectable) { diff --git a/src/GraphicObjects/ListBox.cs b/Crow/src/GraphicObjects/ListBox.cs index 438e8d60..438e8d60 100644 --- a/src/GraphicObjects/ListBox.cs +++ b/Crow/src/GraphicObjects/ListBox.cs diff --git a/src/GraphicObjects/Menu.cs b/Crow/src/GraphicObjects/Menu.cs index dbc1d636..73396238 100644 --- a/src/GraphicObjects/Menu.cs +++ b/Crow/src/GraphicObjects/Menu.cs @@ -41,7 +41,7 @@ namespace Crow bool autoOpen = false; #region Public properties - [XmlAttributeAttribute][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public Orientation Orientation { get { return orientation; } set { @@ -51,10 +51,15 @@ namespace Crow NotifyValueChanged ("Orientation", orientation); } } - [XmlIgnore]public bool AutomaticOpenning + [XmlIgnore]public bool AutomaticOpening { get { return autoOpen; } - set { autoOpen = value; } + set { + if (autoOpen == value) + return; + autoOpen = value; + NotifyValueChanged ("AutomaticOpening", autoOpen); + } } #endregion @@ -70,7 +75,7 @@ namespace Crow public override void onMouseLeave (object sender, MouseMoveEventArgs e) { base.onMouseLeave (sender, e); - AutomaticOpenning = false; + AutomaticOpening = false; } } } diff --git a/src/GraphicObjects/MenuItem.cs b/Crow/src/GraphicObjects/MenuItem.cs index 5c9665fb..a9e164d5 100644 --- a/src/GraphicObjects/MenuItem.cs +++ b/Crow/src/GraphicObjects/MenuItem.cs @@ -46,7 +46,7 @@ namespace Crow Measure popWidth, popHeight; #region Public properties - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool IsOpened { get { return isOpened; } set { @@ -58,12 +58,12 @@ namespace Crow if (isOpened) { onOpen (this, null); if (LogicalParent is Menu) - (LogicalParent as Menu).AutomaticOpenning = true; + (LogicalParent as Menu).AutomaticOpening = true; }else onClose (this, null); } } - [XmlAttributeAttribute][DefaultValue(null)] + [DefaultValue(null)] public virtual Command Command { get { return command; } set { @@ -85,17 +85,17 @@ namespace Crow NotifyValueChanged ("Command", command); } } - [XmlAttributeAttribute] + public override bool IsEnabled { get { return Command == null ? base.IsEnabled : Command.CanExecute; } set { base.IsEnabled = value; } } - [XmlAttributeAttribute] + public override string Caption { get { return Command == null ? base.Caption : Command.Caption; } set { base.Caption = value; } } - [XmlAttributeAttribute] + public Picture Icon { get { return Command == null ? icon : Command.Icon;; } set { @@ -106,7 +106,7 @@ namespace Crow NotifyValueChanged ("Icon", icon); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopWidth { get { return popWidth; } set { @@ -116,7 +116,7 @@ namespace Crow NotifyValueChanged ("PopWidth", popWidth); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopHeight { get { return popHeight; } set { @@ -148,7 +148,7 @@ namespace Crow closeMenu (); } if(!IsOpened) - (LogicalParent as Menu).AutomaticOpenning = false; + (LogicalParent as Menu).AutomaticOpening = false; } protected virtual void onOpen (object sender, EventArgs e){ Open.Raise (this, null); @@ -164,7 +164,10 @@ namespace Crow public override void onMouseEnter (object sender, MouseMoveEventArgs e) { base.onMouseEnter (sender, e); - if ((LogicalParent as Menu).AutomaticOpenning && items.Children.Count>0) + Menu menu = LogicalParent as Menu; + if (menu == null) + return; + if (menu.AutomaticOpening && items.Children.Count>0) IsOpened = true; } public override void onMouseLeave (object sender, MouseMoveEventArgs e) @@ -178,6 +181,8 @@ namespace Crow MenuItem tmp = LogicalParent as MenuItem; while (tmp != null) { tmp.IsOpened = false; + tmp.Background = Color.Transparent; + tmp.AutomaticOpening = false; tmp = tmp.LogicalParent as MenuItem; } } diff --git a/src/GraphicObjects/MessageBox.cs b/Crow/src/GraphicObjects/MessageBox.cs index 45ef1e00..ed9da2b4 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/Crow/src/GraphicObjects/MessageBox.cs @@ -50,7 +50,7 @@ namespace Crow protected override void loadTemplate (GraphicObject template) { base.loadTemplate (template); - NotifyValueChanged ("MsgIcon", "#Crow.Images.Icons.Informations.svg"); + NotifyValueChanged ("MsgIcon", "#Crow.Icons.iconInfo.svg"); } string message, okMessage, cancelMessage, noMessage; Type msgType = Type.None; @@ -114,7 +114,7 @@ namespace Crow NotifyValueChanged ("MsgType", msgType); switch (msgType) { case Type.Information: - MsgIcon = "#Crow.Images.Icons.Informations.svg"; + MsgIcon = "#Crow.Icons.iconInfo.svg"; Caption = "Informations"; OkMessage = "Ok"; NotifyValueChanged ("CancelButIsVisible", false); @@ -130,7 +130,7 @@ namespace Crow NotifyValueChanged ("NoButIsVisible", true); break; case Type.Alert: - MsgIcon = "#Crow.Images.Icons.IconAlerte.svg"; + MsgIcon = "#Crow.Icons.IconAlerte.svg"; Caption = "Alert"; OkMessage = "Ok"; CancelMessage = "Cancel"; @@ -138,7 +138,7 @@ namespace Crow NotifyValueChanged ("NoButIsVisible", false); break; case Type.Error: - MsgIcon = "#Crow.Images.Icons.exit.svg"; + MsgIcon = "#Crow.Icons.exit.svg"; Caption = "Error"; OkMessage = "Ok"; NotifyValueChanged ("CancelButIsVisible", false); diff --git a/src/GraphicObjects/NumericControl.cs b/Crow/src/GraphicObjects/NumericControl.cs index f0eda90f..73083311 100644 --- a/src/GraphicObjects/NumericControl.cs +++ b/Crow/src/GraphicObjects/NumericControl.cs @@ -49,7 +49,7 @@ namespace Crow #endregion #region public properties - [XmlAttributeAttribute][DefaultValue(2)] + [DefaultValue(2)] public int Decimals { get { return _decimals; } @@ -62,7 +62,7 @@ namespace Crow RegisterForGraphicUpdate(); } } - [XmlAttributeAttribute][DefaultValue(0.0)] + [DefaultValue(0.0)] public virtual double Minimum { get { return minValue; } set { @@ -74,7 +74,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(100.0)] + [DefaultValue(100.0)] public virtual double Maximum { get { return maxValue; } @@ -87,7 +87,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(1.0)] + [DefaultValue(1.0)] public virtual double SmallIncrement { get { return smallStep; } @@ -100,7 +100,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(5.0)] + [DefaultValue(5.0)] public virtual double LargeIncrement { get { return bigStep; } diff --git a/src/GraphicObjects/Popper.cs b/Crow/src/GraphicObjects/Popper.cs index 1186e8e7..89c0fa5a 100644 --- a/src/GraphicObjects/Popper.cs +++ b/Crow/src/GraphicObjects/Popper.cs @@ -46,7 +46,7 @@ namespace Crow public event EventHandler Unpoped; #region Public Properties - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopWidth { get { return popWidth; } set { @@ -56,7 +56,7 @@ namespace Crow NotifyValueChanged ("PopWidth", popWidth); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopHeight { get { return popHeight; } set { @@ -66,7 +66,7 @@ namespace Crow NotifyValueChanged ("PopHeight", popHeight); } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsPopped { get { return _isPopped; } @@ -89,7 +89,7 @@ namespace Crow } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public bool CanPop { get { return _canPop; } @@ -102,7 +102,7 @@ namespace Crow NotifyValueChanged ("CanPop", _canPop); } } - [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)] + [DefaultValue(Alignment.Bottom)] public virtual Alignment PopDirection { get { return popDirection; } set { diff --git a/src/GraphicObjects/PrivateContainer.cs b/Crow/src/GraphicObjects/PrivateContainer.cs index d6637247..0f9b0c59 100644 --- a/src/GraphicObjects/PrivateContainer.cs +++ b/Crow/src/GraphicObjects/PrivateContainer.cs @@ -51,10 +51,17 @@ namespace Crow go = null; if (base.FindByDesignID (designID, out go)) return true; - return (bool)child?.FindByDesignID (designID, out go); + if (child == null) + return false; + return child.FindByDesignID (designID, out go); } #endif protected GraphicObject child; + #if DEBUG_LOG + internal GraphicObject getTemplateRoot { + get { return child; } + } + #endif protected virtual void SetChild(GraphicObject _child) { diff --git a/src/GraphicObjects/ProgressBar.cs b/Crow/src/GraphicObjects/ProgressBar.cs index e8165fd2..e8165fd2 100644 --- a/src/GraphicObjects/ProgressBar.cs +++ b/Crow/src/GraphicObjects/ProgressBar.cs diff --git a/src/GraphicObjects/RadioButton.cs b/Crow/src/GraphicObjects/RadioButton.cs index 4c553481..d18971a2 100644 --- a/src/GraphicObjects/RadioButton.cs +++ b/Crow/src/GraphicObjects/RadioButton.cs @@ -60,7 +60,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsChecked { get { return isChecked; } diff --git a/src/GraphicObjects/SaturationValueSelector.cs b/Crow/src/GraphicObjects/SaturationValueSelector.cs index 485a33d2..5a25d6a2 100644 --- a/src/GraphicObjects/SaturationValueSelector.cs +++ b/Crow/src/GraphicObjects/SaturationValueSelector.cs @@ -40,7 +40,7 @@ namespace Crow double v, s; - [XmlAttributeAttribute()] + public virtual double V { get { return v; } set { @@ -53,7 +53,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()] + public virtual double S { get { return s; } set { diff --git a/src/GraphicObjects/ScrollBar.cs b/Crow/src/GraphicObjects/ScrollBar.cs index 5dac20e1..cf6201e4 100644 --- a/src/GraphicObjects/ScrollBar.cs +++ b/Crow/src/GraphicObjects/ScrollBar.cs @@ -45,7 +45,7 @@ namespace Crow public ScrollBar(Interface iface) : base(iface) {} #endregion - [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)] + [DefaultValue(Orientation.Vertical)] public virtual Orientation Orientation { get { return _orientation; } @@ -54,10 +54,15 @@ namespace Crow return; _orientation = value; NotifyValueChanged ("Orientation", _orientation); - RegisterForGraphicUpdate (); + if (_orientation == Orientation.Horizontal) + NotifyValueChanged ("ScrollBackShape", "M 1.5,3.5 L 6.5,0.5 L 6.5,6.5 Z"); + else + NotifyValueChanged ("ScrollBackShape", "M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z"); + + RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue(20)] + [DefaultValue(20)] public virtual int CursorSize { get { return _cursorSize; } set { diff --git a/src/GraphicObjects/Scroller.cs b/Crow/src/GraphicObjects/Scroller.cs index 30dd1480..16f6556d 100644 --- a/src/GraphicObjects/Scroller.cs +++ b/Crow/src/GraphicObjects/Scroller.cs @@ -53,7 +53,7 @@ namespace Crow #region public properties /// <summary> Horizontal Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollX { get { return scrollX; } set { @@ -76,7 +76,7 @@ namespace Crow } } /// <summary> Vertical Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollY { get { return scrollY; } set { @@ -99,7 +99,7 @@ namespace Crow } } /// <summary> Horizontal Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollX { get { return maxScrollX; } set { @@ -116,7 +116,7 @@ namespace Crow } } /// <summary> Vertical Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollY { get { return maxScrollY; } set { @@ -133,7 +133,7 @@ namespace Crow } } /// <summary> Mouse Wheel Scrolling multiplier </summary> - [XmlAttributeAttribute][DefaultValue(50)] + [DefaultValue(50)] public virtual int ScrollSpeed { get { return scrollSpeed; } set { @@ -222,13 +222,13 @@ namespace Crow public override void onMouseWheel (object sender, MouseWheelEventArgs e) { base.onMouseWheel (sender, e); - if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft)) + if (IFace.IsKeyDown (Key.Shift_L)) ScrollX += e.Delta * ScrollSpeed; else ScrollY -= e.Delta * ScrollSpeed; } /// <summary> Process scrolling with arrow keys, home and end keys. </summary> - public override void onKeyDown (object sender, KeyboardKeyEventArgs e) + public override void onKeyDown (object sender, KeyEventArgs e) { base.onKeyDown (sender, e); diff --git a/src/GraphicObjects/ScrollingObject.cs b/Crow/src/GraphicObjects/ScrollingObject.cs index de4b2113..65d79d90 100644 --- a/src/GraphicObjects/ScrollingObject.cs +++ b/Crow/src/GraphicObjects/ScrollingObject.cs @@ -52,7 +52,7 @@ namespace Crow protected bool KeyEventsOverrides = false; /// <summary> Horizontal Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollX { get { return scrollX; } set { @@ -68,14 +68,14 @@ namespace Crow if (newS == scrollX) return; - scrollX = value; + scrollX = newS; NotifyValueChanged ("ScrollX", scrollX); RegisterForGraphicUpdate (); } } /// <summary> Vertical Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollY { get { return scrollY; } set { @@ -91,14 +91,14 @@ namespace Crow if (newS == scrollY) return; - scrollY = value; + scrollY = newS; NotifyValueChanged ("ScrollY", scrollY); RegisterForGraphicUpdate (); } } /// <summary> Horizontal Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollX { get { return maxScrollX; } set { @@ -115,7 +115,7 @@ namespace Crow } } /// <summary> Vertical Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollY { get { return maxScrollY; } set { @@ -132,7 +132,7 @@ namespace Crow } } /// <summary> Mouse Wheel Scrolling multiplier </summary> - [XmlAttributeAttribute][DefaultValue(1)] + [DefaultValue(1)] public virtual int MouseWheelSpeed { get { return mouseWheelSpeed; } set { @@ -149,13 +149,13 @@ namespace Crow public override void onMouseWheel (object sender, MouseWheelEventArgs e) { base.onMouseWheel (sender, e); - if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft)) + if (IFace.Shift) ScrollX += e.Delta * MouseWheelSpeed; else ScrollY -= e.Delta * MouseWheelSpeed; } /// <summary> Process scrolling with arrow keys, home and end keys. </summary> - public override void onKeyDown (object sender, KeyboardKeyEventArgs e) + public override void onKeyDown (object sender, KeyEventArgs e) { base.onKeyDown (sender, e); diff --git a/src/GraphicObjects/Shape.cs b/Crow/src/GraphicObjects/Shape.cs index a4b3193e..aa397316 100644 --- a/src/GraphicObjects/Shape.cs +++ b/Crow/src/GraphicObjects/Shape.cs @@ -63,6 +63,7 @@ namespace Crow string path; double strokeWidth; + Size size; public string Path { get { return path; } @@ -75,7 +76,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute][DefaultValue(1.0)] + [DefaultValue(1.0)] public double StokeWidth { get { return strokeWidth; } set { @@ -87,14 +88,37 @@ namespace Crow RegisterForGraphicUpdate (); } } + [DefaultValue("0,0")] + public Size Size + { + get { return size; } + set + { + if (size == value) + return; + size = value; + contentSize = default(Size); + NotifyValueChanged("Size", size); + RegisterForLayouting(LayoutingType.Sizing); + } + } + protected override void onDraw(Context gr) + { + + if (string.IsNullOrEmpty(path)) + return; + + gr.Save(); + + Rectangle r = ClientRectangle; - protected override void onDraw (Context gr) - { - - if (string.IsNullOrEmpty (path)) - return; - Rectangle r = ClientRectangle; + double sx = (double)r.Width / (double)(contentSize.Width == 0? size.Width : contentSize.Width); + double sy = (double)r.Height / (double)(contentSize.Height == 0 ? size.Height : contentSize.Height); + + gr.Translate(r.Left, r.Top); + gr.Scale (sx,sy); + executePath (gr); @@ -102,7 +126,8 @@ namespace Crow gr.FillPreserve (); gr.LineWidth = strokeWidth; Foreground.SetAsSource (gr, r); - gr.Stroke (); + gr.Stroke (); + gr.Restore(); } void executePath (Context gr){ @@ -148,13 +173,20 @@ namespace Crow protected override int measureRawSize (LayoutingType lt) { if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) { - using (Surface drawing = new ImageSurface (Format.A1, 1,1)) { - using (Context ctx = new Context (drawing)) { - executePath (ctx); - Rectangle r = ctx.StrokeExtents (); - contentSize = new Size (r.Right, r.Bottom); - } - } + if (size != default(Size)) + contentSize = size; + else + { + using (Surface drawing = new ImageSurface(Format.A1, 1, 1)) + { + using (Context ctx = new Context(drawing)) + { + executePath(ctx); + Rectangle r = ctx.StrokeExtents(); + contentSize = new Size(r.Right, r.Bottom); + } + } + } } return lt == LayoutingType.Width ? contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin; diff --git a/src/GraphicObjects/Slider.cs b/Crow/src/GraphicObjects/Slider.cs index 2bdd5b8a..d76d6379 100644 --- a/src/GraphicObjects/Slider.cs +++ b/Crow/src/GraphicObjects/Slider.cs @@ -68,7 +68,7 @@ namespace Crow protected double unity; #region Public properties - [DefaultValue("vgradient|0:White|0,1:LightGray|0,9:LightGray|1:DimGray")] + [DefaultValue("vgradient|0:White|0,1:LightGrey|0,9:LightGrey|1:DimGrey")] public virtual Fill CursorColor { get { return _cursorColor; } set { @@ -121,6 +121,7 @@ namespace Crow protected override void onDraw (Context gr) { base.onDraw (gr); + if (Maximum <= 0) return; @@ -142,6 +143,10 @@ namespace Crow } + Background.SetAsSource(gr, r); + gr.Rectangle (r); + gr.Fill (); + DrawGraduations (gr, pStart,pEnd); DrawCursor (gr, cursor); @@ -161,9 +166,11 @@ namespace Crow } protected virtual void DrawCursor(Context gr, Rectangle _cursor) { - CursorColor.SetAsSource (gr, _cursor); CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius); - gr.Fill(); + Foreground.SetAsSource(gr, _cursor); + gr.StrokePreserve(); + CursorColor.SetAsSource(gr, _cursor); + gr.Fill(); } void computeCursorPosition() @@ -184,7 +191,7 @@ namespace Crow cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2), r.Top + (int)((Value - Minimum) * unity)); } - cursor.Inflate (-1); + //cursor.Inflate (-1); } Point mouseDownInit; double mouseDownInitValue; diff --git a/src/GraphicObjects/Spinner.cs b/Crow/src/GraphicObjects/Spinner.cs index 7c5fdb26..7c5fdb26 100644 --- a/src/GraphicObjects/Spinner.cs +++ b/Crow/src/GraphicObjects/Spinner.cs diff --git a/src/GraphicObjects/Splitter.cs b/Crow/src/GraphicObjects/Splitter.cs index 84e1ade0..8fb7bb77 100644 --- a/src/GraphicObjects/Splitter.cs +++ b/Crow/src/GraphicObjects/Splitter.cs @@ -43,7 +43,7 @@ namespace Crow int thickness; - [XmlAttributeAttribute][DefaultValue(1)] + [DefaultValue(1)] public virtual int Thickness { get { return thickness; } set { @@ -141,7 +141,7 @@ namespace Crow { base.onMouseMove (sender, e); - if (!IsActive) + if (!IsActive || go1 == null || go2 == null) return; GenericStack gs = Parent as GenericStack; diff --git a/src/GraphicObjects/TabItem.cs b/Crow/src/GraphicObjects/TabItem.cs index 473fc313..f92c1d75 100644 --- a/src/GraphicObjects/TabItem.cs +++ b/Crow/src/GraphicObjects/TabItem.cs @@ -49,6 +49,7 @@ namespace Crow int tabOffset; bool isSelected; Measure tabThickness; + Fill selectedBackground = Color.Transparent; #endregion #region TemplatedControl overrides @@ -115,8 +116,30 @@ namespace Crow set { if (isSelected == value) return; + + if (tview != null) + tview.SelectedTab = tview.Children.IndexOf(this); + isSelected = value; NotifyValueChanged ("IsSelected", isSelected); + RegisterForRedraw (); + } + } + + /// <summary> + /// background fill of the control, maybe solid color, gradient, image, or svg + /// </summary> + [DesignCategory ("Appearance")][DefaultValue("DimGrey")] + public virtual Fill SelectedBackground { + get { return selectedBackground; } + set { + if (selectedBackground == value) + return; + if (value == null) + return; + selectedBackground = value; + NotifyValueChanged ("SelectedBackground", selectedBackground); + RegisterForRedraw (); } } protected override void onDraw (Context gr) @@ -148,8 +171,17 @@ namespace Crow gr.LineWidth = 1; Foreground.SetAsSource (gr); gr.StrokePreserve (); - gr.Clip (); + gr.ClipPreserve (); + + if (IsSelected) + SelectedBackground.SetAsSource (gr, ClientRectangle); + else + Background.SetAsSource (gr, ClientRectangle); + + gr.Fill (); + base.onDraw (gr); + gr.Restore (); } @@ -158,6 +190,7 @@ namespace Crow int dis = 128; internal TabView savedParent = null; + void makeFloating (TabView tv) { lock (IFace.UpdateMutex) { ImageSurface di = new ImageSurface (Format.Argb32, dis, dis); @@ -231,7 +264,8 @@ namespace Crow { if (!base.PointIsIn (ref m)) return false; - + if (tview == null)//double check this, just added to prevent exception + return false; if (m.Y < tview.TabHeight) return TabTitle.Slot.ContainsOrIsEqual (m); else @@ -240,7 +274,7 @@ namespace Crow public override void onMouseUp (object sender, MouseButtonEventArgs e) { base.onMouseUp (sender, e); - tview.UpdateLayout (LayoutingType.ArrangeChildren); + tview?.UpdateLayout (LayoutingType.ArrangeChildren); } public override void onMouseMove (object sender, MouseMoveEventArgs e) { diff --git a/src/GraphicObjects/TabView.cs b/Crow/src/GraphicObjects/TabView.cs index 304e820d..304e820d 100644 --- a/src/GraphicObjects/TabView.cs +++ b/Crow/src/GraphicObjects/TabView.cs diff --git a/src/GraphicObjects/TemplatedContainer.cs b/Crow/src/GraphicObjects/TemplatedContainer.cs index a779595d..a779595d 100644 --- a/src/GraphicObjects/TemplatedContainer.cs +++ b/Crow/src/GraphicObjects/TemplatedContainer.cs diff --git a/src/GraphicObjects/TemplatedControl.cs b/Crow/src/GraphicObjects/TemplatedControl.cs index 54991a41..a1a11b22 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/Crow/src/GraphicObjects/TemplatedControl.cs @@ -69,7 +69,7 @@ namespace Crow /// Template path /// </summary> //TODO: this property should be renamed 'TemplatePath' - [XmlAttributeAttribute][DefaultValue(null)] + [DefaultValue(null)] public string Template { get { return _template; } set { @@ -86,7 +86,7 @@ namespace Crow /// <summary> /// a caption being recurrent need in templated widget, it is declared here. /// </summary> - [XmlAttributeAttribute()][DefaultValue("Templated Control")] + [DefaultValue("Templated Control")] public virtual string Caption { get { return caption; } set { diff --git a/src/GraphicObjects/TemplatedGroup.cs b/Crow/src/GraphicObjects/TemplatedGroup.cs index f7c93763..dd9afb6c 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/Crow/src/GraphicObjects/TemplatedGroup.cs @@ -97,7 +97,7 @@ namespace Crow /// ItemTemplate enclosing tag, or several item templates each enclosed /// in a separate tag. /// </summary> - [XmlAttributeAttribute] + public string ItemTemplate { get { return _itemTemplate; } set { @@ -128,7 +128,7 @@ namespace Crow /// Other possible values are properties of Data /// </summary> /// <value>The data property test.</value> - [XmlAttributeAttribute][DefaultValue("TypeOf")] + [DefaultValue("TypeOf")] public string DataTest { get { return dataTest; } set { @@ -148,23 +148,23 @@ namespace Crow : items.Children; } } - [XmlAttributeAttribute][DefaultValue(-1)]public virtual int SelectedIndex{ + [DefaultValue(-1)]public virtual int SelectedIndex{ get { return _selectedIndex; } set { if (value == _selectedIndex) return; - if (_selectedIndex >= 0 && Items.Count > _selectedIndex) { + /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) { Items[_selectedIndex].Foreground = Color.Transparent; Items[_selectedIndex].Background = Color.Transparent; - } + }*/ _selectedIndex = value; - if (_selectedIndex >= 0 && Items.Count > _selectedIndex) { + /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) { Items[_selectedIndex].Foreground = SelectionForeground; Items[_selectedIndex].Background = SelectionBackground; - } + }*/ NotifyValueChanged ("SelectedIndex", _selectedIndex); NotifyValueChanged ("SelectedItem", SelectedItem); @@ -188,7 +188,7 @@ namespace Crow [XmlIgnore]public bool HasItems { get { return Items.Count > 0; } } - [XmlAttributeAttribute]public IList Data { + public IList Data { get { return data; } set { if (value == data) @@ -250,7 +250,7 @@ namespace Crow loadItem (e.Element, items, dataTest); } - [XmlAttributeAttribute][DefaultValue("SteelBlue")] + [DefaultValue("SteelBlue")] public virtual Color SelectionBackground { get { return selBackground; } set { @@ -261,7 +261,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Color SelectionForeground { get { return selForeground; } set { diff --git a/src/GraphicObjects/TestCairoPatch.cs b/Crow/src/GraphicObjects/TestCairoPatch.cs index f155d3c0..f155d3c0 100644 --- a/src/GraphicObjects/TestCairoPatch.cs +++ b/Crow/src/GraphicObjects/TestCairoPatch.cs diff --git a/src/GraphicObjects/TextBox.cs b/Crow/src/GraphicObjects/TextBox.cs index e29ff9bf..500a0a1a 100644 --- a/src/GraphicObjects/TextBox.cs +++ b/Crow/src/GraphicObjects/TextBox.cs @@ -66,7 +66,7 @@ namespace Crow #endregion #region Keyboard handling - public override void onKeyDown (object sender, KeyboardKeyEventArgs e) + public override void onKeyDown (object sender, KeyEventArgs e) { base.onKeyDown (sender, e); @@ -74,7 +74,7 @@ namespace Crow switch (key) { - case Key.Back: + case Key.BackSpace: if (CurrentPosition == 0) return; this.DeleteChar(); @@ -85,12 +85,12 @@ namespace Crow if (selectionIsEmpty) { if (!MoveRight ()) return; - }else if (e.Shift) + }else if (IFace.Shift) IFace.Clipboard = this.SelectedText; this.DeleteChar (); break; - case Key.Enter: - case Key.KeypadEnter: + case Key.KP_Enter: + case Key.Return: if (!selectionIsEmpty) this.DeleteChar (); if (Multiline) @@ -104,46 +104,46 @@ namespace Crow SelRelease = -1; break; case Key.Home: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = new Point (CurrentColumn, CurrentLine); - if (e.Control) + if (IFace.Ctrl) CurrentLine = 0; CurrentColumn = 0; SelRelease = new Point (CurrentColumn, CurrentLine); break; } SelRelease = -1; - if (e.Control) + if (IFace.Ctrl) CurrentLine = 0; CurrentColumn = 0; break; case Key.End: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = CurrentPosition; - if (e.Control) + if (IFace.Ctrl) CurrentLine = int.MaxValue; CurrentColumn = int.MaxValue; SelRelease = CurrentPosition; break; } SelRelease = -1; - if (e.Control) + if (IFace.Ctrl) CurrentLine = int.MaxValue; CurrentColumn = int.MaxValue; break; case Key.Insert: - if (e.Shift) + if (IFace.Shift) this.Insert (IFace.Clipboard); - else if (e.Control && !selectionIsEmpty) + else if (IFace.Ctrl && !selectionIsEmpty) IFace.Clipboard = this.SelectedText; break; case Key.Left: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = new Point(CurrentColumn, CurrentLine); - if (e.Control) + if (IFace.Ctrl) GotoWordStart (); else if (!MoveLeft ()) return; @@ -151,16 +151,16 @@ namespace Crow break; } SelRelease = -1; - if (e.Control) + if (IFace.Ctrl) GotoWordStart (); else MoveLeft(); break; case Key.Right: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = CurrentPosition; - if (e.Control) + if (IFace.Ctrl) GotoWordEnd (); else if (!MoveRight ()) return; @@ -168,13 +168,13 @@ namespace Crow break; } SelRelease = -1; - if (e.Control) + if (IFace.Ctrl) GotoWordEnd (); else MoveRight (); break; case Key.Up: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = CurrentPosition; CurrentLine--; @@ -185,7 +185,7 @@ namespace Crow CurrentLine--; break; case Key.Down: - if (e.Shift) { + if (IFace.Shift) { if (selectionIsEmpty) SelBegin = CurrentPosition; CurrentLine++; @@ -197,13 +197,11 @@ namespace Crow break; case Key.Menu: break; - case Key.NumLock: + case Key.Num_Lock: break; - case Key.PageDown: + case Key.Page_Down: break; - case Key.PageUp: - break; - case Key.RWin: + case Key.Page_Up: break; case Key.Tab: this.Insert ("\t"); @@ -211,6 +209,7 @@ namespace Crow default: break; } + RegisterForGraphicUpdate(); } public override void onKeyPress (object sender, KeyPressEventArgs e) diff --git a/src/GraphicObjects/TextRun.cs b/Crow/src/GraphicObjects/TextRun.cs index 17e3b770..297ffe95 100644 --- a/src/GraphicObjects/TextRun.cs +++ b/Crow/src/GraphicObjects/TextRun.cs @@ -61,13 +61,13 @@ namespace Crow #endregion - [XmlAttributeAttribute ()] + [DefaultValue (Alignment.Left)] public Alignment TextAlignment { get { return _textAlignment; } set { _textAlignment = value; } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public virtual bool HorizontalStretch { get { return horizontalStretch; } @@ -79,7 +79,7 @@ namespace Crow NotifyValueChanged ("HorizontalStretch", horizontalStretch); } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public virtual bool VerticalStretch { get { return verticalStretch; } @@ -91,7 +91,7 @@ namespace Crow NotifyValueChanged ("VerticalStretch", verticalStretch); } } - [XmlAttributeAttribute ()] + [DefaultValue ("label")] public string Text { get { @@ -112,7 +112,7 @@ namespace Crow lines = getLines; } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public bool Multiline { get { return _multiline; } @@ -121,7 +121,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public bool WordWrap { get { diff --git a/src/GraphicObjects/TreeView.cs b/Crow/src/GraphicObjects/TreeView.cs index 2c3f817f..5a5e7144 100644 --- a/src/GraphicObjects/TreeView.cs +++ b/Crow/src/GraphicObjects/TreeView.cs @@ -45,7 +45,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool IsRoot { get { return isRoot; } set { @@ -67,13 +67,13 @@ namespace Crow GraphicObject tmp = sender as GraphicObject; if (!tmp.HasFocus) return; - if (selectedItemContainer != null) { + /*if (selectedItemContainer != null) { selectedItemContainer.Foreground = Color.Transparent; selectedItemContainer.Background = Color.Transparent; - } + }*/ selectedItemContainer = tmp; - selectedItemContainer.Foreground = SelectionForeground; - selectedItemContainer.Background = SelectionBackground; + //selectedItemContainer.Foreground = SelectionForeground; + //selectedItemContainer.Background = SelectionBackground; NotifyValueChanged ("SelectedItem", SelectedItem); raiseSelectedItemChanged (); } diff --git a/src/GraphicObjects/Trend.cs b/Crow/src/GraphicObjects/Trend.cs index e9d3c2d3..a2e0c838 100644 --- a/src/GraphicObjects/Trend.cs +++ b/Crow/src/GraphicObjects/Trend.cs @@ -60,7 +60,7 @@ namespace Crow AddValue (value); } } - [XmlAttributeAttribute()][DefaultValue(100)] + [DefaultValue(400)] public virtual int NbValues { get { return nbValues; } set { @@ -72,7 +72,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(0.0)] + [DefaultValue(0.0)] public virtual double Minimum { get { return minValue; } set { @@ -84,7 +84,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(100.0)] + [DefaultValue(100.0)] public virtual double Maximum { get { return maxValue; } @@ -97,7 +97,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(20.0)] + [DefaultValue(1.0)] public virtual double LowThreshold { get { return lowThreshold; } set { @@ -108,7 +108,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue(80.0)] + [DefaultValue(80.0)] public virtual double HighThreshold { get { return highThreshold; } set { @@ -119,7 +119,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue("DarkRed")] + [DefaultValue("DarkRed")] public virtual Fill LowThresholdFill { get { return lowThresholdFill; } set { @@ -130,7 +130,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue("DarkGreen")] + [DefaultValue("DarkGreen")] public virtual Fill HighThresholdFill { get { return highThresholdFill; } set { diff --git a/src/GraphicObjects/VerticalStack.cs b/Crow/src/GraphicObjects/VerticalStack.cs index 9650e685..cf0a251a 100644 --- a/src/GraphicObjects/VerticalStack.cs +++ b/Crow/src/GraphicObjects/VerticalStack.cs @@ -43,7 +43,7 @@ namespace Crow } #endregion - [System.Xml.Serialization.XmlIgnore] + [XmlIgnore] public override Orientation Orientation { get { return Orientation.Vertical; } diff --git a/src/GraphicObjects/Window.cs b/Crow/src/GraphicObjects/Window.cs index 56632ff3..647286fc 100644 --- a/src/GraphicObjects/Window.cs +++ b/Crow/src/GraphicObjects/Window.cs @@ -84,7 +84,7 @@ namespace Crow #endregion #region public properties - [XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.crow.png")] + [DefaultValue("#Crow.Icons.crow.svg")] public string Icon { get { return _icon; } set { @@ -97,7 +97,7 @@ namespace Crow /// <summary> /// Background of the title bar if any. /// </summary> - [XmlAttributeAttribute][DefaultValue("vgradient|0:Onyx|1:SteelBlue")] + [DefaultValue("vgradient|0:Onyx|1:SteelBlue")] public virtual Fill TitleBarBackground { get { return titleBarBackground; } set { @@ -111,7 +111,7 @@ namespace Crow /// <summary> /// Foreground of the title bar, usualy used for the window caption color. /// </summary> - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Fill TitleBarForeground { get { return titleBarForeground; } set { @@ -122,7 +122,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public bool Resizable { get { return resizable; @@ -134,7 +134,7 @@ namespace Crow NotifyValueChanged ("Resizable", resizable); } } - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public bool Movable { get { return movable; @@ -146,7 +146,7 @@ namespace Crow NotifyValueChanged ("Movable", movable); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Modal { get { return modal; @@ -158,7 +158,7 @@ namespace Crow NotifyValueChanged ("Modal", modal); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool IsMinimized { get { return _minimized; } set{ @@ -177,7 +177,7 @@ namespace Crow [XmlIgnore]public bool IsNormal { get { return !(IsMaximized|_minimized); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool AlwaysOnTop { get { return modal ? true : alwaysOnTop; @@ -194,7 +194,7 @@ namespace Crow NotifyValueChanged ("AlwaysOnTop", AlwaysOnTop); } } -// [XmlAttributeAttribute()][DefaultValue(WindowState.Normal)] +// [DefaultValue(WindowState.Normal)] // public virtual WindowState State { // get { return _state; } // set { diff --git a/src/GraphicObjects/Wrapper.cs b/Crow/src/GraphicObjects/Wrapper.cs index a7f5f73b..a7f5f73b 100644 --- a/src/GraphicObjects/Wrapper.cs +++ b/Crow/src/GraphicObjects/Wrapper.cs diff --git a/Tests/Tutorials/T2_IML.cs b/Crow/src/GraphicObjects/XmlIgnoreAttribute.cs index 57eea835..29e5bf6e 100644 --- a/Tests/Tutorials/T2_IML.cs +++ b/Crow/src/GraphicObjects/XmlIgnoreAttribute.cs @@ -1,5 +1,5 @@ -// -// HelloWorld.cs +// +// Expandable.cs // // Author: // Jean-Philippe Bruyère <jp.bruyere@hotmail.com> @@ -25,28 +25,10 @@ // THE SOFTWARE. using System; -using Crow; -namespace Tutorials +namespace Crow { - class T2_IML : CrowWindow - { - public T2_IML () - : base(800, 600,"First app with OpenTK") - { - } - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - Load ("#Tests.Tutorials.test.crow"); - } - - [STAThread] - static void Main () - { - T2_IML win = new T2_IML (); - win.Run (30); - } - } + public class XmlIgnoreAttribute : Attribute + { + } }
\ No newline at end of file diff --git a/src/IListChanged.cs b/Crow/src/IListChanged.cs index b2b23375..b2b23375 100644 --- a/src/IListChanged.cs +++ b/Crow/src/IListChanged.cs diff --git a/src/IML/BindingDefinition.cs b/Crow/src/IML/BindingDefinition.cs index 075b80b3..075b80b3 100644 --- a/src/IML/BindingDefinition.cs +++ b/Crow/src/IML/BindingDefinition.cs diff --git a/src/IML/BindingMember.cs b/Crow/src/IML/BindingMember.cs index 4a2b2c61..47cba5fc 100644 --- a/src/IML/BindingMember.cs +++ b/Crow/src/IML/BindingMember.cs @@ -133,7 +133,7 @@ namespace Crow.IML il.Emit (OpCodes.Brfalse, nextLogicParent); } else if (LevelsUp > 0) {//go upward in logical tree il.Emit (OpCodes.Ldc_I4, LevelsUp);//push arg 2 of goUpLevels - il.Emit (OpCodes.Callvirt, CompilerServices.miGoUpLevels); + il.Emit (OpCodes.Call, CompilerServices.miGoUpLevels); //test if null il.Emit (OpCodes.Dup); il.Emit (OpCodes.Brfalse, cancel); diff --git a/src/IML/EventBinding.cs b/Crow/src/IML/EventBinding.cs index 41e0c96a..41e0c96a 100644 --- a/src/IML/EventBinding.cs +++ b/Crow/src/IML/EventBinding.cs diff --git a/src/IML/IMLContext.cs b/Crow/src/IML/IMLContext.cs index aa4dee2f..6042e6da 100644 --- a/src/IML/IMLContext.cs +++ b/Crow/src/IML/IMLContext.cs @@ -175,7 +175,7 @@ namespace Crow.IML il.Emit(OpCodes.Ldfld, CompilerServices.fiCachedDel); il.Emit(OpCodes.Ldc_I4, index);//load delegate index il.Emit(OpCodes.Callvirt, CompilerServices.miGetDelegateListItem); - il.Emit(OpCodes.Callvirt, evt.AddMethod);//call add event + il.Emit(OpCodes.Call, evt.AddMethod);//call add event } /// <summary> /// Emits the handler method addition, done at end of parsing, Loc_0 is root node instance @@ -204,8 +204,8 @@ namespace Crow.IML il.Emit (OpCodes.Call, CompilerServices.miGetTypeFromHandle); //load methodInfo (3rd arg) il.Emit (OpCodes.Ldstr, membs[membs.Length-1]); - il.Emit (OpCodes.Callvirt, CompilerServices.miCreateDel); - il.Emit (OpCodes.Callvirt, bd.SourceEvent.AddMethod);//call add event + il.Emit (OpCodes.Call, CompilerServices.miCreateDel); + il.Emit (OpCodes.Call, bd.SourceEvent.AddMethod);//call add event } // public void emitHandlerMethodAddition(EventBinding bd){ // //fetch source instance with address for handler addition (as 1st arg of handler.add) diff --git a/src/IML/MemberAddress.cs b/Crow/src/IML/MemberAddress.cs index f27a8b87..f27a8b87 100644 --- a/src/IML/MemberAddress.cs +++ b/Crow/src/IML/MemberAddress.cs diff --git a/src/IML/Node.cs b/Crow/src/IML/Node.cs index 2ca90e8c..2ca90e8c 100644 --- a/src/IML/Node.cs +++ b/Crow/src/IML/Node.cs diff --git a/src/IML/NodeAddress.cs b/Crow/src/IML/NodeAddress.cs index 450a9d2d..450a9d2d 100644 --- a/src/IML/NodeAddress.cs +++ b/Crow/src/IML/NodeAddress.cs diff --git a/src/IML/NodeStack.cs b/Crow/src/IML/NodeStack.cs index 80e9156f..80e9156f 100644 --- a/src/IML/NodeStack.cs +++ b/Crow/src/IML/NodeStack.cs diff --git a/src/IMLAttributes.cs b/Crow/src/IMLAttributes.cs index 929fd4f8..929fd4f8 100644 --- a/src/IMLAttributes.cs +++ b/Crow/src/IMLAttributes.cs diff --git a/src/Input/ButtonState.cs b/Crow/src/Input/ButtonState.cs index 17849ca8..17849ca8 100644 --- a/src/Input/ButtonState.cs +++ b/Crow/src/Input/ButtonState.cs diff --git a/src/Input/Buttons.cs b/Crow/src/Input/Buttons.cs index ebf3bc42..ebf3bc42 100644 --- a/src/Input/Buttons.cs +++ b/Crow/src/Input/Buttons.cs diff --git a/Crow/src/Input/Key.cs b/Crow/src/Input/Key.cs new file mode 100644 index 00000000..ee2cfb6a --- /dev/null +++ b/Crow/src/Input/Key.cs @@ -0,0 +1,2442 @@ + #region License + // + // The Open Toolkit Library License + // + // Copyright (c) 2006 - 2009 the Open Toolkit library. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights to + // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + // the Software, and to permit persons to whom the Software is furnished to do + // so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in all + // copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + // OTHER DEALINGS IN THE SOFTWARE. + // + #endregion + +namespace Crow +{ + /// <summary> + /// The available keyboard keys. + /// </summary> + public enum Key : int + { + NoSymbol = 0x000000, + VoidSymbol = 0xffffff, + BackSpace = 0xff08, + Tab = 0xff09, + Linefeed = 0xff0a, + Clear = 0xff0b, + Return = 0xff0d, + Pause = 0xff13, + Scroll_Lock = 0xff14, + Sys_Req = 0xff15, + Escape = 0xff1b, + Delete = 0xffff, + Multi_key = 0xff20, + Codeinput = 0xff37, + SingleCandidate = 0xff3c, + MultipleCandidate = 0xff3d, + PreviousCandidate = 0xff3e, + Kanji = 0xff21, + Muhenkan = 0xff22, + Henkan_Mode = 0xff23, + Henkan = 0xff23, + Romaji = 0xff24, + Hiragana = 0xff25, + Katakana = 0xff26, + Hiragana_Katakana = 0xff27, + Zenkaku = 0xff28, + Hankaku = 0xff29, + Zenkaku_Hankaku = 0xff2a, + Touroku = 0xff2b, + Massyo = 0xff2c, + Kana_Lock = 0xff2d, + Kana_Shift = 0xff2e, + Eisu_Shift = 0xff2f, + Eisu_toggle = 0xff30, + Kanji_Bangou = 0xff37, + Zen_Koho = 0xff3d, + Mae_Koho = 0xff3e, + Home = 0xff50, + Left = 0xff51, + Up = 0xff52, + Right = 0xff53, + Down = 0xff54, + Prior = 0xff55, + Page_Up = 0xff55, + Next = 0xff56, + Page_Down = 0xff56, + End = 0xff57, + Begin = 0xff58, + Select = 0xff60, + Print = 0xff61, + Execute = 0xff62, + Insert = 0xff63, + Undo = 0xff65, + Redo = 0xff66, + Menu = 0xff67, + Find = 0xff68, + Cancel = 0xff69, + Help = 0xff6a, + Break = 0xff6b, + Mode_switch = 0xff7e, + script_switch = 0xff7e, + Num_Lock = 0xff7f, + KP_Space = 0xff80, + KP_Tab = 0xff89, + KP_Enter = 0xff8d, + KP_F1 = 0xff91, + KP_F2 = 0xff92, + KP_F3 = 0xff93, + KP_F4 = 0xff94, + KP_Home = 0xff95, + KP_Left = 0xff96, + KP_Up = 0xff97, + KP_Right = 0xff98, + KP_Down = 0xff99, + KP_Prior = 0xff9a, + KP_Page_Up = 0xff9a, + KP_Next = 0xff9b, + KP_Page_Down = 0xff9b, + KP_End = 0xff9c, + KP_Begin = 0xff9d, + KP_Insert = 0xff9e, + KP_Delete = 0xff9f, + KP_Equal = 0xffbd, + KP_Multiply = 0xffaa, + KP_Add = 0xffab, + KP_Separator = 0xffac, + KP_Subtract = 0xffad, + KP_Decimal = 0xffae, + KP_Divide = 0xffaf, + KP_0 = 0xffb0, + KP_1 = 0xffb1, + KP_2 = 0xffb2, + KP_3 = 0xffb3, + KP_4 = 0xffb4, + KP_5 = 0xffb5, + KP_6 = 0xffb6, + KP_7 = 0xffb7, + KP_8 = 0xffb8, + KP_9 = 0xffb9, + F1 = 0xffbe, + F2 = 0xffbf, + F3 = 0xffc0, + F4 = 0xffc1, + F5 = 0xffc2, + F6 = 0xffc3, + F7 = 0xffc4, + F8 = 0xffc5, + F9 = 0xffc6, + F10 = 0xffc7, + F11 = 0xffc8, + L1 = 0xffc8, + F12 = 0xffc9, + L2 = 0xffc9, + F13 = 0xffca, + L3 = 0xffca, + F14 = 0xffcb, + L4 = 0xffcb, + F15 = 0xffcc, + L5 = 0xffcc, + F16 = 0xffcd, + L6 = 0xffcd, + F17 = 0xffce, + L7 = 0xffce, + F18 = 0xffcf, + L8 = 0xffcf, + F19 = 0xffd0, + L9 = 0xffd0, + F20 = 0xffd1, + L10 = 0xffd1, + F21 = 0xffd2, + R1 = 0xffd2, + F22 = 0xffd3, + R2 = 0xffd3, + F23 = 0xffd4, + R3 = 0xffd4, + F24 = 0xffd5, + R4 = 0xffd5, + F25 = 0xffd6, + R5 = 0xffd6, + F26 = 0xffd7, + R6 = 0xffd7, + F27 = 0xffd8, + R7 = 0xffd8, + F28 = 0xffd9, + R8 = 0xffd9, + F29 = 0xffda, + R9 = 0xffda, + F30 = 0xffdb, + R10 = 0xffdb, + F31 = 0xffdc, + R11 = 0xffdc, + F32 = 0xffdd, + R12 = 0xffdd, + F33 = 0xffde, + R13 = 0xffde, + F34 = 0xffdf, + R14 = 0xffdf, + F35 = 0xffe0, + R15 = 0xffe0, + Shift_L = 0xffe1, + Shift_R = 0xffe2, + Control_L = 0xffe3, + Control_R = 0xffe4, + Caps_Lock = 0xffe5, + Shift_Lock = 0xffe6, + Meta_L = 0xffe7, + Meta_R = 0xffe8, + Alt_L = 0xffe9, + Alt_R = 0xffea, + Super_L = 0xffeb, + Super_R = 0xffec, + Hyper_L = 0xffed, + Hyper_R = 0xffee, + ISO_Lock = 0xfe01, + ISO_Level2_Latch = 0xfe02, + ISO_Level3_Shift = 0xfe03, + ISO_Level3_Latch = 0xfe04, + ISO_Level3_Lock = 0xfe05, + ISO_Level5_Shift = 0xfe11, + ISO_Level5_Latch = 0xfe12, + ISO_Level5_Lock = 0xfe13, + ISO_Group_Shift = 0xff7e, + ISO_Group_Latch = 0xfe06, + ISO_Group_Lock = 0xfe07, + ISO_Next_Group = 0xfe08, + ISO_Next_Group_Lock = 0xfe09, + ISO_Prev_Group = 0xfe0a, + ISO_Prev_Group_Lock = 0xfe0b, + ISO_First_Group = 0xfe0c, + ISO_First_Group_Lock = 0xfe0d, + ISO_Last_Group = 0xfe0e, + ISO_Last_Group_Lock = 0xfe0f, + ISO_Left_Tab = 0xfe20, + ISO_Move_Line_Up = 0xfe21, + ISO_Move_Line_Down = 0xfe22, + ISO_Partial_Line_Up = 0xfe23, + ISO_Partial_Line_Down = 0xfe24, + ISO_Partial_Space_Left = 0xfe25, + ISO_Partial_Space_Right = 0xfe26, + ISO_Set_Margin_Left = 0xfe27, + ISO_Set_Margin_Right = 0xfe28, + ISO_Release_Margin_Left = 0xfe29, + ISO_Release_Margin_Right = 0xfe2a, + ISO_Release_Both_Margins = 0xfe2b, + ISO_Fast_Cursor_Left = 0xfe2c, + ISO_Fast_Cursor_Right = 0xfe2d, + ISO_Fast_Cursor_Up = 0xfe2e, + ISO_Fast_Cursor_Down = 0xfe2f, + ISO_Continuous_Underline = 0xfe30, + ISO_Discontinuous_Underline = 0xfe31, + ISO_Emphasize = 0xfe32, + ISO_Center_Object = 0xfe33, + ISO_Enter = 0xfe34, + dead_grave = 0xfe50, + dead_acute = 0xfe51, + dead_circumflex = 0xfe52, + dead_tilde = 0xfe53, + dead_perispomeni = 0xfe53, + dead_macron = 0xfe54, + dead_breve = 0xfe55, + dead_abovedot = 0xfe56, + dead_diaeresis = 0xfe57, + dead_abovering = 0xfe58, + dead_doubleacute = 0xfe59, + dead_caron = 0xfe5a, + dead_cedilla = 0xfe5b, + dead_ogonek = 0xfe5c, + dead_iota = 0xfe5d, + dead_voiced_sound = 0xfe5e, + dead_semivoiced_sound = 0xfe5f, + dead_belowdot = 0xfe60, + dead_hook = 0xfe61, + dead_horn = 0xfe62, + dead_stroke = 0xfe63, + dead_abovecomma = 0xfe64, + dead_psili = 0xfe64, + dead_abovereversedcomma = 0xfe65, + dead_dasia = 0xfe65, + dead_doublegrave = 0xfe66, + dead_belowring = 0xfe67, + dead_belowmacron = 0xfe68, + dead_belowcircumflex = 0xfe69, + dead_belowtilde = 0xfe6a, + dead_belowbreve = 0xfe6b, + dead_belowdiaeresis = 0xfe6c, + dead_invertedbreve = 0xfe6d, + dead_belowcomma = 0xfe6e, + dead_currency = 0xfe6f, + dead_lowline = 0xfe90, + dead_aboveverticalline = 0xfe91, + dead_belowverticalline = 0xfe92, + dead_longsolidusoverlay = 0xfe93, + dead_a = 0xfe80, + dead_A = 0xfe81, + dead_e = 0xfe82, + dead_E = 0xfe83, + dead_i = 0xfe84, + dead_I = 0xfe85, + dead_o = 0xfe86, + dead_O = 0xfe87, + dead_u = 0xfe88, + dead_U = 0xfe89, + dead_small_schwa = 0xfe8a, + dead_capital_schwa = 0xfe8b, + dead_greek = 0xfe8c, + First_Virtual_Screen = 0xfed0, + Prev_Virtual_Screen = 0xfed1, + Next_Virtual_Screen = 0xfed2, + Last_Virtual_Screen = 0xfed4, + Terminate_Server = 0xfed5, + AccessX_Enable = 0xfe70, + AccessX_Feedback_Enable = 0xfe71, + RepeatKeys_Enable = 0xfe72, + SlowKeys_Enable = 0xfe73, + BounceKeys_Enable = 0xfe74, + StickyKeys_Enable = 0xfe75, + MouseKeys_Enable = 0xfe76, + MouseKeys_Accel_Enable = 0xfe77, + Overlay1_Enable = 0xfe78, + Overlay2_Enable = 0xfe79, + AudibleBell_Enable = 0xfe7a, + Pointer_Left = 0xfee0, + Pointer_Right = 0xfee1, + Pointer_Up = 0xfee2, + Pointer_Down = 0xfee3, + Pointer_UpLeft = 0xfee4, + Pointer_UpRight = 0xfee5, + Pointer_DownLeft = 0xfee6, + Pointer_DownRight = 0xfee7, + Pointer_Button_Dflt = 0xfee8, + Pointer_Button1 = 0xfee9, + Pointer_Button2 = 0xfeea, + Pointer_Button3 = 0xfeeb, + Pointer_Button4 = 0xfeec, + Pointer_Button5 = 0xfeed, + Pointer_DblClick_Dflt = 0xfeee, + Pointer_DblClick1 = 0xfeef, + Pointer_DblClick2 = 0xfef0, + Pointer_DblClick3 = 0xfef1, + Pointer_DblClick4 = 0xfef2, + Pointer_DblClick5 = 0xfef3, + Pointer_Drag_Dflt = 0xfef4, + Pointer_Drag1 = 0xfef5, + Pointer_Drag2 = 0xfef6, + Pointer_Drag3 = 0xfef7, + Pointer_Drag4 = 0xfef8, + Pointer_Drag5 = 0xfefd, + Pointer_EnableKeys = 0xfef9, + Pointer_Accelerate = 0xfefa, + Pointer_DfltBtnNext = 0xfefb, + Pointer_DfltBtnPrev = 0xfefc, + ch = 0xfea0, + Ch = 0xfea1, + CH = 0xfea2, + c_h = 0xfea3, + C_h = 0xfea4, + C_H = 0xfea5, + key_3270_Duplicate = 0xfd01, + key_3270_FieldMark = 0xfd02, + key_3270_Right2 = 0xfd03, + key_3270_Left2 = 0xfd04, + key_3270_BackTab = 0xfd05, + key_3270_EraseEOF = 0xfd06, + key_3270_EraseInput = 0xfd07, + key_3270_Reset = 0xfd08, + key_3270_Quit = 0xfd09, + key_3270_PA1 = 0xfd0a, + key_3270_PA2 = 0xfd0b, + key_3270_PA3 = 0xfd0c, + key_3270_Test = 0xfd0d, + key_3270_Attn = 0xfd0e, + key_3270_CursorBlink = 0xfd0f, + key_3270_AltCursor = 0xfd10, + key_3270_KeyClick = 0xfd11, + key_3270_Jump = 0xfd12, + key_3270_Ident = 0xfd13, + key_3270_Rule = 0xfd14, + key_3270_Copy = 0xfd15, + key_3270_Play = 0xfd16, + key_3270_Setup = 0xfd17, + key_3270_Record = 0xfd18, + key_3270_ChangeScreen = 0xfd19, + key_3270_DeleteWord = 0xfd1a, + key_3270_ExSelect = 0xfd1b, + key_3270_CursorSelect = 0xfd1c, + key_3270_PrintScreen = 0xfd1d, + key_3270_Enter = 0xfd1e, + space = 0x0020, + exclam = 0x0021, + quotedbl = 0x0022, + numbersign = 0x0023, + dollar = 0x0024, + percent = 0x0025, + ampersand = 0x0026, + apostrophe = 0x0027, + quoteright = 0x0027, + parenleft = 0x0028, + parenright = 0x0029, + asterisk = 0x002a, + plus = 0x002b, + comma = 0x002c, + minus = 0x002d, + period = 0x002e, + slash = 0x002f, + key_0 = 0x0030, + key_1 = 0x0031, + key_2 = 0x0032, + key_3 = 0x0033, + key_4 = 0x0034, + key_5 = 0x0035, + key_6 = 0x0036, + key_7 = 0x0037, + key_8 = 0x0038, + key_9 = 0x0039, + colon = 0x003a, + semicolon = 0x003b, + less = 0x003c, + equal = 0x003d, + greater = 0x003e, + question = 0x003f, + at = 0x0040, + A = 0x0041, + B = 0x0042, + C = 0x0043, + D = 0x0044, + E = 0x0045, + F = 0x0046, + G = 0x0047, + H = 0x0048, + I = 0x0049, + J = 0x004a, + K = 0x004b, + L = 0x004c, + M = 0x004d, + N = 0x004e, + O = 0x004f, + P = 0x0050, + Q = 0x0051, + R = 0x0052, + S = 0x0053, + T = 0x0054, + U = 0x0055, + V = 0x0056, + W = 0x0057, + X = 0x0058, + Y = 0x0059, + Z = 0x005a, + bracketleft = 0x005b, + backslash = 0x005c, + bracketright = 0x005d, + asciicircum = 0x005e, + underscore = 0x005f, + grave = 0x0060, + quoteleft = 0x0060, + a = 0x0061, + b = 0x0062, + c = 0x0063, + d = 0x0064, + e = 0x0065, + f = 0x0066, + g = 0x0067, + h = 0x0068, + i = 0x0069, + j = 0x006a, + k = 0x006b, + l = 0x006c, + m = 0x006d, + n = 0x006e, + o = 0x006f, + p = 0x0070, + q = 0x0071, + r = 0x0072, + s = 0x0073, + t = 0x0074, + u = 0x0075, + v = 0x0076, + w = 0x0077, + x = 0x0078, + y = 0x0079, + z = 0x007a, + braceleft = 0x007b, + bar = 0x007c, + braceright = 0x007d, + asciitilde = 0x007e, + nobreakspace = 0x00a0, + exclamdown = 0x00a1, + cent = 0x00a2, + sterling = 0x00a3, + currency = 0x00a4, + yen = 0x00a5, + brokenbar = 0x00a6, + section = 0x00a7, + diaeresis = 0x00a8, + copyright = 0x00a9, + ordfeminine = 0x00aa, + guillemotleft = 0x00ab, + notsign = 0x00ac, + hyphen = 0x00ad, + registered = 0x00ae, + macron = 0x00af, + degree = 0x00b0, + plusminus = 0x00b1, + twosuperior = 0x00b2, + threesuperior = 0x00b3, + acute = 0x00b4, + mu = 0x00b5, + paragraph = 0x00b6, + periodcentered = 0x00b7, + cedilla = 0x00b8, + onesuperior = 0x00b9, + masculine = 0x00ba, + guillemotright = 0x00bb, + onequarter = 0x00bc, + onehalf = 0x00bd, + threequarters = 0x00be, + questiondown = 0x00bf, + Agrave = 0x00c0, + Aacute = 0x00c1, + Acircumflex = 0x00c2, + Atilde = 0x00c3, + Adiaeresis = 0x00c4, + Aring = 0x00c5, + AE = 0x00c6, + Ccedilla = 0x00c7, + Egrave = 0x00c8, + Eacute = 0x00c9, + Ecircumflex = 0x00ca, + Ediaeresis = 0x00cb, + Igrave = 0x00cc, + Iacute = 0x00cd, + Icircumflex = 0x00ce, + Idiaeresis = 0x00cf, + ETH = 0x00d0, + Eth = 0x00d0, + Ntilde = 0x00d1, + Ograve = 0x00d2, + Oacute = 0x00d3, + Ocircumflex = 0x00d4, + Otilde = 0x00d5, + Odiaeresis = 0x00d6, + multiply = 0x00d7, + Oslash = 0x00d8, + Ooblique = 0x00d8, + Ugrave = 0x00d9, + Uacute = 0x00da, + Ucircumflex = 0x00db, + Udiaeresis = 0x00dc, + Yacute = 0x00dd, + THORN = 0x00de, + Thorn = 0x00de, + ssharp = 0x00df, + agrave = 0x00e0, + aacute = 0x00e1, + acircumflex = 0x00e2, + atilde = 0x00e3, + adiaeresis = 0x00e4, + aring = 0x00e5, + ae = 0x00e6, + ccedilla = 0x00e7, + egrave = 0x00e8, + eacute = 0x00e9, + ecircumflex = 0x00ea, + ediaeresis = 0x00eb, + igrave = 0x00ec, + iacute = 0x00ed, + icircumflex = 0x00ee, + idiaeresis = 0x00ef, + eth = 0x00f0, + ntilde = 0x00f1, + ograve = 0x00f2, + oacute = 0x00f3, + ocircumflex = 0x00f4, + otilde = 0x00f5, + odiaeresis = 0x00f6, + division = 0x00f7, + oslash = 0x00f8, + ooblique = 0x00f8, + ugrave = 0x00f9, + uacute = 0x00fa, + ucircumflex = 0x00fb, + udiaeresis = 0x00fc, + yacute = 0x00fd, + thorn = 0x00fe, + ydiaeresis = 0x00ff, + Aogonek = 0x01a1, + breve = 0x01a2, + Lstroke = 0x01a3, + Lcaron = 0x01a5, + Sacute = 0x01a6, + Scaron = 0x01a9, + Scedilla = 0x01aa, + Tcaron = 0x01ab, + Zacute = 0x01ac, + Zcaron = 0x01ae, + Zabovedot = 0x01af, + aogonek = 0x01b1, + ogonek = 0x01b2, + lstroke = 0x01b3, + lcaron = 0x01b5, + sacute = 0x01b6, + caron = 0x01b7, + scaron = 0x01b9, + scedilla = 0x01ba, + tcaron = 0x01bb, + zacute = 0x01bc, + doubleacute = 0x01bd, + zcaron = 0x01be, + zabovedot = 0x01bf, + Racute = 0x01c0, + Abreve = 0x01c3, + Lacute = 0x01c5, + Cacute = 0x01c6, + Ccaron = 0x01c8, + Eogonek = 0x01ca, + Ecaron = 0x01cc, + Dcaron = 0x01cf, + Dstroke = 0x01d0, + Nacute = 0x01d1, + Ncaron = 0x01d2, + Odoubleacute = 0x01d5, + Rcaron = 0x01d8, + Uring = 0x01d9, + Udoubleacute = 0x01db, + Tcedilla = 0x01de, + racute = 0x01e0, + abreve = 0x01e3, + lacute = 0x01e5, + cacute = 0x01e6, + ccaron = 0x01e8, + eogonek = 0x01ea, + ecaron = 0x01ec, + dcaron = 0x01ef, + dstroke = 0x01f0, + nacute = 0x01f1, + ncaron = 0x01f2, + odoubleacute = 0x01f5, + rcaron = 0x01f8, + uring = 0x01f9, + udoubleacute = 0x01fb, + tcedilla = 0x01fe, + abovedot = 0x01ff, + Hstroke = 0x02a1, + Hcircumflex = 0x02a6, + Iabovedot = 0x02a9, + Gbreve = 0x02ab, + Jcircumflex = 0x02ac, + hstroke = 0x02b1, + hcircumflex = 0x02b6, + idotless = 0x02b9, + gbreve = 0x02bb, + jcircumflex = 0x02bc, + Cabovedot = 0x02c5, + Ccircumflex = 0x02c6, + Gabovedot = 0x02d5, + Gcircumflex = 0x02d8, + Ubreve = 0x02dd, + Scircumflex = 0x02de, + cabovedot = 0x02e5, + ccircumflex = 0x02e6, + gabovedot = 0x02f5, + gcircumflex = 0x02f8, + ubreve = 0x02fd, + scircumflex = 0x02fe, + kra = 0x03a2, + kappa = 0x03a2, + Rcedilla = 0x03a3, + Itilde = 0x03a5, + Lcedilla = 0x03a6, + Emacron = 0x03aa, + Gcedilla = 0x03ab, + Tslash = 0x03ac, + rcedilla = 0x03b3, + itilde = 0x03b5, + lcedilla = 0x03b6, + emacron = 0x03ba, + gcedilla = 0x03bb, + tslash = 0x03bc, + ENG = 0x03bd, + eng = 0x03bf, + Amacron = 0x03c0, + Iogonek = 0x03c7, + Eabovedot = 0x03cc, + Imacron = 0x03cf, + Ncedilla = 0x03d1, + Omacron = 0x03d2, + Kcedilla = 0x03d3, + Uogonek = 0x03d9, + Utilde = 0x03dd, + Umacron = 0x03de, + amacron = 0x03e0, + iogonek = 0x03e7, + eabovedot = 0x03ec, + imacron = 0x03ef, + ncedilla = 0x03f1, + omacron = 0x03f2, + kcedilla = 0x03f3, + uogonek = 0x03f9, + utilde = 0x03fd, + umacron = 0x03fe, + Wcircumflex = 0x1000174, + wcircumflex = 0x1000175, + Ycircumflex = 0x1000176, + ycircumflex = 0x1000177, + Babovedot = 0x1001e02, + babovedot = 0x1001e03, + Dabovedot = 0x1001e0a, + dabovedot = 0x1001e0b, + Fabovedot = 0x1001e1e, + fabovedot = 0x1001e1f, + Mabovedot = 0x1001e40, + mabovedot = 0x1001e41, + Pabovedot = 0x1001e56, + pabovedot = 0x1001e57, + Sabovedot = 0x1001e60, + sabovedot = 0x1001e61, + Tabovedot = 0x1001e6a, + tabovedot = 0x1001e6b, + Wgrave = 0x1001e80, + wgrave = 0x1001e81, + Wacute = 0x1001e82, + wacute = 0x1001e83, + Wdiaeresis = 0x1001e84, + wdiaeresis = 0x1001e85, + Ygrave = 0x1001ef2, + ygrave = 0x1001ef3, + OE = 0x13bc, + oe = 0x13bd, + Ydiaeresis = 0x13be, + overline = 0x047e, + kana_fullstop = 0x04a1, + kana_openingbracket = 0x04a2, + kana_closingbracket = 0x04a3, + kana_comma = 0x04a4, + kana_conjunctive = 0x04a5, + kana_middledot = 0x04a5, + kana_WO = 0x04a6, + kana_a = 0x04a7, + kana_i = 0x04a8, + kana_u = 0x04a9, + kana_e = 0x04aa, + kana_o = 0x04ab, + kana_ya = 0x04ac, + kana_yu = 0x04ad, + kana_yo = 0x04ae, + kana_tsu = 0x04af, + kana_tu = 0x04af, + prolongedsound = 0x04b0, + kana_A = 0x04b1, + kana_I = 0x04b2, + kana_U = 0x04b3, + kana_E = 0x04b4, + kana_O = 0x04b5, + kana_KA = 0x04b6, + kana_KI = 0x04b7, + kana_KU = 0x04b8, + kana_KE = 0x04b9, + kana_KO = 0x04ba, + kana_SA = 0x04bb, + kana_SHI = 0x04bc, + kana_SU = 0x04bd, + kana_SE = 0x04be, + kana_SO = 0x04bf, + kana_TA = 0x04c0, + kana_CHI = 0x04c1, + kana_TI = 0x04c1, + kana_TSU = 0x04c2, + kana_TU = 0x04c2, + kana_TE = 0x04c3, + kana_TO = 0x04c4, + kana_NA = 0x04c5, + kana_NI = 0x04c6, + kana_NU = 0x04c7, + kana_NE = 0x04c8, + kana_NO = 0x04c9, + kana_HA = 0x04ca, + kana_HI = 0x04cb, + kana_FU = 0x04cc, + kana_HU = 0x04cc, + kana_HE = 0x04cd, + kana_HO = 0x04ce, + kana_MA = 0x04cf, + kana_MI = 0x04d0, + kana_MU = 0x04d1, + kana_ME = 0x04d2, + kana_MO = 0x04d3, + kana_YA = 0x04d4, + kana_YU = 0x04d5, + kana_YO = 0x04d6, + kana_RA = 0x04d7, + kana_RI = 0x04d8, + kana_RU = 0x04d9, + kana_RE = 0x04da, + kana_RO = 0x04db, + kana_WA = 0x04dc, + kana_N = 0x04dd, + voicedsound = 0x04de, + semivoicedsound = 0x04df, + kana_switch = 0xff7e, + Farsi_0 = 0x10006f0, + Farsi_1 = 0x10006f1, + Farsi_2 = 0x10006f2, + Farsi_3 = 0x10006f3, + Farsi_4 = 0x10006f4, + Farsi_5 = 0x10006f5, + Farsi_6 = 0x10006f6, + Farsi_7 = 0x10006f7, + Farsi_8 = 0x10006f8, + Farsi_9 = 0x10006f9, + Arabic_percent = 0x100066a, + Arabic_superscript_alef = 0x1000670, + Arabic_tteh = 0x1000679, + Arabic_peh = 0x100067e, + Arabic_tcheh = 0x1000686, + Arabic_ddal = 0x1000688, + Arabic_rreh = 0x1000691, + Arabic_comma = 0x05ac, + Arabic_fullstop = 0x10006d4, + Arabic_0 = 0x1000660, + Arabic_1 = 0x1000661, + Arabic_2 = 0x1000662, + Arabic_3 = 0x1000663, + Arabic_4 = 0x1000664, + Arabic_5 = 0x1000665, + Arabic_6 = 0x1000666, + Arabic_7 = 0x1000667, + Arabic_8 = 0x1000668, + Arabic_9 = 0x1000669, + Arabic_semicolon = 0x05bb, + Arabic_question_mark = 0x05bf, + Arabic_hamza = 0x05c1, + Arabic_maddaonalef = 0x05c2, + Arabic_hamzaonalef = 0x05c3, + Arabic_hamzaonwaw = 0x05c4, + Arabic_hamzaunderalef = 0x05c5, + Arabic_hamzaonyeh = 0x05c6, + Arabic_alef = 0x05c7, + Arabic_beh = 0x05c8, + Arabic_tehmarbuta = 0x05c9, + Arabic_teh = 0x05ca, + Arabic_theh = 0x05cb, + Arabic_jeem = 0x05cc, + Arabic_hah = 0x05cd, + Arabic_khah = 0x05ce, + Arabic_dal = 0x05cf, + Arabic_thal = 0x05d0, + Arabic_ra = 0x05d1, + Arabic_zain = 0x05d2, + Arabic_seen = 0x05d3, + Arabic_sheen = 0x05d4, + Arabic_sad = 0x05d5, + Arabic_dad = 0x05d6, + Arabic_tah = 0x05d7, + Arabic_zah = 0x05d8, + Arabic_ain = 0x05d9, + Arabic_ghain = 0x05da, + Arabic_tatweel = 0x05e0, + Arabic_feh = 0x05e1, + Arabic_qaf = 0x05e2, + Arabic_kaf = 0x05e3, + Arabic_lam = 0x05e4, + Arabic_meem = 0x05e5, + Arabic_noon = 0x05e6, + Arabic_ha = 0x05e7, + Arabic_heh = 0x05e7, + Arabic_waw = 0x05e8, + Arabic_alefmaksura = 0x05e9, + Arabic_yeh = 0x05ea, + Arabic_fathatan = 0x05eb, + Arabic_dammatan = 0x05ec, + Arabic_kasratan = 0x05ed, + Arabic_fatha = 0x05ee, + Arabic_damma = 0x05ef, + Arabic_kasra = 0x05f0, + Arabic_shadda = 0x05f1, + Arabic_sukun = 0x05f2, + Arabic_madda_above = 0x1000653, + Arabic_hamza_above = 0x1000654, + Arabic_hamza_below = 0x1000655, + Arabic_jeh = 0x1000698, + Arabic_veh = 0x10006a4, + Arabic_keheh = 0x10006a9, + Arabic_gaf = 0x10006af, + Arabic_noon_ghunna = 0x10006ba, + Arabic_heh_doachashmee = 0x10006be, + Farsi_yeh = 0x10006cc, + Arabic_farsi_yeh = 0x10006cc, + Arabic_yeh_baree = 0x10006d2, + Arabic_heh_goal = 0x10006c1, + Arabic_switch = 0xff7e, + Cyrillic_GHE_bar = 0x1000492, + Cyrillic_ghe_bar = 0x1000493, + Cyrillic_ZHE_descender = 0x1000496, + Cyrillic_zhe_descender = 0x1000497, + Cyrillic_KA_descender = 0x100049a, + Cyrillic_ka_descender = 0x100049b, + Cyrillic_KA_vertstroke = 0x100049c, + Cyrillic_ka_vertstroke = 0x100049d, + Cyrillic_EN_descender = 0x10004a2, + Cyrillic_en_descender = 0x10004a3, + Cyrillic_U_straight = 0x10004ae, + Cyrillic_u_straight = 0x10004af, + Cyrillic_U_straight_bar = 0x10004b0, + Cyrillic_u_straight_bar = 0x10004b1, + Cyrillic_HA_descender = 0x10004b2, + Cyrillic_ha_descender = 0x10004b3, + Cyrillic_CHE_descender = 0x10004b6, + Cyrillic_che_descender = 0x10004b7, + Cyrillic_CHE_vertstroke = 0x10004b8, + Cyrillic_che_vertstroke = 0x10004b9, + Cyrillic_SHHA = 0x10004ba, + Cyrillic_shha = 0x10004bb, + Cyrillic_SCHWA = 0x10004d8, + Cyrillic_schwa = 0x10004d9, + Cyrillic_I_macron = 0x10004e2, + Cyrillic_i_macron = 0x10004e3, + Cyrillic_O_bar = 0x10004e8, + Cyrillic_o_bar = 0x10004e9, + Cyrillic_U_macron = 0x10004ee, + Cyrillic_u_macron = 0x10004ef, + Serbian_dje = 0x06a1, + Macedonia_gje = 0x06a2, + Cyrillic_io = 0x06a3, + Ukrainian_ie = 0x06a4, + Ukranian_je = 0x06a4, + Macedonia_dse = 0x06a5, + Ukrainian_i = 0x06a6, + Ukranian_i = 0x06a6, + Ukrainian_yi = 0x06a7, + Ukranian_yi = 0x06a7, + Cyrillic_je = 0x06a8, + Serbian_je = 0x06a8, + Cyrillic_lje = 0x06a9, + Serbian_lje = 0x06a9, + Cyrillic_nje = 0x06aa, + Serbian_nje = 0x06aa, + Serbian_tshe = 0x06ab, + Macedonia_kje = 0x06ac, + Ukrainian_ghe_with_upturn = 0x06ad, + Byelorussian_shortu = 0x06ae, + Cyrillic_dzhe = 0x06af, + Serbian_dze = 0x06af, + numerosign = 0x06b0, + Serbian_DJE = 0x06b1, + Macedonia_GJE = 0x06b2, + Cyrillic_IO = 0x06b3, + Ukrainian_IE = 0x06b4, + Ukranian_JE = 0x06b4, + Macedonia_DSE = 0x06b5, + Ukrainian_I = 0x06b6, + Ukranian_I = 0x06b6, + Ukrainian_YI = 0x06b7, + Ukranian_YI = 0x06b7, + Cyrillic_JE = 0x06b8, + Serbian_JE = 0x06b8, + Cyrillic_LJE = 0x06b9, + Serbian_LJE = 0x06b9, + Cyrillic_NJE = 0x06ba, + Serbian_NJE = 0x06ba, + Serbian_TSHE = 0x06bb, + Macedonia_KJE = 0x06bc, + Ukrainian_GHE_WITH_UPTURN = 0x06bd, + Byelorussian_SHORTU = 0x06be, + Cyrillic_DZHE = 0x06bf, + Serbian_DZE = 0x06bf, + Cyrillic_yu = 0x06c0, + Cyrillic_a = 0x06c1, + Cyrillic_be = 0x06c2, + Cyrillic_tse = 0x06c3, + Cyrillic_de = 0x06c4, + Cyrillic_ie = 0x06c5, + Cyrillic_ef = 0x06c6, + Cyrillic_ghe = 0x06c7, + Cyrillic_ha = 0x06c8, + Cyrillic_i = 0x06c9, + Cyrillic_shorti = 0x06ca, + Cyrillic_ka = 0x06cb, + Cyrillic_el = 0x06cc, + Cyrillic_em = 0x06cd, + Cyrillic_en = 0x06ce, + Cyrillic_o = 0x06cf, + Cyrillic_pe = 0x06d0, + Cyrillic_ya = 0x06d1, + Cyrillic_er = 0x06d2, + Cyrillic_es = 0x06d3, + Cyrillic_te = 0x06d4, + Cyrillic_u = 0x06d5, + Cyrillic_zhe = 0x06d6, + Cyrillic_ve = 0x06d7, + Cyrillic_softsign = 0x06d8, + Cyrillic_yeru = 0x06d9, + Cyrillic_ze = 0x06da, + Cyrillic_sha = 0x06db, + Cyrillic_e = 0x06dc, + Cyrillic_shcha = 0x06dd, + Cyrillic_che = 0x06de, + Cyrillic_hardsign = 0x06df, + Cyrillic_YU = 0x06e0, + Cyrillic_A = 0x06e1, + Cyrillic_BE = 0x06e2, + Cyrillic_TSE = 0x06e3, + Cyrillic_DE = 0x06e4, + Cyrillic_IE = 0x06e5, + Cyrillic_EF = 0x06e6, + Cyrillic_GHE = 0x06e7, + Cyrillic_HA = 0x06e8, + Cyrillic_I = 0x06e9, + Cyrillic_SHORTI = 0x06ea, + Cyrillic_KA = 0x06eb, + Cyrillic_EL = 0x06ec, + Cyrillic_EM = 0x06ed, + Cyrillic_EN = 0x06ee, + Cyrillic_O = 0x06ef, + Cyrillic_PE = 0x06f0, + Cyrillic_YA = 0x06f1, + Cyrillic_ER = 0x06f2, + Cyrillic_ES = 0x06f3, + Cyrillic_TE = 0x06f4, + Cyrillic_U = 0x06f5, + Cyrillic_ZHE = 0x06f6, + Cyrillic_VE = 0x06f7, + Cyrillic_SOFTSIGN = 0x06f8, + Cyrillic_YERU = 0x06f9, + Cyrillic_ZE = 0x06fa, + Cyrillic_SHA = 0x06fb, + Cyrillic_E = 0x06fc, + Cyrillic_SHCHA = 0x06fd, + Cyrillic_CHE = 0x06fe, + Cyrillic_HARDSIGN = 0x06ff, + Greek_ALPHAaccent = 0x07a1, + Greek_EPSILONaccent = 0x07a2, + Greek_ETAaccent = 0x07a3, + Greek_IOTAaccent = 0x07a4, + Greek_IOTAdieresis = 0x07a5, + Greek_IOTAdiaeresis = 0x07a5, + Greek_OMICRONaccent = 0x07a7, + Greek_UPSILONaccent = 0x07a8, + Greek_UPSILONdieresis = 0x07a9, + Greek_OMEGAaccent = 0x07ab, + Greek_accentdieresis = 0x07ae, + Greek_horizbar = 0x07af, + Greek_alphaaccent = 0x07b1, + Greek_epsilonaccent = 0x07b2, + Greek_etaaccent = 0x07b3, + Greek_iotaaccent = 0x07b4, + Greek_iotadieresis = 0x07b5, + Greek_iotaaccentdieresis = 0x07b6, + Greek_omicronaccent = 0x07b7, + Greek_upsilonaccent = 0x07b8, + Greek_upsilondieresis = 0x07b9, + Greek_upsilonaccentdieresis = 0x07ba, + Greek_omegaaccent = 0x07bb, + Greek_ALPHA = 0x07c1, + Greek_BETA = 0x07c2, + Greek_GAMMA = 0x07c3, + Greek_DELTA = 0x07c4, + Greek_EPSILON = 0x07c5, + Greek_ZETA = 0x07c6, + Greek_ETA = 0x07c7, + Greek_THETA = 0x07c8, + Greek_IOTA = 0x07c9, + Greek_KAPPA = 0x07ca, + Greek_LAMDA = 0x07cb, + Greek_LAMBDA = 0x07cb, + Greek_MU = 0x07cc, + Greek_NU = 0x07cd, + Greek_XI = 0x07ce, + Greek_OMICRON = 0x07cf, + Greek_PI = 0x07d0, + Greek_RHO = 0x07d1, + Greek_SIGMA = 0x07d2, + Greek_TAU = 0x07d4, + Greek_UPSILON = 0x07d5, + Greek_PHI = 0x07d6, + Greek_CHI = 0x07d7, + Greek_PSI = 0x07d8, + Greek_OMEGA = 0x07d9, + Greek_alpha = 0x07e1, + Greek_beta = 0x07e2, + Greek_gamma = 0x07e3, + Greek_delta = 0x07e4, + Greek_epsilon = 0x07e5, + Greek_zeta = 0x07e6, + Greek_eta = 0x07e7, + Greek_theta = 0x07e8, + Greek_iota = 0x07e9, + Greek_kappa = 0x07ea, + Greek_lamda = 0x07eb, + Greek_lambda = 0x07eb, + Greek_mu = 0x07ec, + Greek_nu = 0x07ed, + Greek_xi = 0x07ee, + Greek_omicron = 0x07ef, + Greek_pi = 0x07f0, + Greek_rho = 0x07f1, + Greek_sigma = 0x07f2, + Greek_finalsmallsigma = 0x07f3, + Greek_tau = 0x07f4, + Greek_upsilon = 0x07f5, + Greek_phi = 0x07f6, + Greek_chi = 0x07f7, + Greek_psi = 0x07f8, + Greek_omega = 0x07f9, + Greek_switch = 0xff7e, + leftradical = 0x08a1, + topleftradical = 0x08a2, + horizconnector = 0x08a3, + topintegral = 0x08a4, + botintegral = 0x08a5, + vertconnector = 0x08a6, + topleftsqbracket = 0x08a7, + botleftsqbracket = 0x08a8, + toprightsqbracket = 0x08a9, + botrightsqbracket = 0x08aa, + topleftparens = 0x08ab, + botleftparens = 0x08ac, + toprightparens = 0x08ad, + botrightparens = 0x08ae, + leftmiddlecurlybrace = 0x08af, + rightmiddlecurlybrace = 0x08b0, + topleftsummation = 0x08b1, + botleftsummation = 0x08b2, + topvertsummationconnector = 0x08b3, + botvertsummationconnector = 0x08b4, + toprightsummation = 0x08b5, + botrightsummation = 0x08b6, + rightmiddlesummation = 0x08b7, + lessthanequal = 0x08bc, + notequal = 0x08bd, + greaterthanequal = 0x08be, + integral = 0x08bf, + therefore = 0x08c0, + variation = 0x08c1, + infinity = 0x08c2, + nabla = 0x08c5, + approximate = 0x08c8, + similarequal = 0x08c9, + ifonlyif = 0x08cd, + implies = 0x08ce, + identical = 0x08cf, + radical = 0x08d6, + includedin = 0x08da, + includes = 0x08db, + intersection = 0x08dc, + union = 0x08dd, + logicaland = 0x08de, + logicalor = 0x08df, + partialderivative = 0x08ef, + function = 0x08f6, + leftarrow = 0x08fb, + uparrow = 0x08fc, + rightarrow = 0x08fd, + downarrow = 0x08fe, + blank = 0x09df, + soliddiamond = 0x09e0, + checkerboard = 0x09e1, + ht = 0x09e2, + ff = 0x09e3, + cr = 0x09e4, + lf = 0x09e5, + nl = 0x09e8, + vt = 0x09e9, + lowrightcorner = 0x09ea, + uprightcorner = 0x09eb, + upleftcorner = 0x09ec, + lowleftcorner = 0x09ed, + crossinglines = 0x09ee, + horizlinescan1 = 0x09ef, + horizlinescan3 = 0x09f0, + horizlinescan5 = 0x09f1, + horizlinescan7 = 0x09f2, + horizlinescan9 = 0x09f3, + leftt = 0x09f4, + rightt = 0x09f5, + bott = 0x09f6, + topt = 0x09f7, + vertbar = 0x09f8, + emspace = 0x0aa1, + enspace = 0x0aa2, + em3space = 0x0aa3, + em4space = 0x0aa4, + digitspace = 0x0aa5, + punctspace = 0x0aa6, + thinspace = 0x0aa7, + hairspace = 0x0aa8, + emdash = 0x0aa9, + endash = 0x0aaa, + signifblank = 0x0aac, + ellipsis = 0x0aae, + doubbaselinedot = 0x0aaf, + onethird = 0x0ab0, + twothirds = 0x0ab1, + onefifth = 0x0ab2, + twofifths = 0x0ab3, + threefifths = 0x0ab4, + fourfifths = 0x0ab5, + onesixth = 0x0ab6, + fivesixths = 0x0ab7, + careof = 0x0ab8, + figdash = 0x0abb, + leftanglebracket = 0x0abc, + decimalpoint = 0x0abd, + rightanglebracket = 0x0abe, + marker = 0x0abf, + oneeighth = 0x0ac3, + threeeighths = 0x0ac4, + fiveeighths = 0x0ac5, + seveneighths = 0x0ac6, + trademark = 0x0ac9, + signaturemark = 0x0aca, + trademarkincircle = 0x0acb, + leftopentriangle = 0x0acc, + rightopentriangle = 0x0acd, + emopencircle = 0x0ace, + emopenrectangle = 0x0acf, + leftsinglequotemark = 0x0ad0, + rightsinglequotemark = 0x0ad1, + leftdoublequotemark = 0x0ad2, + rightdoublequotemark = 0x0ad3, + prescription = 0x0ad4, + permille = 0x0ad5, + minutes = 0x0ad6, + seconds = 0x0ad7, + latincross = 0x0ad9, + hexagram = 0x0ada, + filledrectbullet = 0x0adb, + filledlefttribullet = 0x0adc, + filledrighttribullet = 0x0add, + emfilledcircle = 0x0ade, + emfilledrect = 0x0adf, + enopencircbullet = 0x0ae0, + enopensquarebullet = 0x0ae1, + openrectbullet = 0x0ae2, + opentribulletup = 0x0ae3, + opentribulletdown = 0x0ae4, + openstar = 0x0ae5, + enfilledcircbullet = 0x0ae6, + enfilledsqbullet = 0x0ae7, + filledtribulletup = 0x0ae8, + filledtribulletdown = 0x0ae9, + leftpointer = 0x0aea, + rightpointer = 0x0aeb, + club = 0x0aec, + diamond = 0x0aed, + heart = 0x0aee, + maltesecross = 0x0af0, + dagger = 0x0af1, + doubledagger = 0x0af2, + checkmark = 0x0af3, + ballotcross = 0x0af4, + musicalsharp = 0x0af5, + musicalflat = 0x0af6, + malesymbol = 0x0af7, + femalesymbol = 0x0af8, + telephone = 0x0af9, + telephonerecorder = 0x0afa, + phonographcopyright = 0x0afb, + caret = 0x0afc, + singlelowquotemark = 0x0afd, + doublelowquotemark = 0x0afe, + cursor = 0x0aff, + leftcaret = 0x0ba3, + rightcaret = 0x0ba6, + downcaret = 0x0ba8, + upcaret = 0x0ba9, + overbar = 0x0bc0, + downtack = 0x0bc2, + upshoe = 0x0bc3, + downstile = 0x0bc4, + underbar = 0x0bc6, + jot = 0x0bca, + quad = 0x0bcc, + uptack = 0x0bce, + circle = 0x0bcf, + upstile = 0x0bd3, + downshoe = 0x0bd6, + rightshoe = 0x0bd8, + leftshoe = 0x0bda, + lefttack = 0x0bdc, + righttack = 0x0bfc, + hebrew_doublelowline = 0x0cdf, + hebrew_aleph = 0x0ce0, + hebrew_bet = 0x0ce1, + hebrew_beth = 0x0ce1, + hebrew_gimel = 0x0ce2, + hebrew_gimmel = 0x0ce2, + hebrew_dalet = 0x0ce3, + hebrew_daleth = 0x0ce3, + hebrew_he = 0x0ce4, + hebrew_waw = 0x0ce5, + hebrew_zain = 0x0ce6, + hebrew_zayin = 0x0ce6, + hebrew_chet = 0x0ce7, + hebrew_het = 0x0ce7, + hebrew_tet = 0x0ce8, + hebrew_teth = 0x0ce8, + hebrew_yod = 0x0ce9, + hebrew_finalkaph = 0x0cea, + hebrew_kaph = 0x0ceb, + hebrew_lamed = 0x0cec, + hebrew_finalmem = 0x0ced, + hebrew_mem = 0x0cee, + hebrew_finalnun = 0x0cef, + hebrew_nun = 0x0cf0, + hebrew_samech = 0x0cf1, + hebrew_samekh = 0x0cf1, + hebrew_ayin = 0x0cf2, + hebrew_finalpe = 0x0cf3, + hebrew_pe = 0x0cf4, + hebrew_finalzade = 0x0cf5, + hebrew_finalzadi = 0x0cf5, + hebrew_zade = 0x0cf6, + hebrew_zadi = 0x0cf6, + hebrew_qoph = 0x0cf7, + hebrew_kuf = 0x0cf7, + hebrew_resh = 0x0cf8, + hebrew_shin = 0x0cf9, + hebrew_taw = 0x0cfa, + hebrew_taf = 0x0cfa, + Hebrew_switch = 0xff7e, + Thai_kokai = 0x0da1, + Thai_khokhai = 0x0da2, + Thai_khokhuat = 0x0da3, + Thai_khokhwai = 0x0da4, + Thai_khokhon = 0x0da5, + Thai_khorakhang = 0x0da6, + Thai_ngongu = 0x0da7, + Thai_chochan = 0x0da8, + Thai_choching = 0x0da9, + Thai_chochang = 0x0daa, + Thai_soso = 0x0dab, + Thai_chochoe = 0x0dac, + Thai_yoying = 0x0dad, + Thai_dochada = 0x0dae, + Thai_topatak = 0x0daf, + Thai_thothan = 0x0db0, + Thai_thonangmontho = 0x0db1, + Thai_thophuthao = 0x0db2, + Thai_nonen = 0x0db3, + Thai_dodek = 0x0db4, + Thai_totao = 0x0db5, + Thai_thothung = 0x0db6, + Thai_thothahan = 0x0db7, + Thai_thothong = 0x0db8, + Thai_nonu = 0x0db9, + Thai_bobaimai = 0x0dba, + Thai_popla = 0x0dbb, + Thai_phophung = 0x0dbc, + Thai_fofa = 0x0dbd, + Thai_phophan = 0x0dbe, + Thai_fofan = 0x0dbf, + Thai_phosamphao = 0x0dc0, + Thai_moma = 0x0dc1, + Thai_yoyak = 0x0dc2, + Thai_rorua = 0x0dc3, + Thai_ru = 0x0dc4, + Thai_loling = 0x0dc5, + Thai_lu = 0x0dc6, + Thai_wowaen = 0x0dc7, + Thai_sosala = 0x0dc8, + Thai_sorusi = 0x0dc9, + Thai_sosua = 0x0dca, + Thai_hohip = 0x0dcb, + Thai_lochula = 0x0dcc, + Thai_oang = 0x0dcd, + Thai_honokhuk = 0x0dce, + Thai_paiyannoi = 0x0dcf, + Thai_saraa = 0x0dd0, + Thai_maihanakat = 0x0dd1, + Thai_saraaa = 0x0dd2, + Thai_saraam = 0x0dd3, + Thai_sarai = 0x0dd4, + Thai_saraii = 0x0dd5, + Thai_saraue = 0x0dd6, + Thai_sarauee = 0x0dd7, + Thai_sarau = 0x0dd8, + Thai_sarauu = 0x0dd9, + Thai_phinthu = 0x0dda, + Thai_maihanakat_maitho = 0x0dde, + Thai_baht = 0x0ddf, + Thai_sarae = 0x0de0, + Thai_saraae = 0x0de1, + Thai_sarao = 0x0de2, + Thai_saraaimaimuan = 0x0de3, + Thai_saraaimaimalai = 0x0de4, + Thai_lakkhangyao = 0x0de5, + Thai_maiyamok = 0x0de6, + Thai_maitaikhu = 0x0de7, + Thai_maiek = 0x0de8, + Thai_maitho = 0x0de9, + Thai_maitri = 0x0dea, + Thai_maichattawa = 0x0deb, + Thai_thanthakhat = 0x0dec, + Thai_nikhahit = 0x0ded, + Thai_leksun = 0x0df0, + Thai_leknung = 0x0df1, + Thai_leksong = 0x0df2, + Thai_leksam = 0x0df3, + Thai_leksi = 0x0df4, + Thai_lekha = 0x0df5, + Thai_lekhok = 0x0df6, + Thai_lekchet = 0x0df7, + Thai_lekpaet = 0x0df8, + Thai_lekkao = 0x0df9, + Hangul = 0xff31, + Hangul_Start = 0xff32, + Hangul_End = 0xff33, + Hangul_Hanja = 0xff34, + Hangul_Jamo = 0xff35, + Hangul_Romaja = 0xff36, + Hangul_Codeinput = 0xff37, + Hangul_Jeonja = 0xff38, + Hangul_Banja = 0xff39, + Hangul_PreHanja = 0xff3a, + Hangul_PostHanja = 0xff3b, + Hangul_SingleCandidate = 0xff3c, + Hangul_MultipleCandidate = 0xff3d, + Hangul_PreviousCandidate = 0xff3e, + Hangul_Special = 0xff3f, + Hangul_switch = 0xff7e, + Hangul_Kiyeog = 0x0ea1, + Hangul_SsangKiyeog = 0x0ea2, + Hangul_KiyeogSios = 0x0ea3, + Hangul_Nieun = 0x0ea4, + Hangul_NieunJieuj = 0x0ea5, + Hangul_NieunHieuh = 0x0ea6, + Hangul_Dikeud = 0x0ea7, + Hangul_SsangDikeud = 0x0ea8, + Hangul_Rieul = 0x0ea9, + Hangul_RieulKiyeog = 0x0eaa, + Hangul_RieulMieum = 0x0eab, + Hangul_RieulPieub = 0x0eac, + Hangul_RieulSios = 0x0ead, + Hangul_RieulTieut = 0x0eae, + Hangul_RieulPhieuf = 0x0eaf, + Hangul_RieulHieuh = 0x0eb0, + Hangul_Mieum = 0x0eb1, + Hangul_Pieub = 0x0eb2, + Hangul_SsangPieub = 0x0eb3, + Hangul_PieubSios = 0x0eb4, + Hangul_Sios = 0x0eb5, + Hangul_SsangSios = 0x0eb6, + Hangul_Ieung = 0x0eb7, + Hangul_Jieuj = 0x0eb8, + Hangul_SsangJieuj = 0x0eb9, + Hangul_Cieuc = 0x0eba, + Hangul_Khieuq = 0x0ebb, + Hangul_Tieut = 0x0ebc, + Hangul_Phieuf = 0x0ebd, + Hangul_Hieuh = 0x0ebe, + Hangul_A = 0x0ebf, + Hangul_AE = 0x0ec0, + Hangul_YA = 0x0ec1, + Hangul_YAE = 0x0ec2, + Hangul_EO = 0x0ec3, + Hangul_E = 0x0ec4, + Hangul_YEO = 0x0ec5, + Hangul_YE = 0x0ec6, + Hangul_O = 0x0ec7, + Hangul_WA = 0x0ec8, + Hangul_WAE = 0x0ec9, + Hangul_OE = 0x0eca, + Hangul_YO = 0x0ecb, + Hangul_U = 0x0ecc, + Hangul_WEO = 0x0ecd, + Hangul_WE = 0x0ece, + Hangul_WI = 0x0ecf, + Hangul_YU = 0x0ed0, + Hangul_EU = 0x0ed1, + Hangul_YI = 0x0ed2, + Hangul_I = 0x0ed3, + Hangul_J_Kiyeog = 0x0ed4, + Hangul_J_SsangKiyeog = 0x0ed5, + Hangul_J_KiyeogSios = 0x0ed6, + Hangul_J_Nieun = 0x0ed7, + Hangul_J_NieunJieuj = 0x0ed8, + Hangul_J_NieunHieuh = 0x0ed9, + Hangul_J_Dikeud = 0x0eda, + Hangul_J_Rieul = 0x0edb, + Hangul_J_RieulKiyeog = 0x0edc, + Hangul_J_RieulMieum = 0x0edd, + Hangul_J_RieulPieub = 0x0ede, + Hangul_J_RieulSios = 0x0edf, + Hangul_J_RieulTieut = 0x0ee0, + Hangul_J_RieulPhieuf = 0x0ee1, + Hangul_J_RieulHieuh = 0x0ee2, + Hangul_J_Mieum = 0x0ee3, + Hangul_J_Pieub = 0x0ee4, + Hangul_J_PieubSios = 0x0ee5, + Hangul_J_Sios = 0x0ee6, + Hangul_J_SsangSios = 0x0ee7, + Hangul_J_Ieung = 0x0ee8, + Hangul_J_Jieuj = 0x0ee9, + Hangul_J_Cieuc = 0x0eea, + Hangul_J_Khieuq = 0x0eeb, + Hangul_J_Tieut = 0x0eec, + Hangul_J_Phieuf = 0x0eed, + Hangul_J_Hieuh = 0x0eee, + Hangul_RieulYeorinHieuh = 0x0eef, + Hangul_SunkyeongeumMieum = 0x0ef0, + Hangul_SunkyeongeumPieub = 0x0ef1, + Hangul_PanSios = 0x0ef2, + Hangul_KkogjiDalrinIeung = 0x0ef3, + Hangul_SunkyeongeumPhieuf = 0x0ef4, + Hangul_YeorinHieuh = 0x0ef5, + Hangul_AraeA = 0x0ef6, + Hangul_AraeAE = 0x0ef7, + Hangul_J_PanSios = 0x0ef8, + Hangul_J_KkogjiDalrinIeung = 0x0ef9, + Hangul_J_YeorinHieuh = 0x0efa, + Korean_Won = 0x0eff, + Armenian_ligature_ew = 0x1000587, + Armenian_full_stop = 0x1000589, + Armenian_verjaket = 0x1000589, + Armenian_separation_mark = 0x100055d, + Armenian_but = 0x100055d, + Armenian_hyphen = 0x100058a, + Armenian_yentamna = 0x100058a, + Armenian_exclam = 0x100055c, + Armenian_amanak = 0x100055c, + Armenian_accent = 0x100055b, + Armenian_shesht = 0x100055b, + Armenian_question = 0x100055e, + Armenian_paruyk = 0x100055e, + Armenian_AYB = 0x1000531, + Armenian_ayb = 0x1000561, + Armenian_BEN = 0x1000532, + Armenian_ben = 0x1000562, + Armenian_GIM = 0x1000533, + Armenian_gim = 0x1000563, + Armenian_DA = 0x1000534, + Armenian_da = 0x1000564, + Armenian_YECH = 0x1000535, + Armenian_yech = 0x1000565, + Armenian_ZA = 0x1000536, + Armenian_za = 0x1000566, + Armenian_E = 0x1000537, + Armenian_e = 0x1000567, + Armenian_AT = 0x1000538, + Armenian_at = 0x1000568, + Armenian_TO = 0x1000539, + Armenian_to = 0x1000569, + Armenian_ZHE = 0x100053a, + Armenian_zhe = 0x100056a, + Armenian_INI = 0x100053b, + Armenian_ini = 0x100056b, + Armenian_LYUN = 0x100053c, + Armenian_lyun = 0x100056c, + Armenian_KHE = 0x100053d, + Armenian_khe = 0x100056d, + Armenian_TSA = 0x100053e, + Armenian_tsa = 0x100056e, + Armenian_KEN = 0x100053f, + Armenian_ken = 0x100056f, + Armenian_HO = 0x1000540, + Armenian_ho = 0x1000570, + Armenian_DZA = 0x1000541, + Armenian_dza = 0x1000571, + Armenian_GHAT = 0x1000542, + Armenian_ghat = 0x1000572, + Armenian_TCHE = 0x1000543, + Armenian_tche = 0x1000573, + Armenian_MEN = 0x1000544, + Armenian_men = 0x1000574, + Armenian_HI = 0x1000545, + Armenian_hi = 0x1000575, + Armenian_NU = 0x1000546, + Armenian_nu = 0x1000576, + Armenian_SHA = 0x1000547, + Armenian_sha = 0x1000577, + Armenian_VO = 0x1000548, + Armenian_vo = 0x1000578, + Armenian_CHA = 0x1000549, + Armenian_cha = 0x1000579, + Armenian_PE = 0x100054a, + Armenian_pe = 0x100057a, + Armenian_JE = 0x100054b, + Armenian_je = 0x100057b, + Armenian_RA = 0x100054c, + Armenian_ra = 0x100057c, + Armenian_SE = 0x100054d, + Armenian_se = 0x100057d, + Armenian_VEV = 0x100054e, + Armenian_vev = 0x100057e, + Armenian_TYUN = 0x100054f, + Armenian_tyun = 0x100057f, + Armenian_RE = 0x1000550, + Armenian_re = 0x1000580, + Armenian_TSO = 0x1000551, + Armenian_tso = 0x1000581, + Armenian_VYUN = 0x1000552, + Armenian_vyun = 0x1000582, + Armenian_PYUR = 0x1000553, + Armenian_pyur = 0x1000583, + Armenian_KE = 0x1000554, + Armenian_ke = 0x1000584, + Armenian_O = 0x1000555, + Armenian_o = 0x1000585, + Armenian_FE = 0x1000556, + Armenian_fe = 0x1000586, + Armenian_apostrophe = 0x100055a, + Georgian_an = 0x10010d0, + Georgian_ban = 0x10010d1, + Georgian_gan = 0x10010d2, + Georgian_don = 0x10010d3, + Georgian_en = 0x10010d4, + Georgian_vin = 0x10010d5, + Georgian_zen = 0x10010d6, + Georgian_tan = 0x10010d7, + Georgian_in = 0x10010d8, + Georgian_kan = 0x10010d9, + Georgian_las = 0x10010da, + Georgian_man = 0x10010db, + Georgian_nar = 0x10010dc, + Georgian_on = 0x10010dd, + Georgian_par = 0x10010de, + Georgian_zhar = 0x10010df, + Georgian_rae = 0x10010e0, + Georgian_san = 0x10010e1, + Georgian_tar = 0x10010e2, + Georgian_un = 0x10010e3, + Georgian_phar = 0x10010e4, + Georgian_khar = 0x10010e5, + Georgian_ghan = 0x10010e6, + Georgian_qar = 0x10010e7, + Georgian_shin = 0x10010e8, + Georgian_chin = 0x10010e9, + Georgian_can = 0x10010ea, + Georgian_jil = 0x10010eb, + Georgian_cil = 0x10010ec, + Georgian_char = 0x10010ed, + Georgian_xan = 0x10010ee, + Georgian_jhan = 0x10010ef, + Georgian_hae = 0x10010f0, + Georgian_he = 0x10010f1, + Georgian_hie = 0x10010f2, + Georgian_we = 0x10010f3, + Georgian_har = 0x10010f4, + Georgian_hoe = 0x10010f5, + Georgian_fi = 0x10010f6, + Xabovedot = 0x1001e8a, + Ibreve = 0x100012c, + Zstroke = 0x10001b5, + Gcaron = 0x10001e6, + Ocaron = 0x10001d1, + Obarred = 0x100019f, + xabovedot = 0x1001e8b, + ibreve = 0x100012d, + zstroke = 0x10001b6, + gcaron = 0x10001e7, + ocaron = 0x10001d2, + obarred = 0x1000275, + SCHWA = 0x100018f, + schwa = 0x1000259, + EZH = 0x10001b7, + ezh = 0x1000292, + Lbelowdot = 0x1001e36, + lbelowdot = 0x1001e37, + Abelowdot = 0x1001ea0, + abelowdot = 0x1001ea1, + Ahook = 0x1001ea2, + ahook = 0x1001ea3, + Acircumflexacute = 0x1001ea4, + acircumflexacute = 0x1001ea5, + Acircumflexgrave = 0x1001ea6, + acircumflexgrave = 0x1001ea7, + Acircumflexhook = 0x1001ea8, + acircumflexhook = 0x1001ea9, + Acircumflextilde = 0x1001eaa, + acircumflextilde = 0x1001eab, + Acircumflexbelowdot = 0x1001eac, + acircumflexbelowdot = 0x1001ead, + Abreveacute = 0x1001eae, + abreveacute = 0x1001eaf, + Abrevegrave = 0x1001eb0, + abrevegrave = 0x1001eb1, + Abrevehook = 0x1001eb2, + abrevehook = 0x1001eb3, + Abrevetilde = 0x1001eb4, + abrevetilde = 0x1001eb5, + Abrevebelowdot = 0x1001eb6, + abrevebelowdot = 0x1001eb7, + Ebelowdot = 0x1001eb8, + ebelowdot = 0x1001eb9, + Ehook = 0x1001eba, + ehook = 0x1001ebb, + Etilde = 0x1001ebc, + etilde = 0x1001ebd, + Ecircumflexacute = 0x1001ebe, + ecircumflexacute = 0x1001ebf, + Ecircumflexgrave = 0x1001ec0, + ecircumflexgrave = 0x1001ec1, + Ecircumflexhook = 0x1001ec2, + ecircumflexhook = 0x1001ec3, + Ecircumflextilde = 0x1001ec4, + ecircumflextilde = 0x1001ec5, + Ecircumflexbelowdot = 0x1001ec6, + ecircumflexbelowdot = 0x1001ec7, + Ihook = 0x1001ec8, + ihook = 0x1001ec9, + Ibelowdot = 0x1001eca, + ibelowdot = 0x1001ecb, + Obelowdot = 0x1001ecc, + obelowdot = 0x1001ecd, + Ohook = 0x1001ece, + ohook = 0x1001ecf, + Ocircumflexacute = 0x1001ed0, + ocircumflexacute = 0x1001ed1, + Ocircumflexgrave = 0x1001ed2, + ocircumflexgrave = 0x1001ed3, + Ocircumflexhook = 0x1001ed4, + ocircumflexhook = 0x1001ed5, + Ocircumflextilde = 0x1001ed6, + ocircumflextilde = 0x1001ed7, + Ocircumflexbelowdot = 0x1001ed8, + ocircumflexbelowdot = 0x1001ed9, + Ohornacute = 0x1001eda, + ohornacute = 0x1001edb, + Ohorngrave = 0x1001edc, + ohorngrave = 0x1001edd, + Ohornhook = 0x1001ede, + ohornhook = 0x1001edf, + Ohorntilde = 0x1001ee0, + ohorntilde = 0x1001ee1, + Ohornbelowdot = 0x1001ee2, + ohornbelowdot = 0x1001ee3, + Ubelowdot = 0x1001ee4, + ubelowdot = 0x1001ee5, + Uhook = 0x1001ee6, + uhook = 0x1001ee7, + Uhornacute = 0x1001ee8, + uhornacute = 0x1001ee9, + Uhorngrave = 0x1001eea, + uhorngrave = 0x1001eeb, + Uhornhook = 0x1001eec, + uhornhook = 0x1001eed, + Uhorntilde = 0x1001eee, + uhorntilde = 0x1001eef, + Uhornbelowdot = 0x1001ef0, + uhornbelowdot = 0x1001ef1, + Ybelowdot = 0x1001ef4, + ybelowdot = 0x1001ef5, + Yhook = 0x1001ef6, + yhook = 0x1001ef7, + Ytilde = 0x1001ef8, + ytilde = 0x1001ef9, + Ohorn = 0x10001a0, + ohorn = 0x10001a1, + Uhorn = 0x10001af, + uhorn = 0x10001b0, + EcuSign = 0x10020a0, + ColonSign = 0x10020a1, + CruzeiroSign = 0x10020a2, + FFrancSign = 0x10020a3, + LiraSign = 0x10020a4, + MillSign = 0x10020a5, + NairaSign = 0x10020a6, + PesetaSign = 0x10020a7, + RupeeSign = 0x10020a8, + WonSign = 0x10020a9, + NewSheqelSign = 0x10020aa, + DongSign = 0x10020ab, + EuroSign = 0x20ac, + zerosuperior = 0x1002070, + foursuperior = 0x1002074, + fivesuperior = 0x1002075, + sixsuperior = 0x1002076, + sevensuperior = 0x1002077, + eightsuperior = 0x1002078, + ninesuperior = 0x1002079, + zerosubscript = 0x1002080, + onesubscript = 0x1002081, + twosubscript = 0x1002082, + threesubscript = 0x1002083, + foursubscript = 0x1002084, + fivesubscript = 0x1002085, + sixsubscript = 0x1002086, + sevensubscript = 0x1002087, + eightsubscript = 0x1002088, + ninesubscript = 0x1002089, + partdifferential = 0x1002202, + emptyset = 0x1002205, + elementof = 0x1002208, + notelementof = 0x1002209, + containsas = 0x100220B, + squareroot = 0x100221A, + cuberoot = 0x100221B, + fourthroot = 0x100221C, + dintegral = 0x100222C, + tintegral = 0x100222D, + because = 0x1002235, + approxeq = 0x1002248, + notapproxeq = 0x1002247, + notidentical = 0x1002262, + stricteq = 0x1002263, + braille_dot_1 = 0xfff1, + braille_dot_2 = 0xfff2, + braille_dot_3 = 0xfff3, + braille_dot_4 = 0xfff4, + braille_dot_5 = 0xfff5, + braille_dot_6 = 0xfff6, + braille_dot_7 = 0xfff7, + braille_dot_8 = 0xfff8, + braille_dot_9 = 0xfff9, + braille_dot_10 = 0xfffa, + braille_blank = 0x1002800, + braille_dots_1 = 0x1002801, + braille_dots_2 = 0x1002802, + braille_dots_12 = 0x1002803, + braille_dots_3 = 0x1002804, + braille_dots_13 = 0x1002805, + braille_dots_23 = 0x1002806, + braille_dots_123 = 0x1002807, + braille_dots_4 = 0x1002808, + braille_dots_14 = 0x1002809, + braille_dots_24 = 0x100280a, + braille_dots_124 = 0x100280b, + braille_dots_34 = 0x100280c, + braille_dots_134 = 0x100280d, + braille_dots_234 = 0x100280e, + braille_dots_1234 = 0x100280f, + braille_dots_5 = 0x1002810, + braille_dots_15 = 0x1002811, + braille_dots_25 = 0x1002812, + braille_dots_125 = 0x1002813, + braille_dots_35 = 0x1002814, + braille_dots_135 = 0x1002815, + braille_dots_235 = 0x1002816, + braille_dots_1235 = 0x1002817, + braille_dots_45 = 0x1002818, + braille_dots_145 = 0x1002819, + braille_dots_245 = 0x100281a, + braille_dots_1245 = 0x100281b, + braille_dots_345 = 0x100281c, + braille_dots_1345 = 0x100281d, + braille_dots_2345 = 0x100281e, + braille_dots_12345 = 0x100281f, + braille_dots_6 = 0x1002820, + braille_dots_16 = 0x1002821, + braille_dots_26 = 0x1002822, + braille_dots_126 = 0x1002823, + braille_dots_36 = 0x1002824, + braille_dots_136 = 0x1002825, + braille_dots_236 = 0x1002826, + braille_dots_1236 = 0x1002827, + braille_dots_46 = 0x1002828, + braille_dots_146 = 0x1002829, + braille_dots_246 = 0x100282a, + braille_dots_1246 = 0x100282b, + braille_dots_346 = 0x100282c, + braille_dots_1346 = 0x100282d, + braille_dots_2346 = 0x100282e, + braille_dots_12346 = 0x100282f, + braille_dots_56 = 0x1002830, + braille_dots_156 = 0x1002831, + braille_dots_256 = 0x1002832, + braille_dots_1256 = 0x1002833, + braille_dots_356 = 0x1002834, + braille_dots_1356 = 0x1002835, + braille_dots_2356 = 0x1002836, + braille_dots_12356 = 0x1002837, + braille_dots_456 = 0x1002838, + braille_dots_1456 = 0x1002839, + braille_dots_2456 = 0x100283a, + braille_dots_12456 = 0x100283b, + braille_dots_3456 = 0x100283c, + braille_dots_13456 = 0x100283d, + braille_dots_23456 = 0x100283e, + braille_dots_123456 = 0x100283f, + braille_dots_7 = 0x1002840, + braille_dots_17 = 0x1002841, + braille_dots_27 = 0x1002842, + braille_dots_127 = 0x1002843, + braille_dots_37 = 0x1002844, + braille_dots_137 = 0x1002845, + braille_dots_237 = 0x1002846, + braille_dots_1237 = 0x1002847, + braille_dots_47 = 0x1002848, + braille_dots_147 = 0x1002849, + braille_dots_247 = 0x100284a, + braille_dots_1247 = 0x100284b, + braille_dots_347 = 0x100284c, + braille_dots_1347 = 0x100284d, + braille_dots_2347 = 0x100284e, + braille_dots_12347 = 0x100284f, + braille_dots_57 = 0x1002850, + braille_dots_157 = 0x1002851, + braille_dots_257 = 0x1002852, + braille_dots_1257 = 0x1002853, + braille_dots_357 = 0x1002854, + braille_dots_1357 = 0x1002855, + braille_dots_2357 = 0x1002856, + braille_dots_12357 = 0x1002857, + braille_dots_457 = 0x1002858, + braille_dots_1457 = 0x1002859, + braille_dots_2457 = 0x100285a, + braille_dots_12457 = 0x100285b, + braille_dots_3457 = 0x100285c, + braille_dots_13457 = 0x100285d, + braille_dots_23457 = 0x100285e, + braille_dots_123457 = 0x100285f, + braille_dots_67 = 0x1002860, + braille_dots_167 = 0x1002861, + braille_dots_267 = 0x1002862, + braille_dots_1267 = 0x1002863, + braille_dots_367 = 0x1002864, + braille_dots_1367 = 0x1002865, + braille_dots_2367 = 0x1002866, + braille_dots_12367 = 0x1002867, + braille_dots_467 = 0x1002868, + braille_dots_1467 = 0x1002869, + braille_dots_2467 = 0x100286a, + braille_dots_12467 = 0x100286b, + braille_dots_3467 = 0x100286c, + braille_dots_13467 = 0x100286d, + braille_dots_23467 = 0x100286e, + braille_dots_123467 = 0x100286f, + braille_dots_567 = 0x1002870, + braille_dots_1567 = 0x1002871, + braille_dots_2567 = 0x1002872, + braille_dots_12567 = 0x1002873, + braille_dots_3567 = 0x1002874, + braille_dots_13567 = 0x1002875, + braille_dots_23567 = 0x1002876, + braille_dots_123567 = 0x1002877, + braille_dots_4567 = 0x1002878, + braille_dots_14567 = 0x1002879, + braille_dots_24567 = 0x100287a, + braille_dots_124567 = 0x100287b, + braille_dots_34567 = 0x100287c, + braille_dots_134567 = 0x100287d, + braille_dots_234567 = 0x100287e, + braille_dots_1234567 = 0x100287f, + braille_dots_8 = 0x1002880, + braille_dots_18 = 0x1002881, + braille_dots_28 = 0x1002882, + braille_dots_128 = 0x1002883, + braille_dots_38 = 0x1002884, + braille_dots_138 = 0x1002885, + braille_dots_238 = 0x1002886, + braille_dots_1238 = 0x1002887, + braille_dots_48 = 0x1002888, + braille_dots_148 = 0x1002889, + braille_dots_248 = 0x100288a, + braille_dots_1248 = 0x100288b, + braille_dots_348 = 0x100288c, + braille_dots_1348 = 0x100288d, + braille_dots_2348 = 0x100288e, + braille_dots_12348 = 0x100288f, + braille_dots_58 = 0x1002890, + braille_dots_158 = 0x1002891, + braille_dots_258 = 0x1002892, + braille_dots_1258 = 0x1002893, + braille_dots_358 = 0x1002894, + braille_dots_1358 = 0x1002895, + braille_dots_2358 = 0x1002896, + braille_dots_12358 = 0x1002897, + braille_dots_458 = 0x1002898, + braille_dots_1458 = 0x1002899, + braille_dots_2458 = 0x100289a, + braille_dots_12458 = 0x100289b, + braille_dots_3458 = 0x100289c, + braille_dots_13458 = 0x100289d, + braille_dots_23458 = 0x100289e, + braille_dots_123458 = 0x100289f, + braille_dots_68 = 0x10028a0, + braille_dots_168 = 0x10028a1, + braille_dots_268 = 0x10028a2, + braille_dots_1268 = 0x10028a3, + braille_dots_368 = 0x10028a4, + braille_dots_1368 = 0x10028a5, + braille_dots_2368 = 0x10028a6, + braille_dots_12368 = 0x10028a7, + braille_dots_468 = 0x10028a8, + braille_dots_1468 = 0x10028a9, + braille_dots_2468 = 0x10028aa, + braille_dots_12468 = 0x10028ab, + braille_dots_3468 = 0x10028ac, + braille_dots_13468 = 0x10028ad, + braille_dots_23468 = 0x10028ae, + braille_dots_123468 = 0x10028af, + braille_dots_568 = 0x10028b0, + braille_dots_1568 = 0x10028b1, + braille_dots_2568 = 0x10028b2, + braille_dots_12568 = 0x10028b3, + braille_dots_3568 = 0x10028b4, + braille_dots_13568 = 0x10028b5, + braille_dots_23568 = 0x10028b6, + braille_dots_123568 = 0x10028b7, + braille_dots_4568 = 0x10028b8, + braille_dots_14568 = 0x10028b9, + braille_dots_24568 = 0x10028ba, + braille_dots_124568 = 0x10028bb, + braille_dots_34568 = 0x10028bc, + braille_dots_134568 = 0x10028bd, + braille_dots_234568 = 0x10028be, + braille_dots_1234568 = 0x10028bf, + braille_dots_78 = 0x10028c0, + braille_dots_178 = 0x10028c1, + braille_dots_278 = 0x10028c2, + braille_dots_1278 = 0x10028c3, + braille_dots_378 = 0x10028c4, + braille_dots_1378 = 0x10028c5, + braille_dots_2378 = 0x10028c6, + braille_dots_12378 = 0x10028c7, + braille_dots_478 = 0x10028c8, + braille_dots_1478 = 0x10028c9, + braille_dots_2478 = 0x10028ca, + braille_dots_12478 = 0x10028cb, + braille_dots_3478 = 0x10028cc, + braille_dots_13478 = 0x10028cd, + braille_dots_23478 = 0x10028ce, + braille_dots_123478 = 0x10028cf, + braille_dots_578 = 0x10028d0, + braille_dots_1578 = 0x10028d1, + braille_dots_2578 = 0x10028d2, + braille_dots_12578 = 0x10028d3, + braille_dots_3578 = 0x10028d4, + braille_dots_13578 = 0x10028d5, + braille_dots_23578 = 0x10028d6, + braille_dots_123578 = 0x10028d7, + braille_dots_4578 = 0x10028d8, + braille_dots_14578 = 0x10028d9, + braille_dots_24578 = 0x10028da, + braille_dots_124578 = 0x10028db, + braille_dots_34578 = 0x10028dc, + braille_dots_134578 = 0x10028dd, + braille_dots_234578 = 0x10028de, + braille_dots_1234578 = 0x10028df, + braille_dots_678 = 0x10028e0, + braille_dots_1678 = 0x10028e1, + braille_dots_2678 = 0x10028e2, + braille_dots_12678 = 0x10028e3, + braille_dots_3678 = 0x10028e4, + braille_dots_13678 = 0x10028e5, + braille_dots_23678 = 0x10028e6, + braille_dots_123678 = 0x10028e7, + braille_dots_4678 = 0x10028e8, + braille_dots_14678 = 0x10028e9, + braille_dots_24678 = 0x10028ea, + braille_dots_124678 = 0x10028eb, + braille_dots_34678 = 0x10028ec, + braille_dots_134678 = 0x10028ed, + braille_dots_234678 = 0x10028ee, + braille_dots_1234678 = 0x10028ef, + braille_dots_5678 = 0x10028f0, + braille_dots_15678 = 0x10028f1, + braille_dots_25678 = 0x10028f2, + braille_dots_125678 = 0x10028f3, + braille_dots_35678 = 0x10028f4, + braille_dots_135678 = 0x10028f5, + braille_dots_235678 = 0x10028f6, + braille_dots_1235678 = 0x10028f7, + braille_dots_45678 = 0x10028f8, + braille_dots_145678 = 0x10028f9, + braille_dots_245678 = 0x10028fa, + braille_dots_1245678 = 0x10028fb, + braille_dots_345678 = 0x10028fc, + braille_dots_1345678 = 0x10028fd, + braille_dots_2345678 = 0x10028fe, + braille_dots_12345678 = 0x10028ff, + Sinh_ng = 0x1000d82, + Sinh_h2 = 0x1000d83, + Sinh_a = 0x1000d85, + Sinh_aa = 0x1000d86, + Sinh_ae = 0x1000d87, + Sinh_aee = 0x1000d88, + Sinh_i = 0x1000d89, + Sinh_ii = 0x1000d8a, + Sinh_u = 0x1000d8b, + Sinh_uu = 0x1000d8c, + Sinh_ri = 0x1000d8d, + Sinh_rii = 0x1000d8e, + Sinh_lu = 0x1000d8f, + Sinh_luu = 0x1000d90, + Sinh_e = 0x1000d91, + Sinh_ee = 0x1000d92, + Sinh_ai = 0x1000d93, + Sinh_o = 0x1000d94, + Sinh_oo = 0x1000d95, + Sinh_au = 0x1000d96, + Sinh_ka = 0x1000d9a, + Sinh_kha = 0x1000d9b, + Sinh_ga = 0x1000d9c, + Sinh_gha = 0x1000d9d, + Sinh_ng2 = 0x1000d9e, + Sinh_nga = 0x1000d9f, + Sinh_ca = 0x1000da0, + Sinh_cha = 0x1000da1, + Sinh_ja = 0x1000da2, + Sinh_jha = 0x1000da3, + Sinh_nya = 0x1000da4, + Sinh_jnya = 0x1000da5, + Sinh_nja = 0x1000da6, + Sinh_tta = 0x1000da7, + Sinh_ttha = 0x1000da8, + Sinh_dda = 0x1000da9, + Sinh_ddha = 0x1000daa, + Sinh_nna = 0x1000dab, + Sinh_ndda = 0x1000dac, + Sinh_tha = 0x1000dad, + Sinh_thha = 0x1000dae, + Sinh_dha = 0x1000daf, + Sinh_dhha = 0x1000db0, + Sinh_na = 0x1000db1, + Sinh_ndha = 0x1000db3, + Sinh_pa = 0x1000db4, + Sinh_pha = 0x1000db5, + Sinh_ba = 0x1000db6, + Sinh_bha = 0x1000db7, + Sinh_ma = 0x1000db8, + Sinh_mba = 0x1000db9, + Sinh_ya = 0x1000dba, + Sinh_ra = 0x1000dbb, + Sinh_la = 0x1000dbd, + Sinh_va = 0x1000dc0, + Sinh_sha = 0x1000dc1, + Sinh_ssha = 0x1000dc2, + Sinh_sa = 0x1000dc3, + Sinh_ha = 0x1000dc4, + Sinh_lla = 0x1000dc5, + Sinh_fa = 0x1000dc6, + Sinh_al = 0x1000dca, + Sinh_aa2 = 0x1000dcf, + Sinh_ae2 = 0x1000dd0, + Sinh_aee2 = 0x1000dd1, + Sinh_i2 = 0x1000dd2, + Sinh_ii2 = 0x1000dd3, + Sinh_u2 = 0x1000dd4, + Sinh_uu2 = 0x1000dd6, + Sinh_ru2 = 0x1000dd8, + Sinh_e2 = 0x1000dd9, + Sinh_ee2 = 0x1000dda, + Sinh_ai2 = 0x1000ddb, + Sinh_o2 = 0x1000ddc, + Sinh_oo2 = 0x1000ddd, + Sinh_au2 = 0x1000dde, + Sinh_lu2 = 0x1000ddf, + Sinh_ruu2 = 0x1000df2, + Sinh_luu2 = 0x1000df3, + Sinh_kunddaliya = 0x1000df4, + XF86ModeLock = 0x1008FF01, + XF86MonBrightnessUp = 0x1008FF02, + XF86MonBrightnessDown = 0x1008FF03, + XF86KbdLightOnOff = 0x1008FF04, + XF86KbdBrightnessUp = 0x1008FF05, + XF86KbdBrightnessDown = 0x1008FF06, + XF86Standby = 0x1008FF10, + XF86AudioLowerVolume = 0x1008FF11, + XF86AudioMute = 0x1008FF12, + XF86AudioRaiseVolume = 0x1008FF13, + XF86AudioPlay = 0x1008FF14, + XF86AudioStop = 0x1008FF15, + XF86AudioPrev = 0x1008FF16, + XF86AudioNext = 0x1008FF17, + XF86HomePage = 0x1008FF18, + XF86Mail = 0x1008FF19, + XF86Start = 0x1008FF1A, + XF86Search = 0x1008FF1B, + XF86AudioRecord = 0x1008FF1C, + XF86Calculator = 0x1008FF1D, + XF86Memo = 0x1008FF1E, + XF86ToDoList = 0x1008FF1F, + XF86Calendar = 0x1008FF20, + XF86PowerDown = 0x1008FF21, + XF86ContrastAdjust = 0x1008FF22, + XF86RockerUp = 0x1008FF23, + XF86RockerDown = 0x1008FF24, + XF86RockerEnter = 0x1008FF25, + XF86Back = 0x1008FF26, + XF86Forward = 0x1008FF27, + XF86Stop = 0x1008FF28, + XF86Refresh = 0x1008FF29, + XF86PowerOff = 0x1008FF2A, + XF86WakeUp = 0x1008FF2B, + XF86Eject = 0x1008FF2C, + XF86ScreenSaver = 0x1008FF2D, + XF86WWW = 0x1008FF2E, + XF86Sleep = 0x1008FF2F, + XF86Favorites = 0x1008FF30, + XF86AudioPause = 0x1008FF31, + XF86AudioMedia = 0x1008FF32, + XF86MyComputer = 0x1008FF33, + XF86VendorHome = 0x1008FF34, + XF86LightBulb = 0x1008FF35, + XF86Shop = 0x1008FF36, + XF86History = 0x1008FF37, + XF86OpenURL = 0x1008FF38, + XF86AddFavorite = 0x1008FF39, + XF86HotLinks = 0x1008FF3A, + XF86BrightnessAdjust = 0x1008FF3B, + XF86Finance = 0x1008FF3C, + XF86Community = 0x1008FF3D, + XF86AudioRewind = 0x1008FF3E, + XF86BackForward = 0x1008FF3F, + XF86Launch0 = 0x1008FF40, + XF86Launch1 = 0x1008FF41, + XF86Launch2 = 0x1008FF42, + XF86Launch3 = 0x1008FF43, + XF86Launch4 = 0x1008FF44, + XF86Launch5 = 0x1008FF45, + XF86Launch6 = 0x1008FF46, + XF86Launch7 = 0x1008FF47, + XF86Launch8 = 0x1008FF48, + XF86Launch9 = 0x1008FF49, + XF86LaunchA = 0x1008FF4A, + XF86LaunchB = 0x1008FF4B, + XF86LaunchC = 0x1008FF4C, + XF86LaunchD = 0x1008FF4D, + XF86LaunchE = 0x1008FF4E, + XF86LaunchF = 0x1008FF4F, + XF86ApplicationLeft = 0x1008FF50, + XF86ApplicationRight = 0x1008FF51, + XF86Book = 0x1008FF52, + XF86CD = 0x1008FF53, + XF86Calculater = 0x1008FF54, + XF86Clear = 0x1008FF55, + XF86Close = 0x1008FF56, + XF86Copy = 0x1008FF57, + XF86Cut = 0x1008FF58, + XF86Display = 0x1008FF59, + XF86DOS = 0x1008FF5A, + XF86Documents = 0x1008FF5B, + XF86Excel = 0x1008FF5C, + XF86Explorer = 0x1008FF5D, + XF86Game = 0x1008FF5E, + XF86Go = 0x1008FF5F, + XF86iTouch = 0x1008FF60, + XF86LogOff = 0x1008FF61, + XF86Market = 0x1008FF62, + XF86Meeting = 0x1008FF63, + XF86MenuKB = 0x1008FF65, + XF86MenuPB = 0x1008FF66, + XF86MySites = 0x1008FF67, + XF86New = 0x1008FF68, + XF86News = 0x1008FF69, + XF86OfficeHome = 0x1008FF6A, + XF86Open = 0x1008FF6B, + XF86Option = 0x1008FF6C, + XF86Paste = 0x1008FF6D, + XF86Phone = 0x1008FF6E, + XF86Q = 0x1008FF70, + XF86Reply = 0x1008FF72, + XF86Reload = 0x1008FF73, + XF86RotateWindows = 0x1008FF74, + XF86RotationPB = 0x1008FF75, + XF86RotationKB = 0x1008FF76, + XF86Save = 0x1008FF77, + XF86ScrollUp = 0x1008FF78, + XF86ScrollDown = 0x1008FF79, + XF86ScrollClick = 0x1008FF7A, + XF86Send = 0x1008FF7B, + XF86Spell = 0x1008FF7C, + XF86SplitScreen = 0x1008FF7D, + XF86Support = 0x1008FF7E, + XF86TaskPane = 0x1008FF7F, + XF86Terminal = 0x1008FF80, + XF86Tools = 0x1008FF81, + XF86Travel = 0x1008FF82, + XF86UserPB = 0x1008FF84, + XF86User1KB = 0x1008FF85, + XF86User2KB = 0x1008FF86, + XF86Video = 0x1008FF87, + XF86WheelButton = 0x1008FF88, + XF86Word = 0x1008FF89, + XF86Xfer = 0x1008FF8A, + XF86ZoomIn = 0x1008FF8B, + XF86ZoomOut = 0x1008FF8C, + XF86Away = 0x1008FF8D, + XF86Messenger = 0x1008FF8E, + XF86WebCam = 0x1008FF8F, + XF86MailForward = 0x1008FF90, + XF86Pictures = 0x1008FF91, + XF86Music = 0x1008FF92, + XF86Battery = 0x1008FF93, + XF86Bluetooth = 0x1008FF94, + XF86WLAN = 0x1008FF95, + XF86UWB = 0x1008FF96, + XF86AudioForward = 0x1008FF97, + XF86AudioRepeat = 0x1008FF98, + XF86AudioRandomPlay = 0x1008FF99, + XF86Subtitle = 0x1008FF9A, + XF86AudioCycleTrack = 0x1008FF9B, + XF86CycleAngle = 0x1008FF9C, + XF86FrameBack = 0x1008FF9D, + XF86FrameForward = 0x1008FF9E, + XF86Time = 0x1008FF9F, + XF86Select = 0x1008FFA0, + XF86View = 0x1008FFA1, + XF86TopMenu = 0x1008FFA2, + XF86Red = 0x1008FFA3, + XF86Green = 0x1008FFA4, + XF86Yellow = 0x1008FFA5, + XF86Blue = 0x1008FFA6, + XF86Suspend = 0x1008FFA7, + XF86Hibernate = 0x1008FFA8, + XF86TouchpadToggle = 0x1008FFA9, + XF86TouchpadOn = 0x1008FFB0, + XF86TouchpadOff = 0x1008FFB1, + XF86AudioMicMute = 0x1008FFB2, + XF86Keyboard = 0x1008FFB3, + XF86WWAN = 0x1008FFB4, + XF86RFKill = 0x1008FFB5, + XF86AudioPreset = 0x1008FFB6, + XF86Switch_VT_1 = 0x1008FE01, + XF86Switch_VT_2 = 0x1008FE02, + XF86Switch_VT_3 = 0x1008FE03, + XF86Switch_VT_4 = 0x1008FE04, + XF86Switch_VT_5 = 0x1008FE05, + XF86Switch_VT_6 = 0x1008FE06, + XF86Switch_VT_7 = 0x1008FE07, + XF86Switch_VT_8 = 0x1008FE08, + XF86Switch_VT_9 = 0x1008FE09, + XF86Switch_VT_10 = 0x1008FE0A, + XF86Switch_VT_11 = 0x1008FE0B, + XF86Switch_VT_12 = 0x1008FE0C, + XF86Ungrab = 0x1008FE20, + XF86ClearGrab = 0x1008FE21, + XF86Next_VMode = 0x1008FE22, + XF86Prev_VMode = 0x1008FE23, + XF86LogWindowTree = 0x1008FE24, + XF86LogGrabInfo = 0x1008FE25, + SunFA_Grave = 0x1005FF00, + SunFA_Circum = 0x1005FF01, + SunFA_Tilde = 0x1005FF02, + SunFA_Acute = 0x1005FF03, + SunFA_Diaeresis = 0x1005FF04, + SunFA_Cedilla = 0x1005FF05, + SunF36 = 0x1005FF10, + SunF37 = 0x1005FF11, + SunSys_Req = 0x1005FF60, + SunPrint_Screen = 0x0000FF61, + SunCompose = 0x0000FF20, + SunAltGraph = 0x0000FF7E, + SunPageUp = 0x0000FF55, + SunPageDown = 0x0000FF56, + SunUndo = 0x0000FF65, + SunAgain = 0x0000FF66, + SunFind = 0x0000FF68, + SunStop = 0x0000FF69, + SunProps = 0x1005FF70, + SunFront = 0x1005FF71, + SunCopy = 0x1005FF72, + SunOpen = 0x1005FF73, + SunPaste = 0x1005FF74, + SunCut = 0x1005FF75, + SunPowerSwitch = 0x1005FF76, + SunAudioLowerVolume = 0x1005FF77, + SunAudioMute = 0x1005FF78, + SunAudioRaiseVolume = 0x1005FF79, + SunVideoDegauss = 0x1005FF7A, + SunVideoLowerBrightness = 0x1005FF7B, + SunVideoRaiseBrightness = 0x1005FF7C, + SunPowerSwitchShift = 0x1005FF7D, + Dring_accent = 0x1000FEB0, + Dcircumflex_accent = 0x1000FE5E, + Dcedilla_accent = 0x1000FE2C, + Dacute_accent = 0x1000FE27, + Dgrave_accent = 0x1000FE60, + Dtilde = 0x1000FE7E, + Ddiaeresis = 0x1000FE22, + DRemove = 0x1000FF00, + hpClearLine = 0x1000FF6F, + hpInsertLine = 0x1000FF70, + hpDeleteLine = 0x1000FF71, + hpInsertChar = 0x1000FF72, + hpDeleteChar = 0x1000FF73, + hpBackTab = 0x1000FF74, + hpKP_BackTab = 0x1000FF75, + hpModelock1 = 0x1000FF48, + hpModelock2 = 0x1000FF49, + hpReset = 0x1000FF6C, + hpSystem = 0x1000FF6D, + hpUser = 0x1000FF6E, + hpmute_acute = 0x100000A8, + hpmute_grave = 0x100000A9, + hpmute_asciicircum = 0x100000AA, + hpmute_diaeresis = 0x100000AB, + hpmute_asciitilde = 0x100000AC, + hplira = 0x100000AF, + hpguilder = 0x100000BE, + hpYdiaeresis = 0x100000EE, + hpIO = 0x100000EE, + hplongminus = 0x100000F6, + hpblock = 0x100000FC, + osfCopy = 0x1004FF02, + osfCut = 0x1004FF03, + osfPaste = 0x1004FF04, + osfBackTab = 0x1004FF07, + osfBackSpace = 0x1004FF08, + osfClear = 0x1004FF0B, + osfEscape = 0x1004FF1B, + osfAddMode = 0x1004FF31, + osfPrimaryPaste = 0x1004FF32, + osfQuickPaste = 0x1004FF33, + osfPageLeft = 0x1004FF40, + osfPageUp = 0x1004FF41, + osfPageDown = 0x1004FF42, + osfPageRight = 0x1004FF43, + osfActivate = 0x1004FF44, + osfMenuBar = 0x1004FF45, + osfLeft = 0x1004FF51, + osfUp = 0x1004FF52, + osfRight = 0x1004FF53, + osfDown = 0x1004FF54, + osfEndLine = 0x1004FF57, + osfBeginLine = 0x1004FF58, + osfEndData = 0x1004FF59, + osfBeginData = 0x1004FF5A, + osfPrevMenu = 0x1004FF5B, + osfNextMenu = 0x1004FF5C, + osfPrevField = 0x1004FF5D, + osfNextField = 0x1004FF5E, + osfSelect = 0x1004FF60, + osfInsert = 0x1004FF63, + osfUndo = 0x1004FF65, + osfMenu = 0x1004FF67, + osfCancel = 0x1004FF69, + osfHelp = 0x1004FF6A, + osfSelectAll = 0x1004FF71, + osfDeselectAll = 0x1004FF72, + osfReselect = 0x1004FF73, + osfExtend = 0x1004FF74, + osfRestore = 0x1004FF78, + osfDelete = 0x1004FFFF, + Reset = 0x1000FF6C, + System = 0x1000FF6D, + User = 0x1000FF6E, + ClearLine = 0x1000FF6F, + InsertLine = 0x1000FF70, + DeleteLine = 0x1000FF71, + InsertChar = 0x1000FF72, + DeleteChar = 0x1000FF73, + BackTab = 0x1000FF74, + KP_BackTab = 0x1000FF75, + Ext16bit_L = 0x1000FF76, + Ext16bit_R = 0x1000FF77, + mute_acute = 0x100000a8, + mute_grave = 0x100000a9, + mute_asciicircum = 0x100000aa, + mute_diaeresis = 0x100000ab, + mute_asciitilde = 0x100000ac, + lira = 0x100000af, + guilder = 0x100000be, + IO = 0x100000ee, + longminus = 0x100000f6, + block = 0x100000fc, + } +}
\ No newline at end of file diff --git a/Crow/src/Input/KeyEventArgs.cs b/Crow/src/Input/KeyEventArgs.cs new file mode 100644 index 00000000..510e68a0 --- /dev/null +++ b/Crow/src/Input/KeyEventArgs.cs @@ -0,0 +1,64 @@ +#region License +// +// The Open Toolkit Library License +// +// Copyright (c) 2006 - 2009 the Open Toolkit library. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Crow +{ + public class KeyEventArgs : EventArgs + { + int keyCode; + Key key; + bool repeat; + + public KeyEventArgs(Key _key, bool _repeat) + { + key = _key; + repeat = _repeat; + } + public KeyEventArgs(KeyEventArgs args) + { + Key = args.Key; + } + public Key Key + { + get { return key; } + internal set { key = value; } + } + public uint ScanCode + { + get { return (uint)Key; } + } + public bool IsRepeat + { + get { return repeat; } + internal set { repeat = value; } + } + } +} diff --git a/src/Input/KeyPressEventArgs.cs b/Crow/src/Input/KeyPressEventArgs.cs index 73990613..73990613 100644 --- a/src/Input/KeyPressEventArgs.cs +++ b/Crow/src/Input/KeyPressEventArgs.cs diff --git a/src/Input/MouseButton.cs b/Crow/src/Input/MouseButton.cs index 92be4774..92be4774 100644 --- a/src/Input/MouseButton.cs +++ b/Crow/src/Input/MouseButton.cs diff --git a/src/Input/MouseEventArgs.cs b/Crow/src/Input/MouseEventArgs.cs index cf883f13..68741094 100644 --- a/src/Input/MouseEventArgs.cs +++ b/Crow/src/Input/MouseEventArgs.cs @@ -28,9 +28,6 @@ #endregion using System; -#if !MINIMAL -using System.Drawing; -#endif namespace Crow { diff --git a/src/Input/MouseScroll.cs b/Crow/src/Input/MouseScroll.cs index a04e9d69..a04e9d69 100644 --- a/src/Input/MouseScroll.cs +++ b/Crow/src/Input/MouseScroll.cs diff --git a/src/Input/MouseState.cs b/Crow/src/Input/MouseState.cs index f6db21ea..f6db21ea 100644 --- a/src/Input/MouseState.cs +++ b/Crow/src/Input/MouseState.cs diff --git a/src/Instantiator.cs b/Crow/src/Instantiator.cs index 001832b1..c59043b8 100644 --- a/src/Instantiator.cs +++ b/Crow/src/Instantiator.cs @@ -198,7 +198,7 @@ namespace Crow.IML emitBindingDelegates (ctx); - ctx.il.Emit (OpCodes.Ldloc_0);//load root obj to return + ctx.il.Emit (OpCodes.Ldloc_0);//load root obj to return ctx.il.Emit(OpCodes.Ret); reader.Read ();//close tag @@ -437,9 +437,10 @@ namespace Crow.IML #endif } } - ctx.il.Emit (OpCodes.Ldloc_0); - ctx.il.Emit (OpCodes.Callvirt, CompilerServices.miLoadDefaultVals); - #endregion + ctx.il.Emit (OpCodes.Ldloc_0); + ctx.il.Emit (OpCodes.Callvirt, CompilerServices.miLoadDefaultVals); + #endregion + #region Attributes reading if (reader.HasAttributes) { @@ -492,7 +493,7 @@ namespace Crow.IML /// <summary> /// Parse child node an generate corresponding msil /// </summary> - void readChildren (XmlTextReader reader, IMLContext ctx, int startingIdx = 0) + void readChildren (XmlReader reader, IMLContext ctx, int startingIdx = 0) { bool endTagReached = false; int nodeIdx = startingIdx; @@ -622,6 +623,7 @@ namespace Crow.IML emitRemoveOldDataSourceHandler (il, sourceEvent.Name, bindingDef.TargetMember, false); + //fetch method in datasource and test if it exist il.Emit (OpCodes.Ldarg_2);//load new datasource il.Emit (OpCodes.Ldfld, CompilerServices.fiDSCNewDS); @@ -630,28 +632,27 @@ namespace Crow.IML il.Emit (OpCodes.Ldfld, CompilerServices.fiDSCNewDS); il.Emit (OpCodes.Ldstr, bindingDef.TargetMember);//load handler method name il.Emit (OpCodes.Call, CompilerServices.miGetMethInfoWithRefx); - il.Emit (OpCodes.Stloc_0);//save MethodInfo - il.Emit (OpCodes.Ldloc_0);//push mi for test if null + il.Emit (OpCodes.Stloc_0);//save MethodInfo + il.Emit (OpCodes.Ldloc_0);//push mi for test if null + il.Emit (OpCodes.Brfalse, cancel);//cancel if null - il.Emit (OpCodes.Brfalse, cancel); + il.Emit (OpCodes.Ldarg_1);//load datasource change source where the event is as 1st arg of handler.add + if (bindingDef.IsTemplateBinding)//fetch source instance with address + CompilerServices.emitGetInstance (il, bindingDef.SourceNA); - il.Emit (OpCodes.Ldarg_1);//load datasource change source where the event is as 1st arg of handler.add - if (bindingDef.IsTemplateBinding)//fetch source instance with address - CompilerServices.emitGetInstance (il, bindingDef.SourceNA); + //load handlerType of sourceEvent to create delegate (1st arg) + il.Emit (OpCodes.Ldtoken, sourceEvent.EventHandlerType); + il.Emit (OpCodes.Call, CompilerServices.miGetTypeFromHandle); + il.Emit (OpCodes.Ldarg_2);//load new datasource where the method is defined + il.Emit (OpCodes.Ldfld, CompilerServices.fiDSCNewDS); + il.Emit (OpCodes.Ldloc_0);//load methodInfo (3rd arg) - //load handlerType of sourceEvent to create delegate (1st arg) - il.Emit (OpCodes.Ldtoken, sourceEvent.EventHandlerType); - il.Emit (OpCodes.Call, CompilerServices.miGetTypeFromHandle); - il.Emit (OpCodes.Ldarg_2);//load new datasource where the method is defined - il.Emit (OpCodes.Ldfld, CompilerServices.fiDSCNewDS); - il.Emit (OpCodes.Ldloc_0);//load methodInfo (3rd arg) - - il.Emit (OpCodes.Callvirt, CompilerServices.miCreateBoundDel); - il.Emit (OpCodes.Callvirt, sourceEvent.AddMethod);//call add event - - System.Reflection.Emit.Label finish = il.DefineLabel (); - il.Emit (OpCodes.Br, finish); - il.MarkLabel (cancel); + il.Emit (OpCodes.Call, CompilerServices.miCreateBoundDel); + il.Emit (OpCodes.Call, sourceEvent.AddMethod);//call add event + + System.Reflection.Emit.Label finish = il.DefineLabel (); + il.Emit (OpCodes.Br, finish); + il.MarkLabel (cancel); #if DEBUG_BINDING il.EmitWriteLine (string.Format ("Handler method '{0}' for '{1}' NOT FOUND in new dataSource", bindingDef.TargetMember, sourceEvent.Name)); #endif @@ -659,6 +660,7 @@ namespace Crow.IML #if DEBUG_BINDING il.EmitWriteLine (string.Format ("Handler method '{0}' for '{1}' FOUND in new dataSource", bindingDef.TargetMember, sourceEvent.Name)); #endif + il.Emit (OpCodes.Ret); //store dschange delegate in instatiator instance for access while instancing graphic object @@ -717,7 +719,7 @@ namespace Crow.IML il.Emit (OpCodes.Ldstr, bindingCase.Key);//load name to test il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal - il.Emit (OpCodes.Callvirt, CompilerServices.stringEquals); + il.Emit (OpCodes.Call, CompilerServices.stringEquals); il.Emit (OpCodes.Brfalse, nextTest);//if not equal, jump to next case #endregion @@ -851,7 +853,7 @@ namespace Crow.IML il.Emit (OpCodes.Ldstr, bindingCase.Key);//load name to test il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal - il.Emit (OpCodes.Callvirt, CompilerServices.stringEquals); + il.Emit (OpCodes.Call, CompilerServices.stringEquals); il.Emit (OpCodes.Brfalse, nextTest);//if not equal, jump to next case #endregion @@ -928,7 +930,7 @@ namespace Crow.IML ilPC.Emit(OpCodes.Ldfld, CompilerServices.fiTemplateBinding); //add template bindings dynValueChanged delegate to new parent event - ilPC.Emit(OpCodes.Callvirt, CompilerServices.eiValueChange.AddMethod);//call add event + ilPC.Emit(OpCodes.Call, CompilerServices.eiValueChange.AddMethod);//call add event ilPC.MarkLabel (cancel); ilPC.Emit (OpCodes.Ret); @@ -972,7 +974,7 @@ namespace Crow.IML //test if it's the expected one il.Emit (OpCodes.Ldstr, bindingDef.TargetMember); il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal - il.Emit (OpCodes.Callvirt, CompilerServices.stringEquals); + il.Emit (OpCodes.Call, CompilerServices.stringEquals); il.Emit (OpCodes.Brfalse, endMethod); //set destination member with valueChanged new value //load destination ref @@ -1149,7 +1151,7 @@ namespace Crow.IML //test if it's the expected one il.Emit (OpCodes.Ldstr, origMember); il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal - il.Emit (OpCodes.Callvirt, CompilerServices.stringEquals); + il.Emit (OpCodes.Call, CompilerServices.stringEquals); il.Emit (OpCodes.Brfalse, endMethod); //set destination member with valueChanged new value //load destination ref diff --git a/src/Interface.cs b/Crow/src/Interface.cs index cc62a1aa..1dfcfee2 100644 --- a/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -36,6 +36,9 @@ using System.Xml.Serialization; using Cairo; using System.Globalization; using Crow.IML; +using System.Runtime.InteropServices; + + namespace Crow { @@ -63,13 +66,24 @@ namespace Crow /// The resulting surface (a byte array in the OpenTK renderer) is made available and protected with the /// RenderMutex of the interface. /// </remarks> - public class Interface : ILayoutable + public class Interface : ILayoutable, IDisposable ,IValueChange { + #region IValueChange implementation + public event EventHandler<ValueChangeEventArgs> ValueChanged; + public virtual void NotifyValueChanged(string MemberName, object _value) + { + //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value); + ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); + } + #endregion + + internal IBackend backend; + #region CTOR static Interface(){ - if (Type.GetType ("Mono.Runtime") == null) { + /*if (Type.GetType ("Mono.Runtime") == null) { throw new Exception (@"C.R.O.W. run only on Mono, download latest version at: http://www.mono-project.com/download/stable/"); - } + }*/ CrowConfigRoot = System.IO.Path.Combine( @@ -92,20 +106,143 @@ namespace Crow FontRenderingOptions.Antialias = Antialias.Subpixel; FontRenderingOptions.HintMetrics = HintMetrics.On; FontRenderingOptions.HintStyle = HintStyle.Full; - FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb; + FontRenderingOptions.SubpixelOrder = SubpixelOrder.Default; } - public Interface(){ - CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + + public Interface(int width=800, int height=600){ + + clientRectangle = new Rectangle (0, 0, width, height); + + Init (); + + InitBackend (); + } + #endregion + + protected bool running; + protected virtual void InitBackend () { + if (Environment.OSVersion.Platform == PlatformID.Unix) + backend = new Crow.XCB.XCBBackend(); + else + backend = new Crow.Win32.Win32Backend(); + + //backend = new Crow.XLib.XLibBackend (); + backend.Init (this); + + initTooltip (); + initContextMenus (); + + running = true; + + Thread t = new Thread (interfaceThread); + t.IsBackground = true; + t.Start (); + } + public void Run () { + while (running) { + ProcessEvents (); + Thread.Sleep(1); + } + } + public void ProcessKeyPress (char c) + { + if (_focusedWidget != null) + _focusedWidget.onKeyPress (this, new KeyPressEventArgs(c)); + } + + public void ProcessKeyUp (Key key) + { + if (_focusedWidget != null) + _focusedWidget.onKeyUp (this, new KeyEventArgs(key, false)); +// if (keyboardRepeatThread != null) { +// keyboardRepeatOn = false; +// keyboardRepeatThread.Abort(); +// keyboardRepeatThread.Join (); +// } + } + public void ProcessKeyDown (Key key) + { + //Keyboard.SetKeyState((Crow.Key)Key,true); + lastKeyDownEvt = new KeyEventArgs (key, true); + + if (_focusedWidget != null) + _focusedWidget.onKeyDown (this, new KeyEventArgs (key, false)); + + // keyboardRepeatThread = new Thread (keyboardRepeatThreadFunc); + // keyboardRepeatThread.IsBackground = true; + // keyboardRepeatThread.Start (); + } + + public bool Shift { + get { return backend.Shift; } + } + + public bool Ctrl { + get { return backend.Ctrl; } + } + + public bool Alt { + get { return backend.Alt; } + } + + void interfaceThread() + { + while (running) { + Update (); + Thread.Sleep (20); + } + } + + #region IDisposable Support + private bool disposedValue = false; // To detect redundant calls + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + // TODO: dispose managed state (managed objects). + } + + backend.CleanUp (); + + + disposedValue = true; + } + } + + // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. + ~Interface() { + // Do not change this code. Put cleanup code in Dispose(bool disposing) above. + Dispose(false); + } + + // This code added to correctly implement the disposable pattern. + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); } #endregion + public void ProcessEvents() { + backend.ProcessEvents (); + } public void Init () { + CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + CurrentInterface = this; - loadCursors (); + //loadCursors (); loadStyling (); findAvailableTemplates (); - initTooltip (); - initContextMenus (); + + #if MEASURE_TIME + PerfMeasures.Add (updateMeasure); + PerfMeasures.Add (drawingMeasure); + PerfMeasures.Add (layoutingMeasure); + PerfMeasures.Add (clippingMeasure); + #endif } #region Static and constants @@ -125,6 +262,7 @@ namespace Crow public static int DeviceRepeatDelay = 700; /// <summary> Time interval in millisecond between device event repeat</summary> public static int DeviceRepeatInterval = 40; + public static float WheelIncrement = 1; /// <summary>Tabulation size in Text controls</summary> public static int TabSize = 4; public static string LineBreak = "\n"; @@ -174,10 +312,16 @@ namespace Crow public event EventHandler<MouseButtonEventArgs> MouseButtonDown; public event EventHandler<MouseButtonEventArgs> MouseClick; public event EventHandler<MouseMoveEventArgs> MouseMove; - public event EventHandler<KeyboardKeyEventArgs> KeyboardKeyDown; - public event EventHandler<KeyboardKeyEventArgs> KeyboardKeyUp; + public event EventHandler<KeyEventArgs> KeyDown; + public event EventHandler<KeyEventArgs> KeyUp; + public event EventHandler<KeyPressEventArgs> KeyPress; + /*public event EventHandler<KeyEventArgs> KeyboardKeyDown; + public event EventHandler<KeyEventArgs> KeyboardKeyUp;*/ #endregion + /// <summary>Main Cairo surface</summary> + public Surface surf; + #region Public Fields /// <summary>Graphic Tree of this interface</summary> public List<GraphicObject> GraphicTree = new List<GraphicObject>(); @@ -229,13 +373,11 @@ namespace Crow #region Private Fields /// <summary>Client rectangle in the host context</summary> - Rectangle clientRectangle; + protected Rectangle clientRectangle; /// <summary>Clipping rectangles on the root context</summary> Region clipping = new Region(); /// <summary>Main Cairo context</summary> Context ctx; - /// <summary>Main Cairo surface</summary> - Surface surf; #endregion #region Default values and Style loading @@ -335,7 +477,7 @@ namespace Crow if (path.StartsWith ("#")) { string resId = path.Substring (1); //try/catch added to prevent nunit error - try { + try { stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); } catch{} if (stream == null)//try to find ressource in Crow assembly @@ -361,8 +503,9 @@ namespace Crow } catch{} if (stream == null)//try to find ressource in Crow assembly stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId); - if (stream == null) - throw new Exception ("Resource not found: " + path); + if (stream == null) + throw new Exception("Resource not found: " + path); + } else { if (!File.Exists (path)) throw new FileNotFoundException ("File not found: ", path); @@ -383,9 +526,9 @@ namespace Crow } } /// <summary> - /// Add the content of the IML fragment to the graphic tree of this interface + /// Create an instantiator bound to this interface from the IML fragment /// </summary> - /// <returns>return the new instance for convenience, may be ignored</returns> + /// <returns>return the new instantiator</returns> /// <param name="imlFragment">a valid IML string</param> public Instantiator CreateITorFromIMLFragment (string imlFragment) { return Instantiator.CreateFromImlFragment (this, imlFragment); @@ -457,10 +600,15 @@ namespace Crow _activeWidget = value; + #if DEBUG_FOCUS + NotifyValueChanged("ActiveWidget", _activeWidget); + #endif + if (_activeWidget != null) { _activeWidget.IsActive = true; #if DEBUG_FOCUS + NotifyValueChanged("ActiveWidget", _activeWidget); Debug.WriteLine("Active => " + _activeWidget.ToString()); }else Debug.WriteLine("Active => null"); @@ -477,11 +625,15 @@ namespace Crow if (_hoverWidget == value) return; - if (_hoverWidget != null) - _hoverWidget.IsHover = false; + //if (_hoverWidget != null) + // _hoverWidget.IsHover = false; _hoverWidget = value; + #if DEBUG_FOCUS + NotifyValueChanged("HoverWidget", _hoverWidget); + #endif + /* if (_hoverWidget != null) { _hoverWidget.IsHover = true; @@ -492,6 +644,7 @@ namespace Crow #else } #endif + */ } } /// <summary>Widget has the keyboard or mouse focus</summary> @@ -503,6 +656,9 @@ namespace Crow if (_focusedWidget != null) _focusedWidget.HasFocus = false; _focusedWidget = value; + #if DEBUG_FOCUS + NotifyValueChanged("FocusedWidget", _focusedWidget); + #endif if (_focusedWidget != null) _focusedWidget.HasFocus = true; } @@ -515,13 +671,13 @@ namespace Crow /// Once in that queue, that means that the layouting of obj and childs have succeed, /// the next step when dequeued will be clipping registration</summary> public void EnqueueForRepaint(GraphicObject g) - { - #if DEBUG_UPDATE - Debug.WriteLine (string.Format("\tEnqueueForRepaint -> {0}", g?.ToString ())); - #endif + { lock (ClippingMutex) { if (g.IsQueueForClipping) return; + #if DEBUG_LOG + DebugLog.AddEvent(DbgEvtType.GOEnqueueForRepaint, g); + #endif ClippingQueue.Enqueue (g); g.IsQueueForClipping = true; } @@ -566,16 +722,11 @@ namespace Crow updateMeasure.StartCycle(); #endif - processLayouting (); + /*#if DEBUG_LOG + DebugLog.AddEvent (DbgEvtType.IFaceUpdate); + #endif*/ - #if DEBUG_LAYOUTING - if (curLQIsTries.Count > 0){ - LQIsTries.Add(curLQIsTries); - curLQIsTries = new LQIList(); - LQIs.Add(curLQIs); - curLQIs = new LQIList(); - } - #endif + processLayouting (); clippingRegistration (); @@ -594,24 +745,25 @@ namespace Crow #if MEASURE_TIME layoutingMeasure.StartCycle(); #endif - if (Monitor.TryEnter (LayoutMutex)) { + #if DEBUG_LOG + if (LayoutingQueue.Count > 0) + DebugLog.AddEvent (DbgEvtType.IFaceStartLayouting); + #endif DiscardQueue = new Queue<LayoutingQueueItem> (); //Debug.WriteLine ("======= Layouting queue start ======="); LayoutingQueueItem lqi; while (LayoutingQueue.Count > 0) { lqi = LayoutingQueue.Dequeue (); - #if DEBUG_LAYOUTING - currentLQI = lqi; - curLQIsTries.Add(currentLQI); - #endif lqi.ProcessLayouting (); } LayoutingQueue = DiscardQueue; Monitor.Exit (LayoutMutex); DiscardQueue = null; } - + /*#if DEBUG_LOG + DebugLog.AddEvent (DbgEvtType.IFaceStartLayouting); + #endif*/ #if MEASURE_TIME layoutingMeasure.StopCycle(); #endif @@ -623,6 +775,10 @@ namespace Crow #if MEASURE_TIME clippingMeasure.StartCycle(); #endif + #if DEBUG_LOG + if (ClippingQueue.Count > 0) + DebugLog.AddEvent (DbgEvtType.IFaceStartClipping); + #endif GraphicObject g = null; while (ClippingQueue.Count > 0) { lock (ClippingMutex) { @@ -631,7 +787,9 @@ namespace Crow } g.ClippingRegistration (); } - + /*#if DEBUG_LOG + DebugLog.AddEvent (DbgEvtType.IFaceEndClipping); + #endif*/ #if MEASURE_TIME clippingMeasure.StopCycle(); #endif @@ -642,84 +800,72 @@ namespace Crow #if MEASURE_TIME drawingMeasure.StartCycle(); #endif + #if DEBUG_LOG + if (!clipping.IsEmpty) + DebugLog.AddEvent (DbgEvtType.IFaceStartDrawing); + #endif if (DragImage != null) clipping.UnionRectangle(new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight)); - using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) { - using (ctx = new Context (surf)){ - if (!clipping.IsEmpty) { + //using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) { + using (ctx = new Context (surf)){ + if (!clipping.IsEmpty) { + IsDirty = true; - for (int i = 0; i < clipping.NumRectangles; i++) - ctx.Rectangle(clipping.GetRectangle(i)); - - ctx.ClipPreserve(); - ctx.Operator = Operator.Clear; - ctx.Fill(); - ctx.Operator = Operator.Over; + for (int i = 0; i < clipping.NumRectangles; i++) + ctx.Rectangle(clipping.GetRectangle(i)); + + ctx.ClipPreserve(); + ctx.Operator = Operator.Clear; + ctx.Fill(); + ctx.Operator = Operator.Over; - for (int i = GraphicTree.Count -1; i >= 0 ; i--){ - GraphicObject p = GraphicTree[i]; - if (!p.Visible) - continue; - if (clipping.Contains (p.Slot) == RegionOverlap.Out) - continue; + for (int i = GraphicTree.Count -1; i >= 0 ; i--){ + GraphicObject p = GraphicTree[i]; + if (!p.Visible) + continue; + if (clipping.Contains (p.Slot) == RegionOverlap.Out) + continue; + ctx.Save (); + p.Paint (ref ctx); + ctx.Restore (); + } + + if (DragAndDropOperation != null) { + if (DragImage != null) { + DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight); + DragImageX = Mouse.X - DragImageWidth / 2; + DragImageY = Mouse.Y - DragImageHeight / 2; ctx.Save (); - p.Paint (ref ctx); + ctx.ResetClip (); + ctx.SetSourceSurface (DragImage, DragImageX, DragImageY); + ctx.PaintWithAlpha (0.8); ctx.Restore (); - } - - if (DragAndDropOperation != null) { - if (DragImage != null) { - DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight); - DragImageX = Mouse.X - DragImageWidth / 2; - DragImageY = Mouse.Y - DragImageHeight / 2; - ctx.Save (); - ctx.ResetClip (); - ctx.SetSourceSurface (DragImage, DragImageX, DragImageY); - ctx.PaintWithAlpha (0.8); - ctx.Restore (); - DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight); - IsDirty = true; - //Console.WriteLine ("dragimage drawn: {0},{1}", DragImageX, DragImageY); - } - } - - #if DEBUG_CLIP_RECTANGLE - clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5)); - #endif - lock (RenderMutex) { -// Array.Copy (bmp, dirtyBmp, bmp.Length); - - if (IsDirty) - DirtyRect += clipping.Extents; - else - DirtyRect = clipping.Extents; + DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight); IsDirty = true; - - DirtyRect.Left = Math.Max (0, DirtyRect.Left); - DirtyRect.Top = Math.Max (0, DirtyRect.Top); - DirtyRect.Width = Math.Min (ClientRectangle.Width - DirtyRect.Left, DirtyRect.Width); - DirtyRect.Height = Math.Min (ClientRectangle.Height - DirtyRect.Top, DirtyRect.Height); - DirtyRect.Width = Math.Max (0, DirtyRect.Width); - DirtyRect.Height = Math.Max (0, DirtyRect.Height); - - if (DirtyRect.Width > 0 && DirtyRect.Height >0) { - dirtyBmp = new byte[4 * DirtyRect.Width * DirtyRect.Height]; - for (int y = 0; y < DirtyRect.Height; y++) { - Array.Copy (bmp, - ((DirtyRect.Top + y) * ClientRectangle.Width * 4) + DirtyRect.Left * 4, - dirtyBmp, y * DirtyRect.Width * 4, DirtyRect.Width * 4); - } - - } else - IsDirty = false; + //Console.WriteLine ("dragimage drawn: {0},{1}", DragImageX, DragImageY); } - clipping.Dispose (); - clipping = new Region (); } + + #if DEBUG_CLIP_RECTANGLE + ctx.LineWidth = 1; + ctx.SetSourceColor(Color.Magenta.AdjustAlpha (0.5)); + for (int i = 0; i < clipping.NumRectangles; i++) + ctx.Rectangle(clipping.GetRectangle(i)); + ctx.Stroke (); + #endif + + clipping.Dispose (); + clipping = new Region (); + //} //surf.WriteToPng (@"/mnt/data/test.png"); + + backend?.Flush (); } } + /*#if DEBUG_LOG + DebugLog.AddEvent (DbgEvtType.IFaceEndDrawing); + #endif*/ #if MEASURE_TIME drawingMeasure.StopCycle(); #endif @@ -728,7 +874,7 @@ namespace Crow #region GraphicTree handling /// <summary>Add widget to the Graphic tree of this interface and register it for layouting</summary> - public void AddWidget(GraphicObject g) + public GraphicObject AddWidget(GraphicObject g) { g.Parent = this; int ptr = 0; @@ -736,10 +882,11 @@ namespace Crow if (newW != null) { while (ptr < GraphicTree.Count) { Window w = GraphicTree [ptr] as Window; - if (w != null) { - if (newW.AlwaysOnTop || !w.AlwaysOnTop) - break; - } + if (w == null) + break; + if (newW.AlwaysOnTop || !w.AlwaysOnTop) + break; + ptr++; } } @@ -749,6 +896,8 @@ namespace Crow g.RegisteredLayoutings = LayoutingType.None; g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren); + + return g; } /// <summary>Set visible state of widget to false and delete if from the graphic tree</summary> public void DeleteWidget(GraphicObject g) @@ -837,13 +986,17 @@ namespace Crow /// when window resize event occurs. /// </summary> /// <param name="bounds">bounding box of the interface</param> - public void ProcessResize(Rectangle bounds){ + public virtual void ProcessResize(Rectangle bounds){ lock (UpdateMutex) { clientRectangle = bounds; - int stride = 4 * ClientRectangle.Width; - int bmpSize = Math.Abs (stride) * ClientRectangle.Height; - bmp = new byte[bmpSize]; - dirtyBmp = new byte[bmpSize]; + + /*surf.Dispose (); + surf = new Cairo.XlibSurface (xHandle, xwinHnd, xDefaultVisual, clientRectangle.Width, clientRectangle.Height);*/ + if (surf is XlibSurface) + (surf as XlibSurface).SetSize (clientRectangle.Width, clientRectangle.Height); + else if (surf is XcbSurface) + (surf as XcbSurface).SetSize (clientRectangle.Width, clientRectangle.Height); + foreach (GraphicObject g in GraphicTree) g.RegisterForLayouting (LayoutingType.All); @@ -856,7 +1009,6 @@ namespace Crow XCursor cursor = XCursor.Default; public MouseState Mouse; - public KeyboardState Keyboard; public XCursor MouseCursor { set { @@ -871,10 +1023,10 @@ namespace Crow /// <returns>true if mouse is in the interface</returns> public virtual bool ProcessMouseMove(int x, int y) { - if (armedClickSender != null) { - armedClickSender.onMouseClick (armedClickSender, armedClickEvtArgs); + /*if (armedClickSender != null) { + //armedClickSender.onMouseClick (armedClickSender, armedClickEvtArgs); armedClickSender = null; - } + }*/ int deltaX = x - Mouse.X; int deltaY = y - Mouse.Y; Mouse.X = x; @@ -961,17 +1113,16 @@ namespace Crow /// </summary> /// <returns>return true, if interface handled the event, false otherwise.</returns> /// <param name="button">Button index</param> - public bool ProcessMouseButtonUp(int button) + public bool ProcessMouseButtonUp(Crow.MouseButton button) { - Mouse.DisableBit (button); - MouseButtonEventArgs e = new MouseButtonEventArgs ((Crow.MouseButton)button) { Mouse = Mouse }; + Mouse.DisableBit ((int)button); + MouseButtonEventArgs e = new MouseButtonEventArgs (button) { Mouse = Mouse }; if (_activeWidget == null) return false; if (mouseRepeatThread != null) { mouseRepeatOn = false; - mouseRepeatThread.Abort(); - mouseRepeatThread.Join (); + mouseRepeatThread.Cancel(); } if (!mouseRepeatTriggeredAtLeastOnce) { if (_activeWidget.MouseIsIn (e.Position)) @@ -992,15 +1143,23 @@ namespace Crow /// </summary> /// <returns>return true, if interface handled the event, false otherwise.</returns> /// <param name="button">Button index</param> - public bool ProcessMouseButtonDown(int button) + public bool ProcessMouseButtonDown(Crow.MouseButton button) { - Mouse.EnableBit (button); - MouseButtonEventArgs e = new MouseButtonEventArgs ((Crow.MouseButton)button) { Mouse = Mouse }; + Mouse.EnableBit ((int)button); + MouseButtonEventArgs e = new MouseButtonEventArgs (button) { Mouse = Mouse }; if (HoverWidget == null) return false; - if (HoverWidget == armedClickSender) { + GraphicObject hoverFocused = HoverWidget; + while (!hoverFocused.Focusable) { + hoverFocused = hoverFocused.focusParent; + if (hoverFocused == null) { + hoverFocused = HoverWidget; + break; + } + } + if (hoverFocused == armedClickSender) { if (clickTimer.ElapsedMilliseconds < Interface.DoubleClick) { armedClickSender.onMouseDoubleClick (armedClickSender, e); armedClickSender = null; @@ -1016,10 +1175,12 @@ namespace Crow if (FocusedWidget == null) return true; + + ActiveWidget = FocusedWidget; + if (!FocusedWidget.MouseRepeat) return true; - mouseRepeatThread = new Thread (mouseRepeatThreadFunc); - mouseRepeatThread.IsBackground = true; + mouseRepeatThread = new CrowThread (FocusedWidget, mouseRepeatThreadFunc); mouseRepeatThread.Start (); return true; } @@ -1038,56 +1199,9 @@ namespace Crow HoverWidget.onMouseWheel (this, e); return true; } - /// <summary> - /// Forward key down event from the host to the crow interface - /// </summary> - /// <returns>return true, if interface handled the event, false otherwise.</returns> - /// <param name="button">Button index</param> - public bool ProcessKeyDown(int Key){ - Keyboard.SetKeyState((Crow.Key)Key,true); - if (_focusedWidget == null) - return false; - KeyboardKeyEventArgs e = lastKeyDownEvt = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); - lastKeyDownEvt.IsRepeat = true; - _focusedWidget.onKeyDown (this, e); - -// keyboardRepeatThread = new Thread (keyboardRepeatThreadFunc); -// keyboardRepeatThread.IsBackground = true; -// keyboardRepeatThread.Start (); - - return true; - } - /// <summary> - /// Forward key up event from the host to the crow interface - /// </summary> - /// <returns>return true, if interface handled the event, false otherwise.</returns> - /// <param name="button">Button index</param> - public bool ProcessKeyUp(int Key){ - Keyboard.SetKeyState((Crow.Key)Key,false); - if (_focusedWidget == null) - return false; - KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); - - _focusedWidget.onKeyUp (this, e); -// if (keyboardRepeatThread != null) { -// keyboardRepeatOn = false; -// keyboardRepeatThread.Abort(); -// keyboardRepeatThread.Join (); -// } - return true; - } - /// <summary> - /// Forward a translated key press event from the host to the crow interface - /// </summary> - /// <returns>return true, if interface handled the event, false otherwise.</returns> - /// <param name="button">Button index</param> - public bool ProcessKeyPress(char Key){ - if (_focusedWidget == null) - return false; - KeyPressEventArgs e = new KeyPressEventArgs(Key); - _focusedWidget.onKeyPress (this, e); - return true; + public bool IsKeyDown (Key key) { + return false; } #endregion @@ -1180,14 +1294,14 @@ namespace Crow #region Device Repeat Events volatile bool mouseRepeatOn, keyboardRepeatOn, mouseRepeatTriggeredAtLeastOnce = false; volatile int mouseRepeatCount, keyboardRepeatCount; - Thread mouseRepeatThread, keyboardRepeatThread; - KeyboardKeyEventArgs lastKeyDownEvt; + CrowThread mouseRepeatThread, keyboardRepeatThread; + KeyEventArgs lastKeyDownEvt; void mouseRepeatThreadFunc() { mouseRepeatOn = true; mouseRepeatTriggeredAtLeastOnce = false; Thread.Sleep (Interface.DeviceRepeatDelay); - while (mouseRepeatOn) { + while (mouseRepeatOn&!mouseRepeatThread.cancelRequested) { mouseRepeatCount++; Thread.Sleep (Interface.DeviceRepeatInterval); } @@ -1246,10 +1360,11 @@ namespace Crow #endregion #if MEASURE_TIME - public PerformanceMeasure clippingMeasure = new PerformanceMeasure("Clipping", 100); - public PerformanceMeasure layoutingMeasure = new PerformanceMeasure("Layouting", 100); - public PerformanceMeasure updateMeasure = new PerformanceMeasure("Update", 100); - public PerformanceMeasure drawingMeasure = new PerformanceMeasure("Drawing", 100); + public PerformanceMeasure clippingMeasure = new PerformanceMeasure("Clipping", 1); + public PerformanceMeasure layoutingMeasure = new PerformanceMeasure("Layouting", 1); + public PerformanceMeasure updateMeasure = new PerformanceMeasure("Update", 1); + public PerformanceMeasure drawingMeasure = new PerformanceMeasure("Drawing", 1); + public List<PerformanceMeasure> PerfMeasures = new List<PerformanceMeasure>(); #endif #if DEBUG_LAYOUTING public List<LQIList> LQIsTries = new List<LQIList>(); diff --git a/src/ItemTemplate.cs b/Crow/src/ItemTemplate.cs index dda9d152..fc893718 100644 --- a/src/ItemTemplate.cs +++ b/Crow/src/ItemTemplate.cs @@ -222,7 +222,7 @@ namespace Crow //dynamically and fetch il.Emit (OpCodes.Ldstr, fetchMethodName); - il.Emit (OpCodes.Callvirt, CompilerServices.miGetDataTypeAndFetch); + il.Emit (OpCodes.Call, CompilerServices.miGetDataTypeAndFetch); }else emitGetSubData(il, dataType); } @@ -259,7 +259,7 @@ namespace Crow //dynamically and fetch il.Emit (OpCodes.Ldstr, fetchMethodName); - il.Emit (OpCodes.Callvirt, CompilerServices.miGetDataTypeAndFetch); + il.Emit (OpCodes.Call, CompilerServices.miGetDataTypeAndFetch); }else emitGetSubData(il, dataType); } diff --git a/src/LayoutingEventArgs.cs b/Crow/src/LayoutingEventArgs.cs index 9254aec4..9254aec4 100644 --- a/src/LayoutingEventArgs.cs +++ b/Crow/src/LayoutingEventArgs.cs diff --git a/src/LayoutingQueueItem.cs b/Crow/src/LayoutingQueueItem.cs index 7efdf1bc..a905f25d 100644 --- a/src/LayoutingQueueItem.cs +++ b/Crow/src/LayoutingQueueItem.cs @@ -57,8 +57,16 @@ namespace Crow /// <summary> Unsuccessfull UpdateLayout and requeueing count </summary> public int LayoutingTries, DiscardCount; - #if DEBUG_LAYOUTING - public Stopwatch LQITime; + #if DEBUG_LOG + public enum Result : byte { + Unknown, + Register, + Success, + Requeued, + Discarded, + Deleted, + } + public Result result; public GraphicObject graphicObject { get { return Layoutable as GraphicObject; } } @@ -85,11 +93,11 @@ namespace Crow Layoutable.RegisteredLayoutings |= LayoutType; LayoutingTries = 0; DiscardCount = 0; - #if DEBUG_LAYOUTING - LQITime = new Stopwatch(); + #if DEBUG_LOG Slot = Rectangle.Empty; NewSlot = Rectangle.Empty; - Debug.WriteLine ("\tRegister => " + this.ToString ()); + result = Result.Register; + DebugLog.AddEvent (DbgEvtType.GORegisterLayouting, this); #endif } #endregion @@ -108,44 +116,46 @@ namespace Crow if (go.Parent == null) {//TODO:improve this //cancel layouting for object without parent, maybe some were in queue when //removed from a listbox - #if DEBUG_UPDATE || DEBUG_LAYOUTING - Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ()); + #if DEBUG_LOG + DebugLog.AddEvent (DbgEvtType.GOProcessLayoutingWithNoParent, this); #endif go.parentRWLock.ExitReadLock (); return; } - #if DEBUG_LAYOUTING - LQITime.Start(); - Debug.WriteLine ("=> " + this.ToString ()); + #if DEBUG_LOG + DbgEvent dbgEvt = DebugLog.AddEvent (DbgEvtType.GOProcessLayouting, this); #endif LayoutingTries++; if (!Layoutable.UpdateLayout (LayoutType)) { - #if DEBUG_LAYOUTING - Debug.WriteLine ("\t\tRequeued"); + #if DEBUG_LOG + dbgEvt.end = DebugLog.chrono.ElapsedTicks; #endif if (LayoutingTries < Interface.MaxLayoutingTries) { Layoutable.RegisteredLayoutings |= LayoutType; (Layoutable as GraphicObject).IFace.LayoutingQueue.Enqueue (this); + #if DEBUG_LOG + result = Result.Requeued; + #endif } else if (DiscardCount < Interface.MaxDiscardCount) { - #if DEBUG_LAYOUTING - Debug.WriteLine ("\t\tDiscarded"); + #if DEBUG_LOG + result = Result.Discarded; #endif LayoutingTries = 0; DiscardCount++; Layoutable.RegisteredLayoutings |= LayoutType; (Layoutable as GraphicObject).IFace.DiscardQueue.Enqueue (this); } -// #if DEBUG_LAYOUTING - else - Debug.WriteLine ("\tDELETED => " + this.ToString ()); -// #endif + #if DEBUG_LOG + else { + result = Result.Deleted; + } + #endif } + #if DEBUG_LOG else{ - if (LayoutingTries > 2 || DiscardCount > 0) - Debug.WriteLine (this.ToString ()); + result = Result.Success; } - #if DEBUG_LAYOUTING - LQITime.Stop(); + dbgEvt.data = this; #endif go.parentRWLock.ExitReadLock (); } @@ -161,8 +171,8 @@ namespace Crow public override string ToString () { #if DEBUG_LAYOUTING - return string.Format ("{2};{3};{4} {1}->{0}", LayoutType,Layoutable.ToString(), - LayoutingTries,DiscardCount,LQITime.ElapsedTicks); + return string.Format ("{2};{3} {1}->{0}", LayoutType,Layoutable.ToString(), + LayoutingTries,DiscardCount); #else return string.Format ("{2};{3} {1}->{0}", LayoutType,Layoutable.ToString(), LayoutingTries, DiscardCount); diff --git a/src/Measure.cs b/Crow/src/Measure.cs index 0374f5d9..c40c6703 100644 --- a/src/Measure.cs +++ b/Crow/src/Measure.cs @@ -31,7 +31,7 @@ namespace Crow /// <summary> /// Measurement unit /// </summary> - public enum Unit { Pixel, Percent, Inherit } + public enum Unit {Undefined, Pixel, Percent, Inherit } /// <summary> /// Measure class allow proportional sizes as well as stretched and fit on content. /// </summary> @@ -114,7 +114,7 @@ namespace Crow public static Measure Parse(string s){ if (string.IsNullOrEmpty (s)) - return Measure.Stretched; + return default(Measure); string st = s.Trim (); int tmp = 0; diff --git a/src/Mono.Cairo/Antialias.cs b/Crow/src/Mono.Cairo/Antialias.cs index 9ea64f75..30c71c0f 100644 --- a/src/Mono.Cairo/Antialias.cs +++ b/Crow/src/Mono.Cairo/Antialias.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Antialias.cs // // Authors: @@ -32,12 +32,12 @@ using System; namespace Cairo { - [Serializable] + public enum Antialias { Default, None, - Gray, + Grey, Subpixel, } } diff --git a/src/Mono.Cairo/Cairo.cs b/Crow/src/Mono.Cairo/Cairo.cs index c0a5f2ab..c0a5f2ab 100644 --- a/src/Mono.Cairo/Cairo.cs +++ b/Crow/src/Mono.Cairo/Cairo.cs diff --git a/src/Mono.Cairo/CairoDebug.cs b/Crow/src/Mono.Cairo/CairoDebug.cs index d694bbb5..d694bbb5 100644 --- a/src/Mono.Cairo/CairoDebug.cs +++ b/Crow/src/Mono.Cairo/CairoDebug.cs diff --git a/src/Mono.Cairo/Content.cs b/Crow/src/Mono.Cairo/Content.cs index a88d35a9..a45370ff 100644 --- a/src/Mono.Cairo/Content.cs +++ b/Crow/src/Mono.Cairo/Content.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Content.cs // // Authors: @@ -33,7 +33,7 @@ using System; namespace Cairo { //[Flags] - [Serializable] + public enum Content { Color = 0x1000, diff --git a/src/Mono.Cairo/Context.cs b/Crow/src/Mono.Cairo/Context.cs index 264774dd..d428b42c 100644 --- a/src/Mono.Cairo/Context.cs +++ b/Crow/src/Mono.Cairo/Context.cs @@ -37,9 +37,9 @@ using System; using System.Runtime.InteropServices; using System.Text; -using Cairo; +using Color = Crow.Color; -namespace Cairo { +namespace Cairo { [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")] public class Graphics : Context { @@ -67,7 +67,9 @@ namespace Cairo { // int ptr_size = Marshal.SizeOf (typeof (IntPtr)); - PlatformID platform = Environment.OSVersion.Platform; + /*PlatformID platform = Environment.OSVersion.Platform; + RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + RuntimeInformation.OSArchitecture.HasFlag(Architecture.); if (platform == PlatformID.Win32NT || platform == PlatformID.Win32S || platform == PlatformID.Win32Windows || @@ -75,10 +77,10 @@ namespace Cairo { ptr_size == 4){ c_compiler_long_size = 4; native_glyph_size = Marshal.SizeOf (typeof (NativeGlyph_4byte_longs)); - } else { + } else {*/ c_compiler_long_size = 8; native_glyph_size = Marshal.SizeOf (typeof (Glyph)); - } + //} } public Context (Surface surface) : this (NativeMethods.cairo_create (surface.Handle), true) @@ -161,20 +163,6 @@ namespace Cairo { } } - [Obsolete ("Use SetSourceColor method")] - public Color Color { - set { - SetSourceColor (value); - } - } - - [Obsolete ("Use SetSourceRGBA method")] - public Cairo.Color ColorRgb { - set { - Color = new Color (value.R, value.G, value.B); - } - } - public double Tolerance { get { return NativeMethods.cairo_get_tolerance (handle); @@ -870,13 +858,9 @@ namespace Cairo { public void ShowText(string str) { - NativeMethods.cairo_show_text (handle, TerminateUtf8(str)); + NativeMethods.cairo_show_text (handle, str); } - public void ShowText(byte[] utf8) - { - NativeMethods.cairo_show_text (handle, TerminateUtf8(utf8)); - } public void TextPath(string str) { @@ -891,16 +875,10 @@ namespace Cairo { public TextExtents TextExtents(string s) { TextExtents extents; - NativeMethods.cairo_text_extents (handle, TerminateUtf8(s), out extents); + NativeMethods.cairo_text_extents (handle, s, out extents); return extents; } - public TextExtents TextExtents(byte[] utf8) - { - TextExtents extents; - NativeMethods.cairo_text_extents (handle, TerminateUtf8(utf8), out extents); - return extents; - } public TextExtents GlyphExtents (Glyph[] glyphs) { diff --git a/src/Mono.Cairo/DRMDevice.cs b/Crow/src/Mono.Cairo/DRMDevice.cs index a03195fb..a03195fb 100644 --- a/src/Mono.Cairo/DRMDevice.cs +++ b/Crow/src/Mono.Cairo/DRMDevice.cs diff --git a/src/Mono.Cairo/DRMSurface.cs b/Crow/src/Mono.Cairo/DRMSurface.cs index 248541c7..248541c7 100644 --- a/src/Mono.Cairo/DRMSurface.cs +++ b/Crow/src/Mono.Cairo/DRMSurface.cs diff --git a/src/Mono.Cairo/Device.cs b/Crow/src/Mono.Cairo/Device.cs index 06715bc9..a5452f9d 100644 --- a/src/Mono.Cairo/Device.cs +++ b/Crow/src/Mono.Cairo/Device.cs @@ -64,7 +64,7 @@ namespace Cairo } public string Status { get { - return System.Runtime.InteropServices.Marshal.PtrToStringAuto(NativeMethods.cairo_status_to_string (NativeMethods.cairo_device_status (handle))); + return ""; //System.Runtime.InteropServices.Marshal.PtrToStringAuto(NativeMethods.cairo_status_to_string (NativeMethods.cairo_device_status (handle))); } } public void SetThreadAware (bool value){ diff --git a/src/Mono.Cairo/DirectFBSurface.cs b/Crow/src/Mono.Cairo/DirectFBSurface.cs index afa57b7d..afa57b7d 100644 --- a/src/Mono.Cairo/DirectFBSurface.cs +++ b/Crow/src/Mono.Cairo/DirectFBSurface.cs diff --git a/src/Mono.Cairo/Distance.cs b/Crow/src/Mono.Cairo/Distance.cs index 7cba3729..7cba3729 100644 --- a/src/Mono.Cairo/Distance.cs +++ b/Crow/src/Mono.Cairo/Distance.cs diff --git a/src/Mono.Cairo/EGLDevice.cs b/Crow/src/Mono.Cairo/EGLDevice.cs index 45c988a3..45c988a3 100644 --- a/src/Mono.Cairo/EGLDevice.cs +++ b/Crow/src/Mono.Cairo/EGLDevice.cs diff --git a/src/Mono.Cairo/Extend.cs b/Crow/src/Mono.Cairo/Extend.cs index 0ffee3fb..1135c2ff 100644 --- a/src/Mono.Cairo/Extend.cs +++ b/Crow/src/Mono.Cairo/Extend.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Extend.cs // // Authors: @@ -34,7 +34,7 @@ using System; namespace Cairo { - [Serializable] + public enum Extend { None, diff --git a/src/Mono.Cairo/FillRule.cs b/Crow/src/Mono.Cairo/FillRule.cs index 6d8c0626..24cbfba2 100644 --- a/src/Mono.Cairo/FillRule.cs +++ b/Crow/src/Mono.Cairo/FillRule.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.FillRule.cs // // Authors: @@ -32,7 +32,7 @@ using System; namespace Cairo { - [Serializable] + public enum FillRule { Winding, diff --git a/src/Mono.Cairo/Filter.cs b/Crow/src/Mono.Cairo/Filter.cs index d602ed7d..2355fbb3 100644 --- a/src/Mono.Cairo/Filter.cs +++ b/Crow/src/Mono.Cairo/Filter.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Filter.cs // // Authors: @@ -32,7 +32,7 @@ using System; namespace Cairo { - [Serializable] + public enum Filter { Fast, diff --git a/src/Mono.Cairo/FontExtents.cs b/Crow/src/Mono.Cairo/FontExtents.cs index 76c7e658..76c7e658 100644 --- a/src/Mono.Cairo/FontExtents.cs +++ b/Crow/src/Mono.Cairo/FontExtents.cs diff --git a/src/Mono.Cairo/FontFace.cs b/Crow/src/Mono.Cairo/FontFace.cs index 19d8163c..19d8163c 100644 --- a/src/Mono.Cairo/FontFace.cs +++ b/Crow/src/Mono.Cairo/FontFace.cs diff --git a/src/Mono.Cairo/FontOptions.cs b/Crow/src/Mono.Cairo/FontOptions.cs index 5269d54d..5269d54d 100644 --- a/src/Mono.Cairo/FontOptions.cs +++ b/Crow/src/Mono.Cairo/FontOptions.cs diff --git a/src/Mono.Cairo/FontSlant.cs b/Crow/src/Mono.Cairo/FontSlant.cs index c4e1af78..b7a5684c 100644 --- a/src/Mono.Cairo/FontSlant.cs +++ b/Crow/src/Mono.Cairo/FontSlant.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.FontSlant.cs // // Authors: @@ -32,7 +32,7 @@ using System; namespace Cairo { - [Serializable] + public enum FontSlant { Normal, diff --git a/src/Mono.Cairo/FontType.cs b/Crow/src/Mono.Cairo/FontType.cs index 0c71fcb2..e9fd263a 100644 --- a/src/Mono.Cairo/FontType.cs +++ b/Crow/src/Mono.Cairo/FontType.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.FontType.cs // // Authors: @@ -30,7 +30,7 @@ using System; namespace Cairo { - [Serializable] + public enum FontType { Toy, diff --git a/src/Mono.Cairo/FontWeight.cs b/Crow/src/Mono.Cairo/FontWeight.cs index 9d1927d8..5b781095 100644 --- a/src/Mono.Cairo/FontWeight.cs +++ b/Crow/src/Mono.Cairo/FontWeight.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.FontWeight.cs // // Authors: @@ -32,7 +32,7 @@ using System; namespace Cairo { - [Serializable] + public enum FontWeight { Normal, diff --git a/src/Mono.Cairo/Format.cs b/Crow/src/Mono.Cairo/Format.cs index f0bded3c..96e9a0f5 100644 --- a/src/Mono.Cairo/Format.cs +++ b/Crow/src/Mono.Cairo/Format.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Format.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -31,7 +31,7 @@ using System; namespace Cairo { - [Serializable] + public enum Format { Argb32 = 0, diff --git a/src/Mono.Cairo/GLSurface.cs b/Crow/src/Mono.Cairo/GLSurface.cs index 9486c9cd..9486c9cd 100644 --- a/src/Mono.Cairo/GLSurface.cs +++ b/Crow/src/Mono.Cairo/GLSurface.cs diff --git a/src/Mono.Cairo/GLXDevice.cs b/Crow/src/Mono.Cairo/GLXDevice.cs index 189872a2..189872a2 100644 --- a/src/Mono.Cairo/GLXDevice.cs +++ b/Crow/src/Mono.Cairo/GLXDevice.cs diff --git a/src/Mono.Cairo/GlitzSurface.cs b/Crow/src/Mono.Cairo/GlitzSurface.cs index 6da1ac6a..6da1ac6a 100644 --- a/src/Mono.Cairo/GlitzSurface.cs +++ b/Crow/src/Mono.Cairo/GlitzSurface.cs diff --git a/src/Mono.Cairo/Glyph.cs b/Crow/src/Mono.Cairo/Glyph.cs index ec9c2ff3..ec9c2ff3 100644 --- a/src/Mono.Cairo/Glyph.cs +++ b/Crow/src/Mono.Cairo/Glyph.cs diff --git a/src/Mono.Cairo/Gradient.cs b/Crow/src/Mono.Cairo/Gradient.cs index 0fb617e4..c7bc53c6 100644 --- a/src/Mono.Cairo/Gradient.cs +++ b/Crow/src/Mono.Cairo/Gradient.cs @@ -28,7 +28,7 @@ // using System; - +using Color = Crow.Color; namespace Cairo { public class Gradient : Pattern diff --git a/src/Mono.Cairo/HintMetrics.cs b/Crow/src/Mono.Cairo/HintMetrics.cs index d4341424..3bf01d23 100644 --- a/src/Mono.Cairo/HintMetrics.cs +++ b/Crow/src/Mono.Cairo/HintMetrics.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.HintMetrics.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -31,7 +31,7 @@ using System; namespace Cairo { - [Serializable] + public enum HintMetrics { Default, diff --git a/src/Mono.Cairo/HintStyle.cs b/Crow/src/Mono.Cairo/HintStyle.cs index bb848206..b8cca974 100644 --- a/src/Mono.Cairo/HintStyle.cs +++ b/Crow/src/Mono.Cairo/HintStyle.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.HintStyle.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -31,7 +31,7 @@ using System; namespace Cairo { - [Serializable] + public enum HintStyle { Default, diff --git a/src/Mono.Cairo/ImageSurface.cs b/Crow/src/Mono.Cairo/ImageSurface.cs index 98143fe8..98143fe8 100644 --- a/src/Mono.Cairo/ImageSurface.cs +++ b/Crow/src/Mono.Cairo/ImageSurface.cs diff --git a/src/Mono.Cairo/LineCap.cs b/Crow/src/Mono.Cairo/LineCap.cs index 57cfdec2..46938c25 100644 --- a/src/Mono.Cairo/LineCap.cs +++ b/Crow/src/Mono.Cairo/LineCap.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.LineCap.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -31,7 +31,7 @@ using System; namespace Cairo { - [Serializable] + public enum LineCap { Butt, diff --git a/src/Mono.Cairo/LineJoin.cs b/Crow/src/Mono.Cairo/LineJoin.cs index 439b2a51..b5c241b0 100644 --- a/src/Mono.Cairo/LineJoin.cs +++ b/Crow/src/Mono.Cairo/LineJoin.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.LineJoin.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -31,7 +31,7 @@ using System; namespace Cairo { - [Serializable] + public enum LineJoin { Miter, diff --git a/src/Mono.Cairo/LinearGradient.cs b/Crow/src/Mono.Cairo/LinearGradient.cs index 85fdea84..85fdea84 100644 --- a/src/Mono.Cairo/LinearGradient.cs +++ b/Crow/src/Mono.Cairo/LinearGradient.cs diff --git a/src/Mono.Cairo/Matrix.cs b/Crow/src/Mono.Cairo/Matrix.cs index 83ffce49..12f0cb92 100644 --- a/src/Mono.Cairo/Matrix.cs +++ b/Crow/src/Mono.Cairo/Matrix.cs @@ -37,7 +37,7 @@ using System.Runtime.InteropServices; namespace Cairo { [StructLayout(LayoutKind.Sequential)] - public class Matrix : ICloneable + public class Matrix //: ICloneable { public double Xx; public double Yx; diff --git a/src/Mono.Cairo/MeshPattern.cs b/Crow/src/Mono.Cairo/MeshPattern.cs index b14c709b..b14c709b 100644 --- a/src/Mono.Cairo/MeshPattern.cs +++ b/Crow/src/Mono.Cairo/MeshPattern.cs diff --git a/Crow/src/Mono.Cairo/NativeMethods-internal.cs b/Crow/src/Mono.Cairo/NativeMethods-internal.cs new file mode 100644 index 00000000..6e6d507c --- /dev/null +++ b/Crow/src/Mono.Cairo/NativeMethods-internal.cs @@ -0,0 +1,1026 @@ +// +// Cairo.cs - a simplistic binding of the Cairo API to C#. +// +// Authors: Duncan Mak (duncan@ximian.com) +// Hisham Mardam Bey (hisham.mardambey@gmail.com) +// John Luke (john.luke@gmail.com) +// Alp Toker (alp@atoker.com) +// +// (C) Ximian, Inc. 2003 +// Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright (C) 2005 John Luke +// Copyright (C) 2006 Alp Toker +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; + +namespace Cairo +{ + // sort the functions like in the following page so it is easier to find what is missing + // http://cairographics.org/manual/index-all.html + + public static class NativeMethods + { + #if MONOTOUCH + const string cairo = "__Internal"; + #else + const string cairo = "libcairo-2.dll"; + #endif + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern void cairo_append_path (IntPtr cr, Path path); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); + + // [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + // public static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_clip (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_clip_preserve (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_close_path (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_copy_page (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_copy_path (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_copy_path_flat (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_create (IntPtr target); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_debug_reset_static_data (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_destroy (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_fill (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_fill_preserve (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_extents (IntPtr cr, out FontExtents extents); + + #region FontFace + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_face_destroy (IntPtr font_face); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern FontType cairo_font_face_get_type (IntPtr font_face); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern void cairo_font_face_get_user_data (IntPtr font_face); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern void cairo_font_face_set_user_data (IntPtr font_face); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_font_face_reference (IntPtr font_face); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_font_face_status (IntPtr font_face); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern uint cairo_font_face_get_reference_count (IntPtr surface); + #endregion + + #region FontOptions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_font_options_copy (IntPtr original); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_font_options_create (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_destroy (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern bool cairo_font_options_equal (IntPtr options, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Antialias cairo_font_options_get_antialias (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern HintStyle cairo_font_options_get_hint_style (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern long cairo_font_options_hash (IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_merge (IntPtr options, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_font_options_status (IntPtr options); + #endregion + + #region Freetype / FontConfig + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Antialias cairo_get_antialias (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_get_current_point (IntPtr cr, out double x, out double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern FillRule cairo_get_fill_rule (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_get_font_face (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_get_font_options (IntPtr cr, IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_get_group_target (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern LineCap cairo_get_line_cap (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern LineJoin cairo_get_line_join (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern double cairo_get_line_width (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_get_matrix (IntPtr cr, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern double cairo_get_miter_limit (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Operator cairo_get_operator (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern uint cairo_get_reference_count (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_get_source (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_get_target (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern double cairo_get_tolerance (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_glitz_surface_create (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + [return: MarshalAs (UnmanagedType.U1)] + public static extern bool cairo_has_current_point (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_identity_matrix (IntPtr cr); + + #region Image Surface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height); + + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + public static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_image_surface_create_from_png (string filename); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern IntPtr cairo_image_surface_create_from_png_stream (string filename); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_image_surface_get_data (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Format cairo_image_surface_get_format (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_image_surface_get_height (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_image_surface_get_stride (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_image_surface_get_width (IntPtr surface); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + [return: MarshalAs (UnmanagedType.U1)] + public static extern bool cairo_in_clip (IntPtr cr, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + [return: MarshalAs (UnmanagedType.U1)] + public static extern bool cairo_in_fill (IntPtr cr, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + [return: MarshalAs (UnmanagedType.U1)] + public static extern bool cairo_in_stroke (IntPtr cr, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_line_to (IntPtr cr, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_mask (IntPtr cr, IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y); + + #region Matrix + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_init_identity (Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_init_rotate (Matrix matrix, double radians); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_matrix_invert (Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_rotate (Matrix matrix, double radians); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_move_to (IntPtr cr, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_new_path (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_new_sub_path (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_paint (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_paint_with_alpha (IntPtr cr, double alpha); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_path_destroy (IntPtr path); + + #region Pattern + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count); + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_destroy (IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Extend cairo_pattern_get_extend (IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Filter cairo_pattern_get_filter (IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern PatternType cairo_pattern_get_type (IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pattern_reference (IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_pattern_status (IntPtr pattern); + #endregion + + #region PdfSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y); + #endregion + + #region PostscriptSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_ps_surface_create (string filename, double width, double height); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height); + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_pop_group (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_pop_group_to_source (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_push_group (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_push_group_with_content (IntPtr cr, Content content); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_reference (IntPtr cr); + + #region Regions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern bool cairo_region_contains_point (IntPtr region, int x, int y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_region_copy (IntPtr original); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_region_create (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_region_destroy (IntPtr region); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern bool cairo_region_equal (IntPtr a, IntPtr b); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_intersect (IntPtr dst, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern bool cairo_region_is_empty (IntPtr region); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_region_num_rectangles (IntPtr region); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_region_reference (IntPtr region); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_status (IntPtr region); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_subtract (IntPtr dst, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_region_translate (IntPtr region, int dx, int dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_union (IntPtr dst, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_xor (IntPtr dst, IntPtr other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_reset_clip (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_restore (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rotate (IntPtr cr, double angle); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_save (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_scale (IntPtr cr, double sx, double sy); + + #region ScaledFont + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_scaled_font_status (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_get_scaled_font (IntPtr cr); + + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_antialias (IntPtr cr, Antialias antialias); + + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_get_dash_count (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace); + + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_font_options (IntPtr cr, IntPtr options); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_font_size (IntPtr cr, double size); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_line_width (IntPtr cr, double width); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_matrix (IntPtr cr, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_miter_limit (IntPtr cr, double limit); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_source (IntPtr cr, IntPtr pattern); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_set_tolerance (IntPtr cr, double tolerance); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_show_page (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_show_text (IntPtr cr, string str); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_status (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_status_to_string (Status status); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_stroke (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_stroke_preserve (IntPtr cr); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr); + + #region Surface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_destroy (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_finish (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_flush (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Content cairo_surface_get_content (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern uint cairo_surface_get_reference_count (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern SurfaceType cairo_surface_get_type (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_mark_dirty (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_surface_reference (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_surface_status (IntPtr surface); + #endregion + + #region SVG surface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_surface_write_to_png (IntPtr surface, string filename); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height); + + //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + //public static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_text_extents (IntPtr cr, string txt, out TextExtents extents); + + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_text_path (IntPtr ct, byte[] utf8); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_transform (IntPtr cr, Matrix matrix); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_translate (IntPtr cr, double tx, double ty); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_version (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_version_string (); + + #region DirectFBSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface); + #endregion + + #region win32 fonts + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc); + #endregion + + #region win32 surface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_win32_surface_create (IntPtr hdc); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height); + #endregion + + #region XcbSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height); + #endregion + + #region XlibSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_xlib_surface_get_depth (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_xlib_surface_get_height (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_xlib_surface_get_width (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height); + #endregion + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value); + + #region GLSurface + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_gl_surface_get_width (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_gl_surface_get_height (IntPtr surface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_gl_surface_swapbuffers (IntPtr surf); + #endregion + + #region GLX Functions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_glx_device_get_display (IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_glx_device_get_context (IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height); + #endregion + + #region WGL Fucntions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_wgl_device_create (IntPtr hglrc); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_wgl_device_get_context (IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height); + #endregion + + #region EGL Functions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height); + #endregion + + #region DRM Functions + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_device_get (IntPtr udev_device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_device_get_for_fd (int fd); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_device_default (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_drm_device_get_fd (IntPtr cairo_device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_drm_device_throttle (IntPtr cairo_device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format, int width, int height); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format, int width, int height, int stride); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Format cairo_drm_surface_get_format (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_drm_surface_get_width (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_drm_surface_get_height (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern int cairo_drm_surface_get_stride (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_drm_surface_unmap (IntPtr drmSurface, IntPtr imageSurface); + #endregion + + #region Device + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_device_acquire(IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_device_destroy (IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern IntPtr cairo_device_reference (IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void cairo_device_release(IntPtr device); + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern Status cairo_device_status(IntPtr device); + #endregion + + + + [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] + public static extern void crow_cairo_region_clear(IntPtr ctx, IntPtr reg); + + } +}
\ No newline at end of file diff --git a/src/Mono.Cairo/NativeMethods.cs b/Crow/src/Mono.Cairo/NativeMethods.cs index 53501369..8ed90290 100644 --- a/src/Mono.Cairo/NativeMethods.cs +++ b/Crow/src/Mono.Cairo/NativeMethods.cs @@ -44,13 +44,13 @@ namespace Cairo #if MONOTOUCH const string cairo = "__Internal"; #else - const string cairo = "libcairo-2.dll"; + const string cairo = "cairo"; #endif - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern void cairo_append_path (IntPtr cr, Path path); + //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + //internal static extern void cairo_append_path (IntPtr cr, Path path); - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] + [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] @@ -752,7 +752,7 @@ namespace Cairo internal static extern void cairo_show_page (IntPtr cr); [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_show_text (IntPtr cr, byte[] utf8); + internal static extern void cairo_show_text (IntPtr cr, string text); [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] internal static extern Status cairo_status (IntPtr cr); @@ -840,7 +840,7 @@ namespace Cairo #endregion [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_text_extents (IntPtr cr, byte[] utf8, out TextExtents extents); + internal static extern void cairo_text_extents (IntPtr cr, string text, out TextExtents extents); [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] internal static extern void cairo_text_path (IntPtr ct, byte[] utf8); diff --git a/src/Mono.Cairo/Operator.cs b/Crow/src/Mono.Cairo/Operator.cs index c1ced71d..f233a25f 100644 --- a/src/Mono.Cairo/Operator.cs +++ b/Crow/src/Mono.Cairo/Operator.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Operator.cs // // Authors: Duncan Mak (duncan@ximian.com) @@ -33,7 +33,7 @@ using System; namespace Cairo { - [Serializable] + public enum Operator { Clear, @@ -52,5 +52,11 @@ namespace Cairo Xor, Add, Saturate, + Multiply, + Screen, + Overlay, + Darken, + Lighten, + } } diff --git a/src/Mono.Cairo/PSSurface.cs b/Crow/src/Mono.Cairo/PSSurface.cs index 9d6b73be..9d6b73be 100644 --- a/src/Mono.Cairo/PSSurface.cs +++ b/Crow/src/Mono.Cairo/PSSurface.cs diff --git a/src/Mono.Cairo/Path.cs b/Crow/src/Mono.Cairo/Path.cs index 184c606c..184c606c 100644 --- a/src/Mono.Cairo/Path.cs +++ b/Crow/src/Mono.Cairo/Path.cs diff --git a/src/Mono.Cairo/Pattern.cs b/Crow/src/Mono.Cairo/Pattern.cs index bc0a962a..bc0a962a 100644 --- a/src/Mono.Cairo/Pattern.cs +++ b/Crow/src/Mono.Cairo/Pattern.cs diff --git a/src/Mono.Cairo/PatternType.cs b/Crow/src/Mono.Cairo/PatternType.cs index 8fe2d85d..f9b9523a 100644 --- a/src/Mono.Cairo/PatternType.cs +++ b/Crow/src/Mono.Cairo/PatternType.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.PatternType.cs // // Authors: @@ -30,7 +30,7 @@ using System; namespace Cairo { - [Serializable] + public enum PatternType { Solid, diff --git a/src/Mono.Cairo/PdfSurface.cs b/Crow/src/Mono.Cairo/PdfSurface.cs index c980f249..c980f249 100644 --- a/src/Mono.Cairo/PdfSurface.cs +++ b/Crow/src/Mono.Cairo/PdfSurface.cs diff --git a/src/Mono.Cairo/Point.cs b/Crow/src/Mono.Cairo/Point.cs index e72ca6c5..e72ca6c5 100644 --- a/src/Mono.Cairo/Point.cs +++ b/Crow/src/Mono.Cairo/Point.cs diff --git a/src/Mono.Cairo/PointD.cs b/Crow/src/Mono.Cairo/PointD.cs index c2e3587d..c2e3587d 100644 --- a/src/Mono.Cairo/PointD.cs +++ b/Crow/src/Mono.Cairo/PointD.cs diff --git a/src/Mono.Cairo/RadialGradient.cs b/Crow/src/Mono.Cairo/RadialGradient.cs index 6422e00d..6422e00d 100644 --- a/src/Mono.Cairo/RadialGradient.cs +++ b/Crow/src/Mono.Cairo/RadialGradient.cs diff --git a/src/Mono.Cairo/Region.cs b/Crow/src/Mono.Cairo/Region.cs index 4a82842a..4a82842a 100644 --- a/src/Mono.Cairo/Region.cs +++ b/Crow/src/Mono.Cairo/Region.cs diff --git a/src/Mono.Cairo/ScaledFont.cs b/Crow/src/Mono.Cairo/ScaledFont.cs index 93719460..93719460 100644 --- a/src/Mono.Cairo/ScaledFont.cs +++ b/Crow/src/Mono.Cairo/ScaledFont.cs diff --git a/src/Mono.Cairo/SolidPattern.cs b/Crow/src/Mono.Cairo/SolidPattern.cs index 875b3fbf..37864e5b 100644 --- a/src/Mono.Cairo/SolidPattern.cs +++ b/Crow/src/Mono.Cairo/SolidPattern.cs @@ -28,7 +28,7 @@ // using System; - +using Color = Crow.Color; namespace Cairo { public class SolidPattern : Pattern diff --git a/src/Mono.Cairo/Status.cs b/Crow/src/Mono.Cairo/Status.cs index 6e5fbe01..54b2fec3 100644 --- a/src/Mono.Cairo/Status.cs +++ b/Crow/src/Mono.Cairo/Status.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Status.cs // // Authors: @@ -34,7 +34,7 @@ using System; namespace Cairo { - [Serializable] + public enum Status { Success = 0, diff --git a/src/Mono.Cairo/SubpixelOrder.cs b/Crow/src/Mono.Cairo/SubpixelOrder.cs index e8ab6581..3c3a3362 100644 --- a/src/Mono.Cairo/SubpixelOrder.cs +++ b/Crow/src/Mono.Cairo/SubpixelOrder.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Cairo.cs // // Authors: @@ -30,7 +30,7 @@ using System; namespace Cairo { - [Serializable] + public enum SubpixelOrder { Default, diff --git a/src/Mono.Cairo/Surface.cs b/Crow/src/Mono.Cairo/Surface.cs index 6a55496a..14f4a2b1 100644 --- a/src/Mono.Cairo/Surface.cs +++ b/Crow/src/Mono.Cairo/Surface.cs @@ -40,9 +40,6 @@ namespace Cairo { public class Surface : IDisposable { - [Obsolete] - protected static Hashtable surfaces = new Hashtable (); - IntPtr handle = IntPtr.Zero; [Obsolete] @@ -120,7 +117,7 @@ namespace Cairo { IntPtr p = NativeMethods.cairo_surface_create_similar ( this.Handle, content, width, height); - return new Cairo.Surface (p, true); + return Surface.Lookup(p, true); } ~Surface () @@ -152,6 +149,8 @@ namespace Cairo { NativeMethods.cairo_surface_destroy (handle); handle = IntPtr.Zero; } + public virtual void SetSize (int width, int height) { + } public Status Finish () { diff --git a/src/Mono.Cairo/SurfacePattern.cs b/Crow/src/Mono.Cairo/SurfacePattern.cs index 4422b11d..4422b11d 100644 --- a/src/Mono.Cairo/SurfacePattern.cs +++ b/Crow/src/Mono.Cairo/SurfacePattern.cs diff --git a/src/Mono.Cairo/SurfaceType.cs b/Crow/src/Mono.Cairo/SurfaceType.cs index ae86d134..b0b659c6 100644 --- a/src/Mono.Cairo/SurfaceType.cs +++ b/Crow/src/Mono.Cairo/SurfaceType.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.SurfaceType.cs // // Authors: @@ -30,7 +30,7 @@ using System; namespace Cairo { - [Serializable] + public enum SurfaceType { Image, diff --git a/src/Mono.Cairo/SvgSurface.cs b/Crow/src/Mono.Cairo/SvgSurface.cs index 41829501..41829501 100644 --- a/src/Mono.Cairo/SvgSurface.cs +++ b/Crow/src/Mono.Cairo/SvgSurface.cs diff --git a/src/Mono.Cairo/SvgVersion.cs b/Crow/src/Mono.Cairo/SvgVersion.cs index 99cee289..7f0f4620 100644 --- a/src/Mono.Cairo/SvgVersion.cs +++ b/Crow/src/Mono.Cairo/SvgVersion.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.SvgVersion.cs // // Authors: @@ -30,7 +30,7 @@ using System; namespace Cairo { - [Serializable] + public enum SvgVersion { // FIXME: yuck diff --git a/src/Mono.Cairo/TextExtents.cs b/Crow/src/Mono.Cairo/TextExtents.cs index f9cd560f..f9cd560f 100644 --- a/src/Mono.Cairo/TextExtents.cs +++ b/Crow/src/Mono.Cairo/TextExtents.cs diff --git a/src/Mono.Cairo/WGLDevice.cs b/Crow/src/Mono.Cairo/WGLDevice.cs index 03f7e3a4..03f7e3a4 100644 --- a/src/Mono.Cairo/WGLDevice.cs +++ b/Crow/src/Mono.Cairo/WGLDevice.cs diff --git a/src/Mono.Cairo/Win32Surface.cs b/Crow/src/Mono.Cairo/Win32Surface.cs index dd244286..dd244286 100644 --- a/src/Mono.Cairo/Win32Surface.cs +++ b/Crow/src/Mono.Cairo/Win32Surface.cs diff --git a/src/Mono.Cairo/XcbSurface.cs b/Crow/src/Mono.Cairo/XcbSurface.cs index 142ebf9e..340b0fae 100644 --- a/src/Mono.Cairo/XcbSurface.cs +++ b/Crow/src/Mono.Cairo/XcbSurface.cs @@ -45,9 +45,8 @@ namespace Cairo { IntPtr ptr = NativeMethods.cairo_xcb_surface_create_for_bitmap (connection, bitmap, screen, width, height); return new XcbSurface (ptr, true); } - - public void SetSize (int width, int height) - { + public override void SetSize (int width, int height) + { NativeMethods.cairo_xcb_surface_set_size (Handle, width, height); } } diff --git a/src/Mono.Cairo/XlibSurface.cs b/Crow/src/Mono.Cairo/XlibSurface.cs index c0003a49..c0003a49 100644 --- a/src/Mono.Cairo/XlibSurface.cs +++ b/Crow/src/Mono.Cairo/XlibSurface.cs diff --git a/src/MouseCursorChangedEventArgs.cs b/Crow/src/MouseCursorChangedEventArgs.cs index 9c63c11f..9c63c11f 100644 --- a/src/MouseCursorChangedEventArgs.cs +++ b/Crow/src/MouseCursorChangedEventArgs.cs diff --git a/src/ObservableList.cs b/Crow/src/ObservableList.cs index 96bfccc9..96bfccc9 100644 --- a/src/ObservableList.cs +++ b/Crow/src/ObservableList.cs diff --git a/src/ParsingException.cs b/Crow/src/ParsingException.cs index 1b596981..1b596981 100644 --- a/src/ParsingException.cs +++ b/Crow/src/ParsingException.cs diff --git a/src/PerformanceMeasure.cs b/Crow/src/PerformanceMeasure.cs index 3c978e8b..3c978e8b 100644 --- a/src/PerformanceMeasure.cs +++ b/Crow/src/PerformanceMeasure.cs diff --git a/src/Picture.cs b/Crow/src/Picture.cs index 3784780b..f2f45261 100644 --- a/src/Picture.cs +++ b/Crow/src/Picture.cs @@ -96,7 +96,7 @@ namespace Crow /// load the image for rendering from the stream given as argument /// </summary> /// <param name="stream">picture stream</param> - public abstract void Load(Interface iface, string path); + //public abstract void Load(Interface iface, string path); #endregion /// <summary> diff --git a/src/Point.cs b/Crow/src/Point.cs index 6175efc7..08dd4436 100644 --- a/src/Point.cs +++ b/Crow/src/Point.cs @@ -66,14 +66,6 @@ namespace Crow { return new Cairo.PointD(p.X, p.Y); } - public static implicit operator System.Drawing.Point(Point p) - { - return new System.Drawing.Point(p.X, p.Y); - } - public static implicit operator Point(System.Drawing.Point p) - { - return new Point(p.X, p.Y); - } public static implicit operator Point(int i) { return new Point(i, i); diff --git a/src/Rectangle.cs b/Crow/src/Rectangle.cs index 56e4148f..b5934157 100644 --- a/src/Rectangle.cs +++ b/Crow/src/Rectangle.cs @@ -180,14 +180,6 @@ namespace Crow #endregion #region operators - public static implicit operator Rectangle(System.Drawing.Rectangle r) - { - return new Rectangle(r.X, r.Y, r.Width, r.Height); - } - public static implicit operator System.Drawing.Rectangle(Rectangle r) - { - return new System.Drawing.Rectangle(r.X, r.Y, r.Width, r.Height); - } public static Rectangle operator +(Rectangle r1, Rectangle r2) { int x = Math.Min(r1.X, r2.X); diff --git a/src/ReflexionExtensions.cs b/Crow/src/ReflexionExtensions.cs index 8c0b4f27..8c0b4f27 100644 --- a/src/ReflexionExtensions.cs +++ b/Crow/src/ReflexionExtensions.cs diff --git a/src/ScrollingEventArgs.cs b/Crow/src/ScrollingEventArgs.cs index 3ff42065..3ff42065 100644 --- a/src/ScrollingEventArgs.cs +++ b/Crow/src/ScrollingEventArgs.cs diff --git a/src/SelectionChangeEventArgs.cs b/Crow/src/SelectionChangeEventArgs.cs index 988a6975..988a6975 100644 --- a/src/SelectionChangeEventArgs.cs +++ b/Crow/src/SelectionChangeEventArgs.cs diff --git a/src/Size.cs b/Crow/src/Size.cs index 891c1fb5..891c1fb5 100644 --- a/src/Size.cs +++ b/Crow/src/Size.cs diff --git a/src/SolidColor.cs b/Crow/src/SolidColor.cs index d6423d31..d6423d31 100644 --- a/src/SolidColor.cs +++ b/Crow/src/SolidColor.cs diff --git a/src/Style.cs b/Crow/src/Style.cs index 58f09f33..58f09f33 100644 --- a/src/Style.cs +++ b/Crow/src/Style.cs diff --git a/src/StyleReader.cs b/Crow/src/StyleReader.cs index 458b7856..c50083eb 100644 --- a/src/StyleReader.cs +++ b/Crow/src/StyleReader.cs @@ -182,19 +182,5 @@ namespace Crow } } } - -// public override int Read () -// { -// int tmp = base.Read (); -// char c = (char)tmp; -// if (c == '\n') { -// line++; -// column = 1; -// } else if (c == '\t') -// column += Interface.TabSize; -// else if (c != '\r') -// column++; -// return tmp; -// } } } diff --git a/src/SvgPicture.cs b/Crow/src/SvgPicture.cs index f676a497..dee6c8e0 100644 --- a/src/SvgPicture.cs +++ b/Crow/src/SvgPicture.cs @@ -48,19 +48,20 @@ namespace Crow /// </summary> /// <param name="path">image path, may be embedded</param> public SvgPicture (string path) : base(path) - {} + { + Load (); + } #endregion - public override void Load (Interface iface, string path) - { - Path = path; - if (sharedResources.ContainsKey (path)) { - sharedPicture sp = sharedResources [path]; + void Load () + { + if (sharedResources.ContainsKey (Path)) { + sharedPicture sp = sharedResources [Path]; hSVG = (Rsvg.Handle)sp.Data; Dimensions = sp.Dims; return; } - using (Stream stream = iface.GetStreamFromPath (path)) { + using (Stream stream = Interface.StaticGetStreamFromPath (Path)) { using (MemoryStream ms = new MemoryStream ()) { stream.CopyTo (ms); @@ -68,7 +69,7 @@ namespace Crow Dimensions = new Size (hSVG.Dimensions.Width, hSVG.Dimensions.Height); } } - sharedResources [path] = new sharedPicture (hSVG, Dimensions); + sharedResources [Path] = new sharedPicture (hSVG, Dimensions); } public void LoadSvgFragment (string fragment) { diff --git a/src/TextChangeEventArgs.cs b/Crow/src/TextChangeEventArgs.cs index 33ca405c..33ca405c 100644 --- a/src/TextChangeEventArgs.cs +++ b/Crow/src/TextChangeEventArgs.cs diff --git a/src/ValueChangeEventArgs.cs b/Crow/src/ValueChangeEventArgs.cs index e8293de8..e8293de8 100644 --- a/src/ValueChangeEventArgs.cs +++ b/Crow/src/ValueChangeEventArgs.cs diff --git a/src/XCursor.cs b/Crow/src/XCursor.cs index 1cca510e..1cca510e 100644 --- a/src/XCursor.cs +++ b/Crow/src/XCursor.cs diff --git a/Tests/HelloWorld.cs b/Crow/src/backends/IBackend.cs index 75cc9bd5..3275205e 100644 --- a/Tests/HelloWorld.cs +++ b/Crow/src/backends/IBackend.cs @@ -1,8 +1,8 @@ -// -// HelloWorld.cs +// +// IBackend.cs // // Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // // Copyright (c) 2013-2017 Jean-Philippe Bruyère // @@ -23,31 +23,21 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - using System; -using Crow; -using Tutorials; -namespace Tests +namespace Crow { - class HelloWorld : CrowWindow + public interface IBackend { - public HelloWorld () - : base(800, 600,"Crow Test with OpenTK") - { - } + void Init(Interface iFace); + void CleanUp(); + void Flush(); + void ProcessEvents(); - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Gray' Width='30' Height='50%'/>"); - } - - [STAThread] - static void Main () - { - HelloWorld win = new HelloWorld (); - win.Run (30); - } + bool IsDown (Key key); + bool Shift { get; } + bool Ctrl { get; } + bool Alt { get; } } -}
\ No newline at end of file +} + diff --git a/Tests/Tutorials/T1_HelloWorld.cs b/Crow/src/backends/IKeyboard.cs index 539085d5..d04655e2 100644 --- a/Tests/Tutorials/T1_HelloWorld.cs +++ b/Crow/src/backends/IKeyboard.cs @@ -1,8 +1,8 @@ -// -// HelloWorld.cs +// +// IKeyboard.cs // // Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // // Copyright (c) 2013-2017 Jean-Philippe Bruyère // @@ -23,30 +23,25 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - using System; -using Crow; -namespace Tutorials +namespace Crow { - class T1_HelloWorld : CrowWindow + public interface IKeyboard { - public T1_HelloWorld () - : base(800, 600,"Hello World") - { - } + event EventHandler<KeyEventArgs> KeyDown; + event EventHandler<KeyEventArgs> KeyUp; + event EventHandler<KeyPressEventArgs> KeyPress; + - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - AddWidget (new Label (CurrentInterface) { Text = "Hello World" }); - } + void HandleEvent (uint Keycode, bool pressed); - [STAThread] - static void Main () - { - T1_HelloWorld win = new T1_HelloWorld (); - win.Run (30); - } + bool IsDown (Key key); + bool Shift { get; } + bool Ctrl { get; } + bool Alt { get; } + + void Destroy (); } -}
\ No newline at end of file +} + diff --git a/Crow/src/backends/win32/User32/Cursor.cs b/Crow/src/backends/win32/User32/Cursor.cs new file mode 100644 index 00000000..f324d574 --- /dev/null +++ b/Crow/src/backends/win32/User32/Cursor.cs @@ -0,0 +1,170 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with the cursor. + /// </summary> + public static class Cursor + { + /// <summary> + /// Loads the specified cursor resource from a set of pre-defined cursors (see <see cref="CursorName"/>). + /// </summary> + /// <param name="cursorName">An identifier for one of the pre-defined cursors.</param> + /// <returns> + /// If the function succeeds, the return value is the handle to the newly loaded cursor. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr LoadCursor(CursorName cursorName) + => LoadCursor(IntPtr.Zero, (int)cursorName); + + /// <summary> + /// Loads the specified cursor resource from the executable (.EXE) file associated + /// with an application instance. + /// </summary> + /// <param name="moduleInstance"> + /// A handle to an instance of the module whose executable file contains the cursor to be loaded. + /// </param> + /// <param name="cursorName">The name of the cursor resource to be loaded.</param> + /// <returns> + /// If the function succeeds, the return value is the handle to the newly loaded cursor. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern IntPtr LoadCursor + ( + [In] IntPtr moduleInstance, + [In] string cursorName + ); + + /// <summary> + /// Loads the specified cursor resource from a set of pre-defined cursors (see <see cref="CursorName"/>). + /// </summary> + /// <param name="moduleInstance">Usually a handle to an instance, but null in this overload.</param> + /// <param name="cursorIdentifier"> + /// An integer consisting of the resource identifier in the low-order word and zero in the high-order word. + /// </param> + /// <returns> + /// If the function succeeds, the return value is the handle to the newly loaded cursor. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + private static extern IntPtr LoadCursor + ( + [In] [Optional] IntPtr moduleInstance, + [In] int cursorIdentifier + ); + + /// <summary> + /// Confines the cursor to a rectangular area on the screen. If a subsequent cursor position + /// (set by the <see cref="SetCursorPos(int, int)"/> function or the mouse) lies outside the rectangle, + /// the system automatically adjusts the position to keep the cursor inside the rectangular area. + /// </summary> + /// <param name="rect"> + /// A pointer to the structure that contains the screen coordinates of the upper-left and lower-right + /// corners of the confining rectangle. If this parameter is null, + /// the cursor is free to move anywhere on the screen. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true. + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ClipCursor([In] [Optional] ref Rect rect); + + /// <summary> + /// Confines the cursor to a rectangular area on the screen. If a subsequent cursor position + /// (set by the <see cref="SetCursorPos(int, int)"/> function or the mouse) lies outside the rectangle, + /// the system automatically adjusts the position to keep the cursor inside the rectangular area. + /// </summary> + /// <param name="rect"> + /// A pointer to the structure that contains the screen coordinates of the upper-left and lower-right + /// corners of the confining rectangle. If this parameter is null, + /// the cursor is free to move anywhere on the screen. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true. + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ClipCursor([In] [Optional] IntPtr rect); + + /// <summary> + /// Displays or hides the cursor. + /// </summary> + /// <param name="show"> + /// If true, the display count is incremented by one. If false, the display count is decremented by one. + /// </param> + /// <returns>The return value specifies the new display counter.</returns> + [DllImport(Library)] + public static extern int ShowCursor([In] bool show); + + /// <summary> + /// Retrieves the cursor's position, in screen coordinates. + /// </summary> + /// <param name="point"> + /// A pointer to a <see cref="Point"/> structure that receives the screen coordinates of the cursor. + /// </param> + /// <returns> + /// Returns true if successful or false otherwise.<para/> + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetCursorPos([Out] out Point point); + + /// <summary> + /// Moves the cursor to the specified screen coordinates. If the new coordinates are not within the + /// screen rectangle set by the most recent <see cref="ClipCursor(ref Rect)"/> function call, the system + /// automatically adjusts the coordinates so that the cursor stays within the rectangle. + /// </summary> + /// <param name="x">The new x-coordinate of the cursor, in screen coordinates.</param> + /// <param name="y">The new y-coordinate of the cursor, in screen coordinates.</param> + /// <returns> + /// Returns true if successful or false otherwise.<para/> + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetCursorPos([In] int x, [In] int y); + + /// <summary> + /// Retrieves a handle to the current cursor. + /// </summary> + /// <returns> + /// The return value is the handle to the current cursor. If there is + /// no cursor, the return value is null. + /// </returns> + [DllImport(Library)] + public static extern IntPtr GetCursor(); + + /// <summary> + /// Sets the cursor shape. + /// </summary> + /// <param name="cursor"> + /// A handle to the cursor. The cursor must have been created by the CreateCursor function or loaded by + /// the <see cref="LoadCursor(IntPtr, string)"/> or LoadImage function. If this parameter is null, + /// the cursor is removed from the screen. + /// </param> + /// <returns> + /// The return value is the handle to the previous cursor, if there was one. + /// If there was no previous cursor, the return value is null. + /// </returns> + [DllImport(Library)] + public static extern IntPtr SetCursor([In] [Optional] IntPtr cursor); + } + } +} diff --git a/Crow/src/backends/win32/User32/Delegates/TimerProc.cs b/Crow/src/backends/win32/User32/Delegates/TimerProc.cs new file mode 100644 index 00000000..765e326e --- /dev/null +++ b/Crow/src/backends/win32/User32/Delegates/TimerProc.cs @@ -0,0 +1,25 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// An application-defined callback function that processes <see cref="WindowMessage.Timer"/> messages. TimerProc + /// is a placeholder for the application-defined function name. + /// </summary> + /// <param name="hwnd">A handle to the window associated with the timer. </param> + /// <param name="msg">The <see cref="WindowMessage.Timer"/> message.</param> + /// <param name="timerID">The timer's identifier.</param> + /// <param name="elapsedTime"> + /// The number of milliseconds that have elapsed since the system was started. This is the + /// value returned by the GetTickCount function. + /// </param> + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + public delegate void TimerProc + ( + [In] IntPtr hwnd, + [In] WindowMessage msg, + [In] UIntPtr timerID, + [In] uint elapsedTime + ); +} diff --git a/Crow/src/backends/win32/User32/Delegates/WindowProc.cs b/Crow/src/backends/win32/User32/Delegates/WindowProc.cs new file mode 100644 index 00000000..e3cc1932 --- /dev/null +++ b/Crow/src/backends/win32/User32/Delegates/WindowProc.cs @@ -0,0 +1,31 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// An application-defined function that processes messages sent to a window. WindowProc is a placeholder for the + /// application-defined function name. + /// </summary> + /// <param name="hwnd">A handle to the window.</param> + /// <param name="msg">The message.</param> + /// <param name="wparam"> + /// Additional message information. The contents of this parameter depend on the value of the + /// <paramref name="msg"/> parameter. + /// </param> + /// <param name="lparam"> + /// Additional message information. The contents of this parameter depend on the value of the + /// <paramref name="msg"/> parameter. + /// </param> + /// <returns>The return value is the result of the message processing and depends on the message sent.</returns> + [SuppressUnmanagedCodeSecurity] + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + public delegate IntPtr WindowProc + ( + [In] IntPtr hwnd, + [In] WindowMessage msg, + [In] IntPtr wparam, + [In] IntPtr lparam + ); +} diff --git a/Crow/src/backends/win32/User32/Device.cs b/Crow/src/backends/win32/User32/Device.cs new file mode 100644 index 00000000..9a4bea35 --- /dev/null +++ b/Crow/src/backends/win32/User32/Device.cs @@ -0,0 +1,61 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with devices. + /// </summary> + public static class Device + { + /// <summary> + /// Registers the device or type of device for which a window will receive notifications. + /// </summary> + /// <param name="recipient"> + /// A handle to the window or service that will receive device events for the devices specified in the + /// <paramref name="notificationFilter"/> parameter. The same window handle can be used in multiple calls + /// to <see cref="RegisterDeviceNotification(IntPtr, IntPtr, DeviceNotificationEnum)"/>.<para/> + /// Services can specify either a window handle or service status handle. + /// </param> + /// <param name="notificationFilter"> + /// A pointer to a block of data that specifies the type of device for which notifications should be sent. + /// This block always begins with the DEV_BROADCAST_HDR structure. The data following this header is + /// dependent on the value of the dbch_devicetype member, which can be + /// <see cref="DeviceBroadcastType.DeviceInterface"/> or <see cref="DeviceBroadcastType.Handle"/>.<para/> + /// For more information, see the Remarks section in the official documentation. + /// </param> + /// <param name="flags">Specifies additional information for this function call.</param> + /// <returns> + /// If the function succeeds, the return value is a device notification handle. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>.<para/> + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern IntPtr RegisterDeviceNotification + ( + [In] IntPtr recipient, + [In] IntPtr notificationFilter, + [In] DeviceNotificationEnum flags + ); + + /// <summary> + /// Closes the specified device notification handle. + /// </summary> + /// <param name="handle"> + /// Device notification handle returned by the + /// <see cref="RegisterDeviceNotification(IntPtr, IntPtr, DeviceNotificationEnum)"/> function. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true. + /// If the function fails, the return value is false.<para/> + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool UnregisterDeviceNotification([In] IntPtr handle); + } + } +} diff --git a/Crow/src/backends/win32/User32/DeviceContext.cs b/Crow/src/backends/win32/User32/DeviceContext.cs new file mode 100644 index 00000000..e1d2a5d5 --- /dev/null +++ b/Crow/src/backends/win32/User32/DeviceContext.cs @@ -0,0 +1,213 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with device contexts. + /// </summary> + public static class DeviceContext + { + /// <summary> + /// Retrieves a handle to a device context (DC) for the client area + /// of a specified window or for the entire screen. + /// </summary> + /// <param name="window"> + /// A handle to the window whose DC is to be retrieved. + /// If this value is <see cref="IntPtr.Zero"/>, the DC for the entire screen is retrieved. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle + /// to the DC for the specified window's client area. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr GetDC([In] [Optional] IntPtr window); + + /// <summary> + /// Releases a device context (DC), freeing it for use by other applications. The effect of this function + /// depends on the type of DC.<para/> + /// It frees only common and window DCs. It has no effect on class or private DCs. + /// </summary> + /// <param name="window">A handle to the window whose DC is to be released.</param> + /// <param name="dc">A handle to the DC to be released.</param> + /// <returns> + /// The return value indicates whether the DC was released. + /// If the DC was released, the return value is true.<para/> + /// If the DC was not released, the return value is false. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ReleaseDC([In] IntPtr window, [In] IntPtr dc); + + /// <summary> + /// Changes the settings of the default display device to the specified graphics mode.<para/> + /// To change the settings of a specified display device, use the + /// <see cref="ChangeDisplaySettingsEx(string, IntPtr, IntPtr, DisplaySettingsChanges, IntPtr)"/> + /// function. + /// </summary> + /// <param name="deviceMode"> + /// A <see cref="DeviceMode"/> structure that describes the new graphics mode. If + /// <paramref name="deviceMode"/> is <see cref="IntPtr.Zero"/>, all the values currently in the registry + /// will be used for the display setting. Passing <see cref="IntPtr.Zero"/> for the + /// <paramref name="deviceMode"/> parameter and 0 for the <paramref name="changeFlags"/> parameter is the + /// easiest way to return to the default mode after a dynamic mode change. + /// </param> + /// <param name="changeFlags">Indicates how the graphics mode should be changed.</param> + /// <returns> + /// A <see cref="ChangeDisplaySettingsResult"/> indicating the status of the change operation. + /// </returns> + [DllImport(Library)] + public static extern ChangeDisplaySettingsResult ChangeDisplaySettings + ( + [In] ref DeviceMode deviceMode, + [In] DisplaySettingsChanges changeFlags + ); + + /// <summary> + /// Changes the settings of the specified display device to the specified graphics mode. + /// </summary> + /// <param name="deviceName"> + /// A string that specifies the display device whose graphics mode will change.<para/> + /// Only display device names as returned by + /// <see cref="EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/> are valid. + /// </param> + /// <param name="deviceMode"> + /// A <see cref="DeviceMode"/> structure that describes the new graphics mode. If + /// <paramref name="deviceMode"/> is <see cref="IntPtr.Zero"/>, all the values currently in the registry + /// will be used for the display setting. Passing <see cref="IntPtr.Zero"/> for the + /// <paramref name="deviceMode"/> parameter and 0 for the <paramref name="changeFlags"/> parameter is the + /// easiest way to return to the default mode after a dynamic mode change. + /// </param> + /// <param name="window">Reserved, must be null.</param> + /// <param name="changeFlags">Indicates how the graphics mode should be changed.</param> + /// <param name="changeParams"> + /// If <paramref name="changeFlags"/> is <see cref="DisplaySettingsChanges.VideoParameters"/>, this + /// parameter is a pointer to a VIDEOPARAMETERS structure.<para/> + /// Otherwise <paramref name="changeParams"/> must be NULL. + /// </param> + /// <returns> + /// A <see cref="ChangeDisplaySettingsResult"/> indicating the status of the change operation. + /// </returns> + [DllImport(Library, CharSet = CharSet.Unicode)] + public static extern ChangeDisplaySettingsResult ChangeDisplaySettingsEx + ( + [In] [Optional] string deviceName, + [In] [Optional] IntPtr deviceMode, + [Optional] IntPtr window, + [In] DisplaySettingsChanges changeFlags, + [In] IntPtr changeParams + ); + + /// <summary> + /// Retrieves information about one of the graphics modes for a display device. To retrieve information + /// for all the graphics modes of a display device, make a series of calls to this function. + /// </summary> + /// <param name="deviceName"> + /// A string that specifies the display device about whose graphics mode the function + /// will obtain information.<para/> + /// This parameter is either null or a <see cref="DisplayDevice.DeviceName"/> returned from + /// <see cref="EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/>. A null value specifies the + /// current display device on the computer on which the calling thread is running. + /// </param> + /// <param name="modeSetting">Specifies the type of information to be retrieved.</param> + /// <param name="deviceMode"> + /// A <see cref="DeviceMode"/> structure into which the function stores information about the specified + /// graphics mode. Before calling + /// <see cref="EnumDisplaySettings(string, DisplayModeSetting, out DeviceMode)"/>, set the + /// <see cref="DeviceMode.Size"/> member to <see cref="DeviceMode.SizeInBytes"/>, + /// and set the <see cref="DeviceMode.DriverExtra"/> member to indicate the size, in bytes, + /// of the additional space available to receive private driver data. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true. + /// If the function fails, the return value is false. + /// </returns> + [DllImport(Library, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool EnumDisplaySettings + ( + [In] string deviceName, + [In] DisplayModeSetting modeSetting, + [Out] out DeviceMode deviceMode + ); + + /// <summary> + /// Retrieves information about one of the graphics modes for a display device. To retrieve information + /// for all the graphics modes of a display device, make a series of calls to this function. + /// </summary> + /// <param name="deviceName"> + /// A string that specifies the display device about whose graphics mode the function + /// will obtain information.<para/> + /// This parameter is either null or a <see cref="DisplayDevice.DeviceName"/> returned from + /// <see cref="EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/>. A null value specifies the + /// current display device on the computer on which the calling thread is running. + /// </param> + /// <param name="modeSetting">Specifies the type of information to be retrieved.</param> + /// <param name="deviceMode"> + /// A <see cref="DeviceMode"/> structure into which the function stores information about the specified + /// graphics mode. Before calling + /// <see cref="EnumDisplaySettings(string, DisplayModeSetting, out DeviceMode)"/>, set the + /// <see cref="DeviceMode.Size"/> member to <see cref="DeviceMode.SizeInBytes"/>, + /// and set the <see cref="DeviceMode.DriverExtra"/> member to indicate the size, in bytes, + /// of the additional space available to receive private driver data. + /// </param> + /// <param name="displayModeFlags"> + /// Sets constraints on which graphics modes to return for the given display device. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true. + /// If the function fails, the return value is false. + /// </returns> + [DllImport(Library, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool EnumDisplaySettingsEx + ( + [In] string deviceName, + [In] DisplayModeSetting modeSetting, + [Out] out DeviceMode deviceMode, + [In] EnumDisplayModes displayModeFlags + ); + + /// <summary> + /// Obtains information about the display devices in the current session. + /// </summary> + /// <param name="deviceName"> + /// A pointer to the device name. If NULL, function returns information for the display adapter(s) + /// on the machine, based on <paramref name="deviceIndex"/>. + /// </param> + /// <param name="deviceIndex">An index value that specifies the display device of interest.</param> + /// <param name="displayDevice"> + /// A <see cref="DisplayDevice"/> structure that receives information about the display device + /// specified by <paramref name="deviceIndex"/>.<para/> + /// Before calling <see cref="EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/>, you must + /// initialize the <see cref="DisplayDevice.Size"/> member of <see cref="DisplayDevice"/> + /// to <see cref="DisplayDevice.SizeInBytes"/>. + /// </param> + /// <param name="flags"> + /// Set this to 1 to retrieve the device interface name for GUID_DEVINTERFACE_MONITOR, which is registered + /// by the operating system on a per monitor basis. The value is placed in the + /// <see cref="DisplayDevice.DeviceID"/> member in <paramref name="displayDevice"/>. The resulting device + /// interface name can be used with SetupAPI functions and serves as a link between GDI monitor + /// devices and SetupAPI monitor devices. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// The function fails if <paramref name="deviceIndex"/> is greater than the largest device index. + /// </returns> + [DllImport(Library, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool EnumDisplayDevices + ( + [In] [Optional] string deviceName, + [In] uint deviceIndex, + [Out] out DisplayDevice displayDevice, + [In] uint flags + ); + } + } +} diff --git a/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs b/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs new file mode 100644 index 00000000..89e2b397 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs @@ -0,0 +1,53 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.DeviceContext.ChangeDisplaySettings(ref DeviceMode, DisplaySettingsChanges)"/> + /// and <see cref="User32.DeviceContext.ChangeDisplaySettingsEx(string, IntPtr, IntPtr, DisplaySettingsChanges, + /// IntPtr)"/> to indicate the result of the function call. + /// </summary> + public enum ChangeDisplaySettingsResult : int + { + /// <summary> + /// The settings change was successful. + /// </summary> + Successful = 0, + + /// <summary> + /// The computer must be restarted for the graphics mode to work. + /// </summary> + Restart = 1, + + /// <summary> + /// The display driver failed the specified graphics mode. + /// </summary> + Failed = -1, + + /// <summary> + /// The graphics mode is not supported. + /// </summary> + BadMode = -2, + + /// <summary> + /// Unable to write settings to the registry. + /// </summary> + NotUpdated = -3, + + /// <summary> + /// An invalid set of flags was passed in. + /// </summary> + BadFlags = -4, + + /// <summary> + /// An invalid parameter was passed in. This can include an invalid flag or combination of flags. + /// </summary> + BadParam = -5, + + /// <summary> + /// The settings change was unsuccessful because the system is DualView capable. + /// Only supported on XP and higher. + /// </summary> + BadDualView = -6, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/CursorName.cs b/Crow/src/backends/win32/User32/Enums/CursorName.cs new file mode 100644 index 00000000..c8aac66f --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/CursorName.cs @@ -0,0 +1,88 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies resource identifiers for the pre-defined cursors. + /// </summary> + public enum CursorName + { + /// <summary> + /// Standard arrow and small hourglass. + /// </summary> + AppStarting = 32650, + + /// <summary> + /// Standard arrow. + /// </summary> + Arrow = 32512, + + /// <summary> + /// Crosshair. + /// </summary> + Cross = 32515, + + /// <summary> + /// Hand. + /// </summary> + Hand = 32649, + + /// <summary> + /// Arrow and question mark. + /// </summary> + Help = 32651, + + /// <summary> + /// I-beam. + /// </summary> + IBeam = 32513, + + /// <summary> + /// Obsolete for applications marked version 4.0 or later. + /// </summary> + Icon = 32641, + + /// <summary> + /// Slashed circle. + /// </summary> + No = 32648, + + /// <summary> + /// Obsolete for applications marked version 4.0 or later. Use <see cref="SizeAll"/>. + /// </summary> + Size = 32640, + + /// <summary> + /// Four-pointed arrow pointing north, south, east, and west. + /// </summary> + SizeAll = 32646, + + /// <summary> + /// Double-pointed arrow pointing northeast and southwest. + /// </summary> + SizeNortheastSouthwest = 32643, + + /// <summary> + /// Double-pointed arrow pointing north and south. + /// </summary> + SizeNorthSouth = 32645, + + /// <summary> + /// Double-pointed arrow pointing northwest and southeast. + /// </summary> + SizeNorthwestSoutheast = 32642, + + /// <summary> + /// Double-pointed arrow pointing west and east. + /// </summary> + SizeWestEast = 32644, + + /// <summary> + /// Vertical arrow. + /// </summary> + UpArrow = 32516, + + /// <summary> + /// Hourglass. + /// </summary> + Wait = 32514 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs b/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs new file mode 100644 index 00000000..1389972c --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs @@ -0,0 +1,43 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in the <see cref="BroadcastDeviceInterface"/>. + /// </summary> + public enum DeviceBroadcastType : uint + { + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Oem = 0, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + DevNode = 1, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Volume = 2, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Port = 3, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Net = 4, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + DeviceInterface = 5, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Handle = 6 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs b/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs new file mode 100644 index 00000000..ea642a9f --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs @@ -0,0 +1,165 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in the <see cref="DeviceMode"/> structure to specify whether certain members of the structure + /// have been initialized.<para/> + /// If a member is initialized, its corresponding bit is set, otherwise the bit is clear. + /// A driver supports only those <see cref="DeviceMode"/> members that are appropriate for the + /// printer or display technology. + /// </summary> + [Flags] + public enum DeviceModeFieldFlags : uint + { + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.Orientation"/> field is set. + /// </summary> + Orientation = 0x00000001, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.PaperSize"/> field is set. + /// </summary> + PaperSize = 0x00000002, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.PaperLength"/> field is set. + /// </summary> + PaperLength = 0x00000004, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.PaperWidth"/> field is set. + /// </summary> + PaperWidth = 0x00000008, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.Scale"/> field is set. + /// </summary> + Scale = 0x00000010, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DisplayDeviceOptions.Position"/> field is set. + /// </summary> + Position = 0x00000020, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.Nup"/> field is set. + /// </summary> + Nup = 0x00000040, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DisplayDeviceOptions.DisplayOrientation"/> field is set. + /// </summary> + DisplayOrientation = 0x00000080, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.Copies"/> field is set. + /// </summary> + Copies = 0x00000100, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.DefaultSource"/> field is set. + /// </summary> + DefaultSource = 0x00000200, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PrinterDeviceOptions.PrintQuality"/> field is set. + /// </summary> + PrintQuality = 0x00000400, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.Color"/> field is set. + /// </summary> + Color = 0x00000800, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.Duplex"/> field is set. + /// </summary> + Duplex = 0x00001000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.YResolution"/> field is set. + /// </summary> + YResolution = 0x00002000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.TrueTypeOption"/> field is set. + /// </summary> + TrueTypeOption = 0x00004000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.Collate"/> field is set. + /// </summary> + Collate = 0x00008000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.FormName"/> field is set. + /// </summary> + FormName = 0x00010000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.LogPixels"/> field is set. + /// </summary> + LogPixels = 0x00020000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.BitsPerPixel"/> field is set. + /// </summary> + BitsPerPixel = 0x00040000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.WidthInPixels"/> field is set. + /// </summary> + WidthInPixels = 0x00080000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.HeightInPixels"/> field is set. + /// </summary> + HeightInPixels = 0x00100000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DisplayFlags"/> field is set. + /// </summary> + DisplayFlags = 0x00200000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DisplayFrequency"/> field is set. + /// </summary> + DisplayFrequency = 0x00400000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.IcmMethod"/> field is set. + /// </summary> + IcmMethod = 0x00800000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.IcmIntent"/> field is set. + /// </summary> + IcmIntent = 0x01000000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.MediaType"/> field is set. + /// </summary> + MediaType = 0x02000000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DitherType"/> field is set. + /// </summary> + DitherType = 0x04000000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PanningWidth"/> field is set. + /// </summary> + PanningWidth = 0x08000000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.PanningHeight"/> field is set. + /// </summary> + PanningHeight = 0x10000000, + + /// <summary> + /// Specifies whether the <see cref="DeviceMode.DisplayDeviceOptions.DisplayFixedOutput"/> field is set. + /// </summary> + DisplayFixedOutput = 0x20000000, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs b/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs new file mode 100644 index 00000000..f0a455ac --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs @@ -0,0 +1,28 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in + /// <see cref="User32.Device.RegisterDeviceNotification(System.IntPtr, System.IntPtr, DeviceNotificationEnum)"/> + /// to specify additional information. + /// </summary> + public enum DeviceNotificationEnum + { + /// <summary> + /// The recipient parameter is a window handle. + /// </summary> + WindowHandle = 0x00000000, + + /// <summary> + /// The recipient parameter is a service status handle. + /// </summary> + ServiceHandle = 0x00000001, + + /// <summary> + /// Notifies the recipient of device interface events for all device interface classes. + /// (The dbcc_classguid member is ignored.)<para/> + /// This value can be used only if the dbch_devicetype member is + /// <see cref="DeviceBroadcastType.DeviceInterface"/>. + /// </summary> + AllInterfaceClasses = 0x00000004 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs b/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs new file mode 100644 index 00000000..54a44912 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs @@ -0,0 +1,48 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="DisplayDevice"/> to represent the device state. + /// </summary> + [Flags] + public enum DisplayDeviceStateFlags : uint + { + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + AttachedToDesktop = 0x00000001, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + MultiDriver = 0x00000002, + + /// <summary> + /// The primary desktop is on the device. For a system with a single display card, this is always set. For a + /// system with multiple display cards, only one device can have this set. + /// </summary> + PrimaryDevice = 0x00000004, + + /// <summary> + /// Represents a pseudo device used to mirror application drawing for remoting or other purposes.<para/> + /// An invisible pseudo monitor is associated with this device. + /// </summary> + MirroringDriver = 0x00000008, + + /// <summary> + /// The device is VGA compatible. + /// </summary> + VgaCompatible = 0x00000010, + + /// <summary> + /// The device is removable; it cannot be the primary display. + /// </summary> + Removable = 0x00000020, + + /// <summary> + /// The device has more display modes than its output devices support. + /// </summary> + ModesPruned = 0x08000000, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs b/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs new file mode 100644 index 00000000..71256c0a --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs @@ -0,0 +1,19 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// For fixed-resolution displays, specifies how the device can present a lower-resolution + /// mode on a higher-resolution display. + /// </summary> + public enum DisplayFixedOutputType : uint + { + /// <summary> + /// The display device presents a lower-resolution mode image by stretching it to fill the larger screen space. + /// </summary> + Stretch = 1, + + /// <summary> + /// The display device presents a lower resolution mode image by centering it in the larger screen space. + /// </summary> + Center = 2, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs b/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs new file mode 100644 index 00000000..17ad23ff --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs @@ -0,0 +1,21 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the device's display mode. + /// </summary> + [Flags] + public enum DisplayFlags : uint + { + /// <summary> + /// Specifies that the display is a noncolor device. If this flag is not set, color is assumed. + /// </summary> + Grayscale = 0x00000001, + + /// <summary> + /// Specifies that the display mode is interlaced. If the flag is not set, noninterlaced is assumed. + /// </summary> + Interlaced = 0x00000002, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs b/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs new file mode 100644 index 00000000..6c004218 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs @@ -0,0 +1,20 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.DeviceContext.EnumDisplaySettings(string, DisplayModeSetting, out DeviceMode)"/> and + /// <see cref="User32.DeviceContext.EnumDisplaySettingsEx(string, DisplayModeSetting, out DeviceMode, + /// EnumDisplayModes)"/> to specify which information should be retrieved. + /// </summary> + public enum DisplayModeSetting : uint + { + /// <summary> + /// Retrieve the current settings for the display device. + /// </summary> + CurrentSettings = unchecked((uint)(-1)), + + /// <summary> + /// Retrieve the settings for the display device that are currently stored in the registry. + /// </summary> + RegistrySettings = unchecked((uint)(-2)) + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs b/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs new file mode 100644 index 00000000..c7bd5a44 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs @@ -0,0 +1,29 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines possible display orientations. + /// </summary> + public enum DisplayOrientation : uint + { + /// <summary> + /// The current mode's display device orientation is the natural orientation of the device, + /// and should be used as the default. + /// </summary> + Default = 0, + + /// <summary> + /// The display device orientation is 90 degrees (measured clockwise) from that of <see cref="Default"/>. + /// </summary> + Rotated90 = 1, + + /// <summary> + /// The display device orientation is 180 degrees (measured clockwise) from that of <see cref="Default"/>. + /// </summary> + Rotated180 = 2, + + /// <summary> + /// The display device orientation is 270 degrees (measured clockwise) from that of <see cref="Default"/>. + /// </summary> + Rotated270 = 3, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs b/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs new file mode 100644 index 00000000..e65084fd --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs @@ -0,0 +1,76 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.DeviceContext.ChangeDisplaySettings(ref DeviceMode, DisplaySettingsChanges)"/> + /// and <see cref="User32.DeviceContext.ChangeDisplaySettingsEx(string, IntPtr, IntPtr, DisplaySettingsChanges, + /// IntPtr)"/> to indicate how the graphics mode should be changed. + /// </summary> + [Flags] + public enum DisplaySettingsChanges : uint + { + /// <summary> + /// The graphics mode for the current screen will be changed dynamically. + /// </summary> + Dynamic = 0, + + /// <summary> + /// The graphics mode for the current screen will be changed dynamically and the graphics mode will be + /// updated in the registry. The mode information is stored in the USER profile. + /// </summary> + UpdateRegistry = 0x00000001, + + /// <summary> + /// The system tests if the requested graphics mode could be set. + /// </summary> + Test = 0x00000002, + + /// <summary> + /// The mode is temporary in nature.<para/> + /// If you change to and from another desktop, this mode will not be reset. + /// </summary> + Fullscreen = 0x00000004, + + /// <summary> + /// The settings will be saved in the global settings area so that they will affect all users on the machine. + /// Otherwise, only the settings for the user are modified. + /// This flag is only valid when specified with the <see cref="UpdateRegistry"/> flag. + /// </summary> + Global = 0x00000008, + + /// <summary> + /// This device will become the primary device. + /// </summary> + SetPrimary = 0x00000010, + + /// <summary> + /// Not supported by <see cref="User32.DeviceContext.ChangeDisplaySettings"/>.<para/> + /// Only supported on Vista and higher. + /// </summary> + VideoParameters = 0x00000020, + + /// <summary> + /// Not supported by <see cref="User32.DeviceContext.ChangeDisplaySettings"/>.<para/> + /// Only supported on Vista and higher. + /// </summary> + EnableUnsafeModes = 0x00000100, + + /// <summary> + /// Not supported by <see cref="User32.DeviceContext.ChangeDisplaySettings"/>.<para/> + /// Only supported on Vista and higher. + /// </summary> + DisableUnsafeModes = 0x00000200, + + /// <summary> + /// The settings should be changed, even if the requested settings are the same as the current settings. + /// </summary> + Reset = 0x40000000, + + /// <summary> + /// The settings will be saved in the registry, but will not take effect. + /// This flag is only valid when specified with the <see cref="UpdateRegistry"/> flag. + /// </summary> + NoReset = 0x10000000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs b/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs new file mode 100644 index 00000000..08c1cb2e --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs @@ -0,0 +1,24 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Flags used in <see cref="User32.DeviceContext.EnumDisplaySettingsEx(string, DisplayModeSetting, out DeviceMode, + /// EnumDisplayModes)"/> to specify which graphics modes to return. + /// </summary> + [Flags] + public enum EnumDisplayModes + { + /// <summary> + /// If set, the function will return all graphics modes reported by the adapter driver, regardless of + /// monitor capabilities. Otherwise, it will only return modes that are compatible with current monitors. + /// </summary> + RawMode = 0x00000002, + + /// <summary> + /// If set, the function will return graphics modes in all orientations. Otherwise, it will only return + /// modes that have the same orientation as the one currently set for the requested display. + /// </summary> + RotatedMode = 0x00000004, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs b/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs new file mode 100644 index 00000000..538b674c --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs @@ -0,0 +1,193 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines extended window style flags for usage in <see cref="User32.Window.AdjustWindowRectEx(ref Rect, + /// WindowStyles, bool, ExtendedWindowStyles)"/> and <see cref="User32.Window.CreateWindowEx( + /// ExtendedWindowStyles, string, string, WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/>. + /// </summary> + [Flags] + public enum ExtendedWindowStyles : uint + { + /// <summary> + /// The window has a double border; the window can, optionally, be created with a title bar + /// by specifying the <see cref="WindowStyles.Caption"/> style in the dwStyle parameter. + /// </summary> + DialogModalFrame = 0x00000001, + + /// <summary> + /// The child window created with this style does not send the <see cref="WindowMessage.ParentNotify"/> message + /// to its parent window when it is created or destroyed. + /// </summary> + NoParentModify = 0x00000004, + + /// <summary> + /// The window should be placed above all non-topmost windows and should stay above them, + /// even when the window is deactivated. To add or remove this style, use the + /// <see cref="User32.Window.SetWindowPos(IntPtr, IntPtr, int, int, int, int, SetWindowPosFlags)"/> function. + /// </summary> + Topmost = 0x00000008, + + /// <summary> + /// The window accepts drag-drop files. + /// </summary> + AcceptFiles = 0x00000010, + + /// <summary> + /// The window should not be painted until siblings beneath the window + /// (that were created by the same thread) have been painted. + /// The window appears transparent because the bits of underlying + /// sibling windows have already been painted.<para/> + /// To achieve transparency without these restrictions, use the SetWindowRgn function. + /// </summary> + Transparent = 0x00000020, + + /// <summary> + /// The window is a MDI child window. + /// </summary> + MdiChild = 0x00000040, + + /// <summary> + /// The window is intended to be used as a floating toolbar. A tool window has a title bar + /// that is shorter than a normal title bar, and the window title is drawn using a smaller font. + /// A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. + /// If a tool window has a system menu, its icon is not displayed on the title bar. However, + /// you can display the system menu by right-clicking or by typing ALT+SPACE. + /// </summary> + ToolWindow = 0x00000080, + + /// <summary> + /// The window has a border with a raised edge. + /// </summary> + WindowEdge = 0x00000100, + + /// <summary> + /// The window has a border with a sunken edge. + /// </summary> + ClientEdge = 0x00000200, + + /// <summary> + /// The title bar of the window includes a question mark. When the user clicks the question mark, + /// the cursor changes to a question mark with a pointer. If the user then clicks a child window, + /// the child receives a <see cref="WindowMessage.Help"/> message. The child window should pass the message to + /// the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. + /// The Help application displays a pop-up window that typically contains help for the child window.<para/> + /// <see cref="ContextHelp"/> cannot be used with the <see cref="WindowStyles.MaximizeBox"/> + /// or <see cref="WindowStyles.MinimizeBox"/> styles. + /// </summary> + ContextHelp = 0x00000400, + + /// <summary> + /// The window has generic "right-aligned" properties. This depends on the window class. + /// This style has an effect only if the shell language is Hebrew, Arabic, or another language + /// that supports reading-order alignment; otherwise, the style is ignored.<para/> + /// Using the <see cref="Right"/> style for static or edit controls has the same effect as using the SS_RIGHT + /// or ES_RIGHT style, respectively. Using this style with button controls has the same effect + /// as using BS_RIGHT and BS_RIGHTBUTTON styles. + /// </summary> + Right = 0x00001000, + + /// <summary> + /// The window has generic left-aligned properties. This is the default. + /// </summary> + Left = 0x00000000, + + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, + /// the window text is displayed using right-to-left reading-order properties. For other languages, + /// the style is ignored. + /// </summary> + RtlReading = 0x00002000, + + /// <summary> + /// The window text is displayed using left-to-right reading-order properties. This is the default. + /// </summary> + LtrReading = 0x00000000, + + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, + /// the vertical scroll bar (if present) is to the left of the client area. + /// For other languages, the style is ignored. + /// </summary> + LeftScrollbar = 0x00004000, + + /// <summary> + /// The vertical scroll bar (if present) is to the right of the client area. This is the default. + /// </summary> + RightScrollbar = 0x00000000, + + /// <summary> + /// The window itself contains child windows that should take part in dialog box navigation.<para/> + /// If this style is specified, the dialog manager recurses into children of this window when performing + /// navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. + /// </summary> + ControlParent = 0x00010000, + + /// <summary> + /// The window has a three-dimensional border style intended to be used for items + /// that do not accept user input. + /// </summary> + StaticEdge = 0x00020000, + + /// <summary> + /// Forces a top-level window onto the taskbar when the window is visible. + /// </summary> + AppWindow = 0x00040000, + + /// <summary> + /// The window is an overlapped window. + /// </summary> + OverlappedWindow = WindowEdge | ClientEdge, + + /// <summary> + /// The window is palette window, which is a modeless dialog box that presents an array of commands. + /// </summary> + PaletteWindow = WindowEdge | ToolWindow | Topmost, + + /// <summary> + /// The window is a layered window. This style cannot be used if the window has + /// a class style of either <see cref="WindowClassStyles.OwnDeviceContext"/> or + /// <see cref="WindowClassStyles.ClassDeviceContext"/>.<para/> + /// </summary> + Layered = 0x00080000, + + /// <summary> + /// The window does not pass its window layout to its child windows.<para/> + /// </summary> + NoInheritLayout = 0x00100000, + + /// <summary> + /// The window does not render to a redirection surface. This is for windows that do not have visible + /// content or that use mechanisms other than surfaces to provide their visual.<para/> + /// </summary> + NoRedirectionBitmap = 0x00200000, + + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, + /// the horizontal origin of the window is on the right edge. + /// Increasing horizontal values advance to the left.<para/> + /// </summary> + LayoutRtl = 0x00400000, + + /// <summary> + /// Paints all descendants of a window in bottom-to-top painting order using double-buffering.<para/> + /// This cannot be used if the window has a class style of either <see cref="WindowClassStyles.OwnDeviceContext"/> + /// or <see cref="WindowClassStyles.ClassDeviceContext"/>.<para/> + /// </summary> + Composited = 0x02000000, + + /// <summary> + /// A top-level window created with this style does not become the foreground window when the user clicks it. + /// The system does not bring this window to the foreground when the user minimizes or closes + /// the foreground window.<para/> + /// The window should not be activated through programmatic access or via keyboard navigation by accessible + /// technology, such as Narrator.<para/> + /// To activate the window, use the SetActiveWindow or <see cref="User32.Window.SetForegroundWindow"/> + /// function.<para/> + /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, + /// use the <see cref="ExtendedWindowStyles.AppWindow"/> style.<para/> + /// </summary> + NoActivate = 0x08000000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs b/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs new file mode 100644 index 00000000..a138f791 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs @@ -0,0 +1,21 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the resolution desired by <see cref="User32.Mouse.GetMouseMovePointsEx(uint, ref MouseMovePoint, + /// MouseMovePoint*, int, GetMouseMovePointsResolution)"/>. + /// </summary> + public enum GetMouseMovePointsResolution : uint + { + /// <summary> + /// Retrieves the points using the display resolution. + /// </summary> + UseDisplayPoints = 1, + + /// <summary> + /// Retrieves high resolution points. Points can range from zero to 65,535 (0xFFFF) in both x- and + /// y-coordinates. This is the resolution provided by absolute coordinate pointing devices + /// such as drawing tablets. + /// </summary> + UseHighResolutionPoints = 2 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs b/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs new file mode 100644 index 00000000..efc773ce --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs @@ -0,0 +1,19 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies which type of raw input data to get in a <see cref="User32.RawInput.GetRawInputData(System.IntPtr, + /// GetRawInputDataCommand, System.IntPtr, ref uint, uint)"/> function call. + /// </summary> + public enum GetRawInputDataCommand : uint + { + /// <summary> + /// Get the raw data from the <see cref="RawInput"/> structure. + /// </summary> + Input = 0x10000003, + + /// <summary> + /// Get the header information from the <see cref="RawInput"/> structure. + /// </summary> + Header = 0x10000005 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs b/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs new file mode 100644 index 00000000..01f82ffb --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs @@ -0,0 +1,25 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.RawInput.GetRawInputDeviceInfo(System.IntPtr, + /// GetRawInputDeviceInfoEnum, byte[], ref uint)"/> to specify what data to return in the data parameter. + /// </summary> + public enum GetRawInputDeviceInfoEnum : uint + { + /// <summary> + /// data points to the previously parsed data. + /// </summary> + PreparsedData = 0x20000005, + + /// <summary> + /// data points to a string that contains the device name.<para/> + /// For this command only, the value in dataSize is the character count (not the byte count). + /// </summary> + DeviceName = 0x20000007, + + /// <summary> + /// data points to an <see cref="RawInputDeviceInfo"/> structure. + /// </summary> + DeviceInfo = 0x2000000b + } +} diff --git a/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs b/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs new file mode 100644 index 00000000..279608c5 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs @@ -0,0 +1,50 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Pre-defines memory offsets in extra window memory for specific pieces information to be used in + /// <see cref="User32.Window.GetWindowLong(System.IntPtr, GetWindowLongIndex)"/> and + /// <see cref="User32.Window.SetWindowLong(System.IntPtr, GetWindowLongIndex, System.IntPtr)"/>. + /// </summary> + public enum GetWindowLongIndex + { + /// <summary> + /// Retrieves the address of the window procedure, or a handle + /// representing the address of the window procedure. + /// You must use the CallWindowProc function to call the window procedure. + /// </summary> + WindowProcedure = -4, + + /// <summary> + /// Retrieves a handle to the application instance. + /// </summary> + HInstance = -6, + + /// <summary> + /// Retrieves a handle to the parent window, if any.<para/> + /// Not supported in <see cref="User32.Window.SetWindowLong(System.IntPtr, int, System.IntPtr)"/>. + /// </summary> + HWndParent = -8, + + /// <summary> + /// Retrieves the identifier of the window. + /// </summary> + ID = -12, + + /// <summary> + /// Retrieves the window styles. + /// </summary> + Style = -16, + + /// <summary> + /// Retrieves the extended window styles. + /// </summary> + ExStyle = -20, + + /// <summary> + /// Retrieves the user data associated with the window. + /// This data is intended for use by the application that created the window. + /// Its value is initially zero. + /// </summary> + UserData = -21 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/IconName.cs b/Crow/src/backends/win32/User32/Enums/IconName.cs new file mode 100644 index 00000000..d410b307 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/IconName.cs @@ -0,0 +1,38 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies resource identifiers for the pre-defined icons. + /// </summary> + public enum IconName + { + /// <summary> + /// Application icon. + /// </summary> + Application = 32512, + + /// <summary> + /// Stop sign icon. + /// </summary> + Hand = 32513, + + /// <summary> + /// Question-mark icon. + /// </summary> + Question = 32514, + + /// <summary> + /// Exclamation point icon. + /// </summary> + Exclamation = 32515, + + /// <summary> + /// Asterisk icon. + /// </summary> + Asterisk = 32516, + + /// <summary> + /// Application icon. + /// </summary> + WinLogo = 32517, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs b/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs new file mode 100644 index 00000000..70de9c04 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs @@ -0,0 +1,39 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="MapVirtualKeyType"/> to specify the translation to be performed. + /// </summary> + public enum MapVirtualKeyType : uint + { + /// <summary> + /// uCode is a virtual-key code and is translated into a scan code. If it is a virtual-key code that does not + /// distinguish between left- and right-hand keys, the left-hand scan code is returned. + /// If there is no translation, the function returns 0. + /// </summary> + VirtualKeyToScanCode = 0, + + /// <summary> + /// uCode is a scan code and is translated into a virtual-key code that does not distinguish between left- and + /// right-hand keys. If there is no translation, the function returns 0. + /// </summary> + ScanCodeToVirtualKey = 1, + + /// <summary> + /// uCode is a virtual-key code and is translated into an unshifted character value in the low-order word of + /// the return value. Dead keys (diacritics) are indicated by setting the top bit of the return value. + /// If there is no translation, the function returns 0. + /// </summary> + VirtualKeyToCharacter = 2, + + /// <summary> + /// Windows NT/2000/XP: uCode is a scan code and is translated into a virtual-key code that distinguishes + /// between left- and right-hand keys. If there is no translation, the function returns 0. + /// </summary> + ScanCodeToVirtualKeyExtended = 3, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + VirtualKeyToScanCodeExtended = 4 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs b/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs new file mode 100644 index 00000000..50eb7e2d --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs @@ -0,0 +1,26 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies what values to return if + /// <see cref="User32.Monitor.MonitorFromPoint(Point, MonitorFromDefaultValue)"/> and + /// <see cref="User32.Monitor.MonitorFromWindow(System.IntPtr, MonitorFromDefaultValue)"/> + /// fail to find a monitor for the given arguments. + /// </summary> + public enum MonitorFromDefaultValue : uint + { + /// <summary> + /// Returns null. + /// </summary> + DefaultToNull = 0, + + /// <summary> + /// Returns a handle to the primary display monitor. + /// </summary> + DefaultToPrimary = 1, + + /// <summary> + /// Returns a handle to the display monitor that is nearest to the window/display monitor. + /// </summary> + DefaultToNearest = 2 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs b/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs new file mode 100644 index 00000000..160bc91b --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs @@ -0,0 +1,48 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.Message.PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> + /// to define what actions to take for retrieved messages. + /// </summary> + [Flags] + public enum PeekMessageActions : uint + { + /// <summary> + /// Messages are not removed from the queue after processing by <see cref="User32.Message.PeekMessage"/>. + /// </summary> + NoRemove = 0, + + /// <summary> + /// Messages are removed from the queue after processing by <see cref="User32.Message.PeekMessage"/>. + /// </summary> + Remove = 1, + + /// <summary> + /// Prevents the system from releasing any thread that is waiting for the caller to go idle + /// (see WaitForInputIdle). Combine this value with either <see cref="NoRemove"/> or <see cref="Remove"/>. + /// </summary> + NoYield = 2, + + /// <summary> + /// Process mouse and keyboard messages. + /// </summary> + QSInput = QueueMessageTypes.Input << 16, + + /// <summary> + /// Process paint messages. + /// </summary> + QSPaint = QueueMessageTypes.Paint << 16, + + /// <summary> + /// Process all posted messages, including timers and hotkeys. + /// </summary> + QSPostMessage = (QueueMessageTypes.PostMessage | QueueMessageTypes.Hotkey | QueueMessageTypes.Timer) << 16, + + /// <summary> + /// Process all sent messages. + /// </summary> + QSSendMessage = QueueMessageTypes.SendMessage << 16 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterColor.cs b/Crow/src/backends/win32/User32/Enums/PrinterColor.cs new file mode 100644 index 00000000..2e3606e2 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterColor.cs @@ -0,0 +1,18 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the color mode to use with color printers. + /// </summary> + public enum PrinterColor : short + { + /// <summary> + /// Use monochrome printing mode. + /// </summary> + Monochrome = 1, + + /// <summary> + /// Use color printing mode. + /// </summary> + Color = 2, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs b/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs new file mode 100644 index 00000000..d2bb026d --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs @@ -0,0 +1,84 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// For a printer, specifies the paper source. + /// </summary> + public enum PrinterDefaultSource : short + { + /// <summary> + /// Select the upper paper bin. + /// This value is also used for the paper source for printers that only have one paper bin. + /// </summary> + Upper = 1, + + /// <summary> + /// Same as <see cref="Upper"/>. + /// </summary> + OnlyOne = 1, + + /// <summary> + /// Select the lower bin. + /// </summary> + Lower = 2, + + /// <summary> + /// Select the middle paper bin. + /// </summary> + Middle = 3, + + /// <summary> + /// Manually select the paper bin. + /// </summary> + Manual = 4, + + /// <summary> + /// Select the auto envelope bin. + /// </summary> + Envelope = 5, + + /// <summary> + /// Select the manual envelope bin. + /// </summary> + EnvelopeManual = 6, + + /// <summary> + /// Auto-select the bin. + /// </summary> + Auto = 7, + + /// <summary> + /// Select the bin with the tractor paper. + /// </summary> + Tractor = 8, + + /// <summary> + /// Select the bin with the smaller paper format. + /// </summary> + SmallFormat = 9, + + /// <summary> + /// Select the bin with the larger paper format. + /// </summary> + LargeFormat = 10, + + /// <summary> + /// Select the bin with large capacity. + /// </summary> + LargeCapacity = 11, + + /// <summary> + /// Select the cassette bin. + /// </summary> + Cassette = 14, + + /// <summary> + /// Select the bin with the required form. + /// </summary> + FormSource = 15, + + /// <summary> + /// Starting value for user-defined printer sources. + /// </summary> + User = 256, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs b/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs new file mode 100644 index 00000000..7b8a8868 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs @@ -0,0 +1,66 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// For printers, specifies types of dithering. + /// </summary> + public enum PrinterDitherType : uint + { + /// <summary> + /// No dithering. + /// </summary> + None = 1, + + /// <summary> + /// Dithering with a coarse brush. + /// </summary> + Coarse = 2, + + /// <summary> + /// Dithering with a fine brush. + /// </summary> + Fine = 3, + + /// <summary> + /// Line art dithering, a special dithering method that produces well defined borders between black, white, + /// and gray scaling. It is not suitable for images that include continuous graduations in intensity and hue, + /// such as scanned photographs. + /// </summary> + LineArt = 4, + + /// <summary> + /// Error diffusion dithering.<para/> + /// Only supported on Windows 95, 98, and Millennium Edition. + /// </summary> + ErrorDiffusion = 5, + + /// <summary> + /// Reserved. Do not use. + /// </summary> + Reserved6 = 6, + + /// <summary> + /// Reserved. Do not use. + /// </summary> + Reserved7 = 7, + + /// <summary> + /// Reserved. Do not use. + /// </summary> + Reserved8 = 8, + + /// <summary> + /// Reserved. Do not use. + /// </summary> + Reserved9 = 9, + + /// <summary> + /// Device does gray scaling. + /// </summary> + Grayscale = 10, + + /// <summary> + /// This is the starting value for user-defined values. + /// </summary> + User = 256, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs b/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs new file mode 100644 index 00000000..1caa897b --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs @@ -0,0 +1,23 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies duplex (double-sided) printing for duplex-capable printers. + /// </summary> + public enum PrinterDuplex : short + { + /// <summary> + /// Print single-sided. + /// </summary> + SimpleX = 1, + + /// <summary> + /// Print double-sided, using long edge binding. + /// </summary> + Vertical = 2, + + /// <summary> + /// Print double-sided, using short edge binding. + /// </summary> + Horizontal = 3, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs b/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs new file mode 100644 index 00000000..9ae6e24d --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs @@ -0,0 +1,38 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies which color matching method, or intent, is used by default. + /// </summary> + public enum PrinterIcmIntent : uint + { + /// <summary> + /// Optimize for color saturation.<para/> + /// This value is the most appropriate choice for business graphs when dithering is not desired. + /// </summary> + Saturate = 1, + + /// <summary> + /// Optimize for color contrast.<para/> + /// This value is the most appropriate choice for scanned or photographic images when dithering is desired. + /// </summary> + Contrast = 2, + + /// <summary> + /// Optimize to match the exact color requested.<para/> + /// This value is most appropriate for use with business logos + /// or other images when an exact color match is desired. + /// </summary> + Colorimetric = 3, + + /// <summary> + /// Optimize to match the exact color requested without white point mapping.<para/> + /// This value is most appropriate for use with proofing. + /// </summary> + AbsoluteColorimetric = 4, + + /// <summary> + /// This is the starting value for user-defined values. + /// </summary> + User = 256, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs b/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs new file mode 100644 index 00000000..0a98c6cf --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs @@ -0,0 +1,33 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies how Image Color Management (ICM) is handled. + /// </summary> + public enum PrinterIcmMethod : uint + { + /// <summary> + /// Specifies that ICM is disabled. + /// </summary> + None = 1, + + /// <summary> + /// Specifies that ICM is handled by the system on which the page description language (PDL) data is generated. + /// </summary> + System = 2, + + /// <summary> + /// Specifies that ICM is handled by the printer driver. + /// </summary> + Driver = 3, + + /// <summary> + /// Specifies that ICM is handled by the destination device. + /// </summary> + Device = 4, + + /// <summary> + /// This is the starting value for user-defined values. + /// </summary> + User = 256, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs b/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs new file mode 100644 index 00000000..3db4d065 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs @@ -0,0 +1,28 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the type of media being printed on. + /// </summary> + public enum PrinterMediaType : uint + { + /// <summary> + /// Plain paper. + /// </summary> + Standard = 1, + + /// <summary> + /// Transparent film. + /// </summary> + Transparency = 2, + + /// <summary> + /// Glossy paper. + /// </summary> + Glossy = 3, + + /// <summary> + /// This is the starting value for user-defined values. + /// </summary> + User = 256, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs b/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs new file mode 100644 index 00000000..2e0372d1 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs @@ -0,0 +1,18 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the responsibility for performing page layout for N-up printing. + /// </summary> + public enum PrinterNupHandling : uint + { + /// <summary> + /// The print server does the page layout. + /// </summary> + System = 1, + + /// <summary> + /// The application does the page layout. + /// </summary> + OneUp = 2, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs b/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs new file mode 100644 index 00000000..0543a354 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs @@ -0,0 +1,18 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// For printers, the orientation for output. + /// </summary> + public enum PrinterPaperOrientation : short + { + /// <summary> + /// "Portrait" orientation. + /// </summary> + Portrait = 1, + + /// <summary> + /// "Landscape" orientation. + /// </summary> + Landscape = 2, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs b/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs new file mode 100644 index 00000000..e0ac4a9d --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs @@ -0,0 +1,600 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Lists all defined types for paper size, with <see cref="Letter"/>, <see cref="Legal"/>, <see cref="A3"/> and + /// <see cref="A4"/> being the most typical. All types not included in this enum are reserved.<para/> + /// Note that the paper size types cannot be combined with one another. + /// </summary> + public enum PrinterPaperSize : short + { + /// <summary> + /// US Letter 8 1/2 x 11 in + /// </summary> + Letter = 1, + + /// <summary> + /// US Letter Small 8 1/2 x 11 in + /// </summary> + LetterSmall = 2, + + /// <summary> + /// US Tabloid 11 x 17 in + /// </summary> + Tabloid = 3, + + /// <summary> + /// US Ledger 17 x 11 in + /// </summary> + Ledger = 4, + + /// <summary> + /// US Legal 8 1/2 x 14 in + /// </summary> + Legal = 5, + + /// <summary> + /// US Statement 5 1/2 x 8 1/2 in + /// </summary> + Statement = 6, + + /// <summary> + /// US Executive 7 1/4 x 10 1/2 in + /// </summary> + Executive = 7, + + /// <summary> + /// A3 297 x 420 mm + /// </summary> + A3 = 8, + + /// <summary> + /// A4 210 x 297 mm + /// </summary> + A4 = 9, + + /// <summary> + /// A4 Small 210 x 297 mm + /// </summary> + A4Small = 10, + + /// <summary> + /// A5 148 x 210 mm + /// </summary> + A5 = 11, + + /// <summary> + /// B4 (JIS) 257 x 364 mm + /// </summary> + B4 = 12, + + /// <summary> + /// B5 (JIS) 182 x 257 mm + /// </summary> + B5 = 13, + + /// <summary> + /// Folio 8 1/2 x 13 in + /// </summary> + Folio = 14, + + /// <summary> + /// Quarto 215 x 275 mm + /// </summary> + Quarto = 15, + + /// <summary> + /// 10 x 14 in + /// </summary> + TenByFourteenInches = 16, + + /// <summary> + /// 11 x 17 in + /// </summary> + ElevenBySeventeenInches = 17, + + /// <summary> + /// US Note 8 1/2 x 11 in + /// </summary> + Note = 18, + + /// <summary> + /// US Envelope #9 3 7/8 x 8 7/8 + /// </summary> + Envelope9 = 19, + + /// <summary> + /// US Envelope #10 4 1/8 x 9 1/2 + /// </summary> + Envelope10 = 20, + + /// <summary> + /// US Envelope #11 4 1/2 x 10 3/8 + /// </summary> + Envelope11 = 21, + + /// <summary> + /// US Envelope #12 4 3/4 x 11 in + /// </summary> + Envelope12 = 22, + + /// <summary> + /// US Envelope #14 5 x 11 1/2 + /// </summary> + Envelope14 = 23, + + /// <summary> + /// C size sheet + /// </summary> + CSheet = 24, + + /// <summary> + /// D size sheet + /// </summary> + DSheet = 25, + + /// <summary> + /// E size sheet + /// </summary> + ESheet = 26, + + /// <summary> + /// Envelope DL 110 x 220mm + /// </summary> + EnvelopeDL = 27, + + /// <summary> + /// Envelope C5 162 x 229 mm + /// </summary> + EnvelopeC5 = 28, + + /// <summary> + /// Envelope C3 324 x 458 mm + /// </summary> + EnvelopeC3 = 29, + + /// <summary> + /// Envelope C4 229 x 324 mm + /// </summary> + EnvelopeC4 = 30, + + /// <summary> + /// Envelope C6 114 x 162 mm + /// </summary> + EnvelopeC6 = 31, + + /// <summary> + /// Envelope C65 114 x 229 mm + /// </summary> + EnvelopeC65 = 32, + + /// <summary> + /// Envelope B4 250 x 353 mm + /// </summary> + EnvelopeB4 = 33, + + /// <summary> + /// Envelope B5 176 x 250 mm + /// </summary> + EnvelopeB5 = 34, + + /// <summary> + /// Envelope B6 176 x 125 mm + /// </summary> + EnvelopeB6 = 35, + + /// <summary> + /// Envelope 110 x 230 mm + /// </summary> + EnvelopeItaly = 36, + + /// <summary> + /// US Envelope Monarch 3.875 x 7.5 in + /// </summary> + EnvelopeMonarch = 37, + + /// <summary> + /// 6 3/4 US Envelope 3 5/8 x 6 1/2 in + /// </summary> + EnvelopePersonal = 38, + + /// <summary> + /// US Std Fanfold 14 7/8 x 11 in + /// </summary> + FanfoldUS = 39, + + /// <summary> + /// German Std Fanfold 8 1/2 x 12 in + /// </summary> + FanfoldStandardGerman = 40, + + /// <summary> + /// German Legal Fanfold 8 1/2 x 13 in + /// </summary> + FanfoldLegalGerman = 41, + + /// <summary> + /// B4 (ISO) 250 x 353 mm + /// </summary> + IsoB4 = 42, + + /// <summary> + /// Japanese Postcard 100 x 148 mm + /// </summary> + JapanesePostcard = 43, + + /// <summary> + /// 9 x 11 in + /// </summary> + NineByElevenInches = 44, + + /// <summary> + /// 10 x 11 in + /// </summary> + TenByElevenInches = 45, + + /// <summary> + /// 15 x 11 in + /// </summary> + FifteenByElevenInches = 46, + + /// <summary> + /// Envelope Invite 220 x 220 mm + /// </summary> + EnvelopeInvite = 47, + + /// <summary> + /// RESERVED--DO NOT USE + /// </summary> + Reserved48 = 48, + + /// <summary> + /// RESERVED--DO NOT USE + /// </summary> + Reserved49 = 49, + + /// <summary> + /// US Letter Extra 9 1/2 x 12 in + /// </summary> + LetterExtra = 50, + + /// <summary> + /// US Legal Extra 9 1/2 x 15 in + /// </summary> + LegalExtra = 51, + + /// <summary> + /// US Tabloid Extra 11.69 x 18 in + /// </summary> + TabloidExtra = 52, + + /// <summary> + /// A4 Extra 9.27 x 12.69 in + /// </summary> + A4Extra = 53, + + /// <summary> + /// Letter Transverse 8 1/2 x 11 in + /// </summary> + LetterTransverse = 54, + + /// <summary> + /// A4 Transverse 210 x 297 mm + /// </summary> + A4Transverse = 55, + + /// <summary> + /// Letter Extra Transverse 9 1/2 x 12 in + /// </summary> + LetterExtraTransverse = 56, + + /// <summary> + /// SuperA/SuperA/A4 227 x 356 mm + /// </summary> + APlus = 57, + + /// <summary> + /// SuperB/SuperB/A3 305 x 487 mm + /// </summary> + BPlus = 58, + + /// <summary> + /// US Letter Plus 8.5 x 12.69 in + /// </summary> + LetterPlus = 59, + + /// <summary> + /// A4 Plus 210 x 330 mm + /// </summary> + A4Plus = 60, + + /// <summary> + /// A5 Transverse 148 x 210 mm + /// </summary> + A5Transverse = 61, + + /// <summary> + /// B5 (JIS) Transverse 182 x 257 mm + /// </summary> + B5Transverse = 62, + + /// <summary> + /// A3 Extra 322 x 445 mm + /// </summary> + A3Extra = 63, + + /// <summary> + /// A5 Extra 174 x 235 mm + /// </summary> + A5Extra = 64, + + /// <summary> + /// B5 (ISO) Extra 201 x 276 mm + /// </summary> + B5Extra = 65, + + /// <summary> + /// A2 420 x 594 mm + /// </summary> + A2 = 66, + + /// <summary> + /// A3 Transverse 297 x 420 mm + /// </summary> + A3Transverse = 67, + + /// <summary> + /// A3 Extra Transverse 322 x 445 mm + /// </summary> + A3ExtraTransverse = 68, + + /// <summary> + /// Japanese Double Postcard 200 x 148 mm + /// </summary> + DoubleJapanesePostcard = 69, + + /// <summary> + /// A6 105 x 148 mm + /// </summary> + A6 = 70, + + /// <summary> + /// Japanese Envelope Kaku #2 + /// </summary> + JapaneseEnvelopeKaku2 = 71, + + /// <summary> + /// Japanese Envelope Kaku #3 + /// </summary> + JapaneseEnvelopeKaku3 = 72, + + /// <summary> + /// Japanese Envelope Chou #3 + /// </summary> + JapaneseEnvelopeChou3 = 73, + + /// <summary> + /// Japanese Envelope Chou #4 + /// </summary> + JapaneseEnvelopeChou4 = 74, + + /// <summary> + /// Letter Rotated 11 x 8 1/2 11 in + /// </summary> + LetterRotated = 75, + + /// <summary> + /// A3 Rotated 420 x 297 mm + /// </summary> + A3Rotated = 76, + + /// <summary> + /// A4 Rotated 297 x 210 mm + /// </summary> + A4Rotated = 77, + + /// <summary> + /// A5 Rotated 210 x 148 mm + /// </summary> + A5Rotated = 78, + + /// <summary> + /// B4 (JIS) Rotated 364 x 257 mm + /// </summary> + B4JisRotated = 79, + + /// <summary> + /// B5 (JIS) Rotated 257 x 182 mm + /// </summary> + B5JisRotated = 80, + + /// <summary> + /// Japanese Postcard Rotated 148 x 100 mm + /// </summary> + JapanesePostcardRotated = 81, + + /// <summary> + /// Double Japanese Postcard Rotated 148 x 200 mm + /// </summary> + DoubleJapanesePostcardRotated = 82, + + /// <summary> + /// A6 Rotated 148 x 105 mm + /// </summary> + A6Rotated = 83, + + /// <summary> + /// Japanese Envelope Kaku #2 Rotated + /// </summary> + JapaneseEnvelopeKaku2Rotated = 84, + + /// <summary> + /// Japanese Envelope Kaku #3 Rotated + /// </summary> + JapaneseEnvelopeKaku3Rotated = 85, + + /// <summary> + /// Japanese Envelope Chou #3 Rotated + /// </summary> + JapaneseEnvelopeChou3Rotated = 86, + + /// <summary> + /// Japanese Envelope Chou #4 Rotated + /// </summary> + JapaneseEnvelopeChou4Rotated = 87, + + /// <summary> + /// B6 (JIS) 128 x 182 mm + /// </summary> + B6Jis = 88, + + /// <summary> + /// B6 (JIS) Rotated 182 x 128 mm + /// </summary> + B6JisRotated = 89, + + /// <summary> + /// 12 x 11 in + /// </summary> + TwelveByElevenInches = 90, + + /// <summary> + /// Japanese Envelope You #4 + /// </summary> + JapaneseEnvelopeYou4 = 91, + + /// <summary> + /// Japanese Envelope You #4 Rotated + /// </summary> + JapaneseEnvelopeYou4Rotated = 92, + + /// <summary> + /// PRC 16K 146 x 215 mm + /// </summary> + Prc16K = 93, + + /// <summary> + /// PRC 32K 97 x 151 mm + /// </summary> + Prc32K = 94, + + /// <summary> + /// PRC 32K(Big) 97 x 151 mm + /// </summary> + Prc32KBig = 95, + + /// <summary> + /// PRC Envelope #1 102 x 165 mm + /// </summary> + PrcEnvelope1 = 96, + + /// <summary> + /// PRC Envelope #2 102 x 176 mm + /// </summary> + PrcEnvelope2 = 97, + + /// <summary> + /// PRC Envelope #3 125 x 176 mm + /// </summary> + PrcEnvelope3 = 98, + + /// <summary> + /// PRC Envelope #4 110 x 208 mm + /// </summary> + PrcEnvelope4 = 99, + + /// <summary> + /// PRC Envelope #5 110 x 220 mm + /// </summary> + PrcEnvelope5 = 100, + + /// <summary> + /// PRC Envelope #6 120 x 230 mm + /// </summary> + PrcEnvelope6 = 101, + + /// <summary> + /// PRC Envelope #7 160 x 230 mm + /// </summary> + PrcEnvelope7 = 102, + + /// <summary> + /// PRC Envelope #8 120 x 309 mm + /// </summary> + PrcEnvelope8 = 103, + + /// <summary> + /// PRC Envelope #9 229 x 324 mm + /// </summary> + PrcEnvelope9 = 104, + + /// <summary> + /// PRC Envelope #10 324 x 458 mm + /// </summary> + PrcEnvelope10 = 105, + + /// <summary> + /// PRC 16K Rotated + /// </summary> + P16KRotated = 106, + + /// <summary> + /// PRC 32K Rotated + /// </summary> + P32KRotated = 107, + + /// <summary> + /// PRC 32K(Big) Rotated + /// </summary> + P32KBigRotated = 108, + + /// <summary> + /// PRC Envelope #1 Rotated 165 x 102 mm + /// </summary> + PrcEnvelope1Rotated = 109, + + /// <summary> + /// PRC Envelope #2 Rotated 176 x 102 mm + /// </summary> + PrcEnvelope2Rotated = 110, + + /// <summary> + /// PRC Envelope #3 Rotated 176 x 125 mm + /// </summary> + PrcEnvelope3Rotated = 111, + + /// <summary> + /// PRC Envelope #4 Rotated 208 x 110 mm + /// </summary> + PrcEnvelope4Rotated = 112, + + /// <summary> + /// PRC Envelope #5 Rotated 220 x 110 mm + /// </summary> + PrcEnvelope5Rotated = 113, + + /// <summary> + /// PRC Envelope #6 Rotated 230 x 120 mm + /// </summary> + PrcEnvelope6Rotated = 114, + + /// <summary> + /// PRC Envelope #7 Rotated 230 x 160 mm + /// </summary> + PrcEnvelope7Rotated = 115, + + /// <summary> + /// PRC Envelope #8 Rotated 309 x 120 mm + /// </summary> + PrcEnvelope8Rotated = 116, + + /// <summary> + /// PRC Envelope #9 Rotated 324 x 229 mm + /// </summary> + PrcEnvelope9Rotated = 117, + + /// <summary> + /// PRC Envelope #10 Rotated 458 x 324 mm + /// </summary> + PrcEnvelope10Rotated = 118, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs b/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs new file mode 100644 index 00000000..e3392a63 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs @@ -0,0 +1,29 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// For printers, specifies the printer resolution.<para/> + /// Either specify one of these pre-defined values or specify a positive device-dependent resolution in DPI. + /// </summary> + public enum PrinterPrintQuality : short + { + /// <summary> + /// Draft-resolution printouts. + /// </summary> + Draft = -1, + + /// <summary> + /// Low-resolution printouts. + /// </summary> + Low = -2, + + /// <summary> + /// Medium-resolution printouts. + /// </summary> + Medium = -3, + + /// <summary> + /// High-resolution printouts. + /// </summary> + High = -4, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs b/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs new file mode 100644 index 00000000..650542e2 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs @@ -0,0 +1,28 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies how TrueType fonts should be printed. + /// </summary> + public enum PrinterTrueTypeOption : short + { + /// <summary> + /// Device will print TrueType fonts as graphics. + /// </summary> + Bitmap = 1, + + /// <summary> + /// Device will download TrueType fonts. + /// </summary> + Download = 2, + + /// <summary> + /// Device will substitute device fonts for TrueType fonts. + /// </summary> + SubstituteDevice = 3, + + /// <summary> + /// Downloads TrueType fonts as outline soft fonts. + /// </summary> + DownloadOutline = 4, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs b/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs new file mode 100644 index 00000000..cf9a09ea --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs @@ -0,0 +1,96 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Flags used in <see cref="User32.Message.GetQueueStatus(QueueMessageTypes)"/> + /// to specify the types of messages to check for. + /// </summary> + [Flags] + public enum QueueMessageTypes : uint + { + /// <summary> + /// A <see cref="WindowMessage.KeyUp"/>, <see cref="WindowMessage.KeyDown"/>, + /// <see cref="WindowMessage.SystemKeyUp"/>, or <see cref="WindowMessage.SystemKeyDown"/> message + /// is in the queue. + /// </summary> + Key = 0x0001, + + /// <summary> + /// A <see cref="WindowMessage.MouseMove"/> message is in the queue. + /// </summary> + MouseMove = 0x0002, + + /// <summary> + /// A mouse-button message (<see cref="WindowMessage.LButtonUp"/>, + /// <see cref="WindowMessage.RButtonDown"/>, and so on). + /// </summary> + MouseButton = 0x0004, + + /// <summary> + /// A posted message (other than those listed here) is in the queue. + /// </summary> + PostMessage = 0x0008, + + /// <summary> + /// A <see cref="WindowMessage.Timer"/> message is in the queue. + /// </summary> + Timer = 0x0010, + + /// <summary> + /// A <see cref="WindowMessage.Paint"/> message is in the queue. + /// </summary> + Paint = 0x0020, + + /// <summary> + /// A message sent by another thread or application is in the queue. + /// </summary> + SendMessage = 0x0040, + + /// <summary> + /// A <see cref="WindowMessage.Hotkey"/> message is in the queue. + /// </summary> + Hotkey = 0x0080, + + /// <summary> + /// A posted message (other than those listed here) is in the queue. + /// </summary> + AllPostMessage = 0x0100, + + /// <summary> + /// A raw input message is in the queue. For more information, see Raw Input. + /// Windows XP and higher only. + /// </summary> + RawInput = 0x0400, + + /// <summary> + /// A <see cref="WindowMessage.MouseMove"/> message or mouse-button message + /// (<see cref="WindowMessage.LButtonUp"/>, <see cref="WindowMessage.RButtonDown"/>, and so on). + /// </summary> + Mouse = MouseMove | MouseButton, + + /// <summary> + /// An input message is in the queue. This is composed of <see cref="Key"/>, + /// <see cref="Mouse"/> and <see cref="RawInput"/>. + /// Windows XP and higher only. + /// </summary> + Input = Mouse | Key | RawInput, + + /// <summary> + /// An input message is in the queue. This is composed of <see cref="Key"/> and <see cref="Mouse"/>. + /// Windows 2000 and earlier. + /// </summary> + InputLegacy = Mouse | Key, + + /// <summary> + /// An input, <see cref="WindowMessage.Timer"/>, <see cref="WindowMessage.Paint"/>, + /// <see cref="WindowMessage.Hotkey"/>, or posted message is in the queue. + /// </summary> + AllEvents = Input | PostMessage | Timer | Paint | Hotkey, + + /// <summary> + /// Any message is in the queue. + /// </summary> + AllInput = Input | PostMessage | Timer | Paint | Hotkey | SendMessage + } +} diff --git a/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs b/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs new file mode 100644 index 00000000..3d4230eb --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs @@ -0,0 +1,75 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="RawInputDevice"/> to specify how to interpret the data in the structure. + /// </summary> + [Flags] + public enum RawInputDeviceFlags : uint + { + /// <summary> + /// If set, this removes the top level collection from the inclusion list. + /// This tells the operating system to stop reading from a device which matches the top level collection. + /// </summary> + Remove = 0x00000001, + + /// <summary> + /// If set, this specifies the top level collections to exclude when reading a complete usage page. + /// This flag only affects a TLC whose usage page is already specified with RawInputDeviceEnum.PAGEONLY. + /// </summary> + Exclude = 0x00000010, + + /// <summary> + /// If set, this specifies all devices whose top level collection is from the specified UsagePage. + /// Note that usUsage must be zero. To exclude a particular top level collection, use EXCLUDE. + /// </summary> + PageOnly = 0x00000020, + + /// <summary> + /// If set, this prevents any devices specified by UsagePage or Usage from generating legacy messages. + /// This is only for the mouse and keyboard. See RawInputDevice Remarks. + /// </summary> + NoLegacy = 0x00000030, + + /// <summary> + /// If set, this enables the caller to receive the input even when the caller is not in the foreground. + /// Note that Target must be specified in RawInputDevice. + /// </summary> + InputSink = 0x00000100, + + /// <summary> + /// If set, the mouse button click does not activate the other window. + /// </summary> + CaptureMouse = 0x00000200, // effective when mouse nolegacy is specified, otherwise it would be an error + + /// <summary> + /// If set, the application-defined keyboard device hotkeys are not handled. + /// However, the system hotkeys; for example, ALT+TAB and CTRL+ALT+DEL, are still handled. + /// By default, all keyboard hotkeys are handled. + /// NOHOTKEYS can be specified even if NOLEGACY is not specified and Target is NULL in RawInputDevice. + /// </summary> + NoHotkeys = 0x00000200, // effective for keyboard. + + /// <summary> + /// Microsoft Windows XP Service Pack 1 (SP1): If set, the application command keys are handled. APPKEYS can be + /// specified only if NOLEGACY is specified for a keyboard device. + /// </summary> + AppKeys = 0x00000400, // effective for keyboard. + + /// <summary> + /// If set, this enables the caller to receive input in the background only if the foreground application + /// does not process it. In other words, if the foreground application is not registered for raw input, + /// then the background application that is registered will receive the input.<para/> + /// Only supported on Vista later. + /// </summary> + ExInputSink = 0x00001000, + + /// <summary> + /// If set, this enables the caller to receive WM_INPUT_DEVICE_CHANGE notifications for device arrival and + /// device removal.<para/> + /// Only supported on Vista and later. + /// </summary> + DevNotify = 0x00002000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs b/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs new file mode 100644 index 00000000..95fa0679 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs @@ -0,0 +1,23 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the type of raw input device. + /// </summary> + public enum RawInputDeviceType : uint + { + /// <summary> + /// Data comes from a mouse. + /// </summary> + Mouse = 0, + + /// <summary> + /// Data comes from a keyboard. + /// </summary> + Keyboard = 1, + + /// <summary> + /// Data comes from an HID that is not a keyboard or a mouse. + /// </summary> + Hid = 2 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs b/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs new file mode 100644 index 00000000..e4725d54 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs @@ -0,0 +1,38 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Flags for scan code information. + /// </summary> + public enum RawKeyboardScanCodeFlags : ushort + { + /// <summary> + /// The key is down. + /// </summary> + Make = 0x0, + + /// <summary> + /// The key is up. + /// </summary> + Break = 0x1, + + /// <summary> + /// The scan code has the E0 prefix. + /// </summary> + E0 = 0x2, + + /// <summary> + /// The scan code has the E1 prefix. + /// </summary> + E1 = 0x4, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + TermsrvSetLed = 0x8, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + TermsrvShadow = 0x10 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs b/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs new file mode 100644 index 00000000..174f6598 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs @@ -0,0 +1,101 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the transition state of the mouse buttons. + /// </summary> + [Flags] + public enum RawMouseButtonFlags : ushort + { + /// <summary> + /// Left Button changed to down. + /// </summary> + LeftButtonDown = 0x0001, + + /// <summary> + /// Left Button changed to up. + /// </summary> + LeftButtonUp = 0x0002, + + /// <summary> + /// Right Button changed to down. + /// </summary> + RightButtonDown = 0x0004, + + /// <summary> + /// Right Button changed to up. + /// </summary> + RightButtonUp = 0x0008, + + /// <summary> + /// Middle Button changed to down. + /// </summary> + MiddleButtonDown = 0x0010, + + /// <summary> + /// Middle Button changed to up. + /// </summary> + MiddleButtonUp = 0x0020, + + /// <summary> + /// Same as <see cref="LeftButtonDown"/>. + /// </summary> + Button1Down = LeftButtonDown, + + /// <summary> + /// Same as <see cref="LeftButtonUp"/>. + /// </summary> + Button1Up = LeftButtonUp, + + /// <summary> + /// Same as <see cref="RightButtonDown"/>. + /// </summary> + Button2Down = RightButtonDown, + + /// <summary> + /// Same as <see cref="RightButtonUp"/>. + /// </summary> + Button2Up = RightButtonUp, + + /// <summary> + /// Same as <see cref="MiddleButtonDown"/>. + /// </summary> + Button3Down = MiddleButtonDown, + + /// <summary> + /// Same as <see cref="MiddleButtonUp"/>. + /// </summary> + Button3Up = MiddleButtonUp, + + /// <summary> + /// XBUTTON1 changed to down. + /// </summary> + Button4Down = 0x0040, + + /// <summary> + /// XBUTTON1 changed to up. + /// </summary> + Button4Up = 0x0080, + + /// <summary> + /// XBUTTON2 changed to down. + /// </summary> + Button5Down = 0x0100, + + /// <summary> + /// XBUTTON2 changed to up. + /// </summary> + Button5Up = 0x0200, + + /// <summary> + /// Raw input comes from a mouse wheel. The wheel delta is stored in <see cref="RawMouse.ButtonData"/>. + /// </summary> + Wheel = 0x0400, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + HWheel = 0x0800 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs b/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs new file mode 100644 index 00000000..c299c9e9 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs @@ -0,0 +1,31 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Mouse indicator flags (found in winuser.h). + /// </summary> + [Flags] + public enum RawMouseFlags : ushort + { + /// <summary> + /// LastX/Y indicate relative motion. + /// </summary> + MouseMoveRelative = 0x00, + + /// <summary> + /// LastX/Y indicate absolute motion. + /// </summary> + MouseMoveAbsolute = 0x01, + + /// <summary> + /// The coordinates are mapped to the virtual desktop. + /// </summary> + MouseVirtualDesktop = 0x02, + + /// <summary> + /// Requery for mouse attributes. + /// </summary> + MouseAttributesChanged = 0x04 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs b/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs new file mode 100644 index 00000000..6a80fb03 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs @@ -0,0 +1,98 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Window sizing and positioning flags. + /// </summary> + [Flags] + public enum SetWindowPosFlags : uint + { + /// <summary> + /// Retains the current size (ignores the cx and cy parameters). + /// </summary> + NoSize = 0x0001, + + /// <summary> + /// Retains the current position (ignores the x and y parameters). + /// </summary> + NoMove = 0x0002, + + /// <summary> + /// Retains the current Z order (ignores the hwndInsertAfter parameter). + /// </summary> + NoZOrder = 0x0004, + + /// <summary> + /// Does not redraw changes. If this flag is set, no repainting of any kind occurs. + /// This applies to the client area, the nonclient area (including the title bar and scroll bars), + /// and any part of the parent window uncovered as a result of the window being moved. + /// When this flag is set, the application must explicitly invalidate or redraw any parts + /// of the window and parent window that need redrawing. + /// </summary> + NoRedraw = 0x0008, + + /// <summary> + /// Does not activate the window. If this flag is not set, + /// the window is activated and moved to the top of either the topmost or non-topmost group + /// (depending on the setting of the hwndInsertAfter member). + /// </summary> + NoActivate = 0x0010, + + /// <summary> + /// Sends a <see cref="WindowMessage.NCCalcSize"/> message to the window, even if the window's size is not + /// being changed. If this flag is not specified, <see cref="WindowMessage.NCCalcSize"/> is sent only when + /// the window's size is being changed. + /// </summary> + FrameChanged = 0x0020, + + /// <summary> + /// Displays the window. + /// </summary> + ShowWindow = 0x0040, + + /// <summary> + /// Hides the window. + /// </summary> + HideWindow = 0x0080, + + /// <summary> + /// Discards the entire contents of the client area. If this flag is not specified, + /// the valid contents of the client area are saved and copied back into the client area + /// after the window is sized or repositioned. + /// </summary> + NoCopyBits = 0x0100, + + /// <summary> + /// Does not change the owner window's position in the Z order. + /// </summary> + NoOwnerZOrder = 0x0200, + + /// <summary> + /// Prevents the window from receiving the <see cref="WindowMessage.WindowPosChanging"/> message. + /// </summary> + NoSendChanging = 0x0400, + + /// <summary> + /// Draws a frame (defined in the window's class description) around the window. + /// </summary> + DrawFrame = FrameChanged, + + /// <summary> + /// Same as the <see cref="NoOwnerZOrder"/> flag. + /// </summary> + NoReposition = NoOwnerZOrder, + + /// <summary> + /// Prevents generation of the <see cref="WindowMessage.SyncPaint"/> message. + /// </summary> + DeferErase = 0x2000, + + /// <summary> + /// If the calling thread and the thread that owns the window are attached to different input queues, + /// the system posts the request to the thread that owns the window. This prevents the calling thread + /// from blocking its execution while other threads process the request. + /// </summary> + AsyncWindowPos = 0x4000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs b/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs new file mode 100644 index 00000000..9df83949 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs @@ -0,0 +1,32 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies a set of pre-defined values for special behavior in <see cref="User32.Window.SetWindowPos( + /// System.IntPtr, SetWindowPosHwndEnum, int, int, int, int, SetWindowPosFlags)"/>. + /// </summary> + public enum SetWindowPosHwndEnum + { + /// <summary> + /// Places the window above all non-topmost windows (that is, behind all topmost windows). + /// This flag has no effect if the window is already a non-topmost window. + /// </summary> + NoTopmost = -2, + + /// <summary> + /// Places the window above all non-topmost windows. + /// The window maintains its topmost position even when it is deactivated. + /// </summary> + Topmost = -1, + + /// <summary> + /// Places the window at the top of the Z order. + /// </summary> + Top = 0, + + /// <summary> + /// Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, + /// the window loses its topmost status and is placed at the bottom of all other windows. + /// </summary> + Bottom = 1, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs b/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs new file mode 100644 index 00000000..22ea736a --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs @@ -0,0 +1,83 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="User32.Window.ShowWindow(System.IntPtr, ShowWindowCommand)"/> to control + /// how a window is to be shown. + /// </summary> + public enum ShowWindowCommand + { + /// <summary> + /// Hides the window and activates another window. + /// </summary> + Hide = 0, + + /// <summary> + /// Activates and displays a window. If the window is minimized or maximized, the system restores it to + /// its original size and position. + /// An application should specify this flag when displaying the window for the first time. + /// </summary> + ShowNormal = 1, + + /// <summary> + /// Activates the window and displays it as a minimized window. + /// </summary> + ShowMinimized = 2, + + /// <summary> + /// Activates the window and displays it as a maximized window. + /// </summary> + ShowMaximized = 3, + + /// <summary> + /// Maximizes the specified window. + /// </summary> + Maximize = 3, + + /// <summary> + /// Displays a window in its most recent size and position. This value is similar to <see cref="ShowNormal"/>, + /// except that the window is not activated. + /// </summary> + ShowNoActivate = 4, + + /// <summary> + /// Activates the window and displays it in its current size and position. + /// </summary> + Show = 5, + + /// <summary> + /// Minimizes the specified window and activates the next top-level window in the Z order. + /// </summary> + Minimize = 6, + + /// <summary> + /// Displays the window as a minimized window. This value is similar to <see cref="ShowMinimized"/>, + /// except the window is not activated. + /// </summary> + ShowMinimizedNoActivate = 7, + + /// <summary> + /// Displays the window in its current size and position. This value is similar to <see cref="ShowNormal"/>, + /// except the window is not activated. + /// </summary> + ShowNA = 8, + + /// <summary> + /// Activates and displays the window. If the window is minimized or maximized, the system restores it to + /// its original size and position. + /// An application should specify this flag when restoring a minimized window. + /// </summary> + Restore = 9, + + /// <summary> + /// Sets the show state based on the <see cref="ShowWindowCommand"/> value specified in the STARTUPINFO + /// structure passed to the CreateProcess function by the program that started the application. + /// </summary> + ShowDefault = 10, + + /// <summary> + /// Windows 2000/XP: Minimizes a window, even if the thread that owns the window is not responding. + /// This flag should only be used when minimizing windows from a different thread. + /// </summary> + ForceMinimize = 11 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs b/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs new file mode 100644 index 00000000..e4a55ddc --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs @@ -0,0 +1,51 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used in <see cref="TrackMouseEvent"/> to request specific services. + /// </summary> + [Flags] + public enum TrackMouseEvents : uint + { + /// <summary> + /// The caller wants hover notification. Notification is delivered as a <see cref="WindowMessage.MouseHover"/> + /// message.<para/> + /// If the caller requests hover tracking while hover tracking is already active, + /// the hover timer will be reset.<para/> + /// This flag is ignored if the mouse pointer is not over the specified window or area. + /// </summary> + Hover = 0x00000001, + + /// <summary> + /// The caller wants leave notification. Notification is delivered as a <see cref="WindowMessage.MouseLeave"/> + /// message. If the mouse is not over the specified window or area, + /// a leave notification is generated immediately and no further tracking is performed. + /// </summary> + Leave = 0x00000002, + + /// <summary> + /// The caller wants hover and leave notification for the nonclient areas. + /// Notification is delivered as <see cref="WindowMessage.NCMouseHover"/> + /// and <see cref="WindowMessage.NCMouseLeave"/> messages. + /// </summary> + NonClient = 0x00000010, + + /// <summary> + /// The function fills in the structure instead of treating it as a tracking request. + /// The structure is filled such that had that structure been passed to TrackMouseEvent, + /// it would generate the current tracking. The only anomaly is that the hover time-out + /// returned is always the actual time-out and not <see cref="TrackMouseEvent.DefaultHoverTime"/>, if + /// <see cref="TrackMouseEvent.DefaultHoverTime"/> was specified during the original + /// <see cref="User32.Mouse.TrackMouseEvent"/> request. + /// </summary> + Query = 0x40000000, + + /// <summary> + /// The caller wants to cancel a prior tracking request. The caller should also specify the type + /// of tracking that it wants to cancel. For example, to cancel hover tracking, the caller must + /// pass the <see cref="Cancel"/> and <see cref="Hover"/> flags. + /// </summary> + Cancel = 0x80000000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/VirtualKey.cs b/Crow/src/backends/win32/User32/Enums/VirtualKey.cs new file mode 100644 index 00000000..40529d8e --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/VirtualKey.cs @@ -0,0 +1,874 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Lists all virtual keys. + /// </summary> + public enum VirtualKey : uint + { + /// <summary> + /// Left mouse button. + /// </summary> + LButton = 0x01, + + /// <summary> + /// Right mouse button. + /// </summary> + RButton = 0x02, + + /// <summary> + /// Control-break processing. + /// </summary> + Cancel = 0x03, + + /// <summary> + /// Middle mouse button (three-button mouse).<para/> + /// Not contiguous with L and R Button. + /// </summary> + MButton = 0x04, + + /// <summary> + /// X1 mouse button. + /// Not contiguous with L and R Button. + /// </summary> + XButton1 = 0x05, + + /// <summary> + /// X2 mouse button. + /// Not contiguous with L and R Button. + /// </summary> + XButton2 = 0x06, + + /* + * 0x07: Undefined + */ + + /// <summary> + /// BACKSPACE key. + /// </summary> + Back = 0x08, + + /// <summary> + /// TAB key. + /// </summary> + Tab = 0x09, + + /* + * 0x0A - 0x0B: Reserved + */ + + /// <summary> + /// CLEAR key. + /// </summary> + Clear = 0x0C, + + /// <summary> + /// ENTER key. + /// </summary> + Return = 0x0D, + + /* + * 0x0E - 0x0F: Undefined + */ + + /// <summary> + /// SHIFT key. + /// </summary> + Shift = 0x10, + + /// <summary> + /// CTRL key. + /// </summary> + Control = 0x11, + + /// <summary> + /// ALT key. + /// </summary> + Menu = 0x12, + + /// <summary> + /// PAUSE key. + /// </summary> + Pause = 0x13, + + /// <summary> + /// CAPS LOCK key + /// </summary> + Capital = 0x14, + + /// <summary> + /// IME Kana mode. + /// </summary> + Kana = 0x15, + + /// <summary> + /// IME Hanguel mode (maintained for compatibility; use <see cref="Hangul"/>). + /// </summary> + Hangeul = 0x15, + + /// <summary> + /// IME Hangul mode. + /// </summary> + Hangul = 0x15, + + /* + * 0x16: Undefined + */ + + /// <summary> + /// IME Junja mode + /// </summary> + Junja = 0x17, + + /// <summary> + /// IME final mode. + /// </summary> + Final = 0x18, + + /// <summary> + /// IME Hanja mode. + /// </summary> + Hanja = 0x19, + + /// <summary> + /// IME Kanji mode. + /// </summary> + Kanji = 0x19, + + /* + * 0x1A: Undefined + */ + + /// <summary> + /// ESC key + /// </summary> + Escape = 0x1B, + + /// <summary> + /// IME convert. + /// </summary> + Convert = 0x1C, + + /// <summary> + /// IME nonconvert. + /// </summary> + NonConvert = 0x1D, + + /// <summary> + /// IME accept. + /// </summary> + Accept = 0x1E, + + /// <summary> + /// IME mode change request. + /// </summary> + ModeChange = 0x1F, + + /// <summary> + /// SPACEBAR. + /// </summary> + Space = 0x20, + + /// <summary> + /// PAGE UP key. + /// </summary> + Prior = 0x21, + + /// <summary> + /// PAGE DOWN key. + /// </summary> + Next = 0x22, + + /// <summary> + /// END key. + /// </summary> + End = 0x23, + + /// <summary> + /// HOME key. + /// </summary> + Home = 0x24, + + /// <summary> + /// LEFT ARROW key. + /// </summary> + Left = 0x25, + + /// <summary> + /// UP ARROW key. + /// </summary> + Up = 0x26, + + /// <summary> + /// RIGHT ARROW key. + /// </summary> + Right = 0x27, + + /// <summary> + /// DOWN ARROW key. + /// </summary> + Down = 0x28, + + /// <summary> + /// SELECT key. + /// </summary> + Select = 0x29, + + /// <summary> + /// PRINT key. + /// </summary> + Print = 0x2A, + + /// <summary> + /// EXECUTE key. + /// </summary> + Execute = 0x2B, + + /// <summary> + /// PRINT SCREEN key. + /// </summary> + Snapshot = 0x2C, + + /// <summary> + /// INS key. + /// </summary> + Insert = 0x2D, + + /// <summary> + /// DEL key. + /// </summary> + Delete = 0x2E, + + /// <summary> + /// HELP key. + /// </summary> + Help = 0x2F, + + /* + * 0 - 9 are the same as ASCII '0' - '9' (0x30 - 0x39) + * 0x40: Unassigned + * A - Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) + */ + + /// <summary> + /// Left Windows key (Natural keyboard). + /// </summary> + LWin = 0x5B, + + /// <summary> + /// Right Windows key (Natural keyboard). + /// </summary> + RWin = 0x5C, + + /// <summary> + /// Applications key (Natural keyboard). + /// </summary> + Apps = 0x5D, + + /* + * 0x5E: Reserved + */ + + /// <summary> + /// Computer Sleep key. + /// </summary> + Sleep = 0x5F, + + /// <summary> + /// Numeric keypad 0 key. + /// </summary> + Numpad0 = 0x60, + + /// <summary> + /// Numeric keypad 1 key + /// </summary> + Numpad1 = 0x61, + + /// <summary> + /// Numeric keypad 2 key + /// </summary> + Numpad2 = 0x62, + + /// <summary> + /// Numeric keypad 3 key + /// </summary> + Numpad3 = 0x63, + + /// <summary> + /// Numeric keypad 4 key + /// </summary> + Numpad4 = 0x64, + + /// <summary> + /// Numeric keypad 5 key + /// </summary> + Numpad5 = 0x65, + + /// <summary> + /// Numeric keypad 6 key + /// </summary> + Numpad6 = 0x66, + + /// <summary> + /// Numeric keypad 7 key + /// </summary> + Numpad7 = 0x67, + + /// <summary> + /// Numeric keypad 8 key + /// </summary> + Numpad8 = 0x68, + + /// <summary> + /// Numeric keypad 9 key + /// </summary> + Numpad9 = 0x69, + + /// <summary> + /// Multiply key. + /// </summary> + Multiply = 0x6A, + + /// <summary> + /// Add key. + /// </summary> + Add = 0x6B, + + /// <summary> + /// Separator key. + /// </summary> + Separator = 0x6C, + + /// <summary> + /// Subtract key. + /// </summary> + Subtract = 0x6D, + + /// <summary> + /// Decimal key. + /// </summary> + Decimal = 0x6E, + + /// <summary> + /// Divide key. + /// </summary> + Divide = 0x6F, + + /// <summary> + /// F1 key. + /// </summary> + F1 = 0x70, + + /// <summary> + /// F2 key. + /// </summary> + F2 = 0x71, + + /// <summary> + /// F3 key. + /// </summary> + F3 = 0x72, + + /// <summary> + /// F4 key. + /// </summary> + F4 = 0x73, + + /// <summary> + /// F5 key. + /// </summary> + F5 = 0x74, + + /// <summary> + /// F6 key. + /// </summary> + F6 = 0x75, + + /// <summary> + /// F7 key. + /// </summary> + F7 = 0x76, + + /// <summary> + /// F8 key. + /// </summary> + F8 = 0x77, + + /// <summary> + /// F9 key. + /// </summary> + F9 = 0x78, + + /// <summary> + /// F10 key. + /// </summary> + F10 = 0x79, + + /// <summary> + /// F11 key. + /// </summary> + F11 = 0x7A, + + /// <summary> + /// F12 key. + /// </summary> + F12 = 0x7B, + + /// <summary> + /// F13 key. + /// </summary> + F13 = 0x7C, + + /// <summary> + /// F14 key. + /// </summary> + F14 = 0x7D, + + /// <summary> + /// F15 key. + /// </summary> + F15 = 0x7E, + + /// <summary> + /// F16 key. + /// </summary> + F16 = 0x7F, + + /// <summary> + /// F17 key. + /// </summary> + F17 = 0x80, + + /// <summary> + /// F18 key. + /// </summary> + F18 = 0x81, + + /// <summary> + /// F19 key. + /// </summary> + F19 = 0x82, + + /// <summary> + /// F20 key. + /// </summary> + F20 = 0x83, + + /// <summary> + /// F21 key. + /// </summary> + F21 = 0x84, + + /// <summary> + /// F22 key. + /// </summary> + F22 = 0x85, + + /// <summary> + /// F23 key. + /// </summary> + F23 = 0x86, + + /// <summary> + /// F24 key. + /// </summary> + F24 = 0x87, + + /* + * 0x88 - 0x8F: Unassigned + */ + + /// <summary> + /// NUM LOCK key. + /// </summary> + NumLock = 0x90, + + /// <summary> + /// SCROLL LOCK key. + /// </summary> + Scroll = 0x91, + + /* + * 0x92 - 0x96: OEM specific + */ + + /* + * 0x97 - 0x9F: Unassigned + */ + + /* + * L* & R* - left and right Alt, Ctrl and Shift virtual keys. + * Used only as parameters to GetAsyncKeyState() and GetKeyState(). + * No other API or message will distinguish left and right keys in this way. + */ + + /// <summary> + /// Left SHIFT key. + /// </summary> + LShift = 0xA0, + + /// <summary> + /// Right SHIFT key. + /// </summary> + RShift = 0xA1, + + /// <summary> + /// Left CONTROL key. + /// </summary> + LControl = 0xA2, + + /// <summary> + /// Right CONTROL key. + /// </summary> + RControl = 0xA3, + + /// <summary> + /// Left MENU key. + /// </summary> + LMenu = 0xA4, + + /// <summary> + /// Right MENU key. + /// </summary> + RMenu = 0xA5, + + /// <summary> + /// Browser Back key. + /// </summary> + BrowserBack = 0xA6, + + /// <summary> + /// Browser Forward key + /// </summary> + BrowserForward = 0xA7, + + /// <summary> + /// Browser Refresh key. + /// </summary> + BrowserRefresh = 0xA8, + + /// <summary> + /// Browser Stop key. + /// </summary> + BrowserStop = 0xA9, + + /// <summary> + /// Browser Search key. + /// </summary> + BrowserSearch = 0xAA, + + /// <summary> + /// Browser Favorites key. + /// </summary> + BrowserFavorites = 0xAB, + + /// <summary> + /// Browser Start and Home key. + /// </summary> + BrowserHome = 0xAC, + + /// <summary> + /// Volume Mute key. + /// </summary> + VolumeMute = 0xAD, + + /// <summary> + /// Volume Down key. + /// </summary> + VolumeDown = 0xAE, + + /// <summary> + /// Volume Up key. + /// </summary> + VolumeUp = 0xAF, + + /// <summary> + /// Next Track key. + /// </summary> + MediaNextTrack = 0xB0, + + /// <summary> + /// Previous Track key. + /// </summary> + MediaPreviousTrack = 0xB1, + + /// <summary> + /// Stop Media key. + /// </summary> + MediaStop = 0xB2, + + /// <summary> + /// Play/Pause Media key. + /// </summary> + MediaPlayPause = 0xB3, + + /// <summary> + /// Start Mail key. + /// </summary> + LaunchMail = 0xB4, + + /// <summary> + /// Select Media key. + /// </summary> + LaunchMediaSelect = 0xB5, + + /// <summary> + /// Start Application 1 key. + /// </summary> + LaunchApp1 = 0xB6, + + /// <summary> + /// Start Application 2 key. + /// </summary> + LaunchApp2 = 0xB7, + + /* + * 0xB8 - 0xB9 : reserved + */ + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the ';:' key. + /// </summary> + Oem1 = 0xBA, + + /// <summary> + /// For any country/region, the '+' key. + /// </summary> + OemPlus = 0xBB, + + /// <summary> + /// For any country/region, the ',' key. + /// </summary> + OemComma = 0xBC, + + /// <summary> + /// For any country/region, the '-' key. + /// </summary> + OemMinus = 0xBD, + + /// <summary> + /// For any country/region, the '.' key. + /// </summary> + OemPeriod = 0xBE, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the '/?' key. + /// </summary> + Oem2 = 0xBF, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the '`~' key. + /// </summary> + Oem3 = 0xC0, + + /* + * 0xC1 - 0xD7: Reserved + */ + + /* + * 0xD8 - 0xDA: Unassigned + */ + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the '[{' key + /// </summary> + Oem4 = 0xDB, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the '\|' key + /// </summary> + Oem5 = 0xDC, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the ']}' key + /// </summary> + Oem6 = 0xDD, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// For the US standard keyboard, the 'single-quote/double-quote' key + /// </summary> + Oem7 = 0xDE, + + /// <summary> + /// Used for miscellaneous characters; it can vary by keyboard. + /// </summary> + Oem8 = 0xDF, + + /* + * 0xE0: Reserved + */ + + /* + * Various extended or enhanced keyboards + */ + + /// <summary> + /// OEM specific. + /// 'AX' key on Japanese AX keyboard. + /// </summary> + OemAX = 0xE1, + + /// <summary> + /// Either the angle bracket key or the backslash key on the RT 102-key keyboard. + /// </summary> + Oem102 = 0xE2, + + /// <summary> + /// OEM specific. + /// Help key on ICO. + /// </summary> + IcoHelp = 0xE3, + + /// <summary> + /// OEM specific. + /// 00 key on ICO. + /// </summary> + Ico00 = 0xE4, + + /// <summary> + /// IME PROCESS key. + /// </summary> + ProcessKey = 0xE5, + + /// <summary> + /// OEM specific. + /// Clear key on ICO. + /// </summary> + IcoClear = 0xE6, + + /// <summary> + /// Used to pass Unicode characters as if they were keystrokes. The <see cref="Packet"/> key is + /// the low word of a 32-bit Virtual Key value used for non-keyboard input methods. + /// </summary> + Packet = 0xE7, + + /* + * 0xE8: Unassigned + */ + + /* + * Nokia/Ericsson definitions + */ + + /// <summary> + /// OEM specific Reset key. + /// </summary> + OemReset = 0xE9, + + /// <summary> + /// OEM specific Jump key. + /// </summary> + OemJump = 0xEA, + + /// <summary> + /// OEM specific PA1 key. + /// </summary> + OemPA1 = 0xEB, + + /// <summary> + /// OEM specific PA2 key. + /// </summary> + OemPA2 = 0xEC, + + /// <summary> + /// OEM specific PA3 key. + /// </summary> + OemPA3 = 0xED, + + /// <summary> + /// OEM specific WSCtrl key. + /// </summary> + OemWSCtrl = 0xEE, + + /// <summary> + /// OEM specific CUseL key. + /// </summary> + OemCUseL = 0xEF, + + /// <summary> + /// OEM specific attn key. + /// </summary> + OemAttn = 0xF0, + + /// <summary> + /// OEM specific Finish key. + /// </summary> + OemFinish = 0xF1, + + /// <summary> + /// OEM specific Copy key. + /// </summary> + OemCopy = 0xF2, + + /// <summary> + /// OEM specific Auto key. + /// </summary> + OemAuto = 0xF3, + + /// <summary> + /// OEM specific Enlw key. + /// </summary> + OemEnlw = 0xF4, + + /// <summary> + /// OEM specific Backtab key. + /// </summary> + OemBacktab = 0xF5, + + /// <summary> + /// Attn key. + /// </summary> + Attn = 0xF6, + + /// <summary> + /// CrSel key. + /// </summary> + CrSel = 0xF7, + + /// <summary> + /// ExSel key. + /// </summary> + ExSel = 0xF8, + + /// <summary> + /// Erase EOF key. + /// </summary> + ErEof = 0xF9, + + /// <summary> + /// Play key. + /// </summary> + Play = 0xFA, + + /// <summary> + /// Zoom key. + /// </summary> + Zoom = 0xFB, + + /// <summary> + /// Reserved. + /// </summary> + NoName = 0xFC, + + /// <summary> + /// PA1 key. + /// </summary> + PA1 = 0xFD, + + /// <summary> + /// Clear key. + /// </summary> + OemClear = 0xFE, + + /// <summary> + /// The highest possible value for virtual keys. + /// </summary> + Last = 0xFF, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs b/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs new file mode 100644 index 00000000..b3f9d5f4 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs @@ -0,0 +1,97 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines additional elements of the window class. + /// </summary> + [Flags] + public enum WindowClassStyles : uint + { + /// <summary> + /// Redraws the entire window if a movement or size adjustment changes the height of the client area. + /// </summary> + VRedraw = 0x0001, + + /// <summary> + /// Redraws the entire window if a movement or size adjustment changes the width of the client area. + /// </summary> + HRedraw = 0x0002, + + /// <summary> + /// Sends a double-click message to the window procedure when the user double-clicks + /// the mouse while the cursor is within a window belonging to the class. + /// </summary> + DoubleClicks = 0x0008, + + /// <summary> + /// Allocates a unique device context for each window in the class. + /// </summary> + OwnDeviceContext = 0x0020, + + /// <summary> + /// Allocates one device context to be shared by all windows in the class. Because window classes are process + /// specific, it is possible for multiple threads of an application to create a window of the same class. + /// It is also possible for the threads to attempt to use the device context simultaneously. When this + /// happens, the system allows only one thread to successfully finish its drawing operation. + /// </summary> + ClassDeviceContext = 0x0040, + + /// <summary> + /// Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on + /// the parent. A window with the <see cref="ParentDeviceContext"/> style bit receives a regular device context + /// from the system's cache of device contexts. It does not give the child the parent's device context or + /// device context settings. Specifying <see cref="ParentDeviceContext"/> enhances an application's + /// performance. + /// </summary> + ParentDeviceContext = 0x0080, + + /// <summary> + /// Disables Close on the window menu. + /// </summary> + NoClose = 0x0200, + + /// <summary> + /// Saves, as a bitmap, the portion of the screen image obscured by a window of this class. When the window is + /// removed, the system uses the saved bitmap to restore the screen image, including other windows that were + /// obscured. Therefore, the system does not send <see cref="WindowMessage.Paint"/> to windows that were + /// obscured if the memory used by the bitmap has not been discarded and if other screen actions + /// have not invalidated the stored image.<para/> + /// This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly + /// and then removed before other screen activity takes place. This style increases the time required to + /// display the window, because the system must first allocate memory to store the bitmap. + /// </summary> + SaveBits = 0x0800, + + /// <summary> + /// Aligns the window's client area on a byte boundary (in the x direction). + /// This style affects the width of the window and its horizontal placement on the display. + /// </summary> + ByteAlignClient = 0x1000, + + /// <summary> + /// Aligns the window on a byte boundary (in the x direction). + /// This style affects the width of the window and its horizontal placement on the display. + /// </summary> + ByteAlignWindow = 0x2000, + + /// <summary> + /// Indicates that the window class is an application global class. For more information, see the + /// "Application Global Classes" section of About Window Classes. + /// </summary> + GlobalClass = 0x4000, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + Ime = 0x00010000, + + /// <summary> + /// Enables the drop shadow effect on a window. The effect is turned on and off through SPI_SETDROPSHADOW. + /// Typically, this is enabled for small, short-lived windows such as menus to emphasize their Z-order + /// relationship to other windows. Windows created from a class with this style must be top-level windows; + /// they may not be child windows. + /// </summary> + DropShadow = 0x00020000 + } +} diff --git a/Crow/src/backends/win32/User32/Enums/WindowMessage.cs b/Crow/src/backends/win32/User32/Enums/WindowMessage.cs new file mode 100644 index 00000000..cb7be8b6 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/WindowMessage.cs @@ -0,0 +1,1661 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies the different types of window messages. + /// </summary> + public enum WindowMessage : uint + { + /// <summary> + /// Performs no operation. An application sends the <see cref="Null"/> message if it wants to + /// post a message that the recipient window will ignore. + /// </summary> + Null = 0x0000, + + /// <summary> + /// Sent when an application requests that a window be created by calling the + /// <see cref="User32.Window.CreateWindowEx(ExtendedWindowStyles, string, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> or CreateWindow function. + /// (The message is sent before the function returns.) The window procedure of the + /// new window receives this message after the window is created, but before the window becomes visible. + /// </summary> + Create = 0x0001, + + /// <summary> + /// Sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed + /// after the window is removed from the screen.<para/> + /// This message is sent first to the window being destroyed and then to the child windows (if any) as they + /// are destroyed. During the processing of the message, it can be assumed that all child windows still exist. + /// </summary> + Destroy = 0x0002, + + /// <summary> + /// Sent after a window has been moved. + /// </summary> + Move = 0x0003, + + /// <summary> + /// Sent to a window after its size has changed. + /// </summary> + Size = 0x0005, + + /// <summary> + /// Sent to both the window being activated and the window being deactivated. If the windows use the same + /// input queue, the message is sent synchronously, first to the window procedure of the top-level window being + /// deactivated, then to the window procedure of the top-level window being activated. If the windows use + /// different input queues, the message is sent asynchronously, so the window is activated immediately. + /// </summary> + Activate = 0x0006, + + /// <summary> + /// Sent to a window after it has gained the keyboard focus. + /// </summary> + SetFocus = 0x0007, + + /// <summary> + /// Sent to a window immediately before it loses the keyboard focus. + /// </summary> + KillFocus = 0x0008, + + /// <summary> + /// Sent when an application changes the enabled state of a window. It is sent to the window whose enabled + /// state is changing. This message is sent before the EnableWindow function returns, but after the enabled + /// state (<see cref="WindowStyles.Disabled"/> style bit) of the window has changed. + /// </summary> + Enable = 0x000A, + + /// <summary> + /// An application sends the <see cref="SetRedraw"/> message to a window to allow changes in that window + /// to be redrawn or to prevent changes in that window from being redrawn. + /// </summary> + SetRedraw = 0x000B, + + /// <summary> + /// Sets the text of a window. + /// </summary> + SetText = 0x000C, + + /// <summary> + /// Copies the text that corresponds to a window into a buffer provided by the caller. + /// </summary> + GetText = 0x000D, + + /// <summary> + /// Determines the length, in characters, of the text associated with a window. + /// </summary> + GetTextLength = 0x000E, + + /// <summary> + /// Sent when the system or another application makes a request to paint a portion of an application's window. + /// The message is sent when the UpdateWindow or RedrawWindow function is called, or by the + /// <see cref="User32.Message.DispatchMessage(ref Msg)"/> function when the application obtains a + /// <see cref="WindowMessage.Paint"/> message by using the + /// <see cref="User32.Message.GetMessage(out Msg, IntPtr, uint, uint)"/> or + /// <see cref="User32.Message.PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </summary> + Paint = 0x000F, + + /// <summary> + /// Sent as a signal that a window or an application should terminate. + /// </summary> + Close = 0x0010, + + /// <summary> + /// Sent when the user chooses to end the session or when an application calls one of the system shutdown + /// functions. If any application returns zero, the session is not ended. The system stops sending + /// <see cref="QueryEndSession"/> messages as soon as one application returns zero. + /// </summary> + QueryEndSession = 0x0011, + + /// <summary> + /// Indicates a request to terminate an application, and is generated when the application calls the + /// <see cref="User32.Message.PostQuitMessage(int)"/> function. This message causes the + /// <see cref="User32.Message.GetMessage(out Msg, IntPtr, uint, uint)"/> function to return zero. + /// </summary> + Quit = 0x0012, + + /// <summary> + /// Sent to an icon when the user requests that the window be restored to its previous size and position. + /// </summary> + QueryOpen = 0x0013, + + /// <summary> + /// Sent when the window background must be erased (for example, when a window is resized). + /// The message is sent to prepare an invalidated portion of a window for painting. + /// </summary> + EraseBackground = 0x0014, + + /// <summary> + /// The <see cref="SystemColorChange"/> message is sent to all top-level windows when + /// a change is made to a system color setting. + /// </summary> + SystemColorChange = 0x0015, + + /// <summary> + /// Sent to an application after the system processes the results of the <see cref="QueryEndSession"/> message. + /// The <see cref="EndSession"/> message informs the application whether the session is ending. + /// </summary> + EndSession = 0x0016, + + /// <summary> + /// Sent to a window when the window is about to be hidden or shown. + /// </summary> + ShowWindow = 0x0018, + + /// <summary> + /// Sent by an application to all top-level windows after making a change to the + /// WIN.INI file. The SystemParametersInfo function sends this message + /// after an application uses the function to change a setting in WIN.INI. + /// </summary> + WinIniChange = 0x001A, + + /// <summary> + /// A message that is sent to all top-level windows when the SystemParametersInfo function changes + /// a system-wide setting or when policy settings have changed.<para/> + /// Applications should send <see cref="SettingChange"/> to all top-level windows when they make changes to + /// system parameters. (This message cannot be sent directly to a window.) To send the + /// <see cref="SettingChange"/> message to all top-level windows, use the SendMessageTimeout function with the + /// hwnd parameter set to <see cref="User32.Message.BroadcastHandle"/>. + /// </summary> + SettingChange = WinIniChange, + + /// <summary> + /// Sent to all top-level windows whenever the user changes device-mode settings. + /// </summary> + DeviceModeChange = 0x001B, + + /// <summary> + /// Sent when a window belonging to a different application than the active window is about to be activated. + /// The message is sent to the application whose window is being activated + /// and to the application whose window is being deactivated. + /// </summary> + ActivateApp = 0x001C, + + /// <summary> + /// Sent to all top-level windows in the system after changing the pool of font resources. + /// </summary> + FontChange = 0x001D, + + /// <summary> + /// A message that is sent whenever there is a change in the system time. + /// </summary> + TimeChange = 0x001E, + + /// <summary> + /// Sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the + /// active window when a dialog box or message box is displayed. Certain functions also send this message + /// explicitly to the specified window regardless of whether it is the active window. For example, + /// the EnableWindow function sends this message when disabling the specified window. + /// </summary> + CancelMode = 0x001F, + + /// <summary> + /// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. + /// </summary> + SetCursor = 0x0020, + + /// <summary> + /// Sent when the cursor is in an inactive window and the user presses a mouse button. The parent window + /// receives this message only if the child window passes it to the + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function. + /// </summary> + MouseActivate = 0x0021, + + /// <summary> + /// Sent to a child window when the user clicks the window's title bar or + /// when the window is activated, moved, or sized. + /// </summary> + ChildActivate = 0x0022, + + /// <summary> + /// Sent by a computer-based training (CBT) application to separate user-input messages + /// from other messages sent through the WH_JOURNALPLAYBACK procedure. + /// </summary> + QueueSync = 0x0023, + + /// <summary> + /// Sent to a window when the size or position of the window is about to change. An application can use + /// this message to override the window's default maximized size and position, + /// or its default minimum or maximum tracking size. + /// </summary> + GetMinMaxInfo = 0x0024, + + /// <summary> + /// Obsolete. Used in Windows NT 3.51 and earlier. + /// </summary> + PaintIcon = 0x0026, + + /// <summary> + /// Obsolete. Used in Windows NT 3.51 and earlier. + /// </summary> + IconEraseBackground = 0x0027, + + /// <summary> + /// Sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. + /// </summary> + NextDialogCtl = 0x0028, + + /// <summary> + /// Sent from Print Manager whenever a job is added to or removed from the Print Manager queue. + /// </summary> + SpoolerStatus = 0x002A, + + /// <summary> + /// Sent to the parent window of an owner-drawn button, combo box, list box, or menu when a + /// visual aspect of the button, combo box, list box, or menu has changed. + /// </summary> + DrawItem = 0x002B, + + /// <summary> + /// Sent to the owner window of a combo box, list box, list view control, or menu item when + /// the control or menu is created. + /// </summary> + MeasureItem = 0x002C, + + /// <summary> + /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items + /// are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. + /// The system sends a <see cref="DeleteItem"/> message for each deleted item. The system sends the + /// <see cref="DeleteItem"/> message for any deleted list box or combo box item with nonzero item data. + /// </summary> + DeleteItem = 0x002D, + + /// <summary> + /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its + /// owner in response to a <see cref="KeyDown"/> message. + /// </summary> + VKeyToItem = 0x002E, + + /// <summary> + /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its + /// owner in response to a <see cref="Char"/> message. + /// </summary> + CharToItem = 0x002F, + + /// <summary> + /// Sent to specify the font that a control is to use when drawing text. + /// </summary> + SetFont = 0x0030, + + /// <summary> + /// Sent to a control to retrieve the font with which the control is currently drawing its text. + /// </summary> + GetFont = 0x0031, + + /// <summary> + /// Sent to a window to associate a hot key with the window. + /// When the user presses the hot key, the system activates the window. + /// </summary> + SetHotkey = 0x0032, + + /// <summary> + /// Sent to determine the hot key associated with a window. + /// </summary> + GetHotkey = 0x0033, + + /// <summary> + /// Sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an + /// icon defined for its class. An application can return a handle to an icon or cursor. + /// The system displays this cursor or icon while the user drags the icon. + /// </summary> + QueryDragIcon = 0x0037, + + /// <summary> + /// Sent to determine the relative position of a new item in the sorted list of an owner-drawn combo box or + /// list box. Whenever the application adds a new item, the system sends this message to the owner of a + /// combo box or list box created with the CBS_SORT or LBS_SORT style. + /// </summary> + CompareItem = 0x0039, + + /// <summary> + /// Sent by Active Accessibility to obtain information about an accessible object contained in a server + /// application. Applications never send this message directly. It is sent only by Active Accessibility + /// in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or + /// AccessibleObjectFromWindow. However, server applications handle this message. + /// </summary> + GetObject = 0x003D, + + /// <summary> + /// Sent to all top-level windows when the system detects more than 12.5 percent of system time over a + /// 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low. + /// </summary> + Compacting = 0x0041, + + /// <summary> + /// Marked as "no longer supported" and not officially documented. Use with care. + /// </summary> + CommNotify = 0x0044, + + /// <summary> + /// Sent to a window whose size, position, or place in the Z order is about to change as a result of a + /// call to the <see cref="User32.Window.SetWindowPos(IntPtr, SetWindowPosHwndEnum, int, int, int, int, + /// SetWindowPosFlags)"/> function or another window-management function. + /// </summary> + WindowPosChanging = 0x0046, + + /// <summary> + /// Sent to a window whose size, position, or place in the Z order has changed as a result of a call to the + /// <see cref="User32.Window.SetWindowPos(IntPtr, SetWindowPosHwndEnum, int, int, int, int, + /// SetWindowPosFlags)"/> function or another window-management function. + /// </summary> + WindowPosChanged = 0x0047, + + /// <summary> + /// Notifies applications that the system, typically a battery-powered personal computer, + /// is about to enter a suspended mode.<para/> + /// Obsolete : use <see cref="PowerBroadcast"/> instead. + /// </summary> + Power = 0x0048, + + /// <summary> + /// Sent to pass data to another application. + /// </summary> + CopyData = 0x004A, + + /// <summary> + /// Posted to an application when a user cancels the application's journaling activities. + /// The message is posted with a null/zero window handle. + /// </summary> + CancelJournal = 0x004B, + + /// <summary> + /// Sent by a common control to its parent window when an event has occurred + /// or the control requires some information. + /// </summary> + Notify = 0x004E, + + /// <summary> + /// Posted to the window with the focus when the user chooses a new input language, either with the hotkey + /// (specified in the Keyboard control panel application) or from the indicator on the system taskbar. + /// An application can accept the change by passing the message to the + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function or reject the change (and prevent it from taking place) by returning immediately. + /// </summary> + InputLanguageChangeRequest = 0x0050, + + /// <summary> + /// Sent to the topmost affected window after an application's input language has been changed. You should + /// make any application-specific settings and pass the message to the + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function, which passes the message to all first-level child windows. These child windows can pass the + /// message to + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// to have it pass the message to their child windows, and so on. + /// </summary> + InputLanguageChange = 0x0051, + + /// <summary> + /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs + /// the application when the user clicks an authorable button. An application initiates a training card by + /// specifying the HELP_TCARD command in a call to the WinHelp function. + /// </summary> + TCard = 0x0052, + + /// <summary> + /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, <see cref="Help"/> is + /// sent to the window associated with the menu; otherwise, <see cref="Help"/> is sent to the window that has + /// the keyboard focus. If no window has the keyboard focus, <see cref="Help"/> is sent to the currently + /// active window. + /// </summary> + Help = 0x0053, + + /// <summary> + /// Sent to all windows after the user has logged on or off. When the user logs on or off, the system updates + /// the user-specific settings. The system sends this message immediately after updating the settings. + /// </summary> + UserChanged = 0x0054, + + /// <summary> + /// Determines if a window accepts ANSI or Unicode structures in the <see cref="Notify"/> notification message. + /// <see cref="NotifyFormat"/> messages are sent from a common control to its parent window + /// and from the parent window to the common control. + /// </summary> + NotifyFormat = 0x0055, + + /// <summary> + /// Notifies a window that the user clicked the right mouse button (right-clicked) in the window. + /// </summary> + ContextMenu = 0x007B, + + /// <summary> + /// Sent to a window when the <see cref="User32.Window.SetWindowLong(IntPtr, int, int)"/> + /// function is about to change one or more of the window's styles. + /// </summary> + StyleChanging = 0x007C, + + /// <summary> + /// Sent to a window after the <see cref="User32.Window.SetWindowLong(IntPtr, int, int)"/> + /// function has changed one or more of the window's styles. + /// </summary> + StyleChanged = 0x007D, + + /// <summary> + /// Sent to all windows when the display resolution has changed. + /// </summary> + DisplayChange = 0x007E, + + /// <summary> + /// Sent to a window to retrieve a handle to the large or small icon associated with a window. + /// The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. + /// </summary> + GetIcon = 0x007F, + + /// <summary> + /// Sent by an application to associate a new large or small icon with a window. The system displays the + /// large icon in the ALT+TAB dialog box, and the small icon in the window caption. + /// </summary> + SetIcon = 0x0080, + + /// <summary> + /// Sent prior to the <see cref="Create"/> message when a window is first created. + /// </summary> + NCCreate = 0x0081, + + /// <summary> + /// Informs a window that its nonclient area is being destroyed. The + /// <see cref="User32.Window.DestroyWindow(IntPtr)"/> function sends the <see cref="NCDestroy"/> message + /// to the window following the <see cref="Destroy"/> message. + /// <see cref="Destroy"/> is used to free the allocated memory object associated with the window. + /// </summary> + NCDestroy = 0x0082, + + /// <summary> + /// Sent when the size and position of a window's client area must be calculated. By processing this message, + /// an application can control the content of the window's client area when + /// the size or position of the window changes. + /// </summary> + NCCalcSize = 0x0083, + + /// <summary> + /// Sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is + /// not captured, the message is sent to the window beneath the cursor. + /// Otherwise, the message is sent to the window that has captured the mouse. + /// </summary> + NCHitTest = 0x0084, + + /// <summary> + /// Sent to a window when its frame must be painted. + /// </summary> + NCPaint = 0x0085, + + /// <summary> + /// Non Client Area Activated Caption (Title) of the Form. + /// </summary> + NCActivate = 0x0086, + + /// <summary> + /// Sent to the window procedure associated with a control. By default, the system handles all keyboard input + /// to the control; the system interprets certain types of keyboard input as dialog box navigation keys. + /// To override this default behavior, the control can respond to the <see cref="GetDialogCode"/> message to + /// indicate the types of input it wants to process itself. + /// </summary> + GetDialogCode = 0x0087, + + /// <summary> + /// Used to synchronize painting while avoiding linking independent GUI threads. + /// </summary> + SyncPaint = 0x0088, + + /// <summary> + /// Posted to a window when the cursor is moved within the nonclient area of the window. This message is posted + /// to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCMouseMove = 0x00A0, + + /// <summary> + /// Posted when the user presses the left mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCLButtonDown = 0x00A1, + + /// <summary> + /// Posted when the user releases the left mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCLButtonUp = 0x00A2, + + /// <summary> + /// Posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area + /// of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCLButtonDoubleClick = 0x00A3, + + /// <summary> + /// Posted when the user presses the right mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCRButtonDown = 0x00A4, + + /// <summary> + /// Posted when the user releases the right mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCRButtonUp = 0x00A5, + + /// <summary> + /// Posted when the user double-clicks the right mouse button while the cursor is within the nonclient area + /// of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCRButtonDoubleClick = 0x00A6, + + /// <summary> + /// Posted when the user presses the middle mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCMButtonDown = 0x00A7, + + /// <summary> + /// Posted when the user releases the middle mouse button while the cursor is within the nonclient area of a + /// window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCMButtonUp = 0x00A8, + + /// <summary> + /// Posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area + /// of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCMButtonDoubleClick = 0x00A9, + + /// <summary> + /// Posted when the user presses the first or second X button while the cursor is within the nonclient area + /// of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCXButtonDown = 0x00AB, + + /// <summary> + /// Posted when the user releases the first or second X button while the cursor is within the nonclient area + /// of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCXButtonUp = 0x00AC, + + /// <summary> + /// Posted when the user double-clicks the first or second X button while the cursor is within the nonclient + /// area of a window. This message is posted to the window that contains the cursor.<para/> + /// If a window has captured the mouse, this message is not posted. + /// </summary> + NCXButtonDoubleClick = 0x00AD, + + /// <summary> + /// Sent to the window that registered to receive raw input. + /// </summary> + InputDeviceChange = 0x00FE, + + /// <summary> + /// Sent to the window that is getting raw input. + /// </summary> + Input = 0x00FF, + + /// <summary> + /// Posted to the window with the keyboard focus when a nonsystem key is pressed. + /// A nonsystem key is a key that is pressed when the ALT key is not pressed. + /// </summary> + KeyDown = 0x0100, + + /// <summary> + /// This message filters for keyboard messages. + /// </summary> + KeyFirst = 0x0100, + + /// <summary> + /// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key + /// that is pressed when the ALT key is not pressed, + /// or a keyboard key that is pressed when a window has the keyboard focus. + /// </summary> + KeyUp = 0x0101, + + /// <summary> + /// Posted to the window with the keyboard focus when a <see cref="KeyDown"/> message is translated by the + /// TranslateMessage function. The <see cref="Char"/> message contains + /// the character code of the key that was pressed. + /// </summary> + Char = 0x0102, + + /// <summary> + /// Posted to the window with the keyboard focus when a <see cref="KeyUp"/> message is translated by the + /// TranslateMessage function. <see cref="DeadChar"/> specifies a character code generated by a dead key. + /// A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with + /// another character to form a composite character. For example, the umlaut-O character (Ö) is generated + /// by typing the dead key for the umlaut character, and then typing the O key. + /// </summary> + DeadChar = 0x0103, + + /// <summary> + /// Posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu + /// bar) or holds down the ALT key and then presses another key. It also occurs when no window currently + /// has the keyboard focus; in this case, the <see cref="SystemKeyDown"/> message is sent to the active window. + /// The window that receives the message can distinguish between these two contexts by + /// checking the context code in the lParam parameter. + /// </summary> + SystemKeyDown = 0x0104, + + /// <summary> + /// Posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT + /// key was held down. It also occurs when no window currently has the keyboard focus; in this case, the + /// <see cref="SystemKeyUp"/> message is sent to the active window. The window that receives the message can + /// distinguish between these two contexts by checking the context code in the lParam parameter. + /// </summary> + SystemKeyUp = 0x0105, + + /// <summary> + /// Posted to the window with the keyboard focus when a <see cref="SystemKeyDown"/> message is translated by + /// the TranslateMessage function. It specifies the character code of a system character key — that is, a + /// character key that is pressed while the ALT key is down. + /// </summary> + SystemChar = 0x0106, + + /// <summary> + /// Sent to the window with the keyboard focus when a <see cref="SystemKeyDown"/> message is translated by the + /// TranslateMessage function. <see cref="SystemDeadChar"/> specifies the character code of a system dead key + /// — that is, a dead key that is pressed while holding down the ALT key. + /// </summary> + SystemDeadChar = 0x0107, + + /// <summary> + /// Can be used by an application to post input to other windows. This message contains the character code + /// of the key that was pressed. (Test whether a target app can process <see cref="UnicodeCharacter"/> messages + /// by sending the message with wParam set to UNICODE_NOCHAR.) + /// </summary> + UnicodeCharacter = 0x0109, + + /// <summary> + /// This message filters for keyboard messages. + /// </summary> + KeyLast = 0x0109, + + /// <summary> + /// Sent immediately before the IME generates the composition string as a result of a keystroke. + /// </summary> + ImeStartComposition = 0x010D, + + /// <summary> + /// Sent to an application when the IME ends composition. + /// </summary> + ImeEndComposition = 0x010E, + + /// <summary> + /// Sent to an application when the IME changes composition status as a result of a keystroke. + /// </summary> + ImeComposition = 0x010F, + + /// <summary> + /// Same as <see cref="ImeComposition"/>. Documentation incomplete. + /// </summary> + ImeKeylast = 0x010F, + + /// <summary> + /// Sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures + /// typically use this message to initialize controls and carry out any other + /// initialization tasks that affect the appearance of the dialog box. + /// </summary> + InitDialog = 0x0110, + + /// <summary> + /// Sent when the user selects a command item from a menu, when a control sends a notification message + /// to its parent window, or when an accelerator keystroke is translated. + /// </summary> + Command = 0x0111, + + /// <summary> + /// A window receives this message when the user chooses a command from the Window menu (formerly known + /// as the system or control menu) or when the user chooses the maximize button, minimize button, + /// restore button, or close button. + /// </summary> + SystemCommand = 0x0112, + + /// <summary> + /// Posted to the installing thread's message queue when a timer expires. + /// The message is posted by the <see cref="User32.Message.GetMessage(out Msg, IntPtr, uint, uint)"/> or + /// <see cref="User32.Message.PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </summary> + Timer = 0x0113, + + /// <summary> + /// Sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. + /// This message is also sent to the owner of a horizontal scroll bar control + /// when a scroll event occurs in the control. + /// </summary> + HScroll = 0x0114, + + /// <summary> + /// Sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message + /// is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. + /// </summary> + VScroll = 0x0115, + + /// <summary> + /// Sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or + /// presses a menu key. This allows the application to modify the menu before it is displayed. + /// </summary> + InitMenu = 0x0116, + + /// <summary> + /// Sent when a drop-down menu or submenu is about to become active. This allows an application to modify + /// the menu before it is displayed, without changing the entire menu. + /// </summary> + InitMenuPopup = 0x0117, + + /// <summary> + /// Passes information about a gesture.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + Gesture = 0x0119, + + /// <summary> + /// Gives you a chance to set the gesture configuration.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + GestureNotify = 0x011A, + + /// <summary> + /// Sent to a menu's owner window when the user selects a menu item. + /// </summary> + MenuSelect = 0x011F, + + /// <summary> + /// Sent when a menu is active and the user presses a key that does not correspond to any mnemonic + /// or accelerator key. This message is sent to the window that owns the menu. + /// </summary> + MenuChar = 0x0120, + + /// <summary> + /// Sent to the owner window of a modal dialog box or menu that is entering an idle state. + /// A modal dialog box or menu enters an idle state when no messages are waiting in its queue + /// after it has processed one or more previous messages. + /// </summary> + EnterIdle = 0x0121, + + /// <summary> + /// Sent when the user releases the right mouse button while the cursor is on a menu item. + /// </summary> + MenuRButtonUp = 0x0122, + + /// <summary> + /// Sent to the owner of a drag-and-drop menu when the user drags a menu item. + /// </summary> + MenuDrag = 0x0123, + + /// <summary> + /// Sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves + /// from the center of the item to the top or bottom of the item. + /// </summary> + MenuGetObject = 0x0124, + + /// <summary> + /// Sent when a drop-down menu or submenu has been destroyed. + /// </summary> + UninitMenuPopup = 0x0125, + + /// <summary> + /// Sent when the user makes a selection from a menu. + /// </summary> + MenuCommand = 0x0126, + + /// <summary> + /// Sent by an application to indicate that the UI state should be changed. + /// </summary> + ChangeUIState = 0x0127, + + /// <summary> + /// Sent by an application to change the UI state for the specified window and all its child windows. + /// </summary> + UpdateUIState = 0x0128, + + /// <summary> + /// Sent by an application to retrieve the UI state for a window. + /// </summary> + QueryUIState = 0x0129, + + /// <summary> + /// Sent to the owner window of a message box before Windows draws the message box. By responding to this + /// message, the owner window can set the text and background colors of the message box + /// by using the given display device context handle. + /// </summary> + CtlColorMsgBox = 0x0132, + + /// <summary> + /// An edit control that is not read-only or disabled sends the <see cref="CtlColorEdit"/> message to its + /// parent window when the control is about to be drawn. By responding to this message, the parent window + /// can use the specified device context handle to set the text and background colors of the edit control. + /// </summary> + CtlColorEdit = 0x0133, + + /// <summary> + /// Sent to the parent window of a list box before the system draws the list box. By responding to this + /// message, the parent window can set the text and background colors of the list box + /// by using the specified display device context handle. + /// </summary> + CtlColorListBox = 0x0134, + + /// <summary> + /// Sent to the parent window of a button before drawing the button. The parent window can change + /// the button's text and background colors. However, only owner-drawn buttons + /// respond to the parent window processing this message. + /// </summary> + CtlColorButton = 0x0135, + + /// <summary> + /// Sent to a dialog box before the system draws the dialog box. By responding to this message, + /// the dialog box can set its text and background colors using the specified display device context handle. + /// </summary> + CtlColorDialog = 0x0136, + + /// <summary> + /// Sent to the parent window of a scroll bar control when the control is about to be drawn. + /// By responding to this message, the parent window can use the display context handle + /// to set the background color of the scroll bar control. + /// </summary> + CtlColorScrollbar = 0x0137, + + /// <summary> + /// A static control, or an edit control that is read-only or disabled, sends the <see cref="CtlColorStatic"/> + /// message to its parent window when the control is about to be drawn. + /// By responding to this message, the parent window can use the specified device context handle + /// to set the text and background colors of the static control. + /// </summary> + CtlColorStatic = 0x0138, + + /// <summary> + /// Retrieves the menu handle for the current window. + /// </summary> + GetHMenu = 0x01E1, + + /// <summary> + /// Posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window + /// that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + MouseMove = 0x0200, + + /// <summary> + /// Use to specify the first mouse message. Use the + /// <see cref="User32.Message.PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </summary> + MouseFirst = 0x0200, + + /// <summary> + /// Posted when the user presses the left mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + LButtonDown = 0x0201, + + /// <summary> + /// Posted when the user releases the left mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + LButtonUp = 0x0202, + + /// <summary> + /// Posted when the user double-clicks the left mouse button while the cursor is in the client area of a + /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + LButtonDoubleClick = 0x0203, + + /// <summary> + /// Posted when the user presses the right mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + RButtonDown = 0x0204, + + /// <summary> + /// Posted when the user releases the right mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + RButtonUp = 0x0205, + + /// <summary> + /// Posted when the user double-clicks the right mouse button while the cursor is in the client area of a + /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + RButtonDoubleClick = 0x0206, + + /// <summary> + /// Posted when the user presses the middle mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + MButtonDown = 0x0207, + + /// <summary> + /// Posted when the user releases the middle mouse button while the cursor is in the client area of a window. + /// If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + MButtonUp = 0x0208, + + /// <summary> + /// Posted when the user double-clicks the middle mouse button while the cursor is in the client area of a + /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + MButtonDoubleClick = 0x0209, + + /// <summary> + /// Sent to the focus window when the mouse wheel is rotated. The + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function propagates the message to the window's parent. There should be no internal forwarding of the + /// message, since + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// propagates it up the parent chain until it finds a window that processes it. + /// </summary> + MouseWheel = 0x020A, + + /// <summary> + /// Posted when the user presses the first or second X button while the cursor is in the client area of a + /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, + /// the message is posted to the window that has captured the mouse. + /// </summary> + XButtonDown = 0x020B, + + /// <summary> + /// Posted when the user releases the first or second X button while the cursor is in the client area of a + /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + XButtonUp = 0x020C, + + /// <summary> + /// Posted when the user double-clicks the first or second X button while the cursor is in the client area of + /// a window. If the mouse is not captured, the message is posted to the window beneath the cursor. + /// Otherwise, the message is posted to the window that has captured the mouse. + /// </summary> + XButtonDoubleClick = 0x020D, + + /// <summary> + /// Sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function propagates the message to the window's parent. There should be no internal forwarding of the + /// message, since + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// propagates it up the parent chain until it finds a window that processes it. + /// </summary> + MouseHWheel = 0x020E, + + /// <summary> + /// Same as <see cref="MouseHWheel"/>. Documentation incomplete. + /// </summary> + MouseLast = 0x020E, + + /// <summary> + /// Sent to the parent of a child window when the child window is created or destroyed, or when the user + /// clicks a mouse button while the cursor is over the child window. When the child window is being created, + /// the system sends <see cref="ParentNotify"/> just before the CreateWindow or + /// <see cref="User32.Window.CreateWindowEx(ExtendedWindowStyles, string, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> + /// function that creates the window returns. When the child window is being destroyed, the system sends the + /// message before any processing to destroy the window takes place. + /// </summary> + ParentNotify = 0x0210, + + /// <summary> + /// Informs an application's main window procedure that a menu modal loop has been entered. + /// </summary> + EnterMenuLoop = 0x0211, + + /// <summary> + /// Informs an application's main window procedure that a menu modal loop has been exited. + /// </summary> + ExitMenuLoop = 0x0212, + + /// <summary> + /// Sent to an application when the right or left arrow key is used + /// to switch between the menu bar and the system menu. + /// </summary> + NextMenu = 0x0213, + + /// <summary> + /// Sent to a window that the user is resizing. By processing this message, an application can monitor + /// the size and position of the drag rectangle and, if needed, change its size or position. + /// </summary> + Sizing = 0x0214, + + /// <summary> + /// Sent to the window that is losing the mouse capture. + /// </summary> + CaptureChanged = 0x0215, + + /// <summary> + /// Sent to a window that the user is moving. By processing this message, an application can monitor + /// the position of the drag rectangle and, if needed, change its position. + /// </summary> + Moving = 0x0216, + + /// <summary> + /// Notifies applications that a power-management event has occurred. + /// </summary> + PowerBroadcast = 0x0218, + + /// <summary> + /// Notifies an application of a change to the hardware configuration of a device or the computer. + /// </summary> + DeviceChange = 0x0219, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to create an MDI child window. + /// </summary> + MdiCreate = 0x0220, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to close an MDI child window. + /// </summary> + MdiDestroy = 0x0221, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to instruct the client window + /// to activate a different MDI child window. + /// </summary> + MdiActivate = 0x0222, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to restore an MDI child + /// window from maximized or minimized size. + /// </summary> + MdiRestore = 0x0223, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to activate the + /// next or previous child window. + /// </summary> + MdiNext = 0x0224, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to maximize an MDI + /// child window. The system resizes the child window to make its client area fill the client window. The + /// system places the child window's window menu icon in the rightmost position of the frame window's menu bar, + /// and places the child window's restore icon in the leftmost position. The system also appends the title bar + /// text of the child window to that of the frame window. + /// </summary> + MdiMaximize = 0x0225, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to arrange all of its MDI + /// child windows in a tile format. + /// </summary> + MdiTile = 0x0226, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to arrange all its MDI + /// child windows in a cascade format. + /// </summary> + MdiCascade = 0x0227, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to arrange all minimized MDI + /// child windows. It does not affect child windows that are not minimized. + /// </summary> + MdiIconArrange = 0x0228, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to retrieve the handle + /// to the active MDI child window. + /// </summary> + MdiGetActive = 0x0229, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to replace the entire menu + /// of an MDI frame window, to replace the window menu of the frame window, or both. + /// </summary> + MdiSetMenu = 0x0230, + + /// <summary> + /// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or + /// sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes + /// the <see cref="SystemCommand"/> message to the + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. + /// The operation is complete when + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// returns. + /// </summary> + EnterSizeMove = 0x0231, + + /// <summary> + /// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the + /// moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the + /// window passes the <see cref="SystemCommand"/> message to the + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. + /// The operation is complete when + /// <see cref="User32.Window.DefWindowProc(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// returns. + /// </summary> + ExitSizeMove = 0x0232, + + /// <summary> + /// Sent when the user drops a file on the window of an application that + /// has registered itself as a recipient of dropped files. + /// </summary> + DropFiles = 0x0233, + + /// <summary> + /// Sent to a multiple-document interface (MDI) client window by an application to refresh + /// the window menu of the MDI frame window. + /// </summary> + MdiRefreshMenu = 0x0234, + + /// <summary> + /// Sent to a window when there is a change in the settings of a monitor that has a digitizer attached to it. + /// This message contains information regarding the scaling of the display mode.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + PointerDeviceChange = 0x0238, + + /// <summary> + /// Sent to a window when a pointer device is detected within range of an input digitizer. + /// This message contains information regarding the device and its proximity.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + PointerDeviceInRange = 0x0239, + + /// <summary> + /// Sent to a window when a pointer device has departed the range of an input digitizer. + /// This message contains information regarding the device and its proximity.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + PointerDeviceOutOfRange = 0x023A, + + /// <summary> + /// Notifies the window when one or more touch points, such as a finger or pen, + /// touches a touch-sensitive digitizer surface.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + Touch = 0x0240, + + /// <summary> + /// Posted to provide an update on a pointer that made contact over the non-client area of a window or when a + /// hovering uncaptured contact moves over the non-client area of a window. While the pointer is hovering, + /// the message targets whichever window the pointer happens to be over. While the pointer is in contact with + /// the surface, the pointer is implicitly captured to the window over which the pointer made contact and that + /// window continues to receive input for the pointer until it breaks contact.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + NCPointerUpdate = 0x0241, + + /// <summary> + /// Posted when a pointer makes contact over the non-client area of a window. The message targets the window + /// over which the pointer makes contact. The pointer is implicitly captured to the window so that the window + /// continues to receive input for the pointer until it breaks contact.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + NCPointerDown = 0x0242, + + /// <summary> + /// Posted when a pointer that made contact over the non-client area of a window breaks contact. The message + /// targets the window over which the pointer makes contact and the pointer is, at that point, implicitly + /// captured to the window so that the window continues to receive input for the pointer until it breaks + /// contact, including the <see cref="NCPointerUp"/> notification.<para/> + /// If a window has captured this pointer, this message is not posted. Instead, a <see cref="PointerUp"/> + /// is posted to the window that has captured this pointer.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + NCPointerUp = 0x0243, + + /// <summary> + /// Posted to provide an update on a pointer that made contact over the client area of a window or on a + /// hovering uncaptured pointer over the client area of a window. While the pointer is hovering, the message + /// targets whichever window the pointer happens to be over. While the pointer is in contact with the surface, + /// the pointer is implicitly captured to the window over which the pointer made contact and that window + /// continues to receive input for the pointer until it breaks contact.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerUpdate = 0x0245, + + /// <summary> + /// Posted when a pointer makes contact over the client area of a window. This input message targets the + /// window over which the pointer makes contact, and the pointer is implicitly captured to the window so + /// that the window continues to receive input for the pointer until it breaks contact.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerDown = 0x0246, + + /// <summary> + /// Posted when a pointer that made contact over the client area of a window breaks contact. This input + /// message targets the window over which the pointer makes contact and the pointer is, at that point, + /// implicitly captured to the window so that the window continues to receive input messages including + /// the <see cref="PointerUp"/> notification for the pointer until it breaks contact.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerUp = 0x0247, + + /// <summary> + /// Sent to a window when a new pointer enters detection range over the window (hover) or when an + /// existing pointer moves within the boundaries of the window.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerEnter = 0x0249, + + /// <summary> + /// Sent to a window when a pointer leaves detection range over the window (hover) or when a + /// pointer moves outside the boundaries of the window.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerLeave = 0x024A, + + /// <summary> + /// Sent to an inactive window when a primary pointer generates a <see cref="PointerDown"/> over the window. + /// As long as the message remains unhandled, it travels up the parent window chain until it is reaches the + /// top-level window. Applications can respond to this message to specify whether they wish to be activated. + /// <para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerActivate = 0x024B, + + /// <summary> + /// Sent to a window that is losing capture of an input pointer.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerCaptureChanged = 0x024C, + + /// <summary> + /// Sent to a window on a touch down in order to determine the most probable touch target.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + TouchHitTesting = 0x024D, + + /// <summary> + /// Posted to the window with foreground keyboard focus when a scroll wheel is rotated.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerWheel = 0x024E, + + /// <summary> + /// Posted to the window with foreground keyboard focus when a horizontal scroll wheel is rotated.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerHWheel = 0x024F, + + /// <summary> + /// This member is not officially documented. Use with care.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerHitTest = 0x0250, + + /// <summary> + /// Sent when ongoing pointer input, for an existing pointer ID, transitions from one process to another + /// across content configured for cross-process chaining (AddContentWithCrossProcessChaining).<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerRoutedTo = 0x0251, + + /// <summary> + /// Sent when pointer input transitions from one process to another across content configured for + /// cross-process chaining (AddContentWithCrossProcessChaining).<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerRoutedAway = 0x0252, + + /// <summary> + /// Sent to all processes (configured for cross-process chaining through AddContentWithCrossProcessChaining + /// and not currently handling pointer input) ever associated with a specific pointer ID, + /// when a <see cref="PointerUp"/> message is received on the current process.<para/> + /// Only supported on Windows 8 and higher. + /// </summary> + PointerRoutedReleased = 0x0253, + + /// <summary> + /// Sent to an application when a window is activated. + /// </summary> + ImeSetContext = 0x0281, + + /// <summary> + /// Sent to an application to notify it of changes to the IME window. + /// </summary> + ImeNotify = 0x0282, + + /// <summary> + /// Sent by an application to direct the IME window to carry out the requested command. The application + /// uses this message to control the IME window that it has created. + /// </summary> + ImeControl = 0x0283, + + /// <summary> + /// Sent to an application when the IME window finds no space to extend the area for the composition window. + /// </summary> + ImeCompositionFull = 0x0284, + + /// <summary> + /// Sent to an application when the operating system is about to change the current IME. + /// </summary> + ImeSelect = 0x0285, + + /// <summary> + /// Sent to an application when the IME gets a character of the conversion result. + /// </summary> + ImeChar = 0x0286, + + /// <summary> + /// Sent to an application to provide commands and request information. + /// </summary> + ImeRequest = 0x0288, + + /// <summary> + /// Sent to an application by the IME to notify the application of a key press and to keep message order. + /// </summary> + ImeKeydown = 0x0290, + + /// <summary> + /// Sent to an application by the IME to notify the application of a key release and to keep message order. + /// </summary> + ImeKeyup = 0x0291, + + /// <summary> + /// Posted to a window when the cursor hovers over the nonclient area of the window for the period of time + /// specified in a prior call to <see cref="User32.Mouse.TrackMouseEvent(ref TrackMouseEvent)"/>. + /// </summary> + NCMouseHover = 0x02A0, + + /// <summary> + /// Posted to a window when the cursor hovers over the client area of the window for the period of time + /// specified in a prior call to <see cref="User32.Mouse.TrackMouseEvent(ref TrackMouseEvent)"/>. + /// </summary> + MouseHover = 0x02A1, + + /// <summary> + /// Posted to a window when the cursor leaves the nonclient area of the window specified + /// in a prior call to <see cref="User32.Mouse.TrackMouseEvent(ref TrackMouseEvent)"/>. + /// </summary> + NCMouseLeave = 0x02A2, + + /// <summary> + /// Posted to a window when the cursor leaves the client area of the window specified + /// in a prior call to <see cref="User32.Mouse.TrackMouseEvent(ref TrackMouseEvent)"/>. + /// </summary> + MouseLeave = 0x02A3, + + /// <summary> + /// Notifies applications of changes in session state. + /// </summary> + WtsSessionChange = 0x02B1, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + TabletFirst = 0x02C0, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + TabletLast = 0x02DF, + + /// <summary> + /// Sent when the effective dots per inch (dpi) for a window has changed. The DPI is the scale factor for a + /// window. There are multiple events that can cause the DPI to change.<para/> + /// Only supported on Windows 7 and higher. + /// </summary> + DpiChanged = 0x02E0, + + /// <summary> + /// For Per Monitor v2 top-level windows, this message is sent to all HWNDs in the child HWDN tree of the + /// window that is undergoing a DPI change. This message occurs before the top-level window receives + /// <see cref="DpiChanged"/>, and traverses the child tree from the bottom up.<para/> + /// Only supported on Windows 10. + /// </summary> + DpiChangedBeforeParent = 0x02E2, + + /// <summary> + /// For Per Monitor v2 top-level windows, this message is sent to all HWNDs in the child HWDN tree of the + /// window that is undergoing a DPI change. This message occurs after the top-level window receives + /// <see cref="DpiChanged"/>, and traverses the child tree from the top down.<para/> + /// Only supported on Windows 10. + /// </summary> + DpiChangedAfterParent = 0x02E3, + + /// <summary> + /// This message tells the operating system that the window will be sized to dimensions other than the default. + /// <para/> + /// Only supported on Windows 10. + /// </summary> + GetDpiScaledSize = 0x02E4, + + /// <summary> + /// Sent to an edit control or combo box by an application to delete (cut) the current selection, + /// if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. + /// </summary> + Cut = 0x0300, + + /// <summary> + /// Sent to an edit control or combo box by an application to copy the current selection + /// to the clipboard in CF_TEXT format. + /// </summary> + Copy = 0x0301, + + /// <summary> + /// Sent to an edit control or combo box by an application to copy the current content of the clipboard to the + /// edit control at the current caret position. + /// Data is inserted only if the clipboard contains data in CF_TEXT format. + /// </summary> + Paste = 0x0302, + + /// <summary> + /// Sent to an edit control or combo box by an application to delete (clear) the current selection, + /// if any, from the edit control. + /// </summary> + Clear = 0x0303, + + /// <summary> + /// Sent to an edit control by an application to undo the last operation. When this message is sent to + /// an edit control, the previously deleted text is restored or the previously added text is deleted. + /// </summary> + Undo = 0x0304, + + /// <summary> + /// Sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application + /// has requested data in that format. The clipboard owner must render data in the specified format + /// and place it on the clipboard by calling the SetClipboardData function. + /// </summary> + RenderFormat = 0x0305, + + /// <summary> + /// Sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or + /// more clipboard formats. For the content of the clipboard to remain available to other applications, + /// the clipboard owner must render data in all the formats it is capable of generating, and place the + /// data on the clipboard by calling the SetClipboardData function. + /// </summary> + RenderAllFormats = 0x0306, + + /// <summary> + /// Sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. + /// </summary> + DestroyClipboard = 0x0307, + + /// <summary> + /// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This + /// enables a clipboard viewer window to display the new content of the clipboard. + /// </summary> + DrawClipboard = 0x0308, + + /// <summary> + /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the + /// CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. + /// </summary> + PaintClipboard = 0x0309, + + /// <summary> + /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the + /// CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. + /// The owner should scroll the clipboard image and update the scroll bar values. + /// </summary> + VScrollClipboard = 0x030A, + + /// <summary> + /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the + /// CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. + /// </summary> + SizeClipboard = 0x030B, + + /// <summary> + /// Sent to the clipboard owner by a clipboard viewer window to request the name of a + /// CF_OWNERDISPLAY clipboard format. + /// </summary> + AskClipboardFormatName = 0x030C, + + /// <summary> + /// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain. + /// </summary> + ChangeClipboardChain = 0x030D, + + /// <summary> + /// Sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in + /// the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner + /// should scroll the clipboard image and update the scroll bar values. + /// </summary> + HScrollClipboard = 0x030E, + + /// <summary> + /// Informs a window that it is about to receive the keyboard focus, giving the window the opportunity + /// to realize its logical palette when it receives the focus. + /// </summary> + QueryNewPalette = 0x030F, + + /// <summary> + /// Informs applications that an application is going to realize its logical palette. + /// </summary> + PaletteIsChanging = 0x0310, + + /// <summary> + /// Sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes + /// its logical palette. This message enables windows that do not have the keyboard focus to realize + /// their logical palettes and update their client areas. + /// </summary> + PaletteChanged = 0x0311, + + /// <summary> + /// Posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed + /// at the top of the message queue associated with the thread that registered the hot key. + /// </summary> + Hotkey = 0x0312, + + /// <summary> + /// Sent to a window to request that it draw itself in the specified device context, + /// most commonly in a printer device context. + /// </summary> + Print = 0x0317, + + /// <summary> + /// Sent to a window to request that it draw its client area in the specified device context, + /// most commonly in a printer device context. + /// </summary> + PrintClient = 0x0318, + + /// <summary> + /// Notifies a window that the user generated an application command event, for example, by clicking an + /// application command button using the mouse or typing an application command key on the keyboard.<para/> + /// </summary> + AppCommand = 0x0319, + + /// <summary> + /// Broadcast to every window following a theme change event. Examples of theme change events are the + /// activation of a theme, the deactivation of a theme, or a transition from one theme to another. + /// </summary> + ThemeChanged = 0x031A, + + /// <summary> + /// Sent when the contents of the clipboard have changed. + /// </summary> + ClipboardUpdate = 0x031D, + + /// <summary> + /// Informs all top-level windows that Desktop Window Manager (DWM) composition has been enabled or disabled. + /// <para/> + /// Only supported on Windows Vista or higher. + /// </summary> + DwmCompositionChanged = 0x031E, + + /// <summary> + /// Sent when the non-client area rendering policy has changed.<para/> + /// Only supported on Windows Vista or higher. + /// </summary> + DwmNCRenderingChanged = 0x031F, + + /// <summary> + /// Informs all top-level windows that the colorization color has changed.<para/> + /// Only supported on Windows Vista or higher. + /// </summary> + DwmColorizationColorChanged = 0x0320, + + /// <summary> + /// Sent when a Desktop Window Manager (DWM) composed window is maximized.<para/> + /// Only supported on Windows Vista or higher. + /// </summary> + DwmWindowMaximizedChange = 0x0321, + + /// <summary> + /// Instructs a window to provide a static bitmap to use as a thumbnail representation of that window.<para/> + /// Only supported on Windows 7 or higher. + /// </summary> + DwmSendIconicThumbnail = 0x0323, + + /// <summary> + /// Instructs a window to provide a static bitmap to use as a + /// live preview (also known as a Peek preview) of that window.<para/> + /// Only supported on Windows 7 or higher. + /// </summary> + DwmSendIconicLivePreviewBitmap = 0x0326, + + /// <summary> + /// Sent to request extended title bar information.<para/> + /// Only supported on Windows Vista or higher. + /// </summary> + GetTitleBarInfoEx = 0x033F, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + HandheldFirst = 0x0358, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + HandheldLast = 0x035F, + + /// <summary> + /// Specifies the first afx message. + /// </summary> + AfxFirst = 0x0360, + + /// <summary> + /// Specifies the last afx message. + /// </summary> + AfxLast = 0x037F, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + PenWinFirst = 0x0380, + + /// <summary> + /// This member is not officially documented. Use with care. + /// </summary> + PenWinLast = 0x038F, + + /// <summary> + /// Used by applications to help define private messages, + /// usually of the form <see cref="App"/> + X, where X is an integer value. + /// </summary> + App = 0x8000, + + /// <summary> + /// Used by applications to help define private messages for use by private window classes, + /// usually of the form <see cref="User"/> + X, where X is an integer value. + /// </summary> + User = 0x0400, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs b/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs new file mode 100644 index 00000000..5085e507 --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs @@ -0,0 +1,34 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// The type of resizing requested by a <see cref="WindowMessage.Size"/>. + /// </summary> + public enum WindowMessageSizeType + { + /// <summary> + /// The window has been resized, but neither the <see cref="Minimized"/> + /// nor <see cref="Maximized"/> value applies. + /// </summary> + Restored = 0, + + /// <summary> + /// The window has been minimized. + /// </summary> + Minimized = 1, + + /// <summary> + /// The window has been maximized. + /// </summary> + Maximized = 2, + + /// <summary> + /// Message is sent to all pop-up windows when some other window has been restored to its former size. + /// </summary> + MaxShow = 3, + + /// <summary> + /// Message is sent to all pop-up windows when some other window is maximized. + /// </summary> + MaxHide = 4, + } +} diff --git a/Crow/src/backends/win32/User32/Enums/WindowStyles.cs b/Crow/src/backends/win32/User32/Enums/WindowStyles.cs new file mode 100644 index 00000000..501e9dee --- /dev/null +++ b/Crow/src/backends/win32/User32/Enums/WindowStyles.cs @@ -0,0 +1,179 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Every window has one or more window styles. A window style is a named constant that defines an aspect of the + /// window's appearance and behavior that is not specified by the window's class. An application usually sets + /// window styles when creating windows. It can also set the styles after creating a window by using the + /// <see cref="User32.Window.SetWindowLong(IntPtr, int, int)"/> function. + /// </summary> + [Flags] + public enum WindowStyles : uint + { + /// <summary> + /// The window is an overlapped window. An overlapped window has a title bar and a border. + /// Same as the <see cref="Tiled"/> style. + /// </summary> + Overlapped = 0x00000000, + + /// <summary> + /// The window is an overlapped window. An overlapped window has a title bar and a border. + /// Same as the <see cref="Overlapped"/> style. + /// </summary> + Tiled = Overlapped, + + /// <summary> + /// The window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing + /// the TAB key changes the keyboard focus to the next control with the <see cref="TabStop"/> style.<para/> + /// You can turn this style on and off to change dialog box navigation. To change this style after a window + /// has been created, use the <see cref="User32.Window.SetWindowLong(IntPtr, GetWindowLongIndex, IntPtr)"/> + /// function. For user-created windows and modeless dialogs to work with tab stops, + /// alter the message loop to call the IsDialogMessage function. + /// </summary> + TabStop = 0x00010000, + + /// <summary> + /// The window has a maximize button. Cannot be combined with the + /// <see cref="ExtendedWindowStyles.ContextHelp"/> style. The <see cref="SystemMenu"/> + /// style must also be specified. + /// </summary> + MaximizeBox = 0x00010000, + + /// <summary> + /// The window is the first control of a group of controls. The group consists of this first control and all + /// controls defined after it, up to the next control with the <see cref="Group"/> style. The first control + /// in each group usually has the <see cref="TabStop"/> style so that the user can move from group to group. + /// The user can subsequently change the keyboard focus from one control in the group to + /// the next control in the group by using the direction keys.<para/> + /// You can turn this style on and off to change dialog box navigation. To change this style after a window + /// has been created, use the <see cref="User32.Window.SetWindowLong(IntPtr, GetWindowLongIndex, IntPtr)"/> + /// function. + /// </summary> + Group = 0x00020000, + + /// <summary> + /// The window has a minimize button. Cannot be combined with the + /// <see cref="ExtendedWindowStyles.ContextHelp"/> style. + /// The <see cref="SystemMenu"/> style must also be specified. + /// </summary> + MinimizeBox = 0x00020000, + + /// <summary> + /// The window has a sizing border. Same as the <see cref="SizeBox"/> style. + /// </summary> + ThickFrame = 0x00040000, + + /// <summary> + /// The window has a sizing border. Same as the <see cref="ThickFrame"/> style. + /// </summary> + SizeBox = ThickFrame, + + /// <summary> + /// The window has a window menu on its title bar. The <see cref="Caption"/> style must also be specified. + /// </summary> + SystemMenu = 0x00080000, + + /// <summary> + /// The window has a horizontal scroll bar. + /// </summary> + HScroll = 0x00100000, + + /// <summary> + /// The window has a vertical scroll bar. + /// </summary> + VScroll = 0x00200000, + + /// <summary> + /// The window has a border of a style typically used with dialog boxes. + /// A window with this style cannot have a title bar. + /// </summary> + DialogFrame = 0x00400000, + + /// <summary> + /// The window has a thin-line border. + /// </summary> + Border = 0x00800000, + + /// <summary> + /// The window has a title bar (includes the <see cref="Border"/> style). + /// </summary> + Caption = Border | DialogFrame, + + /// <summary> + /// The window is initially maximized. + /// </summary> + Maximize = 0x01000000, + + /// <summary> + /// Excludes the area occupied by child windows when drawing occurs within the parent window. + /// This style is used when creating the parent window. + /// </summary> + ClipChildren = 0x02000000, + + /// <summary> + /// Clips child windows relative to each other; that is, when a particular child window receives a + /// <see cref="WindowMessage.Paint"/> message, the <see cref="ClipSiblings"/> style clips all other overlapping + /// child windows out of the region of the child window to be updated. If <see cref="ClipSiblings"/> is not + /// specified and child windows overlap, it is possible, when drawing within the client area of a child window, + /// to draw within the client area of a neighboring child window. + /// </summary> + ClipSiblings = 0x04000000, + + /// <summary> + /// The window is initially disabled. A disabled window cannot receive input from the user. To change this + /// after a window has been created, use the EnableWindow function. + /// </summary> + Disabled = 0x08000000, + + /// <summary> + /// The window is initially visible.<para/> + /// This style can be turned on and off by using the + /// <see cref="User32.Window.ShowWindow(IntPtr, ShowWindowCommand)"/> or <see cref="User32.Window.SetWindowPos( + /// IntPtr, SetWindowPosHwndEnum, int, int, int, int, SetWindowPosFlags)"/> function. + /// </summary> + Visible = 0x10000000, + + /// <summary> + /// The window is initially minimized. Same as the <see cref="Iconic"/> style. + /// </summary> + Minimize = 0x20000000, + + /// <summary> + /// The window is initially minimized. Same as the <see cref="Minimize"/> style. + /// </summary> + Iconic = Minimize, + + /// <summary> + /// The window is a child window. A window with this style cannot have a menu bar. + /// This style cannot be used with the <see cref="Popup"/> style. + /// </summary> + Child = 0x40000000, + + /// <summary> + /// Same as the <see cref="Child"/> style. + /// </summary> + ChildWindow = Child, + + /// <summary> + /// The windows is a pop-up window. This style cannot be used with the <see cref="Child"/> style. + /// </summary> + Popup = 0x80000000, + + /// <summary> + /// The window is an overlapped window. Same as the <see cref="TiledWindow"/> style. + /// </summary> + OverlappedWindow = Overlapped | Caption | SystemMenu | ThickFrame | MinimizeBox | MaximizeBox, + + /// <summary> + /// The window is an overlapped window. Same as the <see cref="OverlappedWindow"/> style. + /// </summary> + TiledWindow = OverlappedWindow, + + /// <summary> + /// The window is a pop-up window. The <see cref="Caption"/> and + /// <see cref="PopupWindow"/> styles must be combined to make the window menu visible. + /// </summary> + PopupWindow = Popup | Border | SystemMenu, + } +} diff --git a/Crow/src/backends/win32/User32/Icon.cs b/Crow/src/backends/win32/User32/Icon.cs new file mode 100644 index 00000000..468aabe7 --- /dev/null +++ b/Crow/src/backends/win32/User32/Icon.cs @@ -0,0 +1,159 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with icons. + /// </summary> + public static class Icon + { + /// <summary> + /// Creates an icon or cursor from an <see cref="IconInfo"/> structure. + /// </summary> + /// <param name="iconInfo"> + /// An <see cref="IconInfo"/> structure the function uses to create the icon or cursor. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle to the icon or cursor that is created.<para/> + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern IntPtr CreateIconIndirect([In] ref IconInfo iconInfo); + + /// <summary> + /// Destroys an icon and frees any memory the icon occupied. + /// </summary> + /// <param name="icon">A handle to the icon to be destroyed. The icon must not be in use.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DestroyIcon([In] IntPtr icon); + + /// <summary> + /// Retrieves information about the specified icon or cursor. + /// </summary> + /// <param name="icon">A handle to the icon or cursor.</param> + /// <param name="iconInfo"> + /// A pointer to an <see cref="IconInfo"/> structure. The function fills in the structure's members. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true and the function + /// fills in the members of the specified <see cref="IconInfo"/> structure.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetIconInfo([In] IntPtr icon, [Out] out IconInfo iconInfo); + + /// <summary> + /// Retrieves information about the specified pre-defined cursor. + /// </summary> + /// <param name="cursorName">One of the pre-defined cursors.</param> + /// <param name="iconInfo"> + /// A pointer to an <see cref="IconInfo"/> structure. The function fills in the structure's members. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true and the function + /// fills in the members of the specified <see cref="IconInfo"/> structure.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static bool GetIconInfo(CursorName cursorName, out IconInfo iconInfo) + { + return GetIconInfo(new IntPtr((int)cursorName), out iconInfo); + } + + /// <summary> + /// Retrieves information about the specified pre-defined icon. + /// </summary> + /// <param name="iconName">One of the pre-defined cursors.</param> + /// <param name="iconInfo"> + /// A pointer to an <see cref="IconInfo"/> structure. The function fills in the structure's members. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true and the function + /// fills in the members of the specified <see cref="IconInfo"/> structure.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static bool GetIconInfo(IconName iconName, out IconInfo iconInfo) + { + return GetIconInfo(new IntPtr((int)iconName), out iconInfo); + } + + /// <summary> + /// Loads the specified icon resource from the executable (.exe) + /// file associated with an application instance. + /// </summary> + /// <param name="moduleInstance"> + /// A handle to an instance of the module whose executable file contains the icon to be loaded. + /// This parameter must be <see cref="IntPtr.Zero"/> when a standard icon is being loaded. + /// </param> + /// <param name="iconName">The name of the icon resource to be loaded.</param> + /// <returns> + /// If the function succeeds, the return value is a handle to the newly loaded icon.<para/> + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern IntPtr LoadIcon([In] [Optional] IntPtr moduleInstance, [In] string iconName); + + /// <summary> + /// Loads the specified icon resource from the executable (.exe) + /// file associated with an application instance. + /// </summary> + /// <param name="moduleInstance"> + /// A handle to an instance of the module whose executable file contains the icon to be loaded. + /// This parameter must be <see cref="IntPtr.Zero"/> when a standard icon is being loaded. + /// </param> + /// <param name="iconName">A pointer to a string with the name of the icon resource to be loaded.</param> + /// <returns> + /// If the function succeeds, the return value is a handle to the newly loaded icon.<para/> + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern IntPtr LoadIcon([In] [Optional] IntPtr moduleInstance, [In] IntPtr iconName); + + /// <summary> + /// Loads the specified icon resource from the executable (.exe) + /// file associated with an application instance. + /// </summary> + /// <param name="cursorName">One of the pre-defined cursors to be loaded.</param> + /// <returns> + /// If the function succeeds, the return value is a handle to the newly loaded icon.<para/> + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr LoadIcon(CursorName cursorName) + { + return LoadIcon(IntPtr.Zero, new IntPtr((int)cursorName)); + } + + /// <summary> + /// Loads the specified icon resource from the executable (.exe) + /// file associated with an application instance. + /// </summary> + /// <param name="iconName">One of the pre-defined icons to be loaded.</param> + /// <returns> + /// If the function succeeds, the return value is a handle to the newly loaded icon.<para/> + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr LoadIcon(IconName iconName) + { + return LoadIcon(IntPtr.Zero, new IntPtr((int)iconName)); + } + } + } +} diff --git a/Crow/src/backends/win32/User32/Keyboard.cs b/Crow/src/backends/win32/User32/Keyboard.cs new file mode 100644 index 00000000..5c86e436 --- /dev/null +++ b/Crow/src/backends/win32/User32/Keyboard.cs @@ -0,0 +1,93 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with the keyboard. + /// </summary> + public static class Keyboard + { + /// <summary> + /// Retrieves the status of the specified virtual key. The status specifies whether the key is up, down, + /// or toggled (on, off—alternating each time the key is pressed). + /// </summary> + /// <param name="key">The desired virtual key.</param> + /// <returns> + /// The return value specifies the status of the specified virtual key, as follows:<para/> + /// If the high-order bit is 1, the key is down; otherwise, it is up.<para/> + /// If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is + /// turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light + /// (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern short GetKeyState([In] VirtualKey key); + + /// <summary> + /// Determines whether a key is up or down at the time the function is called, + /// and whether the key was pressed after a previous call to GetAsyncKeyState. + /// </summary> + /// <param name="key">The desired virtual key.</param> + /// <returns> + /// If the function succeeds, the return value specifies whether the key was pressed since the last call + /// to <see cref="GetAsyncKeyState(VirtualKey)"/>, and whether the key is currently up or down. If the + /// most significant bit is set, the key is down, and if the least significant bit is set, the key was + /// pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last + /// behavior; for more information, see the Remarks section in the official documentation. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern short GetAsyncKeyState([In] VirtualKey key); + + /// <summary> + /// Retrieves the handle to the window that has the keyboard focus, + /// if the window is attached to the calling thread's message queue. + /// </summary> + /// <returns> + /// The return value is the handle to the window with the keyboard focus. If the calling thread's message + /// queue does not have an associated window with the keyboard focus, + /// the return value is <see cref="IntPtr.Zero"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr GetFocus(); + + /// <summary> + /// Sets the keyboard focus to the specified window. + /// The window must be attached to the calling thread's message queue. + /// </summary> + /// <param name="window">A handle to the window that will receive the keyboard input. + /// If this parameter is <see cref="IntPtr.Zero"/>, keystrokes are ignored.</param> + /// <returns> + /// If the function succeeds, the return value is the handle to the window that previously had the + /// keyboard focus. If the <paramref name="window"/> parameter is invalid or the window is not attached + /// to the calling thread's message queue, the return value is <see cref="IntPtr.Zero"/>.<para/> + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern IntPtr SetFocus([In] [Optional] IntPtr window); + + /// <summary> + /// Translates (maps) a virtual-key code into a scan code or character value, + /// or translates a scan code into a virtual-key code. + /// </summary> + /// <param name="vkey"> + /// The virtual key code or scan code for a key. + /// How this value is interpreted depends on the value of the <paramref name="mapType"/> parameter. + /// </param> + /// <param name="mapType">The translation to be performed.</param> + /// <returns> + /// The return value is either a scan code, a virtual-key code, or a character value, depending on + /// the value of <paramref name="vkey"/> and <paramref name="mapType"/>.<para/> + /// If there is no translation, the return value is zero. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern uint MapVirtualKey([In] VirtualKey vkey, [In] MapVirtualKeyType mapType); + } + } +} diff --git a/Crow/src/backends/win32/User32/Message.cs b/Crow/src/backends/win32/User32/Message.cs new file mode 100644 index 00000000..eac8d7be --- /dev/null +++ b/Crow/src/backends/win32/User32/Message.cs @@ -0,0 +1,307 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with messages. + /// </summary> + public static class Message + { + /// <summary> + /// A special constant value that can be used to send a message to all top-level windows, including + /// disabled or invisible unowned windows, overlapped windows, and pop-up windows; + /// but not to child windows. + /// </summary> + public static readonly IntPtr BroadcastHandle = new IntPtr(0xFFFF); + + /// <summary> + /// Dispatches incoming sent messages, checks the thread message queue for a posted message, + /// and retrieves the message (if any exist). + /// </summary> + /// <param name="msg">A <see cref="Msg"/> structure that receives message information.</param> + /// <param name="window"> + /// A handle to the window whose messages are to be retrieved. + /// The window must belong to the current thread.<para/> + /// If <paramref name="window"/> is <see cref="IntPtr.Zero"/>, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> retrieves messages for any + /// window that belongs to the current thread, and any messages on the current thread's message queue whose + /// <paramref name="window"/> value is <see cref="IntPtr.Zero"/> (see the <see cref="Msg"/> structure). + /// Therefore if <paramref name="window"/> is <see cref="IntPtr.Zero"/>, both window messages + /// and thread messages are processed.<para/> + /// If <paramref name="window"/> is -1, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> retrieves only messages on the + /// current thread's message queue whose <paramref name="window"/> value is <see cref="IntPtr.Zero"/>, + /// that is, thread messages as posted by <see cref="PostMessage(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// (when the window parameter is <see cref="IntPtr.Zero"/>) or PostThreadMessage. + /// </param> + /// <param name="messageFilterMin"> + /// The value of the first message in the range of messages to be examined. + /// Use <see cref="WindowMessage.KeyFirst"/> to specify the first keyboard message or + /// <see cref="WindowMessage.MouseFirst"/> to specify the first mouse message.<para/> + /// If <paramref name="messageFilterMin"/> and <paramref name="messageFilterMax"/> are both zero, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> returns all available messages + /// (that is, no range filtering is performed). + /// </param> + /// <param name="messageFilterMax"> + /// The value of the last message in the range of messages to be examined. Use + /// <see cref="WindowMessage.KeyLast"/> to specify the last keyboard message or + /// <see cref="WindowMessage.MouseLast"/> to specify the last mouse message.<para/> + /// If <paramref name="messageFilterMin"/> and <paramref name="messageFilterMax"/> are both zero, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> returns all available messages + /// (that is, no range filtering is performed). + /// </param> + /// <param name="messageActions">Specifies how messages are to be handled.</param> + /// <returns> + /// If a message is available, the return value is true.<para/> + /// If no messages are available, the return value is false. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool PeekMessage + ( + [Out] out Msg msg, + [In] [Optional] IntPtr window, + [In] uint messageFilterMin, + [In] uint messageFilterMax, + [In] PeekMessageActions messageActions + ); + + /// <summary> + /// Retrieves a message from the calling thread's message queue. The function dispatches + /// incoming sent messages until a posted message is available for retrieval.<para/> + /// Unlike <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/>, the + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function does not wait + /// for a message to be posted before returning. + /// </summary> + /// <param name="msg"> + /// An <see cref="Msg"/> structure that receives message information from the thread's message queue. + /// </param> + /// <param name="window"> + /// A handle to the window whose messages are to be retrieved. + /// The window must belong to the current thread.<para/> + /// If <paramref name="window"/> is <see cref="IntPtr.Zero"/>, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> retrieves messages for any + /// window that belongs to the current thread, and any messages on the current thread's message queue whose + /// <paramref name="window"/> value is <see cref="IntPtr.Zero"/> (see the <see cref="Msg"/> structure). + /// Therefore if <paramref name="window"/> is <see cref="IntPtr.Zero"/>, both window messages + /// and thread messages are processed.<para/> + /// If <paramref name="window"/> is -1, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> retrieves only messages on the + /// current thread's message queue whose <paramref name="window"/> value is <see cref="IntPtr.Zero"/>, + /// that is, thread messages as posted by <see cref="PostMessage(IntPtr, WindowMessage, IntPtr, IntPtr)"/> + /// (when the window parameter is <see cref="IntPtr.Zero"/>) or PostThreadMessage. + /// </param> + /// <param name="messageFilterMin"> + /// The value of the first message in the range of messages to be examined. + /// Use <see cref="WindowMessage.KeyFirst"/> to specify the first keyboard message or + /// <see cref="WindowMessage.MouseFirst"/> to specify the first mouse message.<para/> + /// Use <see cref="WindowMessage.Input"/> here and in <paramref name="messageFilterMax"/> to specify only + /// the <see cref="WindowMessage.Input"/> messages.<para/> + /// If <paramref name="messageFilterMin"/> and <paramref name="messageFilterMax"/> are both zero, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> returns all available messages + /// (that is, no range filtering is performed). + /// </param> + /// <param name="messageFilterMax"> + /// The value of the last message in the range of messages to be examined. Use + /// <see cref="WindowMessage.KeyLast"/> to specify the last keyboard message or + /// <see cref="WindowMessage.MouseLast"/> to specify the last mouse message.<para/> + /// Use <see cref="WindowMessage.Input"/> here and in <paramref name="messageFilterMin"/> to specify only + /// the <see cref="WindowMessage.Input"/> messages.<para/> + /// If <paramref name="messageFilterMin"/> and <paramref name="messageFilterMax"/> are both zero, + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> returns all available messages + /// (that is, no range filtering is performed). + /// </param> + /// <returns> + /// If the function retrieves a message other than <see cref="WindowMessage.Quit"/>, + /// the return value is true.<para/> + /// If the function retrieves the <see cref="WindowMessage.Quit"/> message, the return value is false. + /// <para/> + /// If there is an error, the return value is -1. For example, the function fails if + /// <paramref name="window"/> is an invalid window handle or <paramref name="msg"/> is an invalid pointer. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern int GetMessage + ( + [Out] out Msg msg, + [In] [Optional] IntPtr window, + [In] uint messageFilterMin, + [In] uint messageFilterMax + ); + + /// <summary> + /// Retrieves the message time for the last message retrieved by the + /// <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/> function. The time is a long integer that + /// specifies the elapsed time, in milliseconds, from the time the system was started to the time the + /// message was created (that is, placed in the thread's message queue). + /// </summary> + /// <returns>The return value specifies the message time.</returns> + [DllImport(Library)] + public static extern int GetMessageTime(); + + /// <summary> + /// Sends the specified message to a window or windows. The + /// <see cref="SendMessage(IntPtr, WindowMessage, IntPtr, IntPtr)"/> function calls the window procedure for the + /// specified window and does not return until the window procedure has processed the message. + /// </summary> + /// <param name="window"> + /// A handle to the window whose window procedure will receive the message.<para/> + /// Message sending is subject to UIPI. The thread of a process can send messages only to message queues + /// of threads in processes of lesser or equal integrity level. + /// </param> + /// <param name="msg">The message to be sent.</param> + /// <param name="wparam">Additional message-specific information.</param> + /// <param name="lparam">Additional message-specific information.</param> + /// <returns> + /// The return value specifies the result of the message processing; it depends on the message sent. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern IntPtr SendMessage + ( + [In] IntPtr window, + [In] WindowMessage msg, + [In] IntPtr wparam, + [In] IntPtr lparam + ); + + /// <summary> + /// Sends a message to all top-level windows in the system, including disabled or invisible unowned + /// windows, overlapped windows, and pop-up windows; but not to child windows. + /// </summary> + /// <param name="msg">The message to be sent.</param> + /// <param name="wparam">Additional message-specific information.</param> + /// <param name="lparam">Additional message-specific information.</param> + /// <returns> + /// The return value specifies the result of the message processing; it depends on the message sent. + /// </returns> + /// <remarks> + /// This method uses the constant <see cref="BroadcastHandle"/> for this special behavior. + /// </remarks> + public static IntPtr SendMessageAsBroadcast(WindowMessage msg, IntPtr wparam, IntPtr lparam) + { + return SendMessage(BroadcastHandle, msg, wparam, lparam); + } + + /// <summary> + /// Places (posts) a message in the message queue associated with the thread that created the specified + /// window and returns without waiting for the thread to process the message. + /// </summary> + /// <param name="window"> + /// A handle to the window whose window procedure is to receive the message.<para/> + /// Starting with Windows Vista, message posting is subject to UIPI. The thread of a process can post + /// messages only to message queues of threads in processes of lesser or equal integrity level.<para/> + /// If <paramref name="window"/> is <see cref="IntPtr.Zero"/>, this function will behave like a call to + /// PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread. + /// </param> + /// <param name="msg">The message to be posted.</param> + /// <param name="wparam">Additional message-specific information.</param> + /// <param name="lparam">Additional message-specific information.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool PostMessage + ( + [In] [Optional] IntPtr window, + [In] WindowMessage msg, + [In] IntPtr wparam, + [In] IntPtr lparam + ); + + /// <summary> + /// Places (posts) a message to all top-level windows in the system, including disabled or invisible + /// unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows. + /// </summary> + /// <param name="msg">The message to be posted.</param> + /// <param name="wparam">Additional message-specific information.</param> + /// <param name="lparam">Additional message-specific information.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + /// <remarks> + /// This method uses the constant <see cref="BroadcastHandle"/> for this special behavior. + /// </remarks> + public static bool PostMessageAsBroadcast(WindowMessage msg, IntPtr wparam, IntPtr lparam) + { + return PostMessage(BroadcastHandle, msg, wparam, lparam); + } + + /// <summary> + /// Indicates to the system that a thread has made a request to terminate (quit). + /// It is typically used in response to a <see cref="WindowMessage.Destroy"/> message. + /// </summary> + /// <param name="exitCode"> + /// The application exit code. This value is used as the + /// wParam parameter of the <see cref="WindowMessage.Quit"/> message. + /// </param> + [DllImport(Library)] + public static extern void PostQuitMessage([In] int exitCode); + + /// <summary> + /// Dispatches a message to a window procedure. It is typically used to + /// dispatch a message retrieved by the <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/> function. + /// </summary> + /// <param name="msg">A structure that contains the message.</param> + /// <returns> + /// The return value specifies the value returned by the window procedure. + /// Although its meaning depends on the message being dispatched, the return value generally is ignored. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + public static extern IntPtr DispatchMessage([In] ref Msg msg); + + /// <summary> + /// Translates virtual-key messages into character messages. The character messages are posted to the + /// calling thread's message queue, to be read the next time the thread calls the + /// <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/> or + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </summary> + /// <param name="msg"> + /// An <see cref="Msg"/> structure that contains message information retrieved from the + /// calling thread's message queue by using the <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/> or + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </param> + /// <returns> + /// If the message is translated (that is, a character message is posted to the thread's message queue), + /// the return value is true.<para/> + /// If the message is <see cref="WindowMessage.KeyDown"/>, <see cref="WindowMessage.KeyUp"/>, + /// <see cref="WindowMessage.SystemKeyDown"/>, or <see cref="WindowMessage.SystemKeyUp"/>, + /// the return value is true, regardless of the translation.<para/> + /// If the message is not translated (that is, a character message is not posted to the + /// thread's message queue), the return value is false. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool TranslateMessage([In] ref Msg msg); + + /// <summary> + /// Retrieves the type of messages found in the calling thread's message queue. + /// </summary> + /// <param name="flags">The types of messages for which to check.</param> + /// <returns> + /// The high-order word of the return value indicates the types of messages currently in the queue. + /// The low-order word indicates the types of messages that have been added to the queue and that are + /// still in the queue since the last call to the <see cref="GetQueueStatus(QueueMessageTypes)"/>, + /// <see cref="GetMessage(out Msg, IntPtr, uint, uint)"/>, or + /// <see cref="PeekMessage(out Msg, IntPtr, uint, uint, PeekMessageActions)"/> function. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + public static extern uint GetQueueStatus([In] QueueMessageTypes flags); + } + } +} diff --git a/Crow/src/backends/win32/User32/Monitor.cs b/Crow/src/backends/win32/User32/Monitor.cs new file mode 100644 index 00000000..d7cc6cce --- /dev/null +++ b/Crow/src/backends/win32/User32/Monitor.cs @@ -0,0 +1,70 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with monitors. + /// </summary> + public static class Monitor + { + /// <summary> + /// Retrieves information about a display monitor. + /// </summary> + /// <param name="monitor">A handle to the display monitor of interest.</param> + /// <param name="monitorInfo"> + /// A pointer to a <see cref="MonitorInfo"/> or MONITORINFOEX structure + /// that receives information about the specified display monitor.<para/> + /// You must set the Size member of the structure to the respective structure's size in bytes + /// before calling the <see cref="GetMonitorInfo(IntPtr, out MonitorInfo)"/> function. Doing so + /// lets the function determine the type of structure you are passing to it. + /// </param> + /// <returns> + /// If the function succeeds, the return value is nonzero.<para/> + /// If the function fails, the return value is zero. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetMonitorInfo([In] IntPtr monitor, [Out] out MonitorInfo monitorInfo); + + /// <summary> + /// Retrieves a handle to the display monitor that contains a specified point. + /// </summary> + /// <param name="pt"> + /// A <see cref="Point"/> structure that specifies the point of interest in virtual-screen coordinates. + /// </param> + /// <param name="defaultTo"> + /// Determines the function's return value if the point is not contained within any display monitor. + /// </param> + /// <returns> + /// If the point is contained by a display monitor, + /// the return value is an <see cref="IntPtr"/> handle to that display monitor.<para/> + /// If the point is not contained by a display monitor, + /// the return value depends on the value of <paramref name="defaultTo"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr MonitorFromPoint([In] Point pt, [In] MonitorFromDefaultValue defaultTo); + + /// <summary> + /// Retrieves a handle to the display monitor that has the largest area of intersection + /// with the bounding rectangle of a specified window. + /// </summary> + /// <param name="window">A handle to the window of interest.</param> + /// <param name="defaultTo"> + /// Determines the function's return value if the window does not intersect any display monitor. + /// </param> + /// <returns> + /// If the window intersects one or more display monitor rectangles, the return value is an + /// <see cref="IntPtr"/> handle to the display monitor that + /// has the largest area of intersection with the window.<para/> + /// If the window does not intersect a display monitor, + /// the return value depends on the value of <paramref name="defaultTo"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr MonitorFromWindow([In] IntPtr window, [In] MonitorFromDefaultValue defaultTo); + } + } +} diff --git a/Crow/src/backends/win32/User32/Mouse.cs b/Crow/src/backends/win32/User32/Mouse.cs new file mode 100644 index 00000000..b61eaa2b --- /dev/null +++ b/Crow/src/backends/win32/User32/Mouse.cs @@ -0,0 +1,133 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with the mouse. + /// </summary> + public static class Mouse + { + /// <summary> + /// Retrieves a handle to the window (if any) that has captured the mouse. Only one window at a time can + /// capture the mouse; this window receives mouse input whether or not the cursor is within its borders. + /// </summary> + /// <returns> + /// The return value is a handle to the capture window associated with the current thread.<para/> + /// If no window in the thread has captured the mouse, the return value is <see cref="IntPtr.Zero"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr GetCapture(); + + /// <summary> + /// Sets the mouse capture to the specified window belonging to the current thread. + /// <see cref="SetCapture(IntPtr)"/> captures mouse input either when the mouse is over the capturing window, + /// or when the mouse button was pressed while the mouse was over the capturing window and the button is + /// still down. Only one window at a time can capture the mouse.<para/> + /// If the mouse cursor is over a window created by another thread, + /// the system will direct mouse input to the specified window only if a mouse button is down. + /// </summary> + /// <param name="window"> + /// A handle to the window in the current thread that is to capture the mouse. + /// </param> + /// <returns> + /// The return value is a handle to the window that had previously captured the mouse. + /// If there is no such window, the return value is <see cref="IntPtr.Zero"/>. + /// </returns> + [DllImport(Library)] + public static extern IntPtr SetCapture(IntPtr window); + + /// <summary> + /// Releases the mouse capture from a window in the current thread and restores normal mouse input + /// processing. A window that has captured the mouse receives all mouse input, regardless of the position + /// of the cursor, except when a mouse button is clicked while the cursor + /// hot spot is in the window of another thread. + /// </summary> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ReleaseCapture(); + + /// <summary> + /// Posts messages when the mouse pointer leaves a window or hovers + /// over a window for a specified amount of time. + /// </summary> + /// <param name="trackMouseEvent"> + /// A pointer to a <see cref="Native.TrackMouseEvent"/> structure that contains tracking information. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool TrackMouseEvent([In] [Out] ref TrackMouseEvent trackMouseEvent); + + /// <summary> + /// Retrieves a history of up to 64 previous coordinates of the mouse or pen. + /// </summary> + /// <param name="size">The size, in bytes, of the <see cref="MouseMovePoint"/> structure.</param> + /// <param name="movePointIn"> + /// A pointer to a <see cref="MouseMovePoint"/> structure containing valid mouse coordinates + /// (in screen coordinates). It may also contain a time stamp. + /// </param> + /// <param name="movePointOutBuffer"> + /// A pointer to a buffer that will receive the points. + /// It should be at least <paramref name="size"/> * <paramref name="pointAmount"/> in size. + /// </param> + /// <param name="pointAmount">The number of points to be retrieved.</param> + /// <param name="resolution">The resolution desired.</param> + /// <returns> + /// If the function succeeds, the return value is the number of points in the buffer.<para/> + /// Otherwise, the function returns –1. + /// For extended error information, your application can call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport("user32", SetLastError = true)] + public static extern int GetMouseMovePointsEx + ( + [In] uint size, + [In] ref MouseMovePoint movePointIn, + [Out] out MouseMovePoint[] movePointOutBuffer, + [In] int pointAmount, + [In] GetMouseMovePointsResolution resolution + ); + + /// <summary> + /// Retrieves a history of up to 64 previous coordinates of the mouse or pen. + /// </summary> + /// <param name="size">The size, in bytes, of the <see cref="MouseMovePoint"/> structure.</param> + /// <param name="movePointIn"> + /// A pointer to a <see cref="MouseMovePoint"/> structure containing valid mouse coordinates + /// (in screen coordinates). It may also contain a time stamp. + /// </param> + /// <param name="movePointOutBuffer"> + /// A pointer to a buffer that will receive the points. + /// It should be at least <paramref name="size"/> * <paramref name="pointAmount"/> in size. + /// </param> + /// <param name="pointAmount">The number of points to be retrieved.</param> + /// <param name="resolution">The resolution desired.</param> + /// <returns> + /// If the function succeeds, the return value is the number of points in the buffer.<para/> + /// Otherwise, the function returns –1. + /// For extended error information, your application can call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport("user32", SetLastError = true)] + public static unsafe extern int GetMouseMovePointsEx + ( + [In] uint size, + [In] ref MouseMovePoint movePointIn, + [Out] MouseMovePoint* movePointOutBuffer, + [In] int pointAmount, + [In] GetMouseMovePointsResolution resolution + ); + } + } +} diff --git a/Crow/src/backends/win32/User32/RawInput.cs b/Crow/src/backends/win32/User32/RawInput.cs new file mode 100644 index 00000000..48649616 --- /dev/null +++ b/Crow/src/backends/win32/User32/RawInput.cs @@ -0,0 +1,423 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with raw input. + /// </summary> + public static class RawInput + { + /// <summary> + /// Calls the default raw input procedure to provide default processing for any raw input messages that + /// an application does not process. This function ensures that every message is processed. + /// <see cref="DefRawInputProc(Native.RawInput[], int, uint)"/> is called with the same parameters + /// received by the window procedure. + /// </summary> + /// <param name="rawInputArrayOut">An array of <see cref="Native.RawInput"/> structures.</param> + /// <param name="rawInputAmount"> + /// The number of <see cref="Native.RawInput"/> + /// structures pointed to by <paramref name="rawInputArrayOut"/>. + /// </param> + /// <param name="headerSize">The size, in bytes, of the <see cref="RawInputHeader"/> structure.</param> + /// <returns> + /// If successful, the function returns <see cref="IntPtr.Zero"/>. Otherwise it returns an error value. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + public static extern IntPtr DefRawInputProc + ( + [In] Native.RawInput[] rawInputArrayOut, + [In] int rawInputAmount, + [In] uint headerSize + ); + + /// <summary> + /// Calls the default raw input procedure to provide default processing for any raw input messages that + /// an application does not process. This function ensures that every message is processed. + /// <see cref="DefRawInputProc(Native.RawInput[], int, uint)"/> is called with the same parameters + /// received by the window procedure. + /// </summary> + /// <param name="rawInputArrayOut"> + /// A pointer to an array of <see cref="Native.RawInput"/> structures. + /// </param> + /// <param name="rawInputAmount"> + /// The number of <see cref="Native.RawInput"/> + /// structures pointed to by <paramref name="rawInputArrayOut"/>. + /// </param> + /// <param name="headerSize">The size, in bytes, of the <see cref="RawInputHeader"/> structure.</param> + /// <returns> + /// If successful, the function returns <see cref="IntPtr.Zero"/>. Otherwise it returns an error value. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library)] + public static unsafe extern IntPtr DefRawInputProc + ( + [In] Native.RawInput* rawInputArrayOut, + [In] int rawInputAmount, + [In] uint headerSize + ); + + /// <summary> + /// Registers the devices that supplies the raw input data. + /// </summary> + /// <param name="rawInputDevices"> + /// An array of <see cref="RawInputDevice"/> structures that + /// represent the devices that supply the raw input. + /// </param> + /// <param name="deviceAmount"> + /// The number of <see cref="RawInputDevice"/> structures pointed to by <paramref name="rawInputDevices"/>. + /// </param> + /// <param name="size">The size, in bytes, of a <see cref="RawInputDevice"/> structure.</param> + /// <returns> + /// True if the function succeeds; otherwise, false.<para/> + /// If the function fails, call <see cref="Marshal.GetLastWin32Error"/> for more information. + /// </returns> + //[DllImport(Library, SetLastError = true)] + //[return: MarshalAs(UnmanagedType.Bool)] + //public static extern bool RegisterRawInputDevices + //( + // [In] RawInputDevice[] rawInputDevices, + // [In] uint deviceAmount, + // [In] uint size + //); + + /// <summary> + /// Retrieves the information about the raw input devices for the current application. + /// </summary> + /// <param name="rawInputDevicesOut"> + /// An array of <see cref="RawInputDevice"/> structures for the application. + /// </param> + /// <param name="deviceAmount"> + /// The number of <see cref="RawInputDevice"/> structures in <paramref name="rawInputDevicesOut"/>. + /// </param> + /// <param name="size">The size, in bytes, of a <see cref="RawInputDevice"/> structure.</param> + /// <returns> + /// If successful, the function returns a non-negative number that is + /// the number of <see cref="RawInputDevice"/> structures written to the buffer.<para/> + /// If the <paramref name="rawInputDevicesOut"/> buffer is too small or null, the function sets the last + /// error as ERROR_INSUFFICIENT_BUFFER, returns -1, and sets <paramref name="deviceAmount"/> to the + /// required number of devices. If the function fails for any other reason, it returns -1.<para/> + /// For more details, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + //[DllImport(Library, SetLastError = true)] + //public static extern uint GetRegisteredRawInputDevices + //( + // [Out] [Optional] RawInputDevice[] rawInputDevicesOut, + // [In] [Out] ref uint deviceAmount, + // [In] uint size + //); + + /// <summary> + /// Performs a buffered read of the raw input data. + /// </summary> + /// <param name="data"> + /// A buffer of <see cref="RawInput"/> structures that contain the raw input data. + /// If null, the minimum required buffer, in bytes, is returned in <paramref name="rawInputSize"/>. + /// </param> + /// <param name="rawInputSize">The size, in bytes, of a <see cref="RawInput"/> structure.</param> + /// <param name="headerSize">The size, in bytes, of the <see cref="RawInputHeader"/> structure.</param> + /// <returns> + /// If <paramref name="data"/> is null and the function is successful, the return value is zero. + /// If <paramref name="data"/> is not null and the function is successful, the return value is the + /// number of <see cref="RawInput"/> structures written to <paramref name="data"/>.<para/> + /// If an error occurs, the return value is -1. + /// Call <see cref="Marshal.GetLastWin32Error"/> for the error code. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern uint GetRawInputBuffer + ( + [Out] [Optional] Native.RawInput[] data, + [In] [Out] ref uint rawInputSize, + [In] uint headerSize + ); + + /// <summary> + /// Performs a buffered read of the raw input data. + /// </summary> + /// <param name="data"> + /// A pointer to a buffer of <see cref="RawInput"/> structures that contain the raw input data. + /// If null, the minimum required buffer, in bytes, is returned in <paramref name="rawInputSize"/>. + /// </param> + /// <param name="rawInputSize">The size, in bytes, of a <see cref="RawInput"/> structure.</param> + /// <param name="headerSize">The size, in bytes, of the <see cref="RawInputHeader"/> structure.</param> + /// <returns> + /// If <paramref name="data"/> is null and the function is successful, the return value is zero. + /// If <paramref name="data"/> is not null and the function is successful, the return value is the + /// number of <see cref="RawInput"/> structures written to <paramref name="data"/>.<para/> + /// If an error occurs, the return value is (uint)-1. + /// Call <see cref="Marshal.GetLastWin32Error"/> for the error code. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static unsafe extern uint GetRawInputBuffer + ( + [Out] [Optional] Native.RawInput* data, + [In] [Out] ref uint rawInputSize, + [In] uint headerSize + ); + + /// <summary> + /// Enumerates the raw input devices attached to the system. + /// </summary> + /// <param name="deviceListArrayOut"> + /// An array of <see cref="RawInputDeviceList"/> structures for the devices attached to the system. + /// If null, the number of devices are returned in <paramref name="deviceListAmount"/>. + /// </param> + /// <param name="deviceListAmount"> + /// If <paramref name="deviceListArrayOut"/> is null, the function populates this variable with + /// the number of devices attached to the system; otherwise, this variable specifies the number of + /// <see cref="RawInputDeviceList"/> structures that can be contained in the buffer to which + /// <paramref name="deviceListArrayOut"/> points. If this value is less than the number of devices + /// attached to the system, the function returns the actual number of devices in this variable + /// and fails with ERROR_INSUFFICIENT_BUFFER. + /// </param> + /// <param name="deviceListSize"> + /// The size of a <see cref="RawInputDeviceList"/> structure, in bytes. + /// </param> + /// <returns> + /// If the function is successful, the return value is the number of devices stored in the buffer + /// pointed to by <paramref name="deviceListArrayOut"/>.<para/> + /// On any other error, the function returns (uint)-1 and + /// <see cref="Marshal.GetLastWin32Error"/> returns the error indication. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern uint GetRawInputDeviceList + ( + [Out] [Optional] RawInputDeviceList[] deviceListArrayOut, + [In] [Out] ref uint deviceListAmount, + [In] uint deviceListSize + ); + + /// <summary> + /// Enumerates the raw input devices attached to the system. + /// </summary> + /// <param name="deviceListArrayOut"> + /// A pointer to an array of <see cref="RawInputDeviceList"/> structures for the devices attached to the + /// system. If null, the number of devices are returned in <paramref name="deviceListAmount"/>. + /// </param> + /// <param name="deviceListAmount"> + /// If <paramref name="deviceListArrayOut"/> is null, the function populates this variable with + /// the number of devices attached to the system; otherwise, this variable specifies the number of + /// <see cref="RawInputDeviceList"/> structures that can be contained in the buffer to which + /// <paramref name="deviceListArrayOut"/> points. If this value is less than the number of devices + /// attached to the system, the function returns the actual number of devices in this variable + /// and fails with ERROR_INSUFFICIENT_BUFFER. + /// </param> + /// <param name="deviceListSize"> + /// The size of a <see cref="RawInputDeviceList"/> structure, in bytes. + /// </param> + /// <returns> + /// If the function is successful, the return value is the number of devices stored in the buffer + /// pointed to by <paramref name="deviceListArrayOut"/>.<para/> + /// On any other error, the function returns (uint)-1 and + /// <see cref="Marshal.GetLastWin32Error"/> returns the error indication. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static unsafe extern uint GetRawInputDeviceList + ( + [Out] [Optional] RawInputDeviceList* deviceListArrayOut, + [In] [Out] ref uint deviceListAmount, + [In] uint deviceListSize + ); + + /// <summary> + /// Retrieves information about the raw input device. + /// </summary> + /// <param name="device"> + /// A handle to the raw input device. This comes from the <see cref="RawInputHeader.Device"/> or + /// from <see cref="GetRawInputDeviceList(RawInputDeviceList[], ref uint, uint)"/>. + /// </param> + /// <param name="command">Specifies what data will be returned in <paramref name="data"/>.</param> + /// <param name="data"> + /// A buffer that contains the information specified by <paramref name="command"/>. + /// If <paramref name="command"/> is <see cref="GetRawInputDeviceInfoEnum.DeviceInfo"/>, set the + /// <see cref="RawInputDeviceInfo.Size"/> to <see cref="RawInputDeviceInfo.SizeInBytes"/> before calling + /// <see cref="GetRawInputDeviceInfo(IntPtr, GetRawInputDeviceInfoEnum, IntPtr, ref uint)"/>. + /// </param> + /// <param name="dataSize">The size, in bytes, of the data in <paramref name="data"/>.</param> + /// <returns> + /// If successful, this function returns a non-negative number indicating the number + /// of bytes copied to <paramref name="data"/>.<para/> + /// If pData is not large enough for the data, the function returns -1. If <paramref name="data"/> is + /// <see cref="IntPtr.Zero"/>, the function returns a value of zero. In both of these cases, + /// <paramref name="dataSize"/> is set to the minimum size required for the <paramref name="data"/> buffer. + /// <para/> + /// Call <see cref="Marshal.GetLastWin32Error"/> to identify any other errors. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern uint GetRawInputDeviceInfo + ( + [In] [Optional] IntPtr device, + [In] GetRawInputDeviceInfoEnum command, + [In] [Out] [Optional] byte[] data, + [In] [Out] ref uint dataSize + ); + + /// <summary> + /// Retrieves information about the raw input device. + /// </summary> + /// <param name="device"> + /// A handle to the raw input device. This comes from the <see cref="RawInputHeader.Device"/> or + /// from <see cref="GetRawInputDeviceList(RawInputDeviceList[], ref uint, uint)"/>. + /// </param> + /// <param name="command">Specifies what data will be returned in <paramref name="data"/>.</param> + /// <param name="data"> + /// A pointer to a buffer that contains the information specified by <paramref name="command"/>. + /// If <paramref name="command"/> is <see cref="GetRawInputDeviceInfoEnum.DeviceInfo"/>, set the + /// <see cref="RawInputDeviceInfo.Size"/> to <see cref="RawInputDeviceInfo.SizeInBytes"/> before calling + /// <see cref="GetRawInputDeviceInfo(IntPtr, GetRawInputDeviceInfoEnum, IntPtr, ref uint)"/>. + /// </param> + /// <param name="dataSize">The size, in bytes, of the data in <paramref name="data"/>.</param> + /// <returns> + /// If successful, this function returns a non-negative number indicating the number + /// of bytes copied to <paramref name="data"/>.<para/> + /// If pData is not large enough for the data, the function returns -1. If <paramref name="data"/> is + /// <see cref="IntPtr.Zero"/>, the function returns a value of zero. In both of these cases, + /// <paramref name="dataSize"/> is set to the minimum size required for the <paramref name="data"/> buffer. + /// <para/> + /// Call <see cref="Marshal.GetLastWin32Error"/> to identify any other errors. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static unsafe extern uint GetRawInputDeviceInfo + ( + [In] [Optional] IntPtr device, + [In] GetRawInputDeviceInfoEnum command, + [In] [Out] [Optional] IntPtr data, + [In] [Out] ref uint dataSize + ); + + /// <summary> + /// Retrieves information about the raw input device. + /// </summary> + /// <param name="device"> + /// A handle to the raw input device. This comes from <see cref="RawInputHeader.Device"/> or from + /// <see cref="GetRawInputDeviceList(RawInputDeviceList[], ref uint, uint)"/>. + /// </param> + /// <param name="command">Specifies what data will be returned in <paramref name="data"/>.</param> + /// <param name="data"> + /// A pointer to a buffer that contains the information specified by <paramref name="command"/>. If + /// <paramref name="command"/> is <see cref="GetRawInputDeviceInfoEnum.DeviceInfo"/>, set the + /// <see cref="RawInputDeviceInfo.Size"/> to <see cref="RawInputDeviceInfo.SizeInBytes"/> + /// before calling this. + /// </param> + /// <param name="size">The size, in bytes, of the data in <paramref name="data"/>.</param> + /// <returns> + /// If successful, this function returns a non-negative number + /// indicating the number of bytes copied to <paramref name="data"/>.<para/> + /// If <paramref name="data"/> is not large enough for the data, the function returns -1. If + /// <paramref name="data"/> is null, the function returns a value of zero. In both of these cases, + /// <paramref name="size"/> is set to the minimum size required for the <paramref name="data"/> buffer. + /// <para/> + /// Call <see cref="Marshal.GetLastWin32Error"/> to identify any other errors. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern uint GetRawInputDeviceInfo + ( + [In] [Optional] IntPtr device, + [In] GetRawInputDeviceInfoEnum command, + [In] [Out] [Optional] ref RawInputDeviceInfo data, + [In] [Out] ref uint size + ); + + /// <summary> + /// Retrieves the raw input header from the specified device. + /// </summary> + /// <param name="rawInput"> + /// A handle to the <see cref="Native.RawInput"/> structure. This comes from the lParam in + /// <see cref="WindowMessage.Input"/>. + /// </param> + /// <param name="header">The <see cref="RawInputHeader"/> structure to receive the raw data.</param> + /// <returns> + /// If the function is successful, the return value is the number of bytes copied into + /// <paramref name="header"/>.<para/> + /// If there is an error, the return value is (uint)-1 [== <see cref="uint.MaxValue"/>]. + /// </returns> + public static unsafe uint GetRawInputData(IntPtr rawInput, out RawInputHeader header) + { + uint size = RawInputHeader.SizeInBytes; + fixed (RawInputHeader* headerPtr = &header) + { + return GetRawInputData + ( + rawInput, + GetRawInputDataCommand.Header, + (IntPtr)headerPtr, + ref size, + RawInputHeader.SizeInBytes + ); + } + } + + /// <summary> + /// Retrieves raw input data from the specified device. + /// </summary> + /// <param name="rawInput"> + /// A handle to the <see cref="Native.RawInput"/> structure. This comes from the lParam in + /// <see cref="WindowMessage.Input"/>. + /// </param> + /// <param name="data">The <see cref="Native.RawInput"/> structure to receive the raw data.</param> + /// <returns> + /// If the function is successful, the return value is the number of bytes copied into + /// <paramref name="data"/>.<para/> + /// If there is an error, the return value is (uint)-1 [== <see cref="uint.MaxValue"/>]. + /// </returns> + public static unsafe uint GetRawInputData(IntPtr rawInput, out Native.RawInput data) + { + uint size = Native.RawInput.SizeInBytes; + fixed (Native.RawInput* dataPtr = &data) + { + return GetRawInputData + ( + rawInput, + GetRawInputDataCommand.Input, + (IntPtr)dataPtr, + ref size, + RawInputHeader.SizeInBytes + ); + } + } + + /// <summary> + /// Retrieves the raw input from the specified device.<para/> + /// Consider using one of the other overloads for a better experience. + /// </summary> + /// <param name="rawInput"> + /// A handle to the <see cref="Native.RawInput"/> structure. This comes from the lParam in + /// <see cref="WindowMessage.Input"/>. + /// </param> + /// <param name="command">The command flag.</param> + /// <param name="data"> + /// A pointer to the data that comes from the <see cref="Native.RawInput"/> structure. This depends on the + /// value of <paramref name="command"/>. If <paramref name="data"/> is <see cref="IntPtr.Zero"/>, + /// the required size of the buffer is returned in <paramref name="size"/>. + /// </param> + /// <param name="size">The size, in bytes, of the data in <paramref name="data"/>.</param> + /// <param name="headerSize">The size, in bytes, of the <see cref="RawInputHeader"/> structure.</param> + /// <returns> + /// If <paramref name="data"/> is <see cref="IntPtr.Zero"/> and the function is successful, the return + /// value is 0. If <paramref name="data"/> is not <see cref="IntPtr.Zero"/> and the function is successful, + /// the return value is the number of bytes copied into <paramref name="data"/>.<para/> + /// If there is an error, the return value is (uint)-1 [== <see cref="uint.MaxValue"/>]. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern uint GetRawInputData + ( + [In] IntPtr rawInput, + [In] GetRawInputDataCommand command, + [Out] [Optional] IntPtr data, + [In] [Out] ref uint size, + [In] uint headerSize + ); + } + } +} diff --git a/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs b/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs new file mode 100644 index 00000000..874402bd --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs @@ -0,0 +1,58 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about a class of devices. + /// </summary> + public struct BroadcastDeviceInterface + { + /// <summary> + /// The size of this structure, in bytes. This is the size of the members plus the actual length of the + /// <see cref="Name"/> string (the null character is accounted for by the declaration of <see cref="Name"/> + /// as a one-character array). + /// </summary> + public uint Size; + + /// <summary> + /// Official documentation states "Set to <see cref="DeviceBroadcastType.DeviceInterface"/>".<para/> + /// Only set to something else if you know what you're doing. + /// </summary> + public DeviceBroadcastType DeviceType; + + /// <summary> + /// Reserved; do not use. + /// </summary> + public uint Reserved; + + /// <summary> + /// The GUID for the interface device class. + /// </summary> + public Guid ClassGuid; + + /// <summary> + /// Gets a string that specifies the name of the device. + /// </summary> + public unsafe string Name + { + get + { + fixed (char* namePtr = &_name) + { + return Marshal.PtrToStringUni((IntPtr)namePtr); + } + } + } + + /// <summary> + /// The first character of the <see cref="Name"/>. + /// </summary> + private char _name; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<BroadcastDeviceInterface>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/CreateStruct.cs b/Crow/src/backends/win32/User32/Structs/CreateStruct.cs new file mode 100644 index 00000000..d8cb565c --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/CreateStruct.cs @@ -0,0 +1,92 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the initialization parameters passed to the window procedure of an application. These members are + /// identical to the parameters of the + /// <see cref="User32.Window.CreateWindowEx(ExtendedWindowStyles, IntPtr, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> function. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct CreateStruct + { + /// <summary> + /// Contains additional data which may be used to create the window. If the window is being created as a + /// result of a call to the CreateWindow or + /// <see cref="User32.Window.CreateWindowEx(ExtendedWindowStyles, IntPtr, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> + /// function, this member contains the value of the lpParam parameter specified in the function call.<para/> + /// If the window being created is a MDI client window, this member contains a pointer to a CLIENTCREATESTRUCT + /// structure. If the window being created is a MDI child window, this member contains a pointer to an + /// MDICREATESTRUCT structure.<para/> + /// If the window is being created from a dialog template, this member is the address of a <see cref="short"/> + /// value that specifies the size, in bytes, of the window creation data. The value is immediately followed + /// by the creation data. + /// </summary> + public IntPtr CreateParams; + + /// <summary> + /// Handle to the module that owns the new window. + /// </summary> + public IntPtr Instance; + + /// <summary> + /// Handle to the menu to be used by the new window. + /// </summary> + public IntPtr Menu; + + /// <summary> + /// Handle to the parent window, if the window is a child window. + /// If the window is owned, this member identifies the owner window. + /// If the window is not a child or owned window, this member is null. + /// </summary> + public IntPtr Parent; + + /// <summary> + /// Specifies the height of the new window, in pixels. + /// </summary> + public int Height; + + /// <summary> + /// Specifies the width of the new window, in pixels. + /// </summary> + public int Width; + + /// <summary> + /// Specifies the y-coordinate of the upper left corner of the new window. + /// If the new window is a child window, coordinates are relative to the parent window. + /// Otherwise, the coordinates are relative to the screen origin. + /// </summary> + public int Y; + + /// <summary> + /// Specifies the x-coordinate of the upper left corner of the new window. + /// If the new window is a child window, coordinates are relative to the parent window. + /// Otherwise, the coordinates are relative to the screen origin. + /// </summary> + public int X; + + /// <summary> + /// Specifies the style for the new window. + /// </summary> + public WindowStyles Style; + + /// <summary> + /// Pointer to a null-terminated string that specifies the name of the new window. + /// </summary> + public string Name; + + /// <summary> + /// Either a pointer to a null-terminated string or an atom that specifies the class name + /// of the new window. + /// </summary> + public IntPtr ClassName; + + /// <summary> + /// The extended window style for the new window. + /// </summary> + public ExtendedWindowStyles ExtendedStyle; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/DeviceMode.cs b/Crow/src/backends/win32/User32/Structs/DeviceMode.cs new file mode 100644 index 00000000..9f3c13d2 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/DeviceMode.cs @@ -0,0 +1,334 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Specifies characteristics of display and print devices.<para/> + /// Before accessing a field, check the <see cref="Fields"/> field to determine whether any given field is set. + /// </summary> + [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] + public struct DeviceMode + { + /// <summary> + /// Length of the <see cref="DeviceName"/> in characters. + /// </summary> + public const int DeviceNameLength = 32; + + /// <summary> + /// Length of the <see cref="FormName"/> in characters. + /// </summary> + public const int FormNameLength = 32; + + /// <summary> + /// Default value for <see cref="SpecVersion"/> and <see cref="DriverVersion"/> (see the documentation of those + /// fields for more information). + /// </summary> + public const ushort DefaultSpecVersion = 800; + + /// <summary> + /// A zero-terminated character array that specifies the "friendly" name of the printer or display. + /// </summary> + [FieldOffset(0)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string DeviceName; + + /// <summary> + /// The version number of the initialization data specification on which the structure is based. + /// The current version number is identified by <see cref="DefaultSpecVersion"/>. + /// </summary> + [FieldOffset(64)] + public ushort SpecVersion; + + /// <summary> + /// For a printer, specifies the printer driver version number assigned by the printer driver developer.<para/> + /// Display drivers can set this member to <see cref="DefaultSpecVersion"/>. + /// </summary> + [FieldOffset(66)] + public ushort DriverVersion; + + /// <summary> + /// Specifies the size in bytes of the public DEVMODEW structure, not including any private, + /// driver-specified members identified by the dmDriverExtra member.<para/> + /// Set this to <see cref="SizeInBytes"/>. + /// </summary> + [FieldOffset(68)] + public ushort Size; + + /// <summary> + /// Specifies the number of bytes of private driver data that follow the public structure members. + /// If a device driver does not provide private members, this member should be set to zero. + /// </summary> + [FieldOffset(70)] + public ushort DriverExtra; + + /// <summary> + /// Specifies bit flags identifying which of the following members are in use. + /// For example, the <see cref="DeviceModeFieldFlags.Orientation"/> flag is set when the + /// <see cref="PrinterDeviceOptions.Orientation"/> member contains valid data. + /// </summary> + [FieldOffset(72)] + public DeviceModeFieldFlags Fields; + + /// <summary> + /// Provides printer-specific device mode options. + /// </summary> + [FieldOffset(76)] + public PrinterDeviceOptions PrinterOptions; + + /// <summary> + /// Provides display-specific device mode options. + /// </summary> + [FieldOffset(76)] + public DisplayDeviceOptions DisplayOptions; + + /// <summary> + /// For printers, specifies whether a color printer should print color or monochrome. + /// </summary> + [FieldOffset(92)] + public PrinterColor Color; + + /// <summary> + /// For printers, specifies duplex (double-sided) printing for duplex-capable printers. + /// </summary> + [FieldOffset(94)] + public PrinterDuplex Duplex; + + /// <summary> + /// For printers, specifies the y resolution of the printer, in DPI. If this member is used, + /// the <see cref="PrinterDeviceOptions.PrintQuality"/> member specifies the x resolution. + /// </summary> + [FieldOffset(96)] + public short YResolution; + + /// <summary> + /// For printers, specifies how TrueType fonts should be printed. + /// </summary> + [FieldOffset(98)] + public PrinterTrueTypeOption TrueTypeOption; + + /// <summary> + /// For printers, specifies whether multiple copies should be collated. 1 == true, 0 == false. + /// </summary> + [FieldOffset(100)] + public short Collate; + + /// <summary> + /// Gets the name of the printer form to use; such as "Letter" or "Legal". + /// This must be a name that can be obtain by calling the Win32 EnumForms function. + /// </summary> + public unsafe string FormName + { + get + { + fixed (char* formNamePtr = &_formName) + { + return Marshal.PtrToStringUni((IntPtr)formNamePtr); + } + } + } + + /// <summary> + /// With the current struct layout (which is set in stone because of interoperability with the Windows API), + /// there is no way to put a `string` type at this position(string is a reference type -> there is a pointer + /// here, which is either 4 or 8 bytes depending on the platform). This means that a string can never be + /// properly aligned at position 102 (which, again, can't be changed). This is why the <see cref="FormName"/> + /// property exists. + /// </summary> + [FieldOffset(102)] + private char _formName; + + /// <summary> + /// For displays, specifies the number of logical pixels per inch of a display device and should be equal + /// to the ulLogPixels member of the GDIINFO structure. + /// </summary> + [FieldOffset(166)] + public ushort LogPixels; + + /// <summary> + /// For displays, specifies the color resolution, in bits per pixel, of a display device. + /// </summary> + [FieldOffset(168)] + public uint BitsPerPixel; + + /// <summary> + /// For displays, specifies the width, in pixels, of the visible device surface. + /// </summary> + [FieldOffset(172)] + public uint WidthInPixels; + + /// <summary> + /// For displays, specifies the height, in pixels, of the visible device surface. + /// </summary> + [FieldOffset(176)] + public uint HeightInPixels; + + /// <summary> + /// For displays, specifies a display device's display mode. + /// </summary> + [FieldOffset(180)] + public DisplayFlags DisplayFlags; + + /// <summary> + /// For printers, specifies whether the print system handles "N-up" printing + /// (playing multiple EMF logical pages onto a single physical page). + /// </summary> + [FieldOffset(180)] + public uint Nup; + + /// <summary> + /// For displays, specifies the frequency, in hertz, of a display device in its current mode. + /// </summary> + [FieldOffset(184)] + public uint DisplayFrequency; + + /// <summary> + /// For printers, specifies how Image Color Management (ICM) is handled. For a non-ICM application, this field + /// determines if ICM is enabled or disabled. For ICM applications, the system examines this field to determine + /// how to handle ICM support.<para/> + /// The value of this field can be one of the pre-defined <see cref="PrinterIcmMethod"/> values or a printer + /// driver-defined value greater than or equal to <see cref="PrinterIcmMethod.User"/>. + /// </summary> + [FieldOffset(188)] + public PrinterIcmMethod IcmMethod; + + /// <summary> + /// For printers, specifies which color matching method, or intent, is used by default. This field is primarily + /// for non-ICM applications. ICM applications can establish intents by using the ICM functions.<para/> + /// The value of this field can be one of the pre-defined <see cref="PrinterIcmIntent"/> values or a printer + /// driver-defined value greater than or equal to <see cref="PrinterIcmIntent.User"/>. + /// </summary> + [FieldOffset(192)] + public PrinterIcmIntent IcmIntent; + + /// <summary> + /// For printers, specifies the type of media being printed on.<para/> + /// The value of this field can be one of the pre-defined <see cref="PrinterMediaType"/> values or a printer + /// driver-defined value greater than or equal to <see cref="PrinterMediaType.User"/>. + /// </summary> + [FieldOffset(196)] + public PrinterMediaType MediaType; + + /// <summary> + /// Specifies how dithering is to be done.<para/> + /// The value of this field can be one of the pre-defined <see cref="PrinterDitherType"/> values or a printer + /// driver-defined value greater than or equal to <see cref="PrinterDitherType.User"/>. + /// </summary> + [FieldOffset(200)] + public PrinterDitherType DitherType; + + /// <summary> + /// Is reserved for system use and must be zero. + /// </summary> + [FieldOffset(204)] + public uint Reserved1; + + /// <summary> + /// Is reserved for system use and must be zero. + /// </summary> + [FieldOffset(208)] + public uint Reserved2; + + /// <summary> + /// Must be zero. + /// </summary> + [FieldOffset(212)] + public uint PanningWidth; + + /// <summary> + /// Must be zero. + /// </summary> + [FieldOffset(216)] + public uint PanningHeight; + + /// <summary> + /// The size of the structure in bytes. + /// </summary> + public static readonly ushort SizeInBytes = (ushort)Marshal.SizeOf<DeviceMode>(); + + /// <summary> + /// Contains printer-specific device options. + /// </summary> + public struct PrinterDeviceOptions + { + /// <summary> + /// For printers, specifies the paper orientation. + /// </summary> + public PrinterPaperOrientation Orientation; + + /// <summary> + /// For printers, specifies the size of the paper to be printed on. This member must be zero if the length + /// and width of the paper are specified by the <see cref="PaperLength"/> and <see cref="PaperWidth"/> + /// members. + /// </summary> + public PrinterPaperSize PaperSize; + + /// <summary> + /// For printers, specifies the length of the paper, in units of 1/10 of a millimeter. + /// This value overrides the length of the paper specified by the <see cref="PaperSize"/> member, + /// and is used if the paper is of a custom size, or if the device is a dot matrix printer, + /// which can print a page of arbitrary length. + /// </summary> + public short PaperLength; + + /// <summary> + /// For printers, specifies the width of the paper, in units of 1/10 of a millimeter. + /// This value overrides the width of the paper specified by the <see cref="PaperSize"/> member. + /// This member must be used if <see cref="PaperLength"/> is used. + /// </summary> + public short PaperWidth; + + /// <summary> + /// For printers, specifies the percentage by which the image is to be scaled for printing. The image's + /// page size is scaled to the physical page by a factor of <see cref="Scale"/>/100. For example, + /// a 17-inch by 22-inch image with a scale value of 100 requires 17x22-inch paper, while the same image + /// with a scale value of 50 should print as half-sized and fit on letter-sized paper. + /// </summary> + public short Scale; + + /// <summary> + /// For printers, specifies the number of copies to be printed, if the device supports multiple copies. + /// </summary> + public short Copies; + + /// <summary> + /// For printers, specifies the printer's default input bin. If the specified constant is + /// <see cref="PrinterDefaultSource.FormSource"/>, the input bin should be selected automatically. + /// </summary> + public PrinterDefaultSource DefaultSource; + + /// <summary> + /// For printers, specifies the printer resolution. Either set this to one of the + /// <see cref="PrinterPrintQuality"/> values, or use a positive value specifying the number of DPI for the + /// x resolution, with the y resolution being specified by <see cref="YResolution"/>. + /// </summary> + public PrinterPrintQuality PrintQuality; + } + + /// <summary> + /// Contains display-specific device options. + /// </summary> + public struct DisplayDeviceOptions + { + /// <summary> + /// For displays, specifies a <see cref="Point"/> structure containing the x- and y-coordinates of the + /// upper-left corner of the display, in desktop coordinates. This member is used to determine the + /// relative position of monitors in a multiple monitor environment. + /// </summary> + public Point Position; + + /// <summary> + /// For displays, specifies the orientation at which images should be presented. + /// </summary> + public DisplayOrientation DisplayOrientation; + + /// <summary> + /// For fixed-resolution displays, specifies how the device can present a lower-resolution mode on a + /// higher-resolution display. For example, if a display device's resolution is fixed at 1024 X 768, + /// and its mode is set to 640 x 480, the device can either display a 640 X 480 image within the 1024 X 768 + /// screen space, or stretch the 640 X 480 image to fill the larger screen space. + /// </summary> + public DisplayFixedOutputType DisplayFixedOutput; + } + } +} diff --git a/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs b/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs new file mode 100644 index 00000000..db46d3d4 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs @@ -0,0 +1,55 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Receives information about the display device specified by the iDevNum parameter of the + /// <see cref="User32.DeviceContext.EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/> function. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct DisplayDevice + { + /// <summary> + /// Size, in bytes, of the structure. This must be initialized prior to calling + /// <see cref="User32.DeviceContext.EnumDisplayDevices(string, uint, out DisplayDevice, uint)"/>. + /// </summary> + /// <seealso cref="SizeInBytes"/> + public uint Size; + + /// <summary> + /// An array of characters identifying the device name. + /// This is either the adapter device or the monitor device. + /// </summary> + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string DeviceName; + + /// <summary> + /// An array of characters containing the device context string. + /// This is either a description of the display adapter or of the display monitor. + /// </summary> + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string DeviceString; + + /// <summary> + /// Device state flags. It can be any reasonable combination of <see cref="DisplayDeviceStateFlags"/>. + /// </summary> + public DisplayDeviceStateFlags StateFlags; + + /// <summary> + /// Not used. + /// </summary> + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string DeviceID; + + /// <summary> + /// Reserved. + /// </summary> + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string DeviceKey; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<DisplayDevice>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs b/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs new file mode 100644 index 00000000..3bf68a38 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs @@ -0,0 +1,98 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains window class information. It is used with the + /// <see cref="User32.WindowClass.RegisterClassEx(ref ExtendedWindowClass)"/> and + /// <see cref="User32.WindowClass.GetClassInfoEx(IntPtr, string, out ExtendedWindowClass)"/> functions.<para/> + /// The <see cref="ExtendedWindowClass"/> structure is similar to the <see cref="WindowClass"/> structure. + /// There are two differences. <see cref="ExtendedWindowClass"/> includes the <see cref="Size"/> member, which + /// specifies the size of the structure, and the <see cref="IconSmall"/> member, which contains a handle + /// to a small icon associated with the window class. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct ExtendedWindowClass + { + /// <summary> + /// The size, in bytes, of this structure. Set this member to <see cref="SizeInBytes"/>.<para/> + /// Be sure to set this member before calling the + /// <see cref="User32.WindowClass.GetClassInfoEx(IntPtr, IntPtr, out ExtendedWindowClass)"/> function. + /// </summary> + public uint Size; + + /// <summary> + /// The class style(s). This member can be any combination of <see cref="WindowClassStyles"/>. + /// </summary> + public WindowClassStyles Style; + + /// <summary> + /// A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. + /// </summary> + public WindowProc WindowProc; + + /// <summary> + /// The number of extra bytes to allocate following the window-class structure. + /// The system initializes the bytes to zero. + /// </summary> + public int ClassExtra; + + /// <summary> + /// The number of extra bytes to allocate following the window instance. The system initializes the bytes + /// to zero. If an application uses <see cref="ExtendedWindowClass"/> to register a dialog box created by + /// using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + /// </summary> + public int WindowExtra; + + /// <summary> + /// A handle to the instance that contains the window procedure for the class. + /// </summary> + public IntPtr Instance; + + /// <summary> + /// A handle to the class icon. This member must be a handle to an icon resource. + /// If this member is <see cref="IntPtr.Zero"/>, the system provides a default icon. + /// </summary> + public IntPtr Icon; + + /// <summary> + /// A handle to the class cursor. This member must be a handle to a cursor resource. + /// If this member is <see cref="IntPtr.Zero"/>, an application must explicitly set the cursor shape + /// whenever the mouse moves into the application's window. + /// </summary> + public IntPtr Cursor; + + /// <summary> + /// A handle to the class background brush. This member can be a handle to the brush to be used for + /// painting the background, or it can be a color value.<para/> + /// For more information on setting this to a color value, check the official documentation. + /// </summary> + public IntPtr Background; + + /// <summary> + /// Pointer to a string that specifies the resource name of the class menu, as the name appears in the + /// resource file. If this member is null, windows belonging to this class have no default menu. + /// </summary> + public string MenuName; + + /// <summary> + /// A string specifying the window class name. The class name can be any name registered with + /// RegisterClass or <see cref="User32.WindowClass.RegisterClassEx(ref ExtendedWindowClass)"/>, + /// or any of the predefined control-class names. + /// </summary> + public string ClassName; + + /// <summary> + /// A handle to a small icon that is associated with the window class. If this member is + /// <see cref="IntPtr.Zero"/>, the system searches the icon resource specified by the hIcon member for an icon + /// of the appropriate size to use as the small icon. + /// </summary> + public IntPtr IconSmall; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<ExtendedWindowClass>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/IconInfo.cs b/Crow/src/backends/win32/User32/Structs/IconInfo.cs new file mode 100644 index 00000000..ff0f45c1 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/IconInfo.cs @@ -0,0 +1,49 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about an icon or a cursor. + /// </summary> + public struct IconInfo + { + /// <summary> + /// Specifies whether this structure defines an icon or a cursor. A + /// value of true specifies an icon; false specifies a cursor. + /// </summary> + public bool Icon; + + /// <summary> + /// The x-coordinate of a cursor's hot spot. If this structure defines + /// an icon, the hot spot is always in the center of the icon, and + /// this member is ignored. + /// </summary> + public uint XHotspot; + + /// <summary> + /// The y-coordinate of a cursor's hot spot. If this structure defines + /// an icon, the hot spot is always in the center of the icon, and + /// this member is ignored. + /// </summary> + public uint YHotspot; + + /// <summary> + /// The icon bitmask bitmap. If this structure defines a black and + /// white icon, this bitmask is formatted so that the upper half is + /// the icon AND bitmask and the lower half is the icon XOR bitmask. + /// Under this condition, the height should be an even multiple of + /// two. If this structure defines a color icon, this mask only + /// defines the AND bitmask of the icon. + /// </summary> + public IntPtr BitmapMask; + + /// <summary> + /// A handle to the icon color bitmap. This member can be optional if + /// this structure defines a black and white icon. The AND bitmask of + /// <see cref="BitmapMask"/> is applied with the SRCAND flag to the destination; + /// subsequently, the color bitmap is applied (using XOR) to the + /// destination by using the SRCINVERT flag. + /// </summary> + public IntPtr BitmapColor; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs b/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs new file mode 100644 index 00000000..908777ca --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs @@ -0,0 +1,42 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about a display monitor. + /// </summary> + public struct MonitorInfo + { + /// <summary> + /// The size of the structure, in bytes. Set this member to <see cref="SizeInBytes"/> before calling the + /// <see cref="User32.Monitor.GetMonitorInfo(System.IntPtr, out MonitorInfo)"/> function. + /// </summary> + public uint Size; + + /// <summary> + /// A <see cref="Rect"/> structure that specifies the display monitor rectangle, expressed in virtual-screen + /// coordinates. Note that if the monitor is not the primary display monitor, some of the rectangle's + /// coordinates may be negative values. + /// </summary> + public Rect Monitor; + + /// <summary> + /// A <see cref="Rect"/> structure that specifies the work area rectangle of the display monitor, + /// expressed in virtual-screen coordinates. Note that if the monitor is not the primary display monitor, + /// some of the rectangle's coordinates may be negative values. + /// </summary> + public Rect Work; + + /// <summary> + /// A set of flags that represent attributes of the display monitor.<para/> + /// The (currently only) defined flag is "Primary" with a value of 1, so a value of 1 means the display is + /// primary while a value of 0 means that it is not. + /// </summary> + public uint Flags; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<MonitorInfo>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs b/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs new file mode 100644 index 00000000..8be2fa24 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs @@ -0,0 +1,36 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about the mouse's location in screen coordinates. + /// </summary> + public struct MouseMovePoint + { + /// <summary> + /// The x-coordinate of the mouse. + /// </summary> + public int X; + + /// <summary> + /// The y-coordinate of the mouse. + /// </summary> + public int Y; + + /// <summary> + /// The time stamp of the mouse coordinate. + /// </summary> + public uint Time; + + /// <summary> + /// Additional information associated with this coordinate. + /// </summary> + public IntPtr ExtraInfo; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<MouseMovePoint>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/Msg.cs b/Crow/src/backends/win32/User32/Structs/Msg.cs new file mode 100644 index 00000000..f31c4db0 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/Msg.cs @@ -0,0 +1,50 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains message information from a thread's message queue. + /// </summary> + public struct Msg + { + /// <summary> + /// A handle to the window whose window procedure receives the message. This member is + /// <see cref="System.IntPtr.Zero"/> when the message is a thread message. + /// </summary> + public IntPtr HWnd; + + /// <summary> + /// The message identifier. Applications can only use the low word; the high word is reserved by the system. + /// </summary> + public WindowMessage Message; + + /// <summary> + /// Additional information about the message.The exact meaning depends on the value of the + /// <see cref="Message"/> member. + /// </summary> + public IntPtr WParam; + + /// <summary> + /// Additional information about the message.The exact meaning depends on the value of the + /// <see cref="Message"/> member. + /// </summary> + public IntPtr LParam; + + /// <summary> + /// The time at which the message was posted. + /// </summary> + public uint Time; + + /// <summary> + /// The cursor position, in screen coordinates, when the message was posted. + /// </summary> + public Point Point; + + /// <inheritdoc/> + public override string ToString() + { + return $"msg=0x{(int)Message:x} ({Message.ToString()}) hwnd=0x{HWnd.ToInt32():x}" + + $"wparam=0x{WParam.ToInt32():x} lparam=0x{LParam.ToInt32():x} pt={Point}"; + } + } +} diff --git a/Crow/src/backends/win32/User32/Structs/Point.cs b/Crow/src/backends/win32/User32/Structs/Point.cs new file mode 100644 index 00000000..bd3fe05b --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/Point.cs @@ -0,0 +1,49 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the X and Y coordinates of a point. + /// </summary> + public struct Point + { + /// <summary> + /// The X coordinate of this point. + /// </summary> + public int X; + + /// <summary> + /// The Y coordinate of this point. + /// </summary> + public int Y; + + /// <summary> + /// Initializes a new instance of the <see cref="Point"/> struct with the given X and Y coordinates. + /// </summary> + /// <param name="x">The X coordinate.</param> + /// <param name="y">The Y coordinate.</param> + public Point(int x, int y) + { + X = x; + Y = y; + } + + /// <summary> + /// Converts a <see cref="Point"/> structure used for interoperability with the Windows API to a + /// <see cref="System.Drawing.Point"/>. + /// </summary> + /// <param name="point">The OpenTK.NT.Native.Point structure to convert.</param> + public static implicit operator System.Drawing.Point(Point point) + { + return new System.Drawing.Point(point.X, point.Y); + } + + /// <summary> + /// Converts a <see cref="System.Drawing.Point"/> to a <see cref="Point"/> + /// structure meant for interoperability with the Windows API. + /// </summary> + /// <param name="point">The System.Drawing.Point structure to convert.</param> + public static implicit operator Point(System.Drawing.Point point) => new Point(point.X, point.Y); + + /// <inheritdoc/> + public override string ToString() => $"{{X={X},Y={Y}}}"; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawHid.cs b/Crow/src/backends/win32/User32/Structs/RawHid.cs new file mode 100644 index 00000000..f415e71a --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawHid.cs @@ -0,0 +1,66 @@ +using System; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// The RawHID structure describes the format of the raw input from a Human Interface Device (HID). + /// </summary> + /// <remarks> + /// Each <see cref="WindowMessage.Input"/> can indicate several inputs, but all of the inputs come from the same + /// HID. The size of the <see cref="RawData"/> array is <see cref="SizeHid"/> * <see cref="Count"/>. + /// </remarks> + public struct RawHid + { + /// <summary> + /// Size, in bytes, of each HID input in bRawData. + /// </summary> + public uint SizeHid; + + /// <summary> + /// Number of HID inputs in bRawData. + /// </summary> + public uint Count; + + /// <summary> + /// The first byte of the raw input data. + /// </summary> + public byte RawData; + + /// <summary> + /// Gets the raw input data as an array of bytes. + /// </summary> + /// <returns>An array of raw input data.</returns> + public unsafe byte[] GetRawData() + { + byte[] result = new byte[SizeHid * Count]; + + fixed (byte* dataPtr = &RawData) + { + for (int i = 0; i < result.Length; i++) + { + result[i] = *(dataPtr + i); + } + } + + return result; + } + + /// <summary> + /// Access the raw input data at a given index. + /// </summary> + /// <param name="index">The index at which to access the raw input data.</param> + /// <returns>A byte of raw input data at the given index.</returns> + public unsafe byte GetRawDataAt(int index) + { + if (index < 0 || index > SizeHid * Count) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + fixed (byte* dataPtr = &RawData) + { + return *(dataPtr + index); + } + } + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInput.cs b/Crow/src/backends/win32/User32/Structs/RawInput.cs new file mode 100644 index 00000000..7d8f0bfe --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInput.cs @@ -0,0 +1,26 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains the raw input from a device. + /// </summary> + [StructLayout(LayoutKind.Sequential)] + public struct RawInput + { + /// <summary> + /// The raw input data. + /// </summary> + public RawInputHeader Header; + + /// <summary> + /// Contains device-specific raw input data. + /// </summary> + public RawInputData Data; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInput>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputData.cs b/Crow/src/backends/win32/User32/Structs/RawInputData.cs new file mode 100644 index 00000000..3c4c73ee --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputData.cs @@ -0,0 +1,34 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// A union containing raw input data from a device. + /// </summary> + [StructLayout(LayoutKind.Explicit)] + public struct RawInputData + { + /// <summary> + /// If the data comes from a mouse, this is the raw input data. + /// </summary> + [FieldOffset(0)] + public RawMouse Mouse; + + /// <summary> + /// If the data comes from a keyboard, this is the raw input data. + /// </summary> + [FieldOffset(0)] + public RawKeyboard Keyboard; + + /// <summary> + /// If the data comes from a HID, this is the raw input data. + /// </summary> + [FieldOffset(0)] + public RawHid Hid; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInputData>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs b/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs new file mode 100644 index 00000000..04242df6 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs @@ -0,0 +1,83 @@ +using System; +using System.Runtime.InteropServices; +using OpenToolkit.Input.Hid; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines information for the raw input devices. + /// </summary> + public struct RawInputDevice + { + /// <summary> + /// Top level collection Usage page for the raw input device. + /// </summary> + public HidPage UsagePage; + + /// <summary> + /// Top level collection Usage for the raw input device. + /// </summary> + public ushort Usage; + + /// <summary> + /// Mode flag that specifies how to interpret the information provided by UsagePage and Usage. + /// By default, the operating system sends raw input from devices with the specified top level collection (TLC) + /// to the registered application as long as it has the window focus. + /// </summary> + public RawInputDeviceFlags Flags; + + /// <summary> + /// Handle to the target window. If NULL it follows the keyboard focus. + /// </summary> + public IntPtr Target; + + /// <summary> + /// Initializes a new instance of the <see cref="RawInputDevice"/> struct for generic desktop usage. + /// </summary> + /// <param name="usage">HID usage for the Generic Desktop page.</param> + /// <param name="flags">Specifies how to interpret the raw input data.</param> + /// <param name="target">Handle to the target window.</param> + public RawInputDevice(HidGenericDesktopUsage usage, RawInputDeviceFlags flags, IntPtr target) + : this((ushort)usage, flags, target, HidPage.GenericDesktop) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="RawInputDevice"/> struct for consumer usage. + /// </summary> + /// <param name="usage">HID usage for the Consumer page.</param> + /// <param name="flags">Specifies how to interpret the raw input data.</param> + /// <param name="target">Handle to the target window.</param> + public RawInputDevice(HidConsumerUsage usage, RawInputDeviceFlags flags, IntPtr target) + : this((ushort)usage, flags, target, HidPage.Consumer) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="RawInputDevice"/> struct for simulation usage. + /// </summary> + /// <param name="usage">HID usage for the Simulation page.</param> + /// <param name="flags">Specifies how to interpret the raw input data.</param> + /// <param name="target">Handle to the target window.</param> + public RawInputDevice(HidSimulationUsage usage, RawInputDeviceFlags flags, IntPtr target) + : this((ushort)usage, flags, target, HidPage.Simulation) + { + } + + private RawInputDevice(ushort usage, RawInputDeviceFlags flags, IntPtr target, HidPage usagePage) + { + Usage = usage; + Flags = flags; + Target = target; + UsagePage = usagePage; + } + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInputDevice>(); + + /// <inheritdoc/> + public override string ToString() => $"{UsagePage}/{Usage}, flags: {Flags}, window: {Target}"; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs new file mode 100644 index 00000000..07cca2b4 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs @@ -0,0 +1,49 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the raw input data coming from any device. + /// </summary> + [StructLayout(LayoutKind.Explicit)] + public struct RawInputDeviceInfo + { + /// <summary> + /// Size, in bytes, of the <see cref="RawInputDeviceInfo"/> structure. + /// </summary> + [FieldOffset(0)] + public uint Size; + + /// <summary> + /// Type of raw input data. + /// </summary> + [FieldOffset(4)] + public RawInputDeviceType Type; + + /// <summary> + /// If <see cref="Type"/> is <see cref="RawInputDeviceType.Mouse"/>, this is the + /// <see cref="RawInputDeviceInfoMouse"/> structure that defines the mouse. + /// </summary> + [FieldOffset(8)] + public RawInputDeviceInfoMouse Mouse; + + /// <summary> + /// If <see cref="Type"/> is <see cref="RawInputDeviceType.Keyboard"/>, this is the + /// <see cref="RawInputDeviceInfoKeyboard"/> structure that defines the keyboard. + /// </summary> + [FieldOffset(8)] + public RawInputDeviceInfoKeyboard Keyboard; + + /// <summary> + /// If <see cref="Type"/> is <see cref="RawInputDeviceType.Hid"/>, this is the + /// <see cref="RawInputDeviceInfoHid"/> structure that defines the HID. + /// </summary> + [FieldOffset(8)] + public RawInputDeviceInfoHid Hid; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInputDeviceInfo>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs new file mode 100644 index 00000000..403e221d --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs @@ -0,0 +1,33 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the raw input data coming from the specified Human Interface Device (HID). + /// </summary> + public struct RawInputDeviceInfoHid + { + /// <summary> + /// Vendor ID for the HID. + /// </summary> + public uint VendorId; + + /// <summary> + /// Product ID for the HID. + /// </summary> + public uint ProductId; + + /// <summary> + /// Version number for the HID. + /// </summary> + public uint VersionNumber; + + /// <summary> + /// Top-level collection Usage Page for the device. + /// </summary> + public ushort UsagePage; + + /// <summary> + /// Top-level collection Usage for the device. + /// </summary> + public ushort Usage; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs new file mode 100644 index 00000000..62cd8376 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs @@ -0,0 +1,41 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the raw input data coming from the specified keyboard. + /// </summary> + /// <remarks> + /// For the keyboard, the Usage Page is 1 and the Usage is 6. + /// </remarks> + public struct RawInputDeviceInfoKeyboard + { + /// <summary> + /// Type of the keyboard. + /// </summary> + public uint Type; + + /// <summary> + /// Subtype of the keyboard. + /// </summary> + public uint SubType; + + /// <summary> + /// Scan code mode. + /// </summary> + public uint KeyboardMode; + + /// <summary> + /// Number of function keys on the keyboard. + /// </summary> + public uint NumberOfFunctionKeys; + + /// <summary> + /// Number of LED indicators on the keyboard. + /// </summary> + public uint NumberOfIndicators; + + /// <summary> + /// Total number of keys on the keyboard. + /// </summary> + public uint NumberOfKeysTotal; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs new file mode 100644 index 00000000..fa20c44c --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs @@ -0,0 +1,34 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the raw input data coming from the specified mouse. + /// </summary> + /// <remarks> + /// For the keyboard, the Usage Page is 1 and the Usage is 2. + /// </remarks> + public struct RawInputDeviceInfoMouse + { + /// <summary> + /// ID for the mouse device. + /// </summary> + public uint Id; + + /// <summary> + /// Number of buttons for the mouse. + /// </summary> + public uint NumberOfButtons; + + /// <summary> + /// Number of data points per second. This information may not be applicable for every mouse device. + /// </summary> + public uint SampleRate; + + /// <summary> + /// TRUE if the mouse has a wheel for horizontal scrolling; otherwise, FALSE. + /// </summary> + /// <remarks> + /// This member is only supported under Microsoft Windows Vista and later versions. + /// </remarks> + public bool HasHorizontalWheel; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs new file mode 100644 index 00000000..8e87acc0 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs @@ -0,0 +1,29 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about a raw input device. + /// </summary> + public struct RawInputDeviceList + { + /// <summary> + /// Handle to the raw input device. + /// </summary> + public IntPtr Device; + + /// <summary> + /// Type of device. + /// </summary> + public RawInputDeviceType Type; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInputDeviceList>(); + + /// <inheritdoc/> + public override string ToString() => $"{Type}, Handle: {Device}"; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs b/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs new file mode 100644 index 00000000..724fae5f --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs @@ -0,0 +1,37 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains the header information that is part of the raw input data. + /// </summary> + public struct RawInputHeader + { + /// <summary> + /// Type of raw input. + /// </summary> + public RawInputDeviceType Type; + + /// <summary> + /// The size, in bytes, of the entire input packet of data. This includes <see cref="RawInput"/> plus + /// possible extra input reports in the <see cref="RawHid"/> variable length array. + /// </summary> + public uint Size; + + /// <summary> + /// Handle to the device generating the raw input data. + /// </summary> + public IntPtr Device; + + /// <summary> + /// Value passed in the wParam parameter of the <see cref="WindowMessage.Input"/> message. + /// </summary> + public IntPtr Param; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawInputHeader>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs b/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs new file mode 100644 index 00000000..bc3c7466 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs @@ -0,0 +1,39 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about the state of the keyboard. + /// </summary> + public struct RawKeyboard + { + /// <summary> + /// Scan code from the key depression. The scan code for keyboard overrun is KEYBOARD_OVERRUN_MAKE_CODE. + /// </summary> + public ushort MakeCode; + + /// <summary> + /// Flags for scan code information. + /// </summary> + public RawKeyboardScanCodeFlags Flags; + + /// <summary> + /// Reserved; must be zero. + /// </summary> + public ushort Reserved; + + /// <summary> + /// Microsoft Windows message compatible virtual-key code. For more information, see Virtual-Key Codes. + /// </summary> + public VirtualKey VKey; + + /// <summary> + /// Corresponding window message, for example <see cref="WindowMessage.KeyDown"/>, + /// <see cref="WindowMessage.SystemKeyDown"/>, and so forth. + /// </summary> + public uint Message; + + /// <summary> + /// Device-specific additional information for the event. + /// </summary> + public uint ExtraInformation; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/RawMouse.cs b/Crow/src/backends/win32/User32/Structs/RawMouse.cs new file mode 100644 index 00000000..945be9fa --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/RawMouse.cs @@ -0,0 +1,67 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about the state of the mouse. + /// </summary> + [StructLayout(LayoutKind.Explicit)] + public struct RawMouse + { + /// <summary> + /// Mouse state. + /// </summary> + [FieldOffset(0)] + public RawMouseFlags Flags; + + /// <summary> + /// Reserved. Use <see cref="ButtonFlags"/> instead. + /// </summary> + [FieldOffset(4)] + public uint Buttons; + + /// <summary> + /// The transition state of the mouse buttons. + /// </summary> + [FieldOffset(4)] + public RawMouseButtonFlags ButtonFlags; + + /// <summary> + /// If <see cref="ButtonFlags"/> is <see cref="RawMouseButtonFlags.Wheel"/>, + /// this member is a signed value that specifies the wheel delta. + /// </summary> + [FieldOffset(6)] + public ushort ButtonData; + + /// <summary> + /// Raw state of the mouse buttons. + /// </summary> + [FieldOffset(8)] + public uint RawButtons; + + /// <summary> + /// Motion in the X direction. This is signed relative motion or absolute motion, + /// depending on the value of <see cref="Flags"/>. + /// </summary> + [FieldOffset(12)] + public int LastX; + + /// <summary> + /// Motion in the Y direction. This is signed relative motion or absolute motion, + /// depending on the value of <see cref="Flags"/>. + /// </summary> + [FieldOffset(16)] + public int LastY; + + /// <summary> + /// Device-specific additional information for the event. + /// </summary> + [FieldOffset(20)] + public uint ExtraInformation; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<RawMouse>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/Rect.cs b/Crow/src/backends/win32/User32/Structs/Rect.cs new file mode 100644 index 00000000..832420cb --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/Rect.cs @@ -0,0 +1,102 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Defines the coordinates of the upper-left and lower-right corners of a rectangle. + /// </summary> + /// <remarks> + /// By convention, the right and bottom edges of the rectangle are normally considered exclusive. In other words, + /// the pixel whose coordinates are (right, bottom) lies immediately outside of the the rectangle. For example, + /// when <see cref="Rect"/> is passed to the FillRect function, the rectangle is filled up to, but not including, + /// the right column and bottom row of pixels. + /// </remarks> + public struct Rect + { + /// <summary> + /// Specifies the x-coordinate of the upper-left corner of the rectangle. + /// </summary> + public int Left; + + /// <summary> + /// Specifies the y-coordinate of the upper-left corner of the rectangle. + /// </summary> + public int Top; + + /// <summary> + /// Specifies the x-coordinate of the lower-right corner of the rectangle. + /// </summary> + public int Right; + + /// <summary> + /// Specifies the y-coordinate of the lower-right corner of the rectangle. + /// </summary> + public int Bottom; + + /// <summary> + /// Gets the width of the rectangle. + /// </summary> + public int Width => Right - Left; + + /// <summary> + /// Gets the height of the rectangle. + /// </summary> + public int Height => Bottom - Top; + + /// <inheritdoc/> + public override string ToString() => $"{{X={Left},Y={Top},Width={Width},Height={Height}}}"; + + /// <summary> + /// Implicitly converts a <see cref="Rect"/> structure into a <see cref="Rectangle"/> structure. + /// </summary> + /// <param name="value">A <see cref="Rectangle"/> with the same values as the given <see cref="Rect"/>.</param> + public static implicit operator Rectangle(Rect value) + { + return Rectangle.FromLTRB(value.Left, value.Top, value.Right, value.Bottom); + } + + /// <summary> + /// Implicitly converts a <see cref="Rectangle"/> structure into a <see cref="Rect"/> structure. + /// </summary> + /// <param name="value">A <see cref="Rect"/> with the same values as the given <see cref="Rectangle"/>.</param> + public static implicit operator Rect(Rectangle value) + { + return new Rect + { + Left = value.Left, + Right = value.Right, + Top = value.Top, + Bottom = value.Bottom + }; + } + + /// <summary> + /// Creates a <see cref="Rect"/> structure with the specified Size at location (0,0). + /// </summary> + /// <param name="value">The size from which to construct the new <see cref="Rect"/> structure.</param> + /// <returns>A <see cref="Rect"/> structure with the given size.</returns> + public static Rect FromSize(Size value) + { + return new Rect + { + Left = 0, + Right = value.Width, + Top = 0, + Bottom = value.Height + }; + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct PAINTSTRUCT + { + public IntPtr hdc; + public bool fErase; + public Rect rcPaint; + public bool fRestore; + public bool fIncUpdate; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] rgbReserved; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/StyleStruct.cs b/Crow/src/backends/win32/User32/Structs/StyleStruct.cs new file mode 100644 index 00000000..93cdd2c5 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/StyleStruct.cs @@ -0,0 +1,19 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains the styles for a window.<para/> + /// Both members can be <see cref="WindowStyles"/> or <see cref="ExtendedWindowStyles"/>. + /// </summary> + public struct StyleStruct + { + /// <summary> + /// The previous styles for a window. + /// </summary> + public uint StyleOld; + + /// <summary> + /// The new styles for a window. + /// </summary> + public uint StyleNew; + } +} diff --git a/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs b/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs new file mode 100644 index 00000000..e1b5cce6 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs @@ -0,0 +1,44 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Used by the <see cref="User32.Mouse.TrackMouseEvent(ref TrackMouseEvent)"/> function to track + /// when the mouse pointer leaves a window or hovers over a window for a specified amount of time. + /// </summary> + public struct TrackMouseEvent + { + /// <summary> + /// Set <see cref="HoverTime"/> to this value to use the system default hover time-out. + /// </summary> + public const uint DefaultHoverTime = 0xFFFFFFFF; + + /// <summary> + /// The size of the <see cref="TrackMouseEvent"/> structure, in bytes.<para/> + /// Set this to <see cref="SizeInBytes"/>. + /// </summary> + public uint Size; + + /// <summary> + /// The services requested. + /// </summary> + public TrackMouseEvents Flags; + + /// <summary> + /// A handle to the window to track. + /// </summary> + public IntPtr TrackWindowHandle; + + /// <summary> + /// The hover time-out (if <see cref="TrackMouseEvents.Hover"/> was specified in <see cref="Flags"/>), in + /// milliseconds. Can be <see cref="DefaultHoverTime"/>, which means to use the system default hover time-out. + /// </summary> + public uint HoverTime; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<TrackMouseEvent>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/WindowClass.cs b/Crow/src/backends/win32/User32/Structs/WindowClass.cs new file mode 100644 index 00000000..57f1a6f9 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/WindowClass.cs @@ -0,0 +1,78 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains the window class attributes that are registered by the RegisterClass function. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct WindowClass + { + /// <summary> + /// The class style(s). This member can be any combination of <see cref="WindowClassStyles"/>. + /// </summary> + public WindowClassStyles Style; + + /// <summary> + /// A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. + /// </summary> + public WindowProc WindowProc; + + /// <summary> + /// The number of extra bytes to allocate following the window-class structure. + /// The system initializes the bytes to zero. + /// </summary> + public int ClassExtra; + + /// <summary> + /// The number of extra bytes to allocate following the window instance. The system initializes the bytes + /// to zero. If an application uses <see cref="WindowClass"/> to register a dialog box created by + /// using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + /// </summary> + public int WindowExtra; + + /// <summary> + /// A handle to the instance that contains the window procedure for the class. + /// </summary> + public IntPtr Instance; + + /// <summary> + /// A handle to the class icon. This member must be a handle to an icon resource. + /// If this member is <see cref="IntPtr.Zero"/>, the system provides a default icon. + /// </summary> + public IntPtr Icon; + + /// <summary> + /// A handle to the class cursor. This member must be a handle to a cursor resource. + /// If this member is <see cref="IntPtr.Zero"/>, an application must explicitly set the cursor shape + /// whenever the mouse moves into the application's window. + /// </summary> + public IntPtr Cursor; + + /// <summary> + /// A handle to the class background brush. This member can be a handle to the brush to be used for + /// painting the background, or it can be a color value.<para/> + /// For more information on setting this to a color value, check the official documentation. + /// </summary> + public IntPtr Background; + + /// <summary> + /// Pointer to a string that specifies the resource name of the class menu, as the name appears in the + /// resource file. If this member is null, windows belonging to this class have no default menu. + /// </summary> + public string MenuName; + + /// <summary> + /// A string specifying the window class name. The class name can be any name registered with + /// RegisterClass or <see cref="User32.WindowClass.RegisterClassEx(ref ExtendedWindowClass)"/>, + /// or any of the predefined control-class names. + /// </summary> + public string ClassName; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<WindowClass>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/WindowInfo.cs b/Crow/src/backends/win32/User32/Structs/WindowInfo.cs new file mode 100644 index 00000000..e5df1d31 --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/WindowInfo.cs @@ -0,0 +1,66 @@ +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains window information. + /// </summary> + public struct WindowInfo + { + /// <summary> + /// The size of the structure, in bytes. + /// </summary> + public uint Size; + + /// <summary> + /// Pointer to a RECT structure that specifies the coordinates of the window. + /// </summary> + public Rect Window; + + /// <summary> + /// Pointer to a RECT structure that specifies the coordinates of the client area. + /// </summary> + public Rect Client; + + /// <summary> + /// The window styles. For a table of window styles, see CreateWindowEx. + /// </summary> + public WindowStyles Style; + + /// <summary> + /// The extended window styles. For a table of extended window styles, see CreateWindowEx. + /// </summary> + public ExtendedWindowStyles ExtendedStyle; + + /// <summary> + /// The window status. If this member is WS_ACTIVECAPTION, the window is active. + /// Otherwise, this member is zero. + /// </summary> + public uint WindowStatus; + + /// <summary> + /// The width of the window border, in pixels. + /// </summary> + public uint WindowBordersX; + + /// <summary> + /// The height of the window border, in pixels. + /// </summary> + public uint WindowBordersY; + + /// <summary> + /// The window class atom (see RegisterClass). + /// </summary> + public ushort WindowType; + + /// <summary> + /// The Microsoft Windows version of the application that created the window. + /// </summary> + public ushort CreatorVersion; + + /// <summary> + /// The size of this structure in bytes. + /// </summary> + public static readonly uint SizeInBytes = (uint)Marshal.SizeOf<WindowInfo>(); + } +} diff --git a/Crow/src/backends/win32/User32/Structs/WindowPosition.cs b/Crow/src/backends/win32/User32/Structs/WindowPosition.cs new file mode 100644 index 00000000..1e3d89eb --- /dev/null +++ b/Crow/src/backends/win32/User32/Structs/WindowPosition.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Contains information about the size and position of a window. + /// </summary> + [StructLayout(LayoutKind.Sequential)] + public struct WindowPosition + { + /// <summary> + /// Handle to the window. + /// </summary> + public IntPtr HWnd; + + /// <summary> + /// Specifies the position of the window in Z order (front-to-back position). + /// This member can be a handle to the window behind which this window is placed, + /// or can be one of the special values listed with the SetWindowPos function. + /// </summary> + public IntPtr HWndInsertAfter; + + /// <summary> + /// Specifies the position of the left edge of the window. + /// </summary> + public int X; + + /// <summary> + /// Specifies the position of the top edge of the window. + /// </summary> + public int Y; + + /// <summary> + /// Specifies the window width, in pixels. + /// </summary> + public int Width; + + /// <summary> + /// Specifies the window height, in pixels. + /// </summary> + public int Height; + + /// <summary> + /// Specifies the window position. + /// </summary> + public SetWindowPosFlags Flags; + } +} diff --git a/Crow/src/backends/win32/User32/Timer.cs b/Crow/src/backends/win32/User32/Timer.cs new file mode 100644 index 00000000..9266e811 --- /dev/null +++ b/Crow/src/backends/win32/User32/Timer.cs @@ -0,0 +1,88 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with timers. + /// </summary> + public static class Timer + { + /// <summary> + /// Creates a timer with the specified time-out value. + /// </summary> + /// <param name="window"> + /// A handle to the window to be associated with the timer. This window must be owned + /// by the calling thread. If a <see cref="IntPtr.Zero"/> value for <paramref name="window"/> is passed + /// in along with an <paramref name="timerID"/> of an existing timer, that timer will be replaced in the + /// same way that an existing non-zero <paramref name="window"/> timer will be. + /// </param> + /// <param name="timerID"> + /// A nonzero timer identifier. If the <paramref name="window"/> parameter is <see cref="IntPtr.Zero"/>, + /// and the <paramref name="timerID"/> does not match an existing timer then it is ignored and a new + /// timer ID is generated.<para/> + /// If the <paramref name="window"/> parameter is not <see cref="IntPtr.Zero"/> + /// and the window specified by <paramref name="window"/> already has a timer with the value + /// <paramref name="timerID"/>, then the existing timer is replaced by the new timer. When + /// <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/> replaces a timer, the timer is reset. + /// Therefore, a message will be sent after the current time-out value elapses, but the previously set + /// time-out value is ignored.<para/> + /// If the call is not intended to replace an existing timer, + /// <paramref name="timerID"/> should be 0 if the <paramref name="window"/> is <see cref="IntPtr.Zero"/>. + /// </param> + /// <param name="elapse">The time-out value, in milliseconds.</param> + /// <param name="timerFunc"> + /// A pointer to the function to be notified when the time-out value elapses. For more information about + /// the function, see <see cref="TimerProc"/>. If <paramref name="timerFunc"/> is null, the system posts + /// a <see cref="WindowMessage.Timer"/> message to the application queue. The <see cref="Msg.HWnd"/> + /// member of the message's <see cref="Msg"/> structure contains + /// the value of the <paramref name="window"/> parameter. + /// </param> + /// <returns> + /// If the function succeeds and the <paramref name="window"/> parameter is <see cref="IntPtr.Zero"/>, + /// the return value is an integer identifying the new timer. An application can pass this value to the + /// <see cref="KillTimer(IntPtr, UIntPtr)"/> function to destroy the timer. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern UIntPtr SetTimer + ( + [In] [Optional] IntPtr window, + [In] UIntPtr timerID, + [In] uint elapse, + [In] [Optional] TimerProc timerFunc + ); + + /// <summary> + /// Destroys the specified timer. + /// </summary> + /// <param name="window"> + /// A handle to the window associated with the specified timer. This value must be the same as the window + /// value passed to the <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/> + /// function that created the timer. + /// </param> + /// <param name="timerID"> + /// The timer to be destroyed. If the window handle passed to + /// <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/> is valid, this parameter must be the same as + /// the timerID value passed to <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/>. If the application + /// calls <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/> with window set to + /// <see cref="IntPtr.Zero"/>, this parameter must be the timer identifier returned by + /// <see cref="SetTimer(IntPtr, UIntPtr, uint, TimerProc)"/>. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool KillTimer + ( + [In] [Optional] IntPtr window, + [In] UIntPtr timerID + ); + } + } +} diff --git a/Crow/src/backends/win32/User32/User32.cs b/Crow/src/backends/win32/User32/User32.cs new file mode 100644 index 00000000..a4883d05 --- /dev/null +++ b/Crow/src/backends/win32/User32/User32.cs @@ -0,0 +1,13 @@ +namespace OpenToolkit.NT.Native +{ + /// <summary> + /// Provides a subset of functions from the Windows API, specifically those that are imported from user32.dll. + /// </summary> + public static partial class User32 + { + /// <summary> + /// The filename of the dynamic link library (DLL) that contains these functions. + /// </summary> + public const string Library = "user32.dll"; + } +} diff --git a/Crow/src/backends/win32/User32/Window.cs b/Crow/src/backends/win32/User32/Window.cs new file mode 100644 index 00000000..4aa9b21a --- /dev/null +++ b/Crow/src/backends/win32/User32/Window.cs @@ -0,0 +1,969 @@ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with windows. + /// </summary> + public static class Window + { + /// <summary> + /// Calculates the required size of the window rectangle, based on the desired client-rectangle size. + /// The window rectangle can then be passed to the CreateWindow function to create a window whose + /// client area is the desired size. + /// </summary> + /// <param name="rect"> + /// A pointer to a <see cref="Rect"/> structure that contains the coordinates of the top-left and + /// bottom-right corners of the desired client area. When the function returns, the structure contains + /// the coordinates of the top-left and bottom-right corners of the window to accommodate the desired + /// client area. + /// </param> + /// <param name="style"> + /// The window style of the window whose required size is to be calculated. + /// Note that you cannot specify the <see cref="WindowStyles.Overlapped"/> style. + /// </param> + /// <param name="hasMenu">Indicates whether the window has a menu.</param> + /// <returns> + /// If the function succeeds, the return value is nonzero. + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool AdjustWindowRect + ( + [In] [Out] ref Rect rect, + [In] WindowStyles style, + [In] bool hasMenu + ); + + /// <summary> + /// Calculates the required size of the window rectangle, based on the desired client-rectangle size. + /// The window rectangle can then be passed to the + /// <see cref="CreateWindowEx(ExtendedWindowStyles, string, string, WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> + /// function to create a window whose client area is the desired size. + /// </summary> + /// <param name="rect"> + /// A pointer to a <see cref="Rect"/> structure that contains the coordinates of the top-left and + /// bottom-right corners of the desired client area. When the function returns, the structure contains + /// the coordinates of the top-left and bottom-right corners of the window to accommodate the + /// desired client area. + /// </param> + /// <param name="style"> + /// The window style of the window whose required size is to be calculated. + /// Note that you cannot specify the <see cref="WindowStyles.Overlapped"/> style. + /// </param> + /// <param name="hasMenu">Indicates whether the window has a menu.</param> + /// <param name="extendedStyle"> + /// The extended window style of the window whose required size is to be calculated. + /// </param> + /// <returns> + /// If the function succeeds, the return value is nonzero. + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool AdjustWindowRectEx + ( + [In] [Out] ref Rect rect, + [In] WindowStyles style, + [In] bool hasMenu, + [In] ExtendedWindowStyles extendedStyle + ); + + /// <summary> + /// A constant that can be used in all CreateWindowEx overloads to specify special behavior.<para/> + /// For more information, see any CreateWindowEx overload. + /// </summary> + public const int UseDefault = unchecked((int)0x80000000); + + /// <summary> + /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, + /// this function is identical to the CreateWindow function. + /// </summary> + /// <param name="extendedStyle">The extended window style of the window being created.</param> + /// <param name="className">A string specifying the window class name.</param> + /// <param name="windowName"> + /// The window name. If the window style specifies a title bar, + /// the window title pointed to by <paramref name="windowName"/> is displayed in the title bar. + /// </param> + /// <param name="style">The style of the window being created.</param> + /// <param name="x"> + /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is + /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner + /// of the parent window's client area.<para/> + /// If x is set to <see cref="int.MinValue"/>, the system selects the default position for the window's + /// upper-left corner and ignores the y parameter. <see cref="int.MinValue"/> is valid only for overlapped + /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. + /// </param> + /// <param name="y"> + /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is + /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left + /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the + /// upper-left corner of the list box's client area relative to the upper-left corner of the parent + /// window's client area.<para/> + /// If an overlapped window is created with the <see cref="WindowStyles.Visible"/> style bit set and + /// the x parameter is set to <see cref="int.MinValue"/>, then the y parameter determines how the window + /// is shown. If the y parameter is <see cref="int.MinValue"/>, then the window manager calls + /// <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with the <see cref="ShowWindowCommand.Show"/> + /// flag after the window has been created. If the y parameter is some other value, then the window manager + /// calls <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with that value as the nCmdShow parameter. + /// </param> + /// <param name="width"> + /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in + /// screen coordinates, or <see cref="UseDefault"/>.<para/> + /// If nWidth is <see cref="UseDefault"/>, the system selects a default width and height for the window; + /// the default width extends from the initial x-coordinates to the right edge of the screen; the default + /// height extends from the initial y-coordinate to the top of the icon area.<para/> + /// <see cref="UseDefault"/> is valid only for overlapped windows; if <see cref="UseDefault"/> is + /// specified for a pop-up or child window, the <paramref name="width"/> and <paramref name="height"/> + /// parameter are set to zero. + /// </param> + /// <param name="height"> + /// The height, in device units, of the window. For overlapped windows, <paramref name="height"/> is the + /// window's height, in screen coordinates.<para/> + /// If the <paramref name="width"/> parameter is set to <see cref="UseDefault"/>, + /// the system ignores <paramref name="height"/>. + /// </param> + /// <param name="parentWindow"> + /// A handle to the parent or owner window of the window being created. To create a child window or an + /// owned window, supply a valid window handle. This parameter is optional for pop-up windows.<para/> + /// </param> + /// <param name="menu"> + /// A handle to a menu, or specifies a child-window identifier, depending on the window style.<para/> + /// For an overlapped or pop-up window, <paramref name="menu"/> identifies the menu to be used with the + /// window; it can be <see cref="IntPtr.Zero"/> if the class menu is to be used.<para/> + /// For a child window, <paramref name="menu"/> specifies the child-window identifier, an integer value + /// used by a dialog box control to notify its parent about events. The application determines the + /// child-window identifier; it must be unique for all child windows with the same parent window. + /// </param> + /// <param name="moduleInstance"> + /// A handle to the instance of the module to be associated with the window. + /// </param> + /// <param name="createParam"> + /// Pointer to a value to be passed to the window through the <see cref="CreateStruct"/> structure + /// (<see cref="CreateStruct.CreateParams"/> member) pointed to by the lParam param of the + /// <see cref="WindowMessage.Create"/> message.<para/> + /// This message is sent to the created window by this function before it returns. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle to the new window. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern IntPtr CreateWindowEx + ( + [In] ExtendedWindowStyles extendedStyle, + [In] [Optional] string className, + [In] [Optional] string windowName, + [In] WindowStyles style, + [In] int x, + [In] int y, + [In] int width, + [In] int height, + [In] [Optional] IntPtr parentWindow, + [In] [Optional] IntPtr menu, + [In] [Optional] IntPtr moduleInstance, + [In] [Optional] IntPtr createParam + ); + + /// <summary> + /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, + /// this function is identical to the CreateWindow function. + /// </summary> + /// <param name="extendedStyle">The extended window style of the window being created.</param> + /// <param name="className">A pointer to a string specifying the window class name.</param> + /// <param name="windowName"> + /// The window name. If the window style specifies a title bar, + /// the window title pointed to by <paramref name="windowName"/> is displayed in the title bar. + /// </param> + /// <param name="style">The style of the window being created.</param> + /// <param name="x"> + /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is + /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner + /// of the parent window's client area.<para/> + /// If x is set to <see cref="int.MinValue"/>, the system selects the default position for the window's + /// upper-left corner and ignores the y parameter. <see cref="int.MinValue"/> is valid only for overlapped + /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. + /// </param> + /// <param name="y"> + /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is + /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left + /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the + /// upper-left corner of the list box's client area relative to the upper-left corner of the parent + /// window's client area.<para/> + /// If an overlapped window is created with the <see cref="WindowStyles.Visible"/> style bit set and + /// the x parameter is set to <see cref="int.MinValue"/>, then the y parameter determines how the window + /// is shown. If the y parameter is <see cref="int.MinValue"/>, then the window manager calls + /// <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with the <see cref="ShowWindowCommand.Show"/> + /// flag after the window has been created. If the y parameter is some other value, then the window manager + /// calls <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with that value as the nCmdShow parameter. + /// </param> + /// <param name="width"> + /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in + /// screen coordinates, or <see cref="UseDefault"/>.<para/> + /// If nWidth is <see cref="UseDefault"/>, the system selects a default width and height for the window; + /// the default width extends from the initial x-coordinates to the right edge of the screen; the default + /// height extends from the initial y-coordinate to the top of the icon area.<para/> + /// <see cref="UseDefault"/> is valid only for overlapped windows; if <see cref="UseDefault"/> is + /// specified for a pop-up or child window, the <paramref name="width"/> and <paramref name="height"/> + /// parameter are set to zero. + /// </param> + /// <param name="height"> + /// The height, in device units, of the window. For overlapped windows, <paramref name="height"/> is the + /// window's height, in screen coordinates.<para/> + /// If the <paramref name="width"/> parameter is set to <see cref="UseDefault"/>, + /// the system ignores <paramref name="height"/>. + /// </param> + /// <param name="parentWindow"> + /// A handle to the parent or owner window of the window being created. To create a child window or an + /// owned window, supply a valid window handle. This parameter is optional for pop-up windows.<para/> + /// </param> + /// <param name="menu"> + /// A handle to a menu, or specifies a child-window identifier, depending on the window style.<para/> + /// For an overlapped or pop-up window, <paramref name="menu"/> identifies the menu to be used with the + /// window; it can be <see cref="IntPtr.Zero"/> if the class menu is to be used.<para/> + /// For a child window, <paramref name="menu"/> specifies the child-window identifier, an integer value + /// used by a dialog box control to notify its parent about events. The application determines the + /// child-window identifier; it must be unique for all child windows with the same parent window. + /// </param> + /// <param name="moduleInstance"> + /// A handle to the instance of the module to be associated with the window. + /// </param> + /// <param name="createParam"> + /// Pointer to a value to be passed to the window through the <see cref="CreateStruct"/> structure + /// (<see cref="CreateStruct.CreateParams"/> member) pointed to by the lParam param of the + /// <see cref="WindowMessage.Create"/> message.<para/> + /// This message is sent to the created window by this function before it returns. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle to the new window. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern IntPtr CreateWindowEx + ( + [In] ExtendedWindowStyles extendedStyle, + [In] [Optional] IntPtr className, + [In] [Optional] string windowName, + [In] WindowStyles style, + [In] int x, + [In] int y, + [In] int width, + [In] int height, + [In] [Optional] IntPtr parentWindow, + [In] [Optional] IntPtr menu, + [In] [Optional] IntPtr moduleInstance, + [In] [Optional] IntPtr createParam + ); + + /// <summary> + /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, + /// this function is identical to the CreateWindow function. + /// </summary> + /// <param name="extendedStyle">The extended window style of the window being created.</param> + /// <param name="classAtom"> + /// A class atom created by a previous call to RegisterClass or + /// <see cref="WindowClass.RegisterClassEx(ref ExtendedWindowClass)"/>. + /// </param> + /// <param name="windowName"> + /// The window name. If the window style specifies a title bar, + /// the window title pointed to by <paramref name="windowName"/> is displayed in the title bar. + /// </param> + /// <param name="style">The style of the window being created.</param> + /// <param name="x"> + /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is + /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner + /// of the parent window's client area.<para/> + /// If x is set to <see cref="int.MinValue"/>, the system selects the default position for the window's + /// upper-left corner and ignores the y parameter. <see cref="int.MinValue"/> is valid only for overlapped + /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. + /// </param> + /// <param name="y"> + /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is + /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, + /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left + /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the + /// upper-left corner of the list box's client area relative to the upper-left corner of the parent + /// window's client area.<para/> + /// If an overlapped window is created with the <see cref="WindowStyles.Visible"/> style bit set and + /// the x parameter is set to <see cref="int.MinValue"/>, then the y parameter determines how the window + /// is shown. If the y parameter is <see cref="int.MinValue"/>, then the window manager calls + /// <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with the <see cref="ShowWindowCommand.Show"/> + /// flag after the window has been created. If the y parameter is some other value, then the window manager + /// calls <see cref="ShowWindow(IntPtr, ShowWindowCommand)"/> with that value as the nCmdShow parameter. + /// </param> + /// <param name="width"> + /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in + /// screen coordinates, or <see cref="UseDefault"/>.<para/> + /// If nWidth is <see cref="UseDefault"/>, the system selects a default width and height for the window; + /// the default width extends from the initial x-coordinates to the right edge of the screen; the default + /// height extends from the initial y-coordinate to the top of the icon area.<para/> + /// <see cref="UseDefault"/> is valid only for overlapped windows; if <see cref="UseDefault"/> is + /// specified for a pop-up or child window, the <paramref name="width"/> and <paramref name="height"/> + /// parameter are set to zero. + /// </param> + /// <param name="height"> + /// The height, in device units, of the window. For overlapped windows, <paramref name="height"/> is the + /// window's height, in screen coordinates.<para/> + /// If the <paramref name="width"/> parameter is set to <see cref="UseDefault"/>, + /// the system ignores <paramref name="height"/>. + /// </param> + /// <param name="parentWindow"> + /// A handle to the parent or owner window of the window being created. To create a child window or an + /// owned window, supply a valid window handle. This parameter is optional for pop-up windows.<para/> + /// </param> + /// <param name="menu"> + /// A handle to a menu, or specifies a child-window identifier, depending on the window style.<para/> + /// For an overlapped or pop-up window, <paramref name="menu"/> identifies the menu to be used with the + /// window; it can be <see cref="IntPtr.Zero"/> if the class menu is to be used.<para/> + /// For a child window, <paramref name="menu"/> specifies the child-window identifier, an integer value + /// used by a dialog box control to notify its parent about events. The application determines the + /// child-window identifier; it must be unique for all child windows with the same parent window. + /// </param> + /// <param name="moduleInstance"> + /// A handle to the instance of the module to be associated with the window. + /// </param> + /// <param name="createParam"> + /// Pointer to a value to be passed to the window through the <see cref="CreateStruct"/> structure + /// (<see cref="CreateStruct.CreateParams"/> member) pointed to by the lParam param of the + /// <see cref="WindowMessage.Create"/> message.<para/> + /// This message is sent to the created window by this function before it returns. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle to the new window. + /// If the function fails, the return value is <see cref="IntPtr.Zero"/>. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr CreateWindowEx + ( + [In] ExtendedWindowStyles extendedStyle, + [In] [Optional] ushort classAtom, + [In] [Optional] string windowName, + [In] WindowStyles style, + [In] int x, + [In] int y, + [In] int width, + [In] int height, + [In] [Optional] IntPtr parentWindow, + [In] [Optional] IntPtr menu, + [In] [Optional] IntPtr moduleInstance, + [In] [Optional] IntPtr createParam + ) + { + return CreateWindowEx + ( + extendedStyle, + new IntPtr(classAtom), + windowName, + style, + x, + y, + width, + height, + parentWindow, + menu, + moduleInstance, + createParam + ); + } + + /// <summary> + /// Destroys the specified window. The function sends <see cref="WindowMessage.Destroy"/> + /// and <see cref="WindowMessage.NCDestroy"/> messages to the window to deactivate it and remove the + /// keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, + /// destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain + /// (if the window is at the top of the viewer chain).<para/> + /// If the specified window is a parent or owner window, <see cref="DestroyWindow(IntPtr)"/> automatically + /// destroys the associated child or owned windows when it destroys the parent or owner window. The + /// function first destroys child or owned windows, and then it destroys the parent or owner window. + /// </summary> + /// <param name="window">A handle to the window to be destroyed.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DestroyWindow([In] IntPtr window); + + /// <summary> + /// Passes message information to the specified window procedure. + /// </summary> + /// <param name="previousWindowFunc"> + /// The previous window procedure. If this value is obtained by calling the + /// <see cref="GetWindowLong(IntPtr, GetWindowLongIndex)"/> function with the index parameter set to + /// <see cref="GetWindowLongIndex.WindowProcedure"/> or DWL_DLGPROC, it is actually either the address of + /// a window or dialog box procedure, or a special internal value meaningful only to + /// <see cref="CallWindowProc(IntPtr, IntPtr, WindowMessage, IntPtr, IntPtr)"/>. + /// </param> + /// <param name="window">A handle to the window procedure to receive the message.</param> + /// <param name="msg">The message.</param> + /// <param name="wparam"> + /// Additional message-specific information. + /// The contents of this parameter depend on the value of the <paramref name="msg"/> parameter. + /// </param> + /// <param name="lparam"> + /// Additional message-specific information. + /// The contents of this parameter depend on the value of the <paramref name="msg"/> parameter. + /// </param> + /// <returns> + /// The return value specifies the result of the message processing and depends on the message sent. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + public static extern IntPtr CallWindowProc + ( + [In] IntPtr previousWindowFunc, + [In] IntPtr window, + [In] WindowMessage msg, + [In] IntPtr wparam, + [In] IntPtr lparam + ); + + /// <summary> + /// Sets the current process as dots per inch (dpi) aware. Note: <see cref="SetProcessDPIAware"/> is + /// subject to a possible race condition if a DLL caches dpi settings during initialization. + /// For this reason, it is recommended that dpi-aware be set through the application (.exe) manifest + /// rather than by calling <see cref="SetProcessDPIAware"/>. + /// </summary> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// Otherwise, the return value is false. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetProcessDPIAware(); + + /// <summary> + /// Changes the window procedure of the specified window. + /// </summary> + /// <param name="window"> + /// A handle to the window and, indirectly, the class to which the window belongs. + /// </param> + /// <param name="newProc">The replacement window procedure.</param> + /// <returns> + /// If the function succeeds, the return value is the previous value + /// of the specified 32-bit integer.<para/> + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr SetWindowLong(IntPtr window, WindowProc newProc) + { + return SetWindowLong + ( + window, + GetWindowLongIndex.WindowProcedure, + Marshal.GetFunctionPointerForDelegate(newProc) + ); + } + + /// <summary> + /// Changes an attribute of the specified window. + /// The function also sets a value at the specified offset in the extra window memory. + /// </summary> + /// <param name="window"> + /// A handle to the window and, indirectly, the class to which the window belongs. + /// </param> + /// <param name="index"> + /// One of the pre-defined values specifying the offset to the value to be set. + /// </param> + /// <param name="newLong">The replacement value.</param> + /// <returns> + /// If the function succeeds, the return value is the previous value of the + /// specified 32-bit integer.<para/> + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static IntPtr SetWindowLong(IntPtr window, GetWindowLongIndex index, IntPtr newLong) + { + return SetWindowLong(window, (int)index, newLong); + } + + /// <summary> + /// Changes an attribute of the specified window. The function also sets a value at the specified offset + /// in the extra window memory. + /// </summary> + /// <param name="window"> + /// A handle to the window and, indirectly, the class to which the window belongs. + /// </param> + /// <param name="index"> + /// The zero-based offset to the value to be set. Valid values are in the range zero through the number + /// of bytes of extra window memory, minus the size of an <see cref="IntPtr"/>. + /// </param> + /// <param name="newLong">The replacement value.</param> + /// <returns> + /// If the function succeeds, the return value is the previous value of the + /// specified 32-bit integer.<para/> + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + /// <remarks> + /// This method is a wrapper around both the SetWindowLong (32-bit) and the SetWindowLongPtr (64-bit) + /// version of these functions.<para/> + /// This method will always call the "correct" function for this machine, + /// and return the value wrapped in an <see cref="IntPtr"/>. + /// This method will throw a <see cref="Win32Exception"/> if the Windows API function returns a value + /// that indicates failure. + /// </remarks> + /// <exception cref="Win32Exception">An error occurs in the native function call.</exception> + public static IntPtr SetWindowLong(IntPtr window, int index, IntPtr newLong) + { + //Kernel32.SetLastError(0); + + IntPtr result; + if (IntPtr.Size == 8) + { + result = SetWindowLongPtr(window, index, newLong); + } + else + { + result = new IntPtr(SetWindowLong(window, index, newLong.ToInt32())); + } + + int error; + if (result == IntPtr.Zero && (error = Marshal.GetLastWin32Error()) != 0) + { + throw new Win32Exception(error, "Failed to modify window border."); + } + + return result; + } + + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + private static extern int SetWindowLong + ( + [In] IntPtr window, + [In] int index, + [In] int newLong + ); + + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + private static extern IntPtr SetWindowLongPtr + ( + [In] IntPtr window, + [In] int index, + [In] IntPtr newLong + ); + + /// <summary> + /// Retrieves information about the specified window. The function also retrieves the value at a + /// specified offset into the extra window memory. + /// </summary> + /// <param name="window"> + /// A handle to the window and, indirectly, the class to which the window belongs. + /// </param> + /// <param name="index"> + /// One of the pre-defined values specifying the offset to the value to be retrieved. + /// </param> + /// <returns> + /// If the function succeeds, the return value is the requested value.<para/> + /// If the function fails, the return value is zero. To get extended error information, call + /// <see cref="Marshal.GetLastWin32Error"/>.<para/> + /// If SetWindowLong or SetWindowLongPtr has not been called previously, + /// GetWindowLongPtr returns zero for values in the extra window or class memory. + /// </returns> + /// <remarks> + /// This method is a wrapper around both the GetWindowLong (32-bit) and the GetWindowLongPtr + /// (64-bit) version of these functions.<para/> + /// This method will always call the "correct" function for this machine, + /// and return the value wrapped in an <see cref="IntPtr"/>. + /// </remarks> + public static IntPtr GetWindowLong(IntPtr window, GetWindowLongIndex index) + { + return GetWindowLong(window, (int)index); + } + + /// <summary> + /// Retrieves information about the specified window. The function also retrieves the value at a specified + /// offset into the extra window memory. + /// </summary> + /// <param name="window"> + /// A handle to the window and, indirectly, the class to which the window belongs. + /// </param> + /// <param name="index"> + /// The zero-based offset to the value to be retrieved. Valid values are in the range zero through the + /// number of bytes of extra window memory, minus the size of a <see cref="IntPtr"/>. + /// </param> + /// <returns> + /// If the function succeeds, the return value is the requested value.<para/> + /// If the function fails, the return value is zero. To get extended error information, + /// call <see cref="Marshal.GetLastWin32Error"/>.<para/> + /// If SetWindowLong or SetWindowLongPtr has not been called previously, GetWindowLongPtr returns zero for + /// values in the extra window or class memory. + /// </returns> + /// <remarks> + /// This method is a wrapper around both the GetWindowLong (32-bit) and the GetWindowLongPtr (64-bit) + /// version of these functions.<para/> + /// This method will always call the "correct" function for this machine, + /// and return the value wrapped in an <see cref="IntPtr"/>. + /// </remarks> + public static IntPtr GetWindowLong(IntPtr window, int index) + { + if (IntPtr.Size == 8) + { + return GetWindowLongPtr(window, index); + } + else + { + return new IntPtr(GetWindowLongPrivate(window, index)); + } + } + + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + private static extern int GetWindowLongPrivate([In] IntPtr window, [In] int index); + + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + private static extern IntPtr GetWindowLongPtr([In] IntPtr window, [In] int index); + + /// <summary> + /// Calls the default window procedure to provide default processing for any window messages that an + /// application does not process. This function ensures that every message is processed. + /// </summary> + /// <param name="window">A handle to the window procedure that received the message.</param> + /// <param name="msg">The message.</param> + /// <param name="wparam"> + /// Additional message information. The content of this parameter depends on the value of the + /// <paramref name="msg"/> parameter. + /// </param> + /// <param name="lparam"> + /// Additional message information. The content of this parameter depends on the value of the + /// <paramref name="msg"/> parameter. + /// </param> + /// <returns>The return value is the result of the message processing and depends on the message.</returns> + [DllImport(Library, CharSet = CharSet.Unicode)] + public static extern IntPtr DefWindowProc + ( + [In] IntPtr window, + [In] WindowMessage msg, + [In] IntPtr wparam, + [In] IntPtr lparam + ); + + /// <summary> + /// Sets the specified window's show state. + /// </summary> + /// <param name="window">A handle to the window.</param> + /// <param name="showCommand">Controls how the window is to be shown.</param> + /// <returns>If the window was previously visible, the return value is true. Otherwise false.</returns> + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ShowWindow([In] IntPtr window, [In] ShowWindowCommand showCommand); + + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + public static extern IntPtr BeginPaint(IntPtr hwnd, out PAINTSTRUCT lpPaint); + + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool EndPaint(IntPtr hWnd, [In] ref PAINTSTRUCT lpPaint); + + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + public static extern IntPtr GetDC(IntPtr hWnd); + + [DllImport(Library, SetLastError = true)] + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); + + /// <summary> + /// Copies the text of the specified window's title bar (if it has one) into a buffer. If the specified + /// window is a control, the text of the control is copied. However, + /// <see cref="GetWindowText(IntPtr, StringBuilder, int)"/> cannot retrieve the text of a control in another + /// application. + /// </summary> + /// <param name="window">A handle to the window or control containing the text.</param> + /// <param name="windowText"> + /// The buffer that will receive the text. If the string is as long or longer than the buffer, + /// the string is truncated and terminated with a null character. + /// </param> + /// <param name="maxCharCount"> + /// The maximum number of characters to copy to the buffer, including the null character. + /// If the text exceeds this limit, it is truncated. + /// </param> + /// <returns> + /// If the function succeeds, the return value is the length, in characters, of the copied string, not + /// including the terminating null character. If the window has no title bar or text, if the title bar + /// is empty, or if the window or control handle is invalid, the return value is zero. To get extended + /// error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern int GetWindowText + ( + [In] IntPtr window, + [In] [Out] StringBuilder windowText, + [In] int maxCharCount + ); + + /// <summary> + /// Changes the text of the specified window's title bar (if it has one). If the specified window is a + /// control, the text of the control is changed. However, <see cref="SetWindowText(IntPtr, string)"/> + /// cannot change the text of a control in another application. + /// </summary> + /// <param name="window">A handle to the window or control whose text is to be changed.</param> + /// <param name="newText">The new title or control text.</param> + /// <returns> + /// If the function succeeds, the return value is nonzero.<para/> + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetWindowText + ( + [In] IntPtr window, + [In] [Optional] string newText + ); + + /// <summary> + /// Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are + /// ordered according to their appearance on the screen. The topmost window receives the highest rank + /// and is the first window in the Z order. + /// </summary> + /// <param name="window">A handle to the window.</param> + /// <param name="windowInsertAfter"> + /// A handle to the window to precede the positioned window in the Z order. + /// This parameter must be a window handle. + /// </param> + /// <param name="x">The new position of the left side of the window, in client coordinates.</param> + /// <param name="y">The new position of the top of the window, in client coordinates.</param> + /// <param name="cx">The new width of the window, in pixels.</param> + /// <param name="cy">The new height of the window, in pixels.</param> + /// <param name="flags">The window sizing and positioning flags.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetWindowPos + ( + [In] IntPtr window, + [In] [Optional] IntPtr windowInsertAfter, + [In] int x, + [In] int y, + [In] int cx, + [In] int cy, + [In] SetWindowPosFlags flags + ); + + /// <summary> + /// Changes the size, position, and Z order of a child, pop-up, or top-level window. + /// These windows are ordered according to their appearance on the screen. The topmost window receives + /// the highest rank and is the first window in the Z order. + /// </summary> + /// <param name="window">One of the pre-defined values for window Z order positioning.</param> + /// <param name="windowInsertAfter"> + /// A handle to the window to precede the positioned window in the Z order. + /// This parameter must be a window handle. + /// </param> + /// <param name="x">The new position of the left side of the window, in client coordinates.</param> + /// <param name="y">The new position of the top of the window, in client coordinates.</param> + /// <param name="cx">The new width of the window, in pixels.</param> + /// <param name="cy">The new height of the window, in pixels.</param> + /// <param name="flags">The window sizing and positioning flags.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetWindowPos + ( + [In] IntPtr window, + [In] [Optional] SetWindowPosHwndEnum windowInsertAfter, + [In] int x, + [In] int y, + [In] int cx, + [In] int cy, + [In] SetWindowPosFlags flags + ); + + /// <summary> + /// Brings the thread that created the specified window into the foreground and activates the window. + /// Keyboard input is directed to the window, and various visual cues are changed for the user. + /// The system assigns a slightly higher priority to the thread that created the foreground window + /// than it does to other threads. + /// </summary> + /// <param name="window"> + /// A handle to the window that should be activated and brought to the foreground. + /// </param> + /// <returns> + /// If the window was brought to the foreground, the return value is true.<para/> + /// If the window was not brought to the foreground, the return value is false. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetForegroundWindow([In] IntPtr window); + + /// <summary> + /// Brings the specified window to the top of the Z order. If the window is a top-level window, it is + /// activated. If the window is a child window, the top-level parent window associated with the child + /// window is activated. + /// </summary> + /// <param name="window">A handle to the window to bring to the top of the Z order.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool BringWindowToTop([In] IntPtr window); + + /// <summary> + /// Changes the parent window of the specified child window. + /// </summary> + /// <param name="childWindow">A handle to the child window.</param> + /// <param name="newParent"> + /// A handle to the new parent window. If this parameter is + /// <see cref="IntPtr.Zero"/>, the desktop window becomes the new parent window. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a handle to the previous parent window.<para/> + /// If the function fails, the return value is null. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + public static extern IntPtr SetParent + ( + [In] IntPtr childWindow, + [In] [Optional] IntPtr newParent + ); + + /// <summary> + /// Retrieves information about the specified window. + /// </summary> + /// <param name="hwnd">A handle to the window whose information is to be retrieved.</param> + /// <param name="wi"> + /// A pointer to a <see cref="WindowInfo"/> structure to receive the information. + /// Note that you must set the <see cref="WindowInfo.Size"/> member to + /// <see cref="WindowInfo.SizeInBytes"/> before calling this function. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetWindowInfo([In] IntPtr hwnd, [In] [Out] ref WindowInfo wi); + + /// <summary> + /// Determines the visibility state of the specified window. + /// </summary> + /// <param name="window">A handle to the window to be tested.</param> + /// <returns> + /// If the specified window, its parent window, its parent's parent window, and so forth, have the + /// <see cref="WindowStyles.Visible"/> style, the return value is true. Otherwise, + /// the return value is false.<para/> + /// Because the return value specifies whether the window has the <see cref="WindowStyles.Visible"/> + /// style, it may be true even if the window is totally obscured by other windows. + /// </returns> + [DllImport(Library)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool IsWindowVisible([In] IntPtr window); + + /// <summary> + /// Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given + /// in screen coordinates that are relative to the upper-left corner of the screen. + /// </summary> + /// <param name="windowHandle">Handle to the window whose client coordinates are to be retrieved.</param> + /// <param name="windowRectangle"> + /// Pointer to a structure that receives the screen coordinates of the upper-left and + /// lower-right corners of the window. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetWindowRect([In] IntPtr windowHandle, [Out] out Rect windowRectangle); + + /// <summary> + /// Retrieves the coordinates of a window's client area. The client coordinates specify the upper-left + /// and lower-right corners of the client area. Because client coordinates are relative to the upper-left + /// corner of a window's client area, the coordinates of the upper-left corner are (0,0). + /// </summary> + /// <param name="windowHandle">Handle to the window whose client coordinates are to be retrieved.</param> + /// <param name="clientRectangle"> + /// Pointer to a <see cref="Rect"/> structure that receives the client coordinates. + /// The <see cref="Rect.Left"/> and <see cref="Rect.Top"/> members are zero. The <see cref="Rect.Right"/> + /// and <see cref="Rect.Bottom"/> members contain the width and height of the window. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetClientRect([In] IntPtr windowHandle, [Out] out Rect clientRectangle); + + /// <summary> + /// Converts the screen coordinates of a specified point on the screen to client-area coordinates. + /// </summary> + /// <param name="window">Handle to the window whose client area will be used for the conversion.</param> + /// <param name="point"> + /// Pointer to a <see cref="Point"/> structure that specifies the screen coordinates to be converted. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ScreenToClient([In] IntPtr window, ref Point point); + + /// <summary> + /// Converts the client-area coordinates of a specified point to screen coordinates. + /// </summary> + /// <param name="window">Handle to the window whose client area will be used for the conversion.</param> + /// <param name="point"> + /// Pointer to a <see cref="Point"/> structure that contains the client coordinates to be converted. + /// The new screen coordinates are copied into this structure if the function succeeds. + /// </param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the function fails, the return value is false. + /// </returns> + [SuppressUnmanagedCodeSecurity] + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ClientToScreen([In] IntPtr window, [In] [Out] ref Point point); + } + } +} diff --git a/Crow/src/backends/win32/User32/WindowClass.cs b/Crow/src/backends/win32/User32/WindowClass.cs new file mode 100644 index 00000000..b0462076 --- /dev/null +++ b/Crow/src/backends/win32/User32/WindowClass.cs @@ -0,0 +1,210 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenToolkit.NT.Native +{ + public static partial class User32 + { + /// <summary> + /// Provides a subset of functions from the Windows API, + /// specifically those imported from user32.dll that deal with window classes. + /// </summary> + public static class WindowClass + { + /// <summary> + /// Retrieves information about a window class, + /// including a handle to the small icon associated with the window class. + /// </summary> + /// <param name="instance"> + /// A handle to the instance of the application that created the class. + /// To retrieve information about classes defined by the system (such as buttons or list boxes), + /// set this parameter to <see cref="IntPtr.Zero"/>. + /// </param> + /// <param name="className"> + /// A string containing the class name. The name must be that of a preregistered class or a class + /// registered by a previous call to the RegisterClass or + /// <see cref="RegisterClassEx(ref ExtendedWindowClass)"/> function. + /// </param> + /// <param name="extendedWindowClass"> + /// A pointer to a <see cref="ExtendedWindowClass"/> structure + /// that receives the information about the class. + /// </param> + /// <returns> + /// If the function finds a matching class and successfully copies the data, the return value is + /// true.<para/> + /// If the function does not find a matching class and successfully copy the data, the return value is + /// false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetClassInfoEx + ( + [In] [Optional] IntPtr instance, + [In] string className, + [Out] out ExtendedWindowClass extendedWindowClass + ); + + /// <summary> + /// Retrieves information about a window class, + /// including a handle to the small icon associated with the window class. + /// </summary> + /// <param name="instance"> + /// A handle to the instance of the application that created the class. + /// To retrieve information about classes defined by the system (such as buttons or list boxes), + /// set this parameter to <see cref="IntPtr.Zero"/>. + /// </param> + /// <param name="className"> + /// A pointer to a string containing the class name. + /// The name must be that of a preregistered class or a class registered by a previous call to the + /// RegisterClass or <see cref="RegisterClassEx(ref ExtendedWindowClass)"/> function. + /// </param> + /// <param name="extendedWindowClass"> + /// A pointer to a <see cref="ExtendedWindowClass"/> structure + /// that receives the information about the class. + /// </param> + /// <returns> + /// If the function finds a matching class and successfully copies the data, the return value is + /// true.<para/> + /// If the function does not find a matching class and successfully copy the data, the return value + /// is false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetClassInfoEx + ( + [In] IntPtr instance, + [In] IntPtr className, + [Out] out ExtendedWindowClass extendedWindowClass + ); + + /// <summary> + /// Retrieves information about a window class, + /// including a handle to the small icon associated with the window class. + /// </summary> + /// <param name="instance"> + /// A handle to the instance of the application that created the class. + /// To retrieve information about classes defined by the system (such as buttons or list boxes), + /// set this parameter to <see cref="IntPtr.Zero"/>. + /// </param> + /// <param name="classAtom"> + /// A class atom created by a previous call to RegisterClass + /// or <see cref="RegisterClassEx(ref ExtendedWindowClass)"/>. + /// </param> + /// <param name="extendedWindowStyle"> + /// A pointer to a <see cref="ExtendedWindowClass"/> structure + /// that receives the information about the class. + /// </param> + /// <returns> + /// If the function finds a matching class and successfully copies the data, the return value is + /// true.<para/> + /// If the function does not find a matching class and successfully copy the data, the return value is + /// false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + public static bool GetClassInfoEx + ( + [In] IntPtr instance, + [In] ushort classAtom, + [Out] out ExtendedWindowClass extendedWindowStyle + ) + { + return GetClassInfoEx(instance, new IntPtr(classAtom), out extendedWindowStyle); + } + + /// <summary> + /// Registers a window class for subsequent use in calls to the CreateWindow or + /// <see cref="Window.CreateWindowEx(ExtendedWindowStyles, IntPtr, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/> function. + /// </summary> + /// <param name="extendedWindowClass"> + /// A pointer to a <see cref="ExtendedWindowClass"/> structure. You must fill the structure with the + /// appropriate class attributes before passing it to the function. + /// </param> + /// <returns> + /// If the function succeeds, the return value is a class atom that uniquely identifies the class being + /// registered. This atom can only be used by the CreateWindow, + /// <see cref="Window.CreateWindowEx(ExtendedWindowStyles, IntPtr, string, + /// WindowStyles, int, int, int, int, IntPtr, IntPtr, IntPtr, IntPtr)"/>, + /// GetClassInfo, <see cref="GetClassInfoEx(IntPtr, IntPtr, out ExtendedWindowClass)"/>, FindWindow, + /// FindWindowEx, and <see cref="UnregisterClass(string, IntPtr)"/> functions + /// and the IActiveIMMap::FilterClientWindows method.<para/> + /// If the function fails, the return value is zero. + /// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + public static extern ushort RegisterClassEx([In] ref ExtendedWindowClass extendedWindowClass); + + /// <summary> + /// Unregisters a window class, freeing the memory required for the class. + /// </summary> + /// <param name="className"> + /// A string specifying the window class name. This class name must have been + /// registered by a previous call to the RegisterClass or + /// <see cref="RegisterClassEx(ref ExtendedWindowClass)"/> function. + /// </param> + /// <param name="moduleInstance">A handle to the instance of the module that created the class.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the class could not be found or if a window still exists that was created with the class, the return + /// value is false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + /// <remarks> + /// Before calling this function, an application must destroy all windows created with the + /// specified class.<para/> + /// All window classes that an application registers are unregistered when it terminates. + /// </remarks> + [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool UnregisterClass([In] string className, [In] [Optional] IntPtr moduleInstance); + + /// <summary> + /// Unregisters a window class, freeing the memory required for the class. + /// </summary> + /// <param name="className"> + /// A pointer to a string specifying the window class name. This class name must + /// have been registered by a previous call to the RegisterClass or + /// <see cref="RegisterClassEx(ref ExtendedWindowClass)"/> function. + /// </param> + /// <param name="moduleInstance">A handle to the instance of the module that created the class.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the class could not be found or if a window still exists that was created with the class, the return + /// value is false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + /// <remarks> + /// Before calling this function, an application must destroy all windows created with the + /// specified class.<para/> + /// All window classes that an application registers are unregistered when it terminates. + /// </remarks> + [DllImport(Library, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool UnregisterClass + ( + [In] IntPtr className, + [In] [Optional] IntPtr moduleInstance + ); + + /// <summary> + /// Unregisters a window class, freeing the memory required for the class. + /// </summary> + /// <param name="classAtom"> + /// A class atom created by a previous call to the RegisterClass or + /// <see cref="RegisterClassEx(ref ExtendedWindowClass)"/> function. + /// </param> + /// <param name="moduleInstance">A handle to the instance of the module that created the class.</param> + /// <returns> + /// If the function succeeds, the return value is true.<para/> + /// If the class could not be found or if a window still exists that was created with the class, the return + /// value is false. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>. + /// </returns> + /// <remarks> + /// Before calling this function, an application must destroy all windows created with the + /// specified class.<para/> + /// All window classes that an application registers are unregistered when it terminates. + /// </remarks> + public static bool UnregisterClass([In] ushort classAtom, [In] [Optional] IntPtr moduleInstance) + { + return UnregisterClass(new IntPtr(classAtom), moduleInstance); + } + } + } +} diff --git a/Crow/src/backends/win32/WinBackend.cs b/Crow/src/backends/win32/WinBackend.cs new file mode 100755 index 00000000..183adc12 --- /dev/null +++ b/Crow/src/backends/win32/WinBackend.cs @@ -0,0 +1,469 @@ +// +// XLibBackend.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; +using OpenToolkit.NT.Native; + +namespace Crow.Win32 +{ + + public class Win32Backend : IBackend + { + public void CleanUp() + { + User32.Window.ReleaseDC(handle, hdc); + User32.Window.DestroyWindow(handle); + } + + public void Flush() + { + iFace.surf.Flush (); + //throw new NotImplementedException(); + } + + WindowProc WindowProcedureDelegate; + string className = "myWindowClass"; + IntPtr instance = Marshal.GetHINSTANCE(typeof(Win32Backend).Module); + IntPtr handle = IntPtr.Zero; + IntPtr hdc = IntPtr.Zero; + Interface iFace; + + public void Init(Interface _iFace) + { + iFace = _iFace; + + WindowProcedureDelegate = WindowProcedure; + + Rect rect = new Rect + { + Left = iFace.ClientRectangle.Left, + Top = iFace.ClientRectangle.Top, + Right = iFace.ClientRectangle.Right, + Bottom = iFace.ClientRectangle.Bottom + }; + + User32.Window.AdjustWindowRectEx(ref rect, 0, false, 0); + + ExtendedWindowClass wc = new ExtendedWindowClass + { + Size = ExtendedWindowClass.SizeInBytes, + Style = 0, + WindowProc = WindowProcedureDelegate, + ClassExtra = 0, + WindowExtra = 0, + Instance = instance, + Icon = IntPtr.Zero, + Cursor = User32.Cursor.LoadCursor(CursorName.Arrow), + //Background = Gdi32.GetStockObject(GetStockObjectType.BlackBrush), + MenuName = null, + ClassName = className, + }; + + ushort atom = User32.WindowClass.RegisterClassEx(ref wc); + + handle = User32.Window.CreateWindowEx( + ExtendedWindowStyles.ClientEdge, + className, + "The title of my window", + WindowStyles.OverlappedWindow, + + rect.Left, + rect.Top, + rect.Width, + rect.Height, + IntPtr.Zero, + IntPtr.Zero, + instance, + IntPtr.Zero + ); + + User32.Window.ShowWindow(handle, ShowWindowCommand.Show); + + hdc = User32.Window.GetDC(handle); + iFace.surf = new Cairo.Win32Surface(hdc); + + } + + public void ProcessEvents() + { + Msg msg; + while (User32.Message.PeekMessage(out msg, IntPtr.Zero, 0, 0, PeekMessageActions.Remove)) + { + User32.Message.TranslateMessage(ref msg); + User32.Message.DispatchMessage(ref msg); + } + } + + public bool IsDown (Key key) { + return false; + } + public bool Shift { + get { + throw new NotImplementedException (); + } + } + + public bool Ctrl { + get { + throw new NotImplementedException (); + } + } + + public bool Alt { + get { + throw new NotImplementedException (); + } + } + + void HandleWindowPositionChanged(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam) + { + var pos = Marshal.PtrToStructure<WindowPosition>(lParam); + if (pos.HWnd == handle) + { + Rectangle bounds = new Rectangle(pos.X, pos.Y, pos.Width, pos.Height); + + User32.Window.SetWindowPos + ( + handle, + IntPtr.Zero, + bounds.X, + bounds.Y, + bounds.Width, + bounds.Height, + SetWindowPosFlags.NoZOrder | SetWindowPosFlags.NoOwnerZOrder | + SetWindowPosFlags.NoActivate | SetWindowPosFlags.NoSendChanging + ); + bounds.Left = bounds.Top = 0; + iFace.ProcessResize (bounds); + } + } + + static Key GetKey(int code) + { + switch (code) + { + // 0 - 15 + case 0: return Key.NoSymbol; + case 1: return Key.Escape; + case 2: return Key.key_1; + case 3: return Key.key_2; + case 4: return Key.key_3; + case 5: return Key.key_4; + case 6: return Key.key_5; + case 7: return Key.key_6; + case 8: return Key.key_7; + case 9: return Key.key_8; + case 10: return Key.key_9; + case 11: return Key.key_0; + case 12: return Key.minus; + case 13: return Key.plus; + case 14: return Key.BackSpace; + case 15: return Key.Tab; + + // 16-31 + case 16: return Key.Q; + case 17: return Key.W; + case 18: return Key.E; + case 19: return Key.R; + case 20: return Key.T; + case 21: return Key.Y; + case 22: return Key.U; + case 23: return Key.I; + case 24: return Key.O; + case 25: return Key.P; + case 26: return Key.bracketleft; + case 27: return Key.bracketright; + case 28: return Key.Return; + case 29: return Key.Control_L; + case 30: return Key.A; + case 31: return Key.S; + + // 32 - 47 + case 32: return Key.D; + case 33: return Key.F; + case 34: return Key.G; + case 35: return Key.H; + case 36: return Key.J; + case 37: return Key.K; + case 38: return Key.L; + case 39: return Key.semicolon; + case 40: return Key.quotedbl; + case 41: return Key.grave; + case 42: return Key.Shift_L; + case 43: return Key.backslash; + case 44: return Key.Z; + case 45: return Key.X; + case 46: return Key.C; + case 47: return Key.V; + + // 48 - 63 + case 48: return Key.B; + case 49: return Key.N; + case 50: return Key.M; + case 51: return Key.comma; + case 52: return Key.period; + case 53: return Key.slash; + case 54: return Key.Shift_R; + case 55: return Key.Print; + case 56: return Key.Alt_L; + case 57: return Key.space; + case 58: return Key.Caps_Lock; + case 59: return Key.F1; + case 60: return Key.F2; + case 61: return Key.F3; + case 62: return Key.F4; + case 63: return Key.F5; + + // 64 - 79 + case 64: return Key.F6; + case 65: return Key.F7; + case 66: return Key.F8; + case 67: return Key.F9; + case 68: return Key.F10; + case 69: return Key.Num_Lock; + case 70: return Key.Scroll_Lock; + case 71: return Key.Home; + case 72: return Key.Up; + case 73: return Key.Page_Up; + case 74: return Key.KP_Subtract; + case 75: return Key.Left; + case 76: return Key.KP_5; + case 77: return Key.Right; + case 78: return Key.KP_Add; + case 79: return Key.End; + + // 80 - 95 + case 80: return Key.Down; + case 81: return Key.Page_Down; + case 82: return Key.Insert; + case 83: return Key.Delete; + case 84: return Key.NoSymbol; + case 85: return Key.NoSymbol; + case 86: return Key.NoSymbol; + case 87: return Key.F11; + case 88: return Key.F12; + case 89: return Key.Pause; + case 90: return Key.NoSymbol; + case 91: return Key.Meta_L; + case 92: return Key.Meta_R; + case 93: return Key.Menu; + case 94: return Key.NoSymbol; + case 95: return Key.NoSymbol; + + // 96 - 106 + case 96: return Key.NoSymbol; + case 97: return Key.NoSymbol; + case 98: return Key.NoSymbol; + case 99: return Key.NoSymbol; + case 100: return Key.F13; + case 101: return Key.F14; + case 102: return Key.F15; + case 103: return Key.F16; + case 104: return Key.F17; + case 105: return Key.F18; + case 106: return Key.F19; + + default: return Key.NoSymbol; + } + } + const long ExtendedBit = 1 << 24; // Used to distinguish left and right control, alt and enter keys. + + void handleKeyboard (IntPtr lParam, IntPtr wParam, bool pressed) { + bool extended = (lParam.ToInt64() & ExtendedBit) != 0; + uint scancode = (uint)((lParam.ToInt64() >> 16) & 0xFF); + //ushort repeat_count = unchecked((ushort)((ulong)lParam.ToInt64() & 0xffffu)); +// VirtualKey vkey = (VirtualKey)wParam; +// var key = WinKeyMap.TranslateKey(scancode, vkey, extended, false, out bool is_valid); + Key k = GetKey ((int)scancode); + + if (pressed) + iFace.ProcessKeyDown (k); + else + iFace.ProcessKeyUp (k); + } + void handleChar (IntPtr lParam, IntPtr wParam) { + char c = IntPtr.Size == 4 ? + (char)wParam.ToInt32() : + (char)wParam.ToInt64(); + + if (!char.IsControl (c)) + iFace.ProcessKeyPress (c); + } + + + + IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam) + { + var result = IntPtr.Zero; + + + switch (message) + { + case WindowMessage.MouseMove: + iFace.ProcessMouseMove + ((int)((uint)lParam.ToInt32() & 0x0000FFFF), (int)(((uint)lParam.ToInt32() & 0xFFFF0000) >> 16)); + break; + case WindowMessage.LButtonDown: + iFace.ProcessMouseButtonDown(Crow.MouseButton.Left); + return IntPtr.Zero; + case WindowMessage.RButtonDown: + iFace.ProcessMouseButtonDown(Crow.MouseButton.Right); + return IntPtr.Zero; + case WindowMessage.MButtonDown: + iFace.ProcessMouseButtonDown(Crow.MouseButton.Middle); + return IntPtr.Zero; + case WindowMessage.LButtonUp: + iFace.ProcessMouseButtonUp(Crow.MouseButton.Left); + return IntPtr.Zero; + case WindowMessage.RButtonUp: + iFace.ProcessMouseButtonUp(Crow.MouseButton.Right); + return IntPtr.Zero; + case WindowMessage.MButtonUp: + iFace.ProcessMouseButtonUp(Crow.MouseButton.Middle); + return IntPtr.Zero; + case WindowMessage.MouseWheel: + iFace.ProcessMouseWheelChanged ((((long)wParam << 32) >> 48) / 120.0f); + return IntPtr.Zero; + case WindowMessage.MouseHWheel: + iFace.ProcessMouseWheelChanged ((((long)wParam << 32) >> 48) / 120.0f); + return IntPtr.Zero; + case WindowMessage.KeyDown: + case WindowMessage.SystemKeyDown: + handleKeyboard (lParam, wParam, true); + return IntPtr.Zero; + case WindowMessage.KeyUp: + case WindowMessage.SystemKeyUp: + handleKeyboard (lParam, wParam, false); + return IntPtr.Zero; + case WindowMessage.Char: + handleChar (lParam, wParam); + break; + case WindowMessage.WindowPosChanged: + HandleWindowPositionChanged(handle, message, wParam, lParam); + break; + + + /*case WindowMessage.Activate: + HandleActivate(handle, message, wParam, lParam); + break; + + case WindowMessage.EnterMenuLoop: + case WindowMessage.EnterSizeMove: + HandleEnterModalLoop(handle, message, wParam, lParam); + break; + + case WindowMessage.ExitMenuLoop: + case WindowMessage.ExitSizeMove: + HandleExitModalLoop(handle, message, wParam, lParam); + break; + + case WindowMessage.EraseBackground: + // This is triggered only when the client area changes. + // As such it does not affect steady-state performance. + break; + + + case WindowMessage.StyleChanged: + HandleStyleChanged(handle, message, wParam, lParam); + break; + + case WindowMessage.Size: + HandleSize(handle, message, wParam, lParam); + break; + + case WindowMessage.SetCursor: + result = HandleSetCursor(handle, message, wParam, lParam); + break; + + case WindowMessage.CaptureChanged: + HandleCaptureChanged(handle, message, wParam, lParam); + break; + + case WindowMessage.Char: + HandleChar(handle, message, wParam, lParam); + break; + + + + case WindowMessage.MouseLeave: + HandleMouseLeave(handle, message, wParam, lParam); + break; + + case WindowMessage.MouseWheel: + HandleMouseWheel(handle, message, wParam, lParam); + return IntPtr.Zero; + + case WindowMessage.MouseHWheel: + HandleMouseHWheel(handle, message, wParam, lParam); + return IntPtr.Zero; + + + // Keyboard events: + case WindowMessage.KeyDown: + case WindowMessage.KeyUp: + case WindowMessage.SystemKeyDown: + case WindowMessage.SystemKeyUp: + HandleKeyboard(handle, message, wParam, lParam); + return IntPtr.Zero; + + case WindowMessage.SystemChar: + return IntPtr.Zero; + + case WindowMessage.KillFocus: + HandleKillFocus(handle, message, wParam, lParam); + break; + + case WindowMessage.DropFiles: + HandleDropFiles(handle, message, wParam, lParam); + break; + + case WindowMessage.Create: + HandleCreate(handle, message, wParam, lParam); + break; + case WindowMessage.Paint: + dc = User32.Window.BeginPaint(handle, out paintStruct); + + return IntPtr.Zero;*/ + case WindowMessage.Close: + User32.Window.DestroyWindow(handle); + return IntPtr.Zero; + case WindowMessage.Destroy: + User32.Message.PostQuitMessage(0); + //User32.WindowClass.UnregisterClass(className, instance); + break; + } + + if (result != IntPtr.Zero) + return result; + + return User32.Window.DefWindowProc(handle, message, wParam, lParam); + } + + } +} + diff --git a/Crow/src/backends/xcb/XCBBackend.cs b/Crow/src/backends/xcb/XCBBackend.cs new file mode 100644 index 00000000..a3ccab91 --- /dev/null +++ b/Crow/src/backends/xcb/XCBBackend.cs @@ -0,0 +1,503 @@ +// +// XLibBackend.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; + + + +namespace Crow.XCB +{ + using xcb_window_t = System.UInt32; + using xcb_pixmap_t = System.UInt32; + using xcb_cursor_t = System.UInt32; + using xcb_font_t = System.UInt32; + using xcb_colormap_t = System.UInt32; + using xcb_atom_t = System.UInt32; + using xcb_drawable_t = System.UInt32; + using xcb_visualid_t = System.UInt32; + using xcb_keysym_t = System.UInt32; + using xcb_keycode_t = System.Byte; + using xcb_timestamp_t = System.UInt32; + + using xcb_void_cookie_t = System.UInt32; + + public class XCBBackend : IBackend + { + const byte XCB_COPY_FROM_PARENT = 0; + + + enum xcb_window_class_t : ushort { + COPY_FROM_PARENT = 0, + INPUT_OUTPUT = 1, + INPUT_ONLY = 2 + } + + enum xcb_button_t : byte { + Left = 1, + Middle, + Right, + WheelUp, + WheelDown, + But6, + But7, + But8, + But9, + But10, + } + + [Flags] + enum xcb_event_mask_t : uint { + NO_EVENT = 0, + KEY_PRESS = 1, + KEY_RELEASE = 2, + BUTTON_PRESS = 4, + BUTTON_RELEASE = 8, + ENTER_WINDOW = 16, + LEAVE_WINDOW = 32, + POINTER_MOTION = 64, + POINTER_MOTION_HINT = 128, + BUTTON_1_MOTION = 256, + BUTTON_2_MOTION = 512, + BUTTON_3_MOTION = 1024, + BUTTON_4_MOTION = 2048, + BUTTON_5_MOTION = 4096, + BUTTON_MOTION = 8192, + KEYMAP_STATE = 16384, + EXPOSURE = 32768, + VISIBILITY_CHANGE = 65536, + STRUCTURE_NOTIFY = 131072, + RESIZE_REDIRECT = 262144, + SUBSTRUCTURE_NOTIFY = 524288, + SUBSTRUCTURE_REDIRECT = 1048576, + FOCUS_CHANGE = 2097152, + PROPERTY_CHANGE = 4194304, + COLOR_MAP_CHANGE = 8388608, + OWNER_GRAB_BUTTON = 16777216 + } + + enum xcb_event_type : byte { + KEY_PRESS = 2, + KEY_RELEASE, + BUTTON_PRESS, + BUTTON_RELEASE, + MOTION_NOTIFY, + ENTER_NOTIFY, + LEAVE_NOTIFY, + FOCUS_IN, + FOCUS_OUT, + KEYMAP_NOTIFY, + EXPOSE, + GRAPHICS_EXPOSURE, + NO_EXPOSURE, + VISIBILITY_NOTIFY, + CREATE_NOTIFY, + DESTROY_NOTIFY, + UNMAP_NOTIFY, + MAP_NOTIFY, + MAP_REQUEST, + REPARENT_NOTIFY, + CONFIGURE_NOTIFY, + CONFIGURE_REQUEST, + GRAVITY_NOTIFY, + RESIZE_REQUEST, + CIRCULATE_NOTIFY, + CIRCULATE_REQUEST, + PROPERTY_NOTIFY, + SELECTION_CLEAR, + SELECTION_REQUEST, + SELECTION_NOTIFY, + COLORMAP_NOTIFY, + CLIENT_MESSAGE, + MAPPING_NOTIFY, + GE_GENERIC, + } + [Flags] + enum xcb_cw_t : uint { + BACK_PIXMAP = 1, + BACK_PIXEL = 2, + BORDER_PIXMAP = 4, + BORDER_PIXEL = 8, + BIT_GRAVITY = 16, + WIN_GRAVITY = 32, + BACKING_STORE = 64, + BACKING_PLANES = 128, + BACKING_PIXEL = 256, + OVERRIDE_REDIRECT = 512, + SAVE_UNDER = 1024, + EVENT_MASK = 2048, + DONT_PROPAGATE = 4096, + COLORMAP = 8192, + CURSOR = 16384 + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_generic_event_t{ + public xcb_event_type response_type; /**< Type of the response */ + public byte pad0; /**< Padding */ + public UInt16 sequence; /**< Sequence number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + UInt32[] pad; + public UInt32 full_sequence; /**< full sequence */ + } + + [StructLayout(LayoutKind.Explicit, Size = 32)] + struct xcb_event_t{ + [FieldOffsetAttribute(0)] + public xcb_event_type response_type; + + [FieldOffsetAttribute(1)] + public byte detail; + [FieldOffsetAttribute(1)] + public xcb_keycode_t keycode; + [FieldOffsetAttribute(1)] + public xcb_button_t button; + + [FieldOffsetAttribute(2)] + public UInt16 sequence; + [FieldOffsetAttribute(4)] + public xcb_timestamp_t time; + [FieldOffsetAttribute(8)] + public xcb_window_t root; + + //expose event fields + [FieldOffsetAttribute(4)] + public xcb_window_t window; + [FieldOffsetAttribute(8)] + public UInt16 x; + [FieldOffsetAttribute(10)] + public UInt16 y; + [FieldOffsetAttribute(12)] + public UInt16 width; + [FieldOffsetAttribute(14)] + public UInt16 height; + [FieldOffsetAttribute(14)] + public UInt16 count; + /// + + [FieldOffsetAttribute(12)] + public xcb_window_t evt; + [FieldOffsetAttribute(16)] + public xcb_window_t child; + [FieldOffsetAttribute(20)] + public UInt16 root_x; + [FieldOffsetAttribute(22)] + public UInt16 root_y; + [FieldOffsetAttribute(24)] + public UInt16 event_x; + [FieldOffsetAttribute(26)] + public UInt16 event_y; + [FieldOffsetAttribute(28)] + public UInt16 state; + [FieldOffsetAttribute(30)] + public byte same_screen; + + [FieldOffsetAttribute(31)] + public byte same_screen_focus; + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_key_press_event_t { + public xcb_event_type response_type; + public xcb_keycode_t detail; + public UInt16 sequence; + public xcb_timestamp_t time; + public xcb_window_t root; + public xcb_window_t evt; + public xcb_window_t child; + public UInt16 root_x; + public UInt16 root_y; + public UInt16 event_x; + public UInt16 event_y; + public UInt16 state; + public byte same_screen; + byte pad0; + } + [StructLayout(LayoutKind.Sequential)] + struct xcb_button_press_event_t { + public xcb_event_type response_type; + public xcb_button_t detail; + public UInt16 sequence; + public xcb_timestamp_t time; + public xcb_window_t root; + public xcb_window_t evt; + public xcb_window_t child; + public UInt16 root_x; + public UInt16 root_y; + public UInt16 event_x; + public UInt16 event_y; + public UInt16 state; + public byte same_screen; + byte pad0; + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_motion_notify_event_t { + public xcb_event_type response_type; + public byte detail; + public UInt16 sequence; + public xcb_timestamp_t time; + public xcb_window_t root; + public xcb_window_t evt; + public xcb_window_t child; + public UInt16 root_x; + public UInt16 root_y; + public UInt16 event_x; + public UInt16 event_y; + public UInt16 state; + public byte same_screen; + byte pad0; + } + [StructLayout(LayoutKind.Sequential)] + struct xcb_iterator_t { + public IntPtr data; + public int rem; + public int index; + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_screen_t { + public xcb_window_t root; + public xcb_colormap_t default_colormap; + public UInt32 white_pixel; + public UInt32 black_pixel; + public UInt32 current_input_masks; + public UInt16 width_in_pixels; + public UInt16 height_in_pixels; + public UInt16 width_in_millimeters; + public UInt16 height_in_millimeters; + public UInt16 min_installed_maps; + public UInt16 max_installed_maps; + public xcb_visualid_t root_visual; + public byte backing_stores; + public byte save_unders; + public byte root_depth; + public byte allowed_depths_len; + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_visualtype_t { + public xcb_visualid_t visual_id; + public byte _class; + public byte bits_per_rgb_value; + public UInt16 colormap_entries; + public UInt32 red_mask; + public UInt32 green_mask; + public UInt32 blue_mask; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + byte[] pad; + } + + [StructLayout(LayoutKind.Sequential)] + struct xcb_generic_reply_t{ + public byte response_type; /**< Type of the response */ + byte pad0; /**< Padding */ + public UInt16 sequence; /**< Sequence number */ + public UInt32 length; /**< Length of the response */ + } + + + + #region pinvoke XCB + [DllImportAttribute("xcb")] + static extern IntPtr xcb_connect(string displayName, IntPtr screenNum); + [DllImportAttribute("xcb")] + static extern IntPtr xcb_get_setup(IntPtr connection); + [DllImportAttribute("xcb")] + static extern IntPtr xcb_flush(IntPtr connection); + [DllImportAttribute("xcb")] + static extern UInt32 xcb_generate_id(IntPtr connection); + + [DllImportAttribute("xcb")] + static extern xcb_iterator_t xcb_setup_roots_iterator(IntPtr setup); + [DllImportAttribute("xcb")] + static extern xcb_iterator_t xcb_screen_allowed_depths_iterator(IntPtr scr); + [DllImportAttribute("xcb")] + static extern xcb_iterator_t xcb_depth_visuals_iterator(IntPtr depth); + + [DllImportAttribute("xcb")] + static extern void xcb_screen_next(ref xcb_iterator_t scr_iterator); + [DllImportAttribute("xcb")] + static extern void xcb_depth_next(ref xcb_iterator_t depth_iterator); + [DllImportAttribute("xcb")] + static extern void xcb_visualtype_next(ref xcb_iterator_t depth_visual_iterator); + + [DllImportAttribute("xcb")] + static extern xcb_void_cookie_t xcb_create_window(IntPtr connection, byte depth, xcb_window_t win, UInt32 parent, + Int16 x, Int16 y, UInt16 width, UInt16 height, UInt16 border, + xcb_window_class_t _class, xcb_visualid_t visual, xcb_cw_t mask, IntPtr valueList); + [DllImportAttribute("xcb")] + static extern xcb_void_cookie_t xcb_map_window(IntPtr conn, xcb_window_t window); + [DllImportAttribute("xcb")] + static extern void xcb_disconnect(IntPtr connection); + + [DllImportAttribute("xcb")] + static extern IntPtr xcb_poll_for_event(IntPtr connection); + + + #endregion + + Interface iFace; + + IntPtr conn; + + XKB.XCBKeyboard Keyboard; + + + #region IBackend implementation + public void Init (Interface _iFace) + { + iFace = _iFace; + + conn = xcb_connect (null, IntPtr.Zero); + + + Keyboard = new XKB.XCBKeyboard (conn, iFace); + + xcb_iterator_t scr_it = xcb_setup_roots_iterator (xcb_get_setup (conn)); + IntPtr screen = scr_it.data; + + xcb_screen_t scr = (xcb_screen_t)Marshal.PtrToStructure (screen, typeof(xcb_screen_t)); + + xcb_window_t win = xcb_generate_id (conn); + + xcb_cw_t mask = xcb_cw_t.BACK_PIXEL | xcb_cw_t.EVENT_MASK; + uint[] values = { + scr.black_pixel, + (uint)( + xcb_event_mask_t.EXPOSURE | + xcb_event_mask_t.POINTER_MOTION | + xcb_event_mask_t.BUTTON_PRESS | + xcb_event_mask_t.BUTTON_RELEASE | + xcb_event_mask_t.KEY_PRESS | + xcb_event_mask_t.KEY_RELEASE + ) + }; + + IntPtr intPtr = IntPtr.Zero; + + unsafe + { + fixed(uint* pValues = values) + intPtr = new IntPtr((void *) pValues); + xcb_create_window (conn, XCB_COPY_FROM_PARENT, win, scr.root, 0,0,(ushort)iFace.ClientRectangle.Width, (ushort)iFace.ClientRectangle.Height,0, + xcb_window_class_t.INPUT_OUTPUT, scr.root_visual, mask, intPtr); + } + + + xcb_map_window (conn, win); + + xcb_flush (conn); + + + IntPtr visual = findVisual (scr_it, scr.root_visual); + + + iFace.surf = new Cairo.XcbSurface (conn, win, visual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height); + } + + public void CleanUp () + { + Keyboard.Destroy (); + + xcb_disconnect (conn); + } + public void Flush () { + xcb_flush (conn); + } + + public void ProcessEvents () + { + IntPtr evtPtr = xcb_poll_for_event (conn); + if (evtPtr == IntPtr.Zero) + return; + xcb_event_t evt = (xcb_event_t)Marshal.PtrToStructure (evtPtr, typeof(xcb_event_t)); + + switch (evt.response_type) { + case xcb_event_type.EXPOSE: + if (evt.width > 0) + iFace.ProcessResize (new Rectangle (0, 0, evt.width, evt.height)); + break; + case xcb_event_type.MOTION_NOTIFY: + iFace.ProcessMouseMove (evt.event_x, evt.event_y); + break; + case xcb_event_type.BUTTON_PRESS: + if (evt.button == xcb_button_t.WheelUp) + iFace.ProcessMouseWheelChanged (Interface.WheelIncrement); + else if(evt.button == xcb_button_t.WheelDown) + iFace.ProcessMouseWheelChanged (-Interface.WheelIncrement); + else + iFace.ProcessMouseButtonDown ((MouseButton)(evt.detail - 1)); + break; + case xcb_event_type.BUTTON_RELEASE: + if (evt.button == xcb_button_t.WheelUp || evt.button == xcb_button_t.WheelDown) + break; + iFace.ProcessMouseButtonUp ((MouseButton)(evt.detail - 1)); + break; + case xcb_event_type.KEY_PRESS: + Keyboard.HandleEvent (evt.keycode, true); + break; + case xcb_event_type.KEY_RELEASE: + Keyboard.HandleEvent (evt.keycode, false); + break; + default: + Console.WriteLine ("unknown event"); + break; + } + } + public bool IsDown (Key key) { + return false; + } + public bool Shift { + get { return Keyboard.Shift; } + } + public bool Ctrl { + get { return Keyboard.Ctrl; } + } + public bool Alt { + get { return Keyboard.Alt;} + } + #endregion + + static IntPtr findVisual (xcb_iterator_t scr_it, xcb_visualid_t visualId){ + for (; scr_it.rem > 0; xcb_screen_next (ref scr_it)) { + xcb_iterator_t depth_it = xcb_screen_allowed_depths_iterator (scr_it.data); + for (; depth_it.rem > 0; xcb_depth_next (ref depth_it)) { + xcb_iterator_t visual_it = xcb_depth_visuals_iterator (depth_it.data); + for (; visual_it.rem > 0; xcb_visualtype_next (ref visual_it)) { + xcb_visualtype_t visual = (xcb_visualtype_t)Marshal.PtrToStructure (visual_it.data, typeof(xcb_visualtype_t)); + if (visualId == visual.visual_id) + return visual_it.data; + } + } + } + return IntPtr.Zero; + } + + } +} + diff --git a/Crow/src/backends/xcb/XCBKeyboard.cs b/Crow/src/backends/xcb/XCBKeyboard.cs new file mode 100644 index 00000000..5043ec37 --- /dev/null +++ b/Crow/src/backends/xcb/XCBKeyboard.cs @@ -0,0 +1,2605 @@ +// +// XCBKeyboard.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Runtime.InteropServices; + +namespace Crow.XKB +{ + using xkb_keycode_t = System.UInt32; + using xkb_mod_index_t = System.UInt32; + + public class XCBKeyboard + { + enum xkb_keysym : uint { + NoSymbol = 0x000000, + VoidSymbol = 0xffffff, + BackSpace = 0xff08, + Tab = 0xff09, + Linefeed = 0xff0a, + Clear = 0xff0b, + Return = 0xff0d, + Pause = 0xff13, + Scroll_Lock = 0xff14, + Sys_Req = 0xff15, + Escape = 0xff1b, + Delete = 0xffff, + Multi_key = 0xff20, + Codeinput = 0xff37, + SingleCandidate = 0xff3c, + MultipleCandidate = 0xff3d, + PreviousCandidate = 0xff3e, + Kanji = 0xff21, + Muhenkan = 0xff22, + Henkan_Mode = 0xff23, + Henkan = 0xff23, + Romaji = 0xff24, + Hiragana = 0xff25, + Katakana = 0xff26, + Hiragana_Katakana = 0xff27, + Zenkaku = 0xff28, + Hankaku = 0xff29, + Zenkaku_Hankaku = 0xff2a, + Touroku = 0xff2b, + Massyo = 0xff2c, + Kana_Lock = 0xff2d, + Kana_Shift = 0xff2e, + Eisu_Shift = 0xff2f, + Eisu_toggle = 0xff30, + Kanji_Bangou = 0xff37, + Zen_Koho = 0xff3d, + Mae_Koho = 0xff3e, + Home = 0xff50, + Left = 0xff51, + Up = 0xff52, + Right = 0xff53, + Down = 0xff54, + Prior = 0xff55, + Page_Up = 0xff55, + Next = 0xff56, + Page_Down = 0xff56, + End = 0xff57, + Begin = 0xff58, + Select = 0xff60, + Print = 0xff61, + Execute = 0xff62, + Insert = 0xff63, + Undo = 0xff65, + Redo = 0xff66, + Menu = 0xff67, + Find = 0xff68, + Cancel = 0xff69, + Help = 0xff6a, + Break = 0xff6b, + Mode_switch = 0xff7e, + script_switch = 0xff7e, + Num_Lock = 0xff7f, + KP_Space = 0xff80, + KP_Tab = 0xff89, + KP_Enter = 0xff8d, + KP_F1 = 0xff91, + KP_F2 = 0xff92, + KP_F3 = 0xff93, + KP_F4 = 0xff94, + KP_Home = 0xff95, + KP_Left = 0xff96, + KP_Up = 0xff97, + KP_Right = 0xff98, + KP_Down = 0xff99, + KP_Prior = 0xff9a, + KP_Page_Up = 0xff9a, + KP_Next = 0xff9b, + KP_Page_Down = 0xff9b, + KP_End = 0xff9c, + KP_Begin = 0xff9d, + KP_Insert = 0xff9e, + KP_Delete = 0xff9f, + KP_Equal = 0xffbd, + KP_Multiply = 0xffaa, + KP_Add = 0xffab, + KP_Separator = 0xffac, + KP_Subtract = 0xffad, + KP_Decimal = 0xffae, + KP_Divide = 0xffaf, + KP_0 = 0xffb0, + KP_1 = 0xffb1, + KP_2 = 0xffb2, + KP_3 = 0xffb3, + KP_4 = 0xffb4, + KP_5 = 0xffb5, + KP_6 = 0xffb6, + KP_7 = 0xffb7, + KP_8 = 0xffb8, + KP_9 = 0xffb9, + F1 = 0xffbe, + F2 = 0xffbf, + F3 = 0xffc0, + F4 = 0xffc1, + F5 = 0xffc2, + F6 = 0xffc3, + F7 = 0xffc4, + F8 = 0xffc5, + F9 = 0xffc6, + F10 = 0xffc7, + F11 = 0xffc8, + L1 = 0xffc8, + F12 = 0xffc9, + L2 = 0xffc9, + F13 = 0xffca, + L3 = 0xffca, + F14 = 0xffcb, + L4 = 0xffcb, + F15 = 0xffcc, + L5 = 0xffcc, + F16 = 0xffcd, + L6 = 0xffcd, + F17 = 0xffce, + L7 = 0xffce, + F18 = 0xffcf, + L8 = 0xffcf, + F19 = 0xffd0, + L9 = 0xffd0, + F20 = 0xffd1, + L10 = 0xffd1, + F21 = 0xffd2, + R1 = 0xffd2, + F22 = 0xffd3, + R2 = 0xffd3, + F23 = 0xffd4, + R3 = 0xffd4, + F24 = 0xffd5, + R4 = 0xffd5, + F25 = 0xffd6, + R5 = 0xffd6, + F26 = 0xffd7, + R6 = 0xffd7, + F27 = 0xffd8, + R7 = 0xffd8, + F28 = 0xffd9, + R8 = 0xffd9, + F29 = 0xffda, + R9 = 0xffda, + F30 = 0xffdb, + R10 = 0xffdb, + F31 = 0xffdc, + R11 = 0xffdc, + F32 = 0xffdd, + R12 = 0xffdd, + F33 = 0xffde, + R13 = 0xffde, + F34 = 0xffdf, + R14 = 0xffdf, + F35 = 0xffe0, + R15 = 0xffe0, + Shift_L = 0xffe1, + Shift_R = 0xffe2, + Control_L = 0xffe3, + Control_R = 0xffe4, + Caps_Lock = 0xffe5, + Shift_Lock = 0xffe6, + Meta_L = 0xffe7, + Meta_R = 0xffe8, + Alt_L = 0xffe9, + Alt_R = 0xffea, + Super_L = 0xffeb, + Super_R = 0xffec, + Hyper_L = 0xffed, + Hyper_R = 0xffee, + ISO_Lock = 0xfe01, + ISO_Level2_Latch = 0xfe02, + ISO_Level3_Shift = 0xfe03, + ISO_Level3_Latch = 0xfe04, + ISO_Level3_Lock = 0xfe05, + ISO_Level5_Shift = 0xfe11, + ISO_Level5_Latch = 0xfe12, + ISO_Level5_Lock = 0xfe13, + ISO_Group_Shift = 0xff7e, + ISO_Group_Latch = 0xfe06, + ISO_Group_Lock = 0xfe07, + ISO_Next_Group = 0xfe08, + ISO_Next_Group_Lock = 0xfe09, + ISO_Prev_Group = 0xfe0a, + ISO_Prev_Group_Lock = 0xfe0b, + ISO_First_Group = 0xfe0c, + ISO_First_Group_Lock = 0xfe0d, + ISO_Last_Group = 0xfe0e, + ISO_Last_Group_Lock = 0xfe0f, + ISO_Left_Tab = 0xfe20, + ISO_Move_Line_Up = 0xfe21, + ISO_Move_Line_Down = 0xfe22, + ISO_Partial_Line_Up = 0xfe23, + ISO_Partial_Line_Down = 0xfe24, + ISO_Partial_Space_Left = 0xfe25, + ISO_Partial_Space_Right = 0xfe26, + ISO_Set_Margin_Left = 0xfe27, + ISO_Set_Margin_Right = 0xfe28, + ISO_Release_Margin_Left = 0xfe29, + ISO_Release_Margin_Right = 0xfe2a, + ISO_Release_Both_Margins = 0xfe2b, + ISO_Fast_Cursor_Left = 0xfe2c, + ISO_Fast_Cursor_Right = 0xfe2d, + ISO_Fast_Cursor_Up = 0xfe2e, + ISO_Fast_Cursor_Down = 0xfe2f, + ISO_Continuous_Underline = 0xfe30, + ISO_Discontinuous_Underline = 0xfe31, + ISO_Emphasize = 0xfe32, + ISO_Center_Object = 0xfe33, + ISO_Enter = 0xfe34, + dead_grave = 0xfe50, + dead_acute = 0xfe51, + dead_circumflex = 0xfe52, + dead_tilde = 0xfe53, + dead_perispomeni = 0xfe53, + dead_macron = 0xfe54, + dead_breve = 0xfe55, + dead_abovedot = 0xfe56, + dead_diaeresis = 0xfe57, + dead_abovering = 0xfe58, + dead_doubleacute = 0xfe59, + dead_caron = 0xfe5a, + dead_cedilla = 0xfe5b, + dead_ogonek = 0xfe5c, + dead_iota = 0xfe5d, + dead_voiced_sound = 0xfe5e, + dead_semivoiced_sound = 0xfe5f, + dead_belowdot = 0xfe60, + dead_hook = 0xfe61, + dead_horn = 0xfe62, + dead_stroke = 0xfe63, + dead_abovecomma = 0xfe64, + dead_psili = 0xfe64, + dead_abovereversedcomma = 0xfe65, + dead_dasia = 0xfe65, + dead_doublegrave = 0xfe66, + dead_belowring = 0xfe67, + dead_belowmacron = 0xfe68, + dead_belowcircumflex = 0xfe69, + dead_belowtilde = 0xfe6a, + dead_belowbreve = 0xfe6b, + dead_belowdiaeresis = 0xfe6c, + dead_invertedbreve = 0xfe6d, + dead_belowcomma = 0xfe6e, + dead_currency = 0xfe6f, + dead_lowline = 0xfe90, + dead_aboveverticalline = 0xfe91, + dead_belowverticalline = 0xfe92, + dead_longsolidusoverlay = 0xfe93, + dead_a = 0xfe80, + dead_A = 0xfe81, + dead_e = 0xfe82, + dead_E = 0xfe83, + dead_i = 0xfe84, + dead_I = 0xfe85, + dead_o = 0xfe86, + dead_O = 0xfe87, + dead_u = 0xfe88, + dead_U = 0xfe89, + dead_small_schwa = 0xfe8a, + dead_capital_schwa = 0xfe8b, + dead_greek = 0xfe8c, + First_Virtual_Screen = 0xfed0, + Prev_Virtual_Screen = 0xfed1, + Next_Virtual_Screen = 0xfed2, + Last_Virtual_Screen = 0xfed4, + Terminate_Server = 0xfed5, + AccessX_Enable = 0xfe70, + AccessX_Feedback_Enable = 0xfe71, + RepeatKeys_Enable = 0xfe72, + SlowKeys_Enable = 0xfe73, + BounceKeys_Enable = 0xfe74, + StickyKeys_Enable = 0xfe75, + MouseKeys_Enable = 0xfe76, + MouseKeys_Accel_Enable = 0xfe77, + Overlay1_Enable = 0xfe78, + Overlay2_Enable = 0xfe79, + AudibleBell_Enable = 0xfe7a, + Pointer_Left = 0xfee0, + Pointer_Right = 0xfee1, + Pointer_Up = 0xfee2, + Pointer_Down = 0xfee3, + Pointer_UpLeft = 0xfee4, + Pointer_UpRight = 0xfee5, + Pointer_DownLeft = 0xfee6, + Pointer_DownRight = 0xfee7, + Pointer_Button_Dflt = 0xfee8, + Pointer_Button1 = 0xfee9, + Pointer_Button2 = 0xfeea, + Pointer_Button3 = 0xfeeb, + Pointer_Button4 = 0xfeec, + Pointer_Button5 = 0xfeed, + Pointer_DblClick_Dflt = 0xfeee, + Pointer_DblClick1 = 0xfeef, + Pointer_DblClick2 = 0xfef0, + Pointer_DblClick3 = 0xfef1, + Pointer_DblClick4 = 0xfef2, + Pointer_DblClick5 = 0xfef3, + Pointer_Drag_Dflt = 0xfef4, + Pointer_Drag1 = 0xfef5, + Pointer_Drag2 = 0xfef6, + Pointer_Drag3 = 0xfef7, + Pointer_Drag4 = 0xfef8, + Pointer_Drag5 = 0xfefd, + Pointer_EnableKeys = 0xfef9, + Pointer_Accelerate = 0xfefa, + Pointer_DfltBtnNext = 0xfefb, + Pointer_DfltBtnPrev = 0xfefc, + ch = 0xfea0, + Ch = 0xfea1, + CH = 0xfea2, + c_h = 0xfea3, + C_h = 0xfea4, + C_H = 0xfea5, + key_3270_Duplicate = 0xfd01, + key_3270_FieldMark = 0xfd02, + key_3270_Right2 = 0xfd03, + key_3270_Left2 = 0xfd04, + key_3270_BackTab = 0xfd05, + key_3270_EraseEOF = 0xfd06, + key_3270_EraseInput = 0xfd07, + key_3270_Reset = 0xfd08, + key_3270_Quit = 0xfd09, + key_3270_PA1 = 0xfd0a, + key_3270_PA2 = 0xfd0b, + key_3270_PA3 = 0xfd0c, + key_3270_Test = 0xfd0d, + key_3270_Attn = 0xfd0e, + key_3270_CursorBlink = 0xfd0f, + key_3270_AltCursor = 0xfd10, + key_3270_KeyClick = 0xfd11, + key_3270_Jump = 0xfd12, + key_3270_Ident = 0xfd13, + key_3270_Rule = 0xfd14, + key_3270_Copy = 0xfd15, + key_3270_Play = 0xfd16, + key_3270_Setup = 0xfd17, + key_3270_Record = 0xfd18, + key_3270_ChangeScreen = 0xfd19, + key_3270_DeleteWord = 0xfd1a, + key_3270_ExSelect = 0xfd1b, + key_3270_CursorSelect = 0xfd1c, + key_3270_PrintScreen = 0xfd1d, + key_3270_Enter = 0xfd1e, + space = 0x0020, + exclam = 0x0021, + quotedbl = 0x0022, + numbersign = 0x0023, + dollar = 0x0024, + percent = 0x0025, + ampersand = 0x0026, + apostrophe = 0x0027, + quoteright = 0x0027, + parenleft = 0x0028, + parenright = 0x0029, + asterisk = 0x002a, + plus = 0x002b, + comma = 0x002c, + minus = 0x002d, + period = 0x002e, + slash = 0x002f, + key_0 = 0x0030, + key_1 = 0x0031, + key_2 = 0x0032, + key_3 = 0x0033, + key_4 = 0x0034, + key_5 = 0x0035, + key_6 = 0x0036, + key_7 = 0x0037, + key_8 = 0x0038, + key_9 = 0x0039, + colon = 0x003a, + semicolon = 0x003b, + less = 0x003c, + equal = 0x003d, + greater = 0x003e, + question = 0x003f, + at = 0x0040, + A = 0x0041, + B = 0x0042, + C = 0x0043, + D = 0x0044, + E = 0x0045, + F = 0x0046, + G = 0x0047, + H = 0x0048, + I = 0x0049, + J = 0x004a, + K = 0x004b, + L = 0x004c, + M = 0x004d, + N = 0x004e, + O = 0x004f, + P = 0x0050, + Q = 0x0051, + R = 0x0052, + S = 0x0053, + T = 0x0054, + U = 0x0055, + V = 0x0056, + W = 0x0057, + X = 0x0058, + Y = 0x0059, + Z = 0x005a, + bracketleft = 0x005b, + backslash = 0x005c, + bracketright = 0x005d, + asciicircum = 0x005e, + underscore = 0x005f, + grave = 0x0060, + quoteleft = 0x0060, + a = 0x0061, + b = 0x0062, + c = 0x0063, + d = 0x0064, + e = 0x0065, + f = 0x0066, + g = 0x0067, + h = 0x0068, + i = 0x0069, + j = 0x006a, + k = 0x006b, + l = 0x006c, + m = 0x006d, + n = 0x006e, + o = 0x006f, + p = 0x0070, + q = 0x0071, + r = 0x0072, + s = 0x0073, + t = 0x0074, + u = 0x0075, + v = 0x0076, + w = 0x0077, + x = 0x0078, + y = 0x0079, + z = 0x007a, + braceleft = 0x007b, + bar = 0x007c, + braceright = 0x007d, + asciitilde = 0x007e, + nobreakspace = 0x00a0, + exclamdown = 0x00a1, + cent = 0x00a2, + sterling = 0x00a3, + currency = 0x00a4, + yen = 0x00a5, + brokenbar = 0x00a6, + section = 0x00a7, + diaeresis = 0x00a8, + copyright = 0x00a9, + ordfeminine = 0x00aa, + guillemotleft = 0x00ab, + notsign = 0x00ac, + hyphen = 0x00ad, + registered = 0x00ae, + macron = 0x00af, + degree = 0x00b0, + plusminus = 0x00b1, + twosuperior = 0x00b2, + threesuperior = 0x00b3, + acute = 0x00b4, + mu = 0x00b5, + paragraph = 0x00b6, + periodcentered = 0x00b7, + cedilla = 0x00b8, + onesuperior = 0x00b9, + masculine = 0x00ba, + guillemotright = 0x00bb, + onequarter = 0x00bc, + onehalf = 0x00bd, + threequarters = 0x00be, + questiondown = 0x00bf, + Agrave = 0x00c0, + Aacute = 0x00c1, + Acircumflex = 0x00c2, + Atilde = 0x00c3, + Adiaeresis = 0x00c4, + Aring = 0x00c5, + AE = 0x00c6, + Ccedilla = 0x00c7, + Egrave = 0x00c8, + Eacute = 0x00c9, + Ecircumflex = 0x00ca, + Ediaeresis = 0x00cb, + Igrave = 0x00cc, + Iacute = 0x00cd, + Icircumflex = 0x00ce, + Idiaeresis = 0x00cf, + ETH = 0x00d0, + Eth = 0x00d0, + Ntilde = 0x00d1, + Ograve = 0x00d2, + Oacute = 0x00d3, + Ocircumflex = 0x00d4, + Otilde = 0x00d5, + Odiaeresis = 0x00d6, + multiply = 0x00d7, + Oslash = 0x00d8, + Ooblique = 0x00d8, + Ugrave = 0x00d9, + Uacute = 0x00da, + Ucircumflex = 0x00db, + Udiaeresis = 0x00dc, + Yacute = 0x00dd, + THORN = 0x00de, + Thorn = 0x00de, + ssharp = 0x00df, + agrave = 0x00e0, + aacute = 0x00e1, + acircumflex = 0x00e2, + atilde = 0x00e3, + adiaeresis = 0x00e4, + aring = 0x00e5, + ae = 0x00e6, + ccedilla = 0x00e7, + egrave = 0x00e8, + eacute = 0x00e9, + ecircumflex = 0x00ea, + ediaeresis = 0x00eb, + igrave = 0x00ec, + iacute = 0x00ed, + icircumflex = 0x00ee, + idiaeresis = 0x00ef, + eth = 0x00f0, + ntilde = 0x00f1, + ograve = 0x00f2, + oacute = 0x00f3, + ocircumflex = 0x00f4, + otilde = 0x00f5, + odiaeresis = 0x00f6, + division = 0x00f7, + oslash = 0x00f8, + ooblique = 0x00f8, + ugrave = 0x00f9, + uacute = 0x00fa, + ucircumflex = 0x00fb, + udiaeresis = 0x00fc, + yacute = 0x00fd, + thorn = 0x00fe, + ydiaeresis = 0x00ff, + Aogonek = 0x01a1, + breve = 0x01a2, + Lstroke = 0x01a3, + Lcaron = 0x01a5, + Sacute = 0x01a6, + Scaron = 0x01a9, + Scedilla = 0x01aa, + Tcaron = 0x01ab, + Zacute = 0x01ac, + Zcaron = 0x01ae, + Zabovedot = 0x01af, + aogonek = 0x01b1, + ogonek = 0x01b2, + lstroke = 0x01b3, + lcaron = 0x01b5, + sacute = 0x01b6, + caron = 0x01b7, + scaron = 0x01b9, + scedilla = 0x01ba, + tcaron = 0x01bb, + zacute = 0x01bc, + doubleacute = 0x01bd, + zcaron = 0x01be, + zabovedot = 0x01bf, + Racute = 0x01c0, + Abreve = 0x01c3, + Lacute = 0x01c5, + Cacute = 0x01c6, + Ccaron = 0x01c8, + Eogonek = 0x01ca, + Ecaron = 0x01cc, + Dcaron = 0x01cf, + Dstroke = 0x01d0, + Nacute = 0x01d1, + Ncaron = 0x01d2, + Odoubleacute = 0x01d5, + Rcaron = 0x01d8, + Uring = 0x01d9, + Udoubleacute = 0x01db, + Tcedilla = 0x01de, + racute = 0x01e0, + abreve = 0x01e3, + lacute = 0x01e5, + cacute = 0x01e6, + ccaron = 0x01e8, + eogonek = 0x01ea, + ecaron = 0x01ec, + dcaron = 0x01ef, + dstroke = 0x01f0, + nacute = 0x01f1, + ncaron = 0x01f2, + odoubleacute = 0x01f5, + rcaron = 0x01f8, + uring = 0x01f9, + udoubleacute = 0x01fb, + tcedilla = 0x01fe, + abovedot = 0x01ff, + Hstroke = 0x02a1, + Hcircumflex = 0x02a6, + Iabovedot = 0x02a9, + Gbreve = 0x02ab, + Jcircumflex = 0x02ac, + hstroke = 0x02b1, + hcircumflex = 0x02b6, + idotless = 0x02b9, + gbreve = 0x02bb, + jcircumflex = 0x02bc, + Cabovedot = 0x02c5, + Ccircumflex = 0x02c6, + Gabovedot = 0x02d5, + Gcircumflex = 0x02d8, + Ubreve = 0x02dd, + Scircumflex = 0x02de, + cabovedot = 0x02e5, + ccircumflex = 0x02e6, + gabovedot = 0x02f5, + gcircumflex = 0x02f8, + ubreve = 0x02fd, + scircumflex = 0x02fe, + kra = 0x03a2, + kappa = 0x03a2, + Rcedilla = 0x03a3, + Itilde = 0x03a5, + Lcedilla = 0x03a6, + Emacron = 0x03aa, + Gcedilla = 0x03ab, + Tslash = 0x03ac, + rcedilla = 0x03b3, + itilde = 0x03b5, + lcedilla = 0x03b6, + emacron = 0x03ba, + gcedilla = 0x03bb, + tslash = 0x03bc, + ENG = 0x03bd, + eng = 0x03bf, + Amacron = 0x03c0, + Iogonek = 0x03c7, + Eabovedot = 0x03cc, + Imacron = 0x03cf, + Ncedilla = 0x03d1, + Omacron = 0x03d2, + Kcedilla = 0x03d3, + Uogonek = 0x03d9, + Utilde = 0x03dd, + Umacron = 0x03de, + amacron = 0x03e0, + iogonek = 0x03e7, + eabovedot = 0x03ec, + imacron = 0x03ef, + ncedilla = 0x03f1, + omacron = 0x03f2, + kcedilla = 0x03f3, + uogonek = 0x03f9, + utilde = 0x03fd, + umacron = 0x03fe, + Wcircumflex = 0x1000174, + wcircumflex = 0x1000175, + Ycircumflex = 0x1000176, + ycircumflex = 0x1000177, + Babovedot = 0x1001e02, + babovedot = 0x1001e03, + Dabovedot = 0x1001e0a, + dabovedot = 0x1001e0b, + Fabovedot = 0x1001e1e, + fabovedot = 0x1001e1f, + Mabovedot = 0x1001e40, + mabovedot = 0x1001e41, + Pabovedot = 0x1001e56, + pabovedot = 0x1001e57, + Sabovedot = 0x1001e60, + sabovedot = 0x1001e61, + Tabovedot = 0x1001e6a, + tabovedot = 0x1001e6b, + Wgrave = 0x1001e80, + wgrave = 0x1001e81, + Wacute = 0x1001e82, + wacute = 0x1001e83, + Wdiaeresis = 0x1001e84, + wdiaeresis = 0x1001e85, + Ygrave = 0x1001ef2, + ygrave = 0x1001ef3, + OE = 0x13bc, + oe = 0x13bd, + Ydiaeresis = 0x13be, + overline = 0x047e, + kana_fullstop = 0x04a1, + kana_openingbracket = 0x04a2, + kana_closingbracket = 0x04a3, + kana_comma = 0x04a4, + kana_conjunctive = 0x04a5, + kana_middledot = 0x04a5, + kana_WO = 0x04a6, + kana_a = 0x04a7, + kana_i = 0x04a8, + kana_u = 0x04a9, + kana_e = 0x04aa, + kana_o = 0x04ab, + kana_ya = 0x04ac, + kana_yu = 0x04ad, + kana_yo = 0x04ae, + kana_tsu = 0x04af, + kana_tu = 0x04af, + prolongedsound = 0x04b0, + kana_A = 0x04b1, + kana_I = 0x04b2, + kana_U = 0x04b3, + kana_E = 0x04b4, + kana_O = 0x04b5, + kana_KA = 0x04b6, + kana_KI = 0x04b7, + kana_KU = 0x04b8, + kana_KE = 0x04b9, + kana_KO = 0x04ba, + kana_SA = 0x04bb, + kana_SHI = 0x04bc, + kana_SU = 0x04bd, + kana_SE = 0x04be, + kana_SO = 0x04bf, + kana_TA = 0x04c0, + kana_CHI = 0x04c1, + kana_TI = 0x04c1, + kana_TSU = 0x04c2, + kana_TU = 0x04c2, + kana_TE = 0x04c3, + kana_TO = 0x04c4, + kana_NA = 0x04c5, + kana_NI = 0x04c6, + kana_NU = 0x04c7, + kana_NE = 0x04c8, + kana_NO = 0x04c9, + kana_HA = 0x04ca, + kana_HI = 0x04cb, + kana_FU = 0x04cc, + kana_HU = 0x04cc, + kana_HE = 0x04cd, + kana_HO = 0x04ce, + kana_MA = 0x04cf, + kana_MI = 0x04d0, + kana_MU = 0x04d1, + kana_ME = 0x04d2, + kana_MO = 0x04d3, + kana_YA = 0x04d4, + kana_YU = 0x04d5, + kana_YO = 0x04d6, + kana_RA = 0x04d7, + kana_RI = 0x04d8, + kana_RU = 0x04d9, + kana_RE = 0x04da, + kana_RO = 0x04db, + kana_WA = 0x04dc, + kana_N = 0x04dd, + voicedsound = 0x04de, + semivoicedsound = 0x04df, + kana_switch = 0xff7e, + Farsi_0 = 0x10006f0, + Farsi_1 = 0x10006f1, + Farsi_2 = 0x10006f2, + Farsi_3 = 0x10006f3, + Farsi_4 = 0x10006f4, + Farsi_5 = 0x10006f5, + Farsi_6 = 0x10006f6, + Farsi_7 = 0x10006f7, + Farsi_8 = 0x10006f8, + Farsi_9 = 0x10006f9, + Arabic_percent = 0x100066a, + Arabic_superscript_alef = 0x1000670, + Arabic_tteh = 0x1000679, + Arabic_peh = 0x100067e, + Arabic_tcheh = 0x1000686, + Arabic_ddal = 0x1000688, + Arabic_rreh = 0x1000691, + Arabic_comma = 0x05ac, + Arabic_fullstop = 0x10006d4, + Arabic_0 = 0x1000660, + Arabic_1 = 0x1000661, + Arabic_2 = 0x1000662, + Arabic_3 = 0x1000663, + Arabic_4 = 0x1000664, + Arabic_5 = 0x1000665, + Arabic_6 = 0x1000666, + Arabic_7 = 0x1000667, + Arabic_8 = 0x1000668, + Arabic_9 = 0x1000669, + Arabic_semicolon = 0x05bb, + Arabic_question_mark = 0x05bf, + Arabic_hamza = 0x05c1, + Arabic_maddaonalef = 0x05c2, + Arabic_hamzaonalef = 0x05c3, + Arabic_hamzaonwaw = 0x05c4, + Arabic_hamzaunderalef = 0x05c5, + Arabic_hamzaonyeh = 0x05c6, + Arabic_alef = 0x05c7, + Arabic_beh = 0x05c8, + Arabic_tehmarbuta = 0x05c9, + Arabic_teh = 0x05ca, + Arabic_theh = 0x05cb, + Arabic_jeem = 0x05cc, + Arabic_hah = 0x05cd, + Arabic_khah = 0x05ce, + Arabic_dal = 0x05cf, + Arabic_thal = 0x05d0, + Arabic_ra = 0x05d1, + Arabic_zain = 0x05d2, + Arabic_seen = 0x05d3, + Arabic_sheen = 0x05d4, + Arabic_sad = 0x05d5, + Arabic_dad = 0x05d6, + Arabic_tah = 0x05d7, + Arabic_zah = 0x05d8, + Arabic_ain = 0x05d9, + Arabic_ghain = 0x05da, + Arabic_tatweel = 0x05e0, + Arabic_feh = 0x05e1, + Arabic_qaf = 0x05e2, + Arabic_kaf = 0x05e3, + Arabic_lam = 0x05e4, + Arabic_meem = 0x05e5, + Arabic_noon = 0x05e6, + Arabic_ha = 0x05e7, + Arabic_heh = 0x05e7, + Arabic_waw = 0x05e8, + Arabic_alefmaksura = 0x05e9, + Arabic_yeh = 0x05ea, + Arabic_fathatan = 0x05eb, + Arabic_dammatan = 0x05ec, + Arabic_kasratan = 0x05ed, + Arabic_fatha = 0x05ee, + Arabic_damma = 0x05ef, + Arabic_kasra = 0x05f0, + Arabic_shadda = 0x05f1, + Arabic_sukun = 0x05f2, + Arabic_madda_above = 0x1000653, + Arabic_hamza_above = 0x1000654, + Arabic_hamza_below = 0x1000655, + Arabic_jeh = 0x1000698, + Arabic_veh = 0x10006a4, + Arabic_keheh = 0x10006a9, + Arabic_gaf = 0x10006af, + Arabic_noon_ghunna = 0x10006ba, + Arabic_heh_doachashmee = 0x10006be, + Farsi_yeh = 0x10006cc, + Arabic_farsi_yeh = 0x10006cc, + Arabic_yeh_baree = 0x10006d2, + Arabic_heh_goal = 0x10006c1, + Arabic_switch = 0xff7e, + Cyrillic_GHE_bar = 0x1000492, + Cyrillic_ghe_bar = 0x1000493, + Cyrillic_ZHE_descender = 0x1000496, + Cyrillic_zhe_descender = 0x1000497, + Cyrillic_KA_descender = 0x100049a, + Cyrillic_ka_descender = 0x100049b, + Cyrillic_KA_vertstroke = 0x100049c, + Cyrillic_ka_vertstroke = 0x100049d, + Cyrillic_EN_descender = 0x10004a2, + Cyrillic_en_descender = 0x10004a3, + Cyrillic_U_straight = 0x10004ae, + Cyrillic_u_straight = 0x10004af, + Cyrillic_U_straight_bar = 0x10004b0, + Cyrillic_u_straight_bar = 0x10004b1, + Cyrillic_HA_descender = 0x10004b2, + Cyrillic_ha_descender = 0x10004b3, + Cyrillic_CHE_descender = 0x10004b6, + Cyrillic_che_descender = 0x10004b7, + Cyrillic_CHE_vertstroke = 0x10004b8, + Cyrillic_che_vertstroke = 0x10004b9, + Cyrillic_SHHA = 0x10004ba, + Cyrillic_shha = 0x10004bb, + Cyrillic_SCHWA = 0x10004d8, + Cyrillic_schwa = 0x10004d9, + Cyrillic_I_macron = 0x10004e2, + Cyrillic_i_macron = 0x10004e3, + Cyrillic_O_bar = 0x10004e8, + Cyrillic_o_bar = 0x10004e9, + Cyrillic_U_macron = 0x10004ee, + Cyrillic_u_macron = 0x10004ef, + Serbian_dje = 0x06a1, + Macedonia_gje = 0x06a2, + Cyrillic_io = 0x06a3, + Ukrainian_ie = 0x06a4, + Ukranian_je = 0x06a4, + Macedonia_dse = 0x06a5, + Ukrainian_i = 0x06a6, + Ukranian_i = 0x06a6, + Ukrainian_yi = 0x06a7, + Ukranian_yi = 0x06a7, + Cyrillic_je = 0x06a8, + Serbian_je = 0x06a8, + Cyrillic_lje = 0x06a9, + Serbian_lje = 0x06a9, + Cyrillic_nje = 0x06aa, + Serbian_nje = 0x06aa, + Serbian_tshe = 0x06ab, + Macedonia_kje = 0x06ac, + Ukrainian_ghe_with_upturn = 0x06ad, + Byelorussian_shortu = 0x06ae, + Cyrillic_dzhe = 0x06af, + Serbian_dze = 0x06af, + numerosign = 0x06b0, + Serbian_DJE = 0x06b1, + Macedonia_GJE = 0x06b2, + Cyrillic_IO = 0x06b3, + Ukrainian_IE = 0x06b4, + Ukranian_JE = 0x06b4, + Macedonia_DSE = 0x06b5, + Ukrainian_I = 0x06b6, + Ukranian_I = 0x06b6, + Ukrainian_YI = 0x06b7, + Ukranian_YI = 0x06b7, + Cyrillic_JE = 0x06b8, + Serbian_JE = 0x06b8, + Cyrillic_LJE = 0x06b9, + Serbian_LJE = 0x06b9, + Cyrillic_NJE = 0x06ba, + Serbian_NJE = 0x06ba, + Serbian_TSHE = 0x06bb, + Macedonia_KJE = 0x06bc, + Ukrainian_GHE_WITH_UPTURN = 0x06bd, + Byelorussian_SHORTU = 0x06be, + Cyrillic_DZHE = 0x06bf, + Serbian_DZE = 0x06bf, + Cyrillic_yu = 0x06c0, + Cyrillic_a = 0x06c1, + Cyrillic_be = 0x06c2, + Cyrillic_tse = 0x06c3, + Cyrillic_de = 0x06c4, + Cyrillic_ie = 0x06c5, + Cyrillic_ef = 0x06c6, + Cyrillic_ghe = 0x06c7, + Cyrillic_ha = 0x06c8, + Cyrillic_i = 0x06c9, + Cyrillic_shorti = 0x06ca, + Cyrillic_ka = 0x06cb, + Cyrillic_el = 0x06cc, + Cyrillic_em = 0x06cd, + Cyrillic_en = 0x06ce, + Cyrillic_o = 0x06cf, + Cyrillic_pe = 0x06d0, + Cyrillic_ya = 0x06d1, + Cyrillic_er = 0x06d2, + Cyrillic_es = 0x06d3, + Cyrillic_te = 0x06d4, + Cyrillic_u = 0x06d5, + Cyrillic_zhe = 0x06d6, + Cyrillic_ve = 0x06d7, + Cyrillic_softsign = 0x06d8, + Cyrillic_yeru = 0x06d9, + Cyrillic_ze = 0x06da, + Cyrillic_sha = 0x06db, + Cyrillic_e = 0x06dc, + Cyrillic_shcha = 0x06dd, + Cyrillic_che = 0x06de, + Cyrillic_hardsign = 0x06df, + Cyrillic_YU = 0x06e0, + Cyrillic_A = 0x06e1, + Cyrillic_BE = 0x06e2, + Cyrillic_TSE = 0x06e3, + Cyrillic_DE = 0x06e4, + Cyrillic_IE = 0x06e5, + Cyrillic_EF = 0x06e6, + Cyrillic_GHE = 0x06e7, + Cyrillic_HA = 0x06e8, + Cyrillic_I = 0x06e9, + Cyrillic_SHORTI = 0x06ea, + Cyrillic_KA = 0x06eb, + Cyrillic_EL = 0x06ec, + Cyrillic_EM = 0x06ed, + Cyrillic_EN = 0x06ee, + Cyrillic_O = 0x06ef, + Cyrillic_PE = 0x06f0, + Cyrillic_YA = 0x06f1, + Cyrillic_ER = 0x06f2, + Cyrillic_ES = 0x06f3, + Cyrillic_TE = 0x06f4, + Cyrillic_U = 0x06f5, + Cyrillic_ZHE = 0x06f6, + Cyrillic_VE = 0x06f7, + Cyrillic_SOFTSIGN = 0x06f8, + Cyrillic_YERU = 0x06f9, + Cyrillic_ZE = 0x06fa, + Cyrillic_SHA = 0x06fb, + Cyrillic_E = 0x06fc, + Cyrillic_SHCHA = 0x06fd, + Cyrillic_CHE = 0x06fe, + Cyrillic_HARDSIGN = 0x06ff, + Greek_ALPHAaccent = 0x07a1, + Greek_EPSILONaccent = 0x07a2, + Greek_ETAaccent = 0x07a3, + Greek_IOTAaccent = 0x07a4, + Greek_IOTAdieresis = 0x07a5, + Greek_IOTAdiaeresis = 0x07a5, + Greek_OMICRONaccent = 0x07a7, + Greek_UPSILONaccent = 0x07a8, + Greek_UPSILONdieresis = 0x07a9, + Greek_OMEGAaccent = 0x07ab, + Greek_accentdieresis = 0x07ae, + Greek_horizbar = 0x07af, + Greek_alphaaccent = 0x07b1, + Greek_epsilonaccent = 0x07b2, + Greek_etaaccent = 0x07b3, + Greek_iotaaccent = 0x07b4, + Greek_iotadieresis = 0x07b5, + Greek_iotaaccentdieresis = 0x07b6, + Greek_omicronaccent = 0x07b7, + Greek_upsilonaccent = 0x07b8, + Greek_upsilondieresis = 0x07b9, + Greek_upsilonaccentdieresis = 0x07ba, + Greek_omegaaccent = 0x07bb, + Greek_ALPHA = 0x07c1, + Greek_BETA = 0x07c2, + Greek_GAMMA = 0x07c3, + Greek_DELTA = 0x07c4, + Greek_EPSILON = 0x07c5, + Greek_ZETA = 0x07c6, + Greek_ETA = 0x07c7, + Greek_THETA = 0x07c8, + Greek_IOTA = 0x07c9, + Greek_KAPPA = 0x07ca, + Greek_LAMDA = 0x07cb, + Greek_LAMBDA = 0x07cb, + Greek_MU = 0x07cc, + Greek_NU = 0x07cd, + Greek_XI = 0x07ce, + Greek_OMICRON = 0x07cf, + Greek_PI = 0x07d0, + Greek_RHO = 0x07d1, + Greek_SIGMA = 0x07d2, + Greek_TAU = 0x07d4, + Greek_UPSILON = 0x07d5, + Greek_PHI = 0x07d6, + Greek_CHI = 0x07d7, + Greek_PSI = 0x07d8, + Greek_OMEGA = 0x07d9, + Greek_alpha = 0x07e1, + Greek_beta = 0x07e2, + Greek_gamma = 0x07e3, + Greek_delta = 0x07e4, + Greek_epsilon = 0x07e5, + Greek_zeta = 0x07e6, + Greek_eta = 0x07e7, + Greek_theta = 0x07e8, + Greek_iota = 0x07e9, + Greek_kappa = 0x07ea, + Greek_lamda = 0x07eb, + Greek_lambda = 0x07eb, + Greek_mu = 0x07ec, + Greek_nu = 0x07ed, + Greek_xi = 0x07ee, + Greek_omicron = 0x07ef, + Greek_pi = 0x07f0, + Greek_rho = 0x07f1, + Greek_sigma = 0x07f2, + Greek_finalsmallsigma = 0x07f3, + Greek_tau = 0x07f4, + Greek_upsilon = 0x07f5, + Greek_phi = 0x07f6, + Greek_chi = 0x07f7, + Greek_psi = 0x07f8, + Greek_omega = 0x07f9, + Greek_switch = 0xff7e, + leftradical = 0x08a1, + topleftradical = 0x08a2, + horizconnector = 0x08a3, + topintegral = 0x08a4, + botintegral = 0x08a5, + vertconnector = 0x08a6, + topleftsqbracket = 0x08a7, + botleftsqbracket = 0x08a8, + toprightsqbracket = 0x08a9, + botrightsqbracket = 0x08aa, + topleftparens = 0x08ab, + botleftparens = 0x08ac, + toprightparens = 0x08ad, + botrightparens = 0x08ae, + leftmiddlecurlybrace = 0x08af, + rightmiddlecurlybrace = 0x08b0, + topleftsummation = 0x08b1, + botleftsummation = 0x08b2, + topvertsummationconnector = 0x08b3, + botvertsummationconnector = 0x08b4, + toprightsummation = 0x08b5, + botrightsummation = 0x08b6, + rightmiddlesummation = 0x08b7, + lessthanequal = 0x08bc, + notequal = 0x08bd, + greaterthanequal = 0x08be, + integral = 0x08bf, + therefore = 0x08c0, + variation = 0x08c1, + infinity = 0x08c2, + nabla = 0x08c5, + approximate = 0x08c8, + similarequal = 0x08c9, + ifonlyif = 0x08cd, + implies = 0x08ce, + identical = 0x08cf, + radical = 0x08d6, + includedin = 0x08da, + includes = 0x08db, + intersection = 0x08dc, + union = 0x08dd, + logicaland = 0x08de, + logicalor = 0x08df, + partialderivative = 0x08ef, + function = 0x08f6, + leftarrow = 0x08fb, + uparrow = 0x08fc, + rightarrow = 0x08fd, + downarrow = 0x08fe, + blank = 0x09df, + soliddiamond = 0x09e0, + checkerboard = 0x09e1, + ht = 0x09e2, + ff = 0x09e3, + cr = 0x09e4, + lf = 0x09e5, + nl = 0x09e8, + vt = 0x09e9, + lowrightcorner = 0x09ea, + uprightcorner = 0x09eb, + upleftcorner = 0x09ec, + lowleftcorner = 0x09ed, + crossinglines = 0x09ee, + horizlinescan1 = 0x09ef, + horizlinescan3 = 0x09f0, + horizlinescan5 = 0x09f1, + horizlinescan7 = 0x09f2, + horizlinescan9 = 0x09f3, + leftt = 0x09f4, + rightt = 0x09f5, + bott = 0x09f6, + topt = 0x09f7, + vertbar = 0x09f8, + emspace = 0x0aa1, + enspace = 0x0aa2, + em3space = 0x0aa3, + em4space = 0x0aa4, + digitspace = 0x0aa5, + punctspace = 0x0aa6, + thinspace = 0x0aa7, + hairspace = 0x0aa8, + emdash = 0x0aa9, + endash = 0x0aaa, + signifblank = 0x0aac, + ellipsis = 0x0aae, + doubbaselinedot = 0x0aaf, + onethird = 0x0ab0, + twothirds = 0x0ab1, + onefifth = 0x0ab2, + twofifths = 0x0ab3, + threefifths = 0x0ab4, + fourfifths = 0x0ab5, + onesixth = 0x0ab6, + fivesixths = 0x0ab7, + careof = 0x0ab8, + figdash = 0x0abb, + leftanglebracket = 0x0abc, + decimalpoint = 0x0abd, + rightanglebracket = 0x0abe, + marker = 0x0abf, + oneeighth = 0x0ac3, + threeeighths = 0x0ac4, + fiveeighths = 0x0ac5, + seveneighths = 0x0ac6, + trademark = 0x0ac9, + signaturemark = 0x0aca, + trademarkincircle = 0x0acb, + leftopentriangle = 0x0acc, + rightopentriangle = 0x0acd, + emopencircle = 0x0ace, + emopenrectangle = 0x0acf, + leftsinglequotemark = 0x0ad0, + rightsinglequotemark = 0x0ad1, + leftdoublequotemark = 0x0ad2, + rightdoublequotemark = 0x0ad3, + prescription = 0x0ad4, + permille = 0x0ad5, + minutes = 0x0ad6, + seconds = 0x0ad7, + latincross = 0x0ad9, + hexagram = 0x0ada, + filledrectbullet = 0x0adb, + filledlefttribullet = 0x0adc, + filledrighttribullet = 0x0add, + emfilledcircle = 0x0ade, + emfilledrect = 0x0adf, + enopencircbullet = 0x0ae0, + enopensquarebullet = 0x0ae1, + openrectbullet = 0x0ae2, + opentribulletup = 0x0ae3, + opentribulletdown = 0x0ae4, + openstar = 0x0ae5, + enfilledcircbullet = 0x0ae6, + enfilledsqbullet = 0x0ae7, + filledtribulletup = 0x0ae8, + filledtribulletdown = 0x0ae9, + leftpointer = 0x0aea, + rightpointer = 0x0aeb, + club = 0x0aec, + diamond = 0x0aed, + heart = 0x0aee, + maltesecross = 0x0af0, + dagger = 0x0af1, + doubledagger = 0x0af2, + checkmark = 0x0af3, + ballotcross = 0x0af4, + musicalsharp = 0x0af5, + musicalflat = 0x0af6, + malesymbol = 0x0af7, + femalesymbol = 0x0af8, + telephone = 0x0af9, + telephonerecorder = 0x0afa, + phonographcopyright = 0x0afb, + caret = 0x0afc, + singlelowquotemark = 0x0afd, + doublelowquotemark = 0x0afe, + cursor = 0x0aff, + leftcaret = 0x0ba3, + rightcaret = 0x0ba6, + downcaret = 0x0ba8, + upcaret = 0x0ba9, + overbar = 0x0bc0, + downtack = 0x0bc2, + upshoe = 0x0bc3, + downstile = 0x0bc4, + underbar = 0x0bc6, + jot = 0x0bca, + quad = 0x0bcc, + uptack = 0x0bce, + circle = 0x0bcf, + upstile = 0x0bd3, + downshoe = 0x0bd6, + rightshoe = 0x0bd8, + leftshoe = 0x0bda, + lefttack = 0x0bdc, + righttack = 0x0bfc, + hebrew_doublelowline = 0x0cdf, + hebrew_aleph = 0x0ce0, + hebrew_bet = 0x0ce1, + hebrew_beth = 0x0ce1, + hebrew_gimel = 0x0ce2, + hebrew_gimmel = 0x0ce2, + hebrew_dalet = 0x0ce3, + hebrew_daleth = 0x0ce3, + hebrew_he = 0x0ce4, + hebrew_waw = 0x0ce5, + hebrew_zain = 0x0ce6, + hebrew_zayin = 0x0ce6, + hebrew_chet = 0x0ce7, + hebrew_het = 0x0ce7, + hebrew_tet = 0x0ce8, + hebrew_teth = 0x0ce8, + hebrew_yod = 0x0ce9, + hebrew_finalkaph = 0x0cea, + hebrew_kaph = 0x0ceb, + hebrew_lamed = 0x0cec, + hebrew_finalmem = 0x0ced, + hebrew_mem = 0x0cee, + hebrew_finalnun = 0x0cef, + hebrew_nun = 0x0cf0, + hebrew_samech = 0x0cf1, + hebrew_samekh = 0x0cf1, + hebrew_ayin = 0x0cf2, + hebrew_finalpe = 0x0cf3, + hebrew_pe = 0x0cf4, + hebrew_finalzade = 0x0cf5, + hebrew_finalzadi = 0x0cf5, + hebrew_zade = 0x0cf6, + hebrew_zadi = 0x0cf6, + hebrew_qoph = 0x0cf7, + hebrew_kuf = 0x0cf7, + hebrew_resh = 0x0cf8, + hebrew_shin = 0x0cf9, + hebrew_taw = 0x0cfa, + hebrew_taf = 0x0cfa, + Hebrew_switch = 0xff7e, + Thai_kokai = 0x0da1, + Thai_khokhai = 0x0da2, + Thai_khokhuat = 0x0da3, + Thai_khokhwai = 0x0da4, + Thai_khokhon = 0x0da5, + Thai_khorakhang = 0x0da6, + Thai_ngongu = 0x0da7, + Thai_chochan = 0x0da8, + Thai_choching = 0x0da9, + Thai_chochang = 0x0daa, + Thai_soso = 0x0dab, + Thai_chochoe = 0x0dac, + Thai_yoying = 0x0dad, + Thai_dochada = 0x0dae, + Thai_topatak = 0x0daf, + Thai_thothan = 0x0db0, + Thai_thonangmontho = 0x0db1, + Thai_thophuthao = 0x0db2, + Thai_nonen = 0x0db3, + Thai_dodek = 0x0db4, + Thai_totao = 0x0db5, + Thai_thothung = 0x0db6, + Thai_thothahan = 0x0db7, + Thai_thothong = 0x0db8, + Thai_nonu = 0x0db9, + Thai_bobaimai = 0x0dba, + Thai_popla = 0x0dbb, + Thai_phophung = 0x0dbc, + Thai_fofa = 0x0dbd, + Thai_phophan = 0x0dbe, + Thai_fofan = 0x0dbf, + Thai_phosamphao = 0x0dc0, + Thai_moma = 0x0dc1, + Thai_yoyak = 0x0dc2, + Thai_rorua = 0x0dc3, + Thai_ru = 0x0dc4, + Thai_loling = 0x0dc5, + Thai_lu = 0x0dc6, + Thai_wowaen = 0x0dc7, + Thai_sosala = 0x0dc8, + Thai_sorusi = 0x0dc9, + Thai_sosua = 0x0dca, + Thai_hohip = 0x0dcb, + Thai_lochula = 0x0dcc, + Thai_oang = 0x0dcd, + Thai_honokhuk = 0x0dce, + Thai_paiyannoi = 0x0dcf, + Thai_saraa = 0x0dd0, + Thai_maihanakat = 0x0dd1, + Thai_saraaa = 0x0dd2, + Thai_saraam = 0x0dd3, + Thai_sarai = 0x0dd4, + Thai_saraii = 0x0dd5, + Thai_saraue = 0x0dd6, + Thai_sarauee = 0x0dd7, + Thai_sarau = 0x0dd8, + Thai_sarauu = 0x0dd9, + Thai_phinthu = 0x0dda, + Thai_maihanakat_maitho = 0x0dde, + Thai_baht = 0x0ddf, + Thai_sarae = 0x0de0, + Thai_saraae = 0x0de1, + Thai_sarao = 0x0de2, + Thai_saraaimaimuan = 0x0de3, + Thai_saraaimaimalai = 0x0de4, + Thai_lakkhangyao = 0x0de5, + Thai_maiyamok = 0x0de6, + Thai_maitaikhu = 0x0de7, + Thai_maiek = 0x0de8, + Thai_maitho = 0x0de9, + Thai_maitri = 0x0dea, + Thai_maichattawa = 0x0deb, + Thai_thanthakhat = 0x0dec, + Thai_nikhahit = 0x0ded, + Thai_leksun = 0x0df0, + Thai_leknung = 0x0df1, + Thai_leksong = 0x0df2, + Thai_leksam = 0x0df3, + Thai_leksi = 0x0df4, + Thai_lekha = 0x0df5, + Thai_lekhok = 0x0df6, + Thai_lekchet = 0x0df7, + Thai_lekpaet = 0x0df8, + Thai_lekkao = 0x0df9, + Hangul = 0xff31, + Hangul_Start = 0xff32, + Hangul_End = 0xff33, + Hangul_Hanja = 0xff34, + Hangul_Jamo = 0xff35, + Hangul_Romaja = 0xff36, + Hangul_Codeinput = 0xff37, + Hangul_Jeonja = 0xff38, + Hangul_Banja = 0xff39, + Hangul_PreHanja = 0xff3a, + Hangul_PostHanja = 0xff3b, + Hangul_SingleCandidate = 0xff3c, + Hangul_MultipleCandidate = 0xff3d, + Hangul_PreviousCandidate = 0xff3e, + Hangul_Special = 0xff3f, + Hangul_switch = 0xff7e, + Hangul_Kiyeog = 0x0ea1, + Hangul_SsangKiyeog = 0x0ea2, + Hangul_KiyeogSios = 0x0ea3, + Hangul_Nieun = 0x0ea4, + Hangul_NieunJieuj = 0x0ea5, + Hangul_NieunHieuh = 0x0ea6, + Hangul_Dikeud = 0x0ea7, + Hangul_SsangDikeud = 0x0ea8, + Hangul_Rieul = 0x0ea9, + Hangul_RieulKiyeog = 0x0eaa, + Hangul_RieulMieum = 0x0eab, + Hangul_RieulPieub = 0x0eac, + Hangul_RieulSios = 0x0ead, + Hangul_RieulTieut = 0x0eae, + Hangul_RieulPhieuf = 0x0eaf, + Hangul_RieulHieuh = 0x0eb0, + Hangul_Mieum = 0x0eb1, + Hangul_Pieub = 0x0eb2, + Hangul_SsangPieub = 0x0eb3, + Hangul_PieubSios = 0x0eb4, + Hangul_Sios = 0x0eb5, + Hangul_SsangSios = 0x0eb6, + Hangul_Ieung = 0x0eb7, + Hangul_Jieuj = 0x0eb8, + Hangul_SsangJieuj = 0x0eb9, + Hangul_Cieuc = 0x0eba, + Hangul_Khieuq = 0x0ebb, + Hangul_Tieut = 0x0ebc, + Hangul_Phieuf = 0x0ebd, + Hangul_Hieuh = 0x0ebe, + Hangul_A = 0x0ebf, + Hangul_AE = 0x0ec0, + Hangul_YA = 0x0ec1, + Hangul_YAE = 0x0ec2, + Hangul_EO = 0x0ec3, + Hangul_E = 0x0ec4, + Hangul_YEO = 0x0ec5, + Hangul_YE = 0x0ec6, + Hangul_O = 0x0ec7, + Hangul_WA = 0x0ec8, + Hangul_WAE = 0x0ec9, + Hangul_OE = 0x0eca, + Hangul_YO = 0x0ecb, + Hangul_U = 0x0ecc, + Hangul_WEO = 0x0ecd, + Hangul_WE = 0x0ece, + Hangul_WI = 0x0ecf, + Hangul_YU = 0x0ed0, + Hangul_EU = 0x0ed1, + Hangul_YI = 0x0ed2, + Hangul_I = 0x0ed3, + Hangul_J_Kiyeog = 0x0ed4, + Hangul_J_SsangKiyeog = 0x0ed5, + Hangul_J_KiyeogSios = 0x0ed6, + Hangul_J_Nieun = 0x0ed7, + Hangul_J_NieunJieuj = 0x0ed8, + Hangul_J_NieunHieuh = 0x0ed9, + Hangul_J_Dikeud = 0x0eda, + Hangul_J_Rieul = 0x0edb, + Hangul_J_RieulKiyeog = 0x0edc, + Hangul_J_RieulMieum = 0x0edd, + Hangul_J_RieulPieub = 0x0ede, + Hangul_J_RieulSios = 0x0edf, + Hangul_J_RieulTieut = 0x0ee0, + Hangul_J_RieulPhieuf = 0x0ee1, + Hangul_J_RieulHieuh = 0x0ee2, + Hangul_J_Mieum = 0x0ee3, + Hangul_J_Pieub = 0x0ee4, + Hangul_J_PieubSios = 0x0ee5, + Hangul_J_Sios = 0x0ee6, + Hangul_J_SsangSios = 0x0ee7, + Hangul_J_Ieung = 0x0ee8, + Hangul_J_Jieuj = 0x0ee9, + Hangul_J_Cieuc = 0x0eea, + Hangul_J_Khieuq = 0x0eeb, + Hangul_J_Tieut = 0x0eec, + Hangul_J_Phieuf = 0x0eed, + Hangul_J_Hieuh = 0x0eee, + Hangul_RieulYeorinHieuh = 0x0eef, + Hangul_SunkyeongeumMieum = 0x0ef0, + Hangul_SunkyeongeumPieub = 0x0ef1, + Hangul_PanSios = 0x0ef2, + Hangul_KkogjiDalrinIeung = 0x0ef3, + Hangul_SunkyeongeumPhieuf = 0x0ef4, + Hangul_YeorinHieuh = 0x0ef5, + Hangul_AraeA = 0x0ef6, + Hangul_AraeAE = 0x0ef7, + Hangul_J_PanSios = 0x0ef8, + Hangul_J_KkogjiDalrinIeung = 0x0ef9, + Hangul_J_YeorinHieuh = 0x0efa, + Korean_Won = 0x0eff, + Armenian_ligature_ew = 0x1000587, + Armenian_full_stop = 0x1000589, + Armenian_verjaket = 0x1000589, + Armenian_separation_mark = 0x100055d, + Armenian_but = 0x100055d, + Armenian_hyphen = 0x100058a, + Armenian_yentamna = 0x100058a, + Armenian_exclam = 0x100055c, + Armenian_amanak = 0x100055c, + Armenian_accent = 0x100055b, + Armenian_shesht = 0x100055b, + Armenian_question = 0x100055e, + Armenian_paruyk = 0x100055e, + Armenian_AYB = 0x1000531, + Armenian_ayb = 0x1000561, + Armenian_BEN = 0x1000532, + Armenian_ben = 0x1000562, + Armenian_GIM = 0x1000533, + Armenian_gim = 0x1000563, + Armenian_DA = 0x1000534, + Armenian_da = 0x1000564, + Armenian_YECH = 0x1000535, + Armenian_yech = 0x1000565, + Armenian_ZA = 0x1000536, + Armenian_za = 0x1000566, + Armenian_E = 0x1000537, + Armenian_e = 0x1000567, + Armenian_AT = 0x1000538, + Armenian_at = 0x1000568, + Armenian_TO = 0x1000539, + Armenian_to = 0x1000569, + Armenian_ZHE = 0x100053a, + Armenian_zhe = 0x100056a, + Armenian_INI = 0x100053b, + Armenian_ini = 0x100056b, + Armenian_LYUN = 0x100053c, + Armenian_lyun = 0x100056c, + Armenian_KHE = 0x100053d, + Armenian_khe = 0x100056d, + Armenian_TSA = 0x100053e, + Armenian_tsa = 0x100056e, + Armenian_KEN = 0x100053f, + Armenian_ken = 0x100056f, + Armenian_HO = 0x1000540, + Armenian_ho = 0x1000570, + Armenian_DZA = 0x1000541, + Armenian_dza = 0x1000571, + Armenian_GHAT = 0x1000542, + Armenian_ghat = 0x1000572, + Armenian_TCHE = 0x1000543, + Armenian_tche = 0x1000573, + Armenian_MEN = 0x1000544, + Armenian_men = 0x1000574, + Armenian_HI = 0x1000545, + Armenian_hi = 0x1000575, + Armenian_NU = 0x1000546, + Armenian_nu = 0x1000576, + Armenian_SHA = 0x1000547, + Armenian_sha = 0x1000577, + Armenian_VO = 0x1000548, + Armenian_vo = 0x1000578, + Armenian_CHA = 0x1000549, + Armenian_cha = 0x1000579, + Armenian_PE = 0x100054a, + Armenian_pe = 0x100057a, + Armenian_JE = 0x100054b, + Armenian_je = 0x100057b, + Armenian_RA = 0x100054c, + Armenian_ra = 0x100057c, + Armenian_SE = 0x100054d, + Armenian_se = 0x100057d, + Armenian_VEV = 0x100054e, + Armenian_vev = 0x100057e, + Armenian_TYUN = 0x100054f, + Armenian_tyun = 0x100057f, + Armenian_RE = 0x1000550, + Armenian_re = 0x1000580, + Armenian_TSO = 0x1000551, + Armenian_tso = 0x1000581, + Armenian_VYUN = 0x1000552, + Armenian_vyun = 0x1000582, + Armenian_PYUR = 0x1000553, + Armenian_pyur = 0x1000583, + Armenian_KE = 0x1000554, + Armenian_ke = 0x1000584, + Armenian_O = 0x1000555, + Armenian_o = 0x1000585, + Armenian_FE = 0x1000556, + Armenian_fe = 0x1000586, + Armenian_apostrophe = 0x100055a, + Georgian_an = 0x10010d0, + Georgian_ban = 0x10010d1, + Georgian_gan = 0x10010d2, + Georgian_don = 0x10010d3, + Georgian_en = 0x10010d4, + Georgian_vin = 0x10010d5, + Georgian_zen = 0x10010d6, + Georgian_tan = 0x10010d7, + Georgian_in = 0x10010d8, + Georgian_kan = 0x10010d9, + Georgian_las = 0x10010da, + Georgian_man = 0x10010db, + Georgian_nar = 0x10010dc, + Georgian_on = 0x10010dd, + Georgian_par = 0x10010de, + Georgian_zhar = 0x10010df, + Georgian_rae = 0x10010e0, + Georgian_san = 0x10010e1, + Georgian_tar = 0x10010e2, + Georgian_un = 0x10010e3, + Georgian_phar = 0x10010e4, + Georgian_khar = 0x10010e5, + Georgian_ghan = 0x10010e6, + Georgian_qar = 0x10010e7, + Georgian_shin = 0x10010e8, + Georgian_chin = 0x10010e9, + Georgian_can = 0x10010ea, + Georgian_jil = 0x10010eb, + Georgian_cil = 0x10010ec, + Georgian_char = 0x10010ed, + Georgian_xan = 0x10010ee, + Georgian_jhan = 0x10010ef, + Georgian_hae = 0x10010f0, + Georgian_he = 0x10010f1, + Georgian_hie = 0x10010f2, + Georgian_we = 0x10010f3, + Georgian_har = 0x10010f4, + Georgian_hoe = 0x10010f5, + Georgian_fi = 0x10010f6, + Xabovedot = 0x1001e8a, + Ibreve = 0x100012c, + Zstroke = 0x10001b5, + Gcaron = 0x10001e6, + Ocaron = 0x10001d1, + Obarred = 0x100019f, + xabovedot = 0x1001e8b, + ibreve = 0x100012d, + zstroke = 0x10001b6, + gcaron = 0x10001e7, + ocaron = 0x10001d2, + obarred = 0x1000275, + SCHWA = 0x100018f, + schwa = 0x1000259, + EZH = 0x10001b7, + ezh = 0x1000292, + Lbelowdot = 0x1001e36, + lbelowdot = 0x1001e37, + Abelowdot = 0x1001ea0, + abelowdot = 0x1001ea1, + Ahook = 0x1001ea2, + ahook = 0x1001ea3, + Acircumflexacute = 0x1001ea4, + acircumflexacute = 0x1001ea5, + Acircumflexgrave = 0x1001ea6, + acircumflexgrave = 0x1001ea7, + Acircumflexhook = 0x1001ea8, + acircumflexhook = 0x1001ea9, + Acircumflextilde = 0x1001eaa, + acircumflextilde = 0x1001eab, + Acircumflexbelowdot = 0x1001eac, + acircumflexbelowdot = 0x1001ead, + Abreveacute = 0x1001eae, + abreveacute = 0x1001eaf, + Abrevegrave = 0x1001eb0, + abrevegrave = 0x1001eb1, + Abrevehook = 0x1001eb2, + abrevehook = 0x1001eb3, + Abrevetilde = 0x1001eb4, + abrevetilde = 0x1001eb5, + Abrevebelowdot = 0x1001eb6, + abrevebelowdot = 0x1001eb7, + Ebelowdot = 0x1001eb8, + ebelowdot = 0x1001eb9, + Ehook = 0x1001eba, + ehook = 0x1001ebb, + Etilde = 0x1001ebc, + etilde = 0x1001ebd, + Ecircumflexacute = 0x1001ebe, + ecircumflexacute = 0x1001ebf, + Ecircumflexgrave = 0x1001ec0, + ecircumflexgrave = 0x1001ec1, + Ecircumflexhook = 0x1001ec2, + ecircumflexhook = 0x1001ec3, + Ecircumflextilde = 0x1001ec4, + ecircumflextilde = 0x1001ec5, + Ecircumflexbelowdot = 0x1001ec6, + ecircumflexbelowdot = 0x1001ec7, + Ihook = 0x1001ec8, + ihook = 0x1001ec9, + Ibelowdot = 0x1001eca, + ibelowdot = 0x1001ecb, + Obelowdot = 0x1001ecc, + obelowdot = 0x1001ecd, + Ohook = 0x1001ece, + ohook = 0x1001ecf, + Ocircumflexacute = 0x1001ed0, + ocircumflexacute = 0x1001ed1, + Ocircumflexgrave = 0x1001ed2, + ocircumflexgrave = 0x1001ed3, + Ocircumflexhook = 0x1001ed4, + ocircumflexhook = 0x1001ed5, + Ocircumflextilde = 0x1001ed6, + ocircumflextilde = 0x1001ed7, + Ocircumflexbelowdot = 0x1001ed8, + ocircumflexbelowdot = 0x1001ed9, + Ohornacute = 0x1001eda, + ohornacute = 0x1001edb, + Ohorngrave = 0x1001edc, + ohorngrave = 0x1001edd, + Ohornhook = 0x1001ede, + ohornhook = 0x1001edf, + Ohorntilde = 0x1001ee0, + ohorntilde = 0x1001ee1, + Ohornbelowdot = 0x1001ee2, + ohornbelowdot = 0x1001ee3, + Ubelowdot = 0x1001ee4, + ubelowdot = 0x1001ee5, + Uhook = 0x1001ee6, + uhook = 0x1001ee7, + Uhornacute = 0x1001ee8, + uhornacute = 0x1001ee9, + Uhorngrave = 0x1001eea, + uhorngrave = 0x1001eeb, + Uhornhook = 0x1001eec, + uhornhook = 0x1001eed, + Uhorntilde = 0x1001eee, + uhorntilde = 0x1001eef, + Uhornbelowdot = 0x1001ef0, + uhornbelowdot = 0x1001ef1, + Ybelowdot = 0x1001ef4, + ybelowdot = 0x1001ef5, + Yhook = 0x1001ef6, + yhook = 0x1001ef7, + Ytilde = 0x1001ef8, + ytilde = 0x1001ef9, + Ohorn = 0x10001a0, + ohorn = 0x10001a1, + Uhorn = 0x10001af, + uhorn = 0x10001b0, + EcuSign = 0x10020a0, + ColonSign = 0x10020a1, + CruzeiroSign = 0x10020a2, + FFrancSign = 0x10020a3, + LiraSign = 0x10020a4, + MillSign = 0x10020a5, + NairaSign = 0x10020a6, + PesetaSign = 0x10020a7, + RupeeSign = 0x10020a8, + WonSign = 0x10020a9, + NewSheqelSign = 0x10020aa, + DongSign = 0x10020ab, + EuroSign = 0x20ac, + zerosuperior = 0x1002070, + foursuperior = 0x1002074, + fivesuperior = 0x1002075, + sixsuperior = 0x1002076, + sevensuperior = 0x1002077, + eightsuperior = 0x1002078, + ninesuperior = 0x1002079, + zerosubscript = 0x1002080, + onesubscript = 0x1002081, + twosubscript = 0x1002082, + threesubscript = 0x1002083, + foursubscript = 0x1002084, + fivesubscript = 0x1002085, + sixsubscript = 0x1002086, + sevensubscript = 0x1002087, + eightsubscript = 0x1002088, + ninesubscript = 0x1002089, + partdifferential = 0x1002202, + emptyset = 0x1002205, + elementof = 0x1002208, + notelementof = 0x1002209, + containsas = 0x100220B, + squareroot = 0x100221A, + cuberoot = 0x100221B, + fourthroot = 0x100221C, + dintegral = 0x100222C, + tintegral = 0x100222D, + because = 0x1002235, + approxeq = 0x1002248, + notapproxeq = 0x1002247, + notidentical = 0x1002262, + stricteq = 0x1002263, + braille_dot_1 = 0xfff1, + braille_dot_2 = 0xfff2, + braille_dot_3 = 0xfff3, + braille_dot_4 = 0xfff4, + braille_dot_5 = 0xfff5, + braille_dot_6 = 0xfff6, + braille_dot_7 = 0xfff7, + braille_dot_8 = 0xfff8, + braille_dot_9 = 0xfff9, + braille_dot_10 = 0xfffa, + braille_blank = 0x1002800, + braille_dots_1 = 0x1002801, + braille_dots_2 = 0x1002802, + braille_dots_12 = 0x1002803, + braille_dots_3 = 0x1002804, + braille_dots_13 = 0x1002805, + braille_dots_23 = 0x1002806, + braille_dots_123 = 0x1002807, + braille_dots_4 = 0x1002808, + braille_dots_14 = 0x1002809, + braille_dots_24 = 0x100280a, + braille_dots_124 = 0x100280b, + braille_dots_34 = 0x100280c, + braille_dots_134 = 0x100280d, + braille_dots_234 = 0x100280e, + braille_dots_1234 = 0x100280f, + braille_dots_5 = 0x1002810, + braille_dots_15 = 0x1002811, + braille_dots_25 = 0x1002812, + braille_dots_125 = 0x1002813, + braille_dots_35 = 0x1002814, + braille_dots_135 = 0x1002815, + braille_dots_235 = 0x1002816, + braille_dots_1235 = 0x1002817, + braille_dots_45 = 0x1002818, + braille_dots_145 = 0x1002819, + braille_dots_245 = 0x100281a, + braille_dots_1245 = 0x100281b, + braille_dots_345 = 0x100281c, + braille_dots_1345 = 0x100281d, + braille_dots_2345 = 0x100281e, + braille_dots_12345 = 0x100281f, + braille_dots_6 = 0x1002820, + braille_dots_16 = 0x1002821, + braille_dots_26 = 0x1002822, + braille_dots_126 = 0x1002823, + braille_dots_36 = 0x1002824, + braille_dots_136 = 0x1002825, + braille_dots_236 = 0x1002826, + braille_dots_1236 = 0x1002827, + braille_dots_46 = 0x1002828, + braille_dots_146 = 0x1002829, + braille_dots_246 = 0x100282a, + braille_dots_1246 = 0x100282b, + braille_dots_346 = 0x100282c, + braille_dots_1346 = 0x100282d, + braille_dots_2346 = 0x100282e, + braille_dots_12346 = 0x100282f, + braille_dots_56 = 0x1002830, + braille_dots_156 = 0x1002831, + braille_dots_256 = 0x1002832, + braille_dots_1256 = 0x1002833, + braille_dots_356 = 0x1002834, + braille_dots_1356 = 0x1002835, + braille_dots_2356 = 0x1002836, + braille_dots_12356 = 0x1002837, + braille_dots_456 = 0x1002838, + braille_dots_1456 = 0x1002839, + braille_dots_2456 = 0x100283a, + braille_dots_12456 = 0x100283b, + braille_dots_3456 = 0x100283c, + braille_dots_13456 = 0x100283d, + braille_dots_23456 = 0x100283e, + braille_dots_123456 = 0x100283f, + braille_dots_7 = 0x1002840, + braille_dots_17 = 0x1002841, + braille_dots_27 = 0x1002842, + braille_dots_127 = 0x1002843, + braille_dots_37 = 0x1002844, + braille_dots_137 = 0x1002845, + braille_dots_237 = 0x1002846, + braille_dots_1237 = 0x1002847, + braille_dots_47 = 0x1002848, + braille_dots_147 = 0x1002849, + braille_dots_247 = 0x100284a, + braille_dots_1247 = 0x100284b, + braille_dots_347 = 0x100284c, + braille_dots_1347 = 0x100284d, + braille_dots_2347 = 0x100284e, + braille_dots_12347 = 0x100284f, + braille_dots_57 = 0x1002850, + braille_dots_157 = 0x1002851, + braille_dots_257 = 0x1002852, + braille_dots_1257 = 0x1002853, + braille_dots_357 = 0x1002854, + braille_dots_1357 = 0x1002855, + braille_dots_2357 = 0x1002856, + braille_dots_12357 = 0x1002857, + braille_dots_457 = 0x1002858, + braille_dots_1457 = 0x1002859, + braille_dots_2457 = 0x100285a, + braille_dots_12457 = 0x100285b, + braille_dots_3457 = 0x100285c, + braille_dots_13457 = 0x100285d, + braille_dots_23457 = 0x100285e, + braille_dots_123457 = 0x100285f, + braille_dots_67 = 0x1002860, + braille_dots_167 = 0x1002861, + braille_dots_267 = 0x1002862, + braille_dots_1267 = 0x1002863, + braille_dots_367 = 0x1002864, + braille_dots_1367 = 0x1002865, + braille_dots_2367 = 0x1002866, + braille_dots_12367 = 0x1002867, + braille_dots_467 = 0x1002868, + braille_dots_1467 = 0x1002869, + braille_dots_2467 = 0x100286a, + braille_dots_12467 = 0x100286b, + braille_dots_3467 = 0x100286c, + braille_dots_13467 = 0x100286d, + braille_dots_23467 = 0x100286e, + braille_dots_123467 = 0x100286f, + braille_dots_567 = 0x1002870, + braille_dots_1567 = 0x1002871, + braille_dots_2567 = 0x1002872, + braille_dots_12567 = 0x1002873, + braille_dots_3567 = 0x1002874, + braille_dots_13567 = 0x1002875, + braille_dots_23567 = 0x1002876, + braille_dots_123567 = 0x1002877, + braille_dots_4567 = 0x1002878, + braille_dots_14567 = 0x1002879, + braille_dots_24567 = 0x100287a, + braille_dots_124567 = 0x100287b, + braille_dots_34567 = 0x100287c, + braille_dots_134567 = 0x100287d, + braille_dots_234567 = 0x100287e, + braille_dots_1234567 = 0x100287f, + braille_dots_8 = 0x1002880, + braille_dots_18 = 0x1002881, + braille_dots_28 = 0x1002882, + braille_dots_128 = 0x1002883, + braille_dots_38 = 0x1002884, + braille_dots_138 = 0x1002885, + braille_dots_238 = 0x1002886, + braille_dots_1238 = 0x1002887, + braille_dots_48 = 0x1002888, + braille_dots_148 = 0x1002889, + braille_dots_248 = 0x100288a, + braille_dots_1248 = 0x100288b, + braille_dots_348 = 0x100288c, + braille_dots_1348 = 0x100288d, + braille_dots_2348 = 0x100288e, + braille_dots_12348 = 0x100288f, + braille_dots_58 = 0x1002890, + braille_dots_158 = 0x1002891, + braille_dots_258 = 0x1002892, + braille_dots_1258 = 0x1002893, + braille_dots_358 = 0x1002894, + braille_dots_1358 = 0x1002895, + braille_dots_2358 = 0x1002896, + braille_dots_12358 = 0x1002897, + braille_dots_458 = 0x1002898, + braille_dots_1458 = 0x1002899, + braille_dots_2458 = 0x100289a, + braille_dots_12458 = 0x100289b, + braille_dots_3458 = 0x100289c, + braille_dots_13458 = 0x100289d, + braille_dots_23458 = 0x100289e, + braille_dots_123458 = 0x100289f, + braille_dots_68 = 0x10028a0, + braille_dots_168 = 0x10028a1, + braille_dots_268 = 0x10028a2, + braille_dots_1268 = 0x10028a3, + braille_dots_368 = 0x10028a4, + braille_dots_1368 = 0x10028a5, + braille_dots_2368 = 0x10028a6, + braille_dots_12368 = 0x10028a7, + braille_dots_468 = 0x10028a8, + braille_dots_1468 = 0x10028a9, + braille_dots_2468 = 0x10028aa, + braille_dots_12468 = 0x10028ab, + braille_dots_3468 = 0x10028ac, + braille_dots_13468 = 0x10028ad, + braille_dots_23468 = 0x10028ae, + braille_dots_123468 = 0x10028af, + braille_dots_568 = 0x10028b0, + braille_dots_1568 = 0x10028b1, + braille_dots_2568 = 0x10028b2, + braille_dots_12568 = 0x10028b3, + braille_dots_3568 = 0x10028b4, + braille_dots_13568 = 0x10028b5, + braille_dots_23568 = 0x10028b6, + braille_dots_123568 = 0x10028b7, + braille_dots_4568 = 0x10028b8, + braille_dots_14568 = 0x10028b9, + braille_dots_24568 = 0x10028ba, + braille_dots_124568 = 0x10028bb, + braille_dots_34568 = 0x10028bc, + braille_dots_134568 = 0x10028bd, + braille_dots_234568 = 0x10028be, + braille_dots_1234568 = 0x10028bf, + braille_dots_78 = 0x10028c0, + braille_dots_178 = 0x10028c1, + braille_dots_278 = 0x10028c2, + braille_dots_1278 = 0x10028c3, + braille_dots_378 = 0x10028c4, + braille_dots_1378 = 0x10028c5, + braille_dots_2378 = 0x10028c6, + braille_dots_12378 = 0x10028c7, + braille_dots_478 = 0x10028c8, + braille_dots_1478 = 0x10028c9, + braille_dots_2478 = 0x10028ca, + braille_dots_12478 = 0x10028cb, + braille_dots_3478 = 0x10028cc, + braille_dots_13478 = 0x10028cd, + braille_dots_23478 = 0x10028ce, + braille_dots_123478 = 0x10028cf, + braille_dots_578 = 0x10028d0, + braille_dots_1578 = 0x10028d1, + braille_dots_2578 = 0x10028d2, + braille_dots_12578 = 0x10028d3, + braille_dots_3578 = 0x10028d4, + braille_dots_13578 = 0x10028d5, + braille_dots_23578 = 0x10028d6, + braille_dots_123578 = 0x10028d7, + braille_dots_4578 = 0x10028d8, + braille_dots_14578 = 0x10028d9, + braille_dots_24578 = 0x10028da, + braille_dots_124578 = 0x10028db, + braille_dots_34578 = 0x10028dc, + braille_dots_134578 = 0x10028dd, + braille_dots_234578 = 0x10028de, + braille_dots_1234578 = 0x10028df, + braille_dots_678 = 0x10028e0, + braille_dots_1678 = 0x10028e1, + braille_dots_2678 = 0x10028e2, + braille_dots_12678 = 0x10028e3, + braille_dots_3678 = 0x10028e4, + braille_dots_13678 = 0x10028e5, + braille_dots_23678 = 0x10028e6, + braille_dots_123678 = 0x10028e7, + braille_dots_4678 = 0x10028e8, + braille_dots_14678 = 0x10028e9, + braille_dots_24678 = 0x10028ea, + braille_dots_124678 = 0x10028eb, + braille_dots_34678 = 0x10028ec, + braille_dots_134678 = 0x10028ed, + braille_dots_234678 = 0x10028ee, + braille_dots_1234678 = 0x10028ef, + braille_dots_5678 = 0x10028f0, + braille_dots_15678 = 0x10028f1, + braille_dots_25678 = 0x10028f2, + braille_dots_125678 = 0x10028f3, + braille_dots_35678 = 0x10028f4, + braille_dots_135678 = 0x10028f5, + braille_dots_235678 = 0x10028f6, + braille_dots_1235678 = 0x10028f7, + braille_dots_45678 = 0x10028f8, + braille_dots_145678 = 0x10028f9, + braille_dots_245678 = 0x10028fa, + braille_dots_1245678 = 0x10028fb, + braille_dots_345678 = 0x10028fc, + braille_dots_1345678 = 0x10028fd, + braille_dots_2345678 = 0x10028fe, + braille_dots_12345678 = 0x10028ff, + Sinh_ng = 0x1000d82, + Sinh_h2 = 0x1000d83, + Sinh_a = 0x1000d85, + Sinh_aa = 0x1000d86, + Sinh_ae = 0x1000d87, + Sinh_aee = 0x1000d88, + Sinh_i = 0x1000d89, + Sinh_ii = 0x1000d8a, + Sinh_u = 0x1000d8b, + Sinh_uu = 0x1000d8c, + Sinh_ri = 0x1000d8d, + Sinh_rii = 0x1000d8e, + Sinh_lu = 0x1000d8f, + Sinh_luu = 0x1000d90, + Sinh_e = 0x1000d91, + Sinh_ee = 0x1000d92, + Sinh_ai = 0x1000d93, + Sinh_o = 0x1000d94, + Sinh_oo = 0x1000d95, + Sinh_au = 0x1000d96, + Sinh_ka = 0x1000d9a, + Sinh_kha = 0x1000d9b, + Sinh_ga = 0x1000d9c, + Sinh_gha = 0x1000d9d, + Sinh_ng2 = 0x1000d9e, + Sinh_nga = 0x1000d9f, + Sinh_ca = 0x1000da0, + Sinh_cha = 0x1000da1, + Sinh_ja = 0x1000da2, + Sinh_jha = 0x1000da3, + Sinh_nya = 0x1000da4, + Sinh_jnya = 0x1000da5, + Sinh_nja = 0x1000da6, + Sinh_tta = 0x1000da7, + Sinh_ttha = 0x1000da8, + Sinh_dda = 0x1000da9, + Sinh_ddha = 0x1000daa, + Sinh_nna = 0x1000dab, + Sinh_ndda = 0x1000dac, + Sinh_tha = 0x1000dad, + Sinh_thha = 0x1000dae, + Sinh_dha = 0x1000daf, + Sinh_dhha = 0x1000db0, + Sinh_na = 0x1000db1, + Sinh_ndha = 0x1000db3, + Sinh_pa = 0x1000db4, + Sinh_pha = 0x1000db5, + Sinh_ba = 0x1000db6, + Sinh_bha = 0x1000db7, + Sinh_ma = 0x1000db8, + Sinh_mba = 0x1000db9, + Sinh_ya = 0x1000dba, + Sinh_ra = 0x1000dbb, + Sinh_la = 0x1000dbd, + Sinh_va = 0x1000dc0, + Sinh_sha = 0x1000dc1, + Sinh_ssha = 0x1000dc2, + Sinh_sa = 0x1000dc3, + Sinh_ha = 0x1000dc4, + Sinh_lla = 0x1000dc5, + Sinh_fa = 0x1000dc6, + Sinh_al = 0x1000dca, + Sinh_aa2 = 0x1000dcf, + Sinh_ae2 = 0x1000dd0, + Sinh_aee2 = 0x1000dd1, + Sinh_i2 = 0x1000dd2, + Sinh_ii2 = 0x1000dd3, + Sinh_u2 = 0x1000dd4, + Sinh_uu2 = 0x1000dd6, + Sinh_ru2 = 0x1000dd8, + Sinh_e2 = 0x1000dd9, + Sinh_ee2 = 0x1000dda, + Sinh_ai2 = 0x1000ddb, + Sinh_o2 = 0x1000ddc, + Sinh_oo2 = 0x1000ddd, + Sinh_au2 = 0x1000dde, + Sinh_lu2 = 0x1000ddf, + Sinh_ruu2 = 0x1000df2, + Sinh_luu2 = 0x1000df3, + Sinh_kunddaliya = 0x1000df4, + XF86ModeLock = 0x1008FF01, + XF86MonBrightnessUp = 0x1008FF02, + XF86MonBrightnessDown = 0x1008FF03, + XF86KbdLightOnOff = 0x1008FF04, + XF86KbdBrightnessUp = 0x1008FF05, + XF86KbdBrightnessDown = 0x1008FF06, + XF86Standby = 0x1008FF10, + XF86AudioLowerVolume = 0x1008FF11, + XF86AudioMute = 0x1008FF12, + XF86AudioRaiseVolume = 0x1008FF13, + XF86AudioPlay = 0x1008FF14, + XF86AudioStop = 0x1008FF15, + XF86AudioPrev = 0x1008FF16, + XF86AudioNext = 0x1008FF17, + XF86HomePage = 0x1008FF18, + XF86Mail = 0x1008FF19, + XF86Start = 0x1008FF1A, + XF86Search = 0x1008FF1B, + XF86AudioRecord = 0x1008FF1C, + XF86Calculator = 0x1008FF1D, + XF86Memo = 0x1008FF1E, + XF86ToDoList = 0x1008FF1F, + XF86Calendar = 0x1008FF20, + XF86PowerDown = 0x1008FF21, + XF86ContrastAdjust = 0x1008FF22, + XF86RockerUp = 0x1008FF23, + XF86RockerDown = 0x1008FF24, + XF86RockerEnter = 0x1008FF25, + XF86Back = 0x1008FF26, + XF86Forward = 0x1008FF27, + XF86Stop = 0x1008FF28, + XF86Refresh = 0x1008FF29, + XF86PowerOff = 0x1008FF2A, + XF86WakeUp = 0x1008FF2B, + XF86Eject = 0x1008FF2C, + XF86ScreenSaver = 0x1008FF2D, + XF86WWW = 0x1008FF2E, + XF86Sleep = 0x1008FF2F, + XF86Favorites = 0x1008FF30, + XF86AudioPause = 0x1008FF31, + XF86AudioMedia = 0x1008FF32, + XF86MyComputer = 0x1008FF33, + XF86VendorHome = 0x1008FF34, + XF86LightBulb = 0x1008FF35, + XF86Shop = 0x1008FF36, + XF86History = 0x1008FF37, + XF86OpenURL = 0x1008FF38, + XF86AddFavorite = 0x1008FF39, + XF86HotLinks = 0x1008FF3A, + XF86BrightnessAdjust = 0x1008FF3B, + XF86Finance = 0x1008FF3C, + XF86Community = 0x1008FF3D, + XF86AudioRewind = 0x1008FF3E, + XF86BackForward = 0x1008FF3F, + XF86Launch0 = 0x1008FF40, + XF86Launch1 = 0x1008FF41, + XF86Launch2 = 0x1008FF42, + XF86Launch3 = 0x1008FF43, + XF86Launch4 = 0x1008FF44, + XF86Launch5 = 0x1008FF45, + XF86Launch6 = 0x1008FF46, + XF86Launch7 = 0x1008FF47, + XF86Launch8 = 0x1008FF48, + XF86Launch9 = 0x1008FF49, + XF86LaunchA = 0x1008FF4A, + XF86LaunchB = 0x1008FF4B, + XF86LaunchC = 0x1008FF4C, + XF86LaunchD = 0x1008FF4D, + XF86LaunchE = 0x1008FF4E, + XF86LaunchF = 0x1008FF4F, + XF86ApplicationLeft = 0x1008FF50, + XF86ApplicationRight = 0x1008FF51, + XF86Book = 0x1008FF52, + XF86CD = 0x1008FF53, + XF86Calculater = 0x1008FF54, + XF86Clear = 0x1008FF55, + XF86Close = 0x1008FF56, + XF86Copy = 0x1008FF57, + XF86Cut = 0x1008FF58, + XF86Display = 0x1008FF59, + XF86DOS = 0x1008FF5A, + XF86Documents = 0x1008FF5B, + XF86Excel = 0x1008FF5C, + XF86Explorer = 0x1008FF5D, + XF86Game = 0x1008FF5E, + XF86Go = 0x1008FF5F, + XF86iTouch = 0x1008FF60, + XF86LogOff = 0x1008FF61, + XF86Market = 0x1008FF62, + XF86Meeting = 0x1008FF63, + XF86MenuKB = 0x1008FF65, + XF86MenuPB = 0x1008FF66, + XF86MySites = 0x1008FF67, + XF86New = 0x1008FF68, + XF86News = 0x1008FF69, + XF86OfficeHome = 0x1008FF6A, + XF86Open = 0x1008FF6B, + XF86Option = 0x1008FF6C, + XF86Paste = 0x1008FF6D, + XF86Phone = 0x1008FF6E, + XF86Q = 0x1008FF70, + XF86Reply = 0x1008FF72, + XF86Reload = 0x1008FF73, + XF86RotateWindows = 0x1008FF74, + XF86RotationPB = 0x1008FF75, + XF86RotationKB = 0x1008FF76, + XF86Save = 0x1008FF77, + XF86ScrollUp = 0x1008FF78, + XF86ScrollDown = 0x1008FF79, + XF86ScrollClick = 0x1008FF7A, + XF86Send = 0x1008FF7B, + XF86Spell = 0x1008FF7C, + XF86SplitScreen = 0x1008FF7D, + XF86Support = 0x1008FF7E, + XF86TaskPane = 0x1008FF7F, + XF86Terminal = 0x1008FF80, + XF86Tools = 0x1008FF81, + XF86Travel = 0x1008FF82, + XF86UserPB = 0x1008FF84, + XF86User1KB = 0x1008FF85, + XF86User2KB = 0x1008FF86, + XF86Video = 0x1008FF87, + XF86WheelButton = 0x1008FF88, + XF86Word = 0x1008FF89, + XF86Xfer = 0x1008FF8A, + XF86ZoomIn = 0x1008FF8B, + XF86ZoomOut = 0x1008FF8C, + XF86Away = 0x1008FF8D, + XF86Messenger = 0x1008FF8E, + XF86WebCam = 0x1008FF8F, + XF86MailForward = 0x1008FF90, + XF86Pictures = 0x1008FF91, + XF86Music = 0x1008FF92, + XF86Battery = 0x1008FF93, + XF86Bluetooth = 0x1008FF94, + XF86WLAN = 0x1008FF95, + XF86UWB = 0x1008FF96, + XF86AudioForward = 0x1008FF97, + XF86AudioRepeat = 0x1008FF98, + XF86AudioRandomPlay = 0x1008FF99, + XF86Subtitle = 0x1008FF9A, + XF86AudioCycleTrack = 0x1008FF9B, + XF86CycleAngle = 0x1008FF9C, + XF86FrameBack = 0x1008FF9D, + XF86FrameForward = 0x1008FF9E, + XF86Time = 0x1008FF9F, + XF86Select = 0x1008FFA0, + XF86View = 0x1008FFA1, + XF86TopMenu = 0x1008FFA2, + XF86Red = 0x1008FFA3, + XF86Green = 0x1008FFA4, + XF86Yellow = 0x1008FFA5, + XF86Blue = 0x1008FFA6, + XF86Suspend = 0x1008FFA7, + XF86Hibernate = 0x1008FFA8, + XF86TouchpadToggle = 0x1008FFA9, + XF86TouchpadOn = 0x1008FFB0, + XF86TouchpadOff = 0x1008FFB1, + XF86AudioMicMute = 0x1008FFB2, + XF86Keyboard = 0x1008FFB3, + XF86WWAN = 0x1008FFB4, + XF86RFKill = 0x1008FFB5, + XF86AudioPreset = 0x1008FFB6, + XF86Switch_VT_1 = 0x1008FE01, + XF86Switch_VT_2 = 0x1008FE02, + XF86Switch_VT_3 = 0x1008FE03, + XF86Switch_VT_4 = 0x1008FE04, + XF86Switch_VT_5 = 0x1008FE05, + XF86Switch_VT_6 = 0x1008FE06, + XF86Switch_VT_7 = 0x1008FE07, + XF86Switch_VT_8 = 0x1008FE08, + XF86Switch_VT_9 = 0x1008FE09, + XF86Switch_VT_10 = 0x1008FE0A, + XF86Switch_VT_11 = 0x1008FE0B, + XF86Switch_VT_12 = 0x1008FE0C, + XF86Ungrab = 0x1008FE20, + XF86ClearGrab = 0x1008FE21, + XF86Next_VMode = 0x1008FE22, + XF86Prev_VMode = 0x1008FE23, + XF86LogWindowTree = 0x1008FE24, + XF86LogGrabInfo = 0x1008FE25, + SunFA_Grave = 0x1005FF00, + SunFA_Circum = 0x1005FF01, + SunFA_Tilde = 0x1005FF02, + SunFA_Acute = 0x1005FF03, + SunFA_Diaeresis = 0x1005FF04, + SunFA_Cedilla = 0x1005FF05, + SunF36 = 0x1005FF10, + SunF37 = 0x1005FF11, + SunSys_Req = 0x1005FF60, + SunPrint_Screen = 0x0000FF61, + SunCompose = 0x0000FF20, + SunAltGraph = 0x0000FF7E, + SunPageUp = 0x0000FF55, + SunPageDown = 0x0000FF56, + SunUndo = 0x0000FF65, + SunAgain = 0x0000FF66, + SunFind = 0x0000FF68, + SunStop = 0x0000FF69, + SunProps = 0x1005FF70, + SunFront = 0x1005FF71, + SunCopy = 0x1005FF72, + SunOpen = 0x1005FF73, + SunPaste = 0x1005FF74, + SunCut = 0x1005FF75, + SunPowerSwitch = 0x1005FF76, + SunAudioLowerVolume = 0x1005FF77, + SunAudioMute = 0x1005FF78, + SunAudioRaiseVolume = 0x1005FF79, + SunVideoDegauss = 0x1005FF7A, + SunVideoLowerBrightness = 0x1005FF7B, + SunVideoRaiseBrightness = 0x1005FF7C, + SunPowerSwitchShift = 0x1005FF7D, + Dring_accent = 0x1000FEB0, + Dcircumflex_accent = 0x1000FE5E, + Dcedilla_accent = 0x1000FE2C, + Dacute_accent = 0x1000FE27, + Dgrave_accent = 0x1000FE60, + Dtilde = 0x1000FE7E, + Ddiaeresis = 0x1000FE22, + DRemove = 0x1000FF00, + hpClearLine = 0x1000FF6F, + hpInsertLine = 0x1000FF70, + hpDeleteLine = 0x1000FF71, + hpInsertChar = 0x1000FF72, + hpDeleteChar = 0x1000FF73, + hpBackTab = 0x1000FF74, + hpKP_BackTab = 0x1000FF75, + hpModelock1 = 0x1000FF48, + hpModelock2 = 0x1000FF49, + hpReset = 0x1000FF6C, + hpSystem = 0x1000FF6D, + hpUser = 0x1000FF6E, + hpmute_acute = 0x100000A8, + hpmute_grave = 0x100000A9, + hpmute_asciicircum = 0x100000AA, + hpmute_diaeresis = 0x100000AB, + hpmute_asciitilde = 0x100000AC, + hplira = 0x100000AF, + hpguilder = 0x100000BE, + hpYdiaeresis = 0x100000EE, + hpIO = 0x100000EE, + hplongminus = 0x100000F6, + hpblock = 0x100000FC, + osfCopy = 0x1004FF02, + osfCut = 0x1004FF03, + osfPaste = 0x1004FF04, + osfBackTab = 0x1004FF07, + osfBackSpace = 0x1004FF08, + osfClear = 0x1004FF0B, + osfEscape = 0x1004FF1B, + osfAddMode = 0x1004FF31, + osfPrimaryPaste = 0x1004FF32, + osfQuickPaste = 0x1004FF33, + osfPageLeft = 0x1004FF40, + osfPageUp = 0x1004FF41, + osfPageDown = 0x1004FF42, + osfPageRight = 0x1004FF43, + osfActivate = 0x1004FF44, + osfMenuBar = 0x1004FF45, + osfLeft = 0x1004FF51, + osfUp = 0x1004FF52, + osfRight = 0x1004FF53, + osfDown = 0x1004FF54, + osfEndLine = 0x1004FF57, + osfBeginLine = 0x1004FF58, + osfEndData = 0x1004FF59, + osfBeginData = 0x1004FF5A, + osfPrevMenu = 0x1004FF5B, + osfNextMenu = 0x1004FF5C, + osfPrevField = 0x1004FF5D, + osfNextField = 0x1004FF5E, + osfSelect = 0x1004FF60, + osfInsert = 0x1004FF63, + osfUndo = 0x1004FF65, + osfMenu = 0x1004FF67, + osfCancel = 0x1004FF69, + osfHelp = 0x1004FF6A, + osfSelectAll = 0x1004FF71, + osfDeselectAll = 0x1004FF72, + osfReselect = 0x1004FF73, + osfExtend = 0x1004FF74, + osfRestore = 0x1004FF78, + osfDelete = 0x1004FFFF, + Reset = 0x1000FF6C, + System = 0x1000FF6D, + User = 0x1000FF6E, + ClearLine = 0x1000FF6F, + InsertLine = 0x1000FF70, + DeleteLine = 0x1000FF71, + InsertChar = 0x1000FF72, + DeleteChar = 0x1000FF73, + BackTab = 0x1000FF74, + KP_BackTab = 0x1000FF75, + Ext16bit_L = 0x1000FF76, + Ext16bit_R = 0x1000FF77, + mute_acute = 0x100000a8, + mute_grave = 0x100000a9, + mute_asciicircum = 0x100000aa, + mute_diaeresis = 0x100000ab, + mute_asciitilde = 0x100000ac, + lira = 0x100000af, + guilder = 0x100000be, + IO = 0x100000ee, + longminus = 0x100000f6, + block = 0x100000fc, + + } + + enum xkb_key_direction : byte { + KEY_UP, /**< The key was released. */ + KEY_DOWN /**< The key was pressed. */ + } + + [Flags] + enum xkb_state_component : ushort { + XKB_STATE_MODS_DEPRESSED = (1 << 0), + XKB_STATE_MODS_LATCHED = (1 << 1), + XKB_STATE_MODS_LOCKED = (1 << 2), + XKB_STATE_MODS_EFFECTIVE = (1 << 3), + XKB_STATE_LAYOUT_DEPRESSED = (1 << 4), + XKB_STATE_LAYOUT_LATCHED = (1 << 5), + XKB_STATE_LAYOUT_LOCKED = (1 << 6), + XKB_STATE_LAYOUT_EFFECTIVE = (1 << 7), + XKB_STATE_LEDS = (1 << 8) + } + + const string XKB_MOD_NAME_SHIFT ="Shift"; + const string XKB_MOD_NAME_CAPS = "Lock"; + const string XKB_MOD_NAME_CTRL = "Control"; + const string XKB_MOD_NAME_ALT = "Mod1"; + const string XKB_MOD_NAME_NUM = "Mod2"; + const string XKB_MOD_NAME_LOGO = "Mod4"; + + const string XKB_LED_NAME_CAPS = "Caps Lock"; + const string XKB_LED_NAME_NUM = "Num Lock"; + const string XKB_LED_NAME_SCROLL = "Scroll Lock"; + + #region pinvoke XKB + + [DllImportAttribute("xkbcommon")] + static extern IntPtr xkb_context_new (int flags); + [DllImportAttribute("xkbcommon")] + static extern xkb_keysym xkb_state_key_get_one_sym (IntPtr state, xkb_keycode_t keycode); + [DllImportAttribute("xkbcommon")] + static extern int xkb_state_key_get_syms (IntPtr state, xkb_keycode_t keycode, ref IntPtr syms_out); + + [DllImportAttribute("xkbcommon")] + static extern xkb_mod_index_t xkb_keymap_num_mods (IntPtr keymap); + [DllImportAttribute("xkbcommon")] + static extern xkb_mod_index_t xkb_keymap_mod_get_index (IntPtr keymap, string name); + [DllImportAttribute("xkbcommon")] + static extern bool xkb_state_mod_index_is_active (IntPtr state, xkb_mod_index_t idx, xkb_state_component type); + [DllImportAttribute("xkbcommon")] + static extern int xkb_state_mod_name_is_active (IntPtr state, string mod_name, xkb_state_component type); + + [DllImportAttribute("xkbcommon")] + static extern UInt32 xkb_state_key_get_utf32 (IntPtr state, xkb_keycode_t key); + [DllImportAttribute("xkbcommon")] + static extern void xkb_state_unref (IntPtr state); + [DllImportAttribute("xkbcommon")] + static extern void xkb_keymap_unref (IntPtr keymap); + [DllImportAttribute("xkbcommon")] + static extern void xkb_context_unref (IntPtr ctx); + + [DllImportAttribute("xkbcommon")] + static extern xkb_state_component xkb_state_update_key(IntPtr state, xkb_keycode_t key, xkb_key_direction direction); + + [DllImportAttribute("xkbcommon-x11.so.0")] + static extern int xkb_x11_setup_xkb_extension (IntPtr connection, + UInt16 major_xkb_version, UInt16 minor_xkb_version, + byte xkb_x11_setup_xkb_extension_flags, + out UInt16 major_xkb_version_out, + out UInt16 minor_xkb_version_out, + out byte base_event_out, + out byte base_error_out); + [DllImportAttribute("xkbcommon-x11.so.0")] + static extern int xkb_x11_get_core_keyboard_device_id(IntPtr connection); + [DllImportAttribute("xkbcommon-x11.so.0")] + static extern IntPtr xkb_x11_keymap_new_from_device (IntPtr context, IntPtr connection, + int device_id, byte flags); + [DllImportAttribute("xkbcommon-x11.so.0")] + static extern IntPtr xkb_x11_state_new_from_device (IntPtr xkbKeymap, IntPtr connection, int device_id); + #endregion + xkb_mod_index_t ModIdxShift; + xkb_mod_index_t ModIdxCtrl; + xkb_mod_index_t ModIdxAlt; + xkb_mod_index_t ModIdxLogo; + xkb_mod_index_t ModIdxCapsLock; + xkb_mod_index_t ModIdxNumLock; + + IntPtr xkbCtx, xkbKeymap, xkbState; + + Interface iFace; + + + public void HandleEvent (uint keycode, bool pressed) { + xkb_keysym ks = xkb_state_key_get_one_sym (xkbState, keycode); + xkb_key_direction keyDir = xkb_key_direction.KEY_DOWN; + + if (pressed) { + iFace.ProcessKeyDown ((Key)ks); + + IntPtr ptrKeySyms = IntPtr.Zero; + + int nbKeySyms = xkb_state_key_get_syms (xkbState, keycode, ref ptrKeySyms); + int[] keySyms = new int[nbKeySyms]; + Marshal.Copy (ptrKeySyms, keySyms, 0, nbKeySyms); + + uint utf32 = xkb_state_key_get_utf32 (xkbState, keycode); + char c = char.ConvertFromUtf32 ((int)utf32) [0]; + + if (!char.IsControl (c)) + iFace.ProcessKeyPress (c); + } else { + keyDir = xkb_key_direction.KEY_UP; + iFace.ProcessKeyUp ((Key)ks); + } + + xkb_state_update_key (xkbState, keycode, keyDir); + } + public bool IsDown (Key key) { + return false; + } + public bool Shift { + get { + return xkb_state_mod_index_is_active (xkbState, ModIdxShift, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); + } + } + public bool Ctrl { + get { + return xkb_state_mod_index_is_active (xkbState, ModIdxCtrl, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); + } + } + public bool Alt { + get { + return xkb_state_mod_index_is_active (xkbState, ModIdxAlt, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); + } + } + public void Destroy () { + xkb_state_unref (xkbState); + xkb_keymap_unref (xkbKeymap); + xkb_context_unref (xkbCtx); + } + + + public XCBKeyboard (IntPtr xcbConnection, Interface _iface) + { + iFace = _iface; + + ushort xkb_maj, xkb_min; + byte base_evt, base_err; + + xkbCtx = xkb_context_new (0); + xkb_x11_setup_xkb_extension (xcbConnection, 1, 0, 0, out xkb_maj, out xkb_min, out base_evt, out base_err); + int kb = xkb_x11_get_core_keyboard_device_id (xcbConnection); + xkbKeymap = xkb_x11_keymap_new_from_device (xkbCtx, xcbConnection, kb, 0); + xkbState = xkb_x11_state_new_from_device (xkbKeymap, xcbConnection, kb); + + ModIdxShift = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_SHIFT); + ModIdxCtrl = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_CTRL); + ModIdxAlt = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_ALT); + ModIdxLogo = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_LOGO); + ModIdxCapsLock = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_CAPS); + ModIdxNumLock = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_NUM); + } + } +} + diff --git a/Crow/src/backends/xlib/X11Keyboard.cs b/Crow/src/backends/xlib/X11Keyboard.cs new file mode 100644 index 00000000..2af86d3f --- /dev/null +++ b/Crow/src/backends/xlib/X11Keyboard.cs @@ -0,0 +1,120 @@ +// +// XCBKeyboard.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Runtime.InteropServices; + +namespace Crow.XLib +{ + public class X11Keyboard + { + #region PInvoke + [DllImportAttribute("X11")] + static extern IntPtr XFree(IntPtr data); + [DllImport ("libX11")] + static extern void XDisplayKeycodes (IntPtr disp, out int min, out int max); + [DllImport ("libX11")] + static extern IntPtr XGetKeyboardMapping (IntPtr disp, byte first_keycode, int keycode_count, + out int keysyms_per_keycode_return); + [DllImport ("libX11")] + unsafe static extern byte* XGetModifierMapping (IntPtr disp); + [DllImport ("libX11")] + static extern uint XKeycodeToKeysym (IntPtr display, int keycode, int index); + #endregion + + #region IKeyboard implementation + + public event EventHandler<KeyEventArgs> KeyDown; + public event EventHandler<KeyEventArgs> KeyUp; + public event EventHandler<KeyPressEventArgs> KeyPress; + + public void HandleEvent (uint keycode, bool pressed) { + /*int min_keycode, max_keycode, keysyms_per_keycode; + XLib.NativeMethods.XDisplayKeycodes (xDisp, out min_keycode, out max_keycode); + + IntPtr ksp = XLib.NativeMethods.XGetKeyboardMapping (xDisp, (byte)min_keycode, + max_keycode + 1 - min_keycode, out keysyms_per_keycode); + XLib.NativeMethods.XFree (ksp);*/ + + uint keySym; + keySym = XKeycodeToKeysym (xDisp, (int)keycode, 0); + char c = (char)keySym; + if (pressed) + KeyDown.Raise (this, new KeyEventArgs ((Key)keySym, false)); + else + KeyUp.Raise (this, new KeyEventArgs ((Key)keySym, false)); + } + public bool IsDown (Key key) { + throw new NotImplementedException(); + } + public bool Shift { + get { + throw new NotImplementedException(); + } + } + public bool Ctrl { + get { + throw new NotImplementedException (); + } + } + public bool Alt { + get { + throw new NotImplementedException (); + } + } + public void Destroy () { + + } + #endregion + + + IntPtr xDisp; + + public X11Keyboard (IntPtr _xDisp) + { + xDisp = _xDisp; + + int min_keycode, max_keycode, keysyms_per_keycode; + + XDisplayKeycodes (xDisp, out min_keycode, out max_keycode); + IntPtr ksp = XGetKeyboardMapping (xDisp, (byte) min_keycode, + max_keycode + 1 - min_keycode, out keysyms_per_keycode); + XFree (ksp); + + unsafe { + byte* modmap_unmanaged = XGetModifierMapping (xDisp); + int nummodmap = 0; + int* ptr = (int*)modmap_unmanaged; + nummodmap = ptr [0]; + + for (int i = 0; i< nummodmap; i++) { + Console.WriteLine(modmap_unmanaged[i+4]); + } + XFree ((IntPtr)modmap_unmanaged); + } + } + } +} + diff --git a/Crow/src/backends/xlib/X11Structs.cs b/Crow/src/backends/xlib/X11Structs.cs new file mode 100644 index 00000000..5e43e006 --- /dev/null +++ b/Crow/src/backends/xlib/X11Structs.cs @@ -0,0 +1,1821 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software",, to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2004 Novell, Inc. +// +// Authors: +// Peter Bartok pbartok@novell.com +// + + +// NOT COMPLETE + +using System; +using System.ComponentModel; +using System.Collections; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Threading; +using System.Reflection; + +// X11 Version +namespace Crow.XLib { + // + // In the structures below, fields of type long are mapped to IntPtr. + // This will work on all platforms where sizeof(long)==sizeof(void*), which + // is almost all platforms except WIN64. + // + + [StructLayout(LayoutKind.Sequential)] + public struct XAnyEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XKeyEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr root; + public IntPtr subwindow; + public IntPtr time; + public int x; + public int y; + public int x_root; + public int y_root; + public int state; + public int keycode; + public bool same_screen; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XButtonEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr root; + public IntPtr subwindow; + public IntPtr time; + public int x; + public int y; + public int x_root; + public int y_root; + public int state; + public int button; + public bool same_screen; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XMotionEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr root; + public IntPtr subwindow; + public IntPtr time; + public int x; + public int y; + public int x_root; + public int y_root; + public int state; + public byte is_hint; + public bool same_screen; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XCrossingEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr root; + public IntPtr subwindow; + public IntPtr time; + public int x; + public int y; + public int x_root; + public int y_root; + public NotifyMode mode; + public NotifyDetail detail; + public bool same_screen; + public bool focus; + public int state; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XFocusChangeEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public int mode; + public NotifyDetail detail; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XKeymapEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public byte key_vector0; + public byte key_vector1; + public byte key_vector2; + public byte key_vector3; + public byte key_vector4; + public byte key_vector5; + public byte key_vector6; + public byte key_vector7; + public byte key_vector8; + public byte key_vector9; + public byte key_vector10; + public byte key_vector11; + public byte key_vector12; + public byte key_vector13; + public byte key_vector14; + public byte key_vector15; + public byte key_vector16; + public byte key_vector17; + public byte key_vector18; + public byte key_vector19; + public byte key_vector20; + public byte key_vector21; + public byte key_vector22; + public byte key_vector23; + public byte key_vector24; + public byte key_vector25; + public byte key_vector26; + public byte key_vector27; + public byte key_vector28; + public byte key_vector29; + public byte key_vector30; + public byte key_vector31; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XExposeEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public int x; + public int y; + public int width; + public int height; + public int count; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XGraphicsExposeEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr drawable; + public int x; + public int y; + public int width; + public int height; + public int count; + public int major_code; + public int minor_code; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XNoExposeEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr drawable; + public int major_code; + public int minor_code; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XVisibilityEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public int state; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XCreateWindowEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr parent; + public IntPtr window; + public int x; + public int y; + public int width; + public int height; + public int border_width; + public bool override_redirect; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XDestroyWindowEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XUnmapEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public bool from_configure; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XMapEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public bool override_redirect; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XMapRequestEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr parent; + public IntPtr window; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XReparentEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public IntPtr parent; + public int x; + public int y; + public bool override_redirect; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XConfigureEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public int x; + public int y; + public int width; + public int height; + public int border_width; + public IntPtr above; + public bool override_redirect; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XGravityEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public int x; + public int y; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XResizeRequestEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public int width; + public int height; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XConfigureRequestEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr parent; + public IntPtr window; + public int x; + public int y; + public int width; + public int height; + public int border_width; + public IntPtr above; + public int detail; + public IntPtr value_mask; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XCirculateEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr xevent; + public IntPtr window; + public int place; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XCirculateRequestEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr parent; + public IntPtr window; + public int place; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XPropertyEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr atom; + public IntPtr time; + public int state; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XSelectionClearEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr selection; + public IntPtr time; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XSelectionRequestEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr owner; + public IntPtr requestor; + public IntPtr selection; + public IntPtr target; + public IntPtr property; + public IntPtr time; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XSelectionEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr requestor; + public IntPtr selection; + public IntPtr target; + public IntPtr property; + public IntPtr time; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XColormapEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr colormap; + public bool c_new; + public int state; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XClientMessageEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public IntPtr message_type; + public int format; + public IntPtr ptr1; + public IntPtr ptr2; + public IntPtr ptr3; + public IntPtr ptr4; + public IntPtr ptr5; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XMappingEvent { + public XEventName type; + public IntPtr serial; + public bool send_event; + public IntPtr display; + public IntPtr window; + public int request; + public int first_keycode; + public int count; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XErrorEvent { + public XEventName type; + public IntPtr display; + public IntPtr resourceid; + public IntPtr serial; + public byte error_code; + public XRequest request_code; + public byte minor_code; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XEventPad { + public IntPtr pad0; + public IntPtr pad1; + public IntPtr pad2; + public IntPtr pad3; + public IntPtr pad4; + public IntPtr pad5; + public IntPtr pad6; + public IntPtr pad7; + public IntPtr pad8; + public IntPtr pad9; + public IntPtr pad10; + public IntPtr pad11; + public IntPtr pad12; + public IntPtr pad13; + public IntPtr pad14; + public IntPtr pad15; + public IntPtr pad16; + public IntPtr pad17; + public IntPtr pad18; + public IntPtr pad19; + public IntPtr pad20; + public IntPtr pad21; + public IntPtr pad22; + public IntPtr pad23; + } + + [StructLayout(LayoutKind.Explicit)] + public struct XEvent { + [ FieldOffset(0) ] public XEventName type; + [ FieldOffset(0) ] public XAnyEvent AnyEvent; + [ FieldOffset(0) ] public XKeyEvent KeyEvent; + [ FieldOffset(0) ] public XButtonEvent ButtonEvent; + [ FieldOffset(0) ] public XMotionEvent MotionEvent; + [ FieldOffset(0) ] public XCrossingEvent CrossingEvent; + [ FieldOffset(0) ] public XFocusChangeEvent FocusChangeEvent; + [ FieldOffset(0) ] public XExposeEvent ExposeEvent; + [ FieldOffset(0) ] public XGraphicsExposeEvent GraphicsExposeEvent; + [ FieldOffset(0) ] public XNoExposeEvent NoExposeEvent; + [ FieldOffset(0) ] public XVisibilityEvent VisibilityEvent; + [ FieldOffset(0) ] public XCreateWindowEvent CreateWindowEvent; + [ FieldOffset(0) ] public XDestroyWindowEvent DestroyWindowEvent; + [ FieldOffset(0) ] public XUnmapEvent UnmapEvent; + [ FieldOffset(0) ] public XMapEvent MapEvent; + [ FieldOffset(0) ] public XMapRequestEvent MapRequestEvent; + [ FieldOffset(0) ] public XReparentEvent ReparentEvent; + [ FieldOffset(0) ] public XConfigureEvent ConfigureEvent; + [ FieldOffset(0) ] public XGravityEvent GravityEvent; + [ FieldOffset(0) ] public XResizeRequestEvent ResizeRequestEvent; + [ FieldOffset(0) ] public XConfigureRequestEvent ConfigureRequestEvent; + [ FieldOffset(0) ] public XCirculateEvent CirculateEvent; + [ FieldOffset(0) ] public XCirculateRequestEvent CirculateRequestEvent; + [ FieldOffset(0) ] public XPropertyEvent PropertyEvent; + [ FieldOffset(0) ] public XSelectionClearEvent SelectionClearEvent; + [ FieldOffset(0) ] public XSelectionRequestEvent SelectionRequestEvent; + [ FieldOffset(0) ] public XSelectionEvent SelectionEvent; + [ FieldOffset(0) ] public XColormapEvent ColormapEvent; + [ FieldOffset(0) ] public XClientMessageEvent ClientMessageEvent; + [ FieldOffset(0) ] public XMappingEvent MappingEvent; + [ FieldOffset(0) ] public XErrorEvent ErrorEvent; + [ FieldOffset(0) ] public XKeymapEvent KeymapEvent; + + //[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=24)] + //[ FieldOffset(0) ] public int[] pad; + [ FieldOffset(0) ] public XEventPad Pad; + public override string ToString() { + switch (type) + { + case XEventName.ButtonPress: + case XEventName.ButtonRelease: + return ToString (ButtonEvent); + case XEventName.CirculateNotify: + case XEventName.CirculateRequest: + return ToString (CirculateEvent); + case XEventName.ClientMessage: + return ToString (ClientMessageEvent); + case XEventName.ColormapNotify: + return ToString (ColormapEvent); + case XEventName.ConfigureNotify: + return ToString (ConfigureEvent); + case XEventName.ConfigureRequest: + return ToString (ConfigureRequestEvent); + case XEventName.CreateNotify: + return ToString (CreateWindowEvent); + case XEventName.DestroyNotify: + return ToString (DestroyWindowEvent); + case XEventName.Expose: + return ToString (ExposeEvent); + case XEventName.FocusIn: + case XEventName.FocusOut: + return ToString (FocusChangeEvent); + case XEventName.GraphicsExpose: + return ToString (GraphicsExposeEvent); + case XEventName.GravityNotify: + return ToString (GravityEvent); + case XEventName.KeymapNotify: + return ToString (KeymapEvent); + case XEventName.MapNotify: + return ToString (MapEvent); + case XEventName.MappingNotify: + return ToString (MappingEvent); + case XEventName.MapRequest: + return ToString (MapRequestEvent); + case XEventName.MotionNotify: + return ToString (MotionEvent); + case XEventName.NoExpose: + return ToString (NoExposeEvent); + case XEventName.PropertyNotify: + return ToString (PropertyEvent); + case XEventName.ReparentNotify: + return ToString (ReparentEvent); + case XEventName.ResizeRequest: + return ToString (ResizeRequestEvent); + case XEventName.SelectionClear: + return ToString (SelectionClearEvent); + case XEventName.SelectionNotify: + return ToString (SelectionEvent); + case XEventName.SelectionRequest: + return ToString (SelectionRequestEvent); + case XEventName.UnmapNotify: + return ToString (UnmapEvent); + case XEventName.VisibilityNotify: + return ToString (VisibilityEvent); + case XEventName.EnterNotify: + case XEventName.LeaveNotify: + return ToString (CrossingEvent); + default: + return type.ToString (); + } + } + + public static string ToString (object ev) + { + string result = string.Empty; + Type type = ev.GetType (); + System.Reflection.FieldInfo [] fields = type.GetFields (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance); + for (int i = 0; i < fields.Length; i++) { + if (result != string.Empty) { + result += ", "; + } + object value = fields [i].GetValue (ev); + result += fields [i].Name + "=" + (value == null ? "<null>" : value.ToString ()); + } + return type.Name + " (" + result + ")"; + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct XSetWindowAttributes { + public IntPtr background_pixmap; + public IntPtr background_pixel; + public IntPtr border_pixmap; + public IntPtr border_pixel; + public Gravity bit_gravity; + public Gravity win_gravity; + public int backing_store; + public IntPtr backing_planes; + public IntPtr backing_pixel; + public bool save_under; + public IntPtr event_mask; + public IntPtr do_not_propagate_mask; + public bool override_redirect; + public IntPtr colormap; + public IntPtr cursor; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XWindowAttributes { + public int x; + public int y; + public int width; + public int height; + public int border_width; + public int depth; + public IntPtr visual; + public IntPtr root; + public int c_class; + public Gravity bit_gravity; + public Gravity win_gravity; + public int backing_store; + public IntPtr backing_planes; + public IntPtr backing_pixel; + public bool save_under; + public IntPtr colormap; + public bool map_installed; + public MapState map_state; + public IntPtr all_event_masks; + public IntPtr your_event_mask; + public IntPtr do_not_propagate_mask; + public bool override_direct; + public IntPtr screen; + + public override string ToString () + { + return XEvent.ToString (this); + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct XTextProperty { + public string value; + public IntPtr encoding; + public int format; + public IntPtr nitems; + } + + public enum XWindowClass { + InputOutput = 1, + InputOnly = 2 + } + + public enum XEventName { + KeyPress = 2, + KeyRelease = 3, + ButtonPress = 4, + ButtonRelease = 5, + MotionNotify = 6, + EnterNotify = 7, + LeaveNotify = 8, + FocusIn = 9, + FocusOut = 10, + KeymapNotify = 11, + Expose = 12, + GraphicsExpose = 13, + NoExpose = 14, + VisibilityNotify = 15, + CreateNotify = 16, + DestroyNotify = 17, + UnmapNotify = 18, + MapNotify = 19, + MapRequest = 20, + ReparentNotify = 21, + ConfigureNotify = 22, + ConfigureRequest = 23, + GravityNotify = 24, + ResizeRequest = 25, + CirculateNotify = 26, + CirculateRequest = 27, + PropertyNotify = 28, + SelectionClear = 29, + SelectionRequest = 30, + SelectionNotify = 31, + ColormapNotify = 32, + ClientMessage = 33, + MappingNotify = 34, + + LASTEvent + } + + [Flags] + public enum SetWindowValuemask { + Nothing = 0, + BackPixmap = 1, + BackPixel = 2, + BorderPixmap = 4, + BorderPixel = 8, + BitGravity = 16, + WinGravity = 32, + BackingStore = 64, + BackingPlanes = 128, + BackingPixel = 256, + OverrideRedirect = 512, + SaveUnder = 1024, + EventMask = 2048, + DontPropagate = 4096, + ColorMap = 8192, + Cursor = 16384 + } + + public enum SendEventValues { + PointerWindow = 0, + InputFocus = 1 + } + + public enum CreateWindowArgs { + CopyFromParent = 0, + ParentRelative = 1, + InputOutput = 1, + InputOnly = 2 + } + + public enum Gravity { + ForgetGravity = 0, + NorthWestGravity= 1, + NorthGravity = 2, + NorthEastGravity= 3, + WestGravity = 4, + CenterGravity = 5, + EastGravity = 6, + SouthWestGravity= 7, + SouthGravity = 8, + SouthEastGravity= 9, + StaticGravity = 10 + } + + public enum XKeySym : uint { + XK_BackSpace = 0xFF08, + XK_Tab = 0xFF09, + XK_Clear = 0xFF0B, + XK_Return = 0xFF0D, + XK_Home = 0xFF50, + XK_Left = 0xFF51, + XK_Up = 0xFF52, + XK_Right = 0xFF53, + XK_Down = 0xFF54, + XK_Page_Up = 0xFF55, + XK_Page_Down = 0xFF56, + XK_End = 0xFF57, + XK_Begin = 0xFF58, + XK_Menu = 0xFF67, + XK_Shift_L = 0xFFE1, + XK_Shift_R = 0xFFE2, + XK_Control_L = 0xFFE3, + XK_Control_R = 0xFFE4, + XK_Caps_Lock = 0xFFE5, + XK_Shift_Lock = 0xFFE6, + XK_Meta_L = 0xFFE7, + XK_Meta_R = 0xFFE8, + XK_Alt_L = 0xFFE9, + XK_Alt_R = 0xFFEA, + XK_Super_L = 0xFFEB, + XK_Super_R = 0xFFEC, + XK_Hyper_L = 0xFFED, + XK_Hyper_R = 0xFFEE, + } + + [Flags] + public enum EventMask { + NoEventMask = 0, + KeyPressMask = 1<<0, + KeyReleaseMask = 1<<1, + ButtonPressMask = 1<<2, + ButtonReleaseMask = 1<<3, + EnterWindowMask = 1<<4, + LeaveWindowMask = 1<<5, + PointerMotionMask = 1<<6, + PointerMotionHintMask = 1<<7, + Button1MotionMask = 1<<8, + Button2MotionMask = 1<<9, + Button3MotionMask = 1<<10, + Button4MotionMask = 1<<11, + Button5MotionMask = 1<<12, + ButtonMotionMask = 1<<13, + KeymapStateMask = 1<<14, + ExposureMask = 1<<15, + VisibilityChangeMask = 1<<16, + StructureNotifyMask = 1<<17, + ResizeRedirectMask = 1<<18, + SubstructureNotifyMask = 1<<19, + SubstructureRedirectMask= 1<<20, + FocusChangeMask = 1<<21, + PropertyChangeMask = 1<<22, + ColormapChangeMask = 1<<23, + OwnerGrabButtonMask = 1<<24 + } + + public enum GrabMode { + GrabModeSync = 0, + GrabModeAsync = 1 + } + + [StructLayout(LayoutKind.Sequential)] + public struct XStandardColormap { + public IntPtr colormap; + public IntPtr red_max; + public IntPtr red_mult; + public IntPtr green_max; + public IntPtr green_mult; + public IntPtr blue_max; + public IntPtr blue_mult; + public IntPtr base_pixel; + public IntPtr visualid; + public IntPtr killid; + } + + [StructLayout(LayoutKind.Sequential, Pack=2)] + public struct XColor { + public IntPtr pixel; + public ushort red; + public ushort green; + public ushort blue; + public byte flags; + public byte pad; + } + + public enum Atom { + AnyPropertyType = 0, + XA_PRIMARY = 1, + XA_SECONDARY = 2, + XA_ARC = 3, + XA_ATOM = 4, + XA_BITMAP = 5, + XA_CARDINAL = 6, + XA_COLORMAP = 7, + XA_CURSOR = 8, + XA_CUT_BUFFER0 = 9, + XA_CUT_BUFFER1 = 10, + XA_CUT_BUFFER2 = 11, + XA_CUT_BUFFER3 = 12, + XA_CUT_BUFFER4 = 13, + XA_CUT_BUFFER5 = 14, + XA_CUT_BUFFER6 = 15, + XA_CUT_BUFFER7 = 16, + XA_DRAWABLE = 17, + XA_FONT = 18, + XA_INTEGER = 19, + XA_PIXMAP = 20, + XA_POINT = 21, + XA_RECTANGLE = 22, + XA_RESOURCE_MANAGER = 23, + XA_RGB_COLOR_MAP = 24, + XA_RGB_BEST_MAP = 25, + XA_RGB_BLUE_MAP = 26, + XA_RGB_DEFAULT_MAP = 27, + XA_RGB_GRAY_MAP = 28, + XA_RGB_GREEN_MAP = 29, + XA_RGB_RED_MAP = 30, + XA_STRING = 31, + XA_VISUALID = 32, + XA_WINDOW = 33, + XA_WM_COMMAND = 34, + XA_WM_HINTS = 35, + XA_WM_CLIENT_MACHINE = 36, + XA_WM_ICON_NAME = 37, + XA_WM_ICON_SIZE = 38, + XA_WM_NAME = 39, + XA_WM_NORMAL_HINTS = 40, + XA_WM_SIZE_HINTS = 41, + XA_WM_ZOOM_HINTS = 42, + XA_MIN_SPACE = 43, + XA_NORM_SPACE = 44, + XA_MAX_SPACE = 45, + XA_END_SPACE = 46, + XA_SUPERSCRIPT_X = 47, + XA_SUPERSCRIPT_Y = 48, + XA_SUBSCRIPT_X = 49, + XA_SUBSCRIPT_Y = 50, + XA_UNDERLINE_POSITION = 51, + XA_UNDERLINE_THICKNESS = 52, + XA_STRIKEOUT_ASCENT = 53, + XA_STRIKEOUT_DESCENT = 54, + XA_ITALIC_ANGLE = 55, + XA_X_HEIGHT = 56, + XA_QUAD_WIDTH = 57, + XA_WEIGHT = 58, + XA_POINT_SIZE = 59, + XA_RESOLUTION = 60, + XA_COPYRIGHT = 61, + XA_NOTICE = 62, + XA_FONT_NAME = 63, + XA_FAMILY_NAME = 64, + XA_FULL_NAME = 65, + XA_CAP_HEIGHT = 66, + XA_WM_CLASS = 67, + XA_WM_TRANSIENT_FOR = 68, + + XA_LAST_PREDEFINED = 68 + } + + [StructLayout(LayoutKind.Sequential)] + public struct XScreen { + public IntPtr ext_data; + public IntPtr display; + public IntPtr root; + public int width; + public int height; + public int mwidth; + public int mheight; + public int ndepths; + public IntPtr depths; + public int root_depth; + public IntPtr root_visual; + public IntPtr default_gc; + public IntPtr cmap; + public IntPtr white_pixel; + public IntPtr black_pixel; + public int max_maps; + public int min_maps; + public int backing_store; + public bool save_unders; + public IntPtr root_input_mask; + } + + [Flags] + public enum ChangeWindowFlags { + CWX = 1<<0, + CWY = 1<<1, + CWWidth = 1<<2, + CWHeight = 1<<3, + CWBorderWidth = 1<<4, + CWSibling = 1<<5, + CWStackMode = 1<<6 + } + + public enum StackMode { + Above = 0, + Below = 1, + TopIf = 2, + BottomIf = 3, + Opposite = 4 + } + + [StructLayout(LayoutKind.Sequential)] + public struct XWindowChanges { + public int x; + public int y; + public int width; + public int height; + public int border_width; + public IntPtr sibling; + public StackMode stack_mode; + } + + [Flags] + public enum ColorFlags { + DoRed = 1<<0, + DoGreen = 1<<1, + DoBlue = 1<<2 + } + + public enum NotifyMode { + NotifyNormal = 0, + NotifyGrab = 1, + NotifyUngrab = 2 + } + + public enum NotifyDetail { + NotifyAncestor = 0, + NotifyVirtual = 1, + NotifyInferior = 2, + NotifyNonlinear = 3, + NotifyNonlinearVirtual = 4, + NotifyPointer = 5, + NotifyPointerRoot = 6, + NotifyDetailNone = 7 + } + + [StructLayout(LayoutKind.Sequential)] + public struct MotifWmHints { + public IntPtr flags; + public IntPtr functions; + public IntPtr decorations; + public IntPtr input_mode; + public IntPtr status; + + public override string ToString () + { + return string.Format("MotifWmHints <flags={0}, functions={1}, decorations={2}, input_mode={3}, status={4}", (MotifFlags) flags.ToInt32 (), (MotifFunctions) functions.ToInt32 (), (MotifDecorations) decorations.ToInt32 (), (MotifInputMode) input_mode.ToInt32 (), status.ToInt32 ()); + } + } + + [Flags] + public enum MotifFlags { + Functions = 1, + Decorations = 2, + InputMode = 4, + Status = 8 + } + + [Flags] + public enum MotifFunctions { + All = 0x01, + Resize = 0x02, + Move = 0x04, + Minimize = 0x08, + Maximize = 0x10, + Close = 0x20 + } + + [Flags] + public enum MotifDecorations { + All = 0x01, + Border = 0x02, + ResizeH = 0x04, + Title = 0x08, + Menu = 0x10, + Minimize = 0x20, + Maximize = 0x40, + + } + + [Flags] + public enum MotifInputMode { + Modeless = 0, + ApplicationModal = 1, + SystemModal = 2, + FullApplicationModal = 3 + } + + [Flags] + public enum KeyMasks { + ShiftMask = (1 << 0), + LockMask = (1 << 1), + ControlMask = (1 << 2), + Mod1Mask = (1 << 3), + Mod2Mask = (1 << 4), + Mod3Mask = (1 << 5), + Mod4Mask = (1 << 6), + Mod5Mask = (1 << 7), + + ModMasks = Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask + } + + [Flags] + public enum MouseKeyMasks { + Button1Mask = (1 << 8), + Button2Mask = (1 << 9), + Button3Mask = (1 << 10), + Button4Mask = (1 << 11), + Button5Mask = (1 << 12), + } + + [StructLayout (LayoutKind.Sequential)] + public struct XModifierKeymap { + public int max_keypermod; + public IntPtr modifiermap; + } + + public enum PropertyMode { + Replace = 0, + Prepend = 1, + Append = 2 + } + + [StructLayout (LayoutKind.Sequential)] + public struct XKeyBoardState { + public int key_click_percent; + public int bell_percent; + public uint bell_pitch, bell_duration; + public IntPtr led_mask; + public int global_auto_repeat; + public AutoRepeats auto_repeats; + + [StructLayout (LayoutKind.Explicit)] + public struct AutoRepeats { + [FieldOffset (0)] + public byte first; + + [FieldOffset (31)] + public byte last; + } + } + + [Flags] + public enum GCFunction { + GCFunction = 1<<0, + GCPlaneMask = 1<<1, + GCForeground = 1<<2, + GCBackground = 1<<3, + GCLineWidth = 1<<4, + GCLineStyle = 1<<5, + GCCapStyle = 1<<6, + GCJoinStyle = 1<<7, + GCFillStyle = 1<<8, + GCFillRule = 1<<9, + GCTile = 1<<10, + GCStipple = 1<<11, + GCTileStipXOrigin = 1<<12, + GCTileStipYOrigin = 1<<13, + GCFont = 1<<14, + GCSubwindowMode = 1<<15, + GCGraphicsExposures = 1<<16, + GCClipXOrigin = 1<<17, + GCClipYOrigin = 1<<18, + GCClipMask = 1<<19, + GCDashOffset = 1<<20, + GCDashList = 1<<21, + GCArcMode = 1<<22 + } + + public enum GCJoinStyle { + JoinMiter = 0, + JoinRound = 1, + JoinBevel = 2 + } + + public enum GCLineStyle { + LineSolid = 0, + LineOnOffDash = 1, + LineDoubleDash = 2 + } + + public enum GCCapStyle { + CapNotLast = 0, + CapButt = 1, + CapRound = 2, + CapProjecting = 3 + } + + public enum GCFillStyle { + FillSolid = 0, + FillTiled = 1, + FillStippled = 2, + FillOpaqueStppled = 3 + } + + public enum GCFillRule { + EvenOddRule = 0, + WindingRule = 1 + } + + public enum GCArcMode { + ArcChord = 0, + ArcPieSlice = 1 + } + + public enum GCSubwindowMode { + ClipByChildren = 0, + IncludeInferiors = 1 + } + + [StructLayout (LayoutKind.Sequential)] + public struct XGCValues { + public GXFunction function; + public IntPtr plane_mask; + public IntPtr foreground; + public IntPtr background; + public int line_width; + public GCLineStyle line_style; + public GCCapStyle cap_style; + public GCJoinStyle join_style; + public GCFillStyle fill_style; + public GCFillRule fill_rule; + public GCArcMode arc_mode; + public IntPtr tile; + public IntPtr stipple; + public int ts_x_origin; + public int ts_y_origin; + public IntPtr font; + public GCSubwindowMode subwindow_mode; + public bool graphics_exposures; + public int clip_x_origin; + public int clib_y_origin; + public IntPtr clip_mask; + public int dash_offset; + public byte dashes; + } + + public enum GXFunction { + GXclear = 0x0, /* 0 */ + GXand = 0x1, /* src AND dst */ + GXandReverse = 0x2, /* src AND NOT dst */ + GXcopy = 0x3, /* src */ + GXandInverted = 0x4, /* NOT src AND dst */ + GXnoop = 0x5, /* dst */ + GXxor = 0x6, /* src XOR dst */ + GXor = 0x7, /* src OR dst */ + GXnor = 0x8, /* NOT src AND NOT dst */ + GXequiv = 0x9, /* NOT src XOR dst */ + GXinvert = 0xa, /* NOT dst */ + GXorReverse = 0xb, /* src OR NOT dst */ + GXcopyInverted = 0xc, /* NOT src */ + GXorInverted = 0xd, /* NOT src OR dst */ + GXnand = 0xe, /* NOT src OR NOT dst */ + GXset = 0xf /* 1 */ + } + + public enum NetWindowManagerState { + Remove = 0, + Add = 1, + Toggle = 2 + } + + public enum RevertTo { + None = 0, + PointerRoot = 1, + Parent = 2 + } + + public enum MapState { + IsUnmapped = 0, + IsUnviewable = 1, + IsViewable = 2 + } + + public enum CursorFontShape { + XC_X_cursor = 0, + XC_arrow = 2, + XC_based_arrow_down = 4, + XC_based_arrow_up = 6, + XC_boat = 8, + XC_bogosity = 10, + XC_bottom_left_corner = 12, + XC_bottom_right_corner = 14, + XC_bottom_side = 16, + XC_bottom_tee = 18, + XC_box_spiral = 20, + XC_center_ptr = 22, + + XC_circle = 24, + XC_clock = 26, + XC_coffee_mug = 28, + XC_cross = 30, + XC_cross_reverse = 32, + XC_crosshair = 34, + XC_diamond_cross = 36, + XC_dot = 38, + XC_dotbox = 40, + XC_double_arrow = 42, + XC_draft_large = 44, + XC_draft_small = 46, + + XC_draped_box = 48, + XC_exchange = 50, + XC_fleur = 52, + XC_gobbler = 54, + XC_gumby = 56, + XC_hand1 = 58, + XC_hand2 = 60, + XC_heart = 62, + XC_icon = 64, + XC_iron_cross = 66, + XC_left_ptr = 68, + XC_left_side = 70, + + XC_left_tee = 72, + XC_left_button = 74, + XC_ll_angle = 76, + XC_lr_angle = 78, + XC_man = 80, + XC_middlebutton = 82, + XC_mouse = 84, + XC_pencil = 86, + XC_pirate = 88, + XC_plus = 90, + XC_question_arrow = 92, + XC_right_ptr = 94, + + XC_right_side = 96, + XC_right_tee = 98, + XC_rightbutton = 100, + XC_rtl_logo = 102, + XC_sailboat = 104, + XC_sb_down_arrow = 106, + XC_sb_h_double_arrow = 108, + XC_sb_left_arrow = 110, + XC_sb_right_arrow = 112, + XC_sb_up_arrow = 114, + XC_sb_v_double_arrow = 116, + XC_sb_shuttle = 118, + + XC_sizing = 120, + XC_spider = 122, + XC_spraycan = 124, + XC_star = 126, + XC_target = 128, + XC_tcross = 130, + XC_top_left_arrow = 132, + XC_top_left_corner = 134, + XC_top_right_corner = 136, + XC_top_side = 138, + XC_top_tee = 140, + XC_trek = 142, + + XC_ul_angle = 144, + XC_umbrella = 146, + XC_ur_angle = 148, + XC_watch = 150, + XC_xterm = 152, + XC_num_glyphs = 154 + } + + public enum SystrayRequest { + SYSTEM_TRAY_REQUEST_DOCK = 0, + SYSTEM_TRAY_BEGIN_MESSAGE = 1, + SYSTEM_TRAY_CANCEL_MESSAGE = 2 + } + + public enum NetWmStateRequest { + _NET_WM_STATE_REMOVE = 0, + _NET_WM_STATE_ADD = 1, + _NET_WM_STATE_TOGGLE = 2 + } + + public enum NetWmMoveResize { + _NET_WM_MOVERESIZE_SIZE_TOPLEFT = 0, + _NET_WM_MOVERESIZE_SIZE_TOP = 1, + _NET_WM_MOVERESIZE_SIZE_TOPRIGHT = 2, + _NET_WM_MOVERESIZE_SIZE_RIGHT = 3, + _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT = 4, + _NET_WM_MOVERESIZE_SIZE_BOTTOM = 5, + _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6, + _NET_WM_MOVERESIZE_SIZE_LEFT = 7, + _NET_WM_MOVERESIZE_MOVE = 8, + _NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9, + _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10, + _NET_WM_MOVERESIZE_CANCEL = 11 + } + + [Flags] + public enum XSizeHintsFlags { + USPosition = (1 << 0), + USSize = (1 << 1), + PPosition = (1 << 2), + PSize = (1 << 3), + PMinSize = (1 << 4), + PMaxSize = (1 << 5), + PResizeInc = (1 << 6), + PAspect = (1 << 7), + PAllHints = (PPosition | PSize | PMinSize | PMaxSize | PResizeInc | PAspect), + PBaseSize = (1 << 8), + PWinGravity = (1 << 9), + } + + [StructLayout(LayoutKind.Sequential)] + public struct XSizeHints { + public IntPtr flags; + public int x; + public int y; + public int width; + public int height; + public int min_width; + public int min_height; + public int max_width; + public int max_height; + public int width_inc; + public int height_inc; + public int min_aspect_x; + public int min_aspect_y; + public int max_aspect_x; + public int max_aspect_y; + public int base_width; + public int base_height; + public int win_gravity; + } + + [Flags] + public enum XWMHintsFlags { + InputHint = (1 << 0), + StateHint = (1 << 1), + IconPixmapHint = (1 << 2), + IconWindowHint = (1 << 3), + IconPositionHint = (1 << 4), + IconMaskHint = (1 << 5), + WindowGroupHint = (1 << 6), + AllHints = (InputHint | StateHint | IconPixmapHint | IconWindowHint | IconPositionHint | IconMaskHint | WindowGroupHint) + } + + public enum XInitialState { + DontCareState = 0, + NormalState = 1, + ZoomState = 2, + IconicState = 3, + InactiveState = 4 + } + + [StructLayout(LayoutKind.Sequential)] + public struct XWMHints { + public IntPtr flags; + public bool input; + public XInitialState initial_state; + public IntPtr icon_pixmap; + public IntPtr icon_window; + public int icon_x; + public int icon_y; + public IntPtr icon_mask; + public IntPtr window_group; + } + + [StructLayout(LayoutKind.Sequential)] + public struct XIconSize { + public int min_width; + public int min_height; + public int max_width; + public int max_height; + public int width_inc; + public int height_inc; + } + + public struct CaretStruct { + public Timer Timer; // Blink interval + public IntPtr Hwnd; // Window owning the caret + public IntPtr Window; // Actual X11 handle of the window + public int X; // X position of the caret + public int Y; // Y position of the caret + public int Width; // Width of the caret; if no image used + public int Height; // Height of the caret, if no image used + public bool Visible; // Is caret visible? + public bool On; // Caret blink display state: On/Off + public IntPtr gc; // Graphics context + public bool Paused; // Don't update right now + } + + public struct HoverStruct { + public Timer Timer; // for hovering + public IntPtr Window; // Last window we entered; used to generate WM_MOUSEHOVER (handle is X11 handle) + public int X; // Last MouseMove X coordinate; used to generate WM_MOUSEHOVER + public int Y; // Last MouseMove Y coordinate; used to generate WM_MOUSEHOVER + public Size Size; // Size of the rectangle the mouse has to stay in to generate hover + public int Interval; // in milliseconds, how long to hold before hover is generated + public IntPtr Atom; // X Atom + } + + /*public struct ClickStruct { + public IntPtr Hwnd; // + public Msg Message; // + public IntPtr wParam; // + public IntPtr lParam; // + public long Time; // Last time we received a mouse click + public bool Pending; // True if we haven't sent the last mouse click + }*/ + + public struct GrabStruct { + public bool Confined; // Is the current grab (if any) confined to grab_area? + public IntPtr Hwnd; // The window that is grabbed + public Rectangle Area; // The area the current grab is confined to + } + + public delegate int XErrorHandler(IntPtr DisplayHandle, ref XErrorEvent error_event); + + public enum XRequest : byte { + X_CreateWindow = 1, + X_ChangeWindowAttributes = 2, + X_GetWindowAttributes = 3, + X_DestroyWindow = 4, + X_DestroySubwindows = 5, + X_ChangeSaveSet = 6, + X_ReparentWindow = 7, + X_MapWindow = 8, + X_MapSubwindows = 9, + X_UnmapWindow = 10, + X_UnmapSubwindows = 11, + X_ConfigureWindow = 12, + X_CirculateWindow = 13, + X_GetGeometry = 14, + X_QueryTree = 15, + X_InternAtom = 16, + X_GetAtomName = 17, + X_ChangeProperty = 18, + X_DeleteProperty = 19, + X_GetProperty = 20, + X_ListProperties = 21, + X_SetSelectionOwner = 22, + X_GetSelectionOwner = 23, + X_ConvertSelection = 24, + X_SendEvent = 25, + X_GrabPointer = 26, + X_UngrabPointer = 27, + X_GrabButton = 28, + X_UngrabButton = 29, + X_ChangeActivePointerGrab = 30, + X_GrabKeyboard = 31, + X_UngrabKeyboard = 32, + X_GrabKey = 33, + X_UngrabKey = 34, + X_AllowEvents = 35, + X_GrabServer = 36, + X_UngrabServer = 37, + X_QueryPointer = 38, + X_GetMotionEvents = 39, + X_TranslateCoords = 40, + X_WarpPointer = 41, + X_SetInputFocus = 42, + X_GetInputFocus = 43, + X_QueryKeymap = 44, + X_OpenFont = 45, + X_CloseFont = 46, + X_QueryFont = 47, + X_QueryTextExtents = 48, + X_ListFonts = 49, + X_ListFontsWithInfo = 50, + X_SetFontPath = 51, + X_GetFontPath = 52, + X_CreatePixmap = 53, + X_FreePixmap = 54, + X_CreateGC = 55, + X_ChangeGC = 56, + X_CopyGC = 57, + X_SetDashes = 58, + X_SetClipRectangles = 59, + X_FreeGC = 60, + X_ClearArea = 61, + X_CopyArea = 62, + X_CopyPlane = 63, + X_PolyPoint = 64, + X_PolyLine = 65, + X_PolySegment = 66, + X_PolyRectangle = 67, + X_PolyArc = 68, + X_FillPoly = 69, + X_PolyFillRectangle = 70, + X_PolyFillArc = 71, + X_PutImage = 72, + X_GetImage = 73, + X_PolyText8 = 74, + X_PolyText16 = 75, + X_ImageText8 = 76, + X_ImageText16 = 77, + X_CreateColormap = 78, + X_FreeColormap = 79, + X_CopyColormapAndFree = 80, + X_InstallColormap = 81, + X_UninstallColormap = 82, + X_ListInstalledColormaps = 83, + X_AllocColor = 84, + X_AllocNamedColor = 85, + X_AllocColorCells = 86, + X_AllocColorPlanes = 87, + X_FreeColors = 88, + X_StoreColors = 89, + X_StoreNamedColor = 90, + X_QueryColors = 91, + X_LookupColor = 92, + X_CreateCursor = 93, + X_CreateGlyphCursor = 94, + X_FreeCursor = 95, + X_RecolorCursor = 96, + X_QueryBestSize = 97, + X_QueryExtension = 98, + X_ListExtensions = 99, + X_ChangeKeyboardMapping = 100, + X_GetKeyboardMapping = 101, + X_ChangeKeyboardControl = 102, + X_GetKeyboardControl = 103, + X_Bell = 104, + X_ChangePointerControl = 105, + X_GetPointerControl = 106, + X_SetScreenSaver = 107, + X_GetScreenSaver = 108, + X_ChangeHosts = 109, + X_ListHosts = 110, + X_SetAccessControl = 111, + X_SetCloseDownMode = 112, + X_KillClient = 113, + X_RotateProperties = 114, + X_ForceScreenSaver = 115, + X_SetPointerMapping = 116, + X_GetPointerMapping = 117, + X_SetModifierMapping = 118, + X_GetModifierMapping = 119, + X_NoOperation = 127 + } + + [Flags] + public enum XIMProperties { + XIMPreeditArea = 0x0001, + XIMPreeditCallbacks = 0x0002, + XIMPreeditPosition = 0x0004, + XIMPreeditNothing = 0x0008, + XIMPreeditNone = 0x0010, + XIMStatusArea = 0x0100, + XIMStatusCallbacks = 0x0200, + XIMStatusNothing = 0x0400, + XIMStatusNone = 0x0800, + } + + [Flags] + public enum WindowType { + Client = 1, + Whole = 2, + Both = 3 + } + + public enum XEmbedMessage { + EmbeddedNotify = 0, + WindowActivate = 1, + WindowDeactivate = 2, + RequestFocus = 3, + FocusIn = 4, + FocusOut = 5, + FocusNext = 6, + FocusPrev = 7, + /* 8-9 were used for XEMBED_GRAB_KEY/XEMBED_UNGRAB_KEY */ + ModalityOn = 10, + ModalityOff = 11, + RegisterAccelerator = 12, + UnregisterAccelerator = 13, + ActivateAccelerator = 14 + } + + [StructLayout (LayoutKind.Sequential)] + public struct XcursorImage + { + private int version; + public int size; /* nominal size for matching */ + public int width; /* actual width */ + public int height; /* actual height */ + public int xhot; /* hot spot x (must be inside image) */ + public int yhot; /* hot spot y (must be inside image) */ + public int delay; /* hot spot y (must be inside image) */ + public IntPtr pixels; /* pointer to pixels */ + + public override string ToString () + { + return string.Format ("XCursorImage (version: {0}, size: {1}, width: {2}, height: {3}, xhot: {4}, yhot: {5}, delay: {6}, pixels: {7}", + version, size, width, height, xhot, yhot, delay, pixels); + } + } ; + + [StructLayout (LayoutKind.Sequential)] + public struct XcursorImages + { + public int nimage; /* number of images */ + public IntPtr images; /* array of XcursorImage pointers */ + } + + [StructLayout (LayoutKind.Sequential)] + public struct XIMStyles + { + public ushort count_styles; + public IntPtr supported_styles; + } + + [StructLayout (LayoutKind.Sequential)] + + public class XPoint + { + public short X; + public short Y; + } + + [StructLayout (LayoutKind.Sequential)] + + public class XIMCallback + { + public IntPtr client_data; + public XIMProc callback; + GCHandle gch; + + public XIMCallback (IntPtr clientData, XIMProc proc) + { + this.client_data = clientData; + this.gch = GCHandle.Alloc (proc); + this.callback = proc; + } + + ~XIMCallback () + { + gch.Free (); + } + } + + public enum XIMFeedback + { + Reverse = 1, + Underline = 2, + Highlight = 4, + Primary = 32, + Secondary = 64, + Tertiary = 128, + } + + public struct XIMFeedbackStruct + { + public byte FeedbackMask; // one or more of XIMFeedback enum + } + + public struct XIMText + { + public ushort Length; + public IntPtr Feedback; // to XIMFeedbackStruct + public bool EncodingIsWChar; + public IntPtr String; // it could be either char* or wchar_t* + } + + public struct XIMPreeditDrawCallbackStruct + { + public int Caret; + public int ChangeFirst; + public int ChangeLength; + public IntPtr Text; // to XIMText + } + + public enum XIMCaretDirection + { + XIMForwardChar, + XIMBackwardChar, + XIMForwardWord, + XIMBackwardWord, + XIMCaretUp, + XIMCaretDown, + XIMNextLine, + XIMPreviousLine, + XIMLineStart, + XIMLineEnd, + XIMAbsolutePosition, + XIMDontChange + } + + public enum XIMCaretStyle + { + IsInvisible, + IsPrimary, + IsSecondary + } + + public struct XIMPreeditCaretCallbackStruct + { + public int Position; + public XIMCaretDirection Direction; + public XIMCaretStyle Style; + } + + // only PreeditStartCallback requires return value though. + public delegate int XIMProc (IntPtr xim, IntPtr clientData, IntPtr callData); + + public static class XNames + { + public const string XNVaNestedList = "XNVaNestedList"; + public const string XNQueryInputStyle = "queryInputStyle"; + public const string XNClientWindow = "clientWindow"; + public const string XNInputStyle = "inputStyle"; + public const string XNFocusWindow = "focusWindow"; + + // XIMPreeditCallbacks delegate names. + public const string XNPreeditStartCallback = "preeditStartCallback"; + public const string XNPreeditDoneCallback = "preeditDoneCallback"; + public const string XNPreeditDrawCallback = "preeditDrawCallback"; + public const string XNPreeditCaretCallback = "preeditCaretCallback"; + public const string XNPreeditStateNotifyCallback = "preeditStateNotifyCallback"; + public const string XNPreeditAttributes = "preeditAttributes"; + // XIMStatusCallbacks delegate names. + public const string XNStatusStartCallback = "statusStartCallback"; + public const string XNStatusDoneCallback = "statusDoneCallback"; + public const string XNStatusDrawCallback = "statusDrawCallback"; + public const string XNStatusAttributes = "statusAttributes"; + + public const string XNArea = "area"; + public const string XNAreaNeeded = "areaNeeded"; + public const string XNSpotLocation = "spotLocation"; + public const string XNFontSet = "fontSet"; + } + + [StructLayout (LayoutKind.Sequential)] + public struct XineramaScreenInfo + { + public int screen_number; + public short x_org; + public short y_org; + public short width; + public short height; + } +} diff --git a/Crow/src/backends/xlib/XKeySym.cs b/Crow/src/backends/xlib/XKeySym.cs new file mode 100644 index 00000000..f874f4d4 --- /dev/null +++ b/Crow/src/backends/xlib/XKeySym.cs @@ -0,0 +1,2109 @@ +/* autogenerated */ +using System; + +namespace XLib +{ + [Flags] + public enum KeySym + { + XK_VoidSymbol = 0xffffff, + XK_BackSpace = 0xff08, + XK_Tab = 0xff09, + XK_Linefeed = 0xff0a, + XK_Clear = 0xff0b, + XK_Return = 0xff0d, + XK_Pause = 0xff13, + XK_Scroll_Lock = 0xff14, + XK_Sys_Req = 0xff15, + XK_Escape = 0xff1b, + XK_Delete = 0xffff, + XK_Multi_key = 0xff20, + XK_Codeinput = 0xff37, + XK_SingleCandidate = 0xff3c, + XK_MultipleCandidate = 0xff3d, + XK_PreviousCandidate = 0xff3e, + XK_Kanji = 0xff21, + XK_Muhenkan = 0xff22, + XK_Henkan_Mode = 0xff23, + XK_Henkan = 0xff23, + XK_Romaji = 0xff24, + XK_Hiragana = 0xff25, + XK_Katakana = 0xff26, + XK_Hiragana_Katakana = 0xff27, + XK_Zenkaku = 0xff28, + XK_Hankaku = 0xff29, + XK_Zenkaku_Hankaku = 0xff2a, + XK_Touroku = 0xff2b, + XK_Massyo = 0xff2c, + XK_Kana_Lock = 0xff2d, + XK_Kana_Shift = 0xff2e, + XK_Eisu_Shift = 0xff2f, + XK_Eisu_toggle = 0xff30, + XK_Kanji_Bangou = 0xff37, + XK_Zen_Koho = 0xff3d, + XK_Mae_Koho = 0xff3e, + XK_Home = 0xff50, + XK_Left = 0xff51, + XK_Up = 0xff52, + XK_Right = 0xff53, + XK_Down = 0xff54, + XK_Prior = 0xff55, + XK_Page_Up = 0xff55, + XK_Next = 0xff56, + XK_Page_Down = 0xff56, + XK_End = 0xff57, + XK_Begin = 0xff58, + XK_Select = 0xff60, + XK_Print = 0xff61, + XK_Execute = 0xff62, + XK_Insert = 0xff63, + XK_Undo = 0xff65, + XK_Redo = 0xff66, + XK_Menu = 0xff67, + XK_Find = 0xff68, + XK_Cancel = 0xff69, + XK_Help = 0xff6a, + XK_Break = 0xff6b, + XK_Mode_switch = 0xff7e, + XK_script_switch = 0xff7e, + XK_Num_Lock = 0xff7f, + XK_KP_Space = 0xff80, + XK_KP_Tab = 0xff89, + XK_KP_Enter = 0xff8d, + XK_KP_F1 = 0xff91, + XK_KP_F2 = 0xff92, + XK_KP_F3 = 0xff93, + XK_KP_F4 = 0xff94, + XK_KP_Home = 0xff95, + XK_KP_Left = 0xff96, + XK_KP_Up = 0xff97, + XK_KP_Right = 0xff98, + XK_KP_Down = 0xff99, + XK_KP_Prior = 0xff9a, + XK_KP_Page_Up = 0xff9a, + XK_KP_Next = 0xff9b, + XK_KP_Page_Down = 0xff9b, + XK_KP_End = 0xff9c, + XK_KP_Begin = 0xff9d, + XK_KP_Insert = 0xff9e, + XK_KP_Delete = 0xff9f, + XK_KP_Equal = 0xffbd, + XK_KP_Multiply = 0xffaa, + XK_KP_Add = 0xffab, + XK_KP_Separator = 0xffac, + XK_KP_Subtract = 0xffad, + XK_KP_Decimal = 0xffae, + XK_KP_Divide = 0xffaf, + XK_KP_0 = 0xffb0, + XK_KP_1 = 0xffb1, + XK_KP_2 = 0xffb2, + XK_KP_3 = 0xffb3, + XK_KP_4 = 0xffb4, + XK_KP_5 = 0xffb5, + XK_KP_6 = 0xffb6, + XK_KP_7 = 0xffb7, + XK_KP_8 = 0xffb8, + XK_KP_9 = 0xffb9, + XK_F1 = 0xffbe, + XK_F2 = 0xffbf, + XK_F3 = 0xffc0, + XK_F4 = 0xffc1, + XK_F5 = 0xffc2, + XK_F6 = 0xffc3, + XK_F7 = 0xffc4, + XK_F8 = 0xffc5, + XK_F9 = 0xffc6, + XK_F10 = 0xffc7, + XK_F11 = 0xffc8, + XK_L1 = 0xffc8, + XK_F12 = 0xffc9, + XK_L2 = 0xffc9, + XK_F13 = 0xffca, + XK_L3 = 0xffca, + XK_F14 = 0xffcb, + XK_L4 = 0xffcb, + XK_F15 = 0xffcc, + XK_L5 = 0xffcc, + XK_F16 = 0xffcd, + XK_L6 = 0xffcd, + XK_F17 = 0xffce, + XK_L7 = 0xffce, + XK_F18 = 0xffcf, + XK_L8 = 0xffcf, + XK_F19 = 0xffd0, + XK_L9 = 0xffd0, + XK_F20 = 0xffd1, + XK_L10 = 0xffd1, + XK_F21 = 0xffd2, + XK_R1 = 0xffd2, + XK_F22 = 0xffd3, + XK_R2 = 0xffd3, + XK_F23 = 0xffd4, + XK_R3 = 0xffd4, + XK_F24 = 0xffd5, + XK_R4 = 0xffd5, + XK_F25 = 0xffd6, + XK_R5 = 0xffd6, + XK_F26 = 0xffd7, + XK_R6 = 0xffd7, + XK_F27 = 0xffd8, + XK_R7 = 0xffd8, + XK_F28 = 0xffd9, + XK_R8 = 0xffd9, + XK_F29 = 0xffda, + XK_R9 = 0xffda, + XK_F30 = 0xffdb, + XK_R10 = 0xffdb, + XK_F31 = 0xffdc, + XK_R11 = 0xffdc, + XK_F32 = 0xffdd, + XK_R12 = 0xffdd, + XK_F33 = 0xffde, + XK_R13 = 0xffde, + XK_F34 = 0xffdf, + XK_R14 = 0xffdf, + XK_F35 = 0xffe0, + XK_R15 = 0xffe0, + XK_Shift_L = 0xffe1, + XK_Shift_R = 0xffe2, + XK_Control_L = 0xffe3, + XK_Control_R = 0xffe4, + XK_Caps_Lock = 0xffe5, + XK_Shift_Lock = 0xffe6, + XK_Meta_L = 0xffe7, + XK_Meta_R = 0xffe8, + XK_Alt_L = 0xffe9, + XK_Alt_R = 0xffea, + XK_Super_L = 0xffeb, + XK_Super_R = 0xffec, + XK_Hyper_L = 0xffed, + XK_Hyper_R = 0xffee, + XK_ISO_Lock = 0xfe01, + XK_ISO_Level2_Latch = 0xfe02, + XK_ISO_Level3_Shift = 0xfe03, + XK_ISO_Level3_Latch = 0xfe04, + XK_ISO_Level3_Lock = 0xfe05, + XK_ISO_Level5_Shift = 0xfe11, + XK_ISO_Level5_Latch = 0xfe12, + XK_ISO_Level5_Lock = 0xfe13, + XK_ISO_Group_Shift = 0xff7e, + XK_ISO_Group_Latch = 0xfe06, + XK_ISO_Group_Lock = 0xfe07, + XK_ISO_Next_Group = 0xfe08, + XK_ISO_Next_Group_Lock = 0xfe09, + XK_ISO_Prev_Group = 0xfe0a, + XK_ISO_Prev_Group_Lock = 0xfe0b, + XK_ISO_First_Group = 0xfe0c, + XK_ISO_First_Group_Lock = 0xfe0d, + XK_ISO_Last_Group = 0xfe0e, + XK_ISO_Last_Group_Lock = 0xfe0f, + XK_ISO_Left_Tab = 0xfe20, + XK_ISO_Move_Line_Up = 0xfe21, + XK_ISO_Move_Line_Down = 0xfe22, + XK_ISO_Partial_Line_Up = 0xfe23, + XK_ISO_Partial_Line_Down = 0xfe24, + XK_ISO_Partial_Space_Left = 0xfe25, + XK_ISO_Partial_Space_Right = 0xfe26, + XK_ISO_Set_Margin_Left = 0xfe27, + XK_ISO_Set_Margin_Right = 0xfe28, + XK_ISO_Release_Margin_Left = 0xfe29, + XK_ISO_Release_Margin_Right = 0xfe2a, + XK_ISO_Release_Both_Margins = 0xfe2b, + XK_ISO_Fast_Cursor_Left = 0xfe2c, + XK_ISO_Fast_Cursor_Right = 0xfe2d, + XK_ISO_Fast_Cursor_Up = 0xfe2e, + XK_ISO_Fast_Cursor_Down = 0xfe2f, + XK_ISO_Continuous_Underline = 0xfe30, + XK_ISO_Discontinuous_Underline = 0xfe31, + XK_ISO_Emphasize = 0xfe32, + XK_ISO_Center_Object = 0xfe33, + XK_ISO_Enter = 0xfe34, + XK_dead_grave = 0xfe50, + XK_dead_acute = 0xfe51, + XK_dead_circumflex = 0xfe52, + XK_dead_tilde = 0xfe53, + XK_dead_perispomeni = 0xfe53, + XK_dead_macron = 0xfe54, + XK_dead_breve = 0xfe55, + XK_dead_abovedot = 0xfe56, + XK_dead_diaeresis = 0xfe57, + XK_dead_abovering = 0xfe58, + XK_dead_doubleacute = 0xfe59, + XK_dead_caron = 0xfe5a, + XK_dead_cedilla = 0xfe5b, + XK_dead_ogonek = 0xfe5c, + XK_dead_iota = 0xfe5d, + XK_dead_voiced_sound = 0xfe5e, + XK_dead_semivoiced_sound = 0xfe5f, + XK_dead_belowdot = 0xfe60, + XK_dead_hook = 0xfe61, + XK_dead_horn = 0xfe62, + XK_dead_stroke = 0xfe63, + XK_dead_abovecomma = 0xfe64, + XK_dead_psili = 0xfe64, + XK_dead_abovereversedcomma = 0xfe65, + XK_dead_dasia = 0xfe65, + XK_dead_doublegrave = 0xfe66, + XK_dead_belowring = 0xfe67, + XK_dead_belowmacron = 0xfe68, + XK_dead_belowcircumflex = 0xfe69, + XK_dead_belowtilde = 0xfe6a, + XK_dead_belowbreve = 0xfe6b, + XK_dead_belowdiaeresis = 0xfe6c, + XK_dead_invertedbreve = 0xfe6d, + XK_dead_belowcomma = 0xfe6e, + XK_dead_currency = 0xfe6f, + XK_dead_lowline = 0xfe90, + XK_dead_aboveverticalline = 0xfe91, + XK_dead_belowverticalline = 0xfe92, + XK_dead_longsolidusoverlay = 0xfe93, + XK_dead_a = 0xfe80, + XK_dead_A = 0xfe81, + XK_dead_e = 0xfe82, + XK_dead_E = 0xfe83, + XK_dead_i = 0xfe84, + XK_dead_I = 0xfe85, + XK_dead_o = 0xfe86, + XK_dead_O = 0xfe87, + XK_dead_u = 0xfe88, + XK_dead_U = 0xfe89, + XK_dead_small_schwa = 0xfe8a, + XK_dead_capital_schwa = 0xfe8b, + XK_dead_greek = 0xfe8c, + XK_First_Virtual_Screen = 0xfed0, + XK_Prev_Virtual_Screen = 0xfed1, + XK_Next_Virtual_Screen = 0xfed2, + XK_Last_Virtual_Screen = 0xfed4, + XK_Terminate_Server = 0xfed5, + XK_AccessX_Enable = 0xfe70, + XK_AccessX_Feedback_Enable = 0xfe71, + XK_RepeatKeys_Enable = 0xfe72, + XK_SlowKeys_Enable = 0xfe73, + XK_BounceKeys_Enable = 0xfe74, + XK_StickyKeys_Enable = 0xfe75, + XK_MouseKeys_Enable = 0xfe76, + XK_MouseKeys_Accel_Enable = 0xfe77, + XK_Overlay1_Enable = 0xfe78, + XK_Overlay2_Enable = 0xfe79, + XK_AudibleBell_Enable = 0xfe7a, + XK_Pointer_Left = 0xfee0, + XK_Pointer_Right = 0xfee1, + XK_Pointer_Up = 0xfee2, + XK_Pointer_Down = 0xfee3, + XK_Pointer_UpLeft = 0xfee4, + XK_Pointer_UpRight = 0xfee5, + XK_Pointer_DownLeft = 0xfee6, + XK_Pointer_DownRight = 0xfee7, + XK_Pointer_Button_Dflt = 0xfee8, + XK_Pointer_Button1 = 0xfee9, + XK_Pointer_Button2 = 0xfeea, + XK_Pointer_Button3 = 0xfeeb, + XK_Pointer_Button4 = 0xfeec, + XK_Pointer_Button5 = 0xfeed, + XK_Pointer_DblClick_Dflt = 0xfeee, + XK_Pointer_DblClick1 = 0xfeef, + XK_Pointer_DblClick2 = 0xfef0, + XK_Pointer_DblClick3 = 0xfef1, + XK_Pointer_DblClick4 = 0xfef2, + XK_Pointer_DblClick5 = 0xfef3, + XK_Pointer_Drag_Dflt = 0xfef4, + XK_Pointer_Drag1 = 0xfef5, + XK_Pointer_Drag2 = 0xfef6, + XK_Pointer_Drag3 = 0xfef7, + XK_Pointer_Drag4 = 0xfef8, + XK_Pointer_Drag5 = 0xfefd, + XK_Pointer_EnableKeys = 0xfef9, + XK_Pointer_Accelerate = 0xfefa, + XK_Pointer_DfltBtnNext = 0xfefb, + XK_Pointer_DfltBtnPrev = 0xfefc, + XK_ch = 0xfea0, + XK_Ch = 0xfea1, + XK_CH = 0xfea2, + XK_c_h = 0xfea3, + XK_C_h = 0xfea4, + XK_C_H = 0xfea5, + XK_3270_Duplicate = 0xfd01, + XK_3270_FieldMark = 0xfd02, + XK_3270_Right2 = 0xfd03, + XK_3270_Left2 = 0xfd04, + XK_3270_BackTab = 0xfd05, + XK_3270_EraseEOF = 0xfd06, + XK_3270_EraseInput = 0xfd07, + XK_3270_Reset = 0xfd08, + XK_3270_Quit = 0xfd09, + XK_3270_PA1 = 0xfd0a, + XK_3270_PA2 = 0xfd0b, + XK_3270_PA3 = 0xfd0c, + XK_3270_Test = 0xfd0d, + XK_3270_Attn = 0xfd0e, + XK_3270_CursorBlink = 0xfd0f, + XK_3270_AltCursor = 0xfd10, + XK_3270_KeyClick = 0xfd11, + XK_3270_Jump = 0xfd12, + XK_3270_Ident = 0xfd13, + XK_3270_Rule = 0xfd14, + XK_3270_Copy = 0xfd15, + XK_3270_Play = 0xfd16, + XK_3270_Setup = 0xfd17, + XK_3270_Record = 0xfd18, + XK_3270_ChangeScreen = 0xfd19, + XK_3270_DeleteWord = 0xfd1a, + XK_3270_ExSelect = 0xfd1b, + XK_3270_CursorSelect = 0xfd1c, + XK_3270_PrintScreen = 0xfd1d, + XK_3270_Enter = 0xfd1e, + XK_space = 0x0020, + XK_exclam = 0x0021, + XK_quotedbl = 0x0022, + XK_numbersign = 0x0023, + XK_dollar = 0x0024, + XK_percent = 0x0025, + XK_ampersand = 0x0026, + XK_apostrophe = 0x0027, + XK_quoteright = 0x0027, + XK_parenleft = 0x0028, + XK_parenright = 0x0029, + XK_asterisk = 0x002a, + XK_plus = 0x002b, + XK_comma = 0x002c, + XK_minus = 0x002d, + XK_period = 0x002e, + XK_slash = 0x002f, + XK_0 = 0x0030, + XK_1 = 0x0031, + XK_2 = 0x0032, + XK_3 = 0x0033, + XK_4 = 0x0034, + XK_5 = 0x0035, + XK_6 = 0x0036, + XK_7 = 0x0037, + XK_8 = 0x0038, + XK_9 = 0x0039, + XK_colon = 0x003a, + XK_semicolon = 0x003b, + XK_less = 0x003c, + XK_equal = 0x003d, + XK_greater = 0x003e, + XK_question = 0x003f, + XK_at = 0x0040, + XK_A = 0x0041, + XK_B = 0x0042, + XK_C = 0x0043, + XK_D = 0x0044, + XK_E = 0x0045, + XK_F = 0x0046, + XK_G = 0x0047, + XK_H = 0x0048, + XK_I = 0x0049, + XK_J = 0x004a, + XK_K = 0x004b, + XK_L = 0x004c, + XK_M = 0x004d, + XK_N = 0x004e, + XK_O = 0x004f, + XK_P = 0x0050, + XK_Q = 0x0051, + XK_R = 0x0052, + XK_S = 0x0053, + XK_T = 0x0054, + XK_U = 0x0055, + XK_V = 0x0056, + XK_W = 0x0057, + XK_X = 0x0058, + XK_Y = 0x0059, + XK_Z = 0x005a, + XK_bracketleft = 0x005b, + XK_backslash = 0x005c, + XK_bracketright = 0x005d, + XK_asciicircum = 0x005e, + XK_underscore = 0x005f, + XK_grave = 0x0060, + XK_quoteleft = 0x0060, + XK_a = 0x0061, + XK_b = 0x0062, + XK_c = 0x0063, + XK_d = 0x0064, + XK_e = 0x0065, + XK_f = 0x0066, + XK_g = 0x0067, + XK_h = 0x0068, + XK_i = 0x0069, + XK_j = 0x006a, + XK_k = 0x006b, + XK_l = 0x006c, + XK_m = 0x006d, + XK_n = 0x006e, + XK_o = 0x006f, + XK_p = 0x0070, + XK_q = 0x0071, + XK_r = 0x0072, + XK_s = 0x0073, + XK_t = 0x0074, + XK_u = 0x0075, + XK_v = 0x0076, + XK_w = 0x0077, + XK_x = 0x0078, + XK_y = 0x0079, + XK_z = 0x007a, + XK_braceleft = 0x007b, + XK_bar = 0x007c, + XK_braceright = 0x007d, + XK_asciitilde = 0x007e, + XK_nobreakspace = 0x00a0, + XK_exclamdown = 0x00a1, + XK_cent = 0x00a2, + XK_sterling = 0x00a3, + XK_currency = 0x00a4, + XK_yen = 0x00a5, + XK_brokenbar = 0x00a6, + XK_section = 0x00a7, + XK_diaeresis = 0x00a8, + XK_copyright = 0x00a9, + XK_ordfeminine = 0x00aa, + XK_guillemotleft = 0x00ab, + XK_notsign = 0x00ac, + XK_hyphen = 0x00ad, + XK_registered = 0x00ae, + XK_macron = 0x00af, + XK_degree = 0x00b0, + XK_plusminus = 0x00b1, + XK_twosuperior = 0x00b2, + XK_threesuperior = 0x00b3, + XK_acute = 0x00b4, + XK_mu = 0x00b5, + XK_paragraph = 0x00b6, + XK_periodcentered = 0x00b7, + XK_cedilla = 0x00b8, + XK_onesuperior = 0x00b9, + XK_masculine = 0x00ba, + XK_guillemotright = 0x00bb, + XK_onequarter = 0x00bc, + XK_onehalf = 0x00bd, + XK_threequarters = 0x00be, + XK_questiondown = 0x00bf, + XK_Agrave = 0x00c0, + XK_Aacute = 0x00c1, + XK_Acircumflex = 0x00c2, + XK_Atilde = 0x00c3, + XK_Adiaeresis = 0x00c4, + XK_Aring = 0x00c5, + XK_AE = 0x00c6, + XK_Ccedilla = 0x00c7, + XK_Egrave = 0x00c8, + XK_Eacute = 0x00c9, + XK_Ecircumflex = 0x00ca, + XK_Ediaeresis = 0x00cb, + XK_Igrave = 0x00cc, + XK_Iacute = 0x00cd, + XK_Icircumflex = 0x00ce, + XK_Idiaeresis = 0x00cf, + XK_ETH = 0x00d0, + XK_Eth = 0x00d0, + XK_Ntilde = 0x00d1, + XK_Ograve = 0x00d2, + XK_Oacute = 0x00d3, + XK_Ocircumflex = 0x00d4, + XK_Otilde = 0x00d5, + XK_Odiaeresis = 0x00d6, + XK_multiply = 0x00d7, + XK_Oslash = 0x00d8, + XK_Ooblique = 0x00d8, + XK_Ugrave = 0x00d9, + XK_Uacute = 0x00da, + XK_Ucircumflex = 0x00db, + XK_Udiaeresis = 0x00dc, + XK_Yacute = 0x00dd, + XK_THORN = 0x00de, + XK_Thorn = 0x00de, + XK_ssharp = 0x00df, + XK_agrave = 0x00e0, + XK_aacute = 0x00e1, + XK_acircumflex = 0x00e2, + XK_atilde = 0x00e3, + XK_adiaeresis = 0x00e4, + XK_aring = 0x00e5, + XK_ae = 0x00e6, + XK_ccedilla = 0x00e7, + XK_egrave = 0x00e8, + XK_eacute = 0x00e9, + XK_ecircumflex = 0x00ea, + XK_ediaeresis = 0x00eb, + XK_igrave = 0x00ec, + XK_iacute = 0x00ed, + XK_icircumflex = 0x00ee, + XK_idiaeresis = 0x00ef, + XK_eth = 0x00f0, + XK_ntilde = 0x00f1, + XK_ograve = 0x00f2, + XK_oacute = 0x00f3, + XK_ocircumflex = 0x00f4, + XK_otilde = 0x00f5, + XK_odiaeresis = 0x00f6, + XK_division = 0x00f7, + XK_oslash = 0x00f8, + XK_ooblique = 0x00f8, + XK_ugrave = 0x00f9, + XK_uacute = 0x00fa, + XK_ucircumflex = 0x00fb, + XK_udiaeresis = 0x00fc, + XK_yacute = 0x00fd, + XK_thorn = 0x00fe, + XK_ydiaeresis = 0x00ff, + XK_Aogonek = 0x01a1, + XK_breve = 0x01a2, + XK_Lstroke = 0x01a3, + XK_Lcaron = 0x01a5, + XK_Sacute = 0x01a6, + XK_Scaron = 0x01a9, + XK_Scedilla = 0x01aa, + XK_Tcaron = 0x01ab, + XK_Zacute = 0x01ac, + XK_Zcaron = 0x01ae, + XK_Zabovedot = 0x01af, + XK_aogonek = 0x01b1, + XK_ogonek = 0x01b2, + XK_lstroke = 0x01b3, + XK_lcaron = 0x01b5, + XK_sacute = 0x01b6, + XK_caron = 0x01b7, + XK_scaron = 0x01b9, + XK_scedilla = 0x01ba, + XK_tcaron = 0x01bb, + XK_zacute = 0x01bc, + XK_doubleacute = 0x01bd, + XK_zcaron = 0x01be, + XK_zabovedot = 0x01bf, + XK_Racute = 0x01c0, + XK_Abreve = 0x01c3, + XK_Lacute = 0x01c5, + XK_Cacute = 0x01c6, + XK_Ccaron = 0x01c8, + XK_Eogonek = 0x01ca, + XK_Ecaron = 0x01cc, + XK_Dcaron = 0x01cf, + XK_Dstroke = 0x01d0, + XK_Nacute = 0x01d1, + XK_Ncaron = 0x01d2, + XK_Odoubleacute = 0x01d5, + XK_Rcaron = 0x01d8, + XK_Uring = 0x01d9, + XK_Udoubleacute = 0x01db, + XK_Tcedilla = 0x01de, + XK_racute = 0x01e0, + XK_abreve = 0x01e3, + XK_lacute = 0x01e5, + XK_cacute = 0x01e6, + XK_ccaron = 0x01e8, + XK_eogonek = 0x01ea, + XK_ecaron = 0x01ec, + XK_dcaron = 0x01ef, + XK_dstroke = 0x01f0, + XK_nacute = 0x01f1, + XK_ncaron = 0x01f2, + XK_odoubleacute = 0x01f5, + XK_rcaron = 0x01f8, + XK_uring = 0x01f9, + XK_udoubleacute = 0x01fb, + XK_tcedilla = 0x01fe, + XK_abovedot = 0x01ff, + XK_Hstroke = 0x02a1, + XK_Hcircumflex = 0x02a6, + XK_Iabovedot = 0x02a9, + XK_Gbreve = 0x02ab, + XK_Jcircumflex = 0x02ac, + XK_hstroke = 0x02b1, + XK_hcircumflex = 0x02b6, + XK_idotless = 0x02b9, + XK_gbreve = 0x02bb, + XK_jcircumflex = 0x02bc, + XK_Cabovedot = 0x02c5, + XK_Ccircumflex = 0x02c6, + XK_Gabovedot = 0x02d5, + XK_Gcircumflex = 0x02d8, + XK_Ubreve = 0x02dd, + XK_Scircumflex = 0x02de, + XK_cabovedot = 0x02e5, + XK_ccircumflex = 0x02e6, + XK_gabovedot = 0x02f5, + XK_gcircumflex = 0x02f8, + XK_ubreve = 0x02fd, + XK_scircumflex = 0x02fe, + XK_kra = 0x03a2, + XK_kappa = 0x03a2, + XK_Rcedilla = 0x03a3, + XK_Itilde = 0x03a5, + XK_Lcedilla = 0x03a6, + XK_Emacron = 0x03aa, + XK_Gcedilla = 0x03ab, + XK_Tslash = 0x03ac, + XK_rcedilla = 0x03b3, + XK_itilde = 0x03b5, + XK_lcedilla = 0x03b6, + XK_emacron = 0x03ba, + XK_gcedilla = 0x03bb, + XK_tslash = 0x03bc, + XK_ENG = 0x03bd, + XK_eng = 0x03bf, + XK_Amacron = 0x03c0, + XK_Iogonek = 0x03c7, + XK_Eabovedot = 0x03cc, + XK_Imacron = 0x03cf, + XK_Ncedilla = 0x03d1, + XK_Omacron = 0x03d2, + XK_Kcedilla = 0x03d3, + XK_Uogonek = 0x03d9, + XK_Utilde = 0x03dd, + XK_Umacron = 0x03de, + XK_amacron = 0x03e0, + XK_iogonek = 0x03e7, + XK_eabovedot = 0x03ec, + XK_imacron = 0x03ef, + XK_ncedilla = 0x03f1, + XK_omacron = 0x03f2, + XK_kcedilla = 0x03f3, + XK_uogonek = 0x03f9, + XK_utilde = 0x03fd, + XK_umacron = 0x03fe, + XK_Wcircumflex = 0x1000174, + XK_wcircumflex = 0x1000175, + XK_Ycircumflex = 0x1000176, + XK_ycircumflex = 0x1000177, + XK_Babovedot = 0x1001e02, + XK_babovedot = 0x1001e03, + XK_Dabovedot = 0x1001e0a, + XK_dabovedot = 0x1001e0b, + XK_Fabovedot = 0x1001e1e, + XK_fabovedot = 0x1001e1f, + XK_Mabovedot = 0x1001e40, + XK_mabovedot = 0x1001e41, + XK_Pabovedot = 0x1001e56, + XK_pabovedot = 0x1001e57, + XK_Sabovedot = 0x1001e60, + XK_sabovedot = 0x1001e61, + XK_Tabovedot = 0x1001e6a, + XK_tabovedot = 0x1001e6b, + XK_Wgrave = 0x1001e80, + XK_wgrave = 0x1001e81, + XK_Wacute = 0x1001e82, + XK_wacute = 0x1001e83, + XK_Wdiaeresis = 0x1001e84, + XK_wdiaeresis = 0x1001e85, + XK_Ygrave = 0x1001ef2, + XK_ygrave = 0x1001ef3, + XK_OE = 0x13bc, + XK_oe = 0x13bd, + XK_Ydiaeresis = 0x13be, + XK_overline = 0x047e, + XK_kana_fullstop = 0x04a1, + XK_kana_openingbracket = 0x04a2, + XK_kana_closingbracket = 0x04a3, + XK_kana_comma = 0x04a4, + XK_kana_conjunctive = 0x04a5, + XK_kana_middledot = 0x04a5, + XK_kana_WO = 0x04a6, + XK_kana_a = 0x04a7, + XK_kana_i = 0x04a8, + XK_kana_u = 0x04a9, + XK_kana_e = 0x04aa, + XK_kana_o = 0x04ab, + XK_kana_ya = 0x04ac, + XK_kana_yu = 0x04ad, + XK_kana_yo = 0x04ae, + XK_kana_tsu = 0x04af, + XK_kana_tu = 0x04af, + XK_prolongedsound = 0x04b0, + XK_kana_A = 0x04b1, + XK_kana_I = 0x04b2, + XK_kana_U = 0x04b3, + XK_kana_E = 0x04b4, + XK_kana_O = 0x04b5, + XK_kana_KA = 0x04b6, + XK_kana_KI = 0x04b7, + XK_kana_KU = 0x04b8, + XK_kana_KE = 0x04b9, + XK_kana_KO = 0x04ba, + XK_kana_SA = 0x04bb, + XK_kana_SHI = 0x04bc, + XK_kana_SU = 0x04bd, + XK_kana_SE = 0x04be, + XK_kana_SO = 0x04bf, + XK_kana_TA = 0x04c0, + XK_kana_CHI = 0x04c1, + XK_kana_TI = 0x04c1, + XK_kana_TSU = 0x04c2, + XK_kana_TU = 0x04c2, + XK_kana_TE = 0x04c3, + XK_kana_TO = 0x04c4, + XK_kana_NA = 0x04c5, + XK_kana_NI = 0x04c6, + XK_kana_NU = 0x04c7, + XK_kana_NE = 0x04c8, + XK_kana_NO = 0x04c9, + XK_kana_HA = 0x04ca, + XK_kana_HI = 0x04cb, + XK_kana_FU = 0x04cc, + XK_kana_HU = 0x04cc, + XK_kana_HE = 0x04cd, + XK_kana_HO = 0x04ce, + XK_kana_MA = 0x04cf, + XK_kana_MI = 0x04d0, + XK_kana_MU = 0x04d1, + XK_kana_ME = 0x04d2, + XK_kana_MO = 0x04d3, + XK_kana_YA = 0x04d4, + XK_kana_YU = 0x04d5, + XK_kana_YO = 0x04d6, + XK_kana_RA = 0x04d7, + XK_kana_RI = 0x04d8, + XK_kana_RU = 0x04d9, + XK_kana_RE = 0x04da, + XK_kana_RO = 0x04db, + XK_kana_WA = 0x04dc, + XK_kana_N = 0x04dd, + XK_voicedsound = 0x04de, + XK_semivoicedsound = 0x04df, + XK_kana_switch = 0xff7e, + XK_Farsi_0 = 0x10006f0, + XK_Farsi_1 = 0x10006f1, + XK_Farsi_2 = 0x10006f2, + XK_Farsi_3 = 0x10006f3, + XK_Farsi_4 = 0x10006f4, + XK_Farsi_5 = 0x10006f5, + XK_Farsi_6 = 0x10006f6, + XK_Farsi_7 = 0x10006f7, + XK_Farsi_8 = 0x10006f8, + XK_Farsi_9 = 0x10006f9, + XK_Arabic_percent = 0x100066a, + XK_Arabic_superscript_alef = 0x1000670, + XK_Arabic_tteh = 0x1000679, + XK_Arabic_peh = 0x100067e, + XK_Arabic_tcheh = 0x1000686, + XK_Arabic_ddal = 0x1000688, + XK_Arabic_rreh = 0x1000691, + XK_Arabic_comma = 0x05ac, + XK_Arabic_fullstop = 0x10006d4, + XK_Arabic_0 = 0x1000660, + XK_Arabic_1 = 0x1000661, + XK_Arabic_2 = 0x1000662, + XK_Arabic_3 = 0x1000663, + XK_Arabic_4 = 0x1000664, + XK_Arabic_5 = 0x1000665, + XK_Arabic_6 = 0x1000666, + XK_Arabic_7 = 0x1000667, + XK_Arabic_8 = 0x1000668, + XK_Arabic_9 = 0x1000669, + XK_Arabic_semicolon = 0x05bb, + XK_Arabic_question_mark = 0x05bf, + XK_Arabic_hamza = 0x05c1, + XK_Arabic_maddaonalef = 0x05c2, + XK_Arabic_hamzaonalef = 0x05c3, + XK_Arabic_hamzaonwaw = 0x05c4, + XK_Arabic_hamzaunderalef = 0x05c5, + XK_Arabic_hamzaonyeh = 0x05c6, + XK_Arabic_alef = 0x05c7, + XK_Arabic_beh = 0x05c8, + XK_Arabic_tehmarbuta = 0x05c9, + XK_Arabic_teh = 0x05ca, + XK_Arabic_theh = 0x05cb, + XK_Arabic_jeem = 0x05cc, + XK_Arabic_hah = 0x05cd, + XK_Arabic_khah = 0x05ce, + XK_Arabic_dal = 0x05cf, + XK_Arabic_thal = 0x05d0, + XK_Arabic_ra = 0x05d1, + XK_Arabic_zain = 0x05d2, + XK_Arabic_seen = 0x05d3, + XK_Arabic_sheen = 0x05d4, + XK_Arabic_sad = 0x05d5, + XK_Arabic_dad = 0x05d6, + XK_Arabic_tah = 0x05d7, + XK_Arabic_zah = 0x05d8, + XK_Arabic_ain = 0x05d9, + XK_Arabic_ghain = 0x05da, + XK_Arabic_tatweel = 0x05e0, + XK_Arabic_feh = 0x05e1, + XK_Arabic_qaf = 0x05e2, + XK_Arabic_kaf = 0x05e3, + XK_Arabic_lam = 0x05e4, + XK_Arabic_meem = 0x05e5, + XK_Arabic_noon = 0x05e6, + XK_Arabic_ha = 0x05e7, + XK_Arabic_heh = 0x05e7, + XK_Arabic_waw = 0x05e8, + XK_Arabic_alefmaksura = 0x05e9, + XK_Arabic_yeh = 0x05ea, + XK_Arabic_fathatan = 0x05eb, + XK_Arabic_dammatan = 0x05ec, + XK_Arabic_kasratan = 0x05ed, + XK_Arabic_fatha = 0x05ee, + XK_Arabic_damma = 0x05ef, + XK_Arabic_kasra = 0x05f0, + XK_Arabic_shadda = 0x05f1, + XK_Arabic_sukun = 0x05f2, + XK_Arabic_madda_above = 0x1000653, + XK_Arabic_hamza_above = 0x1000654, + XK_Arabic_hamza_below = 0x1000655, + XK_Arabic_jeh = 0x1000698, + XK_Arabic_veh = 0x10006a4, + XK_Arabic_keheh = 0x10006a9, + XK_Arabic_gaf = 0x10006af, + XK_Arabic_noon_ghunna = 0x10006ba, + XK_Arabic_heh_doachashmee = 0x10006be, + XK_Farsi_yeh = 0x10006cc, + XK_Arabic_farsi_yeh = 0x10006cc, + XK_Arabic_yeh_baree = 0x10006d2, + XK_Arabic_heh_goal = 0x10006c1, + XK_Arabic_switch = 0xff7e, + XK_Cyrillic_GHE_bar = 0x1000492, + XK_Cyrillic_ghe_bar = 0x1000493, + XK_Cyrillic_ZHE_descender = 0x1000496, + XK_Cyrillic_zhe_descender = 0x1000497, + XK_Cyrillic_KA_descender = 0x100049a, + XK_Cyrillic_ka_descender = 0x100049b, + XK_Cyrillic_KA_vertstroke = 0x100049c, + XK_Cyrillic_ka_vertstroke = 0x100049d, + XK_Cyrillic_EN_descender = 0x10004a2, + XK_Cyrillic_en_descender = 0x10004a3, + XK_Cyrillic_U_straight = 0x10004ae, + XK_Cyrillic_u_straight = 0x10004af, + XK_Cyrillic_U_straight_bar = 0x10004b0, + XK_Cyrillic_u_straight_bar = 0x10004b1, + XK_Cyrillic_HA_descender = 0x10004b2, + XK_Cyrillic_ha_descender = 0x10004b3, + XK_Cyrillic_CHE_descender = 0x10004b6, + XK_Cyrillic_che_descender = 0x10004b7, + XK_Cyrillic_CHE_vertstroke = 0x10004b8, + XK_Cyrillic_che_vertstroke = 0x10004b9, + XK_Cyrillic_SHHA = 0x10004ba, + XK_Cyrillic_shha = 0x10004bb, + XK_Cyrillic_SCHWA = 0x10004d8, + XK_Cyrillic_schwa = 0x10004d9, + XK_Cyrillic_I_macron = 0x10004e2, + XK_Cyrillic_i_macron = 0x10004e3, + XK_Cyrillic_O_bar = 0x10004e8, + XK_Cyrillic_o_bar = 0x10004e9, + XK_Cyrillic_U_macron = 0x10004ee, + XK_Cyrillic_u_macron = 0x10004ef, + XK_Serbian_dje = 0x06a1, + XK_Macedonia_gje = 0x06a2, + XK_Cyrillic_io = 0x06a3, + XK_Ukrainian_ie = 0x06a4, + XK_Ukranian_je = 0x06a4, + XK_Macedonia_dse = 0x06a5, + XK_Ukrainian_i = 0x06a6, + XK_Ukranian_i = 0x06a6, + XK_Ukrainian_yi = 0x06a7, + XK_Ukranian_yi = 0x06a7, + XK_Cyrillic_je = 0x06a8, + XK_Serbian_je = 0x06a8, + XK_Cyrillic_lje = 0x06a9, + XK_Serbian_lje = 0x06a9, + XK_Cyrillic_nje = 0x06aa, + XK_Serbian_nje = 0x06aa, + XK_Serbian_tshe = 0x06ab, + XK_Macedonia_kje = 0x06ac, + XK_Ukrainian_ghe_with_upturn = 0x06ad, + XK_Byelorussian_shortu = 0x06ae, + XK_Cyrillic_dzhe = 0x06af, + XK_Serbian_dze = 0x06af, + XK_numerosign = 0x06b0, + XK_Serbian_DJE = 0x06b1, + XK_Macedonia_GJE = 0x06b2, + XK_Cyrillic_IO = 0x06b3, + XK_Ukrainian_IE = 0x06b4, + XK_Ukranian_JE = 0x06b4, + XK_Macedonia_DSE = 0x06b5, + XK_Ukrainian_I = 0x06b6, + XK_Ukranian_I = 0x06b6, + XK_Ukrainian_YI = 0x06b7, + XK_Ukranian_YI = 0x06b7, + XK_Cyrillic_JE = 0x06b8, + XK_Serbian_JE = 0x06b8, + XK_Cyrillic_LJE = 0x06b9, + XK_Serbian_LJE = 0x06b9, + XK_Cyrillic_NJE = 0x06ba, + XK_Serbian_NJE = 0x06ba, + XK_Serbian_TSHE = 0x06bb, + XK_Macedonia_KJE = 0x06bc, + XK_Ukrainian_GHE_WITH_UPTURN = 0x06bd, + XK_Byelorussian_SHORTU = 0x06be, + XK_Cyrillic_DZHE = 0x06bf, + XK_Serbian_DZE = 0x06bf, + XK_Cyrillic_yu = 0x06c0, + XK_Cyrillic_a = 0x06c1, + XK_Cyrillic_be = 0x06c2, + XK_Cyrillic_tse = 0x06c3, + XK_Cyrillic_de = 0x06c4, + XK_Cyrillic_ie = 0x06c5, + XK_Cyrillic_ef = 0x06c6, + XK_Cyrillic_ghe = 0x06c7, + XK_Cyrillic_ha = 0x06c8, + XK_Cyrillic_i = 0x06c9, + XK_Cyrillic_shorti = 0x06ca, + XK_Cyrillic_ka = 0x06cb, + XK_Cyrillic_el = 0x06cc, + XK_Cyrillic_em = 0x06cd, + XK_Cyrillic_en = 0x06ce, + XK_Cyrillic_o = 0x06cf, + XK_Cyrillic_pe = 0x06d0, + XK_Cyrillic_ya = 0x06d1, + XK_Cyrillic_er = 0x06d2, + XK_Cyrillic_es = 0x06d3, + XK_Cyrillic_te = 0x06d4, + XK_Cyrillic_u = 0x06d5, + XK_Cyrillic_zhe = 0x06d6, + XK_Cyrillic_ve = 0x06d7, + XK_Cyrillic_softsign = 0x06d8, + XK_Cyrillic_yeru = 0x06d9, + XK_Cyrillic_ze = 0x06da, + XK_Cyrillic_sha = 0x06db, + XK_Cyrillic_e = 0x06dc, + XK_Cyrillic_shcha = 0x06dd, + XK_Cyrillic_che = 0x06de, + XK_Cyrillic_hardsign = 0x06df, + XK_Cyrillic_YU = 0x06e0, + XK_Cyrillic_A = 0x06e1, + XK_Cyrillic_BE = 0x06e2, + XK_Cyrillic_TSE = 0x06e3, + XK_Cyrillic_DE = 0x06e4, + XK_Cyrillic_IE = 0x06e5, + XK_Cyrillic_EF = 0x06e6, + XK_Cyrillic_GHE = 0x06e7, + XK_Cyrillic_HA = 0x06e8, + XK_Cyrillic_I = 0x06e9, + XK_Cyrillic_SHORTI = 0x06ea, + XK_Cyrillic_KA = 0x06eb, + XK_Cyrillic_EL = 0x06ec, + XK_Cyrillic_EM = 0x06ed, + XK_Cyrillic_EN = 0x06ee, + XK_Cyrillic_O = 0x06ef, + XK_Cyrillic_PE = 0x06f0, + XK_Cyrillic_YA = 0x06f1, + XK_Cyrillic_ER = 0x06f2, + XK_Cyrillic_ES = 0x06f3, + XK_Cyrillic_TE = 0x06f4, + XK_Cyrillic_U = 0x06f5, + XK_Cyrillic_ZHE = 0x06f6, + XK_Cyrillic_VE = 0x06f7, + XK_Cyrillic_SOFTSIGN = 0x06f8, + XK_Cyrillic_YERU = 0x06f9, + XK_Cyrillic_ZE = 0x06fa, + XK_Cyrillic_SHA = 0x06fb, + XK_Cyrillic_E = 0x06fc, + XK_Cyrillic_SHCHA = 0x06fd, + XK_Cyrillic_CHE = 0x06fe, + XK_Cyrillic_HARDSIGN = 0x06ff, + XK_Greek_ALPHAaccent = 0x07a1, + XK_Greek_EPSILONaccent = 0x07a2, + XK_Greek_ETAaccent = 0x07a3, + XK_Greek_IOTAaccent = 0x07a4, + XK_Greek_IOTAdieresis = 0x07a5, + XK_Greek_IOTAdiaeresis = 0x07a5, + XK_Greek_OMICRONaccent = 0x07a7, + XK_Greek_UPSILONaccent = 0x07a8, + XK_Greek_UPSILONdieresis = 0x07a9, + XK_Greek_OMEGAaccent = 0x07ab, + XK_Greek_accentdieresis = 0x07ae, + XK_Greek_horizbar = 0x07af, + XK_Greek_alphaaccent = 0x07b1, + XK_Greek_epsilonaccent = 0x07b2, + XK_Greek_etaaccent = 0x07b3, + XK_Greek_iotaaccent = 0x07b4, + XK_Greek_iotadieresis = 0x07b5, + XK_Greek_iotaaccentdieresis = 0x07b6, + XK_Greek_omicronaccent = 0x07b7, + XK_Greek_upsilonaccent = 0x07b8, + XK_Greek_upsilondieresis = 0x07b9, + XK_Greek_upsilonaccentdieresis = 0x07ba, + XK_Greek_omegaaccent = 0x07bb, + XK_Greek_ALPHA = 0x07c1, + XK_Greek_BETA = 0x07c2, + XK_Greek_GAMMA = 0x07c3, + XK_Greek_DELTA = 0x07c4, + XK_Greek_EPSILON = 0x07c5, + XK_Greek_ZETA = 0x07c6, + XK_Greek_ETA = 0x07c7, + XK_Greek_THETA = 0x07c8, + XK_Greek_IOTA = 0x07c9, + XK_Greek_KAPPA = 0x07ca, + XK_Greek_LAMDA = 0x07cb, + XK_Greek_LAMBDA = 0x07cb, + XK_Greek_MU = 0x07cc, + XK_Greek_NU = 0x07cd, + XK_Greek_XI = 0x07ce, + XK_Greek_OMICRON = 0x07cf, + XK_Greek_PI = 0x07d0, + XK_Greek_RHO = 0x07d1, + XK_Greek_SIGMA = 0x07d2, + XK_Greek_TAU = 0x07d4, + XK_Greek_UPSILON = 0x07d5, + XK_Greek_PHI = 0x07d6, + XK_Greek_CHI = 0x07d7, + XK_Greek_PSI = 0x07d8, + XK_Greek_OMEGA = 0x07d9, + XK_Greek_alpha = 0x07e1, + XK_Greek_beta = 0x07e2, + XK_Greek_gamma = 0x07e3, + XK_Greek_delta = 0x07e4, + XK_Greek_epsilon = 0x07e5, + XK_Greek_zeta = 0x07e6, + XK_Greek_eta = 0x07e7, + XK_Greek_theta = 0x07e8, + XK_Greek_iota = 0x07e9, + XK_Greek_kappa = 0x07ea, + XK_Greek_lamda = 0x07eb, + XK_Greek_lambda = 0x07eb, + XK_Greek_mu = 0x07ec, + XK_Greek_nu = 0x07ed, + XK_Greek_xi = 0x07ee, + XK_Greek_omicron = 0x07ef, + XK_Greek_pi = 0x07f0, + XK_Greek_rho = 0x07f1, + XK_Greek_sigma = 0x07f2, + XK_Greek_finalsmallsigma = 0x07f3, + XK_Greek_tau = 0x07f4, + XK_Greek_upsilon = 0x07f5, + XK_Greek_phi = 0x07f6, + XK_Greek_chi = 0x07f7, + XK_Greek_psi = 0x07f8, + XK_Greek_omega = 0x07f9, + XK_Greek_switch = 0xff7e, + XK_leftradical = 0x08a1, + XK_topleftradical = 0x08a2, + XK_horizconnector = 0x08a3, + XK_topintegral = 0x08a4, + XK_botintegral = 0x08a5, + XK_vertconnector = 0x08a6, + XK_topleftsqbracket = 0x08a7, + XK_botleftsqbracket = 0x08a8, + XK_toprightsqbracket = 0x08a9, + XK_botrightsqbracket = 0x08aa, + XK_topleftparens = 0x08ab, + XK_botleftparens = 0x08ac, + XK_toprightparens = 0x08ad, + XK_botrightparens = 0x08ae, + XK_leftmiddlecurlybrace = 0x08af, + XK_rightmiddlecurlybrace = 0x08b0, + XK_topleftsummation = 0x08b1, + XK_botleftsummation = 0x08b2, + XK_topvertsummationconnector = 0x08b3, + XK_botvertsummationconnector = 0x08b4, + XK_toprightsummation = 0x08b5, + XK_botrightsummation = 0x08b6, + XK_rightmiddlesummation = 0x08b7, + XK_lessthanequal = 0x08bc, + XK_notequal = 0x08bd, + XK_greaterthanequal = 0x08be, + XK_integral = 0x08bf, + XK_therefore = 0x08c0, + XK_variation = 0x08c1, + XK_infinity = 0x08c2, + XK_nabla = 0x08c5, + XK_approximate = 0x08c8, + XK_similarequal = 0x08c9, + XK_ifonlyif = 0x08cd, + XK_implies = 0x08ce, + XK_identical = 0x08cf, + XK_radical = 0x08d6, + XK_includedin = 0x08da, + XK_includes = 0x08db, + XK_intersection = 0x08dc, + XK_union = 0x08dd, + XK_logicaland = 0x08de, + XK_logicalor = 0x08df, + XK_partialderivative = 0x08ef, + XK_function = 0x08f6, + XK_leftarrow = 0x08fb, + XK_uparrow = 0x08fc, + XK_rightarrow = 0x08fd, + XK_downarrow = 0x08fe, + XK_blank = 0x09df, + XK_soliddiamond = 0x09e0, + XK_checkerboard = 0x09e1, + XK_ht = 0x09e2, + XK_ff = 0x09e3, + XK_cr = 0x09e4, + XK_lf = 0x09e5, + XK_nl = 0x09e8, + XK_vt = 0x09e9, + XK_lowrightcorner = 0x09ea, + XK_uprightcorner = 0x09eb, + XK_upleftcorner = 0x09ec, + XK_lowleftcorner = 0x09ed, + XK_crossinglines = 0x09ee, + XK_horizlinescan1 = 0x09ef, + XK_horizlinescan3 = 0x09f0, + XK_horizlinescan5 = 0x09f1, + XK_horizlinescan7 = 0x09f2, + XK_horizlinescan9 = 0x09f3, + XK_leftt = 0x09f4, + XK_rightt = 0x09f5, + XK_bott = 0x09f6, + XK_topt = 0x09f7, + XK_vertbar = 0x09f8, + XK_emspace = 0x0aa1, + XK_enspace = 0x0aa2, + XK_em3space = 0x0aa3, + XK_em4space = 0x0aa4, + XK_digitspace = 0x0aa5, + XK_punctspace = 0x0aa6, + XK_thinspace = 0x0aa7, + XK_hairspace = 0x0aa8, + XK_emdash = 0x0aa9, + XK_endash = 0x0aaa, + XK_signifblank = 0x0aac, + XK_ellipsis = 0x0aae, + XK_doubbaselinedot = 0x0aaf, + XK_onethird = 0x0ab0, + XK_twothirds = 0x0ab1, + XK_onefifth = 0x0ab2, + XK_twofifths = 0x0ab3, + XK_threefifths = 0x0ab4, + XK_fourfifths = 0x0ab5, + XK_onesixth = 0x0ab6, + XK_fivesixths = 0x0ab7, + XK_careof = 0x0ab8, + XK_figdash = 0x0abb, + XK_leftanglebracket = 0x0abc, + XK_decimalpoint = 0x0abd, + XK_rightanglebracket = 0x0abe, + XK_marker = 0x0abf, + XK_oneeighth = 0x0ac3, + XK_threeeighths = 0x0ac4, + XK_fiveeighths = 0x0ac5, + XK_seveneighths = 0x0ac6, + XK_trademark = 0x0ac9, + XK_signaturemark = 0x0aca, + XK_trademarkincircle = 0x0acb, + XK_leftopentriangle = 0x0acc, + XK_rightopentriangle = 0x0acd, + XK_emopencircle = 0x0ace, + XK_emopenrectangle = 0x0acf, + XK_leftsinglequotemark = 0x0ad0, + XK_rightsinglequotemark = 0x0ad1, + XK_leftdoublequotemark = 0x0ad2, + XK_rightdoublequotemark = 0x0ad3, + XK_prescription = 0x0ad4, + XK_permille = 0x0ad5, + XK_minutes = 0x0ad6, + XK_seconds = 0x0ad7, + XK_latincross = 0x0ad9, + XK_hexagram = 0x0ada, + XK_filledrectbullet = 0x0adb, + XK_filledlefttribullet = 0x0adc, + XK_filledrighttribullet = 0x0add, + XK_emfilledcircle = 0x0ade, + XK_emfilledrect = 0x0adf, + XK_enopencircbullet = 0x0ae0, + XK_enopensquarebullet = 0x0ae1, + XK_openrectbullet = 0x0ae2, + XK_opentribulletup = 0x0ae3, + XK_opentribulletdown = 0x0ae4, + XK_openstar = 0x0ae5, + XK_enfilledcircbullet = 0x0ae6, + XK_enfilledsqbullet = 0x0ae7, + XK_filledtribulletup = 0x0ae8, + XK_filledtribulletdown = 0x0ae9, + XK_leftpointer = 0x0aea, + XK_rightpointer = 0x0aeb, + XK_club = 0x0aec, + XK_diamond = 0x0aed, + XK_heart = 0x0aee, + XK_maltesecross = 0x0af0, + XK_dagger = 0x0af1, + XK_doubledagger = 0x0af2, + XK_checkmark = 0x0af3, + XK_ballotcross = 0x0af4, + XK_musicalsharp = 0x0af5, + XK_musicalflat = 0x0af6, + XK_malesymbol = 0x0af7, + XK_femalesymbol = 0x0af8, + XK_telephone = 0x0af9, + XK_telephonerecorder = 0x0afa, + XK_phonographcopyright = 0x0afb, + XK_caret = 0x0afc, + XK_singlelowquotemark = 0x0afd, + XK_doublelowquotemark = 0x0afe, + XK_cursor = 0x0aff, + XK_leftcaret = 0x0ba3, + XK_rightcaret = 0x0ba6, + XK_downcaret = 0x0ba8, + XK_upcaret = 0x0ba9, + XK_overbar = 0x0bc0, + XK_downtack = 0x0bc2, + XK_upshoe = 0x0bc3, + XK_downstile = 0x0bc4, + XK_underbar = 0x0bc6, + XK_jot = 0x0bca, + XK_quad = 0x0bcc, + XK_uptack = 0x0bce, + XK_circle = 0x0bcf, + XK_upstile = 0x0bd3, + XK_downshoe = 0x0bd6, + XK_rightshoe = 0x0bd8, + XK_leftshoe = 0x0bda, + XK_lefttack = 0x0bdc, + XK_righttack = 0x0bfc, + XK_hebrew_doublelowline = 0x0cdf, + XK_hebrew_aleph = 0x0ce0, + XK_hebrew_bet = 0x0ce1, + XK_hebrew_beth = 0x0ce1, + XK_hebrew_gimel = 0x0ce2, + XK_hebrew_gimmel = 0x0ce2, + XK_hebrew_dalet = 0x0ce3, + XK_hebrew_daleth = 0x0ce3, + XK_hebrew_he = 0x0ce4, + XK_hebrew_waw = 0x0ce5, + XK_hebrew_zain = 0x0ce6, + XK_hebrew_zayin = 0x0ce6, + XK_hebrew_chet = 0x0ce7, + XK_hebrew_het = 0x0ce7, + XK_hebrew_tet = 0x0ce8, + XK_hebrew_teth = 0x0ce8, + XK_hebrew_yod = 0x0ce9, + XK_hebrew_finalkaph = 0x0cea, + XK_hebrew_kaph = 0x0ceb, + XK_hebrew_lamed = 0x0cec, + XK_hebrew_finalmem = 0x0ced, + XK_hebrew_mem = 0x0cee, + XK_hebrew_finalnun = 0x0cef, + XK_hebrew_nun = 0x0cf0, + XK_hebrew_samech = 0x0cf1, + XK_hebrew_samekh = 0x0cf1, + XK_hebrew_ayin = 0x0cf2, + XK_hebrew_finalpe = 0x0cf3, + XK_hebrew_pe = 0x0cf4, + XK_hebrew_finalzade = 0x0cf5, + XK_hebrew_finalzadi = 0x0cf5, + XK_hebrew_zade = 0x0cf6, + XK_hebrew_zadi = 0x0cf6, + XK_hebrew_qoph = 0x0cf7, + XK_hebrew_kuf = 0x0cf7, + XK_hebrew_resh = 0x0cf8, + XK_hebrew_shin = 0x0cf9, + XK_hebrew_taw = 0x0cfa, + XK_hebrew_taf = 0x0cfa, + XK_Hebrew_switch = 0xff7e, + XK_Thai_kokai = 0x0da1, + XK_Thai_khokhai = 0x0da2, + XK_Thai_khokhuat = 0x0da3, + XK_Thai_khokhwai = 0x0da4, + XK_Thai_khokhon = 0x0da5, + XK_Thai_khorakhang = 0x0da6, + XK_Thai_ngongu = 0x0da7, + XK_Thai_chochan = 0x0da8, + XK_Thai_choching = 0x0da9, + XK_Thai_chochang = 0x0daa, + XK_Thai_soso = 0x0dab, + XK_Thai_chochoe = 0x0dac, + XK_Thai_yoying = 0x0dad, + XK_Thai_dochada = 0x0dae, + XK_Thai_topatak = 0x0daf, + XK_Thai_thothan = 0x0db0, + XK_Thai_thonangmontho = 0x0db1, + XK_Thai_thophuthao = 0x0db2, + XK_Thai_nonen = 0x0db3, + XK_Thai_dodek = 0x0db4, + XK_Thai_totao = 0x0db5, + XK_Thai_thothung = 0x0db6, + XK_Thai_thothahan = 0x0db7, + XK_Thai_thothong = 0x0db8, + XK_Thai_nonu = 0x0db9, + XK_Thai_bobaimai = 0x0dba, + XK_Thai_popla = 0x0dbb, + XK_Thai_phophung = 0x0dbc, + XK_Thai_fofa = 0x0dbd, + XK_Thai_phophan = 0x0dbe, + XK_Thai_fofan = 0x0dbf, + XK_Thai_phosamphao = 0x0dc0, + XK_Thai_moma = 0x0dc1, + XK_Thai_yoyak = 0x0dc2, + XK_Thai_rorua = 0x0dc3, + XK_Thai_ru = 0x0dc4, + XK_Thai_loling = 0x0dc5, + XK_Thai_lu = 0x0dc6, + XK_Thai_wowaen = 0x0dc7, + XK_Thai_sosala = 0x0dc8, + XK_Thai_sorusi = 0x0dc9, + XK_Thai_sosua = 0x0dca, + XK_Thai_hohip = 0x0dcb, + XK_Thai_lochula = 0x0dcc, + XK_Thai_oang = 0x0dcd, + XK_Thai_honokhuk = 0x0dce, + XK_Thai_paiyannoi = 0x0dcf, + XK_Thai_saraa = 0x0dd0, + XK_Thai_maihanakat = 0x0dd1, + XK_Thai_saraaa = 0x0dd2, + XK_Thai_saraam = 0x0dd3, + XK_Thai_sarai = 0x0dd4, + XK_Thai_saraii = 0x0dd5, + XK_Thai_saraue = 0x0dd6, + XK_Thai_sarauee = 0x0dd7, + XK_Thai_sarau = 0x0dd8, + XK_Thai_sarauu = 0x0dd9, + XK_Thai_phinthu = 0x0dda, + XK_Thai_maihanakat_maitho = 0x0dde, + XK_Thai_baht = 0x0ddf, + XK_Thai_sarae = 0x0de0, + XK_Thai_saraae = 0x0de1, + XK_Thai_sarao = 0x0de2, + XK_Thai_saraaimaimuan = 0x0de3, + XK_Thai_saraaimaimalai = 0x0de4, + XK_Thai_lakkhangyao = 0x0de5, + XK_Thai_maiyamok = 0x0de6, + XK_Thai_maitaikhu = 0x0de7, + XK_Thai_maiek = 0x0de8, + XK_Thai_maitho = 0x0de9, + XK_Thai_maitri = 0x0dea, + XK_Thai_maichattawa = 0x0deb, + XK_Thai_thanthakhat = 0x0dec, + XK_Thai_nikhahit = 0x0ded, + XK_Thai_leksun = 0x0df0, + XK_Thai_leknung = 0x0df1, + XK_Thai_leksong = 0x0df2, + XK_Thai_leksam = 0x0df3, + XK_Thai_leksi = 0x0df4, + XK_Thai_lekha = 0x0df5, + XK_Thai_lekhok = 0x0df6, + XK_Thai_lekchet = 0x0df7, + XK_Thai_lekpaet = 0x0df8, + XK_Thai_lekkao = 0x0df9, + XK_Hangul = 0xff31, + XK_Hangul_Start = 0xff32, + XK_Hangul_End = 0xff33, + XK_Hangul_Hanja = 0xff34, + XK_Hangul_Jamo = 0xff35, + XK_Hangul_Romaja = 0xff36, + XK_Hangul_Codeinput = 0xff37, + XK_Hangul_Jeonja = 0xff38, + XK_Hangul_Banja = 0xff39, + XK_Hangul_PreHanja = 0xff3a, + XK_Hangul_PostHanja = 0xff3b, + XK_Hangul_SingleCandidate = 0xff3c, + XK_Hangul_MultipleCandidate = 0xff3d, + XK_Hangul_PreviousCandidate = 0xff3e, + XK_Hangul_Special = 0xff3f, + XK_Hangul_switch = 0xff7e, + XK_Hangul_Kiyeog = 0x0ea1, + XK_Hangul_SsangKiyeog = 0x0ea2, + XK_Hangul_KiyeogSios = 0x0ea3, + XK_Hangul_Nieun = 0x0ea4, + XK_Hangul_NieunJieuj = 0x0ea5, + XK_Hangul_NieunHieuh = 0x0ea6, + XK_Hangul_Dikeud = 0x0ea7, + XK_Hangul_SsangDikeud = 0x0ea8, + XK_Hangul_Rieul = 0x0ea9, + XK_Hangul_RieulKiyeog = 0x0eaa, + XK_Hangul_RieulMieum = 0x0eab, + XK_Hangul_RieulPieub = 0x0eac, + XK_Hangul_RieulSios = 0x0ead, + XK_Hangul_RieulTieut = 0x0eae, + XK_Hangul_RieulPhieuf = 0x0eaf, + XK_Hangul_RieulHieuh = 0x0eb0, + XK_Hangul_Mieum = 0x0eb1, + XK_Hangul_Pieub = 0x0eb2, + XK_Hangul_SsangPieub = 0x0eb3, + XK_Hangul_PieubSios = 0x0eb4, + XK_Hangul_Sios = 0x0eb5, + XK_Hangul_SsangSios = 0x0eb6, + XK_Hangul_Ieung = 0x0eb7, + XK_Hangul_Jieuj = 0x0eb8, + XK_Hangul_SsangJieuj = 0x0eb9, + XK_Hangul_Cieuc = 0x0eba, + XK_Hangul_Khieuq = 0x0ebb, + XK_Hangul_Tieut = 0x0ebc, + XK_Hangul_Phieuf = 0x0ebd, + XK_Hangul_Hieuh = 0x0ebe, + XK_Hangul_A = 0x0ebf, + XK_Hangul_AE = 0x0ec0, + XK_Hangul_YA = 0x0ec1, + XK_Hangul_YAE = 0x0ec2, + XK_Hangul_EO = 0x0ec3, + XK_Hangul_E = 0x0ec4, + XK_Hangul_YEO = 0x0ec5, + XK_Hangul_YE = 0x0ec6, + XK_Hangul_O = 0x0ec7, + XK_Hangul_WA = 0x0ec8, + XK_Hangul_WAE = 0x0ec9, + XK_Hangul_OE = 0x0eca, + XK_Hangul_YO = 0x0ecb, + XK_Hangul_U = 0x0ecc, + XK_Hangul_WEO = 0x0ecd, + XK_Hangul_WE = 0x0ece, + XK_Hangul_WI = 0x0ecf, + XK_Hangul_YU = 0x0ed0, + XK_Hangul_EU = 0x0ed1, + XK_Hangul_YI = 0x0ed2, + XK_Hangul_I = 0x0ed3, + XK_Hangul_J_Kiyeog = 0x0ed4, + XK_Hangul_J_SsangKiyeog = 0x0ed5, + XK_Hangul_J_KiyeogSios = 0x0ed6, + XK_Hangul_J_Nieun = 0x0ed7, + XK_Hangul_J_NieunJieuj = 0x0ed8, + XK_Hangul_J_NieunHieuh = 0x0ed9, + XK_Hangul_J_Dikeud = 0x0eda, + XK_Hangul_J_Rieul = 0x0edb, + XK_Hangul_J_RieulKiyeog = 0x0edc, + XK_Hangul_J_RieulMieum = 0x0edd, + XK_Hangul_J_RieulPieub = 0x0ede, + XK_Hangul_J_RieulSios = 0x0edf, + XK_Hangul_J_RieulTieut = 0x0ee0, + XK_Hangul_J_RieulPhieuf = 0x0ee1, + XK_Hangul_J_RieulHieuh = 0x0ee2, + XK_Hangul_J_Mieum = 0x0ee3, + XK_Hangul_J_Pieub = 0x0ee4, + XK_Hangul_J_PieubSios = 0x0ee5, + XK_Hangul_J_Sios = 0x0ee6, + XK_Hangul_J_SsangSios = 0x0ee7, + XK_Hangul_J_Ieung = 0x0ee8, + XK_Hangul_J_Jieuj = 0x0ee9, + XK_Hangul_J_Cieuc = 0x0eea, + XK_Hangul_J_Khieuq = 0x0eeb, + XK_Hangul_J_Tieut = 0x0eec, + XK_Hangul_J_Phieuf = 0x0eed, + XK_Hangul_J_Hieuh = 0x0eee, + XK_Hangul_RieulYeorinHieuh = 0x0eef, + XK_Hangul_SunkyeongeumMieum = 0x0ef0, + XK_Hangul_SunkyeongeumPieub = 0x0ef1, + XK_Hangul_PanSios = 0x0ef2, + XK_Hangul_KkogjiDalrinIeung = 0x0ef3, + XK_Hangul_SunkyeongeumPhieuf = 0x0ef4, + XK_Hangul_YeorinHieuh = 0x0ef5, + XK_Hangul_AraeA = 0x0ef6, + XK_Hangul_AraeAE = 0x0ef7, + XK_Hangul_J_PanSios = 0x0ef8, + XK_Hangul_J_KkogjiDalrinIeung = 0x0ef9, + XK_Hangul_J_YeorinHieuh = 0x0efa, + XK_Korean_Won = 0x0eff, + XK_Armenian_ligature_ew = 0x1000587, + XK_Armenian_full_stop = 0x1000589, + XK_Armenian_verjaket = 0x1000589, + XK_Armenian_separation_mark = 0x100055d, + XK_Armenian_but = 0x100055d, + XK_Armenian_hyphen = 0x100058a, + XK_Armenian_yentamna = 0x100058a, + XK_Armenian_exclam = 0x100055c, + XK_Armenian_amanak = 0x100055c, + XK_Armenian_accent = 0x100055b, + XK_Armenian_shesht = 0x100055b, + XK_Armenian_question = 0x100055e, + XK_Armenian_paruyk = 0x100055e, + XK_Armenian_AYB = 0x1000531, + XK_Armenian_ayb = 0x1000561, + XK_Armenian_BEN = 0x1000532, + XK_Armenian_ben = 0x1000562, + XK_Armenian_GIM = 0x1000533, + XK_Armenian_gim = 0x1000563, + XK_Armenian_DA = 0x1000534, + XK_Armenian_da = 0x1000564, + XK_Armenian_YECH = 0x1000535, + XK_Armenian_yech = 0x1000565, + XK_Armenian_ZA = 0x1000536, + XK_Armenian_za = 0x1000566, + XK_Armenian_E = 0x1000537, + XK_Armenian_e = 0x1000567, + XK_Armenian_AT = 0x1000538, + XK_Armenian_at = 0x1000568, + XK_Armenian_TO = 0x1000539, + XK_Armenian_to = 0x1000569, + XK_Armenian_ZHE = 0x100053a, + XK_Armenian_zhe = 0x100056a, + XK_Armenian_INI = 0x100053b, + XK_Armenian_ini = 0x100056b, + XK_Armenian_LYUN = 0x100053c, + XK_Armenian_lyun = 0x100056c, + XK_Armenian_KHE = 0x100053d, + XK_Armenian_khe = 0x100056d, + XK_Armenian_TSA = 0x100053e, + XK_Armenian_tsa = 0x100056e, + XK_Armenian_KEN = 0x100053f, + XK_Armenian_ken = 0x100056f, + XK_Armenian_HO = 0x1000540, + XK_Armenian_ho = 0x1000570, + XK_Armenian_DZA = 0x1000541, + XK_Armenian_dza = 0x1000571, + XK_Armenian_GHAT = 0x1000542, + XK_Armenian_ghat = 0x1000572, + XK_Armenian_TCHE = 0x1000543, + XK_Armenian_tche = 0x1000573, + XK_Armenian_MEN = 0x1000544, + XK_Armenian_men = 0x1000574, + XK_Armenian_HI = 0x1000545, + XK_Armenian_hi = 0x1000575, + XK_Armenian_NU = 0x1000546, + XK_Armenian_nu = 0x1000576, + XK_Armenian_SHA = 0x1000547, + XK_Armenian_sha = 0x1000577, + XK_Armenian_VO = 0x1000548, + XK_Armenian_vo = 0x1000578, + XK_Armenian_CHA = 0x1000549, + XK_Armenian_cha = 0x1000579, + XK_Armenian_PE = 0x100054a, + XK_Armenian_pe = 0x100057a, + XK_Armenian_JE = 0x100054b, + XK_Armenian_je = 0x100057b, + XK_Armenian_RA = 0x100054c, + XK_Armenian_ra = 0x100057c, + XK_Armenian_SE = 0x100054d, + XK_Armenian_se = 0x100057d, + XK_Armenian_VEV = 0x100054e, + XK_Armenian_vev = 0x100057e, + XK_Armenian_TYUN = 0x100054f, + XK_Armenian_tyun = 0x100057f, + XK_Armenian_RE = 0x1000550, + XK_Armenian_re = 0x1000580, + XK_Armenian_TSO = 0x1000551, + XK_Armenian_tso = 0x1000581, + XK_Armenian_VYUN = 0x1000552, + XK_Armenian_vyun = 0x1000582, + XK_Armenian_PYUR = 0x1000553, + XK_Armenian_pyur = 0x1000583, + XK_Armenian_KE = 0x1000554, + XK_Armenian_ke = 0x1000584, + XK_Armenian_O = 0x1000555, + XK_Armenian_o = 0x1000585, + XK_Armenian_FE = 0x1000556, + XK_Armenian_fe = 0x1000586, + XK_Armenian_apostrophe = 0x100055a, + XK_Georgian_an = 0x10010d0, + XK_Georgian_ban = 0x10010d1, + XK_Georgian_gan = 0x10010d2, + XK_Georgian_don = 0x10010d3, + XK_Georgian_en = 0x10010d4, + XK_Georgian_vin = 0x10010d5, + XK_Georgian_zen = 0x10010d6, + XK_Georgian_tan = 0x10010d7, + XK_Georgian_in = 0x10010d8, + XK_Georgian_kan = 0x10010d9, + XK_Georgian_las = 0x10010da, + XK_Georgian_man = 0x10010db, + XK_Georgian_nar = 0x10010dc, + XK_Georgian_on = 0x10010dd, + XK_Georgian_par = 0x10010de, + XK_Georgian_zhar = 0x10010df, + XK_Georgian_rae = 0x10010e0, + XK_Georgian_san = 0x10010e1, + XK_Georgian_tar = 0x10010e2, + XK_Georgian_un = 0x10010e3, + XK_Georgian_phar = 0x10010e4, + XK_Georgian_khar = 0x10010e5, + XK_Georgian_ghan = 0x10010e6, + XK_Georgian_qar = 0x10010e7, + XK_Georgian_shin = 0x10010e8, + XK_Georgian_chin = 0x10010e9, + XK_Georgian_can = 0x10010ea, + XK_Georgian_jil = 0x10010eb, + XK_Georgian_cil = 0x10010ec, + XK_Georgian_char = 0x10010ed, + XK_Georgian_xan = 0x10010ee, + XK_Georgian_jhan = 0x10010ef, + XK_Georgian_hae = 0x10010f0, + XK_Georgian_he = 0x10010f1, + XK_Georgian_hie = 0x10010f2, + XK_Georgian_we = 0x10010f3, + XK_Georgian_har = 0x10010f4, + XK_Georgian_hoe = 0x10010f5, + XK_Georgian_fi = 0x10010f6, + XK_Xabovedot = 0x1001e8a, + XK_Ibreve = 0x100012c, + XK_Zstroke = 0x10001b5, + XK_Gcaron = 0x10001e6, + XK_Ocaron = 0x10001d1, + XK_Obarred = 0x100019f, + XK_xabovedot = 0x1001e8b, + XK_ibreve = 0x100012d, + XK_zstroke = 0x10001b6, + XK_gcaron = 0x10001e7, + XK_ocaron = 0x10001d2, + XK_obarred = 0x1000275, + XK_SCHWA = 0x100018f, + XK_schwa = 0x1000259, + XK_EZH = 0x10001b7, + XK_ezh = 0x1000292, + XK_Lbelowdot = 0x1001e36, + XK_lbelowdot = 0x1001e37, + XK_Abelowdot = 0x1001ea0, + XK_abelowdot = 0x1001ea1, + XK_Ahook = 0x1001ea2, + XK_ahook = 0x1001ea3, + XK_Acircumflexacute = 0x1001ea4, + XK_acircumflexacute = 0x1001ea5, + XK_Acircumflexgrave = 0x1001ea6, + XK_acircumflexgrave = 0x1001ea7, + XK_Acircumflexhook = 0x1001ea8, + XK_acircumflexhook = 0x1001ea9, + XK_Acircumflextilde = 0x1001eaa, + XK_acircumflextilde = 0x1001eab, + XK_Acircumflexbelowdot = 0x1001eac, + XK_acircumflexbelowdot = 0x1001ead, + XK_Abreveacute = 0x1001eae, + XK_abreveacute = 0x1001eaf, + XK_Abrevegrave = 0x1001eb0, + XK_abrevegrave = 0x1001eb1, + XK_Abrevehook = 0x1001eb2, + XK_abrevehook = 0x1001eb3, + XK_Abrevetilde = 0x1001eb4, + XK_abrevetilde = 0x1001eb5, + XK_Abrevebelowdot = 0x1001eb6, + XK_abrevebelowdot = 0x1001eb7, + XK_Ebelowdot = 0x1001eb8, + XK_ebelowdot = 0x1001eb9, + XK_Ehook = 0x1001eba, + XK_ehook = 0x1001ebb, + XK_Etilde = 0x1001ebc, + XK_etilde = 0x1001ebd, + XK_Ecircumflexacute = 0x1001ebe, + XK_ecircumflexacute = 0x1001ebf, + XK_Ecircumflexgrave = 0x1001ec0, + XK_ecircumflexgrave = 0x1001ec1, + XK_Ecircumflexhook = 0x1001ec2, + XK_ecircumflexhook = 0x1001ec3, + XK_Ecircumflextilde = 0x1001ec4, + XK_ecircumflextilde = 0x1001ec5, + XK_Ecircumflexbelowdot = 0x1001ec6, + XK_ecircumflexbelowdot = 0x1001ec7, + XK_Ihook = 0x1001ec8, + XK_ihook = 0x1001ec9, + XK_Ibelowdot = 0x1001eca, + XK_ibelowdot = 0x1001ecb, + XK_Obelowdot = 0x1001ecc, + XK_obelowdot = 0x1001ecd, + XK_Ohook = 0x1001ece, + XK_ohook = 0x1001ecf, + XK_Ocircumflexacute = 0x1001ed0, + XK_ocircumflexacute = 0x1001ed1, + XK_Ocircumflexgrave = 0x1001ed2, + XK_ocircumflexgrave = 0x1001ed3, + XK_Ocircumflexhook = 0x1001ed4, + XK_ocircumflexhook = 0x1001ed5, + XK_Ocircumflextilde = 0x1001ed6, + XK_ocircumflextilde = 0x1001ed7, + XK_Ocircumflexbelowdot = 0x1001ed8, + XK_ocircumflexbelowdot = 0x1001ed9, + XK_Ohornacute = 0x1001eda, + XK_ohornacute = 0x1001edb, + XK_Ohorngrave = 0x1001edc, + XK_ohorngrave = 0x1001edd, + XK_Ohornhook = 0x1001ede, + XK_ohornhook = 0x1001edf, + XK_Ohorntilde = 0x1001ee0, + XK_ohorntilde = 0x1001ee1, + XK_Ohornbelowdot = 0x1001ee2, + XK_ohornbelowdot = 0x1001ee3, + XK_Ubelowdot = 0x1001ee4, + XK_ubelowdot = 0x1001ee5, + XK_Uhook = 0x1001ee6, + XK_uhook = 0x1001ee7, + XK_Uhornacute = 0x1001ee8, + XK_uhornacute = 0x1001ee9, + XK_Uhorngrave = 0x1001eea, + XK_uhorngrave = 0x1001eeb, + XK_Uhornhook = 0x1001eec, + XK_uhornhook = 0x1001eed, + XK_Uhorntilde = 0x1001eee, + XK_uhorntilde = 0x1001eef, + XK_Uhornbelowdot = 0x1001ef0, + XK_uhornbelowdot = 0x1001ef1, + XK_Ybelowdot = 0x1001ef4, + XK_ybelowdot = 0x1001ef5, + XK_Yhook = 0x1001ef6, + XK_yhook = 0x1001ef7, + XK_Ytilde = 0x1001ef8, + XK_ytilde = 0x1001ef9, + XK_Ohorn = 0x10001a0, + XK_ohorn = 0x10001a1, + XK_Uhorn = 0x10001af, + XK_uhorn = 0x10001b0, + XK_EcuSign = 0x10020a0, + XK_ColonSign = 0x10020a1, + XK_CruzeiroSign = 0x10020a2, + XK_FFrancSign = 0x10020a3, + XK_LiraSign = 0x10020a4, + XK_MillSign = 0x10020a5, + XK_NairaSign = 0x10020a6, + XK_PesetaSign = 0x10020a7, + XK_RupeeSign = 0x10020a8, + XK_WonSign = 0x10020a9, + XK_NewSheqelSign = 0x10020aa, + XK_DongSign = 0x10020ab, + XK_EuroSign = 0x20ac, + XK_zerosuperior = 0x1002070, + XK_foursuperior = 0x1002074, + XK_fivesuperior = 0x1002075, + XK_sixsuperior = 0x1002076, + XK_sevensuperior = 0x1002077, + XK_eightsuperior = 0x1002078, + XK_ninesuperior = 0x1002079, + XK_zerosubscript = 0x1002080, + XK_onesubscript = 0x1002081, + XK_twosubscript = 0x1002082, + XK_threesubscript = 0x1002083, + XK_foursubscript = 0x1002084, + XK_fivesubscript = 0x1002085, + XK_sixsubscript = 0x1002086, + XK_sevensubscript = 0x1002087, + XK_eightsubscript = 0x1002088, + XK_ninesubscript = 0x1002089, + XK_partdifferential = 0x1002202, + XK_emptyset = 0x1002205, + XK_elementof = 0x1002208, + XK_notelementof = 0x1002209, + XK_containsas = 0x100220B, + XK_squareroot = 0x100221A, + XK_cuberoot = 0x100221B, + XK_fourthroot = 0x100221C, + XK_dintegral = 0x100222C, + XK_tintegral = 0x100222D, + XK_because = 0x1002235, + XK_approxeq = 0x1002248, + XK_notapproxeq = 0x1002247, + XK_notidentical = 0x1002262, + XK_stricteq = 0x1002263, + XK_braille_dot_1 = 0xfff1, + XK_braille_dot_2 = 0xfff2, + XK_braille_dot_3 = 0xfff3, + XK_braille_dot_4 = 0xfff4, + XK_braille_dot_5 = 0xfff5, + XK_braille_dot_6 = 0xfff6, + XK_braille_dot_7 = 0xfff7, + XK_braille_dot_8 = 0xfff8, + XK_braille_dot_9 = 0xfff9, + XK_braille_dot_10 = 0xfffa, + XK_braille_blank = 0x1002800, + XK_braille_dots_1 = 0x1002801, + XK_braille_dots_2 = 0x1002802, + XK_braille_dots_12 = 0x1002803, + XK_braille_dots_3 = 0x1002804, + XK_braille_dots_13 = 0x1002805, + XK_braille_dots_23 = 0x1002806, + XK_braille_dots_123 = 0x1002807, + XK_braille_dots_4 = 0x1002808, + XK_braille_dots_14 = 0x1002809, + XK_braille_dots_24 = 0x100280a, + XK_braille_dots_124 = 0x100280b, + XK_braille_dots_34 = 0x100280c, + XK_braille_dots_134 = 0x100280d, + XK_braille_dots_234 = 0x100280e, + XK_braille_dots_1234 = 0x100280f, + XK_braille_dots_5 = 0x1002810, + XK_braille_dots_15 = 0x1002811, + XK_braille_dots_25 = 0x1002812, + XK_braille_dots_125 = 0x1002813, + XK_braille_dots_35 = 0x1002814, + XK_braille_dots_135 = 0x1002815, + XK_braille_dots_235 = 0x1002816, + XK_braille_dots_1235 = 0x1002817, + XK_braille_dots_45 = 0x1002818, + XK_braille_dots_145 = 0x1002819, + XK_braille_dots_245 = 0x100281a, + XK_braille_dots_1245 = 0x100281b, + XK_braille_dots_345 = 0x100281c, + XK_braille_dots_1345 = 0x100281d, + XK_braille_dots_2345 = 0x100281e, + XK_braille_dots_12345 = 0x100281f, + XK_braille_dots_6 = 0x1002820, + XK_braille_dots_16 = 0x1002821, + XK_braille_dots_26 = 0x1002822, + XK_braille_dots_126 = 0x1002823, + XK_braille_dots_36 = 0x1002824, + XK_braille_dots_136 = 0x1002825, + XK_braille_dots_236 = 0x1002826, + XK_braille_dots_1236 = 0x1002827, + XK_braille_dots_46 = 0x1002828, + XK_braille_dots_146 = 0x1002829, + XK_braille_dots_246 = 0x100282a, + XK_braille_dots_1246 = 0x100282b, + XK_braille_dots_346 = 0x100282c, + XK_braille_dots_1346 = 0x100282d, + XK_braille_dots_2346 = 0x100282e, + XK_braille_dots_12346 = 0x100282f, + XK_braille_dots_56 = 0x1002830, + XK_braille_dots_156 = 0x1002831, + XK_braille_dots_256 = 0x1002832, + XK_braille_dots_1256 = 0x1002833, + XK_braille_dots_356 = 0x1002834, + XK_braille_dots_1356 = 0x1002835, + XK_braille_dots_2356 = 0x1002836, + XK_braille_dots_12356 = 0x1002837, + XK_braille_dots_456 = 0x1002838, + XK_braille_dots_1456 = 0x1002839, + XK_braille_dots_2456 = 0x100283a, + XK_braille_dots_12456 = 0x100283b, + XK_braille_dots_3456 = 0x100283c, + XK_braille_dots_13456 = 0x100283d, + XK_braille_dots_23456 = 0x100283e, + XK_braille_dots_123456 = 0x100283f, + XK_braille_dots_7 = 0x1002840, + XK_braille_dots_17 = 0x1002841, + XK_braille_dots_27 = 0x1002842, + XK_braille_dots_127 = 0x1002843, + XK_braille_dots_37 = 0x1002844, + XK_braille_dots_137 = 0x1002845, + XK_braille_dots_237 = 0x1002846, + XK_braille_dots_1237 = 0x1002847, + XK_braille_dots_47 = 0x1002848, + XK_braille_dots_147 = 0x1002849, + XK_braille_dots_247 = 0x100284a, + XK_braille_dots_1247 = 0x100284b, + XK_braille_dots_347 = 0x100284c, + XK_braille_dots_1347 = 0x100284d, + XK_braille_dots_2347 = 0x100284e, + XK_braille_dots_12347 = 0x100284f, + XK_braille_dots_57 = 0x1002850, + XK_braille_dots_157 = 0x1002851, + XK_braille_dots_257 = 0x1002852, + XK_braille_dots_1257 = 0x1002853, + XK_braille_dots_357 = 0x1002854, + XK_braille_dots_1357 = 0x1002855, + XK_braille_dots_2357 = 0x1002856, + XK_braille_dots_12357 = 0x1002857, + XK_braille_dots_457 = 0x1002858, + XK_braille_dots_1457 = 0x1002859, + XK_braille_dots_2457 = 0x100285a, + XK_braille_dots_12457 = 0x100285b, + XK_braille_dots_3457 = 0x100285c, + XK_braille_dots_13457 = 0x100285d, + XK_braille_dots_23457 = 0x100285e, + XK_braille_dots_123457 = 0x100285f, + XK_braille_dots_67 = 0x1002860, + XK_braille_dots_167 = 0x1002861, + XK_braille_dots_267 = 0x1002862, + XK_braille_dots_1267 = 0x1002863, + XK_braille_dots_367 = 0x1002864, + XK_braille_dots_1367 = 0x1002865, + XK_braille_dots_2367 = 0x1002866, + XK_braille_dots_12367 = 0x1002867, + XK_braille_dots_467 = 0x1002868, + XK_braille_dots_1467 = 0x1002869, + XK_braille_dots_2467 = 0x100286a, + XK_braille_dots_12467 = 0x100286b, + XK_braille_dots_3467 = 0x100286c, + XK_braille_dots_13467 = 0x100286d, + XK_braille_dots_23467 = 0x100286e, + XK_braille_dots_123467 = 0x100286f, + XK_braille_dots_567 = 0x1002870, + XK_braille_dots_1567 = 0x1002871, + XK_braille_dots_2567 = 0x1002872, + XK_braille_dots_12567 = 0x1002873, + XK_braille_dots_3567 = 0x1002874, + XK_braille_dots_13567 = 0x1002875, + XK_braille_dots_23567 = 0x1002876, + XK_braille_dots_123567 = 0x1002877, + XK_braille_dots_4567 = 0x1002878, + XK_braille_dots_14567 = 0x1002879, + XK_braille_dots_24567 = 0x100287a, + XK_braille_dots_124567 = 0x100287b, + XK_braille_dots_34567 = 0x100287c, + XK_braille_dots_134567 = 0x100287d, + XK_braille_dots_234567 = 0x100287e, + XK_braille_dots_1234567 = 0x100287f, + XK_braille_dots_8 = 0x1002880, + XK_braille_dots_18 = 0x1002881, + XK_braille_dots_28 = 0x1002882, + XK_braille_dots_128 = 0x1002883, + XK_braille_dots_38 = 0x1002884, + XK_braille_dots_138 = 0x1002885, + XK_braille_dots_238 = 0x1002886, + XK_braille_dots_1238 = 0x1002887, + XK_braille_dots_48 = 0x1002888, + XK_braille_dots_148 = 0x1002889, + XK_braille_dots_248 = 0x100288a, + XK_braille_dots_1248 = 0x100288b, + XK_braille_dots_348 = 0x100288c, + XK_braille_dots_1348 = 0x100288d, + XK_braille_dots_2348 = 0x100288e, + XK_braille_dots_12348 = 0x100288f, + XK_braille_dots_58 = 0x1002890, + XK_braille_dots_158 = 0x1002891, + XK_braille_dots_258 = 0x1002892, + XK_braille_dots_1258 = 0x1002893, + XK_braille_dots_358 = 0x1002894, + XK_braille_dots_1358 = 0x1002895, + XK_braille_dots_2358 = 0x1002896, + XK_braille_dots_12358 = 0x1002897, + XK_braille_dots_458 = 0x1002898, + XK_braille_dots_1458 = 0x1002899, + XK_braille_dots_2458 = 0x100289a, + XK_braille_dots_12458 = 0x100289b, + XK_braille_dots_3458 = 0x100289c, + XK_braille_dots_13458 = 0x100289d, + XK_braille_dots_23458 = 0x100289e, + XK_braille_dots_123458 = 0x100289f, + XK_braille_dots_68 = 0x10028a0, + XK_braille_dots_168 = 0x10028a1, + XK_braille_dots_268 = 0x10028a2, + XK_braille_dots_1268 = 0x10028a3, + XK_braille_dots_368 = 0x10028a4, + XK_braille_dots_1368 = 0x10028a5, + XK_braille_dots_2368 = 0x10028a6, + XK_braille_dots_12368 = 0x10028a7, + XK_braille_dots_468 = 0x10028a8, + XK_braille_dots_1468 = 0x10028a9, + XK_braille_dots_2468 = 0x10028aa, + XK_braille_dots_12468 = 0x10028ab, + XK_braille_dots_3468 = 0x10028ac, + XK_braille_dots_13468 = 0x10028ad, + XK_braille_dots_23468 = 0x10028ae, + XK_braille_dots_123468 = 0x10028af, + XK_braille_dots_568 = 0x10028b0, + XK_braille_dots_1568 = 0x10028b1, + XK_braille_dots_2568 = 0x10028b2, + XK_braille_dots_12568 = 0x10028b3, + XK_braille_dots_3568 = 0x10028b4, + XK_braille_dots_13568 = 0x10028b5, + XK_braille_dots_23568 = 0x10028b6, + XK_braille_dots_123568 = 0x10028b7, + XK_braille_dots_4568 = 0x10028b8, + XK_braille_dots_14568 = 0x10028b9, + XK_braille_dots_24568 = 0x10028ba, + XK_braille_dots_124568 = 0x10028bb, + XK_braille_dots_34568 = 0x10028bc, + XK_braille_dots_134568 = 0x10028bd, + XK_braille_dots_234568 = 0x10028be, + XK_braille_dots_1234568 = 0x10028bf, + XK_braille_dots_78 = 0x10028c0, + XK_braille_dots_178 = 0x10028c1, + XK_braille_dots_278 = 0x10028c2, + XK_braille_dots_1278 = 0x10028c3, + XK_braille_dots_378 = 0x10028c4, + XK_braille_dots_1378 = 0x10028c5, + XK_braille_dots_2378 = 0x10028c6, + XK_braille_dots_12378 = 0x10028c7, + XK_braille_dots_478 = 0x10028c8, + XK_braille_dots_1478 = 0x10028c9, + XK_braille_dots_2478 = 0x10028ca, + XK_braille_dots_12478 = 0x10028cb, + XK_braille_dots_3478 = 0x10028cc, + XK_braille_dots_13478 = 0x10028cd, + XK_braille_dots_23478 = 0x10028ce, + XK_braille_dots_123478 = 0x10028cf, + XK_braille_dots_578 = 0x10028d0, + XK_braille_dots_1578 = 0x10028d1, + XK_braille_dots_2578 = 0x10028d2, + XK_braille_dots_12578 = 0x10028d3, + XK_braille_dots_3578 = 0x10028d4, + XK_braille_dots_13578 = 0x10028d5, + XK_braille_dots_23578 = 0x10028d6, + XK_braille_dots_123578 = 0x10028d7, + XK_braille_dots_4578 = 0x10028d8, + XK_braille_dots_14578 = 0x10028d9, + XK_braille_dots_24578 = 0x10028da, + XK_braille_dots_124578 = 0x10028db, + XK_braille_dots_34578 = 0x10028dc, + XK_braille_dots_134578 = 0x10028dd, + XK_braille_dots_234578 = 0x10028de, + XK_braille_dots_1234578 = 0x10028df, + XK_braille_dots_678 = 0x10028e0, + XK_braille_dots_1678 = 0x10028e1, + XK_braille_dots_2678 = 0x10028e2, + XK_braille_dots_12678 = 0x10028e3, + XK_braille_dots_3678 = 0x10028e4, + XK_braille_dots_13678 = 0x10028e5, + XK_braille_dots_23678 = 0x10028e6, + XK_braille_dots_123678 = 0x10028e7, + XK_braille_dots_4678 = 0x10028e8, + XK_braille_dots_14678 = 0x10028e9, + XK_braille_dots_24678 = 0x10028ea, + XK_braille_dots_124678 = 0x10028eb, + XK_braille_dots_34678 = 0x10028ec, + XK_braille_dots_134678 = 0x10028ed, + XK_braille_dots_234678 = 0x10028ee, + XK_braille_dots_1234678 = 0x10028ef, + XK_braille_dots_5678 = 0x10028f0, + XK_braille_dots_15678 = 0x10028f1, + XK_braille_dots_25678 = 0x10028f2, + XK_braille_dots_125678 = 0x10028f3, + XK_braille_dots_35678 = 0x10028f4, + XK_braille_dots_135678 = 0x10028f5, + XK_braille_dots_235678 = 0x10028f6, + XK_braille_dots_1235678 = 0x10028f7, + XK_braille_dots_45678 = 0x10028f8, + XK_braille_dots_145678 = 0x10028f9, + XK_braille_dots_245678 = 0x10028fa, + XK_braille_dots_1245678 = 0x10028fb, + XK_braille_dots_345678 = 0x10028fc, + XK_braille_dots_1345678 = 0x10028fd, + XK_braille_dots_2345678 = 0x10028fe, + XK_braille_dots_12345678 = 0x10028ff, + XK_Sinh_ng = 0x1000d82, + XK_Sinh_h2 = 0x1000d83, + XK_Sinh_a = 0x1000d85, + XK_Sinh_aa = 0x1000d86, + XK_Sinh_ae = 0x1000d87, + XK_Sinh_aee = 0x1000d88, + XK_Sinh_i = 0x1000d89, + XK_Sinh_ii = 0x1000d8a, + XK_Sinh_u = 0x1000d8b, + XK_Sinh_uu = 0x1000d8c, + XK_Sinh_ri = 0x1000d8d, + XK_Sinh_rii = 0x1000d8e, + XK_Sinh_lu = 0x1000d8f, + XK_Sinh_luu = 0x1000d90, + XK_Sinh_e = 0x1000d91, + XK_Sinh_ee = 0x1000d92, + XK_Sinh_ai = 0x1000d93, + XK_Sinh_o = 0x1000d94, + XK_Sinh_oo = 0x1000d95, + XK_Sinh_au = 0x1000d96, + XK_Sinh_ka = 0x1000d9a, + XK_Sinh_kha = 0x1000d9b, + XK_Sinh_ga = 0x1000d9c, + XK_Sinh_gha = 0x1000d9d, + XK_Sinh_ng2 = 0x1000d9e, + XK_Sinh_nga = 0x1000d9f, + XK_Sinh_ca = 0x1000da0, + XK_Sinh_cha = 0x1000da1, + XK_Sinh_ja = 0x1000da2, + XK_Sinh_jha = 0x1000da3, + XK_Sinh_nya = 0x1000da4, + XK_Sinh_jnya = 0x1000da5, + XK_Sinh_nja = 0x1000da6, + XK_Sinh_tta = 0x1000da7, + XK_Sinh_ttha = 0x1000da8, + XK_Sinh_dda = 0x1000da9, + XK_Sinh_ddha = 0x1000daa, + XK_Sinh_nna = 0x1000dab, + XK_Sinh_ndda = 0x1000dac, + XK_Sinh_tha = 0x1000dad, + XK_Sinh_thha = 0x1000dae, + XK_Sinh_dha = 0x1000daf, + XK_Sinh_dhha = 0x1000db0, + XK_Sinh_na = 0x1000db1, + XK_Sinh_ndha = 0x1000db3, + XK_Sinh_pa = 0x1000db4, + XK_Sinh_pha = 0x1000db5, + XK_Sinh_ba = 0x1000db6, + XK_Sinh_bha = 0x1000db7, + XK_Sinh_ma = 0x1000db8, + XK_Sinh_mba = 0x1000db9, + XK_Sinh_ya = 0x1000dba, + XK_Sinh_ra = 0x1000dbb, + XK_Sinh_la = 0x1000dbd, + XK_Sinh_va = 0x1000dc0, + XK_Sinh_sha = 0x1000dc1, + XK_Sinh_ssha = 0x1000dc2, + XK_Sinh_sa = 0x1000dc3, + XK_Sinh_ha = 0x1000dc4, + XK_Sinh_lla = 0x1000dc5, + XK_Sinh_fa = 0x1000dc6, + XK_Sinh_al = 0x1000dca, + XK_Sinh_aa2 = 0x1000dcf, + XK_Sinh_ae2 = 0x1000dd0, + XK_Sinh_aee2 = 0x1000dd1, + XK_Sinh_i2 = 0x1000dd2, + XK_Sinh_ii2 = 0x1000dd3, + XK_Sinh_u2 = 0x1000dd4, + XK_Sinh_uu2 = 0x1000dd6, + XK_Sinh_ru2 = 0x1000dd8, + XK_Sinh_e2 = 0x1000dd9, + XK_Sinh_ee2 = 0x1000dda, + XK_Sinh_ai2 = 0x1000ddb, + XK_Sinh_o2 = 0x1000ddc, + XK_Sinh_oo2 = 0x1000ddd, + XK_Sinh_au2 = 0x1000dde, + XK_Sinh_lu2 = 0x1000ddf, + XK_Sinh_ruu2 = 0x1000df2, + XK_Sinh_luu2 = 0x1000df3, + XK_Sinh_kunddaliya = 0x1000df4, + } +} diff --git a/Crow/src/backends/xlib/XLibBackend.cs b/Crow/src/backends/xlib/XLibBackend.cs new file mode 100644 index 00000000..111296e3 --- /dev/null +++ b/Crow/src/backends/xlib/XLibBackend.cs @@ -0,0 +1,203 @@ +// +// XLibBackend.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Crow.XLib +{ + public class XLibBackend : IBackend + { + #region pinvoke + [DllImportAttribute("X11")] + static extern int XInitThreads(); + [DllImportAttribute("X11")] + internal static extern IntPtr XOpenDisplay(IntPtr displayName); + [DllImportAttribute("X11")] + internal static extern IntPtr XCloseDisplay(IntPtr disp); + [DllImportAttribute("X11")] + static extern Int32 XDefaultScreen(IntPtr disp); + [DllImportAttribute("X11")] + static extern IntPtr XDefaultRootWindow(IntPtr disp); + [DllImportAttribute("X11")] + static extern UInt32 XDefaultDepth (IntPtr disp, Int32 screen); + [DllImportAttribute("X11")] + static extern IntPtr XDefaultVisual(IntPtr disp, Int32 screen); + [DllImportAttribute("X11")] + static extern IntPtr XCreateSimpleWindow(IntPtr disp, IntPtr rootWindow, Int32 x, Int32 y, UInt32 width, UInt32 height, + UInt32 borderWidth, IntPtr border, IntPtr background); + [DllImportAttribute("X11")] + static extern IntPtr XCreatePixmap(IntPtr disp, IntPtr rootWindow, UInt32 width, UInt32 height, UInt32 depth); + [DllImportAttribute("X11")] + static extern IntPtr XFreePixmap(IntPtr disp, IntPtr pixmap); + [DllImportAttribute("X11")] + static extern IntPtr XFree(IntPtr data); + [DllImportAttribute("X11")] + static extern Int32 XSelectInput(IntPtr disp, IntPtr win, EventMask eventMask); + [DllImportAttribute("X11")] + static extern Int32 XMapWindow(IntPtr disp, IntPtr win); + [DllImportAttribute("X11")] + static extern int XPending (IntPtr disp); + [DllImportAttribute("X11")] + static extern IntPtr XNextEvent(IntPtr disp, ref XEvent xevent); + [DllImportAttribute("X11")] + static extern Int32 XSync(IntPtr disp, int discard); + [DllImportAttribute("X11")] + static extern int XConnectionNumber(IntPtr disp); + [DllImportAttribute("X11")] + static extern IntPtr XSetErrorHandler(XErrorHandler error_handler); + + #endregion + + IntPtr xDisp, xwinHnd, xDefaultRootWin, xDefaultVisual; + UInt32 xDefaultDepth; + Int32 xScreen; + XErrorHandler errorHnd; + + Interface iFace; + X11Keyboard keyboard; + + #region IBackend implementation + + public void Init (Interface _iFace) + { + iFace = _iFace; + XInitThreads (); + xDisp = XOpenDisplay(IntPtr.Zero); + if (xDisp == IntPtr.Zero) + throw new NotSupportedException("[XLib] Failed to open display."); + + xScreen = XDefaultScreen(xDisp); + + xDefaultRootWin = XDefaultRootWindow (xDisp); + xDefaultVisual = XDefaultVisual (xDisp, xScreen); + xDefaultDepth = XDefaultDepth (xDisp, xScreen); + + xwinHnd = XCreateSimpleWindow (xDisp, xDefaultRootWin, + 0, 0, (uint)iFace.ClientRectangle.Width, (uint)iFace.ClientRectangle.Height, 0, IntPtr.Zero, IntPtr.Zero); + if (xwinHnd == IntPtr.Zero) + throw new NotSupportedException("[XLib] Failed to create window."); + + XSelectInput (xDisp, xwinHnd, EventMask.ExposureMask | + EventMask.KeyPressMask | EventMask.KeyReleaseMask | + EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask); + + XMapWindow (xDisp, xwinHnd); + + keyboard = new Crow.XLib.X11Keyboard (xDisp); + + iFace.surf = new Cairo.XlibSurface (xDisp, xwinHnd, xDefaultVisual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height); + + errorHnd = new XErrorHandler (HandleError); + XSetErrorHandler (errorHnd); + } + + public void CleanUp () + { + keyboard.Destroy (); + + XCloseDisplay (xDisp); + } + public void Flush () { + XSync (xDisp, 0); + } + public void ProcessEvents () + { + if (XPending (xDisp) > 0) { + XEvent xevent = new XEvent (); + XNextEvent (xDisp, ref xevent); + + switch (xevent.type) { + case XEventName.Expose: + iFace.ProcessResize (new Rectangle (0, 0, xevent.ExposeEvent.width, xevent.ExposeEvent.height)); + break; + case XEventName.KeyPress: + keyboard.HandleEvent ((uint)xevent.KeyEvent.keycode, true); + break; + case XEventName.KeyRelease: + keyboard.HandleEvent ((uint)xevent.KeyEvent.keycode, false); + break; + case XEventName.MotionNotify: + //Debug.WriteLine ("motion: ({0},{1})", xevent.MotionEvent.x, xevent.MotionEvent.y); + iFace.ProcessMouseMove (xevent.MotionEvent.x, xevent.MotionEvent.y); + break; + case XEventName.ButtonPress: + //Debug.WriteLine ("button press: {0}", xevent.ButtonEvent.button); + if (xevent.ButtonEvent.button == 4) + iFace.ProcessMouseWheelChanged (Interface.WheelIncrement); + else if(xevent.ButtonEvent.button == 5) + iFace.ProcessMouseWheelChanged (-Interface.WheelIncrement); + else + iFace.ProcessMouseButtonDown ((MouseButton)(xevent.ButtonEvent.button - 1)); + break; + case XEventName.ButtonRelease: + //Debug.WriteLine ("button release: {0}", xevent.ButtonEvent.button); + iFace.ProcessMouseButtonUp ((MouseButton)(xevent.ButtonEvent.button - 1)); + break; + + } + } + } + public bool IsDown (Key key) { + return false; + } + public bool Shift { + get { + throw new NotImplementedException (); + } + } + + public bool Ctrl { + get { + throw new NotImplementedException (); + } + } + + public bool Alt { + get { + throw new NotImplementedException (); + } + } + #endregion + + int HandleError (IntPtr display, ref XErrorEvent error_event) + { + /*if (ErrorExceptions) + throw new X11Exception (error_event.display, error_event.resourceid, + error_event.serial, error_event.error_code, + error_event.request_code, error_event.minor_code); + else + Console.WriteLine ("X11 Error encountered: {0}{1}\n", + X11Exception.GetMessage(error_event.display, error_event.resourceid, + error_event.serial, error_event.error_code, + error_event.request_code, error_event.minor_code), + WhereString());*/ + Debug.WriteLine ("XERROR {0}", error_event.error_code); + return 0; + } + } +} + diff --git a/Tests/Tutorials/T4_Gauge.cs b/Crow/src/debug/DbgEventTypeColors.cs index d909843e..e0881182 100644 --- a/Tests/Tutorials/T4_Gauge.cs +++ b/Crow/src/debug/DbgEventTypeColors.cs @@ -1,8 +1,8 @@ -// -// HelloWorld.cs +// +// DbgEventTypeColors.cs // // Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // // Copyright (c) 2013-2017 Jean-Philippe Bruyère // @@ -23,34 +23,55 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - using System; -using Crow; +using Cairo; +using System.Linq; -namespace Tutorials +namespace Crow { - class T4_Gauge : CrowWindow + #if DEBUG_LOG + public class DbgEventTypeColors : GraphicObject { - public T4_Gauge () - : base(800, 600,"Simple Gauge Tutorial") + protected override void onDraw (Context gr) { - } + base.onDraw (gr); - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - AddWidget (new SimpleGauge (CurrentInterface) { - Level = 40, - Width = 30, Height = "50%", - Foreground = Color.DarkBlue, Background = Color.DimGray - }); - } + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + gr.FontOptions = Interface.FontRenderingOptions; + gr.Antialias = Interface.Antialias; - [STAThread] - static void Main () - { - T4_Gauge win = new T4_Gauge (); - win.Run (30); + DbgEvtType[] types = DbgLogViewer.colors.Keys.ToArray (); + Color[] colors = DbgLogViewer.colors.Values.ToArray (); + + Rectangle r = ClientRectangle; + FontExtents fe = gr.FontExtents; + + double penY = fe.Height + r.Top; + double penX = (double)r.Left; + + + for (int i = 0; i < types.Length; i++) { + string n = types [i].ToString(); + Color c = colors[i]; + Foreground.SetAsSource (gr); + + gr.MoveTo (penX + 25.0, penY - fe.Descent); + gr.ShowText (n); + + Rectangle rc = new Rectangle((int)penX, (int)(penY - fe.Height), 20, (int)fe.Height); + rc.Inflate (-2); + gr.Rectangle (rc); + gr.StrokePreserve (); + + gr.SetSourceColor (c); + gr.Fill (); + + penY += fe.Height; + + } } } -}
\ No newline at end of file + #endif +} + diff --git a/Crow/src/debug/DbgLogViewer.cs b/Crow/src/debug/DbgLogViewer.cs new file mode 100644 index 00000000..c10cfdf6 --- /dev/null +++ b/Crow/src/debug/DbgLogViewer.cs @@ -0,0 +1,646 @@ +// +// DbgLogViewer.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Cairo; + +#if DEBUG_LOG +namespace Crow +{ + public class DbgLogViewer : ScrollingObject + { + public static Dictionary<DbgEvtType,Color> colors; + + public static Configuration colorsConf = new Configuration("dbgcolor.conf"); + + #region debug viewer private classes + public class DbgData { + public int objInstanceNum; + public LayoutingType layout; + public LayoutingQueueItem.Result result; + + public DbgData (int _obj) { + objInstanceNum = _obj; + } + } + public class DbgEvent { + public long begin, end; + public DbgEvtType type; + public DbgData data = null; + + public DbgEvent() {} + + public static DbgEvent Parse (string str) { + if (str == null) + return null; + string[] tmp = str.Trim().Split(';'); + + DbgEvent evt = new DbgEvent (); + evt.begin = long.Parse (tmp [0]); + evt.end = long.Parse (tmp [1]); + evt.type = (DbgEvtType)Enum.Parse (typeof(DbgEvtType), tmp [2]); + + if (evt.type.HasFlag (DbgEvtType.GraphicObject)) { + evt.data = new DbgData (int.Parse (tmp [3])); + if (evt.type.HasFlag (DbgEvtType.GOLayouting)) { + evt.data.layout = (LayoutingType)Enum.Parse (typeof(LayoutingType), tmp [4]); + if (evt.type == DbgEvtType.GOProcessLayouting) + evt.data.result = (LayoutingQueueItem.Result)Enum.Parse (typeof(LayoutingQueueItem.Result), tmp [5]); + } + } + return evt; + } + } + class DbgGo { + public int listIndex;//prevent doing an IndexOf on list for each event to know y pos on screen + public int instanceNum;//class instantiation order, used to bind events to objs + public string name; + //0 is the main graphic tree, for other obj tree not added to main tree, it range from 1->n + //useful to track events for obj shown later, not on start + public int treeIndex; + public int yIndex;//index in parenting, the whole main graphic tree is one continuous suite + public int xLevel;//depth + + public List<DbgEvent> events = new List<DbgEvent>(); + + public static DbgGo Parse (string str) { + DbgGo g = new DbgGo (); + if (str == null) + return null; + string[] tmp = str.Trim().Split(';'); + g.instanceNum = int.Parse (tmp [0]); + g.name = tmp [1]; + g.yIndex = int.Parse (tmp [2]); + g.xLevel = int.Parse (tmp [3]); + return g; + } + + } + #endregion + + public static void reloadColors () { + colors = new Dictionary<DbgEvtType, Color>(); + foreach (string n in colorsConf.Names) { + DbgEvtType t = (DbgEvtType)Enum.Parse (typeof(DbgEvtType), n); + Color c = colorsConf.Get<Color> (n); + colors.Add (t, c); + } + + } + #region CTOR + static DbgLogViewer() { + reloadColors (); + } + protected DbgLogViewer () : base(){} + public DbgLogViewer (Interface iface) : base(iface){} + #endregion + + FontExtents fe; + + double xScale = 1.0/512.0, yScale = 1.0, leftMargin, topMargin = 0.0; + string logFile; + + List<DbgEvent> events;//global events + List<DbgGo> objs; + + long currentTick = 0, selStart = -1, selEnd = -1, minTicks = 0, maxTicks = 0, visibleTicks = 0; + int currentLine = -1; + int visibleLines; + + public string LogFile { + get { return logFile; } + set { + if (logFile == value) + return; + logFile = value; + + loadDebugFile (); + + + NotifyValueChanged ("LogFile", logFile); + RegisterForGraphicUpdate (); + } + } + public double XScale { + get { return xScale; } + set { + if (xScale == value) + return; + xScale = value; + NotifyValueChanged ("XScale", xScale); + updateVisibleTicks (); + RegisterForGraphicUpdate (); + } + } + public double YScale { + get { return yScale; } + set { + if (yScale == value) + return; + yScale = value; + NotifyValueChanged ("YScale", yScale); + RegisterForGraphicUpdate (); + } + } + + + void storeEvent (DbgEvent evt) { + if (evt.data == null)//global events + events.Add (evt); + else { + DbgGo go = objs.Where (o => o.instanceNum == evt.data.objInstanceNum).FirstOrDefault (); + if (go == null) + Console.WriteLine ("Unknown instance: " + evt.data.objInstanceNum); + else + go.events.Add (evt); + } + } + + void loadDebugFile() { + if (!File.Exists (logFile)) + return; + + events = new List<DbgEvent>(); + objs = new List<DbgGo> (); + minTicks = maxTicks = 0; + leftMargin = topMargin = 0.0; + + using (ImageSurface img = new ImageSurface (Format.Argb32, 1, 1)) { + using (Context gr = new Context (img)) { + double maxNameWidth = 0.0; + + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + + using (StreamReader s = new StreamReader (logFile)) { + if (s.ReadLine () != "[GraphicObjects]") + return; + while (!s.EndOfStream) { + string l = s.ReadLine (); + if (l == "[Events]") + break; + DbgGo o = DbgGo.Parse (l); + objs.Add (o); + double nameWidth = gr.TextExtents (o.name).Width + 5.0 * o.xLevel; + if (nameWidth > maxNameWidth) + maxNameWidth = nameWidth; + } + if (!s.EndOfStream) { + DbgEvent firstEvt = DbgEvent.Parse (s.ReadLine ()); + storeEvent (firstEvt); + minTicks = firstEvt.begin; + } + + if (!s.EndOfStream) { + while (true) { + DbgLogViewer.DbgEvent evt = DbgEvent.Parse (s.ReadLine ()); + storeEvent (evt); + if (s.EndOfStream) { + maxTicks = evt.end; + break; + } + } + } + } + + leftMargin = 2.5 + maxNameWidth; + + fe = gr.FontExtents; + + topMargin = 2.0 * fe.Height; + + updateVisibleLines (); + updateVisibleTicks (); + } + } + + } + void updateVisibleLines(){ + visibleLines = (int)Math.Floor (((double)ClientRectangle.Height - topMargin) / fe.Height); + NotifyValueChanged ("VisibleLines", visibleLines); + updateMaxScrollY (); + } + void updateVisibleTicks() { + visibleTicks = Math.Max (0, (long)((double)(ClientRectangle.Width - leftMargin) / XScale)); + NotifyValueChanged ("VisibleTicks", visibleTicks); + updateMaxScrollX (); + } + /* + void updateVisibleColumns(){ + visibleColumns = (int)Math.Floor ((double)(ClientRectangle.Width - leftMargin)/ fe.MaxXAdvance); + NotifyValueChanged ("VisibleColumns", visibleColumns); + updateMaxScrollX (); + } + void updateMaxScrollX () { + MaxScrollX = Math.Max (0, buffer.longestLineCharCount - visibleColumns); + if (buffer.longestLineCharCount > 0) + NotifyValueChanged ("ChildWidthRatio", Slot.Width * visibleColumns / buffer.longestLineCharCount); + }*/ + + void updateMaxScrollX () { + if (objs == null) + MaxScrollX = 0; + else + MaxScrollX = (int)Math.Max(0L, maxTicks - minTicks - visibleTicks); + } + void updateMaxScrollY () { + if (objs == null) + MaxScrollY = 0; + else + MaxScrollY = Math.Max(0, objs.Count - visibleLines); + } + + + public override Font Font { + get { return base.Font; } + set { + base.Font = value; + loadDebugFile (); + } + } + + public override int ScrollY { + get { + return base.ScrollY; + } + set { + base.ScrollY = value; + + if (objs == null) + return; + + Rectangle cb = ClientRectangle; + cb.Left += (int)leftMargin; + cb.Width -= (int)leftMargin; + cb.Y += (int)topMargin; + cb.Height -= (int)topMargin; + + if (mousePos.Y < cb.Top || mousePos.Y > cb.Bottom) + currentLine = -1; + else + currentLine = (int)((double)(mousePos.Y - cb.Top) / fe.Height) + ScrollY; + + NotifyValueChanged ("CurrentLine", currentLine); + + } + } + + + + protected override void onDraw (Cairo.Context gr) + { + base.onDraw (gr); + + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + gr.FontOptions = Interface.FontRenderingOptions; + gr.Antialias = Cairo.Antialias.None; + + if (objs == null) + return; + + gr.LineWidth = 1.0; + + Rectangle cb = ClientRectangle; + + double penY = topMargin + ClientRectangle.Top; + + for (int i = 0; i < visibleLines; i++) { + if (i + ScrollY >= objs.Count) + break; + DbgGo g = objs [i + ScrollY]; + + + foreach (DbgEvent evt in g.events) { + + + if (evt.end - minTicks <= ScrollX) + continue; + if (evt.begin - minTicks > ScrollX + visibleTicks) + break; + + double x = xScale * (evt.begin - minTicks - ScrollX) ; + double w = Math.Max (Math.Max(2.0, 2.0 * xScale), (double)(evt.end - evt.begin) * xScale); + if (x < 0.0) { + w += x; + x = 0.0; + } + x += leftMargin + cb.Left; + double rightDiff = x + w - cb.Right; + if (rightDiff > 0) + w -= rightDiff; + //if (x + w > cb.Right) + // continue; + + Color c = Color.Black; + + if (evt.type == DbgEvtType.GOProcessLayouting) { + switch (evt.data.result) { + case LayoutingQueueItem.Result.Success: + c = Crow.Color.Green; + break; + case LayoutingQueueItem.Result.Deleted: + c = Crow.Color.Red; + break; + case LayoutingQueueItem.Result.Discarded: + c = Crow.Color.OrangeRed; + break; + case LayoutingQueueItem.Result.Requeued: + c = Crow.Color.Orange; + break; + } + } else if (colors.ContainsKey (evt.type)) + c = colors [evt.type]; + else + System.Diagnostics.Debugger.Break (); + + gr.SetSourceColor (c); + + gr.Rectangle (x, penY, w, fe.Height); + gr.Fill (); + } + + penY += fe.Height; + + gr.SetSourceColor (Crow.Color.Jet); + gr.MoveTo (cb.X, penY - 0.5); + gr.LineTo (cb.Right, penY - 0.5); + gr.Stroke (); + + double penX = 5.0 * g.xLevel + cb.Left; + + if (g.yIndex == 0) + gr.SetSourceColor (Crow.Color.LightSalmon); + else + Foreground.SetAsSource (gr); + + gr.MoveTo (penX, penY - gr.FontExtents.Descent); + gr.ShowText (g.name); + + gr.SetSourceColor (Crow.Color.White); + gr.MoveTo (cb.X, penY - gr.FontExtents.Descent); + gr.ShowText ((i+ ScrollY).ToString()); + + } + + + gr.MoveTo (cb.Left, topMargin - 0.5 + cb.Top); + gr.LineTo (cb.Right, topMargin - 0.5 + cb.Top); + + gr.MoveTo (leftMargin + cb.Left, cb.Top); + gr.LineTo (leftMargin + cb.Left, cb.Bottom); + gr.SetSourceColor (Crow.Color.Grey); + + penY = topMargin + ClientRectangle.Top; + + //graduation + int largeGrad = int.Parse ("1" + new string ('0', visibleTicks.ToString ().Length - 1)); + int smallGrad = Math.Max (1, largeGrad / 10); + + long firstVisibleTicks = minTicks + ScrollX; + long curGrad = firstVisibleTicks - firstVisibleTicks % smallGrad + smallGrad; + + long gg = curGrad - ScrollX - minTicks; + while (gg < visibleTicks ) { + double x = (double)gg * xScale + leftMargin + cb.Left; + + gr.MoveTo (x, penY - 0.5); + if (curGrad % largeGrad == 0) { + gr.LineTo (x, penY - 8.5); + string str = curGrad.ToString (); + TextExtents te = gr.TextExtents (str); + gr.RelMoveTo (-0.5 * te.Width, -2.0); + gr.ShowText (str); + }else + gr.LineTo (x, penY - 2.5); + + curGrad += smallGrad; + gg = curGrad - ScrollX - minTicks; + } + + gr.Stroke (); + + //global events + foreach (DbgEvent evt in events) { + if (evt.begin - minTicks <= ScrollX) + continue; + double x = xScale * (evt.begin - minTicks - ScrollX) ; + x += leftMargin + cb.Left; + + gr.SetSourceColor (Crow.Color.Yellow); + gr.MoveTo (x, penY); + gr.LineTo (x, cb.Bottom); + gr.Stroke (); + string s = evt.type.ToString () [10].ToString (); + Cairo.TextExtents te = gr.TextExtents (s); + gr.Rectangle (x - 0.5 * te.Width , penY - te.Height, te.Width, te.Height); + gr.Fill (); + gr.MoveTo (x- 0.5 * te.Width, penY - gr.FontExtents.Descent); + gr.SetSourceColor (Crow.Color.Jet); + gr.ShowText (s); + + } + + } + public override void Paint (ref Cairo.Context ctx) + { + base.Paint (ref ctx); + + Rectangle r = new Rectangle(mousePos.X, 0, 1, Slot.Height); + Rectangle ctxR = ContextCoordinates (r); + Rectangle cb = ClientRectangle; + + ctx.Rectangle (ctxR); + ctx.SetSourceColor (Color.CornflowerBlue); + ctx.Fill(); + + ctx.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + ctx.SetFontSize (Font.Size); + ctx.FontOptions = Interface.FontRenderingOptions; + ctx.Antialias = Interface.Antialias; + + ctx.MoveTo (ctxR.X, ctxR.Y + fe.Height); + ctx.ShowText (currentTick.ToString ()); + + ctx.Operator = Cairo.Operator.Add; + + if (currentLine >= 0) { + r = new Rectangle (cb.Left, (currentLine + 2 - ScrollY) * (int)fe.Height + cb.Top, cb.Width, (int)fe.Height); + + ctx.Operator = Cairo.Operator.Add; + ctx.SetSourceRGBA (0.1, 0.1, 0.1, 0.4); + ctx.Rectangle (ContextCoordinates (r)); + ctx.Fill (); + } + + if (selStart < 0) { + ctx.Operator = Cairo.Operator.Over; + return; + } + double selStartX = (double)(selStart - ScrollX - minTicks) * xScale + leftMargin + cb.Left; + double selEndX = (selEnd >= 0) ? (double)(selEnd - ScrollX - minTicks) * xScale + leftMargin + cb.Left : + (double)(currentTick - ScrollX - minTicks) * xScale + leftMargin + cb.Left; + + if (selStartX < selEndX) { + ctxR.X = (int)selStartX; + ctxR.Width = (int)(selEndX - selStartX); + } else { + ctxR.X = (int)selEndX; + ctxR.Width = (int)(selStartX - selEndX); + } + + ctxR.Width = Math.Max (1, ctxR.Width); + ctx.Rectangle (ctxR); + //ctx.SetSourceColor (Color.LightYellow); + ctx.SetSourceColor (Color.Jet); + ctx.Fill(); + ctx.Operator = Cairo.Operator.Over; + + } + public override void OnLayoutChanges (LayoutingType layoutType) + { + base.OnLayoutChanges (layoutType); + switch (layoutType) { + case LayoutingType.Width: + updateVisibleTicks (); + break; + case LayoutingType.Height: + updateVisibleLines (); + break; + } + } + + Point mousePos; + void updateMouseLocalPos(Point mPos){ + Rectangle r = ScreenCoordinates (Slot); + Rectangle cb = ClientRectangle; + cb.Left += (int)leftMargin; + cb.Width -= (int)leftMargin; + cb.Y += (int)topMargin; + cb.Height -= (int)topMargin; + + mousePos = mPos - r.Position; + + mousePos.X = Math.Max(cb.X, mousePos.X); + mousePos.X = Math.Min(cb.Right, mousePos.X); + + if (mousePos.Y < cb.Top || mousePos.Y > cb.Bottom) + currentLine = -1; + else + currentLine = (int)((double)(mousePos.Y - cb.Top) / fe.Height) + ScrollY; + + NotifyValueChanged ("CurrentLine", currentLine); + + mousePos.Y = Math.Max(cb.Y, mousePos.Y); + mousePos.Y = Math.Min(cb.Bottom, mousePos.Y); + + currentTick = (int)((double)(mousePos.X - cb.X) / xScale) + minTicks + ScrollX; + + } + public override void onMouseLeave (object sender, MouseMoveEventArgs e) + { + base.onMouseLeave (sender, e); + currentLine = -1; + currentTick = 0; + } + public override void onMouseMove (object sender, MouseMoveEventArgs e) + { + base.onMouseMove (sender, e); + updateMouseLocalPos (e.Position); + + if (selStart >= 0 && IFace.Mouse.IsButtonDown(MouseButton.Left)) + selEnd = currentTick; + + if (RegisteredLayoutings == LayoutingType.None && !IsDirty) + IFace.EnqueueForRepaint (this); + + } + public override void onMouseDown (object sender, MouseButtonEventArgs e) + { + base.onMouseDown (sender, e); + + selStart = currentTick; + selEnd = -1; + + RegisterForRedraw (); + } + public override void onMouseUp (object sender, MouseButtonEventArgs e) + { + base.onMouseUp (sender, e); + if (selStart == currentTick) { + selStart = -1; + selEnd = -1; + }else + selEnd = currentTick; + RegisterForRedraw (); + } + + /// <summary> Process scrolling vertically, or if shift is down, vertically </summary> + public override void onMouseWheel (object sender, MouseWheelEventArgs e) + { + //base.onMouseWheel (sender, e); + + if (IFace.Shift) + ScrollX -= (int)((double)(e.Delta * MouseWheelSpeed) / xScale); + else if (IFace.Ctrl) { + if (e.Delta > 0) { + XScale *= 2.0; + } else { + if (MaxScrollX > 0) + XScale *= 0.5; + } + ScrollX = (int)(currentTick - (int)((double)Math.Max(0, mousePos.X - (int)leftMargin) / xScale) - minTicks); + }else + ScrollY -= e.Delta * MouseWheelSpeed; + } + + public override void onKeyDown (object sender, KeyEventArgs e) + { + base.onKeyDown (sender, e); + + if (e.Key == Key.F3) { + if (selEnd < 0) + return; + if (selEnd < selStart) + zoom (selEnd, selStart); + else + zoom (selStart, selEnd); + selEnd = selStart = -1; + } + } + + void zoom (long start, long end) { + //Rectangle cb = ClientRectangle; + //cb.X += (int)leftMargin; + XScale = ((double)ClientRectangle.Width - leftMargin)/(end - start); + ScrollX = (int)(start - minTicks); + } + } +} +#endif + diff --git a/Crow/src/debug/DebugLogger.cs b/Crow/src/debug/DebugLogger.cs new file mode 100644 index 00000000..38cbc2af --- /dev/null +++ b/Crow/src/debug/DebugLogger.cs @@ -0,0 +1,177 @@ +// +// CrowDebugger.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using Cairo; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; + +#if DEBUG_LOG +namespace Crow +{ + /*public class LayoutingEvent : DbgEvent { + public List<LayoutingQueueItem> lqis = new List<LayoutingQueueItem>(); + + }*/ + [Flags] + public enum DbgEvtType { + ////9 nth bit set for iface event + IFace = 0x0100, + IFaceStartLayouting = 0x0101, + IFaceEndLayouting = 0x0102, + IFaceStartClipping = 0x0103, + IFaceEndClipping = 0x0104, + IFaceStartDrawing = 0x0105, + IFaceEndDrawing = 0x0106, + IFaceUpdate = 0x0107, + //10 nth bit set for graphic obj + GraphicObject = 0x0200, + GOClassCreation = 0x0201, + GOInitialization = 0x0202, + GOClippingRegistration = 0x0203, + GORegisterClip = 0x0204, + GORegisterForGraphicUpdate = 0x0205, + GOEnqueueForRepaint = 0x0206, + GOLayouting = 0x0400, + GORegisterLayouting = 0x0607, + GOProcessLayoutingWithNoParent = 0x0608, + GOProcessLayouting = 0x0609, + GODraw = 0x020a, + GORecreateCache = 0x020b, + GOUpdateCacheAndPaintOnCTX = 0x020c, + GOPaint = 0x020d, + GONewDataSource = 0x020e, + GOLock = 0x0800, + GOLockUpdate = 0x0a01, + GOLockClipping = 0x0a02, + GOLockRender = 0x0a03, + GOLockLayouting = 0x0a04, + } + + /// <summary> + /// debug events as recorded, another class is used in the viewer + /// </summary> + public class DbgEvent { + public long begin, end; + public DbgEvtType type; + public object data = null; + + public DbgEvent() {} + + public DbgEvent(long timeStamp, DbgEvtType evt, object _data = null) { + data = _data; + type = evt; + begin = timeStamp; + end = timeStamp; + } + + public override string ToString () + { + GraphicObject go = data as GraphicObject; + if (go != null) + return string.Format ("{0};{1};{2};{3}", begin, end, type, GraphicObject.GraphicObjects.IndexOf(go).ToString()); + if (!(data is LayoutingQueueItem)) + return string.Format ("{0};{1};{2}", begin, end, type); + LayoutingQueueItem lqi = (LayoutingQueueItem)data; + if (type == DbgEvtType.GOProcessLayouting) + return string.Format ("{0};{1};{2};{3};{4};{5}", begin, end, type, GraphicObject.GraphicObjects.IndexOf(lqi.graphicObject).ToString(), lqi.LayoutType.ToString(), lqi.result.ToString()); + return string.Format ("{0};{1};{2};{3};{4}", begin, end, type, GraphicObject.GraphicObjects.IndexOf(lqi.graphicObject).ToString(), lqi.LayoutType.ToString()); + + } + } + + public static class DebugLog + { + static Surface surf; + static Context ctx; + + static Crow.Rectangle bounds = new Crow.Rectangle(0,0,8182,4096); + static double penX = 1.0; + static double ySpacing = 10.0; + static double xPenStart = 250.0; + static double xResolution = 0.001; //per tick + public static Stopwatch chrono = Stopwatch.StartNew(); + + public static List<DbgEvent> events = new List<DbgEvent>(); + public static DbgEvent currentEvent = null; + + public static DbgEvent AddEvent (DbgEvtType evtType, object data = null) { + DbgEvent evt = new DbgEvent(chrono.ElapsedTicks, evtType, data); + events.Add (evt); + return evt; + } + + static int y, level; + + static void parseTree (GraphicObject go) { + if (go == null) + return; + + + go.yIndex = y++; + go.xLevel = level++; + + Group gr = go as Group; + if (gr != null) { + foreach (GraphicObject g in gr.Children) { + parseTree (g); + } + } else { + PrivateContainer pc = go as PrivateContainer; + if (pc != null) + parseTree (pc.getTemplateRoot); + } + level--; + } + + public static void save(Interface iface) { + y = 1; + level = 0; + + foreach (GraphicObject go in iface.GraphicTree) + parseTree (go); + + using (StreamWriter s = new StreamWriter("debug.log")){ + s.WriteLine ("[GraphicObjects]"); + lock (GraphicObject.GraphicObjects) { + GraphicObject.GraphicObjects = GraphicObject.GraphicObjects.OrderBy (o => o.yIndex).ToList(); + for (int i = 0; i < GraphicObject.GraphicObjects.Count; i++) { + GraphicObject g = GraphicObject.GraphicObjects [i]; + s.WriteLine ("{0};{1};{2};{3}", i, g.GetType ().Name, g.yIndex, g.xLevel); + } + } + s.WriteLine ("[Events]"); + + foreach (DbgEvent e in events) + if (e != null) + s.WriteLine (e.ToString ()); + } + } + } +} +#endif + diff --git a/src/rsvg/DimensionData.cs b/Crow/src/rsvg/DimensionData.cs index 66aab91c..66aab91c 100644 --- a/src/rsvg/DimensionData.cs +++ b/Crow/src/rsvg/DimensionData.cs diff --git a/src/rsvg/Global.cs b/Crow/src/rsvg/Global.cs index 65917012..65917012 100644 --- a/src/rsvg/Global.cs +++ b/Crow/src/rsvg/Global.cs diff --git a/src/rsvg/Handle.cs b/Crow/src/rsvg/Handle.cs index e13f79ad..e13f79ad 100644 --- a/src/rsvg/Handle.cs +++ b/Crow/src/rsvg/Handle.cs diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 3e2b7331..8b7d2a28 100755 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -43,11 +43,11 @@ using System.Runtime.CompilerServices; // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("0.7.1.*")] +[assembly: AssemblyVersion ("0.7.1")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("crow.key")] +//[assembly: AssemblyKeyFile("crow.key")] diff --git a/Templates/ArrowBut.template b/Templates/ArrowBut.template deleted file mode 100755 index aa17d2f4..00000000 --- a/Templates/ArrowBut.template +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<Border Name="Content" - Background="vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black" Foreground="DarkGray" - MouseEnter="{Foreground=White}" - MouseLeave="{Foreground=DarkGray}" - MouseDown="{Background=vgradient|0:Black|0.1:LightGray|0.9:LightGray|1:White}" - MouseUp="{Background=vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black}" - > -</Border> diff --git a/Templates/HScrollBar.template b/Templates/HScrollBar.template deleted file mode 100755 index d896e922..00000000 --- a/Templates/HScrollBar.template +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<Border BorderWidth="1" Foreground="DimGray"> - <GenericStack Orientation="{./Orientation}" Spacing="0"> - <Shape Style="HArrowBut" MouseDown="./onScrollBack" Path="M 0.5,5.5 L 10.5,0.5 L 10.5,10.5 Z"/> - <Slider Name="Slider" - Orientation="{./Orientation}" - Value="{²./Value}" - Maximum="{./Maximum}" - CursorSize="{./CursorSize}" - Height="{./HeightPolicy}" Width="{./WidthPolicy}" - LargeIncrement="{./LargeIncrement}" - SmallIncrement="{./SmallIncrement}" - CursorColor="vgradient|0:Gray|1:DimGray" - Foreground="DimGray" - Background="vgradient|0:DimGray|0.1:Gray|0.95:Gray|1:White"/> - <Shape Style="HArrowBut" MouseDown="./onScrollForth" Path="M 0.5,0.5 L 10.5,5.5 L 0.5,10.5 Z"/> - </GenericStack> -</Border>
\ No newline at end of file diff --git a/Templates/ScrollBar.template b/Templates/ScrollBar.template deleted file mode 100755 index 93a09da0..00000000 --- a/Templates/ScrollBar.template +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<Border BorderWidth="1" Foreground="DimGray"> - <GenericStack Orientation="{./Orientation}" Spacing="0"> - <Shape Style="ArrowBut" MouseDown="./onScrollBack" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"/> - <Slider Name="Slider" - Orientation="{./Orientation}" - Value="{²./Value}" - Maximum="{./Maximum}" - CursorSize="{./CursorSize}" - Height="{./HeightPolicy}" Width="{./WidthPolicy}" - LargeIncrement="{./LargeIncrement}" - SmallIncrement="{./SmallIncrement}" - CursorColor="hgradient|0:Gray|1:DimGray" - Foreground="DimGray" - Background="hgradient|0:DimGray|0.1:Gray|0.95:Gray|1:White"/> - <Shape Style="ArrowBut" MouseDown="./onScrollForth" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,10.5 Z"/> - </GenericStack> -</Border>
\ No newline at end of file diff --git a/Templates/Tooltip.template b/Templates/Tooltip.template deleted file mode 100644 index f8b8c3fc..00000000 --- a/Templates/Tooltip.template +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<Border Fit="true" Foreground="DimGray" Background="Khaki"> - <Label Margin="3" Foreground="DimGray" Multiline="true" Text="{Tooltip}"/> -</Border> diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index 5533db56..b8e98567 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -1,325 +1,272 @@ -// -// BasicTests.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - using System; +using System.Runtime.InteropServices; using Crow; +using System.Threading; using System.Collections.Generic; using System.Linq; -using System.IO; -using System.Reflection; -using System.Text; -using System.Diagnostics; - +using System.Runtime.CompilerServices; -namespace Tests +namespace tests { - class BasicTests : CrowWindow + class MainClass : Interface { - public BasicTests () - : base(800, 600,"test: press <F3> to toogle test files") - { - } + [DllImport ("dl", CallingConvention=CallingConvention.Cdecl)] + static extern IntPtr dlopen (string file, dlmode mode); + [DllImport ("dl", CallingConvention=CallingConvention.Cdecl)] + static extern int dlclose (IntPtr handle); + //void *dlsym(void *restrict handle, const char *restrict name); [Option End] + [DllImport ("dl", CallingConvention=CallingConvention.Cdecl)] + static extern IntPtr dlsym (IntPtr libHnd, string funcName); + [DllImport ("mono-2.0", CallingConvention=CallingConvention.Cdecl)] + static extern void mono_add_internal_call (string signature, IntPtr funcPtr); - int idx = 0; - string[] testFiles; + [DllImport ("__Internal", EntryPoint="cairo_stroke", CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_stroke_internal (IntPtr ctx); + [DllImport ("__Internal", EntryPoint="cairo_rectangle", CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_rect_internal (IntPtr ctx, double x, double y, double w, double h); + [DllImport ("__Internal", EntryPoint="cairo_set_source_rgba", CallingConvention=CallingConvention.Cdecl)] + public static extern void cairo_rgba_internal (IntPtr ctx, double r, double g, double b, double a); - public Version CrowVersion { - get { - return System.Reflection.Assembly.GetAssembly(typeof(GraphicObject)).GetName().Version; - } - } + [MethodImplAttribute(MethodImplOptions.InternalCall)] + public static extern void cairo_stroke (IntPtr ctx); - #region Test values for Binding - public List<Crow.Command> Commands; - public int intValue = 500; - DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); - //DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images"); - public FileSystemInfo[] CurDirectory { - get { return curDir.GetFileSystemInfos (); } + [Flags] + enum dlmode { + RTLD_LOCAL = 0, + RTLD_LAZY = 0x00001, /* Lazy function call binding. */ + RTLD_NOW = 0x00002, /* Immediate function call binding. */ + RTLD_BINDING_MASK = 0x3, /* Mask of binding time value. */ + RTLD_NOLOAD = 0x00004, /* Do not load the object. */ + RTLD_DEEPBIND = 0x00008, /* Use deep binding. */ + RTLD_GLOBAL = 0x00100, } - public int IntValue { - get { - return intValue; - } + + const string cairoLibPath = @"/opt/cairo/lib/libcairo.so"; + //static const string cairoLibPath = @"/opt/cairo/lib/libcairo.so.2.11513.0"; + + public delegate void Stroke(IntPtr ctx); + public delegate void Cairo4Doubles (IntPtr ctx, double x, double y, double z, double w); + + public static Stroke cairo_stroke_func; + public static Cairo4Doubles cairo_rect_func; + public static Cairo4Doubles cairo_set_rgba_func; + + /*[DllImport (cairoLibPath, EntryPoint="cairo_stroke")] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public static extern void cairo_stroke_icall (IntPtr cr);*/ + + + static MainClass app; + public Command CMDTest; + public Measure TestWidth = 100; + + public Crow.IML.Instantiator instFileDlg; + + public string CurrentDirectory { + get { return Crow.Configuration.Global.Get<string>("CurrentDirectory");} set { - intValue = value; - NotifyValueChanged ("IntValue", intValue); - } - } - void onSpinnerValueChange(object sender, ValueChangeEventArgs e){ - if (e.MemberName != "Value") - return; - intValue = Convert.ToInt32(e.NewValue); - } - void change_alignment(object sender, EventArgs e){ - RadioButton rb = sender as RadioButton; - if (rb == null) - return; - NotifyValueChanged ("alignment", Enum.Parse(typeof(Alignment), rb.Caption)); - } - public IList<String> List2 = new List<string>(new string[] - { - "string1", - "string2", - "string3", -// "string4", -// "string5", -// "string6", -// "string7", -// "string8", -// "string8", -// "string8", -// "string8", -// "string8", -// "string8", -// "string9" + Crow.Configuration.Global.Set ("CurrentDirectory", value); } - ); - public IList<String> TestList2 { - set{ - List2 = value; - NotifyValueChanged ("TestList2", testList); - } - get { return List2; } } - List<Color> testList = Color.ColorDic.Values//.OrderBy(c=>c.Hue) - //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation) - .ToList(); - public List<Color> TestList { + + IList<Color> testList = Color.ColorDic.Values.ToList(); + public IList<Color> TestList { set{ testList = value; NotifyValueChanged ("TestList", testList); } get { return testList; } } - string curSources = ""; - public string CurSources { - get { return curSources; } - set { - if (value == curSources) - return; - curSources = value; - NotifyValueChanged ("CurSources", curSources); - } - } - bool boolVal = true; - public bool BoolVal { - get { return boolVal; } - set { - if (boolVal == value) - return; - boolVal = value; - NotifyValueChanged ("BoolVal", boolVal); + /*public List<KeyValuePair<DbgEvtType, Color>> ColorsKVPList { + get { + return DbgLogViewer.colors.ToList(); } + }*/ + + protected override void InitBackend () + { + base.InitBackend (); + //Keyboard.KeyDown += App_KeyboardKeyDown; } + public static void Main(string[] args) + { + //IntPtr cairoLib = dlopen (cairoLibPath, dlmode.RTLD_LAZY); - #endregion - void OnClear (object sender, MouseButtonEventArgs e) => TestList = null; - void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = - Color.ColorDic.Values.OrderBy(c=>c.Hue).ToList(); + //mono_add_internal_call ("tests.MainClass:cairo_stroke_icall(IntPtr cr)", strokeFuncPtr); - void command1(){ - Console.WriteLine("command1 triggered"); - } - void command2(){ - Console.WriteLine("command2 triggered"); - } - void command3(){ - Console.WriteLine("command3 triggered"); - } - void command4(){ - Console.WriteLine("command4 triggered"); - } + /*cairo_stroke_func = Marshal.GetDelegateForFunctionPointer<Stroke>(dlsym (cairoLib, "cairo_stroke")); + cairo_rect_func = Marshal.GetDelegateForFunctionPointer<Cairo4Doubles>(dlsym (cairoLib, "cairo_rectangle")); + cairo_set_rgba_func = Marshal.GetDelegateForFunctionPointer<Cairo4Doubles>(dlsym (cairoLib, "cairo_set_source_rgba")); +*/ + foreach (string s in System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceNames()) + { + Console.WriteLine(s); + } + - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); -// -// foreach (Color c in Color.ColorDic.Values) { -// if (string.IsNullOrEmpty(c.htmlCode)) -// Console.WriteLine ("no htmlcode for {0}", c.Name); -// else if (c.htmlCode.Substring(1) != c.HtmlCode) -// Console.WriteLine ("{2} orig: {0} comp: {1}",c.htmlCode, c.HtmlCode, c.Name); -// } + using (app = new MainClass ()) { + // XWindow win = new XWindow (app); + // win.Show (); + //app.LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Grey' Width='30' Height='50%'/>"); + app.CMDTest = new Command(new Action(() => app.AddWidget (app.instFileDlg.CreateInstance()).DataSource = app)) { Caption = "Test", Icon = new SvgPicture("#Tests.image.blank-file.svg"), CanExecute = true}; + //app.AddWidget (@"Interfaces/Divers/testFocus.crow").DataSource = app; + //app.AddWidget (@"Interfaces/Divers/testMenu.crow").DataSource = app; + //app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app; + app.AddWidget (@"Interfaces/Divers/0.crow").DataSource = app; + //app.AddWidget (@"Interfaces/Splitter/1.crow").DataSource = app; + //app.AddWidget (@"Interfaces/GraphicObject/0.crow").DataSource = app; + //app.AddWidget (@"Interfaces/TemplatedContainer/test_Listbox.crow").DataSource = app; - Commands = new List<Crow.Command> (new Crow.Command[] { - new Crow.Command(new Action(() => command1())) { Caption = "command1"}, - new Crow.Command(new Action(() => command2())) { Caption = "command2"}, - new Crow.Command(new Action(() => command3())) { Caption = "command3"}, - new Crow.Command(new Action(() => command4())) { Caption = "command4"}, - }); + /*app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment + (app, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}'/>");*/ + - this.KeyDown += KeyboardKeyDown1; + //app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app; + //app.AddWidget ("Interfaces/Divers/perfMeasures.crow").DataSource = app; - //testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" }; - testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; - //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" }; - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray (); - //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray (); + /*app.AddWidget ("#Tests.ui.dbgLog.crow").DataSource = app; - Load(testFiles[idx]).DataSource = this; + GraphicObject go = app.AddWidget ("#Tests.ui.dbgLogColors.crow"); + go.DataSource = app; -// LoadIMLFragment (@"<DockWindow Width=""150"" Height=""150"" Background=""DarkRed"" />", 0); -// LoadIMLFragment (@"<DockWindow Width=""200"" Height=""150"" Background=""DarkGreen"" />", 0); -// LoadIMLFragment (@"<DockWindow Width=""250"" Height=""150"" Background=""Brown"" />", 0); -// LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0); + (go.FindByName("combo") as ComboBox).SelectedItemChanged += combo_selectedItemChanged; + (go.FindByName("kvpList") as ListBox).SelectedItemChanged += kvpList_selectedItemChanged;*/ + //app.AddWidget (@"Interfaces/Experimental/testDock.crow").DataSource = app; - } - void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e) - { - try { - - if (e.Key == OpenTK.Input.Key.Escape) { - Quit (null, null); - return; - } else if (e.Key == OpenTK.Input.Key.F1) { - TestList.Add ("new string"); - NotifyValueChanged ("TestList", TestList); - return; - } else if (e.Key == OpenTK.Input.Key.F4) { - GraphicObject w = Load ("Interfaces/TemplatedContainer/testWindow.goml"); - w.DataSource = this; - return; - } else if (e.Key == OpenTK.Input.Key.F5) { - GraphicObject w = Load ("Interfaces/Divers/testFileDialog.crow"); - w.DataSource = this; - return; - }else if (e.Key == OpenTK.Input.Key.F6) { - GraphicObject w = Load ("Interfaces/Divers/0.crow"); - w.DataSource = this; - return; - }else if (e.Key == OpenTK.Input.Key.F7) { - GraphicObject w = Load ("Interfaces/Divers/perfMeasures.crow"); - w.DataSource = this.ifaceControl[0]; - return; - } else if (e.Key == OpenTK.Input.Key.F2) - idx--; - else if (e.Key == OpenTK.Input.Key.F3) - idx++; - else - return; + /*app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock1'/>"); + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock2'/>"); + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock3'/>"); - ClearInterface (); + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>"); + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>"); + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>");*/ - if (idx == testFiles.Length) - idx = 0; - else if (idx < 0) - idx = testFiles.Length - 1; + long cpt = 0; + Measure testWidth = 100; + int increment = 1; - this.Title = testFiles [idx] + ". Press <F3> to cycle examples."; + while (true) { + cpt++; + /* + testWidth += increment; - GraphicObject obj = Load (testFiles[idx]); - obj.DataSource = this; - } catch (Exception ex) { - MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException.Message).Modal = true; + if (increment > 0) { + if (testWidth > 500) + increment = -increment; + } else if (testWidth < 100) + increment = -increment; + app.NotifyValueChanged ("TestWidth", testWidth); +*/ + + /*app.NotifyValueChanged ("CPT", cpt); + + if (cpt % 2 == 0) + app.NotifyValueChanged ("TestColor", Color.Red); + else + app.NotifyValueChanged ("TestColor", Color.Blue);*/ + + /*#if MEASURE_TIME + foreach (PerformanceMeasure m in app.PerfMeasures) + m.NotifyChanges (); + #endif*/ + app.ProcessEvents (); + //Thread.Sleep(1); + } } + /*using (Display disp = new Display()) + { + Window win = new Window(disp); + bool running = true; + + while (running) { + IntPtr evt = disp.NextEvent; + + switch ((EventType)Marshal.ReadInt32(evt)) + { + case EventType.KeyPress: + running = false; + break; + } + } + }*/ + + + //dlclose (cairoLib); } -// void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e) -// { -// FileInfo fi = e.NewValue as FileInfo; -// if (fi == null) -// return; -// if (fi.Extension == ".crow" || fi.Extension == ".goml") { -// Instantiator i = new Instantiator(fi.FullName); -// lock (ifaceControl.CrowInterface.UpdateMutex) { -// (ifaceControl.CrowInterface.FindByName ("crowContainer") as Container).SetChild -// (i.CreateInstance(ifaceControl.CrowInterface)); -// //CurSources = i.GetImlSourcesCode(); -// } -// } -// } -// void onImlSourceChanged(Object sender, TextChangeEventArgs e){ -// Instantiator i; -// try { -// i = Instantiator.CreateFromImlFragment (e.Text); -// } catch (Exception ex) { -// Debug.WriteLine (ex); -// return; -// } -// lock (ifaceControl.CrowInterface.UpdateMutex) { -// (ifaceControl.CrowInterface.FindByName ("crowContainer") as Container).SetChild -// (i.CreateInstance(ifaceControl.CrowInterface)); -// } -// } - void onButClick(object send, MouseButtonEventArgs e) + + /*void onColorUpdate (object sender, MouseButtonEventArgs e) { - Console.WriteLine ("button clicked:" + send.ToString()); + DbgLogViewer.colorsConf.Set (selectedEvtType.ToString (), newColor); + DbgLogViewer.colors [selectedEvtType] = newColor; + NotifyValueChanged ("ColorsKVPList", ColorsKVPList); } - void onAddTabButClick(object sender, MouseButtonEventArgs e){ + //static DbgEvtType selectedEvtType; + static Color newColor; - TabView tv = FindByName("tabview1") as TabView; - if (tv == null) + static void kvpList_selectedItemChanged (object sender, SelectionChangeEventArgs e) + { + if (e.NewValue == null) return; - //tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" }); - lock (CurrentInterface.UpdateMutex) { - tv.AddChild (CurrentInterface.LoadIMLFragment - (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>")); - } + selectedEvtType = ((KeyValuePair<DbgEvtType, Color>)e.NewValue).Key; } - [STAThread] - static void Main () + static void combo_selectedItemChanged (object sender, SelectionChangeEventArgs e) { - #if DEBUG - TextWriterTraceListener listener = new TextWriterTraceListener ("debug.log"); - Debug.Listeners.Add (listener); - #endif + newColor = (Color)e.NewValue; - Console.WriteLine ("starting example"); - BasicTests win = new BasicTests (); - win.VSync = OpenTK.VSyncMode.Adaptive; - win.Run (30); - #if DEBUG - listener.Dispose (); - #endif - } - protected override void OnUpdateFrame (OpenTK.FrameEventArgs e) + }*/ + + void App_KeyboardKeyDown (object sender, KeyEventArgs e) { - base.OnUpdateFrame (e); - string test = e.Time.ToString (); - IntValue++; - if (IntValue == 1000) - IntValue = 0; - NotifyValueChanged ("PropertyLessBinding", test); + Console.WriteLine((byte)e.Key); + //#if DEBUG_LOG + switch (e.Key) { + case Key.F2: + //DebugLog.save (app); + break; + case Key.F4: + //app.NotifyValueChanged ("ColorsKVPList", app.ColorsKVPList); + break; + case Key.F6: + app.LoadIMLFragment (@"<FileDialog Caption='Open File'/>"); + //saveDocking (); + break; + case Key.F7: + //reloadDocking (); + break; + case Key.F8: + app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>"); + break; + } + //#endif + } + + void saveDocking () { + DockStack ds = FindByName ("mainDock") as DockStack; + if (ds == null) { + Console.WriteLine ("main dock not found in graphic tree"); + return; + } + string conf = ds.ExportConfig (); + Console.WriteLine ("docking conf = " + conf); + Configuration.Global.Set ("DockingTests", conf); } - void onNew(object sender, EventArgs e){ - Debug.WriteLine ("menu new clicked"); + void reloadDocking () { + DockStack ds = FindByName ("mainDock") as DockStack; + if (ds == null) { + Console.WriteLine ("main dock not found in graphic tree"); + return; + } + + string conf = Configuration.Global.Get<string> ("DockingTests"); + if (string.IsNullOrEmpty (conf)) + return; + + + ds.ImportConfig (conf); } } } diff --git a/Tests/CrowWindow.cs b/Tests/CrowWindow.cs deleted file mode 100644 index 1be9bb45..00000000 --- a/Tests/CrowWindow.cs +++ /dev/null @@ -1,411 +0,0 @@ -// -// CrowWindow.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Threading; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using System.Collections.Generic; - -namespace Crow -{ - public class CrowWindow : GameWindow, IValueChange - { - #region IValueChange implementation - public event EventHandler<ValueChangeEventArgs> ValueChanged; - public virtual void NotifyValueChanged(string MemberName, object _value) - { - if (ValueChanged != null) - ValueChanged.Invoke(this, new ValueChangeEventArgs(MemberName, _value)); - } - #endregion - - #region FPS - int frameCpt = 0; - int _fps = 0; - - public int fps { - get { return _fps; } - set { - if (_fps == value) - return; - - _fps = value; - #if MEASURE_TIME - if (_fps > fpsMax) { - fpsMax = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax)); - } else if (_fps < fpsMin) { - fpsMin = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin)); - } - #endif - if (frameCpt % 3 == 0) { - ValueChanged.Raise (this, new ValueChangeEventArgs ("fps", _fps)); - #if MEASURE_TIME - foreach (PerformanceMeasure m in ifaceControl[0].PerfMeasures) - m.NotifyChanges (); - #endif - } - } - } - - #if MEASURE_TIME - public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10); - - public int fpsMin = int.MaxValue; - public int fpsMax = 0; - - void resetFps () - { - fpsMin = int.MaxValue; - fpsMax = 0; - _fps = 0; - } - #endif - - #endregion - - #region ctor - public CrowWindow(int _width = 800, int _height = 600, string _title="Crow", - int colors = 32, int depth = 24, int stencil = 0, int samples = 1, - int major=3, int minor=3) - : this(_width, _height, new OpenTK.Graphics.GraphicsMode(colors, depth, stencil, samples), - _title,GameWindowFlags.Default,DisplayDevice.Default, - major,minor,OpenTK.Graphics.GraphicsContextFlags.Default) - { - } - public CrowWindow (int width, int height, OpenTK.Graphics.GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, OpenTK.Graphics.GraphicsContextFlags flags) - : base(width,height,mode,title,options,device,major,minor,flags) - { - } - - #endregion - - protected Shader shader; - public List<InterfaceControler> ifaceControl = new List<InterfaceControler>(); - int focusedIdx = -1, activeIdx = -2; - - // TODO:We should be able to set the current interface programmaticaly - /// <summary> - /// Gets the currently focused interface, focus could have been given by creation of new iface controler and - /// not only by the mouse - /// </summary> - public Interface CurrentInterface { - get { - checkDefaultIFace (); - return ifaceControl [focusedIdx].CrowInterface; - } - } - - void addInterfaceControler(InterfaceControler ifaceControler) - { - ifaceControler.CrowInterface.Quit += Quit; - ifaceControler.CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged; - - ifaceControl.Add (ifaceControler); - focusedIdx = ifaceControl.Count - 1; - } - void openGLDraw(){ - //save GL states - bool blend, depthTest, cullFace; - GL.GetBoolean (GetPName.Blend, out blend); - GL.GetBoolean (GetPName.DepthTest, out depthTest); - GL.GetBoolean (GetPName.CullFace, out cullFace); - GL.Enable (EnableCap.Blend); - GL.Disable (EnableCap.DepthTest); - GL.Disable (EnableCap.CullFace); - - #if MEASURE_TIME - glDrawMeasure.StartCycle(); - #endif - - shader.Enable (); - for (int i = 0; i < ifaceControl.Count; i++) { - shader.SetMVP (ifaceControl [i].InterfaceMVP); - ifaceControl [i].OpenGLDraw (); - } - - #if MEASURE_TIME - glDrawMeasure.StopCycle(); - #endif - - //restore GL states - if (!blend) - GL.Disable (EnableCap.Blend); - if (depthTest) - GL.Enable (EnableCap.DepthTest); - if (cullFace) - GL.Enable (EnableCap.CullFace); - } - - public void Quit (object sender, EventArgs e) - { - foreach (InterfaceControler ic in ifaceControl) { - ic.Dispose (); - } - this.Exit (); - } - void CrowInterface_MouseCursorChanged (object sender, MouseCursorChangedEventArgs e) - { - this.Cursor = new MouseCursor( - (int)e.NewCursor.Xhot, - (int)e.NewCursor.Yhot, - (int)e.NewCursor.Width, - (int)e.NewCursor.Height, - e.NewCursor.data); - } - - #region Events - //those events are raised only if mouse isn't in a graphic object - public event EventHandler<OpenTK.Input.MouseWheelEventArgs> CrowMouseWheel; - public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseUp; - public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseDown; - public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseClick; - public event EventHandler<OpenTK.Input.MouseMoveEventArgs> CrowMouseMove; - public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyDown; - public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyUp; - - #endregion - - public ProjectiveIFaceControler Add3DInterface(int width, int height, Matrix4 ifaceModelMat){ - ProjectiveIFaceControler tmp = new ProjectiveIFaceControler (new Rectangle (0, 0, width, height), ifaceModelMat); - addInterfaceControler (tmp); - return tmp; - } - public GraphicObject AddWidget (string path) - { - GraphicObject tmp = Load (path); - return tmp; - } - public GraphicObject AddWidget (GraphicObject g, int interfaceIdx = 0){ - checkDefaultIFace (); - ifaceControl [interfaceIdx].CrowInterface.AddWidget (g); - return g; - } - - public void DeleteWidget (GraphicObject g, int interfaceIdx = 0){ - ifaceControl [interfaceIdx].CrowInterface.DeleteWidget (g); - } - /// <summary> - /// check if a default interface exists, create one if not - /// </summary> - void checkDefaultIFace (){ - if (ifaceControl.Count == 0) {//create default orthogonal interface - addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); - focusedIdx = 0; - } - } - /// <summary> - /// Load the content of the IML file pointed by path and add it to the current interface - /// graphic tree. - /// </summary> - /// <param name="path">the path of the IML file to load</param> - /// <param name="interfaceIdx">interface index to bind to, a default one is created if none exists</param> - public GraphicObject Load (string path, int interfaceIdx = 0){ - checkDefaultIFace(); - return ifaceControl [interfaceIdx].CrowInterface.AddWidget (path); - } - /// <summary> - /// Load the content of the IML string passed as first argument and add it to the current interface - /// graphic tree. - /// </summary> - /// <param name="path">a valid IML string</param> - /// <param name="interfaceIdx">interface index to bind to, a default one is created if none exists</param> - public void LoadIMLFragment (string imlFragment, int interfaceIdx = 0){ - checkDefaultIFace(); - ifaceControl [interfaceIdx].CrowInterface.LoadIMLFragment (imlFragment); - } - - public GraphicObject FindByName (string nameToFind){ - for (int i = 0; i < ifaceControl.Count; i++) { - GraphicObject tmp = ifaceControl [i].CrowInterface.FindByName (nameToFind); - if (tmp != null) - return tmp; - } - return null; - } - public void ClearInterface (int interfaceIdx = 0){ - ifaceControl [interfaceIdx].CrowInterface.ClearInterface (); - } - /// <summary>Override this method for your OpenGL rendering calls</summary> - public virtual void OnRender(FrameEventArgs e) - { - } - /// <summary>Override this method to customize clear method between frames</summary> - public virtual void GLClear() - { - GL.Clear (ClearBufferMask.ColorBufferBit|ClearBufferMask.DepthBufferBit); - } - - #region Game win overrides - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - this.KeyPress += new EventHandler<OpenTK.KeyPressEventArgs>(OpenTKGameWindow_KeyPress); - KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown); - KeyUp += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyUp); - - MouseWheel += new EventHandler<OpenTK.Input.MouseWheelEventArgs>(GL_Mouse_WheelChanged); - MouseDown += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonDown); - MouseUp += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonUp); - MouseMove += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(GL_Mouse_Move); - - #if DEBUG - Console.WriteLine("\n\n*************************************"); - Console.WriteLine("GL version: " + GL.GetString (StringName.Version)); - Console.WriteLine("GL vendor: " + GL.GetString (StringName.Vendor)); - Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion)); - Console.WriteLine("*************************************\n"); - #endif - - shader = new Shader (); - shader.Enable (); - - GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f); - } - protected override void OnUpdateFrame(FrameEventArgs e) - { - base.OnUpdateFrame(e); - fps = (int)RenderFrequency; - - #if MEASURE_TIME - if (frameCpt > 500) { - resetFps (); - frameCpt = 0; -// #if DEBUG -// GC.Collect(); -// GC.WaitForPendingFinalizers(); -// NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString()); -// #endif - } - #endif - - frameCpt++; - } - protected override void OnRenderFrame(FrameEventArgs e) - { - GLClear (); - - base.OnRenderFrame(e); - - OnRender (e); - openGLDraw (); - - - SwapBuffers (); - } - protected override void OnResize(EventArgs e) - { - base.OnResize (e); - for (int i = 0; i < ifaceControl.Count; i++) { - ifaceControl[i].ProcessResize( - new Rectangle( - 0, - 0, - this.ClientRectangle.Width, - this.ClientRectangle.Height)); - } - } - #endregion - - #region Mouse and Keyboard Handling - void update_mouseButtonStates(ref MouseState e, OpenTK.Input.MouseState otk_e){ - for (int i = 0; i < MouseState.MaxButtons; i++) { - if (otk_e.IsButtonDown ((OpenTK.Input.MouseButton)i)) - e.EnableBit (i); - } - } - protected virtual void GL_Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs otk_e) - { - if (activeIdx == -2) { - for (int i = 0; i < ifaceControl.Count; i++) { - if (ifaceControl [i].ProcessMouseMove (otk_e.X, otk_e.Y)) { - focusedIdx = i; - return; - } - } - } if (ifaceControl [focusedIdx].ProcessMouseMove (otk_e.X, otk_e.Y)) - return; - - CrowMouseMove.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs otk_e) - { - activeIdx = -2; - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseButtonUp ((int)otk_e.Button)) - return; - } - CrowMouseUp.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs otk_e) - { - activeIdx = focusedIdx; - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseButtonDown ((int)otk_e.Button)) - return; - } - CrowMouseDown.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseWheelChanged (otk_e.DeltaPrecise)) - return; - } - CrowMouseWheel.Raise (sender, otk_e); - } - - protected virtual void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyDown((int)otk_e.Key)) - return; - } - CrowKeyDown.Raise (this, otk_e); - } - protected virtual void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyUp((int)otk_e.Key)) - return; - } - CrowKeyUp.Raise (this, otk_e); - } - protected virtual void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyPress (e.KeyChar)) - return; - } - //TODO:create keyboardkeypress evt - } - #endregion - } -} diff --git a/Tests/GOLIBTest_DirViewer.cs b/Tests/GOLIBTest_DirViewer.cs deleted file mode 100644 index f17afb9b..00000000 --- a/Tests/GOLIBTest_DirViewer.cs +++ /dev/null @@ -1,101 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -using System.Diagnostics; - -//using GGL; -using Crow; -using System.Threading; -using System.Reflection; -using System.Linq; -using System.IO; -using System.Collections.Generic; - - -namespace test2 -{ - class GOLIBTest_DirViewer : OpenTKGameWindow - { - public GOLIBTest_DirViewer () - : base(1024, 600,"test") - {} - - public DirContainer CurDir; - FileDialog dialog; - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - - CurDir = new DirContainer(new DirectoryInfo ("/home/jp/")); - -// GraphicObject dv = Interface.Load ("Interfaces/testDirViewer.goml"); -// this.AddWidget(dv); -// dv.DataSource = CurDir; - dialog = new FileDialog(); - dialog.SearchPattern = ".png|.jpg|.jpeg|.gif|.svg"; - dialog.Show (); - - //LoadInterface("Interfaces/testTypeViewer.goml", out g); - } - - - [STAThread] - static void Main () - { - Console.WriteLine ("starting example"); - - using (GOLIBTest_DirViewer win = new GOLIBTest_DirViewer( )) { - win.Run (30.0); - } - } - } - public class DirContainer: IValueChange - { - #region IValueChange implementation - public event EventHandler<ValueChangeEventArgs> ValueChanged; - public void NotifyValueChanged(string name, object value) - { - ValueChanged.Raise (this, new ValueChangeEventArgs (name, value)); - } - #endregion - - public DirectoryInfo CurDir; - public DirContainer(DirectoryInfo _dir){ - CurDir = _dir; - } - public string Name { - get { return CurDir.Name; } - } - public FileSystemInfo[] GetFileSystemInfos - { - get { - List<FileSystemInfo> tmp = CurDir.GetFileSystemInfos ().Where(fi => !fi.Attributes.HasFlag(FileAttributes.Hidden)).ToList(); - if (CurDir.Parent != null) - tmp.Insert (0, CurDir.Parent); - return tmp.ToArray (); - } - } - void onDirUp(object sender, MouseButtonEventArgs e) - { - - } - public void onMouseDown(object sender, MouseButtonEventArgs e) - { - Debug.WriteLine (sender.ToString ()); - } - void OnSelectedItemChanged (object sender, SelectionChangeEventArgs e) - { - CurDir = e.NewValue as DirectoryInfo; - NotifyValueChanged ("GetFileSystemInfos", GetFileSystemInfos); - NotifyValueChanged ("Name", Name); - - } - } - -}
\ No newline at end of file diff --git a/Tests/GOLIBTest_Listbox.cs b/Tests/GOLIBTest_Listbox.cs deleted file mode 100644 index 76631020..00000000 --- a/Tests/GOLIBTest_Listbox.cs +++ /dev/null @@ -1,127 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -using System.Diagnostics; - -//using GGL; -using Crow; -using System.Threading; -using System.Collections.Generic; -using System.IO; -using System.Linq; - - -namespace test -{ - public class ClsItem - { -// #region IValueChange implementation -// -// public event EventHandler<ValueChangeEventArgs> ValueChanged; -// -// #endregion - - public string field; - - public string Field { - get { - return field; - } - set { - field = value; - //ValueChanged.Raise(this, new ValueChangeEventArgs ("Field", null, field)); - } - } - - public ClsItem(){ - } - public ClsItem(string str){ - Field = str; - } - } - - class GOLIBTest_Listbox : OpenTKGameWindow, IValueChange - { - #region IValueChange implementation - - public event EventHandler<ValueChangeEventArgs> ValueChanged; - - #endregion - - public GOLIBTest_Listbox () - : base(1024, 600,"test") - {} - -// public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[] -// { -// new ClsItem("string 1"), -// new ClsItem("string 2"), -// new ClsItem("string 3") -// }); - public List<string> TestList;/* = new List<string>( new string[] - { - "string 1", - "string 2", - "string 3" - }); */ - - public String Hover { - get { return hoverWidget == null ? "None" : hoverWidget.ToString(); } - } - Point mPos; - public string MousePos { - get { return mPos.ToString(); } - } - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - - //TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); - GraphicObject tlb = LoadInterface("Interfaces/test_Listbox.goml"); - tlb.DataSource = this; - -// TestList [1].Field = "test string"; -// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); - } - void OnClear (object sender, MouseButtonEventArgs e){ - TestList = null; - ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); - } - void OnLoadList (object sender, MouseButtonEventArgs e){ - TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); - ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); - } -// protected override void OnMouseMove (MouseMoveEventArgs e) -// { -// base.OnMouseMove (e); -// ValueChanged.Raise (this, new ValueChangeEventArgs ("Hover", Hover)); -// ValueChanged.Raise (this, new ValueChangeEventArgs ("MousePos", e.Position.ToString())); -// } - - protected override void OnUpdateFrame (FrameEventArgs e) - { - base.OnUpdateFrame (e); - } -// protected override void OnKeyDown (KeyboardKeyEventArgs e) -// { -// TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); -// //TestList.Add ("newly added list item"); -// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); -// } - - [STAThread] - static void Main () - { - Console.WriteLine ("starting example"); - - using (GOLIBTest_Listbox win = new GOLIBTest_Listbox( )) { - win.Run (30.0); - } - } - } -}
\ No newline at end of file diff --git a/Tests/GOLIBTest_TypeViewer.cs b/Tests/GOLIBTest_TypeViewer.cs deleted file mode 100644 index 39e5a527..00000000 --- a/Tests/GOLIBTest_TypeViewer.cs +++ /dev/null @@ -1,84 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -using System.Diagnostics; - -//using GGL; -using Crow; -using System.Threading; -using System.Reflection; -using System.Linq; - - -namespace test -{ - class GOLIBTest_TypeViewer : OpenTKGameWindow - { - public GOLIBTest_TypeViewer () - : base(1024, 600,"test") - {} - - VerticalStack g; - TypeContainer type; - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - type = new TypeContainer(typeof (GraphicObject)); - - //this.AddWidget(Interface.Load ("Interfaces/testTypeViewer.goml", type)); - GraphicObject go = LoadInterface("Interfaces/testTypeViewer.goml"); - go.DataSource = type; - } - - protected override void OnRenderFrame (FrameEventArgs e) - { - GL.Clear (ClearBufferMask.ColorBufferBit); - base.OnRenderFrame (e); - SwapBuffers (); - - MemberInfo mi; - - - } - - [STAThread] - static void Main () - { - Console.WriteLine ("starting example"); - - using (GOLIBTest_TypeViewer win = new GOLIBTest_TypeViewer( )) { - win.Run (30.0); - } - } - } - public class TypeContainer - { - public Type Type; - public TypeContainer(Type _type){ - Type = _type; - } - public string Name { - get { return Type.Name; } - } - public MemberInfo[] Members { - get { - MemberInfo[] mi = Properties.Cast<MemberInfo> ().Concat (Methods.Cast<MemberInfo> ()).ToArray(); - return mi; - } - } - public MethodInfo[] Methods { - get { return Type.GetMethods (BindingFlags.Public | BindingFlags.Instance).Where (m => !m.IsSpecialName).ToArray(); } - } - public PropertyInfo[] Properties { - get { return Type.GetProperties (); } - } - - } - -}
\ No newline at end of file diff --git a/Tests/GOLIBTest_Window.cs b/Tests/GOLIBTest_Window.cs deleted file mode 100644 index e2a96e96..00000000 --- a/Tests/GOLIBTest_Window.cs +++ /dev/null @@ -1,125 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using OpenTK.Input; - -using System.Diagnostics; - -//using GGL; -using go; -using System.Threading; - - -namespace test -{ - class GOLIBTest_Window : OpenTKGameWindow , IValueChange - { - #region IValueChange implementation - public event EventHandler<ValueChangeEventArgs> ValueChanged; - #endregion - - #region FPS - int _fps = 0; - - public int fps { - get { return _fps; } - set { - if (_fps == value) - return; - - _fps = value; - - if (_fps > fpsMax) { - fpsMax = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax)); - } else if (_fps < fpsMin) { - fpsMin = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin)); - } - - if (ValueChanged != null) - ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps)); - } - } - string name = "testName"; - - public string Name { - get { - return name; - } - set { - name = value; - } - } - - public int fpsMin = int.MaxValue; - public int fpsMax = 0; - - void resetFps () - { - fpsMin = int.MaxValue; - fpsMax = 0; - _fps = 0; - } - #endregion - - public GOLIBTest_Window () - : base(800, 600,"test") - {} - - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - LoadInterface("Interfaces/testWindow.goml"); - LoadInterface("Interfaces/testWindow.goml"); -// LoadInterface("Interfaces/testWindow.goml", out g); -// LoadInterface("Interfaces/testWindow.goml", out g); -// LoadInterface("Interfaces/testWindow.goml", out g); -// LoadInterface("Interfaces/testWindow.goml", out g); -// LoadInterface("Interfaces/testWindow.goml", out g); - CursorVisible = true; - } - - - private int frameCpt = 0; - protected override void OnUpdateFrame (FrameEventArgs e) - { - base.OnUpdateFrame (e); - - fps = (int)RenderFrequency; - - if (frameCpt > 200) { - resetFps (); - frameCpt = 0; - - } - frameCpt++; - } - - protected override void OnKeyDown (KeyboardKeyEventArgs e) - { - base.OnKeyDown (e); - this.Quit (); - } - - void butQuitPress (object sender, MouseButtonEventArgs e) - { - DeleteWidget (sender as GraphicObject); - } - - [STAThread] - static void Main () - { - Console.WriteLine ("starting example"); - - using (GOLIBTest_Window win = new GOLIBTest_Window( )) { - win.Run (30.0); - } - } - } -}
\ No newline at end of file diff --git a/Tests/GOLIBTest_deviceOffset.cs b/Tests/GOLIBTest_deviceOffset.cs deleted file mode 100644 index 96486db3..00000000 --- a/Tests/GOLIBTest_deviceOffset.cs +++ /dev/null @@ -1,88 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using OpenTK.Input; - -using System.Diagnostics; - -//using GGL; -using go; -using System.Threading; - - -namespace test6 -{ - class GOLIBTest_0 : OpenTKGameWindow - { - public GOLIBTest_0 () - : base(1024, 600,"test") - {} - - GraphicObject g; - Label l; - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - g = LoadInterface("Interfaces/test0.goml"); - l = g.FindByName ("labCpt") as Label; - } - - void onUp (object sender, MouseButtonEventArgs e) - { - decimal tmp = 0; - if (!decimal.TryParse (l.Text, out tmp)) - return; - - tmp += 1; - l.Text = tmp.ToString (); - } - void onDown (object sender, MouseButtonEventArgs e) - { - decimal tmp = 0; - if (!decimal.TryParse (l.Text, out tmp)) - return; - - tmp -= 1; - l.Text = tmp.ToString (); - } - - protected override void OnKeyDown (KeyboardKeyEventArgs e) - { - switch (e.Key) { - case Key.Left: - g.Left++; - break; - case Key.Right: - g.Left--; - break; - case Key.Up: - g.Top--; - break; - case Key.Down: - g.Top++; - break; - default: - break; - } - } - protected override void OnUpdateFrame (FrameEventArgs e) - { - base.OnUpdateFrame (e); - } - - [STAThread] - static void Main () - { - Console.WriteLine ("starting example"); - - using (GOLIBTest_0 win = new GOLIBTest_0( )) { - win.Run (30.0); - } - } - } -}
\ No newline at end of file diff --git a/Tests/GraphicObjects/LaggingGraphicObject.cs b/Tests/GraphicObjects/LaggingGraphicObject.cs new file mode 100644 index 00000000..82cf0bfc --- /dev/null +++ b/Tests/GraphicObjects/LaggingGraphicObject.cs @@ -0,0 +1,86 @@ +// +// SimpleGauge.cs +// +// Author: +// jp <> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using Crow; +using System.ComponentModel; +using Cairo; +using System.Diagnostics; + +namespace Crow +{ + public class LaggingGraphicObject : GraphicObject + { + protected override void onDraw (Context gr) + { + base.onDraw (gr); + + Stopwatch t = Stopwatch.StartNew (); + + IntPtr ctxHnd = gr.Handle; + + for (int i = 0; i < 1000000; i++) { + + /*gr.SetSourceRGBA (1.0,0.0,0.0,1.0); + gr.Rectangle (0, 0, 100, 100); + gr.Stroke ();*/ + + /*Cairo.NativeMethods.SetSourceRGBA (ctxHnd, 1.0,0.0,0.0,1.0); + Cairo.NativeMethods.Rectangle (ctxHnd, 0, 0, 100, 100); + Cairo.NativeMethods.Stroke (ctxHnd);*/ + + + //tests.MainClass.cairo_set_rgba_func (ctxHnd, 1.0,0.0,0.0,1.0); + //tests.MainClass.cairo_rect_func (ctxHnd, 0, 0, 100, 100); + //tests.MainClass.cairo_stroke_func (ctxHnd); + + tests.MainClass.cairo_rgba_internal (ctxHnd, 1.0,0.0,0.0,1.0); + tests.MainClass.cairo_rect_internal (ctxHnd, 0, 0, 100, 100); + tests.MainClass.cairo_stroke_internal (ctxHnd); + //tests.MainClass.cairo_stroke (ctxHnd); + //tests.MainClass.cairo_stroke_icall (ctxHnd); + + + + } + + + t.Stop (); + + Console.WriteLine("elapsed ticks = {0}", t.ElapsedTicks); + + //System.Threading.Thread.Sleep (1000); + + } + + public override void onMouseMove (object sender, MouseMoveEventArgs e) + { + + + RegisterForRedraw (); + } + } +} + diff --git a/Tests/Hello3D.cs b/Tests/Hello3D.cs deleted file mode 100644 index 2730bb63..00000000 --- a/Tests/Hello3D.cs +++ /dev/null @@ -1,154 +0,0 @@ -// -// Hello3D.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using Crow; - -namespace Tests -{ - class Hello3D : CrowWindow - { - [STAThread] - static void Main () - { - Hello3D win = new Hello3D (); - win.Run (30); - } - - public Hello3D () - : base(800, 600,"Crow Test with OpenTK") - { - } - - public Matrix4 modelview, projection; - public int[] viewport = new int[4]; - public Vector3 vEyeTarget = new Vector3(0f, 0f, 0f); - public Vector3 vEye; - public Vector3 vLookInit = Vector3.Normalize(new Vector3(-1.0f, -1.0f, 1.0f)); - public Vector3 vLook; // Camera vLook Vector - public float zNear = 0.001f, zFar = 300.0f; - public float fovY = (float)Math.PI / 4; - public float eyeDist = 10.2f; - public float viewZangle, viewXangle; - public const float MoveSpeed = 0.02f; - public const float RotationSpeed = 0.005f; - public const float ZoomSpeed = 0.22f; - - vaoMesh cube; - Texture texture; - ProjectiveIFaceControler iface3D; - - void initGL(){ - GL.Enable (EnableCap.CullFace); - GL.Enable (EnableCap.Blend); - GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); - - cube = vaoMesh.CreateCube (); - texture = new Texture ("image/textest.png"); - } - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - - CrowMouseMove += HelloCube_MouseMove; - CrowMouseWheel += Hello3D_MouseWheelChanged; - - iface3D = Add3DInterface (800, 800, - Matrix4.CreateScale (6f) * - Matrix4.CreateRotationX (MathHelper.PiOver2) * - Matrix4.CreateTranslation (Vector3.UnitY * -1.1f)); - Load (@"Interfaces/Divers/0.crow").DataSource = this; - initGL (); - shader.Enable (); - } - - protected override void OnResize (EventArgs e) - { - base.OnResize (e); - UpdateViewMatrix (); - } - - public override void OnRender (FrameEventArgs e) - { - base.OnRender (e); - - shader.SetMVP(modelview * projection); - - GL.BindTexture (TextureTarget.Texture2D, texture); - cube.Render (BeginMode.Triangles); - GL.BindTexture (TextureTarget.Texture2D, 0); - } - - public void UpdateViewMatrix() - { - Rectangle r = this.ClientRectangle; - GL.Viewport( r.X, r.Y, r.Width, r.Height); - projection = Matrix4.CreatePerspectiveFieldOfView (fovY, r.Width / (float)r.Height, zNear, zFar); - vLook = vLookInit.Transform( - Matrix4.CreateRotationX (viewXangle)* - Matrix4.CreateRotationZ (viewZangle)); - vLook.Normalize(); - vEye = vEyeTarget + vLook * eyeDist; - modelview = Matrix4.LookAt(vEye, vEyeTarget, Vector3.UnitZ); - GL.GetInteger(GetPName.Viewport, viewport); - - iface3D.UpdateView (projection, modelview, viewport, vEye); - } - - void HelloCube_MouseMove(object sender, OpenTK.Input.MouseMoveEventArgs otk_e) - { - if (otk_e.Mouse.MiddleButton == OpenTK.Input.ButtonState.Pressed) { - viewZangle -= (float)otk_e.XDelta * RotationSpeed; - viewXangle -= (float)otk_e.YDelta * RotationSpeed; - UpdateViewMatrix (); - } else if (otk_e.Mouse.LeftButton == OpenTK.Input.ButtonState.Pressed) { - return; - } else if (otk_e.Mouse.RightButton == OpenTK.Input.ButtonState.Pressed) { - Vector2 v2Look = vLook.Xy.Normalized (); - Vector2 disp = v2Look.PerpendicularLeft * otk_e.XDelta * MoveSpeed + - v2Look * otk_e.YDelta * MoveSpeed; - vEyeTarget += new Vector3 (disp.X, disp.Y, 0); - UpdateViewMatrix (); - } - } - void Hello3D_MouseWheelChanged (object sender, OpenTK.Input.MouseWheelEventArgs e) - { - float speed = ZoomSpeed; - //if (Keyboard[OpenTK.Input.Key.ControlLeft]) - // speed *= 20.0f; - - eyeDist -= e.Delta * speed; - if (eyeDist < zNear) - eyeDist = zNear; - else if (eyeDist > zFar) - eyeDist = zFar; - UpdateViewMatrix (); - } - } -}
\ No newline at end of file diff --git a/Tests/IValueChange.cs b/Tests/IValueChange.cs deleted file mode 100644 index 21d3c45d..00000000 --- a/Tests/IValueChange.cs +++ /dev/null @@ -1,23 +0,0 @@ -#define MONO_CAIRO_DEBUG_DISPOSE - - -using System; -using System.Runtime.InteropServices; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using OpenTK.Input; - -using System.Diagnostics; - -//using GGL; -using go; -using System.Threading; - - -namespace test -{ - interface IValueChange - { - } - -}
\ No newline at end of file diff --git a/Tests/InterfaceControler.cs b/Tests/InterfaceControler.cs deleted file mode 100644 index 034cab39..00000000 --- a/Tests/InterfaceControler.cs +++ /dev/null @@ -1,268 +0,0 @@ -// -// InterfaceControler.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using System.Threading; -using System.Collections.Generic; - -namespace Crow -{ - public class ProjectiveIFaceControler : InterfaceControler { - Matrix4 modelview; - int[] viewport = new int[4]; - Vector3 vEyePosition; - - public Matrix4 ifaceModelMat; - Point localMousePos; - - public ProjectiveIFaceControler(Rectangle ifaceBounds, Matrix4 _ifaceModelMat) - : base(ifaceBounds){ - ifaceModelMat = _ifaceModelMat; - } - - public override Matrix4 InterfaceMVP { - get { return ifaceModelMat * modelview * projection; } - } - - public override void initGL(){ - quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1); - //ifaceModelMat = Matrix4.CreateRotationX(MathHelper.PiOver2) * Matrix4.CreateTranslation(Vector3.UnitY); - CrowInterface.ProcessResize(iRect); - createContext (); - //CrowInterface.ProcessResize (iRect); - } - public override void ProcessResize (Rectangle newSize) - { - } - public override void OpenGLDraw () - { - GL.Enable (EnableCap.DepthTest); - base.OpenGLDraw (); - GL.Disable (EnableCap.DepthTest); - } - public void UpdateView (Matrix4 _projection, Matrix4 _modelview, int[] _viewport, Vector3 _vEyePosition) - { - projection = _projection; - modelview = _modelview; - viewport = _viewport; - vEyePosition = _vEyePosition; - } - public override bool ProcessMouseMove (int x, int y) - { - Matrix4 mv = ifaceModelMat * modelview; - Vector3 vMouse = UnProject(ref projection, ref mv, viewport, new Vector2 (x, y)).Xyz; - Vector3 vE = vEyePosition.Transform (ifaceModelMat.Inverted()); - Vector3 vMouseRay = Vector3.Normalize(vMouse - vE); - float a = vE.Z / vMouseRay.Z; - vMouse = vE - vMouseRay * a; - //vMouse = vMouse.Transform (interfaceModelView.Inverted()); - localMousePos = new Point ((int)Math.Truncate ((vMouse.X + 0.5f) * iRect.Width), - iRect.Height - (int)Math.Truncate ((vMouse.Y + 0.5f) * iRect.Height)); - mouseIsInInterface = localMousePos.X.IsInBetween (0, iRect.Width) & localMousePos.Y.IsInBetween (0, iRect.Height); - - return mouseIsInInterface ? CrowInterface.ProcessMouseMove (localMousePos.X, localMousePos.Y) : false; - } - Vector4 UnProject(ref Matrix4 projection, ref Matrix4 view, int[] viewport, Vector2 mouse) - { - Vector4 vec; - - vec.X = 2.0f * mouse.X / (float)viewport[2] - 1; - vec.Y = -(2.0f * mouse.Y / (float)viewport[3] - 1); - vec.Z = 0f; - vec.W = 1.0f; - - Matrix4 viewInv = Matrix4.Invert(view); - Matrix4 projInv = Matrix4.Invert(projection); - - Vector4.Transform(ref vec, ref projInv, out vec); - Vector4.Transform(ref vec, ref viewInv, out vec); - - if (vec.W > float.Epsilon || vec.W < float.Epsilon) - { - vec.X /= vec.W; - vec.Y /= vec.W; - vec.Z /= vec.W; - } - - return vec; - } - } - public class InterfaceControler : IDisposable { - public Interface CrowInterface; - public int texID; - public vaoMesh quad; - public Rectangle iRect = new Rectangle(0,0,2048,2048); - public bool mouseIsInInterface = false; - - protected Matrix4 projection; - public virtual Matrix4 InterfaceMVP { - get { return projection; } - } - - #if MEASURE_TIME - public List<PerformanceMeasure> PerfMeasures; - public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10); - #endif - - #region CTOR - public InterfaceControler(Rectangle ifaceBounds){ - iRect = ifaceBounds; - - CrowInterface = new Interface (); - CrowInterface.Init (); - - #if MEASURE_TIME - PerfMeasures = new List<PerformanceMeasure> ( - new PerformanceMeasure[] { - this.CrowInterface.updateMeasure, - this.CrowInterface.layoutingMeasure, - this.CrowInterface.clippingMeasure, - this.CrowInterface.drawingMeasure, - this.glDrawMeasure - } - ); - #endif - - Thread t = new Thread (interfaceThread); - t.IsBackground = true; - t.Start (); - - initGL (); - } - #endregion - - void interfaceThread() - { - while (CrowInterface.ClientRectangle.Size.Width == 0) - Thread.Sleep (5); - - while (true) { - CrowInterface.Update (); - Thread.Sleep (2); - } - } - - #region Mouse And Keyboard handling - public virtual void ProcessResize(Rectangle newSize){ - iRect = newSize; - CrowInterface.ProcessResize(newSize); - createContext (); - GL.Viewport (0, 0, newSize.Width, newSize.Height);//TODO:find a better place for this - } - public virtual bool ProcessMouseMove(int x, int y){ - return CrowInterface.ProcessMouseMove (x, y); - } - public virtual bool ProcessMouseButtonUp(int button) - { - return CrowInterface.ProcessMouseButtonUp (button); - } - public virtual bool ProcessMouseButtonDown(int button) - { - return CrowInterface.ProcessMouseButtonDown (button); - } - public virtual bool ProcessMouseWheelChanged(float delta) - { - return CrowInterface.ProcessMouseWheelChanged (delta); - } - public virtual bool ProcessKeyDown(int Key){ - return CrowInterface.ProcessKeyDown(Key); - } - public virtual bool ProcessKeyUp(int Key){ - return CrowInterface.ProcessKeyUp(Key); - } - public virtual bool ProcessKeyPress(char Key){ - return CrowInterface.ProcessKeyPress(Key); - } - #endregion - - #region graphic context - public virtual void initGL(){ - projection = OpenTK.Matrix4.CreateOrthographicOffCenter (-0.5f, 0.5f, -0.5f, 0.5f, 1, -1); - quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1); - createContext (); - } - /// <summary>Create the texture for the interface redering</summary> - public virtual void createContext() - { - if (GL.IsTexture(texID)) - GL.DeleteTexture (texID); - GL.GenTextures(1, out texID); - GL.ActiveTexture (TextureUnit.Texture0); - GL.BindTexture(TextureTarget.Texture2D, texID); - - GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, - iRect.Width, iRect.Height, 0, - OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.bmp); - - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - - GL.BindTexture(TextureTarget.Texture2D, 0); - } - /// <summary>Rendering of the interface</summary> - public virtual void OpenGLDraw() - { - #if MEASURE_TIME - glDrawMeasure.StartCycle(); - #endif - - GL.ActiveTexture (TextureUnit.Texture0); - GL.BindTexture (TextureTarget.Texture2D, texID); - if (Monitor.TryEnter(CrowInterface.RenderMutex)) { - if (CrowInterface.IsDirty) { - GL.TexSubImage2D (TextureTarget.Texture2D, 0, - CrowInterface.DirtyRect.Left, CrowInterface.DirtyRect.Top, - CrowInterface.DirtyRect.Width, CrowInterface.DirtyRect.Height, - OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.dirtyBmp); - CrowInterface.IsDirty = false; - } - Monitor.Exit (CrowInterface.RenderMutex); - } - quad.Render (BeginMode.TriangleStrip); - GL.BindTexture(TextureTarget.Texture2D, 0); - - #if MEASURE_TIME - glDrawMeasure.StopCycle(); - #endif - } - #endregion - - #region IDisposable implementation - - public void Dispose () - { - if (GL.IsTexture(texID)) - GL.DeleteTexture (texID); - if (quad != null) - quad.Dispose (); - } - - #endregion - } -} - diff --git a/Tests/Interfaces/CheckBox2.imlt b/Tests/Interfaces/CheckBox2.imlt index 4cb7f5f2..c2bfe8da 100644 --- a/Tests/Interfaces/CheckBox2.imlt +++ b/Tests/Interfaces/CheckBox2.imlt @@ -1,7 +1,7 @@ <Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}" Margin="3" Background="{./Background}" - Foreground="DimGray" + Foreground="DimGrey" TextAlignment="Center" MouseEnter="{Foreground=White}" - MouseLeave="{Foreground=DimGray}"/>
\ No newline at end of file + MouseLeave="{Foreground=DimGrey}"/>
\ No newline at end of file diff --git a/Tests/Interfaces/Container/0.crow b/Tests/Interfaces/Container/0.crow index 17bc958e..df2f4733 100755 --- a/Tests/Interfaces/Container/0.crow +++ b/Tests/Interfaces/Container/0.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Container Background="DimGray" Margin="10" Width="90%" Height="90%"> +<Container Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Background="SeaGreen" MinimumSize="50,50"/> </Container>
\ No newline at end of file diff --git a/Tests/Interfaces/Container/3.crow b/Tests/Interfaces/Container/3.crow index dd8afa28..94655ca3 100755 --- a/Tests/Interfaces/Container/3.crow +++ b/Tests/Interfaces/Container/3.crow @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<Container Background="DimGray" Margin="10" Fit="true"> +<Container Background="DimGrey" Margin="10" Fit="true"> <Label Text="{fps}" Margin="10" Fit="true" Background="SeaGreen"/> </Container>
\ No newline at end of file diff --git a/Tests/Interfaces/Divers/0.crow b/Tests/Interfaces/Divers/0.crow index d98668c0..16ec90f9 100755 --- a/Tests/Interfaces/Divers/0.crow +++ b/Tests/Interfaces/Divers/0.crow @@ -3,10 +3,10 @@ <HorizontalStack > <VerticalStack Width="30%" Margin="5"> <GroupBox Caption="Performance" Height="Fit"> - <VerticalStack Width="90%" Height="Fit" Spacing="2" > + <VerticalStack DataSource="{drawingMeasure}" Width="90%" Height="Fit" Spacing="2" > <HorizontalStack Height="Fit" Tooltip="Frame per second"> <Label Text="Fps:" Style="FpsLabel"/> - <Label Text="{fps}" Style="FpsDisp"/> + <Label Text="{minimum}" Style="FpsDisp"/> </HorizontalStack> <HorizontalStack Height="Fit" Tooltip="Minimum Frame per second"> <Label Text="Min:" Style="FpsLabel"/> @@ -34,9 +34,9 @@ </HorizontalStack> </VerticalStack> </GroupBox> - <Label Width="Stretched" Margin="3" Background="DimGray"/> + <Label Width="Stretched" Margin="3" Background="DimGrey"/> <TextBox Text="TextBox" Multiline="true" Margin="3"/> - <HorizontalStack Height="Fit" Margin="5" Background="DimGray" CornerRadius="10"> + <HorizontalStack Height="Fit" Margin="5" Background="DimGrey" CornerRadius="10"> <VerticalStack Spacing="5" Width="50%"> <CheckBox Fit="true" Caption="test"/> <CheckBox Fit="true"/> @@ -51,26 +51,26 @@ </VerticalStack> </HorizontalStack> <HorizontalStack Height="Fit" Margin="5"> - <Label Text="MouseEvents" Width="50%" Margin="3" + <Label Text="MouseEvents" Width="50%" Margin="3" Focusable="true" Background="Jet" - Foreground="DimGray" + Foreground="DimGrey" TextAlignment="Center" MouseEnter="{Foreground=White}" - MouseLeave="{Foreground=DimGray}" + MouseLeave="{Foreground=DimGrey}" MouseDown="{Background=DarkRed}" MouseClick="{Foreground=Green}" MouseDoubleClick="{Foreground=Yellow}" MouseUp="{Background=Jet}"/> <Label Text="MouseEvents" Width="50%" Margin="3" Background="Jet" - Foreground="DimGray" + Foreground="DimGrey" TextAlignment="Center" MouseClick="{Foreground=Green}" MouseDoubleClick="{Foreground=Yellow}" MouseEnter="{Foreground=White}" - MouseLeave="{Foreground=DimGray}" + MouseLeave="{Foreground=DimGrey}" MouseDown="{Background=SeaGreen}" - MouseUp="{Background=DimGray}"/> + MouseUp="{Background=DimGrey}"/> </HorizontalStack> <GroupBox Caption="Templated controls" Height="Fit" Margin="5"> <HorizontalStack Height="Fit"> @@ -101,20 +101,20 @@ <Splitter/> <VerticalStack Width="40%" Margin="5" Spacing="5"> <Expandable> - <Image Path="#Crow.Images.Icons.crow.svg"/> + <Image Path="#Crow.Icons.crow.svg"/> </Expandable> <Popper> - <Border Fit="True" Background="DimGray" CornerRadius="0" BorderWidth="1"> - <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10" - MouseEnter="{Background=LightGray}" + <Border Fit="True" Background="DimGrey" CornerRadius="0" BorderWidth="1"> + <Image Path="#Crow.Icons.crow.svg" Width="100" Height="100" Margin="10" + MouseEnter="{Background=LightGrey}" MouseLeave="{Background=Transparent}"/> </Border> </Popper> <Slider Height="10" Width="90%"/> - <Container Height="Fit" Width="200" Background="DimGray" Margin="2" CornerRadius="5"> - <ProgressBar Background="DimGray" Height="10" Value="50"/> + <Container Height="Fit" Width="200" Background="DimGrey" Margin="2" CornerRadius="5"> + <ProgressBar Background="DimGrey" Height="10" Value="50"/> </Container> - <Image Path="#Crow.Images.Icons.crow.svg" Width="60" Height="60" Background="LightGray" /> + <Image Path="#Crow.Icons.crow.svg" Width="60" Height="60" Background="LightGrey" /> <!-- <TabView Name="tabview1" Height="120" Orientation="Horizontal" Spacing="15"> <TabItem Name="TabItem1" Caption="Tab 1" Margin="0"> @@ -125,7 +125,7 @@ <CheckBox/> </VerticalStack> </TabItem> - <TabItem Name="TabItem2" Caption="Tab 2" Background="Gray"> + <TabItem Name="TabItem2" Caption="Tab 2" Background="Grey"> <VerticalStack Fit="true"> <RadioButton/> <RadioButton/> @@ -133,7 +133,7 @@ <RadioButton/> </VerticalStack> </TabItem> - <TabItem Name="TabItem3" Caption="Tab 3" Background="Gray"> + <TabItem Name="TabItem3" Caption="Tab 3" Background="Grey"> <Container Margin="5" CornerRadius="2"> <TextBox Height="Stretched" Margin="5" Multiline="true" TextAlignment="TopLeft"/> </Container> @@ -154,8 +154,8 @@ </Border> <Splitter/>--> <ListBox Name="colorList" Data="{TestList}" Margin="5" - ItemTemplate="#Tests.Interfaces.colorItem.crow" - Template="#Crow.Templates.ScrollingListBox.template" + ItemTemplate="Interfaces/colorItem.crow" + Template="#Crow.ScrollingListBox.template" /> </VerticalStack> </HorizontalStack> diff --git a/Tests/Interfaces/Divers/3.crow b/Tests/Interfaces/Divers/3.crow index 5ec5c696..a1f5e95d 100755 --- a/Tests/Interfaces/Divers/3.crow +++ b/Tests/Interfaces/Divers/3.crow @@ -1,7 +1,7 @@ <?xml version="1.0"?> <HorizontalStack Fit="true"> <VerticalStack Fit="true" Name="vsFps" Spacing="10" > - <ProgressBar CornerRadius="5" Background="DimGray" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/> + <ProgressBar CornerRadius="5" Background="DimGrey" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/> <HorizontalStack Fit="true"> <Label Text="Memory:" Width="50" TextAlignment="Right"/> <Label Text="{memory}" Font="droid,12" TextAlignment="Center" diff --git a/Tests/Interfaces/Divers/5.crow b/Tests/Interfaces/Divers/5.crow index 53040f93..7489642a 100755 --- a/Tests/Interfaces/Divers/5.crow +++ b/Tests/Interfaces/Divers/5.crow @@ -20,10 +20,10 @@ <GroupBox Caption="Group box" > <Label Text="border test" Margin="3"/> </GroupBox> - <Container Fit="true" Background="DimGray" Margin="3"> - <GraphicObject Width="20" Height="20" Background="LightGray"/> + <Container Fit="true" Background="DimGrey" Margin="3"> + <GraphicObject Width="20" Height="20" Background="LightGrey"/> </Container>--> -<!-- <ProgressBar Height="10" Width="150" Background="DimGray" Value="50" /> +<!-- <ProgressBar Height="10" Width="150" Background="DimGrey" Value="50" /> <Slider Value="5" Width="150" Height="10"/> <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/> <Spinner Value="100"/>--> @@ -48,10 +48,10 @@ <GroupBox Caption="Group box" Width="Stretched"> <Label Text="border test" Margin="3"/> </GroupBox> - <Container Height="Fit" Width="Stretched" Background="DimGray" Margin="3"> - <GraphicObject Width="20" Height="20" Background="LightGray"/> + <Container Height="Fit" Width="Stretched" Background="DimGrey" Margin="3"> + <GraphicObject Width="20" Height="20" Background="LightGrey"/> </Container> - <ProgressBar Height="10" Width="Stretched" Background="DimGray" Value="50" /> + <ProgressBar Height="10" Width="Stretched" Background="DimGrey" Value="50" /> <Slider Value="5" Width="Stretched" Height="10"/> <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="Stretched"/> <Spinner Value="100" Width="Stretched"/> diff --git a/Tests/Interfaces/Divers/6.crow b/Tests/Interfaces/Divers/6.crow index c37ca360..f537a71d 100755 --- a/Tests/Interfaces/Divers/6.crow +++ b/Tests/Interfaces/Divers/6.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Fit="true" Background="DimGray" Margin="5"> +<VerticalStack Fit="true" Background="DimGrey" Margin="5"> <!-- <RadioButton/>--> <Label Text="a" Width="Stretched" Background="Red"/> <Label Text="{fps}" HorizontalAlignment="Right" Background="LimeGreen"/> diff --git a/Tests/Interfaces/Divers/clip0.crow b/Tests/Interfaces/Divers/clip0.crow index 8cdf459b..0dee2ef1 100755 --- a/Tests/Interfaces/Divers/clip0.crow +++ b/Tests/Interfaces/Divers/clip0.crow @@ -1,10 +1,10 @@ <?xml version="1.0"?> <Container Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="false" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{drawing}" Background="RoyalBlue"/> </Container>
\ No newline at end of file diff --git a/Tests/Interfaces/Divers/clip1.crow b/Tests/Interfaces/Divers/clip1.crow index 1e202d90..bc4c9279 100755 --- a/Tests/Interfaces/Divers/clip1.crow +++ b/Tests/Interfaces/Divers/clip1.crow @@ -1,7 +1,7 @@ <?xml version="1.0"?> <Container Fit="true" Margin="20" Background="SkyBlue" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=LightGray}" + MouseEnter="{Background=LightGrey}" MouseLeave="{Background=SkyBlue}"> <Container Fit="true" Margin="20" Background="Red" CacheEnabled="true" HorizontalAlignment="Right" VerticalAlignment="Bottom" @@ -13,10 +13,10 @@ MouseLeave="{Background=Yellow}"> <Container Margin="50" Background="LimeGreen" CacheEnabled="true" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" + MouseEnter="{Background=DimGrey}" MouseLeave="{Background=RoyalBlue}" Margin="1" Text="{drawing}" Background="RoyalBlue"/> </Container> diff --git a/Tests/Interfaces/Divers/clip2.crow b/Tests/Interfaces/Divers/clip2.crow index 198d9113..9292150f 100755 --- a/Tests/Interfaces/Divers/clip2.crow +++ b/Tests/Interfaces/Divers/clip2.crow @@ -1,14 +1,14 @@ <?xml version="1.0"?> <Group Fit="true" Margin="50" Background="Yellow" CacheEnabled="true" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=DimGray}" + MouseEnter="{Background=DimGrey}" MouseLeave="{Background=Yellow}"> <Group Width="300" Height="200" Margin="50" Background="LimeGreen" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <Label Left="10" HorizontalAlignment="Right" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{drawing}" Background="RoyalBlue"/> </Group> diff --git a/Tests/Interfaces/Divers/clip3.crow b/Tests/Interfaces/Divers/clip3.crow index 2bb7c357..82a98881 100755 --- a/Tests/Interfaces/Divers/clip3.crow +++ b/Tests/Interfaces/Divers/clip3.crow @@ -1,32 +1,32 @@ <?xml version="1.0"?> <Group Fit="true" Margin="50" Background="Yellow" CacheEnabled="true" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=DimGray}" + MouseEnter="{Background=DimGrey}" MouseLeave="{Background=Yellow}"> <HorizontalStack Fit="true"> <VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{fps}" Background="RoyalBlue"/> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{drawing}" Background="RoyalBlue"/> </VerticalStack> <VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{fpsMax}" Background="RoyalBlue"/> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{fpsMin}" Background="RoyalBlue"/> </VerticalStack> diff --git a/Tests/Interfaces/Divers/clip4.crow b/Tests/Interfaces/Divers/clip4.crow index 71a887ab..5caaf771 100755 --- a/Tests/Interfaces/Divers/clip4.crow +++ b/Tests/Interfaces/Divers/clip4.crow @@ -1,38 +1,38 @@ <?xml version="1.0"?> <Border Fit="true" BorderWidth="2" > -<Scroller CornerRadius="2" Height="200" Width="300" Background="DimGray" Margin="2"> +<Scroller CornerRadius="2" Height="200" Width="300" Background="DimGrey" Margin="2"> <VerticalStack Margin="10" VerticalAlignment="Top" Fit="true" Background="vgradient|0:RoyalBlue|1:Black" > - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 1"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 2"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 3"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 4"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 5"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 6"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 7"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 8"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 9"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 10"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 11"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 12"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 13"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 14"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 15"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 16"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 17"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 18"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 19"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 20"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 21"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 22"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 23"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 24"/> - <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 25"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 1"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 2"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 3"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 4"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 5"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 6"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 7"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 8"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 9"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 10"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 11"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 12"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 13"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 14"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 15"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 16"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 17"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 18"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 19"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 20"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 21"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 22"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 23"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 24"/> + <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 25"/> </VerticalStack> </Scroller> </Border> <!--<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false" HorizontalAlignment="Right" VerticalAlignment="Bottom" - MouseEnter="{Background=Gray}" + MouseEnter="{Background=Grey}" MouseLeave="{Background=LimeGreen}"> <CheckBox Margin="20" Background="RoyalBlue"/> @@ -48,11 +48,11 @@ <CheckBox/> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{fps}" Background="RoyalBlue"/> <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true" - MouseEnter="{Background=DimGray}" Width="100" + MouseEnter="{Background=DimGrey}" Width="100" MouseLeave="{Background=RoyalBlue}" Margin="10" Text="{drawing}" Background="RoyalBlue"/> </VerticalStack>-->
\ No newline at end of file diff --git a/Tests/Interfaces/Divers/colorPicker.crow b/Tests/Interfaces/Divers/colorPicker.crow index fdfd8f3c..a081946f 100755 --- a/Tests/Interfaces/Divers/colorPicker.crow +++ b/Tests/Interfaces/Divers/colorPicker.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> <VerticalStack> - <ColorPicker SelectedColor="{²../go.Background}" Name="colorPicker" Background="DimGray" Margin="5" Fit="True" /> + <ColorPicker SelectedColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Fit="True" /> <GraphicObject Name="go" Width="100" Height="60" Background="DarkBlue"/> <GraphicObject Name="go" Width="100" Height="60" Background="{../colorPicker.SelectedColor}"/> <Label Text="{../colorPicker.SelectedColor}"/> diff --git a/Tests/Interfaces/Divers/perfMeasures.crow b/Tests/Interfaces/Divers/perfMeasures.crow index c0d0d8b9..ec13cf0e 100755 --- a/Tests/Interfaces/Divers/perfMeasures.crow +++ b/Tests/Interfaces/Divers/perfMeasures.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Window Focusable="true" Caption="Measures" Width="30%" Height="Fit" MinimumSize="100,100"> +<Window Focusable="true" Caption="Measures" Width="30%" Height="300" MinimumSize="100,100"> <ListBox Data="{PerfMeasures}" ItemTemplate="#Tests.Interfaces.perfMsr.crow"/> </Window> diff --git a/Tests/Interfaces/Divers/testDisable.crow b/Tests/Interfaces/Divers/testDisable.crow index 85a3d3b9..68d1cebb 100644 --- a/Tests/Interfaces/Divers/testDisable.crow +++ b/Tests/Interfaces/Divers/testDisable.crow @@ -6,8 +6,8 @@ <Label Text="{fps}" IsEnabled="true" Font="30"/> <Label Text="{fps}" IsEnabled="false" Font="30" Background="SeaGreen"/> <Label Text="{fps}" IsEnabled="true" Font="30" Background="SeaGreen"/> - <Button Caption="Button" IsEnabled="true" Background="Gray"/> - <Button Caption="Button" IsEnabled="false" Background="Gray"/> + <Button Caption="Button" IsEnabled="true" Background="Grey"/> + <Button Caption="Button" IsEnabled="false" Background="Grey"/> <Button Caption="Button" IsEnabled="true" /> <Button Caption="Button" IsEnabled="false" /> <Spinner Fit="true"/> diff --git a/Tests/Interfaces/Divers/testFocus.crow b/Tests/Interfaces/Divers/testFocus.crow new file mode 100755 index 00000000..97a57457 --- /dev/null +++ b/Tests/Interfaces/Divers/testFocus.crow @@ -0,0 +1,82 @@ +<?xml version="1.0"?> +<VerticalStack> + <Menu> + <MenuItem Caption="File" Width="Fit"> + <MenuItem Command="{CMDTest}"/> + <MenuItem Caption="Open"/> + <MenuItem Caption="Save"/> + <MenuItem Caption="Quit"/> + </MenuItem> + <MenuItem Caption="Edit" Name="edit" Width="Fit"> + <MenuItem Caption="Cut"/> + <MenuItem Caption="Copy"/> + <MenuItem Caption="Paste"/> + <MenuItem Caption="Special" Name="special" Width="Fit"> + <MenuItem Caption="Cut"/> + <MenuItem Caption="Copy"/> + <MenuItem Caption="Paste"/> + </MenuItem> + <MenuItem Caption="Special2" Name="special" Width="Fit"> + <MenuItem Caption="Cut"/> + <MenuItem Caption="Copy"/> + <MenuItem Caption="Paste"/> + </MenuItem> + </MenuItem> + <MenuItem Caption="Help" Width="Fit"> + <MenuItem Caption="About"/> + <MenuItem Caption="Help"/> + </MenuItem> + </Menu> + <HorizontalStack Height="Fit"> + <Label Text="Hover:" Width="50" Foreground="Grey"/> + <Label Text="{HoverWidget}"/> + </HorizontalStack> + <HorizontalStack Height="Fit"> + <Label Text="Focus:" Width="50" Foreground="Grey"/> + <Label Text="{FocusedWidget}"/> + </HorizontalStack> + <HorizontalStack Height="Fit"> + <Label Text="Active:" Width="50" Foreground="Grey"/> + <Label Text="{ActiveWidget}"/> + </HorizontalStack> + <Container Fit="true" Margin="50" Background="SlateGrey"> + <Label Text="MouseEvents" Margin="3" Focusable="true" Fit="true" + Background="Jet" + Foreground="DimGrey" + TextAlignment="Center" + MouseEnter="{Foreground=White}" + MouseLeave="{Foreground=DimGrey}" + MouseDown="{Background=DarkRed}" + MouseClick="{Foreground=Green}" + MouseDoubleClick="{Foreground=Yellow}" + MouseUp="{Background=Jet}"/> + </Container> + <TextBox Width="300" Margin="10"/> + <Slider Width="300" Height="12"/> + <ComboBox Data="{TestList}" Width="120"> + <ItemTemplate DataType="Crow.Color"> + <HorizontalStack + HorizontalAlignment="Left" + Height="Fit" Width="200" Margin="1" Focusable="true" + MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}" + MouseLeave="{Background=Transparent}"> + <GraphicObject Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/> + <Label Text="{}" Margin="0" Width="Stretched"/> + </HorizontalStack> + </ItemTemplate> + </ComboBox> + <HorizontalStack Height="Fit" Margin="1" Background="DimGrey" Width="200"> + <VerticalStack Spacing="2" Width="50%"> + <CheckBox Caption="test" MouseEnter="{Background=Blue}" MouseLeave="{Background=Transparent}"/> + <CheckBox /> + <CheckBox /> + <CheckBox IsChecked="true"/> + </VerticalStack> + <VerticalStack Spacing="2" Width="50%"> + <RadioButton Fit="true"/> + <RadioButton Fit="true" IsChecked="true"/> + <RadioButton Fit="true"/> + <RadioButton Fit="true"/> + </VerticalStack> + </HorizontalStack> +</VerticalStack> diff --git a/Tests/Interfaces/Divers/testImage.crow b/Tests/Interfaces/Divers/testImage.crow index eddea8aa..ccdd87c0 100755 --- a/Tests/Interfaces/Divers/testImage.crow +++ b/Tests/Interfaces/Divers/testImage.crow @@ -41,24 +41,24 @@ </HorizontalStack> <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5"> <Label Text="SCALED PROPORTIONNAL" Width="150"/> - <Image Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.tetra.png"/> + <Image Background="Blue" Path="#Crow.Icons.tetra.png"/> + <Image Margin="10" Background="Blue" Path="#Crow.Icons.tetra.png"/> + <Image Background="Blue" Width="20" Height="20" Path="#Crow.Icons.tetra.png"/> + <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Icons.tetra.png"/> + <Image Background="Blue" Width="50" Height="100" Path="#Crow.Icons.tetra.png"/> <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.tetra.png"/> - <Image Background="Blue" Width="50" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> - <Image Margin="10" Background="Blue" Width="50" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/> + <Image Background="Blue" Width="100" Height="50" Path="#Crow.Icons.tetra.png"/> + <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Icons.tetra.png"/> + <Image Background="Blue" Width="50" Height="Fit" Path="#Crow.Icons.tetra.png"/> + <Image Margin="10" Background="Blue" Width="50" Height="Fit" Path="#Crow.Icons.tetra.png"/> </HorizontalStack> <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5"> <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/> - <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/> - <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.tetra.png"/> + <Image KeepProportions="false" Background="Blue" Path="#Crow.Icons.tetra.png"/> + <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Icons.tetra.png"/> + <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Icons.tetra.png"/> + <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Icons.tetra.png"/> + <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Crow.Icons.tetra.png"/> <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.tetra.png"/> <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.tetra.png"/> <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.tetra.png"/> diff --git a/Tests/Interfaces/Divers/testMenu.crow b/Tests/Interfaces/Divers/testMenu.crow new file mode 100755 index 00000000..08822445 --- /dev/null +++ b/Tests/Interfaces/Divers/testMenu.crow @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<Menu> + <MenuItem Caption="File" Width="Fit"> + <MenuItem Command="{CMDTest}"/> + </MenuItem> +</Menu> diff --git a/Tests/Interfaces/Divers/testOutOfClipUpdate.crow b/Tests/Interfaces/Divers/testOutOfClipUpdate.crow index 738f2b11..22523b8c 100755 --- a/Tests/Interfaces/Divers/testOutOfClipUpdate.crow +++ b/Tests/Interfaces/Divers/testOutOfClipUpdate.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Container Width="200" Height="100" Background="DimGray" Margin="5"> +<Container Width="200" Height="100" Background="DimGrey" Margin="5"> <Container Width="Stretched" Height="800" Background="DarkBlue"> <Label Text="{fps}" Background="RoyalBlue" VerticalAlignment="Center"/> </Container> diff --git a/Tests/Interfaces/Divers/testPropLess.crow b/Tests/Interfaces/Divers/testPropLess.crow index 52742477..42282c11 100755 --- a/Tests/Interfaces/Divers/testPropLess.crow +++ b/Tests/Interfaces/Divers/testPropLess.crow @@ -1,2 +1,2 @@ <?xml version="1.0"?> -<Label Margin="50" MinimumSize="10,10" Background="DimGray" Text="{PropertyLessBinding}"/>
\ No newline at end of file +<Label Margin="50" MinimumSize="10,10" Background="DimGrey" Text="{PropertyLessBinding}"/>
\ No newline at end of file diff --git a/Tests/Interfaces/Divers/testShape.crow b/Tests/Interfaces/Divers/testShape.crow index 4adada39..d1f9f3cc 100644 --- a/Tests/Interfaces/Divers/testShape.crow +++ b/Tests/Interfaces/Divers/testShape.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> <Container Fit="true" Background="Red" Tooltip="test tooltip" > - <Shape Foreground="Transparent" Background="DimGray" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z" - MouseEnter="{Background=hgradient|0:DimGray|0.5:RoyalBlue|1:Black}" - MouseLeave="{Background=DimGray}"/> + <Shape Foreground="Transparent" Background="DimGrey" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z" + MouseEnter="{Background=hgradient|0:DimGrey|0.5:RoyalBlue|1:Black}" + MouseLeave="{Background=DimGrey}"/> </Container>
\ No newline at end of file diff --git a/Tests/Interfaces/Divers/testStacks.crow b/Tests/Interfaces/Divers/testStacks.crow index ac2cccc6..99279cd4 100755 --- a/Tests/Interfaces/Divers/testStacks.crow +++ b/Tests/Interfaces/Divers/testStacks.crow @@ -1,82 +1,82 @@ <?xml version="1.0"?> <Window Width="500" Height="300" MinimumSize="50,50"> -<HorizontalStack Margin="5" Background="DimGray"> - <VerticalStack Width="200" Margin="5" Background="Gray"> - <VerticalStack Fit="true" Background="DimGray" Margin="5"> +<HorizontalStack Margin="5" Background="DimGrey"> + <VerticalStack Width="200" Margin="5" Background="Grey"> + <VerticalStack Fit="true" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </VerticalStack> - <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun Background="SkyBlue" Height="Stretched"/> </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> + <HorizontalStack Fit="true" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun Background="SkyBlue"/> </HorizontalStack> </VerticalStack> - <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Gray"> - <VerticalStack Fit="true" Background="DimGray" Margin="5"> + <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Grey"> + <VerticalStack Fit="true" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </VerticalStack> - <VerticalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> + <VerticalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun TextAlignment="Center" Background="SkyBlue" Width="Stretched" Height="Stretched"/> </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> + <HorizontalStack Fit="true" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun Background="SkyBlue"/> </HorizontalStack> </VerticalStack> - <VerticalStack Width="Fit" Margin="5" Background="Gray"> - <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <VerticalStack Width="Fit" Margin="5" Background="Grey"> + <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue" HorizontalAlignment="Left"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </VerticalStack> - <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun Background="SkyBlue" Height="Stretched"/> </VerticalStack> - <HorizontalStack Fit="true" Background="DimGray" Margin="5"> + <HorizontalStack Fit="true" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue"/> </HorizontalStack> - <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5"> + <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5"> <TextRun Background="SkyBlue"/> <TextRun Background="SkyBlue" Width="Stretched"/> <TextRun Background="SkyBlue"/> diff --git a/Tests/Interfaces/Divers/testTextBox.crow b/Tests/Interfaces/Divers/testTextBox.crow index 8a98ff84..d0fe0af4 100755 --- a/Tests/Interfaces/Divers/testTextBox.crow +++ b/Tests/Interfaces/Divers/testTextBox.crow @@ -1,24 +1,24 @@ <?xml version="1.0"?> <VerticalStack Background="SteelBlue" Fit="true"> <HorizontalStack Fit="true"> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopLeft"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Top"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopRight"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Left"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Center"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Right"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomLeft"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Bottom"/> - <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomRight"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="TopLeft"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Top"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="TopRight"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Left"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Center"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Right"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="BottomLeft"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Bottom"/> + <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="BottomRight"/> </HorizontalStack> <HorizontalStack Fit="true"> - <TextBox Background="DarkGray" Height="30" Width="70" TextAlignment="Top" HorizontalStretch="true" Text="TopStretch"/> - <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Center" HorizontalStretch="true" Text="HorizontalStretch" /> - <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Bottom" HorizontalStretch="true" Text="BottomStretch"/> - <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Left" VerticalStretch="true" Text="LeftStretch"/> - <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Center" VerticalStretch="true" Text="VerticalStretch"/> - <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Right" VerticalStretch="true" Text="RightStretch"/> - <TextBox Background="DarkGray" Height="30" Width="50" HorizontalStretch="true" VerticalStretch="true" Text="Fit"/> + <TextBox Background="DarkGrey" Height="30" Width="70" TextAlignment="Top" HorizontalStretch="true" Text="TopStretch"/> + <TextBox Background="DarkGrey" Height="30" Width="60" TextAlignment="Center" HorizontalStretch="true" Text="HorizontalStretch" /> + <TextBox Background="DarkGrey" Height="30" Width="60" TextAlignment="Bottom" HorizontalStretch="true" Text="BottomStretch"/> + <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Left" VerticalStretch="true" Text="LeftStretch"/> + <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Center" VerticalStretch="true" Text="VerticalStretch"/> + <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Right" VerticalStretch="true" Text="RightStretch"/> + <TextBox Background="DarkGrey" Height="30" Width="50" HorizontalStretch="true" VerticalStretch="true" Text="Fit"/> </HorizontalStack> <TextBox Name="tb" Multiline="true" Font="droid,16" Margin="5" Text="A\nBB\nCCC\nDDDD"/> <TextBox Multiline="true" Font="droid,16" Name="tb5" Margin="5" Text="{../tb.SelectedText}"/> diff --git a/Tests/Interfaces/Divers/testVisibility.crow b/Tests/Interfaces/Divers/testVisibility.crow new file mode 100755 index 00000000..70abcbdb --- /dev/null +++ b/Tests/Interfaces/Divers/testVisibility.crow @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<Container Margin="20" Background="Red" > + <Container Margin="20" Background="Green" MouseDown="{../go1.Visible=True}" > + <GraphicObject Name="go1" Margin="20" Background="DimGrey" Visible="false" MouseDown="{Visible=false}" + MouseEnter="{Background=Blue}" + MouseLeave="{Background=DimGrey}"/> + </Container> +</Container> diff --git a/Tests/Interfaces/Divers/welcome.crow b/Tests/Interfaces/Divers/welcome.crow index 22dfd749..fb251487 100644 --- a/Tests/Interfaces/Divers/welcome.crow +++ b/Tests/Interfaces/Divers/welcome.crow @@ -1,7 +1,7 @@ <?xml version="1.0"?> <Border BorderStyle="Sunken" Fit="true" Background="0.7,0.7,0.7,0.5" CornerRadius="10"> <VerticalStack Margin="20"> - <Image Path="#Crow.Images.Icons.crow.svg"/> + <Image Path="#Crow.Icons.crow.svg"/> <!-- <Label Font="Times bold, 60" Text="C.R.O.W"/>--> <HorizontalStack Fit="true" DataSource="{CrowVersion}" Spacing="0"> <Label Foreground="Black" Font="mono, 12" Text="version: "/> @@ -9,13 +9,13 @@ <Label Foreground="Black" Font="mono, 12" Text="."/> <Label Foreground="Black" Font="mono, 12" Text="{Minor}"/> <Label Foreground="Black" Font="mono, 12" Text="."/> - <Label Foreground="DimGray" Font="mono, 12" Text="{Build}"/> + <Label Foreground="DimGrey" Font="mono, 12" Text="{Build}"/> </HorizontalStack> <GraphicObject Height="30"/> <Label Font="20" Text="Press <F2> and <F3> to cycle into the examples"/> <Label Font="20" Text="Those are basic tests used to validate changes,"/> <GraphicObject Height="30"/> - <Label Foreground="DimGray" Font="20" Text="<F5> => File dialog example"/> - <Label Foreground="DimGray" Font="20" Text="<F6> => Window example"/> + <Label Foreground="DimGrey" Font="20" Text="<F5> => File dialog example"/> + <Label Foreground="DimGrey" Font="20" Text="<F6> => Window example"/> </VerticalStack> </Border>
\ No newline at end of file diff --git a/Tests/Interfaces/DragAndDrop/0.crow b/Tests/Interfaces/DragAndDrop/0.crow index 356fa49a..ca1a7bb5 100755 --- a/Tests/Interfaces/DragAndDrop/0.crow +++ b/Tests/Interfaces/DragAndDrop/0.crow @@ -1,20 +1,20 @@ <?xml version="1.0"?> -<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%" Spacing="100" Focusable="true"> - <Container Name="source" StartDrag="{Background=DimGray}" EndDrag="{Background=SeaGreen}" Focusable="true" Fit="true" +<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%" Spacing="100" Focusable="true"> + <Container Name="source" StartDrag="{Background=DimGrey}" EndDrag="{Background=SeaGreen}" Focusable="true" Fit="true" Drop="{../target.Background=Green}" MouseEnter="{/txt.Foreground=Red}" MouseLeave="{/txt.Foreground=White}" MouseClick="{Background=SeaGreen}" AllowDrag="true" Width="200" Height="200" Background="SeaGreen"> <VerticalStack Margin="50"> - <Label Name="txt" Text="Drag me" Foreground="Gray"/> - <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Gray"/> + <Label Name="txt" Text="Drag me" Foreground="Grey"/> + <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Grey"/> </VerticalStack> </Container> - <Container Name="target" DragEnter="{Background=SeaGreen}" DragLeave="{Background=DimGray}" Focusable="true" Fit="true" + <Container Name="target" DragEnter="{Background=SeaGreen}" DragLeave="{Background=DimGrey}" Focusable="true" Fit="true" MouseEnter="{/txt.Foreground=Red}" MouseLeave="{/txt.Foreground=White}" - AllowDrop="true" Background="DimGray"> + AllowDrop="true" Background="DimGrey"> <VerticalStack Margin="50"> - <Label Name="txt" Text="Drop here" Foreground="Gray"/> - <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Gray"/> + <Label Name="txt" Text="Drop here" Foreground="Grey"/> + <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Grey"/> </VerticalStack> </Container> </HorizontalStack>
\ No newline at end of file diff --git a/Tests/Interfaces/Experimental/DockWindow.template b/Tests/Interfaces/Experimental/DockWindow.template new file mode 100755 index 00000000..42f51163 --- /dev/null +++ b/Tests/Interfaces/Experimental/DockWindow.template @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!--<GraphicObject Background="{./Background}"/>--> +<Border BorderWidth="1" Foreground="Black" CornerRadius="{./CornerRadius}" + Background="{./Background}" + MouseEnter="./onBorderMouseEnter" + MouseLeave="./onBorderMouseLeave"> + <VerticalStack Spacing="0"> + <HorizontalStack Height="Fit"> + <Label Text="{./Name}" TextAlignment="Left" Width="Fit" + Foreground="White" /> + <Label Text="{./DockingPosition}" TextAlignment="Left" Width="Fit" + Foreground="White" /> + </HorizontalStack> + <Label Text="{./Width}" TextAlignment="Left" Width="Fit" + Foreground="White" /> + <Label Text="{./Height}" TextAlignment="Left" Width="Fit" + Foreground="White" /> + + <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Grey"> + <Label Text="{./Caption}" TextAlignment="Left" Width="Stretched" + Foreground="Jet" /> + <Image Width="8" Height="8" Focusable="true" Margin="0" Path="#Crow.Icons.exit2.svg" + MouseClick="./butQuitPress"/> + </HorizontalStack> + <HorizontalStack Background="vgradient|0:0.5,0.6,0.5,0.5|1:0.2,0.3,0.3,0.7" + Name="hs" Margin="0" Spacing="0" Height="Fit" Visible="{./IsFloating}"> + <GraphicObject Width="5"/> + <Image Margin="1" Width="10" Height="10" Path="{./Icon}"/> + <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Left" Text="{./Caption}" /> + <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="10" Width="10" + MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> + <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Icons.exit2.svg" + MouseClick="./butQuitPress"/> + </Border> + <GraphicObject Width="5"/> + </HorizontalStack> + <Container Name="Content" MinimumSize="50,50"/> + </VerticalStack> +</Border> diff --git a/Tests/Interfaces/Experimental/testDock.crow b/Tests/Interfaces/Experimental/testDock.crow index 94a936a6..c0e6e96b 100644 --- a/Tests/Interfaces/Experimental/testDock.crow +++ b/Tests/Interfaces/Experimental/testDock.crow @@ -1,16 +1,17 @@ <?xml version="1.0"?> -<Window Height="50%" Width="60%"> - <DockStack Background="#60101050" Margin="10"/> +<Window Width="Stretched" Height="Stretched" Background="Jet"> + <DockStack Name="mainDock" Background="DarkRed" Margin="20"> + </DockStack> </Window> -<!--- <DockWindow Left="400" Top="400" Width="150" Height="150" Background="MediumSeaGreen"/> +<!--- <DockWindow Left="450" Top="450" Width="150" Height="150" Background="Maize"/>--> -<!--<Group Background="DimGray" Margin = "0" Focusable="true" > - <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window> - <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window> - <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window> - <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window> +<!--<Group Background="DimGrey" Margin = "0" Focusable="true" > + <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window> + <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window> + <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window> + <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window> </Group>--> <!--<Docker > <DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300"> @@ -20,7 +21,7 @@ <Label Text="{../../LogicalParent}" Background="Black"/> </VerticalStack> </DockWindow> - <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow> - <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow> - <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow> + <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow> + <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow> + <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow> </Docker>-->
\ No newline at end of file diff --git a/Tests/Interfaces/Experimental/testDock2.crow b/Tests/Interfaces/Experimental/testDock2.crow index 700f965c..041d0d85 100644 --- a/Tests/Interfaces/Experimental/testDock2.crow +++ b/Tests/Interfaces/Experimental/testDock2.crow @@ -6,11 +6,11 @@ <DockWindow Left="400" Top="400" Width="150" Height="150" Background="DarkYellow"/> <DockWindow Left="500" Top="500" Width="150" Height="150" Background="Yellow"/> </Docker> -<!--<Group Background="DimGray" Margin = "0" Focusable="true" > - <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window> - <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window> - <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window> - <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window> +<!--<Group Background="DimGrey" Margin = "0" Focusable="true" > + <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window> + <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window> + <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window> + <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window> </Group>--> <!--<Docker > <DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300"> @@ -20,7 +20,7 @@ <Label Text="{../../LogicalParent}" Background="Black"/> </VerticalStack> </DockWindow> - <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow> - <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow> - <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow> + <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow> + <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow> + <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow> </Docker>-->
\ No newline at end of file diff --git a/Tests/Interfaces/Experimental/testStack.crow b/Tests/Interfaces/Experimental/testStack.crow index 88e309dc..e17db3b1 100644 --- a/Tests/Interfaces/Experimental/testStack.crow +++ b/Tests/Interfaces/Experimental/testStack.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> <Window Width="600" Height="500"> -<VerticalStack Margin="20" Background="DimGray" Spacing="10"> +<VerticalStack Margin="20" Background="DimGrey" Spacing="10"> <GraphicObject Height="100" Width="500" Background="Green"/> <Splitter/> <HorizontalStack> @@ -12,11 +12,11 @@ <GraphicObject Height="100" Width="500" Background="Green"/> </VerticalStack> </Window> -<!--<Group Background="DimGray" Margin = "0" Focusable="true" > - <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window> - <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window> - <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window> - <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window> +<!--<Group Background="DimGrey" Margin = "0" Focusable="true" > + <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window> + <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window> + <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window> + <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window> </Group>--> <!--<Docker > <DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300"> @@ -26,7 +26,7 @@ <Label Text="{../../LogicalParent}" Background="Black"/> </VerticalStack> </DockWindow> - <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow> - <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow> - <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow> + <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow> + <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow> + <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow> </Docker>-->
\ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/0.crow b/Tests/Interfaces/GraphicObject/0.crow index 7fdd607f..97cda8a0 100755 --- a/Tests/Interfaces/GraphicObject/0.crow +++ b/Tests/Interfaces/GraphicObject/0.crow @@ -1,3 +1,2 @@ <?xml version="1.0"?> -<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen" - MinimumSize="50,50"/>
\ No newline at end of file +<GraphicObject Background="SeaGreen"/>
\ No newline at end of file diff --git a/Tests/Interfaces/Group/0.crow b/Tests/Interfaces/Group/0.crow index 9195ed4f..836231de 100755 --- a/Tests/Interfaces/Group/0.crow +++ b/Tests/Interfaces/Group/0.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Group MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%"> +<Group MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" VerticalAlignment="Top" MinimumSize="10,10"/> diff --git a/Tests/Interfaces/Group/1.crow b/Tests/Interfaces/Group/1.crow index 4f355f9b..540d4192 100755 --- a/Tests/Interfaces/Group/1.crow +++ b/Tests/Interfaces/Group/1.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Group Background="DimGray" Margin="10" Width="90%" Height="90%"> +<Group Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen" VerticalAlignment="Top" HorizontalAlignment="Left" diff --git a/Tests/Interfaces/Group/2.crow b/Tests/Interfaces/Group/2.crow index de743d3a..6982fc2b 100755 --- a/Tests/Interfaces/Group/2.crow +++ b/Tests/Interfaces/Group/2.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Group Background="DimGray" Margin="10" Fit="true"> +<Group Background="DimGrey" Margin="10" Fit="true"> <GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen" VerticalAlignment="Top" HorizontalAlignment="Left" diff --git a/Tests/Interfaces/Group/3.crow b/Tests/Interfaces/Group/3.crow index e323fd08..b6482063 100755 --- a/Tests/Interfaces/Group/3.crow +++ b/Tests/Interfaces/Group/3.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Group Background="DimGray" Margin="10" Width="70%" Height="50%"> +<Group Background="DimGrey" Margin="10" Width="70%" Height="50%"> <GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen" VerticalAlignment="Top" HorizontalAlignment="Left" diff --git a/Tests/Interfaces/Group/4.crow b/Tests/Interfaces/Group/4.crow index b7704d5b..815ef495 100755 --- a/Tests/Interfaces/Group/4.crow +++ b/Tests/Interfaces/Group/4.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Group Background="DimGray" Margin="10" Fit="true"> +<Group Background="DimGrey" Margin="10" Fit="true"> <Label Font="droid bold,40" Text="{fps}" Margin="10" Fit="true"/> <GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen" VerticalAlignment="Top" diff --git a/Tests/Interfaces/Splitter/1.crow b/Tests/Interfaces/Splitter/1.crow index e7eef87b..48c1ea1e 100755 --- a/Tests/Interfaces/Splitter/1.crow +++ b/Tests/Interfaces/Splitter/1.crow @@ -19,7 +19,7 @@ </Border> <Splitter Thickness="3"/> <Border Width="45%" CornerRadius="10" BorderWidth="1"> - <VerticalStack Width="50%" Height="50%" Background="DimGray"> + <VerticalStack Width="50%" Height="50%" Background="DimGrey"> <RadioButton IsChecked="false" Caption="Choice 1" Background="hgradient|0:DarkRed|1:Transparent"/> <RadioButton IsChecked="false" Caption="Choice 2" Background="hgradient|0:DarkRed|1:Transparent"/> <RadioButton IsChecked="true" Caption="Choice 3" Background="hgradient|0:DarkRed|1:Transparent"/> diff --git a/Tests/Interfaces/Stack/0.crow b/Tests/Interfaces/Stack/0.crow index 467a063e..1cdc4981 100755 --- a/Tests/Interfaces/Stack/0.crow +++ b/Tests/Interfaces/Stack/0.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%"> +<VerticalStack MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/0h.crow b/Tests/Interfaces/Stack/0h.crow index 95ef1359..24ee8a49 100755 --- a/Tests/Interfaces/Stack/0h.crow +++ b/Tests/Interfaces/Stack/0h.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<HorizontalStack MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%"> +<HorizontalStack MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/1.crow b/Tests/Interfaces/Stack/1.crow index 8a6a3c3c..d0e0c350 100755 --- a/Tests/Interfaces/Stack/1.crow +++ b/Tests/Interfaces/Stack/1.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="90%"> +<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="Stretched" Height="20%" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="60%" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/1h.crow b/Tests/Interfaces/Stack/1h.crow index c8ea266d..b4cb18d2 100755 --- a/Tests/Interfaces/Stack/1h.crow +++ b/Tests/Interfaces/Stack/1h.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%"> +<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="10" Width="Stretched" Height="20%" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="60%" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/2.crow b/Tests/Interfaces/Stack/2.crow index a3f2c019..64006cce 100755 --- a/Tests/Interfaces/Stack/2.crow +++ b/Tests/Interfaces/Stack/2.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="100%"> +<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="100%"> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/2h.crow b/Tests/Interfaces/Stack/2h.crow index faa5956c..3bb7d5f0 100755 --- a/Tests/Interfaces/Stack/2h.crow +++ b/Tests/Interfaces/Stack/2h.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="100%"> +<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="100%"> <GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="10,10"/> <GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/3.crow b/Tests/Interfaces/Stack/3.crow index b7784b90..b7d3543a 100755 --- a/Tests/Interfaces/Stack/3.crow +++ b/Tests/Interfaces/Stack/3.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="90%"> +<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="2,2"/> <GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/3h.crow b/Tests/Interfaces/Stack/3h.crow index 620cdeee..a20a284b 100755 --- a/Tests/Interfaces/Stack/3h.crow +++ b/Tests/Interfaces/Stack/3h.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%"> +<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%"> <GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="SeaGreen" MinimumSize="2,2"/> <GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="SeaGreen" diff --git a/Tests/Interfaces/Stack/4.crow b/Tests/Interfaces/Stack/4.crow index 6a7f2da7..33d57deb 100755 --- a/Tests/Interfaces/Stack/4.crow +++ b/Tests/Interfaces/Stack/4.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> <VerticalStack> - <HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="20%"> + <HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="20%"> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> @@ -12,7 +12,7 @@ <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> </HorizontalStack> - <HorizontalStack Background="DimGray" Margin="10" Width="Fit" Height="20%"> + <HorizontalStack Background="DimGrey" Margin="10" Width="Fit" Height="20%"> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> <Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/> diff --git a/Tests/Interfaces/TabItem.template b/Tests/Interfaces/TabItem.template index df580a85..fd0f310d 100644 --- a/Tests/Interfaces/TabItem.template +++ b/Tests/Interfaces/TabItem.template @@ -2,23 +2,23 @@ <GenericStack Orientation="Vertical" Spacing="0" Background="{./Background}" MouseEnter="{/caption.Foreground=White}" - MouseLeave="{/caption.Foreground=Gray}"> + MouseLeave="{/caption.Foreground=Grey}"> <HorizontalStack Left="{./TabOffset}" Name="TabTitle" HorizontalAlignment="Left" Height="{./TabHeight}" Width="{./TabWidth}"> - <Label Name="caption" Text="{./Caption}" Foreground="Gray" Width="Stretched"/> + <Label Name="caption" Text="{./Caption}" Foreground="Grey" Width="Stretched"/> <Label Text="{./ViewIndex}" Foreground="Green"/> <Label Text="{./TabOffset}" Foreground="Red"/> <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> - <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg" + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" MouseClick="./butCloseTabClick"/> </Border> </HorizontalStack> <Container Margin="20"> - <Container Background="DimGray" Name="Content"/> + <Container Background="DimGrey" Name="Content"/> </Container> </GenericStack> diff --git a/Tests/Interfaces/TemplatedContainer/0.crow b/Tests/Interfaces/TemplatedContainer/0.crow index e600d37c..5b267402 100755 --- a/Tests/Interfaces/TemplatedContainer/0.crow +++ b/Tests/Interfaces/TemplatedContainer/0.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<Expandable Fit="true" Caption="Test expandable" Background="DimGray"> +<Expandable Fit="true" Caption="Test expandable" Background="DimGrey"> <VerticalStack Margin="5" > <CheckBox Name="chk1" /> <CheckBox Name="chk2" IsChecked="true"/> diff --git a/Tests/Interfaces/TemplatedContainer/6.crow b/Tests/Interfaces/TemplatedContainer/6.crow index c1362017..641d58f9 100755 --- a/Tests/Interfaces/TemplatedContainer/6.crow +++ b/Tests/Interfaces/TemplatedContainer/6.crow @@ -1,8 +1,8 @@ -<Expandable Width="Stretched" Background="Gray"> +<Expandable Width="Stretched" Background="Grey"> <Expandable Width="Stretched" Background="LightBlue"> <Expandable Width="Stretched" Background="Green"> <Expandable Width="Stretched" Background="LimeGreen"> - <Expandable Width="Stretched" Background="DimGray"> + <Expandable Width="Stretched" Background="DimGrey"> <Expandable Width="Stretched" Background="Yellow"> <Expandable Width="Stretched" Background="SeaGreen"> <Expandable Width="Stretched" Background="Blue"> diff --git a/Tests/Interfaces/TemplatedContainer/7.crow b/Tests/Interfaces/TemplatedContainer/7.crow index 648b7a82..99a75079 100755 --- a/Tests/Interfaces/TemplatedContainer/7.crow +++ b/Tests/Interfaces/TemplatedContainer/7.crow @@ -1,11 +1,11 @@ <?xml version="1.0"?> <VerticalStack Height="Fit" Width="Fit"> <Label Width="Stretched"/> - <Expandable Width="Fit" Background="Gray"> + <Expandable Width="Fit" Background="Grey"> <Expandable Background="LightBlue"> <Expandable Background="Green"> <Expandable Background="LimeGreen"> - <Expandable Background="DimGray"> + <Expandable Background="DimGrey"> <Expandable Width="Stretched" Background="Yellow"> <Expandable Background="SeaGreen"> <Expandable Width="Stretched" Background="Blue"> diff --git a/Tests/Interfaces/TemplatedContainer/testGroupBox.crow b/Tests/Interfaces/TemplatedContainer/testGroupBox.crow index 416bb217..48581803 100755 --- a/Tests/Interfaces/TemplatedContainer/testGroupBox.crow +++ b/Tests/Interfaces/TemplatedContainer/testGroupBox.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!--<Container Background="vgradient|0:DarkGray|1:DimGray">--> +<!--<Container Background="vgradient|0:DarkGrey|1:DimGrey">--> <GroupBox Fit="true" Background="vgradient|0:SteelBlue|1:Transparent" Foreground="White"> <!-- <Label/>--> diff --git a/Tests/Interfaces/TemplatedContainer/testPopper.crow b/Tests/Interfaces/TemplatedContainer/testPopper.crow index 07e56b80..7d70da96 100755 --- a/Tests/Interfaces/TemplatedContainer/testPopper.crow +++ b/Tests/Interfaces/TemplatedContainer/testPopper.crow @@ -9,7 +9,7 @@ </VerticalStack> </Border> <GraphicObject Height="200"/> - <Popper Caption="TestPopper" Width="100" Background="DimGray" PopDirection="{alignment}"> + <Popper Caption="TestPopper" Width="100" Background="DimGrey" PopDirection="{alignment}"> <Border Fit="True" Background="SteelBlue"> <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/> <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue"> diff --git a/Tests/Interfaces/TemplatedContainer/testTabView.crow b/Tests/Interfaces/TemplatedContainer/testTabView.crow index c9e211f8..e3717c82 100644 --- a/Tests/Interfaces/TemplatedContainer/testTabView.crow +++ b/Tests/Interfaces/TemplatedContainer/testTabView.crow @@ -5,8 +5,8 @@ <Label Text="Selected Tab:"/> <Label Text="{../../tabview1.SelectedTab}"/> </HorizontalStack> - <TabView Name="tabview1" Background="DimGray" Orientation="Horizontal"> - <TabItem Name="TabItem1" Caption="tab item 1" Background="DimGray"> + <TabView Name="tabview1" Background="DimGrey" Orientation="Horizontal"> + <TabItem Name="TabItem1" Caption="tab item 1" Background="DimGrey"> <VerticalStack Margin="20"> <CheckBox/> <CheckBox/> @@ -14,7 +14,7 @@ <CheckBox/> </VerticalStack> </TabItem> - <TabItem Name="TabItem2" Caption="tab item 2" Background="DimGray"> + <TabItem Name="TabItem2" Caption="tab item 2" Background="DimGrey"> <VerticalStack Height="Fit" Margin="10"> <RadioButton Fit="true"/> <RadioButton/> @@ -22,16 +22,16 @@ <RadioButton/> </VerticalStack> </TabItem> - <TabItem Name="TabItem3" Background="DimGray" Caption="tab item 3"> + <TabItem Name="TabItem3" Background="DimGrey" Caption="tab item 3"> <Container Margin="5" CornerRadius="2" > <TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/> </Container> </TabItem> - <TabItem Name="TabItem4" Background="DimGray" Caption="tab item 4" Margin="0"> + <TabItem Name="TabItem4" Background="DimGrey" Caption="tab item 4" Margin="0"> <TextBox/> </TabItem> </TabView> - <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right" + <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right" Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/> </VerticalStack> </Group>
\ No newline at end of file diff --git a/Tests/Interfaces/TemplatedContainer/testTabView2.crow b/Tests/Interfaces/TemplatedContainer/testTabView2.crow index c02e991a..67b87b07 100644 --- a/Tests/Interfaces/TemplatedContainer/testTabView2.crow +++ b/Tests/Interfaces/TemplatedContainer/testTabView2.crow @@ -5,8 +5,8 @@ <Label Text="Selected Tab:"/> <Label Text="{../../tabview1.SelectedTab}"/> </HorizontalStack> - <TabView Name="tabview1" Background="DimGray" Orientation="Horizontal" Margin="5" > - <TabItem Name="TabItem1" Caption="tab-1.1" Background="DimGray"> + <TabView Name="tabview1" Background="DimGrey" Orientation="Horizontal" Margin="5" > + <TabItem Name="TabItem1" Caption="tab-1.1" Background="DimGrey"> <VerticalStack Margin="20"> <CheckBox/> <CheckBox/> @@ -14,7 +14,7 @@ <CheckBox/> </VerticalStack> </TabItem> - <TabItem Name="TabItem2" Caption="tab-1.2" Background="DimGray"> + <TabItem Name="TabItem2" Caption="tab-1.2" Background="DimGrey"> <VerticalStack Height="Fit" Margin="10"> <RadioButton Fit="true"/> <RadioButton/> @@ -22,13 +22,13 @@ <RadioButton/> </VerticalStack> </TabItem> - <TabItem Name="TabItem3" Background="DimGray" Caption="tab-1.3"> + <TabItem Name="TabItem3" Background="DimGrey" Caption="tab-1.3"> <Container Margin="5" CornerRadius="2" > <TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/> </Container> </TabItem> </TabView> - <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right" + <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right" Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/> </VerticalStack> <VerticalStack Width="40%"> @@ -36,8 +36,8 @@ <Label Text="Selected Tab:"/> <Label Text="{../../tabview2.SelectedTab}"/> </HorizontalStack> - <TabView Name="tabview2" Background="DimGray" Orientation="Horizontal" > - <TabItem Name="TabItem1" Caption="tab-2.1" Background="DimGray"> + <TabView Name="tabview2" Background="DimGrey" Orientation="Horizontal" > + <TabItem Name="TabItem1" Caption="tab-2.1" Background="DimGrey"> <VerticalStack Margin="20"> <CheckBox/> <CheckBox/> @@ -45,7 +45,7 @@ <CheckBox/> </VerticalStack> </TabItem> - <TabItem Name="TabItem2" Caption="tab-2.2" Background="DimGray"> + <TabItem Name="TabItem2" Caption="tab-2.2" Background="DimGrey"> <VerticalStack Height="Fit" Margin="10"> <RadioButton Fit="true"/> <RadioButton/> @@ -53,13 +53,13 @@ <RadioButton/> </VerticalStack> </TabItem> - <TabItem Name="TabItem3" Background="DimGray" Caption="tab-2.3"> + <TabItem Name="TabItem3" Background="DimGrey" Caption="tab-2.3"> <Container Margin="5" CornerRadius="2" > <TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/> </Container> </TabItem> </TabView> - <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right" + <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right" Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick2"/> </VerticalStack> </HorizontalStack> diff --git a/Tests/Interfaces/TemplatedControl/testButton.crow b/Tests/Interfaces/TemplatedControl/testButton.crow index 69367eaa..8911619d 100755 --- a/Tests/Interfaces/TemplatedControl/testButton.crow +++ b/Tests/Interfaces/TemplatedControl/testButton.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Fit="true" Background="vgradient|0:DimGray|1:Black"> +<VerticalStack Fit="true" Background="vgradient|0:DimGrey|1:Black"> <HorizontalStack Fit="True"> <Button Caption="but" MouseClick="onButClick"/> <Button Caption="but" MouseClick="onButClick" Fit="true"/> diff --git a/Tests/Interfaces/TemplatedControl/testCheckbox.crow b/Tests/Interfaces/TemplatedControl/testCheckbox.crow index 5147a151..7c8438c0 100755 --- a/Tests/Interfaces/TemplatedControl/testCheckbox.crow +++ b/Tests/Interfaces/TemplatedControl/testCheckbox.crow @@ -1,11 +1,11 @@ <?xml version="1.0"?> -<VerticalStack Fit="true" Margin="100" Background="DimGray" > - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> - <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> +<VerticalStack Fit="true" Margin="100" Background="DimGrey" > + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> + <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/> </VerticalStack> diff --git a/Tests/Interfaces/TemplatedControl/testCombobox.crow b/Tests/Interfaces/TemplatedControl/testCombobox.crow index 3ef27ace..4363986e 100755 --- a/Tests/Interfaces/TemplatedControl/testCombobox.crow +++ b/Tests/Interfaces/TemplatedControl/testCombobox.crow @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<Container Background="DimGray" Width="300"> +<Container Background="DimGrey" Width="300"> <ComboBox Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem.crow"/> </Container>
\ No newline at end of file diff --git a/Tests/Interfaces/TemplatedControl/testRadioButton.crow b/Tests/Interfaces/TemplatedControl/testRadioButton.crow index 905cdeba..a01d9041 100755 --- a/Tests/Interfaces/TemplatedControl/testRadioButton.crow +++ b/Tests/Interfaces/TemplatedControl/testRadioButton.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGray"> +<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGrey"> <RadioButton Caption="Radio1"/> <RadioButton Caption="Radio2" IsChecked="true"/> <RadioButton Caption="Radio3"/> diff --git a/Tests/Interfaces/TemplatedControl/testScrollbar.crow b/Tests/Interfaces/TemplatedControl/testScrollbar.crow index c494e347..f8c4a9ae 100755 --- a/Tests/Interfaces/TemplatedControl/testScrollbar.crow +++ b/Tests/Interfaces/TemplatedControl/testScrollbar.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> <Group Name="TopContainer" Width="400" Height="400" - Focusable="True" Background="Gray"> - <ScrollBar Height="Stretched" Orientation="Vertical" Width="16" Maximum="100"/> + Focusable="True" Background="Grey"> + <ScrollBar Height="16" Orientation="Horizontal" Width="Stretched" Maximum="100"/> </Group>
\ No newline at end of file diff --git a/Tests/Interfaces/TemplatedControl/testSpinner.crow b/Tests/Interfaces/TemplatedControl/testSpinner.crow index 07d62e65..01d53016 100755 --- a/Tests/Interfaces/TemplatedControl/testSpinner.crow +++ b/Tests/Interfaces/TemplatedControl/testSpinner.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> <VerticalStack Name="TopContainer" Width="400" Height="Fit" - Margin="20" Background="DarkGray"> + Margin="20" Background="DarkGrey"> <HorizontalStack Fit="true" Margin="5" Background="SkyBlue"> <Spinner Name="sp1" Value="5" ValueChanged="onSpinnerValueChange"/> diff --git a/Tests/Interfaces/basicTests/7.crow b/Tests/Interfaces/basicTests/7.crow index 8df18346..8d1e441c 100755 --- a/Tests/Interfaces/basicTests/7.crow +++ b/Tests/Interfaces/basicTests/7.crow @@ -89,11 +89,11 @@ </VerticalStack> <VerticalStack Width="33%" Margin="5" Spacing="5"> <Expandable Background="DimGray"> - <Image Path="#Crow.Images.Icons.crow.svg"/> + <Image Path="#Crow.Icons.crow.svg"/> </Expandable> <Popper Background="DimGray" PopDirection="Bottom"> <Border Fit="True" Background="DimGray" CornerRadius="0" BorderWidth="1"> - <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10" + <Image Path="#Crow.Icons.crow.svg" Width="100" Height="100" Margin="10" MouseEnter="{Background=LightGray}" MouseLeave="{Background=Transparent}"/> </Border> @@ -102,7 +102,7 @@ <Container Height="Fit" Background="Onyx" Margin="2" CornerRadius="5"> <ProgressBar Background="DimGray" Height="10" Value="50"/> </Container> - <Image Path="#Crow.Images.Icons.crow.svg" Width="60" Height="60" Background="LightGray" /> + <Image Path="#Crow.Icons.crow.svg" Width="60" Height="60" Background="LightGray" /> <TabView Name="tabview1" Height="120" Orientation="Horizontal" Spacing="15"> <TabItem Name="TabItem1" Caption="Tab 1" Margin="0"> diff --git a/Tests/Interfaces/colorItem2.crow b/Tests/Interfaces/colorItem2.crow new file mode 100755 index 00000000..4e29d380 --- /dev/null +++ b/Tests/Interfaces/colorItem2.crow @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit"> + <HorizontalStack Margin="0" + MouseEnter="{Background=CornflowerBlue}" + MouseLeave="{Background=Transparent}"> + <GraphicObject Height="8" Width="14" Background="{}" Margin="0" CornerRadius="2"/> + <Label Text="{}" Margin="0" Width="Stretched" Font="mono, 8"/> + </HorizontalStack> +</Border> + diff --git a/Tests/Interfaces/perfMsr.crow b/Tests/Interfaces/perfMsr.crow index d823ea42..22a62ea1 100755 --- a/Tests/Interfaces/perfMsr.crow +++ b/Tests/Interfaces/perfMsr.crow @@ -1,7 +1,7 @@ <?xml version="1.0"?> - <VerticalStack Spacing="0" Fit="true" Width="160"> - <HorizontalStack Background="Black"> + <VerticalStack Spacing="1" Height="Fit" Width="Stretched"> + <HorizontalStack Background="DarkSlateGrey"> <Label Text="{Name}" Width="Stretched" Font="doid bold, 10" Margin="2"/> <Button Caption="Reset" MouseClick="onResetClick" Height="Fit"/> </HorizontalStack> @@ -21,6 +21,9 @@ <Label Text="Maximum:" Style="FpsLabel"/> <Label Text="{maximum}" Style="FpsDisp"/> </HorizontalStack> + <Border Foreground="White" Width="Stretched" Height="60"> + <Trend Background="Black" NewValue="{current}" Minimum="0" Maximum="100"/> + </Border> <!-- <HorizontalStack> <Label Text="Total:" Style="FpsLabel"/> <Label Text="{total}" Style="FpsDisp"/> diff --git a/Tests/Interfaces/testBorder.goml.cs b/Tests/Interfaces/testBorder.goml.cs deleted file mode 100644 index 8c7663a4..00000000 --- a/Tests/Interfaces/testBorder.goml.cs +++ /dev/null @@ -1,31 +0,0 @@ -// ------------------------------------------------------------------------------ -// <autogenerated> -// This code was generated by a tool. -// Mono Runtime Version: 4.0.30319.17020 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </autogenerated> -// ------------------------------------------------------------------------------ - -using System; - - -namespace Crow { - - public partial class testBorder : Border { - public testBorder() { - this.BorderWidth = 5; - this.Width = 200; - this.Height = 200; - this.CornerRadius = 20; - this.Margin = 0; - this.Background = Crow.Color.Mantis; - this.SetChild(new Crow.GraphicObject()); - this.Child.CornerRadius = 0; - this.Child.Background = Crow.Color.CornflowerBlue; - this.Child.Height = 100; - this.Child.Width = 100; - } - } -} diff --git a/Tests/OpenGL/Extensions.cs b/Tests/OpenGL/Extensions.cs deleted file mode 100644 index 7b26f76b..00000000 --- a/Tests/OpenGL/Extensions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Extensions.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2017 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -using System; -using OpenTK; -using Crow; - -namespace Crow -{ - public static partial class Extensions { - public static Vector4 ToVector4(this Color c){ - float[] f = c.floatArray; - return new Vector4 (f [0], f [1], f [2], f [3]); - } - public static Vector3 Transform(this Vector3 v, Matrix4 m){ - return Vector4.Transform(new Vector4(v, 1), m).Xyz; - } - public static bool IsInBetween(this int v, int min, int max){ - return v >= min & v <= max; - } - - } -} - diff --git a/Tests/OpenGL/Shader.cs b/Tests/OpenGL/Shader.cs deleted file mode 100644 index 1253ff72..00000000 --- a/Tests/OpenGL/Shader.cs +++ /dev/null @@ -1,336 +0,0 @@ -// -// Shader.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2016 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -using System; -using System.Diagnostics; -using System.IO; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -namespace Crow -{ - public class Shader : IDisposable - { - #region CTOR - public Shader () - { - Init (); - } - public Shader (string vertResPath, string fragResPath = null, string geomResPath = null) - { - VertSourcePath = vertResPath; - FragSourcePath = fragResPath; - GeomSourcePath = geomResPath; - - loadSourcesFiles (); - - Init (); - } - #endregion - - public string VertSourcePath, - FragSourcePath, - GeomSourcePath; - #region Sources - protected string _vertSource = @" - #version 300 es - precision lowp float; - - uniform mat4 mvp; - - layout(location = 0) in vec3 in_position; - layout(location = 1) in vec2 in_tex; - - out vec2 texCoord; - - void main(void) - { - texCoord = in_tex; - gl_Position = mvp * vec4(in_position, 1.0); - }"; - - protected string _fragSource = @" - #version 300 es - precision lowp float; - - uniform sampler2D tex; - - in vec2 texCoord; - out vec4 out_frag_color; - - void main(void) - { - out_frag_color = texture( tex, texCoord);//vec4(1,0,0,1); - }"; - string _geomSource = @""; -// #version 330 -// layout(triangles) in; -// layout(triangle_strip, max_vertices=3) out; -// void main() -// { -// for(int i=0; i<3; i++) -// { -// gl_Position = gl_in[i].gl_Position; -// EmitVertex(); -// } -// EndPrimitive(); -// }"; - #endregion - - #region Private and protected fields - public int vsId, fsId, gsId, pgmId, mvpLocation; - - Matrix4 mvp = Matrix4.Identity; - #endregion - - - #region Public properties - public virtual string vertSource - { - get { return _vertSource;} - set { _vertSource = value; } - } - public virtual string fragSource - { - get { return _fragSource;} - set { _fragSource = value; } - } - public virtual string geomSource - { - get { return _geomSource; } - set { _geomSource = value; } - } - - public virtual Matrix4 MVP{ - set { mvp = value; } - get { return mvp; } - } - #endregion - - #region Public functions - /// <summary> - /// configure sources and compile - /// </summary> - public virtual void Init() - { - Compile (); - } - public void Reload(){ - loadSourcesFiles (); - Compile (); - } - public void SetSource(ShaderType shaderType, string _source){ - switch (shaderType) { - case ShaderType.FragmentShader: - fragSource = _source; - return; - case ShaderType.VertexShader: - vertSource = _source; - return; - case ShaderType.GeometryShader: - geomSource = _source; - return; - } - } - public string GetSource(ShaderType shaderType){ - switch (shaderType) { - case ShaderType.FragmentShader: - return fragSource; - case ShaderType.VertexShader: - return vertSource; - case ShaderType.GeometryShader: - return geomSource; - } - return ""; - } - public string GetSourcePath(ShaderType shaderType){ - switch (shaderType) { - case ShaderType.FragmentShader: - return FragSourcePath; - case ShaderType.VertexShader: - return VertSourcePath; - case ShaderType.GeometryShader: - return GeomSourcePath; - } - return ""; - } - public virtual void Compile() - { - Dispose (); - - pgmId = GL.CreateProgram(); - - if (!string.IsNullOrEmpty(vertSource)) - { - vsId = GL.CreateShader(ShaderType.VertexShader); - compileShader(vsId, vertSource); - } - if (!string.IsNullOrEmpty(fragSource)) - { - fsId = GL.CreateShader(ShaderType.FragmentShader); - compileShader(fsId, fragSource); - - } - if (!string.IsNullOrEmpty(geomSource)) - { - gsId = GL.CreateShader(ShaderType.GeometryShader); - compileShader(gsId,geomSource); - } - - if (vsId != 0) - GL.AttachShader(pgmId, vsId); - if (fsId != 0) - GL.AttachShader(pgmId, fsId); - if (gsId != 0) - GL.AttachShader(pgmId, gsId); - - BindVertexAttributes (); - - string info; - GL.LinkProgram(pgmId); - GL.GetProgramInfoLog(pgmId, out info); - - if (!string.IsNullOrEmpty (info)) { - Debug.WriteLine ("Linkage:"); - Debug.WriteLine (info); - } - - info = null; - - GL.ValidateProgram(pgmId); - GL.GetProgramInfoLog(pgmId, out info); - if (!string.IsNullOrEmpty (info)) { - Debug.WriteLine ("Validation:"); - Debug.WriteLine (info); - } - - GL.UseProgram (pgmId); - - GetUniformLocations (); - BindSamplesSlots (); - - Disable (); - } - - protected virtual void BindVertexAttributes() - { - GL.BindAttribLocation(pgmId, 0, "in_position"); - GL.BindAttribLocation(pgmId, 1, "in_tex"); - } - protected virtual void GetUniformLocations() - { - mvpLocation = GL.GetUniformLocation(pgmId, "mvp"); - } - protected virtual void BindSamplesSlots(){ - GL.Uniform1(GL.GetUniformLocation (pgmId, "tex"), 0); - } - public void SetMVP(Matrix4 _mvp){ - GL.UniformMatrix4(mvpLocation, false, ref _mvp); - } - public virtual void Enable(){ - GL.UseProgram (pgmId); - } - public virtual void Disable(){ - GL.UseProgram (0); - } - public static void Enable(Shader s) - { - if (s == null) - return; - s.Enable (); - } - public static void Disable(Shader s) - { - if (s == null) - return; - s.Disable (); - } - #endregion - - void loadSourcesFiles(){ - Stream s; - - if (!string.IsNullOrEmpty (VertSourcePath)) { - s = Crow.Interface.StaticGetStreamFromPath (VertSourcePath); - if (s != null) { - using (StreamReader sr = new StreamReader (s)) { - vertSource = sr.ReadToEnd (); - } - } - } - - if (!string.IsNullOrEmpty (FragSourcePath)) { - s = Crow.Interface.StaticGetStreamFromPath (FragSourcePath); - if (s != null) { - using (StreamReader sr = new StreamReader (s)) { - fragSource = sr.ReadToEnd (); - } - } - } - - if (!string.IsNullOrEmpty (GeomSourcePath)) { - s = Crow.Interface.StaticGetStreamFromPath (GeomSourcePath); - if (s != null) { - using (StreamReader sr = new StreamReader (s)) { - geomSource = sr.ReadToEnd (); - } - } - } - } - void compileShader(int shader, string source) - { - GL.ShaderSource(shader, source); - GL.CompileShader(shader); - - string info; - GL.GetShaderInfoLog(shader, out info); - Debug.WriteLine(info); - - int compileResult; - GL.GetShader(shader, ShaderParameter.CompileStatus, out compileResult); - if (compileResult != 1) - { - Debug.WriteLine("Compile Error!"); - Debug.WriteLine(source); - } - } - public override string ToString () - { - return string.Format ("{0} {1} {2}", VertSourcePath, FragSourcePath, GeomSourcePath); - } - - #region IDisposable implementation - public virtual void Dispose () - { - if (GL.IsProgram (pgmId)) - GL.DeleteProgram (pgmId); - - if (GL.IsShader (vsId)) - GL.DeleteShader (vsId); - if (GL.IsShader (fsId)) - GL.DeleteShader (fsId); - if (GL.IsShader (gsId)) - GL.DeleteShader (gsId); - } - #endregion - } -} - diff --git a/Tests/OpenGL/Texture.cs b/Tests/OpenGL/Texture.cs deleted file mode 100644 index 08215ada..00000000 --- a/Tests/OpenGL/Texture.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// Texture.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2016 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -using System; -using System.Drawing; -using OpenTK.Graphics.OpenGL; -using System.Drawing.Imaging; -using System.IO; -using System.Diagnostics; - -namespace Crow -{ - public class Texture - { - public string Map; - public int texRef; - public int Width; - public int Height; - - public Texture(string _mapPath, bool flipY = true) - { - using (Stream s = Interface.StaticGetStreamFromPath (_mapPath)) { - - try { - Map = _mapPath; - - Bitmap bitmap = new Bitmap (s); - - if (flipY) - bitmap.RotateFlip (RotateFlipType.RotateNoneFlipY); - - BitmapData data = bitmap.LockBits (new System.Drawing.Rectangle (0, 0, bitmap.Width, bitmap.Height), - ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); - - createTexture (data.Scan0, data.Width, data.Height); - - bitmap.UnlockBits (data); - - GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear); - GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - - GL.GenerateMipmap (GenerateMipmapTarget.Texture2D); - - } catch (Exception ex) { - Debug.WriteLine ("Error loading texture: " + Map + ":" + ex.Message); - } - } - } - - public Texture(int width, int height) - { - createTexture (IntPtr.Zero, width, height); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp); - } - - void createTexture(IntPtr data, int width, int height) - { - Width = width; - Height = height; - - GL.GenTextures(1, out texRef); - GL.BindTexture(TextureTarget.Texture2D, texRef); - GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, width, height, 0, - OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data); - } - - public static implicit operator int(Texture t) - { - return t == null ? 0: t.texRef; - } - } - -} diff --git a/Tests/OpenGL/vaoMesh.cs b/Tests/OpenGL/vaoMesh.cs deleted file mode 100644 index 19acd737..00000000 --- a/Tests/OpenGL/vaoMesh.cs +++ /dev/null @@ -1,221 +0,0 @@ -// -// vaoMesh.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2016 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -namespace Crow -{ - public class vaoMesh : IDisposable - { - public int vaoHandle, - positionVboHandle, - texVboHandle, - eboHandle; - - public Vector3[] positions; - public Vector2[] texCoords; - public int[] indices; - - public vaoMesh() - { - } - - public vaoMesh (Vector3[] _positions, Vector2[] _texCoord, int[] _indices) - { - positions = _positions; - texCoords = _texCoord; - indices = _indices; - - CreateBuffers (); - } - - public vaoMesh (float x, float y, float z, float width, float height, float TileX = 1f, float TileY = 1f) - { - positions = - new Vector3[] { - new Vector3 (x - width / 2, y + height / 2, z), - new Vector3 (x - width / 2, y - height / 2, z), - new Vector3 (x + width / 2, y + height / 2, z), - new Vector3 (x + width / 2, y - height / 2, z) - }; - texCoords = new Vector2[] { - new Vector2 (0, TileY), - new Vector2 (0, 0), - new Vector2 (TileX, TileY), - new Vector2 (TileX, 0) - }; - indices = new int[] { 0, 1, 2, 3 }; - - CreateBuffers (); - } - public static vaoMesh CreateCube(){ - vaoMesh tmp = new vaoMesh (); - tmp.positions = new Vector3[] - { - new Vector3(-1.0f, -1.0f, -1.0f), - new Vector3( -1.0f, -1.0f, 1.0f), - new Vector3( 1.0f, -1.0f, -1.0f), - new Vector3(1.0f, -1.0f, 1.0f), - new Vector3(1.0f, 1.0f, -1.0f), - new Vector3( 1.0f, 1.0f, 1.0f), - new Vector3( -1.0f, 1.0f, -1.0f), - new Vector3(-1.0f, 1.0f, 1.0f) - }; - tmp.indices = new int[] - { - // front face - 0, 2, 1, 1, 2, 3, - // top face - 2, 4, 3, 3, 4, 5, - // back face - 4, 6, 5, 5, 6, 7, - // left face - 6, 0, 7, 7, 0, 1, - // bottom face - 1, 3, 7, 7, 3, 5, - // right face -// 1, 5, 6, 6, 2, 1, - }; - tmp.texCoords = new Vector2[] - { - new Vector2(0, 0), - new Vector2(0, 1), - new Vector2(1, 0), - new Vector2(1, 1), - new Vector2(0, 0), - new Vector2(0, 1), - new Vector2(1, 0), - new Vector2(1, 1), - }; - tmp.CreateBuffers (); - return tmp; -// Normals = new Vector3[] -// { -// new Vector3(-1.0f, -1.0f, 1.0f), -// new Vector3( 1.0f, -1.0f, 1.0f), -// new Vector3( 1.0f, 1.0f, 1.0f), -// new Vector3(-1.0f, 1.0f, 1.0f), -// new Vector3(-1.0f, -1.0f, -1.0f), -// new Vector3( 1.0f, -1.0f, -1.0f), -// new Vector3( 1.0f, 1.0f, -1.0f), -// new Vector3(-1.0f, 1.0f, -1.0f), -// }; -// -// Colors = new int[] -// { -// Utilities.ColorToRgba32(Color.DarkRed), -// Utilities.ColorToRgba32(Color.DarkRed), -// Utilities.ColorToRgba32(Color.Gold), -// Utilities.ColorToRgba32(Color.Gold), -// Utilities.ColorToRgba32(Color.DarkRed), -// Utilities.ColorToRgba32(Color.DarkRed), -// Utilities.ColorToRgba32(Color.Gold), -// Utilities.ColorToRgba32(Color.Gold), -// }; - } - public void CreateBuffers(){ - CreateVBOs (); - CreateVAOs (); - } - protected void CreateVBOs() - { - positionVboHandle = GL.GenBuffer(); - GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle); - GL.BufferData<Vector3>(BufferTarget.ArrayBuffer, - new IntPtr(positions.Length * Vector3.SizeInBytes), - positions, BufferUsageHint.StaticDraw); - - if (texCoords != null) { - texVboHandle = GL.GenBuffer (); - GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle); - GL.BufferData<Vector2> (BufferTarget.ArrayBuffer, - new IntPtr (texCoords.Length * Vector2.SizeInBytes), - texCoords, BufferUsageHint.StaticDraw); - } - - GL.BindBuffer(BufferTarget.ArrayBuffer, 0); - - if (indices != null) { - eboHandle = GL.GenBuffer (); - GL.BindBuffer (BufferTarget.ElementArrayBuffer, eboHandle); - GL.BufferData (BufferTarget.ElementArrayBuffer, - new IntPtr (sizeof(uint) * indices.Length), - indices, BufferUsageHint.StaticDraw); - GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0); - } - } - protected void CreateVAOs() - { - vaoHandle = GL.GenVertexArray(); - GL.BindVertexArray(vaoHandle); - - GL.EnableVertexAttribArray(0); - GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle); - GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, true, Vector3.SizeInBytes, 0); - - if (texCoords != null) { - GL.EnableVertexAttribArray (1); - GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle); - GL.VertexAttribPointer (1, 2, VertexAttribPointerType.Float, true, Vector2.SizeInBytes, 0); - } - if (indices != null) - GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle); - - GL.BindVertexArray(0); - } - - public void Render(BeginMode _primitiveType){ - GL.BindVertexArray(vaoHandle); - if (indices == null) - GL.DrawArrays (_primitiveType, 0, positions.Length); - else - GL.DrawElements(_primitiveType, indices.Length, - DrawElementsType.UnsignedInt, IntPtr.Zero); - GL.BindVertexArray (0); - } - public void Render(BeginMode _primitiveType, int[] _customIndices){ - GL.BindVertexArray(vaoHandle); - GL.DrawElements(_primitiveType, _customIndices.Length, - DrawElementsType.UnsignedInt, _customIndices); - GL.BindVertexArray (0); - } - public void Render(BeginMode _primitiveType, int instances){ - - GL.BindVertexArray(vaoHandle); - GL.DrawElementsInstanced(_primitiveType, indices.Length, - DrawElementsType.UnsignedInt, IntPtr.Zero, instances); - GL.BindVertexArray (0); - } - - #region IDisposable implementation - public void Dispose () - { - GL.DeleteBuffer (positionVboHandle); - GL.DeleteBuffer (texVboHandle); - GL.DeleteBuffer (eboHandle); - GL.DeleteVertexArray (vaoHandle); - } - #endregion - - } -}
\ No newline at end of file diff --git a/Tests/Showcase.cs b/Tests/Showcase.cs index da9b99dc..ca72bf10 100644 --- a/Tests/Showcase.cs +++ b/Tests/Showcase.cs @@ -25,8 +25,6 @@ // THE SOFTWARE. using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; using Crow; using System.IO; using System.Collections.Generic; @@ -35,46 +33,48 @@ using System.Linq; using System.Text; using Crow.IML; -namespace Tests +namespace tests { - class Showcase : CrowWindow + class Showcase : Interface { + public Container crowContainer; + [STAThread] static void Main () { - Showcase win = new Showcase (); - win.Run (30); - } + using (Showcase app = new Showcase ()) { + //app.Keyboard.KeyDown += App_KeyboardKeyDown; - public Showcase () - : base(1024, 800,"Showcase") - { - } + GraphicObject g = app.AddWidget ("#Tests.ui.showcase.crow"); + g.DataSource = app; + app.crowContainer = g.FindByName ("CrowContainer") as Container; + //I set an empty object as datasource at this level to force update when new + //widgets are added to the interface + app.crowContainer.DataSource = new object (); + app.hideError (); + app.LoadIMLFragment(@"<Window Width='150' Height='150' Name='dock1'/>"); + app.Run(); - Container crowContainer; + } + } - protected override void OnLoad (EventArgs e) + static void App_KeyboardKeyDown (object sender, KeyEventArgs e) { - base.OnLoad (e); - - this.CrowKeyDown += Showcase_CrowKeyDown; - GraphicObject g = Load ("#Tests.ui.showcase.crow"); - g.DataSource = this; - crowContainer = g.FindByName ("CrowContainer") as Container; - //I set an empty object as datasource at this level to force update when new - //widgets are added to the interface - crowContainer.DataSource = new object (); - hideError (); + #if DEBUG_LOG + switch (e.Key) { + case Key.F2: + DebugLog.save (sender as Interface); + break; + } + #endif } - void Showcase_CrowKeyDown (object sender, OpenTK.Input.KeyboardKeyEventArgs e) + public Showcase () + : base(1024, 800) { - if (e.Key == OpenTK.Input.Key.Escape) { - Quit (null, null); - return; - } } + void Dv_SelectedItemChanged (object sender, SelectionChangeEventArgs e) { FileSystemInfo fi = e.NewValue as FileSystemInfo; @@ -83,17 +83,22 @@ namespace Tests if (fi is DirectoryInfo) return; hideError(); - lock (this.CurrentInterface.UpdateMutex) { - try { - GraphicObject g = this.CurrentInterface.Load (fi.FullName); - crowContainer.SetChild (g); - g.DataSource = this; - } catch (InstantiatorException ex) { - showError (ex); - } - } + lock (UpdateMutex) { + try + { + GraphicObject g = Load(fi.FullName); + crowContainer.SetChild(g); + g.DataSource = this; + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + if (ex is InstantiatorException) + showError((InstantiatorException)ex); + } + } - string source = ""; + string source = ""; using (Stream s = new FileStream (fi.FullName, FileMode.Open)) { using (StreamReader sr = new StreamReader (s)) { source = sr.ReadToEnd (); @@ -115,24 +120,22 @@ namespace Tests hideError(); GraphicObject g = null; try { - lock (this.ifaceControl [0].CrowInterface.UpdateMutex) { + lock (UpdateMutex) { Instantiator inst = null; using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (e.Text))){ - inst = new Instantiator (this.ifaceControl [0].CrowInterface, ms); + inst = new Instantiator (this, ms); } g = inst.CreateInstance (); crowContainer.SetChild (g); g.DataSource = this; } - } catch (InstantiatorException ex) { - System.Diagnostics.Debug.WriteLine (ex.ToString ()); - showError (ex); + } catch (Exception ex) { + Console.WriteLine (ex.ToString ()); + if (ex is InstantiatorException) + showError ((InstantiatorException)ex); } - } - public override void OnRender (FrameEventArgs e) - { - base.OnRender (e); - } + } + #region Test values for Binding public int intValue = 500; diff --git a/Tests/Tests.NetStd.csproj b/Tests/Tests.NetStd.csproj new file mode 100644 index 00000000..20239315 --- /dev/null +++ b/Tests/Tests.NetStd.csproj @@ -0,0 +1,39 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>netcoreapp2.0</TargetFramework> + + <OutputType>Exe</OutputType> + <StartupObject>tests.Showcase</StartupObject> + + <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath> + <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath> + + <EnableDefaultItems>false</EnableDefaultItems> + <EnableDefaultCompileItems>false</EnableDefaultCompileItems> + </PropertyGroup> + + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugType>portable</DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="*.cs" /> + + <ProjectReference Include="..\Crow\Crow.NetStd.csproj" /> + + <EmbeddedResource Include="image\**\*.*"> + <LogicalName>Tests.image.%(Filename)%(Extension)</LogicalName> + </EmbeddedResource> + + <EmbeddedResource Include="ui\**\*.*"> + <LogicalName>Tests.ui.%(Filename)%(Extension)</LogicalName> + </EmbeddedResource> + + <EmbeddedResource Include="test.style" /> + + <None Include="Interfaces\**\*.*"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index c86ff9cb..69437acc 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -8,10 +8,9 @@ <OutputType>Exe</OutputType> <RootNamespace>Tests</RootNamespace> <AssemblyName>Tests</AssemblyName> - <StartupObject>Tests.BasicTests</StartupObject> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <StartupObject>tests.Showcase</StartupObject> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ReleaseVersion>0.5</ReleaseVersion> + <ReleaseVersion>0.8.0</ReleaseVersion> <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath> <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath> <CustomCommands> @@ -19,6 +18,7 @@ <Command type="Execute" command="${TargetName}" workingdir="${SolutionDir}/build/${ProjectConfigName}" /> </CustomCommands> </CustomCommands> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -26,10 +26,15 @@ <Optimize>false</Optimize> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <ConsolePause>false</ConsolePause> <DefineConstants>DEBUG;TRACE;MEASURE_TIME</DefineConstants> <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath> <OutputPath>$(SolutionDir)build\Debug</OutputPath> + <EnvironmentVariables> + <EnvironmentVariables> + <Variable name="MONO_CAIRO_DEBUG_DISPOSE" value="1" /> + </EnvironmentVariables> + </EnvironmentVariables> + <ConsolePause>false</ConsolePause> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -75,35 +80,29 @@ <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory> <ConsolePause>false</ConsolePause> </PropertyGroup> + <PropertyGroup Condition=" '$(RunConfiguration)' == 'Custom Command' "> + <StartAction>Program</StartAction> + <StartProgram>%24{TargetName}</StartProgram> + <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory> + <ConsolePause>false</ConsolePause> + </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> <Reference Include="System.Drawing" /> - <Reference Include="OpenTK"> - <HintPath>..\packages\OpenTK.2.0.0\lib\net20\OpenTK.dll</HintPath> - </Reference> + <Reference Include="Mono.Posix" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ItemGroup> <Compile Include="BasicTests.cs" /> - <Compile Include="OpenGL\Shader.cs" /> - <Compile Include="OpenGL\vaoMesh.cs" /> - <Compile Include="OpenGL\Texture.cs" /> - <Compile Include="HelloWorld.cs" /> - <Compile Include="CrowWindow.cs" /> - <Compile Include="Hello3D.cs" /> - <Compile Include="OpenGL\Extensions.cs" /> - <Compile Include="InterfaceControler.cs" /> <Compile Include="Showcase.cs" /> <Compile Include="GraphicObjects\ColorCircleSelector.cs" /> <Compile Include="GraphicObjects\SimpleGauge.cs" /> - <Compile Include="Tutorials\T1_HelloWorld.cs" /> - <Compile Include="Tutorials\T3_OpenGLCube.cs" /> - <Compile Include="Tutorials\T4_Gauge.cs" /> - <Compile Include="Tutorials\T2_IML.cs" /> <Compile Include="GraphicObjects\HexaContainer.cs" /> <Compile Include="GraphicObjects\TechBorder.cs" /> + <Compile Include="keysyms.cs" /> + <Compile Include="GraphicObjects\LaggingGraphicObject.cs" /> </ItemGroup> <ItemGroup> <None Include="image\u.svg"> @@ -351,7 +350,6 @@ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="OpenTK.dll.config" /> - <None Include="packages.config" /> <None Include="Interfaces\Divers\testShape.crow"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> @@ -382,6 +380,18 @@ <None Include="Interfaces\TemplatedContainer\testTabView2.crow"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="Interfaces\Divers\testFocus.crow"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="Interfaces\Divers\testMenu.crow"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="Interfaces\Divers\testVisibility.crow"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="Interfaces\CheckBox2.imlt"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> </ItemGroup> <ItemGroup> <Folder Include="Interfaces\" /> @@ -395,7 +405,6 @@ <Folder Include="Interfaces\TemplatedContainer\" /> <Folder Include="Interfaces\TemplatedGroup\" /> <Folder Include="GraphicObjects\" /> - <Folder Include="Tutorials\" /> <Folder Include="Interfaces\DragAndDrop\" /> <Folder Include="Interfaces\Experimental\" /> </ItemGroup> @@ -417,18 +426,26 @@ <EmbeddedResource Include="ui\MenuItem.style" /> <EmbeddedResource Include="test.style" /> <EmbeddedResource Include="Interfaces\treeList.crow" /> - <EmbeddedResource Include="Interfaces\CheckBox2.imlt" /> <EmbeddedResource Include="Interfaces\perfMsr.crow" /> <EmbeddedResource Include="ui\showcase.crow" /> - <EmbeddedResource Include="Tutorials\test.crow"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </EmbeddedResource> <EmbeddedResource Include="Interfaces\TabItem.template"> <LogicalName>Crow.TabItem.template</LogicalName> </EmbeddedResource> + <EmbeddedResource Include="ui\dbgLog.crow" /> + <EmbeddedResource Include="Interfaces\Experimental\DockWindow.template"> + <LogicalName>Crow.DockWindow.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="ui\MenuItem.template"> + <LogicalName>Crow.MenuItem.template</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="image\blank-file.svg" /> + <EmbeddedResource Include="ui\dbgLogColors.crow" /> + <EmbeddedResource Include="Interfaces\colorItem2.crow"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Crow.csproj"> + <ProjectReference Include="..\Crow\Crow.csproj"> <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project> <Name>Crow</Name> </ProjectReference> diff --git a/Tests/Tutorials/T3_OpenGLCube.cs b/Tests/Tutorials/T3_OpenGLCube.cs deleted file mode 100644 index 2cada668..00000000 --- a/Tests/Tutorials/T3_OpenGLCube.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// HelloCube.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using Crow; - -namespace Tutorials -{ - class T3_OpenGLCube : CrowWindow - { - [STAThread] - static void Main () - { - T3_OpenGLCube win = new T3_OpenGLCube (); - win.Run (30); - } - - public T3_OpenGLCube () - : base(800, 600,"Crow Test with OpenTK") - { - } - - vaoMesh cube; - Texture texture; - Matrix4 projection, modelview; - - protected override void OnLoad (EventArgs e) - { - base.OnLoad (e); - - GL.Enable (EnableCap.CullFace); - GL.Enable (EnableCap.Blend); - GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); - - cube = vaoMesh.CreateCube (); - texture = new Texture ("image/textest.png"); - - projection = - Matrix4.CreatePerspectiveFieldOfView ( - MathHelper.PiOver4, - ClientRectangle.Width / (float)ClientRectangle.Height, 1.0f, 10.0f); - modelview = Matrix4.LookAt(new Vector3(5,5,5), Vector3.Zero, Vector3.UnitZ); - - AddWidget( - new Window (this.CurrentInterface) - { - Caption = "Hello World" - } - ); - } - public override void OnRender (FrameEventArgs e) - { - base.OnRender (e); - - shader.SetMVP(modelview * projection); - - GL.BindTexture (TextureTarget.Texture2D, texture); - cube.Render (BeginMode.Triangles); - GL.BindTexture (TextureTarget.Texture2D, 0); - } - } -}
\ No newline at end of file diff --git a/Tests/Tutorials/test.crow b/Tests/Tutorials/test.crow deleted file mode 100755 index a1299e79..00000000 --- a/Tests/Tutorials/test.crow +++ /dev/null @@ -1,3 +0,0 @@ -<Window Height="400" Width="50%" Caption="My first Window"> - <Label Text="Hello World"/> -</Window>
\ No newline at end of file diff --git a/Tests/image/blank-file.svg b/Tests/image/blank-file.svg new file mode 100644 index 00000000..8136979e --- /dev/null +++ b/Tests/image/blank-file.svg @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generated by IcoMoon.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"> +<path fill="#FFFFFF" d="M10 0h-8v16h12v-12l-4-4zM9 5h4v10h-10v-14h6v4zM10 4v-3l3 3h-3z"></path> +</svg> diff --git a/Tests/keysyms.cs b/Tests/keysyms.cs new file mode 100644 index 00000000..e33add92 --- /dev/null +++ b/Tests/keysyms.cs @@ -0,0 +1,85 @@ +// +// keysyms.cs +// +// Author: +// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.IO; + +namespace Tests +{ + static class keysyms + { + public static void Main(string[] args) + { + using (StreamWriter sw = new StreamWriter ("test.cs")) { + using (StreamReader r = new StreamReader ("/usr/include/xkbcommon/xkbcommon-keysyms.h")) { + bool skip = false; + int maxChar = 0; + sw.WriteLine ("/* autogenerated */"); + sw.WriteLine ("using System;\n"); + sw.WriteLine ("namespace Crow.XCB"); + sw.WriteLine ("{"); + sw.WriteLine ("\t[Flags]"); + sw.WriteLine ("\tpublic enum KeySym"); + sw.WriteLine ("\t{"); + r.ReadLine (); + r.ReadLine (); + while (!r.EndOfStream) { + string s = r.ReadLine ().Trim(); + if (skip) { + if (s.EndsWith ("*/")) + skip = false; + continue; + } + if (s.StartsWith ("/*")) { + if (!s.EndsWith ("*/")) + skip = true; + continue; + } + if (!s.StartsWith ("#define")) + continue; + string[] tmp = s.Split (new char[] {' ', '\t'}, StringSplitOptions.RemoveEmptyEntries); + + string keyName = tmp [1].Substring (8); + if (char.IsDigit (keyName [0])) + keyName = "key_" + keyName; + + if (keyName.Length > maxChar) + maxChar = keyName.Length; + + int nbTab = keyName.Length / 4; + nbTab = 8 - nbTab; + + sw.WriteLine ("\t\t{0}{1}= {2},", keyName, new String('\t',nbTab), tmp[2]); + } + sw.WriteLine ("\t}"); + sw.WriteLine ("}"); + Console.WriteLine ("max char: " + maxChar.ToString ()); + } + + } + } + } +} + diff --git a/Tests/packages.config b/Tests/packages.config deleted file mode 100644 index b3717663..00000000 --- a/Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="OpenTK" version="2.0.0" targetFramework="net45" /> -</packages>
\ No newline at end of file diff --git a/Tests/test.style b/Tests/test.style index 5539b3d0..14971b88 100644 --- a/Tests/test.style +++ b/Tests/test.style @@ -3,7 +3,7 @@ Font = "droid, 10"; Margin = "0"; TextAlignment = "Center"; - Background = "DimGray"; + Background = "DimGrey"; } FpsDisp { Font = "droid bold, 10"; @@ -13,13 +13,13 @@ FpsDisp { Background = "MediumSeaGreen"; } CheckBox2 { - Template= "#Tests.Interfaces.CheckBox2.imlt"; + Template= "Interfaces/CheckBox2.imlt"; Background = "Jet"; Checked="{Background=MediumSeaGreen}"; Unchecked = "{Background=Jet}"; } RadioButton2 { - Template="#Tests.Interfaces.CheckBox2.imlt"; + Template="Interfaces/CheckBox2.imlt"; Background = "Jet"; Checked = "{Background=MediumSeaGreen}"; Unchecked = "{Background=Jet}"; @@ -32,3 +32,12 @@ labPerfVal{ Font = "droid, 8"; Width = "50%"; } +DbgLogViewer{ + Background = "Onyx"; + Font = "mono, 8"; + Foreground = "LightGrey"; + Focusable = "true"; +} +DockWindow{ + Background = "0.1,0.1,0.1,0.5"; +}
\ No newline at end of file diff --git a/Tests/ui/LabelButton.style b/Tests/ui/LabelButton.style index 7182d868..4e61c38b 100644 --- a/Tests/ui/LabelButton.style +++ b/Tests/ui/LabelButton.style @@ -1,8 +1,8 @@ -MouseEnter = "{Background = Gray;Foreground = White;}"; +MouseEnter = "{Background = Grey;Foreground = White;}"; Fit = "true"; -MouseLeave = "{Background=Transparent;Foreground=Gray;}"; +MouseLeave = "{Background=Transparent;Foreground=Grey;}"; MouseDown = "{Background=Red;Foreground=White;}"; -MouseUp = "{Background=Gray;Foreground=White;}"; -Foreground="Gray"; +MouseUp = "{Background=Grey;Foreground=White;}"; +Foreground="Grey"; Margin="5"; CornerRadius="5"; diff --git a/Tests/ui/MenuItem.style b/Tests/ui/MenuItem.style index 969a4abc..2c0ada73 100644 --- a/Tests/ui/MenuItem.style +++ b/Tests/ui/MenuItem.style @@ -4,8 +4,8 @@ MinimumSize="60;10"; Margin="2"; CornerRadius="0"; TextAlignment="Left"; -Foreground="Gray"; -MouseEnter = "{Background=SeaGreen;Foreground=White;}"; -MouseLeave = "{Background=Transparent;Foreground=Gray;}"; -MouseDown = "{Background=White;Foreground=DimGray;}"; +Foreground="Grey"; +//MouseEnter = "{Background=SeaGreen;Foreground=White;}"; +//MouseLeave = "{Background=Transparent;Foreground=Grey;}"; +MouseDown = "{Background=White;Foreground=DimGrey;}"; MouseUp = "{Background=SeaGreen;Foreground=White;}"; diff --git a/Tests/ui/MenuItem.template b/Tests/ui/MenuItem.template new file mode 100644 index 00000000..e959b7d2 --- /dev/null +++ b/Tests/ui/MenuItem.template @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}" + Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click" + IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}" IsEnabled="{./IsEnabled}"> + <Template> + <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}"> + <Template> + <Border Name="border1" + MinimumSize = "40,0" + Foreground="Transparent" + Background="{./Background}"> + <HorizontalStack HorizontalAlignment="Left" Margin="1"> + <Image Width="10" Height="10" Picture="{../../../../../Icon}"/> + <Label Text="{./Caption}" + Foreground="{./Foreground}" + Font="{./Font}" /> + </HorizontalStack> + </Border> + </Template> + </CheckBox> + </Template> + <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="Jet"> + <VerticalStack Name="ItemsContainer"/> + </Border> +</Popper> diff --git a/Tests/ui/dbgLog.crow b/Tests/ui/dbgLog.crow new file mode 100755 index 00000000..cf7e2ae4 --- /dev/null +++ b/Tests/ui/dbgLog.crow @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<Window Width="Stretched" Height="Stretched"> + <VerticalStack> + <HorizontalStack Height="Fit"> + <Label Text="Scale X:"/> + <Label Text="{../../view.XScale}"/> + <Label Text="Scroll X:"/> + <Label Text="{../../view.ScrollX}"/> + <Label Text="Max Scroll X:"/> + <Label Text="{../../view.MaxScrollX}"/> + <Label Text="Scroll Y:"/> + <Label Text="{../../view.ScrollY}"/> + <Label Text="Visible Lines:"/> + <Label Text="{../../view.VisibleLines}"/> + <Label Text="Visible Ticks:"/> + <Label Text="{../../view.VisibleTicks}"/> + <Label Text="CurrentLine:"/> + <Label Text="{../../view.CurrentLine}"/> + </HorizontalStack> + <HorizontalStack> + <DbgLogViewer Margin="0" Name="view" LogFile="debug.log" MouseWheelSpeed="10"/> + <ScrollBar Name="scrollbar1" Orientation="Vertical" + Value="{²../view.ScrollY}" Maximum="{../view.MaxScrollY}" + CursorSize="{../view.ChildHeightRatio}" + LargeIncrement="{../view.PageHeight}" SmallIncrement="30" + Width="12" /> + </HorizontalStack> + <ScrollBar Style="HScrollBar" Name="scrollbarX" Orientation="Horizontal" + Value="{²../view.ScrollX}" Maximum="{../view.MaxScrollX}" + CursorSize="{../view.ChildWidthRatio}" + LargeIncrement="{../view.PageWidth}" SmallIncrement="30" + Height="12" /> + </VerticalStack> +</Window>
\ No newline at end of file diff --git a/Tests/ui/dbgLogColors.crow b/Tests/ui/dbgLogColors.crow new file mode 100755 index 00000000..cc9fdb24 --- /dev/null +++ b/Tests/ui/dbgLogColors.crow @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<Window Template="#Crow.ToolWindow.template" AlwaysOnTop="true" Width="400" Height="300" + HorizontalAlignment="Right" VerticalAlignment="Bottom"> + <VerticalStack> + <Button Caption="update" MouseClick="onColorUpdate"/> + <HorizontalStack Height="Fit" DataSource="{../kvpList.SelectedItem}" Margin="10"> + <Label Text="{Key}" Margin="0" Width="Stretched" Font="mono, 8"/> + <ComboBox Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem2.crow" Name="combo" + SelectedItem="{Value}"> + <Template> + <Popper Caption="{./SelectedItem}" Name="popper" PopDirection="Bottom" Foreground="{./Foreground}" Background="{./Background}"> + <Template> + <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}"> + <Template> + <Border CornerRadius="0" Foreground="LightGrey"> + <HorizontalStack Margin="0" Spacing="1"> + <!---<GraphicObject Height="8" Width="14" Background="{./Caption}" Margin="0" CornerRadius="2"/>--> + <Label MinimumSize="80,10" Text="{./Caption}" Margin="0" Width="Stretched" Font="mono, 8"/> + <Button Width="14" Height="14" Focusable="false" + Template="#Crow.Templates.ArrowBut.template"> + <Image Margin="0" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/> + </Button> + </HorizontalStack> + </Border> + </Template> + </CheckBox> + </Template> + <Border Background="DimGrey" BorderWidth="1" Margin="1" + MinimumSize="{../../MinimumPopupSize}" Fit="true"> + <Scroller Name="scroller1" Margin="2" + MaximumSize="0,200" + HorizontalAlignment="Left"> + <VerticalStack + Height="Fit" Name="ItemsContainer" Margin="0" + HorizontalAlignment="Left" + VerticalAlignment="Top"/> + </Scroller> + </Border> + </Popper> + </Template> + </ComboBox> + <GraphicObject Height="8" Width="14" Background="{Value}" Margin="0" CornerRadius="2"/> + </HorizontalStack> + <HorizontalStack> + <ListBox Name="kvpList" Data="{ColorsKVPList}" Margin="0" + Template="#Crow.Templates.ScrollingListBox.template"> + <ItemTemplate> + <Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit"> + <HorizontalStack Margin="0" + MouseEnter="{Background=CornflowerBlue}" + MouseLeave="{Background=Transparent}"> + <GraphicObject Height="8" Width="14" Background="{Value}" Margin="0" CornerRadius="2"/> + <Label Text="{Key}" Margin="0" Width="Stretched" Font="mono, 8"/> + </HorizontalStack> + </Border> + </ItemTemplate> + </ListBox> + </HorizontalStack> + </VerticalStack> +</Window>
\ No newline at end of file diff --git a/Tests/ui/showcase.crow b/Tests/ui/showcase.crow index 956e236d..f14e965c 100755 --- a/Tests/ui/showcase.crow +++ b/Tests/ui/showcase.crow @@ -3,7 +3,7 @@ <DirectoryView Name="dv" CurrentDirectory="Interfaces" Width="25%" SelectedItemChanged="Dv_SelectedItemChanged"/> <Splitter Width="6"/> <VerticalStack> - <Container Name="CrowContainer" Height="60%" Background="DimGray"/> + <Container Name="CrowContainer" Height="60%" Background="DimGrey"/> <Splitter/> <HorizontalStack> <Scroller Name="scroller1" Background="White" diff --git a/Tests/ui/test.crow b/Tests/ui/test.crow index 64ba349e..663fd934 100755 --- a/Tests/ui/test.crow +++ b/Tests/ui/test.crow @@ -1,9 +1,9 @@ <?xml version="1.0"?> <Window Font="droid bold, 10" Caption="Open GL" HorizontalAlignment="Left" Width="30%" Height="90%"> <VerticalStack> - <HorizontalStack Background="DimGray" Height="Fit" Width="Stretched" Margin="2"> + <HorizontalStack Background="DimGrey" Height="Fit" Width="Stretched" Margin="2"> <Popper Caption="File" Template="#Tests.ui.Popper.template" Width="Fit"> - <Border Fit="True" Foreground="Gray" Background="DimGray"> + <Border Fit="True" Foreground="Grey" Background="DimGrey"> <VerticalStack Height="Fit" Width="Fit" Margin="2"> <Label Text="New File" Style="#Tests.ui.MenuItem.style" /> <Label Text="Open..." Style="#Tests.ui.MenuItem.style"/> diff --git a/Tests/ui/test.style b/Tests/ui/test.style index fe85d912..932fb6b7 100644 --- a/Tests/ui/test.style +++ b/Tests/ui/test.style @@ -1,3 +1,3 @@ BlueLabel { - Background = Blue; + Background = "Blue"; } diff --git a/libs/OpenTK.dll b/libs/OpenTK.dll Binary files differdeleted file mode 100644 index 370a45e3..00000000 --- a/libs/OpenTK.dll +++ /dev/null diff --git a/libs/OpenTK.dll.config b/libs/OpenTK.dll.config deleted file mode 100644 index 7098d39e..00000000 --- a/libs/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ -<configuration> - <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/> - <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/> - <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/> - <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/> - <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/> - <dllmap os="linux" dll="libX11" target="libX11.so.6"/> - <dllmap os="linux" dll="libXi" target="libXi.so.6"/> - <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/> - <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/> - <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" /> - <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" /> - <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" /> - <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" /> - <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" /> - <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/> - <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/> - <!-- XQuartz compatibility (X11 on Mac) --> - <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/> - <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/> - <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/> - <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/> - <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/> - <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/> -</configuration> diff --git a/src/IML/Reader.cs b/src/IML/Reader.cs deleted file mode 100644 index 7a0c8405..00000000 --- a/src/IML/Reader.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -// IMLReader.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2016 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -using System; -using System.Xml; -using System.IO; -using System.Reflection; -using System.Reflection.Emit; -using System.Linq; -using System.Collections.Generic; - -namespace Crow.IML2 -{ - public class Reader : XmlTextReader - { - static List<Type> CrowTypes = new List<Type> (); - - public enum SubNodeType{ - None, - Child, - Children, - Template, - Content, - Items, - ItemTemplate - } - - //public static Node Parse(string str){ - // string[] tmp = str.Trim ().Split ('.'); - // switch (tmp.Length) { - // case 1: - // return new Node ((SubNodeType)int.Parse (tmp [0])); - // case 2: - // return new Node ((SubNodeType)int.Parse (tmp [0]), int.Parse (tmp[1])); - // case 0: - // default: - // return new Node (); - // } - //} - //public static string AddressToString(Node[] address){ - // string tmp = ""; - // foreach (Node n in address) { - // tmp += n.ToString () + ";"; - // } - // return string.IsNullOrEmpty(tmp) ? tmp : tmp.Substring (0, tmp.Length - 1); - //} - //public static Node[] AddressFromString(string address) { - // List<Node> nodes = new List<Node> (); - // string[] tmp = address.Split (';'); - // for (int i = 0; i < tmp.Length; i++) - // nodes.Add (Node.Parse (tmp [i])); - // return nodes.ToArray(); - //} - - - // public class PropertyBinding { - // public string OriginePropertyName = ""; - // public MemberAddress Destination; - // } - - public Type RootType = null; - public Context context; - - InstanciatorInvoker loader = null; - DynamicMethod dm = null; - - ILGenerator il { get { return context.il; }} - - /// <summary> - /// Finalize instatiator MSIL and return LoaderInvoker delegate - /// </summary> - public InstanciatorInvoker GetLoader(){ - if (loader != null) - return loader; - - il.Emit(OpCodes.Ret); - loader = (InstanciatorInvoker)dm.CreateDelegate (typeof(InstanciatorInvoker)); - return loader; - } - - protected int curDepth { - get { return context.nodesStack.Count - 1;} - } - protected Node curNode { - get { return context.nodesStack.Peek(); } - } - //protected Stack<int> curTemplateDepth = new Stack<int>(new int[] {0}); //current template root depth - - #region CTOR - public Reader (string path) - : this(Interface.GetStreamFromPath (path)){ - } - public Reader (Stream stream) - : base(stream) - { - createInstantiator (); - } - /// <summary> - /// Used to parse xmlFrament with same code generator linked - /// If ilGen=null, a new Code Generator will be created. - /// </summary> - public Reader (Context ctx, string xmlFragment) - : base(xmlFragment, XmlNodeType.Element,null){ - - context = ctx; -// -// if (IMLCtx != null) -// return; -// -// createInstantiator(); - } - #endregion - - - void createBindingDelegates(){ -// foreach (Dictionary<string, MemberAddress> pb in IMLCtx.PropertyBindings) { -// -// } - } - - - void registerPropertyBinding(string origNode, string origProp, MemberAddress ma){ - if (!context.PropertyBindings.ContainsKey(origNode)) - context.PropertyBindings [origNode] = new Dictionary<string, MemberAddress> (); - context.PropertyBindings [origNode] [origProp] = ma; - } - void readPropertyBinding(string srcProperty, string expression){ - //if binding exp = '{}' => binding is done on datasource - if (string.IsNullOrEmpty (expression)) { - registerPropertyBinding ("DS", "", new MemberAddress (context.nodesStack.ToArray (), srcProperty)); - return; - } - -// if (expression.StartsWith ("²")) { -// expression = expression.Substring (1); -// TwoWayBinding = true; -// } -// - string [] bindingExp = expression.Split ('/'); - - - if (bindingExp.Length == 1) { - registerPropertyBinding ("DS", bindingExp [0], - new MemberAddress (context.nodesStack.ToArray (), srcProperty)); - return; - } - - string targetName = ""; - string nodeId = ""; - Node[] target = context.nodesStack.ToArray (); - - int nodeIdx = target.Length - 1;//index of target in nodeStack - int ptr = 0;//pointer in bindingExp splitted on '/' - -// //if exp start with '/' => WidgetName.property - if (string.IsNullOrEmpty (bindingExp [0])) { - string[] bindTrg = bindingExp [1].Split ('.'); - if (bindTrg.Length == 1) { - nodeId = Node.AddressToString (target); - targetName = bindTrg [0]; - }else if (bindTrg.Length == 2) { - nodeId = context.Names [bindTrg [0]]; - targetName = bindTrg [1]; - } else - throw new Exception ("Syntax error in binding, expected 'go dot member'"); - } else { - if (bindingExp [0] == ".") { //template binding - //parse nodes up until template node - while (nodeIdx > 0) { - if (target [nodeIdx].Type == SubNodeType.Template) - break; - nodeIdx--; - } - ptr++; - } else { - while (ptr < bindingExp.Length - 1) { - if (bindingExp [ptr] == "..") - nodeIdx--; - else - break; - ptr++; - } - } - Node[] origine = new Node[nodeIdx + 1]; - try { - Array.Copy (target, origine, nodeIdx + 1); - - int destLength = target.Length - nodeIdx; - Node[] dest = new Node[destLength]; - Array.Copy (target, nodeIdx, dest, 0, destLength); - - } catch (Exception ex) { - System.Diagnostics.Debug.WriteLine (ex.ToString ()); - } - - - nodeId = Node.AddressToString (origine); - targetName = bindingExp [ptr]; - } - - registerPropertyBinding (nodeId, targetName, new MemberAddress (context.nodesStack.ToArray (), srcProperty)); - } - - } -} - diff --git a/src/Input/Key.cs b/src/Input/Key.cs deleted file mode 100644 index 71f9d85a..00000000 --- a/src/Input/Key.cs +++ /dev/null @@ -1,380 +0,0 @@ - #region License - // - // The Open Toolkit Library License - // - // Copyright (c) 2006 - 2009 the Open Toolkit library. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights to - // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - // the Software, and to permit persons to whom the Software is furnished to do - // so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in all - // copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - // OTHER DEALINGS IN THE SOFTWARE. - // - #endregion - -namespace Crow -{ - /// <summary> - /// The available keyboard keys. - /// </summary> - public enum Key : int - { - /// <summary>A key outside the known keys.</summary> - Unknown = 0, - - // Modifiers - /// <summary>The left shift key.</summary> - ShiftLeft, - /// <summary>The left shift key (equivalent to ShiftLeft).</summary> - LShift = ShiftLeft, - /// <summary>The right shift key.</summary> - ShiftRight, - /// <summary>The right shift key (equivalent to ShiftRight).</summary> - RShift = ShiftRight, - /// <summary>The left control key.</summary> - ControlLeft, - /// <summary>The left control key (equivalent to ControlLeft).</summary> - LControl = ControlLeft, - /// <summary>The right control key.</summary> - ControlRight, - /// <summary>The right control key (equivalent to ControlRight).</summary> - RControl = ControlRight, - /// <summary>The left alt key.</summary> - AltLeft, - /// <summary>The left alt key (equivalent to AltLeft.</summary> - LAlt = AltLeft, - /// <summary>The right alt key.</summary> - AltRight, - /// <summary>The right alt key (equivalent to AltRight).</summary> - RAlt = AltRight, - /// <summary>The left win key.</summary> - WinLeft, - /// <summary>The left win key (equivalent to WinLeft).</summary> - LWin = WinLeft, - /// <summary>The right win key.</summary> - WinRight, - /// <summary>The right win key (equivalent to WinRight).</summary> - RWin = WinRight, - /// <summary>The menu key.</summary> - Menu, - - // Function keys (hopefully enough for most keyboards - mine has 26) - // <keysymdef.h> on X11 reports up to 35 function keys. - /// <summary>The F1 key.</summary> - F1, - /// <summary>The F2 key.</summary> - F2, - /// <summary>The F3 key.</summary> - F3, - /// <summary>The F4 key.</summary> - F4, - /// <summary>The F5 key.</summary> - F5, - /// <summary>The F6 key.</summary> - F6, - /// <summary>The F7 key.</summary> - F7, - /// <summary>The F8 key.</summary> - F8, - /// <summary>The F9 key.</summary> - F9, - /// <summary>The F10 key.</summary> - F10, - /// <summary>The F11 key.</summary> - F11, - /// <summary>The F12 key.</summary> - F12, - /// <summary>The F13 key.</summary> - F13, - /// <summary>The F14 key.</summary> - F14, - /// <summary>The F15 key.</summary> - F15, - /// <summary>The F16 key.</summary> - F16, - /// <summary>The F17 key.</summary> - F17, - /// <summary>The F18 key.</summary> - F18, - /// <summary>The F19 key.</summary> - F19, - /// <summary>The F20 key.</summary> - F20, - /// <summary>The F21 key.</summary> - F21, - /// <summary>The F22 key.</summary> - F22, - /// <summary>The F23 key.</summary> - F23, - /// <summary>The F24 key.</summary> - F24, - /// <summary>The F25 key.</summary> - F25, - /// <summary>The F26 key.</summary> - F26, - /// <summary>The F27 key.</summary> - F27, - /// <summary>The F28 key.</summary> - F28, - /// <summary>The F29 key.</summary> - F29, - /// <summary>The F30 key.</summary> - F30, - /// <summary>The F31 key.</summary> - F31, - /// <summary>The F32 key.</summary> - F32, - /// <summary>The F33 key.</summary> - F33, - /// <summary>The F34 key.</summary> - F34, - /// <summary>The F35 key.</summary> - F35, - - // Direction arrows - /// <summary>The up arrow key.</summary> - Up, - /// <summary>The down arrow key.</summary> - Down, - /// <summary>The left arrow key.</summary> - Left, - /// <summary>The right arrow key.</summary> - Right, - - /// <summary>The enter key.</summary> - Enter, - /// <summary>The escape key.</summary> - Escape, - /// <summary>The space key.</summary> - Space, - /// <summary>The tab key.</summary> - Tab, - /// <summary>The backspace key.</summary> - BackSpace, - /// <summary>The backspace key (equivalent to BackSpace).</summary> - Back = BackSpace, - /// <summary>The insert key.</summary> - Insert, - /// <summary>The delete key.</summary> - Delete, - /// <summary>The page up key.</summary> - PageUp, - /// <summary>The page down key.</summary> - PageDown, - /// <summary>The home key.</summary> - Home, - /// <summary>The end key.</summary> - End, - /// <summary>The caps lock key.</summary> - CapsLock, - /// <summary>The scroll lock key.</summary> - ScrollLock, - /// <summary>The print screen key.</summary> - PrintScreen, - /// <summary>The pause key.</summary> - Pause, - /// <summary>The num lock key.</summary> - NumLock, - - // Special keys - /// <summary>The clear key (Keypad5 with NumLock disabled, on typical keyboards).</summary> - Clear, - /// <summary>The sleep key.</summary> - Sleep, - /*LogOff, - Help, - Undo, - Redo, - New, - Open, - Close, - Reply, - Forward, - Send, - Spell, - Save, - Calculator, - - // Folders and applications - Documents, - Pictures, - Music, - MediaPlayer, - Mail, - Browser, - Messenger, - - // Multimedia keys - Mute, - PlayPause, - Stop, - VolumeUp, - VolumeDown, - TrackPrevious, - TrackNext,*/ - - // Keypad keys - /// <summary>The keypad 0 key.</summary> - Keypad0, - /// <summary>The keypad 1 key.</summary> - Keypad1, - /// <summary>The keypad 2 key.</summary> - Keypad2, - /// <summary>The keypad 3 key.</summary> - Keypad3, - /// <summary>The keypad 4 key.</summary> - Keypad4, - /// <summary>The keypad 5 key.</summary> - Keypad5, - /// <summary>The keypad 6 key.</summary> - Keypad6, - /// <summary>The keypad 7 key.</summary> - Keypad7, - /// <summary>The keypad 8 key.</summary> - Keypad8, - /// <summary>The keypad 9 key.</summary> - Keypad9, - /// <summary>The keypad divide key.</summary> - KeypadDivide, - /// <summary>The keypad multiply key.</summary> - KeypadMultiply, - /// <summary>The keypad subtract key.</summary> - KeypadSubtract, - /// <summary>The keypad minus key (equivalent to KeypadSubtract).</summary> - KeypadMinus = KeypadSubtract, - /// <summary>The keypad add key.</summary> - KeypadAdd, - /// <summary>The keypad plus key (equivalent to KeypadAdd).</summary> - KeypadPlus = KeypadAdd, - /// <summary>The keypad decimal key.</summary> - KeypadDecimal, - /// <summary>The keypad period key (equivalent to KeypadDecimal).</summary> - KeypadPeriod = KeypadDecimal, - /// <summary>The keypad enter key.</summary> - KeypadEnter, - - // Letters - /// <summary>The A key.</summary> - A, - /// <summary>The B key.</summary> - B, - /// <summary>The C key.</summary> - C, - /// <summary>The D key.</summary> - D, - /// <summary>The E key.</summary> - E, - /// <summary>The F key.</summary> - F, - /// <summary>The G key.</summary> - G, - /// <summary>The H key.</summary> - H, - /// <summary>The I key.</summary> - I, - /// <summary>The J key.</summary> - J, - /// <summary>The K key.</summary> - K, - /// <summary>The L key.</summary> - L, - /// <summary>The M key.</summary> - M, - /// <summary>The N key.</summary> - N, - /// <summary>The O key.</summary> - O, - /// <summary>The P key.</summary> - P, - /// <summary>The Q key.</summary> - Q, - /// <summary>The R key.</summary> - R, - /// <summary>The S key.</summary> - S, - /// <summary>The T key.</summary> - T, - /// <summary>The U key.</summary> - U, - /// <summary>The V key.</summary> - V, - /// <summary>The W key.</summary> - W, - /// <summary>The X key.</summary> - X, - /// <summary>The Y key.</summary> - Y, - /// <summary>The Z key.</summary> - Z, - - // Numbers - /// <summary>The number 0 key.</summary> - Number0, - /// <summary>The number 1 key.</summary> - Number1, - /// <summary>The number 2 key.</summary> - Number2, - /// <summary>The number 3 key.</summary> - Number3, - /// <summary>The number 4 key.</summary> - Number4, - /// <summary>The number 5 key.</summary> - Number5, - /// <summary>The number 6 key.</summary> - Number6, - /// <summary>The number 7 key.</summary> - Number7, - /// <summary>The number 8 key.</summary> - Number8, - /// <summary>The number 9 key.</summary> - Number9, - - // Symbols - /// <summary>The tilde key.</summary> - Tilde, - /// <summary>The grave key (equivaent to Tilde).</summary> - Grave = Tilde, - /// <summary>The minus key.</summary> - Minus, - //Equal, - /// <summary>The plus key.</summary> - Plus, - /// <summary>The left bracket key.</summary> - BracketLeft, - /// <summary>The left bracket key (equivalent to BracketLeft).</summary> - LBracket = BracketLeft, - /// <summary>The right bracket key.</summary> - BracketRight, - /// <summary>The right bracket key (equivalent to BracketRight).</summary> - RBracket = BracketRight, - /// <summary>The semicolon key.</summary> - Semicolon, - /// <summary>The quote key.</summary> - Quote, - /// <summary>The comma key.</summary> - Comma, - /// <summary>The period key.</summary> - Period, - /// <summary>The slash key.</summary> - Slash, - /// <summary>The backslash key.</summary> - BackSlash, - /// <summary>The secondary backslash key.</summary> - NonUSBackSlash, - /// <summary>Indicates the last available keyboard key.</summary> - LastKey - } -}
\ No newline at end of file diff --git a/src/Input/KeyModifiers.cs b/src/Input/KeyModifiers.cs deleted file mode 100644 index 885365ca..00000000 --- a/src/Input/KeyModifiers.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region License -// -// HatPosition.cs -// -// Author: -// Stefanos A. <stapostol@gmail.com> -// -// Copyright (c) 2006-2014 Stefanos Apostolopoulos -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace Crow -{ - /// <summary> - /// Enumerates modifier keys. - /// </summary> - [Flags] - public enum KeyModifiers : byte - { - None = 0, - /// <summary> - /// The alt key modifier (option on Mac). - /// </summary> - Alt = 1 << 0, - - /// <summary> - /// The control key modifier. - /// </summary> - Control = 1 << 1, - - /// <summary> - /// The shift key modifier. - /// </summary> - Shift = 1 << 2, - - /// <summary> - /// The shift key modifier. - /// </summary> - AltGr = 1 << 3 - } -} diff --git a/src/Input/KeyboardKeyEventArgs.cs b/src/Input/KeyboardKeyEventArgs.cs deleted file mode 100644 index f9307ffc..00000000 --- a/src/Input/KeyboardKeyEventArgs.cs +++ /dev/null @@ -1,167 +0,0 @@ -#region License -// -// The Open Toolkit Library License -// -// Copyright (c) 2006 - 2009 the Open Toolkit library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace Crow -{ - /// <summary> - /// Defines the event data for <see cref="KeyboardDevice"/> events. - /// </summary> - /// <remarks> - /// <para> - /// Do not cache instances of this type outside their event handler. - /// If necessary, you can clone a KeyboardEventArgs instance using the - /// <see cref="KeyboardKeyEventArgs(KeyboardKeyEventArgs)"/> constructor. - /// </para> - /// </remarks> - public class KeyboardKeyEventArgs : EventArgs - { - #region Fields - - Key key; - bool repeat; - KeyboardState state; - - #endregion - - #region Constructors - - /// <summary> - /// Constructs a new KeyboardEventArgs instance. - /// </summary> - public KeyboardKeyEventArgs(Key _key, bool _repeat, KeyboardState _state) - { - key = _key; - repeat = _repeat; - state = _state; - } - - /// <summary> - /// Constructs a new KeyboardEventArgs instance. - /// </summary> - /// <param name="args">An existing KeyboardEventArgs instance to clone.</param> - public KeyboardKeyEventArgs(KeyboardKeyEventArgs args) - { - Key = args.Key; - } - - #endregion - - #region Public Members - - /// <summary> - /// Gets the <see cref="Key"/> that generated this event. - /// </summary> - public Key Key - { - get { return key; } - internal set { key = value; } - } - - /// <summary> - /// Gets the scancode which generated this event. - /// </summary> - public uint ScanCode - { - get { return (uint)Key; } - } - - /// <summary> - /// Gets a value indicating whether <see cref="OpenTK.Input.KeyModifiers.Alt"/> is pressed. - /// </summary> - /// <value><c>true</c> if pressed; otherwise, <c>false</c>.</value> - public bool Alt - { - get { return state[Key.AltLeft] || state[Key.AltRight]; } - } - - /// <summary> - /// Gets a value indicating whether <see cref="OpenTK.Input.KeyModifiers.Control"/> is pressed. - /// </summary> - /// <value><c>true</c> if pressed; otherwise, <c>false</c>.</value> - public bool Control - { - get { return state[Key.ControlLeft] || state[Key.ControlRight]; } - } - - /// <summary> - /// Gets a value indicating whether <see cref="OpenTK.Input.KeyModifiers.Shift"/> is pressed. - /// </summary> - /// <value><c>true</c> if pressed; otherwise, <c>false</c>.</value> - public bool Shift - { - get { return state[Key.ShiftLeft] || state[Key.ShiftRight]; } - } - - /// <summary> - /// Gets a bitwise combination representing the <see cref="OpenTK.Input.KeyModifiers"/> - /// that are currently pressed. - /// </summary> - /// <value>The modifiers.</value> - public KeyModifiers Modifiers - { - get - { - KeyModifiers mods = 0; - mods |= Alt ? KeyModifiers.Alt : 0; - mods |= Control ? KeyModifiers.Control : 0; - mods |= Shift ? KeyModifiers.Shift : 0; - return mods; - } - } - - /// <summary> - /// Gets the current <see cref="OpenTK.Input.KeyboardState"/>. - /// </summary> - /// <value>The keyboard.</value> - public KeyboardState Keyboard - { - get { return state; } - internal set { state = value; } - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether - /// this key event is a repeat. - /// </summary> - /// <value> - /// true, if this event was caused by the user holding down - /// a key; false, if this was caused by the user pressing a - /// key for the first time. - /// </value> - public bool IsRepeat - { - get { return repeat; } - internal set { repeat = value; } - } - - #endregion - } -} diff --git a/src/Input/KeyboardState.cs b/src/Input/KeyboardState.cs deleted file mode 100644 index e3784bc3..00000000 --- a/src/Input/KeyboardState.cs +++ /dev/null @@ -1,316 +0,0 @@ - #region License - // - // The Open Toolkit Library License - // - // Copyright (c) 2006 - 2009 the Open Toolkit library. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights to - // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - // the Software, and to permit persons to whom the Software is furnished to do - // so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in all - // copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - // OTHER DEALINGS IN THE SOFTWARE. - // - #endregion - -using System; -using System.Collections.Specialized; -using System.Text; - -namespace Crow -{ - /// <summary> - /// Encapsulates the state of a Keyboard device. - /// </summary> - public struct KeyboardState : IEquatable<KeyboardState> - { - #region Fields - - // Allocate enough ints to store all keyboard keys - const int IntSize = sizeof(int); - const int NumInts = ((int)Key.LastKey + IntSize - 1) / IntSize; - // The following line triggers bogus CS0214 in gmcs 2.0.1, sigh... - unsafe fixed int Keys[NumInts]; - bool is_connected; - - #endregion - - #region Public Members - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether the specified - /// <see cref="OpenTK.Input.Key"/> is pressed. - /// </summary> - /// <param name="key">The <see cref="OpenTK.Input.Key"/> to check.</param> - /// <returns>True if key is pressed; false otherwise.</returns> - public bool this[Key key] - { - get { return IsKeyDown(key); } - internal set { SetKeyState(key, value); } - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether the specified - /// <see cref="OpenTK.Input.Key"/> is pressed. - /// </summary> - /// <param name="code">The scancode to check.</param> - /// <returns>True if code is pressed; false otherwise.</returns> - public bool this[short code] - { - get { return IsKeyDown((Key)code); } - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether this key is down. - /// </summary> - /// <param name="key">The <see cref="OpenTK.Input.Key"/> to check.</param> - public bool IsKeyDown(Key key) - { - return ReadBit((int)key); - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether this scan code is down. - /// </summary> - /// <param name="code">The scan code to check.</param> - public bool IsKeyDown(short code) - { - return code >= 0 && code < (short)Key.LastKey && ReadBit(code); - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether this key is up. - /// </summary> - /// <param name="key">The <see cref="OpenTK.Input.Key"/> to check.</param> - public bool IsKeyUp(Key key) - { - return !ReadBit((int)key); - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether this scan code is down. - /// </summary> - /// <param name="code">The scan code to check.</param> - public bool IsKeyUp(short code) - { - return !IsKeyDown(code); - } - - /// <summary> - /// Gets a <see cref="System.Boolean"/> indicating whether this keyboard - /// is connected. - /// </summary> - public bool IsConnected - { - get { return is_connected; } - internal set { is_connected = value; } - } - -#if false - // Disabled until the correct cross-platform API can be determined. - public bool IsLedOn(KeyboardLeds led) - { - return false; - } - - public bool IsLedOff(KeyboardLeds led) - { - return false; - } -#endif - - /// <summary> - /// Checks whether two <see cref="KeyboardState" /> instances are equal. - /// </summary> - /// <param name="left"> - /// A <see cref="KeyboardState"/> instance. - /// </param> - /// <param name="right"> - /// A <see cref="KeyboardState"/> instance. - /// </param> - /// <returns> - /// True if both left is equal to right; false otherwise. - /// </returns> - public static bool operator ==(KeyboardState left, KeyboardState right) - { - return left.Equals(right); - } - - /// <summary> - /// Checks whether two <see cref="KeyboardState" /> instances are not equal. - /// </summary> - /// <param name="left"> - /// A <see cref="KeyboardState"/> instance. - /// </param> - /// <param name="right"> - /// A <see cref="KeyboardState"/> instance. - /// </param> - /// <returns> - /// True if both left is not equal to right; false otherwise. - /// </returns> - public static bool operator !=(KeyboardState left, KeyboardState right) - { - return !left.Equals(right); - } - - /// <summary> - /// Compares to an object instance for equality. - /// </summary> - /// <param name="obj"> - /// The <see cref="System.Object"/> to compare to. - /// </param> - /// <returns> - /// True if this instance is equal to obj; false otherwise. - /// </returns> - public override bool Equals(object obj) - { - if (obj is KeyboardState) - { - return this == (KeyboardState)obj; - } - else - { - return false; - } - } - - /// <summary> - /// Generates a hashcode for the current instance. - /// </summary> - /// <returns> - /// A <see cref="System.Int32"/> represting the hashcode for this instance. - /// </returns> - public override int GetHashCode() - { - unsafe - { - fixed (int* k = Keys) - { - int hashcode = 0; - for (int i = 0; i < NumInts; i++) - hashcode ^= (k + i)->GetHashCode(); - return hashcode; - } - } - } - - #endregion - - #region Internal Members - - public void SetKeyState(Key key, bool down) - { - if (down) - { - EnableBit((int)key); - } - else - { - DisableBit((int)key); - } - } - - internal bool ReadBit(int offset) - { - ValidateOffset(offset); - - int int_offset = offset / 32; - int bit_offset = offset % 32; - unsafe - { - fixed (int* k = Keys) { return (*(k + int_offset) & (1 << bit_offset)) != 0u; } - } - } - - internal void EnableBit(int offset) - { - //ValidateOffset(offset); - - int int_offset = offset / 32; - int bit_offset = offset % 32; - unsafe - { - fixed (int* k = Keys) { *(k + int_offset) |= 1 << bit_offset; } - } - } - - internal void DisableBit(int offset) - { - ValidateOffset(offset); - - int int_offset = offset / 32; - int bit_offset = offset % 32; - unsafe - { - fixed (int* k = Keys) { *(k + int_offset) &= ~(1 << bit_offset); } - } - } - - internal void MergeBits(KeyboardState other) - { - unsafe - { - int* k2 = other.Keys; - fixed (int* k1 = Keys) - { - for (int i = 0; i < NumInts; i++) - *(k1 + i) |= *(k2 + i); - } - } - IsConnected |= other.IsConnected; - } - - internal void SetIsConnected(bool value) - { - IsConnected = value; - } - - #endregion - - #region Private Members - - static void ValidateOffset(int offset) - { - if (offset < 0 || offset >= NumInts * IntSize) - throw new ArgumentOutOfRangeException(); - } - - #endregion - - #region IEquatable<KeyboardState> Members - - /// <summary> - /// Compares two KeyboardState instances. - /// </summary> - /// <param name="other">The instance to compare two.</param> - /// <returns>True, if both instances are equal; false otherwise.</returns> - public bool Equals(KeyboardState other) - { - bool equal = true; - unsafe - { - int* k2 = other.Keys; - fixed (int* k1 = Keys) - { - for (int i = 0; equal && i < NumInts; i++) - equal &= *(k1 + i) == *(k2 + i); - } - } - return equal; - } - - #endregion - } -} diff --git a/src/LayoutingQueue.cs b/src/LayoutingQueue.cs deleted file mode 100644 index 5f822bf7..00000000 --- a/src/LayoutingQueue.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// LayoutingQueue.cs -// -// Author: -// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> -// -// Copyright (c) 2015 jp -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Diagnostics; - -namespace Crow -{ - public class LayoutingQueue : LinkedList<LayoutingQueueItem> - { - public LayoutingQueue () - { - } - public void Enqueue(LayoutingType _lt, ILayoutable _object) - { - _object.RegisteredLQINodes.Add(this.AddLast (new LayoutingQueueItem (_lt, _object))); - } - LinkedListNode<LayoutingQueueItem> searchLqi(ILayoutable go, LayoutingType lt){ - for (int i = 0; i < go.RegisteredLQINodes.Count; i++) { - if (go.RegisteredLQINodes [i].Value.LayoutType == lt) - return go.RegisteredLQINodes [i]; - } - return null; - } - public void EnqueueAfterParentSizing (LayoutingType _lt, ILayoutable _object) - { - LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object); - LinkedListNode<LayoutingQueueItem> parentLqi = searchLqi (_object.Parent, _lt); - - if (parentLqi == null) - _object.RegisteredLQINodes.Add(this.AddLast (lqi)); - else - _object.RegisteredLQINodes.Add(this.AddAfter (parentLqi, lqi)); - } - public void EnqueueBeforeParentSizing (LayoutingType _lt, ILayoutable _object) - { - LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object); - LinkedListNode<LayoutingQueueItem> parentLqi = searchLqi (_object.Parent, _lt); - - if (parentLqi == null) - _object.RegisteredLQINodes.Add(this.AddLast (lqi)); - else - _object.RegisteredLQINodes.Add(this.AddBefore (parentLqi, lqi)); - } - public void EnqueueAfterThisAndParentSizing (LayoutingType _lt, ILayoutable _object) - { - LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object); - LayoutingType sizing = LayoutingType.Width; - - if (_lt == LayoutingType.Y) - sizing = LayoutingType.Height; - - LinkedListNode<LayoutingQueueItem> parentLqi = searchLqi (_object.Parent, sizing); - LinkedListNode<LayoutingQueueItem> thisLqi = searchLqi (_object, sizing); - - if (parentLqi == null) { - if (thisLqi != null) - _object.RegisteredLQINodes.Add(this.AddAfter (thisLqi, lqi)); - else - _object.RegisteredLQINodes.Add(this.AddLast (lqi)); - } else { - if (thisLqi == null) - _object.RegisteredLQINodes.Add(this.AddAfter (parentLqi, lqi)); - else { - switch (sizing) { - case LayoutingType.Width: - if (_object.Parent.getBounds().Width<0) - _object.RegisteredLQINodes.Add(this.AddAfter (parentLqi, lqi)); - else - _object.RegisteredLQINodes.Add(this.AddAfter (thisLqi, lqi)); - break; - case LayoutingType.Height: - if (_object.Parent.getBounds().Height<0) - _object.RegisteredLQINodes.Add(this.AddAfter (parentLqi, lqi)); - else - _object.RegisteredLQINodes.Add(this.AddAfter (thisLqi, lqi)); - break; - } - } - } - } - public LayoutingQueueItem Dequeue() - { - LayoutingQueueItem tmp = this.First.Value; - tmp.GraphicObject.RegisteredLQINodes.Remove(this.First); - this.RemoveFirst (); - return tmp; - } - } -} - diff --git a/src/Mono.Cairo/Color.cs b/src/Mono.Cairo/Color.cs deleted file mode 100644 index 030089e8..00000000 --- a/src/Mono.Cairo/Color.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// Mono.Cairo.Context.cs -// -// Author: -// Duncan Mak (duncan@ximian.com) -// Miguel de Icaza (miguel@novell.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian Inc, 2003. -// (C) Novell Inc, 2003. -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Cairo { - - public struct Color - { - public Color(double r, double g, double b) : this (r, g, b, 1.0) - { - } - - public Color(double r, double g, double b, double a) - { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - - double r, g, b, a; - - public double R { - get { return r; } - set { r = value; } - } - - public double G { - get { return g; } - set { g = value; } - } - - public double B { - get { return b; } - set { b = value; } - } - - public double A { - get { return a; } - set { a = value; } - } - } -} diff --git a/src/Mono.Cairo/Rectangle.cs b/src/Mono.Cairo/Rectangle.cs deleted file mode 100644 index 6766aa45..00000000 --- a/src/Mono.Cairo/Rectangle.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// Mono.Cairo.Rectangle.cs -// -// Author: -// John Luke (john.luke@gmail.com) -// -// (C) John Luke 2005. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Cairo -{ -// public struct Rectangle -// { -// double x; -// double y; -// double width; -// double height; -// -// public Rectangle (double x, double y, double width, double height) -// { -// this.x = x; -// this.y = y; -// this.width = width; -// this.height = height; -// } -// -// public Rectangle (Point point, double width, double height) -// { -// x = point.X; -// y = point.Y; -// this.width = width; -// this.height = height; -// } -// -// public double X { -// get { return x; } -// } -// -// public double Y { -// get { return y; } -// } -// -// public double Width { -// get { return width; } -// } -// -// public double Height { -// get { return height; } -// } -// -// public override bool Equals (object obj) -// { -// if (obj is Rectangle) -// return this == (Rectangle)obj; -// return false; -// } -// -// public override int GetHashCode () -// { -// return (int) (x + y + width + height); -// } -// -// public override string ToString () -// { -// return String.Format ("x:{0} y:{1} w:{2} h:{3}", x, y, width, height); -// } -// -// public static bool operator == (Rectangle rectangle, Rectangle other) -// { -// return rectangle.X == other.X && rectangle.Y == other.Y && rectangle.Width == other.Width && rectangle.Height == other.Height; -// } -// -// public static bool operator != (Rectangle rectangle, Rectangle other) -// { -// return !(rectangle == other); -// } -// } -} diff --git a/src/win32/Win32.cs b/src/win32/Win32.cs deleted file mode 100644 index 3249fcee..00000000 --- a/src/win32/Win32.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; -using System.Diagnostics; - -namespace Crow -{ - public static class Win32 - { - [DllImport("user32.dll")] - public static extern IntPtr GetDC(IntPtr hWnd); - #region mouse winApi - - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public struct Point - { - - /// LONG->int - public int x; - - /// LONG->int - public int y; - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public struct HICON__ - { - - /// int - public int unused; - } - -#if _WIN32 || _WIN64 - /// Return Type: HCURSOR->HICON->HICON__* - ///hCursor: HCURSOR->HICON->HICON__* - [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor")] - public static extern System.IntPtr SetCursor([System.Runtime.InteropServices.InAttribute()] System.IntPtr hCursor); -#elif __linux__ - public static System.IntPtr SetCursor(System.IntPtr hCursor) - { - - return (IntPtr)0; - } -#endif - - /// Return Type: BOOL->int - ///lpPoint: LPPOINT->tagPOINT* - [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetCursorPos")] - [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] - public static extern bool GetCursorPos([System.Runtime.InteropServices.OutAttribute()] out Point lpPoint); - - /// Return Type: BOOL->int - ///X: int - ///Y: int - [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")] - [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] - public static extern bool SetCursorPos(int X, int Y); - - #endregion - } -} diff --git a/src/win32/winApi.cs b/src/win32/winApi.cs deleted file mode 100755 index 7ed9f90f..00000000 --- a/src/win32/winApi.cs +++ /dev/null @@ -1,1238 +0,0 @@ - /// <summary> - /// Windows Messages - /// Defined in winuser.h from Windows SDK v6.1 - /// Documentation pulled from MSDN. - /// </summary> -using System; - -public enum WM : uint - { - /// <summary> - /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore. - /// </summary> - NULL = 0x0000, - /// <summary> - /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible. - /// </summary> - CREATE = 0x0001, - /// <summary> - /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. - /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist. - /// /// </summary> - DESTROY = 0x0002, - /// <summary> - /// The WM_MOVE message is sent after a window has been moved. - /// </summary> - MOVE = 0x0003, - /// <summary> - /// The WM_SIZE message is sent to a window after its size has changed. - /// </summary> - SIZE = 0x0005, - /// <summary> - /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. - /// </summary> - ACTIVATE = 0x0006, - /// <summary> - /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. - /// </summary> - SETFOCUS = 0x0007, - /// <summary> - /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. - /// </summary> - KILLFOCUS = 0x0008, - /// <summary> - /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. - /// </summary> - ENABLE = 0x000A, - /// <summary> - /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. - /// </summary> - SETREDRAW = 0x000B, - /// <summary> - /// An application sends a WM_SETTEXT message to set the text of a window. - /// </summary> - SETTEXT = 0x000C, - /// <summary> - /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. - /// </summary> - GETTEXT = 0x000D, - /// <summary> - /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. - /// </summary> - GETTEXTLENGTH = 0x000E, - /// <summary> - /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. - /// </summary> - PAINT = 0x000F, - /// <summary> - /// The WM_CLOSE message is sent as a signal that a window or an application should terminate. - /// </summary> - CLOSE = 0x0010, - /// <summary> - /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero. - /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message. - /// </summary> - QUERYENDSESSION = 0x0011, - /// <summary> - /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position. - /// </summary> - QUERYOPEN = 0x0013, - /// <summary> - /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending. - /// </summary> - ENDSESSION = 0x0016, - /// <summary> - /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero. - /// </summary> - QUIT = 0x0012, - /// <summary> - /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. - /// </summary> - ERASEBKGND = 0x0014, - /// <summary> - /// This message is sent to all top-level windows when a change is made to a system color setting. - /// </summary> - SYSCOLORCHANGE = 0x0015, - /// <summary> - /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown. - /// </summary> - SHOWWINDOW = 0x0018, - /// <summary> - /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. - /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. - /// </summary> - WININICHANGE = 0x001A, - /// <summary> - /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. - /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. - /// </summary> - SETTINGCHANGE = WININICHANGE, - /// <summary> - /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. - /// </summary> - DEVMODECHANGE = 0x001B, - /// <summary> - /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated. - /// </summary> - ACTIVATEAPP = 0x001C, - /// <summary> - /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. - /// </summary> - FONTCHANGE = 0x001D, - /// <summary> - /// A message that is sent whenever there is a change in the system time. - /// </summary> - TIMECHANGE = 0x001E, - /// <summary> - /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window. - /// </summary> - CANCELMODE = 0x001F, - /// <summary> - /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. - /// </summary> - SETCURSOR = 0x0020, - /// <summary> - /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function. - /// </summary> - MOUSEACTIVATE = 0x0021, - /// <summary> - /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized. - /// </summary> - CHILDACTIVATE = 0x0022, - /// <summary> - /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. - /// </summary> - QUEUESYNC = 0x0023, - /// <summary> - /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. - /// </summary> - GETMINMAXINFO = 0x0024, - /// <summary> - /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks. - /// </summary> - PAINTICON = 0x0026, - /// <summary> - /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows. - /// </summary> - ICONERASEBKGND = 0x0027, - /// <summary> - /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. - /// </summary> - NEXTDLGCTL = 0x0028, - /// <summary> - /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. - /// </summary> - SPOOLERSTATUS = 0x002A, - /// <summary> - /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed. - /// </summary> - DRAWITEM = 0x002B, - /// <summary> - /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created. - /// </summary> - MEASUREITEM = 0x002C, - /// <summary> - /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data. - /// </summary> - DELETEITEM = 0x002D, - /// <summary> - /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. - /// </summary> - VKEYTOITEM = 0x002E, - /// <summary> - /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. - /// </summary> - CHARTOITEM = 0x002F, - /// <summary> - /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. - /// </summary> - SETFONT = 0x0030, - /// <summary> - /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. - /// </summary> - GETFONT = 0x0031, - /// <summary> - /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. - /// </summary> - SETHOTKEY = 0x0032, - /// <summary> - /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. - /// </summary> - GETHOTKEY = 0x0033, - /// <summary> - /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon. - /// </summary> - QUERYDRAGICON = 0x0037, - /// <summary> - /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. - /// </summary> - COMPAREITEM = 0x0039, - /// <summary> - /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. - /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. - /// </summary> - GETOBJECT = 0x003D, - /// <summary> - /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low. - /// </summary> - COMPACTING = 0x0041, - /// <summary> - /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications - /// </summary> - [Obsolete] - COMMNOTIFY = 0x0044, - /// <summary> - /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function. - /// </summary> - WINDOWPOSCHANGING = 0x0046, - /// <summary> - /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function. - /// </summary> - WINDOWPOSCHANGED = 0x0047, - /// <summary> - /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode. - /// Use: POWERBROADCAST - /// </summary> - [Obsolete] - POWER = 0x0048, - /// <summary> - /// An application sends the WM_COPYDATA message to pass data to another application. - /// </summary> - COPYDATA = 0x004A, - /// <summary> - /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. - /// </summary> - CANCELJOURNAL = 0x004B, - /// <summary> - /// Sent by a common control to its parent window when an event has occurred or the control requires some information. - /// </summary> - NOTIFY = 0x004E, - /// <summary> - /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. - /// </summary> - INPUTLANGCHANGEREQUEST = 0x0050, - /// <summary> - /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. - /// </summary> - INPUTLANGCHANGE = 0x0051, - /// <summary> - /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function. - /// </summary> - TCARD = 0x0052, - /// <summary> - /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. - /// </summary> - HELP = 0x0053, - /// <summary> - /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings. - /// </summary> - USERCHANGED = 0x0054, - /// <summary> - /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control. - /// </summary> - NOTIFYFORMAT = 0x0055, - /// <summary> - /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window. - /// </summary> - CONTEXTMENU = 0x007B, - /// <summary> - /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles. - /// </summary> - STYLECHANGING = 0x007C, - /// <summary> - /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles - /// </summary> - STYLECHANGED = 0x007D, - /// <summary> - /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed. - /// </summary> - DISPLAYCHANGE = 0x007E, - /// <summary> - /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. - /// </summary> - GETICON = 0x007F, - /// <summary> - /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. - /// </summary> - SETICON = 0x0080, - /// <summary> - /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created. - /// </summary> - NCCREATE = 0x0081, - /// <summary> - /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. - /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed. - /// </summary> - NCDESTROY = 0x0082, - /// <summary> - /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes. - /// </summary> - NCCALCSIZE = 0x0083, - /// <summary> - /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse. - /// </summary> - NCHITTEST = 0x0084, - /// <summary> - /// The WM_NCPAINT message is sent to a window when its frame must be painted. - /// </summary> - NCPAINT = 0x0085, - /// <summary> - /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state. - /// </summary> - NCACTIVATE = 0x0086, - /// <summary> - /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself. - /// </summary> - GETDLGCODE = 0x0087, - /// <summary> - /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads. - /// </summary> - SYNCPAINT = 0x0088, - /// <summary> - /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCMOUSEMOVE = 0x00A0, - /// <summary> - /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCLBUTTONDOWN = 0x00A1, - /// <summary> - /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCLBUTTONUP = 0x00A2, - /// <summary> - /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCLBUTTONDBLCLK = 0x00A3, - /// <summary> - /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCRBUTTONDOWN = 0x00A4, - /// <summary> - /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCRBUTTONUP = 0x00A5, - /// <summary> - /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCRBUTTONDBLCLK = 0x00A6, - /// <summary> - /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCMBUTTONDOWN = 0x00A7, - /// <summary> - /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCMBUTTONUP = 0x00A8, - /// <summary> - /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCMBUTTONDBLCLK = 0x00A9, - /// <summary> - /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCXBUTTONDOWN = 0x00AB, - /// <summary> - /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCXBUTTONUP = 0x00AC, - /// <summary> - /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. - /// </summary> - NCXBUTTONDBLCLK = 0x00AD, - /// <summary> - /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function. - /// </summary> - INPUT_DEVICE_CHANGE = 0x00FE, - /// <summary> - /// The WM_INPUT message is sent to the window that is getting raw input. - /// </summary> - INPUT = 0x00FF, - /// <summary> - /// This message filters for keyboard messages. - /// </summary> - KEYFIRST = 0x0100, - /// <summary> - /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. - /// </summary> - KEYDOWN = 0x0100, - /// <summary> - /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. - /// </summary> - KEYUP = 0x0101, - /// <summary> - /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. - /// </summary> - CHAR = 0x0102, - /// <summary> - /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. - /// </summary> - DEADCHAR = 0x0103, - /// <summary> - /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. - /// </summary> - SYSKEYDOWN = 0x0104, - /// <summary> - /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. - /// </summary> - SYSKEYUP = 0x0105, - /// <summary> - /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. - /// </summary> - SYSCHAR = 0x0106, - /// <summary> - /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. - /// </summary> - SYSDEADCHAR = 0x0107, - /// <summary> - /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. - /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters. - /// </summary> - UNICHAR = 0x0109, - /// <summary> - /// This message filters for keyboard messages. - /// </summary> - KEYLAST = 0x0109, - /// <summary> - /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. - /// </summary> - IME_STARTCOMPOSITION = 0x010D, - /// <summary> - /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. - /// </summary> - IME_ENDCOMPOSITION = 0x010E, - /// <summary> - /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. - /// </summary> - IME_COMPOSITION = 0x010F, - IME_KEYLAST = 0x010F, - /// <summary> - /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. - /// </summary> - INITDIALOG = 0x0110, - /// <summary> - /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. - /// </summary> - COMMAND = 0x0111, - /// <summary> - /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out. - /// </summary> - SYSCOMMAND = 0x0112, - /// <summary> - /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. - /// </summary> - TIMER = 0x0113, - /// <summary> - /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. - /// </summary> - HSCROLL = 0x0114, - /// <summary> - /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. - /// </summary> - VSCROLL = 0x0115, - /// <summary> - /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. - /// </summary> - INITMENU = 0x0116, - /// <summary> - /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. - /// </summary> - INITMENUPOPUP = 0x0117, - /// <summary> - /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. - /// </summary> - MENUSELECT = 0x011F, - /// <summary> - /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. - /// </summary> - MENUCHAR = 0x0120, - /// <summary> - /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. - /// </summary> - ENTERIDLE = 0x0121, - /// <summary> - /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. - /// </summary> - MENURBUTTONUP = 0x0122, - /// <summary> - /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. - /// </summary> - MENUDRAG = 0x0123, - /// <summary> - /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. - /// </summary> - MENUGETOBJECT = 0x0124, - /// <summary> - /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. - /// </summary> - UNINITMENUPOPUP = 0x0125, - /// <summary> - /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. - /// </summary> - MENUCOMMAND = 0x0126, - /// <summary> - /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed. - /// </summary> - CHANGEUISTATE = 0x0127, - /// <summary> - /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows. - /// </summary> - UPDATEUISTATE = 0x0128, - /// <summary> - /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window. - /// </summary> - QUERYUISTATE = 0x0129, - /// <summary> - /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. - /// </summary> - CTLCOLORMSGBOX = 0x0132, - /// <summary> - /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. - /// </summary> - CTLCOLOREDIT = 0x0133, - /// <summary> - /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. - /// </summary> - CTLCOLORLISTBOX = 0x0134, - /// <summary> - /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. - /// </summary> - CTLCOLORBTN = 0x0135, - /// <summary> - /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. - /// </summary> - CTLCOLORDLG = 0x0136, - /// <summary> - /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. - /// </summary> - CTLCOLORSCROLLBAR = 0x0137, - /// <summary> - /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. - /// </summary> - CTLCOLORSTATIC = 0x0138, - /// <summary> - /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function. - /// </summary> - MOUSEFIRST = 0x0200, - /// <summary> - /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - MOUSEMOVE = 0x0200, - /// <summary> - /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - LBUTTONDOWN = 0x0201, - /// <summary> - /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - LBUTTONUP = 0x0202, - /// <summary> - /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - LBUTTONDBLCLK = 0x0203, - /// <summary> - /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - RBUTTONDOWN = 0x0204, - /// <summary> - /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - RBUTTONUP = 0x0205, - /// <summary> - /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - RBUTTONDBLCLK = 0x0206, - /// <summary> - /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - MBUTTONDOWN = 0x0207, - /// <summary> - /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - MBUTTONUP = 0x0208, - /// <summary> - /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - MBUTTONDBLCLK = 0x0209, - /// <summary> - /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. - /// </summary> - MOUSEWHEEL = 0x020A, - /// <summary> - /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - XBUTTONDOWN = 0x020B, - /// <summary> - /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - XBUTTONUP = 0x020C, - /// <summary> - /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// </summary> - XBUTTONDBLCLK = 0x020D, - /// <summary> - /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. - /// </summary> - MOUSEHWHEEL = 0x020E, - /// <summary> - /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function. - /// </summary> - MOUSELAST = 0x020E, - /// <summary> - /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place. - /// </summary> - PARENTNOTIFY = 0x0210, - /// <summary> - /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. - /// </summary> - ENTERMENULOOP = 0x0211, - /// <summary> - /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. - /// </summary> - EXITMENULOOP = 0x0212, - /// <summary> - /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. - /// </summary> - NEXTMENU = 0x0213, - /// <summary> - /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. - /// </summary> - SIZING = 0x0214, - /// <summary> - /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture. - /// </summary> - CAPTURECHANGED = 0x0215, - /// <summary> - /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position. - /// </summary> - MOVING = 0x0216, - /// <summary> - /// Notifies applications that a power-management event has occurred. - /// </summary> - POWERBROADCAST = 0x0218, - /// <summary> - /// Notifies an application of a change to the hardware configuration of a device or the computer. - /// </summary> - DEVICECHANGE = 0x0219, - /// <summary> - /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. - /// </summary> - MDICREATE = 0x0220, - /// <summary> - /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. - /// </summary> - MDIDESTROY = 0x0221, - /// <summary> - /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. - /// </summary> - MDIACTIVATE = 0x0222, - /// <summary> - /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. - /// </summary> - MDIRESTORE = 0x0223, - /// <summary> - /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. - /// </summary> - MDINEXT = 0x0224, - /// <summary> - /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. - /// </summary> - MDIMAXIMIZE = 0x0225, - /// <summary> - /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. - /// </summary> - MDITILE = 0x0226, - /// <summary> - /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. - /// </summary> - MDICASCADE = 0x0227, - /// <summary> - /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. - /// </summary> - MDIICONARRANGE = 0x0228, - /// <summary> - /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. - /// </summary> - MDIGETACTIVE = 0x0229, - /// <summary> - /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. - /// </summary> - MDISETMENU = 0x0230, - /// <summary> - /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. - /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled. - /// </summary> - ENTERSIZEMOVE = 0x0231, - /// <summary> - /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. - /// </summary> - EXITSIZEMOVE = 0x0232, - /// <summary> - /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files. - /// </summary> - DROPFILES = 0x0233, - /// <summary> - /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. - /// </summary> - MDIREFRESHMENU = 0x0234, - /// <summary> - /// Sent to an application when a window is activated. A window receives this message through its WindowProc function. - /// </summary> - IME_SETCONTEXT = 0x0281, - /// <summary> - /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. - /// </summary> - IME_NOTIFY = 0x0282, - /// <summary> - /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters. - /// </summary> - IME_CONTROL = 0x0283, - /// <summary> - /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. - /// </summary> - IME_COMPOSITIONFULL = 0x0284, - /// <summary> - /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. - /// </summary> - IME_SELECT = 0x0285, - /// <summary> - /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. - /// </summary> - IME_CHAR = 0x0286, - /// <summary> - /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. - /// </summary> - IME_REQUEST = 0x0288, - /// <summary> - /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. - /// </summary> - IME_KEYDOWN = 0x0290, - /// <summary> - /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. - /// </summary> - IME_KEYUP = 0x0291, - /// <summary> - /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent. - /// </summary> - MOUSEHOVER = 0x02A1, - /// <summary> - /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent. - /// </summary> - MOUSELEAVE = 0x02A3, - /// <summary> - /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent. - /// </summary> - NCMOUSEHOVER = 0x02A0, - /// <summary> - /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent. - /// </summary> - NCMOUSELEAVE = 0x02A2, - /// <summary> - /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state. - /// </summary> - WTSSESSION_CHANGE = 0x02B1, - TABLET_FIRST = 0x02c0, - TABLET_LAST = 0x02df, - /// <summary> - /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. - /// </summary> - CUT = 0x0300, - /// <summary> - /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. - /// </summary> - COPY = 0x0301, - /// <summary> - /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. - /// </summary> - PASTE = 0x0302, - /// <summary> - /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. - /// </summary> - CLEAR = 0x0303, - /// <summary> - /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted. - /// </summary> - UNDO = 0x0304, - /// <summary> - /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. - /// </summary> - RENDERFORMAT = 0x0305, - /// <summary> - /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. - /// </summary> - RENDERALLFORMATS = 0x0306, - /// <summary> - /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. - /// </summary> - DESTROYCLIPBOARD = 0x0307, - /// <summary> - /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. - /// </summary> - DRAWCLIPBOARD = 0x0308, - /// <summary> - /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. - /// </summary> - PAINTCLIPBOARD = 0x0309, - /// <summary> - /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. - /// </summary> - VSCROLLCLIPBOARD = 0x030A, - /// <summary> - /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. - /// </summary> - SIZECLIPBOARD = 0x030B, - /// <summary> - /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format. - /// </summary> - ASKCBFORMATNAME = 0x030C, - /// <summary> - /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. - /// </summary> - CHANGECBCHAIN = 0x030D, - /// <summary> - /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. - /// </summary> - HSCROLLCLIPBOARD = 0x030E, - /// <summary> - /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. - /// </summary> - QUERYNEWPALETTE = 0x030F, - /// <summary> - /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. - /// </summary> - PALETTEISCHANGING = 0x0310, - /// <summary> - /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. - /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas. - /// </summary> - PALETTECHANGED = 0x0311, - /// <summary> - /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. - /// </summary> - HOTKEY = 0x0312, - /// <summary> - /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context. - /// </summary> - PRINT = 0x0317, - /// <summary> - /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context. - /// </summary> - PRINTCLIENT = 0x0318, - /// <summary> - /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard. - /// </summary> - APPCOMMAND = 0x0319, - /// <summary> - /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another. - /// </summary> - THEMECHANGED = 0x031A, - /// <summary> - /// Sent when the contents of the clipboard have changed. - /// </summary> - CLIPBOARDUPDATE = 0x031D, - /// <summary> - /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed. - /// </summary> - DWMCOMPOSITIONCHANGED = 0x031E, - /// <summary> - /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. - /// </summary> - DWMNCRENDERINGCHANGED = 0x031F, - /// <summary> - /// Sent to all top-level windows when the colorization color has changed. - /// </summary> - DWMCOLORIZATIONCOLORCHANGED = 0x0320, - /// <summary> - /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent. - /// </summary> - DWMWINDOWMAXIMIZEDCHANGE = 0x0321, - /// <summary> - /// Sent to request extended title bar information. A window receives this message through its WindowProc function. - /// </summary> - GETTITLEBARINFOEX = 0x033F, - HANDHELDFIRST = 0x0358, - HANDHELDLAST = 0x035F, - AFXFIRST = 0x0360, - AFXLAST = 0x037F, - PENWINFIRST = 0x0380, - PENWINLAST = 0x038F, - /// <summary> - /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. - /// </summary> - APP = 0x8000, - /// <summary> - /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. - /// </summary> - USER = 0x0400, - - /// <summary> - /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. - /// </summary> - CPL_LAUNCH = USER+0x1000, - /// <summary> - /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. - /// </summary> - CPL_LAUNCHED = USER+0x1001, - /// <summary> - /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling. - /// </summary> - SYSTIMER = 0x118, - - /// <summary> - /// The accessibility state has changed. - /// </summary> - HSHELL_ACCESSIBILITYSTATE = 11, - /// <summary> - /// The shell should activate its main window. - /// </summary> - HSHELL_ACTIVATESHELLWINDOW = 3, - /// <summary> - /// The user completed an input event (for example, pressed an application command button on the mouse or an application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by that input. - /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value section for more information. - /// </summary> - HSHELL_APPCOMMAND = 12, - /// <summary> - /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window. - /// </summary> - HSHELL_GETMINRECT = 5, - /// <summary> - /// Keyboard language was changed or a new keyboard layout was loaded. - /// </summary> - HSHELL_LANGUAGE = 8, - /// <summary> - /// The title of a window in the task bar has been redrawn. - /// </summary> - HSHELL_REDRAW = 6, - /// <summary> - /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list. - /// </summary> - HSHELL_TASKMAN = 7, - /// <summary> - /// A top-level, unowned window has been created. The window exists when the system calls this hook. - /// </summary> - HSHELL_WINDOWCREATED = 1, - /// <summary> - /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook. - /// </summary> - HSHELL_WINDOWDESTROYED = 2, - /// <summary> - /// The activation has changed to a different top-level, unowned window. - /// </summary> - HSHELL_WINDOWACTIVATED = 4, - /// <summary> - /// A top-level window is being replaced. The window exists when the system calls this hook. - /// </summary> - HSHELL_WINDOWREPLACED = 13 -} - -/// <summary> -/// Window Styles. -/// The following styles can be specified wherever a window style is required. After the control has been created, these styles cannot be modified, except as noted. -/// </summary> -[Flags()] -public enum WindowStyles : uint -{ - /// <summary>The window has a thin-line border.</summary> - WS_BORDER = 0x800000, - - /// <summary>The window has a title bar (includes the WS_BORDER style).</summary> - WS_CAPTION = 0xc00000, - - /// <summary>The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.</summary> - WS_CHILD = 0x40000000, - - /// <summary>Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.</summary> - WS_CLIPCHILDREN = 0x2000000, - - /// <summary> - /// Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. - /// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window. - /// </summary> - WS_CLIPSIBLINGS = 0x4000000, - - /// <summary>The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.</summary> - WS_DISABLED = 0x8000000, - - /// <summary>The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.</summary> - WS_DLGFRAME = 0x400000, - - /// <summary> - /// The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. - /// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys. - /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function. - /// </summary> - WS_GROUP = 0x20000, - - /// <summary>The window has a horizontal scroll bar.</summary> - WS_HSCROLL = 0x100000, - - /// <summary>The window is initially maximized.</summary> - WS_MAXIMIZE = 0x1000000, - - /// <summary>The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary> - WS_MAXIMIZEBOX = 0x10000, - - /// <summary>The window is initially minimized.</summary> - WS_MINIMIZE = 0x20000000, - - /// <summary>The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary> - WS_MINIMIZEBOX = 0x20000, - - /// <summary>The window is an overlapped window. An overlapped window has a title bar and a border.</summary> - WS_OVERLAPPED = 0x0, - - /// <summary>The window is an overlapped window.</summary> - WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_SIZEFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, - - /// <summary>The window is a pop-up window. This style cannot be used with the WS_CHILD style.</summary> - WS_POPUP = 0x80000000u, - - /// <summary>The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.</summary> - WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU, - - /// <summary>The window has a sizing border.</summary> - WS_SIZEFRAME = 0x40000, - - /// <summary>The window has a window menu on its title bar. The WS_CAPTION style must also be specified.</summary> - WS_SYSMENU = 0x80000, - - /// <summary> - /// The window is a control that can receive the keyboard focus when the user presses the TAB key. - /// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style. - /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function. - /// For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function. - /// </summary> - WS_TABSTOP = 0x10000, - - /// <summary>The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.</summary> - WS_VISIBLE = 0x10000000, - - /// <summary>The window has a vertical scroll bar.</summary> - WS_VSCROLL = 0x200000 -} - -[Flags] -public enum WindowStylesEx : uint -{ - /// <summary> - /// Specifies that a window created with this style accepts drag-drop files. - /// </summary> - WS_EX_ACCEPTFILES = 0x00000010, - /// <summary> - /// Forces a top-level window onto the taskbar when the window is visible. - /// </summary> - WS_EX_APPWINDOW = 0x00040000, - /// <summary> - /// Specifies that a window has a border with a sunken edge. - /// </summary> - WS_EX_CLIENTEDGE = 0x00000200, - /// <summary> - /// Windows XP: Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. - /// </summary> - WS_EX_COMPOSITED = 0x02000000, - /// <summary> - /// Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window. - /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. - /// </summary> - WS_EX_CONTEXTHELP = 0x00000400, - /// <summary> - /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. - /// </summary> - WS_EX_CONTROLPARENT = 0x00010000, - /// <summary> - /// Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter. - /// </summary> - WS_EX_DLGMODALFRAME = 0x00000001, - /// <summary> - /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. - /// </summary> - WS_EX_LAYERED = 0x00080000, - /// <summary> - /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. - /// </summary> - WS_EX_LAYOUTRTL = 0x00400000, - /// <summary> - /// Creates a window that has generic left-aligned properties. This is the default. - /// </summary> - WS_EX_LEFT = 0x00000000, - /// <summary> - /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored. - /// </summary> - WS_EX_LEFTSCROLLBAR = 0x00004000, - /// <summary> - /// The window text is displayed using left-to-right reading-order properties. This is the default. - /// </summary> - WS_EX_LTRREADING = 0x00000000, - /// <summary> - /// Creates a multiple-document interface (MDI) child window. - /// </summary> - WS_EX_MDICHILD = 0x00000040, - /// <summary> - /// Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. - /// To activate the window, use the SetActiveWindow or SetForegroundWindow function. - /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style. - /// </summary> - WS_EX_NOACTIVATE = 0x08000000, - /// <summary> - /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows. - /// </summary> - WS_EX_NOINHERITLAYOUT = 0x00100000, - /// <summary> - /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed. - /// </summary> - WS_EX_NOPARENTNOTIFY = 0x00000004, - /// <summary> - /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles. - /// </summary> - WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE, - /// <summary> - /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles. - /// </summary> - WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, - /// <summary> - /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored. - /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. - /// </summary> - WS_EX_RIGHT = 0x00001000, - /// <summary> - /// Vertical scroll bar (if present) is to the right of the client area. This is the default. - /// </summary> - WS_EX_RIGHTSCROLLBAR = 0x00000000, - /// <summary> - /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored. - /// </summary> - WS_EX_RTLREADING = 0x00002000, - /// <summary> - /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input. - /// </summary> - WS_EX_STATICEDGE = 0x00020000, - /// <summary> - /// Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE. - /// </summary> - WS_EX_TOOLWINDOW = 0x00000080, - /// <summary> - /// Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function. - /// </summary> - WS_EX_TOPMOST = 0x00000008, - /// <summary> - /// Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted. - /// To achieve transparency without these restrictions, use the SetWindowRgn function. - /// </summary> - WS_EX_TRANSPARENT = 0x00000020, - /// <summary> - /// Specifies that a window has a border with a raised edge. - /// </summary> - WS_EX_WINDOWEDGE = 0x00000100 -} - -public enum ShowWindowCommands -{ - /// <summary> - /// Hides the window and activates another window. - /// </summary> - Hide = 0, - /// <summary> - /// Activates and displays a window. If the window is minimized or - /// maximized, the system restores it to its original size and position. - /// An application should specify this flag when displaying the window - /// for the first time. - /// </summary> - Normal = 1, - /// <summary> - /// Activates the window and displays it as a minimized window. - /// </summary> - ShowMinimized = 2, - /// <summary> - /// Maximizes the specified window. - /// </summary> - Maximize = 3, // is this the right value? - /// <summary> - /// Activates the window and displays it as a maximized window. - /// </summary> - ShowMaximized = 3, - /// <summary> - /// Displays a window in its most recent size and position. This value - /// is similar to <see cref="Win32.ShowWindowCommand.Normal"/>, except - /// the window is not activated. - /// </summary> - ShowNoActivate = 4, - /// <summary> - /// Activates the window and displays it in its current size and position. - /// </summary> - Show = 5, - /// <summary> - /// Minimizes the specified window and activates the next top-level - /// window in the Z order. - /// </summary> - Minimize = 6, - /// <summary> - /// Displays the window as a minimized window. This value is similar to - /// <see cref="Win32.ShowWindowCommand.ShowMinimized"/>, except the - /// window is not activated. - /// </summary> - ShowMinNoActive = 7, - /// <summary> - /// Displays the window in its current size and position. This value is - /// similar to <see cref="Win32.ShowWindowCommand.Show"/>, except the - /// window is not activated. - /// </summary> - ShowNA = 8, - /// <summary> - /// Activates and displays the window. If the window is minimized or - /// maximized, the system restores it to its original size and position. - /// An application should specify this flag when restoring a minimized window. - /// </summary> - Restore = 9, - /// <summary> - /// Sets the show state based on the SW_* value specified in the - /// STARTUPINFO structure passed to the CreateProcess function by the - /// program that started the application. - /// </summary> - ShowDefault = 10, - /// <summary> - /// <b>Windows 2000/XP:</b> Minimizes a window, even if the thread - /// that owns the window is not responding. This flag should only be - /// used when minimizing windows from a different thread. - /// </summary> - ForceMinimize = 11 -} |