Tag: cairo

  • programming tip 1.

    In CAIRO + GTK programming.The GTK part will be in the main() function. and cairo API will be in the functions that GTK calls. Ofcourse GTK API can be in the functions too, but CAIRO will not be inside main() normally.

  • cairo 1.1 working internal

    screenshots of tinkering (gdb) bt #0 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:84 #1 0x00007ffff509db24 in do_clone (pd=0x7ffff03bd710, attr=0x7ffff50a7f20, stackaddr=0x7ffff03bd9e0, stopped=1, fct=, clone_flags=) at ../nptl/sysdeps/pthread/createthread.c:75 #2 0x00007ffff509e0d2 in create_thread (newthread=, attr=, start_routine=, arg=) at ../nptl/sysdeps/pthread/createthread.c:205 #3 __pthread_create_2_1 (newthread=, attr=, start_routine=, arg=) at pthread_create.c:561 #4 0x0000000000401a82 in timer_exe (window=0x638400) at cairoanimation.c:138 (gdb) frame 4 #4 0x0000000000401a82 in timer_exe (window=0x638400) […]

  • cairo graphics 1.1 beautification

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include #include //the global pixmap that will serve as our buffer static GdkPixmap *pixmap = NULL; gboolean on_window_configure_event(GtkWidget * da, GdkEventConfigure * event, gpointer user_data){ static int oldw = 0; static int oldh = 0; //make our selves a properly […]

  • cairo graphics 1.0

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include #include //the global pixmap that will serve as our buffer static GdkPixmap *pixmap = NULL; gboolean on_window_configure_event(GtkWidget * da, GdkEventConfigure * event, gpointer user_data){ static int oldw = 0; static int oldh = 0; //make our selves a properly […]

  • cairo graphics 0.8 (intersection)

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include #include //the global pixmap that will serve as our buffer static GdkPixmap *pixmap = NULL; gboolean on_window_configure_event(GtkWidget * da, GdkEventConfigure * event, gpointer user_data){ static int oldw = 0; static int oldh = 0; //make our selves a properly […]

  • context switch

    context switch Multiprogramming leads to the concept of a process. Metaphorically,a process is a program’s breathing air and living space-that is,a running program plus any state needed to continue running it.Time- sharing is a variation of multi-programming that shares the CPU and memory with several interactive users at the same time, giving the illusion that […]

  • cairo graphics 0.5 (arc )

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { int i; cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0.3, 0.8, 0.7); cairo_set_line_width(cr,1.0); for (i=0;i<100;i++) { /* cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i);*/ /* cairo_rectangle(cr,100,100,10+i,10+i);*/ cairo_arc(cr,100,100,60,50,10); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* […]

  • cairo graphics 0.4 (line work animation)

    /* http://cairographics.org/threaded_animation_with_cairo/ */ /* Hack by Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include //the global pixmap that will serve as our buffer static GdkPixmap *pixmap = NULL; gboolean on_window_configure_event(GtkWidget * da, GdkEventConfigure * event, gpointer user_data){ static int oldw = 0; static int oldh = 0; //make […]

  • cairo graphics 0.3

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { int i; cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); for (i=0;i<100;i++) { /* cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i);*/ cairo_rectangle(cr,50+i,100,10+i,10+i); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* cairo_surface_flush(); */ […]

  • cairo graphics 0.2 (triangle)

    /* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include int i=0; static gboolean draw(GtkWidget *widget, GdkEventExpose *event, gpointer data) { cairo_t *cr; cr = gdk_cairo_create(widget->window); cairo_set_source_rgb(cr, 0, 0, 0); cairo_set_line_width (cr, 0.5); for (i=0;i<200;i++) { cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* cairo_surface_flush(); */ /* usleep(100000);*/ } cairo_destroy(cr); return […]