XMSCREEN(3)

๐Ÿ“ฆ
version 2.3.8 ยท 3 versions
, in arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

okay so welcome to the XmScreen(3) library call page, bestie ๐Ÿ’– this is literally the Screen widget class and we are about to get into it.

โœจ NAME โœจ

XmScreen โ€” The Screen widget class ๐Ÿ’…

โœจ SYNOPSIS โœจ

#include <Xm/Screen.h>

โœจ DESCRIPTION โœจ

so the XmScreen object is what Motif widgets use to stash info that is specific to a screen. it also lets the toolkit keep certain deets on widget hierarchies that would otherwise be unavailable. and here's the vibe: every client gets exactly one XmScreen object for each screen it accesses. no cap.

and bestie, you do not even have to make one yourself โ€” an XmScreen object gets auto-created the moment your application creates the first shell on a screen (usually that is a call to XtAppInitialize or XtAppCreateShell). so like, it is not necessary to create an XmScreen object by any other means, periodt. if you want the widget ID of the XmScreen object for a given screen, just call XmGetXmScreen and it is yours ๐Ÿซถ

okay important: you cannot supply initial values for XmScreen resources as arguments to a call to any function that creates widgets. nope. instead, the application or the user can supply initial values in a resource file. then, after creating the first shell on the screen, the application can hit up XmGetXmScreen to obtain the widget ID of the XmScreen object and then call XtSetValues to set the XmScreen resources. slay โœจ

๐ŸŽ€ Classes ๐ŸŽ€

  • Screen inherits behavior and resources from Core. iykyk.
  • the class pointer is xmScreenClass.
  • the class name is XmScreen.

๐ŸŒธ New Resources ๐ŸŒธ

so the table below (well, the table that is about to show up, bestie, keep reading) defines a set of widget resources used by the programmer to specify data. you can also set the resource values for the inherited classes to set attributes for this widget. here is the tea on referencing resources in an .Xdefaults file: if you are referencing by name or by class, remove the XmN or XmC prefix and use the remaining letters. and if you are specifying one of the defined values for a resource in an .Xdefaults file, remove the Xm prefix and use the remaining letters โ€” either lowercase or uppercase, does not matter, but include any underscores between words. the codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). got it? ๐Ÿ’…



๐ŸŒˆ the resource roster (read it, memorise it, slay)

Okay so here's the full lineup of resources this widget is serving. Every one of them, no skips, bestie ๐Ÿ’… โ€” name, class, type, default and access, all of it:

  • XmNbitmapConversionModel โ€” class XmCBitmapConversionModel, type XtEnum, default XmPIXMAP, access CSG??
  • XmNcolorAllocationProc โ€” class XmCColorAllocationProc, type XtProc, default NULL, access CSG??
  • XmNcolorCalculationProc โ€” class XmCColorCalculationProc, type XtProc, default NULL, access CSG??
  • XmNdarkThreshold โ€” class XmCDarkThreshold, type int, default dynamic, access C
  • XmNdefaultCopyCursorIcon โ€” class XmCDefaultCopyCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultInvalidCursorIcon โ€” class XmCDefaultInvalidCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultLinkCursorIcon โ€” class XmCDefaultLinkCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultMoveCursorIcon โ€” class XmCDefaultMoveCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultNoneCursorIcon โ€” class XmCDefaultNoneCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultSourceCursorIcon โ€” class XmCDefaultSourceCursorIcon, type Widget, default NULL, access CSG
  • XmNdefaultValidCursorIcon โ€” class XmCDefaultValidCursorIcon, type Widget, default NULL, access CSG
  • XmNfont โ€” class XmCFont, type XFontStruct *, default NULL, access CSG
  • XmNforegroundThreshold โ€” class XmCForegroundThreshold, type int, default dynamic, access C
  • XmNhorizontalFontUnit โ€” class XmCHorizontalFontUnit, type int, default dynamic, access CSG
  • XmNinsensitiveStippleBitmap โ€” class XmCinsensitiveStippleBitmap, type Bitmap, default "50_foreground", access CSG
  • XmNlightThreshold โ€” class XmCLightThreshold, type int, default dynamic, access C
  • XmNmenuCursor โ€” class XmCCursor, type Cursor, default arrow, access C
  • XmNmoveOpaque โ€” class XmCMoveOpaque, type Boolean, default False, access CSG
  • XmNunpostBehavior โ€” class XmCUnpostBehavior, type unsigned char, default XmUNPOST_AND_REPLAY, access CSG
  • XmNuseColorObject โ€” class XmCUseColorObject, type Boolean, default False, access C
  • XmNuserData โ€” class XmCUserData, type XtPointer, default NULL, access CSG
  • XmNverticalFontUnit โ€” class XmCVerticalFontUnit, type int, default dynamic, access CSG

