Struct gtk4::CssSection
source · #[repr(transparent)]pub struct CssSection { /* private fields */ }Expand description
Defines a part of a CSS document.
Because sections are nested into one another, you can use
parent() to get the containing region.
Implementations§
source§impl CssSection
impl CssSection
sourcepub fn as_ptr(&self) -> *mut GtkCssSection
pub fn as_ptr(&self) -> *mut GtkCssSection
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow<'a>(
ptr: *const *const GtkCssSection
) -> &'a Self
pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const *const GtkCssSection ) -> &'a Self
Borrows the underlying C value.
source§impl CssSection
impl CssSection
sourcepub fn new(
file: Option<&impl IsA<File>>,
start: &CssLocation,
end: &CssLocation
) -> CssSection
pub fn new( file: Option<&impl IsA<File>>, start: &CssLocation, end: &CssLocation ) -> CssSection
Creates a new CssSection referring to the section
in the given file from the start location to the
end location.
file
The file this section refers to
start
The start location
end
The end location
Returns
a new CssSection
sourcepub fn end_location(&self) -> CssLocation
pub fn end_location(&self) -> CssLocation
Returns the location in the CSS document where this section ends.
Returns
The end location of this section
sourcepub fn file(&self) -> Option<File>
pub fn file(&self) -> Option<File>
Gets the file that @self was parsed from.
If no such file exists, for example because the CSS was loaded via
CssProvider::load_from_data(), then NULL is returned.
Returns
the GFile from which the section
was parsed
sourcepub fn parent(&self) -> Option<CssSection>
pub fn parent(&self) -> Option<CssSection>
Gets the parent section for the given section.
The parent section is the section that contains this section. A special
case are sections of type GTK_CSS_SECTION_DOCUMENT. Their parent will
either be NULL if they are the original CSS document that was loaded by
CssProvider::load_from_file() or a section of type
GTK_CSS_SECTION_IMPORT if it was loaded with an @import rule from
a different file.
Returns
the parent section
sourcepub fn start_location(&self) -> CssLocation
pub fn start_location(&self) -> CssLocation
Returns the location in the CSS document where this section starts.
Returns
The start location of this section
Trait Implementations§
source§impl Clone for CssSection
impl Clone for CssSection
source§impl Debug for CssSection
impl Debug for CssSection
source§impl Display for CssSection
impl Display for CssSection
source§impl From<CssSection> for Value
impl From<CssSection> for Value
source§fn from(s: CssSection) -> Self
fn from(s: CssSection) -> Self
source§impl HasParamSpec for CssSection
impl HasParamSpec for CssSection
type ParamSpec = ParamSpecBoxed
§type SetValue = CssSection
type SetValue = CssSection
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, CssSection>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for CssSection
impl Hash for CssSection
source§impl Ord for CssSection
impl Ord for CssSection
source§fn cmp(&self, other: &CssSection) -> Ordering
fn cmp(&self, other: &CssSection) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<CssSection> for CssSection
impl PartialEq<CssSection> for CssSection
source§fn eq(&self, other: &CssSection) -> bool
fn eq(&self, other: &CssSection) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<CssSection> for CssSection
impl PartialOrd<CssSection> for CssSection
source§fn partial_cmp(&self, other: &CssSection) -> Option<Ordering>
fn partial_cmp(&self, other: &CssSection) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl StaticType for CssSection
impl StaticType for CssSection
source§fn static_type() -> Type
fn static_type() -> Type
Self.