Blog
Page: 0 ... 5 ... 10 ... 15 ... 20 ... 25 ... 30 35 36 37 38 39 40 41 42 43 ... 45 ... 50 ... 55 ... 60 ... 65
Mac Porting
Date: 28/2/2007
So I eventually found this little bit of code on the Apple site that shows how to initialize an ATSUI font style with the parameters from a theme font, which is exactly what I wanted to do with fonts inside LGI. My apps now render their text like a native MacOSX app, which is just great.

Also I've fixed enough things in the mail2 backend code that Scribe now loads my main mail folder file (abeit a read-only copy) on my PPC machine. This involved lots of byte swapping.

Current issues are:
  • The list control is not painting anything at all.
  • The scrollbars become blank greyness after resizing a window.
  • Grabbing a splitter and resizing it moves the split to the wrong location. Something to do with co-ordinates and mouse capture.


A triple platform release this month is looking unlikely. Primarily because I'm (again) suffering for chronic RSI and need to take things slowly so that I can recover. But the linux build is pretty close to done, the windows build is still waiting for a focus issue fix and well the mac port is well.... painting its fonts nicely!
(0) Comments | Add Comment

Progress
Date: 15/2/2007
On the Mac coding front I'm implementing support for PPC byte ordering in code that reads/writes the mail2 folders. This is so I can run Scribe on my mini. I think I'm over half way through that, and I'm hoping to have a running build of Scribe next week sometime.

On the Linux front I've ditched the old hack I was using to support some KDE system settings from inside Lgi applications and I've written a new shared library that acts as glue between KDE and Lgi. When an Lgi app detects it's running on a KDE system it loads the support module (hard linked against KDE) that calls the official KDE api to query it for system information. This method has many benifits, first and foremost it's not a hack so it works well and isn't likely to break. Secondly I can now support other window managers easily, so I'll be writing a Gnome support module shortly on Fedora Core 6. The window manager glue module provides access to:
  • Official system path info (e.g. the desktop path)
  • System UI colour settings
  • Mime -> App list translations
  • The currently selected system language
And I guess I could add more if needed. All of this information is optional and Lgi will sythesis it if needed. But having it makes for a nicer user experience. One thing that I could experiement with later is seeing if I can implement a bridge between the KDE/Qt skinning code and the Lgi skinning interface. That could possibly mean that Lgi apps could look like native KDE apps without hard linking against KDE.

On the windows front, I'm still trying to fix the lose of focus issues. I've hacked a fix up for the lose of focus when selecting the root node in Scribe, but I'm finding that there are other places where the same thing is happening, even with the hack in place. For instance sometimes when you click on a message in the list the focus immediately gets lost. Which screws everything up. If I can fix that I'll make a release.

In fact we're looking good for a triple platform release of Scribe this month.
(1) Comment | Add Comment

SetWindowPos Changes Focus
Date: 12/2/2007
Occasionally when I call:
SetWindowPos(hWnd, NULL, x, y, cx, cy, SWP_NOACTIVATE|SWP_NOZORDER);
The focus unexpectedly changes to hWnd. This is annoying and I don't understand why this happens. Anybody care to shed some light on the inner workings of SetWindowPos?

This can be seen in Scribe when you select the root node of the folder tree and the focus disappears. I'm trialing some code that gets the current focus, calls SetWindowPos and then checks the current focus against the old focus, if it's changed it just resets it. But this is a ugly hack and I'd rather just fix the root cause.

It's also annoying users.
(2) Comments | Add Comment

GCC Is Unbelievable
Date: 7/2/2007
So I'm compiling and building Scribe and Lgi on Linux (SUSE 10.0, gcc 4.0.2 20050501) and it's crashing out with weird errors in the List class, which is one of the core container classes used by Lgi. After some hours I've isolated the issue, one of my destructors was not being called. Very weird, very very weird. So I single stepped through the code delete deletes the object and it jumps over to another source code file with a private class of the same name, and runs it's destructor instead of the local class.

So lets get this straight, in "GContainers.cpp" (part of liblgi.so)
class Item
{
public:
    Item() {}
    ~Item() { /* not called */ }
    void Delete()
    {
        delete this; // call goes to wrong destructor
    }
};
And over in the scribe binary there is a file ScribeLangDialog.cpp which implements the initial dialog where you choose the language:
class Item : public GListItem
{
public:
    Item() {}
    ~Item() { /* called from inside GContainers.cpp */ }
};
And neither class is public outside their own file.

Is this normal? Is it legal?

Btw MSVC++ v6 gets it right.
(3) Comments | Add Comment

Scribe/Mac
Date: 5/2/2007
Yes it's true Scribe is running on the Mac and to prove it here is a screenshot:



I've fixed a host of problems: font issues, line spacing, text layout, keyboard entry, clipboard support and international character glyphs.

You can't yet use it as your everyday mailer but it's getting closer everyday.

See how the fonts look bold all the time? Yeah I don't know how to fix that yet.
(2) Comments | Add Comment

Carbon/ATSUI fonts
Date: 1/2/2007
I mentioned I was working on the fonts in the previous entry and well I've got it almost all sorted out. I needed to use the CGContextRef from the kEventControlDraw event and plug it into the ATSU layout object. That fixed the kerning and anti-aliasing but broke the positioning. A few flips of the context's CTM and that was sorted out as well.

Then I turned on font substitution, a feature that you have to implement yourself on Windows and Linux and all the international characters magically appeared. Ohoooo Arhhhhh!

Finally all that is left is that all my text looks like it's drawn in a bold font. I'm retreiving the current system font and setting that up as the default application font, and I'm not setting the bold property... so I'm a bit confused over that one.
(0) Comments | Add Comment