Compare commits

...

31 Commits

Author SHA1 Message Date
Sergey Cherepanov ea89ff33a4 Add missing backslash in examples/Makefile.am. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 7f0336f538 Add GTK+ examples to examples/Makefile.am. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 78aef417bd Update hello-world.scm. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 7146e4176a Add wrapper for gtk_main_quit(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 1a4748717f Add prototype for signal handlers in Scheme. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov ecb505efa6 Add requirement for gobject.la. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov ebdbd5eb13 Add minimal infrastructure for GObject. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 3c42f1ed3b Add checks for GObject. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 5a4ea5dd5c Change P_Gtk_Window_New() to use Symbols_To_Bits(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 90eb17ce78 Fix coding style in gtkmain.c. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov c4c11e6896 Update examples/gtk/hello-world.scm. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov bdfcc5fbfc Add missing registration of wrapper for gtk_widget_show_all(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov d546ac8de3 Add wrapper for gtk_window_set_title(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov fd710559e0 Add wrapper for gtk_widow_new(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 8c45a1ac20 Add infrastructure for wrappers for gtkwindow.h. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 15206a21c7 Add wrapper for gtk_widget_show_all(). 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 4b150c5f7c Add new type: gtk-widget. It represents pointer to GtkWidget. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 79bfa12850 Add C_LINKAGE_BEGIN/C_LINKAGE_END to gtk.h. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 81fea964d9 Add infrastructure for wrappers for gtkwidget.h. 2022-08-17 13:45:58 +03:00
Sergey Cherepanov 388ef489be Add wrappers for gtk_init() and gtk_main(). 2022-08-17 13:45:57 +03:00
Sergey Cherepanov ad005e9685 Add infrastructure for wrappers for gtkmain.h. 2022-08-17 13:45:57 +03:00
Sergey Cherepanov 2b274dd53d Add hello-world.scm for testing GTK+ and GLib wrappers. 2022-08-17 13:45:57 +03:00
Sergey Cherepanov 6f916c8f44 Add minimal infrastructure for GTK+ extension. 2022-08-17 13:45:57 +03:00
Sergey Cherepanov 9fadb39f43 Add checks for GTK+. 2022-08-17 13:45:57 +03:00
Sam Hocevar 1bc7688bf2 Add missing svn:ignore properties. 2022-08-17 13:45:57 +03:00
Sam Hocevar a81ba72333 * No longer version-control autotools. 2022-08-17 13:45:57 +03:00
Sam Hocevar c57110f07a * Ask SVN to ignore the .dirstamp entry. 2022-08-17 13:45:57 +03:00
Sam Hocevar 09e9225969 * Ignore the INSTALL file. 2022-08-17 13:45:57 +03:00
Sam Hocevar 30b223207e * Made SVN ignore temporary files. 2022-08-17 13:45:57 +03:00
Sam Hocevar ba34d768dc * Hide elk.exe from SVN, now that the cygwin and mingw32 ports work. 2022-08-17 13:45:57 +03:00
Sam Hocevar 920be7acf3 * Proper svn:ignore properties. 2022-08-17 13:45:57 +03:00
15 changed files with 540 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -1 +1 @@
SUBDIRS = misc unix xlib xwidgets SUBDIRS = gobject gtk misc unix xlib xwidgets

22
lib/gobject/Makefile.am Normal file
View File

@ -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@

60
lib/gobject/closure.c Normal file
View File

@ -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;
}

41
lib/gobject/gobject.h Normal file
View File

@ -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

36
lib/gobject/init.c Normal file
View File

@ -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"));
}

44
lib/gobject/signal.c Normal file
View File

@ -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);
}

23
lib/gtk/Makefile.am Normal file
View File

@ -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@

53
lib/gtk/gtk.h Normal file
View File

@ -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

68
lib/gtk/gtkmain.c Normal file
View File

@ -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);
}

73
lib/gtk/gtkwidget.c Normal file
View File

@ -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);
}

52
lib/gtk/gtkwindow.c Normal file
View File

@ -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);
}

41
lib/gtk/init.c Normal file
View File

@ -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"));
}