wayland: implement scaling
This involves many subsystems:
- config:
- allow setting the connector scale
- allow setting the cursor size
- cursors:
- load server cursors for all requested sizes and scales
- wl_surface:
- track the output the surface belongs to
- send wl_surface.enter/leave
- wl_output:
- implement wl_output.scale
- text:
- pre-render texts for all used scales
- renderer:
- properly align scale textures and rectangles
- wp_fractional_scale:
- new interface for fractional scaling
This commit is contained in:
parent
16aec8f87e
commit
e52a60b3b6
41 changed files with 1417 additions and 364 deletions
12
src/pango.rs
12
src/pango.rs
|
|
@ -63,6 +63,8 @@ extern "C" {
|
|||
|
||||
fn pango_font_description_from_string(str: *const c::c_char) -> *mut PangoFontDescription_;
|
||||
fn pango_font_description_free(desc: *mut PangoFontDescription_);
|
||||
fn pango_font_description_get_size(desc: *mut PangoFontDescription_) -> c::c_int;
|
||||
fn pango_font_description_set_size(desc: *mut PangoFontDescription_, size: c::c_int);
|
||||
|
||||
fn pango_layout_new(context: *mut PangoContext_) -> *mut PangoLayout_;
|
||||
fn pango_layout_set_width(layout: *mut PangoLayout_, width: c::c_int);
|
||||
|
|
@ -256,6 +258,16 @@ impl PangoFontDescription {
|
|||
s: unsafe { pango_font_description_from_string(s.as_ptr()) },
|
||||
}
|
||||
}
|
||||
|
||||
pub fn size(&self) -> i32 {
|
||||
unsafe { pango_font_description_get_size(self.s) as _ }
|
||||
}
|
||||
|
||||
pub fn set_size(&mut self, size: i32) {
|
||||
unsafe {
|
||||
pango_font_description_set_size(self.s, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for PangoFontDescription {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue