1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 2010-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  A Cairo_Pattern is the paintbrush with which cairo draws. The primary use 
  26. --  of patterns is as the source for all cairo drawing operations. 
  27. -- 
  28. --  A cairo pattern is created by using one of the many constructors, of the 
  29. --  form Cairo_Pattern.Create_<type> or implicitly through 
  30. --  Cairo.Set_Source_<type> subprograms. 
  31. --  </description> 
  32. -- 
  33. --  <c_version>1.8.8</c_version> 
  34. --  <group>Cairo</group> 
  35.  
  36. with System; 
  37.  
  38. package Cairo.Pattern is 
  39.  
  40.    -------------------------------- 
  41.    -- Pattern creation functions -- 
  42.    -------------------------------- 
  43.  
  44.    --  Cairo_Pattern_Type is used to describe the type of a given pattern. 
  45.    -- 
  46.    --  The type of a pattern is determined by the function used to create 
  47.    --  it. The Cairo.Pattern.Create_Rgb and Cairo.Pattern.Create_Rgba 
  48.    --  functions create Solid patterns. The remaining 
  49.    --  Cairo.Pattern.Create_<> functions map to pattern types in obvious 
  50.    --  ways. 
  51.    -- 
  52.    --  The pattern type can be queried with Cairo.Pattern.Get_Type 
  53.    -- 
  54.    --  Most Cairo_Pattern functions can be called with a pattern of any type, 
  55.    --  (though trying to change the extend or filter for a solid pattern will 
  56.    --  have no effect). A notable exception is Cairo.Pattern.Add_Color_Stop_Rgb 
  57.    --  and Cairo.Pattern.Add_Color_Stop_Rgba which must only be called with 
  58.    --  gradient patterns (either Linear or Radial). Otherwise the pattern will 
  59.    --  be shutdown and put into an error state. 
  60.    -- 
  61.    --  New entries may be added in future versions. 
  62.    -- 
  63.    --  Since: 1.2 
  64.    type Cairo_Pattern_Type is 
  65.      (Cairo_Pattern_Type_Solid, 
  66.       --  The pattern is a solid (uniform) color. It may be opaque or 
  67.       --  translucent. 
  68.  
  69.       Cairo_Pattern_Type_Surface, 
  70.       --  The pattern is a based on a surface (an image). 
  71.  
  72.       Cairo_Pattern_Type_Linear, 
  73.       --  The pattern is a linear gradient. 
  74.  
  75.       Cairo_Pattern_Type_Radial 
  76.       --  The pattern is a radial gradient. 
  77.      ); 
  78.    pragma Convention (C, Cairo_Pattern_Type); 
  79.  
  80.    --  Cairo_extend is used to describe how pattern color/alpha will be 
  81.    --  determined for areas "outside" the pattern's natural area, (for 
  82.    --  example, outside the surface bounds or outside the gradient 
  83.    --  geometry). 
  84.    -- 
  85.    --  The default extend mode is CAIRO_EXTEND_NONE for surface patterns 
  86.    --  and CAIRO_EXTEND_PAD for gradient patterns. 
  87.    -- 
  88.    --  New entries may be added in future versions. 
  89.    type Cairo_Extend is 
  90.      (Cairo_Extend_None, 
  91.       --  Pixels outside of the source pattern are fully transparent 
  92.  
  93.       Cairo_Extend_Repeat, 
  94.       --  The pattern is tiled by repeating 
  95.  
  96.       Cairo_Extend_Reflect, 
  97.       --  The pattern is tiled by reflecting at the edges (Implemented for 
  98.       --  surface patterns since 1.6) 
  99.  
  100.       Cairo_Extend_Pad 
  101.       --  Pixels outside of the pattern copy 
  102.       --  the closest pixel from the source (Since 1.2; but only 
  103.       --  implemented for surface patterns since 1.6) 
  104.      ); 
  105.    pragma Convention (C, Cairo_Extend); 
  106.  
  107.    --  Cairo_filter is used to indicate what filtering should be 
  108.    --  applied when reading pixel values from patterns. See 
  109.    --  Cairo.Pattern.Set_Source for indicating the desired filter to be 
  110.    --  used with a particular pattern. 
  111.    type Cairo_Filter is 
  112.      (Cairo_Filter_Fast, 
  113.       --  A high-performance filter, with quality similar to 
  114.       --  Cairo_Filter_Nearest 
  115.  
  116.       Cairo_Filter_Good, 
  117.       --  A reasonable-performance filter, with quality similar to 
  118.       --  Cairo_Filter_Bilinear 
  119.  
  120.       Cairo_Filter_Best, 
  121.       --  The highest-quality available, performance may 
  122.       --  not be suitable for interactive use. 
  123.  
  124.       Cairo_Filter_Nearest, 
  125.       --  Nearest-neighbor filtering 
  126.  
  127.       Cairo_Filter_Bilinear, 
  128.       --  Linear interpolation in two dimensions 
  129.  
  130.       Cairo_Filter_Gaussian 
  131.       --  This filter value is currently unimplemented, and should not be used 
  132.       --  in current code. 
  133.      ); 
  134.    pragma Convention (C, Cairo_Filter); 
  135.  
  136.    function Create_Rgb 
  137.      (Red   : Gdouble; 
  138.       Green : Gdouble; 
  139.       Blue  : Gdouble) 
  140.       return  Cairo_Pattern; 
  141.    --  Red:   Red component of the color 
  142.    --  Green: Green component of the color 
  143.    --  Blue:  Blue component of the color 
  144.    -- 
  145.    --  Creates a new Cairo_Pattern corresponding to an opaque color.  The 
  146.    --  color components are floating point numbers in the range 0 to 1. 
  147.    --  If the values passed in are outside that range, they will be 
  148.    --  clamped. 
  149.    -- 
  150.    --  Return value: the newly created Cairo_Pattern if successful, or 
  151.    --  an error pattern in case of no memory.  The caller owns the 
  152.    --  returned object and should call Cairo.Pattern.Destroy when 
  153.    --  finished with it. 
  154.    -- 
  155.    --  This function will always return a valid pointer, but if an error 
  156.    --  occurred the pattern status will be set to an error. To inspect 
  157.    --  the status of a pattern use Cairo.Pattern.Status. 
  158.  
  159.    function Create_Rgba 
  160.      (Red   : Gdouble; 
  161.       Green : Gdouble; 
  162.       Blue  : Gdouble; 
  163.       Alpha : Gdouble) 
  164.       return  Cairo_Pattern; 
  165.    --  Red: Red component of the color 
  166.    --  Green: Green component of the color 
  167.    --  Blue: Blue component of the color 
  168.    --  Alpha: Alpha component of the color 
  169.    -- 
  170.    --  Creates a new Cairo_Pattern corresponding to a translucent color. 
  171.    --  The color components are floating point numbers in the range 0 to 
  172.    --  1.  If the values passed in are outside that range, they will be 
  173.    --  clamped. 
  174.    -- 
  175.    --  Return value: the newly created Cairo_Pattern if successful, or 
  176.    --  an error pattern in case of no memory.  The caller owns the 
  177.    --  returned object and should call Cairo.Pattern.Destroy when 
  178.    --  finished with it. 
  179.    -- 
  180.    --  This function will always return a valid pointer, but if an error 
  181.    --  occurred the pattern status will be set to an error. To inspect 
  182.    --  the status of a pattern use Cairo.Pattern.Status. 
  183.  
  184.    function Create_For_Surface 
  185.      (Surface : Cairo_Surface) 
  186.       return    Cairo_Pattern; 
  187.    --  Surface: the Surface 
  188.    -- 
  189.    --  Create a new Cairo_Pattern for the given surface. 
  190.    -- 
  191.    --  Return value: the newly created Cairo_Pattern if successful, or 
  192.    --  an error pattern in case of no memory.  The caller owns the 
  193.    --  returned object and should call Cairo.Pattern.Destroy when 
  194.    --  finished with it. 
  195.    -- 
  196.    --  This function will always return a valid pointer, but if an error 
  197.    --  occurred the pattern status will be set to an error. To inspect 
  198.    --  the status of a pattern use Cairo.Pattern.Status. 
  199.  
  200.    function Create_Linear 
  201.      (X0   : Gdouble; 
  202.       Y0   : Gdouble; 
  203.       X1   : Gdouble; 
  204.       Y1   : Gdouble) 
  205.       return Cairo_Pattern; 
  206.    --  X0: x coordinate of the start point 
  207.    --  Y0: y coordinate of the start point 
  208.    --  X1: x coordinate of the end point 
  209.    --  Y1: y coordinate of the end point 
  210.    -- 
  211.    --  Create a new linear gradient Cairo_Pattern along the line defined 
  212.    --  by (X0, Y0) and (X1, Y1).  Before using the gradient pattern, a 
  213.    --  number of color stops should be defined using 
  214.    --  Cairo.Pattern.Add_Color_Stop_Rgb or 
  215.    --  Cairo.Pattern.Add_Color_Stop_Rgba. 
  216.    -- 
  217.    --  Note: The coordinates here are in pattern space. For a new pattern, 
  218.    --  pattern space is identical to user space, but the relationship 
  219.    --  between the spaces can be changed with Cairo.Pattern.Set_Matrix. 
  220.    -- 
  221.    --  Return value: the newly created Cairo_Pattern if successful, or 
  222.    --  an error pattern in case of no memory.  The caller owns the 
  223.    --  returned object and should call Cairo.Pattern.Destroy when 
  224.    --  finished with it. 
  225.    -- 
  226.    --  This function will always return a valid pointer, but if an error 
  227.    --  occurred the pattern status will be set to an error.  To inspect 
  228.    --  the status of a pattern use Cairo.Pattern.Status. 
  229.  
  230.    function Create_Radial 
  231.      (Cx0     : Gdouble; 
  232.       Cy0     : Gdouble; 
  233.       Radius0 : Gdouble; 
  234.       Cx1     : Gdouble; 
  235.       Cy1     : Gdouble; 
  236.       Radius1 : Gdouble) 
  237.       return    Cairo_Pattern; 
  238.    --  Cx0: X coordinate for the center of the start circle 
  239.    --  Cy0: Y coordinate for the center of the start circle 
  240.    --  Radius0: radius of the start circle 
  241.    --  Cx1: X coordinate for the center of the end circle 
  242.    --  Cy1: Y coordinate for the center of the end circle 
  243.    --  Radius1: radius of the end circle 
  244.    -- 
  245.    --  Creates a new radial gradient Cairo_Pattern between the two circles 
  246.    --  defined by (Cx0, Cy0, Radius0) and (Cx1, Cy1, Radius1). Before using the 
  247.    --  gradient pattern, a number of color stops should be defined using 
  248.    --  Cairo.Pattern.Add_Color_Stop_Rgb or Cairo.Pattern.Add_Color_Stop_Rgba. 
  249.    -- 
  250.    --  Note: The coordinates here are in pattern space. For a new pattern, 
  251.    --  pattern space is identical to user space, but the relationship 
  252.    --  between the spaces can be changed with Cairo.Pattern.Set_Matrix. 
  253.    -- 
  254.    --  Return value: the newly created Cairo_Pattern if successful, or 
  255.    --  an error pattern in case of no memory.  The caller owns the 
  256.    --  returned object and should call Cairo.Pattern.Destroy when 
  257.    --  finished with it. 
  258.    -- 
  259.    --  This function will always return a valid pointer, but if an error 
  260.    --  occurred the pattern status will be set to an error.  To inspect 
  261.    --  the status of a pattern use Cairo.Pattern.Status. 
  262.  
  263.    function Reference (Pattern : Cairo_Pattern) return Cairo_Pattern; 
  264.    --  Pattern: a Cairo_Pattern 
  265.    -- 
  266.    --  Increases the reference count on pattern by one. This prevents 
  267.    --  pattern from being destroyed until a matching call to 
  268.    --  Cairo.Pattern.Destroy is made. 
  269.    -- 
  270.    --  The number of references to a Cairo_Pattern can be get using 
  271.    --  Cairo.Pattern.Get_Reference_Count. 
  272.    -- 
  273.    --  Return value: the referenced Cairo_Pattern. 
  274.  
  275.    procedure Destroy (Pattern : Cairo_Pattern); 
  276.    --  Pattern: a Cairo_Pattern 
  277.    -- 
  278.    --  Decreases the reference count on pattern by one. If the result is 
  279.    --  zero, then pattern and all associated resources are freed.  See 
  280.    --  Cairo.Pattern.Reference. 
  281.  
  282.    function Get_Reference_Count (Pattern : Cairo_Pattern) return Guint; 
  283.    --  Pattern: a Cairo_Pattern 
  284.    -- 
  285.    --  Returns the current reference count of pattern. 
  286.    -- 
  287.    --  Return value: the current reference count of pattern.  If the 
  288.    --  object is a nil object, 0 will be returned. 
  289.    -- 
  290.    --  Since: 1.4 
  291.  
  292.    function Status (Pattern : Cairo_Pattern) return Cairo_Status; 
  293.    --  Pattern: a Cairo_Pattern 
  294.    -- 
  295.    --  Checks whether an error has previously occurred for this 
  296.    --  pattern. 
  297.    -- 
  298.    --  Return value: Cairo_Status_Success, Cairo_Status_No_Memory, or 
  299.    --  Cairo_Status_Pattern_Type_Mismatch. 
  300.  
  301.    function Get_User_Data 
  302.      (Pattern : Cairo_Pattern; 
  303.       Key     : access Cairo_User_Data_Key) return System.Address; 
  304.    --  Pattern: a Cairo_Pattern 
  305.    --  Key: the address of the Cairo_User_Data_Key the user data was 
  306.    --  attached to 
  307.    -- 
  308.    --  Return user data previously attached to pattern using the 
  309.    --  specified key.  If no user data has been attached with the given 
  310.    --  key this function returns System.Null_Address. 
  311.    -- 
  312.    --  Return value: the user data previously attached or System.Null_Address. 
  313.    -- 
  314.    --  Since: 1.4 
  315.  
  316.    function Set_User_Data 
  317.      (Pattern   : Cairo_Pattern; 
  318.       Key       : access Cairo_User_Data_Key; 
  319.       User_Data : System.Address; 
  320.       Destroy   : Cairo_Destroy_Func) return Cairo_Status; 
  321.    --  Pattern: a Cairo_Pattern 
  322.    --  Key: the address of a Cairo_User_Data_Key to attach the user data to 
  323.    --  User_Data: the user data to attach to the Cairo_Pattern 
  324.    --  Destroy: a Cairo_Destroy_Func which will be called when the 
  325.    --  Cairo_Context is destroyed or when new user data is attached using the 
  326.    --  same key. 
  327.    -- 
  328.    --  Attach user data to pattern.  To remove user data from a surface, 
  329.    --  call this function with the key that was used to set it and Null_Address 
  330.    --  for data. 
  331.    -- 
  332.    --  Return value: Cairo_Status_Success or Cairo_Status_No_Memory if a 
  333.    --  slot could not be allocated for the user data. 
  334.    -- 
  335.    --  Since: 1.4 
  336.  
  337.    function Get_Type (Pattern : Cairo_Pattern) return Cairo_Pattern_Type; 
  338.    --  Pattern: a Cairo_Pattern 
  339.    -- 
  340.    --  This function returns the type a pattern. 
  341.    --  See Cairo_Pattern_Type for available types. 
  342.    -- 
  343.    --  Return value: The type of pattern. 
  344.    -- 
  345.    --  Since: 1.2 
  346.  
  347.    procedure Add_Color_Stop_Rgb 
  348.      (Pattern : Cairo_Pattern; 
  349.       Offset  : Gdouble; 
  350.       Red     : Gdouble; 
  351.       Green   : Gdouble; 
  352.       Blue    : Gdouble); 
  353.    --  Pattern: a Cairo_Pattern 
  354.    --  Offset: an Offset in the range [0.0 .. 1.0] 
  355.    --  Red: Red component of color 
  356.    --  Green: Green component of color 
  357.    --  Blue: Blue component of color 
  358.    -- 
  359.    --  Adds an opaque color stop to a gradient pattern. The offset 
  360.    --  specifies the location along the gradient's control vector. For 
  361.    --  example, a linear gradient's control vector is from (X0,Y0) to 
  362.    --  (X1,Y1) while a radial gradient's control vector is from any point 
  363.    --  on the start circle to the corresponding point on the end circle. 
  364.    -- 
  365.    --  The color is specified in the same way as in Cairo.Set_Source_Rgb. 
  366.    -- 
  367.    --  If two (or more) stops are specified with identical offset values, 
  368.    --  they will be sorted according to the order in which the stops are 
  369.    --  added, (stops added earlier will compare less than stops added 
  370.    --  later). This can be useful for reliably making sharp color 
  371.    --  transitions instead of the typical blend. 
  372.    -- 
  373.    -- 
  374.    --  Note: If the pattern is not a gradient pattern, (eg. a linear or 
  375.    --  radial pattern), then the pattern will be put into an error status 
  376.    --  with a status of Cairo_Status_Pattern_Type_Mismatch. 
  377.  
  378.    procedure Add_Color_Stop_Rgba 
  379.      (Pattern : Cairo_Pattern; 
  380.       Offset  : Gdouble; 
  381.       Red     : Gdouble; 
  382.       Green   : Gdouble; 
  383.       Blue    : Gdouble; 
  384.       Alpha   : Gdouble); 
  385.    --  Pattern: a Cairo_Pattern 
  386.    --  Offset: an Offset in the range [0.0 .. 1.0] 
  387.    --  Red: Red component of color 
  388.    --  Green: Green component of color 
  389.    --  Blue: Blue component of color 
  390.    --  Alpha: Alpha component of color 
  391.    -- 
  392.    --  Adds a translucent color stop to a gradient pattern. The offset 
  393.    --  specifies the location along the gradient's control vector. For 
  394.    --  example, a linear gradient's control vector is from (x0,y0) to 
  395.    --  (x1,y1) while a radial gradient's control vector is from any point 
  396.    --  on the start circle to the corresponding point on the end circle. 
  397.    -- 
  398.    --  The color is specified in the same way as in Cairo_Set_Source_Rgba. 
  399.    -- 
  400.    --  If two (or more) stops are specified with identical offset values, 
  401.    --  they will be sorted according to the order in which the stops are 
  402.    --  added, (stops added earlier will compare less than stops added 
  403.    --  later). This can be useful for reliably making sharp color 
  404.    --  transitions instead of the typical blend. 
  405.    -- 
  406.    --  Note: If the pattern is not a gradient pattern, (eg. a linear or 
  407.    --  radial pattern), then the pattern will be put into an error status 
  408.    --  with a status of Cairo_Status_Pattern_Type_Mismatch. 
  409.  
  410.    procedure Set_Matrix 
  411.      (Pattern : Cairo_Pattern; 
  412.       Matrix  : access Cairo_Matrix); 
  413.    --  Pattern: a Cairo_Pattern 
  414.    --  Matrix: a Cairo_Matrix 
  415.    -- 
  416.    --  Sets the pattern's transformation matrix to matrix. This matrix is 
  417.    --  a transformation from user space to pattern space. 
  418.    -- 
  419.    --  When a pattern is first created it always has the identity matrix 
  420.    --  for its transformation matrix, which means that pattern space is 
  421.    --  initially identical to user space. 
  422.    -- 
  423.    --  Important: Please note that the direction of this transformation 
  424.    --  matrix is from user space to pattern space. This means that if you 
  425.    --  imagine the flow from a pattern to user space (and on to device 
  426.    --  space), then coordinates in that flow will be transformed by the 
  427.    --  inverse of the pattern matrix. 
  428.    -- 
  429.    --  For example, if you want to make a pattern appear twice as large as 
  430.    --  it does by default the correct code to use is: 
  431.    -- 
  432.    --  Cairo.Matrix.Init_Scale (Matrix, 0.5, 0.5); 
  433.    --  Cairo.Pattern.Set_Matrix (Pattern, Matrix); 
  434.    -- 
  435.    --  Meanwhile, using values of 2.0 rather than 0.5 in the code above 
  436.    --  would cause the pattern to appear at half of its default size. 
  437.    -- 
  438.    --  Also, please note the discussion of the user-space locking 
  439.    --  semantics of Cairo_Set_Source. 
  440.  
  441.    procedure Get_Matrix 
  442.      (Pattern : Cairo_Pattern; 
  443.       Matrix  : access Cairo_Matrix); 
  444.    --  Pattern: a Cairo_Pattern 
  445.    --  Matrix: return value for the Matrix 
  446.    -- 
  447.    --  Stores the pattern's transformation matrix into matrix. 
  448.  
  449.    procedure Set_Extend (Pattern : Cairo_Pattern; Extend : Cairo_Extend); 
  450.    --  Pattern: a Cairo_Pattern 
  451.    --  Extend: a Cairo_Extend describing how the area outside of the 
  452.    --  pattern will be drawn 
  453.    -- 
  454.    --  Sets the mode to be used for drawing outside the area of a pattern. 
  455.    --  See Cairo_Extend for details on the semantics of each extend 
  456.    --  strategy. 
  457.    -- 
  458.    --  The default extend mode is Cairo_Extend_None for surface patterns 
  459.    --  and Cairo_Extend_PAd for gradient patterns. 
  460.  
  461.    function Get_Extend (Pattern : Cairo_Pattern) return Cairo_Extend; 
  462.    --  Pattern: a Cairo_Pattern 
  463.    -- 
  464.    --  Gets the current extend mode for a pattern.  See Cairo_Extend 
  465.    --  for details on the semantics of each extend strategy. 
  466.    -- 
  467.    --  Return value: the current extend strategy used for drawing the 
  468.    --  pattern. 
  469.  
  470.    procedure Set_Filter (Pattern : Cairo_Pattern; Filter : Cairo_Filter); 
  471.    --  Pattern: a Cairo_Pattern 
  472.    --  Filter: a Cairo_Filter describing the Filter to use for resizing 
  473.    --  the pattern 
  474.    -- 
  475.    --  Sets the filter to be used for resizing when using this pattern. 
  476.    --  See Cairo_Filter for details on each filter. 
  477.    -- 
  478.    --  Note that you might want to control filtering even when you do not 
  479.    --  have an explicit Cairo_Pattern object, (for example when using 
  480.    --  Cairo_Set_Source_Surface). In these cases, it is convenient to 
  481.    --  use Cairo_Get_Source to get access to the pattern that cairo 
  482.    --  creates implicitly. For example: 
  483.    -- 
  484.    --  Cairo_Set_Source_Surface (Cr, Image, X, Y); 
  485.    --  Cairo.Pattern.Set_Filter (Cairo_Get_Source (Cr), Cairo_Filter_Nearest); 
  486.  
  487.    function Get_Filter (Pattern : Cairo_Pattern) return Cairo_Filter; 
  488.    --  Pattern: a Cairo_Pattern 
  489.    -- 
  490.    --  Gets the current filter for a pattern.  See Cairo_Filter 
  491.    --  for details on each filter. 
  492.    -- 
  493.    --  Return value: the current filter used for resizing the pattern. 
  494.  
  495.    function Get_Rgba 
  496.      (Pattern : Cairo_Pattern; 
  497.       Red     : access Gdouble; 
  498.       Green   : access Gdouble; 
  499.       Blue    : access Gdouble; 
  500.       Alpha   : access Gdouble) 
  501.       return    Cairo_Status; 
  502.    --  Pattern: a Cairo_Pattern 
  503.    --  Red: return value for Red component of color, or null 
  504.    --  Green: return value for Green component of color, or null 
  505.    --  Blue: return value for Blue component of color, or null 
  506.    --  Alpha: return value for Alpha component of color, or null 
  507.    -- 
  508.    --  Gets the solid color for a solid color pattern. 
  509.    -- 
  510.    --  Return value: Cairo_Status_Success, or 
  511.    --  Cairo_Status_Pattern_Type_Mismatch if the pattern is not a solid 
  512.    --  color pattern. 
  513.    -- 
  514.    --  Since: 1.4 
  515.  
  516.    function Get_Surface 
  517.      (Pattern : Cairo_Pattern; 
  518.       Surface : Cairo_Surface) 
  519.       return    Cairo_Status; 
  520.    --  Pattern: a Cairo_Pattern 
  521.    --  Surface: return value for Surface of pattern, or null 
  522.    -- 
  523.    --  Gets the surface of a surface pattern.  The reference returned in 
  524.    --  surface is owned by the pattern; the caller should call 
  525.    --  Cairo.Surface.Reference if the surface is to be retained. 
  526.    -- 
  527.    --  Return value: Cairo_Status_Success, or 
  528.    --  Cairo_Status_Pattern_Type_Mismatch if the pattern is not a surface 
  529.    --  pattern. 
  530.    -- 
  531.    --  Since: 1.4 
  532.  
  533.    function Get_Color_Stop_Rgba 
  534.      (Pattern : Cairo_Pattern; 
  535.       Index   : Gint; 
  536.       Offset  : access Gdouble; 
  537.       Red     : access Gdouble; 
  538.       Green   : access Gdouble; 
  539.       Blue    : access Gdouble; 
  540.       Alpha   : access Gdouble) 
  541.       return    Cairo_Status; 
  542.    --  Pattern: a Cairo_Pattern 
  543.    --  Index: Index of the stop to return data for 
  544.    --  Offset: return value for the Offset of the stop, or null 
  545.    --  Red: return value for Red component of color, or null 
  546.    --  Green: return value for Green component of color, or null 
  547.    --  Blue: return value for Blue component of color, or null 
  548.    --  Alpha: return value for Alpha component of color, or null 
  549.    -- 
  550.    --  Gets the color and offset information at the given index for a 
  551.    --  gradient pattern.  Values of index are 0 to 1 less than the number 
  552.    --  returned by Cairo.Pattern.Get_Color_Stop_Count. 
  553.    -- 
  554.    --  Return value: Cairo_Status_Success, or Cairo_Status_Invalid_Index 
  555.    --  if index is not valid for the given pattern.  If the pattern is 
  556.    --  not a gradient pattern, Cairo_Status_Pattern_Type_Mismatch is 
  557.    --  returned. 
  558.    -- 
  559.    --  Since: 1.4 
  560.  
  561.    function Get_Color_Stop_Count 
  562.      (Pattern : Cairo_Pattern; 
  563.       Count   : access Gint) 
  564.       return    Cairo_Status; 
  565.    --  Pattern: a Cairo_Pattern 
  566.    --  Count: return value for the number of color stops, or NULL 
  567.    -- 
  568.    --  Gets the number of color stops specified in the given gradient 
  569.    --  pattern. 
  570.    -- 
  571.    --  Return value: Cairo_Status_Success, or 
  572.    --  Cairo_Status_Pattern_Type_Mismatch if pattern is not a gradient 
  573.    --  pattern. 
  574.    -- 
  575.    --  Since: 1.4 
  576.  
  577.    function Get_Linear_Points 
  578.      (Pattern : Cairo_Pattern; 
  579.       X0      : access Gdouble; 
  580.       Y0      : access Gdouble; 
  581.       X1      : access Gdouble; 
  582.       Y1      : access Gdouble) 
  583.       return    Cairo_Status; 
  584.    --  Pattern: a Cairo_Pattern 
  585.    --  X0: return value for the x coordinate of the first point, or null 
  586.    --  Y0: return value for the y coordinate of the first point, or null 
  587.    --  X1: return value for the x coordinate of the second point, or null 
  588.    --  Y1: return value for the y coordinate of the second point, or null 
  589.    -- 
  590.    --  Gets the gradient endpoints for a linear gradient. 
  591.    -- 
  592.    --  Return value: Cairo_Status_Success, or 
  593.    --  Cairo_Status_Pattern_Type_Mismatch if pattern is not a linear 
  594.    --  gradient pattern. 
  595.    -- 
  596.    --  Since: 1.4 
  597.  
  598.    function Get_Radial_Circles 
  599.      (Pattern : Cairo_Pattern; 
  600.       X0      : access Gdouble; 
  601.       Y0      : access Gdouble; 
  602.       R0      : access Gdouble; 
  603.       X1      : access Gdouble; 
  604.       Y1      : access Gdouble; 
  605.       R1      : access Gdouble) 
  606.       return    Cairo_Status; 
  607.    --  Pattern: a Cairo_Pattern 
  608.    --  X0: return value for the x coordinate of the center of the first 
  609.    --  circle, or null 
  610.    --  Y0: return value for the y coordinate of the center of the first 
  611.    --  circle, or null 
  612.    --  R0: return value for the radius of the first circle, or null 
  613.    --  X1: return value for the x coordinate of the center of the second 
  614.    --  circle, or null 
  615.    --  Y1: return value for the y coordinate of the center of the second 
  616.    --  circle, or null 
  617.    --  R1: return value for the radius of the second circle, or null 
  618.    -- 
  619.    --  Gets the gradient endpoint circles for a radial gradient, each 
  620.    --  specified as a center coordinate and a radius. 
  621.    -- 
  622.    --  Return value: Cairo_Status_Success, or 
  623.    --  Cairo_Status_Pattern_Type_Mismatch if pattern is not a radial 
  624.    --  gradient pattern. 
  625.    -- 
  626.    --  Since: 1.4 
  627.  
  628. private 
  629.  
  630.    pragma Import (C, Create_Rgb, "cairo_pattern_create_rgb"); 
  631.    pragma Import (C, Create_Rgba, "cairo_pattern_create_rgba"); 
  632.    pragma Import (C, Create_For_Surface, "cairo_pattern_create_for_surface"); 
  633.    pragma Import (C, Create_Linear, "cairo_pattern_create_linear"); 
  634.    pragma Import (C, Create_Radial, "cairo_pattern_create_radial"); 
  635.    pragma Import (C, Reference, "cairo_pattern_reference"); 
  636.    pragma Import (C, Destroy, "cairo_pattern_destroy"); 
  637.    pragma Import 
  638.      (C, 
  639.       Get_Reference_Count, 
  640.       "cairo_pattern_get_reference_count"); 
  641.    pragma Import (C, Status, "cairo_pattern_status"); 
  642.    pragma Import (C, Get_User_Data, "cairo_pattern_get_user_data"); 
  643.    pragma Import (C, Set_User_Data, "cairo_pattern_set_user_data"); 
  644.    pragma Import (C, Get_Type, "cairo_pattern_get_type"); 
  645.    pragma Import (C, Add_Color_Stop_Rgb, "cairo_pattern_add_color_stop_rgb"); 
  646.    pragma Import 
  647.      (C, 
  648.       Add_Color_Stop_Rgba, 
  649.       "cairo_pattern_add_color_stop_rgba"); 
  650.    pragma Import (C, Set_Matrix, "cairo_pattern_set_matrix"); 
  651.    pragma Import (C, Get_Matrix, "cairo_pattern_get_matrix"); 
  652.    pragma Import (C, Set_Extend, "cairo_pattern_set_extend"); 
  653.    pragma Import (C, Get_Extend, "cairo_pattern_get_extend"); 
  654.    pragma Import (C, Set_Filter, "cairo_pattern_set_filter"); 
  655.    pragma Import (C, Get_Filter, "cairo_pattern_get_filter"); 
  656.    pragma Import (C, Get_Rgba, "cairo_pattern_get_rgba"); 
  657.    pragma Import (C, Get_Surface, "cairo_pattern_get_surface"); 
  658.    pragma Import 
  659.      (C, 
  660.       Get_Color_Stop_Rgba, 
  661.       "cairo_pattern_get_color_stop_rgba"); 
  662.    pragma Import 
  663.      (C, 
  664.       Get_Color_Stop_Count, 
  665.       "cairo_pattern_get_color_stop_count"); 
  666.    pragma Import (C, Get_Linear_Points, "cairo_pattern_get_linear_points"); 
  667.    pragma Import (C, Get_Radial_Circles, "cairo_pattern_get_radial_circles"); 
  668.  
  669. end Cairo.Pattern;