OSDN Git Service

some code cleanup
[eb123/eb123.git] / src / defs.h
1
2 #ifndef __DEFS_H__
3 #define __DEFS_H__
4
5 /* Disable old GTK+ functions */
6 #define GDK_DISABLE_DEPRECATED 1
7 #define GTK_DISABLE_DEPRECATED 1
8 #define GDK_DISABLE_SINGLE_INCLUDES 1
9 #define GTK_DISABLE_SINGLE_INCLUDES 1
10
11 #include <sys/stat.h>
12 #include <fcntl.h>
13 #include <sys/types.h>
14 #include <sys/time.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <gtk/gtk.h>
19 #include <gdk/gdkprivate.h>
20 #include <glib.h>
21 #include <glib/gprintf.h>
22 #include <locale.h>
23 #include <ctype.h>
24 #include <unistd.h>
25 #include <dirent.h>
26 #include <errno.h>
27 #include <intl.h>
28
29 /* Various includes */
30 #include <libxml/HTMLparser.h>
31 #include <libxml/tree.h>
32 #include <libxml/xpath.h>
33 #include <pango/pangox.h>
34 #include <langinfo.h>
35
36 /* Platform specific includes */
37 #include <X11/X.h>
38 #include <X11/Xatom.h>
39 #include <gdk/gdkx.h>
40 #include <gdk/gdkkeysyms.h>
41 #include <gdk-pixbuf/gdk-pixbuf.h>
42
43 /* EB Library includes */
44 #include <eb/eb.h>
45 #include <eb/defs.h>
46 #include <eb/text.h>
47 #include <eb/font.h>
48 #include <eb/appendix.h>
49 #include <eb/error.h>
50 #include <eb/binary.h>
51
52 #ifdef ENABLE_GSTREAMER
53 #include <gst/gst.h>
54 #include <gst/base/gstbasesrc.h>
55 #include <gst/interfaces/xoverlay.h>
56 #include <gst/video/video.h>
57 #endif
58
59 #include "../config.h"
60
61 #define ENC_UTF8            "utf-8"
62 #define ENC_EUC_JP          "euc-jp"
63 #define ENC_SHIFT_JIS       "shift-jis"
64 #define ENC_ISO_2022_JP     "iso-2022-jp"
65 #define ENC_ASCII           "ascii"
66
67 #ifndef SZ
68 #define SZ(a) (sizeof(a)/sizeof(a[0]))
69 #endif
70
71 typedef struct
72 {
73     gboolean active, available;
74     gchar *title, *path, *appendix_path, *subbook_dir;
75     EB_Book *book;
76     EB_Appendix *appendix;
77     EB_Subbook_Code subbook_no, appendix_subbook_no;
78 } BOOK_INFO;
79
80 typedef struct _result_eb
81 {
82     gchar *heading;
83     BOOK_INFO *binfo;
84     EB_Position pos;
85     gint size;
86     gchar *filename;
87 } RESULT;
88
89 #if 0
90 #define SEARCH_METHOD_FORWARD        0
91 #define SEARCH_METHOD_BACKWARD       1
92 #define SEARCH_METHOD_EXACTWORD      2
93 #define SEARCH_METHOD_KEYWORD        3
94 #define SEARCH_METHOD_MENU          10
95 #define SEARCH_METHOD_COPYRIGHT     11
96 #define SEARCH_METHOD_UNKNOWN       99
97 #else
98 enum
99 {
100     SEARCH_METHOD_FORWARD,
101     SEARCH_METHOD_BACKWARD,
102     SEARCH_METHOD_EXACTWORD,
103     SEARCH_METHOD_KEYWORD,
104     SEARCH_METHOD_MENU,
105     SEARCH_METHOD_COPYRIGHT,
106     SEARCH_METHOD_UNKNOWN
107 };
108 #endif
109
110 enum
111 {
112     COLOR_LINK,
113     COLOR_KEYWORD,
114     COLOR_TITLE,
115     COLOR_N
116 };
117
118 enum
119 {
120     DICT_ALIAS,
121     DICT_BINFO,
122     DICT_EDITABLE,
123     DICT_N
124 };
125
126 #include "log.h"
127
128 #define FILENAME_DICTS      "dictionaries.xml"
129 #define FILENAME_PREFS      "preferences.xml"
130 #define FILENAME_HOTKEYS    "hotkeys.xml"
131 #define FILENAME_HISTORY    "history.xml"
132
133 #endif /* __DEFS_H__ */
134