12 graphic programming, Ktam3874/pitx software guide, 1 x11 – Kontron KTAM3874-pITX User Manual

Page 120

Advertising
background image

KTD-S0057-I

Page 116 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide

10.12 Graphic Programming

10.12.1 X11

TM

X11

TM

realizes a client/server architecture and supports graphical screen output as well as keyboard and

mouse input. The following example only gives a small overview about the X11

TM

features. First you can see

two buttons and after click on the centered button the program shows the screen below.

But there exist two restrictions: program execution via the serial remote interface is not possible and the
program is only checked with an HDMI

®

monitor. For cross compilation the addition of the X11

TM

lib within

the Makefile may be necessary, e.g.

LDFLAGS := -l

X11

. If so copy the library from the target hardware to a

search path and if required create a new link or rename the file to

libX11.so

(see previous chapter).

/***************************************************************
* X11 demonstration program

* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
****************************************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "picture.xbm"

#define TRUE

1

#define LEFT

200

#define TOP

200

#define WIDTH

400

#define HEIGHT

216

#define BORDER

4

#define BACKGND_COL

"seagreen"

#define HEADER

"BUTTONTEST"

#define BTN_WIDTH

90

#define BTN_HEIGHT

30

#define BTN_LINECOL

"gray32"

#define BTN_GRAYCOL

"lightgray"

#define BTN_BLUECOL

"cornflowerblue"

#define BTN_TEXTCOL

"navy"

Advertising
This manual is related to the following products: