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)  

XWin Class Reference

#include <xwin.h>

Inheritance diagram for XWin:
[legend]
Collaboration diagram for XWin:
[legend]

Classes

class  Event
 

Public Member Functions

 XWin ()
 
 XWin (int argc, char *argv[], int x, int y, int width, int height)
 
virtual ~XWin (void)
 
void XWinInit (int argc, char *argv[], char *geometry, Xrm *xrmp)
 
int width (void)
 
void width (int val)
 
int height (void)
 
void height (int val)
 
Display * display (void)
 
Window window (void)
 
int done (void)
 
void done (int val)
 
void title (const char *str)
 
void iconname (const char *str)
 
void clear (void)
 
void clear (int x, int y, int width, int height)
 
unsigned long allocColor (const char *name)
 
void setForeground (unsigned long pixelvalue)
 
void setBackground (unsigned long pixelvalue)
 
void setStipple (Pixmap stipple)
 
void setStippleN (int n)
 
Pixmap createPixmap (const char *data, unsigned int w, unsigned int h)
 
unsigned long foreground (void)
 
unsigned long background (void)
 
void resize (int width, int height)
 
void lineWidth (int width)
 
void drawLine (int x1, int y1, int x2, int y2)
 
void drawRectangle (int x, int y, int width, int height)
 
void drawFilledRectangle (int x, int y, int width, int height)
 
void drawString (int x, int y, const char *str)
 
void copyArea (int src_x, int src_y, int width, int height, int dest_x, int dest_y)
 
int textWidth (const char *str, int n)
 
int textWidth (const char *str)
 
int textAscent (void)
 
int textDescent (void)
 
int textHeight (void)
 
virtual void checkevent (void)
 
void map (void)
 
void unmap (void)
 
void flush (void)
 
const char * getResource (const char *name)
 
const char * getResourceOrUseDefault (const char *name, const char *defaultVal)
 
int isResourceTrue (const char *name)
 
void dumpResources (std::ostream &os)
 

Protected Member Functions

void init (int argc, char *argv[])
 
void getGeometry (void)
 
int getPixmap (Pixmap *)
 
void setDisplayName (const char *new_display_name)
 
const char * displayName ()
 
void addEvent (Event *event)
 
void setColors (void)
 
void openDisplay (void)
 
void setHints (int argc, char *argv[])
 
void setFont (void)
 
void selectEvents (long mask)
 
void ignoreEvents (long mask)
 
void configureEvent (XEvent &event)
 
void mappingNotify (XEvent &event)
 
void deleteEvent (XEvent &event)
 
Colormap colormap (void)
 
int screen (void)
 

Protected Attributes

int borderwidth_
 
int x_
 
int y_
 
int width_
 
int height_
 
Display * display_
 
Window window_
 
GC gc_
 
XFontStruct * font_
 
char * name_
 
XTextProperty title_
 
XTextProperty iconname_
 
unsigned long fgcolor_
 
unsigned long bgcolor_
 
XWindowAttributes attr_
 
XWMHints * wmhints_
 
XSizeHints * sizehints_
 
XClassHint * classhints_
 
Eventevents_
 
int done_
 
Atom wm_
 
Atom wmdelete_
 
Colormap colormap_
 
char display_name_ [256]
 
char * geometry_
 
Xrmxrmptr_
 
int doStippling_
 
Pixmap stipples_ [4]
 

Detailed Description

Definition at line 15 of file xwin.h.

Constructor & Destructor Documentation

◆ XWin() [1/2]

XWin::XWin ( )

Definition at line 14 of file xwin.cc.

◆ XWin() [2/2]

XWin::XWin ( int  argc,
char *  argv[],
int  x,
int  y,
int  width,
int  height 
)

Definition at line 18 of file xwin.cc.

References height(), height_, width(), width_, x_, and y_.

◆ ~XWin()

XWin::~XWin ( void  )
virtual

Definition at line 57 of file xwin.cc.

References classhints_, display_, events_, font_, gc_, iconname_, XWin::Event::next_, sizehints_, title_, window_, and wmhints_.

Member Function Documentation

◆ addEvent()

void XWin::addEvent ( Event event)
protected

Definition at line 338 of file xwin.cc.

