Debian Codegraph @

examples/book/events/mouse/examplewindow.h

raw
1 /* gtkmm example Copyright (C) 2024 gtkmm development team
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #ifndef GTKMM_EXAMPLEWINDOW_H
18 #define GTKMM_EXAMPLEWINDOW_H
19
20 #include <gtkmm.h>
21
22 class ExampleWindow : public Gtk::Window
23 {
24 public:
25 ExampleWindow();
26 ~ExampleWindow() override;
27
28 private:
29 // Signal handlers:
30 void on_window_mouse_pressed(int n_press, double x, double y);
31 void on_first_button_mouse_pressed(int n_press, double x, double y);
32 void on_second_button_mouse_pressed(int n_press, double x, double y);
33 void on_third_button_mouse_pressed(int n_press, double x, double y);
34 void on_third_button_clicked();
35 void on_mouse_released(int n_press, double x, double y);
36 void on_mouse_motion(double x, double y);
37 bool on_mouse_scroll(double dx, double dy);
38 bool on_key_pressed(guint keyval, guint keycode, Gdk::ModifierType state);
39
40 Gtk::Box m_box;
41 Gtk::CheckButton m_first;
42 Gtk::CheckButton m_second;
43 Gtk::Button m_third;
44
45 Glib::RefPtr<Gtk::GestureClick> m_window_click;
46 Glib::RefPtr<Gtk::GestureClick> m_first_button_click;
47 Glib::RefPtr<Gtk::GestureClick> m_second_button_click;
48 };
49
50 #endif //GTKMM_EXAMPLEWINDOW_H