Compare commits
	
		
			31 Commits
		
	
	
		
			master
			...
			s-cherepan
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						ea89ff33a4 | |
| 
							
							
								 | 
						7f0336f538 | |
| 
							
							
								 | 
						78aef417bd | |
| 
							
							
								 | 
						7146e4176a | |
| 
							
							
								 | 
						1a4748717f | |
| 
							
							
								 | 
						ecb505efa6 | |
| 
							
							
								 | 
						ebdbd5eb13 | |
| 
							
							
								 | 
						3c42f1ed3b | |
| 
							
							
								 | 
						5a4ea5dd5c | |
| 
							
							
								 | 
						90eb17ce78 | |
| 
							
							
								 | 
						c4c11e6896 | |
| 
							
							
								 | 
						bdfcc5fbfc | |
| 
							
							
								 | 
						d546ac8de3 | |
| 
							
							
								 | 
						fd710559e0 | |
| 
							
							
								 | 
						8c45a1ac20 | |
| 
							
							
								 | 
						15206a21c7 | |
| 
							
							
								 | 
						4b150c5f7c | |
| 
							
							
								 | 
						79bfa12850 | |
| 
							
							
								 | 
						81fea964d9 | |
| 
							
							
								 | 
						388ef489be | |
| 
							
							
								 | 
						ad005e9685 | |
| 
							
							
								 | 
						2b274dd53d | |
| 
							
							
								 | 
						6f916c8f44 | |
| 
							
							
								 | 
						9fadb39f43 | |
| 
							
							
								 | 
						1bc7688bf2 | |
| 
							
							
								 | 
						a81ba72333 | |
| 
							
							
								 | 
						c57110f07a | |
| 
							
							
								 | 
						09e9225969 | |
| 
							
							
								 | 
						30b223207e | |
| 
							
							
								 | 
						ba34d768dc | |
| 
							
							
								 | 
						920be7acf3 | 
							
								
								
									
										10
									
								
								configure.ac
								
								
								
								
							
							
						
						
									
										10
									
								
								configure.ac
								
								
								
								
							| 
						 | 
					@ -567,6 +567,13 @@ fi
 | 
				
			||||||
AC_MSG_RESULT([${ac_cv_my_have_groff}])
 | 
					AC_MSG_RESULT([${ac_cv_my_have_groff}])
 | 
				
			||||||
AM_CONDITIONAL(HAVE_GROFF, test "${ac_cv_my_have_groff}" = "yes")
 | 
					AM_CONDITIONAL(HAVE_GROFF, test "${ac_cv_my_have_groff}" = "yes")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PKG_CHECK_MODULES(GTK, gtk+-2.0, ac_cv_my_have_gtk=yes, ac_cv_my_have_gtk=no)
 | 
				
			||||||
 | 
					AM_CONDITIONAL(HAVE_GTK, test "${ac_cv_my_have_gtk}" = "yes")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if test "${ac_cv_my_have_gtk}" = "yes"; then
 | 
				
			||||||
 | 
					PKG_CHECK_MODULES(GOBJECT, gobject-2.0, ac_cv_my_have_gobject=yes, ac_cv_my_have_gobject=no)
 | 
				
			||||||
 | 
					AM_CONDITIONAL(HAVE_GOBJECT, test "${ac_cv_my_have_gobject}" = "yes")
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dnl
 | 
					dnl
 | 
				
			||||||
dnl  Finished!
 | 
					dnl  Finished!
 | 
				
			||||||
