Add missing libraries to examples' Makefiles
[dockapps.git] / wmail / src / config.h
bloba398b04502bb8a778c0e913b9ae519b586c35b0d
1 ///////////////////////////////////////////////////////////////////////////////
2 // config.h
3 // configuration file parser, part of wmail
4 //
5 // Copyright 2000-2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
6 // Copyright 2016-2017, Doug Torrance <dtorrance@piedmont.edu>.
7 // Copyright 2019, Jeremy Sowden <jeremy@azazel.net>.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions
11 // are met:
12 // 1. Redistributions of source code must retain the above copyright
13 // notice, this list of conditions, and the following disclaimer.
14 // 2. Redistributions in binary form must reproduce the above copyright
15 // notice, this list of conditions, and the following disclaimer in the
16 // documentation and/or other materials provided with the distribution.
17 // 3. The name of the author may not be used to endorse or promote products
18 // derived from this software without specific prior written permission.
20 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_
33 #define _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_
35 typedef enum {
36 TICKER_ADDRESS = 0,
37 TICKER_FAMILYNAME = 1,
38 TICKER_NICKNAME = 2
39 } ticker_mode_t;
41 // re-allocated color-names (to enable disposing of them on reconfiguration)
42 enum {
43 SYM_COLOR = 1<<0,
44 FNT_COLOR = 1<<1,
45 BCK_COLOR = 1<<2,
46 OFF_COLOR = 1<<3,
47 BGR_COLOR = 1<<4
50 // flags to mark used cmdline options
51 enum {
52 CL_DISPLAY = 1 << 0,
53 CL_MAILBOX = 1 << 1,
54 CL_RUNCMD = 1 << 2,
55 CL_SYMBOLCOLOR = 1 << 3,
56 CL_FONTCOLOR = 1 << 4,
57 CL_BACKCOLOR = 1 << 5,
58 CL_OFFLIGHTCOLOR = 1 << 6,
59 CL_BACKGROUNDCOLOR = 1 << 7,
60 CL_CHECKINTERVAL = 1 << 8,
61 CL_FPS = 1 << 9,
62 CL_NEWMAILONLY = 1 << 10,
63 CL_NOSHAPE = 1 << 11,
64 CL_TICKERMODE = 1 << 12,
65 CL_CMDONMAIL = 1 << 13,
66 CL_CONSIDERSTATUSFIELD = 1 << 14,
67 CL_READSTATUS = 1 << 15,
68 CL_USEX11FONT = 1 << 16,
69 CL_CONFIGFILE = 1 << 17
72 typedef struct _config_t {
73 char *display; // display-name
74 char *mailBox; // mailbox-name
75 char *runCmd; // command to run when the run-btn was pressed
76 char *symbolColor; // colorname of the upper-symbols while they are active
77 char *fontColor; // colorname of the ticker- and counter-digits-font
78 char *backColor; // colorname of the background
79 char *offlightColor; // colorname of inactive symbols and counter-digits
80 char *backgroundColor; // colorname of the frame when in noshape-mode
81 char *checksumFileName; // name of the checksum-file
82 int checkInterval; // sesonds between mailbox-checks
83 int fps; // ticker-frames per second
84 bool newMailsOnly; // true means only ticker and count new (unread) mail
85 bool noshape; // true means don't use shape the dockapp
86 ticker_mode_t tickerMode; // ticker senders adress, family-name or nick-name
87 char **skipNames; // sender-names that wmail has to skip
88 char *cmdOnMail; // command to execute when a new mail has received
89 bool considerStatusField; // use the status-field of the mail-header to determine its read-status
90 char *readStatus; // status field content that indicates read mails ("O" for netscape, "ro" for pine etc.)
91 char *useX11Font; // X11 font to render the ticker (NULL -> fallback to buildin font)
92 // ---------------------- //
93 int colorsUsed; // used (malloced) color-names
94 int givenOptions; // bitfield flags all options specified on the cmd-line
95 } config_t;
98 // app configuration data (declared in config.c)
99 extern config_t config;
101 // config manipulation functions
102 void ReadConfigFile( const char *configFile, bool resetConfigStrings );
104 void ResetConfigStrings( void );
106 #endif