[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: Templates? (was Re: [XaraXtreme-dev] XCode - The main goal)



On 28/06/06, Alex Bligh <alex@xxxxxxxxxxx> wrote:
Ben,

> The first thing that my code does is to open the wx Memory Zip
> Filesystem or stream, and try to open '800 by 600 drawing.xar' which
> fails, and I think that nothing else is tried.

It is correct that nothing else is tried, because in getting the filename,
it already checked the file did not exist on disk (if you passed a "-r"
line).

However, the path should have the underscores in it, not spaces. If they
aren't there, we have found the problem.

> I accept that I may be misunderstanding something, but my first
> thought is that without the spaces/underscores, the Darwin code could
> open 'default,xar' from memory/resources perhaps owing to a bug
> somewhere which has now been fixed; but it cannot open the present
> default file.

Does MacOS do substitution of "," for "."? That could certainly cause
it. Spaces in filenames also cause problems which is why we try and
avoid them.

>> Just checked it here. See what pFileName
>> contains when you go into the function (remember it's
>> a pointer to a UNICODE null terminated string). The
>> "Templates" version is only used by the installer
>> (which you aren't using). The difference in size is that
>> the Templates version is a xar file with compression on,
>> and for various tedious reasons the binary one is not
>> a compressed .xar file (though the whole resources are
>> zipped).
>
> It is (TCHAR *)"800 by 600 drawing.xar" where each character is 4 bytes.

OK. So we need to find out where the underscores went. It should come
from IDS_DEFAULTDOCNAME, in rik-strings.xrc. Unless Luke is doing something
cleverer. On Linux, it has the underscores in, and hence works.

> I am not saying that I understand every word of that, but I have seen
> it try to open the Filename through 'memory:resources#zip' and fail. I
> have seen it look for '800 by 600 drawing.xar' when
> '800_by_600_drawing.xar' was present.

This sounds like it is the filename generation that is problematic.

Note that it isn't looking for it on your MacOS/OS-X file system,
but a virtual file system run by wx. By "path" I mean path within
the virtual filesystem - it should read (as I said) something
like "memory:resources#zip:800_by_600_drawing.xar".

AHA! A clue! I notice that in the menu the "D" of "Drawing" is
capitalized as is the "B" of "By". I can't figure where this capitalisation
came from unless something is bound in the code. Perhaps you might check
for that. Perhaps MAC Zip files are case sensitive and GTK ones aren't.

I fear that I have wasted some of your time, because my earlier
messages must have had typos; but I do appreciate the effort that you
have put into this. I am also beginning to suspect that I am in snark
territory, and that if there ever was a bug here, it may have
disappeared.

I am going to start a new thread.

Ben