Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 263 lines (241 sloc) 7.194 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Mike Gorse <mgorse@novell.com>
//

using System;
using System.Collections.Generic;
using NDesk.DBus;
using org.freedesktop.DBus;

namespace Atspi
{
public class EventWindow : EventBase
{
private IEventWindow proxy;

public EventWindow (Accessible accessible) : base (accessible)
{
proxy = Registry.Bus.GetObject<IEventWindow> (accessible.Application.Name, new ObjectPath (accessible.path));
}

public event EventSimple Minimize {
add {
Registry.RegisterEventListener ("Window:Minimize");
proxy.Minimize += GetDelegate (value);
}
remove {
proxy.Minimize -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Minimize");
}
}

public event EventSimple Maximize {
add {
Registry.RegisterEventListener ("Window:Maximize");
proxy.Maximize += GetDelegate (value);
}
remove {
proxy.Maximize -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Maximize");
}
}

public event EventSimple Restore {
add {
Registry.RegisterEventListener ("Window:Restore");
proxy.Restore += GetDelegate (value);
}
remove {
proxy.Restore -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Restore");
}
}

public event EventSimple Close {
add {
Registry.RegisterEventListener ("Window:Close");
proxy.Close += GetDelegate (value);
}
remove {
proxy.Close -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Close");
}
}

public event EventSimple Create {
add {
Registry.RegisterEventListener ("Window:Create");
proxy.Create += GetDelegate (value);
}
remove {
proxy.Create -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Create");
}
}

public event EventSimple Reparent {
add {
Registry.RegisterEventListener ("Window:Reparent");
proxy.Reparent += GetDelegate (value);
}
remove {
proxy.Reparent -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Reparent");
}
}

public event EventSimple DesktopCreate {
add {
Registry.RegisterEventListener ("Window:DesktopCreate");
proxy.DesktopCreate += GetDelegate (value);
}
remove {
proxy.DesktopCreate -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:DesktopCreate");
}
}

public event EventSimple DesktopDestroy {
add {
Registry.RegisterEventListener ("Window:DesktopDestroy");
proxy.DesktopDestroy += GetDelegate (value);
}
remove {
proxy.DesktopDestroy -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:DesktopDestroy");
}
}

public event EventSimple Destroy {
add {
Registry.RegisterEventListener ("Window:Destroy");
proxy.Destroy += GetDelegate (value);
}
remove {
proxy.Destroy -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Destroy");
}
}

public event EventSimple Activate {
add {
Registry.RegisterEventListener ("Window:Activate");
proxy.Activate += GetDelegate (value);
}
remove {
proxy.Activate -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Activate");
}
}

public event EventSimple Deactivate {
add {
Registry.RegisterEventListener ("Window:Deactivate");
proxy.Deactivate += GetDelegate (value);
}
remove {
proxy.Deactivate -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Deactivate");
}
}

public event EventSimple Raise {
add {
Registry.RegisterEventListener ("Window:Raise");
proxy.Raise += GetDelegate (value);
}
remove {
proxy.Raise -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Raise");
}
}

public event EventSimple Lower {
add {
Registry.RegisterEventListener ("Window:Lower");
proxy.Lower += GetDelegate (value);
}
remove {
proxy.Lower -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Lower");
}
}

public event EventSimple Move {
add {
Registry.RegisterEventListener ("Window:Move");
proxy.Move += GetDelegate (value);
}
remove {
proxy.Move -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Move");
}
}

public event EventSimple Resize {
add {
Registry.RegisterEventListener ("Window:Resize");
proxy.Resize += GetDelegate (value);
}
remove {
Registry.DeregisterEventListener ("Window:Resize");
proxy.Resize -= GetDelegate (value);
}
}

public event EventSimple Shade {
add {
Registry.RegisterEventListener ("Window:Shade");
proxy.Shade += GetDelegate (value);
}
remove {
proxy.Shade -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Shade");
}
}

public event EventSimple Unshade {
add {
Registry.RegisterEventListener ("Window:Unshade");
proxy.Unshade += GetDelegate (value);
}
remove {
proxy.Unshade -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Unshade");
}
}

public event EventSimple Restyle {
add {
Registry.RegisterEventListener ("Window:Restyle");
proxy.Restyle += GetDelegate (value);
}
remove {
proxy.Restyle -= GetDelegate (value);
Registry.DeregisterEventListener ("Window:Restyle");
}
}
}

[Interface ("org.a11y.atspi.Event.Window")]
internal interface IEventWindow
{
event AtspiEventHandler Minimize;
event AtspiEventHandler Maximize;
event AtspiEventHandler Restore;
event AtspiEventHandler Close;
event AtspiEventHandler Create;
event AtspiEventHandler Reparent;
event AtspiEventHandler DesktopCreate;
event AtspiEventHandler DesktopDestroy;
event AtspiEventHandler Destroy;
event AtspiEventHandler Activate;
event AtspiEventHandler Deactivate;
event AtspiEventHandler Raise;
event AtspiEventHandler Lower;
event AtspiEventHandler Move;
event AtspiEventHandler Resize;
event AtspiEventHandler Shade;
event AtspiEventHandler Unshade;
event AtspiEventHandler Restyle;
}
}
Something went wrong with that request. Please try again.