]> Dogcows Code - chaz/openbox/commitdiff
more api cleanups
authorDana Jansens <danakj@orodu.net>
Fri, 20 Dec 2002 15:33:58 +0000 (15:33 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 20 Dec 2002 15:33:58 +0000 (15:33 +0000)
12 files changed:
otk/color.cc
otk/focuslabel.cc
otk/gccache.cc
otk/image.cc
otk/image.hh
otk/imagecontrol.cc
otk/label.cc
otk/screeninfo.cc
otk/screeninfo.hh
otk/style.cc
otk/style.hh
otk/widget.cc

index b50c29d96b7499acc4d4cd022fd5b3158cd0d608..f150082c00333f131fcbc786b7954411ab0015a7 100644 (file)
@@ -75,7 +75,7 @@ void BColor::parseColorName(void) {
 
   if (scrn == ~(0u))
     scrn = DefaultScreen(OBDisplay::display);
-  Colormap colormap = OBDisplay::screenInfo(scrn)->getColormap();
+  Colormap colormap = OBDisplay::screenInfo(scrn)->colormap();
 
   // get rgb values from colorname
   XColor xcol;
@@ -98,7 +98,7 @@ void BColor::parseColorName(void) {
 
 void BColor::allocate(void) {
   if (scrn == ~(0u)) scrn = DefaultScreen(OBDisplay::display);
-  Colormap colormap = OBDisplay::screenInfo(scrn)->getColormap();
+  Colormap colormap = OBDisplay::screenInfo(scrn)->colormap();
 
   if (! isValid()) {
     if (colorname.empty()) {
@@ -205,7 +205,7 @@ void BColor::doCacheCleanup(void) {
 
     if (count > 0)
       XFreeColors(OBDisplay::display,
-                  OBDisplay::screenInfo(i)->getColormap(),
+                  OBDisplay::screenInfo(i)->colormap(),
                   pixels, count, 0);
   }
 
index 5b9fcb30f7d5e4694096c8adb3a5cf7093d8ffe5..136eb742c08c9498edf5c46d75e8907f1025b719 100644 (file)
@@ -14,8 +14,8 @@ OtkFocusLabel::OtkFocusLabel(OtkWidget *parent)
   : OtkFocusWidget(parent), _text("")
 {
   const ScreenInfo *info = OBDisplay::screenInfo(screen());
-  _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(),
-                           info->getColormap());
+  _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->visual(),
+                           info->colormap());
 }
 
 OtkFocusLabel::~OtkFocusLabel()
index f971129e9e062476b5a0f50d8def2b1b07b25226..e7f58756d5bc51ebc1bf992d14f94641b1d9fd3c 100644 (file)
@@ -86,7 +86,7 @@ BGCCache::~BGCCache(void) {
 
 
 BGCCacheContext *BGCCache::nextContext(unsigned int scr) {
-  Window hd = OBDisplay::screenInfo(scr)->getRootWindow();
+  Window hd = OBDisplay::screenInfo(scr)->rootWindow();
 
   BGCCacheContext *c;
 
index 8b4e8ede8481e7323a0f5d13dac5f3f3140c4aad..bd8d0ea78af217714835ed3eb07731c5fc5678db 100644 (file)
@@ -562,7 +562,7 @@ Pixmap BImage::renderPixmap(void) {
 
   XPutImage(OBDisplay::display, pixmap,
            DefaultGC(OBDisplay::display,
-                     control->getScreenInfo()->getScreenNumber()),
+                     control->getScreenInfo()->screen()),
             image, 0, 0, 0, 0, width, height);
 
   if (image->data) {
index ed99e12492b896f776a1f273a4903c6c25dca0c3..5407e5227818541f718a0b6624ee957f12a3f1f9 100644 (file)
@@ -88,7 +88,7 @@ public:
 
   inline Window getDrawable(void) const { return window; }
 
-  inline Visual *getVisual(void) { return screeninfo->getVisual(); }
+  inline Visual *getVisual(void) { return screeninfo->visual(); }
 
   inline int getBitsPerPixel(void) const { return bits_per_pixel; }
   inline int getDepth(void) const { return screen_depth; }
index 07b1132c45123ecdc74766c3f961527bd5a4b4b6..09823b8e2499e8f30ed8ee0d3dead765727de8b3 100644 (file)
@@ -69,10 +69,10 @@ BImageControl::BImageControl(OBTimerQueueManager *timermanager,
 
   sqrt_table = (unsigned long *) 0;
 
-  screen_depth = screeninfo->getDepth();
-  window = screeninfo->getRootWindow();
-  screen_number = screeninfo->getScreenNumber();
-  colormap = screeninfo->getColormap();
+  screen_depth = screeninfo->depth();
+  window = screeninfo->rootWindow();
+  screen_number = screeninfo->screen();
+  colormap = screeninfo->colormap();
 
   int count;
   XPixmapFormatValues *pmv = XListPixmapFormats(OBDisplay::display,
index bbc8a6b7ae3e04f16f2d6a8105f1eae257f1230f..cc67a31611a813c4343f22246daf9b09255cca5f 100644 (file)
@@ -12,8 +12,8 @@ OtkLabel::OtkLabel(OtkWidget *parent)
   : OtkWidget(parent), _text("")
 {
   const ScreenInfo *info = OBDisplay::screenInfo(screen());
-  _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(),
-                           info->getColormap());
+  _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->visual(),
+                           info->colormap());
 }
 
 OtkLabel::~OtkLabel()
index 14faf0c0753c726635f10973f45040780df6cd1b..a5fafc5a47903b6c5cfd14da5808c8b13533bf01 100644 (file)
@@ -18,32 +18,32 @@ using std::string;
 namespace otk {
 
 ScreenInfo::ScreenInfo(unsigned int num) {
-  screen_number = num;
+  _screen = num;
 
-  root_window = RootWindow(OBDisplay::display, screen_number);
+  _root_window = RootWindow(OBDisplay::display, _screen);
 
-  rect.setSize(WidthOfScreen(ScreenOfDisplay(OBDisplay::display,
-                                             screen_number)),
+  _rect.setSize(WidthOfScreen(ScreenOfDisplay(OBDisplay::display,
+                                              _screen)),
                HeightOfScreen(ScreenOfDisplay(OBDisplay::display,
-                                              screen_number)));
+                                              _screen)));
   /*
     If the default depth is at least 8 we will use that,
     otherwise we try to find the largest TrueColor visual.
     Preference is given to 24 bit over larger depths if 24 bit is an option.
   */
 
-  depth = DefaultDepth(OBDisplay::display, screen_number);
-  visual = DefaultVisual(OBDisplay::display, screen_number);
-  colormap = DefaultColormap(OBDisplay::display, screen_number);
+  _depth = DefaultDepth(OBDisplay::display, _screen);
+  _visual = DefaultVisual(OBDisplay::display, _screen);
+  _colormap = DefaultColormap(OBDisplay::display, _screen);
   
-  if (depth < 8) {
+  if (_depth < 8) {
     // search for a TrueColor Visual... if we can't find one...
     // we will use the default visual for the screen
     XVisualInfo vinfo_template, *vinfo_return;
     int vinfo_nitems;
     int best = -1;
 
-    vinfo_template.screen = screen_number;
+    vinfo_template.screen = _screen;
     vinfo_template.c_class = TrueColor;
 
     vinfo_return = XGetVisualInfo(OBDisplay::display,
@@ -59,14 +59,14 @@ ScreenInfo::ScreenInfo(unsigned int num) {
           best = i;
         }
       }
-      if (max_depth < depth) best = -1;
+      if (max_depth < _depth) best = -1;
     }
 
     if (best != -1) {
-      depth = vinfo_return[best].depth;
-      visual = vinfo_return[best].visual;
-      colormap = XCreateColormap(OBDisplay::display, root_window, visual,
-                                 AllocNone);
+      _depth = vinfo_return[best].depth;
+      _visual = vinfo_return[best].visual;
+      _colormap = XCreateColormap(OBDisplay::display, _root_window, _visual,
+                                  AllocNone);
     }
 
     XFree(vinfo_return);
@@ -78,11 +78,11 @@ ScreenInfo::ScreenInfo(unsigned int num) {
   if (pos != string::npos)
     default_string.resize(pos);
 
-  display_string = string("DISPLAY=") + default_string + '.' +
-    otk::itostring(static_cast<unsigned long>(screen_number));
+  _display_string = string("DISPLAY=") + default_string + '.' +
+    otk::itostring(static_cast<unsigned long>(_screen));
   
 #ifdef    XINERAMA
-  xinerama_active = False;
+  _xinerama_active = False;
 
   if (d->hasXineramaExtensions()) {
     if (d->getXineramaMajorVersion() == 1) {
@@ -104,16 +104,16 @@ ScreenInfo::ScreenInfo(unsigned int num) {
         XineramaScreenInfo *info = XineramaQueryScreens(OBDisplay::display,
                                                         &num);
         if (num > 0 && info) {
-          xinerama_areas.reserve(num);
+          _xinerama_areas.reserve(num);
           for (int i = 0; i < num; ++i) {
-            xinerama_areas.push_back(Rect(info[i].x_org, info[i].y_org,
-                                          info[i].width, info[i].height));
+            _xinerama_areas.push_back(Rect(info[i].x_org, info[i].y_org,
+                                           info[i].width, info[i].height));
           }
           XFree(info);
 
           // if we can't find any xinerama regions, then we act as if it is not
           // active, even though it said it was
-          xinerama_active = True;
+          _xinerama_active = True;
         }
       }
     }
index 3bb5605f3b64c2e6745a44af05315ee66aeebbc6..314527ab92aa03a45047fcefc0fbfd8a09094ded 100644 (file)
@@ -14,36 +14,34 @@ namespace otk {
 
 class ScreenInfo {
 private:
-  Visual *visual;
-  Window root_window;
-  Colormap colormap;
-
-  int depth;
-  unsigned int screen_number;
-  std::string display_string;
-  Rect rect;
+  Visual *_visual;
+  Window _root_window;
+  Colormap _colormap;
+
+  int _depth;
+  unsigned int _screen;
+  std::string _display_string;
+  Rect _rect;
 #ifdef XINERAMA
-  RectList xinerama_areas;
-  bool xinerama_active;
+  RectList _xinerama_areas;
+  bool _xinerama_active;
 #endif
 
 public:
   ScreenInfo(unsigned int num);
 
-  inline Visual *getVisual(void) const { return visual; }
-  inline Window getRootWindow(void) const { return root_window; }
-  inline Colormap getColormap(void) const { return colormap; }
-  inline int getDepth(void) const { return depth; }
-  inline unsigned int getScreenNumber(void) const
-    { return screen_number; }
-  inline const Rect& getRect(void) const { return rect; }
-  inline unsigned int getWidth(void) const { return rect.width(); }
-  inline unsigned int getHeight(void) const { return rect.height(); }
-  inline const std::string& displayString(void) const
-  { return display_string; }
+  inline Visual *visual() const { return _visual; }
+  inline Window rootWindow() const { return _root_window; }
+  inline Colormap colormap() const { return _colormap; }
+  inline int depth() const { return _depth; }
+  inline unsigned int screen() const { return _screen; }
+  inline const Rect& rect() const { return _rect; }
+  inline unsigned int width() const { return _rect.width(); }
+  inline unsigned int height() const { return _rect.height(); }
+  inline const std::string& displayString() const { return _display_string; }
 #ifdef XINERAMA
-  inline const RectList &getXineramaAreas(void) const { return xinerama_areas; }
-  inline bool isXineramaActive(void) const { return xinerama_active; }
+  inline const RectList &xineramaAreas() const { return _xinerama_areas; }
+  inline bool isXineramaActive() const { return _xinerama_active; }
 #endif
 };
 
index a2f362ecee43d8edc15a23b240b760d648a1b181..5aeef434a249532cc35ef213d08a44d034189249 100644 (file)
@@ -19,7 +19,7 @@ Style::Style() : font(NULL)
 
 Style::Style(BImageControl *ctrl)
   : image_control(ctrl), font(0),
-    screen_number(ctrl->getScreenInfo()->getScreenNumber())
+    screen_number(ctrl->getScreenInfo()->screen())
 {
 }
 
@@ -136,7 +136,7 @@ void Style::load(const Configuration &style) {
   // load bevel, border and handle widths
 
   const ScreenInfo *s_info = OBDisplay::screenInfo(screen_number);
-  unsigned int width = s_info->getRect().width();
+  unsigned int width = s_info->rect().width();
 
   if (! style.getValue("handleWidth", handle_width) ||
       handle_width > width/2 || handle_width == 0)
@@ -160,7 +160,7 @@ void Style::load(const Configuration &style) {
 
 void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
                              const Configuration &style) {
-  Window root_window = OBDisplay::screenInfo(screen_number)->getRootWindow();
+  Window root_window = OBDisplay::screenInfo(screen_number)->rootWindow();
   std::string s;
   int hx, hy; //ignored
   int ret = BitmapOpenFailed; //default to failure.
index c024ade9bb12b27f71ff57c98b0f6ba9e619a8c7..c0e0bbd9daeefc5eacd197b58d40ea029e6779db 100644 (file)
@@ -137,7 +137,7 @@ public:
 
   inline void setImageControl(BImageControl *c) {
     image_control = c;
-    screen_number = c->getScreenInfo()->getScreenNumber();
+    screen_number = c->getScreenInfo()->screen();
   }
   inline unsigned int getScreen(void) { return screen_number; }
 
index f303c3e44428aee28dd167c2b4aa982dcd25a29e..07122bc645a2b9237dbd0f0b9d8d8e5dd06ccbcd 100644 (file)
@@ -70,7 +70,7 @@ OtkWidget::~OtkWidget()
 void OtkWidget::create(void)
 {
   const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen);
-  Window p_window = _parent ? _parent->window() : scr_info->getRootWindow();
+  Window p_window = _parent ? _parent->window() : scr_info->rootWindow();
 
   _rect.setRect(0, 0, 1, 1); // just some initial values
 
@@ -78,7 +78,7 @@ void OtkWidget::create(void)
   unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask;
 
   attrib_create.background_pixmap = None;
-  attrib_create.colormap = scr_info->getColormap();
+  attrib_create.colormap = scr_info->colormap();
   attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
     ButtonMotionMask | ExposureMask | StructureNotifyMask;
 
@@ -89,8 +89,8 @@ void OtkWidget::create(void)
 
   _window = XCreateWindow(otk::OBDisplay::display, p_window, _rect.x(),
                           _rect.y(), _rect.width(), _rect.height(), 0,
-                          scr_info->getDepth(), InputOutput,
-                          scr_info->getVisual(), create_mask, &attrib_create);
+                          scr_info->depth(), InputOutput,
+                          scr_info->visual(), create_mask, &attrib_create);
   _ignore_config++;
 }
 
This page took 0.047173 seconds and 4 git commands to generate.