changed external window interface to only have an area(), no size() and origin(), since all of their values are also in area()
changed toolbar external inteface to have an area, no more getX/Y/Width/Height
This commit is contained in:
parent
b8dd077ab0
commit
75c0a76a53
6 changed files with 39 additions and 35 deletions
12
src/Slit.cc
12
src/Slit.cc
|
@ -559,13 +559,13 @@ void Slit::reposition(void) {
|
||||||
Toolbar *tbar = screen.getToolbar();
|
Toolbar *tbar = screen.getToolbar();
|
||||||
int sw = frame.area.w() + (screen.getBorderWidth() * 2),
|
int sw = frame.area.w() + (screen.getBorderWidth() * 2),
|
||||||
sh = frame.area.h() + (screen.getBorderWidth() * 2),
|
sh = frame.area.h() + (screen.getBorderWidth() * 2),
|
||||||
tw = tbar->getWidth() + screen.getBorderWidth(),
|
tw = tbar->area().w() + screen.getBorderWidth(),
|
||||||
th = tbar->getHeight() + screen.getBorderWidth();
|
th = tbar->area().h() + screen.getBorderWidth();
|
||||||
|
|
||||||
if (tbar->getX() < frame.area.x() + sw &&
|
if (tbar->area().x() < frame.area.x() + sw &&
|
||||||
tbar->getX() + tw > frame.area.x() &&
|
tbar->area().x() + tw > frame.area.x() &&
|
||||||
tbar->getY() < frame.area.y() + sh &&
|
tbar->area().y() < frame.area.y() + sh &&
|
||||||
tbar->getY() + th > frame.area.y()) {
|
tbar->area().y() + th > frame.area.y()) {
|
||||||
if (frame.area.y() < th) {
|
if (frame.area.y() < th) {
|
||||||
frame.area.setY(frame.area.y() + tbar->getExposedHeight());
|
frame.area.setY(frame.area.y() + tbar->getExposedHeight());
|
||||||
if (m_direction == Vertical)
|
if (m_direction == Vertical)
|
||||||
|
|
|
@ -154,14 +154,13 @@ Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn),
|
||||||
mapToolbar();
|
mapToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Toolbar::getX() const {
|
Rect Toolbar::area() const {
|
||||||
return ((m_hidden) ? frame.x_hidden : frame.x);
|
int x = ((m_hidden) ? frame.x_hidden : frame.x);
|
||||||
}
|
int y;
|
||||||
|
if (screen.hideToolbar()) y = screen.size().h();
|
||||||
int Toolbar::getY() const {
|
else if (m_hidden) y = frame.y_hidden;
|
||||||
if (screen.hideToolbar()) return screen.size().h();
|
else y = frame.y;
|
||||||
else if (m_hidden) return frame.y_hidden;
|
return Rect(x, y, frame.width, frame.height);
|
||||||
else return frame.y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Toolbar::getExposedHeight() const {
|
unsigned int Toolbar::getExposedHeight() const {
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Resource.h"
|
#include "Resource.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
|
#include "Geometry.h"
|
||||||
|
|
||||||
// forward declaration
|
// forward declaration
|
||||||
class Toolbar;
|
class Toolbar;
|
||||||
|
@ -114,12 +115,16 @@ public:
|
||||||
|
|
||||||
inline const Window &getWindowID() const { return frame.window; }
|
inline const Window &getWindowID() const { return frame.window; }
|
||||||
|
|
||||||
inline unsigned int getWidth() const { return frame.width; }
|
//inline unsigned int getWidth() const { return frame.width; }
|
||||||
inline unsigned int getHeight() const { return frame.height; }
|
//inline unsigned int getHeight() const { return frame.height; }
|
||||||
unsigned int getExposedHeight() const;
|
unsigned int getExposedHeight() const;
|
||||||
|
|
||||||
int getX() const;
|
//int getX() const;
|
||||||
int getY() const;
|
//int getY() const;
|
||||||
|
|
||||||
|
Rect area() const;
|
||||||
|
//Size size() const { return area().size(); }
|
||||||
|
//Point origin() const { return area().origin(); }
|
||||||
|
|
||||||
void buttonPressEvent(XButtonEvent *);
|
void buttonPressEvent(XButtonEvent *);
|
||||||
void buttonReleaseEvent(XButtonEvent *);
|
void buttonReleaseEvent(XButtonEvent *);
|
||||||
|
|
|
@ -2868,7 +2868,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) {
|
||||||
int snap_distance = screen->edgeSnapThreshold();
|
int snap_distance = screen->edgeSnapThreshold();
|
||||||
// width/height of the snapping window
|
// width/height of the snapping window
|
||||||
unsigned int snap_w = frame.width + (frame.border_w * 2);
|
unsigned int snap_w = frame.width + (frame.border_w * 2);
|
||||||
unsigned int snap_h = size().h() + (frame.border_w * 2);
|
unsigned int snap_h = area().h() + (frame.border_w * 2);
|
||||||
if (snap_distance) {
|
if (snap_distance) {
|
||||||
int drx = screen->size().w() - (dx + snap_w);
|
int drx = screen->size().w() - (dx + snap_w);
|
||||||
|
|
||||||
|
@ -2891,7 +2891,7 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dtty = 0;
|
dtty = 0;
|
||||||
dbby = screen->getToolbar()->getY();
|
dbby = screen->getToolbar()->area().y();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
src/Window.h
24
src/Window.h
|
@ -292,18 +292,18 @@ public:
|
||||||
inline const unsigned int &getTitleHeight(void) const
|
inline const unsigned int &getTitleHeight(void) const
|
||||||
{ return frame.title_h; }
|
{ return frame.title_h; }
|
||||||
|
|
||||||
inline const Point origin() const {
|
//inline const Point origin() const {
|
||||||
return Point(frame.x, frame.y);
|
// return Point(frame.x, frame.y);
|
||||||
}
|
//}
|
||||||
inline const Point clientOrigin() const {
|
//inline const Point clientOrigin() const {
|
||||||
return Point(client.x, client.y);
|
// return Point(client.x, client.y);
|
||||||
}
|
//}
|
||||||
inline const Size size() const {
|
//inline const Size size() const {
|
||||||
return Size(frame.width, flags.shaded ? frame.title_h : frame.height);
|
// return Size(frame.width, flags.shaded ? frame.title_h : frame.height);
|
||||||
}
|
//}
|
||||||
inline const Size clientSize() const {
|
//inline const Size clientSize() const {
|
||||||
return Size(client.width, client.height);
|
// return Size(client.width, client.height);
|
||||||
}
|
//}
|
||||||
inline const Rect area() const {
|
inline const Rect area() const {
|
||||||
return Rect(frame.x, frame.y, frame.width,
|
return Rect(frame.x, frame.y, frame.width,
|
||||||
flags.shaded ? frame.title_h : frame.height);
|
flags.shaded ? frame.title_h : frame.height);
|
||||||
|
|
|
@ -624,8 +624,8 @@ void Workspace::placeWindow(OpenboxWindow *win) {
|
||||||
}
|
}
|
||||||
#endif // SLIT
|
#endif // SLIT
|
||||||
|
|
||||||
const Size window_size(win->size().w()+screen.getBorderWidth() * 4,
|
const Size window_size(win->area().w()+screen.getBorderWidth() * 4,
|
||||||
win->size().h()+screen.getBorderWidth() * 4);
|
win->area().h()+screen.getBorderWidth() * 4);
|
||||||
Point *place = NULL;
|
Point *place = NULL;
|
||||||
LinkedListIterator<OpenboxWindow> it(windowList);
|
LinkedListIterator<OpenboxWindow> it(windowList);
|
||||||
|
|
||||||
|
@ -650,6 +650,6 @@ void Workspace::placeWindow(OpenboxWindow *win) {
|
||||||
if (place->y() + window_size.h() > (signed) screen.size().h())
|
if (place->y() + window_size.h() > (signed) screen.size().h())
|
||||||
place->setY(((signed) screen.size().h() - window_size.h()) / 2);
|
place->setY(((signed) screen.size().h() - window_size.h()) / 2);
|
||||||
|
|
||||||
win->configure(place->x(), place->y(), win->size().w(), win->size().h());
|
win->configure(place->x(), place->y(), win->area().w(), win->area().h());
|
||||||
delete place;
|
delete place;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue