use crate::BackgroundPatternType;
use crate::Buffer;
use crate::ChangeCaseType;
use crate::Completion;
use crate::Gutter;
use crate::Hover;
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
use crate::Indenter;
use crate::MarkAttributes;
use crate::SmartHomeEndType;
use crate::SpaceDrawer;
use glib::object::Cast;
use glib::object::IsA;
use glib::object::ObjectExt;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
pub struct View(Object<ffi::GtkSourceView, ffi::GtkSourceViewClass>) @extends gtk::TextView, gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Scrollable;
match fn {
get_type => || ffi::gtk_source_view_get_type(),
}
}
impl View {
#[doc(alias = "gtk_source_view_new")]
pub fn new() -> View {
assert_initialized_main_thread!();
unsafe { gtk::Widget::from_glib_none(ffi::gtk_source_view_new()).unsafe_cast() }
}
#[doc(alias = "gtk_source_view_new_with_buffer")]
pub fn with_buffer<P: IsA<Buffer>>(buffer: &P) -> View {
skip_assert_initialized!();
unsafe {
gtk::Widget::from_glib_none(ffi::gtk_source_view_new_with_buffer(
buffer.as_ref().to_glib_none().0,
))
.unsafe_cast()
}
}
}
impl Default for View {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Default)]
pub struct ViewBuilder {
auto_indent: Option<bool>,
background_pattern: Option<BackgroundPatternType>,
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
enable_snippets: Option<bool>,
highlight_current_line: Option<bool>,
indent_on_tab: Option<bool>,
indent_width: Option<i32>,
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
indenter: Option<Indenter>,
insert_spaces_instead_of_tabs: Option<bool>,
right_margin_position: Option<u32>,
show_line_marks: Option<bool>,
show_line_numbers: Option<bool>,
show_right_margin: Option<bool>,
smart_backspace: Option<bool>,
smart_home_end: Option<SmartHomeEndType>,
tab_width: Option<u32>,
accepts_tab: Option<bool>,
bottom_margin: Option<i32>,
buffer: Option<gtk::TextBuffer>,
cursor_visible: Option<bool>,
editable: Option<bool>,
im_module: Option<String>,
indent: Option<i32>,
left_margin: Option<i32>,
monospace: Option<bool>,
overwrite: Option<bool>,
pixels_above_lines: Option<i32>,
pixels_below_lines: Option<i32>,
pixels_inside_wrap: Option<i32>,
right_margin: Option<i32>,
top_margin: Option<i32>,
wrap_mode: Option<gtk::WrapMode>,
can_focus: Option<bool>,
can_target: Option<bool>,
css_classes: Option<Vec<String>>,
css_name: Option<String>,
focus_on_click: Option<bool>,
focusable: Option<bool>,
has_tooltip: Option<bool>,
height_request: Option<i32>,
hexpand: Option<bool>,
hexpand_set: Option<bool>,
margin_bottom: Option<i32>,
margin_end: Option<i32>,
margin_start: Option<i32>,
margin_top: Option<i32>,
name: Option<String>,
opacity: Option<f64>,
receives_default: Option<bool>,
sensitive: Option<bool>,
tooltip_markup: Option<String>,
tooltip_text: Option<String>,
vexpand: Option<bool>,
vexpand_set: Option<bool>,
visible: Option<bool>,
width_request: Option<i32>,
}
impl ViewBuilder {
pub fn new() -> Self {
Self::default()
}
pub fn build(self) -> View {
let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
if let Some(ref auto_indent) = self.auto_indent {
properties.push(("auto-indent", auto_indent));
}
if let Some(ref background_pattern) = self.background_pattern {
properties.push(("background-pattern", background_pattern));
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
if let Some(ref enable_snippets) = self.enable_snippets {
properties.push(("enable-snippets", enable_snippets));
}
if let Some(ref highlight_current_line) = self.highlight_current_line {
properties.push(("highlight-current-line", highlight_current_line));
}
if let Some(ref indent_on_tab) = self.indent_on_tab {
properties.push(("indent-on-tab", indent_on_tab));
}
if let Some(ref indent_width) = self.indent_width {
properties.push(("indent-width", indent_width));
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
if let Some(ref indenter) = self.indenter {
properties.push(("indenter", indenter));
}
if let Some(ref insert_spaces_instead_of_tabs) = self.insert_spaces_instead_of_tabs {
properties.push((
"insert-spaces-instead-of-tabs",
insert_spaces_instead_of_tabs,
));
}
if let Some(ref right_margin_position) = self.right_margin_position {
properties.push(("right-margin-position", right_margin_position));
}
if let Some(ref show_line_marks) = self.show_line_marks {
properties.push(("show-line-marks", show_line_marks));
}
if let Some(ref show_line_numbers) = self.show_line_numbers {
properties.push(("show-line-numbers", show_line_numbers));
}
if let Some(ref show_right_margin) = self.show_right_margin {
properties.push(("show-right-margin", show_right_margin));
}
if let Some(ref smart_backspace) = self.smart_backspace {
properties.push(("smart-backspace", smart_backspace));
}
if let Some(ref smart_home_end) = self.smart_home_end {
properties.push(("smart-home-end", smart_home_end));
}
if let Some(ref tab_width) = self.tab_width {
properties.push(("tab-width", tab_width));
}
if let Some(ref accepts_tab) = self.accepts_tab {
properties.push(("accepts-tab", accepts_tab));
}
if let Some(ref bottom_margin) = self.bottom_margin {
properties.push(("bottom-margin", bottom_margin));
}
if let Some(ref buffer) = self.buffer {
properties.push(("buffer", buffer));
}
if let Some(ref cursor_visible) = self.cursor_visible {
properties.push(("cursor-visible", cursor_visible));
}
if let Some(ref editable) = self.editable {
properties.push(("editable", editable));
}
if let Some(ref im_module) = self.im_module {
properties.push(("im-module", im_module));
}
if let Some(ref indent) = self.indent {
properties.push(("indent", indent));
}
if let Some(ref left_margin) = self.left_margin {
properties.push(("left-margin", left_margin));
}
if let Some(ref monospace) = self.monospace {
properties.push(("monospace", monospace));
}
if let Some(ref overwrite) = self.overwrite {
properties.push(("overwrite", overwrite));
}
if let Some(ref pixels_above_lines) = self.pixels_above_lines {
properties.push(("pixels-above-lines", pixels_above_lines));
}
if let Some(ref pixels_below_lines) = self.pixels_below_lines {
properties.push(("pixels-below-lines", pixels_below_lines));
}
if let Some(ref pixels_inside_wrap) = self.pixels_inside_wrap {
properties.push(("pixels-inside-wrap", pixels_inside_wrap));
}
if let Some(ref right_margin) = self.right_margin {
properties.push(("right-margin", right_margin));
}
if let Some(ref top_margin) = self.top_margin {
properties.push(("top-margin", top_margin));
}
if let Some(ref wrap_mode) = self.wrap_mode {
properties.push(("wrap-mode", wrap_mode));
}
if let Some(ref can_focus) = self.can_focus {
properties.push(("can-focus", can_focus));
}
if let Some(ref can_target) = self.can_target {
properties.push(("can-target", can_target));
}
if let Some(ref css_classes) = self.css_classes {
properties.push(("css-classes", css_classes));
}
if let Some(ref css_name) = self.css_name {
properties.push(("css-name", css_name));
}
if let Some(ref focus_on_click) = self.focus_on_click {
properties.push(("focus-on-click", focus_on_click));
}
if let Some(ref focusable) = self.focusable {
properties.push(("focusable", focusable));
}
if let Some(ref has_tooltip) = self.has_tooltip {
properties.push(("has-tooltip", has_tooltip));
}
if let Some(ref height_request) = self.height_request {
properties.push(("height-request", height_request));
}
if let Some(ref hexpand) = self.hexpand {
properties.push(("hexpand", hexpand));
}
if let Some(ref hexpand_set) = self.hexpand_set {
properties.push(("hexpand-set", hexpand_set));
}
if let Some(ref margin_bottom) = self.margin_bottom {
properties.push(("margin-bottom", margin_bottom));
}
if let Some(ref margin_end) = self.margin_end {
properties.push(("margin-end", margin_end));
}
if let Some(ref margin_start) = self.margin_start {
properties.push(("margin-start", margin_start));
}
if let Some(ref margin_top) = self.margin_top {
properties.push(("margin-top", margin_top));
}
if let Some(ref name) = self.name {
properties.push(("name", name));
}
if let Some(ref opacity) = self.opacity {
properties.push(("opacity", opacity));
}
if let Some(ref receives_default) = self.receives_default {
properties.push(("receives-default", receives_default));
}
if let Some(ref sensitive) = self.sensitive {
properties.push(("sensitive", sensitive));
}
if let Some(ref tooltip_markup) = self.tooltip_markup {
properties.push(("tooltip-markup", tooltip_markup));
}
if let Some(ref tooltip_text) = self.tooltip_text {
properties.push(("tooltip-text", tooltip_text));
}
if let Some(ref vexpand) = self.vexpand {
properties.push(("vexpand", vexpand));
}
if let Some(ref vexpand_set) = self.vexpand_set {
properties.push(("vexpand-set", vexpand_set));
}
if let Some(ref visible) = self.visible {
properties.push(("visible", visible));
}
if let Some(ref width_request) = self.width_request {
properties.push(("width-request", width_request));
}
let ret = glib::Object::new::<View>(&properties).expect("object new");
ret
}
pub fn auto_indent(mut self, auto_indent: bool) -> Self {
self.auto_indent = Some(auto_indent);
self
}
pub fn background_pattern(mut self, background_pattern: BackgroundPatternType) -> Self {
self.background_pattern = Some(background_pattern);
self
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
pub fn enable_snippets(mut self, enable_snippets: bool) -> Self {
self.enable_snippets = Some(enable_snippets);
self
}
pub fn highlight_current_line(mut self, highlight_current_line: bool) -> Self {
self.highlight_current_line = Some(highlight_current_line);
self
}
pub fn indent_on_tab(mut self, indent_on_tab: bool) -> Self {
self.indent_on_tab = Some(indent_on_tab);
self
}
pub fn indent_width(mut self, indent_width: i32) -> Self {
self.indent_width = Some(indent_width);
self
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
pub fn indenter<P: IsA<Indenter>>(mut self, indenter: &P) -> Self {
self.indenter = Some(indenter.clone().upcast());
self
}
pub fn insert_spaces_instead_of_tabs(mut self, insert_spaces_instead_of_tabs: bool) -> Self {
self.insert_spaces_instead_of_tabs = Some(insert_spaces_instead_of_tabs);
self
}
pub fn right_margin_position(mut self, right_margin_position: u32) -> Self {
self.right_margin_position = Some(right_margin_position);
self
}
pub fn show_line_marks(mut self, show_line_marks: bool) -> Self {
self.show_line_marks = Some(show_line_marks);
self
}
pub fn show_line_numbers(mut self, show_line_numbers: bool) -> Self {
self.show_line_numbers = Some(show_line_numbers);
self
}
pub fn show_right_margin(mut self, show_right_margin: bool) -> Self {
self.show_right_margin = Some(show_right_margin);
self
}
pub fn smart_backspace(mut self, smart_backspace: bool) -> Self {
self.smart_backspace = Some(smart_backspace);
self
}
pub fn smart_home_end(mut self, smart_home_end: SmartHomeEndType) -> Self {
self.smart_home_end = Some(smart_home_end);
self
}
pub fn tab_width(mut self, tab_width: u32) -> Self {
self.tab_width = Some(tab_width);
self
}
pub fn accepts_tab(mut self, accepts_tab: bool) -> Self {
self.accepts_tab = Some(accepts_tab);
self
}
pub fn bottom_margin(mut self, bottom_margin: i32) -> Self {
self.bottom_margin = Some(bottom_margin);
self
}
pub fn buffer<P: IsA<gtk::TextBuffer>>(mut self, buffer: &P) -> Self {
self.buffer = Some(buffer.clone().upcast());
self
}
pub fn cursor_visible(mut self, cursor_visible: bool) -> Self {
self.cursor_visible = Some(cursor_visible);
self
}
pub fn editable(mut self, editable: bool) -> Self {
self.editable = Some(editable);
self
}
pub fn im_module(mut self, im_module: &str) -> Self {
self.im_module = Some(im_module.to_string());
self
}
pub fn indent(mut self, indent: i32) -> Self {
self.indent = Some(indent);
self
}
pub fn left_margin(mut self, left_margin: i32) -> Self {
self.left_margin = Some(left_margin);
self
}
pub fn monospace(mut self, monospace: bool) -> Self {
self.monospace = Some(monospace);
self
}
pub fn overwrite(mut self, overwrite: bool) -> Self {
self.overwrite = Some(overwrite);
self
}
pub fn pixels_above_lines(mut self, pixels_above_lines: i32) -> Self {
self.pixels_above_lines = Some(pixels_above_lines);
self
}
pub fn pixels_below_lines(mut self, pixels_below_lines: i32) -> Self {
self.pixels_below_lines = Some(pixels_below_lines);
self
}
pub fn pixels_inside_wrap(mut self, pixels_inside_wrap: i32) -> Self {
self.pixels_inside_wrap = Some(pixels_inside_wrap);
self
}
pub fn right_margin(mut self, right_margin: i32) -> Self {
self.right_margin = Some(right_margin);
self
}
pub fn top_margin(mut self, top_margin: i32) -> Self {
self.top_margin = Some(top_margin);
self
}
pub fn wrap_mode(mut self, wrap_mode: gtk::WrapMode) -> Self {
self.wrap_mode = Some(wrap_mode);
self
}
pub fn can_focus(mut self, can_focus: bool) -> Self {
self.can_focus = Some(can_focus);
self
}
pub fn can_target(mut self, can_target: bool) -> Self {
self.can_target = Some(can_target);
self
}
pub fn css_classes(mut self, css_classes: Vec<String>) -> Self {
self.css_classes = Some(css_classes);
self
}
pub fn css_name(mut self, css_name: &str) -> Self {
self.css_name = Some(css_name.to_string());
self
}
pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
self.focus_on_click = Some(focus_on_click);
self
}
pub fn focusable(mut self, focusable: bool) -> Self {
self.focusable = Some(focusable);
self
}
pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
self.has_tooltip = Some(has_tooltip);
self
}
pub fn height_request(mut self, height_request: i32) -> Self {
self.height_request = Some(height_request);
self
}
pub fn hexpand(mut self, hexpand: bool) -> Self {
self.hexpand = Some(hexpand);
self
}
pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
self.hexpand_set = Some(hexpand_set);
self
}
pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
self.margin_bottom = Some(margin_bottom);
self
}
pub fn margin_end(mut self, margin_end: i32) -> Self {
self.margin_end = Some(margin_end);
self
}
pub fn margin_start(mut self, margin_start: i32) -> Self {
self.margin_start = Some(margin_start);
self
}
pub fn margin_top(mut self, margin_top: i32) -> Self {
self.margin_top = Some(margin_top);
self
}
pub fn name(mut self, name: &str) -> Self {
self.name = Some(name.to_string());
self
}
pub fn opacity(mut self, opacity: f64) -> Self {
self.opacity = Some(opacity);
self
}
pub fn receives_default(mut self, receives_default: bool) -> Self {
self.receives_default = Some(receives_default);
self
}
pub fn sensitive(mut self, sensitive: bool) -> Self {
self.sensitive = Some(sensitive);
self
}
pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
self.tooltip_markup = Some(tooltip_markup.to_string());
self
}
pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
self.tooltip_text = Some(tooltip_text.to_string());
self
}
pub fn vexpand(mut self, vexpand: bool) -> Self {
self.vexpand = Some(vexpand);
self
}
pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
self.vexpand_set = Some(vexpand_set);
self
}
pub fn visible(mut self, visible: bool) -> Self {
self.visible = Some(visible);
self
}
pub fn width_request(mut self, width_request: i32) -> Self {
self.width_request = Some(width_request);
self
}
}
pub const NONE_VIEW: Option<&View> = None;
pub trait ViewExt: 'static {
#[doc(alias = "gtk_source_view_get_auto_indent")]
fn get_auto_indent(&self) -> bool;
#[doc(alias = "gtk_source_view_get_background_pattern")]
fn get_background_pattern(&self) -> BackgroundPatternType;
#[doc(alias = "gtk_source_view_get_completion")]
fn get_completion(&self) -> Option<Completion>;
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
#[doc(alias = "gtk_source_view_get_enable_snippets")]
fn get_enable_snippets(&self) -> bool;
#[doc(alias = "gtk_source_view_get_gutter")]
fn get_gutter(&self, window_type: gtk::TextWindowType) -> Option<Gutter>;
#[doc(alias = "gtk_source_view_get_highlight_current_line")]
fn get_highlight_current_line(&self) -> bool;
#[doc(alias = "gtk_source_view_get_hover")]
fn get_hover(&self) -> Option<Hover>;
#[doc(alias = "gtk_source_view_get_indent_on_tab")]
fn get_indent_on_tab(&self) -> bool;
#[doc(alias = "gtk_source_view_get_indent_width")]
fn get_indent_width(&self) -> i32;
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
#[doc(alias = "gtk_source_view_get_indenter")]
fn get_indenter(&self) -> Option<Indenter>;
#[doc(alias = "gtk_source_view_get_insert_spaces_instead_of_tabs")]
fn get_insert_spaces_instead_of_tabs(&self) -> bool;
#[doc(alias = "gtk_source_view_get_right_margin_position")]
fn get_right_margin_position(&self) -> u32;
#[doc(alias = "gtk_source_view_get_show_line_marks")]
fn get_show_line_marks(&self) -> bool;
#[doc(alias = "gtk_source_view_get_show_line_numbers")]
fn get_show_line_numbers(&self) -> bool;
#[doc(alias = "gtk_source_view_get_show_right_margin")]
fn get_show_right_margin(&self) -> bool;
#[doc(alias = "gtk_source_view_get_smart_backspace")]
fn get_smart_backspace(&self) -> bool;
#[doc(alias = "gtk_source_view_get_smart_home_end")]
fn get_smart_home_end(&self) -> SmartHomeEndType;
#[doc(alias = "gtk_source_view_get_space_drawer")]
fn get_space_drawer(&self) -> Option<SpaceDrawer>;
#[doc(alias = "gtk_source_view_get_tab_width")]
fn get_tab_width(&self) -> u32;
#[doc(alias = "gtk_source_view_get_visual_column")]
fn get_visual_column(&self, iter: >k::TextIter) -> u32;
#[doc(alias = "gtk_source_view_indent_lines")]
fn indent_lines(&self, start: &mut gtk::TextIter, end: &mut gtk::TextIter);
#[doc(alias = "gtk_source_view_set_auto_indent")]
fn set_auto_indent(&self, enable: bool);
#[doc(alias = "gtk_source_view_set_background_pattern")]
fn set_background_pattern(&self, background_pattern: BackgroundPatternType);
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
#[doc(alias = "gtk_source_view_set_enable_snippets")]
fn set_enable_snippets(&self, enable_snippets: bool);
#[doc(alias = "gtk_source_view_set_highlight_current_line")]
fn set_highlight_current_line(&self, highlight: bool);
#[doc(alias = "gtk_source_view_set_indent_on_tab")]
fn set_indent_on_tab(&self, enable: bool);
#[doc(alias = "gtk_source_view_set_indent_width")]
fn set_indent_width(&self, width: i32);
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
#[doc(alias = "gtk_source_view_set_indenter")]
fn set_indenter<P: IsA<Indenter>>(&self, indenter: Option<&P>);
#[doc(alias = "gtk_source_view_set_insert_spaces_instead_of_tabs")]
fn set_insert_spaces_instead_of_tabs(&self, enable: bool);
#[doc(alias = "gtk_source_view_set_mark_attributes")]
fn set_mark_attributes(&self, category: &str, attributes: &MarkAttributes, priority: i32);
#[doc(alias = "gtk_source_view_set_right_margin_position")]
fn set_right_margin_position(&self, pos: u32);
#[doc(alias = "gtk_source_view_set_show_line_marks")]
fn set_show_line_marks(&self, show: bool);
#[doc(alias = "gtk_source_view_set_show_line_numbers")]
fn set_show_line_numbers(&self, show: bool);
#[doc(alias = "gtk_source_view_set_show_right_margin")]
fn set_show_right_margin(&self, show: bool);
#[doc(alias = "gtk_source_view_set_smart_backspace")]
fn set_smart_backspace(&self, smart_backspace: bool);
#[doc(alias = "gtk_source_view_set_smart_home_end")]
fn set_smart_home_end(&self, smart_home_end: SmartHomeEndType);
#[doc(alias = "gtk_source_view_set_tab_width")]
fn set_tab_width(&self, width: u32);
#[doc(alias = "gtk_source_view_unindent_lines")]
fn unindent_lines(&self, start: &mut gtk::TextIter, end: &mut gtk::TextIter);
fn connect_change_case<F: Fn(&Self, ChangeCaseType) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_change_case(&self, case_type: ChangeCaseType);
fn connect_change_number<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_change_number(&self, count: i32);
fn connect_join_lines<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_join_lines(&self);
fn connect_line_mark_activated<
F: Fn(&Self, >k::TextIter, u32, gdk::ModifierType, i32) + 'static,
>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_move_lines<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_move_lines(&self, down: bool);
fn connect_move_to_matching_bracket<F: Fn(&Self, bool) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn emit_move_to_matching_bracket(&self, extend_selection: bool);
fn connect_move_words<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_move_words(&self, count: i32);
fn connect_show_completion<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_show_completion(&self);
fn connect_smart_home_end<F: Fn(&Self, >k::TextIter, i32) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_auto_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_background_pattern_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_completion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn connect_property_enable_snippets_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_highlight_current_line_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_indent_on_tab_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_indent_width_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn connect_property_indenter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_insert_spaces_instead_of_tabs_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_right_margin_position_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_show_line_marks_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_show_line_numbers_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_show_right_margin_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_smart_backspace_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_smart_home_end_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_space_drawer_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
fn connect_property_tab_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<View>> ViewExt for O {
fn get_auto_indent(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_auto_indent(
self.as_ref().to_glib_none().0,
))
}
}
fn get_background_pattern(&self) -> BackgroundPatternType {
unsafe {
from_glib(ffi::gtk_source_view_get_background_pattern(
self.as_ref().to_glib_none().0,
))
}
}
fn get_completion(&self) -> Option<Completion> {
unsafe {
from_glib_none(ffi::gtk_source_view_get_completion(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn get_enable_snippets(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_enable_snippets(
self.as_ref().to_glib_none().0,
))
}
}
fn get_gutter(&self, window_type: gtk::TextWindowType) -> Option<Gutter> {
unsafe {
from_glib_none(ffi::gtk_source_view_get_gutter(
self.as_ref().to_glib_none().0,
window_type.to_glib(),
))
}
}
fn get_highlight_current_line(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_highlight_current_line(
self.as_ref().to_glib_none().0,
))
}
}
fn get_hover(&self) -> Option<Hover> {
unsafe {
from_glib_none(ffi::gtk_source_view_get_hover(
self.as_ref().to_glib_none().0,
))
}
}
fn get_indent_on_tab(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_indent_on_tab(
self.as_ref().to_glib_none().0,
))
}
}
fn get_indent_width(&self) -> i32 {
unsafe { ffi::gtk_source_view_get_indent_width(self.as_ref().to_glib_none().0) }
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn get_indenter(&self) -> Option<Indenter> {
unsafe {
from_glib_none(ffi::gtk_source_view_get_indenter(
self.as_ref().to_glib_none().0,
))
}
}
fn get_insert_spaces_instead_of_tabs(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_insert_spaces_instead_of_tabs(
self.as_ref().to_glib_none().0,
))
}
}
fn get_right_margin_position(&self) -> u32 {
unsafe { ffi::gtk_source_view_get_right_margin_position(self.as_ref().to_glib_none().0) }
}
fn get_show_line_marks(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_show_line_marks(
self.as_ref().to_glib_none().0,
))
}
}
fn get_show_line_numbers(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_show_line_numbers(
self.as_ref().to_glib_none().0,
))
}
}
fn get_show_right_margin(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_show_right_margin(
self.as_ref().to_glib_none().0,
))
}
}
fn get_smart_backspace(&self) -> bool {
unsafe {
from_glib(ffi::gtk_source_view_get_smart_backspace(
self.as_ref().to_glib_none().0,
))
}
}
fn get_smart_home_end(&self) -> SmartHomeEndType {
unsafe {
from_glib(ffi::gtk_source_view_get_smart_home_end(
self.as_ref().to_glib_none().0,
))
}
}
fn get_space_drawer(&self) -> Option<SpaceDrawer> {
unsafe {
from_glib_none(ffi::gtk_source_view_get_space_drawer(
self.as_ref().to_glib_none().0,
))
}
}
fn get_tab_width(&self) -> u32 {
unsafe { ffi::gtk_source_view_get_tab_width(self.as_ref().to_glib_none().0) }
}
fn get_visual_column(&self, iter: >k::TextIter) -> u32 {
unsafe {
ffi::gtk_source_view_get_visual_column(
self.as_ref().to_glib_none().0,
iter.to_glib_none().0,
)
}
}
fn indent_lines(&self, start: &mut gtk::TextIter, end: &mut gtk::TextIter) {
unsafe {
ffi::gtk_source_view_indent_lines(
self.as_ref().to_glib_none().0,
start.to_glib_none_mut().0,
end.to_glib_none_mut().0,
);
}
}
fn set_auto_indent(&self, enable: bool) {
unsafe {
ffi::gtk_source_view_set_auto_indent(self.as_ref().to_glib_none().0, enable.to_glib());
}
}
fn set_background_pattern(&self, background_pattern: BackgroundPatternType) {
unsafe {
ffi::gtk_source_view_set_background_pattern(
self.as_ref().to_glib_none().0,
background_pattern.to_glib(),
);
}
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn set_enable_snippets(&self, enable_snippets: bool) {
unsafe {
ffi::gtk_source_view_set_enable_snippets(
self.as_ref().to_glib_none().0,
enable_snippets.to_glib(),
);
}
}
fn set_highlight_current_line(&self, highlight: bool) {
unsafe {
ffi::gtk_source_view_set_highlight_current_line(
self.as_ref().to_glib_none().0,
highlight.to_glib(),
);
}
}
fn set_indent_on_tab(&self, enable: bool) {
unsafe {
ffi::gtk_source_view_set_indent_on_tab(
self.as_ref().to_glib_none().0,
enable.to_glib(),
);
}
}
fn set_indent_width(&self, width: i32) {
unsafe {
ffi::gtk_source_view_set_indent_width(self.as_ref().to_glib_none().0, width);
}
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn set_indenter<P: IsA<Indenter>>(&self, indenter: Option<&P>) {
unsafe {
ffi::gtk_source_view_set_indenter(
self.as_ref().to_glib_none().0,
indenter.map(|p| p.as_ref()).to_glib_none().0,
);
}
}
fn set_insert_spaces_instead_of_tabs(&self, enable: bool) {
unsafe {
ffi::gtk_source_view_set_insert_spaces_instead_of_tabs(
self.as_ref().to_glib_none().0,
enable.to_glib(),
);
}
}
fn set_mark_attributes(&self, category: &str, attributes: &MarkAttributes, priority: i32) {
unsafe {
ffi::gtk_source_view_set_mark_attributes(
self.as_ref().to_glib_none().0,
category.to_glib_none().0,
attributes.to_glib_none().0,
priority,
);
}
}
fn set_right_margin_position(&self, pos: u32) {
unsafe {
ffi::gtk_source_view_set_right_margin_position(self.as_ref().to_glib_none().0, pos);
}
}
fn set_show_line_marks(&self, show: bool) {
unsafe {
ffi::gtk_source_view_set_show_line_marks(
self.as_ref().to_glib_none().0,
show.to_glib(),
);
}
}
fn set_show_line_numbers(&self, show: bool) {
unsafe {
ffi::gtk_source_view_set_show_line_numbers(
self.as_ref().to_glib_none().0,
show.to_glib(),
);
}
}
fn set_show_right_margin(&self, show: bool) {
unsafe {
ffi::gtk_source_view_set_show_right_margin(
self.as_ref().to_glib_none().0,
show.to_glib(),
);
}
}
fn set_smart_backspace(&self, smart_backspace: bool) {
unsafe {
ffi::gtk_source_view_set_smart_backspace(
self.as_ref().to_glib_none().0,
smart_backspace.to_glib(),
);
}
}
fn set_smart_home_end(&self, smart_home_end: SmartHomeEndType) {
unsafe {
ffi::gtk_source_view_set_smart_home_end(
self.as_ref().to_glib_none().0,
smart_home_end.to_glib(),
);
}
}
fn set_tab_width(&self, width: u32) {
unsafe {
ffi::gtk_source_view_set_tab_width(self.as_ref().to_glib_none().0, width);
}
}
fn unindent_lines(&self, start: &mut gtk::TextIter, end: &mut gtk::TextIter) {
unsafe {
ffi::gtk_source_view_unindent_lines(
self.as_ref().to_glib_none().0,
start.to_glib_none_mut().0,
end.to_glib_none_mut().0,
);
}
}
fn connect_change_case<F: Fn(&Self, ChangeCaseType) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn change_case_trampoline<P, F: Fn(&P, ChangeCaseType) + 'static>(
this: *mut ffi::GtkSourceView,
case_type: ffi::GtkSourceChangeCaseType,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(
&View::from_glib_borrow(this).unsafe_cast_ref(),
from_glib(case_type),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"change-case\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
change_case_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_change_case(&self, case_type: ChangeCaseType) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("change-case", &[&case_type])
.unwrap()
};
}
fn connect_change_number<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn change_number_trampoline<P, F: Fn(&P, i32) + 'static>(
this: *mut ffi::GtkSourceView,
count: libc::c_int,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref(), count)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"change-number\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
change_number_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_change_number(&self, count: i32) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("change-number", &[&count])
.unwrap()
};
}
fn connect_join_lines<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn join_lines_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"join-lines\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
join_lines_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_join_lines(&self) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("join-lines", &[])
.unwrap()
};
}
fn connect_line_mark_activated<
F: Fn(&Self, >k::TextIter, u32, gdk::ModifierType, i32) + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn line_mark_activated_trampoline<
P,
F: Fn(&P, >k::TextIter, u32, gdk::ModifierType, i32) + 'static,
>(
this: *mut ffi::GtkSourceView,
iter: *mut gtk::ffi::GtkTextIter,
button: libc::c_uint,
state: gdk::ffi::GdkModifierType,
n_presses: libc::c_int,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(
&View::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(iter),
button,
from_glib(state),
n_presses,
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"line-mark-activated\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
line_mark_activated_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_move_lines<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn move_lines_trampoline<P, F: Fn(&P, bool) + 'static>(
this: *mut ffi::GtkSourceView,
down: glib::ffi::gboolean,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(
&View::from_glib_borrow(this).unsafe_cast_ref(),
from_glib(down),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"move-lines\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
move_lines_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_move_lines(&self, down: bool) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("move-lines", &[&down])
.unwrap()
};
}
fn connect_move_to_matching_bracket<F: Fn(&Self, bool) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn move_to_matching_bracket_trampoline<P, F: Fn(&P, bool) + 'static>(
this: *mut ffi::GtkSourceView,
extend_selection: glib::ffi::gboolean,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(
&View::from_glib_borrow(this).unsafe_cast_ref(),
from_glib(extend_selection),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"move-to-matching-bracket\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
move_to_matching_bracket_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_move_to_matching_bracket(&self, extend_selection: bool) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("move-to-matching-bracket", &[&extend_selection])
.unwrap()
};
}
fn connect_move_words<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn move_words_trampoline<P, F: Fn(&P, i32) + 'static>(
this: *mut ffi::GtkSourceView,
count: libc::c_int,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref(), count)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"move-words\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
move_words_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_move_words(&self, count: i32) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("move-words", &[&count])
.unwrap()
};
}
fn connect_show_completion<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn show_completion_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"show-completion\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
show_completion_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn emit_show_completion(&self) {
let _ = unsafe {
glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
.emit_by_name("show-completion", &[])
.unwrap()
};
}
fn connect_smart_home_end<F: Fn(&Self, >k::TextIter, i32) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn smart_home_end_trampoline<
P,
F: Fn(&P, >k::TextIter, i32) + 'static,
>(
this: *mut ffi::GtkSourceView,
iter: *mut gtk::ffi::GtkTextIter,
count: libc::c_int,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(
&View::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(iter),
count,
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"smart-home-end\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
smart_home_end_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_auto_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_auto_indent_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::auto-indent\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_auto_indent_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_background_pattern_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_background_pattern_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::background-pattern\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_background_pattern_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_completion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_completion_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::completion\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_completion_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn connect_property_enable_snippets_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_snippets_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::enable-snippets\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_enable_snippets_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_highlight_current_line_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_highlight_current_line_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::highlight-current-line\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_highlight_current_line_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_indent_on_tab_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_indent_on_tab_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::indent-on-tab\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_indent_on_tab_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_indent_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_indent_width_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::indent-width\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_indent_width_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v5_0", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_0")))]
fn connect_property_indenter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_indenter_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::indenter\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_indenter_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_insert_spaces_instead_of_tabs_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_insert_spaces_instead_of_tabs_trampoline<
P,
F: Fn(&P) + 'static,
>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::insert-spaces-instead-of-tabs\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_insert_spaces_instead_of_tabs_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_right_margin_position_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_right_margin_position_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::right-margin-position\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_right_margin_position_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_show_line_marks_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_show_line_marks_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::show-line-marks\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_show_line_marks_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_show_line_numbers_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_show_line_numbers_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::show-line-numbers\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_show_line_numbers_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_show_right_margin_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_show_right_margin_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::show-right-margin\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_show_right_margin_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_smart_backspace_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_smart_backspace_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::smart-backspace\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_smart_backspace_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_smart_home_end_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_smart_home_end_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::smart-home-end\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_smart_home_end_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_space_drawer_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_space_drawer_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::space-drawer\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_space_drawer_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_property_tab_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tab_width_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::GtkSourceView,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<View>,
{
let f: &F = &*(f as *const F);
f(&View::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::tab-width\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_tab_width_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl fmt::Display for View {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("View")
}
}