Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <unx/gtk/atkbridge.hxx>
22 : #include <unx/gtk/gtkframe.hxx>
23 :
24 : #include "atkfactory.hxx"
25 : #include "atkutil.hxx"
26 : #include "atkwindow.hxx"
27 : #include <stdio.h>
28 :
29 0 : bool InitAtkBridge(void)
30 : {
31 : #if !GTK_CHECK_VERSION(3,0,0)
32 0 : const char* pVersion = atk_get_toolkit_version();
33 0 : if( ! pVersion )
34 0 : return false;
35 :
36 : unsigned int major, minor, micro;
37 :
38 : /* check gail minimum version requirements */
39 0 : if( sscanf( pVersion, "%u.%u.%u", &major, &minor, µ) < 3 )
40 : {
41 : // g_warning( "unable to parse gail version number" );
42 0 : return false;
43 : }
44 :
45 0 : if( ( (major << 16) | (minor << 8) | micro ) < ( (1 << 16) | 8 << 8 | 6 ) )
46 : {
47 0 : g_warning( "libgail >= 1.8.6 required for accessibility support" );
48 0 : return false;
49 : }
50 :
51 : /* Initialize the AtkUtilityWrapper class */
52 0 : g_type_class_unref( g_type_class_ref( OOO_TYPE_ATK_UTIL ) );
53 :
54 : /* Initialize the GailWindow wrapper class */
55 0 : g_type_class_unref( g_type_class_ref( OOO_TYPE_WINDOW_WRAPPER ) );
56 :
57 : /* Register AtkObject wrapper factory */
58 0 : AtkRegistry * registry = atk_get_default_registry();
59 0 : if( registry )
60 0 : atk_registry_set_factory_type( registry, OOO_TYPE_FIXED, OOO_TYPE_WRAPPER_FACTORY );
61 : #endif
62 :
63 0 : return true;
64 : }
65 :
66 0 : void DeInitAtkBridge()
67 : {
68 : #if !GTK_CHECK_VERSION(3,0,0)
69 0 : restore_gail_window_vtable();
70 : #endif
71 0 : }
72 :
73 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|