Shall GtkAllocation be initialized before use?

2011-09-08 Thread Mikhail Titov
I’ve noticed that I’m getting the following errors with Gtk+ 
(3.1.18-23-gb53a66b) and MS VC++. Am I missing something during the build 
process or indeed those variables are not initialized? Can I simply ignore 
run-time checks? Exception occurs around line 2169 in gtktreeviewcolumn.c when 
calling gdk_window_move_resize() from gtk3-demo.exe .

>8--8<
---
Microsoft Visual C++ Debug Library
---
Debug Error!

Program: C:\gtkmm\bin\gtk3-demo.exe
Module: C:\gtkmm\bin\gtk-3.1-vc90-d.dll
File: 

Run-Time Check Failure #3 - The variable 'allocation' is being used without 
being initialized.

(Press Retry to debug the application)
---
Abort   Retry   Ignore   
---
>8--8<

I can avoid this error with something like

>8--8<
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index af79da7..f8a32a3 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2138,7 +2138,7 @@ _gtk_tree_view_column_allocate (GtkTreeViewColumn 
*tree_column,
intwidth)
 {
   GtkTreeViewColumnPrivate *priv;
-  GtkAllocation allocation;
+  GtkAllocation allocation = {0};
   gboolean  rtl;
 
   g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
>8--8<

Mikhail



___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


win32: A better way to draw HCURSOR with Cairo?

2011-06-07 Thread Mikhail Titov
Hi all!

 

I’d like to draw as much as I can using Cairo. However at some point I need to 
draw a cursor obtained from ::GetCursor() Win32 API function. Hence the 
question: what is the best way to draw it on Cairo context?

 

In gtk+/gdk/win32/gdkcursor-win32.c I can see a function like

 

static GdkCursor*

cursor_new_from_hcursor (HCURSOR   hcursor,

GdkCursorType cursor_type)

 

but I feel like it won’t help me much. First it is not exported and second I’m 
not sure if Cairo can draw it.

 

Do I understand right that virtually the only way is to ::GetIconInfo() for 
that HCURSOR and then call ::GetDIBits() to retrieve bitmap data and then to 
create pixbuf from that data somehow?

 

P.S. I’m using gtkmm 3.0 and latest gtk+ (3.1.4) from GIT if it makes any 
difference.

 

Mikhail

 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Full screen app events

2011-04-22 Thread Mikhail Titov
First of all you didn’t mention your OS. In my understanding this lies
beneath gtk level. Long time ago I ended up writing device filter drivers to
eat all events completely on MS Window 98. It resulted in predictable café
customers behavior. In spite of the message box they thought computer is
frozen and kept rebooting it. After n-th attempt they talked to
administrator.

For linux, I guess you have to hack X. Google is your helper
http://www.mail-archive.com/xorg@lists.freedesktop.org/msg12525.html

Mikhail

From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On
Behalf Of Juan Antonio Ibanez Santorum
Sent: Friday, April 22, 2011 11:27 AM
To: gtk-list@gnome.org
Subject: Full screen app events

Hello!

   Is there any way to consume keyboard and mouse events in a GTK app? I
want to develop an internet cafe app and I must 'block' the computer once
the prepaid gets out using a full screen blocking window. The user must no
be able to bypass the blocking window using any keyboard shortcut. Any
advice on this?

Regards

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


gtk+ 3.1.2/git & MSVC++: GDK_IS_WIN32_WINDOW @ gtkclipboard.c causes troubles

2011-04-13 Thread Mikhail Titov
Hello!

I noticed recently, when I was building either git version or 3.1.2 using MS 
VC++, that I’m getting hard times with GDK_IS_WIN32_WINDOW. It is only 
mentioned in "C:\obs\gtk+-3.1.2\gdk\win32\gdkwin32window.h" and recently was 
introduced in gtkclipboard.c . I just can’t build with it, however once I get 
rid of it, everything builds just fine both git version of gtk+ and 3.1.2 . 

The problem arises when I build gtk-win32-vc90-d-3.1.dll :
gtkclipboard.c.obj : error LNK2019: unresolved external symbol 
_gdk_win32_window_get_type referenced in function _clipboard_get_timestamp
gtk-win32-vc90-d-3.1.dll : fatal error LNK1120: 1 unresolved externals

I can’t find where `gdk_win32_window_get_type` is defined. I see only ` 
gdk_win32_window_get_type_hint` in gdkwindow_win32.c and ` GType
gdk_win32_window_get_type  (void);` in gdkwin32window.h . Is it 
supposed to be generated somewhere?

Am I doing something wrong? I’m not sure if it is because I’m using mingw 
binary dependencies from OBS for gtk+ or something else. The simple change to 
pre 3.1.2 version like the following fixes everything

$ diff -urN gtk/gtkclipboard.c.orig gtk/gtkclipboard.c
--- gtk/gtkclipboard.c.orig 2011-04-13 08:38:18 -0500
+++ gtk/gtkclipboard.c  2011-04-14 00:28:57 -0500
@@ -493,7 +493,7 @@
   else
 #endif
 #if defined GDK_WINDOWING_WIN32
-  if (GDK_IS_WIN32_WINDOW (window))
+  if (1)
{
  timestamp = GetMessageTime ();
}

P.S. I’ll update git-friendly CMakeLists.txt for native Win32 build using 
MSVC++ in Wiki in a while if someone is interested.

Mikhail



___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Question about GTK+ and timers

2011-04-08 Thread Mikhail Titov
I guess the main point it should just work for x86 and certain ARM
architecture. Everything else doesn't matter, including efficiency,
especially if one side is already implemented in a particular way.

Yes, structure packing is compiler-specific. In case of Visual C++ one uses
#pragma, but I feel like OP uses gcc in both cases. So here comes the syntax
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Type-Attributes.html#Type-Attrib
utes

I just learned that ARM is bi-endian and can be set up either way. Haven't
ever had to deal with these creatures. And that is what endianness is
usually about. If you are unlucky the order of 2 bytes of m_voltageMask may
be incorrect, in this case you would receiver char[10] first, reverse it,
and have a packed structure defined with the inverse order of members. See
also http://linux.die.net/man/3/htons .

Mikhail


> -Original Message-
> From: Chris Vine [mailto:ch...@cvine.freeserve.co.uk]
> Sent: Friday, April 08, 2011 7:02 PM
> To: Mikhail Titov
> Cc: 'Igor Korot'; gtk-list@gnome.org
> Subject: Re: Question about GTK+ and timers
> 
> On Fri, 8 Apr 2011 18:36:41 -0500
> "Mikhail Titov"  wrote:
> > Just use something like __attribute__ ((__packed__)) for your
> > structure and you can always cast back and forth from the pointer to
> > your structure to an array of bytes (char*). Just make sure that both
> > systems have same ending (little or big) and that members' order is
> > correct. Otherwise you'll have to swap data within let's say
> > m_voltageMask .
> 
> This attribute is compiler specific.  He would also have to be careful
> to avoid breaking strict aliasing with his casting, or he could have the
> compiler "optimize" away some of his code. It is relatively easy to
> avoid that (make sure you start with the type you finish with), but I
> am not convinced the OP is necessarily up to speed on how to do it
> defensively.
> 
> Because this provides unaligned access (on gcc) it can also be
> significantly inefficient on particular architectures.
> 
> Chris
> 


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Question about GTK+ and timers

2011-04-08 Thread Mikhail Titov
Just use something like __attribute__ ((__packed__)) for your structure and
you can always cast back and forth from the pointer to your structure to an
array of bytes (char*). Just make sure that both systems have same ending
(little or big) and that members' order is correct. Otherwise you'll have to
swap data within let's say m_voltageMask .

Mikhail


> -Original Message-
> From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On
> Behalf Of Igor Korot
> Sent: Friday, April 08, 2011 5:43 PM
> To: gtk-list@gnome.org
> Subject: Re: Question about GTK+ and timers
> >> Is it possible to use m_data with GIOChannel?
> >
> > of course.
> >
> > but you'd better hope that the compiler packs that data structure in
> > the same way the device is sending it. you'd be far better off not
> > using a struct for this, but just reading (in your case) 10 bytes.
> >
> > sending raw C structs over any kind of "wire protocol" almost always
> > turns out to be huge mistake unless its been very carefully thought
> > about.
> 
> 
> So best way is to use char m_data[10]?
> 
> And then just get m_data[4], m_data[5], m_data[6], m_data[7],
> m_data[8] and m_data[9]?
> 
> I am getting bytes over the wire thru the serial port and transfer is
> performed on the client side.
> 
> read( handle, &m_data, 10 );
> 
> I am just getting 10 bytes which are represented on the client as
> m_data members.
> 
> Am I wrong here? It's possible there will be a packing issue, but I'm
> about to test this.
> 
> 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: Question about GTK+ and timers

2011-04-08 Thread Mikhail Titov
As far as I understand it is possible to use it with NULL for encoding. It
should just read bytes with no interpretation.

http://www.mail-archive.com/gtk-list@gnome.org/msg29589.html

Mikhail


> -Original Message-
> From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On
> Behalf Of Igor Korot
> Sent: Friday, April 08, 2011 3:54 PM
> To: gtk-list@gnome.org
> Subject: Re: Question about GTK+ and timers
> ...
> I decided to not to use GIOChannel.
> You can only use it if I need to read string, but I need to read data
> in a structure.

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Keep dialogs open and running even if clicking OK

2011-04-08 Thread Mikhail Titov
While I'm using gtkmm I can override MyDialog::on_response(int id) and don't 
call hide() there. I feel like there should be something inside plain gtk+ as 
well to validate result within dialog and not a main application.

I guess you can handle signal response not to close dialog at the first place 
if you don't like an idea of rerunning it.

Mikhail


-Original Message-
From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of Paul Everlund
Sent: Friday, April 08, 2011 8:07 AM
To: Lex Trotman; gtk-list
Subject: RE: Keep dialogs open and running even if clicking OK

Thank you Lex!

It had also crossed my mind to move the validation to the main app, but of some 
reason I thought it would be neater to have it where it actually should be 
taken care of. But your solution will work perfectly ok, and actually also, 
when I think about it, look quite nice.

So, once again, thank you! And thank you for pointing things out about the 
delete-event. :o)

