summaryrefslogtreecommitdiff
path: root/src/org.freedesktop.DBus.Idl.Tests1.didl
blob: c630bb9b1eb1aa58d5806c9d4fc79ad34d4cde99 (plain)
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
@Version("1.5")
namespace org.freedesktop.DBus.Idl.Tests1
{
  /**
   * @Failed: The operation failed.
   * @Busy: The operation cannot be performed because the flux capicator is busy.
   * @Cancelled: The operation was cancelled.
   * @WouldBlock: The operation would block and non-blocking semantics was requested.
   *
   * An example of an error domain.
   *
   * @brief: Error domain
   */
  error_domain Error
  {
    Failed,
    Busy,
    Cancelled,
    WouldBlock
  };

  // An example of manual doc tags.

  @Doc("Another Error Domain.")
  @DocBrief("Another Error Domain")
  error_domain Error2
  {
    @Doc("Parsing failed.")
    ParsingFailed,
    @Doc("Foo operation failed.")
    FooFailed
  };

  /**
   * An example struct.
   * @bar: First member.
   * @baz: Second member.
   * @something: Third member.
   * @lots_of_something: An array of #Variant<!-- -->s.
   * @property_bag: A property bag.
   *
   * A longer explanation of the example struct.
   *
   * @brief: An example struct
   */
  struct Struct1
  {
    int32 bar;
    uint64 baz;
    variant something;
    array<variant> lots_of_something;
    dict<string,variant> property_bag;
  };

  /**
   * @a: Blah.
   * @b: Baz.
   * @c: Dah.
   * @d: Frob.
   * @stuff: Stuff.
   * @foo: Foo.
   *
   * Some dynamic structure - this is marshalled as
   * <literal>a{sv}</literal> on the wire.
   *
   * @brief: A Dynamic Struct
   */
  dynamic_struct Struct2
  {
    uint64 a;
    uint64 b;
    uint64 c;
    string d;
    array<string> stuff;
    Struct1 foo;
  };

  /**
   * @Foo: Some value.
   * @Bar: Some value.
   * @Baz: Some value.
   * @BigFoo: Some value.
   * @BigBar: Some value.
   * @BigBaz: Some value.
   * @A: Some value.
   * @B: Some value.
   * @C: Some value.
   * @D: Some value.
   * @E: Some value.
   * @F: Some value.
   * @G: Some value.
   * @H: Some value.
   *
   * An enumeration.
   *
   * @brief: Brief docs for enum
   */
  enum Enum1
  {
    Foo,
    Bar,
    Baz,
    BigFoo = 1000,
    BigBar,
    BigBaz,
    A = 2000 + 0,
    B = 2100 - 10,
    C = -32,
    D = 1408 / 11,
    E = 2 * 5,
    F = 1<<5,
    G = (1<<5) + 10,
    H = 1<<5 + 10
  };

  /**
   * @None: No flags set.
   * @AllowReplacement: Allow replacement of bla.
   * @Replace: Replace exisiting bla.
   * @Activate: Activate the Yoyo.
   *
   * Flags used in the EnumMethod() method.
   *
   * @brief: Flags used for EnumMethod()
   */
  @Flags
  enum Enum2
  {
    None = 0,
    AllowReplacement = 1<<0,
    Replace = 1<<1,
    Activate = 1<<2
  };

  /**
   * @x: The X coordinate.
   * @y: The Y coordinate.
   *
   * A data type representing coordinates in a two-dimensional
   * Cartesian coordinate system using integers.
   *
   * See
   * <ulink url="http://en.wikipedia.org/wiki/Cartesian_coordinate_system">
   * <citetitle>this Wikipedia article</citetitle>
   * </ulink>
   * for more information.
   *
   * @brief: Fixed-point 2D coordinate
   * @see: #RealPoint
   */
  struct Point
  {
    int32 x;
    int32 y;
  };

  /**
   * @x: The X coordinate.
   * @y: The Y coordinate.
   *
   * A data type representing coordinates in a two-dimensional
   * Cartesian coordinate system using floating point numbers.
   *
   * @brief: 2D coordinate
   */
  struct RealPoint
  {
    double x;
    double y;
  };

  @Doc("A data type holding a pair of 32-bit integers.")
  @DocBrief("Pair of integers")
  struct Pair
  {
    @Doc("First element in pair.")
    int32 first;
    @Doc("Second element in pair.")
    int32 second;
  };

  /**
   * Here is a longer description of the #Frobnicable interface.
   *
   * @brief: An interface for frobbing
   */
  interface Frobnicable
  {
    /// Method doing nothing
    VoidMethod ();

    /**
     * @a1: A parameter.
     * @a2: A parameter.
     * @a3: A parameter.
     * @a4: A parameter.
     * @a5: A parameter.
     * @a6: A parameter.
     * @a7: A parameter.
     * @a8: A parameter.
     * @a9: A parameter.
     * @a10: A parameter.
     * @a11: A parameter.
     * @a12: A parameter.
     *
     * Method taking primitive types.
     */
    PrimitiveMethod (in byte a1,
                     in boolean a2,
                     in int16 a3,
                     in uint16 a4,
                     in int32 a5,
                     in uint32 a6,
                     in int64 a7,
                     in uint64 a8,
                     in double a9,
                     in string a10,
                     in objpath a11,
                     in signature a12);

    /**
     * @a1: An array of #int32<!-- -->s.
     * @a2: An array of #string<!-- -->s.
     * @a3: An array of an array of #int32.
     * @a4: A hash from #int32 to #int32.
     * @a5: Some weird Hash Table.
     *
     * This tests various container stuff.
     */
    @NoReply
    ContainerMethod (in array<int32> a1,
                     in array<string> a2,
                     in array<array<int32>> a3,
                     in dict<int32,int32> a4,
                     in dict<string,dict<string,array<string>>> a5);

    /**
     * @a1: A parameter.
     * @a2: A parameter.
     * @a3: A parameter.
     * @a4: A parameter.
     * @a5: A parameter.
     * @a6: A parameter.
     * @a7: A parameter.
     *
     * Method for test various structs.
     */
    @Deprecated
    StructsMethod (in Struct1 a1,
                   in array<Struct1> a2,
                   in array<array<Struct1>> a3,
                   in dict<string,Struct1> a4,
                   out Struct2 a5,
                   out array<Struct2> a6,
                   out dict<string,Struct2> a7);

    /**
     * @a1: A parameter.
     * @a2: A parameter.
     *
     * Method for testing enum stuff.
     */
    @Since("1.3")
    EnumMethod (in Enum1 a1, out Enum2 a2);

    /// Signal doing nothing
    @Deprecated("1.2")
    signal VoidSignal();

    /**
     * @points: An array of #Point<!-- -->s.
     * @pairs: An array of #Pairs<!-- -->s.
     *
     * A signal with some points and pairs.
     */
    signal ArgSignal (array<Point> points, array<Pair> pairs);

    /// This is a property that is both readable and writable.
    property int32 RWProperty;

    /// This is a read-only property.
    readonly property int32 ROProperty;

    /// And a write-only property.
    writeonly property int32 WOProperty;

    /**
     * A rather complex property.
     */
    property dict<string,array<Point>> ComplexProperty;
  };

  /**
   * This is an example of another interface.
   *
   * @brief: Another interface
   */
  interface SecondaryProtocol
  {
    /**
     * @foo: Secret parameter.
     *
     * This method is secret. Shh!
     */
    SecretMethod (in int32 foo);
  };

};