Module: gtk-common Synopsis: Manually coded additions to the automatic translation. Author: Andy Armstrong Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Type coercion functions define macro gtk-type-cast-function-definer { define gtk-type-cast-function ?name:name => ?type:name } => { define inline function ?name (pointer :: ) => (object :: ?type) pointer-cast(?type, pointer) end } end macro gtk-type-cast-function-definer; define gtk-type-cast-function GTK-OBJECT => ; define gtk-type-cast-function GTK-CONTAINER => ; define gtk-type-cast-function GTK-BOX => ; define gtk-type-cast-function GTK-WIDGET => ; define gtk-type-cast-function GTK-ADJUSTMENT => ; define gtk-type-cast-function GTK-FIXED => ; define gtk-type-cast-function GTK-WINDOW => ; define gtk-type-cast-function GTK-DRAWING-AREA => ; /// Useful functions define function initialize-gtk () => () let name = application-name(); with-c-string (string = name) let string* = make(, element-count: 1); string*[0] := string; let string** = make(); string**[0] := string*; let int* = make(); int*[0] := 1; gtk-init(int*, string**); destroy(string*); destroy(string**); destroy(int*) end end function initialize-gtk; define method gtk-signal-connect* (object :: , name :: , func :: , func_data :: ) => (value) with-c-string (string = name) gtk-signal-connect(object, string, func, func_data) end end method gtk-signal-connect*; define method gtk-signal-connect-object* (object :: , name :: , func :: , slot_object :: ) => (value) with-c-string (string = name) gtk-signal-connect-object(object, string, func, slot_object) end end method gtk-signal-connect-object*;