Skip to content

Commit

Permalink
rename all BlackboxWindow::get* functions appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleyhughes committed Aug 23, 2004
1 parent 2ad8826 commit 02f08ad
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 48 deletions.
28 changes: 14 additions & 14 deletions src/Screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ bool BScreen::focusFallback(const BlackboxWindow *win) {
if (workspace->id() != current_workspace)
return false;

BWindowGroup *group = win->getWindowGroup();
BWindowGroup *group = win->findWindowGroup();
if (group) {
// focus the top-most window in the group
BlackboxWindowList::const_iterator git = group->windows().begin(),
Expand All @@ -676,7 +676,7 @@ bool BScreen::focusFallback(const BlackboxWindow *win) {

if (win) {
if (win->isTransient()) {
BlackboxWindow * const tmp = win->getTransientFor();
BlackboxWindow * const tmp = win->findTransientFor();
if (tmp
&& tmp->isVisible()
&& tmp->workspace() == current_workspace
Expand Down Expand Up @@ -728,13 +728,13 @@ void BScreen::raiseWindow(StackEntity *entity) {
// walk up the transient_for's to the window that is not a transient
BlackboxWindow *w = win;
while (w->isTransient()) {
BlackboxWindow *tmp = w->getTransientFor();
BlackboxWindow *tmp = w->findTransientFor();
if (!tmp || tmp == win)
break;
w = tmp;
}
win = w;
group = win->getWindowGroup();
group = win->findWindowGroup();

if (win->isFullScreen() && win->layer() != StackingList::LayerFullScreen) {
// move full-screen windows over all other windows when raising
Expand Down Expand Up @@ -828,13 +828,13 @@ void BScreen::lowerWindow(StackEntity *entity) {
// walk up the transient_for's to the window that is not a transient
BlackboxWindow *w = win;
while (w->isTransient()) {
BlackboxWindow *tmp = w->getTransientFor();
BlackboxWindow *tmp = w->findTransientFor();
if (!tmp || tmp == win)
break;
w = tmp;
}
win = w;
group = win->getWindowGroup();
group = win->findWindowGroup();
top = win;
}

Expand Down Expand Up @@ -959,7 +959,7 @@ void BScreen::propagateWindowName(const BlackboxWindow * const win) {
Workspace *workspace = getWorkspace(win->workspace());
if (!workspace) return;

const std::string s = bt::ellideText(win->getTitle(), 60, "...");
const std::string s = bt::ellideText(win->title(), 60, "...");
workspace->menu()->changeItem(win->windowNumber(), s);

if (_toolbar && blackbox->getFocusedWindow() == win)
Expand Down Expand Up @@ -1662,7 +1662,7 @@ void BScreen::updateClientListHint(void) const {
bt::Netwm::WindowList clientList(windowList.size());

std::transform(windowList.begin(), windowList.end(), clientList.begin(),
std::mem_fun(&BlackboxWindow::getClientWindow));
std::mem_fun(&BlackboxWindow::clientWindow));

blackbox->netwm().setClientList(screen_info.rootWindow(), clientList);
}
Expand All @@ -1677,7 +1677,7 @@ void BScreen::updateClientListStackingHint(void) const {
end = stackingList.rend();
for (; it != end; ++it) {
const BlackboxWindow * const win = dynamic_cast<BlackboxWindow *>(*it);
if (win) stack.push_back(win->getClientWindow());
if (win) stack.push_back(win->clientWindow());
}

if (stack.empty()) {
Expand Down Expand Up @@ -1792,8 +1792,8 @@ void BScreen::placeWindow(BlackboxWindow *win) {

if (placed == False) {
cascadePlacement(new_win, avail);
cascade_x += win->getTitleHeight();
cascade_y += win->getTitleHeight();
cascade_x += _resource.windowStyle()->title_height;
cascade_y += _resource.windowStyle()->title_height;
}

if (new_win.right() > avail.right())
Expand Down Expand Up @@ -2156,16 +2156,16 @@ void BScreen::addIcon(BlackboxWindow *win) {
workspace->removeWindow(win);
}

const std::string s = bt::ellideText(win->getIconTitle(), 60, "...");
const std::string s = bt::ellideText(win->iconTitle(), 60, "...");
int id = _iconmenu->insertItem(s);
blackbox->netwm().setWMVisibleIconName(win->getClientWindow(), s);
blackbox->netwm().setWMVisibleIconName(win->clientWindow(), s);
win->setWindowNumber(id);
}


void BScreen::removeIcon(BlackboxWindow *win) {
_iconmenu->removeItem(win->windowNumber());
blackbox->netwm().removeProperty(win->getClientWindow(),
blackbox->netwm().removeProperty(win->clientWindow(),
blackbox->netwm().wmVisibleIconName());

Workspace *workspace = getWorkspace(current_workspace);
Expand Down
12 changes: 6 additions & 6 deletions src/StackingList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void StackingList::dump(void) const {
entity = *it;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
Expand All @@ -191,39 +191,39 @@ void StackingList::dump(void) const {
entity = *fullscreen;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
fprintf(stderr, "zero\n");
entity = *above;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
fprintf(stderr, "zero\n");
entity = *normal;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
fprintf(stderr, "zero\n");
entity = *below;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
fprintf(stderr, "zero\n");
entity = *desktop;
win = dynamic_cast<BlackboxWindow *>(entity);
if (win)
fprintf(stderr, "%s: 0x%lx\n", win->getTitle(), win->getClientWindow());
fprintf(stderr, "%s: 0x%lx\n", win->title(), win->clientWindow());
else if (entity)
fprintf(stderr, "entity: 0x%lx\n", entity->windowID());
else
Expand Down
2 changes: 1 addition & 1 deletion src/Toolbar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ void Toolbar::redrawWindowLabel(void) {
bt::Pen pen(_screen->screenNumber(), style->wlabel_text);
bt::drawText(style->font, pen, frame.window_label, u,
style->alignment,
bt::ellideText(foc->getTitle(), u.width(), "...",
bt::ellideText(foc->title(), u.width(), "...",
_screen->screenNumber(), style->font));
}

Expand Down
28 changes: 14 additions & 14 deletions src/Window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ static void update_decorations(WindowDecorationFlags &decorations,
static void update_window_group(Window window_group,
Blackbox *blackbox,
BlackboxWindow *win) {
BWindowGroup *group = win->getWindowGroup();
BWindowGroup *group = win->findWindowGroup();
if (!group) {
new BWindowGroup(blackbox, window_group);
group = win->getWindowGroup();
group = win->findWindowGroup();
assert(group != 0);
}
group->addWindow(win);
Expand Down Expand Up @@ -285,7 +285,7 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {

if (isTransient()) {
// add ourselves to our transient_for
BlackboxWindow *win = getTransientFor();
BlackboxWindow *win = findTransientFor();
if (win) {
win->addTransient(this);
client.ewmh.workspace = win->workspace();
Expand Down Expand Up @@ -361,7 +361,7 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {

// preserve the window's initial state on first map, and its current
// state across a restart
if (!getState())
if (!readState())
client.current_state = client.wmhints.initial_state;

if (client.state.iconic) {
Expand Down Expand Up @@ -440,13 +440,13 @@ BlackboxWindow::~BlackboxWindow(void) {
delete client.strut;
}

BWindowGroup *group = getWindowGroup();
BWindowGroup *group = findWindowGroup();
if (group)
group->removeWindow(this);

// remove ourselves from our transient_for
if (isTransient()) {
BlackboxWindow *win = getTransientFor();
BlackboxWindow *win = findTransientFor();
if (win)
win->removeTransient(this);
client.transient_for = 0;
Expand Down Expand Up @@ -1499,7 +1499,7 @@ void BlackboxWindow::removeTransient(BlackboxWindow *win) {
}


BlackboxWindow *BlackboxWindow::getTransientFor(void) const {
BlackboxWindow *BlackboxWindow::findTransientFor(void) const {
BlackboxWindow *win = 0;
if (isTransient()) {
win = blackbox->findWindow(client.transient_for);
Expand All @@ -1510,7 +1510,7 @@ BlackboxWindow *BlackboxWindow::getTransientFor(void) const {
}


BWindowGroup *BlackboxWindow::getWindowGroup(void) const {
BWindowGroup *BlackboxWindow::findWindowGroup(void) const {
BWindowGroup *group = 0;
if (client.wmhints.window_group)
group = blackbox->findWindowGroup(client.wmhints.window_group);
Expand Down Expand Up @@ -1542,7 +1542,7 @@ bool BlackboxWindow::setInputFocus(void) {
pass focus to any modal transients, giving modal group transients
higher priority
*/
BWindowGroup *group = getWindowGroup();
BWindowGroup *group = findWindowGroup();
if (group && !group->transients().empty()) {
BlackboxWindowList::const_iterator it = group->transients().begin(),
end = group->transients().end();
Expand Down Expand Up @@ -1671,7 +1671,7 @@ void BlackboxWindow::iconify(void) {
if (client.state.iconic) return;

if (isTransient()) {
BlackboxWindow *win = getTransientFor();
BlackboxWindow *win = findTransientFor();
if (win) {
if (!win->isIconic())
win->iconify();
Expand Down Expand Up @@ -1994,7 +1994,7 @@ void BlackboxWindow::setState(unsigned long new_state) {
}


bool BlackboxWindow::getState(void) {
bool BlackboxWindow::readState(void) {
client.current_state = NormalState;

Atom atom_return;
Expand Down Expand Up @@ -2599,15 +2599,15 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent * const event) {
case XA_WM_TRANSIENT_FOR: {
if (isTransient()) {
// remove ourselves from our transient_for
BlackboxWindow *win = getTransientFor();
BlackboxWindow *win = findTransientFor();
if (win)
win->removeTransient(this);
}

// determine if this is a transient window
client.transient_for = readTransientInfo();
if (isTransient()) {
BlackboxWindow *win = getTransientFor();
BlackboxWindow *win = findTransientFor();
if (win) {
// add ourselves to our new transient_for
win->addTransient(this);
Expand Down Expand Up @@ -2641,7 +2641,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent * const event) {

case XA_WM_HINTS: {
// remove from current window group
BWindowGroup *group = getWindowGroup();
BWindowGroup *group = findWindowGroup();
if (group)
group->removeWindow(this);

Expand Down
17 changes: 7 additions & 10 deletions src/Window.hh
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class BlackboxWindow : public StackEntity, public bt::TimeoutHandler,
void applyGravity(bt::Rect &r);
void restoreGravity(bt::Rect &r);

bool getState(void);
bool readState(void);
void setState(unsigned long new_state);
void clearState(void);

Expand Down Expand Up @@ -308,9 +308,9 @@ public:
void addTransient(BlackboxWindow *win);
void removeTransient(BlackboxWindow *win);

BlackboxWindow *getTransientFor(void) const;
BlackboxWindow *findTransientFor(void) const;

BWindowGroup *getWindowGroup(void) const;
BWindowGroup *findWindowGroup(void) const;

inline BScreen *screen(void) const
{ return _screen; }
Expand All @@ -319,14 +319,14 @@ public:
inline Window windowID(void) const
{ return frame.window; }

inline Window getFrameWindow(void) const
inline Window frameWindow(void) const
{ return frame.window; }
inline Window getClientWindow(void) const
inline Window clientWindow(void) const
{ return client.window; }

inline const char *getTitle(void) const
inline const char *title(void) const
{ return client.title.c_str(); }
inline const char *getIconTitle(void) const
inline const char *iconTitle(void) const
{ return client.icon_title.c_str(); }

inline unsigned int workspace(void) const
Expand All @@ -343,9 +343,6 @@ public:
inline const bt::Rect &clientRect(void) const
{ return client.rect; }

inline unsigned int getTitleHeight(void) const
{ return frame.style->title_height; }

const WMHints &wmHints(void) const
{ return client.wmhints; }
const WMNormalHints &wmNormalHints(void) const
Expand Down
2 changes: 1 addition & 1 deletion src/Windowmenu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void Windowmenu::itemClicked(unsigned int id, unsigned int) {

case KillClient:
XKillClient(_window->screen()->screenInfo().display().XDisplay(),
_window->getClientWindow());
_window->clientWindow());
break;

case Close:
Expand Down
2 changes: 1 addition & 1 deletion src/Workspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void Workspace::addWindow(BlackboxWindow *win) {
assert(win->workspace() == _id || win->workspace() == bt::BSENTINEL);

win->setWorkspace(_id);
const std::string s = bt::ellideText(win->getTitle(), 60, "...");
const std::string s = bt::ellideText(win->title(), 60, "...");
int wid = clientmenu->insertItem(s);
win->setWindowNumber(wid);
}
Expand Down
2 changes: 1 addition & 1 deletion src/blackbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void Blackbox::setFocusedWindow(BlackboxWindow *win) {


void Blackbox::updateActiveWindow() const {
Window active = (focused_window) ? focused_window->getClientWindow() : None;
Window active = (focused_window) ? focused_window->clientWindow() : None;
for (unsigned int i = 0; i < display().screenCount(); ++i)
_netwm->setActiveWindow(display().screenInfo(i).rootWindow(), active);
}
Expand Down

0 comments on commit 02f08ad

Please sign in to comment.