๐ŸŽ€ XmNbitmapConversionModel

So this one's literally the policy girl for turning xbm and xpm files into the Pixmap type. It decides how that glow-up happens. It takes these values, and yes you have to pick:

XmMATCH_DEPTH

From a supplied xbm or xpm file, generates a converted pixmap file having the same depth as the widget.

  • XmDYNAMIC_DEPTH โ€” takes an input xbm file and turns it into a Pixmap of depth 1, or takes an input xpm file and turns it into a Pixmap that has the same depth as the widget. cute, right?

๐ŸŽ€ the resources, continued ๐ŸŽ€

  • XmNcolorAllocationProc โ€” this one names the procedure that gets used for color allocation. Normally it's a procedure you (the app) define. But bestie, if you never set one? The system just falls back on Motif's own predefined color allocation procedure. no drama ๐Ÿ’…
  • XmNcolorCalculationProc โ€” names the procedure used for per-widget color calculation. Again, normally it's an application-defined color calculation procedure. And again, if you didn't set one, the system uses Motif's predefined color calculation procedure. she's got backups for days โœจ
  • XmNdarkThreshold โ€” an integer from 0 (zero) to 100, inclusive. It sets a level of perceived brightness for a color. If the perceived brightness of the background color is below this level, Motif treats that background as "dark" when it's computing the default shadow and select colors. If you set this resource for a particular screen, it applies to widgets created on that screen; otherwise it applies to widgets created on all screens. The default value is implementation specific ๐Ÿ‘‘
  • XmNdefaultCopyCursorIcon โ€” the DragIcon used during a drag operation when that operation is a copy and no other pixmap was specified by the application. If this resource is NULL, a system default icon gets used instead. And that system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultInvalidCursorIcon โ€” the DragIcon used to say "hey, the cursor is over an invalid drop site" during a drag operation, when no other pixmap symbol was specified by the application. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultLinkCursorIcon โ€” the DragIcon used during a drag operation when the operation is a link and no other pixmap was specified by the application. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultMoveCursorIcon โ€” the DragIcon used during a drag operation when the operation is a move and no other pixmap was specified by the application. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultNoneCursorIcon โ€” the DragIcon used to say "the cursor is not over a drop site" during a drag operation, when no other pixmap was specified by the application. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultSourceCursorIcon โ€” the depth-1 pixmap used as a cursor when an XmNsourceCursorIcon was not provided by the DragContext, or when it was provided but is not usable. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNdefaultValidCursorIcon โ€” the DragIcon used to say "the cursor is over a valid drop site" during a drag operation, when no other pixmap was specified by the application. If this resource is NULL, a system default icon is used. The system default icon is determined by the Display resource XmNenableDragIcon.
  • XmNfont โ€” specifies a font to use when computing values for XmNhorizontalFontUnit and XmNverticalFontUnit. When an application is initialized, this resource can be supplied in a resource file, or through the standard command line options -fn, -font, and -xrm. Heads up though: this resource is used only for the calculation of the font unit values. If you want to specify a font that's actually used to display text, use a widget's render table resource (XmNrenderTable). different job, bestie ๐Ÿ™ˆ
  • XmNforegroundThreshold โ€” an integer from 0 (zero) to 100, inclusive, that specifies a level of perceived brightness for a color. Here's the tea: if the perceived brightness of the background color is equal to or below this level, Motif treats the background as "dark" when computing the default foreground and highlight colors. If the perceived brightness of the background color is above this level, Motif treats the background as "light" when computing the default foreground and highlight colors. When the background is "dark," the default foreground and highlight is white; when the background is "light," the default foreground and highlight is black. If this resource is specified for a particular screen, it applies to widgets created on that screen; otherwise, it applies to widgets created on all screens. The default value is implementation specific.
  • XmNhorizontalFontUnit โ€” specifies the horizontal component of the font units used by XmConvertUnits, and it's what's used to interpret the values of geometry resources when the XmNshellUnitType resource of VendorShell, or the XmNunitType resource of Gadget, Manager, or Primitive, has the value Xm100TH_FONT_UNITS.

