Exemple #1
0
        internal Desktop(Application registry)
            : base(registry, "/org/a11y/atspi/accessible/root")
        {
            lock (sync) {
                if (instance == null)
                    instance = this;
                else
                    throw new Exception ("Attempt to create a second desktop");
            }
            role = Role.DesktopFrame;
            children = new List<Accessible> ();

            stateSet = new StateSet ();
            stateSet.Add (StateType.Enabled);
            stateSet.Add (StateType.Sensitive);
            stateSet.Add (StateType.Showing);
            stateSet.Add (StateType.Visible);

            InitEvents ();
        }
Exemple #2
0
        internal void Update(AccessibleProxy e)
        {
            bool initializing = (stateSet == null);
            if (e.name != name) {
                string oldName = name;
                name = e.name;
                if (!initializing)
                    Desktop.RaiseNameChanged (this, oldName, e.name);
            }

            parent = Registry.GetElement (e.parent, false);
            if (parent == null && role == Role.Application)
                parent = Desktop.Instance;
            // Assuming that old and new parents are also
            // going to send ChildrenChanged signals, so
            // not going to update their caches or send
            // add/remove notifications here.

            Role newRole = (Role)e.role;
            if (newRole != role) {
                Role oldRole = role;
                role = newRole;
                if (!initializing)
                    Desktop.RaiseRoleChanged (this, oldRole, newRole);
            }

            if (e.description != description) {
                string oldDescription = description;
                description = e.description;
                if (!initializing)
                    Desktop.RaiseDescriptionChanged (this, oldDescription, e.description);
            }

            interfaces = 0;
            foreach (string iface in e.interfaces)
                AddInterface (iface);

            stateSet = new StateSet (this, e.states);
            // Using at-spi StateChanged events to broadcast
            // changes for now; needed for gail Focused handling
            UpdateChildren (e.children);
        }