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
.impl Eq for CssSection
impl StructuralPartialEq for CssSection
Auto Trait Implementations§
impl Freeze for CssSection
impl RefUnwindSafe for CssSection
impl !Send for CssSection
impl !Sync for CssSection
impl Unpin for CssSection
impl UnwindSafe for CssSection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)