UnidrawIntro(3U)

πŸ’– UnidrawIntro β€” aka Unidraw_Intro πŸ’–

okay bestie, sit down, grab a strawberry πŸ“, because we're about to talk about the Unidraw library for graphical object editor development, and it's lowkey iconic. this page lives in the InterViews Reference Manual, and honestly? it ate. πŸŽ€


✨ NAME ✨

Unidraw_Intro β€” the Unidraw library for graphical object editor development. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

so like, first you gotta include your headers, one for each little family of classes:

#include <Unidraw/class.h>
#include <Unidraw/Components/class.h>
#include <Unidraw/Commands/class.h>
#include <Unidraw/Tools/class.h>
#include <Unidraw/Graphic/class.h>

and then you link the whole girl up like this:

CC ... -lUnidraw ... -lInterViews -lX -lm

that's the recipe, no cap. ✨


πŸ‘‘ DESCRIPTION πŸ‘‘

Unidraw is an architecture for creating object-oriented graphical editors in domains like technical and artistic drawing, music composition, and circuit design. it simplifies (yes, the original says "simpifies", we love a typo queen πŸ’€) the construction of these editors by handing you programming abstractions that are common across domains. so you're not starting from zero, you're starting from slay.

Unidraw defines four basic abstractions, and they are the main characters:

  1. components β€” encapsulate the appearance and semantics of objects in a domain 🧚
  2. tools β€” support direct manipulation of components 🫢
  3. commands β€” define operations on components and other objects ⭐
  4. external representations β€” define the mapping between components and the file format generated by the editor πŸ’œ

and Unidraw also supports multiple views, graphical connectivity and confinement, and dataflow between components. yes, all of it. obsessed. πŸ”₯


The Unidraw library is a whole collection of classes that implement the Unidraw architecture. you use it together with the rest of InterViews, with one exception β€” except the graphic structured graphics library, okay? not that one. πŸ™ˆ

here's the division of labour, bestie:

  • InterViews interactors and composition mechanisms β†’ support an application's look and feel πŸ’…
  • the Unidraw library β†’ supports functionality unique to graphical object editors πŸ‘‘

and here's the part where you gotta pay attention, because it's giving caution:

Currently, the Unidraw library provides its own structured graphics classes, which are similar to but incompatible with the graphic library classes. Therefore you must not use both graphic and Unidraw classes in the same application. like, don't do it. that's a hard no. 😭

πŸ“‚ where do the classes even live πŸ“‚

General Unidraw classes are declared in header files in the Unidraw include file subdirectory.

Component, command, tool, and structured graphics classes are declared in corresponding subdirectories under the Unidraw subdirectory. so they're all neatly tucked away in their own little homes. organized queen. πŸŽ€


πŸ¦‹ SEE ALSO πŸ¦‹

  • InterViews(3I) β€” go read this one too, bestie 🫢
  • Generalized Graphical Object Editing, John M. Vlissides, Technical Report CSL-TR-90-427, Stanford University, June 1990. yes, the academic source material. read it and ascend. πŸ“šβœ¨

and that's the whole page, bestie!! this was the Unidraw manual, UnidrawIntro(3U), dated 11 June 1990 β€” old but iconic, a true vintage queen πŸ‘‘πŸ’–. now go build an editor and make me proud. periodt. πŸ’…βœ¨