Posted
22 days
ago
by
manus_eiffel
Last night I've upgraded my iPod Touch to the latest iPhone OS 3.0 and its corresponding SDK. The OS upgrade went smoothly. However for the SDK, what I had done was not working when I switch the include path to use the 3.0 SDK because it also
... [More]
required GCC 4.2 (by default it is GCC 4.0). Once I changed that, the Eiffel code compiled just fine.
Since my last blog entry, the iPhone library available under $EIFFEL_SRC/experimental/library/iphone (and its corresponding example in $EIFFEL_SRC/examples/iphone/basic) is able to respond to the touch events. You can detect the start, the moving and the end of a touch.
Here is the extract of the application:
indexing
description : "basic application root class"
date : "$Date: 2009-06-15 23:25:41 (Mon, 15 Jun 2009) $"
revision : "$Revision: 79297 $"
class
APPLICATION
inherit
ARGUMENTS
SHARED_LOG
EXCEPTION_MANAGER
create
make
feature {NONE} -- Initialization
make
-- Run application.
local
l_app: UI_APPLICATION
do
create l_app
l_app.post_launch_actions.extend (agent launch)
l_app.launch
rescue
if attached last_exception as l_exception then
put_string (l_exception.exception_trace)
end
end
feature -- Actions
launch
local
window: UI_WINDOW
l_label: UI_LABEL
l_rect: CG_RECT
do
l_rect := (create {UI_SCREEN}.make).bounds
create window.make (l_rect)
create l_rect.make (10, 50, 300, 100)
create l_label.make_with_text ("Hello World!", l_rect)
l_label.set_background_color (
create {UI_COLOR}.make_rgba (0, 1, 0, 1))
l_label.set_foreground_color (
create {UI_COLOR}.make_rgba (1, 0, 1, 1))
l_label.align_text_center
window.extend (l_label)
window.touches_began_actions.extend (
agent touch_began_action (l_label, ?))
window.touches_moved_actions.extend (
agent touch_moved_action (l_label, ?))
window.touches_ended_actions.extend (
agent touch_ended_action (l_label, ?))
window.show
end
touch_began_action (a_label: UI_LABEL; a_event: UI_EVENT)
local
l_point: CG_POINT
do
if attached {UI_TOUCH} a_event.all_touches.item as l_touch then
l_point := l_touch.location
a_label.set_text ("Starting touch " + i.out + " ...")
a_label.set_center (l_point)
i := i + 1
end
end
touch_moved_action (a_label: UI_LABEL; a_event: UI_EVENT)
local
l_point: CG_POINT
do
if attached {UI_TOUCH} a_event.all_touches.item as l_touch then
l_point := l_touch.location
a_label.set_text ("Moving touch " + i.out + " ...")
a_label.set_center (l_point)
i := i + 1
end
end
touch_ended_action (a_label: UI_LABEL; a_event: UI_EVENT)
local
l_point: CG_POINT
do
if attached {UI_TOUCH} a_event.all_touches.item as l_touch then
l_point := l_touch.location
a_label.set_text ("Ending touch " + i.out + " ...")
a_label.set_center (l_point)
i := i + 1
end
end
i: NATURAL_64
I'm looking for people who would like to help in improving the Eiffel iPhone library by wrapping the iPhone UI classes. If you are interested contact me so that we can get together to organize an effective plan of work. [Less]
Posted
about 1 month
ago
by
manus_eiffel
Here it is: my first graphical iPhone/iPod Touch application entirely written in Eiffel using EiffelStudio:
Nothing really fancy but it shows that it is doable. At the moment, you can test your Eiffel applications using either the iPhone
... [More]
Simulator or the actual device. I'll put within the next few weeks when the iPhone graphical library is more complete the steps one should perform to achieve what I've achieved. [Less]
Posted
about 1 month
ago
by
manus_eiffel
I was lucky to get my hands on an iPod Touch. The first thing I did was to install SSH, gcc, subversion, vim, gdb et voila! Checked out the source of the Eiffel Software runtime. Tonight, I'll compile the runtime and run our regression test suite on
... [More]
it to make sure everything works properly.
When this is done, I'll look at how to use Eiffel for iPhone/iPod Touch development. Anyone interested in wrapping the iPhone API, please let me know. [Less]
Posted
about 1 month
ago
by
manus_eiffel
SourceForge started the Community Choice Awards. Click on this link to vote for EiffelStudio.
Posted
3 months
ago
by
manus_eiffel
Have you heard about the Y2K38 bug? If not, you should read the wikipedia entry about it. Is Eiffel immune of that problem? It depends on the platform and the C compiler you are using. The main two issues with time in the Eiffel libraries are:
... [More]
The time stamp for files available through the FILE class.
The EiffelTime library queries to get the current time (e.g. {DATE}.make_now).
For the time stamp, regardless of your C compiler or platform, the FILE class will truncate the value since it is returning an INTEGER_32. So there is some work to be done there to get the INTEGER_64 value that most file system reports.
For the EiffelTime library, it is more complicated. For sure, if you are using a 64-bit platform you are immune since the C layer we use to query the time is always 64-bit. On 32-bit platform the story is a little bit more complicated. For example, on Windows, if you use an older version than Visual Studio 2005, then your code won't work, but if you use VS 2005 or above then it should work because the C compiler uses a 64-bit representation even on 32-bit platform. For 32-bit unices, it seems that you are out of luck and as far as I can see I'm not even sure they can handle the dates beyond 2038 properly.
To definitely avoid this problem, and if you haven't done so now, start developing 64-bit applications. It will certainly reduce your risk if you expect your code to run for the next 30 years or so. [Less]