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.
GLib type: Shared boxed type with reference counted clone semantics.
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(ptr: &*mut GtkCssSection) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkCssSection) -> &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 with_bytes(
file: Option<&impl IsA<File>>,
bytes: Option<&Bytes>,
start: &CssLocation,
end: &CssLocation,
) -> CssSection
Available on crate feature v4_16
only.
pub fn with_bytes( file: Option<&impl IsA<File>>, bytes: Option<&Bytes>, start: &CssLocation, end: &CssLocation, ) -> CssSection
v4_16
only.Creates a new CssSection
referring to the section
in the given file
or the given bytes
from the start
location to the
end
location.
§file
The file this section refers to
§bytes
The bytes this sections 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_DOCUMEN
T. 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
Source§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 for CssSection
impl PartialEq for CssSection
Source§impl PartialOrd for CssSection
impl PartialOrd for CssSection
Source§impl StaticType for CssSection
impl StaticType for CssSection
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.