home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / som / somk / c / tp / blep.c next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  2.5 KB  |  88 lines

  1.  
  2. /*
  3.  *  This file was generated by the SOM Compiler.
  4.  *  Generated using:
  5.  *     SOM incremental update: 6.34
  6.  */
  7.  
  8. #ifndef lint
  9. static char *sccsid = "%Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992";
  10. #endif
  11.  
  12. /*
  13.  * This class is adapted from the book
  14.  *   Class Construction in C and C++, Object Oriented Fundamentals
  15.  *   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  16.  * Reprinted with permission.
  17.  */
  18.  
  19. #define bulletedList_Class_Source
  20. #if defined(_WIN32)
  21. #include "statcls.h"
  22. #endif
  23. #include "blep.ih"
  24. #include "tpword.h"
  25.  
  26. #define PARAGRAPH_INDENTATION 0
  27. #define LINE_INDENTATION 2
  28. #define BULLET " - "
  29.  
  30. /* ************************************************************ */
  31.  
  32. SOM_Scope long  SOMLINK epGetParagraphIndentation(bulletedList *somSelf)
  33. {
  34.     /* bulletedListData *somThis = bulletedListGetData(somSelf); */
  35.     bulletedListMethodDebug("bulletedList", "epGetParagraphIndentation");
  36.  
  37.     somSelf;                   /* Avoid unreferenced parameter compiler
  38.                     * warning for OS/2 compiler */
  39.     return PARAGRAPH_INDENTATION;
  40.  
  41. }
  42.  
  43. /* ************************************************************ */
  44.  
  45. SOM_Scope long  SOMLINK epGetLineIndentation(bulletedList *somSelf)
  46. {
  47.     /* bulletedListData *somThis = bulletedListGetData(somSelf); */
  48.     envProcessor *lastEnv = _epGetPreviousEnv(somSelf);
  49.     bulletedListMethodDebug("bulletedList", "epGetLineIndentation");
  50.  
  51.     if (lastEnv)
  52.     return _epGetLineIndentation(lastEnv) + LINE_INDENTATION;
  53.     else
  54.     return LINE_INDENTATION;
  55. }
  56.  
  57. /* ************************************************************ */
  58. SOM_Scope void SOMLINK epInitializeEnvironment(bulletedList * somSelf)
  59. {
  60.     /* bulletedListData *somThis = bulletedListGetData(somSelf); */
  61.     textLine *thisLine;
  62.     TPWord *bullet;
  63.     bulletedListMethodDebug("bulletedList", "epInitializeEnvironment");
  64.  
  65.     parent_epInitializeEnvironment(somSelf);
  66.  
  67.     bullet = TPWordNew();
  68.     _wordInit1(bullet, BULLET);
  69.     thisLine = _tpGetLine(somSelf);
  70.     _llAddTail(thisLine, (baseType *) bullet);
  71. }
  72.  
  73. /* ************************************************************ */
  74. SOM_Scope void SOMLINK tpProcessNewParagraph(bulletedList * somSelf)
  75. {
  76. /* bulletedListData *somThis = bulletedListGetData(somSelf); */
  77.     textLine *thisLine;
  78.     TPWord *bullet;
  79.     bulletedListMethodDebug("bulletedList", "tpProcessNewParagraph");
  80.  
  81.     parent_tpProcessNewParagraph(somSelf);
  82.  
  83.     bullet = TPWordNew();
  84.     _wordInit1(bullet, BULLET);
  85.     thisLine = _tpGetLine(somSelf);
  86.     _llAddTail(thisLine, (baseType *) bullet);
  87. }
  88.