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(string path)</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="identity_matrix">
235 <proto>void identity_matrix()</proto>
239 <function name="in_fill">
240 <proto>bool in_fill(float x, float y)</proto>
244 <function name="in_stroke">
245 <proto>bool in_stroke(float x, float y)</proto>
249 <function name="line_to">
250 <proto>void line_to(float x, float y)</proto>
254 <function name="mask">
255 <proto>void mask(object p)</proto>
259 <function name="mask_surface">
260 <proto>void mask_surface(object s[,float surface_x, float surface_y])</proto>
264 <function name="move_to">
265 <proto>void move_to(float x, float y)</proto>
269 <function name="new_path">
270 <proto>void new_path()</proto>
274 <function name="new_sub_path">
275 <proto>void new_sub_path()</proto>
279 <function name="paint">
280 <proto>void paint()</proto>
284 <function name="paint_with_alpha">
285 <proto>void paint_with_alpha(float alpha)</proto>
289 <function name="pop_group">
290 <proto>object pop_group()</proto>
294 <function name="pop_group_to_source">
295 <proto>void pop_group_to_source()</proto>
299 <function name="push_group">
300 <proto>void push_group()</proto>
304 <function name="push_group_with_content">
305 <proto>void push_group_with_content(int content)</proto>
309 <function name="rectangle">
310 <proto>void rectangle(float x, float y, float width, float height)</proto>
314 <function name="rel_curve_to">
315 <proto>void rel_curve_to(float x1, float y1, float x2, float y2, float x3, float y3)</proto>
319 <function name="rel_line_to">
320 <proto>void rel_line_to(float x, float y)</proto>
324 <function name="rel_move_to">
325 <proto>void rel_move_to(float x, float y)</proto>
329 <function name="reset_clip">
330 <proto>void reset_clip()</proto>
334 <function name="restore">
335 <proto>void restore()</proto>
339 <function name="rotate">
340 <proto>void rotate(float angle)</proto>
344 <function name="save">
345 <proto>void save()</proto>
349 <function name="scale">
350 <proto>void scale(float x, float y)</proto>
354 <function name="select_font_face">
355 <proto>void select_font_face(object obj[, int slant, int weight])</proto>
359 <function name="set_antialias">
360 <proto>void set_antialias([int antialias])</proto>
364 <function name="set_dash">
365 <proto>void set_dash(object dashes [,float offset])</proto>
369 <function name="set_fill_rule">
370 <proto>void set_fill_rule(int fill_rule)</proto>
374 <function name="set_font_face">
375 <proto>void set_font_face([object obj])</proto>
379 <function name="set_font_matrix">
380 <proto>void set_font_matrix(object matrix)</proto>
384 <function name="set_font_options">
385 <proto>void set_font_options(object options)</proto>
389 <function name="set_font_size">
390 <proto>void set_font_size(float size)</proto>
394 <function name="set_line_cap">
395 <proto>void set_line_cap(int line_cap)</proto>
399 <function name="set_line_join">
400 <proto>void set_line_join(int line_join)</proto>
404 <function name="set_line_width">
405 <proto>void set_line_width(float width)</proto>
409 <function name="set_matrix">
410 <proto>void set_matrix(object matix)</proto>
414 <function name="set_miter_limit">
415 <proto>void set_miter_limit(float limit)</proto>
419 <function name="set_operator">
420 <proto>void set_operator(int op)</proto>
424 <function name="set_source">
425 <proto>void set_source(object p)</proto>
429 <function name="set_source_rgb">
430 <proto>void set_source_rgb(float red, float green, float blue)</proto>
434 <function name="set_source_rgba">
435 <proto>void set_source_rgba(float red, float green, float blue [,float alpha])</proto>
439 <function name="set_source_surface">
440 <proto>void set_source_surface(object surface [,float x, float y])</proto>
444 <function name="set_tolerance">
445 <proto>void set_tolerance(float tolerance)</proto>
449 <function name="show_glyphs">
450 <proto>void show_glyphs(object glyphs [,int num_glyphs])</proto>
454 <function name="show_page">
455 <proto>void show_page()</proto>
459 <function name="show_text">
460 <proto>void show_text(object obj)</proto>
464 <function name="stroke">
465 <proto>void stroke()</proto>
469 <function name="stroke_extents">
470 <proto>array stroke_extents()</proto>
474 <function name="stroke_preserve">
475 <proto>void stroke_preserve()</proto>
479 <function name="text_extents">
480 <proto>array text_extents(object extents)</proto>
484 <function name="text_path">
485 <proto>void text_path(object obj)</proto>
489 <function name="transform">
490 <proto>void transform(object matrix)</proto>
494 <function name="translate">
495 <proto>void translate(float tx, float ty)</proto>
499 <function name="user_to_device">
500 <proto>array user_to_device(float x, float y)</proto>
504 <function name="user_to_device_distance">
505 <proto>array user_to_device_distance(float dx, float dy)</proto>
511 <class name="cairoFontFace">
512 <function name="__construct">
513 <proto>void construct()</proto>
514 <code>/* not allowede to create an object directly*/</code>
517 <function name="__destruct">
518 <proto>void destruct()</proto>
525 <class name="cairoFontOptions">
526 <function name="__construct">
527 <proto>void construct()</proto>
531 <function name="get_antialias">
532 <proto>int get_antialias()</proto>
536 <function name="get_hint_metrics">
537 <proto>int get_hint_metrics()</proto>
541 <function name="get_hint_style">
542 <proto>int get_hint_style()</proto>
546 <function name="get_subpixel_order">
547 <proto>int get_subpixel_order()</proto>
551 <function name="set_antialias">
552 <proto>void set_antialias([int aa])</proto>
556 <function name="set_hint_metrics">
557 <proto>void set_hint_metrics([int hm])</proto>
561 <function name="set_hint_style">
562 <proto>void set_hint_style([int hs])</proto>
566 <function name="set_subpixel_order">
567 <proto>void set_subpixel_order([int so])</proto>
572 <class name="cairoMatrix">
574 <function name="__construct">
575 <proto>void construct([float xx, float yx, float xy, float yy, float x0, float y0])</proto>
579 <function name="init_rotate" access="private">
580 <proto>object inti_rotate(float radians)</proto>
584 <function name="invert">
585 <proto>void invert()</proto>
589 <function name="multiply">
590 <proto>object multiply(object o2)</proto>
594 <function name="rotate">
595 <proto>void rotate(float radians)</proto>
599 <function name="scale">
600 <proto>void scale(float sx, float xy)</proto>
604 <function name="transform_distance">
605 <proto>array transform_distance(float dx, float dy)</proto>
609 <function name="transform_point">
610 <proto>array transform_point(float x, float y)</proto>
614 <function name="translate">
615 <proto>void translate(float tx, float ty)</proto>
619 <!--Some more functions given in pyCairo ... depends on need -->
622 <class name="cairoPattern">
624 <function name="__construct">
625 <proto>void contruct()</proto>
629 <function name="get_matrix">
630 <proto>object get_matrix()</proto>
634 <function name="set_matrix">
635 <proto>void set_matrix(object m)</proto>
641 <class name="cairoGradient" extends="cairoPattern">
643 <function name="__contruct">
644 <proto>void construct()</proto>
648 <function name="add_color_stop_rgb">
649 <proto>void add_color_stop_rgb(float offset, float red, float green, float blue)</proto>
653 <function name="add_color_stop_rgba">
654 <proto>void add_color_stop_rgba(float offset, float red, float green, float blue, float alpha)</proto>
660 <class name="cairoLinearGradient" extends="cairoGradient">
662 <function name="__construct">
663 <proto>void construct(float x0, float y0, float x1, float y1)</proto>
667 <function name="get_linear_points">
668 <proto>array get_linear_points()</proto>
674 <class name="cairoRadialGradient" extends="cairoGradient">
676 <function name="__constuct">
677 <proto>void construct(float cx0, float cy0, float radius0, float cx1, float cy1, float radius1)</proto>
681 <function name="get_radial_circles">
682 <proto>array get_radial_circles()</proto>
688 <class name="cairoSolidPattern" extends="cairoPattern">
690 <function name="__construct">
691 <proto>void construct(float r, float g, float b [, float a])</proto>
695 <function name="get_rgba">
696 <proto>array get_rgba()</proto>
702 <class name="cairoSurfacePattern" extends="cairoPattern">
704 <function name="__construct">
705 <proto>void construct(object s)</proto>
709 <function name="get_extend">
710 <proto>int get_extend()</proto>
714 <function name="get_filter">
715 <proto>int get_filter()</proto>
719 <function name="get_surface">
720 <proto>object get_surface()</proto>
724 <function name="set_extend">
725 <proto>void set_extend(int extend)</proto>
729 <function name="set_filter">
730 <proto>void set_filter(int filter)</proto>
736 <class name="cairoScaledFont">
738 <function name="__construct">
739 <proto>void construct(object ff, object mx1, object mx2, object fo)</proto>
743 <function name="extents">
744 <proto>array extents()</proto>
748 <function name="get_font_face">
749 <proto>object get_font_face()</proto>
753 <function name="text_extents">
754 <proto>array text_extents(string str)</proto>
760 <class name="cairoSurface">
762 <function name="__construct">
763 <proto>void construct()</proto>
767 <function name="create_similar">
768 <proto>object create_similar(int content, int width, int height)</proto>
772 <function name="finish">
773 <proto>void finish()</proto>
777 <function name="flush">
778 <proto>void flush()</proto>
782 <function name="get_content">
783 <proto>int get_content()</proto>
787 <function name="get_device_offset">
788 <proto>array get_device_offset()</proto>
792 <function name="get_font_options">
793 <proto>object get_font_options()</proto>
797 <function name="mark_dirty_rectangle">
798 <proto>void mark_dirty_rectangle([int x, int y, int width, int height])</proto>
802 <function name="set_device_offset">
803 <proto>void set_device_offset(float x_offset, float y_offset)</proto>
807 <function name="set_fallback_resolution">
808 <proto>void set_fallback_resolution(float x_ppi, float y_ppi)</proto>
812 <function name="write_to_png">
813 <proto>void write_to_png(string file)</proto>
819 <class name="cairoImageSurface" extends="cairoSurface">
821 <function name="__construct">
822 <proto>void construct(int format, int widthm, int height)</proto>
826 <function name="create_from_data" access="private">
827 <proto>object create_from_data(object obj, int format, int width, int height [, int stride])</proto>
831 <function name="create_from_png" access="private">
832 <proto>object create_from_png(string file)</proto>
836 <function name="get_data">
837 <proto>string get_data()</proto>
841 <function name="get_format">
842 <proto>int get_format()</proto>
846 <function name="get_height">
847 <proto>int get_height()</proto>
851 <function name="get_stride">
852 <proto>int get_stride()</proto>
856 <function name="get_width">
857 <proto>int get_width()</proto>
864 <class name="cairoPDFSurface" extends="cairoSurface">
866 <function name="__construct">
867 <proto>void construct(string file, float wpts, float hpts)</proto>
871 <function name="set_size">
872 <proto>void set_size(float wptd, float hpts)</proto>
878 <class name="cairoPSSurface" extends="cairoSurface">
880 <function name="__construct">
881 <proto>void construct(string file, float wpts, float hpts)</proto>
885 <function name="dsc_begin_page_setup">
886 <proto>void dsc_begin_page_setup()</proto>
890 <function name="dsc_begin_setup">
891 <proto>void dsc_begin_setup()</proto>
895 <function name="dsc_comment">
896 <proto>void dsc_comment()</proto>
900 <function name="set_size">
901 <proto>void set_size(float wpts, float hpts)</proto>
907 <class name="cairoSVGSurface" extends="cairoSurface">
909 <function name="__construct">
910 <proto>void construct(string file, float wpts, float hpts)</proto>
916 <class name="cairoWin32Surface" extends="cairoSurface">
918 <function name="__construct">
919 <proto>void construct(int hdc)</proto>
925 <class name="cairoXlibSurface" extends="cairoSurface">
927 <function name="__construct">
928 <proto>void construct()</proto>
932 <function name="get_depth">
933 <proto>int get_depth()</proto>
937 <function name="get_height">
938 <proto>int get_height()</proto>
942 <function name="get_width">
943 <proto>int get_width()</proto>
949 <class name="cairoError" extends="Exception">
953 <function name="cairo_version">
954 <proto>int cairo_version()</proto>
958 <function name="cairo_version_string">
959 <proto>string cairo_version_string()</proto>