diff --git a/src/web/vaev-base/page.h b/src/web/vaev-base/page.h index 3468c2f..0b2b769 100644 --- a/src/web/vaev-base/page.h +++ b/src/web/vaev-base/page.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace Vaev { // https://drafts.csswg.org/css-page/#marks @@ -7,37 +9,38 @@ enum struct PageMarks { NONE, CROSS, BOX, + + _LEN, }; // https://drafts.csswg.org/css-page/#margin-boxes -enum struct PageMargin { - NONE, +#define FOREACH_PAGE_MARGIN(ITER) \ + ITER(TOP, "top") \ + ITER(TOP_LEFT_CORNER, "top-left-corner") \ + ITER(TOP_LEFT, "top-left") \ + ITER(TOP_CENTER, "top-center") \ + ITER(TOP_RIGHT, "top-right") \ + ITER(TOP_RIGHT_CORNER, "top-right-corner") \ + ITER(RIGHT, "right") \ + ITER(RIGHT_TOP, "right-top") \ + ITER(RIGHT_MIDDLE, "right-middle") \ + ITER(RIGHT_BOTTOM, "right-bottom") \ + ITER(BOTTOM, "bottom") \ + ITER(BOTTOM_RIGHT_CORNER, "bottom-right-corner") \ + ITER(BOTTOM_RIGHT, "bottom-right") \ + ITER(BOTTOM_CENTER, "bottom-center") \ + ITER(BOTTOM_LEFT, "bottom-left") \ + ITER(BOTTOM_LEFT_CORNER, "bottom-left-corner") \ + ITER(LEFT, "left") \ + ITER(LEFT_BOTTOM, "left-bottom") \ + ITER(LEFT_MIDDLE, "left-middle") \ + ITER(LEFT_TOP, "left-top") - TOP, // NOSPEC: Parent of top-left, top-center, and top-right - TOP_LEFT_CORNER, - TOP_LEFT, - TOP_CENTER, - TOP_RIGHT, - TOP_RIGHT_CORNER, - - RIGHT, // NOSPEC: Parent of top-right, right-middle, and right-bottom - RIGHT_TOP, - RIGHT_MIDDLE, - RIGHT_BOTTOM, - - BOTTOM, // NOSPEC: Parent of bottom-left, bottom-center, and bottom-right - BOTTOM_RIGHT_CORNER, - BOTTOM_RIGHT, - BOTTOM_CENTER, - BOTTOM_LEFT, - BOTTOM_LEFT_CORNER, - - LEFT, // NOSPEC: Parent of bottom-left, left-middle, and left-top - LEFT_BOTTOM, - LEFT_MIDDLE, - LEFT_TOP, - - _LEN, +enum struct PageMargin { +#define ITER(ID, ...) ID, + FOREACH_PAGE_MARGIN(ITER) +#undef ITER + _LEN, }; // https://drafts.csswg.org/css-page/#page-orientation-prop @@ -49,4 +52,8 @@ enum struct PageOrientation { _LEN }; +struct Page { + Opt margin; +}; + } // namespace Vaev