1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef __ACCCOMMON_H_
23 #define __ACCCOMMON_H_
24 
25 
26 //using namespace com::sun::star::accessibility;
27 //using namespace com::sun::star::uno;
28 
29 
30 //for MAccessible.cpp
31 struct ltComp
32 {
operator ()ltComp33     bool operator()(REFGUID  rguid1, REFGUID  rguid2) const
34     {
35         if(((PLONG) &rguid1)[0] < ((PLONG) &rguid2)[0])
36             return TRUE;
37         else if(((PLONG) &rguid1)[0] > ((PLONG) &rguid2)[0])
38             return FALSE;
39         if(((PLONG) &rguid1)[1] < ((PLONG) &rguid2)[1])
40             return TRUE;
41         else if(((PLONG) &rguid1)[1] > ((PLONG) &rguid2)[1])
42             return FALSE;
43         if(((PLONG) &rguid1)[2] < ((PLONG) &rguid2)[2])
44             return TRUE;
45         else if(((PLONG) &rguid1)[2] > ((PLONG) &rguid2)[2])
46             return FALSE;
47         if(((PLONG) &rguid1)[3] < ((PLONG) &rguid2)[3])
48             return TRUE;
49         else if(((PLONG) &rguid1)[3] > ((PLONG) &rguid2)[3])
50             return FALSE;
51         return FALSE;
52     }
53 };
54 
55 #define BEGIN_AGGOBJECT_MAP(x) \
56 	static _UNO_AGGMAP_ENTRY* WINAPI _GetAggEntries() { \
57 	static _UNO_AGGMAP_ENTRY _aggentries[] = {
58 #define END_AGGOBJECT_MAP()   {NULL, NULL,NULL}}; \
59 	return _aggentries;}
60 #define AGGOBJECT_ENTRY(iid, clsid, ifindex) {&iid, \
61 	CComAggregateCreator< CComObject<CMAccessible>, &clsid >::CreateInstance,\
62 	XI_##ifindex},
63 
64 enum DM_NIR {
65     DM_FIRSTCHILD = 0x00,
66     DM_LASTCHILD = 0x01,
67     DM_NEXTCHILD = 0x02,
68     DM_PREVCHILD = 0x03
69 };
70 
ImplIsEqualGUID(REFGUID rguid1,REFGUID rguid2)71 inline BOOL ImplIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
72 {
73     return (
74                ((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] &&
75                ((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] &&
76                ((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] &&
77                ((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]);
78 }
79 #define InlineIsEqualGUID ImplIsEqualGUID
80 //End
81 
82 //for AccAction.cpp
83 #define CODEENTRY(key) \
84 	{KEYCODE_##key, L#key}
85 #define countof(x)	(sizeof(x)/sizeof(x[0]))
86 
87 #define SELECT       L"Select"
88 #define PRESS        L"Press"
89 #define UNCHECK      L"UnCheck"
90 #define CHECK        L"Check"
91 //End
92 
93 static DWORD GetMSAAStateFromUNO(short xState);
94 
95 #endif
96