Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 139

Advertising
background image

KTD-S0057-I

Page 135 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


/***************************************************************
* X11 color 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 <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define TRUE

1

#define LEFT

200

#define TOP

200

#define WIDTH

600

#define HEIGHT

600

#define BORDER

4

#define WAIT

3

#define HEADER

"COLORTEST"

#define FONT

"9x15"

#define RC_SIZE

280

#define RC_X

10

#define RC_Y

10

#define RC_SPC

20

struct cols {
int val;
const char* name;
};

static const struct cols colors[] = {

{.val = 1,

.name = "aliceblue" },

{.val = 2,

.name = "bisque" },

{.val = 3,

.name = "coral" },

{.val = 4,

.name = "cyan3" },

{.val = 5,

.name = "crimson" },

{.val = 6,

.name = "firebrick" },

{.val = 7,

.name = "gold" },

{.val = 8,

.name = "gray22" },

{.val = 9,

.name = "greenyellow" },

{.val = 10,

.name = "indigo" },

Advertising
This manual is related to the following products: