libDXF 0.0.1
A library with DXF related functions written in C.

mtext.c

Go to the documentation of this file.
00001 
00044 #include "mtext.h"
00045 
00046 
00052 DxfMtext *
00053 dxf_mtext_new ()
00054 {
00055 #if DEBUG
00056         DXF_DEBUG_BEGIN
00057 #endif
00058         DxfMtext *mtext = NULL;
00059         size_t size;
00060 
00061         size = sizeof (DxfMtext);
00062         /* avoid malloc of 0 bytes */
00063         if (size == 0) size = 1;
00064         if ((mtext = malloc (size)) == NULL)
00065         {
00066                 fprintf (stderr,
00067                   (_("Error in %s () could not allocate memory for a DxfMtext struct.\n")),
00068                   __FUNCTION__);
00069                 mtext = NULL;
00070         }
00071         else
00072         {
00073                 memset (mtext, 0, size);
00074         }
00075 #if DEBUG
00076         DXF_DEBUG_END
00077 #endif
00078         return (mtext);
00079 }
00080 
00081 
00088 DxfMtext *
00089 dxf_mtext_init
00090 (
00091         DxfMtext *mtext
00093 )
00094 {
00095 #if DEBUG
00096         DXF_DEBUG_BEGIN
00097 #endif
00098         int i;
00099 
00100         /* Do some basic checks. */
00101         if (mtext == NULL)
00102         {
00103                 fprintf (stderr,
00104                   (_("Warning in %s () a NULL pointer was passed.\n")),
00105                   __FUNCTION__);
00106                 mtext = dxf_mtext_new ();
00107         }
00108         if (mtext == NULL)
00109         {
00110               fprintf (stderr,
00111                 (_("Error in %s () could not allocate memory for a DxfMtext struct.\n")),
00112                 __FUNCTION__);
00113               return (NULL);
00114         }
00115         mtext->id_code = 0;
00116         mtext->text_value = strdup ("");
00117         for (i = 1; i < DXF_MAX_PARAM; i++)
00118         {
00119                 mtext->text_additional_value[i] = strdup ("");
00120         }
00121         mtext->linetype = strdup (DXF_DEFAULT_LINETYPE);
00122         mtext->text_style = strdup ("");
00123         mtext->layer = strdup (DXF_DEFAULT_LAYER);
00124         mtext->p0->x0 = 0.0;
00125         mtext->p0->y0 = 0.0;
00126         mtext->p0->z0 = 0.0;
00127         mtext->p1->x0 = 0.0;
00128         mtext->p1->y0 = 0.0;
00129         mtext->p1->z0 = 0.0;
00130         mtext->elevation = 0.0;
00131         mtext->thickness = 0.0;
00132         mtext->height = 0.0;
00133         mtext->rectangle_width = 0.0;
00134         mtext->horizontal_width = 0.0;
00135         mtext->rectangle_height = 0.0;
00136         mtext->spacing_factor = 0.0;
00137         mtext->box_scale = 0.0;
00138         mtext->column_width = 0.0;
00139         mtext->column_gutter = 0.0;
00140         mtext->column_heights = 0.0;
00141         mtext->rot_angle = 0.0;
00142         mtext->color = DXF_COLOR_BYLAYER;
00143         mtext->background_color = 0;
00144         mtext->paperspace = DXF_MODELSPACE;
00145         mtext->attachment_point = 0;
00146         mtext->drawing_direction = 0;
00147         mtext->spacing_style = 0;
00148         mtext->column_type = 0;
00149         mtext->column_count = 0;
00150         mtext->column_flow = 0;
00151         mtext->column_autoheight = 0;
00152         mtext->background_fill = 0;
00153         mtext->extr_x0 = 0.0;
00154         mtext->extr_y0 = 0.0;
00155         mtext->extr_z0 = 0.0;
00156         mtext->background_color_rgb = 0;
00157         mtext->background_color_name = strdup ("");
00158         mtext->background_transparency = 0;
00159 #if DEBUG
00160         DXF_DEBUG_END
00161 #endif
00162         return (mtext);
00163 }
00164 
00165 
00178 DxfMtext *
00179 dxf_mtext_read
00180 (
00181         DxfFile *fp,
00183         DxfMtext *mtext
00185 )
00186 {
00187 #if DEBUG
00188         DXF_DEBUG_BEGIN
00189 #endif
00190         char *temp_string = NULL;
00191 
00192         /* Do some basic checks. */
00193         if (fp == NULL)
00194         {
00195                 fprintf (stderr,
00196                   (_("Error in %s () a NULL file pointer was passed.\n")),
00197                   __FUNCTION__);
00198                 /* Clean up. */
00199                 free (temp_string);
00200                 return (NULL);
00201         }
00202         if (mtext == NULL)
00203         {
00204                 fprintf (stderr,
00205                   (_("Warning in %s () a NULL pointer was passed.\n")),
00206                   __FUNCTION__);
00207                 mtext = dxf_mtext_new ();
00208                 mtext = dxf_mtext_init (mtext);
00209         }
00210         (fp->line_number)++;
00211         fscanf (fp->fp, "%[^\n]", temp_string);
00212         while (strcmp (temp_string, "0") != 0)
00213         {
00214                 if (ferror (fp->fp))
00215                 {
00216                         fprintf (stderr,
00217                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00218                           __FUNCTION__, fp->filename, fp->line_number);
00219                         fclose (fp->fp);
00220                         /* Clean up. */
00221                         free (temp_string);
00222                         return (NULL);
00223                 }
00224                 if (strcmp (temp_string, "1") == 0)
00225                 {
00226                         /* Now follows a string containing a text value. */
00227                         (fp->line_number)++;
00228                         fscanf (fp->fp, "%s\n", mtext->text_value);
00229                 }
00230                 else if (strcmp (temp_string, "3") == 0)
00231                 {
00232                         /* Now follows a string containing a text value. */
00233                         (fp->line_number)++;
00234                         //fscanf (fp->fp, "%s\n", mtext->text_additional_value[number_additional]);
00235                         //number_additional++;
00236                 }
00238                 else if (strcmp (temp_string, "5") == 0)
00239                 {
00240                         /* Now follows a string containing a sequential
00241                          * id number. */
00242                         (fp->line_number)++;
00243                         fscanf (fp->fp, "%x\n", &mtext->id_code);
00244                 }
00245                 else if (strcmp (temp_string, "6") == 0)
00246                 {
00247                         /* Now follows a string containing a linetype
00248                          * name. */
00249                         (fp->line_number)++;
00250                         fscanf (fp->fp, "%s\n", mtext->linetype);
00251                 }
00252                 else if (strcmp (temp_string, "7") == 0)
00253                 {
00254                         /* Now follows a string containing a text style
00255                          * name. */
00256                         (fp->line_number)++;
00257                         fscanf (fp->fp, "%s\n", mtext->text_style);
00258                 }
00259                 else if (strcmp (temp_string, "8") == 0)
00260                 {
00261                         /* Now follows a string containing a layer name. */
00262                         (fp->line_number)++;
00263                         fscanf (fp->fp, "%s\n", mtext->layer);
00264                 }
00265                 else if (strcmp (temp_string, "10") == 0)
00266                 {
00267                         /* Now follows a string containing the
00268                          * X-coordinate of the insertion point. */
00269                         (fp->line_number)++;
00270                         fscanf (fp->fp, "%lf\n", &mtext->p0->x0);
00271                 }
00272                 else if (strcmp (temp_string, "20") == 0)
00273                 {
00274                         /* Now follows a string containing the
00275                          * Y-coordinate of the insertion point. */
00276                         (fp->line_number)++;
00277                         fscanf (fp->fp, "%lf\n", &mtext->p0->y0);
00278                 }
00279                 else if (strcmp (temp_string, "30") == 0)
00280                 {
00281                         /* Now follows a string containing the
00282                          * Z-coordinate of the insertion point. */
00283                         (fp->line_number)++;
00284                         fscanf (fp->fp, "%lf\n", &mtext->p0->z0);
00285                 }
00286                 else if (strcmp (temp_string, "11") == 0)
00287                 {
00288                         /* Now follows a string containing the
00289                          * X-coordinate of the direction vector. */
00290                         (fp->line_number)++;
00291                         fscanf (fp->fp, "%lf\n", &mtext->p1->x0);
00292                 }
00293                 else if (strcmp (temp_string, "21") == 0)
00294                 {
00295                         /* Now follows a string containing the
00296                          * Y-coordinate of the direction vector. */
00297                         (fp->line_number)++;
00298                         fscanf (fp->fp, "%lf\n", &mtext->p1->y0);
00299                 }
00300                 else if (strcmp (temp_string, "31") == 0)
00301                 {
00302                         /* Now follows a string containing the
00303                          * Z-coordinate of the direction vector. */
00304                         (fp->line_number)++;
00305                         fscanf (fp->fp, "%lf\n", &mtext->p1->z0);
00306                 }
00307                 else if ((fp->acad_version_number <= AutoCAD_11)
00308                   && DXF_FLATLAND
00309                   && (strcmp (temp_string, "38") == 0))
00310                 {
00311                         /* Now follows a string containing the
00312                          * elevation. */
00313                         (fp->line_number)++;
00314                         fscanf (fp->fp, "%lf\n", &mtext->elevation);
00315                 }
00316                 else if (strcmp (temp_string, "39") == 0)
00317                 {
00318                         /* Now follows a string containing the
00319                          * thickness. */
00320                         (fp->line_number)++;
00321                         fscanf (fp->fp, "%lf\n", &mtext->thickness);
00322                 }
00323                 else if (strcmp (temp_string, "40") == 0)
00324                 {
00325                         /* Now follows a string containing the
00326                          * height. */
00327                         (fp->line_number)++;
00328                         fscanf (fp->fp, "%lf\n", &mtext->height);
00329                 }
00330                 else if (strcmp (temp_string, "41") == 0)
00331                 {
00332                         /* Now follows a string containing the
00333                          * reference rectangle width. */
00334                         (fp->line_number)++;
00335                         fscanf (fp->fp, "%lf\n", &mtext->rectangle_width);
00336                 }
00337                 else if (strcmp (temp_string, "42") == 0)
00338                 {
00339                         /* Now follows a string containing the
00340                          * horizontal width of the characters. */
00341                         (fp->line_number)++;
00342                         fscanf (fp->fp, "%lf\n", &mtext->horizontal_width);
00343                 }
00344                 else if (strcmp (temp_string, "43") == 0)
00345                 {
00346                         /* Now follows a string containing the
00347                          * vertical rectangle height. */
00348                         (fp->line_number)++;
00349                         fscanf (fp->fp, "%lf\n", &mtext->rectangle_height);
00350                 }
00351                 else if (strcmp (temp_string, "44") == 0)
00352                 {
00353                         /* Now follows a string containing the
00354                          * text line spacing factor. */
00355                         (fp->line_number)++;
00356                         fscanf (fp->fp, "%lf\n", &mtext->spacing_factor);
00357                 }
00358                 else if (strcmp (temp_string, "45") == 0)
00359                 {
00360                         /* Now follows a string containing the
00361                          * fill box scale (border around text). */
00362                         (fp->line_number)++;
00363                         fscanf (fp->fp, "%lf\n", &mtext->box_scale);
00364                 }
00365                 else if (strcmp (temp_string, "48") == 0)
00366                 {
00367                         /* Now follows a string containing the
00368                          * column width. */
00369                         (fp->line_number)++;
00370                         fscanf (fp->fp, "%lf\n", &mtext->column_width);
00371                 }
00372                 else if (strcmp (temp_string, "49") == 0)
00373                 {
00374                         /* Now follows a string containing the
00375                          * column gutter. */
00376                         (fp->line_number)++;
00377                         fscanf (fp->fp, "%lf\n", &mtext->column_gutter);
00378                 }
00379                 else if ((fp->acad_version_number <= AutoCAD_2006)
00380                         && (strcmp (temp_string, "50") == 0))
00381                 {
00382                         /* Now follows a string containing the
00383                          * rotation angle. */
00384                         (fp->line_number)++;
00385                         fscanf (fp->fp, "%lf\n", &mtext->rot_angle);
00386                 }
00387                 else if ((fp->acad_version_number >= AutoCAD_2007)
00388                         && (strcmp (temp_string, "50") == 0))
00389                 {
00390                         /* Can follows a string containing the
00391                          * rotation angle or column heights. */
00392                         (fp->line_number)++;
00394                 }
00395                 else if (strcmp (temp_string, "63") == 0)
00396                 {
00397                         /* Now follows a string containing the
00398                          * color to use for background fill. */
00399                         (fp->line_number)++;
00400                         fscanf (fp->fp, "%d\n", &mtext->background_color);
00401                 }
00402                 else if (strcmp (temp_string, "71") == 0)
00403                 {
00404                         /* Now follows a string containing the
00405                          * attachment point. */
00406                         (fp->line_number)++;
00407                         fscanf (fp->fp, "%d\n", &mtext->attachment_point);
00408                 }
00409                 else if (strcmp (temp_string, "72") == 0)
00410                 {
00411                         /* Now follows a string containing the
00412                          * drawing direction. */
00413                         (fp->line_number)++;
00414                         fscanf (fp->fp, "%d\n", &mtext->drawing_direction);
00415                 }
00416                 else if (strcmp (temp_string, "73") == 0)
00417                 {
00418                         /* Now follows a string containing the
00419                          * mtext line spacing style. */
00420                         (fp->line_number)++;
00421                         fscanf (fp->fp, "%d\n", &mtext->spacing_style);
00422                 }
00423                 else if (strcmp (temp_string, "75") == 0)
00424                 {
00425                         /* Now follows a string containing the
00426                          * column type. */
00427                         (fp->line_number)++;
00428                         fscanf (fp->fp, "%d\n", &mtext->column_type);
00429                 }
00430                 else if (strcmp (temp_string, "76") == 0)
00431                 {
00432                         /* Now follows a string containing the
00433                          * column count. */
00434                         (fp->line_number)++;
00435                         fscanf (fp->fp, "%d\n", &mtext->column_count);
00436                 }
00437                 else if (strcmp (temp_string, "78") == 0)
00438                 {
00439                         /* Now follows a string containing the
00440                          * column flow reverse. */
00441                         (fp->line_number)++;
00442                         fscanf (fp->fp, "%d\n", &mtext->column_flow);
00443                 }
00444                 else if (strcmp (temp_string, "79") == 0)
00445                 {
00446                         /* Now follows a string containing the
00447                          * column autoheight. */
00448                         (fp->line_number)++;
00449                         fscanf (fp->fp, "%d\n", &mtext->column_autoheight);
00450                 }
00451                 else if (strcmp (temp_string, "90") == 0)
00452                 {
00453                         /* Now follows a string containing the
00454                          * background fill setting. */
00455                         (fp->line_number)++;
00456                         fscanf (fp->fp, "%d\n", &mtext->background_fill);
00457                 }
00458                 else if ((fp->acad_version_number >= AutoCAD_13)
00459                         && (strcmp (temp_string, "100") == 0))
00460                 {
00461                         /* Now follows a string containing the
00462                          * subclass marker value. */
00463                         (fp->line_number)++;
00464                         fscanf (fp->fp, "%s\n", temp_string);
00465                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00466                         && ((strcmp (temp_string, "AcDbMText") != 0)))
00467                         {
00468                                 fprintf (stderr,
00469                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00470                                   __FUNCTION__, fp->filename, fp->line_number);
00471                         }
00472                 }
00473                 else if (strcmp (temp_string, "210") == 0)
00474                 {
00475                         /* Now follows a string containing the
00476                          * X-value of the extrusion vector. */
00477                         (fp->line_number)++;
00478                         fscanf (fp->fp, "%lf\n", &mtext->extr_x0);
00479                 }
00480                 else if (strcmp (temp_string, "220") == 0)
00481                 {
00482                         /* Now follows a string containing the
00483                          * Y-value of the extrusion vector. */
00484                         (fp->line_number)++;
00485                         fscanf (fp->fp, "%lf\n", &mtext->extr_y0);
00486                 }
00487                 else if (strcmp (temp_string, "230") == 0)
00488                 {
00489                         /* Now follows a string containing the
00490                          * Z-value of the extrusion vector. */
00491                         (fp->line_number)++;
00492                         fscanf (fp->fp, "%lf\n", &mtext->extr_z0);
00493                 }
00494                 else if (strcmp (temp_string, "999") == 0)
00495                 {
00496                         /* Now follows a string containing a comment. */
00497                         (fp->line_number)++;
00498                         fscanf (fp->fp, "%s\n", temp_string);
00499                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00500                 }
00501 
00502                 else
00503                 {
00504                         fprintf (stderr,
00505                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00506                           __FUNCTION__, fp->filename, fp->line_number);
00507                 }
00508         }
00509         /* Handle omitted members and/or illegal values. */
00510         if (strcmp (mtext->linetype, "") == 0)
00511         {
00512                 mtext->linetype = strdup (DXF_DEFAULT_LINETYPE);
00513         }
00514         if (strcmp (mtext->layer, "") == 0)
00515         {
00516                 mtext->layer = strdup (DXF_DEFAULT_LAYER);
00517         }
00518         /* Clean up. */
00519         free (temp_string);
00520 #if DEBUG
00521         DXF_DEBUG_END
00522 #endif
00523         return (EXIT_SUCCESS);
00524 }
00525 
00526 
00540 int
00541 dxf_mtext_write
00542 (
00543         DxfFile *fp,
00545         DxfMtext *mtext
00547 )
00548 {
00549 #if DEBUG
00550         DXF_DEBUG_BEGIN
00551 #endif
00552         char *dxf_entity_name = strdup ("MTEXT");
00553         int i;
00554 
00555         /* Do some basic checks. */
00556         if (fp == NULL)
00557         {
00558                 fprintf (stderr,
00559                   (_("Error in %s () a NULL file pointer was passed.\n")),
00560                   __FUNCTION__);
00561                 /* Clean up. */
00562                 free (dxf_entity_name);
00563                 return (EXIT_FAILURE);
00564         }
00565         if (mtext == NULL)
00566         {
00567                 fprintf (stderr,
00568                   (_("Error in %s () a NULL pointer was passed.\n")),
00569                   __FUNCTION__);
00570                 /* Clean up. */
00571                 free (dxf_entity_name);
00572                 return (EXIT_FAILURE);
00573         }
00574         if ((fp->acad_version_number < AutoCAD_13)
00575           && (fp->follow_strict_version_rules))
00576         {
00577                 fprintf (stderr,
00578                   (_("Error in %s () illegal DXF version for this %s entity with id-code: %x.\n")),
00579                   __FUNCTION__, dxf_entity_name, mtext->id_code);
00580                 return (EXIT_FAILURE);
00581         }
00582         else
00583         {
00584                 fprintf (stderr,
00585                   (_("Warning in %s () illegal DXF version for this %s entity with id-code: %x.\n")),
00586                   __FUNCTION__, dxf_entity_name, mtext->id_code);
00587         }
00588         if (strcmp (mtext->linetype, "") == 0)
00589         {
00590                 fprintf (stderr,
00591                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00592                   __FUNCTION__, dxf_entity_name, mtext->id_code);
00593                 fprintf (stderr,
00594                   (_("\t%s entity is reset to default linetype")),
00595                   dxf_entity_name);
00596                 mtext->linetype = strdup (DXF_DEFAULT_LINETYPE);
00597         }
00598         if (strcmp (mtext->layer, "") == 0)
00599         {
00600                 fprintf (stderr,
00601                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00602                   __FUNCTION__, dxf_entity_name, mtext->id_code);
00603                 fprintf (stderr,
00604                   (_("\t%s entity is relocated to layer 0")),
00605                   dxf_entity_name);
00606                 mtext->layer = DXF_DEFAULT_LAYER;
00607         }
00608         /* Start writing output. */
00609         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00610         if (mtext->id_code != -1)
00611         {
00612                 fprintf (fp->fp, "  5\n%x\n", mtext->id_code);
00613         }
00624         if ((strcmp (mtext->dictionary_owner_soft, "") != 0)
00625           && (fp->acad_version_number >= AutoCAD_14))
00626         {
00627                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00628                 fprintf (fp->fp, "330\n%s\n", mtext->dictionary_owner_soft);
00629                 fprintf (fp->fp, "102\n}\n");
00630         }
00631         if ((strcmp (mtext->dictionary_owner_hard, "") != 0)
00632           && (fp->acad_version_number >= AutoCAD_14))
00633         {
00634                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00635                 fprintf (fp->fp, "360\n%s\n", mtext->dictionary_owner_hard);
00636                 fprintf (fp->fp, "102\n}\n");
00637         }
00638         if (fp->acad_version_number >= AutoCAD_13)
00639         {
00640                 fprintf (fp->fp, "100\nAcDbEntity\n");
00641         }
00642         if (mtext->paperspace == DXF_PAPERSPACE)
00643         {
00644                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00645         }
00646         fprintf (fp->fp, "  8\n%s\n", mtext->layer);
00647         if (strcmp (mtext->linetype, DXF_DEFAULT_LINETYPE) != 0)
00648         {
00649                 fprintf (fp->fp, "  6\n%s\n", mtext->linetype);
00650         }
00651         if (mtext->color != DXF_COLOR_BYLAYER)
00652         {
00653                 fprintf (fp->fp, " 62\n%d\n", mtext->color);
00654         }
00655         if ((fp->acad_version_number <= AutoCAD_11)
00656           && DXF_FLATLAND
00657           && (mtext->elevation != 0.0))
00658         {
00659                 fprintf (fp->fp, " 38\n%f\n", mtext->elevation);
00660         }
00661         if (mtext->thickness != 0.0)
00662         {
00663                 fprintf (fp->fp, " 39\n%f\n", mtext->thickness);
00664         }
00665         if (mtext->linetype_scale != 1.0)
00666         {
00667                 fprintf (fp->fp, " 48\n%f\n", mtext->linetype_scale);
00668         }
00669         if (mtext->visibility != 0)
00670         {
00671                 fprintf (fp->fp, " 60\n%d\n", mtext->visibility);
00672         }
00673         if (fp->acad_version_number >= AutoCAD_13)
00674         {
00675                 fprintf (fp->fp, "100\nAcDbMText\n");
00676         }
00677         fprintf (fp->fp, " 10\n%f\n", mtext->p0->x0);
00678         fprintf (fp->fp, " 20\n%f\n", mtext->p0->y0);
00679         fprintf (fp->fp, " 30\n%f\n", mtext->p0->z0);
00680         fprintf (fp->fp, " 40\n%f\n", mtext->height);
00681         fprintf (fp->fp, " 41\n%f\n", mtext->rectangle_width);
00682         fprintf (fp->fp, " 71\n%d\n", mtext->attachment_point);
00683         fprintf (fp->fp, " 72\n%d\n", mtext->drawing_direction);
00684         fprintf (fp->fp, "  1\n%s\n", mtext->text_value);
00685         i = 0;
00686         while (strlen (mtext->text_additional_value[i]) > 0)
00687         {
00688                 fprintf (fp->fp, "  3\n%s\n", mtext->text_additional_value[i]);
00689                 i++;
00690         }
00691         fprintf (fp->fp, "  7\n%s\n", mtext->text_style);
00692 
00693         if ((fp->acad_version_number >= AutoCAD_12)
00694                 && (mtext->extr_x0 != 0.0)
00695                 && (mtext->extr_y0 != 0.0)
00696                 && (mtext->extr_z0 != 1.0))
00697         {
00698                 fprintf (fp->fp, "210\n%f\n", mtext->extr_x0);
00699                 fprintf (fp->fp, "220\n%f\n", mtext->extr_y0);
00700                 fprintf (fp->fp, "230\n%f\n", mtext->extr_z0);
00701         }
00702         fprintf (fp->fp, " 11\n%f\n", mtext->p1->x0);
00703         fprintf (fp->fp, " 21\n%f\n", mtext->p1->y0);
00704         fprintf (fp->fp, " 31\n%f\n", mtext->p1->z0);
00705         fprintf (fp->fp, " 42\n%f\n", mtext->horizontal_width);
00706         fprintf (fp->fp, " 43\n%f\n", mtext->rectangle_height);
00707         fprintf (fp->fp, " 50\n%f\n", mtext->rot_angle);
00708         /* Clean up. */
00709         free (dxf_entity_name);
00710 #if DEBUG
00711         DXF_DEBUG_END
00712 #endif
00713         return (EXIT_SUCCESS);
00714 }
00715 
00716 
00724 int
00725 dxf_mtext_free
00726 (
00727         DxfMtext *mtext
00729 )
00730 {
00731 #if DEBUG
00732         DXF_DEBUG_BEGIN
00733 #endif
00734         int i;
00735 
00736         /* Do some basic checks. */
00737         if (mtext == NULL)
00738         {
00739                 fprintf (stderr,
00740                   (_("Error in %s () a NULL pointer was passed.\n")),
00741                   __FUNCTION__);
00742                 return (EXIT_FAILURE);
00743         }
00744         if (mtext->next != NULL)
00745         {
00746                 fprintf (stderr,
00747                   (_("Error in %s () pointer to next was not NULL.\n")),
00748                   __FUNCTION__);
00749                 return (EXIT_FAILURE);
00750         }
00751         free (mtext->linetype);
00752         free (mtext->layer);
00753         free (mtext->text_value);
00754         for (i = 0; i < DXF_MAX_PARAM; i++)
00755         {
00756                 free (mtext->text_additional_value[i]);
00757         }
00758         free (mtext->text_style);
00759         free (mtext->dictionary_owner_soft);
00760         free (mtext->dictionary_owner_hard);
00761         free (mtext->background_color_name);
00762         free (mtext);
00763         mtext = NULL;
00764 #if DEBUG
00765         DXF_DEBUG_END
00766 #endif
00767         return (EXIT_SUCCESS);
00768 }
00769 
00770 
00775 void
00776 dxf_mtext_free_chain
00777 (
00778         DxfMtext *mtexts
00780 )
00781 {
00782 #ifdef DEBUG
00783         DXF_DEBUG_BEGIN
00784 #endif
00785         if (mtexts == NULL)
00786         {
00787                 fprintf (stderr,
00788                   (_("Warning in %s () a NULL pointer was passed.\n")),
00789                   __FUNCTION__);
00790         }
00791         while (mtexts != NULL)
00792         {
00793                 struct DxfMtext *iter = mtexts->next;
00794                 dxf_mtext_free (mtexts);
00795                 mtexts = (DxfMtext *) iter;
00796         }
00797 #if DEBUG
00798         DXF_DEBUG_END
00799 #endif
00800 }
00801 
00802 
00808 int
00809 dxf_mtext_get_id_code
00810 (
00811         DxfMtext *mtext
00813 )
00814 {
00815 #if DEBUG
00816         DXF_DEBUG_BEGIN
00817 #endif
00818         /* Do some basic checks. */
00819         if (mtext == NULL)
00820         {
00821                 fprintf (stderr,
00822                   (_("Error in %s () a NULL pointer was passed.\n")),
00823                   __FUNCTION__);
00824                 return (EXIT_FAILURE);
00825         }
00826         if (mtext->id_code < 0)
00827         {
00828                 fprintf (stderr,
00829                   (_("Error in %s () a negative value was found.\n")),
00830                   __FUNCTION__);
00831                 return (EXIT_FAILURE);
00832         }
00833 #if DEBUG
00834         DXF_DEBUG_END
00835 #endif
00836         return (mtext->id_code);
00837 }
00838 
00839 
00843 DxfMtext *
00844 dxf_mtext_set_id_code
00845 (
00846         DxfMtext *mtext,
00848         int id_code
00852 )
00853 {
00854 #if DEBUG
00855         DXF_DEBUG_BEGIN
00856 #endif
00857         /* Do some basic checks. */
00858         if (mtext == NULL)
00859         {
00860                 fprintf (stderr,
00861                   (_("Error in %s () a NULL pointer was passed.\n")),
00862                   __FUNCTION__);
00863                 return (NULL);
00864         }
00865         if (id_code < 0)
00866         {
00867                 fprintf (stderr,
00868                   (_("Error in %s () a negative value was passed.\n")),
00869                   __FUNCTION__);
00870                 return (NULL);
00871         }
00872         mtext->id_code = id_code;
00873 #if DEBUG
00874         DXF_DEBUG_END
00875 #endif
00876         return (mtext);
00877 }
00878 
00879 
00885 char *
00886 dxf_mtext_get_linetype
00887 (
00888         DxfMtext *mtext
00890 )
00891 {
00892 #if DEBUG
00893         DXF_DEBUG_BEGIN
00894 #endif
00895         /* Do some basic checks. */
00896         if (mtext == NULL)
00897         {
00898                 fprintf (stderr,
00899                   (_("Error in %s () a NULL pointer was passed.\n")),
00900                   __FUNCTION__);
00901                 return (NULL);
00902         }
00903         if (mtext->linetype ==  NULL)
00904         {
00905                 fprintf (stderr,
00906                   (_("Error in %s () a NULL pointer was found.\n")),
00907                   __FUNCTION__);
00908                 return (NULL);
00909         }
00910 #if DEBUG
00911         DXF_DEBUG_END
00912 #endif
00913         return (strdup (mtext->linetype));
00914 }
00915 
00916 
00920 DxfMtext *
00921 dxf_mtext_set_linetype
00922 (
00923         DxfMtext *mtext,
00925         char *linetype
00927 )
00928 {
00929 #if DEBUG
00930         DXF_DEBUG_BEGIN
00931 #endif
00932         /* Do some basic checks. */
00933         if (mtext == NULL)
00934         {
00935                 fprintf (stderr,
00936                   (_("Error in %s () a NULL pointer was passed.\n")),
00937                   __FUNCTION__);
00938                 return (NULL);
00939         }
00940         if (linetype == NULL)
00941         {
00942                 fprintf (stderr,
00943                   (_("Error in %s () a NULL pointer was passed.\n")),
00944                   __FUNCTION__);
00945                 return (NULL);
00946         }
00947         mtext->linetype = strdup (linetype);
00948 #if DEBUG
00949         DXF_DEBUG_END
00950 #endif
00951         return (mtext);
00952 }
00953 
00954 
00960 char *
00961 dxf_mtext_get_layer
00962 (
00963         DxfMtext *mtext
00965 )
00966 {
00967 #if DEBUG
00968         DXF_DEBUG_BEGIN
00969 #endif
00970         /* Do some basic checks. */
00971         if (mtext == NULL)
00972         {
00973                 fprintf (stderr,
00974                   (_("Error in %s () a NULL pointer was passed.\n")),
00975                   __FUNCTION__);
00976                 return (NULL);
00977         }
00978         if (mtext->layer ==  NULL)
00979         {
00980                 fprintf (stderr,
00981                   (_("Error in %s () a NULL pointer was found.\n")),
00982                   __FUNCTION__);
00983                 return (NULL);
00984         }
00985 #if DEBUG
00986         DXF_DEBUG_END
00987 #endif
00988         return (strdup (mtext->layer));
00989 }
00990 
00991 
00995 DxfMtext *
00996 dxf_mtext_set_layer
00997 (
00998         DxfMtext *mtext,
01000         char *layer
01002 )
01003 {
01004 #if DEBUG
01005         DXF_DEBUG_BEGIN
01006 #endif
01007         /* Do some basic checks. */
01008         if (mtext == NULL)
01009         {
01010                 fprintf (stderr,
01011                   (_("Error in %s () a NULL pointer was passed.\n")),
01012                   __FUNCTION__);
01013                 return (NULL);
01014         }
01015         if (layer == NULL)
01016         {
01017                 fprintf (stderr,
01018                   (_("Error in %s () a NULL pointer was passed.\n")),
01019                   __FUNCTION__);
01020                 return (NULL);
01021         }
01022         mtext->layer = strdup (layer);
01023 #if DEBUG
01024         DXF_DEBUG_END
01025 #endif
01026         return (mtext);
01027 }
01028 
01029 
01035 double
01036 dxf_mtext_get_elevation
01037 (
01038         DxfMtext *mtext
01040 )
01041 {
01042 #if DEBUG
01043         DXF_DEBUG_BEGIN
01044 #endif
01045         /* Do some basic checks. */
01046         if (mtext == NULL)
01047         {
01048                 fprintf (stderr,
01049                   (_("Error in %s () a NULL pointer was passed.\n")),
01050                   __FUNCTION__);
01051                 return (EXIT_FAILURE);
01052         }
01053 #if DEBUG
01054         DXF_DEBUG_END
01055 #endif
01056         return (mtext->elevation);
01057 }
01058 
01059 
01063 DxfMtext *
01064 dxf_mtext_set_elevation
01065 (
01066         DxfMtext *mtext,
01068         double elevation
01070 )
01071 {
01072 #if DEBUG
01073         DXF_DEBUG_BEGIN
01074 #endif
01075         /* Do some basic checks. */
01076         if (mtext == NULL)
01077         {
01078                 fprintf (stderr,
01079                   (_("Error in %s () a NULL pointer was passed.\n")),
01080                   __FUNCTION__);
01081                 return (NULL);
01082         }
01083         mtext->elevation = elevation;
01084 #if DEBUG
01085         DXF_DEBUG_END
01086 #endif
01087         return (mtext);
01088 }
01089 
01090 
01096 double
01097 dxf_mtext_get_thickness
01098 (
01099         DxfMtext *mtext
01101 )
01102 {
01103 #if DEBUG
01104         DXF_DEBUG_BEGIN
01105 #endif
01106         /* Do some basic checks. */
01107         if (mtext == NULL)
01108         {
01109                 fprintf (stderr,
01110                   (_("Error in %s () a NULL pointer was passed.\n")),
01111                   __FUNCTION__);
01112                 return (EXIT_FAILURE);
01113         }
01114         if (mtext->thickness < 0.0)
01115         {
01116                 fprintf (stderr,
01117                   (_("Error in %s () a negative value was found.\n")),
01118                   __FUNCTION__);
01119                 return (EXIT_FAILURE);
01120         }
01121 #if DEBUG
01122         DXF_DEBUG_END
01123 #endif
01124         return (mtext->thickness);
01125 }
01126 
01127 
01131 DxfMtext *
01132 dxf_mtext_set_thickness
01133 (
01134         DxfMtext *mtext,
01136         double thickness
01138 )
01139 {
01140 #if DEBUG
01141         DXF_DEBUG_BEGIN
01142 #endif
01143         /* Do some basic checks. */
01144         if (mtext == NULL)
01145         {
01146                 fprintf (stderr,
01147                   (_("Error in %s () a NULL pointer was passed.\n")),
01148                   __FUNCTION__);
01149                 return (NULL);
01150         }
01151         if (thickness < 0.0)
01152         {
01153                 fprintf (stderr,
01154                   (_("Error in %s () a negative value was passed.\n")),
01155                   __FUNCTION__);
01156                 return (NULL);
01157         }
01158         mtext->thickness = thickness;
01159 #if DEBUG
01160         DXF_DEBUG_END
01161 #endif
01162         return (mtext);
01163 }
01164 
01165 
01171 double
01172 dxf_mtext_get_linetype_scale
01173 (
01174         DxfMtext *mtext
01176 )
01177 {
01178 #if DEBUG
01179         DXF_DEBUG_BEGIN
01180 #endif
01181         /* Do some basic checks. */
01182         if (mtext == NULL)
01183         {
01184                 fprintf (stderr,
01185                   (_("Error in %s () a NULL pointer was passed.\n")),
01186                   __FUNCTION__);
01187                 return (EXIT_FAILURE);
01188         }
01189         if (mtext->linetype_scale < 0.0)
01190         {
01191                 fprintf (stderr,
01192                   (_("Error in %s () a negative value was found.\n")),
01193                   __FUNCTION__);
01194                 return (EXIT_FAILURE);
01195         }
01196 #if DEBUG
01197         DXF_DEBUG_END
01198 #endif
01199         return (mtext->linetype_scale);
01200 }
01201 
01202 
01206 DxfMtext *
01207 dxf_mtext_set_linetype_scale
01208 (
01209         DxfMtext *mtext,
01211         double linetype_scale
01213 )
01214 {
01215 #if DEBUG
01216         DXF_DEBUG_BEGIN
01217 #endif
01218         /* Do some basic checks. */
01219         if (mtext == NULL)
01220         {
01221                 fprintf (stderr,
01222                   (_("Error in %s () a NULL pointer was passed.\n")),
01223                   __FUNCTION__);
01224                 return (NULL);
01225         }
01226         if (linetype_scale < 0.0)
01227         {
01228                 fprintf (stderr,
01229                   (_("Error in %s () a negative value was passed.\n")),
01230                   __FUNCTION__);
01231                 return (NULL);
01232         }
01233         mtext->linetype_scale = linetype_scale;
01234 #if DEBUG
01235         DXF_DEBUG_END
01236 #endif
01237         return (mtext);
01238 }
01239 
01240 
01246 int16_t
01247 dxf_mtext_get_visibility
01248 (
01249         DxfMtext *mtext
01251 )
01252 {
01253 #if DEBUG
01254         DXF_DEBUG_BEGIN
01255 #endif
01256         /* Do some basic checks. */
01257         if (mtext == NULL)
01258         {
01259                 fprintf (stderr,
01260                   (_("Error in %s () a NULL pointer was passed.\n")),
01261                   __FUNCTION__);
01262                 return (EXIT_FAILURE);
01263         }
01264         if (mtext->visibility < 0)
01265         {
01266                 fprintf (stderr,
01267                   (_("Error in %s () a negative value was found.\n")),
01268                   __FUNCTION__);
01269                 return (EXIT_FAILURE);
01270         }
01271         if (mtext->visibility > 1)
01272         {
01273                 fprintf (stderr,
01274                   (_("Error in %s () an out of range value was found.\n")),
01275                   __FUNCTION__);
01276                 return (EXIT_FAILURE);
01277         }
01278 #if DEBUG
01279         DXF_DEBUG_END
01280 #endif
01281         return (mtext->visibility);
01282 }
01283 
01284 
01288 DxfMtext *
01289 dxf_mtext_set_visibility
01290 (
01291         DxfMtext *mtext,
01293         int16_t visibility
01295 )
01296 {
01297 #if DEBUG
01298         DXF_DEBUG_BEGIN
01299 #endif
01300         /* Do some basic checks. */
01301         if (mtext == NULL)
01302         {
01303                 fprintf (stderr,
01304                   (_("Error in %s () a NULL pointer was passed.\n")),
01305                   __FUNCTION__);
01306                 return (NULL);
01307         }
01308         if (visibility < 0)
01309         {
01310                 fprintf (stderr,
01311                   (_("Error in %s () a negative value was passed.\n")),
01312                   __FUNCTION__);
01313                 return (NULL);
01314         }
01315         if (visibility > 1)
01316         {
01317                 fprintf (stderr,
01318                   (_("Error in %s () an out of range value was passed.\n")),
01319                   __FUNCTION__);
01320                 return (NULL);
01321         }
01322         mtext->visibility = visibility;
01323 #if DEBUG
01324         DXF_DEBUG_END
01325 #endif
01326         return (mtext);
01327 }
01328 
01329 
01335 int
01336 dxf_mtext_get_color
01337 (
01338         DxfMtext *mtext
01340 )
01341 {
01342 #if DEBUG
01343         DXF_DEBUG_BEGIN
01344 #endif
01345         /* Do some basic checks. */
01346         if (mtext == NULL)
01347         {
01348                 fprintf (stderr,
01349                   (_("Error in %s () a NULL pointer was passed.\n")),
01350                   __FUNCTION__);
01351                 return (EXIT_FAILURE);
01352         }
01353         if (mtext->color < 0)
01354         {
01355                 fprintf (stderr,
01356                   (_("Warning in %s () a negative value was found.\n")),
01357                   __FUNCTION__);
01358         }
01359 #if DEBUG
01360         DXF_DEBUG_END
01361 #endif
01362         return (mtext->color);
01363 }
01364 
01365 
01369 DxfMtext *
01370 dxf_mtext_set_color
01371 (
01372         DxfMtext *mtext,
01374         int color
01376 )
01377 {
01378 #if DEBUG
01379         DXF_DEBUG_BEGIN
01380 #endif
01381         /* Do some basic checks. */
01382         if (mtext == NULL)
01383         {
01384                 fprintf (stderr,
01385                   (_("Error in %s () a NULL pointer was passed.\n")),
01386                   __FUNCTION__);
01387                 return (NULL);
01388         }
01389         if (color < 0)
01390         {
01391                 fprintf (stderr,
01392                   (_("Warning in %s () a negative value was passed.\n")),
01393                   __FUNCTION__);
01394         }
01395         mtext->color = color;
01396 #if DEBUG
01397         DXF_DEBUG_END
01398 #endif
01399         return (mtext);
01400 }
01401 
01402 
01408 int
01409 dxf_mtext_get_paperspace
01410 (
01411         DxfMtext *mtext
01413 )
01414 {
01415 #if DEBUG
01416         DXF_DEBUG_BEGIN
01417 #endif
01418         /* Do some basic checks. */
01419         if (mtext == NULL)
01420         {
01421                 fprintf (stderr,
01422                   (_("Error in %s () a NULL pointer was passed.\n")),
01423                   __FUNCTION__);
01424                 return (EXIT_FAILURE);
01425         }
01426         if (mtext->paperspace < 0)
01427         {
01428                 fprintf (stderr,
01429                   (_("Warning in %s () a negative value was found.\n")),
01430                   __FUNCTION__);
01431         }
01432         if (mtext->paperspace > 1)
01433         {
01434                 fprintf (stderr,
01435                   (_("Warning in %s () an out of range value was found.\n")),
01436                   __FUNCTION__);
01437         }
01438 #if DEBUG
01439         DXF_DEBUG_END
01440 #endif
01441         return (mtext->paperspace);
01442 }
01443 
01444 
01448 DxfMtext *
01449 dxf_mtext_set_paperspace
01450 (
01451         DxfMtext *mtext,
01453         int paperspace
01455 )
01456 {
01457 #if DEBUG
01458         DXF_DEBUG_BEGIN
01459 #endif
01460         /* Do some basic checks. */
01461         if (mtext == NULL)
01462         {
01463                 fprintf (stderr,
01464                   (_("Error in %s () a NULL pointer was passed.\n")),
01465                   __FUNCTION__);
01466                 return (NULL);
01467         }
01468         if (paperspace < 0)
01469         {
01470                 fprintf (stderr,
01471                   (_("Error in %s () a negative value was passed.\n")),
01472                   __FUNCTION__);
01473                 return (NULL);
01474         }
01475         if (paperspace > 1)
01476         {
01477                 fprintf (stderr,
01478                   (_("Error in %s () an out of range value was passed.\n")),
01479                   __FUNCTION__);
01480                 return (NULL);
01481         }
01482         mtext->paperspace = paperspace;
01483 #if DEBUG
01484         DXF_DEBUG_END
01485 #endif
01486         return (mtext);
01487 }
01488 
01489 
01496 int
01497 dxf_mtext_get_graphics_data_size
01498 (
01499         DxfMtext *mtext
01501 )
01502 {
01503 #if DEBUG
01504         DXF_DEBUG_BEGIN
01505 #endif
01506         /* Do some basic checks. */
01507         if (mtext == NULL)
01508         {
01509                 fprintf (stderr,
01510                   (_("Error in %s () a NULL pointer was passed.\n")),
01511                   __FUNCTION__);
01512                 return (EXIT_FAILURE);
01513         }
01514         if (mtext->graphics_data_size < 0)
01515         {
01516                 fprintf (stderr,
01517                   (_("Warning in %s () a negative value was found.\n")),
01518                   __FUNCTION__);
01519         }
01520         if (mtext->graphics_data_size == 0)
01521         {
01522                 fprintf (stderr,
01523                   (_("Warning in %s () a zero value was found.\n")),
01524                   __FUNCTION__);
01525         }
01526 #if DEBUG
01527         DXF_DEBUG_END
01528 #endif
01529         return (mtext->graphics_data_size);
01530 }
01531 
01532 
01539 DxfMtext *
01540 dxf_mtext_set_graphics_data_size
01541 (
01542         DxfMtext *mtext,
01544         int graphics_data_size
01547 )
01548 {
01549 #if DEBUG
01550         DXF_DEBUG_BEGIN
01551 #endif
01552         /* Do some basic checks. */
01553         if (mtext == NULL)
01554         {
01555                 fprintf (stderr,
01556                   (_("Error in %s () a NULL pointer was passed.\n")),
01557                   __FUNCTION__);
01558                 return (NULL);
01559         }
01560         if (graphics_data_size < 0)
01561         {
01562                 fprintf (stderr,
01563                   (_("Error in %s () a negative value was passed.\n")),
01564                   __FUNCTION__);
01565                 return (NULL);
01566         }
01567         if (graphics_data_size == 0)
01568         {
01569                 fprintf (stderr,
01570                   (_("Warning in %s () a zero value was passed.\n")),
01571                   __FUNCTION__);
01572         }
01573         mtext->graphics_data_size = graphics_data_size;
01574 #if DEBUG
01575         DXF_DEBUG_END
01576 #endif
01577         return (mtext);
01578 }
01579 
01580 
01587 int16_t
01588 dxf_mtext_get_shadow_mode
01589 (
01590         DxfMtext *mtext
01592 )
01593 {
01594 #if DEBUG
01595         DXF_DEBUG_BEGIN
01596 #endif
01597         /* Do some basic checks. */
01598         if (mtext == NULL)
01599         {
01600                 fprintf (stderr,
01601                   (_("Error in %s () a NULL pointer was passed.\n")),
01602                   __FUNCTION__);
01603                 return (EXIT_FAILURE);
01604         }
01605         if (mtext->shadow_mode < 0)
01606         {
01607                 fprintf (stderr,
01608                   (_("Error in %s () a negative value was found.\n")),
01609                   __FUNCTION__);
01610                 return (EXIT_FAILURE);
01611         }
01612         if (mtext->shadow_mode > 3)
01613         {
01614                 fprintf (stderr,
01615                   (_("Error in %s () an out of range value was found.\n")),
01616                   __FUNCTION__);
01617                 return (EXIT_FAILURE);
01618         }
01619 #if DEBUG
01620         DXF_DEBUG_END
01621 #endif
01622         return (mtext->shadow_mode);
01623 }
01624 
01625 
01632 DxfMtext *
01633 dxf_mtext_set_shadow_mode
01634 (
01635         DxfMtext *mtext,
01637         int16_t shadow_mode
01639 )
01640 {
01641 #if DEBUG
01642         DXF_DEBUG_BEGIN
01643 #endif
01644         /* Do some basic checks. */
01645         if (mtext == NULL)
01646         {
01647                 fprintf (stderr,
01648                   (_("Error in %s () a NULL pointer was passed.\n")),
01649                   __FUNCTION__);
01650                 return (NULL);
01651         }
01652         if (shadow_mode < 0)
01653         {
01654                 fprintf (stderr,
01655                   (_("Error in %s () a negative value was passed.\n")),
01656                   __FUNCTION__);
01657                 return (NULL);
01658         }
01659         if (shadow_mode > 3)
01660         {
01661                 fprintf (stderr,
01662                   (_("Error in %s () an out of range value was passed.\n")),
01663                   __FUNCTION__);
01664                 return (NULL);
01665         }
01666         mtext->shadow_mode = shadow_mode;
01667 #if DEBUG
01668         DXF_DEBUG_END
01669 #endif
01670         return (mtext);
01671 }
01672 
01673 
01682 DxfBinaryGraphicsData *
01683 dxf_mtext_get_binary_graphics_data
01684 (
01685         DxfMtext *mtext
01687 )
01688 {
01689 #if DEBUG
01690         DXF_DEBUG_BEGIN
01691 #endif
01692         /* Do some basic checks. */
01693         if (mtext == NULL)
01694         {
01695                 fprintf (stderr,
01696                   (_("Error in %s () a NULL pointer was passed.\n")),
01697                   __FUNCTION__);
01698                 return (NULL);
01699         }
01700         if (mtext->binary_graphics_data ==  NULL)
01701         {
01702                 fprintf (stderr,
01703                   (_("Error in %s () a NULL pointer was found.\n")),
01704                   __FUNCTION__);
01705                 return (NULL);
01706         }
01707 #if DEBUG
01708         DXF_DEBUG_END
01709 #endif
01710         return ((DxfBinaryGraphicsData *) mtext->binary_graphics_data);
01711 }
01712 
01713 
01718 DxfMtext *
01719 dxf_mtext_set_binary_graphics_data
01720 (
01721         DxfMtext *mtext,
01723         DxfBinaryGraphicsData *data
01726 )
01727 {
01728 #if DEBUG
01729         DXF_DEBUG_BEGIN
01730 #endif
01731         /* Do some basic checks. */
01732         if (mtext == NULL)
01733         {
01734                 fprintf (stderr,
01735                   (_("Error in %s () a NULL pointer was passed.\n")),
01736                   __FUNCTION__);
01737                 return (NULL);
01738         }
01739         if (data == NULL)
01740         {
01741                 fprintf (stderr,
01742                   (_("Error in %s () a NULL pointer was passed.\n")),
01743                   __FUNCTION__);
01744                 return (NULL);
01745         }
01746         mtext->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01747 #if DEBUG
01748         DXF_DEBUG_END
01749 #endif
01750         return (mtext);
01751 }
01752 
01753 
01762 char *
01763 dxf_mtext_get_dictionary_owner_soft
01764 (
01765         DxfMtext *mtext
01767 )
01768 {
01769 #if DEBUG
01770         DXF_DEBUG_BEGIN
01771 #endif
01772         /* Do some basic checks. */
01773         if (mtext == NULL)
01774         {
01775                 fprintf (stderr,
01776                   (_("Error in %s () a NULL pointer was passed.\n")),
01777                   __FUNCTION__);
01778                 return (NULL);
01779         }
01780         if (mtext->dictionary_owner_soft ==  NULL)
01781         {
01782                 fprintf (stderr,
01783                   (_("Error in %s () a NULL pointer was found.\n")),
01784                   __FUNCTION__);
01785                 return (NULL);
01786         }
01787 #if DEBUG
01788         DXF_DEBUG_END
01789 #endif
01790         return (strdup (mtext->dictionary_owner_soft));
01791 }
01792 
01793 
01798 DxfMtext *
01799 dxf_mtext_set_dictionary_owner_soft
01800 (
01801         DxfMtext *mtext,
01803         char *dictionary_owner_soft
01806 )
01807 {
01808 #if DEBUG
01809         DXF_DEBUG_BEGIN
01810 #endif
01811         /* Do some basic checks. */
01812         if (mtext == NULL)
01813         {
01814                 fprintf (stderr,
01815                   (_("Error in %s () a NULL pointer was passed.\n")),
01816                   __FUNCTION__);
01817                 return (NULL);
01818         }
01819         if (dictionary_owner_soft == NULL)
01820         {
01821                 fprintf (stderr,
01822                   (_("Error in %s () a NULL pointer was passed.\n")),
01823                   __FUNCTION__);
01824                 return (NULL);
01825         }
01826         mtext->dictionary_owner_soft = strdup (dictionary_owner_soft);
01827 #if DEBUG
01828         DXF_DEBUG_END
01829 #endif
01830         return (mtext);
01831 }
01832 
01833 
01842 char *
01843 dxf_mtext_get_material
01844 (
01845         DxfMtext *mtext
01847 )
01848 {
01849 #if DEBUG
01850         DXF_DEBUG_BEGIN
01851 #endif
01852         /* Do some basic checks. */
01853         if (mtext == NULL)
01854         {
01855                 fprintf (stderr,
01856                   (_("Error in %s () a NULL pointer was passed.\n")),
01857                   __FUNCTION__);
01858                 return (NULL);
01859         }
01860         if (mtext->material ==  NULL)
01861         {
01862                 fprintf (stderr,
01863                   (_("Error in %s () a NULL pointer was found.\n")),
01864                   __FUNCTION__);
01865                 return (NULL);
01866         }
01867 #if DEBUG
01868         DXF_DEBUG_END
01869 #endif
01870         return (strdup (mtext->material));
01871 }
01872 
01873 
01880 DxfMtext *
01881 dxf_mtext_set_material
01882 (
01883         DxfMtext *mtext,
01885         char *material
01888 )
01889 {
01890 #if DEBUG
01891         DXF_DEBUG_BEGIN
01892 #endif
01893         /* Do some basic checks. */
01894         if (mtext == NULL)
01895         {
01896                 fprintf (stderr,
01897                   (_("Error in %s () a NULL pointer was passed.\n")),
01898                   __FUNCTION__);
01899                 return (NULL);
01900         }
01901         if (material == NULL)
01902         {
01903                 fprintf (stderr,
01904                   (_("Error in %s () a NULL pointer was passed.\n")),
01905                   __FUNCTION__);
01906                 return (NULL);
01907         }
01908         mtext->material = strdup (material);
01909 #if DEBUG
01910         DXF_DEBUG_END
01911 #endif
01912         return (mtext);
01913 }
01914 
01915 
01924 char *
01925 dxf_mtext_get_dictionary_owner_hard
01926 (
01927         DxfMtext *mtext
01929 )
01930 {
01931 #if DEBUG
01932         DXF_DEBUG_BEGIN
01933 #endif
01934         /* Do some basic checks. */
01935         if (mtext == NULL)
01936         {
01937                 fprintf (stderr,
01938                   (_("Error in %s () a NULL pointer was passed.\n")),
01939                   __FUNCTION__);
01940                 return (NULL);
01941         }
01942         if (mtext->dictionary_owner_hard ==  NULL)
01943         {
01944                 fprintf (stderr,
01945                   (_("Error in %s () a NULL pointer was found.\n")),
01946                   __FUNCTION__);
01947                 return (NULL);
01948         }
01949 #if DEBUG
01950         DXF_DEBUG_END
01951 #endif
01952         return (strdup (mtext->dictionary_owner_hard));
01953 }
01954 
01955 
01960 DxfMtext *
01961 dxf_mtext_set_dictionary_owner_hard
01962 (
01963         DxfMtext *mtext,
01965         char *dictionary_owner_hard
01968 )
01969 {
01970 #if DEBUG
01971         DXF_DEBUG_BEGIN
01972 #endif
01973         /* Do some basic checks. */
01974         if (mtext == NULL)
01975         {
01976                 fprintf (stderr,
01977                   (_("Error in %s () a NULL pointer was passed.\n")),
01978                   __FUNCTION__);
01979                 return (NULL);
01980         }
01981         if (dictionary_owner_hard == NULL)
01982         {
01983                 fprintf (stderr,
01984                   (_("Error in %s () a NULL pointer was passed.\n")),
01985                   __FUNCTION__);
01986                 return (NULL);
01987         }
01988         mtext->dictionary_owner_hard = strdup (dictionary_owner_hard);
01989 #if DEBUG
01990         DXF_DEBUG_END
01991 #endif
01992         return (mtext);
01993 }
01994 
01995 
02002 int16_t
02003 dxf_mtext_get_lineweight
02004 (
02005         DxfMtext *mtext
02007 )
02008 {
02009 #if DEBUG
02010         DXF_DEBUG_BEGIN
02011 #endif
02012         /* Do some basic checks. */
02013         if (mtext == NULL)
02014         {
02015                 fprintf (stderr,
02016                   (_("Error in %s () a NULL pointer was passed.\n")),
02017                   __FUNCTION__);
02018                 return (EXIT_FAILURE);
02019         }
02020 #if DEBUG
02021         DXF_DEBUG_END
02022 #endif
02023         return (mtext->lineweight);
02024 }
02025 
02026 
02033 DxfMtext *
02034 dxf_mtext_set_lineweight
02035 (
02036         DxfMtext *mtext,
02038         int16_t lineweight
02040 )
02041 {
02042 #if DEBUG
02043         DXF_DEBUG_BEGIN
02044 #endif
02045         /* Do some basic checks. */
02046         if (mtext == NULL)
02047         {
02048                 fprintf (stderr,
02049                   (_("Error in %s () a NULL pointer was passed.\n")),
02050                   __FUNCTION__);
02051                 return (NULL);
02052         }
02053         mtext->lineweight = lineweight;
02054 #if DEBUG
02055         DXF_DEBUG_END
02056 #endif
02057         return (mtext);
02058 }
02059 
02060 
02067 char *
02068 dxf_mtext_get_plot_style_name
02069 (
02070         DxfMtext *mtext
02072 )
02073 {
02074 #if DEBUG
02075         DXF_DEBUG_BEGIN
02076 #endif
02077         /* Do some basic checks. */
02078         if (mtext == NULL)
02079         {
02080                 fprintf (stderr,
02081                   (_("Error in %s () a NULL pointer was passed.\n")),
02082                   __FUNCTION__);
02083                 return (NULL);
02084         }
02085         if (mtext->plot_style_name ==  NULL)
02086         {
02087                 fprintf (stderr,
02088                   (_("Error in %s () a NULL pointer was found.\n")),
02089                   __FUNCTION__);
02090                 return (NULL);
02091         }
02092 #if DEBUG
02093         DXF_DEBUG_END
02094 #endif
02095         return (strdup (mtext->plot_style_name));
02096 }
02097 
02098 
02105 DxfMtext *
02106 dxf_mtext_set_plot_style_name
02107 (
02108         DxfMtext *mtext,
02110         char *plot_style_name
02113 )
02114 {
02115 #if DEBUG
02116         DXF_DEBUG_BEGIN
02117 #endif
02118         /* Do some basic checks. */
02119         if (mtext == NULL)
02120         {
02121                 fprintf (stderr,
02122                   (_("Error in %s () a NULL pointer was passed.\n")),
02123                   __FUNCTION__);
02124                 return (NULL);
02125         }
02126         if (plot_style_name == NULL)
02127         {
02128                 fprintf (stderr,
02129                   (_("Error in %s () a NULL pointer was passed.\n")),
02130                   __FUNCTION__);
02131                 return (NULL);
02132         }
02133         mtext->plot_style_name = strdup (plot_style_name);
02134 #if DEBUG
02135         DXF_DEBUG_END
02136 #endif
02137         return (mtext);
02138 }
02139 
02140 
02147 long
02148 dxf_mtext_get_color_value
02149 (
02150         DxfMtext *mtext
02152 )
02153 {
02154 #if DEBUG
02155         DXF_DEBUG_BEGIN
02156 #endif
02157         /* Do some basic checks. */
02158         if (mtext == NULL)
02159         {
02160                 fprintf (stderr,
02161                   (_("Error in %s () a NULL pointer was passed.\n")),
02162                   __FUNCTION__);
02163                 return (EXIT_FAILURE);
02164         }
02165 #if DEBUG
02166         DXF_DEBUG_END
02167 #endif
02168         return (mtext->color_value);
02169 }
02170 
02171 
02178 DxfMtext *
02179 dxf_mtext_set_color_value
02180 (
02181         DxfMtext *mtext,
02183         long color_value
02185 )
02186 {
02187 #if DEBUG
02188         DXF_DEBUG_BEGIN
02189 #endif
02190         /* Do some basic checks. */
02191         if (mtext == NULL)
02192         {
02193                 fprintf (stderr,
02194                   (_("Error in %s () a NULL pointer was passed.\n")),
02195                   __FUNCTION__);
02196                 return (NULL);
02197         }
02198         mtext->color_value = color_value;
02199 #if DEBUG
02200         DXF_DEBUG_END
02201 #endif
02202         return (mtext);
02203 }
02204 
02205 
02212 char *
02213 dxf_mtext_get_color_name
02214 (
02215         DxfMtext *mtext
02217 )
02218 {
02219 #if DEBUG
02220         DXF_DEBUG_BEGIN
02221 #endif
02222         /* Do some basic checks. */
02223         if (mtext == NULL)
02224         {
02225                 fprintf (stderr,
02226                   (_("Error in %s () a NULL pointer was passed.\n")),
02227                   __FUNCTION__);
02228                 return (NULL);
02229         }
02230         if (mtext->color_name ==  NULL)
02231         {
02232                 fprintf (stderr,
02233                   (_("Error in %s () a NULL pointer was found.\n")),
02234                   __FUNCTION__);
02235                 return (NULL);
02236         }
02237 #if DEBUG
02238         DXF_DEBUG_END
02239 #endif
02240         return (strdup (mtext->color_name));
02241 }
02242 
02243 
02250 DxfMtext *
02251 dxf_mtext_set_color_name
02252 (
02253         DxfMtext *mtext,
02255         char *color_name
02258 )
02259 {
02260 #if DEBUG
02261         DXF_DEBUG_BEGIN
02262 #endif
02263         /* Do some basic checks. */
02264         if (mtext == NULL)
02265         {
02266                 fprintf (stderr,
02267                   (_("Error in %s () a NULL pointer was passed.\n")),
02268                   __FUNCTION__);
02269                 return (NULL);
02270         }
02271         if (color_name == NULL)
02272         {
02273                 fprintf (stderr,
02274                   (_("Error in %s () a NULL pointer was passed.\n")),
02275                   __FUNCTION__);
02276                 return (NULL);
02277         }
02278         mtext->color_name = strdup (color_name);
02279 #if DEBUG
02280         DXF_DEBUG_END
02281 #endif
02282         return (mtext);
02283 }
02284 
02285 
02292 long
02293 dxf_mtext_get_transparency
02294 (
02295         DxfMtext *mtext
02297 )
02298 {
02299 #if DEBUG
02300         DXF_DEBUG_BEGIN
02301 #endif
02302         /* Do some basic checks. */
02303         if (mtext == NULL)
02304         {
02305                 fprintf (stderr,
02306                   (_("Error in %s () a NULL pointer was passed.\n")),
02307                   __FUNCTION__);
02308                 return (EXIT_FAILURE);
02309         }
02310 #if DEBUG
02311         DXF_DEBUG_END
02312 #endif
02313         return (mtext->transparency);
02314 }
02315 
02316 
02323 DxfMtext *
02324 dxf_mtext_set_transparency
02325 (
02326         DxfMtext *mtext,
02328         long transparency
02330 )
02331 {
02332 #if DEBUG
02333         DXF_DEBUG_BEGIN
02334 #endif
02335         /* Do some basic checks. */
02336         if (mtext == NULL)
02337         {
02338                 fprintf (stderr,
02339                   (_("Error in %s () a NULL pointer was passed.\n")),
02340                   __FUNCTION__);
02341                 return (NULL);
02342         }
02343         mtext->transparency = transparency;
02344 #if DEBUG
02345         DXF_DEBUG_END
02346 #endif
02347         return (mtext);
02348 }
02349 
02350 
02357 char *
02358 dxf_mtext_get_text_value
02359 (
02360         DxfMtext *mtext
02362 )
02363 {
02364 #if DEBUG
02365         DXF_DEBUG_BEGIN
02366 #endif
02367         /* Do some basic checks. */
02368         if (mtext == NULL)
02369         {
02370                 fprintf (stderr,
02371                   (_("Error in %s () a NULL pointer was passed.\n")),
02372                   __FUNCTION__);
02373                 return (NULL);
02374         }
02375         if (mtext->text_value ==  NULL)
02376         {
02377                 fprintf (stderr,
02378                   (_("Error in %s () a NULL pointer was found.\n")),
02379                   __FUNCTION__);
02380                 return (NULL);
02381         }
02382 #if DEBUG
02383         DXF_DEBUG_END
02384 #endif
02385         return (strdup (mtext->text_value));
02386 }
02387 
02388 
02395 DxfMtext *
02396 dxf_mtext_set_text_value
02397 (
02398         DxfMtext *mtext,
02400         char *text_value
02403 )
02404 {
02405 #if DEBUG
02406         DXF_DEBUG_BEGIN
02407 #endif
02408         /* Do some basic checks. */
02409         if (mtext == NULL)
02410         {
02411                 fprintf (stderr,
02412                   (_("Error in %s () a NULL pointer was passed.\n")),
02413                   __FUNCTION__);
02414                 return (NULL);
02415         }
02416         if (text_value == NULL)
02417         {
02418                 fprintf (stderr,
02419                   (_("Error in %s () a NULL pointer was passed.\n")),
02420                   __FUNCTION__);
02421                 return (NULL);
02422         }
02423         mtext->text_value = strdup (text_value);
02424 #if DEBUG
02425         DXF_DEBUG_END
02426 #endif
02427         return (mtext);
02428 }
02429 
02430 
02437 char *
02438 dxf_mtext_get_text_style
02439 (
02440         DxfMtext *mtext
02442 )
02443 {
02444 #if DEBUG
02445         DXF_DEBUG_BEGIN
02446 #endif
02447         /* Do some basic checks. */
02448         if (mtext == NULL)
02449         {
02450                 fprintf (stderr,
02451                   (_("Error in %s () a NULL pointer was passed.\n")),
02452                   __FUNCTION__);
02453                 return (NULL);
02454         }
02455         if (mtext->text_style ==  NULL)
02456         {
02457                 fprintf (stderr,
02458                   (_("Error in %s () a NULL pointer was found.\n")),
02459                   __FUNCTION__);
02460                 return (NULL);
02461         }
02462 #if DEBUG
02463         DXF_DEBUG_END
02464 #endif
02465         return (strdup (mtext->text_style));
02466 }
02467 
02468 
02475 DxfMtext *
02476 dxf_mtext_set_text_style
02477 (
02478         DxfMtext *mtext,
02480         char *text_style
02483 )
02484 {
02485 #if DEBUG
02486         DXF_DEBUG_BEGIN
02487 #endif
02488         /* Do some basic checks. */
02489         if (mtext == NULL)
02490         {
02491                 fprintf (stderr,
02492                   (_("Error in %s () a NULL pointer was passed.\n")),
02493                   __FUNCTION__);
02494                 return (NULL);
02495         }
02496         if (text_style == NULL)
02497         {
02498                 fprintf (stderr,
02499                   (_("Error in %s () a NULL pointer was passed.\n")),
02500                   __FUNCTION__);
02501                 return (NULL);
02502         }
02503         mtext->text_style = strdup (text_style);
02504 #if DEBUG
02505         DXF_DEBUG_END
02506 #endif
02507         return (mtext);
02508 }
02509 
02510 
02516 DxfPoint *
02517 dxf_mtext_get_p0
02518 (
02519         DxfMtext *mtext
02521 )
02522 {
02523 #ifdef DEBUG
02524         DXF_DEBUG_BEGIN
02525 #endif
02526         /* Do some basic checks. */
02527         if (mtext == NULL)
02528         {
02529                 fprintf (stderr,
02530                   (_("Error in %s () a NULL pointer was passed.\n")),
02531                   __FUNCTION__);
02532                 return (NULL);
02533         }
02534         if (mtext->p0 == NULL)
02535         {
02536                 fprintf (stderr,
02537                   (_("Error in %s () a NULL pointer was found.\n")),
02538                   __FUNCTION__);
02539                 return (NULL);
02540         }
02541 #if DEBUG
02542         DXF_DEBUG_END
02543 #endif
02544         return (mtext->p0);
02545 }
02546 
02547 
02553 DxfMtext *
02554 dxf_mtext_set_p0
02555 (
02556         DxfMtext *mtext,
02558         DxfPoint *p0
02560 )
02561 {
02562 #ifdef DEBUG
02563         DXF_DEBUG_BEGIN
02564 #endif
02565         /* Do some basic checks. */
02566         if (mtext == NULL)
02567         {
02568                 fprintf (stderr,
02569                   (_("Error in %s () a NULL pointer was passed.\n")),
02570                   __FUNCTION__);
02571                 return (NULL);
02572         }
02573         if (p0 == NULL)
02574         {
02575                 fprintf (stderr,
02576                   (_("Error in %s () a NULL pointer was passed.\n")),
02577                   __FUNCTION__);
02578                 return (NULL);
02579         }
02580         mtext->p0 = p0;
02581 #if DEBUG
02582         DXF_DEBUG_END
02583 #endif
02584         return (mtext);
02585 }
02586 
02587 
02594 double
02595 dxf_mtext_get_x0
02596 (
02597         DxfMtext *mtext
02599 )
02600 {
02601 #ifdef DEBUG
02602         DXF_DEBUG_BEGIN
02603 #endif
02604 
02605         /* Do some basic checks. */
02606         if (mtext == NULL)
02607         {
02608                 fprintf (stderr,
02609                   (_("Error in %s () a NULL pointer was passed.\n")),
02610                   __FUNCTION__);
02611                 return (EXIT_FAILURE);
02612         }
02613         if (mtext->p0 == NULL)
02614         {
02615                 fprintf (stderr,
02616                   (_("Error in %s () a NULL pointer was found.\n")),
02617                   __FUNCTION__);
02618                 return (EXIT_FAILURE);
02619         }
02620 #if DEBUG
02621         DXF_DEBUG_END
02622 #endif
02623         return (mtext->p0->x0);
02624 }
02625 
02626 
02634 DxfMtext *
02635 dxf_mtext_set_x0
02636 (
02637         DxfMtext *mtext,
02639         double x0
02642 )
02643 {
02644 #ifdef DEBUG
02645         DXF_DEBUG_BEGIN
02646 #endif
02647         /* Do some basic checks. */
02648         if (mtext == NULL)
02649         {
02650                 fprintf (stderr,
02651                   (_("Error in %s () a NULL pointer was passed.\n")),
02652                   __FUNCTION__);
02653                 return (NULL);
02654         }
02655         if (mtext->p0 == NULL)
02656         {
02657                 fprintf (stderr,
02658                   (_("Error in %s () a NULL pointer was found.\n")),
02659                   __FUNCTION__);
02660                 return (NULL);
02661         }
02662         mtext->p0->x0 = x0;
02663 #if DEBUG
02664         DXF_DEBUG_END
02665 #endif
02666         return (mtext);
02667 }
02668 
02669 
02676 double
02677 dxf_mtext_get_y0
02678 (
02679         DxfMtext *mtext
02681 )
02682 {
02683 #ifdef DEBUG
02684         DXF_DEBUG_BEGIN
02685 #endif
02686 
02687         /* Do some basic checks. */
02688         if (mtext == NULL)
02689         {
02690                 fprintf (stderr,
02691                   (_("Error in %s () a NULL pointer was passed.\n")),
02692                   __FUNCTION__);
02693                 return (EXIT_FAILURE);
02694         }
02695         if (mtext->p0 == NULL)
02696         {
02697                 fprintf (stderr,
02698                   (_("Error in %s () a NULL pointer was found.\n")),
02699                   __FUNCTION__);
02700                 return (EXIT_FAILURE);
02701         }
02702 #if DEBUG
02703         DXF_DEBUG_END
02704 #endif
02705         return (mtext->p0->y0);
02706 }
02707 
02708 
02716 DxfMtext *
02717 dxf_mtext_set_y0
02718 (
02719         DxfMtext *mtext,
02721         double y0
02724 )
02725 {
02726 #ifdef DEBUG
02727         DXF_DEBUG_BEGIN
02728 #endif
02729         /* Do some basic checks. */
02730         if (mtext == NULL)
02731         {
02732                 fprintf (stderr,
02733                   (_("Error in %s () a NULL pointer was passed.\n")),
02734                   __FUNCTION__);
02735                 return (NULL);
02736         }
02737         if (mtext->p0 == NULL)
02738         {
02739                 fprintf (stderr,
02740                   (_("Error in %s () a NULL pointer was found.\n")),
02741                   __FUNCTION__);
02742                 return (NULL);
02743         }
02744         mtext->p0->y0 = y0;
02745 #if DEBUG
02746         DXF_DEBUG_END
02747 #endif
02748         return (mtext);
02749 }
02750 
02751 
02758 double
02759 dxf_mtext_get_z0
02760 (
02761         DxfMtext *mtext
02763 )
02764 {
02765 #ifdef DEBUG
02766         DXF_DEBUG_BEGIN
02767 #endif
02768 
02769         /* Do some basic checks. */
02770         if (mtext == NULL)
02771         {
02772                 fprintf (stderr,
02773                   (_("Error in %s () a NULL pointer was passed.\n")),
02774                   __FUNCTION__);
02775                 return (EXIT_FAILURE);
02776         }
02777         if (mtext->p0 == NULL)
02778         {
02779                 fprintf (stderr,
02780                   (_("Error in %s () a NULL pointer was found.\n")),
02781                   __FUNCTION__);
02782                 return (EXIT_FAILURE);
02783         }
02784 #if DEBUG
02785         DXF_DEBUG_END
02786 #endif
02787         return (mtext->p0->z0);
02788 }
02789 
02790 
02798 DxfMtext *
02799 dxf_mtext_set_z0
02800 (
02801         DxfMtext *mtext,
02803         double z0
02806 )
02807 {
02808 #ifdef DEBUG
02809         DXF_DEBUG_BEGIN
02810 #endif
02811         /* Do some basic checks. */
02812         if (mtext == NULL)
02813         {
02814                 fprintf (stderr,
02815                   (_("Error in %s () a NULL pointer was passed.\n")),
02816                   __FUNCTION__);
02817                 return (NULL);
02818         }
02819         if (mtext->p0 == NULL)
02820         {
02821                 fprintf (stderr,
02822                   (_("Error in %s () a NULL pointer was found.\n")),
02823                   __FUNCTION__);
02824                 return (NULL);
02825         }
02826         mtext->p0->z0 = z0;
02827 #if DEBUG
02828         DXF_DEBUG_END
02829 #endif
02830         return (mtext);
02831 }
02832 
02833 
02839 DxfPoint *
02840 dxf_mtext_get_p1
02841 (
02842         DxfMtext *mtext
02844 )
02845 {
02846 #ifdef DEBUG
02847         DXF_DEBUG_BEGIN
02848 #endif
02849         /* Do some basic checks. */
02850         if (mtext == NULL)
02851         {
02852                 fprintf (stderr,
02853                   (_("Error in %s () a NULL pointer was passed.\n")),
02854                   __FUNCTION__);
02855                 return (NULL);
02856         }
02857         if (mtext->p1 == NULL)
02858         {
02859                 fprintf (stderr,
02860                   (_("Error in %s () a NULL pointer was found.\n")),
02861                   __FUNCTION__);
02862                 return (NULL);
02863         }
02864 #if DEBUG
02865         DXF_DEBUG_END
02866 #endif
02867         return (mtext->p1);
02868 }
02869 
02870 
02876 DxfMtext *
02877 dxf_mtext_set_p1
02878 (
02879         DxfMtext *mtext,
02881         DxfPoint *p1
02883 )
02884 {
02885 #ifdef DEBUG
02886         DXF_DEBUG_BEGIN
02887 #endif
02888         /* Do some basic checks. */
02889         if (mtext == NULL)
02890         {
02891                 fprintf (stderr,
02892                   (_("Error in %s () a NULL pointer was passed.\n")),
02893                   __FUNCTION__);
02894                 return (NULL);
02895         }
02896         if (p1 == NULL)
02897         {
02898                 fprintf (stderr,
02899                   (_("Error in %s () a NULL pointer was passed.\n")),
02900                   __FUNCTION__);
02901                 return (NULL);
02902         }
02903         mtext->p1 = p1;
02904 #if DEBUG
02905         DXF_DEBUG_END
02906 #endif
02907         return (mtext);
02908 }
02909 
02910 
02917 double
02918 dxf_mtext_get_x1
02919 (
02920         DxfMtext *mtext
02922 )
02923 {
02924 #ifdef DEBUG
02925         DXF_DEBUG_BEGIN
02926 #endif
02927 
02928         /* Do some basic checks. */
02929         if (mtext == NULL)
02930         {
02931                 fprintf (stderr,
02932                   (_("Error in %s () a NULL pointer was passed.\n")),
02933                   __FUNCTION__);
02934                 return (EXIT_FAILURE);
02935         }
02936         if (mtext->p1 == NULL)
02937         {
02938                 fprintf (stderr,
02939                   (_("Error in %s () a NULL pointer was found.\n")),
02940                   __FUNCTION__);
02941                 return (EXIT_FAILURE);
02942         }
02943 #if DEBUG
02944         DXF_DEBUG_END
02945 #endif
02946         return (mtext->p1->x0);
02947 }
02948 
02949 
02957 DxfMtext *
02958 dxf_mtext_set_x1
02959 (
02960         DxfMtext *mtext,
02962         double x1
02965 )
02966 {
02967 #ifdef DEBUG
02968         DXF_DEBUG_BEGIN
02969 #endif
02970         /* Do some basic checks. */
02971         if (mtext == NULL)
02972         {
02973                 fprintf (stderr,
02974                   (_("Error in %s () a NULL pointer was passed.\n")),
02975                   __FUNCTION__);
02976                 return (NULL);
02977         }
02978         if (mtext->p1 == NULL)
02979         {
02980                 fprintf (stderr,
02981                   (_("Error in %s () a NULL pointer was found.\n")),
02982                   __FUNCTION__);
02983                 return (NULL);
02984         }
02985         mtext->p1->x0 = x1;
02986 #if DEBUG
02987         DXF_DEBUG_END
02988 #endif
02989         return (mtext);
02990 }
02991 
02992 
02999 double
03000 dxf_mtext_get_y1
03001 (
03002         DxfMtext *mtext
03004 )
03005 {
03006 #ifdef DEBUG
03007         DXF_DEBUG_BEGIN
03008 #endif
03009 
03010         /* Do some basic checks. */
03011         if (mtext == NULL)
03012         {
03013                 fprintf (stderr,
03014                   (_("Error in %s () a NULL pointer was passed.\n")),
03015                   __FUNCTION__);
03016                 return (EXIT_FAILURE);
03017         }
03018         if (mtext->p1 == NULL)
03019         {
03020                 fprintf (stderr,
03021                   (_("Error in %s () a NULL pointer was found.\n")),
03022                   __FUNCTION__);
03023                 return (EXIT_FAILURE);
03024         }
03025 #if DEBUG
03026         DXF_DEBUG_END
03027 #endif
03028         return (mtext->p1->y0);
03029 }
03030 
03031 
03039 DxfMtext *
03040 dxf_mtext_set_y1
03041 (
03042         DxfMtext *mtext,
03044         double y1
03047 )
03048 {
03049 #ifdef DEBUG
03050         DXF_DEBUG_BEGIN
03051 #endif
03052         /* Do some basic checks. */
03053         if (mtext == NULL)
03054         {
03055                 fprintf (stderr,
03056                   (_("Error in %s () a NULL pointer was passed.\n")),
03057                   __FUNCTION__);
03058                 return (NULL);
03059         }
03060         if (mtext->p1 == NULL)
03061         {
03062                 fprintf (stderr,
03063                   (_("Error in %s () a NULL pointer was found.\n")),
03064                   __FUNCTION__);
03065                 return (NULL);
03066         }
03067         mtext->p1->y0 = y1;
03068 #if DEBUG
03069         DXF_DEBUG_END
03070 #endif
03071         return (mtext);
03072 }
03073 
03074 
03081 double
03082 dxf_mtext_get_z1
03083 (
03084         DxfMtext *mtext
03086 )
03087 {
03088 #ifdef DEBUG
03089         DXF_DEBUG_BEGIN
03090 #endif
03091 
03092         /* Do some basic checks. */
03093         if (mtext == NULL)
03094         {
03095                 fprintf (stderr,
03096                   (_("Error in %s () a NULL pointer was passed.\n")),
03097                   __FUNCTION__);
03098                 return (EXIT_FAILURE);
03099         }
03100         if (mtext->p1 == NULL)
03101         {
03102                 fprintf (stderr,
03103                   (_("Error in %s () a NULL pointer was found.\n")),
03104                   __FUNCTION__);
03105                 return (EXIT_FAILURE);
03106         }
03107 #if DEBUG
03108         DXF_DEBUG_END
03109 #endif
03110         return (mtext->p1->z0);
03111 }
03112 
03113 
03121 DxfMtext *
03122 dxf_mtext_set_z1
03123 (
03124         DxfMtext *mtext,
03126         double z1
03129 )
03130 {
03131 #ifdef DEBUG
03132         DXF_DEBUG_BEGIN
03133 #endif
03134         /* Do some basic checks. */
03135         if (mtext == NULL)
03136         {
03137                 fprintf (stderr,
03138                   (_("Error in %s () a NULL pointer was passed.\n")),
03139                   __FUNCTION__);
03140                 return (NULL);
03141         }
03142         if (mtext->p1 == NULL)
03143         {
03144                 fprintf (stderr,
03145                   (_("Error in %s () a NULL pointer was found.\n")),
03146                   __FUNCTION__);
03147                 return (NULL);
03148         }
03149         mtext->p1->z0 = z1;
03150 #if DEBUG
03151         DXF_DEBUG_END
03152 #endif
03153         return (mtext);
03154 }
03155 
03156 
03163 double
03164 dxf_mtext_get_height
03165 (
03166         DxfMtext *mtext
03168 )
03169 {
03170 #ifdef DEBUG
03171         DXF_DEBUG_BEGIN
03172 #endif
03173 
03174         /* Do some basic checks. */
03175         if (mtext == NULL)
03176         {
03177                 fprintf (stderr,
03178                   (_("Error in %s () a NULL pointer was passed.\n")),
03179                   __FUNCTION__);
03180                 return (EXIT_FAILURE);
03181         }
03182         if (mtext->height < 0.0)
03183         {
03184                 fprintf (stderr,
03185                   (_("Warning in %s () a negative value was found.\n")),
03186                   __FUNCTION__);
03187         }
03188 #if DEBUG
03189         DXF_DEBUG_END
03190 #endif
03191         return (mtext->height);
03192 }
03193 
03194 
03202 DxfMtext *
03203 dxf_mtext_set_height
03204 (
03205         DxfMtext *mtext,
03207         double height
03210 )
03211 {
03212 #ifdef DEBUG
03213         DXF_DEBUG_BEGIN
03214 #endif
03215         /* Do some basic checks. */
03216         if (mtext == NULL)
03217         {
03218                 fprintf (stderr,
03219                   (_("Error in %s () a NULL pointer was passed.\n")),
03220                   __FUNCTION__);
03221                 return (NULL);
03222         }
03223         if (height < 0.0)
03224         {
03225                 fprintf (stderr,
03226                   (_("Warning in %s () a negative value was passed.\n")),
03227                   __FUNCTION__);
03228         }
03229         mtext->height = height;
03230 #if DEBUG
03231         DXF_DEBUG_END
03232 #endif
03233         return (mtext);
03234 }
03235 
03236 
03243 double
03244 dxf_mtext_get_rectangle_width
03245 (
03246         DxfMtext *mtext
03248 )
03249 {
03250 #ifdef DEBUG
03251         DXF_DEBUG_BEGIN
03252 #endif
03253 
03254         /* Do some basic checks. */
03255         if (mtext == NULL)
03256         {
03257                 fprintf (stderr,
03258                   (_("Error in %s () a NULL pointer was passed.\n")),
03259                   __FUNCTION__);
03260                 return (EXIT_FAILURE);
03261         }
03262         if (mtext->rectangle_width < 0.0)
03263         {
03264                 fprintf (stderr,
03265                   (_("Warning in %s () a negative value was found.\n")),
03266                   __FUNCTION__);
03267         }
03268 #if DEBUG
03269         DXF_DEBUG_END
03270 #endif
03271         return (mtext->rectangle_width);
03272 }
03273 
03274 
03282 DxfMtext *
03283 dxf_mtext_set_rectangle_width
03284 (
03285         DxfMtext *mtext,
03287         double rectangle_width
03289 )
03290 {
03291 #ifdef DEBUG
03292         DXF_DEBUG_BEGIN
03293 #endif
03294         /* Do some basic checks. */
03295         if (mtext == NULL)
03296         {
03297                 fprintf (stderr,
03298                   (_("Error in %s () a NULL pointer was passed.\n")),
03299                   __FUNCTION__);
03300                 return (NULL);
03301         }
03302         if (rectangle_width < 0.0)
03303         {
03304                 fprintf (stderr,
03305                   (_("Warning in %s () a negative value was passed.\n")),
03306                   __FUNCTION__);
03307         }
03308         mtext->rectangle_width = rectangle_width;
03309 #if DEBUG
03310         DXF_DEBUG_END
03311 #endif
03312         return (mtext);
03313 }
03314 
03315 
03321 double
03322 dxf_mtext_get_horizontal_width
03323 (
03324         DxfMtext *mtext
03326 )
03327 {
03328 #ifdef DEBUG
03329         DXF_DEBUG_BEGIN
03330 #endif
03331 
03332         /* Do some basic checks. */
03333         if (mtext == NULL)
03334         {
03335                 fprintf (stderr,
03336                   (_("Error in %s () a NULL pointer was passed.\n")),
03337                   __FUNCTION__);
03338                 return (EXIT_FAILURE);
03339         }
03340         if (mtext->horizontal_width < 0.0)
03341         {
03342                 fprintf (stderr,
03343                   (_("Warning in %s () a negative value was found.\n")),
03344                   __FUNCTION__);
03345         }
03346 #if DEBUG
03347         DXF_DEBUG_END
03348 #endif
03349         return (mtext->horizontal_width);
03350 }
03351 
03352 
03359 DxfMtext *
03360 dxf_mtext_set_horizontal_width
03361 (
03362         DxfMtext *mtext,
03364         double horizontal_width
03366 )
03367 {
03368 #ifdef DEBUG
03369         DXF_DEBUG_BEGIN
03370 #endif
03371         /* Do some basic checks. */
03372         if (mtext == NULL)
03373         {
03374                 fprintf (stderr,
03375                   (_("Error in %s () a NULL pointer was passed.\n")),
03376                   __FUNCTION__);
03377                 return (NULL);
03378         }
03379         if (horizontal_width < 0.0)
03380         {
03381                 fprintf (stderr,
03382                   (_("Warning in %s () a negative value was passed.\n")),
03383                   __FUNCTION__);
03384         }
03385         mtext->horizontal_width = horizontal_width;
03386 #if DEBUG
03387         DXF_DEBUG_END
03388 #endif
03389         return (mtext);
03390 }
03391 
03392 
03398 double
03399 dxf_mtext_get_rectangle_height
03400 (
03401         DxfMtext *mtext
03403 )
03404 {
03405 #ifdef DEBUG
03406         DXF_DEBUG_BEGIN
03407 #endif
03408 
03409         /* Do some basic checks. */
03410         if (mtext == NULL)
03411         {
03412                 fprintf (stderr,
03413                   (_("Error in %s () a NULL pointer was passed.\n")),
03414                   __FUNCTION__);
03415                 return (EXIT_FAILURE);
03416         }
03417         if (mtext->rectangle_height < 0.0)
03418         {
03419                 fprintf (stderr,
03420                   (_("Warning in %s () a negative value was found.\n")),
03421                   __FUNCTION__);
03422         }
03423 #if DEBUG
03424         DXF_DEBUG_END
03425 #endif
03426         return (mtext->rectangle_height);
03427 }
03428 
03429 
03436 DxfMtext *
03437 dxf_mtext_set_rectangle_height
03438 (
03439         DxfMtext *mtext,
03441         double rectangle_height
03443 )
03444 {
03445 #ifdef DEBUG
03446         DXF_DEBUG_BEGIN
03447 #endif
03448         /* Do some basic checks. */
03449         if (mtext == NULL)
03450         {
03451                 fprintf (stderr,
03452                   (_("Error in %s () a NULL pointer was passed.\n")),
03453                   __FUNCTION__);
03454                 return (NULL);
03455         }
03456         if (rectangle_height < 0.0)
03457         {
03458                 fprintf (stderr,
03459                   (_("Warning in %s () a negative value was passed.\n")),
03460                   __FUNCTION__);
03461         }
03462         mtext->rectangle_height = rectangle_height;
03463 #if DEBUG
03464         DXF_DEBUG_END
03465 #endif
03466         return (mtext);
03467 }
03468 
03469 
03475 double
03476 dxf_mtext_get_spacing_factor
03477 (
03478         DxfMtext *mtext
03480 )
03481 {
03482 #ifdef DEBUG
03483         DXF_DEBUG_BEGIN
03484 #endif
03485 
03486         /* Do some basic checks. */
03487         if (mtext == NULL)
03488         {
03489                 fprintf (stderr,
03490                   (_("Error in %s () a NULL pointer was passed.\n")),
03491                   __FUNCTION__);
03492                 return (EXIT_FAILURE);
03493         }
03494         if (mtext->spacing_factor < 0.0)
03495         {
03496                 fprintf (stderr,
03497                   (_("Warning in %s () a negative value was found.\n")),
03498                   __FUNCTION__);
03499         }
03500 #if DEBUG
03501         DXF_DEBUG_END
03502 #endif
03503         return (mtext->spacing_factor);
03504 }
03505 
03506 
03513 DxfMtext *
03514 dxf_mtext_set_spacing_factor
03515 (
03516         DxfMtext *mtext,
03518         double spacing_factor
03520 )
03521 {
03522 #ifdef DEBUG
03523         DXF_DEBUG_BEGIN
03524 #endif
03525         /* Do some basic checks. */
03526         if (mtext == NULL)
03527         {
03528                 fprintf (stderr,
03529                   (_("Error in %s () a NULL pointer was passed.\n")),
03530                   __FUNCTION__);
03531                 return (NULL);
03532         }
03533         if (spacing_factor < 0.0)
03534         {
03535                 fprintf (stderr,
03536                   (_("Warning in %s () a negative value was passed.\n")),
03537                   __FUNCTION__);
03538         }
03539         mtext->spacing_factor = spacing_factor;
03540 #if DEBUG
03541         DXF_DEBUG_END
03542 #endif
03543         return (mtext);
03544 }
03545 
03546 
03552 double
03553 dxf_mtext_get_box_scale
03554 (
03555         DxfMtext *mtext
03557 )
03558 {
03559 #ifdef DEBUG
03560         DXF_DEBUG_BEGIN
03561 #endif
03562 
03563         /* Do some basic checks. */
03564         if (mtext == NULL)
03565         {
03566                 fprintf (stderr,
03567                   (_("Error in %s () a NULL pointer was passed.\n")),
03568                   __FUNCTION__);
03569                 return (EXIT_FAILURE);
03570         }
03571         if (mtext->box_scale < 0.0)
03572         {
03573                 fprintf (stderr,
03574                   (_("Warning in %s () a negative value was found.\n")),
03575                   __FUNCTION__);
03576         }
03577 #if DEBUG
03578         DXF_DEBUG_END
03579 #endif
03580         return (mtext->box_scale);
03581 }
03582 
03583 
03590 DxfMtext *
03591 dxf_mtext_set_box_scale
03592 (
03593         DxfMtext *mtext,
03595         double box_scale
03597 )
03598 {
03599 #ifdef DEBUG
03600         DXF_DEBUG_BEGIN
03601 #endif
03602         /* Do some basic checks. */
03603         if (mtext == NULL)
03604         {
03605                 fprintf (stderr,
03606                   (_("Error in %s () a NULL pointer was passed.\n")),
03607                   __FUNCTION__);
03608                 return (NULL);
03609         }
03610         if (box_scale < 0.0)
03611         {
03612                 fprintf (stderr,
03613                   (_("Warning in %s () a negative value was passed.\n")),
03614                   __FUNCTION__);
03615         }
03616         mtext->box_scale = box_scale;
03617 #if DEBUG
03618         DXF_DEBUG_END
03619 #endif
03620         return (mtext);
03621 }
03622 
03623 
03629 double
03630 dxf_mtext_get_column_width
03631 (
03632         DxfMtext *mtext
03634 )
03635 {
03636 #ifdef DEBUG
03637         DXF_DEBUG_BEGIN
03638 #endif
03639 
03640         /* Do some basic checks. */
03641         if (mtext == NULL)
03642         {
03643                 fprintf (stderr,
03644                   (_("Error in %s () a NULL pointer was passed.\n")),
03645                   __FUNCTION__);
03646                 return (EXIT_FAILURE);
03647         }
03648         if (mtext->column_width < 0.0)
03649         {
03650                 fprintf (stderr,
03651                   (_("Warning in %s () a negative value was found.\n")),
03652                   __FUNCTION__);
03653         }
03654 #if DEBUG
03655         DXF_DEBUG_END
03656 #endif
03657         return (mtext->column_width);
03658 }
03659 
03660 
03667 DxfMtext *
03668 dxf_mtext_set_column_width
03669 (
03670         DxfMtext *mtext,
03672         double column_width
03674 )
03675 {
03676 #ifdef DEBUG
03677         DXF_DEBUG_BEGIN
03678 #endif
03679         /* Do some basic checks. */
03680         if (mtext == NULL)
03681         {
03682                 fprintf (stderr,
03683                   (_("Error in %s () a NULL pointer was passed.\n")),
03684                   __FUNCTION__);
03685                 return (NULL);
03686         }
03687         if (column_width < 0.0)
03688         {
03689                 fprintf (stderr,
03690                   (_("Warning in %s () a negative value was passed.\n")),
03691                   __FUNCTION__);
03692         }
03693         mtext->column_width = column_width;
03694 #if DEBUG
03695         DXF_DEBUG_END
03696 #endif
03697         return (mtext);
03698 }
03699 
03700 
03706 double
03707 dxf_mtext_get_column_gutter
03708 (
03709         DxfMtext *mtext
03711 )
03712 {
03713 #ifdef DEBUG
03714         DXF_DEBUG_BEGIN
03715 #endif
03716 
03717         /* Do some basic checks. */
03718         if (mtext == NULL)
03719         {
03720                 fprintf (stderr,
03721                   (_("Error in %s () a NULL pointer was passed.\n")),
03722                   __FUNCTION__);
03723                 return (EXIT_FAILURE);
03724         }
03725         if (mtext->column_gutter < 0.0)
03726         {
03727                 fprintf (stderr,
03728                   (_("Warning in %s () a negative value was found.\n")),
03729                   __FUNCTION__);
03730         }
03731 #if DEBUG
03732         DXF_DEBUG_END
03733 #endif
03734         return (mtext->column_gutter);
03735 }
03736 
03737 
03744 DxfMtext *
03745 dxf_mtext_set_column_gutter
03746 (
03747         DxfMtext *mtext,
03749         double column_gutter
03751 )
03752 {
03753 #ifdef DEBUG
03754         DXF_DEBUG_BEGIN
03755 #endif
03756         /* Do some basic checks. */
03757         if (mtext == NULL)
03758         {
03759                 fprintf (stderr,
03760                   (_("Error in %s () a NULL pointer was passed.\n")),
03761                   __FUNCTION__);
03762                 return (NULL);
03763         }
03764         if (column_gutter < 0.0)
03765         {
03766                 fprintf (stderr,
03767                   (_("Warning in %s () a negative value was passed.\n")),
03768                   __FUNCTION__);
03769         }
03770         mtext->column_gutter = column_gutter;
03771 #if DEBUG
03772         DXF_DEBUG_END
03773 #endif
03774         return (mtext);
03775 }
03776 
03777 
03783 double
03784 dxf_mtext_get_column_heights
03785 (
03786         DxfMtext *mtext
03788 )
03789 {
03790 #ifdef DEBUG
03791         DXF_DEBUG_BEGIN
03792 #endif
03793 
03794         /* Do some basic checks. */
03795         if (mtext == NULL)
03796         {
03797                 fprintf (stderr,
03798                   (_("Error in %s () a NULL pointer was passed.\n")),
03799                   __FUNCTION__);
03800                 return (EXIT_FAILURE);
03801         }
03802         if (mtext->column_heights < 0.0)
03803         {
03804                 fprintf (stderr,
03805                   (_("Warning in %s () a negative value was found.\n")),
03806                   __FUNCTION__);
03807         }
03808 #if DEBUG
03809         DXF_DEBUG_END
03810 #endif
03811         return (mtext->column_heights);
03812 }
03813 
03814 
03821 DxfMtext *
03822 dxf_mtext_set_column_heights
03823 (
03824         DxfMtext *mtext,
03826         double column_heights
03828 )
03829 {
03830 #ifdef DEBUG
03831         DXF_DEBUG_BEGIN
03832 #endif
03833         /* Do some basic checks. */
03834         if (mtext == NULL)
03835         {
03836                 fprintf (stderr,
03837                   (_("Error in %s () a NULL pointer was passed.\n")),
03838                   __FUNCTION__);
03839                 return (NULL);
03840         }
03841         if (column_heights < 0.0)
03842         {
03843                 fprintf (stderr,
03844                   (_("Warning in %s () a negative value was passed.\n")),
03845                   __FUNCTION__);
03846         }
03847         mtext->column_heights = column_heights;
03848 #if DEBUG
03849         DXF_DEBUG_END
03850 #endif
03851         return (mtext);
03852 }
03853 
03854 
03860 double
03861 dxf_mtext_get_rot_angle
03862 (
03863         DxfMtext *mtext
03865 )
03866 {
03867 #ifdef DEBUG
03868         DXF_DEBUG_BEGIN
03869 #endif
03870 
03871         /* Do some basic checks. */
03872         if (mtext == NULL)
03873         {
03874                 fprintf (stderr,
03875                   (_("Error in %s () a NULL pointer was passed.\n")),
03876                   __FUNCTION__);
03877                 return (EXIT_FAILURE);
03878         }
03879 #if DEBUG
03880         DXF_DEBUG_END
03881 #endif
03882         return (mtext->rot_angle);
03883 }
03884 
03885 
03892 DxfMtext *
03893 dxf_mtext_set_rot_angle
03894 (
03895         DxfMtext *mtext,
03897         double rot_angle
03899 )
03900 {
03901 #ifdef DEBUG
03902         DXF_DEBUG_BEGIN
03903 #endif
03904         /* Do some basic checks. */
03905         if (mtext == NULL)
03906         {
03907                 fprintf (stderr,
03908                   (_("Error in %s () a NULL pointer was passed.\n")),
03909                   __FUNCTION__);
03910                 return (NULL);
03911         }
03912         mtext->rot_angle = rot_angle;
03913 #if DEBUG
03914         DXF_DEBUG_END
03915 #endif
03916         return (mtext);
03917 }
03918 
03919 
03925 int
03926 dxf_mtext_get_background_color
03927 (
03928         DxfMtext *mtext
03930 )
03931 {
03932 #if DEBUG
03933         DXF_DEBUG_BEGIN
03934 #endif
03935         /* Do some basic checks. */
03936         if (mtext == NULL)
03937         {
03938                 fprintf (stderr,
03939                   (_("Error in %s () a NULL pointer was passed.\n")),
03940                   __FUNCTION__);
03941                 return (EXIT_FAILURE);
03942         }
03943         if (mtext->background_color < 0)
03944         {
03945                 fprintf (stderr,
03946                   (_("Warning in %s () a negative value was found.\n")),
03947                   __FUNCTION__);
03948         }
03949 #if DEBUG
03950         DXF_DEBUG_END
03951 #endif
03952         return (mtext->background_color);
03953 }
03954 
03955 
03959 DxfMtext *
03960 dxf_mtext_set_background_color
03961 (
03962         DxfMtext *mtext,
03964         int background_color
03966 )
03967 {
03968 #if DEBUG
03969         DXF_DEBUG_BEGIN
03970 #endif
03971         /* Do some basic checks. */
03972         if (mtext == NULL)
03973         {
03974                 fprintf (stderr,
03975                   (_("Error in %s () a NULL pointer was passed.\n")),
03976                   __FUNCTION__);
03977                 return (NULL);
03978         }
03979         if (background_color < 0)
03980         {
03981                 fprintf (stderr,
03982                   (_("Warning in %s () a negative value was passed.\n")),
03983                   __FUNCTION__);
03984         }
03985         mtext->background_color = background_color;
03986 #if DEBUG
03987         DXF_DEBUG_END
03988 #endif
03989         return (mtext);
03990 }
03991 
03992 
03998 int
03999 dxf_mtext_get_attachment_point
04000 (
04001         DxfMtext *mtext
04003 )
04004 {
04005 #if DEBUG
04006         DXF_DEBUG_BEGIN
04007 #endif
04008         /* Do some basic checks. */
04009         if (mtext == NULL)
04010         {
04011                 fprintf (stderr,
04012                   (_("Error in %s () a NULL pointer was passed.\n")),
04013                   __FUNCTION__);
04014                 return (EXIT_FAILURE);
04015         }
04016         if (mtext->attachment_point < 0)
04017         {
04018                 fprintf (stderr,
04019                   (_("Warning in %s () a negative value was found.\n")),
04020                   __FUNCTION__);
04021         }
04022         if (mtext->attachment_point > 9)
04023         {
04024                 fprintf (stderr,
04025                   (_("Warning in %s () an out of range value was found.\n")),
04026                   __FUNCTION__);
04027         }
04028 #if DEBUG
04029         DXF_DEBUG_END
04030 #endif
04031         return (mtext->attachment_point);
04032 }
04033 
04034 
04038 DxfMtext *
04039 dxf_mtext_set_attachment_point
04040 (
04041         DxfMtext *mtext,
04043         int attachment_point
04045 )
04046 {
04047 #if DEBUG
04048         DXF_DEBUG_BEGIN
04049 #endif
04050         /* Do some basic checks. */
04051         if (mtext == NULL)
04052         {
04053                 fprintf (stderr,
04054                   (_("Error in %s () a NULL pointer was passed.\n")),
04055                   __FUNCTION__);
04056                 return (NULL);
04057         }
04058         if (attachment_point < 0)
04059         {
04060                 fprintf (stderr,
04061                   (_("Warning in %s () a negative value was passed.\n")),
04062                   __FUNCTION__);
04063         }
04064         if (attachment_point > 9)
04065         {
04066                 fprintf (stderr,
04067                   (_("Warning in %s () an out of range value was passed.\n")),
04068                   __FUNCTION__);
04069         }
04070         mtext->attachment_point = attachment_point;
04071 #if DEBUG
04072         DXF_DEBUG_END
04073 #endif
04074         return (mtext);
04075 }
04076 
04077 
04083 int
04084 dxf_mtext_get_drawing_direction
04085 (
04086         DxfMtext *mtext
04088 )
04089 {
04090 #if DEBUG
04091         DXF_DEBUG_BEGIN
04092 #endif
04093         /* Do some basic checks. */
04094         if (mtext == NULL)
04095         {
04096                 fprintf (stderr,
04097                   (_("Error in %s () a NULL pointer was passed.\n")),
04098                   __FUNCTION__);
04099                 return (EXIT_FAILURE);
04100         }
04101         if (mtext->drawing_direction < 0)
04102         {
04103                 fprintf (stderr,
04104                   (_("Warning in %s () a negative value was found.\n")),
04105                   __FUNCTION__);
04106         }
04107         if (mtext->drawing_direction > 5)
04108         {
04109                 fprintf (stderr,
04110                   (_("Warning in %s () an out of range value was found.\n")),
04111                   __FUNCTION__);
04112         }
04113 #if DEBUG
04114         DXF_DEBUG_END
04115 #endif
04116         return (mtext->drawing_direction);
04117 }
04118 
04119 
04123 DxfMtext *
04124 dxf_mtext_set_drawing_direction
04125 (
04126         DxfMtext *mtext,
04128         int drawing_direction
04130 )
04131 {
04132 #if DEBUG
04133         DXF_DEBUG_BEGIN
04134 #endif
04135         /* Do some basic checks. */
04136         if (mtext == NULL)
04137         {
04138                 fprintf (stderr,
04139                   (_("Error in %s () a NULL pointer was passed.\n")),
04140                   __FUNCTION__);
04141                 return (NULL);
04142         }
04143         if (drawing_direction < 0)
04144         {
04145                 fprintf (stderr,
04146                   (_("Warning in %s () a negative value was passed.\n")),
04147                   __FUNCTION__);
04148         }
04149         if (drawing_direction > 5)
04150         {
04151                 fprintf (stderr,
04152                   (_("Warning in %s () an out of range value was passed.\n")),
04153                   __FUNCTION__);
04154         }
04155         mtext->drawing_direction = drawing_direction;
04156 #if DEBUG
04157         DXF_DEBUG_END
04158 #endif
04159         return (mtext);
04160 }
04161 
04162 
04168 int
04169 dxf_mtext_get_spacing_style
04170 (
04171         DxfMtext *mtext
04173 )
04174 {
04175 #if DEBUG
04176         DXF_DEBUG_BEGIN
04177 #endif
04178         /* Do some basic checks. */
04179         if (mtext == NULL)
04180         {
04181                 fprintf (stderr,
04182                   (_("Error in %s () a NULL pointer was passed.\n")),
04183                   __FUNCTION__);
04184                 return (EXIT_FAILURE);
04185         }
04186         if (mtext->spacing_style < 0)
04187         {
04188                 fprintf (stderr,
04189                   (_("Warning in %s () a negative value was found.\n")),
04190                   __FUNCTION__);
04191         }
04192         if (mtext->spacing_style > 2)
04193         {
04194                 fprintf (stderr,
04195                   (_("Warning in %s () an out of range value was found.\n")),
04196                   __FUNCTION__);
04197         }
04198 #if DEBUG
04199         DXF_DEBUG_END
04200 #endif
04201         return (mtext->spacing_style);
04202 }
04203 
04204 
04208 DxfMtext *
04209 dxf_mtext_set_spacing_style
04210 (
04211         DxfMtext *mtext,
04213         int spacing_style
04215 )
04216 {
04217 #if DEBUG
04218         DXF_DEBUG_BEGIN
04219 #endif
04220         /* Do some basic checks. */
04221         if (mtext == NULL)
04222         {
04223                 fprintf (stderr,
04224                   (_("Error in %s () a NULL pointer was passed.\n")),
04225                   __FUNCTION__);
04226                 return (NULL);
04227         }
04228         if (spacing_style < 0)
04229         {
04230                 fprintf (stderr,
04231                   (_("Warning in %s () a negative value was passed.\n")),
04232                   __FUNCTION__);
04233         }
04234         if (spacing_style > 2)
04235         {
04236                 fprintf (stderr,
04237                   (_("Warning in %s () an out of range value was passed.\n")),
04238                   __FUNCTION__);
04239         }
04240         mtext->spacing_style = spacing_style;
04241 #if DEBUG
04242         DXF_DEBUG_END
04243 #endif
04244         return (mtext);
04245 }
04246 
04247 
04253 int
04254 dxf_mtext_get_column_type
04255 (
04256         DxfMtext *mtext
04258 )
04259 {
04260 #if DEBUG
04261         DXF_DEBUG_BEGIN
04262 #endif
04263         /* Do some basic checks. */
04264         if (mtext == NULL)
04265         {
04266                 fprintf (stderr,
04267                   (_("Error in %s () a NULL pointer was passed.\n")),
04268                   __FUNCTION__);
04269                 return (EXIT_FAILURE);
04270         }
04271         if (mtext->column_type < 0)
04272         {
04273                 fprintf (stderr,
04274                   (_("Warning in %s () a negative value was found.\n")),
04275                   __FUNCTION__);
04276         }
04277 #if DEBUG
04278         DXF_DEBUG_END
04279 #endif
04280         return (mtext->column_type);
04281 }
04282 
04283 
04287 DxfMtext *
04288 dxf_mtext_set_column_type
04289 (
04290         DxfMtext *mtext,
04292         int column_type
04294 )
04295 {
04296 #if DEBUG
04297         DXF_DEBUG_BEGIN
04298 #endif
04299         /* Do some basic checks. */
04300         if (mtext == NULL)
04301         {
04302                 fprintf (stderr,
04303                   (_("Error in %s () a NULL pointer was passed.\n")),
04304                   __FUNCTION__);
04305                 return (NULL);
04306         }
04307         if (column_type < 0)
04308         {
04309                 fprintf (stderr,
04310                   (_("Warning in %s () a negative value was passed.\n")),
04311                   __FUNCTION__);
04312         }
04313         mtext->column_type = column_type;
04314 #if DEBUG
04315         DXF_DEBUG_END
04316 #endif
04317         return (mtext);
04318 }
04319 
04320 
04326 int
04327 dxf_mtext_get_column_count
04328 (
04329         DxfMtext *mtext
04331 )
04332 {
04333 #if DEBUG
04334         DXF_DEBUG_BEGIN
04335 #endif
04336         /* Do some basic checks. */
04337         if (mtext == NULL)
04338         {
04339                 fprintf (stderr,
04340                   (_("Error in %s () a NULL pointer was passed.\n")),
04341                   __FUNCTION__);
04342                 return (EXIT_FAILURE);
04343         }
04344         if (mtext->column_count < 0)
04345         {
04346                 fprintf (stderr,
04347                   (_("Warning in %s () a negative value was found.\n")),
04348                   __FUNCTION__);
04349         }
04350 #if DEBUG
04351         DXF_DEBUG_END
04352 #endif
04353         return (mtext->column_count);
04354 }
04355 
04356 
04360 DxfMtext *
04361 dxf_mtext_set_column_count
04362 (
04363         DxfMtext *mtext,
04365         int column_count
04367 )
04368 {
04369 #if DEBUG
04370         DXF_DEBUG_BEGIN
04371 #endif
04372         /* Do some basic checks. */
04373         if (mtext == NULL)
04374         {
04375                 fprintf (stderr,
04376                   (_("Error in %s () a NULL pointer was passed.\n")),
04377                   __FUNCTION__);
04378                 return (NULL);
04379         }
04380         if (column_count < 0)
04381         {
04382                 fprintf (stderr,
04383                   (_("Warning in %s () a negative value was passed.\n")),
04384                   __FUNCTION__);
04385         }
04386         mtext->column_count = column_count;
04387 #if DEBUG
04388         DXF_DEBUG_END
04389 #endif
04390         return (mtext);
04391 }
04392 
04393 
04399 int
04400 dxf_mtext_get_column_flow
04401 (
04402         DxfMtext *mtext
04404 )
04405 {
04406 #if DEBUG
04407         DXF_DEBUG_BEGIN
04408 #endif
04409         /* Do some basic checks. */
04410         if (mtext == NULL)
04411         {
04412                 fprintf (stderr,
04413                   (_("Error in %s () a NULL pointer was passed.\n")),
04414                   __FUNCTION__);
04415                 return (EXIT_FAILURE);
04416         }
04417         if (mtext->column_flow < 0)
04418         {
04419                 fprintf (stderr,
04420                   (_("Warning in %s () a negative value was found.\n")),
04421                   __FUNCTION__);
04422         }
04423 #if DEBUG
04424         DXF_DEBUG_END
04425 #endif
04426         return (mtext->column_flow);
04427 }
04428 
04429 
04433 DxfMtext *
04434 dxf_mtext_set_column_flow
04435 (
04436         DxfMtext *mtext,
04438         int column_flow
04440 )
04441 {
04442 #if DEBUG
04443         DXF_DEBUG_BEGIN
04444 #endif
04445         /* Do some basic checks. */
04446         if (mtext == NULL)
04447         {
04448                 fprintf (stderr,
04449                   (_("Error in %s () a NULL pointer was passed.\n")),
04450                   __FUNCTION__);
04451                 return (NULL);
04452         }
04453         if (column_flow < 0)
04454         {
04455                 fprintf (stderr,
04456                   (_("Warning in %s () a negative value was passed.\n")),
04457                   __FUNCTION__);
04458         }
04459         mtext->column_flow = column_flow;
04460 #if DEBUG
04461         DXF_DEBUG_END
04462 #endif
04463         return (mtext);
04464 }
04465 
04466 
04472 int
04473 dxf_mtext_get_column_autoheight
04474 (
04475         DxfMtext *mtext
04477 )
04478 {
04479 #if DEBUG
04480         DXF_DEBUG_BEGIN
04481 #endif
04482         /* Do some basic checks. */
04483         if (mtext == NULL)
04484         {
04485                 fprintf (stderr,
04486                   (_("Error in %s () a NULL pointer was passed.\n")),
04487                   __FUNCTION__);
04488                 return (EXIT_FAILURE);
04489         }
04490         if (mtext->column_autoheight < 0)
04491         {
04492                 fprintf (stderr,
04493                   (_("Warning in %s () a negative value was found.\n")),
04494                   __FUNCTION__);
04495         }
04496 #if DEBUG
04497         DXF_DEBUG_END
04498 #endif
04499         return (mtext->column_autoheight);
04500 }
04501 
04502 
04506 DxfMtext *
04507 dxf_mtext_set_column_autoheight
04508 (
04509         DxfMtext *mtext,
04511         int column_autoheight
04513 )
04514 {
04515 #if DEBUG
04516         DXF_DEBUG_BEGIN
04517 #endif
04518         /* Do some basic checks. */
04519         if (mtext == NULL)
04520         {
04521                 fprintf (stderr,
04522                   (_("Error in %s () a NULL pointer was passed.\n")),
04523                   __FUNCTION__);
04524                 return (NULL);
04525         }
04526         if (column_autoheight < 0)
04527         {
04528                 fprintf (stderr,
04529                   (_("Warning in %s () a negative value was passed.\n")),
04530                   __FUNCTION__);
04531         }
04532         mtext->column_autoheight = column_autoheight;
04533 #if DEBUG
04534         DXF_DEBUG_END
04535 #endif
04536         return (mtext);
04537 }
04538 
04539 
04545 int
04546 dxf_mtext_get_background_fill
04547 (
04548         DxfMtext *mtext
04550 )
04551 {
04552 #if DEBUG
04553         DXF_DEBUG_BEGIN
04554 #endif
04555         /* Do some basic checks. */
04556         if (mtext == NULL)
04557         {
04558                 fprintf (stderr,
04559                   (_("Error in %s () a NULL pointer was passed.\n")),
04560                   __FUNCTION__);
04561                 return (EXIT_FAILURE);
04562         }
04563         if (mtext->background_fill < 0)
04564         {
04565                 fprintf (stderr,
04566                   (_("Warning in %s () a negative value was found.\n")),
04567                   __FUNCTION__);
04568         }
04569         if (mtext->background_fill > 2)
04570         {
04571                 fprintf (stderr,
04572                   (_("Warning in %s () an out of range value was found.\n")),
04573                   __FUNCTION__);
04574         }
04575 #if DEBUG
04576         DXF_DEBUG_END
04577 #endif
04578         return (mtext->background_fill);
04579 }
04580 
04581 
04585 DxfMtext *
04586 dxf_mtext_set_background_fill
04587 (
04588         DxfMtext *mtext,
04590         int background_fill
04592 )
04593 {
04594 #if DEBUG
04595         DXF_DEBUG_BEGIN
04596 #endif
04597         /* Do some basic checks. */
04598         if (mtext == NULL)
04599         {
04600                 fprintf (stderr,
04601                   (_("Error in %s () a NULL pointer was passed.\n")),
04602                   __FUNCTION__);
04603                 return (NULL);
04604         }
04605         if (background_fill < 0)
04606         {
04607                 fprintf (stderr,
04608                   (_("Warning in %s () a negative value was passed.\n")),
04609                   __FUNCTION__);
04610         }
04611         if (background_fill > 2)
04612         {
04613                 fprintf (stderr,
04614                   (_("Warning in %s () an out of range value was passed.\n")),
04615                   __FUNCTION__);
04616         }
04617         mtext->background_fill = background_fill;
04618 #if DEBUG
04619         DXF_DEBUG_END
04620 #endif
04621         return (mtext);
04622 }
04623 
04624 
04631 double
04632 dxf_mtext_get_extr_x0
04633 (
04634         DxfMtext *mtext
04636 )
04637 {
04638 #ifdef DEBUG
04639         DXF_DEBUG_BEGIN
04640 #endif
04641 
04642         /* Do some basic checks. */
04643         if (mtext == NULL)
04644         {
04645                 fprintf (stderr,
04646                   (_("Error in %s () a NULL pointer was passed.\n")),
04647                   __FUNCTION__);
04648                 return (EXIT_FAILURE);
04649         }
04650 #if DEBUG
04651         DXF_DEBUG_END
04652 #endif
04653         return (mtext->extr_x0);
04654 }
04655 
04656 
04664 DxfMtext *
04665 dxf_mtext_set_extr_x0
04666 (
04667         DxfMtext *mtext,
04669         double extr_x0
04672 )
04673 {
04674 #ifdef DEBUG
04675         DXF_DEBUG_BEGIN
04676 #endif
04677         /* Do some basic checks. */
04678         if (mtext == NULL)
04679         {
04680                 fprintf (stderr,
04681                   (_("Error in %s () a NULL pointer was passed.\n")),
04682                   __FUNCTION__);
04683                 return (NULL);
04684         }
04685         mtext->extr_x0 = extr_x0;
04686 #if DEBUG
04687         DXF_DEBUG_END
04688 #endif
04689         return (mtext);
04690 }
04691 
04692 
04699 double
04700 dxf_mtext_get_extr_y0
04701 (
04702         DxfMtext *mtext
04704 )
04705 {
04706 #ifdef DEBUG
04707         DXF_DEBUG_BEGIN
04708 #endif
04709 
04710         /* Do some basic checks. */
04711         if (mtext == NULL)
04712         {
04713                 fprintf (stderr,
04714                   (_("Error in %s () a NULL pointer was passed.\n")),
04715                   __FUNCTION__);
04716                 return (EXIT_FAILURE);
04717         }
04718 #if DEBUG
04719         DXF_DEBUG_END
04720 #endif
04721         return (mtext->extr_y0);
04722 }
04723 
04724 
04732 DxfMtext *
04733 dxf_mtext_set_extr_y0
04734 (
04735         DxfMtext *mtext,
04737         double extr_y0
04740 )
04741 {
04742 #ifdef DEBUG
04743         DXF_DEBUG_BEGIN
04744 #endif
04745         /* Do some basic checks. */
04746         if (mtext == NULL)
04747         {
04748                 fprintf (stderr,
04749                   (_("Error in %s () a NULL pointer was passed.\n")),
04750                   __FUNCTION__);
04751                 return (NULL);
04752         }
04753         mtext->extr_y0 = extr_y0;
04754 #if DEBUG
04755         DXF_DEBUG_END
04756 #endif
04757         return (mtext);
04758 }
04759 
04760 
04767 double
04768 dxf_mtext_get_extr_z0
04769 (
04770         DxfMtext *mtext
04772 )
04773 {
04774 #ifdef DEBUG
04775         DXF_DEBUG_BEGIN
04776 #endif
04777 
04778         /* Do some basic checks. */
04779         if (mtext == NULL)
04780         {
04781                 fprintf (stderr,
04782                   (_("Error in %s () a NULL pointer was passed.\n")),
04783                   __FUNCTION__);
04784                 return (EXIT_FAILURE);
04785         }
04786 #if DEBUG
04787         DXF_DEBUG_END
04788 #endif
04789         return (mtext->extr_z0);
04790 }
04791 
04792 
04800 DxfMtext *
04801 dxf_mtext_set_extr_z0
04802 (
04803         DxfMtext *mtext,
04805         double extr_z0
04808 )
04809 {
04810 #ifdef DEBUG
04811         DXF_DEBUG_BEGIN
04812 #endif
04813         /* Do some basic checks. */
04814         if (mtext == NULL)
04815         {
04816                 fprintf (stderr,
04817                   (_("Error in %s () a NULL pointer was passed.\n")),
04818                   __FUNCTION__);
04819                 return (NULL);
04820         }
04821         mtext->extr_z0 = extr_z0;
04822 #if DEBUG
04823         DXF_DEBUG_END
04824 #endif
04825         return (mtext);
04826 }
04827 
04828 
04833 DxfMtext *
04834 dxf_mtext_set_extrusion_vector_from_point
04835 (
04836         DxfMtext *mtext,
04838         DxfPoint *point
04840 )
04841 {
04842 #if DEBUG
04843         DXF_DEBUG_BEGIN
04844 #endif
04845         /* Do some basic checks. */
04846         if (mtext == NULL)
04847         {
04848                 fprintf (stderr,
04849                   (_("Error in %s () a NULL pointer was passed.\n")),
04850                   __FUNCTION__);
04851                 return (NULL);
04852         }
04853         if (point == NULL)
04854         {
04855                 fprintf (stderr,
04856                   (_("Error in %s () a NULL pointer was passed.\n")),
04857                   __FUNCTION__);
04858                 return (NULL);
04859         }
04860         mtext->extr_x0 = (double) point->x0;
04861         mtext->extr_y0 = (double) point->y0;
04862         mtext->extr_z0 = (double) point->z0;
04863 #if DEBUG
04864         DXF_DEBUG_END
04865 #endif
04866         return (mtext);
04867 }
04868 
04869 
04873 DxfMtext *
04874 dxf_mtext_set_extrusion_vector
04875 (
04876         DxfMtext *mtext,
04878         double extr_x0,
04880         double extr_y0,
04882         double extr_z0
04884 )
04885 {
04886 #if DEBUG
04887         DXF_DEBUG_BEGIN
04888 #endif
04889         /* Do some basic checks. */
04890         if (mtext == NULL)
04891         {
04892                 fprintf (stderr,
04893                   (_("Error in %s () a NULL pointer was passed.\n")),
04894                   __FUNCTION__);
04895                 return (NULL);
04896         }
04897         mtext->extr_x0 = extr_x0;
04898         mtext->extr_y0 = extr_y0;
04899         mtext->extr_z0 = extr_z0;
04900 #if DEBUG
04901         DXF_DEBUG_END
04902 #endif
04903         return (mtext);
04904 }
04905 
04906 
04912 int32_t
04913 dxf_mtext_get_background_color_rgb
04914 (
04915         DxfMtext *mtext
04917 )
04918 {
04919 #if DEBUG
04920         DXF_DEBUG_BEGIN
04921 #endif
04922         /* Do some basic checks. */
04923         if (mtext == NULL)
04924         {
04925                 fprintf (stderr,
04926                   (_("Error in %s () a NULL pointer was passed.\n")),
04927                   __FUNCTION__);
04928                 return (EXIT_FAILURE);
04929         }
04930 #if DEBUG
04931         DXF_DEBUG_END
04932 #endif
04933         return (mtext->background_color_rgb);
04934 }
04935 
04936 
04940 DxfMtext *
04941 dxf_mtext_set_background_color_rgb
04942 (
04943         DxfMtext *mtext,
04945         int32_t background_color_rgb
04947 )
04948 {
04949 #if DEBUG
04950         DXF_DEBUG_BEGIN
04951 #endif
04952         /* Do some basic checks. */
04953         if (mtext == NULL)
04954         {
04955                 fprintf (stderr,
04956                   (_("Error in %s () a NULL pointer was passed.\n")),
04957                   __FUNCTION__);
04958                 return (NULL);
04959         }
04960         mtext->background_color_rgb = background_color_rgb;
04961 #if DEBUG
04962         DXF_DEBUG_END
04963 #endif
04964         return (mtext);
04965 }
04966 
04967 
04974 char *
04975 dxf_mtext_get_background_color_name
04976 (
04977         DxfMtext *mtext
04979 )
04980 {
04981 #if DEBUG
04982         DXF_DEBUG_BEGIN
04983 #endif
04984         /* Do some basic checks. */
04985         if (mtext == NULL)
04986         {
04987                 fprintf (stderr,
04988                   (_("Error in %s () a NULL pointer was passed.\n")),
04989                   __FUNCTION__);
04990                 return (NULL);
04991         }
04992         if (mtext->background_color_name ==  NULL)
04993         {
04994                 fprintf (stderr,
04995                   (_("Error in %s () a NULL pointer was found.\n")),
04996                   __FUNCTION__);
04997                 return (NULL);
04998         }
04999 #if DEBUG
05000         DXF_DEBUG_END
05001 #endif
05002         return (strdup (mtext->background_color_name));
05003 }
05004 
05005 
05012 DxfMtext *
05013 dxf_mtext_set_background_color_name
05014 (
05015         DxfMtext *mtext,
05017         char *background_color_name
05020 )
05021 {
05022 #if DEBUG
05023         DXF_DEBUG_BEGIN
05024 #endif
05025         /* Do some basic checks. */
05026         if (mtext == NULL)
05027         {
05028                 fprintf (stderr,
05029                   (_("Error in %s () a NULL pointer was passed.\n")),
05030                   __FUNCTION__);
05031                 return (NULL);
05032         }
05033         if (background_color_name == NULL)
05034         {
05035                 fprintf (stderr,
05036                   (_("Error in %s () a NULL pointer was passed.\n")),
05037                   __FUNCTION__);
05038                 return (NULL);
05039         }
05040         mtext->background_color_name = strdup (background_color_name);
05041 #if DEBUG
05042         DXF_DEBUG_END
05043 #endif
05044         return (mtext);
05045 }
05046 
05047 
05053 int32_t
05054 dxf_mtext_get_background_transparency
05055 (
05056         DxfMtext *mtext
05058 )
05059 {
05060 #if DEBUG
05061         DXF_DEBUG_BEGIN
05062 #endif
05063         /* Do some basic checks. */
05064         if (mtext == NULL)
05065         {
05066                 fprintf (stderr,
05067                   (_("Error in %s () a NULL pointer was passed.\n")),
05068                   __FUNCTION__);
05069                 return (EXIT_FAILURE);
05070         }
05071 #if DEBUG
05072         DXF_DEBUG_END
05073 #endif
05074         return (mtext->background_transparency);
05075 }
05076 
05077 
05081 DxfMtext *
05082 dxf_mtext_set_background_transparency
05083 (
05084         DxfMtext *mtext,
05086         int32_t background_transparency
05089 )
05090 {
05091 #if DEBUG
05092         DXF_DEBUG_BEGIN
05093 #endif
05094         /* Do some basic checks. */
05095         if (mtext == NULL)
05096         {
05097                 fprintf (stderr,
05098                   (_("Error in %s () a NULL pointer was passed.\n")),
05099                   __FUNCTION__);
05100                 return (NULL);
05101         }
05102         mtext->background_transparency = background_transparency;
05103 #if DEBUG
05104         DXF_DEBUG_END
05105 #endif
05106         return (mtext);
05107 }
05108 
05109 
05118 DxfMtext *
05119 dxf_mtext_get_next
05120 (
05121         DxfMtext *mtext
05123 )
05124 {
05125 #if DEBUG
05126         DXF_DEBUG_BEGIN
05127 #endif
05128         /* Do some basic checks. */
05129         if (mtext == NULL)
05130         {
05131                 fprintf (stderr,
05132                   (_("Error in %s () a NULL pointer was passed.\n")),
05133                   __FUNCTION__);
05134                 return (NULL);
05135         }
05136         if (mtext->next == NULL)
05137         {
05138                 fprintf (stderr,
05139                   (_("Error in %s () a NULL pointer was found.\n")),
05140                   __FUNCTION__);
05141                 return (NULL);
05142         }
05143 #if DEBUG
05144         DXF_DEBUG_END
05145 #endif
05146         return ((DxfMtext *) mtext->next);
05147 }
05148 
05149 
05154 DxfMtext *
05155 dxf_mtext_set_next
05156 (
05157         DxfMtext *mtext,
05159         DxfMtext *next
05161 )
05162 {
05163 #if DEBUG
05164         DXF_DEBUG_BEGIN
05165 #endif
05166         /* Do some basic checks. */
05167         if (mtext == NULL)
05168         {
05169                 fprintf (stderr,
05170                   (_("Error in %s () a NULL pointer was passed.\n")),
05171                   __FUNCTION__);
05172                 return (NULL);
05173         }
05174         if (next == NULL)
05175         {
05176                 fprintf (stderr,
05177                   (_("Error in %s () a NULL pointer was passed.\n")),
05178                   __FUNCTION__);
05179                 return (NULL);
05180         }
05181         mtext->next = (struct DxfMtext *) next;
05182 #if DEBUG
05183         DXF_DEBUG_END
05184 #endif
05185         return (mtext);
05186 }
05187 
05188 
05197 DxfMtext *
05198 dxf_mtext_get_last
05199 (
05200         DxfMtext *mtext
05202 )
05203 {
05204 #if DEBUG
05205         DXF_DEBUG_BEGIN
05206 #endif
05207         /* Do some basic checks. */
05208         if (mtext == NULL)
05209         {
05210                 fprintf (stderr,
05211                   (_("Error in %s () a NULL pointer was passed.\n")),
05212                   __FUNCTION__);
05213                 return (NULL);
05214         }
05215         if (mtext->next == NULL)
05216         {
05217                 fprintf (stderr,
05218                   (_("Warning in %s () a NULL pointer was found.\n")),
05219                   __FUNCTION__);
05220                 return ((DxfMtext *) mtext);
05221         }
05222         DxfMtext *iter = (DxfMtext *) mtext->next;
05223         while (iter->next != NULL)
05224         {
05225                 iter = (DxfMtext *) iter->next;
05226         }
05227 #if DEBUG
05228         DXF_DEBUG_END
05229 #endif
05230         return ((DxfMtext *) iter);
05231 }
05232 
05233 
05234 /* EOF */