From 832b55fe89deefd5790c6bc9073d33ddd269d145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Thu, 22 Jul 2010 23:45:08 +0200 Subject: [PATCH] ui.backend.gtk: only set up event sources when we are deploying with io level 3 --- basis/ui/backend/gtk/gtk.factor | 27 +++++++++++++++------------ extra/hello-ui/deploy.factor | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 4d72abdd5e..441e02a04f 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -1,17 +1,15 @@ ! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien.accessors alien.c-types alien.data -alien.strings arrays assocs classes.struct command-line destructors -gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi gtk.gl.ffi -io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel libc -literals locals math math.bitwise math.order math.vectors namespaces -sequences strings system threads ui ui.backend ui.clipboards -ui.commands ui.event-loop ui.gadgets ui.gadgets.menus -ui.gadgets.private ui.gadgets.worlds ui.gestures ui.pixel-formats -ui.pixel-formats.private ui.private ; -RENAME: windows ui.private => ui:windows -EXCLUDE: ui.gadgets.editors => change-caret ; -RENAME: change-caret ui.gadgets.editors => editors:change-caret +alien.strings arrays assocs classes.struct command-line +destructors gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi +gtk.gl.ffi io.backend io.backend.unix.multiplexers +io.encodings.utf8 io.thread kernel libc literals locals math +math.bitwise math.order math.vectors namespaces sequences +strings system threads ui ui.backend ui.clipboards ui.commands +ui.event-loop ui.gadgets ui.gadgets.editors ui.gadgets.menus +ui.gadgets.private ui.gadgets.worlds ui.gestures +ui.pixel-formats ui.pixel-formats.private ui.private ; IN: ui.backend.gtk SINGLETON: gtk-ui-backend @@ -229,7 +227,12 @@ CONSTANT: poll-fd-events mx get fd>> >>fd poll-fd-events >>events ; -: init-io-event-source ( -- ) +HOOK: init-io-event-source io-backend ( -- ) + +M: c-io-backend init-io-event-source + ; + +M: object init-io-event-source GSourceFuncs malloc-struct &free [ io-source-prepare ] GSourceFuncsPrepareFunc >>prepare [ io-source-check ] GSourceFuncsCheckFunc >>check diff --git a/extra/hello-ui/deploy.factor b/extra/hello-ui/deploy.factor index ceff9857cb..cf851f5a95 100644 --- a/extra/hello-ui/deploy.factor +++ b/extra/hello-ui/deploy.factor @@ -5,7 +5,7 @@ H{ { deploy-c-types? f } { deploy-unicode? f } { "stop-after-last-window?" t } - { deploy-io 1 } + { deploy-io 2 } { deploy-reflection 1 } { deploy-word-props? f } { deploy-math? t }