Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

contextMgr.h

Go to the documentation of this file.
00001 
00008 #ifndef CONTEXT_MGR_H
00009 #define CONTEXT_MGR_H
00010 
00011 #include <pango/pango.h>
00012 #include <pango/pangoft2.h>
00013 #include "manager.h"
00014 
00017 class ContextMgr : public Manager<PangoContext*> {
00018   public:
00019     ContextMgr(
00020         const char* const lang="en_US.UTF-8",
00021         const int dpiX = 72,
00022         const int dpiY = 72) {
00023       _t = pango_ft2_get_context(dpiX, dpiY);
00024       pango_context_set_language(_t, pango_language_from_string(lang));
00025       pango_context_set_base_dir(_t, PANGO_DIRECTION_LTR);
00026     }
00027 
00028     ~ContextMgr() {
00029       if (_t && isOwner())
00030         free(_t); // there is no corresponding pango_context_free in the API
00031     }
00032 };
00033 #endif

Generated on Thu Dec 23 03:58:33 2004 for LASi by  doxygen 1.3.9.1