00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 namespace Stetic {
00012
00013
00014 internal class Gui {
00015
00016 private static bool initialized;
00017
00018 internal static void Initialize(Gtk.Widget iconRenderer) {
00019 if ((Stetic.Gui.initialized == false)) {
00020 Stetic.Gui.initialized = true;
00021 }
00022 }
00023 }
00024
00025 internal class BinContainer {
00026
00027 private Gtk.Widget child;
00028
00029 private Gtk.UIManager uimanager;
00030
00031 public static BinContainer Attach(Gtk.Bin bin) {
00032 BinContainer bc = new BinContainer();
00033 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
00034 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
00035 bin.Added += new Gtk.AddedHandler(bc.OnAdded);
00036 return bc;
00037 }
00038
00039 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {
00040 if ((this.child != null)) {
00041 args.Requisition = this.child.SizeRequest();
00042 }
00043 }
00044
00045 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {
00046 if ((this.child != null)) {
00047 this.child.Allocation = args.Allocation;
00048 }
00049 }
00050
00051 private void OnAdded(object sender, Gtk.AddedArgs args) {
00052 this.child = args.Widget;
00053 }
00054
00055 public void SetUiManager(Gtk.UIManager uim) {
00056 this.uimanager = uim;
00057 this.child.Realized += new System.EventHandler(this.OnRealized);
00058 }
00059
00060 private void OnRealized(object sender, System.EventArgs args) {
00061 if ((this.uimanager != null)) {
00062 Gtk.Widget w;
00063 w = this.child.Toplevel;
00064 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {
00065 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
00066 this.uimanager = null;
00067 }
00068 }
00069 }
00070 }
00071
00072 internal class ActionGroups {
00073
00074 public static Gtk.ActionGroup GetActionGroup(System.Type type) {
00075 return Stetic.ActionGroups.GetActionGroup(type.FullName);
00076 }
00077
00078 public static Gtk.ActionGroup GetActionGroup(string name) {
00079 return null;
00080 }
00081 }
00082 }