]> git.tdb.fi Git - libs/gltk.git/commitdiff
Reorder event handling functions
authorMikko Rasa <tdb@tdb.fi>
Tue, 30 Aug 2016 12:51:16 +0000 (15:51 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 30 Aug 2016 12:51:16 +0000 (15:51 +0300)
source/container.cpp
source/container.h
source/widget.h

index 21d31fb0e2af7a988159a74895cfddc863e8c536..d02cc606394298c612bd7c94142298f88ffaf708 100644 (file)
@@ -237,24 +237,6 @@ void Container::pointer_leave()
        set_pointer_focus(0);
 }
 
-void Container::key_press(unsigned key, unsigned mod)
-{
-       if(input_focus)
-               input_focus->key_press(key, mod);
-}
-
-void Container::key_release(unsigned key, unsigned mod)
-{
-       if(input_focus)
-               input_focus->key_release(key, mod);
-}
-
-void Container::character(wchar_t ch)
-{
-       if(input_focus)
-               input_focus->character(ch);
-}
-
 void Container::touch_press(int x, int y, unsigned finger)
 {
        if(Widget *child = get_pointer_target(x, y, true))
@@ -290,6 +272,24 @@ void Container::touch_motion(int x, int y, unsigned finger)
        }
 }
 
+void Container::key_press(unsigned key, unsigned mod)
+{
+       if(input_focus)
+               input_focus->key_press(key, mod);
+}
+
+void Container::key_release(unsigned key, unsigned mod)
+{
+       if(input_focus)
+               input_focus->key_release(key, mod);
+}
+
+void Container::character(wchar_t ch)
+{
+       if(input_focus)
+               input_focus->character(ch);
+}
+
 void Container::focus_out()
 {
        set_input_focus(0);
index 89e3259e3bdbf71791ed445bb3587b1e8ec80e0d..6c75e38e9625f6a17a14d69209358aa69883351a 100644 (file)
@@ -73,11 +73,11 @@ private:
        Widget *get_pointer_target(int, int, bool) const;
 public:
        virtual void pointer_leave();
-       virtual void key_press(unsigned, unsigned);
-       virtual void key_release(unsigned, unsigned);
        virtual void touch_press(int, int, unsigned);
        virtual void touch_release(int, int, unsigned);
        virtual void touch_motion(int, int, unsigned);
+       virtual void key_press(unsigned, unsigned);
+       virtual void key_release(unsigned, unsigned);
        virtual void character(wchar_t);
        virtual void focus_out();
 protected:
index 557e10153269c2290bc8c6c4e938fc95c8284874..2bf751a714f0db3a25bc45015894181fe3c96562 100644 (file)
@@ -136,12 +136,12 @@ public:
        virtual void pointer_motion(int, int) { }
        virtual void pointer_enter();
        virtual void pointer_leave();
-       virtual void key_press(unsigned, unsigned) { }
-       virtual void key_release(unsigned, unsigned) { }
-       virtual void character(wchar_t) { }
        virtual void touch_press(int, int, unsigned);
        virtual void touch_release(int, int, unsigned);
        virtual void touch_motion(int, int, unsigned);
+       virtual void key_press(unsigned, unsigned) { }
+       virtual void key_release(unsigned, unsigned) { }
+       virtual void character(wchar_t) { }
        virtual void focus_in();
        virtual void focus_out();
 protected: