Prima::...CfgMaint(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

okay so this is the Prima::...CfgMaint(3) page from the User Contributed Perl Documentation, and it’s giving full main-character energy for Prima::VB::CfgMaint. πŸ’…

✨ NAME ✨

Prima::VB::CfgMaint β€” configures the widget palette in the Visual Builder. That’s the whole assignment, no cap πŸŽ€

🌸 DESCRIPTION 🌸

This module is used by the Visual Builder and the prima-cfgmaint programs to configure the Visual Builder widget palette. The installed widgets show up in the main panel of the Visual Builder, and you can maintain them with the prima-cfgmaint program. Iconic little ecosystem, honestly πŸ¦‹

🧚 USAGE 🧚

The widget palette config lives in two files, bestie: the system-wide Prima::VB::Config and the user ~/.prima/vbconfig. When the Visual Builder loads them, the user config file takes precedence. The module can select either configuration by assigning the $systemWide boolean property. Choose your fighter πŸ’–

Widgets are grouped into pages, and you can reach those pages by their names.

New widgets can be added to the palette by calling the add_module method, which accepts a perl module file as its first parameter. That module has to conform to the VB-loadable format β€” no rogue modules allowed, okay? πŸ‘‘

πŸ“ FORMAT πŸ“

This section describes the format of a module with VB-loadable widgets.

The module must define a package with the same name as the module. In that package, the class sub must be declared. It returns an array or paired scalars, where each first item in the pair corresponds to the widget class and the second to the hash which contains the class loading information, and that hash must contain the following keys:

  • class STRING β€” Name of the package which represents the original widget class in the Visual Builder. This is usually a lightweight package that does not contain all the functionality of the original class but is capable of visually reflecting changes to the most useful class properties. Lowkey a vibe-forward little stand-in ✨
  • icon PATH β€” Sets the image file with the class icon. PATH provides an extended syntax for indicating a frame index if the image file is multiframed: the frame index is appended to the path name with the ":" character prefix, for example NewWidget::icons.gif:2. Frame two said hi πŸŽ€
  • module STRING β€” Sets the module name that contains class.
  • page STRING β€” Sets the default palette page where the widget is to be stored. The current implementation of the Visual Builder provides four pages: General,Additional,Sliders,Abstract. If the page is not present, a new page is automatically created when the widget class is registered there. Automatic page creation is so slay πŸ’…
  • RTModule STRING β€” Sets the module name that contains the original widget class.

The reader is urged to explore Prima::VB::examples::Widgety file, which contains an example class Prima::SampleWidget, its VB-representation, and an example property lineRoundStyle. Go peek, bestie β€” it’s literally the example buffet 🫢

πŸ› οΈ API πŸ› οΈ

Methods

  • add_module FILE β€” Reads the FILE module and loads all VB-loadable widgets from it.
  • classes β€” Returns declaration of all registered classes as a string (see FORMAT).
  • open_cfg β€” Loads class and pages information from either the system-wide or the user configuration file. If it succeeds, the information is stored in the @pages and %classes variables (the old information is lost) and returns 1. If it fails, returns 0 and a string with the error explanation; @pages and %classes content is undefined. That last bit is real, bestie β€” don’t pretend you didn’t see it 😭
  • pages β€” Returns an array of page names.
  • read_cfg β€” Reads information from both the system-wide and user configuration files and merges the information. If it succeeds, returns 1. If it fails, returns 0 and a string with the error explanation.
  • reset_cfg β€” Erases all information about pages and classes.
  • write_cfg β€” Writes either the system-wide or the user configuration file. If the $backup flag is set to 1, the old file is renamed to a ".bak" file. If it succeeds, returns 1. If it fails, returns 0 and a string with the error explanation.

πŸ“ FILES πŸ“

  • Prima::VB::Config.pm
  • "~/.prima/vbconfig"

🌈 AUTHOR 🌈

Dmitry Karasik, <dmitry@karasik.eu.org>. Legend behavior πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€

VB, prima-cfgmaint, Prima::VB::examples::Widgety.


πŸ’– that’s the whole page, bestie. It’s from perl v5.42.0, dated 2024-08-20 β€” mwah, go configure that palette and slay βœ¨πŸ¦‹

πŸ“¦ where this page comes from