diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs | 104 |
1 files changed, 59 insertions, 45 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs index 5cdc11900b..3c6a731de3 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs @@ -6,9 +6,10 @@ namespace Stetic { private static bool initialized; - internal static void Initialize (Gtk.Widget iconRenderer) + internal static void Initialize(Gtk.Widget iconRenderer) { - if ((Stetic.Gui.initialized == false)) { + if ((Stetic.Gui.initialized == false)) + { Stetic.Gui.initialized = true; } } @@ -17,50 +18,54 @@ namespace Stetic internal class BinContainer { private Gtk.Widget child; - + private Gtk.UIManager uimanager; - public static BinContainer Attach (Gtk.Bin bin) + public static BinContainer Attach(Gtk.Bin bin) { - BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); - bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); - bin.Added += new Gtk.AddedHandler (bc.OnAdded); + BinContainer bc = new BinContainer(); + bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler(bc.OnAdded); return bc; } - private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) { - if ((this.child != null)) { - args.Requisition = this.child.SizeRequest (); + if ((this.child != null)) + { + args.Requisition = this.child.SizeRequest(); } } - private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) { - if ((this.child != null)) { + if ((this.child != null)) + { this.child.Allocation = args.Allocation; } } - private void OnAdded (object sender, Gtk.AddedArgs args) + private void OnAdded(object sender, Gtk.AddedArgs args) { this.child = args.Widget; } - public void SetUiManager (Gtk.UIManager uim) + public void SetUiManager(Gtk.UIManager uim) { this.uimanager = uim; - this.child.Realized += new System.EventHandler (this.OnRealized); + this.child.Realized += new System.EventHandler(this.OnRealized); } - private void OnRealized (object sender, System.EventArgs args) + private void OnRealized(object sender, System.EventArgs args) { - if ((this.uimanager != null)) { + if ((this.uimanager != null)) + { Gtk.Widget w; w = this.child.Toplevel; - if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { - ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) + { + ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup); this.uimanager = null; } } @@ -69,32 +74,41 @@ namespace Stetic internal class IconLoader { - public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size) { - Gdk.Pixbuf res = widget.RenderIcon (name, size, null); - if ((res != null)) { + Gdk.Pixbuf res = widget.RenderIcon(name, size, null); + if ((res != null)) + { return res; - } else { + } + else + { int sz; int sy; - global::Gtk.Icon.SizeLookup (size, out sz, out sy); - try { - return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); - } catch (System.Exception) { - if ((name != "gtk-missing-image")) { - return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); - } else { - Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); - Gdk.GC gc = new Gdk.GC (pmap); - gc.RgbFgColor = new Gdk.Color (255, 255, 255); - pmap.DrawRectangle (gc, true, 0, 0, sz, sz); - gc.RgbFgColor = new Gdk.Color (0, 0, 0); - pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); - gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); - gc.RgbFgColor = new Gdk.Color (255, 0, 0); - pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); - pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); - return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + global::Gtk.Icon.SizeLookup(size, out sz, out sy); + try + { + return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); + } + catch (System.Exception) + { + if ((name != "gtk-missing-image")) + { + return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size); + } + else + { + Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz); + Gdk.GC gc = new Gdk.GC(pmap); + gc.RgbFgColor = new Gdk.Color(255, 255, 255); + pmap.DrawRectangle(gc, true, 0, 0, sz, sz); + gc.RgbFgColor = new Gdk.Color(0, 0, 0); + pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1)); + gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + gc.RgbFgColor = new Gdk.Color(255, 0, 0); + pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); + pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); + return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); } } } @@ -103,12 +117,12 @@ namespace Stetic internal class ActionGroups { - public static Gtk.ActionGroup GetActionGroup (System.Type type) + public static Gtk.ActionGroup GetActionGroup(System.Type type) { - return Stetic.ActionGroups.GetActionGroup (type.FullName); + return Stetic.ActionGroups.GetActionGroup(type.FullName); } - public static Gtk.ActionGroup GetActionGroup (string name) + public static Gtk.ActionGroup GetActionGroup(string name) { return null; } |