Debian Codegraph @

plugins/aiksaurus/aiksaurusgtk3/AiksaurusGTK-C.cpp

raw
1 /*
2 * AiksaurusGTK - A GTK interface to the Aiksaurus library
3 * Copyright (C) 2001 by Jared Davis
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 * 02111-1307, USA.
19 */
20
21 #include "AiksaurusGTK-C.h"
22 #include "AiksaurusGTK.h"
23 #include <new>
24
25 static AiksaurusGTK *instance = 0;
26
27 int AiksaurusGTK_init()
28 {
29 if (!instance)
30 instance = new(std::nothrow) AiksaurusGTK;
31
32 return (instance != 0);
33 }
34
35
36 void AiksaurusGTK_destroy()
37 {
38 delete instance;
39 instance = 0;
40 }
41
42
43 void AiksaurusGTK_setTitle(const char* title)
44 {
45 if (instance)
46 instance->setTitle(title);
47 }
48
49
50 void AiksaurusGTK_setInitialMessage(const char* message)
51 {
52 if (instance)
53 instance->setInitialMessage(message);
54 }
55
56
57 void AiksaurusGTK_showReplacebar()
58 {
59 if (instance)
60 instance->showReplacebar();
61 }
62
63
64 void AiksaurusGTK_hideReplacebar()
65 {
66 if (instance)
67 instance->hideReplacebar();
68 }
69
70 const char* AiksaurusGTK_runThesaurus(const char* word)
71 {
72 return (instance) ? (instance->runThesaurus(word)) : (word);
73 }
74