This file is indexed.

/usr/include/gtkglextmm-1.2/gtkmm/gl/widget.h is in libgtkglextmm-x11-1.2-dev 1.2.0-8.

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
// -*- C++ -*-
/* gtkglextmm - C++ Wrapper for GtkGLExt
 * Copyright (C) 2002-2003  Naofumi Yasufuku
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 */

#ifndef _GTKMM_GL_WIDGET_H
#define _GTKMM_GL_WIDGET_H

#include <gtkmm/widget.h>

#include <gdkmm/gl/tokens.h>
#include <gdkmm/gl/config.h>
#include <gdkmm/gl/context.h>
#include <gdkmm/gl/window.h>

namespace Gtk
{
  namespace GL
  {

    /** Set the OpenGL-capability to the Gtk::Widget.
     * The call setup the callbacks to realize a OpenGL-capable window.
     *
     * @param widget       the GtkWidget to be used as the rendering area.
     * @param glconfig     a Gdk::GL::Config.
     * @param share_list   the Gdk::GL::Context which to share display lists.
     * @param direct       whether rendering is to be done with a direct
     *                     connection to the graphics system.
     * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
     *                     (currently not used).
     * @return  <tt>true</tt> if it is successful, <tt>false</tt> otherwise.
     */
    bool widget_set_gl_capability(Gtk::Widget& widget,
                                  const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
                                  const Glib::RefPtr<const Gdk::GL::Context>& share_list,
                                  bool direct = true,
                                  int render_type = Gdk::GL::RGBA_TYPE);

    /** Set the OpenGL-capability to the Gtk::Widget.
     * The call setup the callbacks to realize a OpenGL-capable window.
     *
     * @param widget       the GtkWidget to be used as the rendering area.
     * @param glconfig     a Gdk::GL::Config.
     * @param direct       whether rendering is to be done with a direct
     *                     connection to the graphics system.
     * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
     *                     (currently not used).
     * @return  <tt>true</tt> if it is successful, <tt>false</tt> otherwise.
     */
    bool widget_set_gl_capability(Gtk::Widget& widget,
                                  const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
                                  bool direct = true,
                                  int render_type = Gdk::GL::RGBA_TYPE);

    /** Return whether the Gtk::Widget is OpenGL-capable.
     *
     * @param widget  a Gtk::Widget.
     * @return  <tt>true</tt> if the Gtk::Widget is OpenGL-capable,
     *          <tt>false</tt> otherwise.
     */
    bool widget_is_gl_capable(const Gtk::Widget& widget);

    /** Return the Gdk::GL::Config referred by the Gtk::Widget.
     *
     * @param widget  a Gtk::Widget.
     * @return  the Gdk::GL::Config.
     */
    Glib::RefPtr<Gdk::GL::Config> widget_get_gl_config(const Gtk::Widget& widget);

    /** Create a new Gdk::GL::Context with the appropriate Gdk::GL::Drawable
     * for this widget.
     *
     * See also get_gl_context().
     *
     * @param widget       a Gtk::Widget.
     * @param share_list   the Gdk::GL::Context which to share display lists.
     * @param direct       whether rendering is to be done with a direct
     *                     connection to the graphics system.
     * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
     *                     (currently not used).
     * @return  the new Gdk::GL::Context.
     */
    Glib::RefPtr<Gdk::GL::Context> widget_create_gl_context(const Gtk::Widget& widget,
                                                            const Glib::RefPtr<const Gdk::GL::Context>& share_list,
                                                            bool direct = true,
                                                            int render_type = Gdk::GL::RGBA_TYPE);

    /** Create a new Gdk::GL::Context with the appropriate Gdk::GL::Drawable
     * for this widget.
     *
     * See also get_gl_context().
     *
     * @param widget       a Gtk::Widget.
     * @param direct       whether rendering is to be done with a direct
     *                     connection to the graphics system.
     * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
     *                     (currently not used).
     * @return  the new Gdk::GL::Context.
     */
    Glib::RefPtr<Gdk::GL::Context> widget_create_gl_context(const Gtk::Widget& widget,
                                                            bool direct = true,
                                                            int render_type = Gdk::GL::RGBA_TYPE);

    /** Return the Gdk::GL::Context with the appropriate Gdk::GL::Drawable
     * for this widget.
     *
     * Unlike the GL context returned by create_gl_context(), this context
     * is owned by the widget.
     *
     * @param widget  a Gtk::Widget.
     * @return  the Gdk::GL::Context.
     */
    Glib::RefPtr<Gdk::GL::Context> widget_get_gl_context(const Gtk::Widget& widget);

    /** Return the Gdk::GL::Window owned by the Gtk::Widget.
     *
     * @param widget  a Gtk::Widget.
     * @return  the Gdk::GL::Window.
     */
    Glib::RefPtr<Gdk::GL::Window> widget_get_gl_window(const Gtk::Widget& widget);

    /** Return the Gdk::GL::Drawable owned by the Gtk::Widget.
     *
     * @param widget  a Gtk::Widget.
     * @return  the Gdk::GL::Drawable.
     */
    Glib::RefPtr<Gdk::GL::Drawable> widget_get_gl_drawable(const Gtk::Widget& widget);

    /** OpenGL extension API to Gtk::Widget.
     *
     *
     */

