diff options
Diffstat (limited to 'main/src/addins/MonoDevelop.GtkCore/libsteticui')
9 files changed, 2 insertions, 406 deletions
diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonFunction.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonFunction.cs deleted file mode 100644 index 9fa8ef4907..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonFunction.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace Stetic.Metacity -{ - - using System; - using System.Runtime.InteropServices; - -#region Autogenerated code - internal enum ButtonFunction { - - Menu, - Minimize, - Maximize, - Close, - Last, - } -#endregion -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonLayout.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonLayout.cs deleted file mode 100644 index e954c20a3e..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ButtonLayout.cs +++ /dev/null @@ -1,36 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace Stetic.Metacity -{ - - using System; - using System.Collections; - using System.Runtime.InteropServices; - -#region Autogenerated code - [StructLayout(LayoutKind.Sequential)] - internal struct ButtonLayout { - - [MarshalAs (UnmanagedType.ByValArray, SizeConst=4)] - public Metacity.ButtonFunction[] LeftButtons; - [MarshalAs (UnmanagedType.ByValArray, SizeConst=4)] - public Metacity.ButtonFunction[] RightButtons; - - public static Metacity.ButtonLayout Zero = new Metacity.ButtonLayout (); - - public static Metacity.ButtonLayout New(IntPtr raw) { - if (raw == IntPtr.Zero) { - return Metacity.ButtonLayout.Zero; - } - Metacity.ButtonLayout self = new Metacity.ButtonLayout(); - self = (Metacity.ButtonLayout) Marshal.PtrToStructure (raw, self.GetType ()); - return self; - } - - internal static GLib.GType GType { - get { return GLib.GType.Pointer; } - } -#endregion - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameFlags.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameFlags.cs deleted file mode 100644 index bc6172fbe8..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameFlags.cs +++ /dev/null @@ -1,30 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace Stetic.Metacity -{ - - using System; - using System.Runtime.InteropServices; - -#region Autogenerated code - [Flags] - internal enum FrameFlags { - - AllowsDelete = 1 << 0, - AllowsMenu = 1 << 1, - AllowsMinimize = 1 << 2, - AllowsMaximize = 1 << 3, - AllowsVerticalResize = 1 << 4, - AllowsHorizontalResize = 1 << 5, - HasFocus = 1 << 6, - Shaded = 1 << 7, - Stuck = 1 << 8, - Maximized = 1 << 9, - AllowsShade = 1 << 10, - AllowsMove = 1 << 11, - Fullscreen = 1 << 12, - IsFlashing = 1 << 13, - } -#endregion -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameType.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameType.cs deleted file mode 100644 index 7ecc08d277..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/FrameType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace Stetic.Metacity -{ - - using System; - using System.Runtime.InteropServices; - -#region Autogenerated code - internal enum FrameType { - - Normal, - Dialog, - ModalDialog, - Utility, - Menu, - Border, - Last, - } -#endregion -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ObjectManager.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ObjectManager.cs deleted file mode 100644 index 201c52370e..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/ObjectManager.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace GtkSharp.MetacitySharp { - - class ObjectManager { - - static bool initialized = false; - // Call this method from the appropriate module init function. - public static void Initialize () - { - if (initialized) - return; - - initialized = true; - GLib.GType.Register (Stetic.Metacity.Preview.GType, typeof (Stetic.Metacity.Preview)); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Preview.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Preview.cs deleted file mode 100644 index b0bd5ba026..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Preview.cs +++ /dev/null @@ -1,226 +0,0 @@ -// This file was generated by the Gtk# code generator. -// Any changes made will be lost if regenerated. - -namespace Stetic.Metacity { - - using System; - using System.Reflection; - using System.Collections; - using System.Runtime.InteropServices; - - internal class Preview : Gtk.Bin - { - const string LIBMETACITY = "libmetacity-private.so.0"; - static Theme theme; - public static bool ThemeError = false; - - public static Metacity.Preview Create (TopLevelWindow window) - { - Metacity.Preview metacityPreview; - - try { - Metacity.Preview.Init (); - metacityPreview = new Metacity.Preview (); - } - catch { - return null; - } - - switch (window.TypeHint) { - case Gdk.WindowTypeHint.Normal: - metacityPreview.FrameType = Metacity.FrameType.Normal; - break; - case Gdk.WindowTypeHint.Dialog: - metacityPreview.FrameType = window.Modal ? Metacity.FrameType.ModalDialog : Metacity.FrameType.Dialog; - break; - case Gdk.WindowTypeHint.Menu: - metacityPreview.FrameType = Metacity.FrameType.Menu; - break; - case Gdk.WindowTypeHint.Splashscreen: - metacityPreview.FrameType = Metacity.FrameType.Border; - break; - case Gdk.WindowTypeHint.Utility: - metacityPreview.FrameType = Metacity.FrameType.Utility; - break; - default: - metacityPreview.FrameType = Metacity.FrameType.Normal; - break; - } - - Metacity.FrameFlags flags = - Metacity.FrameFlags.AllowsDelete | - Metacity.FrameFlags.AllowsVerticalResize | - Metacity.FrameFlags.AllowsHorizontalResize | - Metacity.FrameFlags.AllowsMove | - Metacity.FrameFlags.AllowsShade | - Metacity.FrameFlags.HasFocus; - - if (window.Resizable) - flags = flags | Metacity.FrameFlags.AllowsMaximize; - - metacityPreview.FrameFlags = flags; - metacityPreview.ShowAll (); - metacityPreview.AddWindow (window); - - metacityPreview.Theme = GetTheme (); - - return metacityPreview; - } - - public void AddWindow (TopLevelWindow window) - { - base.Add (window); - - Title = window.Title ?? string.Empty; - window.PropertyChanged += OnWindowPropChange; - Destroyed += delegate { - window.PropertyChanged -= OnWindowPropChange; - }; - } - - void OnWindowPropChange (object ob, EventArgs e) - { - Title = ((TopLevelWindow)ob).Title ?? string.Empty; - } - - static Theme GetTheme () - { - if (theme == null) { - try { - Assembly assm = Assembly.LoadWithPartialName ("gconf-sharp"); - Type client_type = assm.GetType ("GConf.Client"); - MethodInfo method = client_type.GetMethod ("Get", BindingFlags.Instance | BindingFlags.Public); - object client = Activator.CreateInstance (client_type, new object[] { - - }); - string themeName = (string)method.Invoke (client, new object[] { "/apps/metacity/general/theme" }); - theme = Metacity.Theme.Load (themeName); - } catch { - // Set theme error flag - in case of a theme error a solid background needs to be drawn. - ThemeError = true; - // Don't crash if metacity is not available - return null; - } - } - return theme; - } - - /* static void GConfNotify (object obj, GConf.NotifyEventArgs args) - { - if (args.Key == "/apps/metacity/general/theme") { - theme = Metacity.Theme.Load ((string)args.Value); - foreach (Metacity.Preview prev in wrappers.Values) - prev.Theme = Theme; - } - } - */ - - ~Preview ( ) - { - Dispose(); - } - - public Preview(IntPtr raw) : base(raw) {} - - [DllImport(LIBMETACITY)] - static extern IntPtr meta_preview_new(); - - public Preview () : base (IntPtr.Zero) - { - if (GetType () != typeof (Preview)) { - CreateNativeObject (new string [0], new GLib.Value[0]); - return; - } - Raw = meta_preview_new(); - } - - [DllImport(LIBMETACITY)] - static extern void meta_preview_set_title(IntPtr raw, IntPtr title); - - public string Title { - set { - IntPtr title_as_native = GLib.Marshaller.StringToPtrGStrdup (value); - meta_preview_set_title(Handle, title_as_native); - GLib.Marshaller.Free (title_as_native); - } - } - - [DllImport(LIBMETACITY)] - static extern void meta_preview_set_button_layout(IntPtr raw, ref Stetic.Metacity.ButtonLayout button_layout); - - public Stetic.Metacity.ButtonLayout ButtonLayout - { - set { - meta_preview_set_button_layout(Handle, ref value); - } - } - - [DllImport(LIBMETACITY)] - static extern void meta_preview_set_theme(IntPtr raw, IntPtr theme); - - public Metacity.Theme Theme { - set { - meta_preview_set_theme(Handle, (value == null ? IntPtr.Zero : value.Handle)); - } - } - - [DllImport(LIBMETACITY)] - static extern IntPtr meta_preview_get_mini_icon(); - - public static Gdk.Pixbuf MiniIcon { - get { - IntPtr raw_ret = meta_preview_get_mini_icon(); - Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; - return ret; - } - } - - [DllImport(LIBMETACITY)] - static extern IntPtr meta_preview_get_icon(); - - public static Gdk.Pixbuf Icon { - get { - IntPtr raw_ret = meta_preview_get_icon(); - Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; - return ret; - } - } - - [DllImport(LIBMETACITY)] - static extern void meta_preview_set_frame_type(IntPtr raw, int type); - - public Stetic.Metacity.FrameType FrameType - { - set { - meta_preview_set_frame_type(Handle, (int) value); - } - } - - [DllImport(LIBMETACITY)] - static extern IntPtr meta_preview_get_type(); - - public static new GLib.GType GType { - get { - IntPtr raw_ret = meta_preview_get_type(); - GLib.GType ret = new GLib.GType(raw_ret); - return ret; - } - } - - [DllImport(LIBMETACITY)] - static extern void meta_preview_set_frame_flags(IntPtr raw, int flags); - - public Stetic.Metacity.FrameFlags FrameFlags - { - set { - meta_preview_set_frame_flags(Handle, (int) value); - } - } - - - public static void Init() - { - GtkSharp.MetacitySharp.ObjectManager.Initialize (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Theme.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Theme.cs deleted file mode 100644 index b9254d710d..0000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Metacity/Theme.cs +++ /dev/null @@ -1,41 +0,0 @@ - -namespace Stetic.Metacity -{ - using System; - using System.Runtime.InteropServices; - - internal class Theme : GLib.Opaque { - - public Theme (IntPtr raw) : base (raw) {} - - [DllImport("libmetacity-private.so.0")] - static extern IntPtr meta_theme_get_current (); - - public static Theme Current { - get { - IntPtr raw = meta_theme_get_current (); - return (Theme)GetOpaque (raw, typeof (Metacity.Theme), true); - } - } - - [DllImport("libmetacity-private.so.0")] - static extern IntPtr meta_theme_load (string theme_name, IntPtr err); - - public static Theme Load (string name) - { - IntPtr raw = meta_theme_load (name, IntPtr.Zero); - if (raw == IntPtr.Zero) - return null; - else - return (Theme)GetOpaque (raw, typeof (Metacity.Theme), true); - } - - [DllImport("libmetacity-private.so.0")] - static extern void meta_theme_free (IntPtr raw); - - protected override void Free (IntPtr raw) - { - meta_theme_free (Raw); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesignerBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesignerBackend.cs index aad811474c..e3d6864c2c 100644 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesignerBackend.cs +++ b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesignerBackend.cs @@ -78,9 +78,7 @@ namespace Stetic TopLevelWindow window = container as TopLevelWindow; if (window != null) { - preview = Stetic.Metacity.Preview.Create (window); - if (preview == null) - preview = Stetic.Windows.Preview.Create (window); + preview = Stetic.Windows.Preview.Create (window); if (preview == null) { // Use a regular box. EventBox eventBox = new EventBox (); @@ -660,8 +658,7 @@ namespace Stetic PropagateExpose (cw, ev);*/ Gdk.Rectangle rect = child.Allocation; - if (Stetic.Metacity.Preview.ThemeError) - GdkWindow.DrawRectangle (this.Style.BackgroundGC (StateType.Normal), true, rect.X, rect.Y, rect.Width, rect.Height); + GdkWindow.DrawRectangle (this.Style.BackgroundGC (StateType.Normal), true, rect.X, rect.Y, rect.Width, rect.Height); Pixbuf sh = Shadow.AddShadow (rect.Width, rect.Height); GdkWindow.DrawPixbuf (this.Style.BackgroundGC (StateType.Normal), sh, 0, 0, rect.X - 5, rect.Y - 5, sh.Width, sh.Height, RgbDither.None, 0, 0); diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj index fc38b4c1e5..fb9b52a59d 100644 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj +++ b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj @@ -109,13 +109,6 @@ <Compile Include="GuiDispatchServerSink.cs" /> <Compile Include="GuiDispatchServerSinkProvider.cs" /> <Compile Include="LibraryCache.cs" /> - <Compile Include="Metacity\ButtonFunction.cs" /> - <Compile Include="Metacity\ButtonLayout.cs" /> - <Compile Include="Metacity\FrameFlags.cs" /> - <Compile Include="Metacity\FrameType.cs" /> - <Compile Include="Metacity\ObjectManager.cs" /> - <Compile Include="Metacity\Preview.cs" /> - <Compile Include="Metacity\Theme.cs" /> <Compile Include="Palette.cs" /> <Compile Include="PaletteBackend.cs" /> <Compile Include="PluggableWidget.cs" /> |