about.c: cosmetix
[k8lowj.git] / src / conf.h
blob766c61b6bb8adb1426583d4dfaf1ae590bea8417
1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
5 */
7 #ifndef CONF_H
8 #define CONF_H
10 #include "liblj/livejournal.h"
12 #ifdef HAVE_GTK
13 #include "gtk-all.h"
14 #include "jamview.h" /* need META_COUNT */
15 #endif
17 #include "account.h"
18 #include "checkfriends.h"
20 typedef struct {
21 int x, y, width, height;
22 int panedpos; /* optional; for windows with panes. */
23 } Geometry;
25 /* this should match the geometry_names[] array in conf_xml.c */
26 typedef enum {
27 GEOM_MAIN,
28 GEOM_LOGIN,
29 GEOM_FRIENDS,
30 GEOM_FRIENDGROUPS,
31 GEOM_CONSOLE,
32 GEOM_MANAGER,
33 GEOM_CFFLOAT,
34 GEOM_OFFLINE,
35 GEOM_PREVIEW,
36 GEOM_COUNT
37 } GeometryType;
39 typedef struct {
40 gboolean netdump;
41 gboolean nofork;
42 gboolean useproxy;
43 gboolean useproxyauth;
44 #ifdef HAVE_GTK
45 #ifdef HAVE_GTKSPELL
46 gboolean usespellcheck;
47 #endif
48 gboolean revertusejournal;
49 gboolean autosave;
50 gboolean cfautostart;
51 gboolean cfusemask;
52 gboolean docklet;
53 gboolean cffloat;
54 gboolean cffloatraise;
55 gboolean cffloat_decorate;
56 gboolean friends_hidestats;
57 gboolean allowmultipleinstances;
58 gboolean smartquotes;
59 gboolean smartquotes_russian;
60 gboolean showmeta[JAM_VIEW_META_COUNT];
61 #endif /* HAVE_GTK */
62 } Options;
64 enum {
65 POSTMODE_GUI,
66 POSTMODE_CMD
67 } PostmodeType;
69 typedef struct {
70 char *label;
71 char *command;
72 } CommandList;
74 typedef struct {
75 /* configuration file */
76 GSList *hosts;
77 JamHost *lasthost;
79 Geometry geometries[GEOM_COUNT];
81 Options options;
83 gchar *uifont;
84 #ifdef HAVE_GTKSPELL
85 gchar *spell_language;
86 #endif
87 #ifndef G_OS_WIN32
88 char *spawn_command;
90 char *music_command;
92 char *proxy;
93 char *proxyuser, *proxypass;
94 #endif
96 LJSecurity defaultsecurity;
98 gint cfuserinterval;
99 gint cfthreshold;
101 /* run-time settings. */
102 int postmode;
103 } Configuration;
105 typedef struct {
106 gchar *programname;
107 gchar *conf_dir; /* may be null, which means <home>/.logjam/ */
109 gboolean cli; /* true if there's no gui */
110 gboolean quiet;
112 #ifdef HAVE_GTK
113 GtkTooltips *tooltips;
114 GSList *secmgr_list;
116 GSList *quiet_dlgs;
118 CFMgr *cfmgr;
119 CFFloat *cf_float;
121 gint autosave; /* timeout id */
123 void *remote;
124 void *docklet;
125 #endif
126 } Application;
128 JamHost* conf_host_by_name(Configuration *c, const char *hostname);
130 extern Configuration conf;
131 extern Application app;
133 int conf_verify_dir(void);
134 void conf_make_path(char *file, char *buf, int len);
136 char* conf_make_account_path(JamAccount *acc, const char *path);
138 void conf_verify_a_host_exists();
140 gboolean conf_rename_host(JamHost *host, const char *newname, GError **err);
142 #endif /* CONF_H */