diff options
author | fluxgen <fluxgen> | 2003-05-19 22:45:51 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-05-19 22:45:51 (GMT) |
commit | f911c4035fe86ed4c85a79f96aaab30902d56f89 (patch) | |
tree | 9c3ae59db318c26049fd4fda0850d0687378809e | |
parent | 0e9eefef1123a6bc21f89f6e6356351e46e4a3e1 (diff) | |
download | fluxbox-f911c4035fe86ed4c85a79f96aaab30902d56f89.zip fluxbox-f911c4035fe86ed4c85a79f96aaab30902d56f89.tar.bz2 |
cleaning
-rw-r--r-- | src/Screen.cc | 305 | ||||
-rw-r--r-- | src/Screen.hh | 49 |
2 files changed, 172 insertions, 182 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 5c61289..0d1614d 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.173 2003/05/19 15:32:46 rathnor Exp $ | 25 | // $Id: Screen.cc,v 1.174 2003/05/19 22:45:17 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -133,10 +133,9 @@ namespace { | |||
133 | 133 | ||
134 | int anotherWMRunning(Display *display, XErrorEvent *) { | 134 | int anotherWMRunning(Display *display, XErrorEvent *) { |
135 | cerr<<I18n::instance()-> | 135 | cerr<<I18n::instance()-> |
136 | getMessage( | 136 | getMessage(FBNLS::ScreenSet, FBNLS::ScreenAnotherWMRunning, |
137 | FBNLS::ScreenSet, FBNLS::ScreenAnotherWMRunning, | 137 | "BScreen::BScreen: an error occured while querying the X server.\n" |
138 | "BScreen::BScreen: an error occured while querying the X server.\n" | 138 | " another window manager already running on display ")<<DisplayString(display)<<endl; |
139 | " another window manager already running on display ")<<DisplayString(display)<<endl; | ||
140 | 139 | ||
141 | running = false; | 140 | running = false; |
142 | 141 | ||
@@ -526,7 +525,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
526 | 525 | ||
527 | initXinerama(); | 526 | initXinerama(); |
528 | 527 | ||
529 | event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | | 528 | unsigned long event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | |
530 | SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | | 529 | SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | |
531 | ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask; | 530 | ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask; |
532 | 531 | ||
@@ -555,10 +554,9 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
555 | #ifdef HAVE_GETPID | 554 | #ifdef HAVE_GETPID |
556 | pid_t bpid = getpid(); | 555 | pid_t bpid = getpid(); |
557 | 556 | ||
558 | XChangeProperty(disp, rootWindow().window(), | 557 | rootWindow().changeProperty(Fluxbox::instance()->getFluxboxPidAtom(), XA_CARDINAL, |
559 | Fluxbox::instance()->getFluxboxPidAtom(), XA_CARDINAL, | 558 | sizeof(pid_t) * 8, PropModeReplace, |
560 | sizeof(pid_t) * 8, PropModeReplace, | 559 | (unsigned char *) &bpid, 1); |
561 | (unsigned char *) &bpid, 1); | ||
562 | #endif // HAVE_GETPID | 560 | #endif // HAVE_GETPID |
563 | 561 | ||
564 | 562 | ||
@@ -590,11 +588,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
590 | 588 | ||
591 | int l = strlen(s); | 589 | int l = strlen(s); |
592 | 590 | ||
593 | geom_h = winFrameTheme().font().height(); | 591 | int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2; |
594 | geom_w = winFrameTheme().font().textWidth(s, l); | 592 | int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2; |
595 | |||
596 | geom_w += m_root_theme->bevelWidth()*2; | ||
597 | geom_h += m_root_theme->bevelWidth()*2; | ||
598 | 593 | ||
599 | XSetWindowAttributes attrib; | 594 | XSetWindowAttributes attrib; |
600 | unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; | 595 | unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; |
@@ -602,7 +597,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
602 | attrib.colormap = rootWindow().colormap(); | 597 | attrib.colormap = rootWindow().colormap(); |
603 | attrib.save_under = true; | 598 | attrib.save_under = true; |
604 | 599 | ||
605 | geom_window = | 600 | m_geom_window = |
606 | XCreateWindow(disp, rootWindow().window(), | 601 | XCreateWindow(disp, rootWindow().window(), |
607 | 0, 0, geom_w, geom_h, rootTheme().borderWidth(), rootWindow().depth(), | 602 | 0, 0, geom_w, geom_h, rootTheme().borderWidth(), rootWindow().depth(), |
608 | InputOutput, rootWindow().visual(), mask, &attrib); | 603 | InputOutput, rootWindow().visual(), mask, &attrib); |
@@ -612,21 +607,21 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
612 | if (winFrameTheme().titleFocusTexture().type() == | 607 | if (winFrameTheme().titleFocusTexture().type() == |
613 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { | 608 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { |
614 | geom_pixmap = None; | 609 | geom_pixmap = None; |
615 | geom_window.setBackgroundColor(winFrameTheme().titleFocusTexture().color()); | 610 | m_geom_window.setBackgroundColor(winFrameTheme().titleFocusTexture().color()); |
616 | } else { | 611 | } else { |
617 | geom_pixmap = imageControl().renderImage(geom_w, geom_h, | 612 | geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(), |
618 | winFrameTheme().titleFocusTexture()); | 613 | winFrameTheme().titleFocusTexture()); |
619 | geom_window.setBackgroundPixmap(geom_pixmap); | 614 | m_geom_window.setBackgroundPixmap(geom_pixmap); |
620 | } | 615 | } |
621 | } else { | 616 | } else { |
622 | if (winFrameTheme().labelFocusTexture().type() == | 617 | if (winFrameTheme().labelFocusTexture().type() == |
623 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { | 618 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { |
624 | geom_pixmap = None; | 619 | geom_pixmap = None; |
625 | geom_window.setBackgroundColor(winFrameTheme().labelFocusTexture().color()); | 620 | m_geom_window.setBackgroundColor(winFrameTheme().labelFocusTexture().color()); |
626 | } else { | 621 | } else { |
627 | geom_pixmap = imageControl().renderImage(geom_w, geom_h, | 622 | geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(), |
628 | winFrameTheme().labelFocusTexture()); | 623 | winFrameTheme().labelFocusTexture()); |
629 | geom_window.setBackgroundPixmap(geom_pixmap); | 624 | m_geom_window.setBackgroundPixmap(geom_pixmap); |
630 | } | 625 | } |
631 | } | 626 | } |
632 | 627 | ||
@@ -634,15 +629,15 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
634 | 629 | ||
635 | if (*resource.workspaces != 0) { | 630 | if (*resource.workspaces != 0) { |
636 | for (int i = 0; i < *resource.workspaces; ++i) { | 631 | for (int i = 0; i < *resource.workspaces; ++i) { |
637 | Workspace *wkspc = new Workspace(*this, m_layermanager, workspacesList.size()); | 632 | Workspace *wkspc = new Workspace(*this, m_layermanager, m_workspaces_list.size()); |
638 | workspacesList.push_back(wkspc); | 633 | m_workspaces_list.push_back(wkspc); |
639 | } | 634 | } |
640 | } else { // create at least one workspace | 635 | } else { // create at least one workspace |
641 | Workspace *wkspc = new Workspace(*this, m_layermanager, workspacesList.size()); | 636 | Workspace *wkspc = new Workspace(*this, m_layermanager, m_workspaces_list.size()); |
642 | workspacesList.push_back(wkspc); | 637 | m_workspaces_list.push_back(wkspc); |
643 | } | 638 | } |
644 | 639 | ||
645 | current_workspace = workspacesList.front(); | 640 | m_current_workspace = m_workspaces_list.front(); |
646 | 641 | ||
647 | #ifdef SLIT | 642 | #ifdef SLIT |
648 | m_slit.reset(new Slit(*this, *layerManager().getLayer(getSlitLayerNum()), | 643 | m_slit.reset(new Slit(*this, *layerManager().getLayer(getSlitLayerNum()), |
@@ -750,27 +745,27 @@ BScreen::~BScreen() { | |||
750 | 745 | ||
751 | removeWorkspaceNames(); | 746 | removeWorkspaceNames(); |
752 | 747 | ||
753 | Workspaces::iterator w_it = workspacesList.begin(); | 748 | Workspaces::iterator w_it = m_workspaces_list.begin(); |
754 | Workspaces::iterator w_it_end = workspacesList.end(); | 749 | Workspaces::iterator w_it_end = m_workspaces_list.end(); |
755 | for(; w_it != w_it_end; ++w_it) { | 750 | for(; w_it != w_it_end; ++w_it) { |
756 | delete (*w_it); | 751 | delete (*w_it); |
757 | } | 752 | } |
758 | workspacesList.clear(); | 753 | m_workspaces_list.clear(); |
759 | 754 | ||
760 | Icons::iterator i_it = iconList.begin(); | 755 | Icons::iterator i_it = m_icon_list.begin(); |
761 | Icons::iterator i_it_end = iconList.end(); | 756 | Icons::iterator i_it_end = m_icon_list.end(); |
762 | for(; i_it != i_it_end; ++i_it) { | 757 | for(; i_it != i_it_end; ++i_it) { |
763 | delete (*i_it); | 758 | delete (*i_it); |
764 | } | 759 | } |
765 | iconList.clear(); | 760 | m_icon_list.clear(); |
766 | 761 | ||
767 | Netizens::iterator n_it = netizenList.begin(); | 762 | Netizens::iterator n_it = m_netizen_list.begin(); |
768 | Netizens::iterator n_it_end = netizenList.end(); | 763 | Netizens::iterator n_it_end = m_netizen_list.end(); |
769 | for(; n_it != n_it_end; ++n_it) { | 764 | for(; n_it != n_it_end; ++n_it) { |
770 | delete (*n_it); | 765 | delete (*n_it); |
771 | } | 766 | } |
772 | 767 | ||
773 | netizenList.clear(); | 768 | m_netizen_list.clear(); |
774 | 769 | ||
775 | #ifdef XINERAMA | 770 | #ifdef XINERAMA |
776 | if (hasXinerama() && m_xinerama_headinfo) { | 771 | if (hasXinerama() && m_xinerama_headinfo) { |
@@ -788,7 +783,7 @@ FbTk::Menu &BScreen::toolbarModemenu() { | |||
788 | } | 783 | } |
789 | 784 | ||
790 | unsigned int BScreen::currentWorkspaceID() const { | 785 | unsigned int BScreen::currentWorkspaceID() const { |
791 | return current_workspace->workspaceID(); | 786 | return m_current_workspace->workspaceID(); |
792 | } | 787 | } |
793 | 788 | ||
794 | Pixmap BScreen::rootPixmap() const { | 789 | Pixmap BScreen::rootPixmap() const { |
@@ -799,12 +794,11 @@ Pixmap BScreen::rootPixmap() const { | |||
799 | int real_format; | 794 | int real_format; |
800 | unsigned long items_read, items_left; | 795 | unsigned long items_read, items_left; |
801 | unsigned int *data; | 796 | unsigned int *data; |
802 | if (XGetWindowProperty(disp, rootWindow().window(), | 797 | if (rootWindow().property(XInternAtom(disp, "_XROOTPMAP_ID", false), |
803 | XInternAtom(disp, "_XROOTPMAP_ID", false), | 798 | 0L, 1L, |
804 | 0L, 1L, | 799 | false, XA_PIXMAP, &real_type, |
805 | false, XA_PIXMAP, &real_type, | 800 | &real_format, &items_read, &items_left, |
806 | &real_format, &items_read, &items_left, | 801 | (unsigned char **) &data) && |
807 | (unsigned char **) &data) == Success && | ||
808 | items_read) { | 802 | items_read) { |
809 | root_pm = (Pixmap) (*data); | 803 | root_pm = (Pixmap) (*data); |
810 | XFree(data); | 804 | XFree(data); |
@@ -814,7 +808,7 @@ Pixmap BScreen::rootPixmap() const { | |||
814 | 808 | ||
815 | } | 809 | } |
816 | 810 | ||
817 | unsigned int BScreen::maxLeft(FbTk::FbWindow &win) const { | 811 | unsigned int BScreen::maxLeft(const FbTk::FbWindow &win) const { |
818 | if (hasXinerama()) { | 812 | if (hasXinerama()) { |
819 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | 813 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); |
820 | // we MUST use a head, we use the center of the window, or if that | 814 | // we MUST use a head, we use the center of the window, or if that |
@@ -825,7 +819,7 @@ unsigned int BScreen::maxLeft(FbTk::FbWindow &win) const { | |||
825 | return 0; | 819 | return 0; |
826 | } | 820 | } |
827 | 821 | ||
828 | unsigned int BScreen::maxRight(FbTk::FbWindow &win) const { | 822 | unsigned int BScreen::maxRight(const FbTk::FbWindow &win) const { |
829 | if (hasXinerama()) { | 823 | if (hasXinerama()) { |
830 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | 824 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); |
831 | // we MUST use a head, we use the center of the window, or if that | 825 | // we MUST use a head, we use the center of the window, or if that |
@@ -836,7 +830,7 @@ unsigned int BScreen::maxRight(FbTk::FbWindow &win) const { | |||
836 | return width(); | 830 | return width(); |
837 | } | 831 | } |
838 | 832 | ||
839 | unsigned int BScreen::maxTop(FbTk::FbWindow &win) const { | 833 | unsigned int BScreen::maxTop(const FbTk::FbWindow &win) const { |
840 | if (hasXinerama()) { | 834 | if (hasXinerama()) { |
841 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | 835 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); |
842 | // we MUST use a head, we use the center of the window, or if that | 836 | // we MUST use a head, we use the center of the window, or if that |
@@ -846,7 +840,8 @@ unsigned int BScreen::maxTop(FbTk::FbWindow &win) const { | |||
846 | } else | 840 | } else |
847 | return 0; | 841 | return 0; |
848 | } | 842 | } |
849 | unsigned int BScreen::maxBottom(FbTk::FbWindow &win) const { | 843 | |
844 | unsigned int BScreen::maxBottom(const FbTk::FbWindow &win) const { | ||
850 | if (hasXinerama()) { | 845 | if (hasXinerama()) { |
851 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | 846 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); |
852 | // we MUST use a head, we use the center of the window, or if that | 847 | // we MUST use a head, we use the center of the window, or if that |
@@ -883,38 +878,37 @@ void BScreen::reconfigure() { | |||
883 | int l = strlen(s); | 878 | int l = strlen(s); |
884 | 879 | ||
885 | //TODO: repeated from somewhere else? | 880 | //TODO: repeated from somewhere else? |
886 | geom_h = winFrameTheme().font().height(); | 881 | int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2; |
887 | geom_w = winFrameTheme().font().textWidth(s, l); | 882 | int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2; |
888 | geom_w += m_root_theme->bevelWidth()*2; | 883 | m_geom_window.resize(geom_w, geom_h); |
889 | geom_h += m_root_theme->bevelWidth()*2; | ||
890 | 884 | ||
891 | Pixmap tmp = geom_pixmap; | 885 | Pixmap tmp = geom_pixmap; |
892 | if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) { | 886 | if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) { |
893 | if (winFrameTheme().titleFocusTexture().type() == | 887 | if (winFrameTheme().titleFocusTexture().type() == |
894 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { | 888 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { |
895 | geom_pixmap = None; | 889 | geom_pixmap = None; |
896 | geom_window.setBackgroundColor(winFrameTheme().titleFocusTexture().color()); | 890 | m_geom_window.setBackgroundColor(winFrameTheme().titleFocusTexture().color()); |
897 | } else { | 891 | } else { |
898 | geom_pixmap = imageControl().renderImage(geom_w, geom_h, | 892 | geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(), |
899 | winFrameTheme().titleFocusTexture()); | 893 | winFrameTheme().titleFocusTexture()); |
900 | geom_window.setBackgroundPixmap(geom_pixmap); | 894 | m_geom_window.setBackgroundPixmap(geom_pixmap); |
901 | } | 895 | } |
902 | } else { | 896 | } else { |
903 | if (winFrameTheme().labelFocusTexture().type() == | 897 | if (winFrameTheme().labelFocusTexture().type() == |
904 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { | 898 | (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { |
905 | geom_pixmap = None; | 899 | geom_pixmap = None; |
906 | geom_window.setBackgroundColor(winFrameTheme().labelFocusTexture().color()); | 900 | m_geom_window.setBackgroundColor(winFrameTheme().labelFocusTexture().color()); |
907 | } else { | 901 | } else { |
908 | geom_pixmap = imageControl().renderImage(geom_w, geom_h, | 902 | geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(), |
909 | winFrameTheme().labelFocusTexture()); | 903 | winFrameTheme().labelFocusTexture()); |
910 | geom_window.setBackgroundPixmap(geom_pixmap); | 904 | m_geom_window.setBackgroundPixmap(geom_pixmap); |
911 | } | 905 | } |
912 | } | 906 | } |
913 | if (tmp) | 907 | if (tmp) |
914 | imageControl().removeImage(tmp); | 908 | imageControl().removeImage(tmp); |
915 | 909 | ||
916 | geom_window.setBorderWidth(m_root_theme->borderWidth()); | 910 | m_geom_window.setBorderWidth(m_root_theme->borderWidth()); |
917 | geom_window.setBorderColor(m_root_theme->borderColor()); | 911 | m_geom_window.setBorderColor(m_root_theme->borderColor()); |
918 | 912 | ||
919 | //reconfigure menus | 913 | //reconfigure menus |
920 | workspacemenu->reconfigure(); | 914 | workspacemenu->reconfigure(); |
@@ -978,13 +972,13 @@ void BScreen::reconfigure() { | |||
978 | #endif // SLIT | 972 | #endif // SLIT |
979 | 973 | ||
980 | //reconfigure workspaces | 974 | //reconfigure workspaces |
981 | for_each(workspacesList.begin(), | 975 | for_each(m_workspaces_list.begin(), |
982 | workspacesList.end(), | 976 | m_workspaces_list.end(), |
983 | mem_fun(&Workspace::reconfigure)); | 977 | mem_fun(&Workspace::reconfigure)); |
984 | 978 | ||
985 | //reconfigure Icons | 979 | //reconfigure Icons |
986 | for_each(iconList.begin(), | 980 | for_each(m_icon_list.begin(), |
987 | iconList.end(), | 981 | m_icon_list.end(), |
988 | mem_fun(&FluxboxWindow::reconfigure)); | 982 | mem_fun(&FluxboxWindow::reconfigure)); |
989 | 983 | ||
990 | imageControl().timeout(); | 984 | imageControl().timeout(); |
@@ -1000,7 +994,7 @@ void BScreen::rereadMenu() { | |||
1000 | 994 | ||
1001 | 995 | ||
1002 | void BScreen::removeWorkspaceNames() { | 996 | void BScreen::removeWorkspaceNames() { |
1003 | workspaceNames.erase(workspaceNames.begin(), workspaceNames.end()); | 997 | m_workspace_names.erase(m_workspace_names.begin(), m_workspace_names.end()); |
1004 | } | 998 | } |
1005 | 999 | ||
1006 | void BScreen::updateWorkspaceNamesAtom() { | 1000 | void BScreen::updateWorkspaceNamesAtom() { |
@@ -1011,9 +1005,9 @@ void BScreen::updateWorkspaceNamesAtom() { | |||
1011 | void BScreen::addIcon(FluxboxWindow *w) { | 1005 | void BScreen::addIcon(FluxboxWindow *w) { |
1012 | if (! w) return; | 1006 | if (! w) return; |
1013 | 1007 | ||
1014 | w->setWindowNumber(iconList.size()); | 1008 | w->setWindowNumber(m_icon_list.size()); |
1015 | 1009 | ||
1016 | iconList.push_back(w); | 1010 | m_icon_list.push_back(w); |
1017 | } | 1011 | } |
1018 | 1012 | ||
1019 | 1013 | ||
@@ -1022,15 +1016,15 @@ void BScreen::removeIcon(FluxboxWindow *w) { | |||
1022 | return; | 1016 | return; |
1023 | 1017 | ||
1024 | 1018 | ||
1025 | Icons::iterator erase_it = remove_if(iconList.begin(), | 1019 | Icons::iterator erase_it = remove_if(m_icon_list.begin(), |
1026 | iconList.end(), | 1020 | m_icon_list.end(), |
1027 | bind2nd(equal_to<FluxboxWindow *>(), w)); | 1021 | bind2nd(equal_to<FluxboxWindow *>(), w)); |
1028 | if (erase_it != iconList.end()) | 1022 | if (erase_it != m_icon_list.end()) |
1029 | iconList.erase(erase_it); | 1023 | m_icon_list.erase(erase_it); |
1030 | 1024 | ||
1031 | 1025 | ||
1032 | Icons::iterator it = iconList.begin(); | 1026 | Icons::iterator it = m_icon_list.begin(); |
1033 | Icons::iterator it_end = iconList.end(); | 1027 | Icons::iterator it_end = m_icon_list.end(); |
1034 | for (int i = 0; it != it_end; ++it, ++i) { | 1028 | for (int i = 0; it != it_end; ++it, ++i) { |
1035 | (*it)->setWindowNumber(i); | 1029 | (*it)->setWindowNumber(i); |
1036 | } | 1030 | } |
@@ -1065,8 +1059,8 @@ void BScreen::removeClient(WinClient &client) { | |||
1065 | } | 1059 | } |
1066 | 1060 | ||
1067 | FluxboxWindow *BScreen::getIcon(unsigned int index) { | 1061 | FluxboxWindow *BScreen::getIcon(unsigned int index) { |
1068 | if (index < iconList.size()) | 1062 | if (index < m_icon_list.size()) |
1069 | return iconList[index]; | 1063 | return m_icon_list[index]; |
1070 | 1064 | ||
1071 | return 0; | 1065 | return 0; |
1072 | } | 1066 | } |
@@ -1079,34 +1073,34 @@ void BScreen::setAntialias(bool value) { | |||
1079 | } | 1073 | } |
1080 | 1074 | ||
1081 | int BScreen::addWorkspace() { | 1075 | int BScreen::addWorkspace() { |
1082 | Workspace *wkspc = new Workspace(*this, m_layermanager, workspacesList.size()); | 1076 | Workspace *wkspc = new Workspace(*this, m_layermanager, m_workspaces_list.size()); |
1083 | workspacesList.push_back(wkspc); | 1077 | m_workspaces_list.push_back(wkspc); |
1084 | addWorkspaceName(wkspc->name().c_str()); // update names | 1078 | addWorkspaceName(wkspc->name().c_str()); // update names |
1085 | //add workspace to workspacemenu | 1079 | //add workspace to workspacemenu |
1086 | workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu(), | 1080 | workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu(), |
1087 | wkspc->workspaceID() + 2); //+2 so we add it after "remove last" | 1081 | wkspc->workspaceID() + 2); //+2 so we add it after "remove last" |
1088 | 1082 | ||
1089 | workspacemenu->update(); | 1083 | workspacemenu->update(); |
1090 | saveWorkspaces(workspacesList.size()); | 1084 | saveWorkspaces(m_workspaces_list.size()); |
1091 | if (toolbar() != 0) | 1085 | if (toolbar() != 0) |
1092 | toolbar()->reconfigure(); | 1086 | toolbar()->reconfigure(); |
1093 | 1087 | ||
1094 | updateNetizenWorkspaceCount(); | 1088 | updateNetizenWorkspaceCount(); |
1095 | 1089 | ||
1096 | 1090 | ||
1097 | return workspacesList.size(); | 1091 | return m_workspaces_list.size(); |
1098 | 1092 | ||
1099 | } | 1093 | } |
1100 | 1094 | ||
1101 | /// removes last workspace | 1095 | /// removes last workspace |
1102 | /// @return number of desktops left | 1096 | /// @return number of desktops left |
1103 | int BScreen::removeLastWorkspace() { | 1097 | int BScreen::removeLastWorkspace() { |
1104 | if (workspacesList.size() <= 1) | 1098 | if (m_workspaces_list.size() <= 1) |
1105 | return 0; | 1099 | return 0; |
1106 | Workspace *wkspc = workspacesList.back(); | 1100 | Workspace *wkspc = m_workspaces_list.back(); |
1107 | 1101 | ||
1108 | if (current_workspace->workspaceID() == wkspc->workspaceID()) | 1102 | if (m_current_workspace->workspaceID() == wkspc->workspaceID()) |
1109 | changeWorkspaceID(current_workspace->workspaceID() - 1); | 1103 | changeWorkspaceID(m_current_workspace->workspaceID() - 1); |
1110 | 1104 | ||
1111 | wkspc->removeAll(); | 1105 | wkspc->removeAll(); |
1112 | 1106 | ||
@@ -1114,22 +1108,22 @@ int BScreen::removeLastWorkspace() { | |||
1114 | workspacemenu->update(); | 1108 | workspacemenu->update(); |
1115 | 1109 | ||
1116 | //remove last workspace | 1110 | //remove last workspace |
1117 | workspacesList.pop_back(); | 1111 | m_workspaces_list.pop_back(); |
1118 | delete wkspc; | 1112 | delete wkspc; |
1119 | 1113 | ||
1120 | if (toolbar() != 0) | 1114 | if (toolbar() != 0) |
1121 | toolbar()->reconfigure(); | 1115 | toolbar()->reconfigure(); |
1122 | 1116 | ||
1123 | updateNetizenWorkspaceCount(); | 1117 | updateNetizenWorkspaceCount(); |
1124 | saveWorkspaces(workspacesList.size()); | 1118 | saveWorkspaces(m_workspaces_list.size()); |
1125 | 1119 | ||
1126 | return workspacesList.size(); | 1120 | return m_workspaces_list.size(); |
1127 | } | 1121 | } |
1128 | 1122 | ||
1129 | 1123 | ||
1130 | void BScreen::changeWorkspaceID(unsigned int id) { | 1124 | void BScreen::changeWorkspaceID(unsigned int id) { |
1131 | if (! current_workspace || id >= workspacesList.size() || | 1125 | if (! m_current_workspace || id >= m_workspaces_list.size() || |
1132 | id == current_workspace->workspaceID()) | 1126 | id == m_current_workspace->workspaceID()) |
1133 | return; | 1127 | return; |
1134 | 1128 | ||
1135 | XSync(FbTk::App::instance()->display(), true); | 1129 | XSync(FbTk::App::instance()->display(), true); |
@@ -1155,18 +1149,18 @@ void BScreen::changeWorkspaceID(unsigned int id) { | |||
1155 | } | 1149 | } |
1156 | } | 1150 | } |
1157 | 1151 | ||
1158 | current_workspace->hideAll(); | 1152 | currentWorkspace()->hideAll(); |
1159 | 1153 | ||
1160 | workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false); | 1154 | workspacemenu->setItemSelected(currentWorkspace()->workspaceID() + 2, false); |
1161 | 1155 | ||
1162 | // set new workspace | 1156 | // set new workspace |
1163 | current_workspace = getWorkspace(id); | 1157 | m_current_workspace = getWorkspace(id); |
1164 | 1158 | ||
1165 | workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true); | 1159 | workspacemenu->setItemSelected(currentWorkspace()->workspaceID() + 2, true); |
1166 | if (toolbar() != 0) | 1160 | if (toolbar() != 0) |
1167 | toolbar()->redrawWorkspaceLabel(true); | 1161 | toolbar()->redrawWorkspaceLabel(true); |
1168 | 1162 | ||
1169 | current_workspace->showAll(); | 1163 | currentWorkspace()->showAll(); |
1170 | 1164 | ||
1171 | if (focused && (focused->isStuck() || focused->isMoving())) { | 1165 | if (focused && (focused->isStuck() || focused->isMoving())) { |
1172 | focused->setInputFocus(); | 1166 | focused->setInputFocus(); |
@@ -1182,13 +1176,13 @@ void BScreen::changeWorkspaceID(unsigned int id) { | |||
1182 | 1176 | ||
1183 | 1177 | ||
1184 | void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS) { | 1178 | void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS) { |
1185 | if (! current_workspace || id >= workspacesList.size()) | 1179 | if (! m_current_workspace || id >= m_workspaces_list.size()) |
1186 | return; | 1180 | return; |
1187 | 1181 | ||
1188 | if (!win) | 1182 | if (!win) |
1189 | win = Fluxbox::instance()->getFocusedWindow(); | 1183 | win = Fluxbox::instance()->getFocusedWindow(); |
1190 | 1184 | ||
1191 | if (id != current_workspace->workspaceID()) { | 1185 | if (id != currentWorkspace()->workspaceID()) { |
1192 | XSync(FbTk::App::instance()->display(), True); | 1186 | XSync(FbTk::App::instance()->display(), True); |
1193 | 1187 | ||
1194 | if (win && &win->screen() == this && | 1188 | if (win && &win->screen() == this && |
@@ -1219,14 +1213,14 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS | |||
1219 | 1213 | ||
1220 | void BScreen::addNetizen(Window win) { | 1214 | void BScreen::addNetizen(Window win) { |
1221 | Netizen *net = new Netizen(*this, win); | 1215 | Netizen *net = new Netizen(*this, win); |
1222 | netizenList.push_back(net); | 1216 | m_netizen_list.push_back(net); |
1223 | 1217 | ||
1224 | net->sendWorkspaceCount(); | 1218 | net->sendWorkspaceCount(); |
1225 | net->sendCurrentWorkspace(); | 1219 | net->sendCurrentWorkspace(); |
1226 | 1220 | ||
1227 | // send all windows to netizen | 1221 | // send all windows to netizen |
1228 | Workspaces::iterator it = workspacesList.begin(); | 1222 | Workspaces::iterator it = m_workspaces_list.begin(); |
1229 | Workspaces::iterator it_end = workspacesList.end(); | 1223 | Workspaces::iterator it_end = m_workspaces_list.end(); |
1230 | for (; it != it_end; ++it) { | 1224 | for (; it != it_end; ++it) { |
1231 | Workspace::Windows::iterator win_it = (*it)->windowList().begin(); | 1225 | Workspace::Windows::iterator win_it = (*it)->windowList().begin(); |
1232 | Workspace::Windows::iterator win_it_end = (*it)->windowList().end(); | 1226 | Workspace::Windows::iterator win_it_end = (*it)->windowList().end(); |
@@ -1242,13 +1236,13 @@ void BScreen::addNetizen(Window win) { | |||
1242 | } | 1236 | } |
1243 | 1237 | ||
1244 | void BScreen::removeNetizen(Window w) { | 1238 | void BScreen::removeNetizen(Window w) { |
1245 | Netizens::iterator it = netizenList.begin(); | 1239 | Netizens::iterator it = m_netizen_list.begin(); |
1246 | Netizens::iterator it_end = netizenList.end(); | 1240 | Netizens::iterator it_end = m_netizen_list.end(); |
1247 | for (; it != it_end; ++it) { | 1241 | for (; it != it_end; ++it) { |
1248 | if ((*it)->window() == w) { | 1242 | if ((*it)->window() == w) { |
1249 | Netizen *n = *it; | 1243 | Netizen *n = *it; |
1250 | delete n; | 1244 | delete n; |
1251 | netizenList.erase(it); | 1245 | m_netizen_list.erase(it); |
1252 | break; | 1246 | break; |
1253 | } | 1247 | } |
1254 | } | 1248 | } |
@@ -1257,15 +1251,15 @@ void BScreen::removeNetizen(Window w) { | |||
1257 | 1251 | ||
1258 | void BScreen::updateNetizenCurrentWorkspace() { | 1252 | void BScreen::updateNetizenCurrentWorkspace() { |
1259 | m_currentworkspace_sig.notify(); | 1253 | m_currentworkspace_sig.notify(); |
1260 | for_each(netizenList.begin(), | 1254 | for_each(m_netizen_list.begin(), |
1261 | netizenList.end(), | 1255 | m_netizen_list.end(), |
1262 | mem_fun(&Netizen::sendCurrentWorkspace)); | 1256 | mem_fun(&Netizen::sendCurrentWorkspace)); |
1263 | } | 1257 | } |
1264 | 1258 | ||
1265 | 1259 | ||
1266 | void BScreen::updateNetizenWorkspaceCount() { | 1260 | void BScreen::updateNetizenWorkspaceCount() { |
1267 | for_each(netizenList.begin(), | 1261 | for_each(m_netizen_list.begin(), |
1268 | netizenList.end(), | 1262 | m_netizen_list.end(), |
1269 | mem_fun(&Netizen::sendWorkspaceCount)); | 1263 | mem_fun(&Netizen::sendWorkspaceCount)); |
1270 | 1264 | ||
1271 | m_workspacecount_sig.notify(); | 1265 | m_workspacecount_sig.notify(); |
@@ -1274,8 +1268,8 @@ void BScreen::updateNetizenWorkspaceCount() { | |||
1274 | 1268 | ||
1275 | void BScreen::updateNetizenWindowFocus() { | 1269 | void BScreen::updateNetizenWindowFocus() { |
1276 | 1270 | ||
1277 | Netizens::iterator it = netizenList.begin(); | 1271 | Netizens::iterator it = m_netizen_list.begin(); |
1278 | Netizens::iterator it_end = netizenList.end(); | 1272 | Netizens::iterator it_end = m_netizen_list.end(); |
1279 | Window f = ((Fluxbox::instance()->getFocusedWindow()) ? | 1273 | Window f = ((Fluxbox::instance()->getFocusedWindow()) ? |
1280 | Fluxbox::instance()->getFocusedWindow()->clientWindow() : None); | 1274 | Fluxbox::instance()->getFocusedWindow()->clientWindow() : None); |
1281 | for (; it != it_end; ++it) { | 1275 | for (; it != it_end; ++it) { |
@@ -1285,8 +1279,8 @@ void BScreen::updateNetizenWindowFocus() { | |||
1285 | 1279 | ||
1286 | 1280 | ||
1287 | void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { | 1281 | void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { |
1288 | Netizens::iterator it = netizenList.begin(); | 1282 | Netizens::iterator it = m_netizen_list.begin(); |
1289 | Netizens::iterator it_end = netizenList.end(); | 1283 | Netizens::iterator it_end = m_netizen_list.end(); |
1290 | for (; it != it_end; ++it) { | 1284 | for (; it != it_end; ++it) { |
1291 | (*it)->sendWindowAdd(w, p); | 1285 | (*it)->sendWindowAdd(w, p); |
1292 | } | 1286 | } |
@@ -1297,8 +1291,8 @@ void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { | |||
1297 | 1291 | ||
1298 | 1292 | ||
1299 | void BScreen::updateNetizenWindowDel(Window w) { | 1293 | void BScreen::updateNetizenWindowDel(Window w) { |
1300 | Netizens::iterator it = netizenList.begin(); | 1294 | Netizens::iterator it = m_netizen_list.begin(); |
1301 | Netizens::iterator it_end = netizenList.end(); | 1295 | Netizens::iterator it_end = m_netizen_list.end(); |
1302 | for (; it != it_end; ++it) { | 1296 | for (; it != it_end; ++it) { |
1303 | (*it)->sendWindowDel(w); | 1297 | (*it)->sendWindowDel(w); |
1304 | } | 1298 | } |
@@ -1308,8 +1302,8 @@ void BScreen::updateNetizenWindowDel(Window w) { | |||
1308 | 1302 | ||
1309 | 1303 | ||
1310 | void BScreen::updateNetizenWindowRaise(Window w) { | 1304 | void BScreen::updateNetizenWindowRaise(Window w) { |
1311 | Netizens::iterator it = netizenList.begin(); | 1305 | Netizens::iterator it = m_netizen_list.begin(); |
1312 | Netizens::iterator it_end = netizenList.end(); | 1306 | Netizens::iterator it_end = m_netizen_list.end(); |
1313 | for (; it != it_end; ++it) { | 1307 | for (; it != it_end; ++it) { |
1314 | (*it)->sendWindowRaise(w); | 1308 | (*it)->sendWindowRaise(w); |
1315 | } | 1309 | } |
@@ -1317,8 +1311,8 @@ void BScreen::updateNetizenWindowRaise(Window w) { | |||
1317 | 1311 | ||
1318 | 1312 | ||
1319 | void BScreen::updateNetizenWindowLower(Window w) { | 1313 | void BScreen::updateNetizenWindowLower(Window w) { |
1320 | Netizens::iterator it = netizenList.begin(); | 1314 | Netizens::iterator it = m_netizen_list.begin(); |
1321 | Netizens::iterator it_end = netizenList.end(); | 1315 | Netizens::iterator it_end = m_netizen_list.end(); |
1322 | for (; it != it_end; ++it) { | 1316 | for (; it != it_end; ++it) { |
1323 | (*it)->sendWindowLower(w); | 1317 | (*it)->sendWindowLower(w); |
1324 | } | 1318 | } |
@@ -1326,8 +1320,8 @@ void BScreen::updateNetizenWindowLower(Window w) { | |||
1326 | 1320 | ||
1327 | 1321 | ||
1328 | void BScreen::updateNetizenConfigNotify(XEvent *e) { | 1322 | void BScreen::updateNetizenConfigNotify(XEvent *e) { |
1329 | Netizens::iterator it = netizenList.begin(); | 1323 | Netizens::iterator it = m_netizen_list.begin(); |
1330 | Netizens::iterator it_end = netizenList.end(); | 1324 | Netizens::iterator it_end = m_netizen_list.end(); |
1331 | for (; it != it_end; ++it) { | 1325 | for (; it != it_end; ++it) { |
1332 | (*it)->sendConfigNotify(e); | 1326 | (*it)->sendConfigNotify(e); |
1333 | } | 1327 | } |
@@ -1523,13 +1517,13 @@ void BScreen::saveStrftimeFormat(const char *format) { | |||
1523 | 1517 | ||
1524 | 1518 | ||
1525 | void BScreen::addWorkspaceName(const char *name) { | 1519 | void BScreen::addWorkspaceName(const char *name) { |
1526 | workspaceNames.push_back(name); | 1520 | m_workspace_names.push_back(name); |
1527 | } | 1521 | } |
1528 | 1522 | ||
1529 | 1523 | ||
1530 | string BScreen::getNameOfWorkspace(unsigned int workspace) const { | 1524 | string BScreen::getNameOfWorkspace(unsigned int workspace) const { |
1531 | if (workspace < workspaceNames.size()) { | 1525 | if (workspace < m_workspace_names.size()) { |
1532 | return workspaceNames[workspace]; | 1526 | return m_workspace_names[workspace]; |
1533 | } else { | 1527 | } else { |
1534 | return ""; | 1528 | return ""; |
1535 | } | 1529 | } |
@@ -1541,7 +1535,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, | |||
1541 | return; | 1535 | return; |
1542 | 1536 | ||
1543 | if (wkspc_id >= getCount()) { | 1537 | if (wkspc_id >= getCount()) { |
1544 | wkspc_id = current_workspace->workspaceID(); | 1538 | wkspc_id = currentWorkspace()->workspaceID(); |
1545 | #ifdef DEBUG | 1539 | #ifdef DEBUG |
1546 | cerr<<__FILE__<<"("<<__LINE__<<"): wkspc_id >= getCount()"<<endl; | 1540 | cerr<<__FILE__<<"("<<__LINE__<<"): wkspc_id >= getCount()"<<endl; |
1547 | #endif // DEBUG | 1541 | #endif // DEBUG |
@@ -1860,10 +1854,10 @@ void BScreen::initMenu() { | |||
1860 | 1854 | ||
1861 | if (m_rootmenu.get()) { | 1855 | if (m_rootmenu.get()) { |
1862 | // since all menus in root is submenus in m_rootmenu | 1856 | // since all menus in root is submenus in m_rootmenu |
1863 | // just remove every item in m_rootmenu and then clear rootmenuList | 1857 | // just remove every item in m_rootmenu and then clear m_rootmenu_list |
1864 | while (m_rootmenu->numberOfItems()) | 1858 | while (m_rootmenu->numberOfItems()) |
1865 | m_rootmenu->remove(0); | 1859 | m_rootmenu->remove(0); |
1866 | rootmenuList.clear(); | 1860 | m_rootmenu_list.clear(); |
1867 | 1861 | ||
1868 | } else | 1862 | } else |
1869 | m_rootmenu.reset(createMenuFromScreen(*this)); | 1863 | m_rootmenu.reset(createMenuFromScreen(*this)); |
@@ -2109,7 +2103,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
2109 | submenu->update(); | 2103 | submenu->update(); |
2110 | menu.insert(str_label.c_str(), submenu); | 2104 | menu.insert(str_label.c_str(), submenu); |
2111 | // save to list so we can delete it later | 2105 | // save to list so we can delete it later |
2112 | rootmenuList.push_back(submenu); | 2106 | m_rootmenu_list.push_back(submenu); |
2113 | 2107 | ||
2114 | } | 2108 | } |
2115 | } // end of sub | 2109 | } // end of sub |
@@ -2361,8 +2355,8 @@ void BScreen::shutdown() { | |||
2361 | rootWindow().setEventMask(NoEventMask); | 2355 | rootWindow().setEventMask(NoEventMask); |
2362 | XSync(disp, False); | 2356 | XSync(disp, False); |
2363 | 2357 | ||
2364 | for_each(workspacesList.begin(), | 2358 | for_each(m_workspaces_list.begin(), |
2365 | workspacesList.end(), | 2359 | m_workspaces_list.end(), |
2366 | mem_fun(&Workspace::shutdown)); | 2360 | mem_fun(&Workspace::shutdown)); |
2367 | 2361 | ||
2368 | #ifdef SLIT | 2362 | #ifdef SLIT |
@@ -2375,31 +2369,30 @@ void BScreen::shutdown() { | |||
2375 | 2369 | ||
2376 | void BScreen::showPosition(int x, int y) { | 2370 | void BScreen::showPosition(int x, int y) { |
2377 | if (! geom_visible) { | 2371 | if (! geom_visible) { |
2378 | #ifdef XINERAMA | 2372 | if (hasXinerama()) { |
2379 | unsigned int head = hasXinerama() ? getCurrHead() : 0; | 2373 | unsigned int head = getCurrHead(); |
2380 | 2374 | ||
2381 | geom_window.moveResize(getHeadX(head) + (getHeadWidth(head) - geom_w) / 2, | 2375 | m_geom_window.move(getHeadX(head) + (getHeadWidth(head) - m_geom_window.width()) / 2, |
2382 | getHeadY(head) + (getHeadHeight(head) - geom_h) / 2, | 2376 | getHeadY(head) + (getHeadHeight(head) - m_geom_window.height()) / 2); |
2383 | geom_w, geom_h); | 2377 | |
2384 | #else // !XINERMA | 2378 | } else { |
2385 | geom_window.moveResize((width() - geom_w) / 2, | 2379 | m_geom_window.move((width() - m_geom_window.width()) / 2, (height() - m_geom_window.height()) / 2); |
2386 | (height() - geom_h) / 2, geom_w, geom_h); | 2380 | } |
2387 | #endif // XINERAMA | ||
2388 | 2381 | ||
2389 | geom_window.show(); | 2382 | m_geom_window.show(); |
2390 | geom_window.raise(); | 2383 | m_geom_window.raise(); |
2391 | 2384 | ||
2392 | geom_visible = true; | 2385 | geom_visible = true; |
2393 | } | 2386 | } |
2394 | char label[256]; | 2387 | char label[256]; |
2395 | 2388 | ||
2396 | sprintf(label, | 2389 | sprintf(label, |
2397 | I18n::instance()->getMessage(FBNLS::ScreenSet, FBNLS::ScreenPositionFormat, | 2390 | I18n::instance()->getMessage(FBNLS::ScreenSet, FBNLS::ScreenPositionFormat, |
2398 | "X: %4d x Y: %4d"), x, y); | 2391 | "X: %4d x Y: %4d"), x, y); |
2399 | 2392 | ||
2400 | geom_window.clear(); | 2393 | m_geom_window.clear(); |
2401 | 2394 | ||
2402 | winFrameTheme().font().drawText(geom_window.window(), | 2395 | winFrameTheme().font().drawText(m_geom_window.window(), |
2403 | screenNumber(), | 2396 | screenNumber(), |
2404 | winFrameTheme().labelTextFocusGC(), | 2397 | winFrameTheme().labelTextFocusGC(), |
2405 | label, strlen(label), | 2398 | label, strlen(label), |
@@ -2412,18 +2405,17 @@ void BScreen::showPosition(int x, int y) { | |||
2412 | 2405 | ||
2413 | void BScreen::showGeometry(unsigned int gx, unsigned int gy) { | 2406 | void BScreen::showGeometry(unsigned int gx, unsigned int gy) { |
2414 | if (! geom_visible) { | 2407 | if (! geom_visible) { |
2415 | #ifdef XINERAMA | 2408 | if (hasXinerama()) { |
2416 | unsigned int head = hasXinerama() ? getCurrHead() : 0; | 2409 | unsigned int head = getCurrHead(); |
2417 | 2410 | ||
2418 | geom_window.moveResize(getHeadX(head) + (getHeadWidth(head) - geom_w) / 2, | 2411 | m_geom_window.move(getHeadX(head) + (getHeadWidth(head) - m_geom_window.width()) / 2, |
2419 | getHeadY(head) + (getHeadHeight(head) - geom_h) / 2, | 2412 | getHeadY(head) + (getHeadHeight(head) - m_geom_window.height()) / 2); |
2420 | geom_w, geom_h); | 2413 | } else { |
2421 | #else // !XINERMA | 2414 | m_geom_window.move((width() - m_geom_window.width()) / 2, (height() - m_geom_window.height()) / 2); |
2422 | geom_window.moveResize((width() - geom_w) / 2, | 2415 | |
2423 | (height() - geom_h) / 2, geom_w, geom_h); | 2416 | } |
2424 | #endif // XINERAMA | 2417 | m_geom_window.show(); |
2425 | geom_window.show(); | 2418 | m_geom_window.raise(); |
2426 | geom_window.raise(); | ||
2427 | 2419 | ||
2428 | geom_visible = true; | 2420 | geom_visible = true; |
2429 | } | 2421 | } |
@@ -2435,10 +2427,10 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) { | |||
2435 | FBNLS::ScreenSet, FBNLS::ScreenGeometryFormat, | 2427 | FBNLS::ScreenSet, FBNLS::ScreenGeometryFormat, |
2436 | "W: %4d x H: %4d"), gx, gy); | 2428 | "W: %4d x H: %4d"), gx, gy); |
2437 | 2429 | ||
2438 | geom_window.clear(); | 2430 | m_geom_window.clear(); |
2439 | 2431 | ||
2440 | //TODO: geom window again?! repeated | 2432 | //TODO: geom window again?! repeated |
2441 | winFrameTheme().font().drawText(geom_window.window(), | 2433 | winFrameTheme().font().drawText(m_geom_window.window(), |
2442 | screenNumber(), | 2434 | screenNumber(), |
2443 | winFrameTheme().labelTextFocusGC(), | 2435 | winFrameTheme().labelTextFocusGC(), |
2444 | label, strlen(label), | 2436 | label, strlen(label), |
@@ -2450,7 +2442,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) { | |||
2450 | 2442 | ||
2451 | void BScreen::hideGeometry() { | 2443 | void BScreen::hideGeometry() { |
2452 | if (geom_visible) { | 2444 | if (geom_visible) { |
2453 | geom_window.hide(); | 2445 | m_geom_window.hide(); |
2454 | geom_visible = false; | 2446 | geom_visible = false; |
2455 | } | 2447 | } |
2456 | } | 2448 | } |
@@ -2589,6 +2581,7 @@ void BScreen::initXinerama() { | |||
2589 | m_xinerama_headinfo[i].height = screen_info[i].height; | 2581 | m_xinerama_headinfo[i].height = screen_info[i].height; |
2590 | } | 2582 | } |
2591 | #else // XINERAMA | 2583 | #else // XINERAMA |
2584 | // no xinerama | ||
2592 | m_xinerama_avail = false; | 2585 | m_xinerama_avail = false; |
2593 | m_xinerama_num_heads = 0; | 2586 | m_xinerama_num_heads = 0; |
2594 | #endif // XINERAMA | 2587 | #endif // XINERAMA |
diff --git a/src/Screen.hh b/src/Screen.hh index 59a26c1..d156013 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.hh,v 1.101 2003/05/19 15:32:46 rathnor Exp $ | 25 | // $Id: Screen.hh,v 1.102 2003/05/19 22:45:51 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -126,8 +126,8 @@ public: | |||
126 | inline const ToolbarHandler &toolbarHandler() const { return *m_toolbarhandler; } | 126 | inline const ToolbarHandler &toolbarHandler() const { return *m_toolbarhandler; } |
127 | inline ToolbarHandler &toolbarHandler() { return *m_toolbarhandler; } | 127 | inline ToolbarHandler &toolbarHandler() { return *m_toolbarhandler; } |
128 | 128 | ||
129 | inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); } | 129 | inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); } |
130 | inline Workspace *currentWorkspace() { return current_workspace; } | 130 | inline Workspace *currentWorkspace() { return m_current_workspace; } |
131 | 131 | ||
132 | const FbTk::Menu *getWorkspacemenu() const { return workspacemenu.get(); } | 132 | const FbTk::Menu *getWorkspacemenu() const { return workspacemenu.get(); } |
133 | FbTk::Menu *getWorkspacemenu() { return workspacemenu.get(); } | 133 | FbTk::Menu *getWorkspacemenu() { return workspacemenu.get(); } |
@@ -137,10 +137,10 @@ public: | |||
137 | /* | 137 | /* |
138 | maximum screen bounds for given window | 138 | maximum screen bounds for given window |
139 | */ | 139 | */ |
140 | unsigned int maxLeft(FbTk::FbWindow &win) const; | 140 | unsigned int maxLeft(const FbTk::FbWindow &win) const; |
141 | unsigned int maxRight(FbTk::FbWindow &win) const; | 141 | unsigned int maxRight(const FbTk::FbWindow &win) const; |
142 | unsigned int maxTop(FbTk::FbWindow &win) const; | 142 | unsigned int maxTop(const FbTk::FbWindow &win) const; |
143 | unsigned int maxBottom(FbTk::FbWindow &win) const; | 143 | unsigned int maxBottom(const FbTk::FbWindow &win) const; |
144 | 144 | ||
145 | inline unsigned int width() const { return rootWindow().width(); } | 145 | inline unsigned int width() const { return rootWindow().width(); } |
146 | inline unsigned int height() const { return rootWindow().height(); } | 146 | inline unsigned int height() const { return rootWindow().height(); } |
@@ -149,16 +149,16 @@ public: | |||
149 | typedef std::list<WinClient *> FocusedWindows; | 149 | typedef std::list<WinClient *> FocusedWindows; |
150 | 150 | ||
151 | /// @return number of workspaces | 151 | /// @return number of workspaces |
152 | inline unsigned int getCount() const { return workspacesList.size(); } | 152 | inline unsigned int getCount() const { return m_workspaces_list.size(); } |
153 | /// @return number of icons | 153 | /// @return number of icons |
154 | inline unsigned int getIconCount() const { return iconList.size(); } | 154 | inline unsigned int getIconCount() const { return m_icon_list.size(); } |
155 | inline const Icons &getIconList() const { return iconList; } | 155 | inline const Icons &getIconList() const { return m_icon_list; } |
156 | inline Icons &getIconList() { return iconList; } | 156 | inline Icons &getIconList() { return m_icon_list; } |
157 | inline const FocusedWindows &getFocusedList() const { return focused_list; } | 157 | inline const FocusedWindows &getFocusedList() const { return focused_list; } |
158 | inline FocusedWindows &getFocusedList() { return focused_list; } | 158 | inline FocusedWindows &getFocusedList() { return focused_list; } |
159 | WinClient *getLastFocusedWindow(int workspace = -1); | 159 | WinClient *getLastFocusedWindow(int workspace = -1); |
160 | const Workspaces &getWorkspacesList() const { return workspacesList; } | 160 | const Workspaces &getWorkspacesList() const { return m_workspaces_list; } |
161 | const WorkspaceNames &getWorkspaceNames() const { return workspaceNames; } | 161 | const WorkspaceNames &getWorkspaceNames() const { return m_workspace_names; } |
162 | /** | 162 | /** |
163 | @name Screen signals | 163 | @name Screen signals |
164 | */ | 164 | */ |
@@ -369,7 +369,8 @@ private: | |||
369 | bool root_colormap_installed, managed, geom_visible, cycling_focus; | 369 | bool root_colormap_installed, managed, geom_visible, cycling_focus; |
370 | GC opGC; | 370 | GC opGC; |
371 | Pixmap geom_pixmap; | 371 | Pixmap geom_pixmap; |
372 | FbTk::FbWindow geom_window; | 372 | |
373 | FbTk::FbWindow m_geom_window; | ||
373 | 374 | ||
374 | std::auto_ptr<FbTk::ImageControl> m_image_control; | 375 | std::auto_ptr<FbTk::ImageControl> m_image_control; |
375 | std::auto_ptr<FbTk::Menu> m_configmenu; | 376 | std::auto_ptr<FbTk::Menu> m_configmenu; |
@@ -379,9 +380,9 @@ private: | |||
379 | typedef std::list<FbTk::Menu *> Rootmenus; | 380 | typedef std::list<FbTk::Menu *> Rootmenus; |
380 | typedef std::list<Netizen *> Netizens; | 381 | typedef std::list<Netizen *> Netizens; |
381 | 382 | ||
382 | Rootmenus rootmenuList; | 383 | Rootmenus m_rootmenu_list; |
383 | Netizens netizenList; | 384 | Netizens m_netizen_list; |
384 | Icons iconList; | 385 | Icons m_icon_list; |
385 | 386 | ||
386 | // This list keeps the order of window focusing for this screen | 387 | // This list keeps the order of window focusing for this screen |
387 | // Screen global so it works for sticky windows too. | 388 | // Screen global so it works for sticky windows too. |
@@ -391,14 +392,11 @@ private: | |||
391 | 392 | ||
392 | std::auto_ptr<Slit> m_slit; | 393 | std::auto_ptr<Slit> m_slit; |
393 | 394 | ||
394 | Workspace *current_workspace; | 395 | Workspace *m_current_workspace; |
395 | std::auto_ptr<FbTk::Menu> workspacemenu; | 396 | std::auto_ptr<FbTk::Menu> workspacemenu; |
396 | 397 | ||
397 | unsigned int geom_w, geom_h; | 398 | WorkspaceNames m_workspace_names; |
398 | unsigned long event_mask; | 399 | Workspaces m_workspaces_list; |
399 | |||
400 | WorkspaceNames workspaceNames; | ||
401 | Workspaces workspacesList; | ||
402 | 400 | ||
403 | Window auto_group_window; | 401 | Window auto_group_window; |
404 | 402 | ||
@@ -449,15 +447,14 @@ private: | |||
449 | bool m_xinerama_avail; | 447 | bool m_xinerama_avail; |
450 | int m_xinerama_num_heads; | 448 | int m_xinerama_num_heads; |
451 | 449 | ||
452 | #ifdef XINERAMA | ||
453 | // Xinerama related private data | 450 | // Xinerama related private data |
454 | 451 | ||
455 | int m_xinerama_center_x, m_xinerama_center_y; | 452 | int m_xinerama_center_x, m_xinerama_center_y; |
456 | 453 | ||
457 | struct XineramaHeadInfo { | 454 | struct XineramaHeadInfo { |
458 | int x, y, width, height; | 455 | int x, y, width, height; |
459 | } *m_xinerama_headinfo; | 456 | } *m_xinerama_headinfo; |
460 | #endif | 457 | |
461 | }; | 458 | }; |
462 | 459 | ||
463 | 460 | ||