Skip to content

Commit

Permalink
Add wrapper for EventControllerLegacy
Browse files Browse the repository at this point in the history
  • Loading branch information
bog-dan-ro committed Jun 18, 2021
1 parent 5ea4810 commit 0148518
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions gtk/gtkmm/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ gtkmm_any_hg_ccg_basenames = [
'eventcontroller',
'eventcontrollerfocus',
'eventcontrollerkey',
'eventcontrollerlegacy',
'eventcontrollermotion',
'eventcontrollerscroll',
'expander',
Expand Down
18 changes: 18 additions & 0 deletions gtk/src/eventcontrollerlegacy.ccg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright (C) 2021 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#include <gtk/gtk.h>

53 changes: 53 additions & 0 deletions gtk/src/eventcontrollerlegacy.hg
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* Copyright (C) 2021 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#include <gtkmm/eventcontroller.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/eventcontroller_p.h)

namespace Gtk
{
class GTKMM_API Widget;

/** Event controller that provides raw access to the event stream.
*
* %Gtk::EventControllerLegacy is an event controller that provides raw
* access to the event stream.
*
* It should only be used as a last resort if none of the other event
* controllers or gestures do the job.
*
* @newin{4,3}
*
* @ingroup Gestures
*/
class GTKMM_API EventControllerLegacy : public EventController
{
_CLASS_GOBJECT(EventControllerLegacy, GtkEventControllerLegacy, GTK_EVENT_CONTROLLER_LEGACY, EventController, GtkEventController, , , GTKMM_API)

protected:
_CTOR_DEFAULT

public:
_WRAP_CREATE()

// no_default_handler because GtkEventControllerLegacyClass is private.
#m4 _CONVERSION(`GdkEvent*',`const Glib::RefPtr<const Gdk::Event>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(bool event(const Glib::RefPtr<const Gdk::Event>& event), "event", no_default_handler)
};

} // namespace Gtk
11 changes: 11 additions & 0 deletions gtk/src/gtk_signals.defs
Original file line number Diff line number Diff line change
Expand Up @@ -4185,6 +4185,17 @@
(flags "Run Last")
)

;; From GtkEventControllerLegacy

(define-signal event
(of-object "GtkEventControllerLegacy")
(return-type "gboolean")
(flags "Run Last")
(parameters
'("GdkEvent*" "p0")
)
)

;; From GtkEventControllerMotion

(define-signal enter
Expand Down
1 change: 1 addition & 0 deletions tools/extra_defs_gen/generate_defs_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ int main(int /* argc */, char** /* argv */)
<< get_defs( GTK_TYPE_EVENT_CONTROLLER )
<< get_defs( GTK_TYPE_EVENT_CONTROLLER_FOCUS )
<< get_defs( GTK_TYPE_EVENT_CONTROLLER_KEY )
<< get_defs( GTK_TYPE_EVENT_CONTROLLER_LEGACY )
<< get_defs( GTK_TYPE_EVENT_CONTROLLER_MOTION )
<< get_defs( GTK_TYPE_EVENT_CONTROLLER_SCROLL )
<< get_defs( GTK_TYPE_EXPANDER )
Expand Down

0 comments on commit 0148518

Please sign in to comment.