Re: Full glib porting onto Android
2011/3/24 Shuxiang Lim shohyang...@gmail.com: Hi,Maarten,thanks a lot! You're right, that's the more appropriate way. Now I've modified the solution and report it to gtk-bugzilla:#645659: https://bugzilla.gnome.org/show_bug.cgi?id=645659 Erm, Bug 645659 - Basic aesthetic improvements to preferences dialog ? Maarten ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Full glib porting onto Android
Hi, On Sun, Mar 27, 2011 at 3:08 PM, Maarten Bosmans mkbosm...@gmail.com wrote: 2011/3/24 Shuxiang Lim shohyang...@gmail.com: Hi,Maarten,thanks a lot! You're right, that's the more appropriate way. Now I've modified the solution and report it to gtk-bugzilla:#645659: https://bugzilla.gnome.org/show_bug.cgi?id=645659 Erm, Bug 645659 - Basic aesthetic improvements to preferences dialog ? Shuxiang, there was a Database server problem and some bugs in bugzilla were lost. So it seems your bug got lost and you have to refile it and reattach the patch, please. Greets José PS: Hurras to our sysadmins to give us bugzilla back :) Maarten ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Timer start registration breaks the gtk_main()
Lex, -Original Message- From: Lex Trotman ele...@gmail.com Sent: Mar 26, 2011 10:47 PM To: iko...@earthlink.net Cc: gtk-list gtk-list@gnome.org Subject: Re: Timer start registration breaks the gtk_main() It is not automagically passed a pointer to an instance of the object (no this) so it will only work if the function does not access any instance members. Which means that every member of the class that will be used by this function should be static. But this is not good. Not if you want more than one instance :-) Which is not the case here. ;-) If you are writing in C++ why don't you use gtkmm, the C++ binding which has the ability to call bound member functions? Originally I wrote my program with wxWidgets, but it was repeatedly crashing without even initializing. But it looks like I will need to do some more work. Well, wxwidgets works too but it is more than just a binding, but gtkmm is the official C++ binding for GTK. Ok, I will look into this. But right now, I need to do the release as it's already late. Thank you all for the help. I will make the function static and see if there is a chance to do that with gtkmm later. Cheers Lex Thank you. Cheers Lex ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Timer start registration breaks the gtk_main()
Hi iko...@earthlink.net, On Sat, 26 Mar 2011 20:45:53 -0700 (GMT-07:00) you wrote: Yes. You are casting the _RESULT_ of a _CALL_ to ReadData into a GSourceFunc, but ReadData returns void. This produces utterly random results. Yes, I believe I made a mistake here. I was not in front of my developmental machine, so... I think the ReadData() is returning gboolean. Perhaps, but a gboolean is most definitely not the same as a GSourceFunc. So I shall reiterate: g_timer_add_seconds( 1, (GSourceFunc) frame-ReadData(), NULL ); ^^ You are casting the _RESULT_ of a _CALL_ to ReadData into a GSourceFunc, but ReadData returns bool. This produces guaranteed illegal results. The second argument of g_timeout_add_seconds is a function pointer, and requires that you pass it a simple C function reference _without_ the call syntax. Unless you're now going to say that you'd misremembered that too, and the actual code doesn't have the () after the frame-ReadData in the line I re-quoted. It would really help us to help you if you had posted your actual code rather than a misremembered vague approximation. Cheers, Rob ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Timer start registration breaks the gtk_main()
On Sat, Mar 26, 2011 at 11:48:38PM -0700, iko...@earthlink.net wrote: Lex, -Original Message- From: Lex Trotman ele...@gmail.com Sent: Mar 26, 2011 10:47 PM To: iko...@earthlink.net Cc: gtk-list gtk-list@gnome.org Subject: Re: Timer start registration breaks the gtk_main() It is not automagically passed a pointer to an instance of the object (no this) so it will only work if the function does not access any instance members. Which means that every member of the class that will be used by this function should be static. But this is not good. Not if you want more than one instance :-) Which is not the case here. ;-) To make that finally clear, thats why the signal functions pass a data pointer. So to use C++ you can always either pass the object into the static function: class CFrame { static gboolean ReadData(CFrame* me); }; /* ... */ g_timeout_add_seconds(1,(GSourceFunc)CFrame::ReadData,frame); or I would prefer to leave the C++ alone and write a small wrapper frame_ReadData(CFrame* f) { return f-ReadData(); } /* ... */ g_timeout_add_seconds(1,(GSourceFunc)frame_ReadData,frame); ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Timer start registration breaks the gtk_main()
Ingo, -Original Message- From: Ingo Krabbe ikrabbe@gmail.com Sent: Mar 27, 2011 12:33 AM To: gtk-list@gnome.org Subject: Re: Timer start registration breaks the gtk_main() On Sat, Mar 26, 2011 at 11:48:38PM -0700, iko...@earthlink.net wrote: Lex, -Original Message- From: Lex Trotman ele...@gmail.com Sent: Mar 26, 2011 10:47 PM To: iko...@earthlink.net Cc: gtk-list gtk-list@gnome.org Subject: Re: Timer start registration breaks the gtk_main() It is not automagically passed a pointer to an instance of the object (no this) so it will only work if the function does not access any instance members. Which means that every member of the class that will be used by this function should be static. But this is not good. Not if you want more than one instance :-) Which is not the case here. ;-) To make that finally clear, thats why the signal functions pass a data pointer. So to use C++ you can always either pass the object into the static function: class CFrame { static gboolean ReadData(CFrame* me); }; /* ... */ g_timeout_add_seconds(1,(GSourceFunc)CFrame::ReadData,frame); or I would prefer to leave the C++ alone and write a small wrapper frame_ReadData(CFrame* f) { return f-ReadData(); } /* ... */ g_timeout_add_seconds(1,(GSourceFunc)frame_ReadData,frame); Shouldn't it be: static frame_ReadData(CFrame *f) { return f-ReadData(); } ? Thank you. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Timer start registration breaks the gtk_main()
replied too fast... - Forwarded message from Ingo Krabbe ikrabbe@gmail.com - static frame_ReadData(CFrame *f) { return f-ReadData(); } Actually and fully you will need static gboolean frame_ReadData(CFrame* f) { return f-ReadData(); } Note that frame_ReadData is a C function, so that static means something different than in the C++ class context. Actually nothing speaks against using an extern function, though it might make not much sense to export such a simple, locally used function. - End forwarded message - ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Timer start registration breaks the gtk_main()
On Sat, 26 Mar 2011 20:27:04 -0700 (GMT-07:00) iko...@earthlink.net wrote: Yes, ReadData() is a non-static class member function. Illegal casts to avoid compilation failure has, as you can tell, not saved you here. So in order to fix it, I need to use 'static' in front of 'void ReadData()'? You should most properly use a plain function with C linkage as the callback. If you want to access instance (non-static) data you need to pass in an instance pointer; and if it needs to access private data it should be made a friend. Basically what you want is something like this: // *** header file *** extern C gboolean cframe_read_data(void* data); class CFrame { ... public: ... gboolean ReadData(); }; // *** implementation file *** gboolean cframe_read_data(void* data) { return static_castCFrame*(data)-ReadData(); } int main() { ... CFrame* cf = new CFrame; g_timer_add_seconds( 1, cframe_read_data, cf); ... } This is all very basic C/C++ Chris ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Gtk+ 3.0 and MS Windows
2011/3/25 Mikhail Titov m...@gmx.us: Maarten: Thanks again! It worked like magic. I'm not sure if I was supposed to get a bunch of dot cpio files in cache/extracted/ folder. I have 7-zip 9.20. Anyway I selected all of them and did 7-zip - extract here from explorer. However when I try to run demo I get the following message. That's great. The rpm indeed contain a cpio file, so you have to unpack twice. The script I sent the link to does this for you. -8-- C:\...che\extracted\usr\i686-w64-mingw32\sys-root\mingw\bingtk3-demo.exe ** Gtk:ERROR:gtksettings.c:558:gtk_settings_class_init: assertion failed: (result == PROP_ALTERNATIVE_BUTTON_ORDER) This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -8-- Is there something missing, or is it a known issue? It doesn't matter if I change gtk-alternative-button-order to 1 or 0 in gtkrc of MS-Windows theme. If I understand your other mail correctly, you are combining binaries from OBS and those provided on ftp.gnome.org. I'm not entirely sure, but it could be that gives problems. So try downloading all dependencies from OBS. The script I sent the link to does this for you. Mikhail So you also got your own build going, great! You may also want to try downloading -devel packages of the dependencies from the OBS for linking your own build of Gtk+ 3. Not sure that would give better results though. Maarten ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
RE: Gtk+ 3.0 and MS Windows
Maarten: 1) I was not exactly mixing different sources of windows binaries. I just tried different approaches on how I can get binary GTKMM 2.99 for MSVC in the fastest way. 2) I can't build Gtk+ 3.0.6 ( 3.0.5) from the source against OpenSUSE binaries for some reason as I get some weird errors like c:\gtkmm3\include\glib-2.0\glib\gutils.h(146) : error C2143: syntax error : missing '{' before 'const' I have OpenSUSE binaries in c:\gtkmm3\ . But Gtk+ 3.0.5 builds just fine against binaries from gnome project's ftp if I add libmsvcrt.a from MinGW into gtk-demo project. Also I had to change path to demos in main.c around line 48 as it points to old gtk. 3) I was able to link and run successfully very simple tests against OpenSUSE binaries for Glib with MS VC++ 2008. Although I had also to link against libmsvcrt.a from MinGW as by default it was linking against another runtime library as was correctly pointed by Fan. Without it, simple IO with g_fopen() and fgets() were failing. 4) However I completely forgot that OpenSUSE binaries and MSVC++ can work for good old plain C only as C++ name mangling is different between compilers. As a result, to get GTKMM I have to follow instructions http://live.gnome.org/gtkmm/MSWindows/BuildingGtkmm (Now I know why there is a delay in a binary release :-) ). It all was built and linked correctly, however for some reason resulting glibmm dll is broken as it is looking for GModule's export in Glib's dll which is nonsense. So I can't run simple example that calls Glib::Module::get_supported(); , but plain old C interface to Glib like g_module_build_path() works just fine. I don't know what messes up libs. Oh well.. it is outside of the scope of this list :-) Mikhail -Original Message- From: Maarten Bosmans [mailto:mkbosm...@gmail.com] Sent: Sunday, March 27, 2011 2:08 PM To: Gtk+ list Cc: Mikhail Titov Subject: Re: Gtk+ 3.0 and MS Windows 2011/3/25 Mikhail Titov m...@gmx.us: Maarten: Thanks again! It worked like magic. I'm not sure if I was supposed to get a bunch of dot cpio files in cache/extracted/ folder. I have 7-zip 9.20. Anyway I selected all of them and did 7-zip - extract here from explorer. However when I try to run demo I get the following message. That's great. The rpm indeed contain a cpio file, so you have to unpack twice. The script I sent the link to does this for you. -8-- C:\...che\extracted\usr\i686-w64-mingw32\sys-root\mingw\bingtk3-demo. exe ** Gtk:ERROR:gtksettings.c:558:gtk_settings_class_init: assertion failed: (result == PROP_ALTERNATIVE_BUTTON_ORDER) This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -8-- Is there something missing, or is it a known issue? It doesn't matter if I change gtk-alternative-button-order to 1 or 0 in gtkrc of MS-Windows theme. If I understand your other mail correctly, you are combining binaries from OBS and those provided on ftp.gnome.org. I'm not entirely sure, but it could be that gives problems. So try downloading all dependencies from OBS. The script I sent the link to does this for you. Mikhail So you also got your own build going, great! You may also want to try downloading -devel packages of the dependencies from the OBS for linking your own build of Gtk+ 3. Not sure that would give better results though. Maarten ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
RE: Gtk+ 3.0 and MS Windows
2) It turned out that glibconfig.h from OpenSUSE is not MSVC friendly. Perhaps it redefines something important. I took that from gnome's ftp win32 binary. From quick look at the diff output, there is not much difference other than MS specifics in #ifdef blocks. Now at least gdk-win32 compiles. Mikhail -Original Message- From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf Of Mikhail Titov Sent: Sunday, March 27, 2011 6:20 PM To: 'Maarten Bosmans'; 'Gtk+ list' Subject: RE: Gtk+ 3.0 and MS Windows Maarten: 1) I was not exactly mixing different sources of windows binaries. I just tried different approaches on how I can get binary GTKMM 2.99 for MSVC in the fastest way. 2) I can't build Gtk+ 3.0.6 ( 3.0.5) from the source against OpenSUSE binaries for some reason as I get some weird errors like c:\gtkmm3\include\glib-2.0\glib\gutils.h(146) : error C2143: syntax error : missing '{' before 'const' I have OpenSUSE binaries in c:\gtkmm3\ . But Gtk+ 3.0.5 builds just fine against binaries from gnome project's ftp if I add libmsvcrt.a from MinGW into gtk-demo project. Also I had to change path to demos in main.c around line 48 as it points to old gtk. 3) I was able to link and run successfully very simple tests against OpenSUSE binaries for Glib with MS VC++ 2008. Although I had also to link against libmsvcrt.a from MinGW as by default it was linking against another runtime library as was correctly pointed by Fan. Without it, simple IO with g_fopen() and fgets() were failing. 4) However I completely forgot that OpenSUSE binaries and MSVC++ can work for good old plain C only as C++ name mangling is different between compilers. As a result, to get GTKMM I have to follow instructions http://live.gnome.org/gtkmm/MSWindows/BuildingGtkmm (Now I know why there is a delay in a binary release :-) ). It all was built and linked correctly, however for some reason resulting glibmm dll is broken as it is looking for GModule's export in Glib's dll which is nonsense. So I can't run simple example that calls Glib::Module::get_supported(); , but plain old C interface to Glib like g_module_build_path() works just fine. I don't know what messes up libs. Oh well.. it is outside of the scope of this list :-) Mikhail -Original Message- From: Maarten Bosmans [mailto:mkbosm...@gmail.com] Sent: Sunday, March 27, 2011 2:08 PM To: Gtk+ list Cc: Mikhail Titov Subject: Re: Gtk+ 3.0 and MS Windows 2011/3/25 Mikhail Titov m...@gmx.us: Maarten: Thanks again! It worked like magic. I'm not sure if I was supposed to get a bunch of dot cpio files in cache/extracted/ folder. I have 7-zip 9.20. Anyway I selected all of them and did 7-zip - extract here from explorer. However when I try to run demo I get the following message. That's great. The rpm indeed contain a cpio file, so you have to unpack twice. The script I sent the link to does this for you. -8-- C:\...che\extracted\usr\i686-w64-mingw32\sys-root\mingw\bingtk3-demo. exe ** Gtk:ERROR:gtksettings.c:558:gtk_settings_class_init: assertion failed: (result == PROP_ALTERNATIVE_BUTTON_ORDER) This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -8-- Is there something missing, or is it a known issue? It doesn't matter if I change gtk-alternative-button-order to 1 or 0 in gtkrc of MS- Windows theme. If I understand your other mail correctly, you are combining binaries from OBS and those provided on ftp.gnome.org. I'm not entirely sure, but it could be that gives problems. So try downloading all dependencies from OBS. The script I sent the link to does this for you. Mikhail So you also got your own build going, great! You may also want to try downloading -devel packages of the dependencies from the OBS for linking your own build of Gtk+ 3. Not sure that would give better results though. Maarten ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
RE: Gtk+ 3.0 and MS Windows
Just in case someone is following :-) I was able to successfully build GTK+ 3.0.6 using MS VC++ 2008 Express using underlying OpenSUSE win32 binaries. I had to play around with nm.exe and lib.exe (MS proprietary tool) to generate missing dot def files as a usage of gcc libraries (.dll.a) resulted in a weird behavior (like import of symbols from improper dll as I reported before). Gtk-demo.exe runs mostly okay though toolbar icons are not redrawn after menu popup and it dumps sometimes warnings. Tool Palette demo is glitchy in sense of icons. Entry, Icon View, Text Widget demos don't show up at all. Pickers demo fails with GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed I don't have much spare time, but I'll try to summarize what should be done to utilize cross-compiled binaries (like from OpenSUSE) to build stuff using MS VC++. I guess it would be substantial time saver not to manually build dependencies under MS Windows. Here is the python script I used to convert libraries from gcc to MSVC format: -8-- import os,re,sys,shutil from os.path import join, getsize from subprocess import Popen, PIPE os.environ['PATH'] = os.environ['PATH'] + ;C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\\;C:\\MinGW\\bin #gendef = C:\\workspace\\glibmm-2.27.99\\MSVC_Net2008\\gendef\\Win32\\Debug\\gendef.exe #dll = re.sub(.a, , lib) #output = Popen([gendef, d, dll, lib], stdout=PIPE).communicate()[0] def gen(dll): name = re.sub(^lib, , dll) name = re.sub((?:-\\d).dll, , name) #shutil.copyfile(lib, name + .lib) print(Working on %s\n % dll) output = Popen([nm, lib%s.dll.a % name], stdout=PIPE).communicate()[0] d = %s.def % name with open(d, wb) as f: f.write(bEXPORTS\n) for line in output.split(b\r\n): if (re.match(b.* T _|.* I __nm, line)): #|.* I __imp line = re.sub(b^.* T _|^.* I __nm__, b, line) #|^.* I _ f.write(line + b\n) f.write(str.encode(LIBRARY %s\n % dll)) p = Popen([lib, /def:%s % d]) #, shell = True) root = C:\\workspace\\gtk\\usr\\i686-w64-mingw32\\sys-root\\mingw os.chdir(root + \\lib) for root, dirs, files in os.walk(root + \\bin): for name in files: if (re.search(.dll, name)): print(Processing: %s\n % name) gen(name) #gen(libatk-1.0-0.dll) # glibmm-2.4.def libglibmm-2.4-1.dll libglibmm-2.4.dll.a # dumpbin /SYMBOLS /OUT:dumpbin.out libglibmm-2.4.dll.a -8-- Mikhail -Original Message- From: Mikhail Titov [mailto:m...@gmx.us] Sent: Sunday, March 27, 2011 7:57 PM To: 'Mikhail Titov'; 'Maarten Bosmans'; 'Gtk+ list' Subject: RE: Gtk+ 3.0 and MS Windows 2) It turned out that glibconfig.h from OpenSUSE is not MSVC friendly. Perhaps it redefines something important. I took that from gnome's ftp win32 binary. From quick look at the diff output, there is not much difference other than MS specifics in #ifdef blocks. Now at least gdk-win32 compiles. Mikhail -Original Message- From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf Of Mikhail Titov Sent: Sunday, March 27, 2011 6:20 PM To: 'Maarten Bosmans'; 'Gtk+ list' Subject: RE: Gtk+ 3.0 and MS Windows Maarten: 1) I was not exactly mixing different sources of windows binaries. I just tried different approaches on how I can get binary GTKMM 2.99 for MSVC in the fastest way. 2) I can't build Gtk+ 3.0.6 ( 3.0.5) from the source against OpenSUSE binaries for some reason as I get some weird errors like c:\gtkmm3\include\glib-2.0\glib\gutils.h(146) : error C2143: syntax error : missing '{' before 'const' I have OpenSUSE binaries in c:\gtkmm3\ . But Gtk+ 3.0.5 builds just fine against binaries from gnome project's ftp if I add libmsvcrt.a from MinGW into gtk-demo project. Also I had to change path to demos in main.c around line 48 as it points to old gtk. 3) I was able to link and run successfully very simple tests against OpenSUSE binaries for Glib with MS VC++ 2008. Although I had also to link against libmsvcrt.a from MinGW as by default it was linking against another runtime library as was correctly pointed by Fan. Without it, simple IO with g_fopen() and fgets() were failing. 4) However I completely forgot that OpenSUSE binaries and MSVC++ can work for good old plain C only as C++ name mangling is different between compilers. As a result, to get GTKMM I have to follow instructions http://live.gnome.org/gtkmm/MSWindows/BuildingGtkmm (Now I know why there is a delay in a binary release :-) ). It all was built and linked correctly, however for some reason resulting glibmm dll is broken as it is looking for GModule's export in Glib's dll which is nonsense. So I can't run simple example that calls