天天看點

嵌入式GUI FTK介紹(10)-編譯選項

作為嵌入式GUI, FTK必須要能适應不同的環境,在Linux下,這可以通過編譯選項來配置。

o 支援電阻式觸摸屏 –enable-tslib

build with tslib support, tslib is a library to handle touchscreen event,

if you has a resistive touchscreen, you should enable this option.

電容式觸摸屏不需要tslib,直接從/dev/input/eventX裡讀取即可,不需要打開該選項。

o 選擇字型引擎 –with-fontengine

there are two options: default and freetype, generally freetype is better

choise, but if you don’t want to depend on freetype, or freetype is

unavailable, use default instead.

FTK可以使用freetype,也可以使用預設字型引擎。freetype可以用來支援多種格式的字型,特别是可以自由縮放的矢量字型,靈活性更高。而預設字型引擎使用256級灰階的點陣字型,不能自由綻放,但它的好處在于不依賴于第三方軟體包。另外,FTK提供一個字型轉換工具,把适量字型轉換

成點陣字型。

o 選擇後端 –with-backend

backend means how to display bitmap on the screen and how to get the input

device events. there are three options now:

linux-x11:WxH With this option, FTK will run on X11 for emulation. W and H is

the width and height of the emulator. For exmaple, with the following value,

it will create a emulation window with 320 pixels width and 480 pixels height.

–with-backend=linux-x11:320×480

linux-native With this option, FTK will run on linux framebuffer, this is

default value.

linux-vlcd With this option, FTK will run on virtual framebuffer. I wrote a

emulator for FTK base on memfb and uinput, with a vnc server and vncviever,

FTK can run on VNC.

linux-dfb With this option, FTK will run on DirectFB, FTK does not use

DirectFB Windows system, just use it to abstract display and input device, so

you can utilize DirectFB hardware acceleration.

backend決定了FTK如何顯示位圖,以及如何擷取輸入事件。通過backend的抽象,FTK可以運作在多個平台上,比如X11、DirectFB、framebuffer、Windows和其它平台。

繼續閱讀