This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* adopted from http://zetcode.com/gfx/cairo/cairobackends/ | |
*/ | |
#include <cairo.h> | |
int main() { | |
cairo_surface_t* surface; | |
cairo_t* cr; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <glib.h> | |
#include <gtk/gtk.h> | |
#include <gdk/gdk.h> | |
#include <cairo.h> | |
#include <poppler.h> | |
/* gcc `pkg-config --cflags --libs gtk+-2.0 poppler-glib` -o pdfviewer pdfviewer.c */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Adopted from http://james.id.au/tech/doc/gdk/ | |
* gcc -o my_first_gdk_app.bin my_first_gdk_app.c `pkg-config gtk+-2.0 --cflags --libs` | |
* The GDK headers. Very important. | |
*/ | |
#include <gdk/gdk.h> | |
/* Convenient way to suck in all the glib stuff. | |
*/ | |
#include <glib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <glib.h> | |
#include <gdk/gdk.h> | |
#include <gtk/gtk.h> | |
#include <glib/gprintf.h> | |
#include <string.h> | |
/* | |
* | |
* Colorpicker. That's all. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Print entire HTML text after processed JavaScript | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0` | |
* gcc -Wall $FLAGS getbodytext.c -o getbodytext | |
* | |
* usage: | |
* /usr/bin/xvfb-run ./getbodytext test.html | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gdk/gdk.h> | |
int main( int argc, char* argv[] ) { | |
gdk_init( &argc, &argv ); | |
gdk_exit( 0 ); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Simple Xlib application drawing a box in a window. | |
* gcc input.c -o output -lX11 | |
* Adopted from http://en.wikipedia.org/wiki/Xlib | |
*/ | |
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <iostream> | |
#include <unistd.h> | |
int main(void) { | |
Display* dpy = XOpenDisplay(0); | |
int scr = XDefaultScreen(dpy); | |
Window root_window = XRootWindow(dpy, scr); | |
int height = DisplayHeight(dpy, scr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CODE | |
/* test.cc | |
* Compile with: g++ `pkg-config --cflags --libs x11` test.cc -o test | |
* Run with: ./test | |
*/ | |
#include <stdio.h>//printf | |
#include <string.h>//strlen | |
#include <stdlib.h>//atexit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ font_path_list.cxx $(pkg-config x11 --libs --cflags) | |
#include <X11/Xlib.h> | |
#include <cassert> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> |