mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add trait for TextRun methods.
This commit is contained in:
parent
8b80e15fd0
commit
4aa9bbd2ab
1 changed files with 9 additions and 1 deletions
|
@ -18,7 +18,15 @@ pub struct TextRun {
|
|||
priv glyphs: GlyphStore,
|
||||
}
|
||||
|
||||
impl TextRun {
|
||||
trait TextRunMethods {
|
||||
pure fn glyphs(&self) -> &self/GlyphStore;
|
||||
pure fn iter_indivisible_pieces_for_range(&self, offset: uint, length: uint, f: fn(uint, uint) -> bool);
|
||||
|
||||
fn min_width_for_range(&LayoutContext, offset: uint, length: uint) -> au;
|
||||
fn iter_natural_lines_for_range(&self, offset: uint, length: uint, f: fn(uint, uint) -> bool);
|
||||
}
|
||||
|
||||
impl TextRun : TextRunMethods {
|
||||
pure fn glyphs(&self) -> &self/GlyphStore { &self.glyphs }
|
||||
|
||||
fn min_width_for_range(ctx: &LayoutContext, offset: uint, length: uint) -> au {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue