1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 module gdk
is pkgconfig
"gtk+-3.0"
21 #ifdef GdkCallback_run
22 // Callback to GdkCallaback::run
23 gboolean nit_gdk_callback(gpointer user_data) {
24 GdkCallback_decr_ref(user_data);
25 return GdkCallback_run(user_data);
30 # Callback to pass to `gdk_threads_add_idle`
33 # Small unit of code executed by the GDK loop when idle
35 # Returns true if this object should be invoked again.
36 fun run
: Bool do return false
39 # Add a callback to execute whenever there are no higher priority events pending
40 fun gdk_threads_add_idle
(callback
: GdkCallback): Int import GdkCallback.run
`{
41 GdkCallback_incr_ref(callback);
42 return gdk_threads_add_idle(&nit_gdk_callback, callback);