OSDN Git Service

init
[eb123/eb123.git] / src / mainwnd.h
1
2 #ifndef __MAINWND_H__
3 #define __MAINWND_H__
4
5 #include "builder.h"
6 #include "dicts.h"
7 #include "prefs.h"
8 #include "textview.h"
9
10 G_BEGIN_DECLS
11
12 #define TYPE_MAINWND (mainwnd_get_type ())
13 #define MAINWND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAINWND, Mainwnd))
14 #define MAINWND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAINWND, MainwndClass))
15 #define IS_MAINWND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAINWND))
16 #define IS_MAINWND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAINWND))
17 #define MAINWND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAINWND, MainwndClass))
18
19 typedef struct _Mainwnd Mainwnd;
20 typedef struct _MainwndClass MainwndClass;
21
22 struct _Mainwnd {
23     GtkWindow   parent_instance;
24     Builder     *builder;
25     Dicts       *dicts;
26     Prefs       *prefs;
27     GSequence   *results;
28     TextView    *text;
29 };
30
31 struct _MainwndClass {
32     GtkWindowClass parent_class;
33 };
34
35 void            mainwnd_show_about(GtkWidget *w, gpointer data);
36 void            mainwnd_prepare(Mainwnd *self);
37 void            mainwnd_dicts_update();
38 GtkWindow*      mainwnd_get_wnd();
39 GSequence*      mainwnd_get_results();
40 gint            mainwnd_get_search_method();
41 gboolean        mainwnd_get_dicts(GtkTreeModel **store, GtkTreeIter *iter);
42 void            mainwnd_insert_text(gchar *txt, gboolean clear);
43 void            mainwnd_clear_text();
44 void            mainwnd_search(Mainwnd *self, const gchar *word);
45 void            mainwnd_open(Mainwnd *self, RESULT *res);
46 void            mainwnd_exit();
47
48 GType          mainwnd_get_type (void);
49
50 G_END_DECLS
51
52 void            mainwnd_iconify_restore();
53 void            mainwnd_search_();
54 void            mainwnd_reset_font();
55 void            mainwnd_clear_combo();
56 GtkWidget*      mainwnd_search_method_combo();
57
58 #if 0
59 struct _mainwnd
60 {
61     gboolean    custom_font, remember_pos;
62     gchar       *font;
63     gint        x, y, w, h, search;
64     GtkWidget   *wnd, *combo_method, *combo_word, *dictbar;
65     GSequence   *results;
66 } mainwnd;
67
68 struct _paned
69 {
70     gint        treew, treeh;
71     GtkWidget   *pane, *tree;
72     EbTextView  *view;
73 } paned;
74 #endif
75
76 #endif /* __MAINWND_H__ */