"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/Xrm.h" (11 Jul 2020, 1313 Bytes) of package /linux/misc/xosview-1.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Xrm.h" see the Fossies "Dox" file reference documentation.

    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