Permalink
Browse files

2008-01-11 Marek Safar <marek.safar@gmail.com>

	* libstetic/editor/ActionMenu.cs, libstetic/editor/ActionMenuBar.cs,
	libstetic/editor/ActionToolbar.cs, libstetic/undo/ActionDiffAdaptor.cs
	libstetic/editor/ActionGroupEditor.cs: Build with the latest gmcs.
	

svn path=/trunk/stetic/; revision=92661
  • Loading branch information...
1 parent 76ae3f3 commit 101567ffda0e487047ce17d3ccac1a898bf60855 @marek-safar marek-safar committed Jan 11, 2008
View
@@ -1,5 +1,11 @@
2008-01-11 Marek Safar <marek.safar@gmail.com>
+ * libstetic/editor/ActionMenu.cs, libstetic/editor/ActionMenuBar.cs,
+ libstetic/editor/ActionToolbar.cs, libstetic/undo/ActionDiffAdaptor.cs
+ libstetic/editor/ActionGroupEditor.cs: Build with the latest gmcs.
+
+2008-01-11 Marek Safar <marek.safar@gmail.com>
+
* libsteticui/ActionGroupToolbar.cs: Build with the latest gmcs.
2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
@@ -88,7 +88,7 @@ public override void Dispose ()
actionGroup.ObjectChanged -= OnGroupChanged;
actionGroup.ActionAdded -= OnActionAdded;
actionGroup.ActionRemoved -= OnActionRemoved;
- foreach (Action a in actionGroup.Actions)
+ foreach (Wrapper.Action a in actionGroup.Actions)
a.ObjectChanged -= changedEvent;
}
actionGroup = value;
@@ -97,7 +97,7 @@ public override void Dispose ()
actionGroup.ObjectChanged += OnGroupChanged;
actionGroup.ActionAdded += OnActionAdded;
actionGroup.ActionRemoved += OnActionRemoved;
- foreach (Action a in actionGroup.Actions)
+ foreach (Wrapper.Action a in actionGroup.Actions)
a.ObjectChanged += changedEvent;
}
Fill ();
@@ -114,12 +114,12 @@ public override void Dispose ()
set { modified = value; }
}
- public Action SelectedAction {
+ public Wrapper.Action SelectedAction {
get {
IDesignArea designArea = GetDesignArea ();
IObjectSelection sel = designArea.GetSelection ();
if (sel != null)
- return ObjectWrapper.Lookup (sel.DataObject) as Action;
+ return ObjectWrapper.Lookup (sel.DataObject) as Wrapper.Action;
else
return null;
}
@@ -155,7 +155,7 @@ void Fill ()
if (designArea == null)
return;
- Action selAction = null;
+ Wrapper.Action selAction = null;
foreach (ActionMenuItem item in items) {
if (designArea.IsSelected (item))
@@ -167,11 +167,11 @@ void Fill ()
items.Clear ();
if (actionGroup != null) {
- Action[] sortedActions = new Action [actionGroup.Actions.Count];
+ Wrapper.Action[] sortedActions = new Wrapper.Action [actionGroup.Actions.Count];
actionGroup.Actions.CopyTo (sortedActions, 0);
Array.Sort (sortedActions, new ActionComparer ());
for (int n = 0; n < sortedActions.Length; n++) {
- Action action = (Action) sortedActions [n];
+ Wrapper.Action action = (Wrapper.Action) sortedActions [n];
ActionMenuItem item = InsertAction (action, n);
if (selAction == action)
item.Select ();
@@ -190,7 +190,7 @@ void Fill ()
ShowAll ();
}
- ActionMenuItem InsertAction (Action action, int n)
+ ActionMenuItem InsertAction (Wrapper.Action action, int n)
{
uint row = (uint) n / columns;
uint col = (uint) (n % columns) * 3;
@@ -270,7 +270,7 @@ void NotifyModified ()
void OnAddClicked (object s, Gtk.ButtonPressEventArgs args)
{
- Action ac = (Action) ObjectWrapper.Create (project, new Gtk.Action ("", "", null, null));
+ Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (project, new Gtk.Action ("", "", null, null));
ActionMenuItem item = InsertAction (ac, actionGroup.Actions.Count);
item.EditingDone += OnEditDone;
item.Select ();
@@ -451,7 +451,7 @@ class ActionComparer: IComparer
{
public int Compare (object x, object y)
{
- return string.Compare (((Action)x).GtkAction.Label, ((Action)y).GtkAction.Label);
+ return string.Compare (((Wrapper.Action)x).GtkAction.Label, ((Wrapper.Action)y).GtkAction.Label);
}
}
}
@@ -200,7 +200,7 @@ internal void ResetSelection ()
ActionTreeNode InsertAction (int pos)
{
using (wrapper.UndoManager.AtomicChange) {
- Action ac = (Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
+ Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
ActionTreeNode newNode = new ActionTreeNode (Gtk.UIManagerItemType.Menuitem, null, ac);
nodes.Insert (pos, newNode);
ActionMenuItem item = FindMenuItem (newNode);
@@ -259,7 +259,7 @@ void InsertAction (int pos)
{
Widget wrapper = Widget.Lookup (this);
using (wrapper.UndoManager.AtomicChange) {
- Action ac = (Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
+ Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
ActionTreeNode node = new ActionTreeNode (Gtk.UIManagerItemType.Menu, "", ac);
actionTree.Children.Insert (pos, node);
@@ -237,7 +237,7 @@ void InsertAction (int pos)
{
Widget wrapper = Stetic.Wrapper.Widget.Lookup (this);
using (wrapper.UndoManager.AtomicChange) {
- Action ac = (Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
+ Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null));
ActionTreeNode node = new ActionTreeNode (Gtk.UIManagerItemType.Toolitem, "", ac);
actionTree.Children.Insert (pos, node);
@@ -17,10 +17,10 @@ public ActionDiffAdaptor (IProject project)
public IEnumerable GetChildren (object parent)
{
- if (parent is Action)
+ if (parent is Wrapper.Action)
yield break;
else if (parent is ActionGroup) {
- foreach (Action ac in ((ActionGroup)parent).Actions)
+ foreach (Wrapper.Action ac in ((ActionGroup)parent).Actions)
if (ac.Name.Length > 0)
yield return ac;
}
@@ -36,8 +36,8 @@ public string GetUndoId (object childObject)
{
if (childObject is ActionGroup)
return ((ActionGroup)childObject).UndoId;
- if (childObject is Action)
- return ((Action)childObject).UndoId;
+ if (childObject is Wrapper.Action)
+ return ((Wrapper.Action)childObject).UndoId;
throw new NotImplementedException ();
}
@@ -46,7 +46,7 @@ public object FindChild (object parent, string undoId)
{
foreach (object ob in GetChildren (parent))
if (GetUndoId (ob) == undoId) {
- if ((ob is Action) && ((Action)ob).Name.Length == 0)
+ if ((ob is Wrapper.Action) && ((Wrapper.Action)ob).Name.Length == 0)
continue;
return ob;
}
@@ -59,7 +59,7 @@ public void RemoveChild (object parent, string undoId)
if (child == null)
return;
if (parent is ActionGroup) {
- ((ActionGroup)parent).Actions.Remove ((Action)child);
+ ((ActionGroup)parent).Actions.Remove ((Wrapper.Action)child);
} else if (parent is ActionGroupCollection) {
((ActionGroupCollection)parent).Remove ((ActionGroup)child);
} else
@@ -72,15 +72,15 @@ public void AddChild (object parent, XmlElement node, string insertAfter)
if (parent is ActionGroup) {
ActionGroup group = (ActionGroup) parent;
if (insertAfter == null)
- group.Actions.Insert (0, (Action) data);
+ group.Actions.Insert (0, (Wrapper.Action) data);
else {
for (int n=0; n<group.Actions.Count; n++) {
if (group.Actions [n].UndoId == insertAfter) {
- group.Actions.Insert (n+1, (Action) data);
+ group.Actions.Insert (n+1, (Wrapper.Action) data);
return;
}
}
- group.Actions.Add ((Action) data);
+ group.Actions.Add ((Wrapper.Action) data);
}
}
if (parent is ActionGroupCollection) {
@@ -101,7 +101,7 @@ public void AddChild (object parent, XmlElement node, string insertAfter)
public IEnumerable GetProperties (object obj)
{
- Action action = obj as Action;
+ Wrapper.Action action = obj as Wrapper.Action;
if (action != null) {
foreach (ItemGroup iset in action.ClassDescriptor.ItemGroups) {
foreach (ItemDescriptor it in iset) {
@@ -131,8 +131,8 @@ public XmlElement SerializeChild (object child)
XmlDocument doc = new XmlDocument ();
ObjectWriter ow = new ObjectWriter (doc, FileFormat.Native);
- if (child is Action) {
- return ((Action)child).Write (ow);
+ if (child is Wrapper.Action) {
+ return ((Wrapper.Action)child).Write (ow);
} else if (child is ActionGroup) {
return ((ActionGroup)child).Write (ow);
}
@@ -143,7 +143,7 @@ public object DeserializeChild (XmlElement data)
{
ObjectReader or = new ObjectReader (project, FileFormat.Native);
if (data.LocalName == "action") {
- Action ac = new Action ();
+ Wrapper.Action ac = new Wrapper.Action ();
ac.Read (or, data);
return ac;
} else if (data.LocalName == "action-group") {
@@ -161,9 +161,9 @@ public IDiffAdaptor GetChildAdaptor (object child)
public object GetPropertyByName (object obj, string name)
{
- if (obj is Action) {
+ if (obj is Wrapper.Action) {
if (name == "id") name = "Name";
- return ((Action)obj).ClassDescriptor [name];
+ return ((Wrapper.Action)obj).ClassDescriptor [name];
}
else if (obj is ActionGroup) {
if (name == "name") return name;
@@ -186,9 +186,9 @@ public string GetPropertyName (object property)
public string GetPropertyValue (object obj, object property)
{
- if (obj is Action) {
+ if (obj is Wrapper.Action) {
PropertyDescriptor prop = (PropertyDescriptor) property;
- object val = prop.GetValue (((Action)obj).Wrapped);
+ object val = prop.GetValue (((Wrapper.Action)obj).Wrapped);
return prop.ValueToString (val);
}
else if (obj is ActionGroup) {
@@ -200,12 +200,12 @@ public string GetPropertyValue (object obj, object property)
public void SetPropertyValue (object obj, string name, string value)
{
- if (obj is Action) {
+ if (obj is Wrapper.Action) {
if (name == "id") name = "Name";
PropertyDescriptor prop = (PropertyDescriptor) GetPropertyByName (obj, name);
if (prop == null)
throw new InvalidOperationException ("Property '" + name + "' not found in object of type: " + obj.GetType ());
- prop.SetValue (((Action)obj).Wrapped, prop.StringToValue (value));
+ prop.SetValue (((Wrapper.Action)obj).Wrapped, prop.StringToValue (value));
return;
}
else if (obj is ActionGroup) {
@@ -219,17 +219,17 @@ public void SetPropertyValue (object obj, string name, string value)
public void ResetPropertyValue (object obj, string name)
{
- if (obj is Action) {
+ if (obj is Wrapper.Action) {
if (name == "id") name = "Name";
PropertyDescriptor prop = (PropertyDescriptor) GetPropertyByName (obj, name);
- prop.ResetValue (((Action)obj).Wrapped);
+ prop.ResetValue (((Wrapper.Action)obj).Wrapped);
}
}
public IEnumerable GetSignals (object obj)
{
- if (obj is Action) {
- foreach (Signal s in ((Action)obj).Signals)
+ if (obj is Wrapper.Action) {
+ foreach (Signal s in ((Wrapper.Action)obj).Signals)
yield return s;
}
else
@@ -238,7 +238,7 @@ public IEnumerable GetSignals (object obj)
public object GetSignal (object obj, string name, string handler)
{
- foreach (Signal s in ((Action)obj).Signals) {
+ foreach (Signal s in ((Wrapper.Action)obj).Signals) {
if (s.SignalDescriptor.Name == name && s.Handler == handler)
return s;
}
@@ -254,17 +254,17 @@ public void GetSignalInfo (object signal, out string name, out string handler)
public void AddSignal (object obj, string name, string handler)
{
- SignalDescriptor sd = (SignalDescriptor) ((Action)obj).ClassDescriptor.SignalGroups.GetItem (name);
+ SignalDescriptor sd = (SignalDescriptor) ((Wrapper.Action)obj).ClassDescriptor.SignalGroups.GetItem (name);
Signal sig = new Signal (sd);
sig.Handler = handler;
- ((Action)obj).Signals.Add (sig);
+ ((Wrapper.Action)obj).Signals.Add (sig);
}
public void RemoveSignal (object obj, string name, string handler)
{
- foreach (Signal sig in ((Action)obj).Signals) {
+ foreach (Signal sig in ((Wrapper.Action)obj).Signals) {
if (sig.SignalDescriptor.Name == name && sig.Handler == handler) {
- ((Action)obj).Signals.Remove (sig);
+ ((Wrapper.Action)obj).Signals.Remove (sig);
return;
}
}

0 comments on commit 101567f

Please sign in to comment.