]> git.neil.brown.name Git - freerunner.git/blob - NOTES/TODO2
Lots of random updates
[freerunner.git] / NOTES / TODO2
1 TODO: sep 2009, now that I am using this as my real phone:
2  - send touch tone commands
3  - keep record of incoming/outgoing calls
4  - reduce time from wake to ring
5 TODO:
6   DONE runit to scroll to the bottom
7   DONE bigger buttons in runit
8   text, not icons, for shop config stuff
9   DONE launch/status to update more often
10   DONE gsm info in launch/status
11   DONE gsmd: reading 'extra' needs to cope with multiple lines:
12   SMS:
13     - update git
14     - add 'xterm' so I can type...
15     DONE - add 'esc' to 'tapinput'
16     - look for launch errors in .xsession-errors:
17   File "/usr/local/bin/launch", line 324, in press
18     if not self.offsets:
19 AttributeError: 'Selector' object has no attribute 'offsets'
20
21     - make sure launch updates when sms message arrives
22     - find out why everything is so slow
23     - make sure only one 'gsm-getsms' running at a time.  Maybe kill
24       old one?
25     - trace?? to find out why we don't seem to pick up a message on
26        resume.  The newsms file gets changed but maybe no signal gets sent.
27     - "sendsms -n" should go straight to 'new'.
28     - clean up rubbish in 'new' and 'draft' files.
29     - lock should be in charge of buzzer.
30        It turns it off on 'wake' or after a timeout and turns it on when some file changes.
31       Maybe there is an 'alert' file which gets 'sms' or 'ring'.
32       In the case of 'ring' it is updates regularly.
33       'lock' sets a buzz, turns on display, maybe beeps
34     - run gsm-getsms at appropriate times
35         -n when /var/run/gsm-state/new-sms changes
36       DONE  -a at boot time, or when gsmd starts??
37     - write some info to a 'new sms' file that I can watch for status
38         Probably just watch the 'newmesg' log and update shortly after that changes.
39     - improve atchan code - better abstractions
40     - 'delete' should return to list view if in message view
41     - Make sure sendsms notices when the files change
42     - Make 'sender' and time easier to read.
43        Probably make lines twice as high
44        time can be 'today' and 'yesterday' and ' 5 minutes ago' etc
45       mark day/month boundaries some how?
46     - figure out if a '+' should be at the front of the phone number
47     - look into timezone information on exesms messages
48     - implement search function
49     - Highlight 'new', 'draft' 'in/out' better.  Icon?
50     - Don't duplicate a draft when we edit it.
51     - Find some way to remove cruft from new/draft
52     - buzz buzzer when message arrives.
53     - include transit time in full message view.
54     - Make messages disappear from 'new' when they are read.
55     - popup reading in 'new' mode when selected from launcher
56     - capture and decode catenated messages
57     - figure out why changing lists is so slow.
58     - implement undelete.
59     - implement scrolling of message list
60     - change 'open' to 'forward' or 'edit'
61     - add 'reply' button
62     ?? detect SIM card id and have separate mirror file??
63             AT+CIMI
64                  505038191025166
65                  505038240084403
66     - move 'config' to 'listing' page?
67     - change between 'save draft' and 'cancel' when clear.
68     - press-and-hold send to select handler
69     - make 'paste' active only when there is something to paste
70     - send only active when fields are filled in.
71
72     
73 receive AT response +CBM: 4576,50,1,1,1
74 receive AT response South
75 receive AT response Sydney
76 receive AT response 
77
78 Sms-store:
79   DONE store direction (in/out) and only one address (Sender or recipient)
80
81 Inter toy communication:
82  e.g.
83    play this tune
84    call this number
85    I want the speakers
86    don't suspend just now
87    call me on resume
88    everybody pause
89
90  Use X clipboards for specific messages
91  use lock files for 'dont'
92  use leases for 'call me' and 'everybody'
93    That would require all running as same uid.
94    Maybe DNOTIFY, but cannot use that well from python
95    So write C helper and do inotify?
96      But check gobject doco first.
97    I think I can use dnotify OK, poll each file on each signal.
98    So use that for 'call me on resume'
99    Possibly for 'incoming call', 'received sms', 
100    Maybe for 'Internet now available'
101        Used by weather, time,
102    Also 'GSM' and 'GPS' now available
103
104  Root Properties - one-to-many messages. that are ui based.
105    e.g. 'pause' 'ABC/abc/123/$%&', 'scale size'
106
107  So: suspend.
108    We have a directory /var/lock/suspend
109    containing:
110        auto:  Taking a LOCK_SH on this prevents auto suspend.
111               If auto-suspender can get a LOCK_EX, it suspends, then
112                   unlocks on resume
113        suspend: Taking a LOCK_SH on this prevents any suspend completing.
114                However any locker must also watch the file with e.g.
115                dnotify, and when the file is nonempty, the lock must be
116                released promptly.
117        next_suspend:  Taking a lock on this while holding a lock on
118                suspend ensures that you will not miss a suspend/resume cycle.
119                On resume, the file is renamed to 'suspend',
120                So 'dnotify' can discover when resume happens and a subsequent
121                suspend will not complete until the lock is released.
122
123     A client with:
124       take a lock on 'suspend'
125       check that link count is non-zero (if zero, close and loop)
126      loop:
127       set up for active system
128       wait
129       when there is a change in the file:
130         set up for suspend
131         possibly take lock on next_suspend
132         release lock
133         wait for activity on next_suspend (which will be renamed to 'suspend')
134         goto loop
135                
136
137 Alert:
138    Alert is currently part of 'lock'.  Is that a good idea?
139    The connection is that we only want to sound an alert if there is
140    an easy way to turn it off - and 'lock' is in the best position to
141    turn things off.  It is closest to the user.  If lock isn't
142    running,  don't want to make any noise.
143
144    Alert needs:
145      - different alerts:  ring, sms, alarm, low-battery
146      - different sub-alerts:  ring/family. sms/work, alarm/urgent
147      - different settings: silent, unobtrusive, normal
148      - different actions: tone, buzz, flash, repeat count, volume
149                   change, LED flash, screen flash.
150      - some alerts stop when there is user input (tone).  Some
151        continue (LED)
152    
153      - concurrent alerts??  alarm and SMS at same time?
154          As long as we get attention, and display status on screen..
155          Maybe need alert priority and only play the most important.
156     
157    Configuration: too complex for just directories with symlinks to
158      .wav files.
159      Still want to make it easy to change config, either temp or perm.
160
161      Config changes can be
162       -  time based
163       -  location based?
164       -  orientation based
165       -  user-requested
166
167      Does the alert program do this itself, or does some other program
168      move files around?
169
170      Maybe have a set of .ini files where settings cumulate.
171      Read base, then others
172       - calendar program creates a plan every so often which lists
173         time - profile  e.g. 20090228-123456  silent
174                              20090301-012334  -
175       - The location service gives a name to where we are, as precise
176         as possible.  We then look for setting "location-$NAME"
177       - ditto for orientation.
178
179
180 Disable 'xset' screen blan!k
181
182 tapinput:
183   DONE differently OK should become 'go away'
184   DONE Need a 'mode' where all 12 are used.  press/hold mode/del to recover.
185   DONE Move > half off screen, and disappear.
186   DONE statusicon to recover
187   DONE Add:  Ret UP DOWN LEFT RIGHT 
188
189
190 Weather:
191   Waits for 'internet now available' and if more than 8 hours since
192    last check, download weather details.
193
194 Library:
195   Selector
196    Currently used in
197            launcher (folders/tasks), music, shop, sendsms
198    Features:
199        - goes multi-column if possible/needed
200        - auto-scroll when near extreme
201        - tap selects but doesn't activate
202        - small left/right tap areas for select-and-activate
203        - simple text with different colours, or app-specific rendering
204        - alternating background, background for highlight
205        - drags used for text entry
206
207   AutoBox
208     Acts like vbox or hbox depending on available space
209
210   Slider
211     pop-up window
212
213
214 Note pad with search.
215   This might just be an extension to scribble.
216    - simple text file editor
217    - multiple pages with a list that can be selected from
218    - search across all pages - show page name and line.
219    - mark pages 'read-only'
220    (ideas from tomboy)
221    - text size.  features:  highlight strikethrough bold italic
222    - 'link' a word to a page of the same name.
223    - group pages into notebooks???
224    - scrollable pages?
225    - collapsable lists.
226
227 Scribble:
228   - larger buttons
229   - ??save png??
230   - allow grouping of texts with tap-draw-hold
231   - when we have a group of texts, allow
232        - align
233        - sort
234        - fold
235   - move a text with tap-hold-draw
236   - easier to select individual text
237   - allow text to be deleted - maybe drag to corner
238   - new line gets leading number or bullet or whatever
239   - I need:
240        'text' entries to record opposite corner when drawn
241        some set of the last N text entries
242          these are drawn with a grey background??
243        select text
244
245 runit
246   Set window name to something appropriate
247   DONE run a command and display the output.  No user interaction(yet)
248   DONE One button to close
249   Possible additions.
250    - rerun button
251    - different colour for stderr
252    - buffer to build text, then enter it
253   Combine with launcher??? or teach launcher to understand it better
254   Make it easier to run a little shell script
255
256
257 lock:
258  DONE Be more careful about counting up/down - count per button.
259  DONE  be careful about press/release difference
260  DONE  allow insta-lock with icon
261  LATER use lockfile to tell when someone wants no-blank
262  LATER Have lockfile for 'next suspend'. use inotify for clients
263     to find out when 'next' becomes 'now'
264  DONE use lockfile to tell when someone wants no-suspend
265  DONE suspend when more idle
266  DONE use external net connections to disable suspend
267  DONE maybe don't suspend while charging (of >50%)
268  DONE don't suspend while load-average is high
269  DONE no-suspend setting.
270  Only check TCP if keep-alive is working....
271  Use alsa to play tones for alerts.  Also buzz
272    Alerts are requested by creating file /var/run/alert/$name
273    where 'name' is something like 'sms' or 'ring' or 'alarm'
274    We look for /etc/alert/$name to find out what to play.
275     Not sure how to include
276         tone
277         volume
278         repeat/louder
279         vibrate
280         display brightness
281         LED flash
282
283  We terminate the alert tone when a button is pressed
284      Vibrate continues if it is a repeating alert (ring)
285
286
287 Event Viewer
288   Events such as SMS, missed-call, alarm get appended to a file
289   The viewer shows recent events and allows the relevant window to be
290   selected.
291   It has a blinking statusicon when there are new events
292
293   This is probably just included in launcher
294
295 PictureViewer
296   one pane which just shows a photo, is full screen, taps left and right moves
297   one pane with browser showing date information 
298   thumbnails?
299
300 Address Book
301    store addresses with phone numbers
302    lookup and display
303    Format address label as postscript for printing
304    send phone number to dialler
305
306    Store:
307      Names
308      Addresses - people share these
309      Phone number - people have several, and share them
310      Email address - again, can be multiple and shared.
311
312    So we allow entries to include others by reference
313
314    Name - given / family
315    Category  (family, collegue, church, ...)
316    Address[desc] - l1 / l2 / postcode / country
317    Phone[desc] - number
318    Email[desc] - addr
319    group[desc] - entity
320
321    What key to use for 'entity' ??
322       Name?  not unique and can change.
323       UUID I guess.  assigned sequentially.  Maybe use hostname to
324          uniqueify
325
326    Store:
327      notabene.1234 = {
328          name = { given = Neil ; family = Brown }
329          Category = me;
330          Category = Family;
331          address = { type=Home; a= "13 Lang Ave";
332                          city="Pagewood"; postcode=2019;
333                          country = Australia
334          }
335          Phone = { type=mobile; num=0403463349; }
336          Valid = date
337      }
338          
339  
340   That is horribly verbose and not needed.
341   Though if we store gzipped, it isn't much waste.
342
343    We don't really want to store it in memory as that isn't paged out,
344    So we want an ondisk format which is very easy to parse.  Hopefully
345    it will be cached most of the time.
346    So: ':' separated fields with ',' separated subfields and '=' assignments
347      id:family:given:cat,cat:ref,ref:PO:addr:addrext:city:postcode:country:mobile=number,work=number:Date
348
349    Should probably use VCARD - it isn't that hard.
350    Just ignore the bits we don't understand yet.
351    When editting, only change fields we understand.
352    When there are interdependent fields like N vs FN and ADR vs LBL
353     that can be awkward.
354
355    No.  Don't like VCARD - no references (that I can find) as no ID for each entry ???
356
357    Anyway I'll use my own internal format and maybe export/import one day if I decide to care.
358
359    We mmap the file and typicaly use 're' to search through it, while holding a read lock and having
360    checked the size.
361
362    We access the address book by extracting addresses.
363    'first', 'next'
364    These can have an 're' argument meaning 'first/next that matches re'
365    File contains an initial line with a version number, so that each line starts and ends
366    with '\n'.  Thus each field starts and ends with [\n:,=]
367
368    How to integrate this?
369      Any program that just needs read access goes direct to the file, mmaping and searching
370      Auto updates such as 'last used' can similarly be on on the mmapped file.
371      Updates need to be handled by a single GUI.
372      When someone - e.g. SMS or Call-Log - wants to store a number or edit an entry,
373       they put a resource on the root window.  If the contact list is watching, it
374        picks it up.  If it isn't, the button is greyed out (or we run the program)
375
376      The contact editor:
377         Has an edit window where content of interest appears
378
379 music:
380   doesn't always move forward at end-of-song
381   have better way to 'play chosen song'
382   If 'seek' dropdown didn't select a time, don't jump at all.
383   report song on root window property
384   Have fs browser to find music folder(s)
385   survive suspend somehow
386   Don't seek when there is nothing to seek (negative offset??)
387   record current location for restart
388   remove "/home/music/ogg" from displayed path
389   grab /var/run/suspend_disabled when playing
390   DONE add volume control
391   DONE Think about seek control
392   Maybe support HTTP: uris such as classic-fm
393   Support Random-Album
394   Support Random-Song
395   tap 'current song' to go there in browser
396   search by substring
397
398 clock:
399   sync to real time properly
400   alarm clock:
401     periodic or one-off
402     wake to music or buzzer
403   pop up:
404     set timezone
405     show date/calendar
406     ntpdate
407     gpsdate
408     gps-timezone
409
410 Shopping List
411    Need to add/edit locations and places.
412    When 'choose location' or 'choose place' is up, the
413    'add' and 'edit' button affect the location name instead of the product
414    renaming a thing to 'empty' only works if it is not in use.
415    When we click 'config', product list is replaced by location list.
416    Click 'config' again to go back.  Different background colour??
417    If we change place, it changes set of locations
418    '+' adds a new location
419    'edit' changes the name of current location
420    zoom still exist
421    tick and cross become up and down to move current location
422
423     
424 Battery
425   try to get more timely alerts without polling  - Need to use DBUS.
426   DONE  Select between pop-up new window and restore old window
427   DONE Show time_to_{full,empty}_now in correct units
428   ?? use 'status' for 'Charging' ...
429   DONE timeout to make window disappear?  or to refresh display
430   DONE  pop up window with
431     suspend
432     shutdown
433     500/1000 mAmps
434     
435 network
436   need to consider Wifi, USB, bluetooth, gprs, BT/ppp
437    Show status of each
438    device specific page for each:
439     Wifi:
440        list access points
441        connect with DHCP, enter WPA-PSK
442        suspend mode: power off or WOW
443     USB:
444        disable/DHCP-client/DHCP-server
445        if dchp-server: have list of address configs to choose between
446         if another network is active, choose based on that.
447     Bluetooth
448        list peers
449        connect
450        listen
451        DHCP client/server
452        disable/power down
453        ppp over rfcomm
454     GPRS
455        on-demand
456        enter AP
457
458 launcher
459   content for status page:
460     - date, time,  timezone??
461     - GSM carrier, Cellid  strenght?
462     - Network connectivity
463     - new messages
464     - missed calls
465     - last window
466     - GPS co-ords?
467     - next reminder
468     - top of todo list??
469     - load average / uptime
470   Delay "wmctrl -l" a bit so that we start up faster ??
471
472   support displaying values from root attributes
473   run wmctrl at the right time better.
474   have a 'status' folder which shows 'today'
475   use pango.markup
476   Don't adjust sizes of entires
477   Allow different sizes items - keep list of offset for click
478   Don't allow item to be selected if no buttons
479   Center type. MAybe "type" can be e.g. "cmd:center" or "thing:right"
480   How to schedule redraw of e.g. time / date / etc
481      Expensive tasks would need to cache values incase they are called too often.
482   don't iconize- just stay behind
483   watch root properties to be notified of window changes.
484
485   DONE direct button access
486   DONE list options
487   DONEkill window
488   DONE reload option
489
490   DONE Two columns with button row at bottom.
491   DONE First column is cmd group and includes 'active windows'
492   DONE Second column is options in the group
493   DONE Buttons are "run" or "stop"
494
495   I want a third column.  When it appears, the first column disappears.
496   This can be used for:
497     - address-book access when making a call
498     - log of recent calls - in or out
499     - todo list?
500   Why not just put these in the second column with the trigger in the first.
501   So first column gets:
502      contact:  shows address book.
503                text entry reduces list
504                selection provides 'call' and 'txt' and 'open' buttons
505      calls:  shows similar list, but of recent calls.  Can call back
506              or save numbers.
507   Selecting 'last call' or 'dialout' in status window can allows jump to
508      this different page.
509
510   I think I need to rewrite launcher from scratch - it got messy.
511   Have same layout:
512     - text entry at the top:
513           any change is sent to any visible task
514     - buttons at the bottom.
515           these are chosen by active task
516     - left column of task groups.
517         apps comms calls contacts windows games status
518     - right column of tasks
519
520   A 'tasklist' is given to each column and can be static or dynamic.
521   A 'task' has an appearance and an action.
522   For the right column, the action sets the left column.
523   For the left column, the action sets the buttons
524   The buttons also have appearance and action.  The action
525    can do all sorts of things:
526     - run or kill program
527     - raise or close window
528     - make phone call / hang up
529
530   The two columns can be replaced by a textarea that displays the output
531   of some command.
532
533   The 'aux' button can be pressed or held.
534    - press raises the window, then selects 'status', then returns to previous window
535    - hold ... what can that do?  Answer the phone?
536   Maybe if a task is signalling for attention, then 'press' goes to
537    that task, and 'hold' activated the first button for the task.
538
539   I need to define the interface for pluggins.
540    A plugin needs to be able to:
541       - create a task
542       - create a group
543       - watch a file
544       - run a process
545       - open a window
546       - Add an embedded-window
547    
548    A task must be able to
549       - display a text
550       - present some buttons
551       - present an embedded window
552       - receive keyboard input
553       - request that a different task or group be selected
554
555    Some examples of the embedded window:
556      - tap-board for text/number entry
557      - calendar - one month
558      - text, e.g. SMS message, email
559
560   Config file:
561    This stores a list of groups.
562    Some groups need no further details (e.g. active windows)
563    Others need to explicitly list tasks
564     Tasks can be:
565       Internal (in a module)
566       External-window (program to run, window to find)
567       External-text
568
569     When listing explicit tasks we can use:
570       !command
571           for external-text
572       (window) command
573           for external-window, where 'window' is the name of the window
574       module.command
575           for an internal module
576
577    Each group is given in config file as:
578      [name/type]
579    if '/type' is missing, "list" is assumed.
580    Types and the required content are:
581      list
582         a series of task descriptions
583      windows
584         a series of window names to ignore (?)
585      contacts
586         file= name of address book
587      call-log
588         nothing - the call log has a standard location
589      
590    If 'type' is 'modules', then each line names a module
591    
592    Modules have an entry point "init" which returns:
593      a list of group types supported
594      a list of internal commands
595    each is paired with an object-creation command.
596
597    A 'group' object must be able to parse config lines
598     and produce a task list etc.
599
600 gpstrack
601   pygtk similar to tangogps
602
603    Display maps, zoom follow GPS
604      Separate threads for file loading, GPS track, and UI
605      3-D view of path??
606    record path followed
607      Always compress and write to a file
608    record drawn path
609    download maps
610       - always all parent maps for a given download
611       - download maps along a path (to some depth/width)
612          This includes a drawn path.
613    If map not available, scale other resolution
614    record locations
615    display locations
616    report time-to-first-fix
617    three different modes interpretting drag
618     1/ move map around
619     2/ draw a path on the map
620     3/ write text to tag location or path.
621
622
623 Bible viewer:
624   Store KJV
625   Download and cache NIV if Network available.
626   Windows:
627
628 Sound recorder:
629  - support pause/restart
630  - play from start, play last 10 seconds, seek
631  - allow naming of music files
632  - adjustable audio level??
633  - adjustable compression ??  speex/vorbis
634
635 phone functions
636  ON-CALL
637    pops up when a call becomes active
638    presents number*# buttons for tones
639    Allows HOLD/CALL-WAITING/HANG_UP
640    Disappears when no call is active
641    Should handle VOIP too, including call-waiting
642    Logs times??
643    disables suspend
644    un-pause after the call ??
645    Warning tone at points in call time
646
647  Answer-Call
648    Display CNI, look up in address book
649    Choose ring tone bassed on number and time of day??
650    Check device position and be quiet if face down.
651    
652  Make Call
653    allow number to be entered somehow
654    choose VOIP or mobile, while number is being entered.
655    silence music, disable suspend
656    Make connections, log, trigger ON-CALL
657
658  SendSMS
659    text + recipient 
660     send via eXeTeL if network is up, else ??
661
662    Editor window:  simple text, no new lines. auto scroll,
663      simple editing
664      spell check
665      auto-wrap
666
667     Q:
668      How to select for cut/paste?? 
669        'cut' button is normally 'select'.
670        tap that, then draw range, then 'cut'
671      status bar with valid spellings?  and common continuations
672    Buttons:
673      send:   sends to one or more addresses
674      draft:  save as a draft and go to list of drafts
675      config: go to config page.
676
677    If sending fails, save as draft and go to draft page.
678    If it succeeds, save as 'send' and save to 'sent' page.
679
680    'message list' page shows one message per line.
681    messages can be selected.
682    the selected message can be:
683        deleted
684        reloaded for send
685        viewed?
686    The list can be:
687        all / draft / new / sent / received
688        restricted by search string
689        up/down a page
690     So:
691      Top:
692       delete/view/send buttons
693      Bottom:
694       One button rotates through all/draft/new/sent/received
695       two for up/down
696       one for search
697
698    Config options:
699       backend to use for different class of number.
700       each backend has a config page.
701          exetel userid and password
702
703  RecvSMS
704    Database of all messages
705    Highlight unread messages
706    Sort in selectable order - provide virtual folders
707         Date, Month, Sender "contains text"
708
709    Handle VCARD:
710 0000000 006 005 004   # 364  \0  \0   B   E   G   I   N   :   V   C   A
711 0000020   R   D  \r  \n   V   E   R   S   I   O   N   :   2   .   1  \r
712 0000040  \n   N   :   F   a   n   n   y  \r  \n   T   E   L   ;   P   R
713 0000060   E   F   ;   W   O   R   K   ;   V   O   I   C   E   :   9   2
714 0000100   3   4   8   9   0   8  \r  \n   T   E   L   ;   C   E   L   L
715 0000120   ;   V   O   I   C   E   :   0   4   3   3   2   3   1   0   6
716 0000140   9  \r  \n   T   E   L   ;   H   O   M   E   ;   V   O   I   C
717 0000160   E   :   0   2   9   6   6   1   8   8   8   8  \r  \n   E   N
718 0000200   D   :   V   C   A   R   D  \r  \n
719 BEGIN:VCARD^M
720 VERSION:2.1^M
721 N:Fanny^M
722 TEL;PREF;WORK;VOICE:92348908^M
723 TEL;CELL;VOICE:0433231069^M
724 TEL;HOME;VOICE:0296618888^M
725 END:VCARD^M
726
727
728  SMS storage:
729
730   ** Worry about ASCII / UNICODE
731   a/ could use one file per message, named by time
732      with links to a directory for 'draft' or 'new'
733      But that wastes space.
734   b/ could use a TDB database, keyed by date, with
735      a hierarchy of days and years for directories.
736   c/ plain text file, one per month
737      'new' and 'draft' are separate files that list ids.
738
739   Probably c.
740
741   Each SMS entry is one line, space separated:
742     date-time  %Y%m%d-%H%M%S.uuid
743     'from' number
744     'to' numbers, comma separated
745     'text' of message, URL encoded on to one line with no spaces.
746
747   Hmm.. 
748
749
750   More on storage.
751     There are two dates that could be of interest.
752       - the time I first saw the message (my clock)
753       - the time the message was sent (with incoming messages).
754      We need to record both of these.
755      For outgoing, there could be "time message successfully sent"
756
757
758 ----------------------------------------------------------------
759 Thinking about buttons.
760
761  - I want to easily/quickly get to 'main page' with time and status etc.
762    But sometimes I want to get 'back where I was' after a screen blank
763
764  - I want the 'power' button to always do the same thing.  It wakes up
765    from suspend, so it must wake up the same way from blank.
766    But what should it present:  last screen, last launcher, or status?
767    It should be the thing I most likely want after a long abscence, which
768    would be the front status page.
769    It should also be the thing that I can use when there is an incoming call.
770    That would be something with an 'answer' button.  So The status page
771    with 'incoming call' selected and 'answer/cancel' buttons at the bottom.
772    'Answer' would alert the GSM-call window to pop up and answer the call.
773
774  - So the aux button does:
775     - nothing during suspend
776     - wakeup display during blank
777     - launcher when active
778
779  - But that means the lock program needs to grab AUX, so the earpiece
780    switch gets grabbed too.  So either the lock program handles earpiece
781    switching, or it signals someone else.  I guess we write to a file when
782    that changes.  Though we could go direct to scenarios symlink.
783    How complex should this be?
784      /var/lib/audio/scenario -> handset or headset
785      handset -> scenario/handset  ditto for headset
786      scenario points to gsm, voip, stereo, record, gsm-speaker
787      these are each directories which contain 2 .state files.
788
789  - Maybe I want a button to bring up the tap-board as well??
790
791  Maybe:
792    power button always brings up control window, and selects status
793    aux button returns to
794
795
796
797 And about lights.
798 We have two lights.
799 One can be red.
800 One can be blue, orange, or purple.
801 We can used the signal:
802   - charging state (powered, battery full)
803   - ringing state (could be different colour depending on if we know them)
804   - blank-but-not-off-yet
805   - wifi associated (might be a waste of battery...)
806   - 
807
808 PLAN:
809
810  - arrange for power button to present status page
811  - Sort out tapinput usage
812  - install sendsms and make sure I can send via GSM
813  - sync SMS messages from SIM to flash
814  - display unread message info in status page
815  - tap on that goes to SMS application
816
817
818 QVGA:
819  qvga-normal & normal in "/sys/bus/spi/devices/spi2.0/state" .
820
821 SMS/cellid
822   www.opencellid.org
823
824   Keep database of locations and cells I have seen.
825   Don't add duplicates that are within 100m... say 3 seconds or arc.
826
827   ?? Create a key by interleaving bits from lat and long
828    That gives discontinuities.. but we only need to search 2 places.. well, 4.
829     So if we want lat==a..b and long==c..d
830     We find the most sig bit in which a and b (resp c and d) differ
831     and need to check
832
833 ----------------------------------------------------
834 What happens when I type text.  I might want to:
835
836    - make a phone call .. or SMS
837    - look up name in address book
838    - calculate result
839    - add to TODO list
840    - lookup in shopping list
841
842 Maybe each 'task' can register a text handler.
843  They get called when text changes and can update their name??
844  They could make themselves active, but hopefully only one would do that.
845  How could 'address book' show a list of possibles?
846
847 I have outgoing calls sortof working.
848 Need:
849   - gsmd to know and track status in 'incoming'.
850   - wait for atchan to be set up so I don't have to press twice DONE
851   - clean text when call completes
852   - steal keyboard input for touchtones ??
853   - call history
854   - address book lookup
855
856
857 ----------------------------------------
858 Main page currently has
859   two columns for selection/status
860   buttons at bottom for action
861
862   Want text input line at the top for e.g. phone number,
863   contact name, calculation, note search
864   But when not typing anything it is visually unpleasant.
865   For buttons at bottom, they simple provide more space.
866   That doesn't work so well at the top.. unless we can do something with the
867   'gravity' setting .. seems unlikely.
868   So I want something permanent there when there is no input.