~ubuntu-branches/ubuntu/trusty/gnome-do/trusty

« back to all changes in this revision

Viewing changes to Do.Platform.Linux/gtk-gui/generated.cs

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-03-26 11:12:21 UTC
  • mfrom: (0.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120326111221-1jk143fy37zxi3e4
Tags: 0.9-1
* New upstream version no longer uses deprecated internal glib headers.
  (Closes: #665537)
* [59fa37b9] Fix watch file
* [63486516] Imported Upstream version 0.9
* [8c636d84] Disable testsuite for now; requires running dbus and gconf daemons
* [e46de4b9] Remove inaccurate README.Source
* [4591d677] Add git-buildpackage configuration to default to pristine-tar

Show diffs side-by-side

added added

removed removed

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