This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch to make guile-gtk work with upcoming guile-1.4


The below patch makes guile-gtk compile and run the calc.scm test
program when building against guile-1.3.5pre2 (the upcoming guile-1.4).
The patch is relative to current CVS guile-gtk. I suggest folding it
into guile-gtk after guile-1.4 is released.  (It should be tested more
thoroughly, too, of course.)

Thanks,
Greg

Sun Jun 18 18:59:41 2000  Greg J. Badros  <gjb@cs.washington.edu>

        * guile-gtk.c: Updated for guile-1.4 which is about to be
        released.  Change scm_newsmob(..) to scm_make_smob_type_mfpe(..)
        calls.

Index: guile-gtk.c
===================================================================
RCS file: /cvs/gnome/gnome-guile/guile-gtk/guile-gtk.c,v
retrieving revision 1.48
diff -u -p -r1.48 guile-gtk.c
--- guile-gtk.c	2000/05/16 20:18:53	1.48
+++ guile-gtk.c	2000/06/19 02:02:55
@@ -558,13 +558,6 @@ gtkobj_free (SCM obj)
   return sizeof (sgtk_object_proxy);
 }
 
-struct scm_smobfuns gtkobj_smob = {
-  gtkobj_mark,
-  gtkobj_free,
-  gtkobj_print,
-  NULL
-};
-
 /* Treating GtkObject proxies right during GC.  We need to run custom
    code during the mark phase of the Scheme GC.  We do this by
    creating a new smob type and allocating one actual smob of it.
@@ -648,13 +641,6 @@ gtkobj_marker_hook_print (SCM obj, SCM p
   return 1;
 }
 
-struct scm_smobfuns gtkobj_marker_hook_smob = {
-  gtkobj_marker_hook,
-  NULL,
-  gtkobj_marker_hook_print,
-  NULL
-};
-
 static void
 install_marker_hook ()
 {
@@ -1033,13 +1019,6 @@ boxed_print (SCM exp, SCM port, scm_prin
   return 1;
 }
 
-struct scm_smobfuns boxed_smob = {
-  scm_mark0,
-  boxed_free,
-  boxed_print,
-  NULL
-};
-
 SCM
 sgtk_boxed2scm (gpointer ptr, sgtk_boxed_info *info, int copyp)
 {
@@ -1275,13 +1254,6 @@ gtktype_equalp (SCM obj1, SCM obj2)
   return GTKTYPE (obj1) == GTKTYPE (obj2)? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-struct scm_smobfuns gtktype_smob = {
-  scm_mark0,
-  scm_free0,
-  gtktype_print,
-  gtktype_equalp
-};
-
 GtkType
 sgtk_type_from_name (char *name)
 {
@@ -1351,13 +1323,6 @@ illobj_print (SCM obj, SCM port, scm_pri
   return 1;
 }
 
-struct scm_smobfuns illobj_smob = {
-  scm_mark0,
-  scm_free0,
-  illobj_print,
-  NULL
-};
-
 static SCM
 sgtk_make_illegal_type_object (GtkType type)
 {
@@ -2652,11 +2617,40 @@ SCM_SYMBOL (sym_gtk_version, "gtk-1.3");
 static void
 sgtk_init_substrate (void)
 {
-  tc16_gtkobj_marker_hook = scm_newsmob (&gtkobj_marker_hook_smob);
-  tc16_gtkobj = scm_newsmob (&gtkobj_smob);
-  tc16_boxed = scm_newsmob (&boxed_smob);
-  tc16_gtktype = scm_newsmob (&gtktype_smob);
-  tc16_illobj = scm_newsmob (&illobj_smob);
+  tc16_gtkobj_marker_hook = scm_make_smob_type_mfpe("gtkobj_marker_hook",
+                                                    sizeof(sgtk_object_proxy),
+                                                    gtkobj_marker_hook,
+                                                    NULL,
+                                                    gtkobj_marker_hook_print,
+                                                    NULL);
+
+  tc16_gtkobj = scm_make_smob_type_mfpe("gtkobj",
+                                        sizeof(sgtk_object_proxy),
+                                        gtkobj_mark,
+                                        gtkobj_free,
+                                        gtkobj_print,
+                                        NULL);
+
+  tc16_boxed = scm_make_smob_type_mfpe("gtkboxed",
+                                       sizeof(sgtk_boxed_info),
+                                       scm_mark0,
+                                       boxed_free,
+                                       boxed_print,
+                                       NULL);
+
+  tc16_gtktype = scm_make_smob_type_mfpe("gtktype",
+                                         sizeof(sgtk_type_info),
+                                         scm_mark0,
+                                         scm_free0,
+                                         gtktype_print,
+                                         gtktype_equalp);
+
+  tc16_illobj = scm_make_smob_type_mfpe("gtkillobj",
+                                        sizeof(GtkType),
+                                        scm_mark0,
+                                        scm_free0,
+                                        illobj_print,
+                                        NULL);
 
   global_protects = NULL;
   sgtk_protshell_chunk = g_mem_chunk_create (sgtk_protshell, 128,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]