xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Xrm.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 1994, 1995, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
3 //
4 // This file may be distributed under terms of the GPL
5 //
6 
7 #ifndef _Xrm_h
8 #define _Xrm_h
9 
10 #include <X11/Xlib.h>
11 #include <X11/Xresource.h>
12 #include <iostream>
13 
14 
15 class Xrm {
16 public:
17  Xrm(const char *className, const char *instanceName);
18  Xrm(const char *instanceName, int argc, char **argv);
19  ~Xrm();
20 
21  const char *className(void) const { return XrmQuarkToString(_class); }
22  const char *instanceName(void) const { return XrmQuarkToString(_instance); }
23 
24  const char *getResource(const char *rname) const;
25  const char* getDisplayName (int argc, char** argv);
26  void loadAndMergeResources(int& argc, char** argv, Display* display);
27 
28  std::ostream &dump(std::ostream &os) const;
29 
30 private:
31  XrmDatabase _db;
32  XrmClass _class, _instance;
33  const char* _display_name; // Used solely for getting the display's resources.
34 
35  //void getArgs(int argc, char **argv);
36  static Bool enumCB(XrmDatabase *, XrmBindingList bindings,
37  XrmQuarkList quarks, XrmRepresentation *type,
38  XrmValue *value, XPointer closure);
39  void initClassName(const char* className);
40 
41  static bool _initialized;
42 };
43 
44 inline std::ostream &operator<<(std::ostream &os, const Xrm &xrm){
45  return xrm.dump(os);
46 }
47 
48 #endif
std::ostream & operator<<(std::ostream &os, const Xrm &xrm)
Definition: Xrm.h:44
Definition: Xrm.h:15
const char * _display_name
Definition: Xrm.h:33
~Xrm()
Definition: Xrm.cc:96
XrmDatabase _db
Definition: Xrm.h:31
void initClassName(const char *className)
Definition: Xrm.cc:224
const char * getResource(const char *rname) const
Definition: Xrm.cc:64
const char * instanceName(void) const
Definition: Xrm.h:22
const char * className(void) const
Definition: Xrm.h:21
const char * getDisplayName(int argc, char **argv)
Definition: Xrm.cc:45
XrmClass _instance
Definition: Xrm.h:32
std::ostream & dump(std::ostream &os) const
Definition: Xrm.cc:253
XrmClass _class
Definition: Xrm.h:32
Xrm(const char *className, const char *instanceName)
Definition: Xrm.cc:32
void loadAndMergeResources(int &argc, char **argv, Display *display)
Definition: Xrm.cc:102
static Bool enumCB(XrmDatabase *, XrmBindingList bindings, XrmQuarkList quarks, XrmRepresentation *type, XrmValue *value, XPointer closure)
Definition: Xrm.cc:266
static bool _initialized
Definition: Xrm.h:41