[Monodevelop-patches-list] r1715 - trunk/MonoDevelop/src/Libraries/Gdl
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Jun 8 16:05:10 EDT 2004
Author: tberman
Date: 2004-06-08 16:05:10 -0400 (Tue, 08 Jun 2004)
New Revision: 1715
Modified:
trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockNotebook.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockObject.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockPaned.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockPlaceholder.cs
trunk/MonoDevelop/src/Libraries/Gdl/DockRequest.cs
Log:
code compiles, doubt it works, havnt tested, DockPaned still isnt ported at all really
Modified: trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -88,11 +88,11 @@
}
}
- protected void OnSizeRequested (ref Gtk.Requisition requisition)
+ protected override void OnSizeRequested (ref Gtk.Requisition requisition)
{
- int border_width = this.BorderWidth;
+ int border_width = (int)this.BorderWidth;
if (this.root != null && this.root.Visible)
- this.root.SizeRequest (requisition);
+ this.root.SetSizeRequest (requisition.Width, requisition.Height);
else {
requisition.Width = 0;
requisition.Height = 0;
@@ -102,9 +102,9 @@
requisition.Height += 2 * border_width;
}
- protected void OnSizeAllocated (ref Gdk.Rectangle allocation)
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
- int border_width = this.BorderWidth;
+ int border_width = (int)this.BorderWidth;
allocation.X += border_width;
allocation.Y += border_width;
allocation.Width = Math.Max (1, allocation.Width - 2 * border_width);
@@ -114,7 +114,7 @@
this.root.SizeAllocate (allocation);
}
- protected void OnMapped ()
+ protected override void OnMapped ()
{
base.OnMapped ();
if (this.root != null) {
@@ -123,7 +123,7 @@
}
}
- protected void OnUnmapped ()
+ protected override void OnUnmapped ()
{
base.OnUnmapped ();
if (this.root != null) {
@@ -134,9 +134,9 @@
window.Unmap ();
}
- public override void Show ()
+ protected override void OnShown ()
{
- base.Show ();
+ base.OnShown ();
if (this.floating && this.window != null)
this.window.Show ();
/*PORT:
@@ -148,9 +148,9 @@
*/
}
- public override void Hide ()
+ protected override void OnHidden ()
{
- base.Hide ();
+ base.OnHidden ();
if (this.floating && this.window != null)
this.window.Hide ();
/*PORT:
@@ -184,7 +184,7 @@
protected override void ForAll (bool include_internals, CallbackInvoker invoker)
{
- if (this.root)
+ if (this.root != null)
invoker.Invoke (this.root);
}
@@ -213,7 +213,7 @@
if (this.floating)
this.Hide ();
else {
- if (this.Parent && this.Parent is Gtk.Container)
+ if (this.Parent != null && this.Parent is Gtk.Container)
((Gtk.Container)this.Parent).Remove (this);
}
}
@@ -222,7 +222,7 @@
public override bool DockRequest (int x, int y, DockRequest request)
{
Gdk.Rectangle alloc = this.Allocation;
- uint bw = this.BorderWidth;
+ int bw = (int)this.BorderWidth;
int rel_x = x - alloc.X;
int rel_y = y - alloc.Y;
DockRequest my_request = null;
@@ -248,21 +248,21 @@
if (rel_x < bw) {
my_request.Position = DockPlacement.Left;
- req_rect.Width *= 0.3;
+ req_rect.Width = (int)(req_rect.Width * 0.3);
my_request.Rect = req_rect;
} else if (rel_x > alloc.Width - bw) {
my_request.Position = DockPlacement.Right;
- req_rect.X += req_rect.Width * (1 - 0.3);
- req_rect.Width *= 0.3;
+ req_rect.X += (int)(req_rect.Width * (1 - 0.3));
+ req_rect.Width = (int)(req_rect.Width * 0.3);
my_request.Rect = req_rect;
} else if (rel_y < bw) {
my_request.Position = DockPlacement.Top;
- req_rect.Height *= 0.3;
+ req_rect.Height = (int)(req_rect.Height * 0.3);
my_request.Rect = req_rect;
} else if (rel_y > alloc.Height - bw) {
my_request.Position = DockPlacement.Bottom;
- req_rect.y += req_rect.Height * (1 - 0.3);
- req_rect.Height *= 0.3;
+ req_rect.Y += (int)(req_rect.Height * (1 - 0.3));
+ req_rect.Height = (int)(req_rect.Height * 0.3);
my_request.Rect = req_rect;
} else {
may_dock = this.root.DockRequest (x, y, my_request);
@@ -275,26 +275,23 @@
return may_dock;
}
- public override void Dock (DockObject requestor, DockPlacement position, object user_data)
+ public override void Docking (DockObject requestor, DockPlacement position, object user_data)
{
if (!(requestor is DockItem))
return;
if (position == DockPlacement.Floating) {
DockItem item = requestor as DockItem;
- int x, y, width, height;
+ int x = 0, y = 0, width = -1, height = 01;
if (user_data != null && user_data is Gdk.Rectangle) {
- Gdk.Rectangle rect = user_data as Gdk.Rectangle;
+ Gdk.Rectangle rect = (Gdk.Rectangle)user_data;
x = rect.X;
y = rect.Y;
width = rect.Width;
height = rect.Height;
- } else {
- x = y = 0;
- width = height = -1;
}
AddFloatingItem (item, x, y, width, height);
} else if (this.root != null) {
- this.root.Dock (requestor, position, null);
+ this.root.Docking (requestor, position, null);
//gdl_dock_set_title (dock /*this*/);
} else {
this.root = requestor;
@@ -317,7 +314,7 @@
bool handled = false;
if (this.floating && new_position == DockPlacement.Floating && this.root == requestor) {
if (other_data != null && other_data is Gdk.Rectangle) {
- Gdk.Rectangle rect = other_data as Gdk.Rectangle;
+ Gdk.Rectangle rect = (Gdk.Rectangle)other_data;
if (this.window != null && this.window is Gtk.Window) {
((Gtk.Window)this.window).Move (rect.X, rect.Y);
handled = true;
@@ -327,7 +324,7 @@
return handled;
}
- public override bool ChildPlacement (DockObject child, DockPlacement placement)
+ public override bool ChildPlacement (DockObject child, ref DockPlacement placement)
{
bool retval = true;
if (this.root == child) {
@@ -352,7 +349,7 @@
if (placement == DockPlacement.Floating)
AddFloatingItem (item, 0, 0, -1, -1);
else
- this.Dock (item, null);
+ this.Docking (item, placement, null);
}
public void AddFloatingItem (DockItem item, int x, int y, int width, int height)
@@ -375,9 +372,9 @@
{
if (name == null)
return null;
- DockObject found = DockMaster.GetObject (name);
+ DockObject found = this.Master.GetObject (name);
if (found != null && found is DockItem)
- return found;
+ return (DockItem)found;
return null;
}
@@ -385,9 +382,9 @@
{
if (name == null)
return null;
- DockObject found = DockMaster.GetObject (name);
+ DockObject found = this.Master.GetObject (name);
if (found != null && found is DockPlaceholder)
- return found;
+ return (DockPlaceholder)found;
return null;
}
@@ -398,6 +395,7 @@
gdl_dock_master_foreach (GDL_DOCK_OBJECT_GET_MASTER (dock),
(GFunc) _gdl_dock_foreach_build_list, &list);
*/
+ return null;
}
}
@@ -406,7 +404,7 @@
DockObject parent = obj;
while (parent != null && !(parent is Gdl.Dock))
parent = parent.ParentObject;
- return parent;
+ return (Dock)parent;
}
public void XorRect (Gdk.Rectangle rect)
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -9,7 +9,7 @@
private Gtk.Widget child = null;
private DockItemBehavior behavior = DockItemBehavior.Normal;
private Gtk.Orientation orientation = Gtk.Orientation.Horizontal;
- private uint resize = 1;
+ private bool resize = false;
private int dragoff_x = 0;
private int dragoff_y = 0;
private Gtk.Menu menu = null;
@@ -66,6 +66,11 @@
set { this.tab_label = value; }
}
+ public new Gtk.Widget Child {
+ get { return this.child; }
+ set { this.child = value; }
+ }
+
public virtual bool HasGrip {
get { return true; }
}
@@ -195,7 +200,7 @@
return;
}
if (this.InDrag) {
- this.DragEnd (true);
+ this.DockDragEnd ();
}
if (widget != this.Child)
@@ -217,13 +222,13 @@
invoker.Invoke (this.Child);
}
- protected void OnSizeRequested (ref Gtk.Requisition requisition)
+ protected override void OnSizeRequested (ref Gtk.Requisition requisition)
{
Gtk.Requisition child_requisition = new Gtk.Requisition ();
Gtk.Requisition grip_requisition = new Gtk.Requisition ();
- if (this.Child)
- child_requistion = this.Child.SizeRequest ();
+ if (this.Child != null)
+ child_requisition = this.Child.SizeRequest ();
else {
child_requisition.Width = 0;
child_requisition.Height = 0;
@@ -257,19 +262,19 @@
requisition.Width = 0;
}
}
- requisition.Width += (this.BorderWidth + this.Style.XThickness) * 2;
- requisition.Width += (this.BorderWidth + this.Style.YThickness) * 2;
+ requisition.Width += ((int)this.BorderWidth + this.Style.XThickness) * 2;
+ requisition.Width += ((int)this.BorderWidth + this.Style.YThickness) * 2;
this.SetSizeRequest (requisition.Width, requisition.Height);
}
- protected override void OnSizeAllocated (ref Gdk.Rectangle allocation)
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
this.Allocation = allocation;
if (this.IsRealized) {
this.GdkWindow.MoveResize (allocation.X, allocation.Y, allocation.Width, allocation.Height);
}
if (this.Child != null && this.Child.Visible) {
- int border_width = this.BorderWidth;
+ int border_width = (int)this.BorderWidth;
Gdk.Rectangle child_allocation = new Gdk.Rectangle ();
child_allocation.X = border_width + this.Style.XThickness;
child_allocation.Y = border_width + this.Style.YThickness;
@@ -292,7 +297,7 @@
this.grip.SizeAllocate (grip_alloc);
}
}
- this.Child.SizeAllocate (grip_alloc);
+ this.Child.SizeAllocate (child_allocation);
}
}
@@ -317,7 +322,7 @@
protected override void OnRealized ()
{
this.Flags |= (int)Gtk.WidgetFlags.Realized;
- Gdk.WindowAttr attributes;
+ Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
attributes.X = this.Allocation.X;
attributes.Y = this.Allocation.Y;
attributes.Height = this.Allocation.Height;
@@ -326,7 +331,7 @@
attributes.Wclass = Gdk.WindowClass.InputOutput;
attributes.visual = this.Visual;
attributes.colormap = this.Colormap;
- attributes.EventMask = (this.Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask);
+ attributes.EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask);
Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual;
this.GdkWindow = new Gdk.Window (this.ParentWindow, attributes, (int)attributes_mask);
this.GdkWindow.UserData = this.Handle;
@@ -352,7 +357,7 @@
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
if (this.Drawable && evnt.Window == this.GdkWindow) {
- Gtk.Style.PaintBox (this.GdkWindow, this.State, Gtk.ShadowType.None, evnt.Area, this, "dockitem", 0, 0, -1, -1);
+ Gtk.Style.PaintBox (this.Style, this.GdkWindow, this.State, Gtk.ShadowType.None, evnt.Area, this, "dockitem", 0, 0, -1, -1);
base.OnExposeEvent (evnt);
}
return false;
@@ -390,16 +395,16 @@
if (evnt.Button == 1 && evnt.Type == Gdk.EventType.ButtonPress) {
if (in_handle) {
- this.start_x = evnt.X;
- this.start_y = evnt.Y;
+ this.start_x = (int)evnt.X;
+ this.start_y = (int)evnt.Y;
this.DockObjectFlags |= DockObjectFlags.InPreDrag;
- cursor = new Gdk.Cursor (this.Display, (int)Gdk.CursorType.Fleur);
+ cursor = new Gdk.Cursor (this.Display, Gdk.CursorType.Fleur);
this.grip.TitleWindow.Cursor = cursor;
event_handled = true;
}
} else if (evnt.Type == Gdk.EventType.ButtonRelease && evnt.Button == 1) {
if (this.InDrag) {
- this.DragEnd (false);
+ this.DockDragEnd ();
event_handled = true;
} else if (this.InPreDrag) {
this.DockObjectFlags &= ~(DockObjectFlags.InPreDrag);
@@ -407,11 +412,11 @@
}
if (this.grip.TitleWindow != null) {
- cursor = new Gdk.Cursor (this.Display, (int)Gdk.CursorType.Hand2);
+ cursor = new Gdk.Cursor (this.Display, Gdk.CursorType.Hand2);
this.grip.TitleWindow.Cursor = cursor;
}
} else if (evnt.Button == 3 && evnt.Type == Gdk.EventType.ButtonPress && in_handle) {
- this.PopupMenu (evnt.Button, evnt.Time);
+ this.DockPopupMenu (evnt.Button, evnt.Time);
event_handled = true;
}
return event_handled;
@@ -427,19 +432,19 @@
if (!EventInGripWindow (evnt))
return false;
if (this.InPreDrag) {
- if (Gtk.Drag.CheckThreshold (this, this.start_x, this.start_y, evnt.X, evnt.Y)) {
+ if (Gtk.Drag.CheckThreshold (this, this.start_x, this.start_y, (int)evnt.X, (int)evnt.Y)) {
this.DockObjectFlags &= ~(DockObjectFlags.InPreDrag);
this.dragoff_x = this.start_x;
this.dragoff_y = this.start_y;
- this.DragStart ();
+ this.DockDragStart ();
}
}
if (!this.InDrag)
return false;
- int new_x = evnt.XRoot;
- int new_y = evnt.YRoot;
+ int new_x = (int)evnt.XRoot;
+ int new_y = (int)evnt.YRoot;
//PORT THIS:
// g_signal_emit (item, gdl_dock_item_signals [DOCK_DRAG_MOTION], 0, new_x, new_y);
@@ -449,13 +454,13 @@
protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
{
if (this.InDrag && evnt.Key == Gdk.Key.Escape) {
- this.DragEnd (true);
+ this.DockDragEnd ();
return true;
}
return base.OnKeyPressEvent (evnt);
}
- protected static Gtk.Requisition PreferredSize (DockItem item)
+ public static Gtk.Requisition PreferredSize (DockItem item)
{
Gtk.Requisition req;
req.Width = Math.Max (item.preferred_width, item.Allocation.Width);
@@ -470,10 +475,9 @@
int rel_y = y - alloc.Y;
if (rel_x > 0 && rel_x < alloc.Width && rel_y > 0 && rel_y < alloc.Width) {
- Gdk.Rectangle other, my;
- int divider;
- DockItem.PreferredSize (request.Applicant, ref other);
- DockItem.PreferredSize (this, ref my);
+ Gtk.Requisition other = DockItem.PreferredSize ((DockItem)request.Applicant);
+ Gtk.Requisition my = DockItem.PreferredSize (this);
+ int divider = 0;
float rx = (float) rel_x / alloc.Width;
float ry = (float) rel_y / alloc.Height;
@@ -502,24 +506,24 @@
if (request.Applicant != this) {
switch (request.Position) {
case DockPlacement.Top:
- req_rect.Height *= 0.4;
+ req_rect.Height = (int)(req_rect.Height * 0.4);
break;
case DockPlacement.Bottom:
- req_rect.Y += req_rect.Height * (1 - 0.4);
- req_rect.Height *= 0.4;
+ req_rect.Y += (int)(req_rect.Height * (1 - 0.4));
+ req_rect.Height = (int)(req_rect.Height * 0.4);
break;
case DockPlacement.Left:
- req_rect.Width *= 0.4;
+ req_rect.Width = (int)(req_rect.Width * 0.4);
break;
case DockPlacement.Right:
- req_rect.X += req_rect.Width * (1 - 0.4);
- req_rect.Width *= 0.4;
+ req_rect.X += (int)(req_rect.Width * (1 - 0.4));
+ req_rect.Width = (int)(req_rect.Width * 0.4);
break;
case DockPlacement.Center:
- req_rect.X = req_rect.Width * 0.2;
- req_rect.Y = req_rect.Height * 0.2;
- req_rect.Width = (req_rect.Width * (1 - 0.2)) - req_rect.X;
- req_rect.Height = (req_rect.Height * (1 - 0.2)) - req_rect.Y;
+ req_rect.X = (int)(req_rect.Width * 0.2);
+ req_rect.Y = (int)(req_rect.Height * 0.2);
+ req_rect.Width = (int)(req_rect.Width * (1 - 0.2)) - req_rect.X;
+ req_rect.Height = (int)(req_rect.Height * (1 - 0.2)) - req_rect.Y;
break;
default:
break;
@@ -537,7 +541,7 @@
return false;
}
- public override void Dock (DockObject requestor, DockPlacement position, object other_data)
+ public override void Docking (DockObject requestor, DockPlacement position, object other_data)
{
DockObject new_parent = null;
bool add_ourselves_first;
@@ -600,7 +604,7 @@
((DockItem)item).menu = null;
}
- public void PopupMenu (int button, int time)
+ public void DockPopupMenu (uint button, uint time)
{
if (this.menu == null) {
this.menu = new Gtk.Menu ();
@@ -611,7 +615,8 @@
this.menu.Append (mitem);
}
this.menu.ShowAll ();
- this.menu.Popup (null, null, null, null, button, time);
+ this.menu.Popup (null, null, null, IntPtr.Zero, button, time);
+
}
private void ItemHideCb (object o, EventArgs e)
@@ -619,7 +624,7 @@
this.HideItem ();
}
- public void DragStart ()
+ public void DockDragStart ()
{
Gdk.Cursor fleur = new Gdk.Cursor (Gdk.CursorType.Fleur);
@@ -634,7 +639,7 @@
//g_signal_emit (item, gdl_dock_item_signals [DOCK_DRAG_BEGIN], 0);
}
- public void DragEnd ()
+ public void DockDragEnd ()
{
Gtk.Grab.Remove (Gtk.Grab.Current);
@@ -667,7 +672,7 @@
this.dragoff_x = this.dragoff_y = 0;
((Dock)this.Master.Controller).AddFloatingItem (this, 0, 0, -1, -1);
} else
- target.Dock (item, position, null);
+ target.Docking (this, position, null);
}
public virtual void SetOrientation (Gtk.Orientation orientation)
@@ -729,6 +734,25 @@
this.Thaw ();
}
+ public void HideItem (Gtk.Widget widget)
+ {
+ if (!(widget is DockItem))
+ return;
+ DockItem item = widget as DockItem;
+ if (!(item.IsAttached))
+ return;
+ if (!(item.IsAutomatic))
+ item.ph = new DockPlaceholder (this, false);
+
+ item.Freeze ();
+ if (item.IsCompound) {
+ item.Foreach (new Gtk.Callback (HideItem));
+ }
+
+ item.Detach (true);
+ item.Thaw ();
+ }
+
public void IconifyItem ()
{
this.DockObjectFlags |= DockObjectFlags.Iconified;
@@ -744,7 +768,7 @@
this.ph = null;
} else if (this.IsBound) {
if (this.Master.Controller != null) {
- this.Master.Controller.Dock (this, DockPlacement.Floating, null);
+ this.Master.Controller.Docking (this, DockPlacement.Floating, null);
}
}
}
@@ -755,7 +779,7 @@
if (reference != null && reference.IsAttached) {
if (reference is DockPlaceholder) {
- this.ph = reference;
+ this.ph = (DockPlaceholder)reference;
} else {
this.ph = new DockPlaceholder (reference, true);
}
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -25,7 +25,7 @@
this.close_button = new Gtk.Button ();
Widget.PopCompositeChild ();
- this.close_button.Flags |= ~(Gtk.WidgetFlags.CanFocus);
+ this.close_button.Flags |= ~((int)Gtk.WidgetFlags.CanFocus);
this.close_button.Parent = this;
this.close_button.Relief = Gtk.ReliefStyle.None;
this.close_button.Show ();
@@ -40,7 +40,7 @@
this.iconify_button = new Gtk.Button ();
Widget.PopCompositeChild ();
- this.iconify_button.Flags |= ~(Gtk.WidgetFlags.CanFocus);
+ this.iconify_button.Flags |= ~((int)Gtk.WidgetFlags.CanFocus);
this.iconify_button.Parent = this;
this.iconify_button.Relief = Gtk.ReliefStyle.None;
this.iconify_button.Show ();
@@ -81,7 +81,7 @@
public Gdk.Rectangle GetTitleArea ()
{
Gdk.Rectangle area;
- int border = this.BorderWidth;
+ int border = (int)this.BorderWidth;
int alloc_height, alloc_width;
area.Width = (this.Allocation.Width - 2 * border);
@@ -128,7 +128,7 @@
}
}
- protected void OnExposeEvent (Gdk.EventExpose evnt)
+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
Gdk.Rectangle title_area = this.GetTitleArea ();
Gdk.Rectangle expose_area;
@@ -147,13 +147,13 @@
title_area.Width -= pixbuf_rect.Width - 1;
pixbuf_rect.Y = title_area.Y + (title_area.Height - pixbuf_rect.Height) / 2;
- if (evnt.Area.Intersect (ref pixbuf_rect, out expose_area)) {
+ if (evnt.Area.Intersect (pixbuf_rect, out expose_area)) {
Gdk.GC gc = this.Style.BackgroundGC (this.State);
this.GdkWindow.DrawPixbuf (gc, this.icon_pixbuf, 0, 0, pixbuf_rect.X, pixbuf_rect.Y, pixbuf_rect.Width, pixbuf_rect.Height, Gdk.RgbDither.None, 0, 0);
}
}
-
- if (title_area.Intersect (ref evnt.Area, out expose_area)) {
+
+ if (title_area.Intersect (evnt.Area, out expose_area)) {
int layout_width, layout_height, text_x, text_y;
this.title_layout.GetPixelSize (out layout_width, out layout_height);
if (this.Direction == Gtk.TextDirection.Rtl)
@@ -161,10 +161,10 @@
else
text_x = title_area.X;
text_y = title_area.Y + (title_area.Height - layout_height) / 2;
- Gtk.Style.PaintLayout (this.Style, this.GdkWindow, this.State, true, ref expose_area, this, null, text_x, text_y, this.title_layout);
+ Gtk.Style.PaintLayout (this.Style, this.GdkWindow, this.State, true, expose_area, this, null, text_x, text_y, this.title_layout);
}
- base.OnExposeEvent (evnt);
+ return base.OnExposeEvent (evnt);
}
private void CloseClicked (object o, EventArgs e)
@@ -183,7 +183,7 @@
{
base.OnRealized ();
if (this.title_window == null) {
- Gdk.WindowAttr attributes;
+ Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
this.EnsureTitleAndIconPixbuf ();
@@ -231,8 +231,8 @@
protected override void OnSizeRequested (ref Gtk.Requisition requisition)
{
- requisition.Width = this.BorderWidth * 2;
- requisition.Height = this.BorderWidth * 2;
+ requisition.Width = (int)this.BorderWidth * 2;
+ requisition.Height = (int)this.BorderWidth * 2;
this.EnsureTitleAndIconPixbuf ();
@@ -278,7 +278,7 @@
Pango.LayoutLine line = this.title_layout.GetLine (0);
string text = this.title_layout.Text;
if (line.XToIndex (width * 1024, out x, out empty)) {
- this.title_layout.Text = text.Substring (0, x) + "...";
+ this.title_layout.SetText (text.Substring (0, x) + "...");
}
}
@@ -288,13 +288,13 @@
Gdk.Rectangle child_allocation;
if (this.Direction == Gtk.TextDirection.Rtl)
- child_allocation.X = allocation.X + this.BorderWidth;
+ child_allocation.X = allocation.X + (int)this.BorderWidth;
else
- child_allocation.X = allocation.X + allocation.Width - this.BorderWidth;
- child_allocation.Y = allocation.Y + this.BorderWidth;
+ child_allocation.X = allocation.X + allocation.Width - (int)this.BorderWidth;
+ child_allocation.Y = allocation.Y + (int)this.BorderWidth;
if (this.close_button.Visible) {
- Gdk.Rectangle button_requisition = this.close_button.SizeRequest ();
+ Gtk.Requisition button_requisition = this.close_button.SizeRequest ();
if (this.Direction != Gtk.TextDirection.Rtl)
child_allocation.X -= button_requisition.Width;
@@ -308,7 +308,7 @@
}
if (this.iconify_button.Visible) {
- Gdk.Rectangle button_requisition = this.iconify_button.SizeRequest ();
+ Gtk.Requisition button_requisition = this.iconify_button.SizeRequest ();
if (this.Direction != Gtk.TextDirection.Rtl)
child_allocation.X -= button_requisition.Width;
@@ -323,7 +323,7 @@
if (this.title_window != null) {
this.EnsureTitleAndIconPixbuf ();
- this.title_layout.Text = this.title;
+ this.title_layout.SetText (this.title);
Gdk.Rectangle area = this.GetTitleArea ();
this.title_window.MoveResize (area.X, area.Y, area.Width, area.Height);
if (this.icon_pixbuf != null) {
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -93,7 +93,7 @@
XorRect ();
if (cancelled || request.Applicant == request.Target)
return;
- request.Target.Dock (request.Applicant, request.Position, request.Extra);
+ request.Target.Docking (request.Applicant, request.Position, request.Extra);
//emit LayoutChanged here
}
@@ -108,12 +108,12 @@
int win_x, win_y;
int x, y;
Dock dock = null;
- bool may_dock;
+ bool may_dock = false;
Gdk.Window window = Gdk.Window.AtPointer (out win_x, out win_y);
if (window != null) {
- IntPtr widg = window.GetUserData ();
- if (widg != null) {
+ IntPtr widg = window.UserData;
+ if (widg != IntPtr.Zero) {
Gtk.Widget widget = GLib.Object.GetObject (widg, false) as Gtk.Widget;
if (widget != null) {
while (widget != null && (!(widget is Dock) || (widget is DockObject && ((DockObject)widget).Master == this)))
@@ -146,10 +146,9 @@
}
if (!may_dock) {
dock = null;
- Gtk.Requisition req;
+ Gtk.Requisition req = DockItem.PreferredSize ((DockItem)request.Applicant);
my_request.Target = Dock.GetTopLevel (request.Applicant);
my_request.Position = DockPlacement.Floating;
- ((DockItem)request.Applicant).PreferredSize (out req);
Gdk.Rectangle rect = new Gdk.Rectangle ();
rect.Width = req.Width;
rect.Height = req.Height;
@@ -210,7 +209,7 @@
if (!objekt.IsAutomatic) {
if (objekt.Name == null)
objekt.Name = "__dock_" + this.number++;
- DockObject found_object = this.dock_objects[objekt.Name];
+ DockObject found_object = (DockObject)this.dock_objects[objekt.Name];
if (found_object != null) {
Console.WriteLine ("Unable to add object, name taken");
} else {
@@ -265,7 +264,7 @@
{
if (objekt == null)
return;
- if (objekt is DockItem && objekt.HasGrip) {
+ if (objekt is DockItem && ((DockItem)objekt).HasGrip) {
int locked = this.Locked;
if (this.locked_items.Contains (objekt)) {
this.locked_items.Remove (objekt);
@@ -286,7 +285,9 @@
this.toplevel_docks.Remove (objekt);
if (objekt == this.controller) {
DockObject new_controller = null;
- foreach (DockObject item in this.toplevel_docks.Reverse ()) {
+ ArrayList reversed = toplevel_docks;
+ reversed.Reverse ();
+ foreach (DockObject item in reversed) {
if (!item.IsAutomatic) {
new_controller = item;
break;
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockNotebook.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockNotebook.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockNotebook.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -40,7 +40,7 @@
{
if (widget == null || !(widget is DockItem))
return;
- this.Dock ((DockObject)widget, DockPlacement.Center, null);
+ this.Docking ((DockObject)widget, DockPlacement.Center, null);
}
private CallbackInvoker stored_invoker;
@@ -51,9 +51,7 @@
} else {
if (this.Child != null) {
stored_invoker = invoker;
- lock (stored_invoker) {
- ((Gtk.Notebook)this.Child).Foreach (new Gtk.Callback (childForall));
- }
+ ((Gtk.Notebook)this.Child).Foreach (new Gtk.Callback (childForAll));
}
}
}
@@ -77,19 +75,18 @@
private void dock_child (Widget w)
{
- this.Dock (w, stored_info.position, stored_info.other_data);
+ if (w is DockObject)
+ this.Docking ((DockObject)w, stored_info.position, stored_info.other_data);
}
private DockInfo stored_info;
- protected override void Dock (DockObject requestor, DockPlacement position, object extra_data)
+ public override void Docking (DockObject requestor, DockPlacement position, object extra_data)
{
if (position == DockPlacement.Center) {
if (requestor.IsCompound) {
requestor.Freeze ();
stored_info = new DockInfo (position, extra_data);
- lock (stored_info) {
- requestor.Foreach (new Gtk.Callback (dock_child));
- }
+ requestor.Foreach (new Gtk.Callback (dock_child));
requestor.Thaw ();
} else {
DockItem requestor_item = requestor as DockItem;
@@ -107,7 +104,7 @@
requestor.DockObjectFlags |= DockObjectFlags.Attached;
}
} else
- base.Dock (requestor, position, extra_data);
+ base.Docking (requestor, position, extra_data);
}
public override void SetOrientation (Gtk.Orientation orientation)
@@ -148,7 +145,7 @@
base.Present (child);
}
- public bool Reorder (DockObject requestor, DockPlacement new_position, object other_data)
+ public override bool Reorder (DockObject requestor, DockPlacement new_position, object other_data)
{
bool handled = false;
int current_position, new_pos = -1;
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockObject.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockObject.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockObject.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -19,7 +19,7 @@
private string stock_id;
private bool reduce_pending;
- public string Name {
+ public new string Name {
get { return name; }
set { name = value; }
}
@@ -44,24 +44,24 @@
}
}
- public virtual void Show ()
+ protected override void OnShown ()
{
if (this.IsCompound) {
foreach (Gtk.Widget child in this.Children) {
child.Show ();
}
}
- base.Show ();
+ base.OnShown ();
}
- public virtual void Hide ()
+ protected override void OnHidden ()
{
if (this.IsCompound) {
foreach (Gtk.Widget child in this.Children) {
child.Hide ();
}
}
- base.Hide ();
+ base.OnHidden ();
}
public virtual void Detach (bool recursive)
@@ -89,7 +89,7 @@
return;
Gdl.DockObject parent = this.ParentObject;
- Gtk.Widget[] children = this.Children ();
+ Gtk.Widget[] children = this.Children;
if (children.Length <= 1) {
if (parent != null)
parent.Freeze ();
@@ -111,9 +111,12 @@
}
}
- public abstract bool DockRequest (int x, int y, DockRequest request);
+ public virtual bool DockRequest (int x, int y, DockRequest request)
+ {
+ return false;
+ }
- public virtual void Dock (Gdl.DockObject requestor, DockPlacement position, object other_data)
+ public virtual void Docking (Gdl.DockObject requestor, DockPlacement position, object other_data)
{
Gdl.DockObject parent;
if (requestor == null)
@@ -126,7 +129,7 @@
Console.WriteLine ("Dock operation requested in a non-bound object.");
Console.WriteLine ("This might break.");
}
- if (!requestor.IsBound ())
+ if (!requestor.IsBound)
requestor.Bind (this.master);
if (requestor.Master != this.master) {
Console.WriteLine ("Cannot complete dock as they belong to different masters.");
@@ -149,14 +152,20 @@
this.Thaw ();
}
- public abstract bool Reorder (DockObject child, DockPlacement new_position, object other_data);
+ public virtual bool Reorder (DockObject child, DockPlacement new_position, object other_data)
+ {
+ return false;
+ }
public virtual void Present (DockObject child)
{
this.Show ();
}
- public abstract bool ChildPlacement (DockObject child, ref DockPlacement placement);
+ public virtual bool ChildPlacement (DockObject child, ref DockPlacement placement)
+ {
+ return false;
+ }
public virtual bool IsCompound {
get {
@@ -170,7 +179,7 @@
while (parent != null && !(parent is DockObject)) {
parent = parent.Parent;
}
- return parent != null ? parent : null;
+ return parent != null ? (DockObject)parent : null;
}
}
@@ -212,7 +221,7 @@
return;
if (this.master == _master)
return;
- if (this._master != null) {
+ if (this.master != null) {
Console.WriteLine ("Attempt to bind an already bound object");
return;
}
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockPaned.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockPaned.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockPaned.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -8,6 +8,11 @@
public class DockPaned : Gdl.DockItem
{
private bool position_changed = false;
+
+ public DockPaned (Gtk.Orientation orientation)
+ {
+ //JUST A STUB need porting
+ }
public override bool HasGrip {
get { return false; }
@@ -64,14 +69,12 @@
pos = item.Orientation == Gtk.Orientation.Vertical ? DockPlacement.Right : DockPlacement.Bottom;
if (pos != DockPlacement.None)
- this.Dock (item, pos, null);
+ this.Docking (item, pos, null);
}
- protected override void OnAdded (Gtk.Widget widget)
+ private void childForAll (Gtk.Widget widget)
{
- if (widget == null || !(widget is DockItem))
- return;
- this.Dock ((DockObject)widget, DockPlacement.Center, null);
+ stored_invoker.Invoke (widget);
}
private CallbackInvoker stored_invoker;
@@ -82,9 +85,7 @@
} else {
if (this.Child != null) {
stored_invoker = invoker;
- lock (stored_invoker) {
- ((Gtk.Paned)this.Child).Foreach (new Gtk.Callback (childForall));
- }
+ ((Gtk.Paned)this.Child).Foreach (new Gtk.Callback (childForAll));
}
}
}
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockPlaceholder.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockPlaceholder.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockPlaceholder.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -16,8 +16,8 @@
public DockPlaceholder ()
{
- this.Flags |= Gtk.WidgetFlags.NoWindow;
- this.Flags &= ~(Gtk.WidgetFlags.CanFocus);
+ this.Flags |= (int)Gtk.WidgetFlags.NoWindow;
+ this.Flags &= ~((int)Gtk.WidgetFlags.CanFocus);
}
public DockPlaceholder (string name, DockObject objekt, DockPlacement position, bool sticky) : this ()
@@ -26,7 +26,7 @@
this.Name = name;
if (objekt != null) {
this.Attach (objekt);
- if (positition == DockPlacement.None) {
+ if (position == DockPlacement.None) {
position = DockPlacement.Center;
}
NextPlacement = position;
@@ -37,6 +37,10 @@
}
}
+ public DockPlaceholder (DockObject objekt, bool sticky) : this (objekt.Name, objekt, DockPlacement.None, sticky)
+ {
+ }
+
public bool Sticky {
get { return sticky; }
set { sticky = value; }
@@ -60,7 +64,7 @@
{
if (!(widget is DockItem))
return;
- this.Dock (widget, this.NextPlacement, null);
+ this.Docking ((DockItem)widget, this.NextPlacement, null);
}
public override void Detach (bool recursive)
@@ -74,16 +78,16 @@
{
}
- public override void Dock (DockObject requestor, DockPlacement position, object other_data)
+ public override void Docking (DockObject requestor, DockPlacement position, object other_data)
{
if (this.host != null) {
- this.host.Dock (requestor, position, other_data);
+ this.host.Docking (requestor, position, other_data);
} else {
if (!this.IsBound) {
Console.WriteLine ("Attempt to dock a dock object to an unbound placeholder");
return;
}
- this.Master.Controller.Dock (requestor, DockPlacement.Floating, null);
+ this.Master.Controller.Docking (requestor, DockPlacement.Floating, null);
}
}
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockRequest.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockRequest.cs 2004-06-08 17:51:53 UTC (rev 1714)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockRequest.cs 2004-06-08 20:05:10 UTC (rev 1715)
@@ -23,6 +23,10 @@
this.extra = copy.Extra;
}
+ public DockRequest ()
+ {
+ }
+
public DockObject Applicant {
get { return applicant; }
set { applicant = value; }
More information about the Monodevelop-patches-list
mailing list