Low Level X Window Programming An Introduction by Examples

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This is the missing X Window book. While others have shown what the X Window system has available, this book shows how to convert this potential into working tools to fulfil your visualisation needs. It is of the show-me class of books. The majority of the book covers Xlib, although a short coverage of Xcb is also given. Included are: . The relationship between Xlib and the X Window protocol; . All the basic Xlib topics are covered; . Complete working programs with their results; . Exercises to reinforce the material just covered. A 9 part partition to building a complete X program is used throughout. This partitioning fosters the inclusion of all code necessary. All programs are written in C and are one to four pages in length. Open source programs with the occasional Postscript script are shown to provide support as needed. Throughout the examples consideration is given to using colour. The examples produce simple results with the aim of providing building blocks for application oriented codes. The book is directed at graduate students and researchers who create computer code to visualise their data.

Author(s): Ross J. Maloney
Publisher: Springer
Year: 2017

Language: English
Pages: 270
Tags: X Window

Preface......Page 5
Reader Background Assumed......Page 7
Contents......Page 8
1 Preliminaries......Page 12
1.1 The Place of the X Protocol......Page 13
1.2 X Window Programming Gotchas......Page 15
1.3 Programming in X Window......Page 16
2.1 Basic Xlib Programming Code Blocks......Page 17
2.2 Creating a Single Window......Page 18
2.2.1 Open Connection to the Server......Page 19
2.2.2 Top-Level Window......Page 20
2.3 Smallest Xlib Program to Produce a Window......Page 23
2.4 A Simple but Useful Xlib Program......Page 25
2.5 A Moving Window......Page 26
2.6 Parts of Windows Can Disappear from View......Page 31
2.6.1 Testing Overlay Services Available from an X Server......Page 32
2.6.2 Consequences of No Server Overlay Services......Page 34
2.6.3 Exercises......Page 39
2.7 Changing a Window's Properties......Page 40
2.8 Summary......Page 42
3 Windows and Events Produce Menus......Page 44
3.1 Colour......Page 45
3.2 A Button to Click......Page 48
3.3 Events......Page 53
3.4 Menus......Page 58
3.4.1 Text Labelled Menu Buttons......Page 59
3.5 Further Consideration of Mouse Events......Page 66
3.5.1 Exercises......Page 76
3.6 A Mouse Behaviour Application......Page 77
3.7 Implementing Hierarchical Menus......Page 80
3.7.1 Exercises......Page 90
3.8 Which Window Gets the Event?......Page 91
3.9 Summary......Page 93
4 Pattern Maps and Labels......Page 94
4.2 Pattern Patches......Page 95
4.3 Bitmap Patterns......Page 96
4.4 A Bitmap Cursor......Page 101
4.5 A Partially Transparent Pixmap......Page 106
4.6 Using Postscript to Create Labels......Page 110
4.7 Changing the Colour of a Pixmap......Page 114
4.8 Reducing Server–Client Interaction by Images......Page 117
4.9 Creating Menus by Using the Image Format......Page 121
4.10 Forming Text Messages from Bitmap Glyphs......Page 127
4.10.1 Accessing X11 Standard Bitmap Fonts......Page 128
4.10.2 How to Use the Bitmap Fonts......Page 132
4.11 Using Pixmaps to Colour a Window's Background......Page 140
4.11.1 Exercises......Page 146
4.12 Summary......Page 147
5 Keyboard Entry and Displaying Text......Page 148
5.1 Elementary Keyboard Text X Entry......Page 149
5.2 What Fonts Are Available......Page 153
5.3 Keyboard Echoing on Windows......Page 155
5.4 Putting Lines of Text in a Window......Page 161
5.5 Insertion Cursor......Page 165
5.5.1 Exercises......Page 171
5.6 Moving Between Text Input Windows Using Keys......Page 172
5.7 A Slider Bar......Page 177
5.8 Scrolling Text......Page 182
5.8.1 Scrolling Horizontally......Page 184
5.8.2 Scrolling Vertically......Page 188
5.8.3 Exercises......Page 193
5.9 Summary......Page 194
6 Classic Drawing......Page 195
6.1 Limit on Multiple Objects in a Request......Page 196
6.2 Drawing Lines, Circles, and a Coloured-In Square......Page 198
6.3 A Symbol Composed from Circle Parts......Page 202
6.4 A Circle Bouncing off Plain Edges......Page 206
6.5 Displaying the Multi Colours of a Photograph......Page 211
6.5.1 Exercises......Page 215
6.6 Summary......Page 216
7 Extensions......Page 217
7.1 Multi-colour XPM Pixmaps......Page 218
7.2 Network Connecting Client to Server......Page 224
7.3 Scalable Fonts......Page 227
7.4 Summary......Page 231
8 The Xcb Alternative......Page 232
8.1 Starting and Finishing with Xcb......Page 233
8.2 Creating and Using a Window......Page 234
8.3 Communicating with the Window Manager......Page 237
8.4 Events......Page 238
8.5 A Consolidation Program......Page 241
8.6 Colour, Fonts, then Text......Page 243
8.7 A Classic Program Converted to Xcb......Page 247
8.8 Summary......Page 251
9 Closer to the X Protocol......Page 252
9.1 The X Window Environment......Page 253
9.1.1 Exercises......Page 254
9.2 Client/Server Interaction......Page 255
9.3 More than a Protocol is Required......Page 259
9.3.1 Exercises......Page 264
9.4 Summary......Page 265
Appendix References......Page 266
Index......Page 267