summaryrefslogtreecommitdiffstats
path: root/lib/e17/ecore/event.rb
blob: 56b5c69ec7fde49e2fc6a16210fecd9ac26b31e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'e17/ffi_helper'
#
module E17
    module ECORE
        #
        extend FFIHelper
        extend FFI::Library
        #
        ffi_lib 'ecore'
        #
#        enum :ecore_signals, [:none,0,:signal_user,:signal_hup,:signal_exit,:signal_power,:signal_realtime]
        EVENT_NONE = 0
        EVENT_SIGNAL_USER     = 1 # User signal event
        EVENT_SIGNAL_HUP      = 2 # Hup signal event
        EVENT_SIGNAL_EXIT     = 3 # Exit signal event
        EVENT_SIGNAL_POWER    = 4 # Power signal event
        EVENT_SIGNAL_REALTIME = 5 # Realtime signal event
        EVENT_COUNT = 6
        #
        typedef :pointer, :ecore_event
        typedef :pointer, :ecore_event_filter
        typedef :pointer, :ecore_event_handler
        #
        callback :ecore_end_cb, [:pointer, :pointer], :void
        callback :ecore_data_cb, [:pointer], :pointer
        callback :ecore_filter_cb, [:pointer, :pointer, :int, :pointer], :bool
        callback :ecore_event_handler_cb, [:pointer, :int, :pointer], :bool
        #
        fcts = [
            # http://docs.enlightenment.org/auto/ecore/group__Ecore__Event__Group.html
            [ :ecore_event_handler_add, [:int, :ecore_event_handler_cb, :pointer], :ecore_event_handler],
            [ :ecore_event_handler_del, [:ecore_event_handler], :pointer],
            [ :ecore_event_add, [:int, :pointer, :ecore_end_cb, :pointer], :ecore_event],
            [ :ecore_event_del, [:ecore_event], :pointer],
            [ :ecore_event_handler_data_get, [:ecore_event_handler], :pointer],
            [ :ecore_event_handler_data_set, [:ecore_event_handler, :pointer], :pointer],
            [ :ecore_event_type_new, [], :int],
            [ :ecore_event_filter_add, [:ecore_data_cb, :ecore_filter_cb, :ecore_end_cb, :pointer], :ecore_event_filter],
            [ :ecore_event_filter_del, [:ecore_event_filter], :pointer],
            [ :ecore_event_current_type_get, [], :int],
            [ :ecore_event_current_event_get, [], :pointer],
        ]
        #
        attach_fcts fcts
        #
        create_aliases 'ecore_'.length, fcts
        #
    end
end
#
# EOF