本文整理汇总了C#中Gtk.ForwardToTagToggle方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ForwardToTagToggle方法的具体用法?C# Gtk.ForwardToTagToggle怎么用?C# Gtk.ForwardToTagToggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.ForwardToTagToggle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBlockExtents
public static void GetBlockExtents (ref Gtk.TextIter start,
ref Gtk.TextIter end,
int threshold,
Gtk.TextTag avoid_tag)
{
// Move start and end to the beginning or end of their
// respective paragraphs, bounded by some threshold.
start.LineOffset = Math.Max (0, start.LineOffset - threshold);
// FIXME: Sometimes I need to access this before it
// returns real values.
int bug = end.CharsInLine;
if (end.CharsInLine - end.LineOffset > threshold + 1 /* newline */)
end.LineOffset += threshold;
else
end.ForwardToLineEnd ();
if (avoid_tag != null) {
if (start.HasTag (avoid_tag))
start.BackwardToTagToggle (avoid_tag);
if (end.HasTag (avoid_tag))
end.ForwardToTagToggle (avoid_tag);
}
}
示例2: GetExtents
public void GetExtents (Gtk.TextIter iter,
out Gtk.TextIter start,
out Gtk.TextIter end)
{
start = iter;
if (!start.BeginsTag (this))
start.BackwardToTagToggle (this);
end = iter;
end.ForwardToTagToggle (this);
}
示例3: GetParagraphAttributes
private IEnumerable<Pango.Attribute> GetParagraphAttributes (
Pango.Layout layout, double dpiX, out int indentation,
ref Gtk.TextIter position, Gtk.TextIter limit)
{
IList<Pango.Attribute> attributes = new List<Pango.Attribute> ();
indentation = 0;
Gtk.TextTag [] tags = position.Tags;
position.ForwardToTagToggle (null);
if (position.Compare (limit) > 0) position = limit;
double screen_dpiX = Note.Window.Screen.WidthMm * 254d / Note.Window.Screen.Width;
foreach (Gtk.TextTag tag in tags) {
if (tag.BackgroundSet) {
Gdk.Color color = tag.BackgroundGdk;
attributes.Add (new Pango.AttrBackground (
color.Red, color.Green, color.Blue));
}
if (tag.ForegroundSet) {
Gdk.Color color = tag.ForegroundGdk;
attributes.Add (new Pango.AttrForeground (
color.Red, color.Green, color.Blue));
}
if (tag.IndentSet) {
layout.Indent = tag.Indent;
}
if (tag.LeftMarginSet) {
indentation = (int) (tag.LeftMargin / screen_dpiX * dpiX);
}
if (tag.RightMarginSet) {
indentation = (int) (tag.RightMargin / screen_dpiX * dpiX);
}
if (tag.FontDesc != null) {
attributes.Add (new Pango.AttrFontDesc (tag.FontDesc));
}
if (tag.FamilySet) {
attributes.Add (new Pango.AttrFamily (tag.Family));
}
if (tag.SizeSet) {
attributes.Add (new Pango.AttrSize (tag.Size));
}
if (tag.StyleSet) {
attributes.Add (new Pango.AttrStyle (tag.Style));
}
if (tag.UnderlineSet && tag.Underline != Pango.Underline.Error) {
attributes.Add (new Pango.AttrUnderline (tag.Underline));
}
if (tag.WeightSet) {
attributes.Add (new Pango.AttrWeight (tag.Weight));
}
if (tag.StrikethroughSet) {
attributes.Add (new Pango.AttrStrikethrough (tag.Strikethrough));
}
if (tag.RiseSet) {
attributes.Add (new Pango.AttrRise (tag.Rise));
}
if (tag.ScaleSet) {
attributes.Add (new Pango.AttrScale (tag.Scale));
}
if (tag.StretchSet) {
attributes.Add (new Pango.AttrStretch (tag.Stretch));
}
}
return attributes;
}