element_object Derived Type

type, public :: element_object

Bar element class.

Inherited By

type~~element_object~~InheritedByGraph type~element_object element_object type~bar_object bar_object type~element_object->type~bar_object bracket_left, bracket_right, date_time, empty_char, filled_char, prefix, progress_percent, progress_speed, scale_bar, spinner, suffix
Help

Source Code


Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: color_bg

Background color.

character(len=:), public, allocatable:: color_fg

Foreground color.

character(kind=len=:,UCS4), public, allocatable:: string

Element string.

character(len=:), public, allocatable:: style

Style.


Type-Bound Procedures

procedure, private, pass(lhs) :: assign_element

Operator =.

  • private pure subroutine assign_element(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(element_object), intent(inout) :: lhs

    Left hand side.

    type(element_object), intent(in) :: rhs

    Right hand side.

generic, public :: assignment(=) => assign_element

Overload =.

  • private pure subroutine assign_element(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(element_object), intent(inout) :: lhs

    Left hand side.

    type(element_object), intent(in) :: rhs

    Right hand side.

procedure, public, pass(self) :: destroy

Destroy element.

  • private pure subroutine destroy(self)

    Destroy element.

    Arguments

    Type IntentOptional AttributesName
    class(element_object), intent(inout) :: self

    element.

procedure, public, pass(self) :: initialize

Initialize element.

  • private pure subroutine initialize(self, string, color_fg, color_bg, style)

    Initialize element.

    Arguments

    Type IntentOptional AttributesName
    class(element_object), intent(inout) :: self

    element.

    class(*), intent(in), optional :: string

    Element string.

    character(len=*), intent(in), optional :: color_fg

    Foreground color.

    character(len=*), intent(in), optional :: color_bg

    Background color.

    character(len=*), intent(in), optional :: style

    Style.

procedure, public, pass(self) :: output

Return formatted output of element.

  • private pure function output(self)

    Return formatted output of element.

    Arguments

    Type IntentOptional AttributesName
    class(element_object), intent(in) :: self

    element.

    Return Value character(kind=len=:,UCS4), allocatable

    Formatted output.

Source Code

type :: element_object
   !< Bar element class.
   character(len=:, kind=UCS4), allocatable :: string   !< Element string.
   character(len=:),            allocatable :: color_fg !< Foreground color.
   character(len=:),            allocatable :: color_bg !< Background color.
   character(len=:),            allocatable :: style    !< Style.
   contains
      ! public methods
      procedure, pass(self) :: destroy    !< Destroy element.
      procedure, pass(self) :: initialize !< Initialize element.
      procedure, pass(self) :: output     !< Return formatted output of element.
      ! public operators
      generic :: assignment(=) => assign_element !< Overload `=`.
      ! private methods
      procedure, pass(lhs), private :: assign_element !< Operator `=`.
endtype element_object