亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? language-bindings.xml

?? 按照官方的說法:Cairo is a vector graphics library with cross-device output support. 翻譯過來
?? XML
?? 第 1 頁 / 共 2 頁
字號:
<appendix id="language-bindings">  <title>Creating a language binding for cairo</title>  <para>    While cairo is implemented and C, and has a C API, it is expected    that many users of cairo will be using it from languages other    than C. The glue that connects the core cairo library to another    language is known as a <firstterm>language    binding</firstterm>. This appendix attempts to collect together    issues that come up when creating a language bindings for cairo    and present standardized solutions to promote consistency among    the different language bindings.  </para>  <sect1 id="bindings-general">    <title>General considerations</title>    <para>      The naming of the central <link	linkend="cairo-t"><type>cairo_t</type></link> type is a      special exception. The object is “a cairo context” not “a      cairo”, and names such as <type>cairo_t</type> rather than      <type>cairo_context_t</type> and      <function>cairo_set_source()</function> rather than      <function>cairo_context_set_source()</function> are simply      abbreviations to make the C API more palatable. In languages      which have object-oriented syntax, this abbreviation is much      less useful. In fact, if ‘Cairo’ is used as a namespace, then      in many languages, you'd end up with a ridiculous type name      like ‘Cairo.Cairo’. For this reason, and for inter-language      consistency all object-oriented languages should name this      type as if it were <type>cairo_context_t</type>.    </para>    <para>      The punctuation and casing of the type names and      method names of cairo should be changed to match the general      convention of the language. In Java, where type names are written      in StudlyCaps and method names in javaCaps, cairo_font_extents_t      will become FontExtents and      <literal>cairo_set_source(cr,source)</literal>,      <literal>cr.setSource(source)</literal>.      As compared to changing the punctuation, and casing, much      more reluctance should be used in changing the method names      themselves. Even if get is usually omitted from getters in      your language, you shouldn't bind cairo_get_source() as      cr.source().    </para>  </sect1>  <sect1 id="bindings-memory">    <title>Memory Management</title>    <para>      The objects in cairo can roughly be divided into two types:      reference-counted, opaque types like      <link      linkend="cairo-surface-t"><type>cairo_surface_t</type></link>      and plain structures like      <link	linkend="cairo-glyph-t"><type>cairo_glyph_t</type></link>.      <link	linkend="cairo-path-t"><type>cairo_path_t</type></link>      and       <link	linkend="cairo-path-data-t"><type>cairo_path_data_t</type></link>      are special cases and are treated separately in this appendix.    </para>    <para>      Refcounted opaque types all have a      <function>..._reference()</function>      function to increase the refcount by one and a      <function>..._destroy()</function> to decrease the refcount      by one. These should not be exposed to the user of the language      binding, but rather used to implement memory management within      the language binding. The simplest way to do memory management      for a language binding is to treat the language binding object      as a simple handle to the cairo object. The language binding      object references the cairo object, and unreferences it when      finalized. This is the recommended method, though there are      a couple of caveats to be noted:    </para>    <itemizedlist>      <listitem>	<para>	  Equality won't work as expected. You can have two language	  objects for the same cairo and they won't necessarily	  compare equal. If the language allows customizing the	  equality operation, then this is fixable by comparing	  the underlying pointers. It also can be fixed by creating	  at most one language object per cairo object, and	  uniquifying via a <firstterm>pin table</firstterm> (a hash	  table that goes from cairo object to language object).	  For <type>cairo_surface_t</type> you can use also 	  <link	  linkend="cairo-surface-set-user-data"><function>cairo_surface_set_user_data()</function></link>	  instead of a separate pin table.	</para>      </listitem>      <listitem>	<para>	  Derivation from the language object doesn't work because	  you can lose the language object while keeping the Cairo	  object. Code like:	</para><programlisting>public class MySurface (ImageSurface) {   public MySurface (width, height) {      super (Format.ARGB32, width, height);   }   public int get42 () {      return 42;	     }}   cr = Cairo(MySurface(width, height));   surface = cr.getTarget();</programlisting>	<para>	  Can result in <varname>surface</varname> containing an	  <classname>ImageSurface</classname> not a <classname>MySurface</classname>.	  This is not easily fixable without creating memory leaks,	  and it's probably best to simply forbid deriving from the	  language objects.	</para>      </listitem>    </itemizedlist>    <para>      When a plain structure is used as a return value from cairo,      this is done by passing it as a “out parameter”.    </para><programlisting>cairo_font_extents_t extents;      cairo_font_extents (cr, &amp;extents);</programlisting>    <para>      In a language binding, this should typically be treated      as a return value:    </para><programlisting>FontExtents extents = cr.fontExtents ();</programlisting>    <para>      A language binding has a choice in how it implements the      language objects for plain structures. It can use a pure      language object with fields corresponding to those of the C      structure, and convert from and to the C structure when calling      cairo functions or converting cairo return values. Or it      can keep a pointer to the C structure internally and wrap      it inside a language object much like occurs for refcounted      objects. The choice should be invisible to the user: they should      be able to imagine that it is implemented as a pure language      object.    </para>  </sect1>  <sect1 id="bindings-return-values">    <title>Multiple return values</title>    <para>      There are a number of functions in the cairo API that have      multiple <firstterm>out parameters</firstterm> or      <firstterm>in-out parameters</firstterm>. In some languages      these can be translated into multiple return values. In Python,      what is:    </para>    <programlisting>cairo_user_to_device (cr, &amp;x, &amp;y);</programlisting>    <para>      can by mapped to:    </para>    <programlisting>(x, y) = cr.user_to_device (cr, x, y);</programlisting>    <para>      but many languages don't have provisions for multiple return      values, so it is necessary to introduce auxiliary types.      Most of the functions that require the auxiliary types      require a type that would, in C, look like    </para>    <programlisting>typedef struct _cairo_point cairo_point_t;struct _cairo_point {    double x;    double y;}</programlisting>    <para>      The same type should be used both for functions that use a pair      of coordinates as an absolute position, and functions that use      a pair of coordinates as a displacement. While an argument could      be made that having a separate “distance” type is more correct,      it is more likely just to confuse users.    </para>    <programlisting>voidcairo_user_to_device (cairo_t *cr, double *x, double *y);voidcairo_user_to_device_distance (cairo_t *cr, double *dx, double *dy);voidcairo_device_to_user (cairo_t *cr, double *x, double *y);voidcairo_device_to_user_distance (cairo_t *cr, double *dx, double *dy);voidcairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy);voidcairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);voidcairo_get_current_point (cairo_t *cr, double *x, double *y);    </programlisting>    <para>      There are also a couple of functions that return four values      representing a rectangle. These should be mapped to a      “rectangle” type that looks like:    </para>    <programlisting>typedef struct _cairo_rectangle cairo_rectangle_t;struct _cairo_rectangle {    double x;    double y;    double width;    double height;}</programlisting>    <para>      The C function returns the rectangle as a set of two points to      facilitate rounding to integral extents, but this isn't worth      adding a “box” type to go along with the more obvious      “rectangle” representation.    </para>    <remark>      Q: Would it make sense here to define a standard      <function>cairo_rectangle_round()</function> method      that language bindings should map?    </remark>    <programlisting>voidcairo_stroke_extents (cairo_t *cr,		      double *x1, double *y1,		      double *x2, double *y2);voidcairo_fill_extents (cairo_t *cr,		    double *x1, double *y1,		    double *x2, double *y2);    </programlisting>  </sect1>  <sect1 id="bindings-overloading">    <title>Overloading and optional arguments</title>    <para>      Function overloading (having a several variants of a function      with the same name and different arguments) is a language      feature available in many languages but not in C.    </para>    <para>      In general, language binding authors should use restraint in      combining functions in the cairo API via function      overloading. What may seem like an obvious overload now may      turn out to be strange with future additions to cairo.      It might seem logical to make      <link      linkend="cairo-set-source-rgb"><function>cairo_set_source_rgb()</function></link>	an overload of <function>cairo_set_source()</function>, but future plans to add	<function>cairo_set_source_rgb_premultiplied()</function>,      which will also take three doubles make this a bad idea. For      this reason, only the following pairs of functions should      be combined via overloading    </para>    <programlisting>voidcairo_set_source (cairo_t *cr, cairo_pattern_t *source);voidcairo_set_source_surface (cairo_t          *cr,                          cairo_surface_t  *source,                          double            surface_x,                          double            surface_y);      voidcairo_mask (cairo_t         *cr,	    cairo_pattern_t *pattern);voidcairo_mask_surface (cairo_t         *cr,		    cairo_surface_t *surface,		    double           surface_x,		    double           surface_y);      cairo_surface_t *cairo_image_surface_create (cairo_format_t	format,			    int			width,			    int			height);cairo_surface_t *cairo_image_surface_create_for_data (unsigned char	       *data,				     cairo_format_t		format,				     int			width,				     int			height,				     int			stride);cairo_status_tcairo_surface_write_to_png (cairo_surface_t	*surface,			    const char		*filename);cairo_status_tcairo_surface_write_to_png_stream (cairo_surface_t	*surface,				   cairo_write_func_t	write_func,				   void			*closure);cairo_surface_t *cairo_image_surface_create_from_png (const char	*filename);cairo_surface_t *cairo_image_surface_create_from_png_stream (cairo_read_func_t	read_func,					    void		*closure);    </programlisting>    <para>      Note that there are cases where all constructors for a type      aren't overloaded together. For example      <link	linkend="cairo-image-surface-create-from-png"><function>cairo_image_surface_create_from_png()</function></link>      should <emphasis>not</emphasis> be overloaded together with      <link	linkend="cairo-image-surface-create"><function>cairo_image_surface_create()</function></link>.      In such cases, the remaining constructors will typically need to      be bound as static methods. In Java, for example, we might have:    </para><programlisting>Surface surface1 = ImageSurface(Format.RGB24, 100, 100);Surface surface2 = ImageSurface.createFromPNG("camera.png");</programlisting>    <para>      Some other overloads that add combinations not found in C may be      convenient for users for language bindings that provide      <type>cairo_point_t</type> and <type>cairo_rectangle_t</type>      types, for example:    </para>    <programlisting>voidcairo_move_to (cairo_t       *cr,               cairo_point_t *point);voidcairo_rectangle (cairo_t           *cr,                 cairo_rectangle_t *rectangle);    </programlisting>  </sect1>  <sect1 id="bindings-streams">    <title>Streams and File I/O</title>    <para>      Various places in the cairo API deal with reading and writing      data, whether from and to files, or to other sources and      destinations. In these cases, what is typically provided in the      C API is a simple version that just takes a filename, and a      complex version that takes a callback function.      An example is the PNG handling functions:    </para><programlisting>cairo_surface_t *cairo_image_surface_create_from_png (const char	*filename);cairo_surface_t *cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,					    void             *closure);cairo_status_tcairo_surface_write_to_png (cairo_surface_t	*surface,			    const char		*filename);cairo_status_tcairo_surface_write_to_png_stream (cairo_surface_t	*surface,				   cairo_write_func_t	write_func,				   void			*closure);</programlisting>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色久优优欧美色久优优| 欧美三级日韩三级| 在线观看视频一区二区欧美日韩| 777xxx欧美| 天天综合网 天天综合色| 99在线精品一区二区三区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产精品乱码一区二区三区软件| 激情久久五月天| 久久婷婷国产综合国色天香| 国产精品99久久久| 亚洲国产精品二十页| 99久久精品国产观看| 亚洲日本成人在线观看| 欧美在线高清视频| 日产精品久久久久久久性色| 欧美日本在线看| 亚洲国产一区在线观看| 在线精品视频一区二区三四| 国产三级一区二区| 久久99精品久久只有精品| 91精品国产欧美一区二区成人| 一区二区三区四区蜜桃| 欧美日韩在线观看一区二区 | 欧美日韩在线免费视频| 亚洲精品午夜久久久| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美日韩一区二区三区不卡| 亚洲视频在线观看一区| 97久久超碰精品国产| 中文字幕一区二区三区av| 在线观看成人免费视频| 九九九精品视频| 精品三级av在线| 国产福利精品导航| 精品美女一区二区三区| 久久电影网站中文字幕| 欧美一区二区三区色| 日本韩国精品在线| 亚洲视频 欧洲视频| aaa亚洲精品| 亚洲最新在线观看| 日韩欧美中文字幕精品| 日本一不卡视频| 国产欧美一区二区精品忘忧草 | 国产精品一二一区| 一区二区三区在线免费观看| 91麻豆精品国产91久久久资源速度 | 91精品国产一区二区人妖| 不卡电影一区二区三区| 另类小说综合欧美亚洲| 亚洲国产日韩精品| 亚洲欧美日本在线| 国产精品二三区| 久久亚洲综合色一区二区三区| 欧美理论电影在线| 色偷偷一区二区三区| 成人久久18免费网站麻豆| 国产主播一区二区| 国产综合久久久久影院| 狠狠色丁香婷婷综合久久片| 日本视频中文字幕一区二区三区| 亚洲一区二区精品久久av| 亚洲黄色录像片| 亚洲视频一区在线观看| 亚洲欧美一区二区久久 | 一本在线高清不卡dvd| 成人免费不卡视频| 成人性生交大片| 国产成人免费视频 | 国产欧美一区二区精品久导航| 日韩欧美在线不卡| 日韩视频免费直播| 欧美电影免费观看高清完整版在线观看 | 亚洲国产中文字幕| 首页综合国产亚洲丝袜| 香蕉乱码成人久久天堂爱免费| 亚洲精品视频在线看| 亚洲女性喷水在线观看一区| 亚洲欧美日韩小说| 亚洲丰满少妇videoshd| 丝袜诱惑亚洲看片| 国产美女在线观看一区| 99精品桃花视频在线观看| 色婷婷亚洲一区二区三区| 91麻豆精品国产91久久久久久| 欧美一区二区啪啪| 久久久无码精品亚洲日韩按摩| 国产精品久久久久久久岛一牛影视| 亚洲欧洲日韩一区二区三区| 亚洲成人中文在线| 国产伦精品一区二区三区视频青涩| 国产精品 日产精品 欧美精品| 91香蕉视频污在线| 8x8x8国产精品| 国产日韩欧美一区二区三区乱码| 亚洲精品一二三四区| 日韩高清不卡一区| 成人动漫中文字幕| 欧美精品在线观看播放| 久久久久国色av免费看影院| 一区二区国产盗摄色噜噜| 久久99日本精品| 91亚洲午夜精品久久久久久| 欧美一级黄色录像| 亚洲人妖av一区二区| 日韩精品福利网| 91尤物视频在线观看| 欧美大片在线观看| 亚洲美女淫视频| 韩国女主播成人在线| 欧美羞羞免费网站| 国产精品人人做人人爽人人添| 婷婷综合久久一区二区三区| 成人精品视频.| 精品日韩在线一区| 天堂影院一区二区| 欧美最新大片在线看| 中文字幕av一区二区三区高 | 欧美午夜宅男影院| 国产日韩精品视频一区| 香蕉久久一区二区不卡无毒影院 | 午夜久久久久久| 成人教育av在线| 亚洲精品一区二区三区四区高清 | 欧美日韩精品福利| 中文字幕亚洲视频| 国产精品 欧美精品| 精品国产免费人成电影在线观看四季| 一区二区三区精密机械公司| 国产999精品久久久久久绿帽| 欧美肥妇bbw| 一区二区三区日韩欧美精品| 国产成人在线视频播放| 91精品国产全国免费观看| 夜夜嗨av一区二区三区四季av| 国产成人在线免费观看| 精品成人一区二区三区四区| 男女男精品视频| 7777精品伊人久久久大香线蕉最新版 | 精品久久国产字幕高潮| 日精品一区二区| 色屁屁一区二区| 中文字幕亚洲在| 成人a免费在线看| 国产精品系列在线| 丁香六月久久综合狠狠色| 日韩区在线观看| 另类小说综合欧美亚洲| 日韩无一区二区| 免费人成精品欧美精品| 精品久久一二三区| 国产一区二区三区四区在线观看| 欧美xxxxxxxxx| 国产一区二区女| 国产亲近乱来精品视频| 顶级嫩模精品视频在线看| 国产精品美女久久福利网站| 成人久久18免费网站麻豆 | 男男成人高潮片免费网站| 91精品国产91综合久久蜜臀| 日本一区中文字幕| 久久综合狠狠综合久久综合88 | 色吧成人激情小说| 亚洲成人先锋电影| 欧美一二区视频| 国产黄色精品网站| 伊人色综合久久天天人手人婷| 欧美怡红院视频| 开心九九激情九九欧美日韩精美视频电影| 日韩欧美中文一区二区| 成人黄色软件下载| 亚洲一区二区三区四区在线观看| 欧美一区二区视频在线观看| 国产成人三级在线观看| 亚洲制服丝袜av| 精品国产污污免费网站入口 | 中文字幕日韩欧美一区二区三区| www.亚洲精品| 五月天网站亚洲| 国产肉丝袜一区二区| 91免费视频大全| 日韩精品一级二级| 国产欧美一区在线| 欧美三级午夜理伦三级中视频| 青青草国产成人99久久| 1024亚洲合集| 精品美女一区二区| 在线观看视频一区| 国产激情视频一区二区在线观看| 亚洲一区电影777| 久久久久久99精品| 欧美在线视频不卡| 国产风韵犹存在线视精品| 一区二区三区美女视频| 久久精品欧美日韩| 欧美日本国产视频| 972aa.com艺术欧美| 久久69国产一区二区蜜臀| 亚洲综合自拍偷拍|