Re: [GtkGLExt] GtkGLExt in a Mozilla plug-in



On Fri, 2004-12-03 at 12:55 +1300, Alif Wahid wrote:
> Hi Braden,
> 
> Yup, you're right. I guess the following can be derived from your code
> as well to make it slightly more elegant and efficient.
> 
> GType
> user_defined_class_get_type (void)
> {
>   static GType type = g_type_from_name("UserDefinedClass");

gcc (3.4.2) doesn't like that:

        ../../gdk/gdkglconfig.c:37: error: initializer element is not constant

The good news, though, is that this approach does indeed appear to fix
my problem. It would be great if the attached patch could be applied. It
would be even better if a new release could be made incorporating it.

> > I've tried checking GtkGLExt out of CVS and making this modification.
> > However, po/Makefile.in.in doesn't like my version of autotools. (What
> > $(mkinstalldirs) resolves to has changed in a way that is incompatible
> > with how it is used here.) What do I need to do to update this file? I
> > tried gettextize; but that added a rather large number of files that
> > didn't exist previously.
> 
> This is definitely not my area of expertise. I'm hopeless at using
> autoconf and co. Sorry, I'm not of much help here. Naofumi (project
> lead) should be able to help.

I figured it out. I needed to run glib-gettextize. But the file
"mkinstalldirs" needs to be removed from .cvsignore and added to the
repository. (Either that, or glib-gettextize needs to be called from
autogen.sh. I don't think that's what you want, since the other file it
generates--po/Makefile.in.in--is already in the repository.)

-- 
Braden McDaniel                           e-mail: <braden endoframe com>
<http://endoframe.com>                    Jabber: <braden jabber org>
Index: gdk/gdkglconfig.c
===================================================================
RCS file: /cvs/gnome/gtkglext/gdk/gdkglconfig.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 gdkglconfig.c
--- gdk/gdkglconfig.c	5 Feb 2004 09:38:36 -0000	1.1.1.1
+++ gdk/gdkglconfig.c	3 Dec 2004 02:21:22 -0000
@@ -33,10 +33,16 @@
 GType
 gdk_gl_config_get_type (void)
 {
+  static const char type_name[] = "GdkGLConfig";
   static GType type = 0;
 
   if (!type)
     {
+      type = g_type_from_name(type_name);
+    }
+
+  if (!type)
+    {
       static const GTypeInfo type_info = {
         sizeof (GdkGLConfigClass),
         (GBaseInitFunc) NULL,
@@ -50,7 +56,7 @@
       };
 
       type = g_type_register_static (G_TYPE_OBJECT,
-                                     "GdkGLConfig",
+                                     type_name,
                                      &type_info, 0);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]