|
Revision 2, 1.4 KB
(checked in by emasson, 3 years ago)
|
|
initial import for the community edition
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | #ifndef _Xrm_h |
|---|
| 10 | #define _Xrm_h |
|---|
| 11 | |
|---|
| 12 | #include "bool.h" |
|---|
| 13 | |
|---|
| 14 | #define XRM_H_CVSID "$Id: Xrm.h,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $" |
|---|
| 15 | |
|---|
| 16 | #include <X11/Xlib.h> |
|---|
| 17 | #include <X11/Xresource.h> |
|---|
| 18 | |
|---|
| 19 | class Xrm { |
|---|
| 20 | public: |
|---|
| 21 | Xrm(const char *className, const char *instanceName); |
|---|
| 22 | Xrm(const char *instanceName, int argc, char **argv); |
|---|
| 23 | ~Xrm(); |
|---|
| 24 | |
|---|
| 25 | const char *className(void) const { return XrmQuarkToString(_class); } |
|---|
| 26 | const char *instanceName(void) const { return XrmQuarkToString(_instance); } |
|---|
| 27 | |
|---|
| 28 | const char *getResource(const char *rname) const; |
|---|
| 29 | const char* getDisplayName (int argc, char** argv); |
|---|
| 30 | void loadAndMergeResources(int& argc, char** argv, Display* display); |
|---|
| 31 | |
|---|
| 32 | std::ostream &dump(std::ostream &os) const; |
|---|
| 33 | |
|---|
| 34 | private: |
|---|
| 35 | XrmDatabase _db; |
|---|
| 36 | XrmClass _class, _instance; |
|---|
| 37 | char* _display_name; |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | static Bool enumCB(XrmDatabase *, XrmBindingList bindings, |
|---|
| 41 | XrmQuarkList quarks, XrmRepresentation *type, |
|---|
| 42 | XrmValue *value, XPointer closure); |
|---|
| 43 | void initClassName(const char* className); |
|---|
| 44 | |
|---|
| 45 | static bool _initialized; |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | inline std::ostream &operator<<(std::ostream &os, const Xrm &xrm){ |
|---|
| 49 | return xrm.dump(os); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | #endif |
|---|