Skip to content

Commit

Permalink
spec: refactor AcDbMTextObjectEmbedded to SUBCLASS
Browse files Browse the repository at this point in the history
functions can return errors, and we can still continue
outside the subclass.
  • Loading branch information
rurban committed Oct 13, 2024
1 parent cc25852 commit cdce987
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 106 deletions.
6 changes: 2 additions & 4 deletions doc/dynapi.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2077,9 +2077,9 @@ Dwg_AcDbMTextObjectEmbedded
@item is_really_locked
B
@item annotative_data_size
BS, DXF 70
BS
@item annotative_data
TF
RC*
@item annotative_flag
BS
@item annotative_style
Expand Down Expand Up @@ -13214,8 +13214,6 @@ H
@indentedblock
@vtable @code

@item is_really_locked
B
@item attachment
BL
@item ins_pt
Expand Down
1 change: 1 addition & 0 deletions examples/alldwg.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13358,3 +13358,4 @@
{ "WIPEOUT", "statika_from_uloz.to_2000.log", 0xF951, "8E9C2168D4B6A334124DACCD6C413FFB02001812B78F099DD02A0000000000301C902000000000000F03F000000000000F03F43E64640081208000000000001C17E000000000001C17E000000000001C17E000000000001C07E000000000001C07E000000000001C07E000000000001C07E000000000001C17F82046080C0A6167C84A6167C50A0608", NULL, 1, 1092, 1314, 989, 0, 0, 2303 },
{ "WIPEOUT", "statika_from_uloz.to_2000.log", 0xF955, "88FA7E4F0BD6B334124DACCD6C413FFB02003408A7AB3F9CD02A0000000000301C902000000000000F03F000000000000F03F43E646400812099C1800000001C17E000000000001C07ECBCDFFFFFFFFBE7E000000000001C07ECBCDFFFFFFFFBE7E000000000001C17F9C1800000001C17E000000000001C17F820C60A6167C84A6167C50A0608", NULL, 1, 1076, 1314, 989, 0, 0, 2303 },
{ "ATTDEF", "AecObjects_from_ACadSharp_2018.log", 0x2F7F, "E00087A00000F82B5E8F00FEA5AA0CCCCCCCCCCCFCCFD084169015504A10D400001F056BD1E01FD555000010452004F004F004D0041148013C013C01340111530050004100430045004F0042004A0045004300", "test/test-old/2018/from_ACadSharp/AecObjects.dxf", NULL, 1, 664, 38, 11909, 1430, 0, 664 },
{ "ATTDEF", "AecObjects1.log", 0x2AF3, "80008780000000000000040003011F85E853C8FC0000000000000040A5A0000000000000010000000000000000400BCCCCCCCCCCFCCFD084142F3333333333F33F11A4891264890CD01015504A10D0000000", "test/test-old/2018/from_ACadSharp/AecObjects1.dxf", NULL, 1, 664, 38, 11909, 1430, 0, 664 },
1 change: 1 addition & 0 deletions examples/alldxf_0.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2226,3 +2226,4 @@
"\200\000\000\012\000\303\021\274\000\000\000\002\000\051\340\037\002\017\116\330\103\274\136\210\320\011\004\141\105\133\176\240\354\010\220\106\024\125\267\352\016\100\017\116\330\103\274\136\210\320\040\000\000\000\000\000\017\003\360\000\000\000\000\000\017\003\364\036\144\144\000\100\221\040\000\000\002\013\303\034\053\360\000\000\014\016\153\175\353\360\000\000\000\002\225\331\143\360\000\000\000\000\000\016\013\360\000\000\003\011\241\014\323\360\000\000\000\006\350\255\313\360\000\000\014\210\266\375\123\360\000\000\012\006\374\315\173\360\000\000\005\206\236\315\303\360\000\000\010\006\050\314\273\360\000\000\001\011\130\355\343\360\000\000\010\001\064\114\073\360\000\000\011\007\157\135\363\360\000\000\000\005\156\332\053\360\000\000\015\012\070\155\363\360\000\000\010\006\143\073\163\360\000\000\006\002\331\135\303\360\000\000\000\006\041\034\323\360\000\000\013\207\363\155\143\360\000\000\004\007\342\115\163\360\000\000\017\010\076\214\103\360\000\000\004\003\265\175\343\360\000\000\000\014\123\072\113\360\000\000\000\000\000\016\003\360\000\000\012\005\222\074\333\360\000\000\006\000\131\275\303\360\000\000\013\010\352\055\213\360\000\000\012\015\231\075\103\360\000\000\011\202\216\055\333\360\000\000\010\017\166\134\163\360\000\000\000\000\000\016\013\360\000\000\000\005\056\332\033\360\000\000\016\207\112\155\273\360\000\000\016\015\163\255\013\360\000\000\014\207\252\335\113\360\000\000\004\011\247\315\213\366\010\062\222\020\072\201\207\007", 1, 2955, 3891, 2903, 0, 0, 679, NULL },
// name, dxf, handle, bytes, is_entity, num_bits, commonsize, hdloff, strsize, hdlsize, bitsize, fieldptr
{ "ATTDEF", "test/test-old/2018/from_ACadSharp/AecObjects.dxf", 0x2F7F, "E00087A00000F82B5E8F00FEA5AA0CCCCCCCCCCCFCCFD084169015504A10D400001F056BD1E01FD555000010452004F004F004D0041148013C013C01340111530050004100430045004F0042004A0045004300540053003A004E0041004D0045004254801BC01BC01B4008001B8018401B401940120005", 1, 947, 0, 0, 0, 0, 947, NULL },
{ "ATTDEF", "test/test-old/2018/from_ACadSharp/AecObjects1.dxf", 0x2AF3, "80008780000000000000040003011F85E853C8FC0000000000000040A5A0000000000000010000000000000000400BCCCCCCCCCCFCCFD084142F3333333333F33F11A4891264890CD01015504A10D0000000", 1, 82*8, 0, 0, 0, 0, 947, NULL },
1 change: 1 addition & 0 deletions examples/alldxf_2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1113,3 +1113,4 @@ unknown_dxf[1108].fields = unknown_dxf_WIPEOUT_1108;
unknown_dxf[1109].fields = unknown_dxf_WIPEOUT_1109;
unknown_dxf[1110].fields = unknown_dxf_WIPEOUT_1110;
unknown_dxf[1111].fields = unknown_dxf_ATTDEF_2F7F;
unknown_dxf[1112].fields = unknown_dxf_ATTDEF_2AF3;
55 changes: 55 additions & 0 deletions examples/alldxf_ATTDEF.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- */
/* generated by make regen-unknown, do not modify */

