2
// This file has been generated by the GUI designer. Do not modify.
7
private static bool initialized;
9
internal static void Initialize (Gtk.Widget iconRenderer)
11
if ((Stetic.Gui.initialized == false)) {
12
Stetic.Gui.initialized = true;
17
internal class IconLoader
19
public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
21
Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
27
global::Gtk.Icon.SizeLookup (size, out sz, out sy);
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);
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);
51
internal class BinContainer
53
private Gtk.Widget child;
54
private Gtk.UIManager uimanager;
56
public static BinContainer Attach (Gtk.Bin bin)
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);
65
private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
67
if ((this.child != null)) {
68
args.Requisition = this.child.SizeRequest ();
72
private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
74
if ((this.child != null)) {
75
this.child.Allocation = args.Allocation;
79
private void OnAdded (object sender, Gtk.AddedArgs args)
81
this.child = args.Widget;
84
public void SetUiManager (Gtk.UIManager uim)
87
this.child.Realized += new System.EventHandler (this.OnRealized);
90
private void OnRealized (object sender, System.EventArgs args)
92
if ((this.uimanager != null)) {
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;
103
internal class ActionGroups
105
public static Gtk.ActionGroup GetActionGroup (System.Type type)
107
return Stetic.ActionGroups.GetActionGroup (type.FullName);
110
public static Gtk.ActionGroup GetActionGroup (string name)