Clipboard(3U)

πŸ’– Clipboard(3U) πŸ’–

okay so bestie, we're in the InterViews Reference Manual today and we are talking about the Clipboard class β€” the little icon that manages a whole list of graphical component subjects. she's giving admin assistant energy and honestly? she ate. πŸŽ€


✨ NAME ✨

Clipboard β€” manages a list of graphical component subjects πŸ—‚οΈβœ¨


🌸 SYNOPSIS 🌸

#include <Unidraw/clipboard.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically a Clipboard maintains a list of GraphicComp objects and provides operations for manipulating that list. that's it. that's the whole job. πŸ’…

and the plot twist? Catalog and Command classes use clipboards to store the graphical components they affect. so she's not just doing this for herself, she's carrying the whole team. main character energy fr fr. πŸ‘‘


🌈 PUBLIC OPERATIONS 🌈

  • Clipboard(GraphicComp* = nil) β€” construct a brand new clipboard object, and if you want, hand her a GraphicComp that should show up on the list from the jump. optional bestie, no pressure. 🫢
  • virtual ~Clipboard() β€” delete the clipboard. ⚠️ but listen: deleting the clipboard does not delete the GraphicComp objects she's holding. they just get evicted, they don't get deleted. no cap.
  • void Init(Selection*) / void CopyInit(Selection*) β€” Init initializes the clipboard with the subjects belonging to the graphical views in the given selection object. CopyInit initializes it with copies of those subjects. same vibe, but one of them clones. πŸͺžβœ¨
  • void Clear() β€” remove all GraphicComp objects from the clipboard. and nope, the objects are not deleted. they're just... uninvited from the group chat. πŸ’€
  • void DeleteComps() β€” delete each GraphicComp in the clipboard. but here's the tea: this operation does not delete the list itself, so you can still iterate through the list afterwards. DeleteComps is generally called just before the clipboard is destroyed. rip to them but the list structure lives on. πŸͺ¦
  • void Append(GraphicComp*)
  • void Prepend(GraphicComp*)
  • void InsertAfter(Iterator, GraphicComp*)
  • void InsertBefore(Iterator, GraphicComp*)
  • void Remove(GraphicComp*)
  • void Remove(Iterator&) β€” operations for adding and removing GraphicComp objects from the clipboard. InsertAfter and InsertBefore take an iterator that specifies the point before or after which the given GraphicComp should be inserted. and Remove(Iterator&)? she removes the GraphicComp the iterator refers to and increments the iterator to point to the following GraphicComp. multitasking queen. ✨
  • GraphicComp* GetComp(Iterator) / void SetComp(GraphicComp*, Iterator&) β€” GetComp effectively dereferences an iterator, returning the GraphicComp it points to. SetComp initializes an iterator to point to the given GraphicComp object, assuming that object is in the clipboard. (emphasis on assuming, bestie β€” don't be out here assuming. πŸ™ˆ)
  • void First(Iterator&)
  • void Last(Iterator&)
  • void Next(Iterator&)
  • void Prev(Iterator&)
  • boolean Done(Iterator&) β€” operations for iterating through the GraphicComps in the clipboard. First and Last modify the iterator to point to the first and last GraphicComp objects. Next and Prev make the iterator point to the succeeding and preceding GraphicComp objects. and Done returns whether the iterator points to the sentinel object on the list, which marks the beginning and the end of the list. the sentinel is literally the bouncer at both doors. πŸšͺπŸšͺ
  • boolean IsEmpty() / boolean Includes(GraphicComp*) β€” return whether or not the clipboard is empty, or whether it includes the given GraphicComp object. vibe check, essentially. πŸ”
  • virtual Clipboard* Copy() / virtual Clipboard* DeepCopy() β€” Copy creates a new clipboard with a list of the same GraphicComp objects as this one. DeepCopy creates a new clipboard containing copies of the objects in this one. one shares, one clones. know the difference, it matters. πŸ’–

🧚 PROTECTED OPERATIONS 🧚

  • UList* Elem(Iterator) / GraphicComp* Comp(UList*) β€” the Clipboard class stores its GraphicComp objects in a UList. these convenience functions convert an iterator into a UList element, and dereference a UList element to obtain a GraphicComp object, respectively. lowkey just translation services. πŸŽ€

⭐ SEE ALSO ⭐

Catalog(3U), Command(3U), GraphicComp(3U), Iterator(3U), Selection(3U), UList(3U)


πŸ’Œ and that's the whole page bestie, you're officially Clipboard-literate, iykyk πŸ’…

okay so this little icon of a manual page came from Unidraw, dated 12 June 1990, and it's filed under Clipboard(3U). vintage but still slaying, as always. πŸ¦‹πŸ’–βœ¨