Plank.DockItem – plank Reference Manual

# DockItem

## Object Hierarchy:

## Description:

public abstract class DockItem : DockElement

The base class for all dock items.

All known sub-classes:

- ApplicationDockItem
- DockletItem

- FileDockItem
- PlaceholderDockItem

- PlankDockItem
- TransientDockItem

Namespace: Plank
Package: plank

## Content:

### Properties:

- public Color AverageIconColor { get; protected set; }
  The average color of this item's icon.
- public int64 Count { get; set; }
  The count for the dock item.
- public bool CountVisible { get; set; }
  Show the item's count or not.
- public string DockItemFilename { owned get; }
  The filename of the preferences backing file.
- protected Pixbuf? ForcePixbuf { public get; public set; }
- public string Icon { get; set; }
  The dock item's icon.
- public IndicatorState Indicator { get; protected set; }
  The indicator shown for the item.
- public int LastPosition { get; protected set; }
  The dock item's last position on the dock.
- public string Launcher { get; }
  The launcher associated with this item.
- public int Position { get; set; }
  The dock item's position on the dock.
- public DockItemPreferences Prefs { get; construct; }
  The underlying preferences for this item.
- public double Progress { get; set; }
  The progress for this dock item.
- public bool ProgressVisible { get; set; }
  Show the item's progress or not.
- public ItemState State { get; protected set; }
  The item's current state.

### Creation methods:

- protected DockItem ()
  Creates a new dock item.

### Methods:

- public void @delete ()
  Deletes the underlying preferences file.
- public void copy_values_to (DockItem target)
  Copy all property value of this dockitem instance to target instance.
- protected virtual void draw_icon (Surface surface)
  Draws the item's icon onto a surface.
- protected virtual void draw_icon_fast (Surface surface)
  Draws a placeholder icon onto a surface. This method should be considered time-critical! Make sure to only use simple drawing routines, and do not rely on external resources!
- public Surface? get_background_surface (int width, int height, Surface model, DrawDataFunc<DockItem>? draw_data_func)
  Returns the background surface for this item.
- public Surface? get_foreground_surface (int width, int height, Surface model, DrawDataFunc<DockItem>? draw_data_func)
  Returns the foreground surface for this item.
- public Surface get_surface (int width, int height, Surface model)
  Returns the surface for this item.
- public Surface get_surface_copy (int width, int height, Surface model)
  Returns a copy of the surface for this item.
- public virtual bool is_valid ()
  Check the validity of this item.
- protected virtual void load_from_launcher ()
  Parses the associated launcher and e.g. sets the icon and text from it.
- public override void reset_buffers ()
  Resets the buffers for this item's icon.
- protected void reset_icon_buffer ()
  Resets the buffer for this item's icon and requests a redraw.
- public void unset_move_state ()

### Signals:

- public signal void deleted ()
  Signal fired when the .dockitem for this item was deleted.

### Inherited Members:

All known members inherited from class Plank.DockElement

- AddTime
- Button
- ClickedAnimation
- Container
- HoveredAnimation
- IsAttached
- IsVisible
- LastActive
- LastClicked
- LastHovered
- LastMove
- LastScrolled
- LastUrgent

- LastValid
- RemoveTime
- ScrolledAnimation
- Text
- accept_drop
- as_uri
- can_accept_drop
- can_be_removed
- clicked
- create_literal_menu_item
- create_literal_menu_item_with_pixbuf
- create_menu_item

- create_menu_item_with_pixbuf
- get_dock
- get_drop_text
- get_menu_items
- hovered
- needs_redraw
- on_clicked
- on_hovered
- on_scrolled
- reset_buffers
- scrolled
- unique_id

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref