Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7753 in orxonox.OLD for trunk


Ignore:
Timestamp:
May 21, 2006, 5:24:14 PM (19 years ago)
Author:
bensch
Message:

trunk: removed GTK, and also extended the Text Class.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.h.in

    r7729 r7753  
    3030/* Define to 1 if you have the <GL/gl.h> header file. */
    3131#undef HAVE_GL_GL_H
    32 
    33 /* if we have GTK2 */
    34 #undef HAVE_GTK2
    3532
    3633/* Define to 1 if you have the <inttypes.h> header file. */
  • trunk/configure.ac

    r7729 r7753  
    235235  LDFLAGS="${LDFLAGS} -L$PREFIX/${ARCH}/lib -Wl,-rpath -Wl,${PREFIX}/${ARCH}/lib"
    236236
    237   ## QT
     237## QT on Tardis
    238238  QT_PREFIX=/usr/pack/qt-4.1.1-mo/${ARCH}
    239239#  CPPFLAGS="${CPPFLAGS} -I${PREFIX_QT}/include"
    240240#  LDFLAGS="${LDFLAGS} -L${QT_PREFIX}/lib -Wl,-rpath -Wl,${QT_PREFIX}/${ARCH}/lib"
    241241
    242 
    243 
    244   ## GTK
    245   GTKPREFIX=/usr/pack/gtk-2.8.3-mo
    246   GTKPATH=${GTKPREFIX}/${ARCH}/bin
    247   CPPFLAGS="${CPPFLAGS} -I${GTKPREFIX}/include"
    248   LDFLAGS="${LDFLAGS} -L${GTKPREFIX}/${ARCH}/lib -Wl,-rpath -Wl,${GTKPREFIX}/${ARCH}/lib"
    249   echo "yes"
    250242fi
    251243if test x$def_tardis = xno; then
     
    578570fi
    579571
    580 
    581 #-----#
    582 # GTK #
    583 #-----#
    584 if test x$def_gtk = xyes; then
    585 #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
    586         AC_MSG_CHECKING([for gtk2.0])
    587         if `$PKG_CONFIG --exists gtk+-2.0`; then
    588                 echo "yes"
    589                 have_gtk2=yes
    590                 GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
    591                 GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
    592                 AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
    593                 if test $DEBUG -ge 3; then
    594                  echo "cflags: $GTK2_CFLAGS"
    595                  echo "libs: $GTK2_LIBS"
    596                 fi
    597         else
    598                 echo "no"
    599         fi
    600 
    601 fi
    602 AC_SUBST(GTK2_LIBS)
    603 AC_SUBST(GTK2_CFLAGS)
    604 AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
    605 
    606 
    607572#---------#
    608573# libcURL #
     
    627592     echo "efence was requested, but is not installed!! going on"
    628593   fi
    629 
    630594fi
    631595
  • trunk/src/lib/graphics/text_engine/text.cc

    r7742 r7753  
    3939  this->color = TEXT_DEFAULT_COLOR;
    4040
     41  this->setAlignment(TEXT_DEFAULT_ALIGNMENT);
     42
    4143  this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
    42 
    43   this->setAlignment(TEXT_DEFAULT_ALIGNMENT);
    44 }
     44}
     45
     46Text::Text(const Text& text)
     47{
     48  this->setClassID(CL_TEXT, "Text");
     49  this->font = NULL;
     50
     51  *this = text;
     52}
     53
    4554
    4655/**
     
    5362}
    5463
     64/**
     65 * @brief compare the Text with another Text.
     66 * @param text the Text to compare.
     67 * @returns true if all the properties Match.
     68 */
     69bool Text::operator==(const Text& text) const
     70{
     71  return (this->text == text.text &&
     72          this->size == text.size &&
     73          this->font == text.font &&
     74          this->color == text.color &&
     75          this->blending == text.blending);
     76}
     77
     78/**
     79 * @brief compare this Text's internal String with the text.
     80 * @param text the Comparator Text.
     81 * @returns true on a match.
     82 */
     83bool Text::operator==(const std::string& text) const
     84{
     85  return (this->text == text);
     86}
     87
     88/**
     89 * @brief Copies the properties of one text onto the other one.
     90 * @param text: the Text to apply to this one.
     91 * @returns This-reference.
     92 */
     93Text& Text::operator=(const Text& text)
     94{
     95  this->size = text.size;
     96  this->blending = text.blending;
     97  this->color = text.color;
     98  this->setAlignment(text.getAlignment());
     99  if (this->font != NULL)
     100    ResourceManager::getInstance()->unload(this->font);
     101
     102  this->font = (Font*)ResourceManager::getInstance()->copy( text.font ); //!< HACK
     103
     104  this->text = text.text;
     105  return *this;
     106}
     107
     108/**
     109 * @brief Sets a new Text to the font
     110 * @param text the new text to set
     111 */
     112void Text::setText(const std::string& text)
     113{
     114  this->text = text;
     115  this->setupTextWidth();
     116}
     117
     118/**
     119 * @brief append some text to the already existing Text.
     120 * @param appendText The text to append to this Text.
     121 */
     122void Text::append(const std::string& appendText)
     123{
     124  this->text += appendText;
     125  this->setupTextWidth();
     126}
     127
     128/**
     129 * @brief append some text to the already existing Text.
     130 * @param appendText The text to append to this Text.
     131 */
     132const std::string& Text::operator <<(const std::string& appendText)
     133{
     134  this->append(appendText);
     135  return this->text;
     136}
    55137
    56138/**
     
    87169
    88170/**
    89  * @brief Sets a new Text to the font
    90  * @param text the new text to set
    91  */
    92 void Text::setText(const std::string& text)
    93 {
    94   this->text = text;
    95 
    96   this->setupTextWidth();
    97 }
    98 
    99 
    100 /**
    101171 * @brief sets the Size of the Font
    102172 * @param size :the size of the Text
  • trunk/src/lib/graphics/text_engine/text.h

    r7453 r7753  
    2828  public:
    2929    Text(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE);
     30    Text(const Text& text);
    3031    virtual ~Text();
     32    bool operator==(const Text& text) const;
     33    bool operator==(const std::string& text) const;
     34    Text& operator=(const Text& text);
    3135
    32     // SETUP
     36    /// Final Interfacing.
     37    void setText(const std::string& text);
     38    void append(const std::string& appendText);
     39    const std::string& operator<<(const std::string& appendText);
     40
     41    /// SETUP
    3342    void setFont(const std::string& fontFile, unsigned int renderSize);
    34     void setText(const std::string& text);
    3543    /** @param blending the blending intensity to set (between 0.0 and 1.0) */
    3644    inline void setBlending(float blending) { this->blending = blending; };
     
    3947    void setSize(float size);
    4048
     49
    4150    /// RETRIEVE
     51    /** @returns the String this Text displays */
     52    inline const std::string& getText() const { return this->text; };
     53
    4254    /** @returns the pointer to the stored Font (not changeable) */
    4355    inline const Font* const getFont() const { return this->font; };
    44     /** @returns the String this Text displays */
    45     inline const std::string& getText() const { return this->text; };
    4656    /** @returns the Blending Value [0 invisible 1.0 full visible */
    4757    inline float getBlending() const { return this->blending; };
     
    5767  protected:
    5868    virtual void setupTextWidth();
     69  private:
     70    void init();
    5971
    6072  private:
  • trunk/src/lib/shell/shell.h

    r7750 r7753  
    2525class Material;
    2626
     27//! Namespace of the Shell of ORXONOX.
    2728namespace OrxShell
    2829{
     
    3738   * Each Class can check itself in to the Shell, and listen for commands.
    3839   *
    39    * more info: @see ShellCommand
     40   * more info:
     41   * @see ShellCommand
    4042   * @see shell_command.h
    4143   * @see shell_buffer.h
    4244   * @see shell_input.h
    43    *
    44    * !! note in order to keep shellbuffer to a minimal (it is included with
    45    * !! debug.h) Display of it inside the Shell is located here !!
     45   * @see shell_completion.h
    4646   */
    4747  class Shell : public Element2D, public EventListener
Note: See TracChangeset for help on using the changeset viewer.