Skip to content

GTK2 deprecation: document and plan migration to standalone color type#4

Open
rampageservices wants to merge 2 commits into
developfrom
fix/gtk2-deprecation
Open

GTK2 deprecation: document and plan migration to standalone color type#4
rampageservices wants to merge 2 commits into
developfrom
fix/gtk2-deprecation

Conversation

@rampageservices
Copy link
Copy Markdown

Summary

  • Documents GTK2 EOL impact on libgerbv public API
  • GdkColor (16-bit, no alpha) is deprecated — GTK3 uses GdkRGBA
  • gerbv.h forces GTK2 linkage even for headless/library usage

Proposed 3-phase fix

  1. Replace GdkColor with gerbv_color_t (float RGBA, no GTK dep)
  2. Remove #include <gtk/gtk.h> from gerbv.h — move to GUI-only sources
  3. Add headless build optionGERBV_HEADLESS=ON for server-side rendering

Current workaround

Used in Parts Studio gerbv-render.c:

project->file[f]->color.red = ((color >> 24) & 0xFF) * 257;  // 8-bit → 16-bit
project->file[f]->alpha = (gushort)(((color) & 0xFF) * 257);  // separate field

See GTK2_DEPRECATION.md for full details.

GdkColor (16-bit, no alpha) is deprecated in favor of GdkRGBA.
GTK2 is EOL since GTK3. Proposes 3-phase fix: standalone color struct,
remove GTK include from gerbv.h, optional headless build.
Documents current workaround used in Parts Studio gerbv-render.
… (Phase 1)

Introduces gerbv_color_t with normalized float RGBA (0.0-1.0) to gerbv.h
as a GTK-independent color type. Adds GERBV_COLOR_FROM_GDK() and
GERBV_COLOR_TO_GDK() macros for backward-compatible conversion.

No ABI break — existing GdkColor fields are unchanged. This is the
non-breaking foundation for Phase 2 (replacing GdkColor in structs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant