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
|
/* gdict-defbox.h - display widget for dictionary definitions
*
* Copyright (C) 2005-2006 Emmanuele Bassi <ebassi@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
*/
#ifndef __GDICT_DEFBOX_H__
#define __GDICT_DEFBOX_H__
#include <gtk/gtk.h>
#include "gdict-context.h"
G_BEGIN_DECLS
#define GDICT_TYPE_DEFBOX (gdict_defbox_get_type ())
#define GDICT_DEFBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_DEFBOX, GdictDefbox))
#define GDICT_IS_DEFBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_DEFBOX))
#define GDICT_DEFBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_DEFBOX, GdictDefboxClass))
#define GDICT_IS_DEFBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_DEFBOX))
#define GDICT_DEFBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_DEFBOX, GdictDefboxClass))
typedef struct _GdictDefbox GdictDefbox;
typedef struct _GdictDefboxClass GdictDefboxClass;
typedef struct _GdictDefboxPrivate GdictDefboxPrivate;
struct _GdictDefbox
{
/*< private >*/
GtkVBox parent_instance;
GdictDefboxPrivate *priv;
};
struct _GdictDefboxClass
{
GtkVBoxClass parent_class;
/* these are all RUN_ACTION signals for key bindings */
void (*show_find) (GdictDefbox *defbox);
void (*hide_find) (GdictDefbox *defbox);
void (*find_previous) (GdictDefbox *defbox);
void (*find_next) (GdictDefbox *defbox);
/* signals */
void (*link_clicked) (GdictDefbox *defbox,
const gchar *link);
/* padding for future expansion */
void (*_gdict_defbox_1) (void);
void (*_gdict_defbox_2) (void);
void (*_gdict_defbox_3) (void);
void (*_gdict_defbox_4) (void);
};
GType gdict_defbox_get_type (void) G_GNUC_CONST;
GtkWidget * gdict_defbox_new (void);
GtkWidget * gdict_defbox_new_with_context (GdictContext *context);
void gdict_defbox_set_context (GdictDefbox *defbox,
GdictContext *context);
GdictContext * gdict_defbox_get_context (GdictDefbox *defbox);
void gdict_defbox_set_database (GdictDefbox *defbox,
const gchar *database);
const gchar *gdict_defbox_get_database (GdictDefbox *defbox);
const gchar *gdict_defbox_get_word (GdictDefbox *defbox);
gchar * gdict_defbox_get_text (GdictDefbox *defbox,
gsize *length) G_GNUC_MALLOC;
void gdict_defbox_select_all (GdictDefbox *defbox);
void gdict_defbox_copy_to_clipboard (GdictDefbox *defbox,
GtkClipboard *clipboard);
void gdict_defbox_clear (GdictDefbox *defbox);
void gdict_defbox_lookup (GdictDefbox *defbox,
const gchar *word);
gint gdict_defbox_count_definitions (GdictDefbox *defbox);
void gdict_defbox_jump_to_definition (GdictDefbox *defbox,
gint number);
void gdict_defbox_set_show_find (GdictDefbox *defbox,
gboolean show_find);
gboolean gdict_defbox_get_show_find (GdictDefbox *defbox);
void gdict_defbox_find_next (GdictDefbox *defbox);
void gdict_defbox_find_previous (GdictDefbox *defbox);
void gdict_defbox_set_font_name (GdictDefbox *defbox,
const gchar *font_name);
const gchar *gdict_defbox_get_font_name (GdictDefbox *defbox);
gchar * gdict_defbox_get_selected_word (GdictDefbox *defbox) G_GNUC_MALLOC;
G_END_DECLS
#endif /* __GDICT_DEFBOX_H__ */
|