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