gtksourceviewmm
3.91.1
|
#include <gtksourceviewmm/gutterrenderer.h>
Public Member Functions | |
GutterRenderer (GutterRenderer&& src) noexcept | |
GutterRenderer& | operator= (GutterRenderer&& src) noexcept |
GutterRenderer (const GutterRenderer&)=delete | |
GutterRenderer& | operator= (const GutterRenderer&)=delete |
~GutterRenderer () noexcept override | |
GtkSourceGutterRenderer* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkSourceGutterRenderer* | gobj () const |
Provides access to the underlying C GObject. More... | |
void | begin (const Cairo::RefPtr< Cairo::Context >& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::TextIter&start, Gtk::TextIter&end) |
Called when drawing a region begins. More... | |
void | draw (const Cairo::RefPtr< Cairo::Context >& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::TextIter&start, Gtk::TextIter&end, GutterRendererState p6) |
Main renderering method. More... | |
void | end () |
Called when drawing a region of lines has ended. More... | |
int | get_size () const |
Get the size of the renderer. More... | |
void | set_size (int size) |
Sets the size of the renderer. More... | |
bool | get_visible () const |
Get whether the gutter renderer is visible. More... | |
void | set_visible (bool visible) |
Set whether the gutter renderer is visible. More... | |
void | get_padding (int& xpad, int& ypad) const |
Get the x-padding and y-padding of the gutter renderer. More... | |
void | set_padding (int xpad, int ypad) |
Set the padding of the gutter renderer. More... | |
void | get_alignment (float& xalign, float& yalign) const |
Get the x-alignment and y-alignment of the gutter renderer. More... | |
void | set_alignment (float xalign, float yalign) |
Set the alignment of the gutter renderer. More... | |
GutterRendererAlignmentMode | get_alignment_mode () const |
Get the alignment mode. More... | |
void | set_alignment_mode (GutterRendererAlignmentMode mode) |
Set the alignment mode. More... | |
Gtk::TextWindowType | get_window_type () const |
Get the Gtk::TextWindowType associated with the gutter renderer. More... | |
Gtk::TextView* | get_view () |
Get the view associated to the gutter renderer. More... | |
const Gtk::TextView* | get_view () const |
Get the view associated to the gutter renderer. More... | |
bool | get_background (Gdk::RGBA& color) const |
Get the background color of the renderer. More... | |
bool | is_background_set () const |
void | set_background (const Gdk::RGBA& color) |
Set the background color of the renderer. More... | |
void | queue_draw () |
Emits the Gtk::SourceGutterRenderer::signal_queue_draw() signal of the renderer. More... | |
Glib::PropertyProxy< bool > | property_visible () |
Visible. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_visible () const |
Visible. More... | |
Glib::PropertyProxy< int > | property_xpad () |
The x-padding. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_xpad () const |
The x-padding. More... | |
Glib::PropertyProxy< int > | property_ypad () |
The y-padding. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_ypad () const |
The y-padding. More... | |
Glib::PropertyProxy< float > | property_xalign () |
The x-alignment. More... | |
Glib::PropertyProxy_ReadOnly< float > | property_xalign () const |
The x-alignment. More... | |
Glib::PropertyProxy< float > | property_yalign () |
The y-alignment. More... | |
Glib::PropertyProxy_ReadOnly< float > | property_yalign () const |
The y-alignment. More... | |
Glib::PropertyProxy_ReadOnly< Gtk::TextView*> | property_view () const |
The view. More... | |
Glib::PropertyProxy< GutterRendererAlignmentMode > | property_alignment_mode () |
The alignment mode. More... | |
Glib::PropertyProxy_ReadOnly< GutterRendererAlignmentMode > | property_alignment_mode () const |
The alignment mode. More... | |
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > | property_window_type () const |
The window type. More... | |
Glib::PropertyProxy< int > | property_size () |
The size. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_size () const |
The size. More... | |
Glib::PropertyProxy< Gdk::RGBA > | property_background_rgba () |
The background color. More... | |
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > | property_background_rgba () const |
The background color. More... | |
Glib::PropertyProxy< bool > | property_background_set () |
Whether the background color is set. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_background_set () const |
Whether the background color is set. More... | |
Glib::SignalProxy< bool, const Gtk::TextIter&, const Gdk::Rectangle&, int, int, const Glib::RefPtr< Gtk::Tooltip >&> | signal_query_tooltip () |
Glib::SignalProxy< void, const Gtk::TextIter&, const Gdk::Rectangle&, GdkEvent*> | signal_activate () |
Glib::SignalProxy< void > | signal_queue_draw () |
Glib::SignalProxy< void, const Gtk::TextIter&, const Gtk::TextIter&, GutterRendererState > | signal_query_data () |
Glib::SignalProxy< bool, const Gtk::TextIter&, const Gdk::Rectangle&, GdkEvent*> | signal_query_activatable () |
![]() | |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
~Object () noexcept override | |
GObject * | gobj () |
const GObject * | gobj () const |
![]() | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) | |
~trackable () | |
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) |
void | remove_destroy_notify_callback (void *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
virtual bool | on_query_tooltip (const Gtk::TextIter& iter, const Gdk::Rectangle& area, int x, int y, const Glib::RefPtr< Gtk::Tooltip >& tooltip) |
This is a default handler for the signal signal_query_tooltip(). More... | |
virtual void | on_activate (const Gtk::TextIter& iter, const Gdk::Rectangle& area, GdkEvent* event) |
This is a default handler for the signal signal_activate(). More... | |
virtual void | on_queue_draw () |
This is a default handler for the signal signal_queue_draw(). More... | |
virtual void | on_query_data (const Gtk::TextIter&start, const Gtk::TextIter&end, GutterRendererState state) |
This is a default handler for the signal signal_query_data(). More... | |
virtual bool | on_query_activatable (const Gtk::TextIter& iter, const Gdk::Rectangle& area, GdkEvent* event) |
This is a default handler for the signal signal_query_activatable(). More... | |
GutterRenderer () | |
virtual void | begin_vfunc (const Cairo::RefPtr< Cairo::Context >& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::TextIter&start, Gtk::TextIter&end) |
virtual void | draw_vfunc (const Cairo::RefPtr< Cairo::Context >& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::TextIter&start, Gtk::TextIter&end, GutterRendererState p6) |
virtual void | end_vfunc () |
virtual void | change_view_vfunc (Gtk::TextView* old_view) |
virtual void | change_buffer_vfunc (const Glib::RefPtr< Gtk::TextBuffer >& old_buffer) |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Gsv::GutterRenderer* | wrap (GtkSourceGutterRenderer* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
|
noexcept |
|
delete |
|
overridenoexcept |
|
protected |
void Gsv::GutterRenderer::begin | ( | const Cairo::RefPtr< Cairo::Context > & | cr, |
const Gdk::Rectangle & | background_area, | ||
const Gdk::Rectangle & | cell_area, | ||
Gtk::TextIter & | start, | ||
Gtk::TextIter & | end | ||
) |
Called when drawing a region begins.
The region to be drawn is indicated by start and end. The purpose is to allow the implementation to precompute some state before the draw method is called for each cell.
cr | A #cairo_t. |
background_area | A Gdk::Rectangle. |
cell_area | A Gdk::Rectangle. |
start | A Gtk::TextIter. |
end | A Gtk::TextIter. |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
void Gsv::GutterRenderer::draw | ( | const Cairo::RefPtr< Cairo::Context > & | cr, |
const Gdk::Rectangle & | background_area, | ||
const Gdk::Rectangle & | cell_area, | ||
Gtk::TextIter & | start, | ||
Gtk::TextIter & | end, | ||
GutterRendererState | p6 | ||
) |
Main renderering method.
Implementations should implement this method to draw onto the cairo context. The background_area indicates the total area of the cell to be drawn. The cell_area indicates the area where content can be drawn (text, images, etc).
The background_area is the cell_area plus the padding on each side (two times the Gtk::SourceGutterRenderer::property_xpad() horizontally and two times the Gtk::SourceGutterRenderer::property_ypad() vertically, so that the cell_area is centered inside background_area).
The p6 argument indicates the current state of the renderer and should be taken into account to properly draw the different possible states (cursor, prelit, selected) if appropriate.
cr | The cairo render context. |
background_area | A Gdk::Rectangle indicating the total area to be drawn. |
cell_area | A Gdk::Rectangle indicating the area to draw content. |
start | A Gtk::TextIter. |
end | A Gtk::TextIter. |
p6 | A Gtk::SourceGutterRendererState. |
|
protectedvirtual |
void Gsv::GutterRenderer::end | ( | ) |
Called when drawing a region of lines has ended.
|
protectedvirtual |
void Gsv::GutterRenderer::get_alignment | ( | float & | xalign, |
float & | yalign | ||
) | const |
Get the x-alignment and y-alignment of the gutter renderer.
xalign | Return location for the x-alignment, or nullptr to ignore. |
yalign | Return location for the y-alignment, or nullptr to ignore. |
GutterRendererAlignmentMode Gsv::GutterRenderer::get_alignment_mode | ( | ) | const |
Get the alignment mode.
The alignment mode describes the manner in which the renderer is aligned (see :xalign and :yalign).
bool Gsv::GutterRenderer::get_background | ( | Gdk::RGBA & | color | ) | const |
Get the background color of the renderer.
color | Return value for a Gdk::RGBA. |
true
if the background color is set, false
otherwise. void Gsv::GutterRenderer::get_padding | ( | int & | xpad, |
int & | ypad | ||
) | const |
Get the x-padding and y-padding of the gutter renderer.
xpad | Return location for the x-padding, or nullptr to ignore. |
ypad | Return location for the y-padding, or nullptr to ignore. |
int Gsv::GutterRenderer::get_size | ( | ) | const |
Get the size of the renderer.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Gtk::TextView* Gsv::GutterRenderer::get_view | ( | ) |
Get the view associated to the gutter renderer.
const Gtk::TextView* Gsv::GutterRenderer::get_view | ( | ) | const |
Get the view associated to the gutter renderer.
bool Gsv::GutterRenderer::get_visible | ( | ) | const |
Get whether the gutter renderer is visible.
true
if the renderer is visible, false
otherwise. Gtk::TextWindowType Gsv::GutterRenderer::get_window_type | ( | ) | const |
Get the Gtk::TextWindowType associated with the gutter renderer.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
bool Gsv::GutterRenderer::is_background_set | ( | ) | const |
|
protectedvirtual |
This is a default handler for the signal signal_activate().
|
protectedvirtual |
This is a default handler for the signal signal_query_activatable().
|
protectedvirtual |
This is a default handler for the signal signal_query_data().
|
protectedvirtual |
This is a default handler for the signal signal_query_tooltip().
|
protectedvirtual |
This is a default handler for the signal signal_queue_draw().
|
noexcept |
|
delete |
Glib::PropertyProxy< GutterRendererAlignmentMode > Gsv::GutterRenderer::property_alignment_mode | ( | ) |
The alignment mode.
Default value: Gtk::SOURCE_GUTTER_RENDERER_ALIGNMENT_MODE_CELL
Glib::PropertyProxy_ReadOnly< GutterRendererAlignmentMode > Gsv::GutterRenderer::property_alignment_mode | ( | ) | const |
The alignment mode.
Default value: Gtk::SOURCE_GUTTER_RENDERER_ALIGNMENT_MODE_CELL
Glib::PropertyProxy< Gdk::RGBA > Gsv::GutterRenderer::property_background_rgba | ( | ) |
The background color.
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > Gsv::GutterRenderer::property_background_rgba | ( | ) | const |
The background color.
Glib::PropertyProxy< bool > Gsv::GutterRenderer::property_background_set | ( | ) |
Whether the background color is set.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::GutterRenderer::property_background_set | ( | ) | const |
Whether the background color is set.
Default value: false
Glib::PropertyProxy< int > Gsv::GutterRenderer::property_size | ( | ) |
The size.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gsv::GutterRenderer::property_size | ( | ) | const |
The size.
Default value: 0
Glib::PropertyProxy_ReadOnly< Gtk::TextView* > Gsv::GutterRenderer::property_view | ( | ) | const |
The view.
Glib::PropertyProxy< bool > Gsv::GutterRenderer::property_visible | ( | ) |
Visible.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gsv::GutterRenderer::property_visible | ( | ) | const |
Visible.
Default value: true
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > Gsv::GutterRenderer::property_window_type | ( | ) | const |
The window type.
Default value: Gtk::TEXT_WINDOW_PRIVATE
Glib::PropertyProxy< float > Gsv::GutterRenderer::property_xalign | ( | ) |
The x-alignment.
Default value: 0
Glib::PropertyProxy_ReadOnly< float > Gsv::GutterRenderer::property_xalign | ( | ) | const |
The x-alignment.
Default value: 0
Glib::PropertyProxy< int > Gsv::GutterRenderer::property_xpad | ( | ) |
The x-padding.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gsv::GutterRenderer::property_xpad | ( | ) | const |
The x-padding.
Default value: 0
Glib::PropertyProxy< float > Gsv::GutterRenderer::property_yalign | ( | ) |
The y-alignment.
Default value: 0
Glib::PropertyProxy_ReadOnly< float > Gsv::GutterRenderer::property_yalign | ( | ) | const |
The y-alignment.
Default value: 0
Glib::PropertyProxy< int > Gsv::GutterRenderer::property_ypad | ( | ) |
The y-padding.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gsv::GutterRenderer::property_ypad | ( | ) | const |
The y-padding.
Default value: 0
void Gsv::GutterRenderer::queue_draw | ( | ) |
Emits the Gtk::SourceGutterRenderer::signal_queue_draw() signal of the renderer.
Call this from an implementation to inform that the renderer has changed such that it needs to redraw.
void Gsv::GutterRenderer::set_alignment | ( | float | xalign, |
float | yalign | ||
) |
Set the alignment of the gutter renderer.
Both xalign and yalign can be -1, which means the values will not be changed (this allows changing only one of the values).
xalign is the horizontal alignment. Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. yalign is the vertical alignment. Set to 0 for a top alignment. 1 for a bottom alignment.
xalign | The x-alignment. |
yalign | The y-alignment. |
void Gsv::GutterRenderer::set_alignment_mode | ( | GutterRendererAlignmentMode | mode | ) |
Set the alignment mode.
The alignment mode describes the manner in which the renderer is aligned (see :xalign and :yalign).
mode | A Gtk::SourceGutterRendererAlignmentMode. |
void Gsv::GutterRenderer::set_background | ( | const Gdk::RGBA & | color | ) |
Set the background color of the renderer.
If color is set to nullptr
, the renderer will not have a background color.
color | A Gdk::RGBA or nullptr . |
void Gsv::GutterRenderer::set_padding | ( | int | xpad, |
int | ypad | ||
) |
Set the padding of the gutter renderer.
Both xpad and ypad can be -1, which means the values will not be changed (this allows changing only one of the values).
xpad is the left and right padding. ypad is the top and bottom padding.
xpad | The x-padding. |
ypad | The y-padding. |
void Gsv::GutterRenderer::set_size | ( | int | size | ) |
Sets the size of the renderer.
A value of -1 specifies that the size is to be determined dynamically.
size | The size. |
void Gsv::GutterRenderer::set_visible | ( | bool | visible | ) |
Set whether the gutter renderer is visible.
visible | The visibility. |
Glib::SignalProxy< void,const Gtk::TextIter&,const Gdk::Rectangle&,GdkEvent* > Gsv::GutterRenderer::signal_activate | ( | ) |
void on_my_activate(const Gtk::TextIter& iter, const Gdk::Rectangle& area, GdkEvent* event)
Flags: Run Last
The signal_activate() signal is emitted when the renderer is activated.
iter | A Gtk::TextIter. |
area | A Gdk::Rectangle. |
event | The event that caused the activation. |
Glib::SignalProxy< bool,const Gtk::TextIter&,const Gdk::Rectangle&,GdkEvent* > Gsv::GutterRenderer::signal_query_activatable | ( | ) |
bool on_my_query_activatable(const Gtk::TextIter& iter, const Gdk::Rectangle& area, GdkEvent* event)
Flags: Run Last
The signal_query_activatable() signal is emitted when the renderer can possibly be activated.
iter | A Gtk::TextIter. |
area | A Gdk::Rectangle. |
event | The Gdk::Event that is causing the activatable query. |
Glib::SignalProxy< void,const Gtk::TextIter&,const Gtk::TextIter&,GutterRendererState > Gsv::GutterRenderer::signal_query_data | ( | ) |
void on_my_query_data(const Gtk::TextIter& start, const Gtk::TextIter& end, GutterRendererState state)
Flags: Run Last
The signal_query_data() signal is emitted when the renderer needs to be filled with data just before a cell is drawn. This can be used by general renderer implementations to allow render data to be filled in externally.
start | A Gtk::TextIter. |
end | A Gtk::TextIter. |
state | The renderer state. |
Glib::SignalProxy< bool,const Gtk::TextIter&,const Gdk::Rectangle&,int,int,const Glib::RefPtr<Gtk::Tooltip>& > Gsv::GutterRenderer::signal_query_tooltip | ( | ) |
bool on_my_query_tooltip(const Gtk::TextIter& iter, const Gdk::Rectangle& area, int x, int y, const Glib::RefPtr<Gtk::Tooltip>& tooltip)
Flags: Run Last
The signal_query_tooltip() signal is emitted when the renderer can show a tooltip.
iter | A Gtk::TextIter. |
area | A Gdk::Rectangle. |
x | The x position (in window coordinates). |
y | The y position (in window coordinates). |
tooltip | A Gtk::Tooltip. |
Glib::SignalProxy< void > Gsv::GutterRenderer::signal_queue_draw | ( | ) |
void on_my_queue_draw()
Flags: Run Last
The signal_queue_draw() signal is emitted when the renderer needs to be redrawn. Use Gtk::SourceGutterRenderer::queue_draw() to emit this signal from an implementation of the Gtk::SourceGutterRenderer interface.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |