src/font.h

Go to the documentation of this file.
00001 // Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de>
00002 // See ../LICENSE.txt for license details.
00003 //
00004 // $Id: font.h 7 2007-05-24 11:03:53Z eg1981 $
00005 
00006 #ifndef __FONT_H
00007 #define __FONT_H
00008 
00009 extern "C" {
00010 #include <X11/Xlib.h>
00011 }
00012 
00013 #include <string>
00014 
00015 #include "ncwm.h"
00016 
00017 class Monitor;
00018 
00020 class WFont {
00021 
00022 public:
00023 
00024     enum Type {NORMAL, XFT};
00025 
00026     WFont(Monitor *monitor);
00027     virtual ~WFont();
00028 
00029     Type type() const;
00030 
00031     static WFont *load(Monitor *monitor, string name);
00032 
00033     virtual void drawText(Window window, GC gc, int x, int y, string text) = 0;
00034 
00035     virtual int textWidth(string text) = 0;
00036 
00037     virtual unsigned int height() = 0;
00038 
00039     virtual void setHeight(unsigned int height) = 0;
00040 
00041     virtual int ascent() = 0;
00042 
00043     virtual int descent() = 0;
00044 
00045 protected:
00046 
00047     Monitor *monitor_;
00048     Type type_;
00049 
00050 };
00051 
00052 #endif // __FONT_H

Generated on Thu May 24 15:19:32 2007 for ncwm by  doxygen 1.5.1