_S3DW_WIDGET(9)

πŸ’– _S3DW_WIDGET(9) β€” the s3d manual, bestie edition πŸ’–

okay so welcome to the s3d manual, and today's main character is s3dw_widget, the blueprint for literally every widget in the whole system. it's giving foundation. it's giving ancestor energy. let's get into it πŸ¦‹


✨ NAME ✨

s3dw_widget β€” s3d widget information


🌸 SYNOPSIS 🌸

#include <s3dw.h>

πŸŽ€ STRUCTURE MEMBERS πŸŽ€

here's the whole squad, every single member, no one left out, no cap:

struct _s3dw_widget {
     int type;
     s3dw_widget *parent;
     s3dw_style *style;
     int nobj;
     s3dw_widget **pobj;
     int focus;
     int flags;
     float ax;
     float ay;
     float az;
     float as;
     float arx;
     float ary;
     float arz;
     float width;
     float height;
     uint32_t oid;
     void *ptr;
     float x;
     float y;
     float z;
     float s;
     float rx;
     float ry;
     float rz;
}

like. look at her. 25 fields of pure widget lore. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so this right here is the most basic widget type, and she contains all the "general" widget information. think of her as the base layer of the whole outfit. 🧚

if you wanna move a widget, bestie, you'd change x, y, z, s and rx, ry, rz, and then call s3dw_moveit to turn your action into reality. yes literally, that's the move. manifest it, then call the function. ✨

and here's the iconic part: every other widget has this type as its first entry, so a simple typecast to s3dw_widget will hand you that widget's "general" information. for the typecast, you may use S3DWIDGET(). slay, inheritance, we love to see it. 🫢

the pointer ptr lets you link to user-specific data structures. that comes in so handy when the widget gets called back by an event and your program has to figure out which data the user actually reacted to. like detective work but make it structs. πŸ”


πŸ‘‘ AUTHOR πŸ‘‘

  • Simon Wunderlich β€” Author of s3d

fr fr, that's the whole page, and every last detail stayed. don't @ me. πŸ’–

okay bye bestie!! this was the s3d manual, source s3d, page _S3DW_WIDGET(9). mwah, see u in the next manpage πŸ’…πŸ’œ