2 <extension name="phpCairo" version="0.1.0">
4 <!-- Summary and other details -->
5 <summary>PHP bindings for Cairo Graphic Library</summary>
7 This extension offers you object oriented support for Cairo.
12 <name>Akshat Gupta</name>
13 <email>g.akshat@gmail.com</email>
18 <version>0.1</version>
19 <date>2006-06-10</date>
21 <notes>First alpha version</notes>
25 <!-- cairo interface -->
27 <class name="CairoContext">
28 <summary>The main drawing class</summary>
31 <function name="__construct">
32 <proto>void construct(object obj)</proto>
36 <function name="append_path">
37 <proto>void append_path(object p)</proto>
42 <proto>void arc(float xc, float yc, float radius, float angle1, float angle2)</proto>
46 <function name="arc_negative">
47 <proto>void arc_negative(float xc, float yc, float radius, float angle1, float angle2)</proto>
51 <function name="clip">
52 <proto>void clip()</proto>
56 <function name="clip_extents">
57 <proto>array clip_extents()</proto>
62 <function name="clip_preserve">
63 <proto>void clip_preserve()</proto>
67 <function name="close_path">
68 <proto>void close_path()</proto>
71 <!-- need to work on the next functin -->
72 <function name="copy_clip_rectangle_list">
73 <proto>object copy_clip_rectangle_list()</proto>
74 <code>/*using iterator in php5.0 to store the
75 list. Pass the array to an iterator during the
76 object definition and jobs done */</code>
79 <function name="copy_page">
80 <proto>void copy_page()</proto>
84 <function name="copy_path">
85 <proto>object copy_path()</proto>
89 <function name="copy_path_flat">
90 <proto>object copy_path_flat()</proto>
94 <function name="curve_to">
95 <proto>void curve_to (float x1, float y1, float x2, float y2, float x3, float y3)</proto>
99 <function name="device_to_user">
100 <proto>array device_to_user(float x, float y)</proto>
104 <function name="device_to_user_distance">
105 <proto>array device_to_user_distance(float x, float y)</proto>
109 <function name="fill">
110 <proto>void fill()</proto>
114 <function name="fill_extents">
115 <proto>array fill_extents()</proto>
119 <function name="fill_preserve">
120 <proto>void fill_preserve()</proto>
124 <function name="font_extents">
125 <proto>array font_extents()</proto>
129 <function name="get_antialias">
130 <proto>int get_antialias()</proto>
134 <function name="get_current_point">
135 <proto>array get_current_point()</proto>
139 <function name="get_dash">
140 <proto>array get_dash()</proto>
144 <function name="get_dash_count">
145 <proto>int get_dash_count()</proto>
149 <function name="get_fill_rule">
150 <proto>int get_fill_rule()</proto>
154 <function name="get_font_face">
155 <proto>object get_font_face()</proto>
159 <function name="get_font_matrix">
160 <proto>object get_font_matrix()</proto>
164 <function name="get_font_options">
165 <proto>object get_font_options()</proto>
169 <function name="get_group_target">
170 <proto>object get_group_target()</proto>
174 <function name="get_line_cap">
175 <proto>int get_line_cap()</proto>
179 <function name="get_line_join">
180 <proto>int get_line_join()</proto>
184 <function name="get_line_width">
185 <proto>float get_line_width()</proto>
189 <function name="get_matrix">
190 <proto>object get_matrix()</proto>
194 <function name="get_matrix_limit">
195 <proto>float get_matrix_limit()</proto>
199 <function name="get_operator">
200 <proto>int get_operator()</proto>
204 <function name="get_scaled_font">
205 <proto>object get_scaled_font()</proto>
209 <function name="get_source">
210 <proto>object get_source()</proto>
214 <function name="get_target">
215 <proto>object get_target()</proto>
219 <function name="get_tolerance">
220 <proto>float get_tolerance()</proto>
224 <function name="glyph_extents">
225 <proto>array get_extents(object obj[,int num])</proto>
226 <code>/*This might be a prob*/</code>
229 <function name="glyph_path">
230 <proto>void glyph_pat(object obh[,int num])</proto>
234 <function name="has_current_point">
235 <proto>bool has_current_point()</proto>
236 <code>/* ONLY for CAIRO 1.6 */</code>
240 <function name="identity_matrix">
241 <proto>void identity_matrix()</proto>
245 <function name="in_fill">
246 <proto>bool in_fill(float x, float y)</proto>
250 <function name="in_stroke">
251 <proto>bool in_stroke(float x, float y)</proto>
255 <function name="line_to">
256 <proto>void line_to(float x, float y)</proto>
260 <function name="mask">
261 <proto>void mask(object p)</proto>
265 <function name="mask_surface">
266 <proto>void mask_surface(object s[,float surface_x, float surface_y])</proto>
270 <function name="move_to">
271 <proto>void move_to(float x, float y)</proto>
275 <function name="new_path">
276 <proto>void new_path()</proto>
280 <function name="new_sub_path">
281 <proto>void new_sub_path()</proto>
285 <function name="paint">
286 <proto>void paint()</proto>
290 <function name="paint_with_alpha">
291 <proto>void paint_with_alpha(float alpha)</proto>
295 <function name="path_extents">
296 <proto>array path_extents([object path])</proto>
297 <code>/* ONLY for CAIRO 1.6 */</code>
300 <function name="pop_group">
301 <proto>object pop_group()</proto>
305 <function name="pop_group_to_source">
306 <proto>void pop_group_to_source()</proto>
310 <function name="push_group">
311 <proto>void push_group()</proto>
315 <function name="push_group_with_content">
316 <proto>void push_group_with_content(int content)</proto>
320 <function name="rectangle">
321 <proto>void rectangle(float x, float y, float width, float height)</proto>
325 <function name="rel_curve_to">
326 <proto>void rel_curve_to(float x1, float y1, float x2, float y2, float x3, float y3)</proto>
330 <function name="rel_line_to">
331 <proto>void rel_line_to(float x, float y)</proto>
335 <function name="rel_move_to">
336 <proto>void rel_move_to(float x, float y)</proto>
340 <function name="reset_clip">
341 <proto>void reset_clip()</proto>
345 <function name="restore">
346 <proto>void restore()</proto>
350 <function name="rotate">
351 <proto>void rotate(float angle)</proto>
355 <function name="save">
356 <proto>void save()</proto>
360 <function name="scale">
361 <proto>void scale(float x, float y)</proto>
365 <function name="select_font_face">
366 <proto>void select_font_face(object obj[, int slant, int weight])</proto>
370 <function name="set_antialias">
371 <proto>void set_antialias([int antialias])</proto>
375 <function name="set_dash">
376 <proto>void set_dash(object dashes [,float offset])</proto>
380 <function name="set_fill_rule">
381 <proto>void set_fill_rule(int fill_rule)</proto>
385 <function name="set_font_face">
386 <proto>void set_font_face([object obj])</proto>
390 <function name="set_font_matrix">
391 <proto>void set_font_matrix(object matrix)</proto>
395 <function name="set_font_options">
396 <proto>void set_font_options(object options)</proto>
400 <function name="set_font_size">
401 <proto>void set_font_size(float size)</proto>
405 <function name="set_line_cap">
406 <proto>void set_line_cap(int line_cap)</proto>
410 <function name="set_line_join">
411 <proto>void set_line_join(int line_join)</proto>
415 <function name="set_line_width">
416 <proto>void set_line_width(float width)</proto>
420 <function name="set_matrix">
421 <proto>void set_matrix(object matix)</proto>
425 <function name="set_miter_limit">
426 <proto>void set_miter_limit(float limit)</proto>
430 <function name="set_operator">
431 <proto>void set_operator(int op)</proto>
435 <function name="set_source">
436 <proto>void set_source(object p)</proto>
440 <function name="set_source_rgb">
441 <proto>void set_source_rgb(float red, float green, float blue)</proto>
445 <function name="set_source_rgba">
446 <proto>void set_source_rgba(float red, float green, float blue [,float alpha])</proto>
450 <function name="set_source_surface">
451 <proto>void set_source_surface(object surface [,float x, float y])</proto>
455 <function name="set_tolerance">
456 <proto>void set_tolerance(float tolerance)</proto>
460 <function name="show_glyphs">
461 <proto>void show_glyphs(object glyphs [,int num_glyphs])</proto>
465 <function name="show_page">
466 <proto>void show_page()</proto>
470 <function name="show_text">
471 <proto>void show_text(object obj)</proto>
475 <function name="stroke">
476 <proto>void stroke()</proto>
480 <function name="stroke_extents">
481 <proto>array stroke_extents()</proto>
485 <function name="stroke_preserve">
486 <proto>void stroke_preserve()</proto>
490 <function name="text_extents">
491 <proto>array text_extents(object extents)</proto>
495 <function name="text_path">
496 <proto>void text_path(object obj)</proto>
500 <function name="transform">
501 <proto>void transform(object matrix)</proto>
505 <function name="translate">
506 <proto>void translate(float tx, float ty)</proto>
510 <function name="user_to_device">
511 <proto>array user_to_device(float x, float y)</proto>
515 <function name="user_to_device_distance">
516 <proto>array user_to_device_distance(float dx, float dy)</proto>
522 <class name="CairoFontFace">
523 <function name="__construct">
524 <proto>void construct()</proto>
525 <code>/* not allowede to create an object directly*/</code>
528 <function name="__destruct">
529 <proto>void destruct()</proto>
536 <class name="CairoFontOptions">
537 <function name="__construct">
538 <proto>void construct()</proto>
542 <function name="get_antialias">
543 <proto>int get_antialias()</proto>
547 <function name="get_hint_metrics">
548 <proto>int get_hint_metrics()</proto>
552 <function name="get_hint_style">
553 <proto>int get_hint_style()</proto>
557 <function name="get_subpixel_order">
558 <proto>int get_subpixel_order()</proto>
562 <function name="set_antialias">
563 <proto>void set_antialias([int aa])</proto>
567 <function name="set_hint_metrics">
568 <proto>void set_hint_metrics([int hm])</proto>
572 <function name="set_hint_style">
573 <proto>void set_hint_style([int hs])</proto>
577 <function name="set_subpixel_order">
578 <proto>void set_subpixel_order([int so])</proto>
583 <class name="CairoMatrix">
585 <function name="__construct">
586 <proto>void construct([float xx, float yx, float xy, float yy, float x0, float y0])</proto>
590 <function name="init_rotate" access="private">
591 <proto>object inti_rotate(float radians)</proto>
595 <function name="invert">
596 <proto>void invert()</proto>
600 <function name="multiply">
601 <proto>object multiply(object o2)</proto>
605 <function name="rotate">
606 <proto>void rotate(float radians)</proto>
610 <function name="scale">
611 <proto>void scale(float sx, float xy)</proto>
615 <function name="transform_distance">
616 <proto>array transform_distance(float dx, float dy)</proto>
620 <function name="transform_point">
621 <proto>array transform_point(float x, float y)</proto>
625 <function name="translate">
626 <proto>void translate(float tx, float ty)</proto>
630 <!--Some more functions given in pyCairo ... depends on need -->
633 <class name="CairoPath">
635 <function name="__construct">
636 <proto>void construct()</proto>
640 <function name="str">
641 <proto>string str()</proto>
647 <class name="CairoPattern">
649 <function name="__construct">
650 <proto>void contruct()</proto>
654 <function name="get_matrix">
655 <proto>object get_matrix()</proto>
659 <function name="set_matrix">
660 <proto>void set_matrix(object m)</proto>
666 <class name="CairoGradient" extends="CairoPattern">
668 <function name="__contruct">
669 <proto>void construct()</proto>
673 <function name="add_color_stop_rgb">
674 <proto>void add_color_stop_rgb(float offset, float red, float green, float blue)</proto>
678 <function name="add_color_stop_rgba">
679 <proto>void add_color_stop_rgba(float offset, float red, float green, float blue, float alpha)</proto>
685 <class name="CairoLinearGradient" extends="CairoGradient">
687 <function name="__construct">
688 <proto>void construct(float x0, float y0, float x1, float y1)</proto>
692 <function name="get_linear_points">
693 <proto>array get_linear_points()</proto>
699 <class name="CairoRadialGradient" extends="CairoGradient">
701 <function name="__constuct">
702 <proto>void construct(float cx0, float cy0, float radius0, float cx1, float cy1, float radius1)</proto>
706 <function name="get_radial_circles">
707 <proto>array get_radial_circles()</proto>
713 <class name="CairoSolidPattern" extends="CairoPattern">
715 <function name="__construct">
716 <proto>void construct(float r, float g, float b [, float a])</proto>
720 <function name="get_rgba">
721 <proto>array get_rgba()</proto>
727 <class name="CairoSurfacePattern" extends="CairoPattern">
729 <function name="__construct">
730 <proto>void construct(object s)</proto>
734 <function name="get_extend">
735 <proto>int get_extend()</proto>
739 <function name="get_filter">
740 <proto>int get_filter()</proto>
744 <function name="get_surface">
745 <proto>object get_surface()</proto>
749 <function name="set_extend">
750 <proto>void set_extend(int extend)</proto>
754 <function name="set_filter">
755 <proto>void set_filter(int filter)</proto>
761 <class name="CairoScaledFont">
763 <function name="__construct">
764 <proto>void construct(object ff, object mx1, object mx2, object fo)</proto>
768 <function name="extents">
769 <proto>array extents()</proto>
773 <function name="get_font_face">
774 <proto>object get_font_face()</proto>
778 <function name="text_extents">
779 <proto>array text_extents(string str)</proto>
785 <class name="CairoSurface">
787 <function name="__construct">
788 <proto>void construct()</proto>
792 <function name="create_similar">
793 <proto>object create_similar(int content, int width, int height)</proto>
797 <function name="finish">
798 <proto>void finish()</proto>
802 <function name="flush">
803 <proto>void flush()</proto>
807 <function name="get_content">
808 <proto>int get_content()</proto>
812 <function name="get_device_offset">
813 <proto>array get_device_offset()</proto>
817 <function name="get_font_options">
818 <proto>object get_font_options()</proto>
822 <function name="mark_dirty_rectangle">
823 <proto>void mark_dirty_rectangle([int x, int y, int width, int height])</proto>
827 <function name="set_device_offset">
828 <proto>void set_device_offset(float x_offset, float y_offset)</proto>
832 <function name="set_fallback_resolution">
833 <proto>void set_fallback_resolution(float x_ppi, float y_ppi)</proto>
837 <function name="write_to_png">
838 <proto>void write_to_png(string file)</proto>
844 <class name="CairoImageSurface" extends="CairoSurface">
846 <function name="__construct">
847 <proto>void construct(int format, int widthm, int height)</proto>
851 <function name="create_from_data" access="private">
852 <proto>object create_from_data(object obj, int format, int width, int height [, int stride])</proto>
856 <function name="create_from_png" access="private">
857 <proto>object create_from_png(string file)</proto>
861 <function name="get_data">
862 <proto>string get_data()</proto>
866 <function name="get_format">
867 <proto>int get_format()</proto>
871 <function name="get_height">
872 <proto>int get_height()</proto>
876 <function name="get_stride">
877 <proto>int get_stride()</proto>
881 <function name="get_width">
882 <proto>int get_width()</proto>
889 <class name="CairoPDFSurface" extends="CairoSurface">
891 <function name="__construct">
892 <proto>void construct(string file, float wpts, float hpts)</proto>
896 <function name="set_size">
897 <proto>void set_size(float wptd, float hpts)</proto>
903 <class name="CairoPSSurface" extends="CairoSurface">
905 <function name="__construct">
906 <proto>void construct(string file, float wpts, float hpts)</proto>
910 <function name="dsc_begin_page_setup">
911 <proto>void dsc_begin_page_setup()</proto>
915 <function name="dsc_begin_setup">
916 <proto>void dsc_begin_setup()</proto>
920 <function name="dsc_comment">
921 <proto>void dsc_comment()</proto>
925 <function name="get_levels">
926 <proto>array get_levels()</proto>
927 <code>/* ONLY for CAIRO 1.6*/ </code>
930 <function name="get_level_string">
931 <proto>string get_level_string()</proto>
932 <code>/* ONLY for CAIRO 1.6*/</code>
935 <function name="restrict_to_level">
936 <proto>void restrict_to_level(int level)</proto>
937 <code>/* ONLY for CAIRO 1.6 */</code>
940 <function name="set_eps">
941 <proto>void set_eps()</proto>
942 <code>/* ONLY for CAIRO 1.6 */</code>
945 <function name="set_size">
946 <proto>void set_size(float wpts, float hpts)</proto>
952 <class name="CairoQuartzSurface" extends="CairoSurface">
954 <function name="__construct">
955 <proto>void construct(float wpixels, float hpixels [, int format])</proto>
960 <class name="CairoSVGSurface" extends="CairoSurface">
962 <function name="__construct">
963 <proto>void construct(string file, float wpts, float hpts)</proto>
969 <class name="CairoWin32Surface" extends="CairoSurface">
971 <function name="__construct">
972 <proto>void construct(int hdc)</proto>
978 <class name="CairoXlibSurface" extends="CairoSurface">
980 <function name="__construct">
981 <proto>void construct()</proto>
985 <function name="get_depth">
986 <proto>int get_depth()</proto>
990 <function name="get_height">
991 <proto>int get_height()</proto>
995 <function name="get_width">
996 <proto>int get_width()</proto>
1002 <class name="CairoException" extends="Exception">
1006 <function name="cairo_version">
1007 <proto>int cairo_version()</proto>
1011 <function name="cairo_version_string">
1012 <proto>string cairo_version_string()</proto>