상속: IDisposable
예제 #1
0
        public void Init()
        {
            frame = GetFrame ("gtktreeview.py");

            treeTable = FindByRole (frame, Role.TreeTable, true);
            Assert.IsNotNull (treeTable, "Couldn't find the tree table");
        }
예제 #2
0
 public Hyperlink(Accessible accessible, string path)
 {
     application = accessible.application;
     ObjectPath op = new ObjectPath (path);
     proxy = Registry.Bus.GetObject<IHyperlink> (application.name, op);
     properties = Registry.Bus.GetObject<Properties> (application.name, op);
 }
예제 #3
0
파일: Base.cs 프로젝트: mono/at-spi-sharp
        public static void States(Accessible accessible, params StateType [] expected)
        {
            List <StateType> expectedStates = new List <StateType> (expected);
            List <StateType> missingStates = new List <StateType> ();
            List <StateType> superfluousStates = new List <StateType> ();

            StateSet stateSet = accessible.StateSet;
            foreach (StateType state in Enum.GetValues (typeof (StateType))) {
                if (expectedStates.Contains (state) &&
                    (!(stateSet.Contains (state))))
                    missingStates.Add (state);
                else if ((!expectedStates.Contains (state)) &&
                         (stateSet.Contains (state)))
                    superfluousStates.Add (state);
            }

            string missingStatesMsg = string.Empty;
            string superfluousStatesMsg = string.Empty;

            if (missingStates.Count != 0) {
                missingStatesMsg = "Missing states: ";
                foreach (StateType state in missingStates)
                    missingStatesMsg += state.ToString () + ",";
            }
            if (superfluousStates.Count != 0) {
                superfluousStatesMsg = "Superfluous states: ";
                foreach (StateType state in superfluousStates)
                    superfluousStatesMsg += state.ToString () + ",";
            }
            Assert.IsTrue ((missingStates.Count == 0) && (superfluousStates.Count == 0),
                missingStatesMsg + " .. " + superfluousStatesMsg);
        }
예제 #4
0
        public HypertextTest()
        {
            frame = GetFrame ("DocumentTest.exe", "DocumentTest");

            hypertext = frame.QueryHypertext ();
            Assert.IsNotNull (hypertext, "frame.QueryHypertext");
        }
예제 #5
0
        public DocumentTest()
        {
            frame = GetFrame ("DocumentTest.exe", "DocumentTest");

            document = frame.QueryDocument ();
            Assert.IsNotNull (document, "frame.QueryDocument");
        }
예제 #6
0
 public StateSet(Accessible accessible, uint [] states)
 {
     this.accessible = accessible;
     if (states.Length != 2)
         throw new ArgumentException ("Expecting int [2]");
     this.states = (((ulong) states [1]) << (sizeof (int) * 8)) | (ulong)states [0];
 }
예제 #7
0
 public AccessibleTest()
 {
     radioButtonFrame = GetFrame ("gtkradiobutton.py");
     buttonFrame = GetFrame ("gtkbutton.py");
     radioButton = FindByRole (radioButtonFrame, Role.RadioButton, true);
     Assert.IsNotNull (radioButton, "Find radioButton");
     documentFrame = GetFrame ("DocumentTest.exe", "DocumentTest");
 }
 public DeviceEventControllerTest()
 {
     // We need a gtk app so that our keystrokes have a
     // place to land where they will be ricocheted
     // back to our listener.
     frame = GetFrame ("gtktextview.py");
     Assert.IsNotNull (frame, "Couldn't open gtktextview.py");
 }
예제 #9
0
		private void OnRowInserted (Accessible sender, int row, int count)
		{
			EnsureRowsSize (row + count);
			int lim = row + count;
			for (int i = row; i < lim; i++)
				rows.Insert (i, null);
			AdjustRowReferences (row + count);
		}
예제 #10
0
		public TableElement (Accessible accessible) : base (accessible)
		{
			header = null;
			table = accessible.QueryTable ();
			RefreshTreeMode (true);
			accessible.ObjectEvents.RowInserted += OnRowInserted;
			accessible.ObjectEvents.RowDeleted += OnRowDeleted;
			AddEvents (false);
		}
