Commit 82996877 authored by Marko Anastasov's avatar Marko Anastasov Committed by Marko Anastasov

New files and functions, properties and signal of the new tooltips API.

2007-06-30  Marko Anastasov  <marko@marko.anastasov.name>

	* gtk/src/tooltip.[hg|ccg]:
	* gtk/src/widget.[hg|ccg]: New files and functions, properties and signal
	of the new tooltips API.
	* gtk/gtkmm.h: Include tooltip.h.
	* gtk/src/gtk_signals.defs: Added query_tooltip signal for Widget.
	* gtk/src/Makefile_list_of_hg.am_fragment: Include tooltip.hg in build.
	* tools/m4/convert_gtk.m4: Added conversions between GtkTooltip*
	and Glib::RefPtr<Gtk::Tooltip>.
	* tools/extra_defs_gen/generate_defs_gtk.cc: Generate defs for Tooltip.

svn path=/trunk/; revision=863
parent 968f7463
2007-06-30 Marko Anastasov <marko@marko.anastasov.name>
* gtk/src/tooltip.[hg|ccg]:
* gtk/src/widget.[hg|ccg]: New files and functions, properties and signal
of the new tooltips API.
* gtk/gtkmm.h: Include tooltip.h.
* gtk/src/gtk_signals.defs: Added query_tooltip signal for Widget.
* gtk/src/Makefile_list_of_hg.am_fragment: Include tooltip.hg in build.
* tools/m4/convert_gtk.m4: Added conversions between GtkTooltip*
and Glib::RefPtr<Gtk::Tooltip>.
* tools/extra_defs_gen/generate_defs_gtk.cc: Generate defs for Tooltip.
2007-06-26 Murray Cumming <murrayc@murrayc.com>
* examples/book/builder/basic/basic.ui:
......
......@@ -167,6 +167,7 @@ extern const int gtkmm_micro_version;
#include <gtkmm/toolbutton.h>
#include <gtkmm/toggletoolbutton.h>
#include <gtkmm/menutoolbutton.h>
#include <gtkmm/tooltip.h>
#include <gtkmm/tooltips.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treemodelfilter.h>
......
......@@ -32,7 +32,7 @@ files_general_hg = aboutdialog.hg accelgroup.hg accellabel.hg action.hg actiongr
table.hg targetlist.hg tearoffmenuitem.hg \
textattributes.hg textbuffer.hg textchildanchor.hg textiter.hg textmark.hg texttag.hg texttagtable.hg textview.hg \
toggleaction.hg \
togglebutton.hg toggletoolbutton.hg toolbar.hg toolitem.hg toolbutton.hg tooltips.hg \
togglebutton.hg toggletoolbutton.hg toolbar.hg toolitem.hg toolbutton.hg tooltips.hg tooltip.hg \
treedragdest.hg treedragsource.hg treepath.hg treerowreference.hg treeselection.hg treesortable.hg \
treeiter.hg treemodel.hg treemodelfilter.hg treemodelsort.hg treestore.hg treeview.hg treeviewcolumn.hg \
viewport.hg volumebutton.hg uimanager.hg \
......
......@@ -34105,6 +34105,19 @@
)
)
(define-signal query-tooltip
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("gint" "p0")
'("gint" "p1")
'("gboolean" "p2")
'("GtkTooltip*" "p3")
)
)
(define-signal popup-menu
(of-object "GtkWidget")
(return-type "gboolean")
......@@ -34315,6 +34328,33 @@
(construct-only #f)
)
(define-property has-tooltip
(of-object "GtkWidget")
(prop-type "GParamBoolean")
(docs "Whether this widget has a tooltip")
(readable #t)
(writable #t)
(construct-only #f)
)
(define-property tooltip-markup
(of-object "GtkWidget")
(prop-type "GParamString")
(docs "The contents of the tooltip for this widget")
(readable #t)
(writable #t)
(construct-only #f)
)
(define-property tooltip-text
(of-object "GtkWidget")
(prop-type "GParamString")
(docs "The contents of the tooltip for this widget")
(readable #t)
(writable #t)
(construct-only #f)
)
;; From GtkWindow
(define-signal set-focus
......
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtktooltip.h>
namespace Gtk
{
void Tooltip::trigger_tooltip_query(const Glib::RefPtr<Gdk::Display>& display)
{
gtk_tooltip_trigger_tooltip_query(display->gobj());
}
} // namespace Gtk
/* 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/object.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/enums.h>
#include <gtkmm/widget.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
namespace Gtk
{
class Tooltip : public Glib::Object
{
_CLASS_GOBJECT(Tooltip, GtkTooltip, GTK_TOOLTIP, Glib::Object, GObject)
public:
_WRAP_METHOD(void set_markup(const Glib::ustring& markup), gtk_tooltip_set_markup)
_WRAP_METHOD(void set_text(const Glib::ustring& markup), gtk_tooltip_set_text)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_tooltip_set_icon)
_WRAP_METHOD(void set_icon_from_stock(const StockID& stock_id, IconSize size), gtk_tooltip_set_icon_from_stock)
_WRAP_METHOD(void set_custom(Widget& custom_widget), gtk_tooltip_set_custom)
_IGNORE(gtk_tooltip_trigger_tooltip_query)
static void trigger_tooltip_query(const Glib::RefPtr<Gdk::Display>& display);
};
} // namespace Gtk
......@@ -26,6 +26,7 @@
#include <gtkmm/container.h>
#include <gtkmm/selectiondata_private.h>
#include <gtkmm/action.h>
#include <gtkmm/tooltip.h>
#include <gtk/gtkdnd.h>
#include <gtk/gtkselection.h>
#include <gtk/gtkwidget.h>
......@@ -36,7 +37,6 @@
#include <gtk/gtkaction.h> //For gtk_widget_get_action().
namespace //anonymous
{
......
......@@ -68,6 +68,7 @@ class Adjustment;
class Window;
class Container;
class Settings;
class Tooltip;
typedef GtkRequisition Requisition;
......@@ -491,7 +492,15 @@ public:
//TODO: The drawable should be passed by reference, when we can break API/ABI, but it's not the end of the world. murrayc.
void draw_insertion_cursor(Glib::RefPtr<Gdk::Drawable> drawable, const Gdk::Rectangle& area, const Gdk::Rectangle& location, bool is_primary, TextDirection direction, bool draw_arrow = true);
_IGNORE(gtk_draw_insertion_cursor)
// Gtk+ 2.12 tooltip API
_WRAP_METHOD(void set_tooltip_window(Window& widget), gtk_widget_set_tooltip_window)
_WRAP_METHOD(Window* get_tooltip_window(), gtk_widget_get_tooltip_window)
_WRAP_METHOD(void trigger_tooltip_query(), gtk_widget_trigger_tooltip_query)
_WRAP_METHOD(void set_tooltip_text(const Glib::ustring& text), gtk_widget_set_tooltip_text)
_WRAP_METHOD(Glib::ustring get_tooltip_text() const, gtk_widget_get_tooltip_text)
_WRAP_METHOD(void set_tooltip_markup(const Glib::ustring& markup), gtk_widget_set_tooltip_markup)
_WRAP_METHOD(Glib::ustring get_tooltip_markup() const, gtk_widget_get_tooltip_markup)
/* FLAGS */
......@@ -819,8 +828,6 @@ dnl
_WRAP_SIGNAL(void composited_changed(), "composited_changed", no_default_handler)
//TODO: Wrap GtkTooltip?: _WRAP_SIGNAL(void query_tooltip(int x, int y, bool keyboard_tooltip, Tooltip *tooltip), "query_tooltip", no_default_handler)
//TODO: The signal_id is very C-like here:
//_WRAP_SIGNAL(bool can_activate_accel(guint signal_id), "can_activate_accel")
......@@ -831,6 +838,9 @@ dnl
_IGNORE_SIGNAL("destroy-event")
// Tooltip signal
_WRAP_SIGNAL(bool query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Tooltip>& tooltip), "query_tooltip", no_default_handler)
_WRAP_PROPERTY("name", Glib::ustring)
_WRAP_PROPERTY("parent", Container*)
_WRAP_PROPERTY("width_request", int)
......@@ -847,6 +857,9 @@ dnl
_WRAP_PROPERTY("style", Glib::RefPtr<Style>)
_WRAP_PROPERTY("events", Gdk::EventMask)
_WRAP_PROPERTY("extension_events", Gdk::ExtensionMode)
_WRAP_PROPERTY("has_tooltip", bool)
_WRAP_PROPERTY("tooltip_markup", Glib::ustring)
_WRAP_PROPERTY("tooltip_text", Glib::ustring)
protected:
//comment in GTK+ header: "seldomly overidden"
......
......@@ -191,6 +191,7 @@ int main (int argc, char *argv[])
<< get_defs( GTK_TYPE_TEXT_VIEW )
<< get_defs( GTK_TYPE_TOGGLE_ACTION )
<< get_defs( GTK_TYPE_TOGGLE_TOOL_BUTTON )
<< get_defs( GTK_TYPE_TOOLTIP )
<< get_defs( GTK_TYPE_TOOLTIPS )
<< get_defs( GTK_TYPE_TREE_SELECTION )
<< get_defs( GTK_TYPE_TREE_MODEL_FILTER )
......
......@@ -579,6 +579,10 @@ _CONVERSION(`const Glib::RefPtr<Printer>&',`GtkPrinter*',__CONVERT_REFPTR_TO_P($
#PrintJob
_CONVERSION(`GtkPrintCapabilities',`PrintCapabilities',`($2)$3')
#Tooltip
_CONVERSION(`GtkTooltip*',`const Glib::RefPtr<Tooltip>&',`Glib::wrap($3, true)')
_CONVERSION(`const Glib::RefPtr<Tooltip>&',`GtkTooltip*',__CONVERT_REFPTR_TO_P($3))
# Used by Signals:
# The true here means "take reference", because the code that emits the signal does not do a ref for the receiving signal handler.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment