Xlib_square_example.png (200 × 200 pixels, file size: 674 bytes, MIME type: image/png)
This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
Summary
DescriptionXlib square example.png |
Čeština: Jednoduchá Xlib aplikace vykreslující čtvereček a text v okně. Bez dekorací správce oken.
English: Simple Xlib application drawing a box and text in a window. Without window manager decorations. |
Date | |
Source | Own work |
Author | Skim |
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
C source code
/*
* Simple Xlib application drawing a box in a window.
* gcc input.c -o output -lX11
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
int
main(int argc, char **argv)
{
Display *display;
Window window;
XEvent event;
char *msg = "Hello, World!";
int s;
/* Open connection with the server. */
display = XOpenDisplay(NULL);
if(display == NULL){
fprintf(stderr, "Cannot open display\n");
exit(1);
}
s = DefaultScreen(display);
/* Create window. */
window = XCreateSimpleWindow(display, RootWindow(display, s), 10, 10,
200, 200, 1, BlackPixel(display, s), WhitePixel(display, s));
/* Select kind of events we are interested in. */
XSelectInput(display, window, ExposureMask | KeyPressMask);
/* Map (show) the window. */
XMapWindow(display, window);
/* Event loop. */
for(;;){
XNextEvent(display, &event);
/* Draw or redraw the window. */
if(event.type == Expose){
XFillRectangle(display, window, DefaultGC(display, s),
20, 20, 10, 10);
XDrawString(display, window, DefaultGC(display, s), 50,
50, msg, strlen(msg));
}
/* Exit on key press. */
if(event.type == KeyPress)
break;
}
/* Close connection to server. */
XCloseDisplay(display);
return 0;
}
Items portrayed in this file
depicts
Wikimedia username<\/a>"}},"text\/plain":{"en":{"":"Wikimedia username"}}},"{\"value\":\"Skim\",\"type\":\"string\"}":{"text\/html":{"en":{"P4174":"Skim<\/a>","P2093":"Skim"}},"text\/plain":{"en":{"P4174":"Skim","P2093":"Skim"}}},"{\"value\":{\"entity-type\":\"property\",\"numeric-id\":2699,\"id\":\"P2699\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"":"URL<\/a>"}},"text\/plain":{"en":{"":"URL"}}},"{\"value\":\"https:\\\/\\\/commons.wikimedia.org\\\/wiki\\\/user:Skim\",\"type\":\"string\"}":{"text\/html":{"en":{"P2699":"https:\/\/commons.wikimedia.org\/wiki\/user:Skim<\/a>"}},"text\/plain":{"en":{"P2699":"https:\/\/commons.wikimedia.org\/wiki\/user:Skim"}}},"{\"value\":{\"entity-type\":\"property\",\"numeric-id\":2093,\"id\":\"P2093\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"":"author name string<\/a>"}},"text\/plain":{"en":{"":"author name string"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P170 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
copyrighted<\/a>"}},"text\/plain":{"en":{"P6216":"copyrighted"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P6216 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
Creative Commons Attribution-ShareAlike 3.0 Unported<\/a>"}},"text\/plain":{"en":{"P275":"Creative Commons Attribution-ShareAlike 3.0 Unported"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P275 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
31 December 2013
original creation by uploader<\/a>"}},"text\/plain":{"en":{"P7482":"original creation by uploader"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P7482 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 10:41, 31 December 2013 | 200 × 200 (674 bytes) | Skim | User created page with UploadWizard |
File usage
The following page uses this file:
Global file usage
The following other wikis use this file:
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
PNG file comment |
|
---|---|
Horizontal resolution | 37.8 dpc |
Vertical resolution | 37.8 dpc |
File change date and time | 10:37, 31 December 2013 |
Retrieved from "https://en.wikipedia.org/wiki/File:Xlib_square_example.png"