Best regards,
Paul


-- Forwarded message --
From: Lex Trotman 
Date: 8 April 2011 21:41
Subject: Re: Keep dialogs open and running even if clicking OK
To: Paul Everlund 


[...]
> Some pseudo/real-code maybe describes it better:
>
> class MainApp
>  def initialize()
>@glade = GladeXML.new(bla, bla, bla) {|handler| method(handler)}
>  end
>
>  def on_menuUserPassword_activate(widget)
>gUP = UserPasswordDlgGlade.new()
>dlg = gUP.get_widget("UPDlg")
>dlg.show()
>result = dlg.run()

Suggest you do the validation here and if it fails, show the fail message then 
loop back to dlg.run to give them another go, note you haven't hidden the 
dialog yet so the user won't see any change.

Go on to hide and destroy the dialog when the UP is correct or give up.

>dlg.hide()
>  end
> end
>
> // Get the main app up and running.
> MainApp.new()
> Gtk.main
>
> class UserPasswordDlgGlade
>  def initialize()
>@glade = GladeXML.new(bla, bla, bla) {|handler| method(handler)}
>  end
>
>  def on_btnApply_clicked(widget)
>Get the user and password from the widget entries
>If user and password were not valid

do this in main

>  gMsg = MessageDlgGlade.new()
>  dlg = gMsg.get_widget("MsgDlg")
>  dlg.show()
>  dlg.run()
>  dlg.close()
>  If here the user clicked the message dialog's OK button, and we should 
> disregard the Apply click on this UPDlg, and let the user correct the input.
>else
>  The user and password was correct, so now we should actually return the 
> Apply response code to the MainApp.
>end
>  end
>
>  def on_UPDlg_delete_event(a, b, c)
>Here was where I tried to keep the UPDlg still running, by returning 
> either TRUE or FALSE, but it never seemed to  enter this function, even 
> though I connected this signal in Glade.
>  end
> end

