public static string RoleGetName(Atk.Role role) { IntPtr raw_ret = atk_role_get_name((int)role); string ret = GLib.Marshaller.Utf8PtrToString(raw_ret); return(ret); }
public static Atk.Role RoleRegister(string name) { IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup(name); int raw_ret = atk_role_register(native_name); Atk.Role ret = (Atk.Role)raw_ret; GLib.Marshaller.Free(native_name); return(ret); }
internal AtSpiEvent(string sourceName, string sourceRole, string type, string detail1, string detail2, string data) { this.type = type; this.detail1 = detail1; this.detail2 = detail2; this.sourceName = sourceName; this.sourceRole = FromName (sourceRole); this.data = data; }
internal AtSpiEvent(string sourceName, string sourceRole, string type, string detail1, string detail2, string data) { this.type = type; this.detail1 = detail1; this.detail2 = detail2; this.sourceName = sourceName; this.sourceRole = FromName(sourceRole); this.data = data; }
protected void ExpectEvents(int count, Atk.Role role, string evType) { if (events == null) { events = EventMonitor.Pause(); } EventCollection evs = events.FindByRole(role).FindByType(evType); string eventsInXml = String.Format(" events in XML: {0}", Environment.NewLine + events.OriginalGrossXml); Assert.AreEqual(count, evs.Count, "bad number of " + evType + " events: " + eventsInXml); }
protected void ExpectEvents(int min, int max, Atk.Role role, string evType) { GlibSync(); if (events == null) { events = EventMonitor.Pause(); } EventCollection evs = events.FindByRole(role).FindByType(evType); string eventsInXml = String.Format(" events in XML: {0}", Environment.NewLine + events.OriginalGrossXml); Assert.IsTrue(evs.Count >= min && evs.Count <= max, "Expected " + min + "-" + max + " " + evType + " events but got " + evs.Count + ": " + eventsInXml); }
public static Accessibility.Role ToXwtRole(this Atk.Role role) { switch (role) { //case Atk.Role.Invalid: // break; //case Atk.Role.AccelLabel: // break; //case Atk.Role.Alert: // break; //case Atk.Role.Animation: // break; case Atk.Role.Arrow: return(Accessibility.Role.Disclosure); case Atk.Role.Calendar: return(Accessibility.Role.Calendar); //case Atk.Role.Canvas: // break; case Atk.Role.CheckBox: return(Accessibility.Role.CheckBox); case Atk.Role.CheckMenuItem: return(Accessibility.Role.MenuItemCheckBox); case Atk.Role.ColorChooser: return(Accessibility.Role.ColorChooser); case Atk.Role.ColumnHeader: return(Accessibility.Role.Column); case Atk.Role.ComboBox: return(Accessibility.Role.ComboBox); case Atk.Role.DateEditor: return(Accessibility.Role.Calendar); //case Atk.Role.DesktopIcon: // break; //case Atk.Role.DesktopFrame: // break; //case Atk.Role.Dial: // break; //case Atk.Role.Dialog: // break; //case Atk.Role.DirectoryPane: // break; //case Atk.Role.DrawingArea: // break; //case Atk.Role.FileChooser: // break; //case Atk.Role.Filler: // break; //case Atk.Role.FontChooser: // break; //case Atk.Role.Frame: // break; //case Atk.Role.GlassPane: // break; //case Atk.Role.HtmlContainer: // break; //case Atk.Role.Icon: // break; case Atk.Role.Image: return(Accessibility.Role.Image); //case Atk.Role.InternalFrame: // break; case Atk.Role.Label: return(Accessibility.Role.Label); //case Atk.Role.LayeredPane: // break; case Atk.Role.List: return(Accessibility.Role.List); case Atk.Role.ListItem: return(Accessibility.Role.Cell); case Atk.Role.Menu: return(Accessibility.Role.Menu); case Atk.Role.MenuBar: return(Accessibility.Role.MenuBar); case Atk.Role.MenuItem: return(Accessibility.Role.MenuItem); //case Atk.Role.OptionPane: // break; case Atk.Role.PageTab: return(Accessibility.Role.NotebookTab); case Atk.Role.PageTabList: return(Accessibility.Role.Notebook); case Atk.Role.Panel: return(Accessibility.Role.Group); case Atk.Role.PasswordText: return(Accessibility.Role.TextEntryPassword); case Atk.Role.PopupMenu: return(Accessibility.Role.Popup); case Atk.Role.ProgressBar: return(Accessibility.Role.ProgressBar); case Atk.Role.PushButton: return(Accessibility.Role.Button); case Atk.Role.RadioButton: return(Accessibility.Role.RadioButton); case Atk.Role.RadioMenuItem: return(Accessibility.Role.MenuItemRadio); //case Atk.Role.RootPane: // break; case Atk.Role.RowHeader: return(Accessibility.Role.Row); case Atk.Role.ScrollBar: return(Accessibility.Role.ScrollBar); case Atk.Role.ScrollPane: return(Accessibility.Role.ScrollView); case Atk.Role.Separator: return(Accessibility.Role.Separator); case Atk.Role.Slider: return(Accessibility.Role.Slider); case Atk.Role.SplitPane: return(Accessibility.Role.Paned); case Atk.Role.SpinButton: return(Accessibility.Role.SpinButton); //case Atk.Role.Statusbar: // break; case Atk.Role.Table: return(Accessibility.Role.Table); case Atk.Role.TableCell: return(Accessibility.Role.Cell); case Atk.Role.TableColumnHeader: return(Accessibility.Role.Column); case Atk.Role.TableRowHeader: return(Accessibility.Role.Row); //case Atk.Role.TearOffMenuItem: // break; //case Atk.Role.Terminal: // break; case Atk.Role.Text: return(Accessibility.Role.TextArea); case Atk.Role.ToggleButton: return(Accessibility.Role.ToggleButton); case Atk.Role.ToolBar: return(Accessibility.Role.ToolBar); case Atk.Role.ToolTip: return(Accessibility.Role.ToolTip); case Atk.Role.Tree: return(Accessibility.Role.Table); case Atk.Role.TreeTable: return(Accessibility.Role.Table); case Atk.Role.Unknown: return(Accessibility.Role.Custom); //case Atk.Role.Viewport: // break; //case Atk.Role.Window: // break; //case Atk.Role.Header: // break; //case Atk.Role.Footer: // break; //case Atk.Role.Paragraph: // break; //case Atk.Role.Ruler: // break; //case Atk.Role.Application: // break; //case Atk.Role.Autocomplete: // break; //case Atk.Role.Editbar: // break; //case Atk.Role.Embedded: // break; case Atk.Role.Entry: return(Accessibility.Role.TextEntry); //case Atk.Role.Chart: // break; //case Atk.Role.Caption: // break; //case Atk.Role.DocumentFrame: // break; //case Atk.Role.Heading: // break; //case Atk.Role.Page: // break; //case Atk.Role.Section: // break; //case Atk.Role.RedundantObject: // break; //case Atk.Role.Form: // break; case Atk.Role.Link: return(Accessibility.Role.Link); //case Atk.Role.InputMethodWindow: // break; //case Atk.Role.LastDefined: // break; case (Atk.Role) 97: // ATK_ROLE_GROUPING return(Accessibility.Role.RadioGroup); case (Atk.Role) 101: // ATK_ROLE_LEVEL_BAR return(Accessibility.Role.LevelIndicator); default: return(Accessibility.Role.None); } }
public void DateTimePicker () { BasicWidgetType type = BasicWidgetType.DateTimePicker; Atk.Object accessible = GetAccessible (type, new string [0]); dateTimePicker.ShowUpDown = false; dateTimePicker.ShowCheckBox = false; // DayName, Month Day, Year dateTimePicker.Format = SWF.DateTimePickerFormat.Long; Atk.Role[] expectedRoles = new Atk.Role[] { Atk.Role.TreeTable, Atk.Role.Label, Atk.Role.Label, Atk.Role.TreeTable, Atk.Role.Label, Atk.Role.SpinButton, Atk.Role.Label, Atk.Role.Label, Atk.Role.SpinButton, Atk.Role.PushButton }; PropertyRole (type, accessible); Atk.IComponent atkComponent = CastToAtkInterface<Atk.IComponent> (accessible); InterfaceComponent (type, atkComponent); Assert.AreEqual (expectedRoles.Length, accessible.NAccessibleChildren, "Correct number of children not found"); Atk.Object child = null; Atk.Role expectedRole = Atk.Role.Label; for (int i = 0; i < accessible.NAccessibleChildren; i++) { child = accessible.RefAccessibleChild (i); expectedRole = expectedRoles[i]; Assert.AreEqual (expectedRole, child.Role, String.Format ("Child {0}'s role is not what was expected", i)); switch (expectedRole) { case Atk.Role.Label: Label (child, BasicWidgetType.Label); break; case Atk.Role.List: case Atk.Role.TreeTable: // TODO: add when general test for List is more self-contained Atk.Object item = child.RefAccessibleChild (0); States (item, Atk.StateType.Enabled, Atk.StateType.Focusable, Atk.StateType.Selectable, Atk.StateType.Sensitive, Atk.StateType.SingleLine, Atk.StateType.Transient); break; case Atk.Role.SpinButton: // TODO: add when general test for Spinner has values less hard-coded break; } } }
public EventCollection FindByRole(Atk.Role role) { return(new EventCollection(this.FindAll(delegate(AtSpiEvent ev) { return ev.SourceRole == role; }), originalRepr)); }