References events_, and XWin::Event::next_.

Referenced by XOSView::XOSView(), and XWinInit().

◆ allocColor()

◆ background()

unsigned long XWin::background ( void  )
inline

Definition at line 54 of file xwin.h.

References bgcolor_.

◆ checkevent()

void XWin::checkevent ( void  )
virtual

Definition at line 322 of file xwin.cc.

References XWin::Event::callBack(), display_, events_, and XWin::Event::next_.

Referenced by XOSView::run().

◆ clear() [1/2]

void XWin::clear ( int  x,
int  y,
int  width,
int  height 
)
inline

Definition at line 35 of file xwin.h.

References display_, height(), width(), and window_.

◆ clear() [2/2]

void XWin::clear ( void  )
inline

Definition at line 34 of file xwin.h.

References display_, and window_.

Referenced by XOSView::draw(), FieldMeter::drawlegend(), BitFieldMeter::drawused(), and FieldMeter::drawused().

◆ colormap()

Colormap XWin::colormap ( void  )
inlineprotected

Definition at line 158 of file xwin.h.

References colormap_.

Referenced by allocColor().

◆ configureEvent()

void XWin::configureEvent ( XEvent &  event)
protected

◆ copyArea()

void XWin::copyArea ( int  src_x,
int  src_y,
int  width,
int  height,
int  dest_x,
int  dest_y 
)
inline

Definition at line 71 of file xwin.h.

References display_, gc_, height(), width(), and window_.

Referenced by FieldMeterGraph::drawfields().

◆ createPixmap()

Pixmap XWin::createPixmap ( const char *  data,
unsigned int  w,
unsigned int  h 
)
inline

Definition at line 49 of file xwin.h.

References display_, and window_.

Referenced by init().

◆ deleteEvent()

void XWin::deleteEvent ( XEvent &  event)
protected

Definition at line 393 of file xwin.cc.

References done(), wm_, and wmdelete_.

Referenced by XWinInit().

◆ display()

Display* XWin::display ( void  )
inline

Definition at line 27 of file xwin.h.

References display_.

Referenced by setHints().

◆ displayName()

const char* XWin::displayName ( )
inlineprotected

Definition at line 144 of file xwin.h.

References display_name_.

◆ done() [1/2]

void XWin::done ( int  val)
inline

Definition at line 30 of file xwin.h.

References done_.

◆ done() [2/2]

◆ drawFilledRectangle()

void XWin::drawFilledRectangle ( int  x,
int  y,
int  width,
int  height 
)
inline

◆ drawLine()

void XWin::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Definition at line 63 of file xwin.h.

References display_, gc_, and window_.

◆ drawRectangle()

void XWin::drawRectangle ( int  x,
int  y,
int  width,
int  height 
)
inline

Definition at line 65 of file xwin.h.

References display_, gc_, height(), width(), and window_.

Referenced by BitFieldMeter::draw(), and FieldMeter::draw().

◆ drawString()

void XWin::drawString ( int  x,
int  y,
const char *  str 
)
inline

◆ dumpResources()

void XWin::dumpResources ( std::ostream &  os)

Definition at line 377 of file xwin.cc.

◆ flush()

void XWin::flush ( void  )
inline

Definition at line 85 of file xwin.h.

References display_.

Referenced by init(), and XOSView::run().

◆ foreground()

unsigned long XWin::foreground ( void  )
inline

◆ getGeometry()

void XWin::getGeometry ( void  )
protected

Definition at line 256 of file xwin.cc.

References display_, geometry_, getResourceOrUseDefault(), height_, sizehints_, width_, x_, and y_.

Referenced by init().

◆ getPixmap()

int XWin::getPixmap ( Pixmap *  pixmap)
protected

Definition at line 227 of file xwin.cc.

References display_, and getResourceOrUseDefault().

Referenced by init().

◆ getResource()

◆ getResourceOrUseDefault()

const char * XWin::getResourceOrUseDefault ( const char *  name,
const char *  defaultVal 
)

◆ height() [1/2]

void XWin::height ( int  val)
inline

Definition at line 26 of file xwin.h.

References height_.

◆ height() [2/2]

int XWin::height ( void  )
inline

