comparison gtk-gui/generated.cs @ 0:1bb28f84d567

Initial commit of WarFoundry code
author IBBoard <dev@ibboard.co.uk>
date Fri, 19 Dec 2008 15:57:51 +0000
parents
children cfc7683e73f9
comparison
equal deleted inserted replaced
-1:000000000000 0:1bb28f84d567
1 // ------------------------------------------------------------------------------
2 // <autogenerated>
3 // This code was generated by a tool.
4 // Mono Runtime Version: 2.0.50727.42
5 //
6 // Changes to this file may cause incorrect behavior and will be lost if
7 // the code is regenerated.
8 // </autogenerated>
9 // ------------------------------------------------------------------------------
10
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 IconLoader {
26
27 public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) {
28 Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
29 if ((res != null)) {
30 return res;
31 }
32 else {
33 try {
34 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
35 }
36 catch (System.Exception ) {
37 if ((name != "gtk-missing-image")) {
38 return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz);
39 }
40 else {
41 Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);
42 Gdk.GC gc = new Gdk.GC(pmap);
43 gc.RgbFgColor = new Gdk.Color(255, 255, 255);
44 pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
45 gc.RgbFgColor = new Gdk.Color(0, 0, 0);
46 pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));
47 gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
48 gc.RgbFgColor = new Gdk.Color(255, 0, 0);
49 pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
50 pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
51 return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
52 }
53 }
54 }
55 }
56 }
57
58 internal class BinContainer {
59
60 private Gtk.Widget child;
61
62 private Gtk.UIManager uimanager;
63
64 public static BinContainer Attach(Gtk.Bin bin) {
65 BinContainer bc = new BinContainer();
66 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
67 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
68 bin.Added += new Gtk.AddedHandler(bc.OnAdded);
69 return bc;
70 }
71
72 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {
73 if ((this.child != null)) {
74 args.Requisition = this.child.SizeRequest();
75 }
76 }
77
78 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {
79 if ((this.child != null)) {
80 this.child.Allocation = args.Allocation;
81 }
82 }
83
84 private void OnAdded(object sender, Gtk.AddedArgs args) {
85 this.child = args.Widget;
86 }
87
88 public void SetUiManager(Gtk.UIManager uim) {
89 this.uimanager = uim;
90 this.child.Realized += new System.EventHandler(this.OnRealized);
91 }
92
93 private void OnRealized(object sender, System.EventArgs args) {
94 if ((this.uimanager != null)) {
95 Gtk.Widget w;
96 w = this.child.Toplevel;
97 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {
98 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
99 this.uimanager = null;
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 }
115 }