If no initial value is supplied for this resource, the default is computed from the font specified in XmNfont. If no initial value is supplied for this resource or for XmNfont, the default is 10.

If a call to XtSetValues specifies a value for XmNhorizontalFontUnit, this resource is set to that value. If a call to XtSetValues specifies a value for XmNfont but not for XmNhorizontalFontUnit, this resource is set to a value computed from the new XmNfont.

A horizontal font unit is derived from a font like this:

  • If the font has an AVERAGE_WIDTH property, the horizontal font unit is the AVERAGE_WIDTH property divided by 10.
  • If the font has no AVERAGE_WIDTH property but has a QUAD_WIDTH property, the horizontal font unit is the QUAD_WIDTH property.
  • If the font has no AVERAGE_WIDTH or QUAD_WIDTH property, the horizontal font unit is the sum of the font structure's min_bounds.width and max_bounds.width divided by 2.3.

she really said "we'll find a way" ๐Ÿ’–

  • XmNinsensitiveStippleBitmap โ€” hands widgets the bitmap to use when generating the insensitive visual. This bitmap is meant to be used as the stipple for the rendering of insensitive visuals.
  • XmNlightThreshold โ€” an integer from 0 (zero) to 100, inclusive, that specifies a level of perceived brightness for a color. If the perceived brightness of the background color is above this level, Motif treats the background as "light" when computing default shadow and select colors. If this resource is specified for a particular screen, it applies to widgets created on that screen; otherwise it applies to widgets created on all screens. The default value is implementation specific.
  • XmNmenuCursor โ€” sets a variable that controls the cursor used whenever this application posts a menu. You can only specify this resource once, at application startup time, either by putting it in a defaults file or by using the -xrm command line argument. like, for example:
myProg -xrm "*menuCursor: arrow"

You can also pick the menu cursor inside the program itself, through the function XmSetMenuCursor. Here's the list of acceptable cursor names. If the application doesn't specify a cursor, or if an invalid name gets supplied, the default cursor (an arrow pointing up and to the right) is what you get. ๐Ÿซถ

The acceptable cursor names are X_cursor, leftbutton, arrow, ll_angle, based_arrow_down, lr_angle, based_arrow_up, man, boat, middlebutton, bogosity, mouse, bottom_left_corner, pencil, bottom_right_corner, pirate, bottom_side, plus, bottom_tee, question_arrow, box_spiral, right_ptr, center_ptr, right_side, circle, right_tee, clock, rightbutton, coffee_mug, rtl_logo, cross, sailboat, cross_reverse, sb_down_arrow, crosshair, sb_h_double_arrow, diamond_cross, sb_left_arrow, dot, sb_right_arrow, dotbox, sb_up_arrow, double_arrow, sb_v_double_arrow, draft_large, shuttle, draft_small, sizing, draped_box, spider, exchange, spraycan, fleur, star, gobbler, target, gumby, tcross, hand1, top_left_arrow, hand2, top_left_corner, heart, top_right_corner, icon, top_side, iron_cross, left_ptr, left_side, top_tee, left_tee, trek, ul_angle, umbrella, ur_angle, watch, xterm. ๐ŸŒˆ