| 
						 | 
					@ -589,6 +596,8 @@ AC_CONFIG_FILES([
 | 
				
			||||||
  examples/Makefile
 | 
					  examples/Makefile
 | 
				
			||||||
  include/Makefile
 | 
					  include/Makefile
 | 
				
			||||||
  lib/Makefile
 | 
					  lib/Makefile
 | 
				
			||||||
 | 
					  lib/gobject/Makefile
 | 
				
			||||||
 | 
					  lib/gtk/Makefile
 | 
				
			||||||
  lib/misc/Makefile
 | 
					  lib/misc/Makefile
 | 
				
			||||||
  lib/unix/Makefile
 | 
					  lib/unix/Makefile
 | 
				
			||||||
  lib/xlib/Makefile
 | 
					  lib/xlib/Makefile
 | 
				
			||||||
| 
						 | 
					@ -618,6 +627,7 @@ libgdbm support: ${ac_cv_my_have_gdbm}
 | 
				
			||||||
X11 support: ${ac_cv_my_have_x11}
 | 
					X11 support: ${ac_cv_my_have_x11}
 | 
				
			||||||
Xaw support: ${ac_cv_my_have_xaw}
 | 
					Xaw support: ${ac_cv_my_have_xaw}
 | 
				
			||||||
Motif support: ${ac_cv_my_have_motif}
 | 
					Motif support: ${ac_cv_my_have_motif}
 | 
				
			||||||
 | 
					GTK+ support: ${ac_cv_my_have_gtk}
 | 
				
			||||||
build documentation: ${ac_cv_my_have_groff}
 | 
					build documentation: ${ac_cv_my_have_groff}
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,3 +102,8 @@ motif_DATA = \
 | 
				
			||||||
	motif/selection-box.scm \
 | 
						motif/selection-box.scm \
 | 
				
			||||||
	$(NULL)
 | 
						$(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gtkdir = $(examplesdir)/gtk
 | 
				
			||||||
 | 
					gtk_DATA = \
 | 
				
			||||||
 | 
						gtk/hello-world.scm \
 | 
				
			||||||
 | 
						$(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					;;; -*-Scheme-*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(require 'gtk.la)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(gtk-init (command-line-args))
 | 
				
			||||||
 | 
					(define window (gtk-window-new 'gtk-window-toplevel))
 | 
				
			||||||
 | 
					(gtk-window-set-title window "Hello, World!")
 | 
				
			||||||
 | 
					(define callback (lambda args (gtk-main-quit)))
 | 
				
			||||||
 | 
					(g-signal-connect window "destroy" callback)
 | 
				
			||||||
 | 
					(gtk-widget-show-all window)
 | 
				
			||||||
 | 
					(gtk-main)
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
SUBDIRS = misc unix xlib xwidgets
 | 
					SUBDIRS = gobject gtk misc unix xlib xwidgets
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					NULL = 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					lib_LTLIBRARIES = $(libelk_gobject_la)
 | 
				
			||||||
 | 
					pkglib_LTLIBRARIES = $(gobject_la)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if HAVE_GOBJECT
 | 
				
			||||||
 | 
					libelk_gobject_la = libelk-gobject.la
 | 
				
			||||||
 | 
					gobject_la = gobject.la
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					libelk_gobject_la_SOURCES = \
 | 
				
			||||||
 | 
						closure.c \
 | 
				
			||||||
 | 
						signal.c \
 | 
				
			||||||
 | 
						$(NULL)
 | 
				
			||||||
 | 
					libelk_gobject_la_CFLAGS = @GOBJECT_CFLAGS@
 | 
				
			||||||
 | 
					libelk_gobject_la_LDFLAGS = -no-undefined
 | 
				
			||||||
 | 
					libelk_gobject_la_LIBADD = $(top_builddir)/src/libelk.la @GOBJECT_LIBS@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gobject_la_SOURCES = init.c
 | 
				
			||||||
 | 
					gobject_la_CFLAGS = @GOBJECT_CFLAGS@
 | 
				
			||||||
 | 
					gobject_la_LDFLAGS = -module -avoid-version -no-undefined
 | 
				
			||||||
 | 
					gobject_la_LIBADD = $(top_builddir)/src/libelk.la libelk-gobject.la @GOBJECT_LIBS@
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,60 @@
 | 
				
			||||||
 | 
					/* closure.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gobject.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef struct _ElkClosure ElkClosure;
 | 
				
			||||||
 | 
					struct _ElkClosure {
 | 
				
			||||||
 | 
					    GClosure closure;
 | 
				
			||||||
 | 
					    Object callback;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void elk_closure_finalize (gpointer notify_data, GClosure *closure)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void elk_closure_marshal (GClosure *closure, GValue *return_value,
 | 
				
			||||||
 | 
					                                 guint n_param_values,
 | 
				
			||||||
 | 
					                                 const GValue *param_values,
 | 
				
			||||||
 | 
					                                 gpointer invocation_hint,
 | 
				
			||||||
 | 
					                                 gpointer marshal_data) {
 | 
				
			||||||
 | 
					    Funcall (((ElkClosure *)closure)->callback, Null, 0);
 | 
				
			||||||
 | 
					    if (return_value)
 | 
				
			||||||
 | 
					        g_value_init (return_value, G_TYPE_NONE);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GClosure *elk_closure_new (Object callback) {
 | 
				
			||||||
 | 
					    GClosure *closure = g_closure_new_simple (sizeof (ElkClosure), NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ((ElkClosure *)closure)->callback = callback;
 | 
				
			||||||
 | 
					    g_closure_add_finalize_notifier (closure, NULL, elk_closure_finalize);
 | 
				
			||||||
 | 
					    g_closure_set_marshal (closure, elk_closure_marshal);
 | 
				
			||||||
 | 
					    return closure;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,41 @@
 | 
				
			||||||
 | 
					/* gobject.h
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <scheme.h>
 | 
				
			||||||
 | 
					#include <glib-object.h>
 | 
				
			||||||
 | 
					#include "config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					C_LINKAGE_BEGIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GClosure *elk_closure_new (Object callback);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gobject_signal (void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					C_LINKAGE_END
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,36 @@
 | 
				
			||||||
 | 
					/* init.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gobject.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gobject_init () {
 | 
				
			||||||
 | 
					    elk_init_gobject_signal ();
 | 
				
			||||||
 | 
					    P_Provide (Intern ("gobject.la"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,44 @@
 | 
				
			||||||
 | 
					/* signal.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gobject.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_G_Signal_Connect (Object instance, Object detailed_signal, Object handler) {
 | 
				
			||||||
 | 
					    GClosure *closure;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    closure = elk_closure_new (handler);
 | 
				
			||||||
 | 
					    g_signal_connect_closure ((gpointer)Get_GtkWidget (instance),
 | 
				
			||||||
 | 
					                              Get_String (detailed_signal), closure, FALSE);
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gobject_signal () {
 | 
				
			||||||
 | 
					    Define_Primitive (P_G_Signal_Connect, "g-signal-connect", 3, 3, EVAL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,23 @@
 | 
				
			||||||
 | 
					NULL = 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					lib_LTLIBRARIES = $(libelk_gtk_la)
 | 
				
			||||||
 | 
					pkglib_LTLIBRARIES = $(gtk_la)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if HAVE_GTK
 | 
				
			||||||
 | 
					libelk_gtk_la = libelk-gtk.la
 | 
				
			||||||
 | 
					gtk_la = gtk.la
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					libelk_gtk_la_SOURCES = \
 | 
				
			||||||
 | 
						gtkmain.c \
 | 
				
			||||||
 | 
						gtkwidget.c \
 | 
				
			||||||
 | 
						gtkwindow.c \
 | 
				
			||||||
 | 
						$(NULL)
 | 
				
			||||||
 | 
					libelk_gtk_la_CFLAGS = @GTK_CFLAGS@
 | 
				
			||||||
 | 
					libelk_gtk_la_LDFLAGS = -no-undefined
 | 
				
			||||||
 | 
					libelk_gtk_la_LIBADD = $(top_builddir)/src/libelk.la @GTK_LIBS@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gtk_la_SOURCES = init.c
 | 
				
			||||||
 | 
					gtk_la_CFLAGS = @GTK_CFLAGS@
 | 
				
			||||||
 | 
					gtk_la_LDFLAGS = -module -avoid-version -no-undefined
 | 
				
			||||||
 | 
					gtk_la_LIBADD = $(top_builddir)/src/libelk.la libelk-gtk.la @GTK_LIBS@
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,53 @@
 | 
				
			||||||
 | 
					/* gtk.h
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <scheme.h>
 | 
				
			||||||
 | 
					#include <gtk/gtk.h>
 | 
				
			||||||
 | 
					#include "config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern int T_GtkWidget;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define GTKWIDGET(x)   ((struct S_GtkWidget *)POINTER(x))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct S_GtkWidget {
 | 
				
			||||||
 | 
					    Object tag;
 | 
				
			||||||
 | 
					    GtkWidget *widget;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					C_LINKAGE_BEGIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern GtkWidget *Get_GtkWidget (Object w);
 | 
				
			||||||
 | 
					extern Object Make_GtkWidget (GtkWidget *w);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern void elk_init_gtk_gtkmain (void);
 | 
				
			||||||
 | 
					extern void elk_init_gtk_gtkwidget (void);
 | 
				
			||||||
 | 
					extern void elk_init_gtk_gtkwindow (void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					C_LINKAGE_END
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,68 @@
 | 
				
			||||||
 | 
					/* gtkmain.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gtk.h"
 | 
				
			||||||
 | 
					#include "intern.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Init (Object args) {
 | 
				
			||||||
 | 
					    int argc;
 | 
				
			||||||
 | 
					    char **argv;
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Check_List (args);
 | 
				
			||||||
 | 
					    argc = Fast_Length (args) + 1;
 | 
				
			||||||
 | 
					    argv = (char **)Safe_Malloc (sizeof (char *) * argc);
 | 
				
			||||||
 | 
					    argv[0] = appname ? appname : "elk";
 | 
				
			||||||
 | 
					    for (i = 1; i < argc; i++) {
 | 
				
			||||||
 | 
					        Object arg = Car (args);
 | 
				
			||||||
 | 
					        Check_Type (arg, T_String);
 | 
				
			||||||
 | 
					        argv[i] = Get_String (arg);
 | 
				
			||||||
 | 
					        args = Cdr (args);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    gtk_init (&argc, &argv);
 | 
				
			||||||
 | 
					    free (argv);
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Main () {
 | 
				
			||||||
 | 
					    gtk_main ();
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Main_Quit () {
 | 
				
			||||||
 | 
					    gtk_main_quit ();
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gtk_gtkmain () {
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Init, "gtk-init", 1, 1, EVAL);
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Main, "gtk-main", 0, 0, EVAL);
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Main_Quit, "gtk-main-quit", 0, 0, EVAL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,73 @@
 | 
				
			||||||
 | 
					/* gtkwidget.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gtk.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int T_GtkWidget;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GtkWidget *Get_GtkWidget (Object w) {
 | 
				
			||||||
 | 
					    Check_Type (w, T_GtkWidget);
 | 
				
			||||||
 | 
					    return GTKWIDGET(w)->widget;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Object Make_GtkWidget (GtkWidget *w) {
 | 
				
			||||||
 | 
					    Object yield;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    yield = Alloc_Object (sizeof (struct S_GtkWidget), T_GtkWidget, 0);
 | 
				
			||||||
 | 
					    GTKWIDGET(yield)->widget = w;
 | 
				
			||||||
 | 
					    return yield;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int GtkWidget_Equal (Object x, Object y) {
 | 
				
			||||||
 | 
					    return GTKWIDGET(x)->widget == GTKWIDGET(y)->widget;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int GtkWidget_Print (Object x, Object port, int raw, int depth,
 | 
				
			||||||
 | 
					        int len) {
 | 
				
			||||||
 | 
					    Printf (port, "#[gtk-widget %lu]", (unsigned long)GTKWIDGET(x)->widget);
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object GtkWidgetp (Object x) {
 | 
				
			||||||
 | 
					    return TYPE(x) == T_GtkWidget ? True : False;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Widget_Show_All (Object w) {
 | 
				
			||||||
 | 
					    gtk_widget_show_all (Get_GtkWidget(w));
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gtk_gtkwidget () {
 | 
				
			||||||
 | 
					    T_GtkWidget = Define_Type (0, "gtk-widget", NOFUNC,
 | 
				
			||||||
 | 
					        sizeof (struct S_GtkWidget), GtkWidget_Equal, GtkWidget_Equal,
 | 
				
			||||||
 | 
					        GtkWidget_Print, NOFUNC);
 | 
				
			||||||
 | 
					    Define_Primitive (GtkWidgetp, "gtk-widget?", 1, 1, EVAL);
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Widget_Show_All, "gtk-widget-show-all", 1, 1, EVAL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,52 @@
 | 
				
			||||||
 | 
					/* gtkwindow.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include "gtk.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Window_New (Object sym) {
 | 
				
			||||||
 | 
					    SYMDESCR syms[] = {
 | 
				
			||||||
 | 
					        { "gtk-window-toplevel", GTK_WINDOW_TOPLEVEL },
 | 
				
			||||||
 | 
					        { "gtk-window-popup",    GTK_WINDOW_POPUP },
 | 
				
			||||||
 | 
					        { 0, 0 }
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return Make_GtkWidget (gtk_window_new (Symbols_To_Bits (sym, 0, syms)));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static Object P_Gtk_Window_Set_Title (Object w, Object title) {
 | 
				
			||||||
 | 
					    gtk_window_set_title (GTK_WINDOW(Get_GtkWidget(w)), Get_String(title));
 | 
				
			||||||
 | 
					    return Void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gtk_gtkwindow () {
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Window_New, "gtk-window-new", 1, 1, EVAL);
 | 
				
			||||||
 | 
					    Define_Primitive (P_Gtk_Window_Set_Title, "gtk-window-set-title", 2, 2, EVAL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,41 @@
 | 
				
			||||||
 | 
					/* init.c
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * $Id$
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin
 | 
				
			||||||
 | 
					 * Copyright 2002, 2003 Sam Hocevar <sam@hocevar.net>, Paris
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This software was derived from Elk 1.2, which was Copyright 1987, 1988,
 | 
				
			||||||
 | 
					 * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written
 | 
				
			||||||
 | 
					 * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project
 | 
				
			||||||
 | 
					 * between TELES and Nixdorf Microprocessor Engineering, Berlin).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co-
 | 
				
			||||||
 | 
					 * owners or individual owners of copyright in this software, grant to any
 | 
				
			||||||
 | 
					 * person or company a worldwide, royalty free, license to
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *    i) copy this software,
 | 
				
			||||||
 | 
					 *   ii) prepare derivative works based on this software,
 | 
				
			||||||
 | 
					 *  iii) distribute copies of this software or derivative works,
 | 
				
			||||||
 | 
					 *   iv) perform this software, or
 | 
				
			||||||
 | 
					 *    v) display this software,
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * provided that this notice is not removed and that neither Oliver Laumann
 | 
				
			||||||
 | 
					 * nor Teles nor Nixdorf are deemed to have made any representations as to
 | 
				
			||||||
 | 
					 * the suitability of this software for any purpose nor are held responsible
 | 
				
			||||||
 | 
					 * for any defects of this software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "gtk.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void elk_init_gtk_init () {
 | 
				
			||||||
 | 
					    Object sym = Intern ("gobject.la");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    P_Require (1, &sym);
 | 
				
			||||||
 | 
					    elk_init_gtk_gtkmain ();
 | 
				
			||||||
 | 
					    elk_init_gtk_gtkwidget ();
 | 
				
			||||||
 | 
					    elk_init_gtk_gtkwindow ();
 | 
				
			||||||
 | 
					    P_Provide (Intern ("gtk.la"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue