Ticket #25 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

The wrapper or the APIlookups should be updated to make gtkDgl work with tango

Reported by: kaarna Assigned to: Mike Wey
Priority: major Milestone:
Component: Addon - gl Version: TRUNK
Keywords: gtkDgl tango Cc:

Description

I tested gtkD with DSSS, GDC 0.24 and tango 0.99.4 today. gtkD compiles. Cairo demo works. demos/gtk/ all work. /demos/gtkD/ fails compiling with the errors:

../gtkD/TestDrawingArea.d:173: Error: cannot implicitly convert expression (fromString("Courier 48")) of type PangoFontDescription * to pango.PgFontDescription.PgFontDescription

That should be easy to fix. (I don't have time... :( sorry.)

gtkDgl needed some changes. I made them, and committed them to subversion. And unfortunately those are hand made changes, so they should also be made on the APIlookups or the wrapper. But, I committed this to make the svn version working. I don't really have time these days to look at the APIlookups or the wrapper. Sorry again.

The changes are basicly to remove all imports of std.stdio or similar. Remove all printfs. (They should be replaced by the same method used in gtkD to have both tango and phobos supported. Whatever that is.) Add some version(Tango) stuff for the std.gc.disable and added it's tango version tango.core.Memory.GC.disable().

Here's a diff of some sort. (Not including the changes to /demos/gl/ShapesGL.d as those changes are ofcourse OK.) Yes. This is propably the worst bug report I've ever written... Sorry. :)

Index: srcgl/gtkglc/glgtk.d =================================================================== --- srcgl/gtkglc/glgtk.d (revision 409) +++ srcgl/gtkglc/glgtk.d (working copy) @@ -25,8 +25,8 @@

module gtkglc.glgtk;

-version(Tango) private import tango.stdc.stdio; -else private import std.stdio; +//version(Tango) private import tango.stdc.stdio; +//else private import std.stdio;

private import gtkglc.glgtktypes; private import gtkc.Loader; private import gtkc.paths;

Index: srcgl/glgdk/GLConfig.d =================================================================== --- srcgl/glgdk/GLConfig.d (revision 409) +++ srcgl/glgdk/GLConfig.d (working copy) @@ -113,14 +113,14 @@

gdkGLConfig = cast(GdkGLConfig*)gdk_gl_config_new_by_mode(mode); if ( gdkGLConfig is null ) {

- printf ("*** Cannot find the double-buffered visual.\n"); - printf ("*** Trying single-buffered visual.\n"); + //printf ("*** Cannot find the double-buffered visual.\n"); + //printf ("*** Trying single-buffered visual.\n");

gdkGLConfig = cast(GdkGLConfig*)gdk_gl_config_new_by_mode(fallback);

} if ( gdkGLConfig is null ) {

- printf ("*** No appropriate OpenGL-capable visual found.\n"); - throw new Error("GL configure failed"); + //printf ("*** No appropriate OpenGL-capable visual found.\n"); + throw new Exception("GL configure failed");

} this(gdkGLConfig);

}

Index: srcgl/glgtk/GLCapability.d =================================================================== --- srcgl/glgtk/GLCapability.d (revision 409) +++ srcgl/glgtk/GLCapability.d (working copy) @@ -51,11 +51,17 @@

private import gtkglc.glgtk;

+version(Tango) +{ + import tango.core.Memory; +} +else +{ + private import std.gc; +} - -

// SNEAKY MIXIN PROBLEM: // // These need to be public imports

@@ -65,7 +71,7 @@

// May as well be explicit about it:

-public import std.stdio; +//public import std.stdio;

public import glgtk.GLWidget; private import glgdk.GLDrawable; public import gdk.Event;

@@ -238,8 +244,8 @@

return consumeEvent;

}

- private import std.gc; +

int configureFrame(GdkEventConfigure?* event, Widget widget) {

if ( event != null )

@@ -247,7 +253,16 @@

width = event.width; height = event.height;

}

- std.gc.disable(); + + version(Tango) + { + tango.core.Memory.GC.disable(); + } + else + { + std.gc.disable(); + } +

//writefln("configureFrame 1"); //printf("GLCapabilityT.configureFrame \n" ); GLContext context = GLWidget.getGLContext(widget);

@@ -284,7 +299,15 @@

//writefln("configureFrame 9"); /*** OpenGL END ***/

- std.gc.enable(); + version(Tango) + { + tango.core.Memory.GC.enable(); + } + else + { + std.gc.enable(); + } +

return consumeEvent;

}

Change History

01/21/08 15:39:53 changed by Mike Wey

There are some changes for tango support in r404, but they ate only applied to the APILookup files.

I can build a rewraped gtkDgl with tango, although importing tango.stdc.stdio to get printf might not be the best solution.

(in reply to: ↑ description ) 01/21/08 15:45:43 changed by Mike Wey

Replying to kaarna:

I tested gtkD with DSSS, GDC 0.24 and tango 0.99.4 today. gtkD compiles. Cairo demo works. demos/gtk/ all work. /demos/gtkD/ fails compiling with the errors: {{{ ../gtkD/TestDrawingArea.d:173: Error: cannot implicitly convert expression (fromString("Courier 48")) of type PangoFontDescription? * to pango.PgFontDescription?.PgFontDescription? }}} That should be easy to fix. (I don't have time... :( sorry.)

I made some changes to /demos/gtkD to reflect recent Pango changes, but those are only in the APILookup files. i might ad a rewrap later today.

01/21/08 15:47:13 changed by Mike Wey

  • owner changed from JJR to Mike Wey.
  • status changed from new to assigned.

01/21/08 16:42:56 changed by Mike Wey

r411 Adds the rewrap.

  • trunk/srcgl/glgtk/GLCapability.d looks like the rewraped file matches the hand editing.
  • trunk/srcgl/gtkglc/glgtk.d rewap adds the commented imports again, probably for the debug lines whitch are phobos only. the files in gtkc are the same in this regard.
  • trunk/srcgl/glgdk/GLConfig.d The printf's the rewrap imports tango.stdc.stdio to use printf, might be better to use writefln/Stdout.



I tested the rewarped files with two combinations: dmd 1.025 + tango 0.99.4 + DSSS 0.75 gdc 0.23 + gphobos + DSSS 0.73



I tested gtkD with DSSS, GDC 0.24 and tango 0.99.4 today.

note the problens with gdc 0.24 in ticket #4 most demos should compile after using the gdc_undefsymbol_workaround.sh only the TestWindow? demo has a problen with the char** it uses and gdc 0.24

Hopefully i won't wait to long with a rewrap next rime.

01/27/08 10:28:45 changed by Mike Wey

  • status changed from assigned to closed.
  • resolution set to fixed.

I'm closing this if you don't have any problems with the differences between the rewrapped code and the hand made changes.