/usr/include/pangomm-1.4/pangomm/renderer.h is in libpangomm-1.4-dev 2.38.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | // -*- c++ -*-
// Generated by gmmproc 2.46.1 -- DO NOT MODIFY!
#ifndef _PANGOMM_RENDERER_H
#define _PANGOMM_RENDERER_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* $Id: renderer.hg,v 1.4 2006/06/10 15:26:24 murrayc Exp $ */
/* renderer.h
*
* Copyright(C) 2004 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or(at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/object.h>
#include <pangomm/context.h>
#include <pangomm/layoutrun.h> //Has a typedef for GlyphItem
#include <pangomm/glyphstring.h>
#include <pangomm/layout.h>
#include <pangomm/layoutline.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _PangoRenderer PangoRenderer;
typedef struct _PangoRendererClass PangoRendererClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Pango
{ class Renderer_Class; } // namespace Pango
#endif //DOXYGEN_SHOULD_SKIP_THIS
namespace Pango
{
/** @addtogroup pangommEnums pangomm Enums and Flags */
/**
* @var RenderPart RENDER_PART_FOREGROUND
* The text itself.
*
* @var RenderPart RENDER_PART_BACKGROUND
* The area behind the text.
*
* @var RenderPart RENDER_PART_UNDERLINE
* Underlines.
*
* @var RenderPart RENDER_PART_STRIKETHROUGH
* Strikethrough lines.
*
* @enum RenderPart
*
* Pango::RenderPart defines different items to render for such
* purposes as setting colors.
*
* @newin{1,8}
*
* @ingroup pangommEnums
*/
enum RenderPart
{
RENDER_PART_FOREGROUND,
RENDER_PART_BACKGROUND,
RENDER_PART_UNDERLINE,
RENDER_PART_STRIKETHROUGH
};
} // namespace Pango
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Pango::RenderPart> : public Glib::Value_Enum<Pango::RenderPart>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Pango
{
/** Pango::Renderer is a base class that contains the necessary logic for rendering a Pango::Layout or Pango::LayoutLine.
* By subclassing Pango::Renderer and overriding operations such as draw_glyphs and draw_rectangle,
* renderers for particular font backends and destinations can be created.
*/
class Renderer : public Glib::Object
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
typedef Renderer CppObjectType;
typedef Renderer_Class CppClassType;
typedef PangoRenderer BaseObjectType;
typedef PangoRendererClass BaseClassType;
// noncopyable
Renderer(const Renderer&) = delete;
Renderer& operator=(const Renderer&) = delete;
private: friend class Renderer_Class;
static CppClassType renderer_class_;
protected:
explicit Renderer(const Glib::ConstructParams& construct_params);
explicit Renderer(PangoRenderer* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
Renderer(Renderer&& src) noexcept;
Renderer& operator=(Renderer&& src) noexcept;
virtual ~Renderer() noexcept;
/** Get the GType for this class, for use with the underlying GObject type system.
*/
static GType get_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GObject.
PangoRenderer* gobj() { return reinterpret_cast<PangoRenderer*>(gobject_); }
///Provides access to the underlying C GObject.
const PangoRenderer* gobj() const { return reinterpret_cast<PangoRenderer*>(gobject_); }
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
PangoRenderer* gobj_copy();
private:
protected:
public:
/** Draws @a layout with the specified Pango::Renderer.
*
* @newin{1,8}
*
* @param layout A Pango::Layout.
* @param x X position of left edge of baseline, in user space coordinates
* in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates
* in Pango units.
*/
void draw_layout(const Glib::RefPtr<Layout>& layout, int x, int y);
/** Draws @a line with the specified Pango::Renderer.
*
* @newin{1,8}
*
* @param line A Pango::LayoutLine.
* @param x X position of left edge of baseline, in user space coordinates
* in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates
* in Pango units.
*/
void draw_layout_line(const Glib::RefPtr<LayoutLine>& line, int x, int y);
/** Draws the glyphs in @a glyphs with the specified Pango::Renderer.
*
* @newin{1,8}
*
* @param font A Pango::Font.
* @param glyphs A Pango::GlyphString.
* @param x X position of left edge of baseline, in user space coordinates
* in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates
* in Pango units.
*/
void draw_glyphs(const Glib::RefPtr<Font>& font, const GlyphString& glyphs, int x, int y);
/** Draws the glyphs in @a glyph_item with the specified Pango::Renderer,
* embedding the text associated with the glyphs in the output if the
* output format supports it (PDF for example).
*
* Note that @a text is the start of the text for layout, which is then
* indexed by <tt> @a glyph_item->item->offset</tt>.
*
* If @a text is <tt>0</tt>, this simply calls draw_glyphs().
*
* The default implementation of this method simply falls back to
* draw_glyphs().
*
* @newin{1,22}
*
* @param text The UTF-8 text that @a glyph_item refers to, or <tt>0</tt>.
* @param glyph_item A Pango::GlyphItem.
* @param x X position of left edge of baseline, in user space coordinates
* in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates
* in Pango units.
*/
void draw_glyph_item(const Glib::ustring& text, const GlyphItem& glyph_item, int x, int y);
/** Draws an axis-aligned rectangle in user space coordinates with the
* specified Pango::Renderer.
*
* This should be called while @a renderer is already active. Use
* activate() to activate a renderer.
*
* @newin{1,8}
*
* @param part Type of object this rectangle is part of.
* @param x X position at which to draw rectangle, in user space coordinates in Pango units.
* @param y Y position at which to draw rectangle, in user space coordinates in Pango units.
* @param width Width of rectangle in Pango units in user space coordinates.
* @param height Height of rectangle in Pango units in user space coordinates.
*/
void draw_rectangle(RenderPart part, int x, int y, int width, int height);
/** Draw a squiggly line that approximately covers the given rectangle
* in the style of an underline used to indicate a spelling error.
* (The width of the underline is rounded to an integer number
* of up/down segments and the resulting rectangle is centered
* in the original rectangle)
*
* This should be called while @a renderer is already active. Use
* activate() to activate a renderer.
*
* @newin{1,8}
*
* @param x X coordinate of underline, in Pango units in user coordinate system.
* @param y Y coordinate of underline, in Pango units in user coordinate system.
* @param width Width of underline, in Pango units in user coordinate system.
* @param height Height of underline, in Pango units in user coordinate system.
*/
void draw_error_underline(int x, int y, int width, int height);
/** Draws a trapezoid with the parallel sides aligned with the X axis
* using the given Pango::Renderer; coordinates are in device space.
*
* @newin{1,8}
*
* @param part Type of object this trapezoid is part of.
* @param y1 Y coordinate of top of trapezoid.
* @param x11 X coordinate of left end of top of trapezoid.
* @param x21 X coordinate of right end of top of trapezoid.
* @param y2 Y coordinate of bottom of trapezoid.
* @param x12 X coordinate of left end of bottom of trapezoid.
* @param x22 X coordinate of right end of bottom of trapezoid.
*/
void draw_trapezoid(RenderPart part, double y1, double x11, double x21, double y2, double x12, double x22);
/** Draws a single glyph with coordinates in device space.
*
* @newin{1,8}
*
* @param font A Pango::Font.
* @param glyph The glyph index of a single glyph.
* @param x X coordinate of left edge of baseline of glyph.
* @param y Y coordinate of left edge of baseline of glyph.
*/
void draw_glyph(const Glib::RefPtr<Font>& font, Glyph glyph, double x, double y);
/** Does initial setup before rendering operations on @a renderer.
* deactivate() should be called when done drawing.
* Calls such as draw_layout() automatically
* activate the layout before drawing on it. Calls to
* activate() and deactivate() can
* be nested and the renderer will only be initialized and
* deinitialized once.
*
* @newin{1,8}
*/
void activate();
/** Cleans up after rendering operations on @a renderer. See
* docs for activate().
*
* @newin{1,8}
*/
void deactivate();
/** Informs Pango that the way that the rendering is done
* for @a part has changed in a way that would prevent multiple
* pieces being joined together into one drawing call. For
* instance, if a subclass of Pango::Renderer was to add a stipple
* option for drawing underlines, it needs to call
*
* [C example ellipted]
*
* When the stipple changes or underlines with different stipples
* might be joined together. Pango automatically calls this for
* changes to colors. (See set_color())
*
* @newin{1,8}
*
* @param part The part for which rendering has changed.
*/
void part_changed(RenderPart part);
/** Sets the color for part of the rendering.
*
* @newin{1,8}
*
* @param part The part to change the color of.
* @param color The new color or <tt>0</tt> to unset the current color.
*/
void set_color(RenderPart part, const Color& color);
/** Gets the current rendering color for the specified part.
*
* @newin{1,8}
*
* @param part The part to get the color for.
* @return The color for the
* specified part, or <tt>0</tt> if it hasn't been set and should be
* inherited from the environment.
*/
Color get_color(RenderPart part) const;
/** Sets the transformation matrix that will be applied when rendering.
*
* @newin{1,8}
*
* @param matrix A Pango::Matrix, or <tt>0</tt> to unset any existing matrix.
* (No matrix set is the same as setting the identity matrix.).
*/
void set_matrix(const Matrix& matrix);
//TODO: Documentation:
Matrix get_matrix() const;
/** Gets the layout currently being rendered using @a renderer.
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape<!---->() for example.
*
* The returned layout should not be modified while still being
* rendered.
*
* @newin{1,20}
*
* @return The layout, or <tt>0</tt> if
* no layout is being rendered using @a renderer at this time.
*/
Glib::RefPtr<Layout> get_layout();
/** Gets the layout currently being rendered using @a renderer.
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape<!---->() for example.
*
* The returned layout should not be modified while still being
* rendered.
*
* @newin{1,20}
*
* @return The layout, or <tt>0</tt> if
* no layout is being rendered using @a renderer at this time.
*/
Glib::RefPtr<const Layout> get_layout() const;
/** Gets the layout line currently being rendered using @a renderer.
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape<!---->() for example.
*
* The returned layout line should not be modified while still being
* rendered.
*
* @newin{1,20}
*
* @return The layout line, or <tt>0</tt>
* if no layout line is being rendered using @a renderer at this time.
*/
Glib::RefPtr<LayoutLine> get_layout_line();
/** Gets the layout line currently being rendered using @a renderer.
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape<!---->() for example.
*
* The returned layout line should not be modified while still being
* rendered.
*
* @newin{1,20}
*
* @return The layout line, or <tt>0</tt>
* if no layout line is being rendered using @a renderer at this time.
*/
Glib::RefPtr<const LayoutLine> get_layout_line() const;
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
};
} /* namespace Pango */
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Pango::Renderer
*/
Glib::RefPtr<Pango::Renderer> wrap(PangoRenderer* object, bool take_copy = false);
}
#endif /* _PANGOMM_RENDERER_H */
|