diff --git a/doc/dynapi.texi b/doc/dynapi.texi index 37642cb2d..a1f1d32a2 100644 --- a/doc/dynapi.texi +++ b/doc/dynapi.texi @@ -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 @@ -13214,8 +13214,6 @@ H @indentedblock @vtable @code -@item is_really_locked -B @item attachment BL @item ins_pt diff --git a/examples/alldwg.inc b/examples/alldwg.inc index f6c8f01d4..9ef0bf851 100644 --- a/examples/alldwg.inc +++ b/examples/alldwg.inc @@ -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 }, diff --git a/examples/alldxf_0.inc b/examples/alldxf_0.inc index d14b69855..d942d3a44 100644 --- a/examples/alldxf_0.inc +++ b/examples/alldxf_0.inc @@ -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 }, diff --git a/examples/alldxf_2.inc b/examples/alldxf_2.inc index 01d82c594..b90655a51 100644 --- a/examples/alldxf_2.inc +++ b/examples/alldxf_2.inc @@ -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; diff --git a/examples/alldxf_ATTDEF.inc b/examples/alldxf_ATTDEF.inc new file mode 100644 index 000000000..8f45a5659 --- /dev/null +++ b/examples/alldxf_ATTDEF.inc @@ -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} }, +}; diff --git a/include/dwg.h b/include/dwg.h index 70b353c9c..c7b485b95 100644 --- a/include/dwg.h +++ b/include/dwg.h @@ -1343,7 +1343,6 @@ typedef struct _dwg_entity_TEXT */ typedef struct _dwg_AcDbMTextObjectEmbedded { - BITCODE_B is_really_locked; /* 0) \ - { \ - /*FIELD_TF (annotative_data, _obj->annotative_data_size, 0);*/ \ - SUB_FIELD_BS (mtext, attachment, 70); \ - DEBUG_HERE_OBJ \ - SUB_FIELD_3BD (mtext, ins_pt, 10); \ - SUB_FIELD_3BD (mtext, x_axis_dir, 11); \ - SUB_FIELD_BD (mtext, rect_height, 41); \ - SUB_FIELD_BD (mtext, rect_width, 40); /* 1.2: @112 */ \ - /*SUB_FIELD_BD (mtext, extents_width, 42); \ - SUB_FIELD_BD (mtext, extents_height, 43);*/ \ - SUB_FIELD_BS (mtext, column_type, 71); /* 8: @180 */ \ - /*SUB_VALUEOUTOFBOUNDS (mtext, column_type, 2)*/ \ - if (SUB_FIELD_VALUE (mtext, column_type)) \ +#define AcDbMTextObjectEmbedded_fields \ + FIELD_B (is_really_locked, 0); \ + DXF \ + { \ + FIELD_BD (alignment_pt.x, 11); \ + FIELD_BD (alignment_pt.y, 21); \ + VALUE_RD (0.0, 31); \ + VALUE_TFF ("Embedded Object", 101); \ + FIELD_BD (ins_pt.x, 10); \ + FIELD_BD (ins_pt.y, 20); \ + VALUE_RD (0.0, 30); \ + SUB_FIELD_BD (mtext, rect_width, 40); \ + SUB_FIELD_BD (mtext, rect_height, 41); \ + SUB_FIELD_BL (mtext, column_type, 71); \ + SUB_VALUEOUTOFBOUNDS (mtext, column_type, 2) \ + if (SUB_FIELD_VALUE (mtext, column_type)) \ + { \ + SUB_FIELD_BL (mtext, num_column_heights, 72); \ + SUB_FIELD_BD (mtext, column_width, 44); \ + SUB_FIELD_BD (mtext, gutter, 45); \ + SUB_FIELD_B (mtext, auto_height, 73); \ + SUB_FIELD_B (mtext, flow_reversed, 74); \ + if (!SUB_FIELD_VALUE (mtext, auto_height) \ + && SUB_FIELD_VALUE (mtext, column_type) == 2) \ + { \ + SUB_FIELD_VECTOR (mtext, column_heights, BD, \ + num_column_heights, 46); \ + } \ + } \ + } \ + else \ + { \ + FIELD_BS (annotative_data_size, 70); \ + if (FIELD_VALUE (annotative_data_size) > 0) \ + { \ + /*FIELD_TF (annotative_data, _obj->annotative_data_size, 0);*/ \ + SUB_FIELD_BS (mtext, attachment, 70); \ + DEBUG_HERE_OBJ \ + SUB_FIELD_3BD (mtext, ins_pt, 10); \ + SUB_FIELD_3BD (mtext, x_axis_dir, 11); \ + SUB_FIELD_BD (mtext, rect_height, 41); \ + SUB_FIELD_BD (mtext, rect_width, 40); /* 1.2: @112 */ \ + /*SUB_FIELD_BD (mtext, extents_width, 42); \ + SUB_FIELD_BD (mtext, extents_height, 43);*/ \ + SUB_FIELD_BS (mtext, column_type, 71); /* 8: @180 */ \ + SUB_VALUEOUTOFBOUNDS (mtext, column_type, 2) \ + if (SUB_FIELD_VALUE (mtext, column_type)) \ { \ SUB_FIELD_BS (mtext, num_column_heights, 72); /* 5: @23.5 */\ SUB_FIELD_BD (mtext, column_width, 44); \ @@ -240,43 +242,17 @@ DWG_ENTITY_END if (!SUB_FIELD_VALUE (mtext, auto_height) \ && SUB_FIELD_VALUE (mtext, column_type) == 2) \ { \ - SUB_FIELD_VECTOR (mtext, column_heights, BD, num_column_heights, 46); \ + SUB_FIELD_VECTOR (mtext, column_heights, BD, \ + num_column_heights, 46); \ } \ - } \ + } \ FIELD_BS (annotative_flag, 0); \ - } \ - } \ -} - -#define AcDbMTextObjectEmbedded1_fields \ - { \ - SUB_FIELD_B (mtext, is_really_locked, 0); \ - DEBUG_HERE_OBJ \ - SUB_FIELD_BL (mtext, attachment, 70); \ - SUB_FIELD_3BD (mtext, x_axis_dir, 11); \ - DXF { VALUE_TFF ( "Embedded Object", 101 ); } \ - SUB_FIELD_3BD (mtext, ins_pt, 10); \ - SUB_FIELD_BD (mtext, rect_width, 40); \ - SUB_FIELD_BD (mtext, rect_height, 41); \ - SUB_FIELD_BD (mtext, extents_width, 42); \ - SUB_FIELD_BD (mtext, extents_height, 43); \ - SUB_FIELD_BL (mtext, column_type, 71); \ - SUB_VALUEOUTOFBOUNDS (mtext, column_type, 2) \ - if (SUB_FIELD_VALUE (mtext, column_type)) \ - { \ - SUB_FIELD_BL (mtext, num_column_heights, 72); \ - SUB_FIELD_BD (mtext, column_width, 44); \ - SUB_FIELD_BD (mtext, gutter, 45); \ - SUB_FIELD_B (mtext, auto_height, 73); \ - SUB_FIELD_B (mtext, flow_reversed, 74); \ - if (!SUB_FIELD_VALUE (mtext, auto_height) \ - && SUB_FIELD_VALUE (mtext, column_type) == 2) \ - { \ - SUB_FIELD_VECTOR (mtext, column_heights, BD, num_column_heights, 46); \ } \ - } \ } +DWG_ENT_SUBCLASS_DECL (ATTRIB, AcDbMTextObjectEmbedded); +DWG_ENT_SUBCLASS_DECL (ATTDEF, AcDbMTextObjectEmbedded); + /* (2/16) */ DWG_ENTITY (ATTRIB) @@ -452,7 +428,7 @@ DWG_ENTITY (ATTRIB) { FIELD_RC (mtext_type, 70); // 1=single line, 2=multi line attrib, 4=multi line attdef if (FIELD_VALUE (mtext_type) > 1) - AcDbMTextObjectEmbedded_fields + CALL_SUBCLASS (_obj, ATTRIB, AcDbMTextObjectEmbedded); } SINCE (R_13b1) { @@ -598,8 +574,8 @@ DWG_ENTITY (ATTDEF) } else { if (!(dataflags & 0x02)) FIELD_2DD (alignment_pt, ins_pt, 0); - FIELD_BE (extrusion, 0); - FIELD_BT (thickness, 0); + FIELD_BE (extrusion, 210); + FIELD_BT (thickness, 39); } DXF { FIELD_RD0 (rotation, 50); @@ -643,7 +619,7 @@ DWG_ENTITY (ATTDEF) SUBCLASS (AcDbAttributeDefinition); DXF { - VALUE_RS (0, 280); // 0 = 2010 + VALUE_RS (0, 280); // 0 = 2010+ (class_version) FIELD_T (prompt, 3); FIELD_T (tag, 2); FIELD_RC (mtext_type, 70); @@ -664,9 +640,10 @@ DWG_ENTITY (ATTDEF) } IF_FREE_OR_SINCE (R_2018) { - FIELD_RC (mtext_type, 0); // 1=single line, 2=multi line attrib, 4=multi line attdef + // 1=single line, 2=multi line attrib, 4=multi line attdef + FIELD_RC (mtext_type, 0); if (FIELD_VALUE (mtext_type) > 1) - AcDbMTextObjectEmbedded_fields + CALL_SUBCLASS (_obj, ATTDEF, AcDbMTextObjectEmbedded); } SINCE (R_13b1) { FIELD_T (tag, 0); @@ -689,6 +666,9 @@ DWG_ENTITY (ATTDEF) DWG_ENTITY_END +DWG_ENT_SUBCLASS (ATTRIB, AcDbMTextObjectEmbedded); +DWG_ENT_SUBCLASS (ATTDEF, AcDbMTextObjectEmbedded); + /* (4/12) */ DWG_ENTITY (BLOCK) @@ -10205,6 +10185,8 @@ DWG_OBJECT (SUNSTUDY) DWG_OBJECT_END +DWG_ENT_SUBCLASS_DECL (GEOPOSITIONMARKER, AcDbMTextObjectEmbedded); + // (varies) UNSTABLE // in DXF as POSITIONMARKER (rename?, no), command: GEOMARKPOSITION, GEOMARKPOINT // r2014+ @@ -10221,10 +10203,12 @@ DWG_ENTITY (GEOPOSITIONMARKER) FIELD_RCd (text_alignment, 280); FIELD_B (enable_frame_text, 290); if (FIELD_VALUE (enable_frame_text)) - AcDbMTextObjectEmbedded_fields; + CALL_SUBCLASS (_obj, GEOPOSITIONMARKER, AcDbMTextObjectEmbedded); COMMON_ENTITY_HANDLE_DATA; DWG_ENTITY_END +DWG_ENT_SUBCLASS (GEOPOSITIONMARKER, AcDbMTextObjectEmbedded) + #define SweepOptions_fields \ FIELD_BD (draft_angle, 42); \ FIELD_BD (draft_start_distance, 43); \ @@ -10786,7 +10770,7 @@ DWG_OBJECT (MTEXTATTRIBUTEOBJECTCONTEXTDATA) dwg_setup_SCALE (_obj->context); } */ DXF { VALUE_TFF ( "Embedded Object", 101 ); } - //CALL_ENTITY (SCALE, _obj->context); + //CALL_SUBCLASS (_obj->context, SCALE, AcDbScale); SUBCLASS (AcDbScale); SUB_FIELD_BS (context, flag, 70); // always 0 SUB_FIELD_T (context, name, 300); diff --git a/src/dynapi.c b/src/dynapi.c index 799666cc0..7c9b0b4ef 100644 --- a/src/dynapi.c +++ b/src/dynapi.c @@ -1883,8 +1883,8 @@ static const Dwg_DYNAPI_field _dwg_GEOPOSITIONMARKER_fields[] = { { "is_really_locked", "B", sizeof (BITCODE_B), OFF (struct _dwg_entity_GEOPOSITIONMARKER, is_really_locked), 0,0,0, 0 }, { "annotative_data_size", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_entity_GEOPOSITIONMARKER, annotative_data_size), - 0,0,0, 70 }, - { "annotative_data", "TF", sizeof (BITCODE_RC*), OFF (struct _dwg_entity_GEOPOSITIONMARKER, annotative_data), + 0,0,0, 0 }, + { "annotative_data", "RC*", sizeof (BITCODE_RC*), OFF (struct _dwg_entity_GEOPOSITIONMARKER, annotative_data), 1,1,0, 0 }, { "annotative_flag", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_entity_GEOPOSITIONMARKER, annotative_flag), 0,0,0, 0 }, @@ -10828,8 +10828,6 @@ static const Dwg_DYNAPI_field _dwg_ASSOCSURFACEACTIONBODY_fields[] = { }; /* from typedef struct _dwg_AcDbMTextObjectEmbedded: (sorted by offset) */ static const Dwg_DYNAPI_field _dwg_AcDbMTextObjectEmbedded_fields[] = { - { "is_really_locked", "B", sizeof (BITCODE_B), OFF (struct _dwg_AcDbMTextObjectEmbedded, is_really_locked), - 0,0,0, 0 }, { "attachment", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_AcDbMTextObjectEmbedded, attachment), 0,0,0, 0 }, { "ins_pt", "3BD", sizeof (BITCODE_3BD), OFF (struct _dwg_AcDbMTextObjectEmbedded, ins_pt), diff --git a/src/spec.h b/src/spec.h index 3f6a71081..a2fc1b919 100644 --- a/src/spec.h +++ b/src/spec.h @@ -861,6 +861,11 @@ Dwg_Object_##parenttype *restrict _obj, Bit_Chain * dat, \ Bit_Chain * hdl_dat, Bit_Chain * str_dat, Dwg_Object *restrict obj) +#define DWG_ENT_SUBCLASS_DECL(parenttype, subtype) \ + static int DWG_PRIVATE_N (ACTION, parenttype##_##subtype) ( \ + Dwg_Entity_##parenttype *restrict _obj, Bit_Chain * dat, \ + Bit_Chain * hdl_dat, Bit_Chain * str_dat, Dwg_Object *restrict obj) + #define DWG_SUBCLASS(parenttype, subtype) \ static int DWG_PRIVATE_N (ACTION, parenttype##_##subtype) ( \ Dwg_Object_##parenttype *restrict _obj, Bit_Chain * dat, \ @@ -873,13 +878,22 @@ return error; \ } +#define DWG_ENT_SUBCLASS(parenttype, subtype) \ + static int DWG_PRIVATE_N (ACTION, parenttype##_##subtype) ( \ + Dwg_Entity_##parenttype *restrict _obj, Bit_Chain * dat, \ + Bit_Chain * hdl_dat, Bit_Chain * str_dat, Dwg_Object *restrict obj) \ + { \ + BITCODE_BL vcount, rcount3, rcount4; \ + Dwg_Data *dwg = obj->parent; \ + int error = 0; \ + subtype##_fields; \ + return error; \ + } + + #define CALL_SUBCLASS(_xobj, parenttype, subtype) \ error |= DWG_PRIVATE_N (ACTION, parenttype##_##subtype) ( \ _xobj, dat, hdl_dat, str_dat, (Dwg_Object *)obj) -// if the name is compile-time known -#define CALL_ENTITY(name, xobj) \ - error |= DWG_PRIVATE_N (ACTION, name) (dat, hdl_dat, str_dat, \ - (Dwg_Object *)xobj) // TODO: dispatch on the type #define CALL_SUBENT(hdl, dxf) // error |= DWG_PRIVATE_N (ACTION, xobj->fixedtype) (dat, hdl_dat, str_dat, diff --git a/test/unit-testing/attdef.c b/test/unit-testing/attdef.c index 2c58e249e..5b46b0217 100644 --- a/test/unit-testing/attdef.c +++ b/test/unit-testing/attdef.c @@ -65,7 +65,7 @@ api_process (dwg_object *obj) { CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, attachment, BS); CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, ins_pt); - CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, x_axis_dir); + // CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, x_axis_dir); CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, rect_height, BD); CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, rect_width, BD); CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, column_type, BS); diff --git a/test/unit-testing/dynapi_test.c b/test/unit-testing/dynapi_test.c index dc2283b60..8e9d11620 100644 --- a/test/unit-testing/dynapi_test.c +++ b/test/unit-testing/dynapi_test.c @@ -12019,12 +12019,14 @@ static int test_GEOPOSITIONMARKER (const Dwg_Object *obj) return 1; } { - BITCODE_TF annotative_data; + BITCODE_RC* annotative_data; if (dwg_dynapi_entity_value (geopositionmarker, "GEOPOSITIONMARKER", "annotative_data", &annotative_data, NULL) - && !memcmp (&annotative_data, &geopositionmarker->annotative_data, sizeof (BITCODE_TF))) - pass (); + && annotative_data + ? strEQ ((char *)annotative_data, (char *)geopositionmarker->annotative_data) + : !geopositionmarker->annotative_data) + pass (); else - fail ("GEOPOSITIONMARKER.annotative_data [TF]"); + fail ("GEOPOSITIONMARKER.annotative_data [RC*] '%s' <> '%s'", annotative_data, geopositionmarker->annotative_data); } { BITCODE_BS annotative_data_size;