diff options
author | fluxgen <fluxgen> | 2002-12-03 23:58:06 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-12-03 23:58:06 (GMT) |
commit | 044713cd751ce8e476d0dd162f4cc5e2ce4263b9 (patch) | |
tree | 0656cc28b9373d9524a44c3edcf18596ca8e09bb /src | |
parent | ec1947ccc1555b7cdf2335dec7f64c238422f77a (diff) | |
download | fluxbox_paul-044713cd751ce8e476d0dd162f4cc5e2ce4263b9.zip fluxbox_paul-044713cd751ce8e476d0dd162f4cc5e2ce4263b9.tar.bz2 |
removed menu and toolbar functions
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 93 | ||||
-rw-r--r-- | src/fluxbox.hh | 11 |
2 files changed, 13 insertions, 91 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index bbf5a73..a2fd191 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.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: fluxbox.cc,v 1.85 2002/12/02 23:49:56 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.86 2002/12/03 23:58:06 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "fluxbox.hh" | 28 | #include "fluxbox.hh" |
@@ -566,12 +566,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
566 | 566 | ||
567 | return; | 567 | return; |
568 | } | 568 | } |
569 | 569 | // try FbTk::EventHandler first | |
570 | FbTk::EventManager::instance()->handleEvent(*e); | ||
571 | |||
570 | switch (e->type) { | 572 | switch (e->type) { |
571 | case ButtonRelease: | 573 | case ButtonRelease: |
572 | case ButtonPress: | 574 | case ButtonPress: |
573 | handleButtonEvent(e->xbutton); | 575 | handleButtonEvent(e->xbutton); |
574 | FbTk::EventManager::instance()->handleEvent(*e); | ||
575 | break; | 576 | break; |
576 | case ConfigureRequest: | 577 | case ConfigureRequest: |
577 | { | 578 | { |
@@ -726,17 +727,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
726 | last_time = e->xmotion.time; | 727 | last_time = e->xmotion.time; |
727 | 728 | ||
728 | FluxboxWindow *win = 0; | 729 | FluxboxWindow *win = 0; |
729 | Basemenu *menu = 0; | ||
730 | Tab *tab = 0; | 730 | Tab *tab = 0; |
731 | 731 | ||
732 | if ((win = searchWindow(e->xmotion.window)) !=0) | 732 | if ((win = searchWindow(e->xmotion.window)) !=0) |
733 | win->motionNotifyEvent(&e->xmotion); | 733 | win->motionNotifyEvent(&e->xmotion); |
734 | else if ((menu = searchMenu(e->xmotion.window)) !=0) | ||
735 | menu->motionNotifyEvent(&e->xmotion); | ||
736 | else if ((tab = searchTab(e->xmotion.window)) !=0) | 734 | else if ((tab = searchTab(e->xmotion.window)) !=0) |
737 | tab->motionNotifyEvent(&e->xmotion); | 735 | tab->motionNotifyEvent(&e->xmotion); |
738 | 736 | ||
739 | |||
740 | } | 737 | } |
741 | break; | 738 | break; |
742 | case PropertyNotify: { | 739 | case PropertyNotify: { |
@@ -755,13 +752,11 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
755 | case EnterNotify: { | 752 | case EnterNotify: { |
756 | last_time = e->xcrossing.time; | 753 | last_time = e->xcrossing.time; |
757 | 754 | ||
758 | BScreen *screen = (BScreen *) 0; | 755 | BScreen *screen = 0; |
759 | FluxboxWindow *win = (FluxboxWindow *) 0; | 756 | FluxboxWindow *win = 0; |
760 | Basemenu *menu = (Basemenu *) 0; | 757 | Tab *tab = 0; |
761 | |||
762 | Tab *tab = (Tab *) 0; | ||
763 | #ifdef SLIT | 758 | #ifdef SLIT |
764 | Slit *slit = (Slit *) 0; | 759 | Slit *slit = 0; |
765 | #endif // SLIT | 760 | #endif // SLIT |
766 | 761 | ||
767 | if (e->xcrossing.mode == NotifyGrab) | 762 | if (e->xcrossing.mode == NotifyGrab) |
@@ -789,11 +784,7 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
789 | 784 | ||
790 | ungrab(); | 785 | ungrab(); |
791 | } | 786 | } |
792 | } else if ((menu = searchMenu(e->xcrossing.window))) | 787 | } else if ((tab = searchTab(e->xcrossing.window))) { |
793 | menu->enterNotifyEvent(&e->xcrossing); | ||
794 | /* else if ((tbar = searchToolbar(e->xcrossing.window))) | ||
795 | tbar->enterNotifyEvent(&e->xcrossing); | ||
796 | */else if ((tab = searchTab(e->xcrossing.window))) { | ||
797 | win = tab->getWindow(); | 788 | win = tab->getWindow(); |
798 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && | 789 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && |
799 | (! no_focus)) { | 790 | (! no_focus)) { |
@@ -812,10 +803,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
812 | else if ((slit = searchSlit(e->xcrossing.window))) | 803 | else if ((slit = searchSlit(e->xcrossing.window))) |
813 | slit->enterNotifyEvent(&e->xcrossing); | 804 | slit->enterNotifyEvent(&e->xcrossing); |
814 | #endif // SLIT | 805 | #endif // SLIT |
815 | else { | ||
816 | FbTk::EventManager::instance()->handleEvent(*e); | ||
817 | } | ||
818 | |||
819 | 806 | ||
820 | } | 807 | } |
821 | break; | 808 | break; |
@@ -824,48 +811,32 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
824 | last_time = e->xcrossing.time; | 811 | last_time = e->xcrossing.time; |
825 | 812 | ||
826 | FluxboxWindow *win = (FluxboxWindow *) 0; | 813 | FluxboxWindow *win = (FluxboxWindow *) 0; |
827 | Basemenu *menu = (Basemenu *) 0; | ||
828 | 814 | ||
829 | #ifdef SLIT | 815 | #ifdef SLIT |
830 | Slit *slit = (Slit *) 0; | 816 | Slit *slit = (Slit *) 0; |
831 | #endif // SLIT | 817 | #endif // SLIT |
832 | 818 | if ((win = searchWindow(e->xcrossing.window))) | |
833 | if ((menu = searchMenu(e->xcrossing.window))) | 819 | win->installColormap(false); |
834 | menu->leaveNotifyEvent(&e->xcrossing); | ||
835 | else if ((win = searchWindow(e->xcrossing.window))) | ||
836 | win->installColormap(False); | ||
837 | /* else if ((tbar = searchToolbar(e->xcrossing.window))) | ||
838 | tbar->leaveNotifyEvent(&e->xcrossing); | ||
839 | */ | ||
840 | #ifdef SLIT | 820 | #ifdef SLIT |
841 | else if ((slit = searchSlit(e->xcrossing.window))) | 821 | else if ((slit = searchSlit(e->xcrossing.window))) |
842 | slit->leaveNotifyEvent(&e->xcrossing); | 822 | slit->leaveNotifyEvent(&e->xcrossing); |
843 | #endif // SLIT | 823 | #endif // SLIT |
844 | else { | ||
845 | FbTk::EventManager::instance()->handleEvent(*e); | ||
846 | } | ||
847 | 824 | ||
848 | } | 825 | } |
849 | break; | 826 | break; |
850 | case Expose: | 827 | case Expose: |
851 | { | 828 | { |
852 | FluxboxWindow *win = (FluxboxWindow *) 0; | 829 | FluxboxWindow *win = (FluxboxWindow *) 0; |
853 | Basemenu *menu = (Basemenu *) 0; | ||
854 | Tab *tab = 0; | 830 | Tab *tab = 0; |
855 | 831 | ||
856 | if ((win = searchWindow(e->xexpose.window))) | 832 | if ((win = searchWindow(e->xexpose.window))) |
857 | win->exposeEvent(&e->xexpose); | 833 | win->exposeEvent(&e->xexpose); |
858 | else if ((menu = searchMenu(e->xexpose.window))) | ||
859 | menu->exposeEvent(&e->xexpose); | ||
860 | else if ((tab = searchTab(e->xexpose.window))) | 834 | else if ((tab = searchTab(e->xexpose.window))) |
861 | tab->exposeEvent(&e->xexpose); | 835 | tab->exposeEvent(&e->xexpose); |
862 | else | ||
863 | FbTk::EventManager::instance()->handleEvent(*e); | ||
864 | } | 836 | } |
865 | break; | 837 | break; |
866 | case KeyPress: | 838 | case KeyPress: |
867 | handleKeyEvent(e->xkey); | 839 | handleKeyEvent(e->xkey); |
868 | FbTk::EventManager::instance()->handleEvent(*e); | ||
869 | break; | 840 | break; |
870 | case ColormapNotify: { | 841 | case ColormapNotify: { |
871 | BScreen *screen = searchScreen(e->xcolormap.window); | 842 | BScreen *screen = searchScreen(e->xcolormap.window); |
@@ -903,7 +874,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
903 | win->shapeEvent(shape_event); | 874 | win->shapeEvent(shape_event); |
904 | } | 875 | } |
905 | #endif // SHAPE | 876 | #endif // SHAPE |
906 | FbTk::EventManager::instance()->handleEvent(*e); | ||
907 | } | 877 | } |
908 | } | 878 | } |
909 | } | 879 | } |
@@ -915,7 +885,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
915 | last_time = be.time; | 885 | last_time = be.time; |
916 | 886 | ||
917 | FluxboxWindow *win = 0; | 887 | FluxboxWindow *win = 0; |
918 | Basemenu *menu = 0; | ||
919 | Tab *tab = 0; | 888 | Tab *tab = 0; |
920 | #ifdef SLIT | 889 | #ifdef SLIT |
921 | Slit *slit = (Slit *) 0; | 890 | Slit *slit = (Slit *) 0; |
@@ -927,9 +896,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
927 | 896 | ||
928 | if (be.button == 1) | 897 | if (be.button == 1) |
929 | win->installColormap(True); | 898 | win->installColormap(True); |
930 | |||
931 | } else if ((menu = searchMenu(be.window))) { | ||
932 | menu->buttonPressEvent(&be); | ||
933 | } | 899 | } |
934 | #ifdef SLIT | 900 | #ifdef SLIT |
935 | else if ((slit = searchSlit(be.window))) { | 901 | else if ((slit = searchSlit(be.window))) { |
@@ -1029,13 +995,10 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
1029 | { | 995 | { |
1030 | last_time = be.time; | 996 | last_time = be.time; |
1031 | FluxboxWindow *win = (FluxboxWindow *) 0; | 997 | FluxboxWindow *win = (FluxboxWindow *) 0; |
1032 | Basemenu *menu = (Basemenu *) 0; | ||
1033 | Tab *tab = 0; | 998 | Tab *tab = 0; |
1034 | 999 | ||
1035 | if ((win = searchWindow(be.window))) | 1000 | if ((win = searchWindow(be.window))) |
1036 | win->buttonReleaseEvent(&be); | 1001 | win->buttonReleaseEvent(&be); |
1037 | else if ((menu = searchMenu(be.window))) | ||
1038 | menu->buttonReleaseEvent(&be); | ||
1039 | else if ((tab = searchTab(be.window))) | 1002 | else if ((tab = searchTab(be.window))) |
1040 | tab->buttonReleaseEvent(&be); | 1003 | tab->buttonReleaseEvent(&be); |
1041 | } | 1004 | } |
@@ -1716,18 +1679,6 @@ FluxboxWindow *Fluxbox::searchGroup(Window window, FluxboxWindow *win) { | |||
1716 | return it == groupSearch.end() ? 0 : it->second; | 1679 | return it == groupSearch.end() ? 0 : it->second; |
1717 | } | 1680 | } |
1718 | 1681 | ||
1719 | |||
1720 | Basemenu *Fluxbox::searchMenu(Window window) { | ||
1721 | std::map<Window, Basemenu *>::iterator it = menuSearch.find(window); | ||
1722 | return it == menuSearch.end() ? 0 : it->second; | ||
1723 | } | ||
1724 | |||
1725 | |||
1726 | Toolbar *Fluxbox::searchToolbar(Window window) { | ||
1727 | std::map<Window, Toolbar *>::iterator it = toolbarSearch.find(window); | ||
1728 | return it == toolbarSearch.end() ? 0 : it->second; | ||
1729 | } | ||
1730 | |||
1731 | Tab *Fluxbox::searchTab(Window window) { | 1682 | Tab *Fluxbox::searchTab(Window window) { |
1732 | std::map<Window, Tab *>::iterator it = tabSearch.find(window); | 1683 | std::map<Window, Tab *>::iterator it = tabSearch.find(window); |
1733 | return it == tabSearch.end() ? 0 : it->second; | 1684 | return it == tabSearch.end() ? 0 : it->second; |
@@ -1751,17 +1702,6 @@ void Fluxbox::saveGroupSearch(Window window, FluxboxWindow *data) { | |||
1751 | groupSearch[window] = data; | 1702 | groupSearch[window] = data; |
1752 | } | 1703 | } |
1753 | 1704 | ||
1754 | |||
1755 | void Fluxbox::saveMenuSearch(Window window, Basemenu *data) { | ||
1756 | menuSearch[window] = data; | ||
1757 | } | ||
1758 | |||
1759 | |||
1760 | void Fluxbox::saveToolbarSearch(Window window, Toolbar *data) { | ||
1761 | toolbarSearch[window] = data; | ||
1762 | } | ||
1763 | |||
1764 | |||
1765 | void Fluxbox::saveTabSearch(Window window, Tab *data) { | 1705 | void Fluxbox::saveTabSearch(Window window, Tab *data) { |
1766 | tabSearch[window] = data; | 1706 | tabSearch[window] = data; |
1767 | } | 1707 | } |
@@ -1782,15 +1722,6 @@ void Fluxbox::removeGroupSearch(Window window) { | |||
1782 | groupSearch.erase(window); | 1722 | groupSearch.erase(window); |
1783 | } | 1723 | } |
1784 | 1724 | ||
1785 | void Fluxbox::removeMenuSearch(Window window) { | ||
1786 | menuSearch.erase(window); | ||
1787 | } | ||
1788 | |||
1789 | void Fluxbox::removeToolbarSearch(Window window) { | ||
1790 | toolbarSearch.erase(window); | ||
1791 | } | ||
1792 | |||
1793 | |||
1794 | void Fluxbox::removeTabSearch(Window window) { | 1725 | void Fluxbox::removeTabSearch(Window window) { |
1795 | tabSearch.erase(window); | 1726 | tabSearch.erase(window); |
1796 | } | 1727 | } |
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 12faaa4..1f86e50 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.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: fluxbox.hh,v 1.35 2002/12/01 13:42:07 rathnor Exp $ | 25 | // $Id: fluxbox.hh,v 1.36 2002/12/03 23:55:49 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef FLUXBOX_HH | 27 | #ifndef FLUXBOX_HH |
28 | #define FLUXBOX_HH | 28 | #define FLUXBOX_HH |
@@ -98,8 +98,6 @@ public: | |||
98 | #endif | 98 | #endif |
99 | #endif // HAVE_GETPID | 99 | #endif // HAVE_GETPID |
100 | 100 | ||
101 | Basemenu *searchMenu(Window); | ||
102 | |||
103 | FluxboxWindow *searchGroup(Window, FluxboxWindow *); | 101 | FluxboxWindow *searchGroup(Window, FluxboxWindow *); |
104 | FluxboxWindow *searchWindow(Window); | 102 | FluxboxWindow *searchWindow(Window); |
105 | inline FluxboxWindow *getFocusedWindow() { return focused_window; } | 103 | inline FluxboxWindow *getFocusedWindow() { return focused_window; } |
@@ -110,7 +108,6 @@ public: | |||
110 | inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; } | 108 | inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; } |
111 | inline const Time &getLastTime() const { return last_time; } | 109 | inline const Time &getLastTime() const { return last_time; } |
112 | 110 | ||
113 | Toolbar *searchToolbar(Window w); | ||
114 | Tab *searchTab(Window); | 111 | Tab *searchTab(Window); |
115 | 112 | ||
116 | /// obsolete | 113 | /// obsolete |
@@ -142,15 +139,11 @@ public: | |||
142 | void saveMenuFilename(const char *); | 139 | void saveMenuFilename(const char *); |
143 | void saveTitlebarFilename(const char *); | 140 | void saveTitlebarFilename(const char *); |
144 | void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); } | 141 | void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); } |
145 | void saveMenuSearch(Window, Basemenu *); | ||
146 | void saveWindowSearch(Window, FluxboxWindow *); | 142 | void saveWindowSearch(Window, FluxboxWindow *); |
147 | void saveToolbarSearch(Window, Toolbar *); | ||
148 | void saveTabSearch(Window, Tab *); | 143 | void saveTabSearch(Window, Tab *); |
149 | void saveGroupSearch(Window, FluxboxWindow *); | 144 | void saveGroupSearch(Window, FluxboxWindow *); |
150 | void save_rc(); | 145 | void save_rc(); |
151 | void removeMenuSearch(Window); | ||
152 | void removeWindowSearch(Window); | 146 | void removeWindowSearch(Window); |
153 | void removeToolbarSearch(Window); | ||
154 | void removeTabSearch(Window); | 147 | void removeTabSearch(Window); |
155 | void removeGroupSearch(Window); | 148 | void removeGroupSearch(Window); |
156 | void restart(const char * = 0); | 149 | void restart(const char * = 0); |
@@ -237,8 +230,6 @@ private: | |||
237 | 230 | ||
238 | std::map<Window, FluxboxWindow *> windowSearch; | 231 | std::map<Window, FluxboxWindow *> windowSearch; |
239 | std::map<Window, FluxboxWindow *> groupSearch; | 232 | std::map<Window, FluxboxWindow *> groupSearch; |
240 | std::map<Window, Basemenu *> menuSearch; | ||
241 | std::map<Window, Toolbar *> toolbarSearch; | ||
242 | typedef std::map<Window, Tab *> TabList; | 233 | typedef std::map<Window, Tab *> TabList; |
243 | TabList tabSearch; | 234 | TabList tabSearch; |
244 | 235 | ||