This file is indexed.

/usr/include/cairomm-1.0/cairomm/xlib_surface.h is in libcairomm-1.0-dev 1.10.0-1ubuntu3.

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
/* Copyright (C) 2005 The cairomm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#ifndef __CAIROMM_XLIB_SURFACE_H
#define __CAIROMM_XLIB_SURFACE_H

#include <cairomm/surface.h>

// This header is not included by cairomm.h because it requires X headers that 
// tend to pollute the namespace with non-prefixed #defines and typedefs.
// You may include it directly if you need to use this API.

#ifdef CAIRO_HAS_XLIB_SURFACE
#include <cairo-xlib.h> // Needed for the X11 "Display" struct (which pollutes the namespace because it has no prefix.)
#ifdef CAIRO_HAS_XLIB_XRENDER_SURFACE
#include <cairo-xlib-xrender.h> // xrender-specific API
#endif // CAIRO_HAS_XLIB_XRENDER_SURFACE
#endif // CAIRO_HAS_XLIB_SURFACE


namespace Cairo
{

#ifdef CAIRO_HAS_XLIB_SURFACE

/** An XlibSurface provides a way to render to the X Window System using XLib.
 * If you want to draw to the screen within an application that uses the X
 * Window system, you should use this Surface type.
 *
 * @note For this surface to be availabe, cairo must have been compiled with
 * support for XLib Surfaces
 */
class XlibSurface : public Surface
{
public:

  /** Create a C++ wrapper for the C instance. This C++ instance should then be
   * given to a RefPtr.
   *
   * @param cobject The C instance.
   * @param has_reference whether we already have a reference. Otherwise, the
   * constructor will take an extra reference.
   */
  explicit XlibSurface(cairo_surface_t* cobject, bool has_reference = false);
  virtual ~XlibSurface();

  /** Creates an Xlib surface that draws to the given drawable. The way that
   * colors are represented in the drawable is specified by the provided
   * visual.
   *
   * @note If drawable is a Window, then the function
   * cairo_xlib_surface_set_size must be called whenever the size of the window
   * changes.
   *
   * @param dpy	an X Display
   * @param drawable	an X Drawable, (a Pixmap or a Window)
   * @param visual	the visual to use for drawing to drawable. The depth of the visual must match the depth of the drawable. Currently, only TrueColor visuals are fully supported.
   * @param width	the current width of drawable.
   * @param height	the current height of drawable.
   * @return	A RefPtr to the newly created surface
   */
  static RefPtr<XlibSurface> create(Display* dpy, Drawable drawable, Visual* visual, int width, int height);

  /** Creates an Xlib surface that draws to the given bitmap. This will be
   * drawn to as a CAIRO_FORMAT_A1 object.
   *
   * @param dpy	an X Display
   * @param bitmap	an X Drawable, (a depth-1 Pixmap)
   * @param screen	the X Screen associated with bitmap
   * @param width	the current width of bitmap.
   * @param height	the current height of bitmap.
   * @return	A RefPtr to the newly created surface
   */
  static RefPtr<XlibSurface> create(Display *dpy, Pixmap bitmap, Screen *screen, int width, int height);

  /** Informs cairo of the new size of the X Drawable underlying the surface.
   * For a surface created for a Window (rather than a Pixmap), this function
   * must be called each time the size of the window changes. (For a subwindow,
   * you are normally resizing the window yourself, but for a toplevel window,
   * it is necessary to listen for ConfigureNotify events.)
   *
   * A Pixmap can never change size, so it is never necessary to call this
   * function on a surface created for a Pixmap.
   *
   * @param width	the new width of the surface
   * @param height	the new height of the surface
   */
  void set_size(int width, int height);

  /** Informs cairo of a new X Drawable underlying the surface. The drawable
   * must match the display, screen and format of the existing drawable or the
   * application will get X protocol errors and will probably terminate. No
   * checks are done by this function to ensure this compatibility.
   *
   * @param drawable	the new drawable for the surface
   * @param width	the width of the new drawable
   * @param height	the height of the new drawable
   */
  void set_drawable(Drawable drawable, int width, int height);

  /** gets the Drawable object associated with this surface */
  Drawable get_drawable() const;

  /** Get the X Display for the underlying X Drawable. */
  const Display* get_display() const;
  /** Get the X Display for the underlying X Drawable. */
  Display* get_display();

  /** Get the X Screen for the underlying X Drawable */
  Screen* get_screen();
  /** Get the X Screen for the underlying X Drawable */
  const Screen* get_screen() const;

  /** Get the X Visual for the underlying X Drawable */
  Visual* get_visual();
  /** Get the X Visual for the underlying X Drawable */
  const Visual* get_visual() const;

  /** Get the number of bits used to represent each pixel value. */
  int get_depth() const;

  /** Get the height in pixels of the X Drawable underlying the surface */
  int get_height() const;

  /** Get the width in pixels of the X Drawable underlying the surface */
  int get_width() const;

#if CAIRO_HAS_XLIB_XRENDER_SURFACE
  /**
   * Creates an Xlib surface that draws to the given drawable.  The way that
   * colors are represented in the drawable is specified by the provided picture
   * format.
   *
   * Note: If @drawable is a Window, then the function set_size() must be called
   * whenever the size of the window changes.
   *
   * @param dpy an X Display
   * @param drawable an X Drawable, (a Pixmap or a Window)
   * @param screen the X Screen associated with @drawable
   * @param format the picture format to use for drawing to @drawable. The depth
   *          of @format must match the depth of the drawable.
   * @param width the current width of @drawable.
   * @param height the current height of @drawable.
   *
   * @return the newly created surface
   **/
  static Cairo::RefPtr<Cairo::XlibSurface> 
  create_with_xrender_format (Display *dpy,
                              Drawable drawable,
                              Screen *screen,
                              XRenderPictFormat *format,
                              int width,
                              int height);

  /**
   * Gets the X Render picture format that @surface uses for rendering with the
   * X Render extension. If the surface was created by
   * cairo_xlib_surface_create_with_xrender_format() originally, the return
   * value is the format passed to that constructor.
   *
   * Return value: the XRenderPictFormat* associated with @surface,
   * or %NULL if the surface is not an xlib surface
   * or if the X Render extension is not available.
   *
   * Since: 1.6
   **/
  XRenderPictFormat * get_xrender_format() const;

#endif // CAIRO_HAS_XLIB_XRENDER_SURFACE

};

#endif // CAIRO_HAS_XLIB_SURFACE

} // namespace Cairo

#endif //__CAIROMM_XLIB_SURFACE_H

// vim: ts=2 sw=2 et