As documented, delete isn't emitted on dialogs:

"If a dialog receives a delete event, the "response" signal will be emitted 
with a response ID of GTK_RESPONSE_DELETE_EVENT. "

Cheers
Lex
___
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

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-04-03 Thread Mikhail Titov
Fan:

Thanks for the feedback!

1. I'll make corrections it if you didn't make it ahead of me.

2. Hmm.. so why all pragmas and defines from msvc_recommended_pragmas.h are not 
in property file (gtk+.vsprops)? It is just a few flags that turn all the noise 
on the console off.

3. As far as I understand it should be possible to safely add if/else 
preprocessor block to glibconfig.h.in so it will be MSVC-friendly in any case. 
It won't hurt other builds.

4. I saw your post in bugzilla about MSVC2010 files generated from template. 
Theoretically I guess it can be done with CMakeLists.txt as well.

5. In my understanding everyone is happy with autotools on all platforms but 
native Win32 builds. If so, will it hurt to keep few files around solely for 
native Win32 builds? Considering all pros for Win32 platform, I guess there 
should be no objections as they won't interfere with autotools.

I started it all just because I wanted to follow gtkmm development.
1. There are no official MSVC++ binaries for gtkmm 2.99
2. It is a pain to get custom ones especially for newcomers
3. There is no way to cross-build gtkmm for MS VC++ because of different name 
mangling
4. Library naming for gtkmm libraries is different than for gtk+ anyway. 
Furthermore (import) library name suffixes/postfixes can be easily changed in 
CMakeLists.txt  as I intentionally tried to mimic gtkmm appearance. And I guess 
few import library namings can be kept around by simple copying.

In overall, I'd like to see the possibility to stay up to date with gtkmm and 
all the stuff from git and build it as easy as typing nmake. I know this is the 
wrong list, but I had to start with gtk+ :-)

Mikhail


-Original Message-
From: Fan Chun-wei [mailto:fanc...@yahoo.com.tw] 
Sent: Sunday, April 03, 2011 11:14 PM
To: Mikhail Titov
Cc: gtk-list@gnome.org
Subject: RE: Gtk+ 3.0 and MS Windows

Hello Mikhail,

I read through your wiki post and I think the information you have there is 
quite helpful and informative for those intending to build GTK+-3.x with the 
OBS dependencies-thanks for that really, as it may not be clear on how to build 
the GTK+ stack with VS at the moment.  I think I should/would, if possible, 
also follow suit for writing a Wiki post on how to compile the GTK+ and perhaps 
the Clutter stack (GLib, Cairo, ATK, Pango, GDK-Pixbuf, GTK+ 2.24.x/3.x, 
JSON-GLib, Clutter) with their dependencies from VS 2008/2010 as far as 
possible, which means avoiding as much as possible to mix different CRTs, so it 
avoids the problem that you have mentioned (correctly) about usage of g_fopen 
etc.

This may take a while as 1)time constraints and 2)some packages are not yet 
shipping the VS 2008/2010 files due to different release cycles and/or some 
components are pending review.

Some things I would like to point out in your Wiki post, to clarify some issues:
1. There should no longer be need to change in the "additional include 
   path" for the $(GlibEtcInstallRoot)\include\Gdk-Pixbuf-2.0 as of 
   GTK+3.0.7, as that was updated upstream (thanks for pointing that out
   to me so that I could fix the discrepancy).
2. Seems that msvc_recommended_pragmas.h is not included in the OBS builds,
   that is the file which does the job to filter out non-essential VS
   warnings but keep people on the lookout for warnings which could likely
   cause trouble.  This is a file included in the source and binary 
   tarballs from ftp.gnome.org.
3. Since OBS binaries are cross-compiled for MinGW, the glibconfig.h was
   generated there, so that is why it is not VS friendly.  This may also
   be why pango-view looks for X, not native Win32/Cairo items (cross-
   compiler configure bug?)...
