/usr/include/gtkmm-3.0/gtkmm/tooltip.h is in libgtkmm-3.0-dev 3.22.0-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 | // Generated by gmmproc 2.50.0 -- DO NOT MODIFY!
#ifndef _GTKMM_TOOLTIP_H
#define _GTKMM_TOOLTIP_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <glibmm/object.h>
#include <giomm/icon.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/enums.h>
#include <gtkmm/widget.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
using GtkTooltip = struct _GtkTooltip;
using GtkTooltipClass = struct _GtkTooltipClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gtk
{ class Tooltip_Class; } // namespace Gtk
#endif //DOXYGEN_SHOULD_SKIP_THIS
namespace Gtk
{
/** Add tips to your widgets
*
* Basic tooltips can be realized simply by using set_tooltip_text()
* or set_tooltip_markup() without any explicit tooltip object.
*
* When you need a tooltip with a little more fancy contents, like
* adding an image, or you want the tooltip to have different contents
* per Gtk::TreeView row or cell, you will have to do a little more work:
*
* - Call Gtk::Widget:set_has_tooltip(); this will
* make GTK+ monitor the widget for motion and related events
* which are needed to determine when and where to show a tooltip.
*
* - Connect to Gtk::Widget::signal_query_tooltip(). This signal
* will be emitted when a tooltip is supposed to be shown. One
* of the arguments passed to the signal handler is a Gtk::Tooltip
* object. This is the object that we are about to display as a
* tooltip, and can be manipulated in your callback using functions
* like Gtk::Tooltip::set_icon(). There are functions for setting
* the tooltip's markup, setting an image from a stock icon, or
* even putting in a custom widget.
*
* - Return true from your query-tooltip handler. This causes
* the tooltip to be show. If you return false, it will not be shown.
*
* In the probably rare case where you want to have even more control
* over the tooltip that is about to be shown, you can set your own
* Window which will be used as tooltip window. This works as follows:
*
* - Do Gtk::Widget::set_has_tooltip() and connect to
* Gtk::Widget::signal_query_tooltip() as before.
*
* - Use Gtk::Widget::set_tooltip_window() to set a Gtk::Window created
* by you as tooltip window.
*
* - In the query-tooltip callback you can access your window
* using Gtk::Widget::get_tooltip_window() and manipulate it as you
* wish. The semantics of the return value are exactly as before,
* return true to show the window, false to not show it.
*
* @newin{2,12}
*/
class Tooltip : public Glib::Object
{
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
using CppObjectType = Tooltip;
using CppClassType = Tooltip_Class;
using BaseObjectType = GtkTooltip;
using BaseClassType = GtkTooltipClass;
// noncopyable
Tooltip(const Tooltip&) = delete;
Tooltip& operator=(const Tooltip&) = delete;
private: friend class Tooltip_Class;
static CppClassType tooltip_class_;
protected:
explicit Tooltip(const Glib::ConstructParams& construct_params);
explicit Tooltip(GtkTooltip* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
Tooltip(Tooltip&& src) noexcept;
Tooltip& operator=(Tooltip&& src) noexcept;
~Tooltip() noexcept override;
/** 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.
GtkTooltip* gobj() { return reinterpret_cast<GtkTooltip*>(gobject_); }
///Provides access to the underlying C GObject.
const GtkTooltip* gobj() const { return reinterpret_cast<GtkTooltip*>(gobject_); }
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
GtkTooltip* gobj_copy();
private:
public:
/** Sets the text of the tooltip to be @a markup, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* If @a markup is <tt>nullptr</tt>, the label will be hidden.
*
* @newin{2,12}
*
* @param markup A markup string (see [Pango markup format][PangoMarkupFormat]) or <tt>nullptr</tt>.
*/
void set_markup(const Glib::ustring& markup);
/** Hide the label.
* @newin{3,2}
*/
void unset_markup();
/** Sets the text of the tooltip to be @a text. If @a text is <tt>nullptr</tt>, the label
* will be hidden. See also set_markup().
*
* @newin{2,12}
*
* @param text A text string or <tt>nullptr</tt>.
*/
void set_text(const Glib::ustring& text);
/** Hide the label.
* @newin{3,2}
*/
void unset_text();
/** Sets the icon of the tooltip (which is in front of the text) to be
* @a pixbuf. If @a pixbuf is <tt>nullptr</tt>, the image will be hidden.
*
* @newin{2,12}
*
* @param pixbuf A Gdk::Pixbuf, or <tt>nullptr</tt>.
*/
void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
/** Sets the icon of the tooltip (which is in front of the text)
* to be the icon indicated by @a gicon with the size indicated
* by @a size. If @a gicon is <tt>nullptr</tt>, the image will be hidden.
*
* @newin{2,20}
*
* @param gicon A Icon representing the icon, or <tt>nullptr</tt>.
* @param size A stock icon size (Gtk::IconSize).
*/
void set_icon(const Glib::RefPtr<Gio::Icon>& gicon, IconSize size);
//TODO: Remove the _from_*() suffixes?
#ifndef GTKMM_DISABLE_DEPRECATED
/** Sets the icon of the tooltip (which is in front of the text) to be
* the stock item indicated by @a stock_id with the size indicated
* by @a size. If @a stock_id is <tt>nullptr</tt>, the image will be hidden.
*
* @newin{2,12}
*
* Deprecated: 3.10: Use set_icon_from_icon_name() instead.
*
* @deprecated Use set_icon_from_icon_name() instead.
*
* @param stock_id A stock id, or <tt>nullptr</tt>.
* @param size A stock icon size (Gtk::IconSize).
*/
void set_icon_from_stock(const StockID& stock_id, IconSize size);
#endif // GTKMM_DISABLE_DEPRECATED
/** Sets the icon of the tooltip (which is in front of the text) to be
* the icon indicated by @a icon_name with the size indicated
* by @a size. If @a icon_name is <tt>nullptr</tt>, the image will be hidden.
*
* @newin{2,14}
*
* @param icon_name An icon name, or <tt>nullptr</tt>.
* @param size A stock icon size (Gtk::IconSize).
*/
void set_icon_from_icon_name(const Glib::ustring& icon_name, IconSize size);
/** Hide the image.
* @newin{3,2}
*/
void unset_icon();
/** Replaces the widget packed into the tooltip with
* @a custom_widget. @a custom_widget does not get destroyed when the tooltip goes
* away.
* By default a box with a Gtk::Image and Gtk::Label is embedded in
* the tooltip, which can be configured using set_markup()
* and set_icon().
*
*
* @newin{2,12}
*
* @param custom_widget A Gtk::Widget, or <tt>nullptr</tt> to unset the old custom widget.
*/
void set_custom(Widget& custom_widget);
/** Remove the custom widget.
* @newin{3,2}
*/
void unset_custom();
/** Sets the area of the widget, where the contents of this tooltip apply,
* to be @a rect (in widget coordinates). This is especially useful for
* properly setting tooltips on Gtk::TreeView rows and cells, Gtk::IconViews,
* etc.
*
* For setting tooltips on Gtk::TreeView, please refer to the convenience
* functions for this: Gtk::TreeView::set_tooltip_row() and
* Gtk::TreeView::set_tooltip_cell().
*
* @newin{2,12}
*
* @param rect A Gdk::Rectangle.
*/
void set_tip_area(const Gdk::Rectangle& rect);
static void trigger_tooltip_query(const Glib::RefPtr<Gdk::Display>& display);
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
};
} // namespace Gtk
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 Gtk::Tooltip
*/
Glib::RefPtr<Gtk::Tooltip> wrap(GtkTooltip* object, bool take_copy = false);
}
#endif /* _GTKMM_TOOLTIP_H */
|