[cairo-commit] cairo/doc/tutorial/src .cvsignore, NONE, 1.1 Makefile, NONE, 1.1 cairo-tutorial-gtk.h, NONE, 1.1 cairo-tutorial-pdf.h, NONE, 1.1 cairo-tutorial-png.h, NONE, 1.1 cairo-tutorial-xlib.h, NONE, 1.1 cairo-tutorial.h, NONE, 1.1 circle.c, NONE, 1.1 expander.c, NONE, 1.1

Carl Worth commit at pdx.freedesktop.org
Fri Jul 22 06:20:55 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/doc/tutorial/src
In directory gabe:/tmp/cvs-serv1473/src

Added Files:
	.cvsignore Makefile cairo-tutorial-gtk.h cairo-tutorial-pdf.h 
	cairo-tutorial-png.h cairo-tutorial-xlib.h cairo-tutorial.h 
	circle.c expander.c 
Log Message:
Initial import of preliminary tutorial pieces.

--- NEW FILE: .cvsignore ---
*-gtk
*-pdf
*-png
*-xlib
*.pdf
*.png


--- NEW FILE: Makefile ---
MYCFLAGS=$(shell pkg-config --cflags --libs cairo gtk+-2.0) -Wall -g -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing

# If you don't want to/can't compile all of these targets, then trim
# this list.
all: gtk xlib pdf png

GTK_EXAMPLES=$(patsubst %.c,%-gtk,$(wildcard *.c))
gtk: $(GTK_EXAMPLES)
%-gtk:%.c cairo-tutorial-gtk.h
	$(CC) -DCAIRO_TUTORIAL_GTK $(CFLAGS) $(MYCFLAGS) -o $@ $<

XLIB_EXAMPLES=$(patsubst %.c,%-xlib,$(wildcard *.c))
xlib: $(XLIB_EXAMPLES)
%-xlib:%.c cairo-tutorial-xlib.h
	$(CC) -DCAIRO_TUTORIAL_XLIB $(CFLAGS) $(MYCFLAGS) -o $@ $<

PDF_EXAMPLES=$(patsubst %.c,%-pdf,$(wildcard *.c))
pdf: $(PDF_EXAMPLES)
%-pdf:%.c cairo-tutorial-pdf.h
	$(CC) -DCAIRO_TUTORIAL_PDF $(CFLAGS) $(MYCFLAGS) -o $@ $<

PNG_EXAMPLES=$(patsubst %.c,%-png,$(wildcard *.c))
png: $(PNG_EXAMPLES)
%-png:%.c cairo-tutorial-png.h
	$(CC) -DCAIRO_TUTORIAL_PNG $(CFLAGS) $(MYCFLAGS) -o $@ $<

clean:
	rm -f $(GTK_EXAMPLES) $(XLIB_EXAMPLES) $(PDF_EXAMPLES) $(PNG_EXAMPLES)

.PHONY: all gtk xlib pdf png clean

--- NEW FILE: cairo-tutorial-gtk.h ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: cairo-tutorial-pdf.h ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: cairo-tutorial-png.h ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: cairo-tutorial-xlib.h ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: cairo-tutorial.h ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: circle.c ---
#define WIDTH 50
#define HEIGHT 50

#include "cairo-tutorial.h"

static void
draw (cairo_t *cr)
{
    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
    cairo_paint (cr);

    cairo_move_to (cr, 47.5, 25);
    cairo_arc (cr, 25, 25, 22.5,
	       0.0, 2 * M_PI);

    cairo_set_source_rgb (cr, 0.6, 0.8, 1.0);
    cairo_fill_preserve (cr);

    cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
    cairo_set_line_width (cr, 1.0);
    cairo_stroke (cr);
}

--- NEW FILE: expander.c ---
#define WIDTH 50
#define HEIGHT 50

#include "cairo-tutorial.h"

static void
draw (cairo_t *cr)
{
    cairo_translate (cr, 24.5, 25);
    cairo_move_to (cr, 5, -2.5);
    cairo_line_to (cr, 0, 2.5);
    cairo_line_to (cr, -5, -2.5);
    cairo_close_path (cr);
    cairo_set_line_width (cr, 1);
    cairo_stroke (cr);
}




More information about the cairo-commit mailing list