gtk2forpascal-devel Mailing List for gtk2 for pascal (Page 2)
Brought to you by:
mgaertner
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(30) |
Aug
(22) |
Sep
(2) |
Oct
(6) |
Nov
(8) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2004 |
Jan
|
Feb
|
Mar
(11) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mattias G. <nc-...@ne...> - 2004-03-09 18:32:25
|
On Tue, 09 Mar 2004 16:53:07 +0100 Olaf Leidinger <le...@ne...> wrote: > Hello! > > The new gtk-2.4 widgets are in cvs by now. :) Great news. It seems lazarus finally found some volunteers for the gtk2 interface, so it will be used soon. > I hope there are no bugs ;-) > > BTW: Are there many additions to GLib? Don't know. But even 20 new macros will give us headache enough. Mattias |
From: Olaf L. <le...@ne...> - 2004-03-09 16:02:35
|
Hello! The new gtk-2.4 widgets are in cvs by now. I hope there are no bugs ;-) BTW: Are there many additions to GLib? Ciao, Olaf |
From: Jeff P. <yet...@ya...> - 2003-12-31 16:48:22
|
> Could you give me an Example of a simple libglade program (just a few > lines are enough) and show me how to compile it? Have a look at this: http://site.voila.fr/yvesd/ftp/gladepp-0.1.tar.gz __________________________________ Do you Yahoo!? Find out what made the Top Yahoo! Searches of 2003 http://search.yahoo.com/top2003 |
From: Holger P. <em...@ho...> - 2003-12-31 15:21:44
|
Hi, I am currently writing on a little Pascal IDE with glade. I would like to use FreePascal and libglade, so I don't have to use C, however, it didn't work. Could you give me an Example of a simple libglade program (just a few lines are enough) and show me how to compile it? Thx, Holger |
From: Jeff P. <yet...@ya...> - 2003-12-26 14:42:22
|
Here are some additional gtk2 bindings: vte ( terminal widget - replaces zvt ) gtksourceview ( text widget w/syntax highlighting ) gtkhtml-3 ( HTML rendering/editing widget ) gdkx ( GDK interface to xlib: single-head systems ONLY ! ) Tested only on Linux/FPC Get them here: http://houston.quik.com/~jkp/gtk2/jkp-contrib.tar.gz If you like, you can include these in gtk2forpascal - Jeff __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ |
From: Mattias G. <nc-...@ne...> - 2003-06-04 17:33:41
|
Hi all, I have released a 1.0.3 tgz for gtk2forpascal. - The script mk_gtk2fpc_link_res.sh now contains all four gtk2 libs - lazarus package Mattias |
From: Mattias G. <nc-...@ne...> - 2003-03-07 14:52:11
|
Hi all, I have created a RPM of gtk2forpascal for FreePascal 1.0.7. The creation instruction and spec file can be found in the new directory 'gtk2/install'. I have also created some new scripts to make compilation of gtk2 applications under fpc much easier. Just call the script gtk2fpc instead of ppc386, and it will automatically create the needed linker resource file and add the linker options. For example: gtk2fpc yourprogram.pas will create the gtk2.link.res file and compile yourprogram. Because the rpm installs the .ppu files in the fpc lib directory, you don't even need to extend the unitpath any longer. Mattias |
From: Mattias G. <nc-...@ne...> - 2002-11-07 19:38:40
|
On Wed, 6 Nov 2002 23:00:29 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Hello, Mattias > > I attached a tar ball to this email, it's the package > of gtkhtml for gtk2forpascal. It can be used for the > simplest applications, but it's incomplete. I don't > know when I can implement the whole package, just the > dom/ directory of gtkhtml contains over 40 files to be > converted. Another thing is that libxml.so should also > be interfaced. It needs more work. So I don't decide > to complete it now. I have committed it. I did not yet have the time to test it ... Mattias |
From: <wan...@ya...> - 2002-11-06 15:00:43
|
Hello, Mattias I attached a tar ball to this email, it's the package of gtkhtml for gtk2forpascal. It can be used for the simplest applications, but it's incomplete. I don't know when I can implement the whole package, just the dom/ directory of gtkhtml contains over 40 files to be converted. Another thing is that libxml.so should also be interfaced. It needs more work. So I don't decide to complete it now. Yours, mili _________________________________________________________ Do You Yahoo!? "是IT精英吗?小试牛刀获时尚大奖!" http://cn.promo.yahoo.com/cgi-bin/udb/u |
From: Mattias G. <nc-...@ne...> - 2002-11-05 21:32:03
|
On Tue, 5 Nov 2002 21:49:48 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Hi, Mattias > > Today I solved the problem about gtkhtml-2 > programing with > gtk2forpascal. > First, you should download > "gtkhtml2-2.0.1-3.i386.rpm" and > "gtkhtml2-devel-2.0.1-3.i386.rpm" from > www.rpmfind.net. The > first one contains two shared libs. The second one > contains > many header files and "libgtkhtml-2.a" and > "libgtkhtml-2.so", > and most important, it contains a file: > "/usr/lib/pkgconfig/libgtkhtml-2.0.pc" > You can also download "gtkhtml2-2.0.1-3.src.rpm" to > see its > source. This one is more easier to compile than > gtkhtml-1.1.4 > .tar.gz. From the source you will find that there's > really no > gtk_html_new() but a > html_view_new()+html_document_new(). So > the structure of "view+document" is very like the > structure > "view+buffer" in gtk2. > > Now I changed the declaration from: > >>>>> > const > gtkhtmllib = libgtkhtml-2.so'; > <<<<< > To: > >>>>> > const > gtkhtmllib = ''; > <<<<< > > And use the following shell script to compile the > test.pp: > (command: ./make.sh test.pp) > >>>>> make.sh > #!/bin/bash > make_linker_script () { > LibPath=`pkg-config libgtkhtml-2.0 --libs-only-L | > sed -e 's/-L//g'` > Libs=`pkg-config libgtkhtml-2.0 --libs-only-l` > > rm -f gtk2.link.res > > for SinglePath in $LibPath > do > printf "SEARCH_DIR($SinglePath)\n" >> > gtk2.link.res > done > printf "INPUT(\n$Libs\n)" >> gtk2.link.res > } > > DynamicOption="-XD > -k-dynamic-linker=/lib/ld-linux.so.2 -kgtk2.link.res" > > # UnitPath="../gtk2/" -----> Note: Here I move *.o and > *.ppu of gtk2forpascal > # to /usr/lib/fpc/1.0.7/units/linux/gtk2, so they > can be automatically > # found. > > make_linker_script > > ppc386 -g -Fu$UnitPath $DynamicOption $@ > > rm -f gtk2.link.res > <<<<< > > The test.pp file is as follows (very ugly and > unmature): > >>>>> > program test; > > {$H+} > {$mode objfpc} > > uses > glib2, gtk2, gdk2; > > const > gtkhtmllib = '';//libgtkhtml-2.so'; > > type > PHtmlDocument = ^THtmlDocument; > THtmlDocument = record > parent_instance: TGObject; > end;//THtmlDocument > > PHtmlView = ^THtmlView; > THtmlView = record > parent: TGtkLayout; > end;//THtmlView > > function html_document_new():PHtmlDocument;cdecl; > external gtkhtmllib; > procedure html_view_zoom_in(view: PHtmlView);cdecl; > external gtkhtmllib; > function html_view_new:PGtkWidget;cdecl; external > gtkhtmllib; > procedure html_view_set_document(view: PHtmlView; > document: PHtmlDocument);cdecl; external gtkhtmllib; > function html_document_open_stream(document: > PHtmlDocument;mime_type: pgchar):gboolean;cdecl; > external gtkhtmllib; > procedure html_document_write_stream(document: > PHtmlDocument;buffer: pgchar; len: gint);cdecl; > external gtkhtmllib; > procedure html_document_close_stream(document: > PHtmlDocument);cdecl; external gtkhtmllib; > > //=================== > var > window : PGtkWidget; > sw : PGtkWidget; > html : PGtkWidget; > document: PHtmlDocument; > > procedure destroy (window: PGtkWidget; data: > gpointer); cdecl; > begin > gtk_main_quit(); > end;//destroy > > var > s:String; > begin > gtk_init(@argc,@argv); > > window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); > gtk_widget_set_size_request(window,500,400); > > gtk_window_set_position(PGtkWindow(window),GTK_WIN_POS_CENTER_ALWAYS); > gtk_window_set_title(PGtkWindow(window),'Test'); > > g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); > > > sw:=gtk_scrolled_window_new(NULL,NULL); > gtk_widget_show(sw); > gtk_container_add(PGtkContainer(window),sw); > > document := html_document_new(); > html:=html_view_new(); > gtk_widget_show(html); > > gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(sw),html); > s:='<html><head><title>Hello, > World!</title></head>'+ > '<body text="#000000" bgcolor="#FFFFCC">'+ > '<center><h1><font size=7>Hello, > world!</font></h1></center>'+ > '</body></html>'; > html_document_open_stream(document,'text/html'); > > html_document_write_stream(document,PChar(s),length(s)); > html_document_close_stream(document); > html_view_set_document(PHtmlView(html), document); > > gtk_widget_show(window); > gtk_main(); > end.//program test > <<<<< > > Mattias, I write an interface for gtkhtml to > gtk2forpascal, but it's > a very simple one. It has only four widgets: > THtmlView, THtmlDocument, > THtmlStream and THtmlStreamBuffer. In the first two > widgets, some fields > are removed. So perhaps some important functionalities > are not included. > The reason why I remove them is because they use > functions of libxml, > I have no time to port so many packages. It remains to > be further work. > At present, I don't know how to show a picture in the > htmlview yet. > > Mattias, Do you think I can present those sources now? > if so, I will > send you those files. If they work, yes. :) Mattias |
From: <wan...@ya...> - 2002-11-05 13:50:01
|
Hi, Mattias Today I solved the problem about gtkhtml-2 programing with gtk2forpascal. First, you should download "gtkhtml2-2.0.1-3.i386.rpm" and "gtkhtml2-devel-2.0.1-3.i386.rpm" from www.rpmfind.net. The first one contains two shared libs. The second one contains many header files and "libgtkhtml-2.a" and "libgtkhtml-2.so", and most important, it contains a file: "/usr/lib/pkgconfig/libgtkhtml-2.0.pc" You can also download "gtkhtml2-2.0.1-3.src.rpm" to see its source. This one is more easier to compile than gtkhtml-1.1.4 .tar.gz. From the source you will find that there's really no gtk_html_new() but a html_view_new()+html_document_new(). So the structure of "view+document" is very like the structure "view+buffer" in gtk2. Now I changed the declaration from: >>>>> const gtkhtmllib = libgtkhtml-2.so'; <<<<< To: >>>>> const gtkhtmllib = ''; <<<<< And use the following shell script to compile the test.pp: (command: ./make.sh test.pp) >>>>> make.sh #!/bin/bash make_linker_script () { LibPath=`pkg-config libgtkhtml-2.0 --libs-only-L | sed -e 's/-L//g'` Libs=`pkg-config libgtkhtml-2.0 --libs-only-l` rm -f gtk2.link.res for SinglePath in $LibPath do printf "SEARCH_DIR($SinglePath)\n" >> gtk2.link.res done printf "INPUT(\n$Libs\n)" >> gtk2.link.res } DynamicOption="-XD -k-dynamic-linker=/lib/ld-linux.so.2 -kgtk2.link.res" # UnitPath="../gtk2/" -----> Note: Here I move *.o and *.ppu of gtk2forpascal # to /usr/lib/fpc/1.0.7/units/linux/gtk2, so they can be automatically # found. make_linker_script ppc386 -g -Fu$UnitPath $DynamicOption $@ rm -f gtk2.link.res <<<<< The test.pp file is as follows (very ugly and unmature): >>>>> program test; {$H+} {$mode objfpc} uses glib2, gtk2, gdk2; const gtkhtmllib = '';//libgtkhtml-2.so'; type PHtmlDocument = ^THtmlDocument; THtmlDocument = record parent_instance: TGObject; end;//THtmlDocument PHtmlView = ^THtmlView; THtmlView = record parent: TGtkLayout; end;//THtmlView function html_document_new():PHtmlDocument;cdecl; external gtkhtmllib; procedure html_view_zoom_in(view: PHtmlView);cdecl; external gtkhtmllib; function html_view_new:PGtkWidget;cdecl; external gtkhtmllib; procedure html_view_set_document(view: PHtmlView; document: PHtmlDocument);cdecl; external gtkhtmllib; function html_document_open_stream(document: PHtmlDocument;mime_type: pgchar):gboolean;cdecl; external gtkhtmllib; procedure html_document_write_stream(document: PHtmlDocument;buffer: pgchar; len: gint);cdecl; external gtkhtmllib; procedure html_document_close_stream(document: PHtmlDocument);cdecl; external gtkhtmllib; //=================== var window : PGtkWidget; sw : PGtkWidget; html : PGtkWidget; document: PHtmlDocument; procedure destroy (window: PGtkWidget; data: gpointer); cdecl; begin gtk_main_quit(); end;//destroy var s:String; begin gtk_init(@argc,@argv); window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request(window,500,400); gtk_window_set_position(PGtkWindow(window),GTK_WIN_POS_CENTER_ALWAYS); gtk_window_set_title(PGtkWindow(window),'Test'); g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); sw:=gtk_scrolled_window_new(NULL,NULL); gtk_widget_show(sw); gtk_container_add(PGtkContainer(window),sw); document := html_document_new(); html:=html_view_new(); gtk_widget_show(html); gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(sw),html); s:='<html><head><title>Hello, World!</title></head>'+ '<body text="#000000" bgcolor="#FFFFCC">'+ '<center><h1><font size=7>Hello, world!</font></h1></center>'+ '</body></html>'; html_document_open_stream(document,'text/html'); html_document_write_stream(document,PChar(s),length(s)); html_document_close_stream(document); html_view_set_document(PHtmlView(html), document); gtk_widget_show(window); gtk_main(); end.//program test <<<<< Mattias, I write an interface for gtkhtml to gtk2forpascal, but it's a very simple one. It has only four widgets: THtmlView, THtmlDocument, THtmlStream and THtmlStreamBuffer. In the first two widgets, some fields are removed. So perhaps some important functionalities are not included. The reason why I remove them is because they use functions of libxml, I have no time to port so many packages. It remains to be further work. At present, I don't know how to show a picture in the htmlview yet. Mattias, Do you think I can present those sources now? if so, I will send you those files. Yours, mili _________________________________________________________ Do You Yahoo!? "是IT精英吗?小试牛刀获时尚大奖!" http://cn.promo.yahoo.com/cgi-bin/udb/u |
From: <wan...@ya...> - 2002-11-04 14:16:35
|
Hi, Mattias >I don't know why this has anything to do with rh8.0. >I tested on rh8.0 and got the same results. >libgtkhtml.so.20 is the gtk1 version of gtkhtml. You can see this with ldd. Ok, Now I know what do you mean about mixing: "libgtkhtml.so.20 is the gtk1 version of gtkhtml". I have not noticed this point. It is not the fault of redhat 8.0. >I think, the version for gtk2 is libgtkhtml-2.so. >I tried to compile with this version, but I got a linker error, be >cause some functions does not exists. For example gtk_html_new. St >range. But there is a html_view_new, which does not exists in the >1th version. It seems that they changed the interface for the gtk2. >Mattias I downloaded the newest gtkhtml source, there's gtk_html_new in source, I didn't find the definition of html_view_new. I can't compile the newest source. It's frustrating. mili _________________________________________________________ Do You Yahoo!? "是IT精英吗?小试牛刀获时尚大奖!" http://cn.promo.yahoo.com/cgi-bin/udb/u |
From: Mattias G. <nc-...@ne...> - 2002-11-03 20:40:51
|
On Sun, 3 Nov 2002 21:40:27 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Hi, Mattias > I am afraid it's not the mixing of gtk1 and gtk2 > libs, because I am using redhat 8.0, gtk2 libs+gnome2. I don't know why this has anything to do with rh8.0. I tested on rh8.0 and got the same results. Your unit uses 'gtkhtml': const gtkhtmllib = 'gtkhtml'; { I have make a link in /usr/lib to libgtkhtml.so.20, I am sure the gtkhtml is encapsulated in this lib because I used hexedit to search "gtk_html_get_type" } libgtkhtml.so.20 is the gtk1 version of gtkhtml. You can see this with ldd. I think, the version for gtk2 is libgtkhtml-2.so. I tried to compile with this version, but I got a linker error, because some functions does not exists. For example gtk_html_new. Strange. But there is a html_view_new, which does not exists in the 1th version. It seems that they changed the interface for the gtk2. Mattias > > You can find the gtkhtml rpm on > "http://www.rpmfind.net" or > "http://rpm.pbone.net/". > > mili > > >I just tried your program. > >I did the mistake to use gtkhtml for gtk 1 and got > your errors. No > >wonder, you can't mix gtk1 and gtk2 libs. > >Does anyone know about a gtkhtml rpm for gtk 2? > > >Mattias > > > _________________________________________________________ > Do You Yahoo!? > ÐÂÏʵ½µ×,ÓéÀÖµ½¼Ò - ÑÅ»¢ÍƳöÃâ·ÑÓéÀÖµç×ÓÖܱ¨! > http://cn.ent.yahoo.com/newsletter/index.html > > > ------------------------------------------------------- > This SF.net email is sponsored by: ApacheCon, November 18-21 in > Las Vegas (supported by COMDEX), the only Apache event to be > fully supported by the ASF. http://www.apachecon.com > _______________________________________________ > Gtk2forpascal-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: <wan...@ya...> - 2002-11-03 13:40:51
|
Hi, Mattias I am afraid it's not the mixing of gtk1 and gtk2 libs, because I am using redhat 8.0, gtk2 libs+gnome2. You can find the gtkhtml rpm on "http://www.rpmfind.net" or "http://rpm.pbone.net/". mili >I just tried your program. >I did the mistake to use gtkhtml for gtk 1 and got your errors. No >wonder, you can't mix gtk1 and gtk2 libs. >Does anyone know about a gtkhtml rpm for gtk 2? >Mattias _________________________________________________________ Do You Yahoo!? 新鲜到底,娱乐到家 - 雅虎推出免费娱乐电子周报! http://cn.ent.yahoo.com/newsletter/index.html |
From: Mattias G. <nc-...@ne...> - 2002-11-02 15:52:25
|
On Tue, 29 Oct 2002 10:04:32 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Hello, every body > > I try to add gtkhtml into gtk2forpascal. I just want > a very simple gtkhtml, > so I only some of the files into pascal and combine to > one file. I can > compile the interface successfully, but when I use it > into my program, the > compiler report some bugs: I just tried your program. I did the mistake to use gtkhtml for gtk 1 and got your errors. No wonder, you can't mix gtk1 and gtk2 libs. Does anyone know about a gtkhtml rpm for gtk 2? Mattias > > specified class size for type `GParamChar' is > specified class size for type > `GParamChar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUChar' > isspecified class size for type > `GParamUChar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamBoolean' > specified class size for type > `GParamBoolean' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamInt' is > sspecified class size for type > `GParamInt' is smaller than the parent type's `GParam' > class size > specified class size for type `GParamUInt' is > specified class size for type > `GParamUInt' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamLong' is > specified class size for type > `GParamLong' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamULong' > isspecified class size for type > `GParamULong' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamInt64' > isspecified class size for type > `GParamInt64' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUInt64' > ispecified class size for type > `GParamUInt64' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUnichar' > specified class size for type > `GParamUnichar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamEnum' is > specified class size for type > `GParamEnum' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamFlags' > isspecified class size for type > `GParamFlags' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamFloat' > isspecified class size for type > `GParamFloat' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamDouble' > ispecified class size for type > `GParamDouble' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamString' > ispecified class size for type > `GParamString' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamParam' > isspecified class size for type > `GParamParam' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamBoxed' > isspecified class size for type > `GParamBoxed' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamPointer' > specified class size for type > `GParamPointer' is smaller than the parent type's > `GParam' class size > specified class size for type > `GParamValueArraspecified class size for type > `GParamValueArray' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamObject' > ispecified class size for type > `GParamObject' is smaller than the parent type's > `GParam' class size > An unhandled exception occurred at 0x403A8DEB : > Access violation > 0x403A8DEB > 0x403AAB95 > 0x403A717A > 0x403A71C0 > 0x4028219D > 0x400F6D7B > 0x400F71A6 > 0x080796AB > 0x0804DC70 > > Can you tell how to modify this program? > > Thank you very much. > Yours, > mili > > >>>>>>> here is the interface file, gtkhtml.pas > >>>>>>> > > unit gtkhtml; > > interface > > uses > gtk2, glib2, gdk2; > > const > gtkhtmllib = 'gtkhtml'; > { I have make a link in /usr/lib to > libgtkhtml.so.20, I am sure > the gtkhtml is encapsulated in this lib because I > used hexedit > to search "gtk_html_get_type" } > > { Pointers to basic pascal types, inserted by h2pas > conversion program.} > type > TGtkHTMLStreamStatus = (GTK_HTML_STREAM_OK, > GTK_HTML_STREAM_ERROR); > > PGtkHTMLStream = ^TGtkHTMLStream; > > TGtkHTMLStreamTypesFunc = function > (stream:PGtkHTMLStream; > user_data:gpointer):ppgchar;cdecl; > TGtkHTMLStreamCloseFunc = procedure > (stream:PGtkHTMLStream; > status:TGtkHTMLStreamStatus; > user_data:gpointer);cdecl; > TGtkHTMLStreamWriteFunc = procedure > (stream:PGtkHTMLStream; buffer:Pgchar; > size:integer; user_data:gpointer);cdecl; > TGtkHTMLSaveReceiverFn = function > (engine:gpointer; data:Pgchar; > len:integer; user_data:gpointer):gboolean;cdecl; > > TGtkHTMLStream = record > write_func : TGtkHTMLStreamWriteFunc; > close_func : TGtkHTMLStreamCloseFunc; > types_func : TGtkHTMLStreamTypesFunc; > user_data : gpointer; > end;//TGtkHTMLStream > > PGtkHTML = ^TGtkHTML; > TGtkHTML = record > layout : TGtkLayout; > editor_bindings : PGtkBindingSet; > iframe_parent : PGtkWidget; > editor_data : gpointer; > pointer_url : pgchar; > hand_cursor : PGdkCursor; > arrow_cursor : PGdkCursor; > ibeam_cursor : PGdkCursor; > selection_x1 : gint; > selection_y1 : gint; > flag0 : word; > hadj_connection : guint; > vadj_connection : guint; > binding_handled : gboolean; > end;//TGtkHTML > > PGtkHTMLClass = ^TGtkHTMLClass; > TGtkHTMLClass = record > parent_class : TGtkLayoutClass; > end;//TGtkHTMLClass > > function GTK_TYPE_HTML : GType; > function GTK_HTML(obj: pointer) : PGtkHTML; > function GTK_HTML_CLASS(klass: pointer) : > PGtkHTMLClass; > function GTK_IS_HTML(obj: pointer) : boolean; > function GTK_IS_HTML_CLASS(klass: pointer) : > boolean; > > { creation } > function gtk_html_get_type:TGtkType;cdecl; external > gtkhtmllib; > procedure gtk_html_construct(html:PGtkWidget);cdecl; > external gtkhtmllib; > function gtk_html_new:PGtkWidget;cdecl; external > gtkhtmllib; > function gtk_html_new_from_string(str:Pgchar; > len:gint):PGtkWidget;cdecl; > external gtkhtmllib; > > { Behavior. } > procedure gtk_html_allow_selection(html:PGtkHTML; > allow:gboolean);cdecl; > external gtkhtmllib; > > { Loading. } > function > gtk_html_begin(html:PGtkHTML):PGtkHTMLStream;cdecl; > external > gtkhtmllib; > function gtk_html_begin_content(html:PGtkHTML; > content_type:Pgchar):PGtkHTMLStream;cdecl; external > gtkhtmllib; > procedure gtk_html_write(html:PGtkHTML; > handle:PGtkHTMLStream; > buffer:Pgchar; size:integer);cdecl; external > gtkhtmllib; > procedure gtk_html_end(html:PGtkHTML; > handle:PGtkHTMLStream; > status:TGtkHTMLStreamStatus);cdecl; external > gtkhtmllib; > procedure gtk_html_load_empty(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_load_from_string(html:PGtkHTML; > str:Pgchar; > len:gint);cdecl; external gtkhtmllib; > > { Saving. } > function gtk_html_save(html:PGtkHTML; > receiver:TGtkHTMLSaveReceiverFn; > data:gpointer):gboolean;cdecl; external gtkhtmllib; > function gtk_html_export(html:PGtkHTML; _type:Pchar; > receiver:TGtkHTMLSaveReceiverFn; > data:gpointer):gboolean;cdecl; external > gtkhtmllib; > > { Title. } > function > gtk_html_get_title(html:PGtkHTML):pgchar;cdecl; > external > gtkhtmllib; > procedure gtk_html_set_title(html:PGtkHTML; > title:Pchar);cdecl; external > gtkhtmllib; > > { Anchors. } > function gtk_html_jump_to_anchor(html:PGtkHTML; > anchor:Pgchar):gboolean;cdecl; external gtkhtmllib; > > procedure gtk_html_copy(html:PGtkHTML);cdecl; > external gtkhtmllib; > > { misc utils } > procedure > gtk_html_set_default_background_color(html:PGtkHTML; > c:PGdkColor);cdecl; external gtkhtmllib; > procedure > gtk_html_set_default_content_type(html:PGtkHTML; > content_type:Pgchar);cdecl; external gtkhtmllib; > > function gtk_html_get_object_by_id(html:PGtkHTML; > id:Pgchar):gpointer;cdecl; external gtkhtmllib; > > procedure gtk_html_zoom_in(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_zoom_out(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_zoom_reset(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_set_allow_frameset(html:PGtkHTML; > allow:gboolean);cdecl; > external gtkhtmllib; > function > gtk_html_get_allow_frameset(html:PGtkHTML):gboolean;cdecl; > external gtkhtmllib; > > procedure gtk_html_images_ref(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure > gtk_html_images_unref(html:PGtkHTML);cdecl; external > gtkhtmllib; > > procedure gtk_html_image_ref(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_image_unref(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_image_preload(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_set_blocking(html:PGtkHTML; > block:gboolean);cdecl; > external gtkhtmllib; > > {stream} > function gtk_html_stream_new(html:PGtkHTML; > type_func:TGtkHTMLStreamTypesFunc; > write_func:TGtkHTMLStreamWriteFunc; > close_func:TGtkHTMLStreamCloseFunc; > user_data:gpointer):PGtkHTMLStream;cdecl; > external gtkhtmllib; > procedure > gtk_html_stream_write(stream:PGtkHTMLStream; > buffer:Pgchar; > size:integer);cdecl; external gtkhtmllib; > procedure > gtk_html_stream_destroy(stream:PGtkHTMLStream);cdecl; > external > gtkhtmllib; > procedure > gtk_html_stream_close(stream:PGtkHTMLStream; > status:TGtkHTMLStreamStatus);cdecl; external > gtkhtmllib; > function > gtk_html_stream_get_types(stream:PGtkHTMLStream):ppchar;cdecl; > external gtkhtmllib; > > implementation > > {$IFNDEF KYLIX} > { There is a bug in the compiler. If an external > variable is not used, it > will create code, that can be relocated by the > linker. > So, use them in this hidden procedure. > } > procedure CheckUnusedVariable; [Public]; > begin > if (gtk_major_version<>0) then ; > if (gtk_minor_version<>0) then ; > if (gtk_micro_version<>0) then ; > if (gtk_binary_age<>0) then ; > if (gtk_interface_age<>0) then ; > if (ord(gtk_text_attr_appearance_type)<>0) then ; > end; > {$ENDIF} > > function GTK_TYPE_HTML : GType; > begin > GTK_TYPE_HTML:=gtk_html_get_type; > end;//GTK_TYPE_HTML > > function GTK_HTML(obj: pointer) : PGtkHTML; > begin > > GTK_HTML:=PGtkHTML(GTK_CHECK_CAST(obj,GTK_TYPE_HTML)); > end;//GTK_HTML > > function GTK_HTML_CLASS(klass: pointer) : > PGtkHTMLClass; > begin > > GTK_HTML_CLASS:=PGtkHTMLClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_HTM > L)); > end;//GTK_HTML_CLASS > > function GTK_IS_HTML(obj: pointer) : boolean; > begin > GTK_IS_HTML:=GTK_CHECK_TYPE(obj,GTK_TYPE_HTML); > end;//GTK_IS_HTML > > function GTK_IS_HTML_CLASS(klass: pointer) : > boolean; > begin > > GTK_IS_HTML_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_HTML); > end;//GTK_IS_HTML_CLASS > end.//unit gtkhtml > > <<<<<<<<<< end of file gtkhtml.pas <<<<<<<<<<< > > >>>>>>>>>> the test file, test.pp >>>>>>>>>>>>>>>>>> > > program test; > > {$H+} > > uses > glib2, gtk2, gdk2, gtkhtml; > > var > window : PGtkWidget; > sw : PGtkWidget; > html : PGtkWidget; > > procedure destroy (window: PGtkWidget; data: > gpointer); cdecl; > begin > gtk_main_quit(); > end;//destroy > > begin > gtk_init(@argc,@argv); > > window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); > > g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); > > sw:=gtk_scrolled_window_new(NULL,NULL); > gtk_widget_show(sw); > gtk_container_add(PGtkContainer(window),sw); > > html:=gtk_html_new(); > gtk_widget_show(html); > > gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(sw),html); > > gtk_widget_show(window); > gtk_main(); > end.//test > > <<<<<<<<<< end of file test.pp <<<<<<<<<<< > > > _________________________________________________________ > Do You Yahoo!? > "ÊÇIT¾«Ó¢Âð£¿Ð¡ÊÔÅ£µ¶»ñʱÉд󽱣¡" > http://cn.promo.yahoo.com/cgi-bin/udb/u > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gtk2forpascal-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: Mattias G. <nc-...@ne...> - 2002-10-31 08:02:46
|
Hi Zhong, I'm currently very busy. I hope to answer this weekend. Probably a linker problem with the gtkhtml lib. Mattias On Thu, 31 Oct 2002 10:50:21 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Dear Mattias, > I still haven't solved the problem of gtkhtml. > First, I don't know why, the website of sourceforge > can't be accessed from China (though the ftp can do). > So if there's a mirror of gtk2forpascal project on > somewhere else, let me know please. > > Second, I don't think the problem is because the > manner of compiling gtk2. I proved it. This time, I > compile gtk2forpascal without any change from the cvs > source (I use gtk2forpascal-0.5.tgz, because I can't > make gtk2forpascal-0.6.tgz work under fpc 1.0.7). Now, > the examples can be compiled and run normally. Then I > put my codes of gtkhtml interface to the test.pp. The > compilation is successful. But when I run my test > program, it gives errors like: > "specified class size for type `GParamChar' > isspecified class size for type `GParamChar' is > smaller than the parent type's `GParam' class size" > > So there must be some other problems because all the > examples can work well. You know, I am not so > formiliar with the architects of gtk2forpascal > program. > > Any way, I will thank you because you helped me a > lot, such as the problem of "Why my program crash?". I > wanted to say "thank you" for a long time, but my > email often failed to be sent out, yesterday I found > that my old email vendor is added to the blacklist of > sourceforge mailing list. > > And I think we can added more new things into > gtk2forpascal, such as some useful classes, I wrote a > class called "TUndoManager" which easilly gives a > gtktextbuffer the "undo" ability. I mean, through > adding some new classes, we can add more complementary > parts to gtk2 itself. > > Yours, > mili > > > ------- In your last email you said: > > These bugs are not compiler bugs, but glib bugs. > They appear when > >linking in the wrong order. > >Plz see our homepage and the scripts for the examples > how to compile > >gtk2 programs. > >I myself am very interested in gtkhtml. As soon as I > have some time, I > >will try your source and add it to cvs. > > > Mattias > > _________________________________________________________ > Do You Yahoo!? > ÐÂÏʵ½µ×,ÓéÀÖµ½¼Ò - ÑÅ»¢ÍƳöÃâ·ÑÓéÀÖµç×ÓÖܱ¨! > http://cn.ent.yahoo.com/newsletter/index.html > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Gtk2forpascal-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: <wan...@ya...> - 2002-10-31 02:50:31
|
Dear Mattias, I still haven't solved the problem of gtkhtml. First, I don't know why, the website of sourceforge can't be accessed from China (though the ftp can do). So if there's a mirror of gtk2forpascal project on somewhere else, let me know please. Second, I don't think the problem is because the manner of compiling gtk2. I proved it. This time, I compile gtk2forpascal without any change from the cvs source (I use gtk2forpascal-0.5.tgz, because I can't make gtk2forpascal-0.6.tgz work under fpc 1.0.7). Now, the examples can be compiled and run normally. Then I put my codes of gtkhtml interface to the test.pp. The compilation is successful. But when I run my test program, it gives errors like: "specified class size for type `GParamChar' isspecified class size for type `GParamChar' is smaller than the parent type's `GParam' class size" So there must be some other problems because all the examples can work well. You know, I am not so formiliar with the architects of gtk2forpascal program. Any way, I will thank you because you helped me a lot, such as the problem of "Why my program crash?". I wanted to say "thank you" for a long time, but my email often failed to be sent out, yesterday I found that my old email vendor is added to the blacklist of sourceforge mailing list. And I think we can added more new things into gtk2forpascal, such as some useful classes, I wrote a class called "TUndoManager" which easilly gives a gtktextbuffer the "undo" ability. I mean, through adding some new classes, we can add more complementary parts to gtk2 itself. Yours, mili ------- In your last email you said: > These bugs are not compiler bugs, but glib bugs. They appear when >linking in the wrong order. >Plz see our homepage and the scripts for the examples how to compile >gtk2 programs. >I myself am very interested in gtkhtml. As soon as I have some time, I >will try your source and add it to cvs. Mattias _________________________________________________________ Do You Yahoo!? 新鲜到底,娱乐到家 - 雅虎推出免费娱乐电子周报! http://cn.ent.yahoo.com/newsletter/index.html |
From: Mattias G. <nc-...@ne...> - 2002-10-29 20:02:45
|
On Tue, 29 Oct 2002 10:04:32 +0800 (CST) Zhong Wang <wan...@ya...> wrote: > Hello, every body > > I try to add gtkhtml into gtk2forpascal. I just want > a very simple gtkhtml, > so I only some of the files into pascal and combine to > one file. I can > compile the interface successfully, but when I use it > into my program, the > compiler report some bugs: These bugs are not compiler bugs, but glib bugs. They appear when linking in the wrong order. Plz see our homepage and the scripts for the examples how to compile gtk2 programs. I myself am very interested in gtkhtml. As soon as I have some time, I will try your source and add it to cvs. Mattias > specified class size for type `GParamChar' is > specified class size for type > `GParamChar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUChar' > isspecified class size for type > `GParamUChar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamBoolean' > specified class size for type > `GParamBoolean' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamInt' is > sspecified class size for type > `GParamInt' is smaller than the parent type's `GParam' > class size > specified class size for type `GParamUInt' is > specified class size for type > `GParamUInt' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamLong' is > specified class size for type > `GParamLong' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamULong' > isspecified class size for type > `GParamULong' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamInt64' > isspecified class size for type > `GParamInt64' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUInt64' > ispecified class size for type > `GParamUInt64' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamUnichar' > specified class size for type > `GParamUnichar' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamEnum' is > specified class size for type > `GParamEnum' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamFlags' > isspecified class size for type > `GParamFlags' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamFloat' > isspecified class size for type > `GParamFloat' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamDouble' > ispecified class size for type > `GParamDouble' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamString' > ispecified class size for type > `GParamString' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamParam' > isspecified class size for type > `GParamParam' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamBoxed' > isspecified class size for type > `GParamBoxed' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamPointer' > specified class size for type > `GParamPointer' is smaller than the parent type's > `GParam' class size > specified class size for type > `GParamValueArraspecified class size for type > `GParamValueArray' is smaller than the parent type's > `GParam' class size > specified class size for type `GParamObject' > ispecified class size for type > `GParamObject' is smaller than the parent type's > `GParam' class size > An unhandled exception occurred at 0x403A8DEB : > Access violation > 0x403A8DEB > 0x403AAB95 > 0x403A717A > 0x403A71C0 > 0x4028219D > 0x400F6D7B > 0x400F71A6 > 0x080796AB > 0x0804DC70 > > Can you tell how to modify this program? > > Thank you very much. > Yours, > mili > > >>>>>>> here is the interface file, gtkhtml.pas > >>>>>>> > > unit gtkhtml; > > interface > > uses > gtk2, glib2, gdk2; > > const > gtkhtmllib = 'gtkhtml'; > { I have make a link in /usr/lib to > libgtkhtml.so.20, I am sure > the gtkhtml is encapsulated in this lib because I > used hexedit > to search "gtk_html_get_type" } > > { Pointers to basic pascal types, inserted by h2pas > conversion program.} > type > TGtkHTMLStreamStatus = (GTK_HTML_STREAM_OK, > GTK_HTML_STREAM_ERROR); > > PGtkHTMLStream = ^TGtkHTMLStream; > > TGtkHTMLStreamTypesFunc = function > (stream:PGtkHTMLStream; > user_data:gpointer):ppgchar;cdecl; > TGtkHTMLStreamCloseFunc = procedure > (stream:PGtkHTMLStream; > status:TGtkHTMLStreamStatus; > user_data:gpointer);cdecl; > TGtkHTMLStreamWriteFunc = procedure > (stream:PGtkHTMLStream; buffer:Pgchar; > size:integer; user_data:gpointer);cdecl; > TGtkHTMLSaveReceiverFn = function > (engine:gpointer; data:Pgchar; > len:integer; user_data:gpointer):gboolean;cdecl; > > TGtkHTMLStream = record > write_func : TGtkHTMLStreamWriteFunc; > close_func : TGtkHTMLStreamCloseFunc; > types_func : TGtkHTMLStreamTypesFunc; > user_data : gpointer; > end;//TGtkHTMLStream > > PGtkHTML = ^TGtkHTML; > TGtkHTML = record > layout : TGtkLayout; > editor_bindings : PGtkBindingSet; > iframe_parent : PGtkWidget; > editor_data : gpointer; > pointer_url : pgchar; > hand_cursor : PGdkCursor; > arrow_cursor : PGdkCursor; > ibeam_cursor : PGdkCursor; > selection_x1 : gint; > selection_y1 : gint; > flag0 : word; > hadj_connection : guint; > vadj_connection : guint; > binding_handled : gboolean; > end;//TGtkHTML > > PGtkHTMLClass = ^TGtkHTMLClass; > TGtkHTMLClass = record > parent_class : TGtkLayoutClass; > end;//TGtkHTMLClass > > function GTK_TYPE_HTML : GType; > function GTK_HTML(obj: pointer) : PGtkHTML; > function GTK_HTML_CLASS(klass: pointer) : > PGtkHTMLClass; > function GTK_IS_HTML(obj: pointer) : boolean; > function GTK_IS_HTML_CLASS(klass: pointer) : > boolean; > > { creation } > function gtk_html_get_type:TGtkType;cdecl; external > gtkhtmllib; > procedure gtk_html_construct(html:PGtkWidget);cdecl; > external gtkhtmllib; > function gtk_html_new:PGtkWidget;cdecl; external > gtkhtmllib; > function gtk_html_new_from_string(str:Pgchar; > len:gint):PGtkWidget;cdecl; > external gtkhtmllib; > > { Behavior. } > procedure gtk_html_allow_selection(html:PGtkHTML; > allow:gboolean);cdecl; > external gtkhtmllib; > > { Loading. } > function > gtk_html_begin(html:PGtkHTML):PGtkHTMLStream;cdecl; > external > gtkhtmllib; > function gtk_html_begin_content(html:PGtkHTML; > content_type:Pgchar):PGtkHTMLStream;cdecl; external > gtkhtmllib; > procedure gtk_html_write(html:PGtkHTML; > handle:PGtkHTMLStream; > buffer:Pgchar; size:integer);cdecl; external > gtkhtmllib; > procedure gtk_html_end(html:PGtkHTML; > handle:PGtkHTMLStream; > status:TGtkHTMLStreamStatus);cdecl; external > gtkhtmllib; > procedure gtk_html_load_empty(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_load_from_string(html:PGtkHTML; > str:Pgchar; > len:gint);cdecl; external gtkhtmllib; > > { Saving. } > function gtk_html_save(html:PGtkHTML; > receiver:TGtkHTMLSaveReceiverFn; > data:gpointer):gboolean;cdecl; external gtkhtmllib; > function gtk_html_export(html:PGtkHTML; _type:Pchar; > receiver:TGtkHTMLSaveReceiverFn; > data:gpointer):gboolean;cdecl; external > gtkhtmllib; > > { Title. } > function > gtk_html_get_title(html:PGtkHTML):pgchar;cdecl; > external > gtkhtmllib; > procedure gtk_html_set_title(html:PGtkHTML; > title:Pchar);cdecl; external > gtkhtmllib; > > { Anchors. } > function gtk_html_jump_to_anchor(html:PGtkHTML; > anchor:Pgchar):gboolean;cdecl; external gtkhtmllib; > > procedure gtk_html_copy(html:PGtkHTML);cdecl; > external gtkhtmllib; > > { misc utils } > procedure > gtk_html_set_default_background_color(html:PGtkHTML; > c:PGdkColor);cdecl; external gtkhtmllib; > procedure > gtk_html_set_default_content_type(html:PGtkHTML; > content_type:Pgchar);cdecl; external gtkhtmllib; > > function gtk_html_get_object_by_id(html:PGtkHTML; > id:Pgchar):gpointer;cdecl; external gtkhtmllib; > > procedure gtk_html_zoom_in(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_zoom_out(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_zoom_reset(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure gtk_html_set_allow_frameset(html:PGtkHTML; > allow:gboolean);cdecl; > external gtkhtmllib; > function > gtk_html_get_allow_frameset(html:PGtkHTML):gboolean;cdecl; > external gtkhtmllib; > > procedure gtk_html_images_ref(html:PGtkHTML);cdecl; > external gtkhtmllib; > procedure > gtk_html_images_unref(html:PGtkHTML);cdecl; external > gtkhtmllib; > > procedure gtk_html_image_ref(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_image_unref(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_image_preload(html:PGtkHTML; > url:Pgchar);cdecl; external > gtkhtmllib; > procedure gtk_html_set_blocking(html:PGtkHTML; > block:gboolean);cdecl; > external gtkhtmllib; > > {stream} > function gtk_html_stream_new(html:PGtkHTML; > type_func:TGtkHTMLStreamTypesFunc; > write_func:TGtkHTMLStreamWriteFunc; > close_func:TGtkHTMLStreamCloseFunc; > user_data:gpointer):PGtkHTMLStream;cdecl; > external gtkhtmllib; > procedure > gtk_html_stream_write(stream:PGtkHTMLStream; > buffer:Pgchar; > size:integer);cdecl; external gtkhtmllib; > procedure > gtk_html_stream_destroy(stream:PGtkHTMLStream);cdecl; > external > gtkhtmllib; > procedure > gtk_html_stream_close(stream:PGtkHTMLStream; > status:TGtkHTMLStreamStatus);cdecl; external > gtkhtmllib; > function > gtk_html_stream_get_types(stream:PGtkHTMLStream):ppchar;cdecl; > external gtkhtmllib; > > implementation > > {$IFNDEF KYLIX} > { There is a bug in the compiler. If an external > variable is not used, it > will create code, that can be relocated by the > linker. > So, use them in this hidden procedure. > } > procedure CheckUnusedVariable; [Public]; > begin > if (gtk_major_version<>0) then ; > if (gtk_minor_version<>0) then ; > if (gtk_micro_version<>0) then ; > if (gtk_binary_age<>0) then ; > if (gtk_interface_age<>0) then ; > if (ord(gtk_text_attr_appearance_type)<>0) then ; > end; > {$ENDIF} > > function GTK_TYPE_HTML : GType; > begin > GTK_TYPE_HTML:=gtk_html_get_type; > end;//GTK_TYPE_HTML > > function GTK_HTML(obj: pointer) : PGtkHTML; > begin > > GTK_HTML:=PGtkHTML(GTK_CHECK_CAST(obj,GTK_TYPE_HTML)); > end;//GTK_HTML > > function GTK_HTML_CLASS(klass: pointer) : > PGtkHTMLClass; > begin > > GTK_HTML_CLASS:=PGtkHTMLClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_HTM > L)); > end;//GTK_HTML_CLASS > > function GTK_IS_HTML(obj: pointer) : boolean; > begin > GTK_IS_HTML:=GTK_CHECK_TYPE(obj,GTK_TYPE_HTML); > end;//GTK_IS_HTML > > function GTK_IS_HTML_CLASS(klass: pointer) : > boolean; > begin > > GTK_IS_HTML_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_HTML); > end;//GTK_IS_HTML_CLASS > end.//unit gtkhtml > > <<<<<<<<<< end of file gtkhtml.pas <<<<<<<<<<< > > >>>>>>>>>> the test file, test.pp >>>>>>>>>>>>>>>>>> > > program test; > > {$H+} > > uses > glib2, gtk2, gdk2, gtkhtml; > > var > window : PGtkWidget; > sw : PGtkWidget; > html : PGtkWidget; > > procedure destroy (window: PGtkWidget; data: > gpointer); cdecl; > begin > gtk_main_quit(); > end;//destroy > > begin > gtk_init(@argc,@argv); > > window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); > > g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); > > sw:=gtk_scrolled_window_new(NULL,NULL); > gtk_widget_show(sw); > gtk_container_add(PGtkContainer(window),sw); > > html:=gtk_html_new(); > gtk_widget_show(html); > > gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(sw),html); > > gtk_widget_show(window); > gtk_main(); > end.//test > > <<<<<<<<<< end of file test.pp <<<<<<<<<<< > > > _________________________________________________________ > Do You Yahoo!? > "ÊÇIT¾«Ó¢Âð£¿Ð¡ÊÔÅ£µ¶»ñʱÉд󽱣¡" > http://cn.promo.yahoo.com/cgi-bin/udb/u > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gtk2forpascal-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: <wan...@ya...> - 2002-10-29 02:04:50
|
Hello, every body I try to add gtkhtml into gtk2forpascal. I just want a very simple gtkhtml, so I only some of the files into pascal and combine to one file. I can compile the interface successfully, but when I use it into my program, the compiler report some bugs: specified class size for type `GParamChar' is specified class size for type `GParamChar' is smaller than the parent type's `GParam' class size specified class size for type `GParamUChar' isspecified class size for type `GParamUChar' is smaller than the parent type's `GParam' class size specified class size for type `GParamBoolean' specified class size for type `GParamBoolean' is smaller than the parent type's `GParam' class size specified class size for type `GParamInt' is sspecified class size for type `GParamInt' is smaller than the parent type's `GParam' class size specified class size for type `GParamUInt' is specified class size for type `GParamUInt' is smaller than the parent type's `GParam' class size specified class size for type `GParamLong' is specified class size for type `GParamLong' is smaller than the parent type's `GParam' class size specified class size for type `GParamULong' isspecified class size for type `GParamULong' is smaller than the parent type's `GParam' class size specified class size for type `GParamInt64' isspecified class size for type `GParamInt64' is smaller than the parent type's `GParam' class size specified class size for type `GParamUInt64' ispecified class size for type `GParamUInt64' is smaller than the parent type's `GParam' class size specified class size for type `GParamUnichar' specified class size for type `GParamUnichar' is smaller than the parent type's `GParam' class size specified class size for type `GParamEnum' is specified class size for type `GParamEnum' is smaller than the parent type's `GParam' class size specified class size for type `GParamFlags' isspecified class size for type `GParamFlags' is smaller than the parent type's `GParam' class size specified class size for type `GParamFloat' isspecified class size for type `GParamFloat' is smaller than the parent type's `GParam' class size specified class size for type `GParamDouble' ispecified class size for type `GParamDouble' is smaller than the parent type's `GParam' class size specified class size for type `GParamString' ispecified class size for type `GParamString' is smaller than the parent type's `GParam' class size specified class size for type `GParamParam' isspecified class size for type `GParamParam' is smaller than the parent type's `GParam' class size specified class size for type `GParamBoxed' isspecified class size for type `GParamBoxed' is smaller than the parent type's `GParam' class size specified class size for type `GParamPointer' specified class size for type `GParamPointer' is smaller than the parent type's `GParam' class size specified class size for type `GParamValueArraspecified class size for type `GParamValueArray' is smaller than the parent type's `GParam' class size specified class size for type `GParamObject' ispecified class size for type `GParamObject' is smaller than the parent type's `GParam' class size An unhandled exception occurred at 0x403A8DEB : Access violation 0x403A8DEB 0x403AAB95 0x403A717A 0x403A71C0 0x4028219D 0x400F6D7B 0x400F71A6 0x080796AB 0x0804DC70 Can you tell how to modify this program? Thank you very much. Yours, mili >>>>>>> here is the interface file, gtkhtml.pas >>>>>>> unit gtkhtml; interface uses gtk2, glib2, gdk2; const gtkhtmllib = 'gtkhtml'; { I have make a link in /usr/lib to libgtkhtml.so.20, I am sure the gtkhtml is encapsulated in this lib because I used hexedit to search "gtk_html_get_type" } { Pointers to basic pascal types, inserted by h2pas conversion program.} type TGtkHTMLStreamStatus = (GTK_HTML_STREAM_OK, GTK_HTML_STREAM_ERROR); PGtkHTMLStream = ^TGtkHTMLStream; TGtkHTMLStreamTypesFunc = function (stream:PGtkHTMLStream; user_data:gpointer):ppgchar;cdecl; TGtkHTMLStreamCloseFunc = procedure (stream:PGtkHTMLStream; status:TGtkHTMLStreamStatus; user_data:gpointer);cdecl; TGtkHTMLStreamWriteFunc = procedure (stream:PGtkHTMLStream; buffer:Pgchar; size:integer; user_data:gpointer);cdecl; TGtkHTMLSaveReceiverFn = function (engine:gpointer; data:Pgchar; len:integer; user_data:gpointer):gboolean;cdecl; TGtkHTMLStream = record write_func : TGtkHTMLStreamWriteFunc; close_func : TGtkHTMLStreamCloseFunc; types_func : TGtkHTMLStreamTypesFunc; user_data : gpointer; end;//TGtkHTMLStream PGtkHTML = ^TGtkHTML; TGtkHTML = record layout : TGtkLayout; editor_bindings : PGtkBindingSet; iframe_parent : PGtkWidget; editor_data : gpointer; pointer_url : pgchar; hand_cursor : PGdkCursor; arrow_cursor : PGdkCursor; ibeam_cursor : PGdkCursor; selection_x1 : gint; selection_y1 : gint; flag0 : word; hadj_connection : guint; vadj_connection : guint; binding_handled : gboolean; end;//TGtkHTML PGtkHTMLClass = ^TGtkHTMLClass; TGtkHTMLClass = record parent_class : TGtkLayoutClass; end;//TGtkHTMLClass function GTK_TYPE_HTML : GType; function GTK_HTML(obj: pointer) : PGtkHTML; function GTK_HTML_CLASS(klass: pointer) : PGtkHTMLClass; function GTK_IS_HTML(obj: pointer) : boolean; function GTK_IS_HTML_CLASS(klass: pointer) : boolean; { creation } function gtk_html_get_type:TGtkType;cdecl; external gtkhtmllib; procedure gtk_html_construct(html:PGtkWidget);cdecl; external gtkhtmllib; function gtk_html_new:PGtkWidget;cdecl; external gtkhtmllib; function gtk_html_new_from_string(str:Pgchar; len:gint):PGtkWidget;cdecl; external gtkhtmllib; { Behavior. } procedure gtk_html_allow_selection(html:PGtkHTML; allow:gboolean);cdecl; external gtkhtmllib; { Loading. } function gtk_html_begin(html:PGtkHTML):PGtkHTMLStream;cdecl; external gtkhtmllib; function gtk_html_begin_content(html:PGtkHTML; content_type:Pgchar):PGtkHTMLStream;cdecl; external gtkhtmllib; procedure gtk_html_write(html:PGtkHTML; handle:PGtkHTMLStream; buffer:Pgchar; size:integer);cdecl; external gtkhtmllib; procedure gtk_html_end(html:PGtkHTML; handle:PGtkHTMLStream; status:TGtkHTMLStreamStatus);cdecl; external gtkhtmllib; procedure gtk_html_load_empty(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_load_from_string(html:PGtkHTML; str:Pgchar; len:gint);cdecl; external gtkhtmllib; { Saving. } function gtk_html_save(html:PGtkHTML; receiver:TGtkHTMLSaveReceiverFn; data:gpointer):gboolean;cdecl; external gtkhtmllib; function gtk_html_export(html:PGtkHTML; _type:Pchar; receiver:TGtkHTMLSaveReceiverFn; data:gpointer):gboolean;cdecl; external gtkhtmllib; { Title. } function gtk_html_get_title(html:PGtkHTML):pgchar;cdecl; external gtkhtmllib; procedure gtk_html_set_title(html:PGtkHTML; title:Pchar);cdecl; external gtkhtmllib; { Anchors. } function gtk_html_jump_to_anchor(html:PGtkHTML; anchor:Pgchar):gboolean;cdecl; external gtkhtmllib; procedure gtk_html_copy(html:PGtkHTML);cdecl; external gtkhtmllib; { misc utils } procedure gtk_html_set_default_background_color(html:PGtkHTML; c:PGdkColor);cdecl; external gtkhtmllib; procedure gtk_html_set_default_content_type(html:PGtkHTML; content_type:Pgchar);cdecl; external gtkhtmllib; function gtk_html_get_object_by_id(html:PGtkHTML; id:Pgchar):gpointer;cdecl; external gtkhtmllib; procedure gtk_html_zoom_in(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_zoom_out(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_zoom_reset(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_set_allow_frameset(html:PGtkHTML; allow:gboolean);cdecl; external gtkhtmllib; function gtk_html_get_allow_frameset(html:PGtkHTML):gboolean;cdecl; external gtkhtmllib; procedure gtk_html_images_ref(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_images_unref(html:PGtkHTML);cdecl; external gtkhtmllib; procedure gtk_html_image_ref(html:PGtkHTML; url:Pgchar);cdecl; external gtkhtmllib; procedure gtk_html_image_unref(html:PGtkHTML; url:Pgchar);cdecl; external gtkhtmllib; procedure gtk_html_image_preload(html:PGtkHTML; url:Pgchar);cdecl; external gtkhtmllib; procedure gtk_html_set_blocking(html:PGtkHTML; block:gboolean);cdecl; external gtkhtmllib; {stream} function gtk_html_stream_new(html:PGtkHTML; type_func:TGtkHTMLStreamTypesFunc; write_func:TGtkHTMLStreamWriteFunc; close_func:TGtkHTMLStreamCloseFunc; user_data:gpointer):PGtkHTMLStream;cdecl; external gtkhtmllib; procedure gtk_html_stream_write(stream:PGtkHTMLStream; buffer:Pgchar; size:integer);cdecl; external gtkhtmllib; procedure gtk_html_stream_destroy(stream:PGtkHTMLStream);cdecl; external gtkhtmllib; procedure gtk_html_stream_close(stream:PGtkHTMLStream; status:TGtkHTMLStreamStatus);cdecl; external gtkhtmllib; function gtk_html_stream_get_types(stream:PGtkHTMLStream):ppchar;cdecl; external gtkhtmllib; implementation {$IFNDEF KYLIX} { There is a bug in the compiler. If an external variable is not used, it will create code, that can be relocated by the linker. So, use them in this hidden procedure. } procedure CheckUnusedVariable; [Public]; begin if (gtk_major_version<>0) then ; if (gtk_minor_version<>0) then ; if (gtk_micro_version<>0) then ; if (gtk_binary_age<>0) then ; if (gtk_interface_age<>0) then ; if (ord(gtk_text_attr_appearance_type)<>0) then ; end; {$ENDIF} function GTK_TYPE_HTML : GType; begin GTK_TYPE_HTML:=gtk_html_get_type; end;//GTK_TYPE_HTML function GTK_HTML(obj: pointer) : PGtkHTML; begin GTK_HTML:=PGtkHTML(GTK_CHECK_CAST(obj,GTK_TYPE_HTML)); end;//GTK_HTML function GTK_HTML_CLASS(klass: pointer) : PGtkHTMLClass; begin GTK_HTML_CLASS:=PGtkHTMLClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_HTML)); end;//GTK_HTML_CLASS function GTK_IS_HTML(obj: pointer) : boolean; begin GTK_IS_HTML:=GTK_CHECK_TYPE(obj,GTK_TYPE_HTML); end;//GTK_IS_HTML function GTK_IS_HTML_CLASS(klass: pointer) : boolean; begin GTK_IS_HTML_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_HTML); end;//GTK_IS_HTML_CLASS end.//unit gtkhtml <<<<<<<<<< end of file gtkhtml.pas <<<<<<<<<<< >>>>>>>>>> the test file, test.pp >>>>>>>>>>>>>>>>>> program test; {$H+} uses glib2, gtk2, gdk2, gtkhtml; var window : PGtkWidget; sw : PGtkWidget; html : PGtkWidget; procedure destroy (window: PGtkWidget; data: gpointer); cdecl; begin gtk_main_quit(); end;//destroy begin gtk_init(@argc,@argv); window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); sw:=gtk_scrolled_window_new(NULL,NULL); gtk_widget_show(sw); gtk_container_add(PGtkContainer(window),sw); html:=gtk_html_new(); gtk_widget_show(html); gtk_scrolled_window_add_with_viewport(PGtkScrolledWindow(sw),html); gtk_widget_show(window); gtk_main(); end.//test <<<<<<<<<< end of file test.pp <<<<<<<<<<< _________________________________________________________ Do You Yahoo!? "是IT精英吗?小试牛刀获时尚大奖!" http://cn.promo.yahoo.com/cgi-bin/udb/u |
From: Mattias G. <nc-...@ne...> - 2002-10-22 13:08:03
|
On Tue, 22 Oct 2002 17:24:50 +0800 mili <mil...@16...> wrote: > Hello, Every one > My program appears weild. Can anybody find the solutions for them? > (1)First problem: > Compile and run the test program, and try to enter some chars into > the > textviewer, then you will find that the codes under "//---1" can > correctly output chars you entered, but the codes under "//---2" can't > give correct results, and sometimes cause the program to crash. I > suspect that the system has not regard "texts: String" as a String but > a PChar. gtk does not know strings. 'texts' must be a PChar. And PChar begins at 0 not at 1 like strings. hope this helps, Mattias > > (2)Second problem: > Now comment the codes under "//---2" so that we can test the > program. Then try to enter some chars, almost all chars will not > cause problems, > but as soon as you press the key of "enter", the program crashes!!! > So perhaps it's the signal & it's handler of "insert_text" that > should be > responsible for these problems. It's very possible that there's a bug > in Gtk2forpascal. > > Thanks, > Yours, > mili > > >>>>>>>> > > program test; > > {$mode objfpc} {$H+} > > uses > glib2, gtk2, gdk2; > > var > window : PGtkWidget; > sw : PGtkWidget; > tv : PGtkWidget; > buffer : PGtkTextBuffer; > > procedure destroy (window: PGtkWidget; data: gpointer); cdecl; > begin > gtk_main_quit(); > end;//destroy > > procedure InsertTextHandler(buffer: PGtkTextBuffer; pos: PGtkTextIter; > texts: String; len: gint; um: gpointer); cdecl; > var > str:String; > i :Integer; > begin > //Actually, I did nothing in this handler > writeln('@ InsertTextHandler'); > //---1 > setlength(str,len); > for i:=1 to len do str[i]:=texts[i]; > writeln('String: ', str); > //---2 > writeln('String: ', texts); > end;//InsertTextHandler > > begin > gtk_init(@argc,@argv); > > window:=gtk_window_new(GTK_WINDOW_TOPLEVEL); > gtk_widget_set_size_request(window,500,400); > gtk_window_set_position(PGtkWindow(window),GTK_WIN_POS_CENTER_ALWAY > S); gtk_window_set_title(PGtkWindow(window),'Test'); > g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); > > sw:=gtk_scrolled_window_new(NULL,NULL); > tv:=gtk_text_view_new(); > buffer:=gtk_text_view_get_buffer(PGtkTextView(tv)); > g_signal_connect(PGOBJECT(buffer), 'insert_text', > TGCallback(@InsertTextHandler), nil); > gtk_container_add(PGtkContainer(sw),tv); > gtk_widget_show(tv); > gtk_widget_show(sw); > gtk_container_add(PGtkContainer(window),sw); > > gtk_widget_show(window); > gtk_main(); > end.//test > > <<<<<<<< > > > > ------------------------------------------------------- > This sf.net emial is sponsored by: Influence the future of > Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) > program now. http://ad.doubleclick.net/clk;4699841;7576301;v? > http://www.sun.com/javavote > _______________________________________________ > Gtk2forpascal-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2forpascal-devel |
From: mili <mil...@16...> - 2002-10-22 12:38:24
|
Hello, Every one My program appears weild. Can anybody find the solutions for them? (1)First problem: Compile and run the test program, and try to enter some chars into th= e=20 textviewer, then you will find that the codes under "//---1" can correctl= y=20 output chars you entered, but the codes under "//---2" can't give correct= =20 results, and sometimes cause the program to crash. I suspect that the sys= tem=20 has not regard "texts: String" as a String but a PChar. (2)Second problem: Now comment the codes under "//---2" so that we can test the program. Then try to enter some chars, almost all chars will not cause problem= s,=20 but as soon as you press the key of "enter", the program crashes!!! So perhaps it's the signal & it's handler of "insert_text" that shoul= d be=20 responsible for these problems. It's very possible that there's a bug in=20 Gtk2forpascal. Thanks, Yours, mili >>>>>>>> program test; {$mode objfpc} {$H+} uses glib2, gtk2, gdk2; var window : PGtkWidget; sw : PGtkWidget; tv : PGtkWidget; buffer : PGtkTextBuffer; procedure destroy (window: PGtkWidget; data: gpointer); cdecl; begin gtk_main_quit(); end;//destroy procedure InsertTextHandler(buffer: PGtkTextBuffer; pos: PGtkTextIter; texts: String; len: gint; um: gpointer); cdecl; var str:String; i :Integer; begin //Actually, I did nothing in this handler writeln('@ InsertTextHandler'); //---1 setlength(str,len); for i:=3D1 to len do str[i]:=3Dtexts[i]; writeln('String: ', str); //---2 writeln('String: ', texts); end;//InsertTextHandler begin gtk_init(@argc,@argv); window:=3Dgtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request(window,500,400); gtk_window_set_position(PGtkWindow(window),GTK_WIN_POS_CENTER_ALWAYS); gtk_window_set_title(PGtkWindow(window),'Test'); g_signal_connect(window,'destroy',TGCallback(@destroy),NULL); sw:=3Dgtk_scrolled_window_new(NULL,NULL); tv:=3Dgtk_text_view_new(); buffer:=3Dgtk_text_view_get_buffer(PGtkTextView(tv)); g_signal_connect(PGOBJECT(buffer), 'insert_text', TGCallback(@InsertTextHandler), nil); gtk_container_add(PGtkContainer(sw),tv); gtk_widget_show(tv); gtk_widget_show(sw); gtk_container_add(PGtkContainer(window),sw); gtk_widget_show(window); gtk_main(); end.//test <<<<<<<< |
From: Mattias G. <nc-...@ne...> - 2002-09-04 13:40:38
|
On 03 Sep 2002 21:35:42 +0200 Olaf Leidinger <le...@ne...> wrote: > Hello list! > > When trying to compile my gtk2 app with the latest version of the units > I get the following undefined reference: > > Compiling ./gtk+/demo/gtk_demo.pas > Assembling gtk_demo > Linking ./gtk+/demo/gtk_demo > [...]/pas/gtk2/gdk2.o: In function `_GDK2$$_GDK_TYPE_DISPLAY': > [...]/pas/gtk2/gdk2.o(.text+0xb07): undefined reference to > `gdk_display_get_type' > [...]/pas/gtk2/gdk2.o: In function `_GDK2$$_GDK_TYPE_SCREEN': > [...]/pas/gtk2/gdk2.o(.text+0xbc7): undefined reference to > `gdk_screen_get_type' Same result under linux. Both functions do not exists in the libs. Just looked in the 2.0.6 sources: Also missing. Mattias |
From: Olaf L. <le...@ne...> - 2002-09-03 19:35:32
|
Hello list! When trying to compile my gtk2 app with the latest version of the units I get the following undefined reference: Compiling ./gtk+/demo/gtk_demo.pas Assembling gtk_demo Linking ./gtk+/demo/gtk_demo [...]/pas/gtk2/gdk2.o: In function `_GDK2$$_GDK_TYPE_DISPLAY': [...]/pas/gtk2/gdk2.o(.text+0xb07): undefined reference to `gdk_display_get_type' [...]/pas/gtk2/gdk2.o: In function `_GDK2$$_GDK_TYPE_SCREEN': [...]/pas/gtk2/gdk2.o(.text+0xbc7): undefined reference to `gdk_screen_get_type' In the win32 gdk-dll I found the following functions: > objdump -x /win/d/WINNT/system32/libgdk-win32-2.0-0.dll | grep gdk_screen [ 302] gdk_screen_height [ 303] gdk_screen_height_mm [ 304] gdk_screen_width [ 305] gdk_screen_width_mm [1762](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x0003f320 _gdk_screen_width [1763](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x0003f330 _gdk_screen_height [1764](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x0003f348 _gdk_screen_width_mm [1765](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x0003f3b0 _gdk_screen_height_mm > objdump -x /win/d/WINNT/system32/libgdk-win32-2.0-0.dll | grep gdk_display [5821](sec 4)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000550 _gdk_display_hdc ************************************************************************************* And on linux there is: > objdump -x /usr/lib/libgdk-x11-2.0.so | grep gdk_screen 0003b0c0 g F .text 00000035 gdk_screen_width_mm 0003b040 g F .text 00000035 gdk_screen_width 0003b100 g F .text 00000035 gdk_screen_height_mm 0003b080 g F .text 00000035 gdk_screen_height > objdump -x /usr/lib/libgdk-x11-2.0.so | grep gdk_display 00058dec g O .data 00000004 gdk_display Well, I don't know why these functions aren't in my gdk-dll/so Has anybody an idea? Ciao, Olaf |
From: Mattias G. <nc-...@ne...> - 2002-08-30 17:56:45
|
On Sat, 31 Aug 2002 01:23:49 +0800 (CST) "mili" <mil...@16...> wrote: > Hi, Everyone > > In gtk2forpascal, TGtkTextSearchFlags is defined as follows: > TGtkTextSearchFlags = ( > GTK_TEXT_SEARCH_VISIBLE_ONLY, > GTK_TEXT_SEARCH_TEXT_ONLY > ); > > Then the following C codes can't be converted to Pascal: > search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; > to > search_flags := GTK_TEXT_SEARCH_VISIBLE_ONLY or GTK_TEXT_SEARCH_TEXT_ONLY; > > Because bit operator can't be operated on enum type. And at the same time, > > gedit_text_iter_forward_search() function in pascal will ask for a enum > type, anything else is unacceptable. So, How can I do? > I think this is a bug of gtk2forpascal, for the developers have not > anticipate the incompatibility between Pascal and C. Pascal knows enums and sets: In c: search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; in pascal: search_flags := [GTK_TEXT_SEARCH_VISIBLE_ONLY,GTK_TEXT_SEARCH_TEXT_ONLY]; Mattias |
From: Olaf L. <le...@ne...> - 2002-08-30 17:56:41
|
Hi In gtk2forpascal, TGtkTextSearchFlags is defined as follows: TGtkTextSearchFlags = ( GTK_TEXT_SEARCH_VISIBLE_ONLY, GTK_TEXT_SEARCH_TEXT_ONLY ); It should work if we define TGtkTextSearchFlags as longint and set the values of GTK_TEXT_... as const. A new version is on cvs. Ciao, Olaf |