// code, value, bits, pre_bits, num_bits, type, name, num, pos[]
/* ATTDEF 103F45F in test/test-old/2018/from_ACadSharp/AecObjects.dxf */
static struct _unknown_field unknown_dxf_ATTDEF_2F7F[] = {
//bitsize=947
//handle=2F7F
//offsets=947, 64,1274,584, 0. len=947
// { "ATTDEF", "AecObjects_from_ACadSharp_2018.log", 0x2F7F, "E00087A00000F82B5E8F00FEA5AA0CCCCCCCCCCCFCCFD084169015504A10D400001F056BD1E01FD555000010452004F004F004D0041148013C013C01340111530050004100430045004F0042004A0045004300540053003A004E0041004D0045004254801BC01BC01B4008001B8018401B401940120005", "test/test-old/2018/from_ACadSharp/AecObjects.dxf", 1, 14112, 38, 11909, 1430, 0, 11947 },
{ 101, "Embedded Object", NULL, 0, BITS_UNKNOWN, "", 1, {-1,-1,-1,-1,-1} },
{ 10, "-2.2", NULL, 0, BITS_BD, "ins_pt.x", 1, {-1,-1,-1,-1,-1} },
{ 20, "0.1300000000010186", NULL, 0, BITS_BD, "ins_pt.y", 1, {-1,-1,-1,-1,-1} },
{ 30, "0.0", NULL, 0, BITS_BD, "ins_pt.z", 1, {-1,-1,-1,-1,-1} },
{ 11, "0.0", NULL, 0, BITS_BD, "x_axis_dir.x", 1, {-1,-1,-1,-1,-1} },
{ 21, "0.1300000000010186", NULL, 0, BITS_BD, "x_axis_dir.y", 1, {-1,-1,-1,-1,-1} },
{ 31, "0.0", NULL, 0, BITS_BD, "x_axis_dir.z", 1, {-1,-1,-1,-1,-1} },
{ 40, "1.199999999999999", NULL, 0, BITS_BD, "rect_width", 1, {-1,-1,-1,-1,-1} },
{ 41, "0.0", NULL, 0, BITS_BD, "rect_height", 1, {-1,-1,-1,-1,-1} },
{ 42, "0.0", NULL, 0, BITS_BD, "extents_width", 1, {-1,-1,-1,-1,-1} },
{ 43, "0.0", NULL, 0, BITS_BD, "extents_height", 1, {-1,-1,-1,-1,-1} },
{ 71, "8", NULL, 0, BITS_UNKNOWN, "column_type", 1, {-1,-1,-1,-1,-1} },
{ 72, "5", NULL, 0, BITS_UNKNOWN, "num_column_heights", 1, {-1,-1,-1,-1,-1} },
{ 46, "0.0", NULL, 0, BITS_BD, "column_heights", 5, {-1,-1,-1,-1,-1} },
{ 73, "1", NULL, 0, BITS_UNKNOWN, "auto_height", 1, {-1,-1,-1,-1,-1} },
{ 44, "1.0", NULL, 0, BITS_BD, "column_width", 1, {-1,-1,-1,-1,-1} },
{ 2, "SPACEOBJECTS:NAME", NULL, 0, BITS_TU, "tag", 1, {-1,-1,-1,-1,-1} },
{ 3, "Room name", NULL, 0, BITS_TU, "prompt", 1, {-1,-1,-1,-1,-1} },
{ 1, "ROOM", NULL, 0, BITS_TU, "default_value", 1, {-1,-1,-1,-1,-1} },
};
static struct _unknown_field unknown_dxf_ATTDEF_2AF3[] = {
//bitsize=947
//handle=2AF3
//offsets=947, 64,1274,584, 0. len=947
// { "ATTDEF", "AecObjects_from_ACadSharp_2018.log", 0x2AF3, "E00087A00000F82B5E8F00FEA5AA0CCCCCCCCCCCFCCFD084169015504A10D400001F056BD1E01FD555000010452004F004F004D0041148013C013C01340111530050004100430045004F0042004A0045004300540053003A004E0041004D0045004254801BC01BC01B4008001B8018401B401940120005", "test/test-old/2018/from_ACadSharp/AecObjects.dxf", 1, 14112, 38, 11909, 1430, 0, 11947 },
{ 101, "Embedded Object", NULL, 0, BITS_UNKNOWN, "", 1, {-1,-1,-1,-1,-1} },
{ 10, "2.0", NULL, 0, BITS_BD, "ins_pt.x", 1, {-1,-1,-1,-1,-1} },
{ 20, "1.1300000000010186", NULL, 0, BITS_BD, "ins_pt.y", 1, {-1,-1,-1,-1,-1} },
{ 30, "2.0", NULL, 0, BITS_BD, "ins_pt.z", 1, {-1,-1,-1,-1,-1} },
{ 11, "0.0", NULL, 0, BITS_BD, "x_axis_dir.x", 1, {-1,-1,-1,-1,-1} },
{ 21, "0.1300000000010186", NULL, 0, BITS_BD, "x_axis_dir.y", 1, {-1,-1,-1,-1,-1} },
{ 31, "0.0", NULL, 0, BITS_BD, "x_axis_dir.z", 1, {-1,-1,-1,-1,-1} },
{ 40, "1.199999999999999", NULL, 0, BITS_BD, "rect_width", 1, {-1,-1,-1,-1,-1} },
{ 41, "2.0", NULL, 0, BITS_BD, "rect_height", 1, {-1,-1,-1,-1,-1} },
{ 42, "0.0", NULL, 0, BITS_BD, "extents_width", 1, {-1,-1,-1,-1,-1} },
{ 43, "0.0", NULL, 0, BITS_BD, "extents_height", 1, {-1,-1,-1,-1,-1} },
{ 71, "8", NULL, 0, BITS_UNKNOWN, "column_type", 1, {-1,-1,-1,-1,-1} },
{ 72, "5", NULL, 0, BITS_UNKNOWN, "num_column_heights", 1, {-1,-1,-1,-1,-1} },
{ 46, "2.0", NULL, 0, BITS_BD, "column_heights", 5, {-1,-1,-1,-1,-1} },
{ 73, "1", NULL, 0, BITS_UNKNOWN, "auto_height", 1, {-1,-1,-1,-1,-1} },
{ 44, "1.0", NULL, 0, BITS_BD, "column_width", 1, {-1,-1,-1,-1,-1} },
{ 2, "SPACEOBJECTS:NAME1", NULL, 0, BITS_TU, "tag", 1, {-1,-1,-1,-1,-1} },
{ 3, "Room name1", NULL, 0, BITS_TU, "prompt", 1, {-1,-1,-1,-1,-1} },
{ 1, "ROOM1", NULL, 0, BITS_TU, "default_value", 1, {-1,-1,-1,-1,-1} },
};
7 changes: 3 additions & 4 deletions include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,6 @@ typedef struct _dwg_entity_TEXT
*/
typedef struct _dwg_AcDbMTextObjectEmbedded
{
BITCODE_B is_really_locked; /*<! DXF 70 */
BITCODE_BL attachment; /*<! DXF 70 */
BITCODE_3BD ins_pt; /*!< DXF 10 */
BITCODE_3BD x_axis_dir; /*!< DXF 11 */
Expand Down Expand Up @@ -1397,7 +1396,7 @@ typedef struct _dwg_entity_ATTRIB
BITCODE_H style;
BITCODE_RC mtext_type; /* R2018+ */
Dwg_AcDbMTextObjectEmbedded mtext;
BITCODE_B is_really_locked; /* R2018+ */
BITCODE_B is_really_locked; /*<! DXF 70 */
BITCODE_BS annotative_data_size;/* R2018+ */
BITCODE_RC* annotative_data; /* R2018+ */
BITCODE_BS annotative_flag; /* R2018+ */
Expand Down Expand Up @@ -1440,7 +1439,7 @@ typedef struct _dwg_entity_ATTDEF
BITCODE_H style;
BITCODE_RC mtext_type; /* R2018+ */
Dwg_AcDbMTextObjectEmbedded mtext;
BITCODE_B is_really_locked; /* R2018+ */
BITCODE_B is_really_locked; /*<! DXF 70 */
BITCODE_BS annotative_data_size;/* R2018+ */
BITCODE_RC* annotative_data; /* R2018+ */
BITCODE_BS annotative_flag; /* R2018+ */
Expand Down Expand Up @@ -4912,7 +4911,7 @@ typedef struct _dwg_entity_GEOPOSITIONMARKER
BITCODE_B mtext_visible; /*!< DXF 290 */
BITCODE_B enable_frame_text; /*!< DXF 290 */
Dwg_AcDbMTextObjectEmbedded mtext;
BITCODE_B is_really_locked; /* R2018+ */
BITCODE_B is_really_locked; /*<! DXF 70 */
BITCODE_BS annotative_data_size;/* R2018+ */
BITCODE_RC* annotative_data; /* R2018+ */
BITCODE_BS annotative_flag; /* R2018+ */
Expand Down
Loading

0 comments on commit cdce987

Please sign in to comment.