Definition at line 25 of file xwin.h.

References height_.

Referenced by clear(), copyArea(), drawFilledRectangle(), drawRectangle(), resize(), XOSView::resizeEvent(), and XWin().

◆ iconname()

void XWin::iconname ( const char *  str)
inline

Definition at line 32 of file xwin.h.

References display_, and window_.

Referenced by XOSView::XOSView().

◆ ignoreEvents()

void XWin::ignoreEvents ( long  mask)
protected

Definition at line 311 of file xwin.cc.

References display_, and window_.

◆ init()

◆ isResourceTrue()

◆ lineWidth()

void XWin::lineWidth ( int  width)
inline

Definition at line 57 of file xwin.h.

References display_, gc_, and width().

Referenced by BitFieldMeter::draw(), and BitMeter::draw().

◆ map()

void XWin::map ( void  )
inline

Definition at line 83 of file xwin.h.

References display_, and window_.

Referenced by init().

◆ mappingNotify()

void XWin::mappingNotify ( XEvent &  event)
inlineprotected

Definition at line 154 of file xwin.h.

Referenced by XWinInit().

◆ openDisplay()

void XWin::openDisplay ( void  )
protected

Definition at line 195 of file xwin.cc.

References colormap_, display_, display_name_, and screen().

Referenced by XOSView::XOSView().

◆ resize()

void XWin::resize ( int  width,
int  height 
)
inline

Definition at line 55 of file xwin.h.

References display_, height(), width(), and window_.

◆ screen()

int XWin::screen ( void  )
inlineprotected

Definition at line 159 of file xwin.h.

References display_.

Referenced by openDisplay().

◆ selectEvents()

void XWin::selectEvents ( long  mask)
protected

Definition at line 301 of file xwin.cc.

References display_, and window_.

Referenced by init().

◆ setBackground()

void XWin::setBackground ( unsigned long  pixelvalue)
inline

Definition at line 40 of file xwin.h.

References display_, and gc_.

◆ setColors()

void XWin::setColors ( void  )
protected

Definition at line 206 of file xwin.cc.

References bgcolor_, colormap_, display_, fgcolor_, and getResource().

Referenced by init().

◆ setDisplayName()

void XWin::setDisplayName ( const char *  new_display_name)
inlineprotected

Definition at line 142 of file xwin.h.

References display_name_.

Referenced by XOSView::XOSView().

◆ setFont()

void XWin::setFont ( void  )
protected

Definition at line 141 of file xwin.cc.

References display_, font_, getResource(), and name_.

Referenced by XOSView::checkOverallResources(), and init().

◆ setForeground()

◆ setHints()

void XWin::setHints ( int  argc,
char *  argv[] 
)
protected

◆ setStipple()

void XWin::setStipple ( Pixmap  stipple)
inline

Definition at line 42 of file xwin.h.

References display_, doStippling_, and gc_.

Referenced by setStippleN().

◆ setStippleN()

◆ textAscent()

int XWin::textAscent ( void  )
inline

Definition at line 77 of file xwin.h.

References font_.

Referenced by textHeight().

◆ textDescent()

int XWin::textDescent ( void  )
inline

Definition at line 78 of file xwin.h.

References font_.

Referenced by textHeight().

◆ textHeight()

int XWin::textHeight ( void  )
inline

◆ textWidth() [1/2]

int XWin::textWidth ( const char *  str)
inline

Definition at line 75 of file xwin.h.

References textWidth().

◆ textWidth() [2/2]

◆ title()

void XWin::title ( const char *  str)
inline

Definition at line 31 of file xwin.h.

References display_, and window_.

Referenced by XOSView::XOSView().

◆ unmap()

void XWin::unmap ( void  )
inline

Definition at line 84 of file xwin.h.

References display_, and window_.

◆ width() [1/2]

void XWin::width ( int  val)
inline

Definition at line 24 of file xwin.h.

References width_.

◆ width() [2/2]

int XWin::width ( void  )
inline

◆ window()

Window XWin::window ( void  )
inline

Definition at line 28 of file xwin.h.

References window_.

Referenced by setHints().

◆ XWinInit()

void XWin::XWinInit ( int  argc,
char *  argv[],
char *  geometry,
Xrm xrmp 
)

