PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/cairo/library/cairo_font_face.e

http://github.com/tybor/Liberty
Specman e | 124 lines | 55 code | 17 blank | 52 comment | 2 complexity | 8e18ee2f09630e0cbaf898157a3e8ab2 MD5 | raw file
  1note
  2	description: "CAIRO_FONT_FACE -- Base class for fonts"
  3	copyright: "[
  4					Copyright (C) 2007-2017: Paolo Redaelli,
  5									  Soluciones Informaticas Libres S.A. (Except),
  6									  Cairo team
  7					
  8					This library is free software; you can redistribute it and/or
  9					modify it under the terms of the GNU Lesser General Public License
 10					as published by the Free Software Foundation; either version 2.1 of
 11					the License, or (at your option) any later version.
 12					
 13					This library is distributed in the hope that it will be useful, but
 14					WITHOUT ANY WARRANTY; without even the implied warranty of
 15					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 16					Lesser General Public License for more details.
 17
 18					You should have received a copy of the GNU Lesser General Public
 19					License along with this library; if not, write to the Free Software
 20					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 21					02110-1301 USA
 22				]"
 23	date: "$Date:$"
 24	revision: "$Revision:$"
 25	wrapped_version: "1.2.4"
 26
 27class CAIRO_FONT_FACE
 28	-- A cairo_font_face_t specifies all aspects of a font other than
 29	-- the size or font matrix (a font matrix is used to distort a font
 30	-- by sheering it or scaling it unequally in the two directions). A
 31	-- font face can be set on a CAIRO_CONTEXT by using
 32	-- `set_font_face'; the size and font matrix are set with
 33	-- `set_font_size' and `set_font_matrix'.
 34
 35inherit
 36	C_STRUCT
 37
 38insert
 39	CAIRO_FONT_FACE_EXTERNALS
 40	CAIRO_FONT_TYPE
 41	CAIRO_STATUS
 42
 43create {ANY} from_external_pointer
 44
 45feature {ANY} -- Memory handling
 46	dispose do unref end
 47
 48	ref
 49			-- Increases the reference count on font_face by one. This
 50			-- prevents font_face from being destroyed until a matching
 51			-- call to CAIRO_FONT_FACE's `destroy' is made.
 52		local p: POINTER
 53		do
 54			p:=cairo_font_face_reference(handle)
 55		end
 56
 57	unref
 58			-- Decreases the reference count on font_face by one. If the
 59			-- result is zero, then font_face and all associated
 60			-- resources are freed. See `reference'.
 61		do
 62			cairo_font_face_destroy(handle)
 63		end
 64
 65feature {ANY}
 66	status: INTEGER
 67			-- The status of font face. Useful to check whether an error has previously occurred.
 68		do
 69			Result:=cairo_font_face_status(handle)
 70		ensure
 71			valid: is_valid_cairo_status (Result)
 72		end
 73	
 74	-- TODO: if necessary cairo_font_face_get_user_data ()
 75
 76	-- void*       cairo_font_face_get_user_data   (cairo_font_face_t *font_face,
 77	--                                              const cairo_user_data_key_t *key);
 78	--
 79	--   Return user data previously attached to font_face using the specified key.
 80	--   If no user data has been attached with the given key this function returns
 81	--   NULL.
 82	--
 83	--   font_face : a cairo_font_face_t
 84	--   key :       the address of the cairo_user_data_key_t the user data was
 85	--               attached to
 86	--   Returns :   the user data previously attached or NULL.
 87	--
 88
 89	-- TODO: if necessary cairo_font_face_set_user_data ()
 90	--
 91	-- cairo_status_t cairo_font_face_set_user_data
 92	--                                             (cairo_font_face_t *font_face,
 93	--                                              const cairo_user_data_key_t *key,
 94	--                                              void *user_data,
 95	--                                              cairo_destroy_func_t destroy);
 96	--
 97	--   Attach user data to font_face. To remove user data from a font face, call
 98	--   this function with the key that was used to set it and NULL for data.
 99	--
100	--   font_face : a cairo_font_face_t
101	--   key :       the address of a cairo_user_data_key_t to attach the user data
102	--               to
103	--   user_data : the user data to attach to the font face
104	--   destroy :   a cairo_destroy_func_t which will be called when the font face
105	--               is destroyed or when new user data is attached using the same
106	--               key.
107	--   Returns :   CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY if a slot could
108	--               not be allocated for the user data.
109	--
110	--
111
112feature {WRAPPER, WRAPPER_HANDLER}
113	type: INTEGER
114			-- The type of the backend used to create a font face.  See
115			-- CAIRO_FONT_TYPE for available types.
116
117			-- Note: this is useful only to provide wrappers of the 
118			-- effective type.
119		do
120			Result:=cairo_font_face_get_type(handle)
121		ensure valid: is_valid_font_type(Result)
122		end
123
124end -- class CAIRO_FONT_FACE