-
Notifications
You must be signed in to change notification settings - Fork 0
/
FontHandler.cp
1195 lines (855 loc) · 30.8 KB
/
FontHandler.cp
1
/******************************************************************************//* *//* FontHandler.cp */ /* *//* *//* *//* *//******************************************************************************//* *//* (c) 1995 by Magnet Interactive Studios, inc. All rights reserved. *//* *//******************************************************************************//* *//* Change History: *//* */ /* <1> 1/25/95 Glenn Ortner *//* *//* Started today. *//* *//******************************************************************************//************************** ANSI AND 3DO INCLUDES ***************************/#include <stdio.h>#include <stdlib.h>#include <graphics.h>#include <mem.h>#include <strings.h>#include <TextLib.h>#include <UMemory.h>#include <BlockFile.h>#include <CelUtils.h>/**************************** MAGNET INCLUDES *******************************/#include "FontHandler.h"/************************** SPECIAL 3DO INCLUDE *****************************//* The 3DO include, "CPlusSwiHack.h", is included last since this *//* is required by 3DO to compile under the C++ pseudo compiler. */#include <CPlusSwiHack.h>/******************************************************************************//* C_FontHandler Class methods start below: *//******************************************************************************//********************* C_FontHandler Class - Constructor ********************//* *//* *//* *//******************************************************************************/C_FontHandler::C_FontHandler(){ /* Allocate memory for the Font */ gFontDescPtr = new FontDescriptor; /* Allocate memory for the Text Cel */ gTextCelPtr1 = new TextCel; /* Set the Font structure members to 0 */ memset(gFontDescPtr, 0, sizeof(FontDescriptor)); /* Set the Text cel structure members to 0 */ memset(gTextCelPtr1, 0, sizeof(TextCel)); /* Initialize the number of text cels declared */ numTextCels = 0;}/********************* C_FontHandler Class - Destructor *********************//* *//* *//* *//******************************************************************************/C_FontHandler::~C_FontHandler(){ /* Free the memory required by the Font structure */ delete gFontDescPtr; /* Free the memory required by Text cel #1 */ delete gTextCelPtr1; /* Free the memory required by Text cel #2, if required */ if (gTextCelPtr2) { delete gTextCelPtr2; } /* Free the memory required by Text cel #3, if required */ if (gTextCelPtr3) { delete gTextCelPtr3; } /* Free the memory required by Text cel #4, if required */ if (gTextCelPtr4) { delete gTextCelPtr4; } /* Free the memory required by Text cel #5, if required */ if (gTextCelPtr5) { delete gTextCelPtr5; } /* Free the memory required by Text cel #6, if required */ if (gTextCelPtr6) { delete gTextCelPtr6; } /* Free the memory required by Text cel #7, if required */ if (gTextCelPtr7) { delete gTextCelPtr7; } /* Free the memory required by Text cel #8, if required */ if (gTextCelPtr8) { delete gTextCelPtr8; } /* Free the memory required by Text cel #9, if required */ if (gTextCelPtr9) { delete gTextCelPtr9; } /* Free the memory required by Text cel #10, if required */ if (gTextCelPtr10) { delete gTextCelPtr10; }}/***************** C_FontHandler Class - CreateCelFromFont() ****************//* *//* *//* *//******************************************************************************/int C_FontHandler::CreateCelFromFont(char *fontFileName){ /* If we have not created a text cel yet, then load the desired font */ if (numTextCels == 0) { /* Load the 3DO font into the Font Descriptor structure */ if ((gFontDescPtr = LoadFont(fontFileName, MEMTYPE_ANY)) == (FontDescriptor *)NULL) { printf("ERROR - LoadFont(), in CreateCelFromFont(), failed!\n"); return(-1); } /* Create a Text cel from the desired font */ if ((gTextCelPtr1 = CreateTextCel(gFontDescPtr, TC_FORMAT_LEFT_JUSTIFY, 0, 0)) == (TextCel *)NULL) { printf("ERROR - CreateTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(1); } /* The user wishes to create a new text cel */ switch (numTextCels) { case 1: /* Allocate memory for the Text Cel */ gTextCelPtr2 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr2, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr2 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr2 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(2); case 2: /* Allocate memory for the Text Cel */ gTextCelPtr3 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr3, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr3 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr3 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(3); case 3: /* Allocate memory for the Text Cel */ gTextCelPtr4 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr4, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr4 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr4 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(4); case 4: /* Allocate memory for the Text Cel */ gTextCelPtr5 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr5, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr5 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr5 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(5); case 5: /* Allocate memory for the Text Cel */ gTextCelPtr6 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr6, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr6 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr6 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(6); case 6: /* Allocate memory for the Text Cel */ gTextCelPtr7 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr7, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr7 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr7 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(7); case 7: /* Allocate memory for the Text Cel */ gTextCelPtr8 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr8, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr8 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr8 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(8); case 8: /* Allocate memory for the Text Cel */ gTextCelPtr9 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr9, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr9 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr9 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(9); case 9: /* Allocate memory for the Text Cel */ gTextCelPtr10 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr10, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr10 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr10 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(10); case 10: printf("ERROR - CreateCelFromFont() failed!\n"); printf("Sorry, only 10 text cels concurrently are supported\n"); return(-1); } }/***************** C_FontHandler Class - CreateCelFromFont() ****************//* *//* *//* *//******************************************************************************/int C_FontHandler::CreateCelFromFont(void){ switch (numTextCels) { case 1: /* Allocate memory for the Text Cel */ gTextCelPtr2 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr2, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr2 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr2 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(2); case 2: /* Allocate memory for the Text Cel */ gTextCelPtr3 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr3, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr3 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr3 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(3); case 3: /* Allocate memory for the Text Cel */ gTextCelPtr4 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr4, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr4 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr4 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(4); case 4: /* Allocate memory for the Text Cel */ gTextCelPtr5 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr5, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr5 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr5 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(5); case 5: /* Allocate memory for the Text Cel */ gTextCelPtr6 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr6, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr6 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr6 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(6); case 6: /* Allocate memory for the Text Cel */ gTextCelPtr7 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr7, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr7 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr7 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(7); case 7: /* Allocate memory for the Text Cel */ gTextCelPtr8 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr8, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr8 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr8 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(8); case 8: /* Allocate memory for the Text Cel */ gTextCelPtr9 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr9, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr9 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr9 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(9); case 9: /* Allocate memory for the Text Cel */ gTextCelPtr10 = new TextCel; /* Set the Text cel structure members to 0 */ memset(gTextCelPtr10, 0, sizeof(TextCel)); /* Create a new text cel from the existing one */ gTextCelPtr10 = CloneTextCel(gTextCelPtr1, FALSE); if (gTextCelPtr10 == (TextCel *)NULL) { printf("ERROR - CloneTextCel(), in CreateCelFromFont(), failed!\n"); return(-1); } numTextCels++; return(10); case 10: printf("ERROR - CreateCelFromFont() failed!\n"); printf("Sorry, only 10 text cels concurrently are supported\n"); return(-1); default: printf("ERROR - CreateCelFromFont() failed!\n"); printf("A font may not have been loaded yet\n"); return(-1); } }/******************* C_FontHandler Class - AddColorToText() *****************//* *//* *//* *//******************************************************************************/void C_FontHandler::AddColorToText(uint32 redBgColor, uint32 greenBgColor, uint32 blueBgColor, uint32 redFgColor, uint32 greenFgColor, uint32 blueFgColor, int textCelID){ uint32 fontRGBbgColor; /* RGB value for background text color */ uint32 fontRGBfgColor; /* RGB value for forground text color */ /* Call macro to convert RGB to a single RGB555 value for background */ fontRGBbgColor = MakeRGB15(redBgColor, greenBgColor, blueBgColor); /* Call macro to convert RGB to a single RGB555 value for foreground */ fontRGBfgColor = MakeRGB15(redFgColor, greenFgColor, blueFgColor); switch (textCelID) { case 1: /* Set the color for the text */ SetTextCelColor(gTextCelPtr1, fontRGBbgColor, fontRGBfgColor); break; case 2: /* Set the color for the text */ SetTextCelColor(gTextCelPtr2, fontRGBbgColor, fontRGBfgColor); break; case 3: /* Set the color for the text */ SetTextCelColor(gTextCelPtr3, fontRGBbgColor, fontRGBfgColor); break; case 4: /* Set the color for the text */ SetTextCelColor(gTextCelPtr4, fontRGBbgColor, fontRGBfgColor); break; case 5: /* Set the color for the text */ SetTextCelColor(gTextCelPtr5, fontRGBbgColor, fontRGBfgColor); break; case 6: /* Set the color for the text */ SetTextCelColor(gTextCelPtr6, fontRGBbgColor, fontRGBfgColor); break; case 7: /* Set the color for the text */ SetTextCelColor(gTextCelPtr7, fontRGBbgColor, fontRGBfgColor); break; case 8: /* Set the color for the text */ SetTextCelColor(gTextCelPtr8, fontRGBbgColor, fontRGBfgColor); break; case 9: /* Set the color for the text */ SetTextCelColor(gTextCelPtr9, fontRGBbgColor, fontRGBfgColor); break; case 10: /* Set the color for the text */ SetTextCelColor(gTextCelPtr10, fontRGBbgColor, fontRGBfgColor); break; }} /******************* C_FontHandler Class - PlaceTextInCel() *****************//* *//* *//* *//******************************************************************************/ CCB* C_FontHandler::PlaceTextInCel(char *textContent, uint32 redBgColor, uint32 greenBgColor, uint32 blueBgColor, uint32 redFgColor, uint32 greenFgColor, uint32 blueFgColor, unsigned textCelID){ int32 textStatus; /* Used for error checking on UpdateTextInCel() */ /* Verify that a string larger than 80 characters has not been passed */ if ((strlen(textContent)) > 80) { printf("ERROR - A string greater than 80 characters was passed!\n"); return((CCB *) NULL); } switch (textCelID) { case 1: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr1, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr1->tc_CCB); case 2: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr2, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr2->tc_CCB); case 3: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr3, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr3->tc_CCB); case 4: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr4, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr4->tc_CCB); case 5: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr5, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr5->tc_CCB); case 6: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr6, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr6->tc_CCB); case 7: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr7, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr7->tc_CCB); case 8: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr8, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr8->tc_CCB); case 9: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr9, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr9->tc_CCB); case 10: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr10, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } /* Set the color of the text */ AddColorToText(redBgColor, greenBgColor, blueBgColor, redFgColor, greenFgColor, blueFgColor, textCelID); return(gTextCelPtr10->tc_CCB); default: printf("An invalid Cel ID was passed to \n"); }}/******************* C_FontHandler Class - PlaceTextInCel() *****************//* *//* *//* *//******************************************************************************/ CCB* C_FontHandler::PlaceTextInCel(char *textContent, unsigned textCelID){ int32 textStatus; /* Used for error checking on UpdateTextInCel() */ /* Verify that a string larger than 80 characters has not been passed */ if ((strlen(textContent)) > 80) { printf("ERROR - A string greater than 80 characters was passed!\n"); return((CCB *) NULL); } switch (textCelID) { case 1: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr1, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr1->tc_CCB); case 2: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr2, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr2->tc_CCB); case 3: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr3, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr3->tc_CCB); case 4: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr4, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr4->tc_CCB); case 5: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr5, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr5->tc_CCB); case 6: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr6, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr6->tc_CCB); case 7: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr7, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr7->tc_CCB); case 8: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr8, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr8->tc_CCB); case 9: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr9, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr9->tc_CCB); case 10: /* Place the text data into the cel */ textStatus = UpdateTextInCel(gTextCelPtr10, TRUE, textContent); /* Check to see if we had problems placing the text in the cel */ if (textStatus > 0) { printf("Text has been clipped!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } else if (textStatus < 0) { printf("Larger data buffer could not be allocated for autosized cel!\n"); printf("See UpdateTextInCel(), in PlaceTextInCel().\n"); } return(gTextCelPtr10->tc_CCB); default: printf("An invalid Cel ID was passed to \n"); }}/*********************************** EOF ************************************/