Definition at line 35 of file xwin.cc.

References addEvent(), deleteEvent(), done_, events_, font_, geometry_, height_, mappingNotify(), name_, width_, x_, xrmptr_, and y_.

Referenced by XOSView::XOSView().

Member Data Documentation

◆ attr_

XWindowAttributes XWin::attr_
protected

Definition at line 125 of file xwin.h.

Referenced by init().

◆ bgcolor_

unsigned long XWin::bgcolor_
protected

Definition at line 124 of file xwin.h.

Referenced by background(), init(), and setColors().

◆ borderwidth_

int XWin::borderwidth_
protected

Definition at line 113 of file xwin.h.

Referenced by init().

◆ classhints_

XClassHint* XWin::classhints_
protected

Definition at line 128 of file xwin.h.

Referenced by setHints(), and ~XWin().

◆ colormap_

Colormap XWin::colormap_
protected

Definition at line 132 of file xwin.h.

Referenced by colormap(), init(), openDisplay(), and setColors().

◆ display_

◆ display_name_

char XWin::display_name_[256]
protected

Definition at line 133 of file xwin.h.

Referenced by displayName(), openDisplay(), and setDisplayName().

◆ done_

int XWin::done_
protected

Definition at line 130 of file xwin.h.

Referenced by done(), XOSView::keyPressEvent(), XOSView::run(), and XWinInit().

◆ doStippling_

int XWin::doStippling_
protected

Definition at line 136 of file xwin.h.

Referenced by init(), and setStipple().

◆ events_

Event* XWin::events_
protected

Definition at line 129 of file xwin.h.

Referenced by addEvent(), checkevent(), init(), XWinInit(), and ~XWin().

◆ fgcolor_

unsigned long XWin::fgcolor_
protected

Definition at line 123 of file xwin.h.

Referenced by foreground(), init(), and setColors().

◆ font_

XFontStruct* XWin::font_
protected

Definition at line 119 of file xwin.h.

Referenced by init(), setFont(), textAscent(), textDescent(), textWidth(), XWinInit(), and ~XWin().

◆ gc_

◆ geometry_

char* XWin::geometry_
protected

Definition at line 134 of file xwin.h.

Referenced by getGeometry(), and XWinInit().

◆ height_

int XWin::height_
protected

◆ iconname_

XTextProperty XWin::iconname_
protected

Definition at line 122 of file xwin.h.

Referenced by setHints(), and ~XWin().

◆ name_

char* XWin::name_
protected

Definition at line 120 of file xwin.h.

Referenced by setFont(), setHints(), XOSView::XOSView(), and XWinInit().

◆ sizehints_

XSizeHints* XWin::sizehints_
protected

Definition at line 127 of file xwin.h.

Referenced by getGeometry(), init(), setHints(), and ~XWin().

◆ stipples_

Pixmap XWin::stipples_[4]
protected

Definition at line 137 of file xwin.h.

Referenced by init(), and setStippleN().

◆ title_

XTextProperty XWin::title_
protected

Definition at line 121 of file xwin.h.

Referenced by setHints(), and ~XWin().

◆ width_

int XWin::width_
protected

◆ window_

◆ wm_

Atom XWin::wm_
protected

Definition at line 131 of file xwin.h.

Referenced by deleteEvent(), and setHints().

◆ wmdelete_

Atom XWin::wmdelete_
protected

Definition at line 131 of file xwin.h.

Referenced by deleteEvent(), and setHints().

◆ wmhints_

XWMHints* XWin::wmhints_
protected

Definition at line 126 of file xwin.h.

Referenced by setHints(), and ~XWin().

◆ x_

int XWin::x_
protected

Definition at line 114 of file xwin.h.

Referenced by getGeometry(), XWin(), and XWinInit().

◆ xrmptr_

Xrm* XWin::xrmptr_
protected

Definition at line 135 of file xwin.h.

Referenced by getResource(), getResourceOrUseDefault(), setHints(), and XWinInit().

◆ y_

int XWin::y_
protected

Definition at line 114 of file xwin.h.

Referenced by getGeometry(), XWin(), and XWinInit().


The documentation for this class was generated from the following files: