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>
642 <class name="CairoPattern">
644 <function name="__construct">
645 <proto>void contruct()</proto>
649 <function name="get_matrix">
650 <proto>object get_matrix()</proto>
654 <function name="set_matrix">
655 <proto>void set_matrix(object m)</proto>
661 <class name="CairoGradient" extends="CairoPattern">
663 <function name="__contruct">
664 <proto>void construct()</proto>
668 <function name="add_color_stop_rgb">
669 <proto>void add_color_stop_rgb(float offset, float red, float green, float blue)</proto>
673 <function name="add_color_stop_rgba">
674 <proto>void add_color_stop_rgba(float offset, float red, float green, float blue, float alpha)</proto>
680 <class name="CairoLinearGradient" extends="CairoGradient">
682 <function name="__construct">
683 <proto>void construct(float x0, float y0, float x1, float y1)</proto>
687 <function name="get_linear_points">
688 <proto>array get_linear_points()</proto>
694 <class name="CairoRadialGradient" extends="CairoGradient">
696 <function name="__constuct">
697 <proto>void construct(float cx0, float cy0, float radius0, float cx1, float cy1, float radius1)</proto>
701 <function name="get_radial_circles">
702 <proto>array get_radial_circles()</proto>
708 <class name="CairoSolidPattern" extends="CairoPattern">
710 <function name="__construct">
711 <proto>void construct(float r, float g, float b [, float a])</proto>
715 <function name="get_rgba">
716 <proto>array get_rgba()</proto>
722 <class name="CairoSurfacePattern" extends="CairoPattern">
724 <function name="__construct">
725 <proto>void construct(object s)</proto>
729 <function name="get_extend">
730 <proto>int get_extend()</proto>
734 <function name="get_filter">
735 <proto>int get_filter()</proto>
739 <function name="get_surface">
740 <proto>object get_surface()</proto>
744 <function name="set_extend">
745 <proto>void set_extend(int extend)</proto>
749 <function name="set_filter">
750 <proto>void set_filter(int filter)</proto>
756 <class name="CairoScaledFont">
758 <function name="__construct">
759 <proto>void construct(object ff, object mx1, object mx2, object fo)</proto>
763 <function name="extents">
764 <proto>array extents()</proto>
768 <function name="get_font_face">
769 <proto>object get_font_face()</proto>
773 <function name="text_extents">
774 <proto>array text_extents(string str)</proto>
780 <class name="CairoSurface">
782 <function name="__construct">
783 <proto>void construct()</proto>
787 <function name="create_similar">
788 <proto>object create_similar(int content, int width, int height)</proto>
792 <function name="finish">
793 <proto>void finish()</proto>
797 <function name="flush">
798 <proto>void flush()</proto>
802 <function name="get_content">
803 <proto>int get_content()</proto>
807 <function name="get_device_offset">
808 <proto>array get_device_offset()</proto>
812 <function name="get_font_options">
813 <proto>object get_font_options()</proto>
817 <function name="mark_dirty_rectangle">
818 <proto>void mark_dirty_rectangle([int x, int y, int width, int height])</proto>
822 <function name="set_device_offset">
823 <proto>void set_device_offset(float x_offset, float y_offset)</proto>
827 <function name="set_fallback_resolution">
828 <proto>void set_fallback_resolution(float x_ppi, float y_ppi)</proto>
832 <function name="write_to_png">
833 <proto>void write_to_png(string file)</proto>
839 <class name="CairoImageSurface" extends="CairoSurface">
841 <function name="__construct">
842 <proto>void construct(int format, int widthm, int height)</proto>
846 <function name="create_from_data" access="private">
847 <proto>object create_from_data(object obj, int format, int width, int height [, int stride])</proto>
851 <function name="create_from_png" access="private">
852 <proto>object create_from_png(string file)</proto>
856 <function name="get_data">
857 <proto>string get_data()</proto>
861 <function name="get_format">
862 <proto>int get_format()</proto>
866 <function name="get_height">
867 <proto>int get_height()</proto>
871 <function name="get_stride">
872 <proto>int get_stride()</proto>
876 <function name="get_width">
877 <proto>int get_width()</proto>
884 <class name="CairoPDFSurface" extends="CairoSurface">
886 <function name="__construct">
887 <proto>void construct(string file, float wpts, float hpts)</proto>
891 <function name="set_size">
892 <proto>void set_size(float wptd, float hpts)</proto>
898 <class name="CairoPSSurface" extends="CairoSurface">
900 <function name="__construct">
901 <proto>void construct(string file, float wpts, float hpts)</proto>
905 <function name="dsc_begin_page_setup">
906 <proto>void dsc_begin_page_setup()</proto>
910 <function name="dsc_begin_setup">
911 <proto>void dsc_begin_setup()</proto>
915 <function name="dsc_comment">
916 <proto>void dsc_comment()</proto>
920 <function name="get_levels">
921 <proto>array get_levels()</proto>
922 <code>/* ONLY for CAIRO 1.6 </code>
925 <function name="get_level_string">
926 <proto>string get_level_string()</proto>
927 <code>/* ONLY for CAIRO 1.6*/</code>
930 <function name="restrict_to_level">
931 <proto>void restrict_to_level(int level)</proto>
932 <code>/* ONLY for CAIRO 1.6 */</code>
935 <function name="set_eps">
936 <proto>void set_eps()</proto>
937 <code>/* ONLY for CAIRO 1.6 */</code>
940 <function name="set_size">
941 <proto>void set_size(float wpts, float hpts)</proto>
947 <class name="CairoQuartzSurface" extends="CairoSurface">
949 <function name="__construct">
950 <proto>void construct(float wpixels, float hpixels [, int format])</proto>
955 <class name="CairoSVGSurface" extends="CairoSurface">
957 <function name="__construct">
958 <proto>void construct(string file, float wpts, float hpts)</proto>
964 <class name="CairoWin32Surface" extends="CairoSurface">
966 <function name="__construct">
967 <proto>void construct(int hdc)</proto>
973 <class name="CairoXlibSurface" extends="CairoSurface">
975 <function name="__construct">
976 <proto>void construct()</proto>
980 <function name="get_depth">
981 <proto>int get_depth()</proto>
985 <function name="get_height">
986 <proto>int get_height()</proto>
990 <function name="get_width">
991 <proto>int get_width()</proto>
997 <class name="CairoException" extends="Exception">
1001 <function name="cairo_version">
1002 <proto>int cairo_version()</proto>
1006 <function name="cairo_version_string">
1007 <proto>string cairo_version_string()</proto>