1 #ifndef __WMOPTION_H
2 #define __WMOPTION_H
3 
4 #include "upath.h"
5 #include "yarray.h"
6 #include "ypointer.h"
7 
8 struct WindowOption {
9     WindowOption(mstring n_class_instance = null);
10     void combine(const WindowOption& n);
11 
12     mstring w_class_instance;
13     mstring keyboard;
14     mstring icon;
15     unsigned functions, function_mask;
16     unsigned decors, decor_mask;
17     unsigned options, option_mask;
18     int workspace;
19     int layer;
20     int tray;
21     int order;
22     int opacity;
23     int gflags;
24     int gx, gy;
25     unsigned gw, gh;
26 };
27 
28 class WindowOptions {
29 public:
30     void setWinOption(mstring n_class_instance,
31                       const char *opt, const char *arg);
32 
33     void mergeWindowOption(WindowOption &cm,
34                            mstring a_class_instance,
35                            bool remove);
36 
getCount()37     int getCount() const { return fWinOptions.getCount(); }
nonempty()38     bool nonempty() const { return fWinOptions.nonempty(); }
isEmpty()39     bool isEmpty() const { return fWinOptions.isEmpty(); }
40 
41 private:
42     YObjectArray<WindowOption> fWinOptions;
43 
44     bool findOption(mstring a_class_instance, int *index);
45 
46     WindowOption *getOption(mstring a_class_instance);
47 };
48 
49 extern lazy<WindowOptions> defOptions;
50 extern lazy<WindowOptions> hintOptions;
51 
52 void loadWinOptions(upath optFile);
53 
54 #endif
55 
56 // vim: set sw=4 ts=4 et:
57