aboutsummaryrefslogtreecommitdiff
path: root/source/ShiftUI/System.Windows.Forms.VisualStyles
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-07-20 09:40:36 -0400
committerMichaelTheShifter <[email protected]>2016-07-20 09:40:36 -0400
commitd40fed5ce2bc806a91245adb18039634eac13ed0 (patch)
treef1d7168aee6db109ac2c738ad18c9db667a6ba69 /source/ShiftUI/System.Windows.Forms.VisualStyles
parentf1856e8ed30ed882229fd3fa2a4038122a5fb441 (diff)
downloadshiftos-c-_theultimatehacker-d40fed5ce2bc806a91245adb18039634eac13ed0.tar.gz
shiftos-c-_theultimatehacker-d40fed5ce2bc806a91245adb18039634eac13ed0.tar.bz2
shiftos-c-_theultimatehacker-d40fed5ce2bc806a91245adb18039634eac13ed0.zip
Move ShiftUI source code to ShiftOS
This'll be a lot easier to work on.
Diffstat (limited to 'source/ShiftUI/System.Windows.Forms.VisualStyles')
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/BackgroundType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/BooleanProperty.cs47
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/BorderType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/CheckBoxState.cs46
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ColorProperty.cs57
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ComboBoxState.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ContentAlignment.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeEffects.cs41
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeStyle.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/Edges.cs41
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/EnumProperty.cs49
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/FilenameProperty.cs42
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/FillType.cs39
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/FontProperty.cs35
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphFontSizingType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/GroupBoxState.cs36
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/GtkPlus.cs1774
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestCode.cs44
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestOptions.cs46
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/HorizontalAlign.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/IVisualStyles.cs90
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/IconEffect.cs39
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ImageOrientation.cs36
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ImageSelectType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/IntegerProperty.cs58
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/MarginProperty.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/OffsetType.cs48
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/PointProperty.cs42
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/PushButtonState.cs39
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/RadioButtonState.cs42
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarArrowButtonState.cs50
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarSizeBoxState.cs36
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarState.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/SizingType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/StringProperty.cs35
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TabItemState.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TextBoxState.cs40
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetrics.cs158
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsCharacterSet.cs53
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsPitchAndFamilyValues.cs40
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TextShadowType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ThemeSizeType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/ToolBarState.cs40
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TrackBarThumbState.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/TrueSizeScalingType.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/UXTheme.cs216
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VerticalAlignment.cs37
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleElement.cs2714
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleInformation.cs180
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs447
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleState.cs38
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesEngine.cs52
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesGtkPlus.cs1177
-rw-r--r--source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesNative.cs455
55 files changed, 9093 insertions, 0 deletions
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/BackgroundType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/BackgroundType.cs
new file mode 100644
index 0000000..69a233a
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/BackgroundType.cs
@@ -0,0 +1,37 @@
+//
+// BackgroundType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum BackgroundType
+ {
+ ImageFile = 0,
+ BorderFill = 1,
+ None = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/BooleanProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/BooleanProperty.cs
new file mode 100644
index 0000000..7044ecb
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/BooleanProperty.cs
@@ -0,0 +1,47 @@
+//
+// BooleanProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum BooleanProperty
+ {
+ Transparent = 2201,
+ AutoSize = 2202,
+ BorderOnly = 2203,
+ Composited = 2204,
+ BackgroundFill = 2205,
+ GlyphTransparent = 2206,
+ GlyphOnly = 2207,
+ AlwaysShowSizingBar = 2208,
+ MirrorImage = 2209,
+ UniformSizing = 2210,
+ IntegralSizing = 2211,
+ SourceGrow = 2212,
+ SourceShrink = 2213
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/BorderType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/BorderType.cs
new file mode 100644
index 0000000..34eccbd
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/BorderType.cs
@@ -0,0 +1,37 @@
+//
+// BorderType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum BorderType
+ {
+ Rectangle = 0,
+ RoundedRectangle = 1,
+ Ellipse = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/CheckBoxState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/CheckBoxState.cs
new file mode 100644
index 0000000..0724874
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/CheckBoxState.cs
@@ -0,0 +1,46 @@
+//
+// CheckBoxState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum CheckBoxState
+ {
+ UncheckedNormal = 1,
+ UncheckedHot = 2,
+ UncheckedPressed = 3,
+ UncheckedDisabled = 4,
+ CheckedNormal = 5,
+ CheckedHot = 6,
+ CheckedPressed = 7,
+ CheckedDisabled = 8,
+ MixedNormal = 9,
+ MixedHot = 10,
+ MixedPressed = 11,
+ MixedDisabled = 12
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ColorProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ColorProperty.cs
new file mode 100644
index 0000000..21442c8
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ColorProperty.cs
@@ -0,0 +1,57 @@
+//
+// ColorProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ColorProperty
+ {
+ BorderColor = 3801,
+ FillColor = 3802,
+ TextColor = 3803,
+ EdgeLightColor = 3804,
+ EdgeHighlightColor = 3805,
+ EdgeShadowColor = 3806,
+ EdgeDarkShadowColor = 3807,
+ EdgeFillColor = 3808,
+ TransparentColor = 3809,
+ GradientColor1 = 3810,
+ GradientColor2 = 3811,
+ GradientColor3 = 3812,
+ GradientColor4 = 3813,
+ GradientColor5 = 3814,
+ ShadowColor = 3815,
+ GlowColor = 3816,
+ TextBorderColor = 3817,
+ TextShadowColor = 3818,
+ GlyphTextColor = 3819,
+ GlyphTransparentColor = 3820,
+ FillColorHint = 3821,
+ BorderColorHint = 3822,
+ AccentColorHint = 3823
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ComboBoxState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ComboBoxState.cs
new file mode 100644
index 0000000..30b801a
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ComboBoxState.cs
@@ -0,0 +1,38 @@
+//
+// ComboBoxState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ComboBoxState
+ {
+ Normal = 1,
+ Hot = 2,
+ Pressed = 3,
+ Disabled = 4
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ContentAlignment.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ContentAlignment.cs
new file mode 100644
index 0000000..31e6d8f
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ContentAlignment.cs
@@ -0,0 +1,37 @@
+//
+// ContentAlignment.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ContentAlignment
+ {
+ Left = 0,
+ Center = 1,
+ Right = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeEffects.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeEffects.cs
new file mode 100644
index 0000000..539210e
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeEffects.cs
@@ -0,0 +1,41 @@
+//
+// EdgeEffects.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ [Flags]
+ public enum EdgeEffects
+ {
+ None = 0,
+ FillInterior = 2048,
+ Flat = 4096,
+ Soft = 16384,
+ Mono = 32768
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeStyle.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeStyle.cs
new file mode 100644
index 0000000..dc3229b
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/EdgeStyle.cs
@@ -0,0 +1,38 @@
+//
+// EdgeStyle.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum EdgeStyle
+ {
+ Raised = 5,
+ Etched = 6,
+ Bump = 9,
+ Sunken = 10
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/Edges.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/Edges.cs
new file mode 100644
index 0000000..9bef611
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/Edges.cs
@@ -0,0 +1,41 @@
+//
+// Edges.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ [Flags]
+ public enum Edges
+ {
+ Left = 1,
+ Top = 2,
+ Right = 4,
+ Bottom = 8,
+ Diagonal = 16
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/EnumProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/EnumProperty.cs
new file mode 100644
index 0000000..b2c1ca1
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/EnumProperty.cs
@@ -0,0 +1,49 @@
+//
+// EnumProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum EnumProperty
+ {
+ BackgroundType = 4001,
+ BorderType = 4002,
+ FillType = 4003,
+ SizingType = 4004,
+ HorizontalAlignment = 4005,
+ ContentAlignment = 4006,
+ VerticalAlignment = 4007,
+ OffsetType = 4008,
+ IconEffect = 4009,
+ TextShadowType = 4010,
+ ImageLayout = 4011,
+ GlyphType = 4012,
+ ImageSelectType = 4013,
+ GlyphFontSizingType = 4014,
+ TrueSizeScalingType = 4015
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/FilenameProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/FilenameProperty.cs
new file mode 100644
index 0000000..773ddcc
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/FilenameProperty.cs
@@ -0,0 +1,42 @@
+//
+// FilenameProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum FilenameProperty
+ {
+ ImageFile = 3001,
+ ImageFile1 = 3002,
+ ImageFile2 = 3003,
+ ImageFile3 = 3004,
+ ImageFile4 = 3005,
+ ImageFile5 = 3006,
+ StockImageFile = 3007,
+ GlyphImageFile = 3008
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/FillType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/FillType.cs
new file mode 100644
index 0000000..2a2e30d
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/FillType.cs
@@ -0,0 +1,39 @@
+//
+// FillType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum FillType
+ {
+ Solid = 0,
+ VerticalGradient = 1,
+ HorizontalGradient = 2,
+ RadialGradient = 3,
+ TileImage = 4
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/FontProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/FontProperty.cs
new file mode 100644
index 0000000..83e48fe
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/FontProperty.cs
@@ -0,0 +1,35 @@
+//
+// FontProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum FontProperty
+ {
+ GlyphFont = 2601
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphFontSizingType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphFontSizingType.cs
new file mode 100644
index 0000000..3d3c1db
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphFontSizingType.cs
@@ -0,0 +1,37 @@
+//
+// GlyphFontSizingType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum GlyphFontSizingType
+ {
+ None = 0,
+ Size = 1,
+ Dpi = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphType.cs
new file mode 100644
index 0000000..877bc41
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/GlyphType.cs
@@ -0,0 +1,37 @@
+//
+// GlyphType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum GlyphType
+ {
+ None = 0,
+ ImageGlyph = 1,
+ FontGlyph = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/GroupBoxState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/GroupBoxState.cs
new file mode 100644
index 0000000..da0e2bd
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/GroupBoxState.cs
@@ -0,0 +1,36 @@
+//
+// GroupBoxState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum GroupBoxState
+ {
+ Normal = 1,
+ Disabled = 2
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/GtkPlus.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/GtkPlus.cs
new file mode 100644
index 0000000..ea5fb88
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/GtkPlus.cs
@@ -0,0 +1,1774 @@
+//
+// GtkPlus.cs: Wraps GTK+, exposing its Widget painting features to code
+// that uses System.Drawing types (such as IDeviceContext, Rectangle).
+//
+// 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) 2008 George Giolfan
+//
+// Authors:
+// George Giolfan ([email protected])
+//
+
+using gpointer = System.IntPtr;
+using gboolean = System.Boolean;
+using gint = System.Int32;
+using guint = System.UInt32;
+using guint8 = System.Byte;
+using guint16 = System.UInt16;
+using guint32 = System.UInt32;
+using gfloat = System.Single;
+using gdouble = System.Double;
+
+using PangoFontDescriptionPointer = System.IntPtr;
+
+using GDataPointer = System.IntPtr;
+using GObjectPointer = System.IntPtr;
+using GSListPointer = System.IntPtr;
+using GType = System.IntPtr;
+using GTypeClassPointer = System.IntPtr;
+using GTypeInstancePointer = System.IntPtr;
+
+using GdkColormapPointer = System.IntPtr;
+using GdkDrawablePointer = System.IntPtr;
+using GdkGCPointer = System.IntPtr;
+using GdkNativeWindowPointer = System.IntPtr;
+using GdkPixbufPointer = System.IntPtr;
+using GdkPixmapPointer = System.IntPtr;
+using GdkWindowPointer = System.IntPtr;
+
+using GtkAdjustmentPointer = System.IntPtr;
+using GtkBinPointer = System.IntPtr;
+using GtkContainerPointer = System.IntPtr;
+using GtkObjectPointer = System.IntPtr;
+using GtkStylePointer = System.IntPtr;
+using GtkToolbarPointer = System.IntPtr;
+using GtkToolItemPointer = System.IntPtr;
+using GtkTreeViewPointer = System.IntPtr;
+using GtkTreeViewColumnPointer = System.IntPtr;
+using GtkWidgetPointer = System.IntPtr;
+using GtkWindowPointer = System.IntPtr;
+
+using GtkAllocation = ShiftUI.VisualStyles.GtkPlus.GdkRectangle;
+using GInitiallyUnowned = ShiftUI.VisualStyles.GtkPlus.GObject;
+
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ /// <summary>
+ /// </summary>
+ /// <remarks>
+ /// Inspired by ThemeGtk and QGtkStyle (http://labs.trolltech.com/page/Projects/Styles/GtkStyle). Tries to use the exact GTK+ logic in order to be compatible with all its themes.
+ /// </remarks>
+ class GtkPlus
+ {
+ #region Instance
+ static GtkPlus instance;
+ public static GtkPlus Instance {
+ get { return instance; }
+ }
+ #endregion
+ #region GTK+ initialization
+ public static bool Initialize ()
+ {
+ try {
+ if (gtk_check_version (2, 10, 0) != IntPtr.Zero)
+ return false;
+ //TODO: If we need to pass the actual arguments, duplicate the required code from GTK#.
+ int argc = 0;
+ string [] argv = new string [1];
+ bool result = gtk_init_check (ref argc, ref argv);
+ if (result)
+ instance = new GtkPlus ();
+ return result;
+ } catch (DllNotFoundException) {
+ return false;
+ }
+ }
+ #endregion
+
+ #region Fields
+ readonly int WidgetTypeCount = Enum.GetNames (typeof (WidgetType)).Length;
+ readonly GtkWidgetPointer [] widgets;
+ readonly GtkWidgetPointer window;
+ readonly GtkWidgetPointer @fixed;
+ readonly GtkStylePointer [] styles;
+ #region ComboBox
+ readonly GtkWidgetPointer combo_box_drop_down_toggle_button;
+ readonly GtkWidgetPointer combo_box_drop_down_arrow;
+ GtkStylePointer combo_box_drop_down_toggle_button_style;
+ GtkStylePointer combo_box_drop_down_arrow_style;
+ #endregion
+ #region ToolBar
+ readonly GtkWidgetPointer tool_bar_button;
+ readonly GtkWidgetPointer tool_bar_toggle_button;
+ GtkStylePointer tool_bar_button_style;
+ GtkStylePointer tool_bar_toggle_button_style;
+ #endregion
+ #region TreeView
+ readonly GtkTreeViewColumnPointer tree_view_column;
+ readonly GtkWidgetPointer tree_view_column_button;
+ GtkStylePointer tree_view_column_button_style;
+ #endregion
+ #region Painters
+ readonly ButtonPainter button_painter = new ButtonPainter ();
+ readonly CheckBoxPainter check_box_painter = new CheckBoxPainter ();
+ readonly RadioButtonPainter radio_button_painter = new RadioButtonPainter ();
+ #region ComboBox
+ readonly ComboBoxDropDownButtonPainter combo_box_drop_down_button_painter = new ComboBoxDropDownButtonPainter ();
+ readonly ComboBoxBorderPainter combo_box_border_painter = new ComboBoxBorderPainter ();
+ #endregion
+ #region GroupBox
+ readonly GroupBoxPainter group_box_painter = new GroupBoxPainter ();
+ #endregion
+ #region Header
+ readonly HeaderPainter header_painter = new HeaderPainter ();
+ #endregion
+ #region ProgressBar
+ readonly ProgressBarBarPainter progress_bar_bar_painter = new ProgressBarBarPainter ();
+ readonly ProgressBarChunkPainter progress_bar_chunk_painter = new ProgressBarChunkPainter ();
+ #endregion
+ #region ScrollBar
+ readonly ScrollBarArrowButtonPainter scroll_bar_arrow_button_painter = new ScrollBarArrowButtonPainter ();
+ readonly ScrollBarThumbButtonPainter scroll_bar_thumb_button_painter = new ScrollBarThumbButtonPainter ();
+ readonly ScrollBarTrackPainter scroll_bar_track_painter = new ScrollBarTrackPainter ();
+ #endregion
+ #region StatusBar
+ readonly StatusBarGripperPainter status_bar_gripper_painter = new StatusBarGripperPainter ();
+ #endregion
+ #region TabWidget
+ readonly TabWidgetPanePainter tab_Widget_pane_painter = new TabWidgetPanePainter ();
+ readonly TabWidgetTabItemPainter tab_Widget_tab_item_painter = new TabWidgetTabItemPainter ();
+ #endregion
+ readonly TextBoxPainter text_box_painter = new TextBoxPainter ();
+ #region ToolBar
+ readonly ToolBarPainter tool_bar_painter = new ToolBarPainter ();
+ readonly ToolBarButtonPainter tool_bar_button_painter = new ToolBarButtonPainter ();
+ readonly ToolBarCheckedButtonPainter tool_bar_checked_button_painter = new ToolBarCheckedButtonPainter ();
+ #endregion
+ #region TrackBar
+ readonly TrackBarTrackPainter track_bar_track_painter = new TrackBarTrackPainter ();
+ readonly TrackBarThumbPainter track_bar_thumb_painter = new TrackBarThumbPainter ();
+ #endregion
+ readonly TreeViewGlyphPainter tree_view_glyph_painter = new TreeViewGlyphPainter ();
+ readonly UpDownPainter up_down_painter = new UpDownPainter ();
+ #endregion
+ #endregion
+ #region Constructor and finalizer
+ protected GtkPlus ()
+ {
+ widgets = new GtkWidgetPointer [WidgetTypeCount];
+ styles = new GtkStylePointer [WidgetTypeCount];
+ window = gtk_window_new (GtkWindowType.GTK_WINDOW_TOPLEVEL);
+ @fixed = gtk_fixed_new ();
+ gtk_container_add (window, @fixed);
+ #region Widget types
+ #region Button
+ gtk_container_add (@fixed, widgets [(int)WidgetType.Button] = gtk_button_new ());
+ GTK_WIDGET_SET_FLAGS (widgets [(int)WidgetType.Button], GtkWidgetFlags.GTK_CAN_DEFAULT);
+ #endregion
+ #region CheckBox
+ gtk_container_add (@fixed, widgets [(int)WidgetType.CheckBox] = gtk_check_button_new ());
+ #endregion
+ #region ComboBox
+ gtk_container_add (@fixed, widgets [(int)WidgetType.ComboBox] = gtk_combo_box_entry_new ());
+ gtk_widget_realize (widgets [(int)WidgetType.ComboBox]);
+ combo_box_drop_down_toggle_button = GetFirstChildWidgetOfType.Get (widgets [(int)WidgetType.ComboBox], gtk_toggle_button_get_type ());
+ gtk_widget_realize (combo_box_drop_down_toggle_button);
+ combo_box_drop_down_arrow = GetFirstChildWidgetOfType.Get (combo_box_drop_down_toggle_button, gtk_arrow_get_type ());
+ g_object_ref (combo_box_drop_down_toggle_button_style = GetWidgetStyle (combo_box_drop_down_toggle_button));
+ g_object_ref (combo_box_drop_down_arrow_style = GetWidgetStyle (combo_box_drop_down_arrow));
+ #endregion
+ #region GroupBox
+ gtk_container_add (@fixed, widgets [(int)WidgetType.GroupBox] = gtk_frame_new (null));
+ #endregion
+ #region ProgressBar
+ gtk_container_add (@fixed, widgets [(int)WidgetType.ProgressBar] = gtk_progress_bar_new ());
+ #endregion
+ #region RadioButton
+ gtk_container_add (@fixed, widgets [(int)WidgetType.RadioButton] = gtk_radio_button_new (IntPtr.Zero));
+ #endregion
+ #region ScrollBar
+ gtk_container_add (@fixed, widgets [(int)WidgetType.HScrollBar] = gtk_hscrollbar_new (IntPtr.Zero));
+ gtk_container_add (@fixed, widgets [(int)WidgetType.VScrollBar] = gtk_vscrollbar_new (IntPtr.Zero));
+ #endregion
+ #region StatusBar
+ gtk_container_add (@fixed, widgets [(int)WidgetType.StatusBar] = gtk_statusbar_new ());
+ #endregion
+ #region TabWidget
+ gtk_container_add (@fixed, widgets [(int)WidgetType.TabWidget] = gtk_notebook_new ());
+ #endregion
+ #region TextBox
+ gtk_container_add (@fixed, widgets [(int)WidgetType.TextBox] = gtk_entry_new ());
+ #endregion
+ #region ToolBar
+ gtk_container_add (@fixed, widgets [(int)WidgetType.ToolBar] = gtk_toolbar_new ());
+
+ GtkToolItemPointer tool_button = gtk_tool_button_new (IntPtr.Zero, null);
+ gtk_toolbar_insert (widgets [(int)WidgetType.ToolBar], tool_button, -1);
+ tool_bar_button = gtk_bin_get_child (tool_button);
+ g_object_ref (tool_bar_button_style = GetWidgetStyle (tool_bar_button));
+
+ GtkToolItemPointer toggle_tool_button = gtk_toggle_tool_button_new ();
+ gtk_toolbar_insert (widgets [(int)WidgetType.ToolBar], toggle_tool_button, -1);
+ tool_bar_toggle_button = gtk_bin_get_child (toggle_tool_button);
+ g_object_ref (tool_bar_toggle_button_style = GetWidgetStyle (tool_bar_toggle_button));
+ #endregion
+ #region TrackBar
+ gtk_container_add (@fixed, widgets [(int)WidgetType.HorizontalTrackBar] = gtk_hscale_new_with_range (0, 1, 1));
+ gtk_container_add (@fixed, widgets [(int)WidgetType.VerticalTrackBar] = gtk_vscale_new_with_range (0, 1, 1));
+ #endregion
+ #region TreeView
+ gtk_container_add (@fixed, widgets [(int)WidgetType.TreeView] = gtk_tree_view_new ());
+ tree_view_column = gtk_tree_view_column_new ();
+ gtk_tree_view_insert_column (widgets [(int)WidgetType.TreeView], tree_view_column, -1);
+ GtkTreeViewColumn column_structure = (GtkTreeViewColumn)Marshal.PtrToStructure (tree_view_column, typeof (GtkTreeViewColumn));
+ tree_view_column_button = column_structure.button;
+ g_object_ref (tree_view_column_button_style = GetWidgetStyle (tree_view_column_button));
+ #endregion
+ #region UpDown
+ GtkAdjustmentPointer adjustment = gtk_adjustment_new (0, 0, 0, 0, 0, 0);
+ gtk_container_add (@fixed, widgets [(int)WidgetType.UpDown] = gtk_spin_button_new (adjustment, 0, 0));
+ #endregion
+ #endregion
+ for (int widget_index = 0; widget_index < WidgetTypeCount; widget_index++)
+ g_object_ref (styles [widget_index] = GetWidgetStyle (widgets [widget_index]));
+ }
+ ~GtkPlus ()
+ {
+ gtk_object_destroy (window);
+ for (int widget_index = 0; widget_index < WidgetTypeCount; widget_index++)
+ g_object_unref (styles [widget_index]);
+ #region ComboBox
+ g_object_unref (combo_box_drop_down_toggle_button_style);
+ g_object_unref (combo_box_drop_down_arrow_style);
+ #endregion
+ #region ToolBar
+ g_object_unref (tool_bar_button_style);
+ g_object_unref (tool_bar_toggle_button_style);
+ #endregion
+ #region TreeView
+ g_object_unref (tree_view_column_button_style);
+ #endregion
+ }
+ #endregion
+ #region Widgets
+ #region Button
+ public void ButtonPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, bool @default, GtkPlusState state)
+ {
+ button_painter.Configure (@default, state);
+ Paint (WidgetType.Button, bounds, dc, clippingArea, button_painter);
+ }
+ #endregion
+ #region CheckBox
+ public void CheckBoxPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, GtkPlusToggleButtonValue value)
+ {
+ check_box_painter.Configure (state, value);
+ Paint (WidgetType.CheckBox, bounds, dc, clippingArea, check_box_painter);
+ }
+ Size GetGtkCheckButtonIndicatorSize (WidgetType widgetType)
+ {
+ int indicator_size = GetWidgetStyleInteger (widgets [(int)widgetType], "indicator-size");
+ return new Size (indicator_size, indicator_size);
+ }
+ public Size CheckBoxGetSize ()
+ {
+ return GetGtkCheckButtonIndicatorSize (WidgetType.CheckBox);
+ }
+ #endregion
+ #region ComboBox
+ public void ComboBoxPaintDropDownButton (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state)
+ {
+ combo_box_drop_down_button_painter.Configure (state);
+ Paint (WidgetType.ComboBox, bounds, dc, clippingArea, combo_box_drop_down_button_painter);
+ }
+ public void ComboBoxPaintBorder (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.ComboBox, bounds, dc, clippingArea, combo_box_border_painter);
+ }
+ #endregion
+ #region GroupBox
+ public void GroupBoxPaint (IDeviceContext dc, Rectangle bounds, Rectangle excludedArea, GtkPlusState state)
+ {
+ group_box_painter.Configure (state);
+ PaintExcludingArea (WidgetType.GroupBox, bounds, dc, excludedArea, group_box_painter);
+ }
+ #endregion
+ #region Header
+ public void HeaderPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state)
+ {
+ header_painter.Configure (state);
+ Paint (WidgetType.TreeView, bounds, dc, clippingArea, header_painter);
+ }
+ #endregion
+ #region ProgressBar
+ public void ProgressBarPaintBar (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.ProgressBar, bounds, dc, clippingArea, progress_bar_bar_painter);
+ }
+ public void ProgressBarPaintChunk (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.ProgressBar, bounds, dc, clippingArea, progress_bar_chunk_painter);
+ }
+ public Rectangle ProgressBarGetBackgroundContentRectagle (Rectangle bounds)
+ {
+ GtkStyle style = (GtkStyle)Marshal.PtrToStructure (gtk_widget_get_style (widgets [(int)WidgetType.ProgressBar]), typeof(GtkStyle));
+ bounds.Inflate (-style.xthickness, -style.ythickness);
+ return bounds;
+ }
+ #endregion
+ #region RadioButton
+ public void RadioButtonPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, GtkPlusToggleButtonValue value)
+ {
+ radio_button_painter.Configure (state, value);
+ Paint (WidgetType.RadioButton, bounds, dc, clippingArea, radio_button_painter);
+ }
+ public Size RadioButtonGetSize ()
+ {
+ return GetGtkCheckButtonIndicatorSize (WidgetType.RadioButton);
+ }
+ #endregion
+ #region ScrollBar
+ public void ScrollBarPaintArrowButton (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, bool horizontal, bool upOrLeft)
+ {
+ scroll_bar_arrow_button_painter.Configure (state, horizontal, upOrLeft);
+ Paint (horizontal ? WidgetType.HScrollBar : WidgetType.VScrollBar, bounds, dc, clippingArea, scroll_bar_arrow_button_painter);
+ }
+ public void ScrollBarPaintThumbButton (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, bool horizontal)
+ {
+ scroll_bar_thumb_button_painter.Configure (state, horizontal);
+ Paint (horizontal ? WidgetType.HScrollBar : WidgetType.VScrollBar, bounds, dc, clippingArea, scroll_bar_thumb_button_painter);
+ }
+ public void ScrollBarPaintTrack (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, bool horizontal, bool upOrLeft)
+ {
+ scroll_bar_track_painter.Configure (state, upOrLeft);
+ Paint (horizontal ? WidgetType.HScrollBar : WidgetType.VScrollBar, bounds, dc, clippingArea, scroll_bar_track_painter);
+ }
+ #endregion
+ #region StatusBar
+ public void StatusBarPaintGripper (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.StatusBar, bounds, dc, clippingArea, status_bar_gripper_painter);
+ }
+ #endregion
+ #region TabWidget
+ public void TabWidgetPaintPane (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.TabWidget, bounds, dc, clippingArea, tab_Widget_pane_painter);
+ }
+ public void TabWidgetPaintTabItem (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state)
+ {
+ tab_Widget_tab_item_painter.Configure (state);
+ Paint (WidgetType.TabWidget, bounds, dc, clippingArea, tab_Widget_tab_item_painter);
+ }
+ #endregion
+ #region TextBox
+ public void TextBoxPaint (IDeviceContext dc, Rectangle bounds, Rectangle excludedArea, GtkPlusState state)
+ {
+ text_box_painter.Configure (state);
+ PaintExcludingArea (WidgetType.TextBox, bounds, dc, excludedArea, text_box_painter);
+ }
+ #endregion
+ #region ToolBar
+ public void ToolBarPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetType.ToolBar, bounds, dc, clippingArea, tool_bar_painter);
+ }
+ public void ToolBarPaintButton (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state)
+ {
+ tool_bar_button_painter.Configure (state);
+ Paint (WidgetTypeNotNeeded, bounds, dc, clippingArea, tool_bar_button_painter);
+ }
+ public void ToolBarPaintCheckedButton (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea)
+ {
+ Paint (WidgetTypeNotNeeded, bounds, dc, clippingArea, tool_bar_checked_button_painter);
+ }
+ #endregion
+ #region TrackBar
+ public void TrackBarPaintTrack (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, bool horizontal)
+ {
+ Paint (horizontal ? WidgetType.HorizontalTrackBar : WidgetType.VerticalTrackBar, bounds, dc, clippingArea, track_bar_track_painter);
+ }
+ public void TrackBarPaintThumb (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, GtkPlusState state, bool horizontal)
+ {
+ track_bar_thumb_painter.Configure (state, horizontal);
+ Paint (horizontal ? WidgetType.HorizontalTrackBar : WidgetType.VerticalTrackBar, bounds, dc, clippingArea, track_bar_thumb_painter);
+ }
+ #endregion
+ #region TreeView
+ public void TreeViewPaintGlyph (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, bool closed)
+ {
+ tree_view_glyph_painter.Configure (closed);
+ Paint (WidgetType.TreeView, bounds, dc, clippingArea, tree_view_glyph_painter);
+ }
+ #endregion
+ #region UpDown
+ public void UpDownPaint (IDeviceContext dc, Rectangle bounds, Rectangle clippingArea, bool up, GtkPlusState state)
+ {
+ up_down_painter.Configure (up, state);
+ Paint (WidgetType.UpDown, bounds, dc, clippingArea, up_down_painter);
+ }
+ #endregion
+ #endregion
+ #region Painting
+ void Paint (WidgetType widgetType, Rectangle bounds, IDeviceContext dc, Rectangle clippingArea, Painter painter)
+ {
+ Paint (widgetType, bounds, dc, TransparencyType.Alpha, Color.Black, DeviceContextType.Native, clippingArea, painter, Rectangle.Empty);
+ }
+ void PaintExcludingArea (WidgetType widgetType, Rectangle bounds, IDeviceContext dc, Rectangle excludedArea, Painter painter)
+ {
+ Paint (widgetType, bounds, dc, TransparencyType.Alpha, Color.Black, DeviceContextType.Native, bounds, painter, excludedArea);
+ }
+ void Paint (WidgetType widgetType, Rectangle bounds, IDeviceContext dc, TransparencyType transparencyType, Color background, DeviceContextType deviceContextType, Rectangle clippingArea, Painter painter, Rectangle excludedArea)
+ {
+ Rectangle painted_area = Rectangle.Intersect (bounds, clippingArea);
+ if (painted_area.Width == 0 || painted_area.Height == 0)
+ return;
+ painted_area.Offset (-bounds.X, -bounds.Y);
+ excludedArea.Offset (-bounds.X, -bounds.Y);
+ GdkDrawablePointer drawable = gdk_pixmap_new (IntPtr.Zero, bounds.Width, bounds.Height, 24);
+ painter.AttachStyle (widgetType, drawable, this);
+ GdkPixbufPointer pixbuf;
+ IntPtr pixel_data;
+ int rowstride;
+ GdkGCPointer gc = gdk_gc_new (drawable);
+ GdkColor color = new GdkColor (background);
+ gdk_gc_set_rgb_fg_color (gc, ref color);
+ Paint (drawable, gc, bounds, widgetType, out pixbuf, out pixel_data, out rowstride, painted_area, painter, excludedArea);
+ GdkPixbufPointer white_pixbuf = IntPtr.Zero;
+ IntPtr white_pixel_data = IntPtr.Zero;
+ int white_rowstride = 0;
+ GdkColor white_color = new GdkColor();
+ if (transparencyType == TransparencyType.Alpha) {
+ white_color.red = guint16.MaxValue;
+ white_color.green = guint16.MaxValue;
+ white_color.blue = guint16.MaxValue;
+ gdk_gc_set_rgb_fg_color (gc, ref white_color);
+ Paint (drawable, gc, bounds, widgetType, out white_pixbuf, out white_pixel_data, out white_rowstride, painted_area, painter, excludedArea);
+ }
+ g_object_unref (gc);
+ unsafe {
+ byte* row = (byte*)pixel_data;
+ byte* pixel;
+ byte* white_row = (byte*)white_pixel_data;
+ byte* white_pixel;
+
+ for (int row_index = 0; row_index < painted_area.Height; row_index++) {
+ pixel = row;
+ white_pixel = white_row;
+ for (int pixel_index = 0; pixel_index < painted_area.Width; pixel_index++) {
+ const int GdkRedOffset = 0;
+ const int GdkGreenOffset = 1;
+ const int GdkBlueOffset = 2;
+ const int BitmapAlphaOffset = 3;
+ const int BitmapRedOffset = 2;
+ const int BitmapBlueOffset = 0;
+ switch (transparencyType) {
+ case TransparencyType.Alpha:
+ pixel [BitmapAlphaOffset] = (byte)(pixel [GdkRedOffset] - white_pixel [GdkRedOffset] + byte.MaxValue);
+ break;
+ case TransparencyType.Color:
+ if (
+ pixel [GdkRedOffset] == background.R &&
+ pixel [GdkGreenOffset] == background.G &&
+ pixel [GdkBlueOffset] == background.B) {
+ const int AlphaFullyTransparent = 0;
+ pixel [BitmapAlphaOffset] = AlphaFullyTransparent;
+ }
+ break;
+ }
+
+ byte temporary = pixel [GdkRedOffset];
+ pixel [BitmapBlueOffset] = pixel [GdkBlueOffset];
+ pixel [BitmapRedOffset] = temporary;
+
+ const int PixelSize = 4;
+ pixel += PixelSize;
+ white_pixel += PixelSize;
+ }
+ row += rowstride;
+ white_row += white_rowstride;
+ }
+ }
+ if (transparencyType == TransparencyType.Alpha)
+ g_object_unref (white_pixbuf);
+ g_object_unref (drawable);
+ Bitmap bitmap = new Bitmap (painted_area.Width, painted_area.Height, rowstride, PixelFormat.Format32bppPArgb, pixel_data);
+ Graphics g;
+ bool graphics_is_from_hdc = false;
+ switch (deviceContextType) {
+ case DeviceContextType.Graphics:
+ g = (Graphics)dc;
+ break;
+ case DeviceContextType.Native:
+ g = Graphics.FromHdc (dc.GetHdc ());
+ break;
+ default:
+ g = dc as Graphics;
+ if (g == null) {
+ graphics_is_from_hdc = true;
+ g = Graphics.FromHdc (dc.GetHdc ());
+ } else
+ graphics_is_from_hdc = false;
+ break;
+ }
+ painted_area.Offset (bounds.X, bounds.Y);
+ g.DrawImage (bitmap, painted_area.Location);
+ switch (deviceContextType) {
+ case DeviceContextType.Graphics:
+ break;
+ case DeviceContextType.Native:
+ g.Dispose ();
+ dc.ReleaseHdc ();
+ break;
+ default:
+ if (graphics_is_from_hdc) {
+ g.Dispose ();
+ dc.ReleaseHdc ();
+ }
+ break;
+ }
+ bitmap.Dispose ();
+ g_object_unref (pixbuf);
+ }
+ void Paint (GdkDrawablePointer drawable, GdkGCPointer gc, Rectangle rectangle, WidgetType widgetType, out GdkPixbufPointer pixbuf, out IntPtr pixelData, out int rowstride, Rectangle clippingArea, Painter painter, Rectangle excludedArea)
+ {
+ gdk_draw_rectangle (drawable, gc, true, clippingArea.X, clippingArea.Y, clippingArea.Width, clippingArea.Height);
+ painter.Paint (styles [(int)widgetType], drawable, new GdkRectangle(clippingArea), widgets [(int)widgetType], 0, 0, rectangle.Width, rectangle.Height, this);
+ if (excludedArea.Width != 0)
+ gdk_draw_rectangle (drawable, gc, true, excludedArea.X, excludedArea.Y, excludedArea.Width, excludedArea.Height);
+ if (
+ (pixbuf = gdk_pixbuf_new (GdkColorspace.GDK_COLORSPACE_RGB, true, 8, clippingArea.Width, clippingArea.Height)) == IntPtr.Zero ||
+ gdk_pixbuf_get_from_drawable (pixbuf, drawable, IntPtr.Zero, clippingArea.X, clippingArea.Y, 0, 0, clippingArea.Width, clippingArea.Height) == IntPtr.Zero)
+ throw new OutOfMemoryException ();
+ pixelData = gdk_pixbuf_get_pixels (pixbuf);
+ rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ }
+ abstract class Painter
+ {
+ public virtual void AttachStyle (WidgetType widgetType, GdkDrawablePointer drawable, GtkPlus gtkPlus)
+ {
+ gtkPlus.styles [(int)widgetType] = gtk_style_attach (gtkPlus.styles [(int)widgetType], drawable);
+ }
+ public abstract void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus);
+ }
+ enum TransparencyType
+ {
+ None,
+ Color,
+ Alpha
+ }
+ enum DeviceContextType
+ {
+ Unknown,
+ Graphics,
+ Native
+ }
+ #endregion
+ #region Painters
+ #region Button
+ class ButtonPainter : Painter
+ {
+ bool @default;
+ GtkPlusState state;
+ public void Configure (bool @default, GtkPlusState state) {
+ this.@default = @default;
+ this.state = state;
+ }
+ public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
+ {
+ if (@default) {
+ gtk_window_set_default (gtkPlus.window, widget);
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ "buttondefault",
+ x, y, width, height);
+ gtk_window_set_default (gtkPlus.window, IntPtr.Zero);
+ } else
+ gtk_paint_box (
+ style,
+ window,
+ (GtkStateType)state,
+ state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ widget,
+ "button",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region CheckBox, RadioButton
+ abstract class ToggleButtonPainter : Painter
+ {
+ GtkPlusState state;
+ GtkPlusToggleButtonValue value;
+ public void Configure (GtkPlusState state, GtkPlusToggleButtonValue value)
+ {
+ this.state = state;
+ this.value = value;
+ }
+ public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
+ {
+ PaintFunction (
+ style,
+ window,
+ (GtkStateType)state,
+ (GtkShadowType)value,
+ ref area,
+ widget,
+ Detail,
+ x, y, width,height);
+ }
+ protected abstract string Detail { get; }
+ protected abstract ToggleButtonPaintFunction PaintFunction { get; }
+ }
+ delegate void ToggleButtonPaintFunction (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, gint x, gint y, gint width, gint height);
+ class CheckBoxPainter : ToggleButtonPainter
+ {
+ protected override string Detail {
+ get {
+ return "checkbutton";
+ }
+ }
+ protected override ToggleButtonPaintFunction PaintFunction {
+ get {
+ return gtk_paint_check;
+ }
+ }
+ }
+ class RadioButtonPainter : ToggleButtonPainter
+ {
+ protected override string Detail {
+ get {
+ return "radiobutton";
+ }
+ }
+ protected override ToggleButtonPaintFunction PaintFunction {
+ get {
+ return gtk_paint_option;
+ }
+ }
+ }
+ #endregion
+ #region ComboBox
+ class ComboBoxDropDownButtonPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state)
+ {
+ this.state = state;
+ }
+ public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
+ {
+ gtkPlus.combo_box_drop_down_toggle_button_style = gtk_style_attach (gtkPlus.combo_box_drop_down_toggle_button_style, drawable);
+ gtkPlus.combo_box_drop_down_arrow_style = gtk_style_attach (gtkPlus.combo_box_drop_down_arrow_style, drawable);
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ GtkShadowType shadow_type;
+ switch (state) {
+ case GtkPlusState.Disabled:
+ shadow_type = GtkShadowType.GTK_SHADOW_ETCHED_IN;
+ break;
+ case GtkPlusState.Pressed:
+ shadow_type = GtkShadowType.GTK_SHADOW_IN;
+ break;
+ default:
+ shadow_type = GtkShadowType.GTK_SHADOW_OUT;
+ break;
+ }
+ gtk_paint_box (
+ gtkPlus.combo_box_drop_down_toggle_button_style,
+ window,
+ (GtkStateType)state,
+ shadow_type,
+ ref area,
+ gtkPlus.combo_box_drop_down_toggle_button,
+ "button",
+ x, y, width, height);
+ GtkMisc misc = (GtkMisc)Marshal.PtrToStructure (gtkPlus.combo_box_drop_down_arrow, typeof (GtkMisc));
+ int extent = (int)(Math.Min (width - misc.xpad * 2, height - misc.ypad * 2) * GetWidgetStyleSingle (gtkPlus.combo_box_drop_down_arrow, "arrow-scaling"));
+ gtk_paint_arrow (
+ gtkPlus.combo_box_drop_down_arrow_style,
+ window,
+ (GtkStateType)state,
+ GtkShadowType.GTK_SHADOW_NONE,
+ ref area,
+ gtkPlus.combo_box_drop_down_arrow,
+ "arrow",
+ GtkArrowType.GTK_ARROW_DOWN,
+ true,
+ (int)Math.Floor (x + misc.xpad + (width - extent) * misc.xalign),
+ (int)Math.Floor (y + misc.ypad + (height - extent) * misc.yalign),
+ extent, extent);
+ }
+ }
+ class ComboBoxBorderPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_shadow (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ "combobox",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region GroupBox
+ class GroupBoxPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state)
+ {
+ this.state = state;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_shadow (
+ style,
+ window,
+ (GtkStateType)state,
+ GtkShadowType.GTK_SHADOW_ETCHED_IN,
+ ref area,
+ widget,
+ "frame",
+ x, y, width, height);
+
+ }
+ }
+ #endregion
+ #region Header
+ class HeaderPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state)
+ {
+ this.state = state;
+ }
+ public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
+ {
+ gtkPlus.tree_view_column_button_style = gtk_style_attach (gtkPlus.tree_view_column_button_style, drawable);
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ gtkPlus.tree_view_column_button_style,
+ window,
+ (GtkStateType)state,
+ state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ gtkPlus.tree_view_column_button,
+ "button",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region ProgressBar
+ class ProgressBarBarPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ "trough",
+ x, y, width, height);
+ }
+ }
+ class ProgressBarChunkPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_PRELIGHT,
+ GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ widget,
+ "bar",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region ScrollBar
+ class ScrollBarArrowButtonPainter : Painter
+ {
+ GtkPlusState state;
+ bool horizontal;
+ bool up_or_left;
+ public void Configure (GtkPlusState state, bool horizontal, bool upOrLeft)
+ {
+ this.state = state;
+ this.horizontal = horizontal;
+ up_or_left = upOrLeft;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gboolean can_focus;
+ g_object_get (widget, "can-focus", out can_focus, IntPtr.Zero);
+ if (can_focus) {
+ int focus_line_width;
+ int focus_padding;
+ gtk_widget_style_get (widget,
+ "focus-line-width", out focus_line_width,
+ "focus-padding", out focus_padding,
+ IntPtr.Zero);
+ int focus_width = focus_line_width + focus_padding;
+ if (horizontal) {
+ y -= focus_width;
+ height -= 2 * focus_width;
+ } else {
+ x -= focus_width;
+ width -= 2 * focus_width;
+ }
+ }
+ GtkShadowType shadow_type = state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT;
+ string detail = horizontal ? "hscrollbar" : "vscrollbar";
+ gtk_paint_box (
+ style,
+ window,
+ (GtkStateType)state,
+ shadow_type,
+ ref area,
+ widget,
+ detail,
+ x, y, width, height);
+ width /= 2;
+ height /= 2;
+ x += width / 2;
+ y += height / 2;
+ if (state == GtkPlusState.Pressed) {
+ int arrow_displacement_x;
+ int arrow_displacement_y;
+ gtk_widget_style_get (widget,
+ "arrow-displacement-x", out arrow_displacement_x,
+ "arrow-displacement-y", out arrow_displacement_y,
+ IntPtr.Zero);
+ x += arrow_displacement_x;
+ y += arrow_displacement_y;
+ }
+ gtk_paint_arrow (
+ style,
+ window,
+ (GtkStateType)state,
+ shadow_type,
+ ref area,
+ widget,
+ detail,
+ horizontal ? up_or_left ? GtkArrowType.GTK_ARROW_LEFT : GtkArrowType.GTK_ARROW_RIGHT : up_or_left ? GtkArrowType.GTK_ARROW_UP : GtkArrowType.GTK_ARROW_DOWN,
+ true,
+ x, y, width, height);
+ }
+ }
+ abstract class RangeThumbButtonPainter : Painter
+ {
+ GtkPlusState state;
+ bool horizontal;
+ protected bool Horizontal {
+ get { return horizontal; }
+ }
+ public void Configure (GtkPlusState state, bool horizontal)
+ {
+ this.state = state;
+ this.horizontal = horizontal;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_slider (
+ style,
+ window,
+ (GtkStateType)state,
+ state == GtkPlusState.Pressed && GetWidgetStyleBoolean (widget, "activate-slider") ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ widget,
+ Detail,
+ x, y, width, height,
+ horizontal ? GtkOrientation.GTK_ORIENTATION_HORIZONTAL : GtkOrientation.GTK_ORIENTATION_VERTICAL);
+ }
+ protected abstract string Detail { get; }
+ }
+ class ScrollBarThumbButtonPainter : RangeThumbButtonPainter
+ {
+ protected override string Detail {
+ get {
+ return "slider";
+ }
+ }
+ }
+ class ScrollBarTrackPainter : Painter
+ {
+ GtkPlusState state;
+ bool up_or_left;
+ public void Configure (GtkPlusState state, bool upOrLeft)
+ {
+ this.state = state;
+ up_or_left = upOrLeft;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ style,
+ window,
+ state == GtkPlusState.Pressed ? GtkStateType.GTK_STATE_ACTIVE : GtkStateType.GTK_STATE_INSENSITIVE,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ GetWidgetStyleBoolean (widget, "trough-side-details") ?
+ up_or_left ? "trough-upper" : "trough-lower" :
+ "trough",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region StatusBar
+ class StatusBarGripperPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_resize_grip (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ ref area,
+ widget,
+ "statusbar",
+ GdkWindowEdge.GDK_WINDOW_EDGE_SOUTH_EAST,
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region TabWidget
+ class TabWidgetPanePainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box_gap (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ widget,
+ "notebook",
+ x, y, width, height,
+ GtkPositionType.GTK_POS_TOP,
+ 0,
+ 0);
+ }
+ }
+ class TabWidgetTabItemPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state)
+ {
+ this.state = state;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_extension (
+ style,
+ window,
+ (GtkStateType)state,
+ GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ widget,
+ "tab",
+ x, y, width, height,
+ GtkPositionType.GTK_POS_BOTTOM);
+ }
+ }
+ #endregion
+ #region TextBox
+ class TextBoxPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state)
+ {
+ this.state = state;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_shadow (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ "entry",
+ x, y, width, height);
+ GtkStyle style_structure = (GtkStyle)Marshal.PtrToStructure (style, typeof (GtkStyle));
+ x += style_structure.xthickness;
+ y += style_structure.ythickness;
+ width -= 2 * style_structure.xthickness;
+ height -= 2 * style_structure.ythickness;
+ gtk_paint_flat_box (
+ style,
+ window,
+ (GtkStateType)state,
+ GtkShadowType.GTK_SHADOW_NONE,
+ ref area,
+ widget,
+ "entry_bg",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region ToolBar
+ class ToolBarPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ GetWidgetStyleShadowType (widget),
+ ref area,
+ widget,
+ "toolbar",
+ x, y, width, height);
+ }
+ }
+ class ToolBarButtonPainter : Painter
+ {
+ GtkPlusState state;
+ public void Configure (GtkPlusState state) {
+ this.state = state;
+ }
+ public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
+ {
+ gtkPlus.tool_bar_button_style = gtk_style_attach (gtkPlus.tool_bar_button_style, drawable);
+ }
+ public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ gtkPlus.tool_bar_button_style,
+ window,
+ (GtkStateType)state,
+ state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
+ ref area,
+ gtkPlus.tool_bar_button,
+ "button",
+ x, y, width, height);
+ }
+ }
+ class ToolBarCheckedButtonPainter : Painter
+ {
+ public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
+ {
+ gtkPlus.tool_bar_toggle_button_style = gtk_style_attach (gtkPlus.tool_bar_toggle_button_style, drawable);
+ }
+ public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ gtkPlus.tool_bar_toggle_button_style,
+ window,
+ GtkStateType.GTK_STATE_ACTIVE,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ gtkPlus.tool_bar_toggle_button,
+ "button",
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #region TrackBar
+ class TrackBarTrackPainter : Painter
+ {
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_ACTIVE,
+ GtkShadowType.GTK_SHADOW_IN,
+ ref area,
+ widget,
+ "trough",
+ x, y, width, height);
+ }
+ }
+ class TrackBarThumbPainter : RangeThumbButtonPainter
+ {
+ protected override string Detail {
+ get {
+ return Horizontal ? "hscale" : "vscale";
+ }
+ }
+ }
+ #endregion
+ #region TreeView
+ class TreeViewGlyphPainter : Painter
+ {
+ bool closed;
+ public void Configure (bool closed)
+ {
+ this.closed = closed;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ gtk_paint_expander (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ ref area,
+ widget,
+ "treeview",
+ x + width / 2,
+ y + height / 2,
+ closed ? GtkExpanderStyle.GTK_EXPANDER_COLLAPSED : GtkExpanderStyle.GTK_EXPANDER_EXPANDED);
+ }
+ }
+ #endregion
+ #region UpDown
+ class UpDownPainter : Painter
+ {
+ bool up;
+ GtkPlusState state;
+ public void Configure (bool up, GtkPlusState state)
+ {
+ this.up = up;
+ this.state = state;
+ }
+ public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
+ {
+ GtkShadowType shadow_type = GetWidgetStyleShadowType (widget);
+ if (shadow_type != GtkShadowType.GTK_SHADOW_NONE)
+ gtk_paint_box (
+ style,
+ window,
+ GtkStateType.GTK_STATE_NORMAL,
+ shadow_type,
+ ref area,
+ widget,
+ "spinbutton",
+ x, y - (up ? 0 : height), width, height * 2);
+ shadow_type = state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT;
+ gtk_paint_box (
+ style,
+ window,
+ (GtkStateType)state,
+ shadow_type,
+ ref area,
+ widget,
+ up ? "spinbutton_up" : "spinbutton_down",
+ x, y, width, height);
+ if (up)
+ y += 2;
+ height -= 2;
+ width -= 3;
+ x += 1;
+ int w = width / 2;
+ w -= w % 2 - 1;
+ int h = (w + 1) / 2;
+ x += (width - w) / 2;
+ y += (height - h) / 2;
+ height = h;
+ width = w;
+ gtk_paint_arrow (
+ style,
+ window,
+ (GtkStateType)state,
+ shadow_type,
+ ref area,
+ widget,
+ "spinbutton",
+ up ? GtkArrowType.GTK_ARROW_UP : GtkArrowType.GTK_ARROW_DOWN,
+ true,
+ x, y, width, height);
+ }
+ }
+ #endregion
+ #endregion
+ #region Widget types
+ const WidgetType WidgetTypeNotNeeded = (WidgetType)0;
+ enum WidgetType
+ {
+ Button,
+ CheckBox,
+ ComboBox,
+ GroupBox,
+ ProgressBar,
+ RadioButton,
+ #region ScrollBar
+ HScrollBar,
+ VScrollBar,
+ #endregion
+ StatusBar,
+ TabWidget,
+ TextBox,
+ ToolBar,
+ #region TrackBar
+ HorizontalTrackBar,
+ VerticalTrackBar,
+ #endregion
+ TreeView,
+ UpDown,
+ }
+ #endregion
+ #region GTK+ utility methods
+ static GtkShadowType GetWidgetStyleShadowType (GtkWidgetPointer widget)
+ {
+ GtkShadowType result;
+ gtk_widget_style_get (widget, "shadow-type", out result, IntPtr.Zero);
+ return result;
+ }
+ static int GetWidgetStyleInteger (GtkWidgetPointer widget, string propertyName)
+ {
+ gint result;
+ gtk_widget_style_get (widget, propertyName, out result, IntPtr.Zero);
+ return result;
+ }
+ static float GetWidgetStyleSingle (GtkWidgetPointer widget, string propertyName)
+ {
+ gfloat result;
+ gtk_widget_style_get (widget, propertyName, out result, IntPtr.Zero);
+ return result;
+ }
+ static bool GetWidgetStyleBoolean (GtkWidgetPointer widget, string propertyName)
+ {
+ gboolean result;
+ gtk_widget_style_get (widget, propertyName, out result, IntPtr.Zero);
+ return result;
+ }
+ #region GetFirstChildWidgetOfType
+ static class GetFirstChildWidgetOfType
+ {
+ public static GtkWidgetPointer Get (GtkContainerPointer parent, GType childType)
+ {
+ Type = childType;
+ Result = GtkWidgetPointer.Zero;
+ ContainersToSearch = new ArrayList ();
+ ContainersToSearch.Add (parent);
+ while (true) {
+ ArrayList containers_to_search = ContainersToSearch;
+ ContainersToSearch = new ArrayList ();
+ foreach (GtkContainerPointer container in containers_to_search) {
+ gtk_widget_realize (container);
+ gtk_container_forall (container, Callback, gpointer.Zero);
+ if (Result != GtkWidgetPointer.Zero)
+ return Result;
+ }
+ if (ContainersToSearch.Count == 0)
+ return GtkWidgetPointer.Zero;
+ }
+ }
+ static void Callback (GtkWidgetPointer widget, gpointer data)
+ {
+ if (Result != IntPtr.Zero)
+ return;
+ if (g_type_check_instance_is_a (widget, Type))
+ Result = widget;
+ else if (g_type_check_instance_is_a (widget, gtk_container_get_type ()))
+ ContainersToSearch.Add (widget);
+ }
+ static GType Type;
+ static GtkWidgetPointer Result;
+ static ArrayList ContainersToSearch;
+ }
+ #endregion
+ static GtkStylePointer GetWidgetStyle (GtkWidgetPointer widget)
+ {
+ return gtk_rc_get_style (widget);
+ }
+ #endregion
+ #region Platform Invoke
+ #region Library names
+#if VISUAL_STYLES_USE_GTKPLUS_ON_WINDOWS
+ const string GobjectLibraryName = "libgobject-2.0-0.dll";
+ const string GdkLibraryName = "libgdk-win32-2.0-0.dll";
+ const string GdkPixbufLibraryName = "libgdk_pixbuf-2.0-0.dll";
+ const string GtkLibraryName = "libgtk-win32-2.0-0.dll";
+#else
+ const string GobjectLibraryName = "libgobject-2.0.so";
+ const string GdkLibraryName = "libgdk-x11-2.0.so";
+ const string GdkPixbufLibraryName = "libgdk_pixbuf-2.0.so";
+ const string GtkLibraryName = "libgtk-x11-2.0.so";
+#endif
+ #endregion
+ #region GDK
+ [DllImport (GdkLibraryName)]
+ static extern void gdk_draw_rectangle (GdkDrawablePointer drawable, GdkGCPointer gc, gboolean filled, gint x, gint y, gint width, gint height);
+ [DllImport (GdkLibraryName)]
+ static extern GdkGCPointer gdk_gc_new (GdkDrawablePointer drawable);
+ [DllImport (GdkLibraryName)]
+ static extern void gdk_gc_set_rgb_fg_color (GdkGCPointer gc, ref GdkColor color);
+ [DllImport (GdkLibraryName)]
+ static extern GdkPixbufPointer gdk_pixbuf_get_from_drawable (GdkPixbufPointer dest, GdkDrawablePointer src, GdkColormapPointer cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height);
+ [DllImport (GdkLibraryName)]
+ static extern GdkPixmapPointer gdk_pixmap_new (GdkDrawablePointer drawable, gint width, gint height, gint depth);
+ struct GdkColor{
+ public guint32 pixel;
+ public guint16 red;
+ public guint16 green;
+ public guint16 blue;
+ public GdkColor (Color value)
+ {
+ pixel = 0;
+ red = (guint16)(value.R << 8);
+ green = (guint16)(value.G << 8);
+ blue = (guint16)(value.B << 8);
+ }
+ }
+ internal struct GdkRectangle {
+ public gint x;
+ public gint y;
+ public gint width;
+ public gint height;
+ public GdkRectangle (Rectangle value)
+ {
+ x = value.X;
+ y = value.Y;
+ width = value.Width;
+ height = value.Height;
+ }
+ }
+ #endregion
+ #region GdkPixbuf
+ [DllImport (GdkPixbufLibraryName)]
+ static extern IntPtr gdk_pixbuf_get_pixels (GdkPixbufPointer pixbuf);
+ [DllImport (GdkPixbufLibraryName)]
+ static extern int gdk_pixbuf_get_rowstride (GdkPixbufPointer pixbuf);
+ [DllImport (GdkPixbufLibraryName)]
+ static extern GdkPixbufPointer gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height);
+ enum GdkColorspace
+ {
+ GDK_COLORSPACE_RGB
+ }
+ #endregion
+ #region GTK
+ #region Functions
+ [DllImport (GtkLibraryName)]
+ static extern gboolean gtk_init_check (ref int argc, ref string[] argv);
+ [DllImport (GtkLibraryName)]
+ static extern IntPtr gtk_check_version (guint required_major, guint required_minor, guint required_micro);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_container_add (GtkContainerPointer container, GtkWidgetPointer widget);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_container_forall (GtkContainerPointer container, GtkCallback callback, gpointer callback_data);
+ [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
+ delegate void GtkCallback (GtkWidgetPointer widget, gpointer data);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_object_destroy (GtkObjectPointer @object);
+ [DllImport (GtkLibraryName)]
+ static extern GtkStylePointer gtk_rc_get_style (GtkWidgetPointer widget);
+ [DllImport (GtkLibraryName)]
+ static extern GtkStylePointer gtk_style_attach (GtkStylePointer style, GdkWindowPointer window);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_realize (GtkWidgetPointer widget);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_style_get (GtkWidgetPointer widget, string property, out gint value, IntPtr nullTerminator);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_style_get (GtkWidgetPointer widget, string property, out gfloat value, IntPtr nullTerminator);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_style_get (GtkWidgetPointer widget, string property1, out gint value1, string property2, out gint value2, IntPtr nullTerminator);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_style_get (GtkWidgetPointer widget, string property, out GtkShadowType value, IntPtr nullTerminator);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_widget_style_get (GtkWidgetPointer widget, string property, out gboolean value, IntPtr nullTerminator);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_window_new (GtkWindowType type);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_window_set_default (GtkWindowPointer window, GtkWidgetPointer default_widget);
+ [DllImport (GtkLibraryName)]
+ static extern GtkObjectPointer gtk_adjustment_new (gdouble value, gdouble lower, gdouble upper, gdouble step_increment, gdouble page_increment, gdouble page_size);
+ [DllImport (GtkLibraryName)]
+ static extern GtkStylePointer gtk_widget_get_style (GtkWidgetPointer widget);
+ [DllImport (GtkLibraryName)]
+ static extern GtkTreeViewColumnPointer gtk_tree_view_column_new ();
+ [DllImport (GtkLibraryName)]
+ static extern gint gtk_tree_view_insert_column (
+ GtkTreeViewPointer tree_view,
+ GtkTreeViewColumnPointer column,
+ gint position);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_toolbar_insert (
+ GtkToolbarPointer toolbar,
+ GtkToolItemPointer item,
+ gint pos);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_bin_get_child (GtkBinPointer bin);
+ #region Widget type
+ [DllImport (GtkLibraryName)]
+ static extern GType gtk_arrow_get_type ();
+ [DllImport (GtkLibraryName)]
+ static extern GType gtk_container_get_type ();
+ [DllImport (GtkLibraryName)]
+ static extern GType gtk_toggle_button_get_type ();
+ #endregion
+ #region Widget creation
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_button_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_check_button_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_combo_box_entry_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_entry_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_fixed_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_frame_new (string label);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_hscale_new_with_range (gdouble min, gdouble max, gdouble step);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_hscrollbar_new (GtkAdjustmentPointer adjustment);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_notebook_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_progress_bar_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_radio_button_new (GSListPointer group);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_spin_button_new (GtkAdjustmentPointer adjustment, gdouble climb_rate, guint digits);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_statusbar_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkToolItemPointer gtk_toggle_tool_button_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_toolbar_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkToolItemPointer gtk_tool_button_new (
+ GtkWidgetPointer icon_widget,
+ string label);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_tree_view_new ();
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_vscale_new_with_range (gdouble min, gdouble max, gdouble step);
+ [DllImport (GtkLibraryName)]
+ static extern GtkWidgetPointer gtk_vscrollbar_new (GtkAdjustmentPointer adjustment);
+ #endregion
+ #region Painting
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_arrow (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_box (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, gint x, gint y, gint width, gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_box_gap (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ GtkShadowType shadow_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ GtkPositionType gap_side,
+ gint gap_x,
+ gint gap_width);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_check (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, gint x, gint y, gint width, gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_expander (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ gint x,
+ gint y,
+ GtkExpanderStyle expander_style);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_extension (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ GtkShadowType shadow_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ GtkPositionType gap_side);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_flat_box (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ GtkShadowType shadow_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_option (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, gint x, gint y, gint width, gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_resize_grip (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ GdkWindowEdge edge,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_shadow (GtkStylePointer style, GdkWindowPointer window, GtkStateType state_type, GtkShadowType shadow_type, ref GdkRectangle area, GtkWidgetPointer widget, string detail, gint x, gint y, gint width, gint height);
+ [DllImport (GtkLibraryName)]
+ static extern void gtk_paint_slider (
+ GtkStylePointer style,
+ GdkWindowPointer window,
+ GtkStateType state_type,
+ GtkShadowType shadow_type,
+ ref GdkRectangle area,
+ GtkWidgetPointer widget,
+ string detail,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ GtkOrientation orientation);
+ #endregion
+ #endregion
+ #region Enumerations
+ internal enum GtkShadowType
+ {
+ GTK_SHADOW_NONE,
+ GTK_SHADOW_IN,
+ GTK_SHADOW_OUT,
+ GTK_SHADOW_ETCHED_IN,
+ GTK_SHADOW_ETCHED_OUT
+ }
+ enum GtkStateType
+ {
+ GTK_STATE_NORMAL,
+ GTK_STATE_ACTIVE,
+ GTK_STATE_PRELIGHT,
+ GTK_STATE_SELECTED,
+ GTK_STATE_INSENSITIVE
+ }
+ enum GtkWindowType
+ {
+ GTK_WINDOW_TOPLEVEL,
+ GTK_WINDOW_POPUP
+ }
+ enum GtkArrowType
+ {
+ GTK_ARROW_UP,
+ GTK_ARROW_DOWN,
+ GTK_ARROW_LEFT,
+ GTK_ARROW_RIGHT,
+ GTK_ARROW_NONE
+ }
+ enum GtkOrientation
+ {
+ GTK_ORIENTATION_HORIZONTAL,
+ GTK_ORIENTATION_VERTICAL
+ }
+ enum GtkExpanderStyle
+ {
+ GTK_EXPANDER_COLLAPSED,
+ GTK_EXPANDER_SEMI_COLLAPSED,
+ GTK_EXPANDER_SEMI_EXPANDED,
+ GTK_EXPANDER_EXPANDED
+ }
+ enum GtkPositionType
+ {
+ GTK_POS_LEFT,
+ GTK_POS_RIGHT,
+ GTK_POS_TOP,
+ GTK_POS_BOTTOM
+ }
+ enum GtkWidgetFlags : uint
+ {
+ GTK_CAN_DEFAULT = 1 << 13,
+ }
+ enum GdkWindowEdge
+ {
+ GDK_WINDOW_EDGE_NORTH_WEST,
+ GDK_WINDOW_EDGE_NORTH,
+ GDK_WINDOW_EDGE_NORTH_EAST,
+ GDK_WINDOW_EDGE_WEST,
+ GDK_WINDOW_EDGE_EAST,
+ GDK_WINDOW_EDGE_SOUTH_WEST,
+ GDK_WINDOW_EDGE_SOUTH,
+ GDK_WINDOW_EDGE_SOUTH_EAST
+ }
+ #endregion
+ #region Structures
+ struct GtkStyle
+ {
+#pragma warning disable 169
+ GObject parent_instance;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] fg;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] bg;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] light;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] dark;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] mid;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] text;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] @base;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
+ GdkColor[] text_aa;
+ GdkColor black;
+ GdkColor white;
+ PangoFontDescriptionPointer font_desc;
+#pragma warning restore 169
+ public gint xthickness;
+ public gint ythickness;
+ }
+ struct GtkWidget
+ {
+#pragma warning disable 169
+ GtkObject @object;
+ guint16 private_flags;
+ guint8 state;
+ guint8 saved_state;
+ string name;
+ GtkStylePointer style;
+ GtkRequisition requisition;
+#pragma warning restore 169
+ public GtkAllocation allocation;
+#pragma warning disable 169
+ GdkWindowPointer window;
+ GtkWidgetPointer parent;
+#pragma warning restore 169
+ }
+ struct GtkObject
+ {
+#pragma warning disable 169
+ GInitiallyUnowned parent_instance;
+#pragma warning restore 169
+ public guint32 flags;
+ }
+ struct GtkRequisition
+ {
+#pragma warning disable 169
+ gint width;
+ gint height;
+#pragma warning restore 169
+ }
+ struct GtkMisc
+ {
+#pragma warning disable 169
+ GtkWidget widget;
+#pragma warning restore 169
+ public gfloat xalign;
+ public gfloat yalign;
+ public guint16 xpad;
+ public guint16 ypad;
+ }
+ struct GtkTreeViewColumn
+ {
+#pragma warning disable 169
+ GtkObject parent;
+ GtkWidgetPointer tree_view;
+#pragma warning restore 169
+ public GtkWidgetPointer button;
+ }
+ #endregion
+ #region Macros
+ static void GTK_WIDGET_SET_FLAGS (GtkWidgetPointer wid, GtkWidgetFlags flag)
+ {
+ GtkObject @object = (GtkObject)Marshal.PtrToStructure (wid, typeof (GtkObject));
+ @object.flags |= (guint32)flag;
+ Marshal.StructureToPtr (@object, wid, false);
+ }
+ #endregion
+ #endregion
+ #region GObject
+ [DllImport (GobjectLibraryName)]
+ static extern gpointer g_object_ref (gpointer @object);
+ [DllImport (GobjectLibraryName)]
+ static extern void g_object_unref (gpointer @object);
+ [DllImport (GobjectLibraryName)]
+ static extern gboolean g_type_check_instance_is_a (GTypeInstancePointer type_instance, GType iface_type);
+ [DllImport (GobjectLibraryName)]
+ static extern void g_object_get (gpointer @object, string property_name, out gboolean value, IntPtr nullTerminator);
+ const int G_TYPE_FUNDAMENTAL_SHIFT = 2;
+ enum G_TYPE
+ {
+ }
+ struct GTypeInstance
+ {
+#pragma warning disable 169
+ GTypeClassPointer g_class;
+#pragma warning restore 169
+ }
+ internal struct GObject
+ {
+#pragma warning disable 169
+ GTypeInstance g_type_instance;
+ guint ref_count;
+ GDataPointer qdata;
+#pragma warning restore 169
+ }
+ #endregion
+ #endregion
+ }
+ #region Exposed constants
+ enum GtkPlusToggleButtonValue
+ {
+ Unchecked = GtkPlus.GtkShadowType.GTK_SHADOW_OUT,
+ Mixed = GtkPlus.GtkShadowType.GTK_SHADOW_ETCHED_IN,
+ Checked = GtkPlus.GtkShadowType.GTK_SHADOW_IN
+ }
+ enum GtkPlusState
+ {
+ Normal,
+ Pressed,
+ Hot,
+ Selected,
+ Disabled
+ }
+ #endregion
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestCode.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestCode.cs
new file mode 100644
index 0000000..ec873c5
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestCode.cs
@@ -0,0 +1,44 @@
+//
+// HitTestCode.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum HitTestCode
+ {
+ Nowhere = 0,
+ Client = 1,
+ Left = 10,
+ Right = 11,
+ Top = 12,
+ TopLeft = 13,
+ TopRight = 14,
+ Bottom = 15,
+ BottomLeft = 16,
+ BottomRight = 17
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestOptions.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestOptions.cs
new file mode 100644
index 0000000..4dd9e55
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/HitTestOptions.cs
@@ -0,0 +1,46 @@
+//
+// HitTestOptions.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ [Flags]
+ public enum HitTestOptions
+ {
+ BackgroundSegment = 0,
+ FixedBorder = 2,
+ Caption = 4,
+ ResizingBorderLeft = 16,
+ ResizingBorderTop = 32,
+ ResizingBorderRight = 64,
+ ResizingBorderBottom = 128,
+ ResizingBorder = 240,
+ SizingTemplate = 256,
+ SystemSizingMargins = 512
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/HorizontalAlign.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/HorizontalAlign.cs
new file mode 100644
index 0000000..7070d13
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/HorizontalAlign.cs
@@ -0,0 +1,37 @@
+//
+// HorizontalAlign.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum HorizontalAlign
+ {
+ Left = 0,
+ Center = 1,
+ Right = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/IVisualStyles.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/IVisualStyles.cs
new file mode 100644
index 0000000..ad0e1b5
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/IVisualStyles.cs
@@ -0,0 +1,90 @@
+//
+// IVisualStyles.cs: An implementation of VisualStyleRenderer and
+// VisualStyleInformation.
+//
+// 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) 2008 George Giolfan
+//
+// Authors:
+// George Giolfan ([email protected])
+//
+
+using HRESULT = System.Int32;
+using System.Drawing;
+using System;
+
+
+namespace ShiftUI.VisualStyles
+{
+ interface IVisualStyles
+ {
+ #region UxTheme
+ HRESULT UxThemeCloseThemeData (IntPtr hTheme);
+ HRESULT UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds);
+ HRESULT UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Rectangle clipRectangle);
+ HRESULT UxThemeDrawThemeEdge (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds,Edges edges, EdgeStyle style, EdgeEffects effects, out Rectangle result);
+ HRESULT UxThemeDrawThemeParentBackground (IDeviceContext dc, Rectangle bounds, Widget childWidget);
+ HRESULT UxThemeDrawThemeText (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, String text, TextFormatFlags textFlags, Rectangle bounds);
+ HRESULT UxThemeGetThemeBackgroundContentRect (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Rectangle result);
+ HRESULT UxThemeGetThemeBackgroundExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle contentBounds, out Rectangle result);
+ HRESULT UxThemeGetThemeBackgroundRegion (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Region result);
+ HRESULT UxThemeGetThemeBool (IntPtr hTheme, int iPartId, int iStateId, BooleanProperty prop, out bool result);
+ HRESULT UxThemeGetThemeColor (IntPtr hTheme, int iPartId, int iStateId, ColorProperty prop, out Color result);
+ HRESULT UxThemeGetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, EnumProperty prop, out int result);
+ HRESULT UxThemeGetThemeFilename (IntPtr hTheme, int iPartId, int iStateId, FilenameProperty prop, out string result);
+ HRESULT UxThemeGetThemeInt (IntPtr hTheme, int iPartId, int iStateId, IntegerProperty prop, out int result);
+ HRESULT UxThemeGetThemeMargins (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, MarginProperty prop, out Padding result);
+ HRESULT UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, ThemeSizeType type, out Size result);
+ HRESULT UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, ThemeSizeType type, out Size result);
+ HRESULT UxThemeGetThemePosition (IntPtr hTheme, int iPartId, int iStateId, PointProperty prop, out Point result);
+ HRESULT UxThemeGetThemeString (IntPtr hTheme, int iPartId, int iStateId, StringProperty prop, out string result);
+ HRESULT UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, Rectangle bounds, out Rectangle result);
+ HRESULT UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, out Rectangle result);
+ HRESULT UxThemeGetThemeTextMetrics (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, out TextMetrics result);
+ HRESULT UxThemeHitTestThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, HitTestOptions options, Rectangle backgroundRectangle, IntPtr hrgn, Point pt, out HitTestCode result);
+ bool UxThemeIsAppThemed ();
+ bool UxThemeIsThemeActive ();
+ bool UxThemeIsThemeBackgroundPartiallyTransparent (IntPtr hTheme, int iPartId, int iStateId);
+ bool UxThemeIsThemePartDefined (IntPtr hTheme, int iPartId);
+ IntPtr UxThemeOpenThemeData (IntPtr hWnd, String classList);
+ #endregion
+ #region VisualStyleInformation
+ string VisualStyleInformationAuthor { get; }
+ string VisualStyleInformationColorScheme { get; }
+ string VisualStyleInformationCompany { get; }
+ Color VisualStyleInformationWidgetHighlightHot { get; }
+ string VisualStyleInformationCopyright { get; }
+ string VisualStyleInformationDescription { get; }
+ string VisualStyleInformationDisplayName { get; }
+ string VisualStyleInformationFileName { get; }
+ bool VisualStyleInformationIsSupportedByOS { get; }
+ int VisualStyleInformationMinimumColorDepth { get; }
+ string VisualStyleInformationSize { get; }
+ bool VisualStyleInformationSupportsFlatMenus { get; }
+ Color VisualStyleInformationTextWidgetBorder { get; }
+ string VisualStyleInformationUrl { get; }
+ string VisualStyleInformationVersion { get; }
+ #endregion
+ #region VisualStyleRenderer
+ void VisualStyleRendererDrawBackgroundExcludingArea (IntPtr theme, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle excludedArea);
+ #endregion
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/IconEffect.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/IconEffect.cs
new file mode 100644
index 0000000..c6fe225
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/IconEffect.cs
@@ -0,0 +1,39 @@
+//
+// IconEffect.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum IconEffect
+ {
+ None = 0,
+ Glow = 1,
+ Shadow = 2,
+ Pulse = 3,
+ Alpha = 4
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageOrientation.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageOrientation.cs
new file mode 100644
index 0000000..7a96c9f
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageOrientation.cs
@@ -0,0 +1,36 @@
+//
+// ImageOrientation.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ImageOrientation
+ {
+ Vertical = 0,
+ Horizontal = 1
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageSelectType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageSelectType.cs
new file mode 100644
index 0000000..ee0adec
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ImageSelectType.cs
@@ -0,0 +1,37 @@
+//
+// ImageSelectType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ImageSelectType
+ {
+ None = 0,
+ Size = 1,
+ Dpi = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/IntegerProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/IntegerProperty.cs
new file mode 100644
index 0000000..bd07c13
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/IntegerProperty.cs
@@ -0,0 +1,58 @@
+//
+// IntegerProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum IntegerProperty
+ {
+ ImageCount = 2401,
+ AlphaLevel = 2402,
+ BorderSize = 2403,
+ RoundCornerWidth = 2404,
+ RoundCornerHeight = 2405,
+ GradientRatio1 = 2406,
+ GradientRatio2 = 2407,
+ GradientRatio3 = 2408,
+ GradientRatio4 = 2409,
+ GradientRatio5 = 2410,
+ ProgressChunkSize = 2411,
+ ProgressSpaceSize = 2412,
+ Saturation = 2413,
+ TextBorderSize = 2414,
+ AlphaThreshold = 2415,
+ Width = 2416,
+ Height = 2417,
+ GlyphIndex = 2418,
+ TrueSizeStretchMark = 2419,
+ MinDpi1 = 2420,
+ MinDpi2 = 2421,
+ MinDpi3 = 2422,
+ MinDpi4 = 2423,
+ MinDpi5 = 2424
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/MarginProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/MarginProperty.cs
new file mode 100644
index 0000000..4bd1115
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/MarginProperty.cs
@@ -0,0 +1,37 @@
+//
+// MarginProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum MarginProperty
+ {
+ SizingMargins = 3601,
+ ContentMargins = 3602,
+ CaptionMargins = 3603
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/OffsetType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/OffsetType.cs
new file mode 100644
index 0000000..1facddc
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/OffsetType.cs
@@ -0,0 +1,48 @@
+//
+// OffsetType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum OffsetType
+ {
+ TopLeft = 0,
+ TopRight = 1,
+ TopMiddle = 2,
+ BottomLeft = 3,
+ BottomRight = 4,
+ BottomMiddle = 5,
+ MiddleLeft = 6,
+ MiddleRight = 7,
+ LeftOfCaption = 8,
+ RightOfCaption = 9,
+ LeftOfLastButton = 10,
+ RightOfLastButton = 11,
+ AboveLastButton = 12,
+ BelowLastButton = 13
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/PointProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/PointProperty.cs
new file mode 100644
index 0000000..fe6aa62
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/PointProperty.cs
@@ -0,0 +1,42 @@
+//
+// PointProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum PointProperty
+ {
+ Offset = 3401,
+ TextShadowOffset = 3402,
+ MinSize = 3403,
+ MinSize1 = 3404,
+ MinSize2 = 3405,
+ MinSize3 = 3406,
+ MinSize4 = 3407,
+ MinSize5 = 3408
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/PushButtonState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/PushButtonState.cs
new file mode 100644
index 0000000..8fff333
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/PushButtonState.cs
@@ -0,0 +1,39 @@
+//
+// PushButtonState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum PushButtonState
+ {
+ Normal = 1,
+ Hot = 2,
+ Pressed = 3,
+ Disabled = 4,
+ Default = 5
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/RadioButtonState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/RadioButtonState.cs
new file mode 100644
index 0000000..328712f
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/RadioButtonState.cs
@@ -0,0 +1,42 @@
+//
+// RadioButtonState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum RadioButtonState
+ {
+ UncheckedNormal = 1,
+ UncheckedHot = 2,
+ UncheckedPressed = 3,
+ UncheckedDisabled = 4,
+ CheckedNormal = 5,
+ CheckedHot = 6,
+ CheckedPressed = 7,
+ CheckedDisabled = 8
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarArrowButtonState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarArrowButtonState.cs
new file mode 100644
index 0000000..85872a0
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarArrowButtonState.cs
@@ -0,0 +1,50 @@
+//
+// ScrollBarArrowButtonState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ScrollBarArrowButtonState
+ {
+ UpNormal = 1,
+ UpHot = 2,
+ UpPressed = 3,
+ UpDisabled = 4,
+ DownNormal = 5,
+ DownHot = 6,
+ DownPressed = 7,
+ DownDisabled = 8,
+ LeftNormal = 9,
+ LeftHot = 10,
+ LeftPressed = 11,
+ LeftDisabled = 12,
+ RightNormal = 13,
+ RightHot = 14,
+ RightPressed = 15,
+ RightDisabled = 16
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarSizeBoxState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarSizeBoxState.cs
new file mode 100644
index 0000000..17f974b
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarSizeBoxState.cs
@@ -0,0 +1,36 @@
+//
+// ScrollBarSizeBoxState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ScrollBarSizeBoxState
+ {
+ RightAlign = 1,
+ LeftAlign = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarState.cs
new file mode 100644
index 0000000..b362609
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ScrollBarState.cs
@@ -0,0 +1,38 @@
+//
+// ScrollBarState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ScrollBarState
+ {
+ Normal = 1,
+ Hot = 2,
+ Pressed = 3,
+ Disabled = 4
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/SizingType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/SizingType.cs
new file mode 100644
index 0000000..194763f
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/SizingType.cs
@@ -0,0 +1,37 @@
+//
+// SizingType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum SizingType
+ {
+ FixedSize = 0,
+ Stretch = 1,
+ Tile = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/StringProperty.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/StringProperty.cs
new file mode 100644
index 0000000..652916a
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/StringProperty.cs
@@ -0,0 +1,35 @@
+//
+// StringProperty.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum StringProperty
+ {
+ Text = 3201
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TabItemState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TabItemState.cs
new file mode 100644
index 0000000..b9ed0aa
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TabItemState.cs
@@ -0,0 +1,38 @@
+//
+// TabItemState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TabItemState
+ {
+ Normal = 1,
+ Hot = 2,
+ Selected = 3,
+ Disabled = 4
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TextBoxState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextBoxState.cs
new file mode 100644
index 0000000..0ec064c
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextBoxState.cs
@@ -0,0 +1,40 @@
+//
+// TextBoxState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TextBoxState
+ {
+ Normal = 1,
+ Hot = 2,
+ Selected = 3,
+ Disabled = 4,
+ Readonly = 6,
+ Assist = 7
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetrics.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetrics.cs
new file mode 100644
index 0000000..2e25adf
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetrics.cs
@@ -0,0 +1,158 @@
+//
+// TextMetrics.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public struct TextMetrics
+ {
+ #region Private Variables
+ private int ascent;
+ private int average_char_width;
+ private char break_char;
+ private TextMetricsCharacterSet char_set;
+ private char default_char;
+ private int descent;
+ private int digitized_aspect_x;
+ private int digitized_aspect_y;
+ private int external_leading;
+ private char first_char;
+ private int height;
+ private int internal_leading;
+ private bool italic;
+ private char last_char;
+ private int max_char_width;
+ private int overhang;
+ private TextMetricsPitchAndFamilyValues pitch_and_family;
+ private bool struck_out;
+ private bool underlined;
+ private int weight;
+ #endregion
+
+ #region Public Properties
+ public int Ascent {
+ get { return this.ascent; }
+ set { this.ascent = value; }
+ }
+
+ public int AverageCharWidth {
+ get { return this.average_char_width; }
+ set { this.average_char_width = value; }
+ }
+
+ public char BreakChar {
+ get { return this.break_char; }
+ set { this.break_char = value; }
+ }
+
+ public TextMetricsCharacterSet CharSet {
+ get { return this.char_set; }
+ set { this.char_set = value; }
+ }
+
+ public char DefaultChar {
+ get { return this.default_char; }
+ set { this.default_char = value; }
+ }
+
+ public int Descent {
+ get { return this.descent; }
+ set { this.descent = value; }
+ }
+
+ public int DigitizedAspectX {
+ get { return this.digitized_aspect_x; }
+ set { this.digitized_aspect_x = value; }
+ }
+
+ public int DigitizedAspectY {
+ get { return this.digitized_aspect_y; }
+ set { this.digitized_aspect_y = value; }
+ }
+
+ public int ExternalLeading {
+ get { return this.external_leading; }
+ set { this.external_leading = value; }
+ }
+
+ public char FirstChar {
+ get { return this.first_char; }
+ set { this.first_char = value; }
+ }
+
+ public int Height {
+ get { return this.height; }
+ set { this.height = value; }
+ }
+
+ public int InternalLeading {
+ get { return this.internal_leading; }
+ set { this.internal_leading = value; }
+ }
+
+ public bool Italic {
+ get { return this.italic; }
+ set { this.italic = value; }
+ }
+
+ public char LastChar {
+ get { return this.last_char; }
+ set { this.last_char = value; }
+ }
+
+ public int MaxCharWidth {
+ get { return this.max_char_width; }
+ set { this.max_char_width = value; }
+ }
+
+ public int Overhang {
+ get { return this.overhang; }
+ set { this.overhang = value; }
+ }
+
+ public TextMetricsPitchAndFamilyValues PitchAndFamily {
+ get { return this.pitch_and_family; }
+ set { this.pitch_and_family = value; }
+ }
+
+ public bool StruckOut {
+ get { return this.struck_out; }
+ set { this.struck_out = value; }
+ }
+
+ public bool Underlined {
+ get { return this.underlined; }
+ set { this.underlined = value; }
+ }
+
+ public int Weight {
+ get { return this.weight; }
+ set { this.weight = value; }
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsCharacterSet.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsCharacterSet.cs
new file mode 100644
index 0000000..b512078
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsCharacterSet.cs
@@ -0,0 +1,53 @@
+//
+// TextMetricsCharacterSet.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TextMetricsCharacterSet
+ {
+ Ansi = 0,
+ Default = 1,
+ Symbol = 2,
+ Mac = 77,
+ ShiftJis = 128,
+ Hangul = 129,
+ Johab = 130,
+ Gb2312 = 134,
+ ChineseBig5 = 136,
+ Greek = 161,
+ Turkish = 162,
+ Vietnamese = 163,
+ Hebrew = 177,
+ Arabic = 178,
+ Baltic = 186,
+ Russian = 204,
+ Thai = 222,
+ EastEurope = 238,
+ Oem = 255
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsPitchAndFamilyValues.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsPitchAndFamilyValues.cs
new file mode 100644
index 0000000..dbfa5dc
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextMetricsPitchAndFamilyValues.cs
@@ -0,0 +1,40 @@
+//
+// TextMetricsPitchAndFamilyValues.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ [Flags]
+ public enum TextMetricsPitchAndFamilyValues
+ {
+ FixedPitch = 1,
+ Vector = 2,
+ TrueType = 4,
+ Device = 8
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TextShadowType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextShadowType.cs
new file mode 100644
index 0000000..10fb885
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TextShadowType.cs
@@ -0,0 +1,37 @@
+//
+// TextShadowType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TextShadowType
+ {
+ None = 0,
+ Single = 1,
+ Continuous = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ThemeSizeType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ThemeSizeType.cs
new file mode 100644
index 0000000..46175dd
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ThemeSizeType.cs
@@ -0,0 +1,37 @@
+//
+// ThemeSizeType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ThemeSizeType
+ {
+ Minimum = 0,
+ True = 1,
+ Draw = 2
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/ToolBarState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/ToolBarState.cs
new file mode 100644
index 0000000..b38c7df
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/ToolBarState.cs
@@ -0,0 +1,40 @@
+//
+// ToolBarState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum ToolBarState
+ {
+ Normal = 1,
+ Hot = 2,
+ Pressed = 3,
+ Disabled = 4,
+ Checked = 5,
+ HotChecked = 6
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TrackBarThumbState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TrackBarThumbState.cs
new file mode 100644
index 0000000..fd45443
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TrackBarThumbState.cs
@@ -0,0 +1,38 @@
+//
+// TrackBarThumbState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TrackBarThumbState
+ {
+ Normal = 1,
+ Hot = 2,
+ Pressed = 3,
+ Disabled = 5
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/TrueSizeScalingType.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/TrueSizeScalingType.cs
new file mode 100644
index 0000000..09126ff
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/TrueSizeScalingType.cs
@@ -0,0 +1,37 @@
+//
+// TrueSizeScalingType.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum TrueSizeScalingType
+ {
+ None = 0,
+ Size = 1,
+ Dpi = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/UXTheme.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/UXTheme.cs
new file mode 100644
index 0000000..1f88409
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/UXTheme.cs
@@ -0,0 +1,216 @@
+//
+// UXTheme.cs
+// - Internal class for P/Invokes to uxtheme.dll
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+using System.Runtime.InteropServices;
+using System.Drawing;
+using System.Text;
+using ShiftUI;
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ internal class UXTheme
+ {
+ #region DllImports
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 CloseThemeData (IntPtr hTheme);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeBackground (IntPtr hTheme, IntPtr hdc, int iPartId,
+ int iStateId, ref XplatUIWin32.RECT pRect, ref XplatUIWin32.RECT pClipRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeBackground (IntPtr hTheme, IntPtr hdc, int iPartId,
+ int iStateId, ref XplatUIWin32.RECT pRect, IntPtr pClipRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pDestRect, uint egde, uint flags, out XplatUIWin32.RECT pRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pDestRect, uint edge, uint flags, int pRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeIcon (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, IntPtr himl, int iImageIndex);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeParentBackground (IntPtr hWnd, IntPtr hdc, ref XplatUIWin32.RECT pRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeParentBackground (IntPtr hWnd, IntPtr hdc, int pRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 DrawThemeText (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, UInt32 textFlags2, ref XplatUIWin32.RECT pRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 EnableTheming (int fEnable);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public static extern IntPtr OpenThemeData (IntPtr hWnd, String classList);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeBackgroundContentRect (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pBoundingRect, out XplatUIWin32.RECT pContentRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeBackgroundExtent (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, ref XplatUIWin32.RECT pClipRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeBackgroundRegion (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, out IntPtr pRegion);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeBool (IntPtr hTheme, int iPartId, int iStateId, int iPropId, out int pfVal);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeColor (IntPtr hTheme, int iPartId, int iStateId, int iPropId, out Int32 pColor);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, int iPropId, out int piVal);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeFilename (IntPtr hTheme, int iPartId, int iStateId, int iPropId, [MarshalAs (UnmanagedType.LPWStr)] System.Text.StringBuilder themeFileName, int themeFileNameLength);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeFont (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, int iPropId, [MarshalAs (UnmanagedType.LPStruct)] out LOGFONT lf);
+
+ [DllImport ("gdi32", CharSet = CharSet.Auto)]
+ public static extern IntPtr CreateFontIndirect ([In, MarshalAs (UnmanagedType.LPStruct)] LOGFONT lplf);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeInt (IntPtr hTheme, int iPartId, int iStateId, int iPropId, out int piVal);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeMargins (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, int iPropId, out XplatUIWin32.RECT prc, out MARGINS pMargins);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemePartSize (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, int eSize, out SIZE size);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemePartSize (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, IntPtr pRect, int eSize, out SIZE size);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemePosition (IntPtr hTheme, int iPartId, int iStateId, int iPropId, out POINT pPoint);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeString (IntPtr hTheme, int iPartId, int iStateId, int iPropId, [MarshalAs (UnmanagedType.LPWStr)] StringBuilder themeString, int themeStringLength);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeTextExtent (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int textFlags, ref XplatUIWin32.RECT boundingRect, out XplatUIWin32.RECT extentRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeTextExtent (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int textFlags, int boundingRect, out XplatUIWin32.RECT extentRect);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeTextMetrics (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, out XplatUIWin32.TEXTMETRIC textMetric);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 HitTestThemeBackground (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref XplatUIWin32.RECT pRect, IntPtr hrgn, POINT ptTest, out HitTestCode code);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static int IsThemeBackgroundPartiallyTransparent (IntPtr hTheme, int iPartId, int iStateId);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static bool IsThemePartDefined (IntPtr hTheme, int iPartId, int iStateId);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static bool IsThemeActive ();
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static bool IsAppThemed ();
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 HitTestThemeBackground (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref XplatUIWin32.RECT pRect, IntPtr hrgn, POINT ptTest, out int code);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeDocumentationProperty (String stringThemeName, String stringPropertyName, StringBuilder stringValue, int lengthValue);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetCurrentThemeName (StringBuilder stringThemeName, int lengthThemeName, StringBuilder stringColorName, int lengthColorName, StringBuilder stringSizeName, int lengthSizeName);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static UInt32 GetThemeSysColor (IntPtr hTheme, int iColorId);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static Int32 GetThemeSysInt (IntPtr hTheme, int iIntId, out int piVal);
+
+ [DllImport ("uxtheme", ExactSpelling = true, CharSet = CharSet.Unicode)]
+ public extern static int GetThemeSysBool (IntPtr hTheme, int iBoolId);
+ #endregion
+
+ #region LOGFONT Type
+ [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public class LOGFONT
+ {
+ public int lfHeight = 0;
+ public int lfWidth = 0;
+ public int lfEscapement = 0;
+ public int lfOrientation = 0;
+ public int lfWeight = 0;
+ public byte lfItalic = 0;
+ public byte lfUnderline = 0;
+ public byte lfStrikeOut = 0;
+ public byte lfCharSet = 0;
+ public byte lfOutPrecision = 0;
+ public byte lfClipPrecision = 0;
+ public byte lfQuality = 0;
+ public byte lfPitchAndFamily = 0;
+ [MarshalAs (UnmanagedType.ByValTStr, SizeConst = 32)]
+ public string lfFaceName = string.Empty;
+ }
+ #endregion
+
+ #region MARGINS Type
+ [StructLayout (LayoutKind.Sequential)]
+ public struct MARGINS
+ {
+ public int leftWidth;
+ public int rightWidth;
+ public int topHeight;
+ public int bottomHeight;
+
+ public Padding ToPadding ()
+ {
+ return new Padding (leftWidth, topHeight, rightWidth, bottomHeight);
+ }
+ }
+ #endregion
+
+ #region SIZE Type
+ [StructLayout (LayoutKind.Sequential)]
+ public struct SIZE
+ {
+ public int cx;
+ public int cy;
+
+ public Size ToSize ()
+ {
+ return new Size (cx, cy);
+ }
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VerticalAlignment.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VerticalAlignment.cs
new file mode 100644
index 0000000..b1862f4
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VerticalAlignment.cs
@@ -0,0 +1,37 @@
+//
+// VerticalAlignment.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum VerticalAlignment
+ {
+ Top = 0,
+ Center = 1,
+ Bottom = 2
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleElement.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleElement.cs
new file mode 100644
index 0000000..4e79689
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleElement.cs
@@ -0,0 +1,2714 @@
+//
+// VisualStyleElement.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public class VisualStyleElement
+ {
+ #region Private Variables
+ #region Class name/part/state constants
+ private const string BUTTON = "BUTTON";
+ private const string CLOCK = "CLOCK";
+ private const string COMBOBOX = "COMBOBOX";
+ #region DATEPICKER
+ const string DATEPICKER = "DATEPICKER";
+ enum DATEPICKERPARTS
+ {
+ DP_DATEBORDER = 2,
+ DP_SHOWCALENDARBUTTONRIGHT
+ }
+ enum DATEBORDERSTATES
+ {
+ DPDB_NORMAL = 1,
+ DPDB_HOT,
+ DPDB_FOCUSED,
+ DPDB_DISABLED
+ }
+ enum SHOWCALENDARBUTTONRIGHTSTATES
+ {
+ DPSCBR_NORMAL = 1,
+ DPSCBR_HOT,
+ DPSCBR_PRESSED,
+ DPSCBR_DISABLED
+ }
+ #endregion
+ private const string EDIT = "EDIT";
+ private const string EXPLORERBAR = "EXPLORERBAR";
+ private const string HEADER = "HEADER";
+ private const string LISTVIEW = "LISTVIEW";
+ private const string MENU = "MENU";
+ private const string MENUBAND = "MENUBAND";
+ private const string PAGE = "PAGE";
+ private const string PROGRESS = "PROGRESS";
+ private const string REBAR = "REBAR";
+ private const string SCROLLBAR = "SCROLLBAR";
+ private const string SPIN = "SPIN";
+ private const string STARTPANEL = "STARTPANEL";
+ private const string STATUS = "STATUS";
+ private const string TAB = "TAB";
+ private const string TASKBAND = "TASKBAND";
+ private const string TASKBAR = "TASKBAR";
+ private const string TOOLBAR = "TOOLBAR";
+ private const string TOOLTIP = "TOOLTIP";
+ private const string TRACKBAR = "TRACKBAR";
+ private const string TRAYNOTIFY = "TRAYNOTIFY";
+ private const string TREEVIEW = "TREEVIEW";
+ private const string WINDOW = "WINDOW";
+ #endregion
+
+ private string class_name;
+ private int part;
+ private int state;
+ #endregion
+
+ #region Constructors/Deconstructors
+ internal VisualStyleElement (string className, int part, int state)
+ {
+ this.class_name = className;
+ this.part = part;
+ this.state = state;
+ }
+ #endregion
+
+ #region Public Instance Properties
+ public string ClassName { get { return this.class_name; } }
+ public int Part { get { return this.part; } }
+ public int State { get { return this.state; } }
+ #endregion
+
+ #region Public Static Methods
+ public static VisualStyleElement CreateElement (string className, int part, int state)
+ {
+ return new VisualStyleElement (className, part, state);
+ }
+ #endregion
+
+ #region Static Classes
+ #region Button
+ public static class Button
+ {
+ public static class CheckBox
+ {
+ public static VisualStyleElement CheckedDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_CHECKEDDISABLED);
+ }
+ }
+ public static VisualStyleElement CheckedHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_CHECKEDHOT);
+ }
+ }
+ public static VisualStyleElement CheckedNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_CHECKEDNORMAL);
+ }
+ }
+ public static VisualStyleElement CheckedPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_CHECKEDPRESSED);
+ }
+ }
+ public static VisualStyleElement MixedDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_MIXEDDISABLED);
+ }
+ }
+ public static VisualStyleElement MixedHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_MIXEDHOT);
+ }
+ }
+ public static VisualStyleElement MixedNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_MIXEDNORMAL);
+ }
+ }
+ public static VisualStyleElement MixedPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_MIXEDPRESSED);
+ }
+ }
+ public static VisualStyleElement UncheckedDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_UNCHECKEDDISABLED);
+ }
+ }
+ public static VisualStyleElement UncheckedHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_UNCHECKEDHOT);
+ }
+ }
+ public static VisualStyleElement UncheckedNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_UNCHECKEDNORMAL);
+ }
+ }
+ public static VisualStyleElement UncheckedPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_CHECKBOX,
+ (int)CHECKBOXSTATES.CBS_UNCHECKEDPRESSED);
+ }
+ }
+ }
+ public static class GroupBox
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_GROUPBOX,
+ (int)GROUPBOXSTATES.GBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_GROUPBOX,
+ (int)GROUPBOXSTATES.GBS_NORMAL);
+ }
+ }
+ }
+ public static class PushButton
+ {
+ public static VisualStyleElement Default {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_PUSHBUTTON,
+ (int)PUSHBUTTONSTATES.PBS_DEFAULTED);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_PUSHBUTTON,
+ (int)PUSHBUTTONSTATES.PBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_PUSHBUTTON,
+ (int)PUSHBUTTONSTATES.PBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_PUSHBUTTON,
+ (int)PUSHBUTTONSTATES.PBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_PUSHBUTTON,
+ (int)PUSHBUTTONSTATES.PBS_PRESSED);
+ }
+ }
+ }
+ public static class RadioButton
+ {
+ public static VisualStyleElement CheckedDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_CHECKEDDISABLED);
+ }
+ }
+ public static VisualStyleElement CheckedHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_CHECKEDHOT);
+ }
+ }
+ public static VisualStyleElement CheckedNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_CHECKEDNORMAL);
+ }
+ }
+ public static VisualStyleElement CheckedPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_CHECKEDPRESSED);
+ }
+ }
+ public static VisualStyleElement UncheckedDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_UNCHECKEDDISABLED);
+ }
+ }
+ public static VisualStyleElement UncheckedHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_UNCHECKEDHOT);
+ }
+ }
+ public static VisualStyleElement UncheckedNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_UNCHECKEDNORMAL);
+ }
+ }
+ public static VisualStyleElement UncheckedPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ BUTTON,
+ (int)BUTTONPARTS.BP_RADIOBUTTON,
+ (int)RADIOBUTTONSTATES.RBS_UNCHECKEDPRESSED);
+ }
+ }
+ }
+ public static class UserButton
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.BUTTON, 5, 0); } }
+ }
+ }
+ #endregion
+ #region ComboBox
+ public static class ComboBox
+ {
+ public static class DropDownButton
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_DROPDOWNBUTTON,
+ (int)COMBOBOXSTYLESTATES.CBXS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_DROPDOWNBUTTON,
+ (int)COMBOBOXSTYLESTATES.CBXS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_DROPDOWNBUTTON,
+ (int)COMBOBOXSTYLESTATES.CBXS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_DROPDOWNBUTTON,
+ (int)COMBOBOXSTYLESTATES.CBXS_PRESSED);
+ }
+ }
+ }
+ internal static class Border
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return new VisualStyleElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_BORDER,
+ (int)BORDERSTATES.CBB_NORMAL);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return new VisualStyleElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_BORDER,
+ (int)BORDERSTATES.CBB_HOT);
+ }
+ }
+ public static VisualStyleElement Focused {
+ get {
+ return new VisualStyleElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_BORDER,
+ (int)BORDERSTATES.CBB_FOCUSED);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return new VisualStyleElement (
+ COMBOBOX,
+ (int)COMBOBOXPARTS.CP_BORDER,
+ (int)BORDERSTATES.CBB_DISABLED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region DatePicker
+ internal static class DatePicker
+ {
+ public static class DateBorder
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_DATEBORDER,
+ (int)DATEBORDERSTATES.DPDB_NORMAL);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_DATEBORDER,
+ (int)DATEBORDERSTATES.DPDB_HOT);
+ }
+ }
+ public static VisualStyleElement Focused {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_DATEBORDER,
+ (int)DATEBORDERSTATES.DPDB_FOCUSED);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_DATEBORDER,
+ (int)DATEBORDERSTATES.DPDB_DISABLED);
+ }
+ }
+ }
+ public static class ShowCalendarButtonRight
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_SHOWCALENDARBUTTONRIGHT,
+ (int)SHOWCALENDARBUTTONRIGHTSTATES.DPSCBR_NORMAL);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_SHOWCALENDARBUTTONRIGHT,
+ (int)SHOWCALENDARBUTTONRIGHTSTATES.DPSCBR_HOT);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_SHOWCALENDARBUTTONRIGHT,
+ (int)SHOWCALENDARBUTTONRIGHTSTATES.DPSCBR_PRESSED);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return new VisualStyleElement (
+ DATEPICKER,
+ (int)DATEPICKERPARTS.DP_SHOWCALENDARBUTTONRIGHT,
+ (int)SHOWCALENDARBUTTONRIGHTSTATES.DPSCBR_DISABLED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region ExplorerBar
+ public static class ExplorerBar
+ {
+ public static class HeaderBackground
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 1, 0); } }
+ }
+ public static class HeaderClose
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 2, 1); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 2, 2); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 2, 3); } }
+ }
+ public static class HeaderPin
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 3); } }
+ public static VisualStyleElement SelectedHot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 5); } }
+ public static VisualStyleElement SelectedNormal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 4); } }
+ public static VisualStyleElement SelectedPressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 3, 6); } }
+ }
+ public static class IEBarMenu
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 4, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 4, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 4, 3); } }
+ }
+ public static class NormalGroupBackground
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 5, 0); } }
+ }
+ public static class NormalGroupCollapse
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 6, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 6, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 6, 3); } }
+ }
+ public static class NormalGroupExpand
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 7, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 7, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 7, 3); } }
+ }
+ public static class NormalGroupHead
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 8, 0); } }
+ }
+ public static class SpecialGroupBackground
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 9, 0); } }
+ }
+ public static class SpecialGroupCollapse
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 10, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 10, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 10, 3); } }
+ }
+ public static class SpecialGroupExpand
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 11, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 11, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 11, 3); } }
+ }
+ public static class SpecialGroupHead
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EXPLORERBAR, 12, 0); } }
+ }
+ }
+ #endregion
+ #region Header
+ public static class Header
+ {
+ public static class Item
+ {
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ HEADER,
+ (int)HEADERPARTS.HP_HEADERITEM,
+ (int)HEADERITEMSTATES.HIS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ HEADER,
+ (int)HEADERPARTS.HP_HEADERITEM,
+ (int)HEADERITEMSTATES.HIS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ HEADER,
+ (int)HEADERPARTS.HP_HEADERITEM,
+ (int)HEADERITEMSTATES.HIS_PRESSED);
+ }
+ }
+ }
+ public static class ItemLeft
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 2, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 2, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 2, 3); } }
+ }
+ public static class ItemRight
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 3, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 3, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 3, 3); } }
+ }
+ public static class SortArrow
+ {
+ public static VisualStyleElement SortedDown { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 4, 2); } }
+ public static VisualStyleElement SortedUp { get { return VisualStyleElement.CreateElement (VisualStyleElement.HEADER, 4, 1); } }
+ }
+ }
+ #endregion
+ #region ListView
+ public static class ListView
+ {
+ public static class Detail
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 3, 0); } }
+ }
+ public static class EmptyText
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 5, 0); } }
+ }
+ public static class Group
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 2, 0); } }
+ }
+ public static class Item
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 1, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 1, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 1, 1); } }
+ public static VisualStyleElement Selected { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 1, 3); } }
+ public static VisualStyleElement SelectedNotFocus { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 1, 5); } }
+ }
+ public static class SortedDetail
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.LISTVIEW, 4, 0); } }
+ }
+ }
+ #endregion
+ #region Menu
+ public static class Menu
+ {
+ public static class BarDropDown
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 4, 0); } }
+ }
+ public static class BarItem
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 3, 0); } }
+ }
+ public static class Chevron
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 5, 0); } }
+ }
+ public static class DropDown
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 2, 0); } }
+ }
+ public static class Item
+ {
+ public static VisualStyleElement Demoted { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 1, 3); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 1, 1); } }
+ public static VisualStyleElement Selected { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 1, 2); } }
+ }
+ public static class Separator
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENU, 6, 0); } }
+ }
+ }
+ #endregion
+ #region MenuBand
+ public static class MenuBand
+ {
+ public static class NewApplicationButton
+ {
+ public static VisualStyleElement Checked { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 5); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 2); } }
+ public static VisualStyleElement HotChecked { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 6); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 1, 3); } }
+ }
+ public static class Separator
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.MENUBAND, 2, 0); } }
+ }
+ }
+ #endregion
+ #region Page
+ public static class Page
+ {
+ public static class Down
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 2, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 2, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 2, 3); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 2, 1); } }
+ }
+ public static class DownHorizontal
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 4, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 4, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 4, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 4, 3); } }
+ }
+ public static class Up
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 1, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 1, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 1, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 1, 3); } }
+ }
+ public static class UpHorizontal
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 3, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 3, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 3, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.PAGE, 3, 3); } }
+ }
+ }
+ #endregion
+ #region ProgressBar
+ public static class ProgressBar
+ {
+ public static class Bar
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ PROGRESS,
+ (int)PROGRESSPARTS.PP_BAR,
+ 0);
+ }
+ }
+ }
+ public static class BarVertical
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ PROGRESS,
+ (int)PROGRESSPARTS.PP_BARVERT,
+ 0);
+ }
+ }
+ }
+ public static class Chunk
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ PROGRESS,
+ (int)PROGRESSPARTS.PP_CHUNK,
+ 0);
+ }
+ }
+ }
+ public static class ChunkVertical
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ PROGRESS,
+ (int)PROGRESSPARTS.PP_CHUNKVERT,
+ 0);
+ }
+ }
+ }
+ }
+ #endregion
+ #region Rebar
+ public static class Rebar
+ {
+ public static class Band
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ REBAR,
+ (int)REBARPARTS.RP_BAND,
+ 0);
+ }
+ }
+ }
+ public static class Chevron
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 4, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 4, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 4, 3); } }
+ }
+ public static class ChevronVertical
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 5, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 5, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 5, 3); } }
+ }
+ public static class Gripper
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 1, 0); } }
+ }
+ public static class GripperVertical
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.REBAR, 2, 0); } }
+ }
+ }
+ #endregion
+ #region ScrollBar
+ public static class ScrollBar
+ {
+ public static class ArrowButton
+ {
+ public static VisualStyleElement DownDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_DOWNDISABLED);
+ }
+ }
+ public static VisualStyleElement DownHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_DOWNHOT);
+ }
+ }
+ public static VisualStyleElement DownNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_DOWNNORMAL);
+ }
+ }
+ public static VisualStyleElement DownPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_DOWNPRESSED);
+ }
+ }
+ public static VisualStyleElement LeftDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_LEFTDISABLED);
+ }
+ }
+ public static VisualStyleElement LeftHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_LEFTHOT);
+ }
+ }
+ public static VisualStyleElement LeftNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_LEFTNORMAL);
+ }
+ }
+ public static VisualStyleElement LeftPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_LEFTPRESSED);
+ }
+ }
+ public static VisualStyleElement RightDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_RIGHTDISABLED);
+ }
+ }
+ public static VisualStyleElement RightHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_RIGHTHOT);
+ }
+ }
+ public static VisualStyleElement RightNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_RIGHTNORMAL);
+ }
+ }
+ public static VisualStyleElement RightPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_RIGHTPRESSED);
+ }
+ }
+ public static VisualStyleElement UpDisabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_UPDISABLED);
+ }
+ }
+ public static VisualStyleElement UpHot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_UPHOT);
+ }
+ }
+ public static VisualStyleElement UpNormal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_UPNORMAL);
+ }
+ }
+ public static VisualStyleElement UpPressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_UPPRESSED);
+ }
+ }
+ internal static VisualStyleElement DownHover {
+ get {
+ return new VisualStyleElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_DOWNHOVER);
+ }
+ }
+ internal static VisualStyleElement LeftHover {
+ get {
+ return new VisualStyleElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_LEFTHOVER);
+ }
+ }
+ internal static VisualStyleElement RightHover {
+ get {
+ return new VisualStyleElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_RIGHTHOVER);
+ }
+ }
+ internal static VisualStyleElement UpHover {
+ get {
+ return new VisualStyleElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_ARROWBTN,
+ (int)ARROWBTNSTATES.ABS_UPHOVER);
+ }
+ }
+ }
+ public static class GripperHorizontal
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_GRIPPERHORZ,
+ 0);
+ }
+ }
+ }
+ public static class GripperVertical
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ VisualStyleElement.SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_GRIPPERVERT,
+ 0);
+ }
+ }
+ }
+ public static class LeftTrackHorizontal
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ public static class LowerTrackVertical
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ public static class RightTrackHorizontal
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_LOWERTRACKHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ public static class SizeBox
+ {
+ public static VisualStyleElement LeftAlign {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_SIZEBOX,
+ (int)SIZEBOXSTATES.SZB_LEFTALIGN);
+ }
+ }
+ public static VisualStyleElement RightAlign {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_SIZEBOX,
+ (int)SIZEBOXSTATES.SZB_RIGHTALIGN);
+ }
+ }
+ }
+ public static class ThumbButtonHorizontal
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNHORZ,
+ 1);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNHORZ,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ public static class ThumbButtonVertical
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_THUMBBTNVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ public static class UpperTrackVertical
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SCROLLBAR,
+ (int)SCROLLBARPARTS.SBP_UPPERTRACKVERT,
+ (int)SCROLLBARSTYLESTATES.SCRBS_PRESSED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region Spin
+ public static class Spin
+ {
+ public static class Down
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWN,
+ (int)DOWNSTATES.DNS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWN,
+ (int)DOWNSTATES.DNS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWN,
+ (int)DOWNSTATES.DNS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWN,
+ (int)DOWNSTATES.DNS_PRESSED);
+ }
+ }
+ }
+ public static class DownHorizontal
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWNHORZ,
+ (int)DOWNHORZSTATES.DNHZS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWNHORZ,
+ (int)DOWNHORZSTATES.DNHZS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWNHORZ,
+ (int)DOWNHORZSTATES.DNHZS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_DOWNHORZ,
+ (int)DOWNHORZSTATES.DNHZS_PRESSED);
+ }
+ }
+ }
+ public static class Up
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UP,
+ (int)UPSTATES.UPS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UP,
+ (int)UPSTATES.UPS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UP,
+ (int)UPSTATES.UPS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UP,
+ (int)UPSTATES.UPS_PRESSED);
+ }
+ }
+ }
+ public static class UpHorizontal
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UPHORZ,
+ (int)UPHORZSTATES.UPHZS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UPHORZ,
+ (int)UPHORZSTATES.UPHZS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UPHORZ,
+ (int)UPHORZSTATES.UPHZS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ SPIN,
+ (int)SPINPARTS.SPNP_UPHORZ,
+ (int)UPHORZSTATES.UPHZS_PRESSED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region StartPanel
+ public static class StartPanel
+ {
+ public static class LogOff
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 8, 0); } }
+ }
+ public static class LogOffButtons
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 9, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 9, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 9, 3); } }
+ }
+ public static class MorePrograms
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 2, 0); } }
+ }
+ public static class MoreProgramsArrow
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 3, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 3, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 3, 3); } }
+ }
+ public static class PlaceList
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 6, 0); } }
+ }
+ public static class PlaceListSeparator
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 7, 0); } }
+ }
+ public static class Preview
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 11, 0); } }
+ }
+ public static class ProgList
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 4, 0); } }
+ }
+ public static class ProgListSeparator
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 5, 0); } }
+ }
+ public static class UserPane
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 1, 0); } }
+ }
+ public static class UserPicture
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STARTPANEL, 10, 0); } }
+ }
+ }
+ #endregion
+ #region Status
+ public static class Status
+ {
+ public static class Bar
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STATUS, 0, 0); } }
+ }
+ public static class Gripper
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ STATUS,
+ (int)STATUSPARTS.SP_GRIPPER,
+ 0);
+ }
+ }
+ }
+ public static class GripperPane
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STATUS, 2, 0); } }
+ }
+ public static class Pane
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.STATUS, 1, 0); } }
+ }
+ }
+ #endregion
+ #region Tab
+ public static class Tab
+ {
+ public static class Body
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_BODY,
+ 0);
+ }
+ }
+ }
+ public static class Pane
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_PANE,
+ 0);
+ }
+ }
+ }
+ public static class TabItem
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEM,
+ (int)TABITEMSTATES.TIS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEM,
+ (int)TABITEMSTATES.TIS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEM,
+ (int)TABITEMSTATES.TIS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEM,
+ (int)TABITEMSTATES.TIS_SELECTED);
+ }
+ }
+ }
+ public static class TabItemBothEdges
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMBOTHEDGE,
+ 0);
+ }
+ }
+ }
+ public static class TabItemLeftEdge
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMLEFTEDGE,
+ (int)TABITEMLEFTEDGESTATES.TILES_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMLEFTEDGE,
+ (int)TABITEMLEFTEDGESTATES.TILES_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMLEFTEDGE,
+ (int)TABITEMLEFTEDGESTATES.TILES_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMLEFTEDGE,
+ (int)TABITEMLEFTEDGESTATES.TILES_SELECTED);
+ }
+ }
+ }
+ public static class TabItemRightEdge
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMRIGHTEDGE,
+ (int)TABITEMRIGHTEDGESTATES.TIRES_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMRIGHTEDGE,
+ (int)TABITEMRIGHTEDGESTATES.TIRES_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMRIGHTEDGE,
+ (int)TABITEMRIGHTEDGESTATES.TIRES_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TABITEMRIGHTEDGE,
+ (int)TABITEMRIGHTEDGESTATES.TIRES_SELECTED);
+ }
+ }
+ }
+ public static class TopTabItem
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEM,
+ (int)TOPTABITEMSTATES.TTIS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEM,
+ (int)TOPTABITEMSTATES.TTIS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEM,
+ (int)TOPTABITEMSTATES.TTIS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEM,
+ (int)TOPTABITEMSTATES.TTIS_SELECTED);
+ }
+ }
+ }
+ public static class TopTabItemBothEdges
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMBOTHEDGE,
+ 0);
+ }
+ }
+ }
+ public static class TopTabItemLeftEdge
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMLEFTEDGE,
+ (int)TOPTABITEMLEFTEDGESTATES.TTILES_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMLEFTEDGE,
+ (int)TOPTABITEMLEFTEDGESTATES.TTILES_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMLEFTEDGE,
+ (int)TOPTABITEMLEFTEDGESTATES.TTILES_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMLEFTEDGE,
+ (int)TOPTABITEMLEFTEDGESTATES.TTILES_SELECTED);
+ }
+ }
+ }
+ public static class TopTabItemRightEdge
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMRIGHTEDGE,
+ (int)TOPTABITEMRIGHTEDGESTATES.TTIRES_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMRIGHTEDGE,
+ (int)TOPTABITEMRIGHTEDGESTATES.TTIRES_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMRIGHTEDGE,
+ (int)TOPTABITEMRIGHTEDGESTATES.TTIRES_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TAB,
+ (int)TABPARTS.TABP_TOPTABITEMRIGHTEDGE,
+ (int)TOPTABITEMRIGHTEDGESTATES.TTIRES_SELECTED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region TaskBand
+ public static class TaskBand
+ {
+ public static class FlashButton
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAND, 2, 0); } }
+ }
+ public static class FlashButtonGroupMenu
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAND, 3, 0); } }
+ }
+ public static class GroupCount
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAND, 1, 0); } }
+ }
+ }
+ #endregion
+ #region TaskBar
+ public static class Taskbar
+ {
+ public static class BackgroundBottom
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 1, 0); } }
+ }
+ public static class BackgroundLeft
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 4, 0); } }
+ }
+ public static class BackgroundRight
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 2, 0); } }
+ }
+ public static class BackgroundTop
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 3, 0); } }
+ }
+ public static class SizingBarBottom
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 5, 0); } }
+ }
+ public static class SizingBarLeft
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 8, 0); } }
+ }
+ public static class SizingBarRight
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 6, 0); } }
+ }
+ public static class SizingBarTop
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TASKBAR, 7, 0); } }
+ }
+ }
+ #endregion
+ #region TaskBarClock
+ public static class TaskbarClock
+ {
+ public static class Time
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.CLOCK, 1, 1); } }
+ }
+ }
+ #endregion
+ #region TextBox
+ public static class TextBox
+ {
+ public static class Caret
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.EDIT, 2, 0); } }
+ }
+ public static class TextEdit
+ {
+ public static VisualStyleElement Assist {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_ASSIST);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Focused {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_FOCUSED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_NORMAL);
+ }
+ }
+ public static VisualStyleElement ReadOnly {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_READONLY);
+ }
+ }
+ public static VisualStyleElement Selected {
+ get {
+ return VisualStyleElement.CreateElement (
+ EDIT,
+ (int)EDITPARTS.EP_EDITTEXT,
+ (int)EDITTEXTSTATES.ETS_SELECTED);
+ }
+ }
+ }
+ }
+ #endregion
+ #region ToolBar
+ public static class ToolBar
+ {
+ public static class Button
+ {
+ public static VisualStyleElement Checked {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_CHECKED);
+ }
+ }
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_HOT);
+ }
+ }
+ public static VisualStyleElement HotChecked {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_HOTCHECKED);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TOOLBAR,
+ (int)TOOLBARPARTS.TP_BUTTON,
+ (int)TOOLBARSTYLESTATES.TS_PRESSED);
+ }
+ }
+ }
+ public static class DropDownButton
+ {
+ public static VisualStyleElement Checked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 5); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 2); } }
+ public static VisualStyleElement HotChecked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 6); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 2, 3); } }
+ }
+ public static class SeparatorHorizontal
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 5, 0); } }
+ }
+ public static class SeparatorVertical
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 6, 0); } }
+ }
+ public static class SplitButton
+ {
+ public static VisualStyleElement Checked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 5); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 2); } }
+ public static VisualStyleElement HotChecked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 6); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 3, 3); } }
+ }
+ public static class SplitButtonDropDown
+ {
+ public static VisualStyleElement Checked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 5); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 2); } }
+ public static VisualStyleElement HotChecked { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 6); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLBAR, 4, 3); } }
+ }
+ }
+ #endregion
+ #region ToolTip
+ public static class ToolTip
+ {
+ public static class Balloon
+ {
+ public static VisualStyleElement Link { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 3, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 3, 1); } }
+ }
+ public static class BalloonTitle
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 4, 0); } }
+ }
+ public static class Close
+ {
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 5, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 5, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 5, 3); } }
+ }
+ public static class Standard
+ {
+ public static VisualStyleElement Link { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 1, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 1, 1); } }
+ }
+ public static class StandardTitle
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TOOLTIP, 2, 0); } }
+ }
+ }
+ #endregion
+ #region TrackBar
+ public static class TrackBar
+ {
+ public static class Thumb
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMB,
+ (int)THUMBSTATES.TUS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Focused {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMB,
+ (int)THUMBSTATES.TUS_FOCUSED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMB,
+ (int)THUMBSTATES.TUS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMB,
+ (int)THUMBSTATES.TUS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMB,
+ (int)THUMBSTATES.TUS_PRESSED);
+ }
+ }
+ }
+ public static class ThumbBottom
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 4, 5); } }
+ public static VisualStyleElement Focused { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 4, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 4, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 4, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 4, 3); } }
+ }
+ public static class ThumbLeft
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 7, 5); } }
+ public static VisualStyleElement Focused { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 7, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 7, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 7, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 7, 3); } }
+ }
+ public static class ThumbRight
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 8, 5); } }
+ public static VisualStyleElement Focused { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 8, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 8, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 8, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 8, 3); } }
+ }
+ public static class ThumbTop
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 5, 5); } }
+ public static VisualStyleElement Focused { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 5, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 5, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 5, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 5, 3); } }
+ }
+ public static class ThumbVertical
+ {
+ public static VisualStyleElement Disabled {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMBVERT,
+ (int)THUMBVERTSTATES.TUVS_DISABLED);
+ }
+ }
+ public static VisualStyleElement Focused {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMBVERT,
+ (int)THUMBVERTSTATES.TUVS_FOCUSED);
+ }
+ }
+ public static VisualStyleElement Hot {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMBVERT,
+ (int)THUMBVERTSTATES.TUVS_HOT);
+ }
+ }
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMBVERT,
+ (int)THUMBVERTSTATES.TUVS_NORMAL);
+ }
+ }
+ public static VisualStyleElement Pressed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_THUMBVERT,
+ (int)THUMBVERTSTATES.TUVS_PRESSED);
+ }
+ }
+ }
+ public static class Ticks
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 9, 1); } }
+ }
+ public static class TicksVertical
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRACKBAR, 10, 1); } }
+ }
+ public static class Track
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_TRACK,
+ (int)TRACKSTATES.TRS_NORMAL);
+ }
+ }
+ }
+ public static class TrackVertical
+ {
+ public static VisualStyleElement Normal {
+ get {
+ return VisualStyleElement.CreateElement (
+ TRACKBAR,
+ (int)TRACKBARPARTS.TKP_TRACKVERT,
+ (int)TRACKVERTSTATES.TRVS_NORMAL);
+ }
+ }
+ }
+ }
+ #endregion
+ #region TrayNotify
+ public static class TrayNotify
+ {
+ public static class AnimateBackground
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRAYNOTIFY, 2, 0); } }
+ }
+ public static class Background
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TRAYNOTIFY, 1, 0); } }
+ }
+ }
+ #endregion
+ #region TreeView
+ public static class TreeView
+ {
+ public static class Branch
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 3, 0); } }
+ }
+ public static class Glyph
+ {
+ public static VisualStyleElement Closed {
+ get {
+ return VisualStyleElement.CreateElement (
+ TREEVIEW,
+ (int)TREEVIEWPARTS.TVP_GLYPH,
+ (int)GLYPHSTATES.GLPS_CLOSED);
+ }
+ }
+ public static VisualStyleElement Opened {
+ get {
+ return VisualStyleElement.CreateElement (
+ TREEVIEW,
+ (int)TREEVIEWPARTS.TVP_GLYPH,
+ (int)GLYPHSTATES.GLPS_OPENED);
+ }
+ }
+ }
+ public static class Item
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 1, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 1, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 1, 1); } }
+ public static VisualStyleElement Selected { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 1, 3); } }
+ public static VisualStyleElement SelectedNotFocus { get { return VisualStyleElement.CreateElement (VisualStyleElement.TREEVIEW, 1, 5); } }
+ }
+ }
+ #endregion
+ #region Window
+ public static class Window
+ {
+ public static class Caption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 1, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 1, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 1, 2); } }
+ }
+ public static class CaptionSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 30, 0); } }
+ }
+ public static class CloseButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 18, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 18, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 18, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 18, 3); } }
+ }
+ public static class Dialog
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 29, 0); } }
+ }
+ public static class FrameBottom
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 9, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 9, 2); } }
+ }
+ public static class FrameBottomSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 36, 0); } }
+ }
+ public static class FrameLeft
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 7, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 7, 2); } }
+ }
+ public static class FrameLeftSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 32, 0); } }
+ }
+ public static class FrameRight
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 8, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 8, 2); } }
+ }
+ public static class FrameRightSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 34, 0); } }
+ }
+ public static class HelpButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 23, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 23, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 23, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 23, 3); } }
+ }
+ public static class HorizontalScroll
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 25, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 25, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 25, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 25, 3); } }
+ }
+ public static class HorizontalThumb
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 26, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 26, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 26, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 26, 3); } }
+ }
+ public static class MaxButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 17, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 17, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 17, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 17, 3); } }
+ }
+ public static class MaxCaption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 5, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 5, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 5, 2); } }
+ }
+ public static class MdiCloseButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 20, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 20, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 20, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 20, 3); } }
+ }
+ public static class MdiHelpButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 24, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 24, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 24, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 24, 3); } }
+ }
+ public static class MdiMinButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 16, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 16, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 16, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 16, 3); } }
+ }
+ public static class MdiRestoreButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 22, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 22, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 22, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 22, 3); } }
+ }
+ public static class MdiSysButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 14, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 14, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 14, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 14, 3); } }
+ }
+ public static class MinButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 15, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 15, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 15, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 15, 3); } }
+ }
+ public static class MinCaption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 3, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 3, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 3, 2); } }
+ }
+ public static class RestoreButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 21, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 21, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 21, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 21, 3); } }
+ }
+ public static class SmallCaption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 2, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 2, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 2, 2); } }
+ }
+ public static class SmallCaptionSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 31, 0); } }
+ }
+ public static class SmallCloseButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 19, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 19, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 19, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 19, 3); } }
+ }
+ public static class SmallFrameBottom
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 12, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 12, 2); } }
+ }
+ public static class SmallFrameBottomSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 37, 0); } }
+ }
+ public static class SmallFrameLeft
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 10, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 10, 2); } }
+ }
+ public static class SmallFrameLeftSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 33, 0); } }
+ }
+ public static class SmallFrameRight
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 11, 1); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 11, 2); } }
+ }
+ public static class SmallFrameRightSizingTemplate
+ {
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 35, 0); } }
+ }
+ public static class SmallMaxCaption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 6, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 6, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 6, 2); } }
+ }
+ public static class SmallMinCaption
+ {
+ public static VisualStyleElement Active { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 4, 1); } }
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 4, 3); } }
+ public static VisualStyleElement Inactive { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 4, 2); } }
+ }
+ public static class SysButton
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 13, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 13, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 13, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 13, 3); } }
+ }
+ public static class VerticalScroll
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 27, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 27, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 27, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 27, 3); } }
+ }
+ public static class VerticalThumb
+ {
+ public static VisualStyleElement Disabled { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 28, 4); } }
+ public static VisualStyleElement Hot { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 28, 2); } }
+ public static VisualStyleElement Normal { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 28, 1); } }
+ public static VisualStyleElement Pressed { get { return VisualStyleElement.CreateElement (VisualStyleElement.WINDOW, 28, 3); } }
+ }
+ }
+ #endregion
+ #endregion
+ }
+ #region Part and state constants
+ #region BUTTON
+ enum BUTTONPARTS
+ {
+ BP_PUSHBUTTON = 1,
+ BP_RADIOBUTTON,
+ BP_CHECKBOX,
+ BP_GROUPBOX
+ }
+ enum PUSHBUTTONSTATES
+ {
+ PBS_NORMAL = 1,
+ PBS_HOT,
+ PBS_PRESSED,
+ PBS_DISABLED,
+ PBS_DEFAULTED
+ }
+ enum RADIOBUTTONSTATES
+ {
+ RBS_UNCHECKEDNORMAL = 1,
+ RBS_UNCHECKEDHOT,
+ RBS_UNCHECKEDPRESSED,
+ RBS_UNCHECKEDDISABLED,
+ RBS_CHECKEDNORMAL,
+ RBS_CHECKEDHOT,
+ RBS_CHECKEDPRESSED,
+ RBS_CHECKEDDISABLED
+ }
+ enum CHECKBOXSTATES
+ {
+ CBS_UNCHECKEDNORMAL = 1,
+ CBS_UNCHECKEDHOT,
+ CBS_UNCHECKEDPRESSED,
+ CBS_UNCHECKEDDISABLED,
+ CBS_CHECKEDNORMAL,
+ CBS_CHECKEDHOT,
+ CBS_CHECKEDPRESSED,
+ CBS_CHECKEDDISABLED,
+ CBS_MIXEDNORMAL,
+ CBS_MIXEDHOT,
+ CBS_MIXEDPRESSED,
+ CBS_MIXEDDISABLED
+ }
+ enum GROUPBOXSTATES
+ {
+ GBS_NORMAL = 1,
+ GBS_DISABLED
+ }
+ #endregion
+ #region COMBOXBOX
+ enum COMBOBOXPARTS
+ {
+ CP_DROPDOWNBUTTON = 1,
+ CP_BORDER = 4
+ }
+ enum COMBOBOXSTYLESTATES
+ {
+ CBXS_NORMAL = 1,
+ CBXS_HOT,
+ CBXS_PRESSED,
+ CBXS_DISABLED
+ }
+ enum BORDERSTATES
+ {
+ CBB_NORMAL = 1,
+ CBB_HOT,
+ CBB_FOCUSED,
+ CBB_DISABLED
+ }
+ #endregion
+ #region EDIT
+ enum EDITPARTS
+ {
+ EP_EDITTEXT = 1
+ }
+ enum EDITTEXTSTATES {
+ ETS_NORMAL = 1,
+ ETS_HOT,
+ ETS_SELECTED,
+ ETS_DISABLED,
+ ETS_FOCUSED,
+ ETS_READONLY,
+ ETS_ASSIST
+ }
+ #endregion
+ #region HEADER
+ enum HEADERPARTS
+ {
+ HP_HEADERITEM = 1
+ }
+ enum HEADERITEMSTATES
+ {
+ HIS_NORMAL = 1,
+ HIS_HOT,
+ HIS_PRESSED
+ }
+ #endregion
+ #region PROGRESS
+ enum PROGRESSPARTS
+ {
+ PP_BAR = 1,
+ PP_BARVERT,
+ PP_CHUNK,
+ PP_CHUNKVERT
+ }
+ #endregion
+ #region REBAR
+ enum REBARPARTS
+ {
+ RP_BAND = 3
+ }
+ #endregion
+ #region SCROLLBAR
+ enum SCROLLBARPARTS
+ {
+ SBP_ARROWBTN = 1,
+ SBP_THUMBBTNHORZ,
+ SBP_THUMBBTNVERT,
+ SBP_LOWERTRACKHORZ,
+ SBP_UPPERTRACKHORZ,
+ SBP_LOWERTRACKVERT,
+ SBP_UPPERTRACKVERT,
+ SBP_GRIPPERHORZ,
+ SBP_GRIPPERVERT,
+ SBP_SIZEBOX
+ }
+ enum ARROWBTNSTATES
+ {
+ ABS_UPNORMAL = 1,
+ ABS_UPHOT,
+ ABS_UPPRESSED,
+ ABS_UPDISABLED,
+ ABS_DOWNNORMAL,
+ ABS_DOWNHOT,
+ ABS_DOWNPRESSED,
+ ABS_DOWNDISABLED,
+ ABS_LEFTNORMAL,
+ ABS_LEFTHOT,
+ ABS_LEFTPRESSED,
+ ABS_LEFTDISABLED,
+ ABS_RIGHTNORMAL,
+ ABS_RIGHTHOT,
+ ABS_RIGHTPRESSED,
+ ABS_RIGHTDISABLED,
+ ABS_UPHOVER,
+ ABS_DOWNHOVER,
+ ABS_LEFTHOVER,
+ ABS_RIGHTHOVER
+ }
+ enum SCROLLBARSTYLESTATES
+ {
+ SCRBS_NORMAL = 1,
+ SCRBS_HOT,
+ SCRBS_PRESSED,
+ SCRBS_DISABLED
+ }
+ enum SIZEBOXSTATES
+ {
+ SZB_RIGHTALIGN = 1,
+ SZB_LEFTALIGN
+ }
+ #endregion
+ #region SPIN
+ enum SPINPARTS
+ {
+ SPNP_UP = 1,
+ SPNP_DOWN,
+ SPNP_UPHORZ,
+ SPNP_DOWNHORZ
+ }
+ enum UPSTATES
+ {
+ UPS_NORMAL = 1,
+ UPS_HOT,
+ UPS_PRESSED,
+ UPS_DISABLED
+ }
+ enum DOWNSTATES
+ {
+ DNS_NORMAL = 1,
+ DNS_HOT,
+ DNS_PRESSED,
+ DNS_DISABLED
+ }
+ enum UPHORZSTATES
+ {
+ UPHZS_NORMAL = 1,
+ UPHZS_HOT,
+ UPHZS_PRESSED,
+ UPHZS_DISABLED
+ }
+ enum DOWNHORZSTATES
+ {
+ DNHZS_NORMAL = 1,
+ DNHZS_HOT,
+ DNHZS_PRESSED,
+ DNHZS_DISABLED
+ }
+ #endregion
+ #region STATUS
+ enum STATUSPARTS
+ {
+ SP_GRIPPER = 3
+ }
+ #endregion
+ #region TAB
+ enum TABPARTS
+ {
+ TABP_TABITEM = 1,
+ TABP_TABITEMLEFTEDGE,
+ TABP_TABITEMRIGHTEDGE,
+ TABP_TABITEMBOTHEDGE,
+ TABP_TOPTABITEM,
+ TABP_TOPTABITEMLEFTEDGE,
+ TABP_TOPTABITEMRIGHTEDGE,
+ TABP_TOPTABITEMBOTHEDGE,
+ TABP_PANE,
+ TABP_BODY
+ }
+ enum TABITEMSTATES
+ {
+ TIS_NORMAL = 1,
+ TIS_HOT,
+ TIS_SELECTED,
+ TIS_DISABLED
+ }
+ enum TABITEMLEFTEDGESTATES
+ {
+ TILES_NORMAL = 1,
+ TILES_HOT,
+ TILES_SELECTED,
+ TILES_DISABLED
+ }
+ enum TABITEMRIGHTEDGESTATES
+ {
+ TIRES_NORMAL = 1,
+ TIRES_HOT,
+ TIRES_SELECTED,
+ TIRES_DISABLED
+ }
+ enum TOPTABITEMSTATES
+ {
+ TTIS_NORMAL = 1,
+ TTIS_HOT,
+ TTIS_SELECTED,
+ TTIS_DISABLED
+ }
+ enum TOPTABITEMLEFTEDGESTATES
+ {
+ TTILES_NORMAL = 1,
+ TTILES_HOT,
+ TTILES_SELECTED,
+ TTILES_DISABLED
+ }
+ enum TOPTABITEMRIGHTEDGESTATES
+ {
+ TTIRES_NORMAL = 1,
+ TTIRES_HOT,
+ TTIRES_SELECTED,
+ TTIRES_DISABLED
+ }
+ #endregion
+ #region TOOLBAR
+ enum TOOLBARPARTS
+ {
+ TP_BUTTON = 1
+ }
+ enum TOOLBARSTYLESTATES
+ {
+ TS_NORMAL = 1,
+ TS_HOT,
+ TS_PRESSED,
+ TS_DISABLED,
+ TS_CHECKED,
+ TS_HOTCHECKED
+ }
+ #endregion
+ #region TRACKBAR
+ enum TRACKBARPARTS
+ {
+ TKP_TRACK = 1,
+ TKP_TRACKVERT,
+ TKP_THUMB,
+ TKP_THUMBVERT = 6
+ }
+ enum TRACKSTATES
+ {
+ TRS_NORMAL = 1
+ }
+ enum TRACKVERTSTATES
+ {
+ TRVS_NORMAL = 1
+ }
+ enum THUMBSTATES
+ {
+ TUS_NORMAL = 1,
+ TUS_HOT,
+ TUS_PRESSED,
+ TUS_FOCUSED,
+ TUS_DISABLED
+ }
+ enum THUMBVERTSTATES
+ {
+ TUVS_NORMAL = 1,
+ TUVS_HOT,
+ TUVS_PRESSED,
+ TUVS_FOCUSED,
+ TUVS_DISABLED
+ }
+ #endregion
+ #region TREEVIEW
+ enum TREEVIEWPARTS
+ {
+ TVP_GLYPH = 2
+ }
+ enum GLYPHSTATES
+ {
+ GLPS_CLOSED = 1,
+ GLPS_OPENED
+ }
+ #endregion
+ #endregion
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleInformation.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleInformation.cs
new file mode 100644
index 0000000..ae9bddb
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleInformation.cs
@@ -0,0 +1,180 @@
+//
+// VisualStyleInformation.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+using System.Drawing;
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ public static class VisualStyleInformation
+ {
+ #region Public Static Properties
+ public static string Author {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationAuthor;
+ }
+ }
+
+ public static string ColorScheme {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationColorScheme;
+ }
+ }
+
+ public static string Company {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationCompany;
+ }
+ }
+
+ [MonoTODO(@"Cannot get this to return the same as MS's...")]
+ public static Color WidgetHighlightHot {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return SystemColors.ButtonHighlight;
+
+ return VisualStyles.VisualStyleInformationWidgetHighlightHot;
+ }
+ }
+
+ public static string Copyright {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationCopyright;
+ }
+ }
+
+ public static string Description {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationDescription;
+ }
+ }
+
+ public static string DisplayName {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationDisplayName;
+ }
+ }
+
+ public static bool IsEnabledByUser {
+ get {
+ if (!VisualStyleInformation.IsSupportedByOS)
+ return false;
+
+ return (VisualStyles.UxThemeIsAppThemed () && VisualStyles.UxThemeIsThemeActive ());
+ }
+ }
+
+ public static bool IsSupportedByOS {
+ get {
+ return VisualStyles.VisualStyleInformationIsSupportedByOS;
+ }
+ }
+
+ public static int MinimumColorDepth {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return 0;
+
+ return VisualStyles.VisualStyleInformationMinimumColorDepth;
+ }
+ }
+
+ public static string Size {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationSize;
+ }
+ }
+
+ public static bool SupportsFlatMenus {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return false;
+
+ return VisualStyles.VisualStyleInformationSupportsFlatMenus;
+ }
+ }
+
+ [MonoTODO(@"Cannot get this to return the same as MS's...")]
+ public static Color TextWidgetBorder {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return SystemColors.ControlDarkDark;
+
+ return VisualStyles.VisualStyleInformationTextWidgetBorder;
+ }
+ }
+
+ public static string Url {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationUrl;
+ }
+ }
+
+ public static string Version {
+ get {
+ if (!VisualStyleRenderer.IsSupported)
+ return string.Empty;
+
+ return VisualStyles.VisualStyleInformationVersion;
+ }
+ }
+ #endregion
+
+ #region Private Static Properties
+ static IVisualStyles VisualStyles {
+ get {
+ return VisualStylesEngine.Instance;
+ }
+ }
+ #endregion
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
new file mode 100644
index 0000000..c49e213
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
@@ -0,0 +1,447 @@
+//
+// VisualStyleRenderer.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+using System.Drawing;
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ public sealed class VisualStyleRenderer
+ {
+ private string class_name;
+ private int part;
+ private int state;
+ private IntPtr theme;
+ private int last_hresult = 0;
+ private ThemeHandleManager theme_handle_manager = new ThemeHandleManager ();
+
+ #region Public Constructors
+ public VisualStyleRenderer (string className, int part, int state)
+ {
+ theme_handle_manager.VisualStyleRenderer = this;
+ this.SetParameters (className, part, state);
+ }
+
+ public VisualStyleRenderer (VisualStyleElement element)
+ : this (element.ClassName, element.Part, element.State) {
+ }
+ #endregion
+
+ #region Public Properties
+ public String Class { get { return this.class_name; } }
+ public IntPtr Handle { get { return this.theme; } }
+ public int LastHResult { get { return this.last_hresult; } }
+ public int Part { get { return this.part; } }
+ public int State { get { return this.state; } }
+
+ public static bool IsSupported {
+ get {
+ if (!VisualStyleInformation.IsEnabledByUser)
+ return false;
+
+ if (Application.VisualStyleState == VisualStyleState.ClientAndNonClientAreasEnabled ||
+ Application.VisualStyleState == VisualStyleState.ClientAreaEnabled)
+ return true;
+
+ return false;
+ }
+ }
+ #endregion
+
+ #region Public Static Methods
+ public static bool IsElementDefined (VisualStyleElement element)
+ {
+ if (!IsSupported)
+ throw new InvalidOperationException ("Visual Styles are not enabled.");
+
+ if (IsElementKnownToBeSupported (element.ClassName, element.Part, element.State))
+ return true;
+
+ IntPtr theme = VisualStyles.UxThemeOpenThemeData (IntPtr.Zero, element.ClassName);
+ if (theme == IntPtr.Zero)
+ return false;
+ bool retval = VisualStyles.UxThemeIsThemePartDefined (theme, element.Part);
+ VisualStyles.UxThemeCloseThemeData (theme);
+
+ return retval;
+ }
+ #endregion
+
+ #region Public Instance Methods
+ public void DrawBackground (IDeviceContext dc, Rectangle bounds)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ last_hresult = VisualStyles.UxThemeDrawThemeBackground (theme, dc, this.part, this.state, bounds);
+ }
+
+ public void DrawBackground (IDeviceContext dc, Rectangle bounds, Rectangle clipRectangle)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ last_hresult = VisualStyles.UxThemeDrawThemeBackground (theme, dc, this.part, this.state, bounds, clipRectangle);
+ }
+
+ public Rectangle DrawEdge (IDeviceContext dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Rectangle result;
+ last_hresult = VisualStyles.UxThemeDrawThemeEdge (theme, dc, this.part, this.state, bounds, edges, style, effects, out result);
+ return result;
+ }
+
+ public void DrawImage (Graphics g, Rectangle bounds, ImageList imageList, int imageIndex)
+ {
+ if (g == null)
+ throw new ArgumentNullException ("g");
+ if (imageIndex < 0 || imageIndex > imageList.Images.Count - 1)
+ throw new ArgumentOutOfRangeException ("imageIndex");
+ if (imageList.Images[imageIndex] == null)
+ throw new ArgumentNullException ("imageIndex");
+
+ g.DrawImage (imageList.Images[imageIndex], bounds);
+ }
+
+ public void DrawImage (Graphics g, Rectangle bounds, Image image)
+ {
+ if (g == null)
+ throw new ArgumentNullException ("g");
+ if (image == null)
+ throw new ArgumentNullException ("image");
+
+ g.DrawImage (image, bounds);
+ }
+
+ public void DrawParentBackground (IDeviceContext dc, Rectangle bounds, Widget childWidget)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ last_hresult = VisualStyles.UxThemeDrawThemeParentBackground (dc, bounds, childWidget);
+ }
+
+ public void DrawText (IDeviceContext dc, Rectangle bounds, string textToDraw, bool drawDisabled, TextFormatFlags flags)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ last_hresult = VisualStyles.UxThemeDrawThemeText (theme, dc, this.part, this.state, textToDraw, flags, bounds);
+ }
+
+ public void DrawText (IDeviceContext dc, Rectangle bounds, string textToDraw, bool drawDisabled)
+ {
+ this.DrawText (dc, bounds, textToDraw, drawDisabled, TextFormatFlags.Default);
+ }
+
+ public void DrawText (IDeviceContext dc, Rectangle bounds, string textToDraw)
+ {
+ this.DrawText (dc, bounds, textToDraw, false, TextFormatFlags.Default);
+ }
+
+ public Rectangle GetBackgroundContentRectangle (IDeviceContext dc, Rectangle bounds)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Rectangle result;
+ last_hresult = VisualStyles.UxThemeGetThemeBackgroundContentRect (theme, dc, this.part, this.state, bounds, out result);
+ return result;
+ }
+
+ public Rectangle GetBackgroundExtent (IDeviceContext dc, Rectangle contentBounds)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Rectangle result;
+ last_hresult = VisualStyles.UxThemeGetThemeBackgroundExtent (theme, dc, this.part, this.state, contentBounds, out result);
+ return result;
+ }
+
+ [System.Security.SuppressUnmanagedCodeSecurity]
+ public Region GetBackgroundRegion (IDeviceContext dc, Rectangle bounds)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Region result;
+ last_hresult = VisualStyles.UxThemeGetThemeBackgroundRegion (theme, dc, this.part, this.state, bounds, out result);
+ return result;
+ }
+
+ public bool GetBoolean (BooleanProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (BooleanProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (BooleanProperty));
+
+ bool result;
+ last_hresult = VisualStyles.UxThemeGetThemeBool (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ public Color GetColor (ColorProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (ColorProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (ColorProperty));
+
+ Color result;
+ last_hresult = VisualStyles.UxThemeGetThemeColor (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ public int GetEnumValue (EnumProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (EnumProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (EnumProperty));
+
+ int result;
+ last_hresult = VisualStyles.UxThemeGetThemeEnumValue (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ public string GetFilename (FilenameProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (FilenameProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (FilenameProperty));
+
+ string result;
+ last_hresult = VisualStyles.UxThemeGetThemeFilename (theme, this.part, this.state, prop, out result);
+ return result;
+
+ }
+
+ [MonoTODO(@"I can't get MS's to return anything but null, so I can't really get this one right")]
+ public Font GetFont (IDeviceContext dc, FontProperty prop)
+ {
+ throw new NotImplementedException();
+ //if (dc == null)
+ // throw new ArgumentNullException ("dc");
+ //if (!Enum.IsDefined (typeof (FontProperty), prop))
+ // throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (FontProperty));
+
+ //UXTheme.LOGFONT lf = new UXTheme.LOGFONT();
+
+ //UXTheme.GetThemeFont (theme, dc.GetHdc (), this.part, this.state, (int)prop, out lf);
+ //IntPtr fontPtr = UXTheme.CreateFontIndirect(lf);
+ //dc.ReleaseHdc();
+
+ //return Font.FromLogFont(lf);
+ //return null;
+ }
+
+ public int GetInteger (IntegerProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (IntegerProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (IntegerProperty));
+
+ int result;
+ last_hresult = VisualStyles.UxThemeGetThemeInt (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ [MonoTODO(@"MS's causes a PInvokeStackUnbalance on me, so this is not verified against MS.")]
+ public Padding GetMargins (IDeviceContext dc, MarginProperty prop)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+ if (!Enum.IsDefined (typeof (MarginProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (MarginProperty));
+
+ Padding result;
+ last_hresult = VisualStyles.UxThemeGetThemeMargins (theme, dc, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ public Size GetPartSize (IDeviceContext dc, Rectangle bounds, ThemeSizeType type)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+ if (!Enum.IsDefined (typeof (ThemeSizeType), type))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)type, typeof (ThemeSizeType));
+
+ Size result;
+ last_hresult = VisualStyles.UxThemeGetThemePartSize (theme, dc, this.part, this.state, bounds, type, out result);
+ return result;
+ }
+
+ public Size GetPartSize (IDeviceContext dc, ThemeSizeType type)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+ if (!Enum.IsDefined (typeof (ThemeSizeType), type))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)type, typeof (ThemeSizeType));
+
+ Size result;
+ last_hresult = VisualStyles.UxThemeGetThemePartSize (theme, dc, this.part, this.state, type, out result);
+ return result;
+ }
+
+ public Point GetPoint (PointProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (PointProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (PointProperty));
+
+ Point result;
+ last_hresult = VisualStyles.UxThemeGetThemePosition (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ [MonoTODO(@"Can't find any values that return anything on MS to test against")]
+ public string GetString (StringProperty prop)
+ {
+ if (!Enum.IsDefined (typeof (StringProperty), prop))
+ throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (StringProperty));
+
+ string result;
+ last_hresult = VisualStyles.UxThemeGetThemeString (theme, this.part, this.state, prop, out result);
+ return result;
+ }
+
+ public Rectangle GetTextExtent (IDeviceContext dc, Rectangle bounds, string textToDraw, TextFormatFlags flags)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Rectangle result;
+ last_hresult = VisualStyles.UxThemeGetThemeTextExtent (theme, dc, this.part, this.state, textToDraw, flags, bounds, out result);
+ return result;
+ }
+
+ public Rectangle GetTextExtent (IDeviceContext dc, string textToDraw, TextFormatFlags flags)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ Rectangle result;
+ last_hresult = VisualStyles.UxThemeGetThemeTextExtent (theme, dc, this.part, this.state, textToDraw, flags, out result);
+ return result;
+ }
+
+ public TextMetrics GetTextMetrics (IDeviceContext dc)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc", "dc cannot be null.");
+
+ TextMetrics result;
+ last_hresult = VisualStyles.UxThemeGetThemeTextMetrics (theme, dc, this.part, this.state, out result);
+ return result;
+ }
+
+ public HitTestCode HitTestBackground (IDeviceContext dc, Rectangle backgroundRectangle, IntPtr hRgn, Point pt, HitTestOptions options)
+ {
+ if (dc == null)
+ throw new ArgumentNullException ("dc");
+
+ HitTestCode result;
+ last_hresult = VisualStyles.UxThemeHitTestThemeBackground(theme, dc, this.part, this.state, options, backgroundRectangle, hRgn, pt, out result);
+ return result;
+ }
+
+ public HitTestCode HitTestBackground (Graphics g, Rectangle backgroundRectangle, Region region, Point pt, HitTestOptions options)
+ {
+ if (g == null)
+ throw new ArgumentNullException ("g");
+
+ IntPtr hRgn = region.GetHrgn(g);
+
+ return this.HitTestBackground(g, backgroundRectangle, hRgn, pt, options);
+ }
+
+ public HitTestCode HitTestBackground (IDeviceContext dc, Rectangle backgroundRectangle, Point pt, HitTestOptions options)
+ {
+ return this.HitTestBackground (dc, backgroundRectangle, IntPtr.Zero, pt, options);
+ }
+
+ public bool IsBackgroundPartiallyTransparent ()
+ {
+ return VisualStyles.UxThemeIsThemeBackgroundPartiallyTransparent (theme, this.part, this.state);
+ }
+
+ public void SetParameters (string className, int part, int state)
+ {
+ if (theme != IntPtr.Zero)
+ last_hresult = VisualStyles.UxThemeCloseThemeData (theme);
+
+ if (!IsSupported)
+ throw new InvalidOperationException ("Visual Styles are not enabled.");
+
+ this.class_name = className;
+ this.part = part;
+ this.state = state;
+ theme = VisualStyles.UxThemeOpenThemeData (IntPtr.Zero, this.class_name);
+
+ if (IsElementKnownToBeSupported (className, part, state))
+ return;
+ if (theme == IntPtr.Zero || !VisualStyles.UxThemeIsThemePartDefined (theme, this.part))
+ throw new ArgumentException ("This element is not supported by the current visual style.");
+ }
+
+ public void SetParameters (VisualStyleElement element)
+ {
+ this.SetParameters (element.ClassName, element.Part, element.State);
+ }
+ #endregion
+
+ #region Private Properties
+ internal static IVisualStyles VisualStyles {
+ get { return VisualStylesEngine.Instance; }
+ }
+ #endregion
+
+ #region Private Instance Methods
+ internal void DrawBackgroundExcludingArea (IDeviceContext dc, Rectangle bounds, Rectangle excludedArea)
+ {
+ VisualStyles.VisualStyleRendererDrawBackgroundExcludingArea (theme, dc, part, state, bounds, excludedArea);
+ }
+ #endregion
+
+ #region Private Static Methods
+ private static bool IsElementKnownToBeSupported (string className, int part, int state)
+ {
+ return className == "STATUS" && part == 0 && state == 0;
+ }
+ #endregion
+
+ #region Private Classes
+ private class ThemeHandleManager
+ {
+ public VisualStyleRenderer VisualStyleRenderer;
+ ~ThemeHandleManager ()
+ {
+ if (VisualStyleRenderer.theme == IntPtr.Zero)
+ return;
+ VisualStyles.UxThemeCloseThemeData (VisualStyleRenderer.theme);
+ }
+ }
+ #endregion
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleState.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleState.cs
new file mode 100644
index 0000000..4fead8f
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStyleState.cs
@@ -0,0 +1,38 @@
+//
+// VisualStyleState.cs
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+namespace ShiftUI.VisualStyles
+{
+ public enum VisualStyleState
+ {
+ NoneEnabled = 0,
+ NonClientAreaEnabled = 1,
+ ClientAreaEnabled = 2,
+ ClientAndNonClientAreasEnabled = 3
+ }
+} \ No newline at end of file
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesEngine.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesEngine.cs
new file mode 100644
index 0000000..7552b9d
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesEngine.cs
@@ -0,0 +1,52 @@
+//
+// VisualStylesEngine.cs: Selects and provides an IVisualStyles.
+//
+// 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) 2008 George Giolfan
+//
+// Authors:
+// George Giolfan ([email protected])
+//
+using System;
+
+namespace ShiftUI.VisualStyles
+{
+ class VisualStylesEngine
+ {
+ static IVisualStyles instance = Initialize ();
+ public static IVisualStyles Instance {
+ get { return instance; }
+ }
+ static IVisualStyles Initialize ()
+ {
+ string environment_variable = Environment.GetEnvironmentVariable("MONO_VISUAL_STYLES");
+ if (environment_variable != null)
+ environment_variable = environment_variable.ToLower ();
+ if (
+#if !VISUAL_STYLES_USE_GTKPLUS_ON_WINDOWS
+ environment_variable == "gtkplus" &&
+#endif
+ VisualStylesGtkPlus.Initialize ())
+ return new VisualStylesGtkPlus ();
+ return new VisualStylesNative ();
+ }
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesGtkPlus.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesGtkPlus.cs
new file mode 100644
index 0000000..e1c11de
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesGtkPlus.cs
@@ -0,0 +1,1177 @@
+//
+// VisualStylesGtkPlus.cs: IVisualStyles that uses GtkPlus.
+//
+// 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) 2008 George Giolfan
+//
+// Authors:
+// George Giolfan ([email protected])
+//
+
+using System.Drawing;
+using System.Collections.Generic;
+using System;
+
+
+namespace ShiftUI.VisualStyles
+{
+ class VisualStylesGtkPlus : IVisualStyles
+ {
+ public static bool Initialize ()
+ {
+ return GtkPlus.Initialize ();
+ }
+ static GtkPlus GtkPlus {
+ get {
+ return GtkPlus.Instance;
+ }
+ }
+
+ enum S {
+ S_OK,
+ S_FALSE
+ }
+ enum ThemeHandle {
+ BUTTON = 1,
+ COMBOBOX,
+ EDIT,
+ HEADER,
+ PROGRESS,
+ REBAR,
+ SCROLLBAR,
+ SPIN,
+ STATUS,
+ TAB,
+ TOOLBAR,
+ TRACKBAR,
+ TREEVIEW
+ }
+
+ #region UxTheme
+ public int UxThemeCloseThemeData (IntPtr hTheme)
+ {
+#if DEBUG
+ return (int)((Enum.IsDefined (typeof (ThemeHandle), (int)hTheme)) ? S.S_OK : S.S_FALSE);
+#else
+ return (int)S.S_OK;
+#endif
+ }
+ public int UxThemeDrawThemeParentBackground (IDeviceContext dc, Rectangle bounds, Widget childWidget)
+ {
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Rectangle clipRectangle)
+ {
+ return (int)(DrawBackground ((ThemeHandle)(int)hTheme, dc, iPartId, iStateId, bounds, clipRectangle, Rectangle.Empty) ? S.S_OK : S.S_FALSE);
+ }
+ public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds)
+ {
+ return UxThemeDrawThemeBackground (hTheme, dc, iPartId, iStateId, bounds, bounds);
+ }
+ bool DrawBackground (ThemeHandle themeHandle, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle clipRectangle, Rectangle excludedArea) {
+ GtkPlusState gtk_plus_state;
+ GtkPlusToggleButtonValue gtk_plus_toggle_button_value;
+ switch (themeHandle) {
+ #region BUTTON
+ case ThemeHandle.BUTTON:
+ switch ((BUTTONPARTS)part) {
+ #region BP_PUSHBUTTON
+ case BUTTONPARTS.BP_PUSHBUTTON:
+ switch ((PUSHBUTTONSTATES)state) {
+ case PUSHBUTTONSTATES.PBS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case PUSHBUTTONSTATES.PBS_HOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ break;
+ case PUSHBUTTONSTATES.PBS_PRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ break;
+ case PUSHBUTTONSTATES.PBS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ case PUSHBUTTONSTATES.PBS_DEFAULTED:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ default:
+ return false;
+ }
+ GtkPlus.ButtonPaint (dc, bounds, clipRectangle, (PUSHBUTTONSTATES)state == PUSHBUTTONSTATES.PBS_DEFAULTED, gtk_plus_state);
+ return true;
+ #endregion
+ #region BP_RADIOBUTTON
+ case BUTTONPARTS.BP_RADIOBUTTON:
+ switch ((RADIOBUTTONSTATES)state) {
+ case RADIOBUTTONSTATES.RBS_UNCHECKEDNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case RADIOBUTTONSTATES.RBS_UNCHECKEDPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case RADIOBUTTONSTATES.RBS_UNCHECKEDHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case RADIOBUTTONSTATES.RBS_UNCHECKEDDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case RADIOBUTTONSTATES.RBS_CHECKEDNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case RADIOBUTTONSTATES.RBS_CHECKEDPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case RADIOBUTTONSTATES.RBS_CHECKEDHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case RADIOBUTTONSTATES.RBS_CHECKEDDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ default:
+ return false;
+ }
+ GtkPlus.RadioButtonPaint (dc, bounds, clipRectangle, gtk_plus_state, gtk_plus_toggle_button_value);
+ return true;
+ #endregion
+ #region BP_CHECKBOX
+ case BUTTONPARTS.BP_CHECKBOX:
+ switch ((CHECKBOXSTATES)state) {
+ case CHECKBOXSTATES.CBS_UNCHECKEDNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case CHECKBOXSTATES.CBS_UNCHECKEDPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case CHECKBOXSTATES.CBS_UNCHECKEDHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case CHECKBOXSTATES.CBS_UNCHECKEDDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
+ break;
+ case CHECKBOXSTATES.CBS_CHECKEDNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case CHECKBOXSTATES.CBS_CHECKEDPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case CHECKBOXSTATES.CBS_CHECKEDHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case CHECKBOXSTATES.CBS_CHECKEDDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
+ break;
+ case CHECKBOXSTATES.CBS_MIXEDNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
+ break;
+ case CHECKBOXSTATES.CBS_MIXEDPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
+ break;
+ case CHECKBOXSTATES.CBS_MIXEDHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
+ break;
+ case CHECKBOXSTATES.CBS_MIXEDDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
+ break;
+ default:
+ return false;
+ }
+ GtkPlus.CheckBoxPaint (dc, bounds, clipRectangle, gtk_plus_state, gtk_plus_toggle_button_value);
+ return true;
+ #endregion
+ #region BP_GROUPBOX
+ case BUTTONPARTS.BP_GROUPBOX:
+ switch ((GROUPBOXSTATES)state) {
+ case GROUPBOXSTATES.GBS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case GROUPBOXSTATES.GBS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ default:
+ return false;
+ }
+ GtkPlus.GroupBoxPaint (dc, bounds, excludedArea, gtk_plus_state);
+ return true;
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region COMBOBOX
+ case ThemeHandle.COMBOBOX:
+ switch ((COMBOBOXPARTS)part) {
+ #region CP_DROPDOWNBUTTON
+ case COMBOBOXPARTS.CP_DROPDOWNBUTTON:
+ switch ((COMBOBOXSTYLESTATES)state) {
+ case COMBOBOXSTYLESTATES.CBXS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
+ case COMBOBOXSTYLESTATES.CBXS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
+ case COMBOBOXSTYLESTATES.CBXS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
+ case COMBOBOXSTYLESTATES.CBXS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
+ default: return false;
+ }
+ GtkPlus.ComboBoxPaintDropDownButton (dc, bounds, clipRectangle, gtk_plus_state);
+ return true;
+ #endregion
+ #region CP_BORDER
+ case COMBOBOXPARTS.CP_BORDER:
+ switch ((BORDERSTATES)state) {
+ case BORDERSTATES.CBB_NORMAL:
+ case BORDERSTATES.CBB_HOT:
+ case BORDERSTATES.CBB_FOCUSED:
+ case BORDERSTATES.CBB_DISABLED:
+ GtkPlus.ComboBoxPaintBorder (dc, bounds, clipRectangle);
+ return true;
+ default: return false;
+ }
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region EDIT
+ case ThemeHandle.EDIT:
+ switch ((EDITPARTS)part) {
+ #region EP_EDITTEXT
+ case EDITPARTS.EP_EDITTEXT:
+ switch ((EDITTEXTSTATES)state) {
+ case EDITTEXTSTATES.ETS_NORMAL:
+ case EDITTEXTSTATES.ETS_ASSIST:
+ case EDITTEXTSTATES.ETS_READONLY:
+ case EDITTEXTSTATES.ETS_HOT:
+ case EDITTEXTSTATES.ETS_SELECTED:
+ case EDITTEXTSTATES.ETS_FOCUSED:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case EDITTEXTSTATES.ETS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ default: return false;
+ }
+ GtkPlus.TextBoxPaint (dc, bounds, excludedArea, gtk_plus_state);
+ return true;
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region HEADER
+ case ThemeHandle.HEADER:
+ switch ((HEADERPARTS)part) {
+ #region HP_HEADERITEM
+ case HEADERPARTS.HP_HEADERITEM:
+ switch ((HEADERITEMSTATES)state) {
+ case HEADERITEMSTATES.HIS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case HEADERITEMSTATES.HIS_HOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ break;
+ case HEADERITEMSTATES.HIS_PRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ break;
+ default: return false;
+ }
+ GtkPlus.HeaderPaint (dc, bounds, clipRectangle, gtk_plus_state);
+ return true;
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region PROGRESS
+ case ThemeHandle.PROGRESS:
+ switch ((PROGRESSPARTS)part) {
+ case PROGRESSPARTS.PP_BAR:
+ case PROGRESSPARTS.PP_BARVERT:
+ GtkPlus.ProgressBarPaintBar (dc, bounds, clipRectangle);
+ return true;
+ case PROGRESSPARTS.PP_CHUNK:
+ case PROGRESSPARTS.PP_CHUNKVERT:
+ GtkPlus.ProgressBarPaintChunk (dc, bounds, clipRectangle);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region REBAR
+ case ThemeHandle.REBAR:
+ switch ((REBARPARTS)part) {
+ case REBARPARTS.RP_BAND:
+ GtkPlus.ToolBarPaint (dc, bounds, clipRectangle);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region SCROLLBAR
+ case ThemeHandle.SCROLLBAR:
+ switch ((SCROLLBARPARTS)part) {
+ #region SBP_ARROWBTN
+ case SCROLLBARPARTS.SBP_ARROWBTN:
+ bool horizontal;
+ bool up_or_left;
+ switch ((ARROWBTNSTATES)state) {
+ case ARROWBTNSTATES.ABS_UPNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ horizontal = false;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_UPHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ horizontal = false;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_UPPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ horizontal = false;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_UPDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ horizontal = false;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_DOWNNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ horizontal = false;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_DOWNHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ horizontal = false;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_DOWNPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ horizontal = false;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_DOWNDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ horizontal = false;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_LEFTNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ horizontal = true;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_LEFTHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ horizontal = true;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_LEFTPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ horizontal = true;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_LEFTDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ horizontal = true;
+ up_or_left = true;
+ break;
+ case ARROWBTNSTATES.ABS_RIGHTNORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ horizontal = true;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_RIGHTHOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ horizontal = true;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_RIGHTPRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ horizontal = true;
+ up_or_left = false;
+ break;
+ case ARROWBTNSTATES.ABS_RIGHTDISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ horizontal = true;
+ up_or_left = false;
+ break;
+ default: return false;
+ }
+ GtkPlus.ScrollBarPaintArrowButton (dc, bounds, clipRectangle, gtk_plus_state, horizontal, up_or_left);
+ return true;
+ #endregion
+ #region SBP_THUMBBTNHORZ, SBP_THUMBBTNVERT
+ case SCROLLBARPARTS.SBP_THUMBBTNHORZ:
+ case SCROLLBARPARTS.SBP_THUMBBTNVERT:
+ if (!GetGtkPlusState ((SCROLLBARSTYLESTATES)state, out gtk_plus_state))
+ return false;
+ GtkPlus.ScrollBarPaintThumbButton (
+ dc,
+ bounds,
+ clipRectangle,
+ gtk_plus_state,
+ (SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_THUMBBTNHORZ);
+ return true;
+ #endregion
+ #region SBP_LOWERTRACKHORZ, SBP_UPPERTRACKHORZ, SBP_LOWERTRACKVERT, SBP_UPPERTRACKVERT
+ case SCROLLBARPARTS.SBP_LOWERTRACKHORZ:
+ case SCROLLBARPARTS.SBP_UPPERTRACKHORZ:
+ case SCROLLBARPARTS.SBP_LOWERTRACKVERT:
+ case SCROLLBARPARTS.SBP_UPPERTRACKVERT:
+ if (!GetGtkPlusState ((SCROLLBARSTYLESTATES)state, out gtk_plus_state))
+ return false;
+ GtkPlus.ScrollBarPaintTrack (
+ dc,
+ bounds,
+ clipRectangle,
+ gtk_plus_state,
+ (SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_LOWERTRACKHORZ ||
+ (SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
+ (SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKHORZ ||
+ (SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKVERT);
+ return true;
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region SPIN
+ case ThemeHandle.SPIN:
+ bool up;
+ switch ((SPINPARTS)part) {
+ #region SPNP_UP
+ case SPINPARTS.SPNP_UP:
+ up = true;
+ switch ((UPSTATES)state) {
+ case UPSTATES.UPS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
+ case UPSTATES.UPS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
+ case UPSTATES.UPS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
+ case UPSTATES.UPS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region SPNP_DOWN
+ case SPINPARTS.SPNP_DOWN:
+ up = false;
+ switch ((DOWNSTATES)state) {
+ case DOWNSTATES.DNS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
+ case DOWNSTATES.DNS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
+ case DOWNSTATES.DNS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
+ case DOWNSTATES.DNS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
+ default: return false;
+ }
+ break;
+ #endregion
+ default: return false;
+ }
+ GtkPlus.UpDownPaint (dc, bounds, clipRectangle, up, gtk_plus_state);
+ return true;
+ #endregion
+ #region STATUS
+ case ThemeHandle.STATUS:
+ switch ((STATUSPARTS)part) {
+ case STATUSPARTS.SP_GRIPPER:
+ GtkPlus.StatusBarPaintGripper (dc, bounds, clipRectangle);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TABWidget
+ case ThemeHandle.TAB:
+ bool selected;
+ switch ((TABPARTS)part) {
+ #region TABP_TABITEM
+ case TABPARTS.TABP_TABITEM:
+ switch ((TABITEMSTATES)state) {
+ case TABITEMSTATES.TIS_SELECTED:
+ selected = true;
+ break;
+ case TABITEMSTATES.TIS_NORMAL:
+ case TABITEMSTATES.TIS_HOT:
+ case TABITEMSTATES.TIS_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TABITEMLEFTEDGE
+ case TABPARTS.TABP_TABITEMLEFTEDGE:
+ switch ((TABITEMLEFTEDGESTATES)state) {
+ case TABITEMLEFTEDGESTATES.TILES_SELECTED:
+ selected = true;
+ break;
+ case TABITEMLEFTEDGESTATES.TILES_NORMAL:
+ case TABITEMLEFTEDGESTATES.TILES_HOT:
+ case TABITEMLEFTEDGESTATES.TILES_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TABITEMRIGHTEDGE
+ case TABPARTS.TABP_TABITEMRIGHTEDGE:
+ switch ((TABITEMRIGHTEDGESTATES)state) {
+ case TABITEMRIGHTEDGESTATES.TIRES_SELECTED:
+ selected = true;
+ break;
+ case TABITEMRIGHTEDGESTATES.TIRES_NORMAL:
+ case TABITEMRIGHTEDGESTATES.TIRES_HOT:
+ case TABITEMRIGHTEDGESTATES.TIRES_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TABITEMBOTHEDGE
+ case TABPARTS.TABP_TABITEMBOTHEDGE:
+ selected = false;
+ break;
+ #endregion
+ #region TABP_TOPTABITEM
+ case TABPARTS.TABP_TOPTABITEM:
+ switch ((TOPTABITEMSTATES)state) {
+ case TOPTABITEMSTATES.TTIS_SELECTED:
+ selected = true;
+ break;
+ case TOPTABITEMSTATES.TTIS_NORMAL:
+ case TOPTABITEMSTATES.TTIS_HOT:
+ case TOPTABITEMSTATES.TTIS_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TOPTABITEMLEFTEDGE
+ case TABPARTS.TABP_TOPTABITEMLEFTEDGE:
+ switch ((TOPTABITEMLEFTEDGESTATES)state) {
+ case TOPTABITEMLEFTEDGESTATES.TTILES_SELECTED:
+ selected = true;
+ break;
+ case TOPTABITEMLEFTEDGESTATES.TTILES_NORMAL:
+ case TOPTABITEMLEFTEDGESTATES.TTILES_HOT:
+ case TOPTABITEMLEFTEDGESTATES.TTILES_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TOPTABITEMRIGHTEDGE
+ case TABPARTS.TABP_TOPTABITEMRIGHTEDGE:
+ switch ((TOPTABITEMRIGHTEDGESTATES)state) {
+ case TOPTABITEMRIGHTEDGESTATES.TTIRES_SELECTED:
+ selected = true;
+ break;
+ case TOPTABITEMRIGHTEDGESTATES.TTIRES_NORMAL:
+ case TOPTABITEMRIGHTEDGESTATES.TTIRES_HOT:
+ case TOPTABITEMRIGHTEDGESTATES.TTIRES_DISABLED:
+ selected = false;
+ break;
+ default: return false;
+ }
+ break;
+ #endregion
+ #region TABP_TOPTABITEMBOTHEDGE
+ case TABPARTS.TABP_TOPTABITEMBOTHEDGE:
+ selected = false;
+ break;
+ #endregion
+ #region TABP_PANE
+ case TABPARTS.TABP_PANE:
+ GtkPlus.TabWidgetPaintPane (dc, bounds, clipRectangle);
+ return true;
+ #endregion
+ default: return false;
+ }
+ GtkPlus.TabWidgetPaintTabItem (dc, bounds, clipRectangle, selected ? GtkPlusState.Pressed : GtkPlusState.Normal);
+ return true;
+ #endregion
+ #region TOOLBAR
+ case ThemeHandle.TOOLBAR:
+ switch ((TOOLBARPARTS)part) {
+ case TOOLBARPARTS.TP_BUTTON:
+ switch ((TOOLBARSTYLESTATES)state) {
+ case TOOLBARSTYLESTATES.TS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case TOOLBARSTYLESTATES.TS_HOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ break;
+ case TOOLBARSTYLESTATES.TS_PRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ break;
+ case TOOLBARSTYLESTATES.TS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ case TOOLBARSTYLESTATES.TS_CHECKED:
+ case TOOLBARSTYLESTATES.TS_HOTCHECKED:
+ GtkPlus.ToolBarPaintCheckedButton (dc, bounds, clipRectangle);
+ return true;
+ default: return false;
+ }
+ GtkPlus.ToolBarPaintButton (dc, bounds, clipRectangle, gtk_plus_state);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TRACKBAR
+ case ThemeHandle.TRACKBAR:
+ switch ((TRACKBARPARTS)part) {
+ #region TKP_TRACK
+ case TRACKBARPARTS.TKP_TRACK:
+ switch ((TRACKSTATES)state) {
+ case TRACKSTATES.TRS_NORMAL:
+ GtkPlus.TrackBarPaintTrack (dc, bounds, clipRectangle, true);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TKP_TRACKVERT
+ case TRACKBARPARTS.TKP_TRACKVERT:
+ switch ((TRACKVERTSTATES)state) {
+ case TRACKVERTSTATES.TRVS_NORMAL:
+ GtkPlus.TrackBarPaintTrack (dc, bounds, clipRectangle, false);
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TKP_THUMB
+ case TRACKBARPARTS.TKP_THUMB:
+ switch ((THUMBSTATES)state) {
+ case THUMBSTATES.TUS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case THUMBSTATES.TUS_HOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ break;
+ case THUMBSTATES.TUS_PRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ break;
+ case THUMBSTATES.TUS_FOCUSED:
+ gtk_plus_state = GtkPlusState.Selected;
+ break;
+ case THUMBSTATES.TUS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ default: return false;
+ }
+ GtkPlus.TrackBarPaintThumb (dc, bounds, clipRectangle, gtk_plus_state, true);
+ return true;
+ #endregion
+ #region TKP_THUMBVERT
+ case TRACKBARPARTS.TKP_THUMBVERT:
+ switch ((THUMBVERTSTATES)state) {
+ case THUMBVERTSTATES.TUVS_NORMAL:
+ gtk_plus_state = GtkPlusState.Normal;
+ break;
+ case THUMBVERTSTATES.TUVS_HOT:
+ gtk_plus_state = GtkPlusState.Hot;
+ break;
+ case THUMBVERTSTATES.TUVS_PRESSED:
+ gtk_plus_state = GtkPlusState.Pressed;
+ break;
+ case THUMBVERTSTATES.TUVS_FOCUSED:
+ gtk_plus_state = GtkPlusState.Selected;
+ break;
+ case THUMBVERTSTATES.TUVS_DISABLED:
+ gtk_plus_state = GtkPlusState.Disabled;
+ break;
+ default: return false;
+ }
+ GtkPlus.TrackBarPaintThumb (dc, bounds, clipRectangle, gtk_plus_state, false);
+ return true;
+ #endregion
+ default: return false;
+ }
+ #endregion
+ #region TREEVIEW
+ case ThemeHandle.TREEVIEW:
+ switch ((TREEVIEWPARTS)part) {
+ case TREEVIEWPARTS.TVP_GLYPH:
+ bool closed;
+ switch ((GLYPHSTATES)state) {
+ case GLYPHSTATES.GLPS_CLOSED : closed = true; break;
+ case GLYPHSTATES.GLPS_OPENED: closed = false; break;
+ default: return false;
+ }
+ GtkPlus.TreeViewPaintGlyph (dc, bounds, clipRectangle, closed);
+ return true;
+ default: return false;
+ }
+ #endregion
+ default: return false;
+ }
+ }
+ static bool GetGtkPlusState (SCROLLBARSTYLESTATES state, out GtkPlusState result)
+ {
+ switch (state) {
+ case SCROLLBARSTYLESTATES.SCRBS_NORMAL:
+ result = GtkPlusState.Normal;
+ break;
+ case SCROLLBARSTYLESTATES.SCRBS_HOT:
+ result = GtkPlusState.Hot;
+ break;
+ case SCROLLBARSTYLESTATES.SCRBS_PRESSED:
+ result = GtkPlusState.Pressed;
+ break;
+ case SCROLLBARSTYLESTATES.SCRBS_DISABLED:
+ result = GtkPlusState.Disabled;
+ break;
+ default:
+ result = (GtkPlusState)0;
+ return false;
+ }
+ return true;
+ }
+ public int UxThemeDrawThemeEdge (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects, out Rectangle result)
+ {
+ result = Rectangle.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeDrawThemeText (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string text, TextFormatFlags textFlags, Rectangle bounds)
+ {
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeBackgroundContentRect (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Rectangle result)
+ {
+ return (int)(GetBackgroundContentRectangle ((ThemeHandle)(int)hTheme, iPartId, iStateId, bounds, out result) ? S.S_OK : S.S_FALSE);
+ }
+ bool GetBackgroundContentRectangle (ThemeHandle handle, int part, int state, Rectangle bounds, out Rectangle result)
+ {
+ switch (handle) {
+ case ThemeHandle.PROGRESS:
+ switch ((PROGRESSPARTS)part) {
+ case PROGRESSPARTS.PP_BAR:
+ case PROGRESSPARTS.PP_BARVERT:
+ result = GtkPlus.ProgressBarGetBackgroundContentRectagle (bounds);
+ return true;
+ }
+ break;
+ }
+ result = Rectangle.Empty;
+ return false;
+ }
+ public int UxThemeGetThemeBackgroundExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle contentBounds, out Rectangle result)
+ {
+ result = Rectangle.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeBackgroundRegion (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Region result)
+ {
+ result = null;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeBool (IntPtr hTheme, int iPartId, int iStateId, BooleanProperty prop, out bool result)
+ {
+ result = false;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeColor (IntPtr hTheme, int iPartId, int iStateId, ColorProperty prop, out Color result)
+ {
+ result = Color.Black;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, EnumProperty prop, out int result)
+ {
+ result = 0;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeFilename (IntPtr hTheme, int iPartId, int iStateId, FilenameProperty prop, out string result)
+ {
+ result = null;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeInt (IntPtr hTheme, int iPartId, int iStateId, IntegerProperty prop, out int result)
+ {
+ return (int)(GetInteger ((ThemeHandle)(int)hTheme, iPartId, iStateId, prop, out result) ? S.S_OK : S.S_FALSE);
+ }
+ bool GetInteger (ThemeHandle handle, int part, int state, IntegerProperty property, out int result)
+ {
+ switch (handle) {
+ case ThemeHandle.PROGRESS:
+ switch ((PROGRESSPARTS)part) {
+ case PROGRESSPARTS.PP_CHUNK:
+ case PROGRESSPARTS.PP_CHUNKVERT:
+ switch (property) {
+ case IntegerProperty.ProgressChunkSize:
+ result = ThemeWin32Classic.ProgressBarGetChunkSize ();
+ return true;
+ case IntegerProperty.ProgressSpaceSize:
+ result = ThemeWin32Classic.ProgressBarChunkSpacing;
+ return true;
+ }
+ break;
+ }
+ break;
+ }
+ result = 0;
+ return false;
+ }
+ public int UxThemeGetThemeMargins (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, MarginProperty prop, out Padding result)
+ {
+ result = Padding.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, ThemeSizeType type, out Size result)
+ {
+ return (int)(GetPartSize ((ThemeHandle)(int)hTheme, dc, iPartId, iStateId, bounds, true, type, out result) ? S.S_OK : S.S_FALSE);
+ }
+ public int UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, ThemeSizeType type, out Size result)
+ {
+ return (int)(GetPartSize ((ThemeHandle)(int)hTheme, dc, iPartId, iStateId, Rectangle.Empty, false, type, out result) ? S.S_OK : S.S_FALSE);
+ }
+ bool GetPartSize (ThemeHandle themeHandle, IDeviceContext dc, int part, int state, Rectangle bounds, bool rectangleSpecified, ThemeSizeType type, out Size result)
+ {
+ switch (themeHandle) {
+ #region BUTTON
+ case ThemeHandle.BUTTON:
+ switch ((BUTTONPARTS)part) {
+ case BUTTONPARTS.BP_RADIOBUTTON:
+ result = GtkPlus.RadioButtonGetSize ();
+ return true;
+ case BUTTONPARTS.BP_CHECKBOX:
+ result = GtkPlus.CheckBoxGetSize ();
+ return true;
+ }
+ break;
+ #endregion
+ #region HEADER
+ case ThemeHandle.HEADER:
+ switch ((HEADERPARTS)part) {
+ case HEADERPARTS.HP_HEADERITEM:
+ result = new Size (0, ThemeWin32Classic.ListViewGetHeaderHeight ());
+ return true;
+ }
+ break;
+ #endregion
+ #region TRACKBAR
+ case ThemeHandle.TRACKBAR:
+ switch ((TRACKBARPARTS)part) {
+ case TRACKBARPARTS.TKP_TRACK:
+ result = new Size (0, ThemeWin32Classic.TrackBarHorizontalTrackHeight);
+ return true;
+ case TRACKBARPARTS.TKP_TRACKVERT:
+ result = new Size (ThemeWin32Classic.TrackBarVerticalTrackWidth, 0);
+ return true;
+ case TRACKBARPARTS.TKP_THUMB:
+ case TRACKBARPARTS.TKP_THUMBVERT:
+ result = ThemeWin32Classic.TrackBarGetThumbSize ();
+ if ((TRACKBARPARTS)part == TRACKBARPARTS.TKP_THUMBVERT) {
+ int temporary = result.Width;
+ result.Width = result.Height;
+ result.Height = temporary;
+ }
+ return true;
+ }
+ break;
+ #endregion
+ }
+ result = Size.Empty;
+ return false;
+ }
+ public int UxThemeGetThemePosition (IntPtr hTheme, int iPartId, int iStateId, PointProperty prop, out Point result)
+ {
+ result = Point.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeString (IntPtr hTheme, int iPartId, int iStateId, StringProperty prop, out string result)
+ {
+ result = null;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, Rectangle bounds, out Rectangle result)
+ {
+ result = Rectangle.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, out Rectangle result)
+ {
+ result = Rectangle.Empty;
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeGetThemeTextMetrics (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, out TextMetrics result)
+ {
+ result = new TextMetrics ();
+ return (int)S.S_FALSE;
+ }
+ public int UxThemeHitTestThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, HitTestOptions options, Rectangle backgroundRectangle, IntPtr hrgn, Point pt, out HitTestCode result)
+ {
+ result = HitTestCode.Bottom;
+ return (int)S.S_FALSE;
+ }
+ public bool UxThemeIsAppThemed ()
+ {
+ return true;
+ }
+ public bool UxThemeIsThemeActive ()
+ {
+ return true;
+ }
+ public bool UxThemeIsThemeBackgroundPartiallyTransparent (IntPtr hTheme, int iPartId, int iStateId)
+ {
+ return true;
+ }
+ public bool UxThemeIsThemePartDefined (IntPtr hTheme, int iPartId)
+ {
+ switch ((ThemeHandle)(int)hTheme) {
+ #region BUTTON
+ case ThemeHandle.BUTTON:
+ switch ((BUTTONPARTS)iPartId) {
+ case BUTTONPARTS.BP_PUSHBUTTON:
+ case BUTTONPARTS.BP_CHECKBOX:
+ case BUTTONPARTS.BP_RADIOBUTTON:
+ case BUTTONPARTS.BP_GROUPBOX:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region COMBOBOX
+ case ThemeHandle.COMBOBOX:
+ switch ((COMBOBOXPARTS)iPartId) {
+ case COMBOBOXPARTS.CP_DROPDOWNBUTTON:
+ case COMBOBOXPARTS.CP_BORDER:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region EDIT
+ case ThemeHandle.EDIT:
+ switch ((EDITPARTS)iPartId) {
+ case EDITPARTS.EP_EDITTEXT:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region HEADER
+ case ThemeHandle.HEADER:
+ switch ((HEADERPARTS)iPartId) {
+ case HEADERPARTS.HP_HEADERITEM:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region PROGRESS
+ case ThemeHandle.PROGRESS:
+ switch ((PROGRESSPARTS)iPartId) {
+ case PROGRESSPARTS.PP_BAR:
+ case PROGRESSPARTS.PP_BARVERT:
+ case PROGRESSPARTS.PP_CHUNK:
+ case PROGRESSPARTS.PP_CHUNKVERT:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region REBAR
+ case ThemeHandle.REBAR:
+ switch ((REBARPARTS)iPartId) {
+ case REBARPARTS.RP_BAND:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region SCROLLBAR
+ case ThemeHandle.SCROLLBAR:
+ switch ((SCROLLBARPARTS)iPartId) {
+ case SCROLLBARPARTS.SBP_ARROWBTN:
+ case SCROLLBARPARTS.SBP_THUMBBTNHORZ:
+ case SCROLLBARPARTS.SBP_THUMBBTNVERT:
+ case SCROLLBARPARTS.SBP_LOWERTRACKHORZ:
+ case SCROLLBARPARTS.SBP_UPPERTRACKHORZ:
+ case SCROLLBARPARTS.SBP_LOWERTRACKVERT:
+ case SCROLLBARPARTS.SBP_UPPERTRACKVERT:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region SPIN
+ case ThemeHandle.SPIN:
+ switch ((SPINPARTS)iPartId) {
+ case SPINPARTS.SPNP_UP:
+ case SPINPARTS.SPNP_DOWN:
+ return true;
+ default: return false;
+ }
+
+ #endregion
+ #region STATUS
+ case ThemeHandle.STATUS:
+ switch ((STATUSPARTS)iPartId) {
+ case STATUSPARTS.SP_GRIPPER:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TABWidget
+ case ThemeHandle.TAB:
+ switch ((TABPARTS)iPartId) {
+ case TABPARTS.TABP_TABITEM:
+ case TABPARTS.TABP_TABITEMLEFTEDGE:
+ case TABPARTS.TABP_TABITEMRIGHTEDGE:
+ case TABPARTS.TABP_TABITEMBOTHEDGE:
+ case TABPARTS.TABP_TOPTABITEM:
+ case TABPARTS.TABP_TOPTABITEMLEFTEDGE:
+ case TABPARTS.TABP_TOPTABITEMRIGHTEDGE:
+ case TABPARTS.TABP_TOPTABITEMBOTHEDGE:
+ case TABPARTS.TABP_PANE:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TOOLBAR
+ case ThemeHandle.TOOLBAR:
+ switch ((TOOLBARPARTS)iPartId) {
+ case TOOLBARPARTS.TP_BUTTON:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TRACKBAR
+ case ThemeHandle.TRACKBAR:
+ switch ((TRACKBARPARTS)iPartId) {
+ case TRACKBARPARTS.TKP_TRACK:
+ case TRACKBARPARTS.TKP_TRACKVERT:
+ case TRACKBARPARTS.TKP_THUMB:
+ case TRACKBARPARTS.TKP_THUMBVERT:
+ return true;
+ default: return false;
+ }
+ #endregion
+ #region TREEVIEW
+ case ThemeHandle.TREEVIEW:
+ switch ((TREEVIEWPARTS)iPartId) {
+ case TREEVIEWPARTS.TVP_GLYPH:
+ return true;
+ default: return false;
+ }
+ #endregion
+ default: return false;
+ }
+ }
+ public IntPtr UxThemeOpenThemeData (IntPtr hWnd, string classList)
+ {
+ ThemeHandle theme_handle;
+ try {
+ theme_handle = (ThemeHandle)Enum.Parse (typeof (ThemeHandle), classList);
+ } catch (ArgumentException) {
+ return IntPtr.Zero;
+ }
+ return (IntPtr)(int)theme_handle;
+ }
+ #endregion
+ #region VisualStyleInformation
+ public string VisualStyleInformationAuthor {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationColorScheme {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationCompany {
+ get {
+ return null;
+ }
+ }
+ public Color VisualStyleInformationWidgetHighlightHot {
+ get {
+ return Color.Black;
+ }
+ }
+ public string VisualStyleInformationCopyright {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationDescription {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationDisplayName {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationFileName {
+ get {
+ return null;
+ }
+ }
+ public bool VisualStyleInformationIsSupportedByOS
+ {
+ get {
+ return true;
+ }
+ }
+ public int VisualStyleInformationMinimumColorDepth {
+ get {
+ return 0;
+ }
+ }
+ public string VisualStyleInformationSize {
+ get {
+ return null;
+ }
+ }
+ public bool VisualStyleInformationSupportsFlatMenus {
+ get {
+ return false;
+ }
+ }
+ public Color VisualStyleInformationTextWidgetBorder {
+ get {
+ return Color.Black;
+ }
+ }
+ public string VisualStyleInformationUrl {
+ get {
+ return null;
+ }
+ }
+ public string VisualStyleInformationVersion {
+ get {
+ return null;
+ }
+ }
+ #endregion
+ #region VisualStyleRenderer
+ public void VisualStyleRendererDrawBackgroundExcludingArea (IntPtr theme, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle excludedArea)
+ {
+ DrawBackground ((ThemeHandle)(int)theme, dc, part, state, bounds, bounds, excludedArea);
+ }
+ #endregion
+ }
+}
diff --git a/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesNative.cs b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesNative.cs
new file mode 100644
index 0000000..6d304fd
--- /dev/null
+++ b/source/ShiftUI/System.Windows.Forms.VisualStyles/VisualStylesNative.cs
@@ -0,0 +1,455 @@
+//
+// VisualStylesNative.cs: IVisualStyles that uses the Visual Styles feature of
+// Windows XP and later.
+//
+// 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) 2006 Novell, Inc.
+//
+// Authors:
+// Jonathan Pobst ([email protected])
+//
+
+using System.Drawing;
+using System.Diagnostics;
+using System;
+using System.Text;
+
+
+namespace ShiftUI.VisualStyles
+{
+ class VisualStylesNative : IVisualStyles
+ {
+ #region UxTheme
+ public int UxThemeCloseThemeData (IntPtr hTheme)
+ {
+ return UXTheme.CloseThemeData (hTheme);
+ }
+ public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+
+ int result = UXTheme.DrawThemeBackground(hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, IntPtr.Zero);
+ dc.ReleaseHdc ();
+ return result;
+ }
+ public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Rectangle clipRectangle)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ XplatUIWin32.RECT ClipRect = XplatUIWin32.RECT.FromRectangle (clipRectangle);
+
+ int result = UXTheme.DrawThemeBackground (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, ref ClipRect);
+ dc.ReleaseHdc ();
+ return result;
+ }
+ public int UxThemeDrawThemeEdge (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects, out Rectangle result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ XplatUIWin32.RECT retval;
+
+ int hresult = UXTheme.DrawThemeEdge (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, (uint)style, (uint)edges + (uint)effects, out retval);
+ dc.ReleaseHdc ();
+ result = retval.ToRectangle();
+ return hresult;
+ }
+ public int UxThemeDrawThemeParentBackground (IDeviceContext dc, Rectangle bounds, Widget childWidget)
+ {
+ int result;
+
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+
+ using (Graphics g = Graphics.FromHwnd (childWidget.Handle)) {
+ IntPtr hdc = g.GetHdc ();
+ result = UXTheme.DrawThemeParentBackground (childWidget.Handle, hdc, ref BoundsRect);
+ g.ReleaseHdc (hdc);
+ }
+
+ return result;
+ }
+ public int UxThemeDrawThemeText (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string text, TextFormatFlags textFlags, Rectangle bounds)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+
+ int result = UXTheme.DrawThemeText (hTheme, dc.GetHdc (), iPartId, iStateId, text, text.Length, (uint)textFlags, 0, ref BoundsRect);
+ dc.ReleaseHdc ();
+ return result;
+ }
+ public int UxThemeGetThemeBackgroundContentRect (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Rectangle result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ XplatUIWin32.RECT retval;
+
+ int hresult = UXTheme.GetThemeBackgroundContentRect (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToRectangle ();
+ return hresult;
+ }
+ public int UxThemeGetThemeBackgroundExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle contentBounds, out Rectangle result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (contentBounds);
+ XplatUIWin32.RECT retval = new XplatUIWin32.RECT ();
+
+ int hresult = UXTheme.GetThemeBackgroundExtent (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, ref retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToRectangle ();
+ return hresult;
+ }
+ public int UxThemeGetThemeBackgroundRegion (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Region result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ IntPtr retval;
+
+ int hresult = UXTheme.GetThemeBackgroundRegion (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, out retval);
+ dc.ReleaseHdc ();
+
+ result = Region.FromHrgn (retval);
+ return hresult;
+ }
+ public int UxThemeGetThemeBool (IntPtr hTheme, int iPartId, int iStateId, BooleanProperty prop, out bool result)
+ {
+ int retval;
+ int hresult = UXTheme.GetThemeBool (hTheme, iPartId, iStateId, (int)prop, out retval);
+
+ result = retval == 0 ? false : true;
+ return hresult;
+ }
+ public int UxThemeGetThemeColor (IntPtr hTheme, int iPartId, int iStateId, ColorProperty prop, out Color result)
+ {
+ int retval;
+ int hresult = UXTheme.GetThemeColor (hTheme, iPartId, iStateId, (int)prop, out retval);
+
+ result = System.Drawing.Color.FromArgb ((int)(0x000000FFU & retval),
+ (int)(0x0000FF00U & retval) >> 8, (int)(0x00FF0000U & retval) >> 16);
+ return hresult;
+ }
+ public int UxThemeGetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, EnumProperty prop, out int result)
+ {
+ int retval;
+ int hresult = UXTheme.GetThemeEnumValue (hTheme, iPartId, iStateId, (int)prop, out retval);
+
+ result = retval;
+ return hresult;
+ }
+ public int UxThemeGetThemeFilename (IntPtr hTheme, int iPartId, int iStateId, FilenameProperty prop, out string result)
+ {
+ StringBuilder sb = new StringBuilder (255);
+ int hresult = UXTheme.GetThemeFilename (hTheme, iPartId, iStateId, (int)prop, sb, sb.Capacity);
+
+ result = sb.ToString ();
+ return hresult;
+ }
+ public int UxThemeGetThemeInt (IntPtr hTheme, int iPartId, int iStateId, IntegerProperty prop, out int result)
+ {
+ int retval;
+ int hresult = UXTheme.GetThemeInt (hTheme, iPartId, iStateId, (int)prop, out retval);
+
+ result = retval;
+ return hresult;
+ }
+ public int UxThemeGetThemeMargins (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, MarginProperty prop, out Padding result)
+ {
+ UXTheme.MARGINS retval = new UXTheme.MARGINS ();
+ XplatUIWin32.RECT BoundsRect;
+
+ int hresult = UXTheme.GetThemeMargins (hTheme, dc.GetHdc (), iPartId, iStateId, (int)prop, out BoundsRect, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToPadding();
+ return hresult;
+ }
+ public int UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, ThemeSizeType type, out Size result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ UXTheme.SIZE retval;
+
+ int hresult = UXTheme.GetThemePartSize (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, (int)type, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToSize();
+ return hresult;
+ }
+ public int UxThemeGetThemePartSize (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, ThemeSizeType type, out Size result)
+ {
+ UXTheme.SIZE retval;
+
+ int hresult = UXTheme.GetThemePartSize (hTheme, dc.GetHdc (), iPartId, iStateId, IntPtr.Zero, (int)type, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToSize ();
+ return hresult;
+ }
+ public int UxThemeGetThemePosition (IntPtr hTheme, int iPartId, int iStateId, PointProperty prop, out Point result)
+ {
+ POINT retval;
+ int hresult = UXTheme.GetThemePosition (hTheme, iPartId, iStateId, (int)prop, out retval);
+
+ result = retval.ToPoint();
+ return hresult;
+ }
+ public int UxThemeGetThemeString (IntPtr hTheme, int iPartId, int iStateId, StringProperty prop, out string result)
+ {
+ StringBuilder sb = new StringBuilder (255);
+ int hresult = UXTheme.GetThemeString (hTheme, iPartId, iStateId, (int)prop, sb, sb.Capacity);
+
+ result = sb.ToString ();
+ return hresult;
+ }
+ public int UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, Rectangle bounds, out Rectangle result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (bounds);
+ XplatUIWin32.RECT retval;
+
+ int hresult = UXTheme.GetThemeTextExtent (hTheme, dc.GetHdc (), iPartId, iStateId, textToDraw, textToDraw.Length, (int)flags, ref BoundsRect, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToRectangle ();
+ return hresult;
+ }
+ public int UxThemeGetThemeTextExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, out Rectangle result)
+ {
+ XplatUIWin32.RECT retval;
+
+ int hresult = UXTheme.GetThemeTextExtent (hTheme, dc.GetHdc (), iPartId, iStateId, textToDraw, textToDraw.Length, (int)flags, 0, out retval);
+ dc.ReleaseHdc ();
+
+ result = retval.ToRectangle ();
+ return hresult;
+ }
+ public int UxThemeGetThemeTextMetrics (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, out TextMetrics result)
+ {
+ XplatUIWin32.TEXTMETRIC metrics;
+
+ int hresult = UXTheme.GetThemeTextMetrics (hTheme, dc.GetHdc (), iPartId, iStateId, out metrics);
+ dc.ReleaseHdc ();
+
+ TextMetrics retval = new TextMetrics ();
+ retval.Ascent = metrics.tmAscent;
+ retval.AverageCharWidth = metrics.tmAveCharWidth;
+ retval.BreakChar =(char)metrics.tmBreakChar;
+ retval.CharSet = (TextMetricsCharacterSet)metrics.tmCharSet;
+ retval.DefaultChar = (char)metrics.tmDefaultChar;
+ retval.Descent = metrics.tmDescent;
+ retval.DigitizedAspectX = metrics.tmDigitizedAspectX;
+ retval.DigitizedAspectY = metrics.tmDigitizedAspectY;
+ retval.ExternalLeading = metrics.tmExternalLeading;
+ retval.FirstChar = (char)metrics.tmFirstChar;
+ retval.Height = metrics.tmHeight;
+ retval.InternalLeading = metrics.tmInternalLeading;
+ retval.Italic = metrics.tmItalic == 0 ? false : true;
+ retval.LastChar = (char)metrics.tmLastChar;
+ retval.MaxCharWidth = metrics.tmMaxCharWidth;
+ retval.Overhang = metrics.tmOverhang;
+ retval.PitchAndFamily = (TextMetricsPitchAndFamilyValues)metrics.tmPitchAndFamily;
+ retval.StruckOut = metrics.tmStruckOut == 0 ? false : true;
+ retval.Underlined = metrics.tmUnderlined == 0 ? false : true;
+ retval.Weight = metrics.tmWeight;
+
+ result = retval;
+ return hresult;
+ }
+ public int UxThemeHitTestThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, HitTestOptions options, Rectangle backgroundRectangle, IntPtr hrgn, Point pt, out HitTestCode result)
+ {
+ XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (backgroundRectangle);
+ int retval;
+
+ int hresult = UXTheme.HitTestThemeBackground (hTheme, dc.GetHdc (), iPartId, iStateId, (uint)options, ref BoundsRect, hrgn, new POINT(pt.X, pt.Y), out retval);
+ dc.ReleaseHdc ();
+
+ result = (HitTestCode)retval;
+ return hresult;
+ }
+ public bool UxThemeIsAppThemed ()
+ {
+ return UXTheme.IsAppThemed ();
+ }
+ public bool UxThemeIsThemeActive ()
+ {
+ return UXTheme.IsThemeActive ();
+ }
+ public bool UxThemeIsThemePartDefined (IntPtr hTheme, int iPartId)
+ {
+ return UXTheme.IsThemePartDefined (hTheme, iPartId, 0);
+ }
+ public bool UxThemeIsThemeBackgroundPartiallyTransparent (IntPtr hTheme, int iPartId, int iStateId)
+ {
+ int retval = UXTheme.IsThemeBackgroundPartiallyTransparent (hTheme, iPartId, iStateId);
+
+ return retval == 0 ? false : true;
+ }
+ public IntPtr UxThemeOpenThemeData (IntPtr hWnd, string classList)
+ {
+ return UXTheme.OpenThemeData (hWnd, classList);
+ }
+ #endregion
+ #region VisualStyleInformation
+ public string VisualStyleInformationAuthor {
+ get {
+ return GetData ("AUTHOR");
+ }
+ }
+ public string VisualStyleInformationColorScheme {
+ get {
+ StringBuilder ThemeName = new StringBuilder (260);
+ StringBuilder ColorName = new StringBuilder (260);
+ StringBuilder SizeName = new StringBuilder (260);
+ UXTheme.GetCurrentThemeName (ThemeName, ThemeName.Capacity, ColorName, ColorName.Capacity, SizeName, SizeName.Capacity);
+
+ return ColorName.ToString ();
+ }
+ }
+ public string VisualStyleInformationCompany {
+ get {
+ return GetData ("COMPANY");
+ }
+ }
+ public Color VisualStyleInformationWidgetHighlightHot {
+ get {
+ IntPtr theme = UXTheme.OpenThemeData (IntPtr.Zero, "BUTTON");
+
+ uint retval = UXTheme.GetThemeSysColor (theme, 1621);
+ UXTheme.CloseThemeData (theme);
+
+ return System.Drawing.Color.FromArgb ((int)(0x000000FFU & retval),
+ (int)(0x0000FF00U & retval) >> 8, (int)(0x00FF0000U & retval) >> 16);
+ }
+ }
+ public string VisualStyleInformationCopyright {
+ get {
+ return GetData ("COPYRIGHT");
+ }
+ }
+ public string VisualStyleInformationDescription {
+ get {
+ return GetData ("DESCRIPTION");
+ }
+ }
+ public string VisualStyleInformationDisplayName {
+ get {
+ return GetData ("DISPLAYNAME");
+ }
+ }
+ public string VisualStyleInformationFileName {
+ get {
+ StringBuilder ThemeName = new StringBuilder (260);
+ StringBuilder ColorName = new StringBuilder (260);
+ StringBuilder SizeName = new StringBuilder (260);
+ UXTheme.GetCurrentThemeName (ThemeName, ThemeName.Capacity, ColorName, ColorName.Capacity, SizeName, SizeName.Capacity);
+
+ return ThemeName.ToString ();
+ }
+ }
+ static string GetData (string propertyName)
+ {
+ StringBuilder ThemeName = new StringBuilder (260);
+ StringBuilder ColorName = new StringBuilder (260);
+ StringBuilder SizeName = new StringBuilder (260);
+
+ UXTheme.GetCurrentThemeName (ThemeName, ThemeName.Capacity, ColorName, ColorName.Capacity, SizeName, SizeName.Capacity);
+
+ StringBuilder PropertyValue = new StringBuilder (260);
+
+ UXTheme.GetThemeDocumentationProperty (ThemeName.ToString(), propertyName, PropertyValue, PropertyValue.Capacity);
+
+ return PropertyValue.ToString ();
+ }
+ public bool VisualStyleInformationIsSupportedByOS {
+ get {
+ return IsSupported ();
+ }
+ }
+ public int VisualStyleInformationMinimumColorDepth {
+ get {
+ IntPtr theme = UXTheme.OpenThemeData (IntPtr.Zero, "BUTTON");
+ int retval;
+
+ UXTheme.GetThemeSysInt (theme, 1301, out retval);
+ UXTheme.CloseThemeData (theme);
+
+ return retval;
+ }
+ }
+ public static bool IsSupported ()
+ {
+ // Supported OS's should be NT based and at least XP (XP, 2003, Vista)
+ if ((Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version >= new Version (5, 1)))
+ return true;
+
+ return false;
+ }
+ public string VisualStyleInformationSize {
+ get {
+ StringBuilder ThemeName = new StringBuilder (260);
+ StringBuilder ColorName = new StringBuilder (260);
+ StringBuilder SizeName = new StringBuilder (260);
+ UXTheme.GetCurrentThemeName (ThemeName, ThemeName.Capacity, ColorName, ColorName.Capacity, SizeName, SizeName.Capacity);
+
+ return SizeName.ToString ();
+ }
+ }
+ public bool VisualStyleInformationSupportsFlatMenus {
+ get {
+ IntPtr theme = UXTheme.OpenThemeData (IntPtr.Zero, "BUTTON");
+ bool retval;
+
+ retval = UXTheme.GetThemeSysBool (theme, 1001) == 0 ? false : true;
+ UXTheme.CloseThemeData (theme);
+
+ return retval;
+ }
+ }
+ public Color VisualStyleInformationTextWidgetBorder {
+ get {
+ IntPtr theme = UXTheme.OpenThemeData (IntPtr.Zero, "EDIT");
+
+ uint retval = UXTheme.GetThemeSysColor (theme, 1611);
+ UXTheme.CloseThemeData (theme);
+
+ return System.Drawing.Color.FromArgb ((int)(0x000000FFU & retval),
+ (int)(0x0000FF00U & retval) >> 8, (int)(0x00FF0000U & retval) >> 16);
+ }
+ }
+ public string VisualStyleInformationUrl {
+ get {
+ return GetData ("URL");
+ }
+ }
+ public string VisualStyleInformationVersion {
+ get {
+ return GetData ("VERSION");
+ }
+ }
+ #endregion
+ #region VisualStyleRenderer
+ public void VisualStyleRendererDrawBackgroundExcludingArea (IntPtr theme, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle excludedArea)
+ {
+ XplatUIWin32.RECT bounds_rect = XplatUIWin32.RECT.FromRectangle (bounds);
+ IntPtr hdc = dc.GetHdc ();
+ XplatUIWin32.Win32ExcludeClipRect (hdc, excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom);
+ UXTheme.DrawThemeBackground (theme, hdc, part, state, ref bounds_rect, IntPtr.Zero);
+ IntPtr hrgn = XplatUIWin32.Win32CreateRectRgn (excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom);
+ XplatUIWin32.Win32ExtSelectClipRgn (hdc, hrgn, (int)ClipCombineMode.RGN_OR);
+ XplatUIWin32.Win32DeleteObject (hrgn);
+ dc.ReleaseHdc ();
+ }
+ #endregion
+ }
+}