README.DirectFB
author Sam Lantinga <slouken@libsdl.org>
Wed, 03 Oct 2012 20:49:16 -0700
changeset 6555 f2c03c06d987
parent 5199 164f20ba08eb
child 6987 7084af936d82
permissions -rw-r--r--
Fixed bug 1614 - SDL for Android does not implement TextInput API

Andrey Isakov 2012-10-03 08:30:25 PDT

I've found out in the process of porting one OS project to Android/SDL2 that
there is no support for TextInput events/APIs on Android.
So I implemented some kind of initial support of that feature, and at the very
least it seems to work fine with latin chars input with soft and hardware
keyboards on my Moto Milestone2. I've also tried playing around with more
complex IMEs, like japanese, logging the process and it seemed to work too. I'm
not sure since the app itself I am working on does not have support for
non-latin input.

The main point of the patch is to place a fake input view in the region
specified by SDL_SetTextInputRect and create a custom InputConnection for it.
The reason to make it a separate view is to support Android's pan&scan on input
feature properly. For details please refer to
http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html
Even though the manual states that SetTextInputRect is used to determine the
IME variants position, I thought this would be a proper use for this too.
     1 SDL on DirectFB
     2 
     3 Supports:
     4 
     5 - Hardware YUV overlays
     6 - OpenGL - software only
     7 - 2D/3D accelerations (depends on directfb driver)
     8 - multiple displays
     9 - windows
    10 
    11 What you need:
    12 
    13 DirectFB 1.0.1, 1.2.x, 1.3.0
    14 Kernel-Framebuffer support: required: vesafb, radeonfb .... 
    15 Mesa 7.0.x	   - optional for OpenGL
    16 
    17 /etc/directfbrc
    18 
    19 This file should contain the following lines to make
    20 your joystick work and avoid crashes:
    21 ------------------------
    22 disable-module=joystick
    23 disable-module=cle266
    24 disable-module=cyber5k
    25 no-linux-input-grab
    26 ------------------------
    27 
    28 To disable to use x11 backend when DISPLAY variable is found use
    29 
    30 export SDL_DIRECTFB_X11_CHECK=0
    31 
    32 To disable the use of linux input devices, i.e. multimice/multikeyboard support,
    33 use
    34 
    35 export SDL_DIRECTFB_LINUX_INPUT=0
    36 
    37 To use hardware accelerated YUV-overlays for YUV-textures, use:
    38 
    39 export SDL_DIRECTFB_YUV_DIRECT=1
    40 
    41 This is disabled by default. It will only support one 
    42 YUV texture, namely the first. Every other YUV texture will be
    43 rendered in software.
    44 
    45 In addition, you may use (directfb-1.2.x)
    46 
    47 export SDL_DIRECTFB_YUV_UNDERLAY=1
    48 
    49 to make the YUV texture an underlay. This will make the cursor to
    50 be shown.
    51 
    52 Simple Window Manager
    53 =====================
    54 
    55 The driver has support for a very, very basic window manager you may
    56 want to use when runnning with "wm=default". Use
    57 
    58 export SDL_DIRECTFB_WM=1
    59 
    60 to enable basic window borders. In order to have the window title rendered,
    61 you need to have the following font installed:
    62 
    63 /usr/share/fonts/truetype/freefont/FreeSans.ttf
    64 
    65 OPENGL Support
    66 ==============
    67 
    68 The following instructions will give you *software* opengl. However this
    69 works at least on all directfb supported platforms.
    70 
    71 As of this writing 20100802 you need to pull Mesa from git and do the following:
    72 
    73 ------------------------
    74 git clone git://anongit.freedesktop.org/git/mesa/mesa
    75 cd mesa 
    76 git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
    77 ------------------------
    78 
    79 Edit configs/linux-directfb so that the Directories-section looks like
    80 ------------------------
    81 # Directories
    82 SRC_DIRS     = mesa glu 
    83 GLU_DIRS     = sgi
    84 DRIVER_DIRS  = directfb
    85 PROGRAM_DIRS = 
    86 ------------------------
    87 
    88 make linux-directfb
    89 make
    90 
    91 echo Installing - please enter sudo pw.
    92 
    93 sudo make install INSTALL_DIR=/usr/local/dfb_GL
    94 cd src/mesa/drivers/directfb
    95 make
    96 sudo make install INSTALL_DIR=/usr/local/dfb_GL
    97 ------------------------
    98 
    99 To run the SDL - testprograms:
   100 
   101 export SDL_VIDEODRIVER=directfb
   102 export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
   103 export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
   104 
   105 ./testgl
   106