File tree Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,9 @@ status = "generate"
383383 [[object .function ]]
384384 name = " x_to_index"
385385 manual = true
386+ [[object .function ]]
387+ name = " get_x_ranges"
388+ manual = true
386389
387390[[object ]]
388391name = " Pango.Matrix"
Original file line number Diff line number Diff line change @@ -90,23 +90,6 @@ impl LayoutLine {
9090 unsafe { ffi:: pango_layout_line_get_start_index ( self . to_glib_none ( ) . 0 ) }
9191 }
9292
93- #[ doc( alias = "pango_layout_line_get_x_ranges" ) ]
94- #[ doc( alias = "get_x_ranges" ) ]
95- pub fn x_ranges ( & self , start_index : i32 , end_index : i32 ) -> Vec < i32 > {
96- unsafe {
97- let mut ranges = std:: ptr:: null_mut ( ) ;
98- let mut n_ranges = std:: mem:: MaybeUninit :: uninit ( ) ;
99- ffi:: pango_layout_line_get_x_ranges (
100- self . to_glib_none ( ) . 0 ,
101- start_index,
102- end_index,
103- & mut ranges,
104- n_ranges. as_mut_ptr ( ) ,
105- ) ;
106- FromGlibContainer :: from_glib_full_num ( ranges, n_ranges. assume_init ( ) as _ )
107- }
108- }
109-
11093 #[ doc( alias = "pango_layout_line_index_to_x" ) ]
11194 pub fn index_to_x ( & self , index_ : i32 , trailing : bool ) -> i32 {
11295 unsafe {
Original file line number Diff line number Diff line change @@ -90,4 +90,21 @@ impl LayoutLine {
9090 is_inside,
9191 }
9292 }
93+
94+ #[ doc( alias = "pango_layout_line_get_x_ranges" ) ]
95+ #[ doc( alias = "get_x_ranges" ) ]
96+ pub fn x_ranges ( & self , start_index : i32 , end_index : i32 ) -> Vec < i32 > {
97+ unsafe {
98+ let mut ranges = std:: ptr:: null_mut ( ) ;
99+ let mut n_ranges = std:: mem:: MaybeUninit :: uninit ( ) ;
100+ ffi:: pango_layout_line_get_x_ranges (
101+ self . to_glib_none ( ) . 0 ,
102+ start_index,
103+ end_index,
104+ & mut ranges,
105+ n_ranges. as_mut_ptr ( ) ,
106+ ) ;
107+ FromGlibContainer :: from_glib_full_num ( ranges, 2 * n_ranges. assume_init ( ) as usize )
108+ }
109+ }
93110}
You can’t perform that action at this time.
0 commit comments