예제 #11
0
        public SelectionTest()
        {
            frame = GetFrame ("gtkmenubar.py");

            menuBar = FindByRole (frame, Role.MenuBar);
            Assert.IsNotNull (menuBar, "Couldn't find the menu bar");
            selection = menuBar.QuerySelection ();
            Assert.IsNotNull (selection, "menuBar.QuerySelection");
        }
예제 #12
0
        public TableTest()
        {
            frame = GetFrame ("gtktreeview.py");

            treeTable = FindByRole (frame, Role.TreeTable, true);
            Assert.IsNotNull (treeTable, "Couldn't find the tree table");
            table = treeTable.QueryTable ();
            Assert.IsNotNull (table, "menuBar.QueryTable");
        }
예제 #13
0
        public ActionTest()
        {
            frame = GetFrame ("gtkbutton.py");

            Accessible button = FindByRole (frame, Role.PushButton);
            Assert.IsNotNull (button, "Couldn't find the PushButton");
            action = button.QueryAction ();
            Assert.IsNotNull (action, "button.QueryAction");
        }
예제 #14
0
		private void OnColumnDeleted (Accessible sender, int row, int nDeleted)
		{
			int newVal = element.accessible.QueryTable ().NColumns;
			AutomationSource.RaisePropertyChangedEvent (
				element,
				GridPatternIdentifiers.ColumnCountProperty,
				newVal + nDeleted,
				newVal);
		}
예제 #15
0
        public ValueTest()
        {
            frame = GetFrame ("gtkhscale.py");

            Accessible slider = FindByRole (frame, Role.Slider);
            Assert.IsNotNull (slider, "Couldn't find the Slider");
            value = slider.QueryValue ();
            Assert.IsNotNull (value, "slider.QueryValue");
        }
예제 #16
0
		private void OnRowInserted (Accessible sender, int row, int nInserted)
		{
			int newVal = element.accessible.QueryTable ().NRows;
			AutomationSource.RaisePropertyChangedEvent (
				element,
				GridPatternIdentifiers.RowCountProperty,
				newVal - nInserted,
				newVal);
		}
예제 #17
0
		private bool AccessibleIsEnabled (Accessible accessible)
		{
			if (accessible.Parent == null || accessible.Role == Role.Application)
				return true;
			// Work around gail notifying for Sensitive but not
			// Enabled
			if (!accessible.StateSet.Contains (StateType.Enabled) || !accessible.StateSet.Contains (StateType.Sensitive))
				return false;
			return AccessibleIsEnabled (accessible.Parent);
		}
예제 #18
0
		private void OnSelectionChanged (Accessible sender)
		{
			IElement [] newSelection = source.GetSelection ();

			AutomationSource.RaisePropertyChangedEvent (element,
			                                            SelectionPattern.SelectionProperty,
								    oldSelection ?? new IElement [0],
								    newSelection ?? new IElement [0]);
			oldSelection = newSelection;
		}
예제 #19
0
        public TextTest()
        {
            frame = GetFrame ("gtktextview.py");

            Accessible textView = FindByRole (frame, Role.Text);
            Assert.IsNotNull (textView, "Couldn't find the TextView");
            text = textView.QueryText ();
            Assert.IsNotNull (text, "textView.QueryText");
            editableText = textView.QueryEditableText ();
            Assert.IsNotNull (editableText, "textView.QueryEditableText");
        }
예제 #20
0
        public ImageTest()
        {
            frame = GetFrame ("gtkbutton.py");

            Accessible button = Find (frame, Role.PushButton, "openSUSE", true);
            Assert.IsNotNull (button, "Couldn't find the PushButton");
            // It seems that the image needs time to load?
            System.Threading.Thread.Sleep (500);
            image = button.QueryImage ();
            Assert.IsNotNull (image, "button.QueryImage");
        }
예제 #21
0
		private void OnPropertyChange (Accessible sender, string name, object any)
		{
			if (name != "accessible-value")
				return;
			double newVal = Value.CurrentValue;
			AutomationSource.RaisePropertyChangedEvent (
				element,
				RangeValuePatternIdentifiers.ValueProperty,
				currentValue,
				newVal);
			currentValue = newVal;
		}
예제 #22
0
		private void OnTextChanged (Accessible sender, string detail, int v1, int v2, string any)
		{
			string newValue = Text.GetText ();
			if (newValue == currentValue)
				return;

			// LAMESPEC: Client tests confirm OldValue is null.
			AutomationSource.RaisePropertyChangedEvent (element,
			                                            ValuePattern.ValueProperty,
								    null,
								    newValue);
			currentValue = newValue;
		}
예제 #23
0
		public ExpandCollapseSource (Element element)
		{
			accessible = (element is DataItemElement
				? ((Element)element.FirstChild).Accessible
			: element.Accessible);
			action = accessible.QueryAction ();

			ActionDescription [] actions = action.Actions;
			for (int i = 0; i < actions.Length; i++) {
				if (actions [i].Name == "expand or contract" ||
					actions [i].Name == "expand or collapse") {
					expandOrContractAction = i;
					break;
				}
			}
		}
예제 #24
0
파일: Element.cs 프로젝트: mono/uia2atk
		private void OnBoundsChanged (Accessible sender, BoundingBox bounds)
		{
			Rect rect = BoundingBoxToRect (bounds);
			AtspiUiaSource.AutomationSource.RaisePropertyChangedEvent (this,
				AutomationElement.BoundingRectangleProperty,
				Rect.Empty,
				rect);
		}
예제 #25
0
파일: Element.cs 프로젝트: mono/uia2atk
		private static bool IsTreeItem (Accessible accessible)
		{
			if (accessible.Role != Role.TableCell)
				return false;
			Accessible parentAccessible = accessible.Parent;
			Element parent = GetElement (parentAccessible);
			return (parent is TreeItemElement ||
				parent.ControlType == ControlType.Tree);
		}
예제 #26
0
파일: Element.cs 프로젝트: mono/uia2atk
		private static bool IsTableHeaderItem (Accessible accessible)
		{
			return (accessible.Role == Role.TableRowHeader
				|| accessible.Role == Role.TableColumnHeader);
		}
예제 #27
0
파일: Element.cs 프로젝트: mono/uia2atk
		private static bool IsTable (Accessible accessible)
		{
			if (accessible.Role == Role.Table)
				return true;
			if (accessible.Role != Role.TreeTable)
				return false;
			Atspi.Table table = accessible.QueryTable ();
			return (table != null);
		}
예제 #28
0
파일: Element.cs 프로젝트: mono/uia2atk
		internal static Element GetElement (Accessible accessible, DataItemElement parent, int column)
		{
			if (accessible == null)
				return null;
			if (elements.ContainsKey (accessible))
				return elements [accessible];
			elements [accessible] = new TableCellElement (accessible, parent, column);
			return elements [accessible];
		}
예제 #29
0
파일: Element.cs 프로젝트: mono/uia2atk
		internal static Element GetElement (Accessible accessible, TableElement parent, int row)
		{
			if (accessible == null)
				return null;
			if (elements.ContainsKey (accessible))
				return elements [accessible];
			elements [accessible] = new TreeItemElement (accessible, parent, row);
			return elements [accessible];
		}
예제 #30
0
파일: Element.cs 프로젝트: mono/uia2atk
		internal static Element GetElement (Accessible accessible, bool create)
		{
			if (accessible == null)
				return null;
			// We expose the children of Applications as top-level,
			// to be more like UIA
			if (accessible.Role == Role.Application)
				return null;
			if (elements.ContainsKey (accessible))
			return elements [accessible];
			if (!create)
				return null;
			Element element;
			if (IsTable (accessible))
				element = new TableElement (accessible);
			else if (IsTableHeaderItem (accessible))
				element = new TableHeaderItemElement (accessible);
			else if (IsTreeItem (accessible))
				element = new TreeItemElement (accessible);
			else
				element = new Element (accessible);
			return element;
		}