You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. namespace Stetic {
  11. internal class Gui {
  12. private static bool initialized;
  13. internal static void Initialize(Gtk.Widget iconRenderer) {
  14. if ((Stetic.Gui.initialized == false)) {
  15. Stetic.Gui.initialized = true;
  16. }
  17. }
  18. }
  19. internal class IconLoader {
  20. public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) {
  21. Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
  22. if ((res != null)) {
  23. return res;
  24. }
  25. else {
  26. try {
  27. return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
  28. }
  29. catch (System.Exception ) {
  30. if ((name != "gtk-missing-image")) {
  31. return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz);
  32. }
  33. else {
  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);
  45. }
  46. }
  47. }
  48. }
  49. }
  50. internal class BinContainer {
  51. private Gtk.Widget child;
  52. private Gtk.UIManager uimanager;
  53. public static BinContainer Attach(Gtk.Bin bin) {
  54. BinContainer bc = new BinContainer();
  55. bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
  56. bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
  57. bin.Added += new Gtk.AddedHandler(bc.OnAdded);
  58. return bc;
  59. }
  60. private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {
  61. if ((this.child != null)) {
  62. args.Requisition = this.child.SizeRequest();
  63. }
  64. }
  65. private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {
  66. if ((this.child != null)) {
  67. this.child.Allocation = args.Allocation;
  68. }
  69. }
  70. private void OnAdded(object sender, Gtk.AddedArgs args) {
  71. this.child = args.Widget;
  72. }
  73. public void SetUiManager(Gtk.UIManager uim) {
  74. this.uimanager = uim;
  75. this.child.Realized += new System.EventHandler(this.OnRealized);
  76. }
  77. private void OnRealized(object sender, System.EventArgs args) {
  78. if ((this.uimanager != null)) {
  79. Gtk.Widget w;
  80. w = this.child.Toplevel;
  81. if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {
  82. ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
  83. this.uimanager = null;
  84. }
  85. }
  86. }
  87. }
  88. internal class ActionGroups {
  89. public static Gtk.ActionGroup GetActionGroup(System.Type type) {
  90. return Stetic.ActionGroups.GetActionGroup(type.FullName);
  91. }
  92. public static Gtk.ActionGroup GetActionGroup(string name) {
  93. return null;
  94. }
  95. }
  96. }