4. If people are wondering about the current *.sln/*.vcproj files, the
   file listings for compiling parts where the source files are 
   added/removed often are put into the template *.vcproj files when a
   stable/unstable source tarball is released, so this greatly simplifies 
   their maintenance-so the *.vcproj (or their templates) don't have to be 
   changed that often upstream, and the correct source files are placed in 
   the appropriate projects.  It was tml who came up with this strategy
   for the VS project files, so I carried on with that strategy.
5. Thanks much for the CMake items-but I am not entirely sure whether that
   will be accepted upstream in a review by other devs-and that is the 
   reason I said "no" for the moment-especially the naming would be an 
   issue for the *.lib files at least as there are many people using GTK+ 
   and its GNOME deps out there on Windows.

Hope this helps to clear some questions that may be involved, and thanks very 
much for the informative post.

God Bless,
-Fan, Chun-wei

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-04-03 Thread Mikhail Titov
All:

I added a Wiki page [1] as well as template CMake project for native Win32 
build.
Yes, I know there is a reluctance to use CMake, but at least I propose to use 
it for Win32 builds. It is easier to use command line to rebuild yet another 
version of gtk+ rather than clicking on a bunch of settings in IDE. Furthermore 
CMake way allows to use versions of MSVC++ other than vc9.

[1] http://live.gnome.org/GTK%2B/Win32/NativeBuildWithOBS

Mikhail

-Original Message-
From: javierjc1...@gmail.com [mailto:javierjc1...@gmail.com] On Behalf Of 
Javier Jardón
Sent: Tuesday, March 29, 2011 1:06 PM
To: Mikhail Titov
Cc: Maarten Bosmans; Gtk+ list
Subject: Re: Gtk+ 3.0 and MS Windows

On 28 March 2011 06:43, Mikhail Titov  wrote:
>
> 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.

Hey Mikhail,

Feel free to use the wiki page [1] for this, so It can be useful for other 
people in the future.

[1] http://live.gnome.org/GTK+/Win32/
--
Javier Jardón Cabezas

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-28 Thread Mikhail Titov
Here is the proof that it is possible to use OBS dependencies and build later 
stuff like GTKMM with MSVC++.

http://img189.imageshack.us/img189/7503/gtkmm299msvcnet2008obs.png

I finally got GTKMM with support for RGBA!
Note that TreeView doesn't always draw a triangle, so I was hopelessly double 
clicking on it before :-)
Picker demo still gives me that error. I file like I've built something 
incorrectly.

Thanks again for all your suggestions and pointing me to OBS! My problem is 
solved. Now I can enjoy all benefits of 3rd version and hopefully by the time I 
decide to release my code, GTK(MM) 3 become mature :-)

P.S. I didn't try to build GTKMM using GTK from OBS, but GTK demo from OBS 
fails to launch.

Mikhail


-Original Message-
From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of Mikhail Titov
Sent: Monday, March 28, 2011 12:44 AM
To: 'Maarten Bosmans'; 'Gtk+ list'
Subject: 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(b"EXPORTS\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 windo

RE: Gtk+ 3.0 and MS Windows

2011-03-27 Thread Mikhail Titov
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(b"EXPORTS\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 b

RE: Gtk+ 3.0 and MS Windows

2011-03-27 Thread Mikhail Titov
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 :
> > 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\bin>gtk3-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

2011-03-27 Thread Mikhail Titov
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 :
> 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\bin>gtk3-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

2011-03-25 Thread Mikhail Titov
Fan:

I downloaded Gtk+ 3.0.5, as well as these prerequisites 
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip
http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.1-1_win32.zip
http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib-dev_2.28.1-1_win32.zip

I unpacked tarball and did not run ./configure or anything from msys. I opened 
solution in MS VC++ 2008 Express and I had to change few things in gtk+.vsprops 
namely:
GlibEtcInstallRoot
ForcedIncludeFiles="msvc_recommended_pragmas.h"
$(GlibEtcInstallRoot)\include\GdkPixbuf-2.0  -> 
$(GlibEtcInstallRoot)\include\Gdk-Pixbuf-2.0

And again gdk-win32 project compiles nice. However gdk build now gives this:

Linking...
   Creating library 
C:\workspace\gtk+-3.0.5\build\win32\vs9\Debug\Win32\bin\gdk-win32-3.0.lib and 
object C:\workspace\gtk+-3.0.5\build\win32\vs9\Debug\Win32\bin\gdk-win32-3.0.exp
gdkwindow.obj : error LNK2019: unresolved external symbol 
__imp__cairo_gobject_surface_get_type referenced in function 
_gdk_window_class_init
C:\workspace\gtk+-3.0.5\build\win32\vs9\Debug\Win32\bin\gdk-win32-3-vs9.dll : 
fatal error LNK1120: 1 unresolved externals
Build log was saved at 
"file://C:\workspace\gtk+-3.0.5\build\win32\vs9\Debug\Win32\obj\BuildLog.htm"


I had to create libcairo-gobject.lib with the following

-8<
EXPORTS
cairo_gobject_context_get_type
cairo_gobject_pattern_get_type
cairo_gobject_surface_get_type
LIBRARY libcairo-gobject-2.dll
-8<

and add it to gtk+.vsprop in linking section.

Bottom line: I managed to build gtk+ 3.0! However once I saw main window of 
gtk-demo.exe appearing, the program crashed:(  Dependencies bundle has not only 
outdated  glib, but also cairo-related dev files (at least missing dot def and 
dot lib).

I'll debug it later.

P.S. Norton Security Suite is not fun! Its Sonar system silently kept deleting 
gtk-demo.exe after I tried to launch it. It was quite weird to see it 
disappearing:-) I had to disable it.

Mikhail


-Original Message-
From: gtk-list-boun...@gnome.org [mailto:gtk-list-boun...@gnome.org] On Behalf 
Of Mikhail Titov
Sent: Friday, March 25, 2011 8:40 AM
To: 'Fan Chun-wei'
Cc: gtk-list@gnome.org
Subject: RE: Gtk+ 3.0 and MS Windows

Fan:

I tried gtk+ 3.0.4. All most recent dependencies I got in a binary form 
somewhere from gnome ftp. You may be right as I did only `make distclean` and 
reran ./configure when I stuck with previous problems with generating enums 
headers. Though I did remove timestamp files manually. I'm not sure if `make 
distclean` was enough. I'll try a clean MinGW as well as I feel like I have a 
bit outdated environment anyway.

I want to give a try to OpenSUSE binaries before continuing attempts to build 
on my own:-)

Mikhail


-Original Message-
From: Fan Chun-wei [mailto:fanc...@yahoo.com.tw]
Sent: Friday, March 25, 2011 6:11 AM
To: Mikhail Titov
Cc: gtk-list@gnome.org
Subject: RE: Gtk+ 3.0 and MS Windows

Hi Mikhail,

Can I know which version of GTK+ are you using?  You may want to try building 
from a clean source tree that is not touched by MinGW/MSYS (i.e. 
extract from the release tarball, and build from it directly with VS).

I was able to build up to 3.0.4 without problems, and it seems 3.0.5 did not 
change that much to cause any problems of that sort (I didn't have time to 
build 3.0.5 yet)

God Bless,
-Fan, Chun-wei


--- 11/3/25 (五),Mikhail Titov 寫道:

> Fan:
> 
> If I try to use experimental MS VC++ solution/projects,
> gdk-win32 dll gets built correctly. However when I try to build gdk 
> project I get errors like following:
1>Linking...
1>gdk.def : error LNK2001: unresolved external symbol 
1>gdk_axis_use_get_type gdk.def : error LNK2001: unresolved external 
1>symbol gdk_byte_order_get_type



  

___
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

2011-03-25 Thread Mikhail Titov
Fan:

I tried gtk+ 3.0.4. All most recent dependencies I got in a binary form 
somewhere from gnome ftp. You may be right as I did only `make distclean` and 
reran ./configure when I stuck with previous problems with generating enums 
headers. Though I did remove timestamp files manually. I'm not sure if `make 
distclean` was enough. I'll try a clean MinGW as well as I feel like I have a 
bit outdated environment anyway.

I want to give a try to OpenSUSE binaries before continuing attempts to build 
on my own:-)

Mikhail


-Original Message-
From: Fan Chun-wei [mailto:fanc...@yahoo.com.tw] 
Sent: Friday, March 25, 2011 6:11 AM
To: Mikhail Titov
Cc: gtk-list@gnome.org
Subject: RE: Gtk+ 3.0 and MS Windows

Hi Mikhail,

Can I know which version of GTK+ are you using?  You may want to try building 
from a clean source tree that is not touched by MinGW/MSYS (i.e. 
extract from the release tarball, and build from it directly with VS).

I was able to build up to 3.0.4 without problems, and it seems 3.0.5 did not 
change that much to cause any problems of that sort (I didn't have time to 
build 3.0.5 yet)

God Bless,
-Fan, Chun-wei


--- 11/3/25 (五),Mikhail Titov 寫道:

> Fan:
> 
> If I try to use experimental MS VC++ solution/projects,
> gdk-win32 dll gets built correctly. However when I try to build gdk 
> project I get errors like following:
1>Linking...
1>gdk.def : error LNK2001: unresolved external symbol 
1>gdk_axis_use_get_type gdk.def : error LNK2001: unresolved external 
1>symbol gdk_byte_order_get_type



  

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-25 Thread Mikhail Titov
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.

-8<--

C:\...che\extracted\usr\i686-w64-mingw32\sys-root\mingw\bin>gtk3-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.

Mikhail


-Original Message-
From: Maarten Bosmans [mailto:mkbosm...@gmail.com] 
Sent: Friday, March 25, 2011 3:38 AM
To: Gtk+ list
Cc: Mikhail Titov; John Stowers
Subject: Re: Gtk+ 3.0 and MS Windows

2011/3/24 Mikhail Titov :
> Maarten:
>
> Yes, if you have this script available it would be wonderful.

http://lists.opensuse.org/opensuse-mingw/2011-03/msg00020.html
http://www.bosmans.ch/pulseaudio/download-mingw-rpm.py

> The only shortcoming of these binaries from OpenSUSE that they lack dot lib 
> files for MS linker and don't have property sheets that make life easier in 
> Visual Studio IDE. Though both problems are doable as dot lib files can be 
> generated and all properties can be set semi-manually with pkg-conf.

Is there any way those files can be generated automatically when 
cross-compiling? (I've no experiece whatsoever with MSVC) If they can, it would 
be worth adding the right commands to the specfile of the rpm package.

> I'm not sure what is the overall goal for GTK+ for non-linux platform. 
> Shall it be buildable under MS Windows or cross-compilation is the 
> only planned strategy? In former case, I guess it makes sense to debug 
> build process as I had all ./configure prerequisites satisfied. Though 
> I feel like I'm on my own under MS Windows :-)

Yeah, that is a bit unclear. I think the situation is even worse and that it is 
not entirely clear whether windows is supported at all.
(Well, obviously it is ported and supported to some degree, but there seem to 
be some pieces missing. I know, I know, patches welcome ;-)

> Unfortunately cross-compiling my entire project is not an option for me as 
> base classes for DirectShow from Platform SDK that I use have a lot of MS 
> specific code and I failed to build it even with MinGW. So I really hope that 
> an opportunity to use MS compiler and linker out-of-box (like gtkmm 2) will 
> be preserved.
>
> Mikhail

Maarten

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-24 Thread Mikhail Titov
All:

I apologize for confusion about gdk/gdkenumtypes.h . I forgot that I altered 
installation of perl. Those headers are created properly.

I completely forgot that MS Windows has a limited command line length. That 
causes gcc to fail with "gcc.exe: : No such file or directory" as command line 
was cut. So Mingw build _under MS Windows_ is broken unless @response files 
will be used to save on command line length.

Fan:

If I try to use experimental MS VC++ solution/projects, gdk-win32 dll gets 
built correctly. However when I try to build gdk project I get errors like 
following:

...
1>Linking...
1>gdk.def : error LNK2001: unresolved external symbol gdk_axis_use_get_type
1>gdk.def : error LNK2001: unresolved external symbol gdk_byte_order_get_type
...

Mikhail


-Original Message-
From: Fan Chun-wei [mailto:fanc...@yahoo.com.tw] 
Sent: Thursday, March 24, 2011 10:51 PM
To: Mikhail Titov
Cc: john.stowers.li...@gmail.com; mkbosm...@gmail.com; 'Gtk+ list'
Subject: RE: Gtk+ 3.0 and MS Windows

Hi Mikhail,

You may want to try the VS2008 Project files in the $(srcroot)/build
/win32/vs9 folder, and VS2010 project files for gtk+-3.0.x are now under review 
for inclusion (the same holds for GLib 2.28.x and GTK+-2.24.x).

AFAIK, due to different release cycles, VS Project files are not yet in 
GDK-Pixbuf, ATK and Pango stable releases, but they are available in the latest 
unstable versions of GDK-Pixbuf and ATK, and is already upstream for Pango.  
For GDK-Pixbuf 2.23.2, you may want to get a patch from BugZilla so that it 
will compile (sorry, search for my e-mail in BugZilla for a bug regarding 
GDK-Pixbuf-I can't recall the bug number as BugZilla is currently down), as 
under VS, all image loaders are built into the main library DLL.  The VS9 
Project files are all in $(srcroot)/build/win32/vs9 for those respective 
packages-be sure to see the README.txt's in that folder for each package, 
especially regarding gettext-runtime, which can be hard to build yourself under 
VS.

God Bless,
-Fan, Chun-wei


--- 11/3/25 (五),Mikhail Titov 寫道:

> 日期: 2011年3月25日,五,上午6:08
> Maarten:
> 
> Yes, if you have this script available it would be wonderful. The only 
> shortcoming of these binaries from OpenSUSE that they lack dot lib 
> files for MS linker and don't have property sheets that make life 
> easier in Visual Studio IDE. Though both problems are doable as dot 
> lib files can be generated and all properties can be set semi-manually 
> with pkg-conf.
> 
> I'm not sure what is the overall goal for GTK+ for non-linux platform. 
> Shall it be buildable under MS Windows or cross-compilation is the 
> only planned strategy? In former case, I guess it makes sense to debug 
> build process as I had all ./configure prerequisites satisfied. Though 
> I feel like I'm on my own under MS Windows :-)
> 
> Unfortunately cross-compiling my entire project is not an option for 
> me as base classes for DirectShow from Platform SDK that I use have a 
> lot of MS specific code and I failed to build it even with MinGW. So I 
> really hope that an opportunity to use MS compiler and linker 
> out-of-box (like gtkmm 2) will be preserved.
> 
> Mikhail
> 
> 


  

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-24 Thread Mikhail Titov
Maarten:

Yes, if you have this script available it would be wonderful. The only 
shortcoming of these binaries from OpenSUSE that they lack dot lib files for MS 
linker and don't have property sheets that make life easier in Visual Studio 
IDE. Though both problems are doable as dot lib files can be generated and all 
properties can be set semi-manually with pkg-conf.

I'm not sure what is the overall goal for GTK+ for non-linux platform. Shall it 
be buildable under MS Windows or cross-compilation is the only planned 
strategy? In former case, I guess it makes sense to debug build process as I 
had all ./configure prerequisites satisfied. Though I feel like I'm on my own 
under MS Windows :-)

Unfortunately cross-compiling my entire project is not an option for me as base 
classes for DirectShow from Platform SDK that I use have a lot of MS specific 
code and I failed to build it even with MinGW. So I really hope that an 
opportunity to use MS compiler and linker out-of-box (like gtkmm 2) will be 
preserved.

Mikhail


> -Original Message-
> From: John Stowers [mailto:john.stowers.li...@gmail.com]
> Sent: Thursday, March 24, 2011 4:05 PM
> To: Maarten Bosmans
> Cc: Mikhail Titov; Gtk+ list
> Subject: Re: Gtk+ 3.0 and MS Windows
> 
> On Thu, 2011-03-24 at 10:01 +0100, Maarten Bosmans wrote:
> > 2011/3/23 Mikhail Titov :
> > > Maarten:
> > >
> > > Thanks for the link! By saying that I don't have OpenSUSE I implied
> that I'd have to either use `alien` (with possible complication if any)
> or build it myself on Ubuntu.
> >
> > If you like, I have a python script (that works on both Linux and
> > Windows) that downloads a package with all dependencies and extracts
> > the binaries. Combined with the OBS automatically building the latest
> > packages, it makes keeping your Windows program up to date quite easy.
> 
> I would be interested in that script please.
> 
> John


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-23 Thread Mikhail Titov
Maarten:

Thanks for the link! By saying that I don't have OpenSUSE I implied that I'd 
have to either use `alien` (with possible complication if any) or build it 
myself on Ubuntu. I see there is even binary package for gtkmm2.99 hopefully 
they will move to 3.0 soon.

The weird point is that, when I try to build under MS Windows, I keep getting 
useless (without anything between DECLS block) gdk/gdkenumtypes.h even if I 
delete gdk/stamp-gdkenumtypes.h and rerun make though gtk/gtktypebuiltins.h 
looks fine.

Oh well, all looks like cross-comiplation is the only option for now.

I don't know if there are many users developing with Gtk+ on MS Windows, but it 
would be nice to at least make a link to that OpenSUSE archive as there are no 
traces of binary package (even unofficial) on the main page for Gtk+ 3.0.

Mikhail


> -Original Message-
> From: Maarten Bosmans [mailto:mkbosm...@gmail.com]
> Sent: Wednesday, March 23, 2011 3:38 PM
> To: Mikhail Titov
> Cc: Gtk+ list
> Subject: Re: Gtk+ 3.0 and MS Windows
> 
> 2011/3/23 Mikhail Titov :
> > Maarten:
> >
> > Thanks for your quick reply! Good to know that Gtk+ 3 is buildable for
> win32 according to your OpenSUSE link. I don't have OpenSUSE though, but
> I'll give cross-compiler a try under Ubuntu.
> 
> The point of the buildservice is to automate the build (in this case
> cross-compiling) of packages. It is not opensuse specific, other than
> that the project evolved out of opensuse and the virtual machines
> building the windows binaries run various opensuse/SLES versions.
> 
> You can find download packages here:
> http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE
> _11.4/noarch/
> On windows extracting the DLLs from the .rpm is probably easiest done
> with 7zip.
> 
> I usually cross-compile on Ubuntu when hacking/bugfixing on
> gtk/cairo/etc. This is quite easy as you can make install right into a
> smb mount to directly test on Windows. And I use the buildservice
> distribute up-to-date binaries and headers to compile my application.
> 
> Maarten

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Gtk+ 3.0 and MS Windows

2011-03-23 Thread Mikhail Titov
Maarten:

Thanks for your quick reply! Good to know that Gtk+ 3 is buildable for win32 
according to your OpenSUSE link. I don't have OpenSUSE though, but I'll give 
cross-compiler a try under Ubuntu.

Gcc is on my path otherwise ./configure would finish much earlier.

$ gcc.exe -v
Using built-in specs.
COLLECT_GCC=c:\mingw\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure 
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions 
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry 
--enable-libstdcxx-debug --enable-version-specific-runtime-libs 
--disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)

It is just something wrong with command line arguments

$ pwd
/c/workspace/gtk+-3.0.4/gdk/win32

$ gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GD
K_WIN32 -I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CHECKS -mms-bitfields 
-IC:/msys/1.0/local/include/glib-2.0 -IC:/msys/1.0/local/lib/glib-2.0/include -
IC:/msys/1.0/local/include/pango-1.0 -IC:/msys/1.0/local/include/cairo -IC:/msy
s/1.0/local/include -IC:/msys/1.0/local/include/freetype2 -IC:/msys/1.0/local/i
nclude/libpng14 -IC:/msys/1.0/local/include/gdk-pixbuf-2.0 "" -DGDK_COMPILATION
 -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE
_DEPRECATED -DG_DISABLE_DEPRECATED -g -O2 -Wall -mms-bitfields -MT gdkcursor-wi
n32.lo -MD -MP -MF .deps/gdkcursor-win32.Tpo -c gdkcursor-win32.c  -DDLL_EXPORT
 -DPIC -o .libs/gdkcursor-win32.o
gcc.exe: : No such file or directory

Mikhail


> -Original Message-
> From: Maarten Bosmans [mailto:mkbosm...@gmail.com]
> Sent: Wednesday, March 23, 2011 1:53 PM
> To: Mikhail Titov
> Cc: Gtk+ list
> Subject: Re: Gtk+ 3.0 and MS Windows
> 
> 2011/3/23 Mikhail Titov :
> > Hello!
> >
> > I understand that there is a lot of work still needs to be done for
> Gtk+ 3.0 . However I would like to use some of its functionality now if
> possible. The problem is that I’m using gtkmm and msvc++ to compile my
> code under MS Windows. I wonder about win32 builds of gtk+ 3.0. Is it
> not buildable under MS Windows yet?
> 
> The windows project on the OpenSUSE BuildService has a package for gtk3:
> https://build.opensuse.org/package/show?package=mingw32-
> gtk3&project=windows%3Amingw%3Awin32
> It seems to build correctly. I haven't tried it, but at least the gtk2
> binaries produced by the OBS run great on Windows.
> 
> > I decided to give it a try and build it myself with MinGW and gcc
> (4.5.0), but I got stuck in the very beginning. I used binary
> dependencies/prerequisites available from ftp to satisfy ./configure
> complaints since I had old prerequisites bundle installed. However
> ./configure got stuck saying that I have no cairo_pdf.h, though I can
> see it with ls /usr/local/include/cairo/ . Oh well, I commented out this
> check. When I executed make V=1 I got this:
> >
> > make[5]: Entering directory `/c/workspace/gtk+-3.0.4/gdk/win32'
> > /bin/sh ../../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -
> DHAVE_CONFIG_H -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GDK_WIN32 -
> I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CHECKS -mms-bitfields -
> IC:/msys/1.0/local/include/glib-2.0 -IC:/msys/1.0/local/lib/glib-
> 2.0/include -IC:/msys/1.0/local/include/pango-1.0 -
> IC:/msys/1.0/local/include/cairo -IC:/msys/1.0/local/include -
> IC:/msys/1.0/local/include/freetype2 -
> IC:/msys/1.0/local/include/libpng14 -IC:/msys/1.0/local/include/gdk-
> pixbuf-2.0 -DGDK_COMPILATION  -DG_DISABLE_SINGLE_INCLUDES -
> DATK_DISABLE_SINGLE_INCLUDES  -DGDK_PIXBUF_DISABLE_DEPRECATED -
> DG_DISABLE_DEPRECATED -g -O2 -Wall -mms-bitfields -MT gdkcursor-win32.lo
> -MD -MP -MF .deps/gdkcursor-win32.Tpo -c -o gdkcursor-win32.lo
> gdkcursor-win32.c
> > libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -
> DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GDK_WIN32 -I../.. -I../../gdk -I../../gdk
> -DG_DISABLE_CAST_CHECKS -mms-bitfields -IC:/msys/1.0/local/include/glib-
> 2.0 -IC:/msys/1.0/local/lib/glib-2.0/include -
> IC:/msys/1.0/local/include/pango-1.0 -IC:/msys/1.0/local/include/cairo -
> IC:/msys/1.0/local/include -IC:/msys/1.0/local/include/freetype2 -
> IC:/msys/1.0/local/include/libpng14 -IC:/msys/1.0/local/include/gdk-
> pixbuf-2.0 "" -DGDK_COMPILATION -DG_DISABLE_SINGLE_INCLUDES -
> DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_DEPRECATED -
> DG_DISABLE_DEPRECATED -g -O2 -Wall -mms-bitfields -MT gdkcursor-win32.lo
> -MD -MP -MF .deps/gdkcursor-win32.Tpo -c gdkcursor-win32.c  -DDLL_EXPORT
> -DPIC -o .libs/gdkcursor-win32.o
> > gcc.exe: : No such 

Gtk+ 3.0 and MS Windows

2011-03-23 Thread Mikhail Titov
Hello!

I understand that there is a lot of work still needs to be done for Gtk+ 3.0 . 
However I would like to use some of its functionality now if possible. The 
problem is that I’m using gtkmm and msvc++ to compile my code under MS Windows. 
I wonder about win32 builds of gtk+ 3.0. Is it not buildable under MS Windows 
yet?

I decided to give it a try and build it myself with MinGW and gcc (4.5.0), but 
I got stuck in the very beginning. I used binary dependencies/prerequisites 
available from ftp to satisfy ./configure complaints since I had old 
prerequisites bundle installed. However ./configure got stuck saying that I 
have no cairo_pdf.h, though I can see it with ls /usr/local/include/cairo/ . Oh 
well, I commented out this check. When I executed make V=1 I got this:

make[5]: Entering directory `/c/workspace/gtk+-3.0.4/gdk/win32'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H 
-I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GDK_WIN32 -I../.. -I../../gdk 
-I../../gdk -DG_DISABLE_CAST_CHECKS -mms-bitfields 
-IC:/msys/1.0/local/include/glib-2.0 -IC:/msys/1.0/local/lib/glib-2.0/include 
-IC:/msys/1.0/local/include/pango-1.0 -IC:/msys/1.0/local/include/cairo 
-IC:/msys/1.0/local/include -IC:/msys/1.0/local/include/freetype2 
-IC:/msys/1.0/local/include/libpng14 -IC:/msys/1.0/local/include/gdk-pixbuf-2.0 
-DGDK_COMPILATION  -DG_DISABLE_SINGLE_INCLUDES 
-DATK_DISABLE_SINGLE_INCLUDES  -DGDK_PIXBUF_DISABLE_DEPRECATED 
-DG_DISABLE_DEPRECATED -g -O2 -Wall -mms-bitfields -MT gdkcursor-win32.lo -MD 
-MP -MF .deps/gdkcursor-win32.Tpo -c -o gdkcursor-win32.lo gdkcursor-win32.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. 
-DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GDK_WIN32 -I../.. -I../../gdk -I../../gdk 
-DG_DISABLE_CAST_CHECKS -mms-bitfields -IC:/msys/1.0/local/include/glib-2.0 
-IC:/msys/1.0/local/lib/glib-2.0/include -IC:/msys/1.0/local/include/pango-1.0 
-IC:/msys/1.0/local/include/cairo -IC:/msys/1.0/local/include 
-IC:/msys/1.0/local/include/freetype2 -IC:/msys/1.0/local/include/libpng14 
-IC:/msys/1.0/local/include/gdk-pixbuf-2.0 "" -DGDK_COMPILATION 
-DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES 
-DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -g -O2 -Wall 
-mms-bitfields -MT gdkcursor-win32.lo -MD -MP -MF .deps/gdkcursor-win32.Tpo -c 
gdkcursor-win32.c  -DDLL_EXPORT -DPIC -o .libs/gdkcursor-win32.o
gcc.exe: : No such file or directory
make[5]: *** [gdkcursor-win32.lo] Error 1

Is it really not ready for win32 at all or am I doing something wrong?
All I want at this point is a color selection dialog with transparency support 
and RGBA type instead of Color.

Also I’ve tried experimental VS9 project created by configure. But it requires 
“msvc_recommended_pragmas.h” that I gon’t have. Okay, removed that one. Also I 
corrected GlibEtcInstallRoot path and added dash after Gdk into include 
Gdk-Pixbuf-2.0. However this time it is getting stuck on GDK_TYPE_CURSOR_TYPE 
and alike in gdkcursor.c while gdkenumtypes.h doesn't contain anything useful 
as in binary gtk+ 2 I have.

What are my options? Is it something I should just wait? When roughly do you 
estimate to have win32 build available (even unstable)?

Mikhail



___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list