ImportCmd(3U)

πŸ’– ImportCmd β€” import a graphical component πŸ’–

okay so this is a page from the InterViews Reference Manual, bestie, and it's literally all about ImportCmd(3U). grab a snack, we're doing this πŸ“


✨ SYNOPSIS ✨

#include <Unidraw/Commands/import.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

so ImportCmd is the girl that goes and imports a graphical image from a file straight into the drawing you're editing. she's not picky either, she eats:

  • TIFF
  • PostScript generated by pgmtops and ppmtops
  • X bitmap format
  • Unidraw format

like okay versatile queen πŸ‘‘


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • ImportCmd(ControlInfo*, FileChooser* = nil)
  • ImportCmd(Editor* = nil, FileChooser* = nil)

makes a brand new ImportCmd instance for you. you can hand her a FileChooser, which is the thing that prompts the user to specify the file to import β€” but it's optional, hence the nil default, ngl. once the user picks the file, ImportCmd reads it, creates an appropriate graphical component, and pastes it right into the component being edited in the enclosing editor. slay.

  • static GraphicComp* Import(const char*)
  • static GraphicComp* TIFF_Image(const char*)
  • static GraphicComp* PGM_Image(const char*)
  • static GraphicComp* PPM_Image(const char*)
  • static GraphicComp* XBitmap_Image(const char*)

these are the operations for reading data out of the various file formats and making an appropriate graphical component. here's the tea tho: TIFF_Image, PGM_Image, PPM_Image, and XBitmap_Image just assume that the file you gave them is in the corresponding format. no vibe check, no questions asked πŸ™ˆ

Import is the more general one β€” she determines the format from the file and then calls one of the other functions. main character energy fr fr ✨


πŸ”’ PROTECTED OPERATIONS πŸ”’

  • void Init(FileChooser*)

lets you specify the FileChooser instance explicitly, and she stores it in the _dialog protected member. heads up bestie: this operation does not delete the existing instance, if any. it's giving "not my problem" πŸ’€

  • GraphicComp* PostDialog()

posts the FileChooser and returns the graphical component created from the user-specified file, if any. 🫢


🌈 SEE ALSO 🌈

Catalog(3U), Command(3U), FileChooser(3I), GraphicComp(3U), bitmap(1), pgmtops(1), ppmtops(1)


and that's the whole page, periodt πŸ’… it came to you from Unidraw, dated 10 August 1991, and it lives at ImportCmd(3U). go import something cute πŸŽ€βœ¨πŸ’œ