fixing parse error in execcommand
[bbkeys.git] / src / Baseresource.hh
blobdb1c25e11700fd0f7fe6420a9dace3e451b4f2c4
1 // Baseresource.hh for bbtools - tools to display resources in X11.
2 //
3 // Copyright (c) 1998-1999 John Kennis, jkennis@chello.nl
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 // (See the included file COPYING / GPL-2.0)
21 // $Id$
23 #ifndef __BASERESOURCE_HH
24 #define __BASERESOURCE_HH
26 #ifdef HAVE_SYS_TYPES_H
27 # include <sys/types.h>
28 #endif
30 #ifdef HAVE_SYS_STAT_H
31 # include <sys/stat.h>
32 #endif
34 #ifdef HAVE_UNISTD_H
35 # include <unistd.h>
36 #endif
38 extern "C" {
39 #include <X11/Xlib.h>
40 #include <X11/Xresource.h>
43 #include "Timer.hh"
45 #define BBTOOLS 1
46 #define BLACKBOX 2
48 #define BBTOOL_LOCAL ".bbtools/bbkeys.nobb"
49 #define BLACKBOX_LOCAL ".bbtools/bbkeys.bb"
51 class ToolWindow;
52 class BImageControl;
53 class BColor;
54 class BTexture;
56 struct STYLE {
57 bool auto_config;
58 bool honor_modifiers;
59 char *conf_filename;
60 char *style_filename;
61 time_t mtime;
64 class BaseResource : public TimeoutHandler {
66 public:
67 BaseResource(ToolWindow *);
68 virtual ~BaseResource(void);
70 void CopyColor(BColor *,BColor *);
71 void CopyTexture(BTexture ,BTexture *);
72 void Reload(void);
73 STYLE style;
75 protected:
76 void Load(void);
77 void readDatabaseColor(const char *, const char *, BColor *);
78 void readDatabaseTexture(const char *, const char *, BTexture *);
79 void readColor(const char *, const char *, const char *, const char *,
80 const char *,BColor *);
81 void readTexture(const char *, const char *, const char *, const char *,
82 const char *, const char *, const char *, BTexture *);
85 ToolWindow *bbtool;
86 XrmDatabase resource_db;
87 XrmDatabase db;
89 virtual void LoadBBToolResource(void) = 0;
90 virtual void timeout(void);
91 private:
92 bool ReadResourceFromFilename(const char *, const char *);
93 void ReadBBtoolResource(void);
94 void ReadDefaultResource(void);
95 void ReadBlackboxResource(void);
96 BImageControl *image_control;
97 int ResourceType;
98 BTimer *timer;
99 int check_timeout;
100 time_t mtime;
101 struct stat file_status;
102 bool auto_config;
105 #endif /* __BASERESOURCE_HH */