added border size

This commit is contained in:
fluxgen 2003-01-05 22:58:11 +00:00
parent b36851a476
commit 459f2563d2
2 changed files with 13 additions and 7 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: FbWindow.cc,v 1.3 2002/12/16 11:17:26 fluxgen Exp $
// $Id: FbWindow.cc,v 1.4 2003/01/05 22:58:11 fluxgen Exp $
#include "FbWindow.hh"
@ -32,7 +32,8 @@ namespace FbTk {
Display *FbWindow::s_display = 0;
FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0) {
FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0),
m_width(0), m_height(0), m_border_width(0) {
if (s_display == 0)
s_display = App::instance()->display();
@ -83,6 +84,7 @@ void FbWindow::setBorderColor(const FbTk::Color &border_color) {
}
void FbWindow::setBorderWidth(size_t size) {
XSetWindowBorderWidth(s_display, m_window, size);
m_border_width = size;
}
void FbWindow::setName(const char *name) {
@ -171,6 +173,8 @@ void FbWindow::create(Window parent, int x, int y,
assert(s_display);
m_border_width = 0;
long valmask = CWEventMask;
XSetWindowAttributes values;
values.event_mask = eventmask;

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: FbWindow.hh,v 1.5 2002/12/25 11:29:34 fluxgen Exp $
// $Id: FbWindow.hh,v 1.6 2003/01/05 22:55:14 fluxgen Exp $
#ifndef FBTK_FBWINDOW_HH
#define FBTK_FBWINDOW_HH
@ -76,6 +76,7 @@ public:
int y() const { return m_y; }
size_t width() const { return m_width; }
size_t height() const { return m_height; }
size_t borderWidth() const { return m_border_width; }
int screenNumber() const;
/// compare X window
bool operator == (Window win) const { return m_window == win; }
@ -93,9 +94,10 @@ private:
static Display *s_display;
const FbWindow *m_parent;
int m_screen_num;
Window m_window; ///< X window
int m_x, m_y; ///< position
size_t m_width, m_height;
Window m_window; ///< the X window
int m_x, m_y; ///< position of window
size_t m_width, m_height; ///< size of window
size_t m_border_width; // border size
};
bool operator == (Window win, const FbWindow &fbwin);