ngl that list is giving encyclopedia, but every single one of those names is real and load-bearing, so don't skip any ๐Ÿ’€
  • XmNmoveOpaque โ€” okay bestie, this one is lowkey about the drama of moving windows. It specifies whether an interactive operation that moves a window โ€” like tearing off and dragging a tear-off menu, or moving a window in MWM โ€” displays an outline of the window or a representation of the window itself during the move. If the value is True, the operation displays a representation of the window during the move. If the value is False, the operation displays an outline of the window. So True = actual window realness, False = ghost outline era. ๐Ÿ’…
  • XmNunpostBehavior โ€” this is the menu behavior lore. It specifies the behavior of an active menu posted in traversal mode when a subsequent menu button selection is made outside the posted menu. When the value is XmUNPOST_AND_REPLAY, the resource unposts the menu hierarchy and causes the server to replay the event to the window in which the pointer is located. When the value is XmUNPOST, the resource unposts the hierarchy without replaying the event. Two moods: replay the event or just dip. Periodt.
  • XmNuseColorObject โ€” color-sharing simulator, but make it widget. Enables and disables the sharing of colors between widgets, and the dynamic changing of colors. A value of False disables this, and a value of True enables it. Simple as that, no cap.
  • XmNuserData โ€” a lil' pocket for your app's stuff. Allows the application to attach any necessary specific data to the widget. This is an internally unused resource. So it's giving "storage closet," not "active feature," iykyk.
  • XmNverticalFontUnit โ€” font unit math time, bestie, stay with me. Specifies the vertical component of the font units used by XmConvertUnits and used to interpret the values of geometry resources when the XmNshellUnitType resource of VendorShell or the XmNunitType resource of Gadget, Manager, or Primitive has the value Xm100TH_FONT_UNITS. If no initial value is supplied for this resource, the default is computed from the font specified in XmNfont. If no initial value is supplied for this resource or for XmNfont, the default is 10.

If a call to XtSetValues specifies a value for XmNverticalFontUnit, this resource is set to that value. If a call to XtSetValues specifies a value for XmNfont but not for XmNverticalFontUnit, this resource is set to a value computed from the new XmNfont.

A vertical font unit is derived from a font as follows:

  • If the font has a PIXEL_SIZE property, the vertical font unit is the PIXEL_SIZE property divided by 1.8.
  • If the font has no PIXEL_SIZE property but has POINT_SIZE and RESOLUTION_Y properties, the vertical font unit is the product of the POINT_SIZE and RESOLUTION_Y properties divided by 1400.
  • If the font has no PIXEL_SIZE, POINT_SIZE, or RESOLUTION_Y properties, the vertical font unit is the sum of the font structure's max_bounds.ascent and max_bounds.descent divided by 2.2.

Math ate, honestly. ๐Ÿงฎโœจ


๐Ÿงฌ Inherited Resources ๐Ÿงฌ

All of the superclass resources inherited by XmScreen are designated N/A (not applicable). So yeah, they said "not applicable" and we respect the boundary. ๐Ÿ’–


Core(3), XmDisplay(3), XmGetXmScreen(3), and XmSetMenuCursor(3), โ€” yes, that trailing comma is staying, it's part of the iconique original energy. Don't @ me. ๐Ÿ‘‘


Okay bestie, that's the whole page. The footer at the very bottom says XmScreen(library call) โ€” that's the source/version stamp, and there's no date in this bit, so that's the cute lil' sign-off moment. Go forth and configure your screens with main character energy. ๐ŸŽ€๐Ÿฆ‹