~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/mono-addins/Mono.Addins.Gui/gtk-gui/generated.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// This file has been generated by the GUI designer. Do not modify.
 
3
namespace Stetic
 
4
{
 
5
        internal class Gui
 
6
        {
 
7
                private static bool initialized;
 
8
 
 
9
                internal static void Initialize (Gtk.Widget iconRenderer)
 
10
                {
 
11
                        if ((Stetic.Gui.initialized == false)) {
 
12
                                Stetic.Gui.initialized = true;
 
13
                        }
 
14
                }
 
15
        }
 
16
 
 
17
        internal class IconLoader
 
18
        {
 
19
                public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
 
20
                {
 
21
                        Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
 
22
                        if ((res != null)) {
 
23
                                return res;
 
24
                        } else {
 
25
                                int sz;
 
26
                                int sy;
 
27
                                global::Gtk.Icon.SizeLookup (size, out  sz, out  sy);
 
28
                                try {
 
29
                                        return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
 
30
                                } catch (System.Exception) {
 
31
                                        if ((name != "gtk-missing-image")) {
 
32
                                                return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
 
33
                                        } else {
 
34
                                                Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
 
35
                                                Gdk.GC gc = new Gdk.GC (pmap);
 
36
                                                gc.RgbFgColor = new Gdk.Color (255, 255, 255);
 
37
                                                pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
 
38
                                                gc.RgbFgColor = new Gdk.Color (0, 0, 0);
 
39
                                                pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
 
40
                                                gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
 
41
                                                gc.RgbFgColor = new Gdk.Color (255, 0, 0);
 
42
                                                pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
 
43
                                                pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
 
44
                                                return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
 
45
                                        }
 
46
                                }
 
47
                        }
 
48
                }
 
49
        }
 
50
 
 
51
        internal class BinContainer
 
52
        {
 
53
                private Gtk.Widget child;
 
54
                private Gtk.UIManager uimanager;
 
55
 
 
56
                public static BinContainer Attach (Gtk.Bin bin)
 
57
                {
 
58
                        BinContainer bc = new BinContainer ();
 
59
                        bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
 
60
                        bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
 
61
                        bin.Added += new Gtk.AddedHandler (bc.OnAdded);
 
62
                        return bc;
 
63
                }
 
64
 
 
65
                private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
 
66
                {
 
67
                        if ((this.child != null)) {
 
68
                                args.Requisition = this.child.SizeRequest ();
 
69
                        }
 
70
                }
 
71
 
 
72
                private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
 
73
                {
 
74
                        if ((this.child != null)) {
 
75
                                this.child.Allocation = args.Allocation;
 
76
                        }
 
77
                }
 
78
 
 
79
                private void OnAdded (object sender, Gtk.AddedArgs args)
 
80
                {
 
81
                        this.child = args.Widget;
 
82
                }
 
83
 
 
84
                public void SetUiManager (Gtk.UIManager uim)
 
85
                {
 
86
                        this.uimanager = uim;
 
87
                        this.child.Realized += new System.EventHandler (this.OnRealized);
 
88
                }
 
89
 
 
90
                private void OnRealized (object sender, System.EventArgs args)
 
91
                {
 
92
                        if ((this.uimanager != null)) {
 
93
                                Gtk.Widget w;
 
94
                                w = this.child.Toplevel;
 
95
                                if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
 
96
                                        ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
 
97
                                        this.uimanager = null;
 
98
                                }
 
99
                        }
 
100
                }
 
101
        }
 
102
 
 
103
        internal class ActionGroups
 
104
        {
 
105
                public static Gtk.ActionGroup GetActionGroup (System.Type type)
 
106
                {
 
107
                        return Stetic.ActionGroups.GetActionGroup (type.FullName);
 
108
                }
 
109
 
 
110
                public static Gtk.ActionGroup GetActionGroup (string name)
 
111
                {
 
112
                        return null;
 
113
                }
 
114
        }
 
115
}