    template <class T_GtkWidget>
    class Widget
    {
    public:
      virtual ~Widget() = 0;

    public:

      /** Set the OpenGL-capability to the Gtk::Widget.
       * The call setup the callbacks to realize a OpenGL-capable window.
       *
       * @param glconfig     a Gdk::GL::Config.
       * @param share_list   the Gdk::GL::Context which to share display lists.
       * @param direct       whether rendering is to be done with a direct
       *                     connection to the graphics system.
       * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
       *                     (currently not used).
       * @return  <tt>true</tt> if it is successful, <tt>false</tt> otherwise.
       */
      bool set_gl_capability(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
                             const Glib::RefPtr<const Gdk::GL::Context>& share_list,
                             bool direct = true,
                             int render_type = Gdk::GL::RGBA_TYPE)
      { return widget_set_gl_capability(*static_cast<T_GtkWidget*>(this), glconfig, share_list, direct, render_type); }

      /** Set the OpenGL-capability to the Gtk::Widget.
       * The call setup the callbacks to realize a OpenGL-capable window.
       *
       * @param glconfig     a Gdk::GL::Config.
       * @param direct       whether rendering is to be done with a direct
       *                     connection to the graphics system.
       * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
       *                     (currently not used).
       * @return  <tt>true</tt> if it is successful, <tt>false</tt> otherwise.
       */
      bool set_gl_capability(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
                             bool direct = true,
                             int render_type = Gdk::GL::RGBA_TYPE)
      { return widget_set_gl_capability(*static_cast<T_GtkWidget*>(this), glconfig, direct, render_type); }

      /** Return whether the Gtk::Widget is OpenGL-capable.
       *
       * @return  <tt>true</tt> if the Gtk::Widget is OpenGL-capable,
       *          <tt>false</tt> otherwise.
       */
      bool is_gl_capable() const
      { return widget_is_gl_capable(*static_cast<const T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Config referred by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Config.
       */
      Glib::RefPtr<Gdk::GL::Config> get_gl_config()
      { return widget_get_gl_config(*static_cast<T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Config referred by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Config.
       */
      Glib::RefPtr<const Gdk::GL::Config> get_gl_config() const
      { return widget_get_gl_config(*static_cast<const T_GtkWidget*>(this)); }

      /** Create a new Gdk::GL::Context with the appropriate Gdk::GL::Drawable
       * for this widget.
       *
       * See also get_gl_context().
       *
       * @param share_list   the Gdk::GL::Context which to share display lists.
       * @param direct       whether rendering is to be done with a direct
       *                     connection to the graphics system.
       * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
       *                     (currently not used).
       * @return  the new Gdk::GL::Context.
       */
      Glib::RefPtr<Gdk::GL::Context> create_gl_context(const Glib::RefPtr<const Gdk::GL::Context>& share_list,
                                                       bool direct = true,
                                                       int render_type = Gdk::GL::RGBA_TYPE)
      { return widget_create_gl_context(*static_cast<T_GtkWidget*>(this), share_list, direct, render_type); }

      /** Create a new Gdk::GL::Context with the appropriate Gdk::GL::Drawable
       * for this widget.
       *
       * See also get_gl_context().
       *
       * @param direct       whether rendering is to be done with a direct
       *                     connection to the graphics system.
       * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
       *                     (currently not used).
       * @return  the new Gdk::GL::Context.
       */
      Glib::RefPtr<Gdk::GL::Context> create_gl_context(bool direct = true,
                                                       int render_type = Gdk::GL::RGBA_TYPE)
      { return widget_create_gl_context(*static_cast<T_GtkWidget*>(this), direct, render_type); }

      /** Return the Gdk::GL::Context with the appropriate Gdk::GL::Drawable
       * for this widget.
       *
       * Unlike the GL context returned by create_gl_context(), this context
       * is owned by the widget.
       *
       * @return  the Gdk::GL::Context.
       */
      Glib::RefPtr<Gdk::GL::Context> get_gl_context()
      { return widget_get_gl_context(*static_cast<T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Window owned by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Window.
       */
      Glib::RefPtr<Gdk::GL::Window> get_gl_window()
      { return widget_get_gl_window(*static_cast<T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Window owned by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Window.
       */
      Glib::RefPtr<const Gdk::GL::Window> get_gl_window() const
      { return widget_get_gl_window(*static_cast<const T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Drawable owned by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Drawable.
       */
      Glib::RefPtr<Gdk::GL::Drawable> get_gl_drawable()
      { return widget_get_gl_drawable(*static_cast<T_GtkWidget*>(this)); }

      /** Return the Gdk::GL::Drawable owned by the Gtk::Widget.
       *
       * @return  the Gdk::GL::Drawable.
       */
      Glib::RefPtr<const Gdk::GL::Drawable> get_gl_drawable() const
      { return widget_get_gl_drawable(*static_cast<const T_GtkWidget*>(this)); }

    };

    template <class T_GtkWidget>
    Widget<T_GtkWidget>::~Widget()
    {}

    /** @example simple.cc
     *
     * Simple gtkglextmm example.
     *
     */

    /** @example simple-mixed.cc
     *
     * Simple gtkglextmm example for mixing OpenGL and GDK rendering.
     *
     */

  } // namespace GL
} // namespace Gtk

#endif // _GTKMM_GL_WIDGET_H