RE: [Java-gnome-developer] GnomeCanvasPoints
Brought to you by:
afcowie
From: Brad B. <br...@co...> - 2001-08-29 00:59:42
|
Thanks for the quick reply. I started my attemp at implementing the GnomeCanvas* methods/functions but I have a couple questions. First: I started by studying the src/gnome.defs file and saw that in cases where the gnome C api stated things such as: void gnome_color_picker_get_d (GnomeColorPicker *cp, gdouble *r, gdouble *g, gdouble *b, gdouble *a); There were corresponding function definitions in src/gnome.defs like: (define-func gnome_color_picker_get_d none ((GnomeColorPicker cp) (double* r) (double* g) (double* b) (double* a))) and the src/tools/JNIProps.txt file the double*.javaType definition is: double*.javaType: double[] double*.nativeType: jdoubleArray double*.nativeUnwrap: \ gdouble *$TO = \ . . . This leads me to believe that double* is converted to an array of doubles, but I thought the in C when the statement "gdouble *r" ment a pointer to a thing that is of type gdouble. I realize that's the values to this function will also hold the results, but to my understanding there not arrays being passed in (at least not in the C api). Now as I understand it in Java things like int, double, etc... are not real Objects so they are passed by value rather than by reference therefore they will not to hold the return values. So I was wondering if instead of the corresponding arguments in Java for methods/functions like this shouldn't be: void getD(Double r, Double g, Double b, Double a) where "Double r, Double g,..." are the Object types of these value intstead of: void getD(double[] r, double[] g, double[] b, double[] a) where they are arrays of the simple variable types. (Are they arrays to turn them into Objects so that they can be passed by value and hence get the return value?) Let me know if I'm completely off base here, and point me to the proper documentation if so. The next thing is (much simpler question), assuming I'm wrong about the above stuff, all I need to do for the GnomeCavas* methods/functions is something like this in the src/gnome.defs file: (define-func gnome_canvas_get_scroll_region none ((GnomeCanvas canvas) (double* x1) (double* y1) (double* x2) (double* y2))) where the C api looks like: void gnome_canvas_get_scroll_region (GnomeCanvas *canvas, double *x1, double *y1, double *x2, double *y2); Brad On Tue, 2001-08-28 at 05:49, Jeffrey Morgan wrote: > Brad, > > Here are some pointers to help you get started. The bindings > can be extended in four ways. The are: > > 1) The first is adding entries to the defs files located > in src/defs directory. The entries in these files drive > what the code generator creates. > > 2) The next way to extend the bindings is to make new > entries in the src/tools/JNIProps.txt file. This file > helps determine how the code is generated. You can > define new types in this file and then use them in > the defs files. > > 3) The third way to extend the bindings is to write > the code by hand. This is necessary when you run into > a situation that the generator cannot handle even by > extending the bindings with the first two techniques. > You add manual code to generated classes by adding > files into the src/code/jni directories. The code > in the java directory is added to the end of the generated > java files and the code in the glue directory is added > to the end of the generated native code. > > 4) The final way to extend the bindings is to write > new classes and native code which are not a part of the > code generation process. These files are placed in the > src/other directory and must be added to the Makefile > to ensure they are part of the build. > > Any help you could provide would be greatly appreciated. > > -Jeff > > > > > Priority? No, not really. It just seems that they are some very nice > > gui tools that can accomplish some cool things. I'll download the > > lastest cvs snapshot and see if I can help work on them. > > Thanks for the > > timely reply. > > > > Brad > > > > On Mon, 2001-08-27 at 05:51, Jeffrey Morgan wrote: > > > I am sorry to say that the Canvas classes are incomplete. > > > If this is a priority for you then I can possibly place > > > it on my schedule to work on after I release 0.7.0 in > > > about two weeks. > > > > > > -Jeff > > > > > > > > > > > Hi, > > > > Does anyone know what to use the GnomeCanasePoints class? Are the > > > > various canvas classes fully implemented yet? I've just > > > > starting to use > > > > the java-gnome stuff and so far it's seem to work great (I > > > > went through > > > > the tutorials). I'm also interest in the gnome-canvas > > class but can't > > > > seem to get them to work. I've been trying to convert a > > tutorial I > > > > found at IBM to java-gnome, but I can't figure out how to use the > > > > GnomeCanvasPoints stuff. If I get the program going I'll > > > > post it here. > > > > (Every little bit helps right?) > > > > > > > > You guys are doing some great work here. > > > > > > > > Thanks > > > > Brad > > > > > > > > > > > > _______________________________________________ > > > > java-gnome-developer mailing list > > > > jav...@li... > > > > http://lists.sourceforge.net/lists/listinfo/java-gnome-developer > > > > > > > > |