Rewriting for Linux?
Jim Gettys
jg at laptop.org
Mon Apr 2 11:27:42 EDT 2007
I'd agree with Albert on much of what he says, with a few exceptions and
additions.
Whenever possible, we strongly recommend people use the
Cairo/goocanvas/GTK+ stack for their 2D graphics, rather than SDL. We'd
like our software usable anywhere, and that implies scaling. The Cairo
community has been making great strides on performance, and we'll be
optimizing the window system code paths that Cairo uses as well, as is
the entire X Window System community now.
Remember that young kids may not be able to read yet, and their parents
may not either in many areas, so discoverable interfaces without lots of
textual dialog boxes are key to graceful entry to computing in the
environments we serve.
Remember ebook mode requires applications to deal with re-layout and
different aspect ratios. We hope in our next generation to add a touch
screen, so even if your application can't be translated to use the game
pad and buttons in this generation, you need to be prepared for the
next. Tools like GUI builders that allow load on the fly UI
redefinition make it much easier easier for:
o people who are really good at UI design to help tune your UI.
o subsetting interfaces easily for different age kids.
o dealing with different layout when rotated, if necessary. We did
this to great effect on GPE on the iPAQ; our screen is bigger, so this
will be a bit less of an issue, but rotation really needs to work for
long term use of almost all applications: we have existing stroke
recognition systems in hand, and there are continuous writing systems on
Linux as well, though commercial in nature.
Regards,
- Jim Gettys
Best regards,
- Jim
On Mon, 2007-04-02 at 01:50 -0400, Albert Cahalan wrote:
> MARTIN WOODHOUSE writes:
>
> > I have a fairly sizeable application, written in (Borland) C for MSDos,
> > which I think might be useful if ported across to the XO.
>
> Just C, or C++ with Borland's OWL library? Plain C is easier.
>
> 32-bit or 16-bit? Linux doesn't use the "far" keyword. Data types:
>
> 8-bit char
> 16-bit short
> 32-bit int
> either 32-bit or 64-bit long (32-bit on this year's XO)
> pointer same size as long
>
> The struct layout differences may make old data files unreadable.
> You may be able to cheat a bit by using #pragma or __attribute__
> to make the Linux compiler match the Borland compiler.
> See the compiler manual (URL below) for more info.
>
> > It's entirely self-contained and self-running, but I can already
> > see that I cannot hope simply to recompile its code into Linux !
> > ( For one thing, all its display functions are writtten for
> > 640 x 480 VGA.).
>
> If you were writing directly to the screen, you might want to
> convert your code to use the SDL library for graphics. That's the
> easy way. The result will still be fixed-size though, 640x480,
> unless you change that. Being resizable is possible, but SDL
> won't give you any help.
>
> For resizable conversion, you might use the GTK library. This would
> let you make the program able to smoothly adapt to any screen size.
> With GTK you lay out the screen in terms of geometrical divisions.
> For example, you specify that an image gets the upper half of the
> display and other stuff gets the bottom half. Then you subdivide
> that "other stuff" area so that the bottom part is buttons and the
> upper part is text. Then you subdivide the buttons area for the
> individual buttons... but at this point you can probably use a
> ready-made set of buttons rather than drawing your own buttons.
> As you divide things up, you specify functions that will get called
> when the various things get clicked, passed over with the mouse,
> and so on. You write these functions to do as you wish.
>
> > I am currently reading background material in order to teach
> > myself Linux, but what I would like to know is what software
> > you guys & gals are using to write and compile your code?
> > Red Hat or what?
>
> If you specifically wish to develop for the XO, then get the latest
> version of Fedora from Red Hat. That will be easiest, because the XO
> is running a slimmed-down version of Fedora. Any Linux will do though.
> Get your program running on a regular PC before attempting to deal
> with the XO; the XO has some quirks are aren't yet well documented.
>
> Be sure to install the development tools. They are free, and are
> on the CD, but won't always install by default.
>
> The compiler is included. It's called gcc. Most people run gcc from
> the command line, and run a separate editor to edit their code.
> The compiler manual is here: http://gcc.gnu.org/onlinedocs/
> Be sure to enable warnings! The following are good options:
> -O2 -g3 -W -Wall -Wstrict-prototypes -Wmissing-prototypes
>
> I suggest that you install the editor called "joe". It's the one
> that works the most like the one in Borland's Turbo environments.
> The keystrokes are WordStar-like. Borland C supported that, as
> well as the more common CUA style. If you like control-K to do
> things, you need joe. If you select text with shift-arrow and copy
> with control-C, then you prefer CUA and might like the nedit editor.
>
> If you prefer an integrated environment (which contains an editor
> and will run gcc for you) then you can try Anjunta, Eclipse, or emacs.
> All are free, though they might not be installed by default.
>
> Be sure to use the valgrind program. It just about automatically
> finds many kinds of bugs.
> _______________________________________________
> Devel mailing list
> Devel at laptop.org
> http://mailman.laptop.org/mailman/listinfo/devel
--
Jim Gettys
One Laptop Per Child
More information about the Devel
mailing list