diff --git a/src/generator.cpp b/src/generator.cpp index 21bc745..6f736d3 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -37,6 +37,7 @@ #include #include "events.h" +#include "props.h" // Phase 4: find_prop() for the generic loop namespace fs = std::filesystem; @@ -512,6 +513,196 @@ static void emit_scale_marks(std::ostringstream& o, const Widget& w, o << "});\n"; } +// ---- Phase 4 (proposal 2.22 / 4.12): Stock + Instrumentation ---- +// Capability table: class -> (prop, setter) rows the generic loop +// below may emit. A prop is emittable only when it is in the widget's +// Inspector table (same data, props.h); the arg form comes from that +// table's kind. Generated by tools/gen_phase4_props.py. +static const std::map>> + kPhase4Caps = { +// Phase 4 capability table (generated by tools/gen_phase4_props.py). +// (prop, setter) rows the generator may emit for a class; the arg +// form comes from the Inspector table's kind for that prop. + {"InstAnalogGauge", {{"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"needle-line-width", "set_needle_line_width"}, {"value", "set_value"}}}, + {"InstBarMeter", {{"amber-color", "set_amber_color"}, {"face-color", "set_face_color"}, {"green-color", "set_green_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"horizontal", "set_horizontal"}, {"marker-line-width", "set_marker_line_width"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstBeacon", {{"beacon-color", "set_beacon_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"flash-rate", "set_flash_rate"}, {"on", "set_on"}, {"phase", "set_phase"}}}, + {"InstBezel", {{"ink-color", "set_ink_color"}, {"panel-color", "set_panel_color"}, {"screw-color", "set_screw_color"}, {"screw-ring-color", "set_screw_ring_color"}, {"white-color", "set_white_color"}}}, + {"InstCircuitBreaker", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"panel-color", "set_panel_color"}, {"plate-color", "set_plate_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"lever-line-width", "set_lever_line_width"}}}, + {"InstControlPanel", {{"amber-color", "set_amber_color"}, {"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"panel-color", "set_panel_color"}, {"screw-color", "set_screw_color"}, {"screw-ring-color", "set_screw_ring_color"}, {"white-color", "set_white_color"}, {"grid-cols", "set_grid_cols"}, {"grid-rows", "set_grid_rows"}}}, + {"InstDigitalReadout", {{"amber-color", "set_amber_color"}, {"dark-color", "set_dark_color"}, {"ink-color", "set_ink_color"}, {"segment-off-color", "set_segment_off_color"}, {"segment-on-color", "set_segment_on_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstEmergencyStop", {{"amber-color", "set_amber_color"}, {"dark-color", "set_dark_color"}, {"red-color", "set_red_color"}, {"redlit-color", "set_redlit_color"}, {"surround-color", "set_surround_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstFlowMeter", {{"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstHorizontalTankLevel", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstKeySwitch", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"panel-color", "set_panel_color"}, {"plate-color", "set_plate_color"}, {"white-color", "set_white_color"}, {"key-in", "set_key_in"}, {"pointer-line-width", "set_pointer_line_width"}, {"positions", "set_positions"}}}, + {"InstLampTestButton", {{"bezel-color", "set_bezel_color"}, {"face-color", "set_face_color"}, {"face-down-color", "set_face_down_color"}, {"hover-color", "set_hover_color"}, {"white-color", "set_white_color"}}}, + {"InstLedBlue", {{"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lead-color", "set_lead_color"}, {"lens-color", "set_lens_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstLedDigits1", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedDigits2", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedDigits3", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedDigits4", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedDigits5", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedDigits6", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"decimal-places", "set_decimal_places"}, {"value", "set_value"}}}, + {"InstLedGreen", {{"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lead-color", "set_lead_color"}, {"lens-color", "set_lens_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstLedRed", {{"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lead-color", "set_lead_color"}, {"lens-color", "set_lens_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstLevelColumnGauge", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstLevelTransmitter", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstManometer", {{"blue-color", "set_blue_color"}, {"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstNameplate", {{"amber-color", "set_amber_color"}, {"dark-color", "set_dark_color"}, {"engraved-color", "set_engraved_color"}, {"grey-color", "set_grey_color"}, {"screw-color", "set_screw_color"}, {"screw-ring-color", "set_screw_ring_color"}, {"white-color", "set_white_color"}}}, + {"InstNeedleEdgewise", {{"bezel-color", "set_bezel_color"}, {"face-color", "set_face_color"}, {"needle-color", "set_needle_color"}, {"panel-color", "set_panel_color"}, {"red-color", "set_red_color"}, {"tick-color", "set_tick_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstNeedleKnifeEdge", {{"bezel-color", "set_bezel_color"}, {"face-color", "set_face_color"}, {"mirror-color", "set_mirror_color"}, {"needle-color", "set_needle_color"}, {"panel-color", "set_panel_color"}, {"red-color", "set_red_color"}, {"tick-color", "set_tick_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstNeedleTapered", {{"bezel-color", "set_bezel_color"}, {"face-color", "set_face_color"}, {"needle-color", "set_needle_color"}, {"panel-color", "set_panel_color"}, {"red-color", "set_red_color"}, {"tick-color", "set_tick_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstNeedleVu", {{"bezel-color", "set_bezel_color"}, {"face-color", "set_face_color"}, {"needle-color", "set_needle_color"}, {"panel-color", "set_panel_color"}, {"red-color", "set_red_color"}, {"tick-color", "set_tick_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"value", "set_value"}}}, + {"InstOpenChannelLevel", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"surface-color", "set_surface_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstPanelLampAmber", {{"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lens-color", "set_lens_color"}, {"ring-color", "set_ring_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstPanelLampBlue", {{"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lens-color", "set_lens_color"}, {"ring-color", "set_ring_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstPanelLampGreen", {{"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lens-color", "set_lens_color"}, {"ring-color", "set_ring_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstPanelLampRed", {{"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lens-color", "set_lens_color"}, {"ring-color", "set_ring_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstPanelLampWhite", {{"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"hover-color", "set_hover_color"}, {"lens-color", "set_lens_color"}, {"ring-color", "set_ring_color"}, {"white-color", "set_white_color"}, {"brightness", "set_brightness"}, {"on", "set_on"}}}, + {"InstPanelPlate", {{"amber-color", "set_amber_color"}, {"ink-color", "set_ink_color"}, {"panel-color", "set_panel_color"}, {"screw-color", "set_screw_color"}, {"screw-ring-color", "set_screw_ring_color"}, {"white-color", "set_white_color"}}}, + {"InstPressureGauge", {{"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"needle-line-width", "set_needle_line_width"}, {"value", "set_value"}}}, + {"InstPushButton", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"greenlit-color", "set_greenlit_color"}, {"red-color", "set_red_color"}, {"redlit-color", "set_redlit_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstPushButtonLatching", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"greenlit-color", "set_greenlit_color"}, {"redlit-color", "set_redlit_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstRgbStatusLed", {{"blue-channel-color", "set_blue_channel_color"}, {"dark-color", "set_dark_color"}, {"green-channel-color", "set_green_channel_color"}, {"hover-color", "set_hover_color"}, {"red-channel-color", "set_red_channel_color"}, {"swatch-outline-color", "set_swatch_outline_color"}, {"white-color", "set_white_color"}, {"all-on", "set_all"}, {"blue-on", "set_blue"}, {"brightness", "set_brightness"}, {"green-on", "set_green"}, {"red-on", "set_red"}}}, + {"InstRockerSwitch", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"dimred-color", "set_dimred_color"}, {"green-color", "set_green_color"}, {"panel-color", "set_panel_color"}, {"rocker-color", "set_rocker_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstRockerSwitchDouble", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"red-color", "set_red_color"}, {"rocker-color", "set_rocker_color"}, {"white-color", "set_white_color"}, {"position", "set_position"}}}, + {"InstRockerSwitchIlluminated", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"dimred-color", "set_dimred_color"}, {"green-color", "set_green_color"}, {"greenlit-color", "set_greenlit_color"}, {"red-color", "set_red_color"}, {"rocker-color", "set_rocker_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstRotarySelector", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"panel-color", "set_panel_color"}, {"plate-color", "set_plate_color"}, {"white-color", "set_white_color"}, {"pointer-line-width", "set_pointer_line_width"}, {"position", "set_position"}, {"positions", "set_positions"}}}, + {"InstSeg14Display1", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg14Display2", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg14Display3", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg14Display4", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg14Display5", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg14Display6", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display1", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display2", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display3", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display4", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display5", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSeg16Display6", {{"bezel-color", "set_bezel_color"}, {"dim-color", "set_dim_color"}, {"label-color", "set_label_color"}, {"lit-color", "set_lit_color"}, {"value", "set_value"}}}, + {"InstSightGlassLevel", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"steel-color", "set_steel_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstSlideSwitch", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"panel-color", "set_panel_color"}, {"rocker-color", "set_rocker_color"}, {"white-color", "set_white_color"}, {"on", "set_on"}}}, + {"InstSphericalTankLevel", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstStackLight", {{"amber-color", "set_amber_color"}, {"dark-color", "set_dark_color"}, {"green-color", "set_green_color"}, {"hover-color", "set_hover_color"}, {"red-color", "set_red_color"}, {"tier-outline-color", "set_tier_outline_color"}, {"white-color", "set_white_color"}, {"all-on", "set_all"}, {"amber-brightness", "set_amber_brightness"}, {"amber-on", "set_amber"}, {"green-brightness", "set_green_brightness"}, {"green-on", "set_green"}, {"red-brightness", "set_red_brightness"}, {"red-on", "set_red"}}}, + {"InstTankLevelAlarms", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstTemperatureGauge", {{"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"needle-line-width", "set_needle_line_width"}, {"value", "set_value"}}}, + {"InstToggleSwitch", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"greenlit-color", "set_greenlit_color"}, {"panel-color", "set_panel_color"}, {"plate-color", "set_plate_color"}, {"redlit-color", "set_redlit_color"}, {"white-color", "set_white_color"}, {"lever-line-width", "set_lever_line_width"}, {"on", "set_on"}}}, + {"InstToggleSwitchIlluminated", {{"amber-color", "set_amber_color"}, {"bezel-color", "set_bezel_color"}, {"dark-color", "set_dark_color"}, {"dimred-color", "set_dimred_color"}, {"greenlit-color", "set_greenlit_color"}, {"panel-color", "set_panel_color"}, {"plate-color", "set_plate_color"}, {"white-color", "set_white_color"}, {"lever-line-width", "set_lever_line_width"}, {"on", "set_on"}}}, + {"InstVerticalTankLevel", {{"amber-color", "set_amber_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"hover-color", "set_hover_color"}, {"ink-color", "set_ink_color"}, {"pale-color", "set_pale_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"alarm-hi", "set_alarm_hi"}, {"alarm-hi-hi", "set_alarm_hi_hi"}, {"alarm-lo", "set_alarm_lo"}, {"alarm-lo-lo", "set_alarm_lo_lo"}, {"level", "set_level"}}}, + {"InstVuMeter", {{"face-color", "set_face_color"}, {"ink-color", "set_ink_color"}, {"red-color", "set_red_color"}, {"white-color", "set_white_color"}, {"maximum", "set_range"}, {"minimum", "set_range"}, {"needle-line-width", "set_needle_line_width"}, {"value", "set_value"}}}, + {"StockAccumulationDistribution", {{"line-color", "set_line_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockAreaChart", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"line-color", "set_line_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockArrow", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockBaselineChart", {{"axis-color", "set_axis_color"}, {"baseline-color", "set_baseline_color"}, {"down-color", "set_down_color"}, {"down-fill-color", "set_down_fill_color"}, {"grid-color", "set_grid_color"}, {"line-color", "set_line_color"}, {"up-color", "set_up_color"}, {"up-fill-color", "set_up_fill_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"baseline", "set_baseline"}, {"line-width", "set_line_width"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockBrush", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockCandlestickChart", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockCorrelationView", {{"axis-color", "set_axis_color"}, {"corr-color", "set_corr_color"}, {"grid-color", "set_grid_color"}, {"scatter-color", "set_scatter_color"}, {"zero-line-color", "set_zero_line_color"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"window", "set_window"}}}, + {"StockEllipse", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockFibExtension", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"level-color", "set_level_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}}}, + {"StockFibRetracement", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"level-color", "set_level_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}}}, + {"StockHeikinAshi", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockHollowCandles", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockHorizontalLine", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockIndexedComparison", {{"base-line-color", "set_base_line_color"}, {"base-value", "set_base_value"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockLineChart", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"line-color", "set_line_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockMeasureTool", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockMoneyFlowChart", {{"down-color", "set_down_color"}, {"up-color", "set_up_color"}, {"zero-line-color", "set_zero_line_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockMultiSymbolChart", {{"axis-color", "set_axis_color"}, {"grid-color", "set_grid_color"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockOBVChart", {{"line-color", "set_line_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockOHLCBarChart", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockOverlayChart", {{"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockParallelChannel", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockPitchfork", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockPriceLabel", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}}}, + {"StockRatioChart", {{"line-color", "set_line_color"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockRectangle", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockRelativePerformance", {{"zero-line-color", "set_zero_line_color"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockRenko", {{"axis-color", "set_axis_color"}, {"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"up-color", "set_up_color"}, {"auto-y", "set_auto_y"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"brick-size", "set_brick_size"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}, {"y-max", "set_y_range"}, {"y-min", "set_y_range"}}}, + {"StockSectorComparison", {{"labels", "set_labels_text"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockSpreadChart", {{"line-color", "set_line_color"}, {"zero-line-color", "set_zero_line_color"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockTextAnnotation", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"fill-color", "set_fill_color"}, {"grid-color", "set_grid_color"}, {"text-color", "set_text_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"annotation-text", "set_annotation_text"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}}}, + {"StockTrendline", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockVWAP", {{"line-color", "set_line_color"}, {"vwap-color", "set_vwap_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockVerticalLine", {{"axis-color", "set_axis_color"}, {"candle-down-color", "set_candle_down_color"}, {"candle-up-color", "set_candle_up_color"}, {"color", "set_color"}, {"grid-color", "set_grid_color"}, {"anchor-1-bar", "set_anchors"}, {"anchor-1-price", "set_anchors"}, {"anchor-2-bar", "set_anchors"}, {"anchor-2-price", "set_anchors"}, {"anchor-3-bar", "set_anchors"}, {"anchor-3-price", "set_anchors"}, {"axis-height", "set_axis_h"}, {"axis-width", "set_axis_w"}, {"line-width", "set_line_width"}}}, + {"StockVolumeBars", {{"down-color", "set_down_color"}, {"grid-color", "set_grid_color"}, {"line-color", "set_line_color"}, {"up-color", "set_up_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockVolumeCandles", {{"down-color", "set_down_color"}, {"up-color", "set_up_color"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + {"StockVolumeProfile", {{"line-color", "set_line_color"}, {"poc-color", "set_poc_color"}, {"bins", "set_bins"}, {"symbol", "set_symbol"}, {"view-count", "set_view_count"}, {"view-first", "set_view_first"}}}, + }; + +// Phase 4: classes with set_bg_color(Srgb) (generated by +// tools/gen_phase4_props.py). The common "background" +// prop is emitted through set_bg_color for these. +static const std::vector kPhase4BgColor = { + "InstLedDigits1", + "InstLedDigits2", + "InstLedDigits3", + "InstLedDigits4", + "InstLedDigits5", + "InstLedDigits6", + "InstSeg14Display1", + "InstSeg14Display2", + "InstSeg14Display3", + "InstSeg14Display4", + "InstSeg14Display5", + "InstSeg14Display6", + "InstSeg16Display1", + "InstSeg16Display2", + "InstSeg16Display3", + "InstSeg16Display4", + "InstSeg16Display5", + "InstSeg16Display6", + "StockAccumulationDistribution", + "StockAreaChart", + "StockArrow", + "StockBaselineChart", + "StockBrush", + "StockCandlestickChart", + "StockCorrelationView", + "StockEllipse", + "StockFibExtension", + "StockFibRetracement", + "StockHeikinAshi", + "StockHollowCandles", + "StockHorizontalLine", + "StockIndexedComparison", + "StockLineChart", + "StockMeasureTool", + "StockMoneyFlowChart", + "StockMultiSymbolChart", + "StockOBVChart", + "StockOHLCBarChart", + "StockOverlayChart", + "StockParallelChannel", + "StockPitchfork", + "StockPriceLabel", + "StockRatioChart", + "StockRectangle", + "StockRelativePerformance", + "StockRenko", + "StockSectorComparison", + "StockSpreadChart", + "StockTextAnnotation", + "StockTrendline", + "StockVWAP", + "StockVerticalLine", + "StockVolumeBars", + "StockVolumeCandles", + "StockVolumeProfile", +}; + +// Resolve the XFrame class name for a Phase 4 lookup: snapshot +// projects carry the class name; the StockChart palette key maps to +// its class. "" when the widget is not a Stock/Inst class. +static std::string phase4_class(const Widget& w, + const std::string& kind, + const std::string& t) { + if (t == "StockChart") return "StockCandlestickChart"; + if (!kind.empty()) return ""; + std::string cls = w.type; + if (cls.rfind("xframe::", 0) == 0) cls = cls.substr(8); + return cls; +} + static void emit_widget_props(std::ostringstream& o, const Widget& w, const XFrameMap& m, const std::string& var) { // Fix 6: snapshot projects carry the XFrame class name; the branches @@ -1201,12 +1392,9 @@ static void emit_widget_props(std::ostringstream& o, const Widget& w, // StockCandlestickChart draws its seeded preview series; the old // GTK chart's CSV/indicator/drawing engine has no counterpart in // the XFrame widget API, so the design data is recorded here for - // hand-wiring instead of silently dropped. - std::string up = prop_rgb_args(w, "up-color"); - std::string down = prop_rgb_args(w, "down-color"); - if (!up.empty()) emit_color_call(o, var, "set_up_color", true, up); - if (!down.empty()) - emit_color_call(o, var, "set_down_color", true, down); + // hand-wiring instead of silently dropped. (The chart's own + // colours/params -- up/down colour, grid, view, y-range -- are + // emitted by the generic Phase 4 loop below.) if (has("data-file") || has("indicators") || has("drawings") || has("compare-files") || w.props.count("scale-mode")) { o << " // NOTE: StockChart design data not representable " @@ -1249,11 +1437,114 @@ static void emit_widget_props(std::ostringstream& o, const Widget& w, << "\" is not representable through the XGraph API.\n"; } + // Phase 4: Stock/Instrumentation generic emission. One call per + // Inspector-table prop the widget actually has, gated by the + // capability table (so a prop is never emitted for a class whose + // widget lacks the setter) and by the table kind (so "value" emits + // set_value(double) for gauges and set_value("...") for Seg displays). + { + std::string cls = phase4_class(w, kind, t); + auto cit = cls.empty() ? kPhase4Caps.end() : kPhase4Caps.find(cls); + if (cit != kPhase4Caps.end()) { + // Pairs first: one setter takes two values, so both props + // are emitted together from the model. + if (w.props.count("minimum") || w.props.count("maximum")) + o << " " << var << ".w.set_range(" + << fmt_double(prop_or(w, "minimum", "0")) << ", " + << fmt_double(prop_or(w, "maximum", "100")) << ");\n"; + if (w.props.count("y-min") || w.props.count("y-max")) + o << " " << var << ".w.set_y_range(" + << fmt_double(prop_or(w, "y-min", "0")) << ", " + << fmt_double(prop_or(w, "y-max", "1")) << ");\n"; + // Anchors: all six components -> set_anchors3; otherwise + // one set_anchor(i, bar, price) per anchor whose two + // components are both present (never silently reset a + // sibling anchor). + bool all6 = w.props.count("anchor-1-bar") && + w.props.count("anchor-1-price") && + w.props.count("anchor-2-bar") && + w.props.count("anchor-2-price") && + w.props.count("anchor-3-bar") && + w.props.count("anchor-3-price"); + if (all6) { + o << " " << var << ".w.set_anchors3(" + << prop_int(w, "anchor-1-bar", 0) << ", " + << fmt_double(prop_or(w, "anchor-1-price", "100")) << ", " + << prop_int(w, "anchor-2-bar", 10) << ", " + << fmt_double(prop_or(w, "anchor-2-price", "100")) << ", " + << prop_int(w, "anchor-3-bar", 20) << ", " + << fmt_double(prop_or(w, "anchor-3-price", "100")) + << ");\n"; + } else { + for (int i = 1; i <= 3; ++i) { + std::string bar_key = + "anchor-" + std::to_string(i) + "-bar"; + std::string price_key = + "anchor-" + std::to_string(i) + "-price"; + if (!w.props.count(bar_key) || + !w.props.count(price_key)) + continue; + o << " " << var << ".w.set_anchor(" << (i - 1) + << ", " << prop_int(w, bar_key, (i - 1) * 10) << ", " + << fmt_double(prop_or(w, price_key, "100")) + << ");\n"; + } + } + for (const auto& row : cit->second) { + const std::string& prop = row.first; + const std::string& setter = row.second; + if (prop == "text") continue; // shared path above + if (prop == "minimum" || prop == "maximum" || + prop == "y-min" || prop == "y-max" || + prop.rfind("anchor-", 0) == 0) + continue; // pairs, emitted above + if (!w.props.count(prop)) continue; + const PropDef* d = find_prop(cls, prop); + if (!d) continue; + if (d->kind == PropKind::Color) { + std::string rgb = prop_rgb_args(w, prop); + if (!rgb.empty()) + emit_color_call(o, var, setter, true, rgb); + } else if (d->kind == PropKind::Double) { + o << " " << var << ".w." << setter << "(" + << fmt_double(prop_or(w, prop, d->def ? d->def : "0")) + << ");\n"; + } else if (d->kind == PropKind::Int) { + o << " " << var << ".w." << setter << "(" + << prop_int(w, prop, d->def ? std::atoi(d->def) : 0) + << ");\n"; + } else if (d->kind == PropKind::Str) { + o << " " << var << ".w." << setter << "(\"" + << esc_c(prop_or(w, prop, d->def ? d->def : "")) + << "\");\n"; + } else { + // Bool (no Enum props in the Phase 4 tables). + o << " " << var << ".w." << setter << "(" + << (prop_bool(w, prop, + d->def && std::string(d->def) == "true") + ? "true" : "false") + << ");\n"; + } + } + } + } + // Common background / foreground: direct setter where the class has // one, otherwise the per-widget style clone (emitted above). if (m.fill[0]) { std::string rgb = prop_rgb_args(w, "background"); if (!rgb.empty()) emit_color_call(o, var, m.fill, m.fill_srgb, rgb); + } else { + // Phase 4: the map has no fill setter for Stock/Inst classes; + // those with set_bg_color take the background through it. + std::string rgb = prop_rgb_args(w, "background"); + if (!rgb.empty()) { + std::string cls = phase4_class(w, kind, t); + if (!cls.empty() && + std::find(kPhase4BgColor.begin(), kPhase4BgColor.end(), + cls) != kPhase4BgColor.end()) + emit_color_call(o, var, "set_bg_color", true, rgb); + } } if (m.text[0]) { std::string rgb = prop_rgb_args(w, "foreground");