/src/wrappers/glib/library/core/g_io_func.e
http://github.com/tybor/Liberty · Specman e · 56 lines · 40 code · 15 blank · 1 comment · 0 complexity · b432210cd522d60bfe7d4c5d7e4b2716 MD5 · raw file
- class G_IO_FUNC
- inherit
- C_STRUCT
- EIFFEL_OWNED
-
- create
- make
- feature {} -- Creation
- make (ch: G_IO_CHANNEL; a: like action) is
- do
- channel := ch
- action := a
- allocate
- g_io_func_closure_init (handle, to_pointer, $call)
- end
- feature -- Access
- function: POINTER is
- external "C macro use <glib-callbacks.h>"
- alias "g_io_func_closure_invoke"
- end
- data: POINTER is
- do
- Result := handle
- end
- feature {} -- Internal
- channel: G_IO_CHANNEL
- action: FUNCTION [TUPLE [G_IO_CHANNEL, INTEGER], BOOLEAN]
- call (ch: POINTER; condition: INTEGER): BOOLEAN is
- do
- -- We ignore the passed channel, it should be `channel'
- check channel.handle = ch end
- Result := action.item ([channel, condition])
- end
- feature {} -- Externals
- struct_size: INTEGER is
- external "C macro use <glib-callbacks.h>"
- alias "(sizeof (struct GIOFuncClosure))"
- end
- g_io_func_closure_init (h, self, func: POINTER) is
- external "C use <glib-callbacks.h>"
- end
- end -- class G_IO_FUNC