catcmds(3U)

πŸ’… catcmds β€” the catalog-oriented command squad (catcmds(3U))

okay bestie, welcome to catcmds(3U), straight out of the InterViews Reference Manual ✨ this is the page for the little command crew that lets your users open, view, and save components β€” plus print 'em and dip out of the app entirely. no cap, it's giving backstage-pass energy πŸŽ€

✨ NAME ✨

NewCompCmd, PrintCmd, QuitCmd, RevertCmd, SaveCompCmd, SaveCompAsCmd, ViewCompCmd β€” catalog-oriented commands πŸ¦‹

✨ SYNOPSIS ✨

#include <Unidraw/Commands/catcmds.h>

✨ DESCRIPTION ✨

so the Unidraw library comes preloaded with a whole set of non-interpretive commands πŸ‘‘ these are the ones that let a user pick components to open, view, and save, plus generate a PostScript external representation, plus quit the app. like, the full lifecycle, fr fr.

here's the lineup, one by one:

  • NewCompCmd re-initializes its editor's component so the user can start editing fresh πŸ’« if the existing component is modified, it prompts the user to save it first. considerate!
  • PrintCmd generates a PostScriptView of the editor's component and lets the user send it to a file or to a printer πŸ–¨οΈ
  • QuitCmd quits the application, and yes it prompts the user to save modified components on the way out πŸšͺ
  • RevertCmd lets the user re-open the current component and discard changes since it was last saved 😭 gone. poof.
  • SaveCompAsCmd lets the user save a component under a particular name, while SaveCompCmd saves a component named previously πŸ’Ύ
  • ViewCompCmd lets the user specify another component to view in its editor πŸ‘€

🌸 NEWCOMPCMD PUBLIC OPERATIONS 🌸

NewCompCmd(ControlInfo*, Component* prototype = nil)
NewCompCmd(Editor* = nil, Component* = nil)
  • Create a new NewCompCmd instance, optionally supplying a prototype component. When executed, NewCompCmd will make its editor edit a copy of the prototype. The editor's original component will be deleted if no other editor refers to it. 🫢
virtual boolean Reversible()
  • NewCompCmd is not reversible πŸ’€
Component* GetPrototype()
  • Return the prototype component specified in the constructor. πŸ’–

🌸 PRINTCMD PUBLIC OPERATIONS 🌸

PrintCmd(ControlInfo*, PrintDialog* = nil)
PrintCmd(Editor* = nil, PrintDialog* = nil)
  • Create a new PrintCmd instance, optionally supplying the PrintDialog to display when executed. πŸ–¨οΈβœ¨
virtual boolean Reversible()
  • PrintCmd is not reversible πŸ’€

🌸 PRINTCMD PROTECTED OPERATIONS 🌸

void print(const char* print_cmd, const char* file)
  • Concatenates print_cmd and file and calls system(3) on the result. 🫣

🌸 QUITCMD PUBLIC OPERATIONS 🌸

QuitCmd(ControlInfo*)
QuitCmd(Editor* = nil)
  • Create a new QuitCmd instance. bye bestie πŸ‘‹
virtual boolean Reversible()
  • QuitCmd is not reversible πŸ’€

🌸 REVERTCMD PUBLIC OPERATIONS 🌸

RevertCmd(ControlInfo*)
RevertCmd(Editor* = nil)
  • Create a new RevertCmd instance. πŸ™ˆ
virtual boolean Reversible()
  • RevertCmd is not reversible πŸ’€

🌸 SAVECOMPCMD PUBLIC OPERATIONS 🌸

SaveCompCmd(ControlInfo*)
SaveCompCmd(Editor* = nil)
  • Create a new SaveCompCmd instance. πŸ’Ύ
virtual boolean Reversible()
  • SaveCompCmd is not reversible πŸ’€

🌸 SAVECOMPASCMD PUBLIC OPERATIONS 🌸

SaveCompAsCmd(ControlInfo*, FileChooser* = nil)
SaveCompAsCmd(Editor* = nil, FileChooser* = nil)
  • Create a new SaveCompAsCmd instance, optionally supplying the FileChooser that will prompt the user to name the component. πŸŽ€
virtual boolean Reversible()
  • SaveCompAsCmd is not reversible πŸ’€

🌸 VIEWCOMPCMD PUBLIC OPERATIONS 🌸

ViewCompCmd(ControlInfo*, FileChooser* = nil)
ViewCompCmd(Editor* = nil, FileChooser* = nil)
  • Create a new ViewCompCmd instance, optionally supplying the FileChooser that will prompt the user to specify the component to view. After the new component is opened successfully, the editor's original component will be deleted if no other editor refers to it. πŸ‘€πŸ’«
virtual boolean Reversible()
  • ViewCompCmd is not reversible πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

BasicDialog(3U), Command(3U), Component(3U), Editor(3U), PostScriptView(3U), lpr(1).


and that's the whole page, bestie πŸ’– this one's from Unidraw, dated 23 January 1991 β€” yeah, vintage, but she still ate, no cap πŸ‘‘βœ¨ go forth and command πŸ¦‹πŸ’