feat(document): deprecate the four drawing element types - #818
Closed
andiwand wants to merge 1 commit into
Closed
Conversation
`Rect`, `Line`, `Circle` and `CustomShape`, their `ElementType` values and the matching `Element::as_*` collapse into `Frame`, which gains a shape kind. Only the odf parser ever produced them; the other five engines already funnel every shape into `frame`. Towards #773. New `ODR_DEPRECATED` in `definitions.hpp` carries the attribute, and expands to nothing under `ODR_INTERNAL_BUILD` so the library, the tests and the bindings keep serving what they deprecate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8WoFb87bkWF7sow8zeRHe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
The deprecation half of #773. Nothing changes at runtime, and no emitted html
moves — this only marks what the follow-up removes, so consumers get a release
that warns before the one that breaks.
What is deprecated
ElementType::rect,::line,::circle,::custom_shapeodr::Rect,odr::Line,odr::Circle,odr::CustomShapeElement::as_rect(),::as_line(),::as_circle(),::as_custom_shape()Mirrored in the bindings:
@Deprecatedon the Java classes,ElementTypeconstants and
Element.as*methods;DEPRECATED_MSG_ATTRIBUTEon the ObjCinterfaces and
ODRElementTypevalues; docstrings on the pybind classes,enumerators and methods. Wasm binds no element types, so it is untouched.
The replacement lands in the stacked breaking PR:
Framegains aShapeType shape_type()discriminator plus the geometry the four classescarried, and the odf parser maps every
draw:*shape onto it.frameisalready the generic-shape element in five of the six engines — only odf ever
produced the other four.
ODR_DEPRECATED[[deprecated]]on an api the library itself renders through would fail CI,which builds with
-Werror. Sodefinitions.hppgainsand
ODR_INTERNAL_BUILDis setPRIVATEonodr,odr_test,odr_jni,pyodr_coreandodr_apple— the library and its own mirrors, which have tokeep serving what they deprecate. Consumers building against the installed
headers get the attribute.
ODRDocumentElement.mmneeds one file-scope-Wdeprecated-declarationspragma on top, for the ObjC attributes the macrodoes not reach.
This also gives the repo's existing doc-comment-only deprecations
(
html.hpp,global_params.hpp) somewhere to grow a real attribute.Verified
-Werrorbuild with-DODR_TEST=ON -DODR_JNI=ON -DODR_PYTHON=ON: clean.ODRDocumentElement.mmsyntax-checked with-Werrorseparately (the appletarget is not in that job).
ODR_INTERNAL_BUILDwarns on all three kindsof use — the enumerator, the
as_*and the class.odr_test, odf and html filters: 67 passing.