About: Ftwl   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Freeciv Theme and Widget Layer (FTWL) is a low-level library for manipulating the graphics and input systems on your computer, and displaying screens with widgets based on themes loaded from configuration files. A few naming conventions: be_* backend functions te_* theme engine functions sw_* widget related functions osda off-screen drawing area buffer Programming in FTWL is quite simple. Here is an annotated example: TODO:

AttributesValues
rdfs:label
  • Ftwl
rdfs:comment
  • Freeciv Theme and Widget Layer (FTWL) is a low-level library for manipulating the graphics and input systems on your computer, and displaying screens with widgets based on themes loaded from configuration files. A few naming conventions: be_* backend functions te_* theme engine functions sw_* widget related functions osda off-screen drawing area buffer Programming in FTWL is quite simple. Here is an annotated example: TODO:
dbkwik:freeciv/pro...iPageUsesTemplate
abstract
  • Freeciv Theme and Widget Layer (FTWL) is a low-level library for manipulating the graphics and input systems on your computer, and displaying screens with widgets based on themes loaded from configuration files. A few naming conventions: be_* backend functions te_* theme engine functions sw_* widget related functions osda off-screen drawing area buffer Programming in FTWL is quite simple. Here is an annotated example: #include Always remember this one, folks, otherwise you end up with bugs that are horribly difficult to figure out. I speak from experience... #include #include #include "shared.h" #include "support.h" These are utility files. #include "back_end.h" #include "widget.h" These two contain the public API of FTWL. struct sw_widget *root; A variable to point to the root window. void nullfunc(int socket); /* prototype */ static bool my_key_handler(struct sw_widget *widget, const struct be_key *key, void *data) { assert(ct_key_is_valid(key)); if (key->type == BE_KEY_NORMAL && key->key == 'q') { exit(0); return TRUE; } return FALSE; } The above function is a callback that handles all keypresses that are received on the root window. We use this to add a convenient way to exit our example application. void nullfunc(int socket) { return; } The main loop expects a function pointer that can give it input from outside devices, eg the network. We just use an empty function here. int main(int argc, char **argv) { struct ct_size res; struct ct_size size; res.width = 640; res.height = 480; sw_init(); be_init(&res, FALSE); Now we have set up the main window at 640x480. /* Error checking */ be_screen_get_size(&size); if (size.width != res.width || size.height != res.height) { die("Instead of the desired screen resolution (%dx%d) " "got (%dx%d). This may be a problem with the window-manager.", res.width, res.height, size.width, size.height); } Error checking is always nice. root = sw_create_root_window(); Set up the root window. sw_window_set_key_notify(root, my_key_handler, NULL); Register our key handler from above. You need to register key handlers for any widget that is supposed to receive key presses. sw_mainloop(nullfunc); Start the main loop. Unlike more primitive libraries, FTWL has a built-in main loop, and your program must be callback-driven. return 0; } That's it. TODO: * Add more documentation! * Support UNICODE * Support more depth on the existing backend * Create a backend with palette mode (no transparency, no AA) * OpenGL, Quartz and DirectX backends
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software