Skip to content

Commit

Permalink
fix all files that used tabs, use spaces instead
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Sep 12, 2024
1 parent 05008b2 commit 36482f7
Show file tree
Hide file tree
Showing 20 changed files with 448 additions and 449 deletions.
16 changes: 8 additions & 8 deletions include/guisan/sdl/sdlgraphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ namespace gcn
* Constructor.
*/
SDLGraphics();
/**
* Destructor.
*/
~SDLGraphics();

/**
* Destructor.
*/
~SDLGraphics();

/**
* Sets the target SDL_Surface to draw to. The target can be any
* SDL_Surface. This function also pushes a clip areas corresponding to
Expand Down Expand Up @@ -126,8 +126,8 @@ namespace gcn
virtual void popClipArea();

virtual void drawImage(const Image* image, int srcX, int srcY,
int dstX, int dstY, int width,
int height);
int dstX, int dstY, int width,
int height);

virtual void drawPoint(int x, int y);

Expand Down
10 changes: 5 additions & 5 deletions include/guisan/sdl/sdlimage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ namespace gcn
* @return the SDL surface for the image.
*/
virtual SDL_Surface* getSurface() const;
/**
* Gets the SDL texture for the image.

/**
* Gets the SDL texture for the image.
*
* @return the SDL texture for the image.
*/
virtual SDL_Texture* getTexture() const;
*/
virtual SDL_Texture* getTexture() const;

// Inherited from Image

Expand Down
200 changes: 100 additions & 100 deletions include/guisan/sdl/sdltruetypefont.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,106 +55,106 @@

namespace gcn
{
class Graphics;

/**
* SDL True Type Font implementation of Font. It uses the SDL_ttf library
* to display True Type Fonts with SDL.
*
* NOTE: You must initialize the SDL_ttf library before using this
* class. Also, remember to call the SDL_ttf libraries quit
* function.
*
* @author Walluce Pinkham
* @author Olof Naessén
*/
class GCN_EXTENSION_DECLSPEC SDLTrueTypeFont: public Font
{
public:

/**
* Constructor.
*
* @param filename the filename of the True Type Font.
* @param size the size the font should be in.
*/
SDLTrueTypeFont(const std::string& filename, int size);

/**
* Destructor.
*/
virtual ~SDLTrueTypeFont();

/**
* Sets the spacing between rows in pixels. Default is 0 pixels.
* The spacing can be negative.
*
* @param spacing the spacing in pixels.
*/
virtual void setRowSpacing(int spacing);

/**
* Gets the spacing between rows in pixels.
*
* @return the spacing.
*/
virtual int getRowSpacing();

/**
* Sets the spacing between letters in pixels. Default is 0 pixels.
* The spacing can be negative.
*
* @param spacing the spacing in pixels.
*/
virtual void setGlyphSpacing(int spacing);

/**
* Gets the spacing between letters in pixels.
*
* @return the spacing.
*/
virtual int getGlyphSpacing();

/**
* Sets the use of anti aliasing..
*
* @param antiAlias true for use of anti-aliasing.
*/
virtual void setAntiAlias(bool antiAlias);

/**
* Checks if anti aliasing is used.
*
* @return true if anti aliasing is used.
*/
virtual bool isAntiAlias();

/**
* Set the color of the font.
*
* @param color the color of the font.
*/
virtual void setColor(const Color& color);

// Inherited from Font

virtual int getWidth(const std::string& text) const;

virtual int getHeight() const;

virtual void drawString(Graphics* graphics, const std::string& text, int x, int y, bool enabled);

protected:
TTF_Font *mFont;

int mHeight;
int mGlyphSpacing;
int mRowSpacing;

std::string mFilename;
bool mAntiAlias;
Color mColor;
};
class Graphics;

/**
* SDL True Type Font implementation of Font. It uses the SDL_ttf library
* to display True Type Fonts with SDL.
*
* NOTE: You must initialize the SDL_ttf library before using this
* class. Also, remember to call the SDL_ttf libraries quit
* function.
*
* @author Walluce Pinkham
* @author Olof Naessén
*/
class GCN_EXTENSION_DECLSPEC SDLTrueTypeFont: public Font
{
public:

/**
* Constructor.
*
* @param filename the filename of the True Type Font.
* @param size the size the font should be in.
*/
SDLTrueTypeFont(const std::string& filename, int size);

/**
* Destructor.
*/
virtual ~SDLTrueTypeFont();

/**
* Sets the spacing between rows in pixels. Default is 0 pixels.
* The spacing can be negative.
*
* @param spacing the spacing in pixels.
*/
virtual void setRowSpacing(int spacing);

/**
* Gets the spacing between rows in pixels.
*
* @return the spacing.
*/
virtual int getRowSpacing();

/**
* Sets the spacing between letters in pixels. Default is 0 pixels.
* The spacing can be negative.
*
* @param spacing the spacing in pixels.
*/
virtual void setGlyphSpacing(int spacing);

/**
* Gets the spacing between letters in pixels.
*
* @return the spacing.
*/
virtual int getGlyphSpacing();

/**
* Sets the use of anti aliasing..
*
* @param antiAlias true for use of anti-aliasing.
*/
virtual void setAntiAlias(bool antiAlias);

/**
* Checks if anti aliasing is used.
*
* @return true if anti aliasing is used.
*/
virtual bool isAntiAlias();

/**
* Set the color of the font.
*
* @param color the color of the font.
*/
virtual void setColor(const Color& color);

// Inherited from Font

virtual int getWidth(const std::string& text) const;

virtual int getHeight() const;

virtual void drawString(Graphics* graphics, const std::string& text, int x, int y, bool enabled);

protected:
TTF_Font *mFont;

int mHeight;
int mGlyphSpacing;
int mRowSpacing;

std::string mFilename;
bool mAntiAlias;
Color mColor;
};
}

#endif
2 changes: 1 addition & 1 deletion include/guisan/widgets/dropdown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace gcn
virtual void mouseDragged(MouseEvent& mouseEvent);


// Inherited from SelectionListener
// Inherited from SelectionListener

virtual void valueChanged(const SelectionEvent& event);

Expand Down
18 changes: 9 additions & 9 deletions include/guisan/widgets/messagebox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace gcn

/**
* Constructor.
* This version only has a single button labeled "OK".
* This version only has a single button labeled "OK".
*
* @param caption the MessageBox caption.
* @param message the message to display in the MessageBox
Expand Down Expand Up @@ -185,14 +185,14 @@ namespace gcn
* @return true or false.
*/
bool isOpaque();
/**
* Add this MessageBox to a parent container, centered both horizontally and vertically
* If instead, you want to place it somewhere else, use Container::add().
*
* @param container parent container
*/
void addToContainer(Container* container);
/**
* Add this MessageBox to a parent container, centered both horizontally and vertically
* If instead, you want to place it somewhere else, use Container::add().
*
* @param container parent container
*/
void addToContainer(Container* container);

/**
* Resizes the container to fit the content exactly.
Expand Down
2 changes: 1 addition & 1 deletion src/cliprectangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace gcn
{
ClipRectangle::ClipRectangle()
{
x = y = width = height = xOffset = yOffset = 0;
x = y = width = height = xOffset = yOffset = 0;
}

ClipRectangle::ClipRectangle(int x, int y, int width, int height, int xOffset, int yOffset)
Expand Down
50 changes: 25 additions & 25 deletions src/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,39 @@
namespace gcn
{
Color::Color()
:
r(0),
g(0),
b(0),
a(255)
:
r(0),
g(0),
b(0),
a(255)
{
}

Color::Color(int color)
:
r((color >> 16) & 0xFF),
b((color >> 8) & 0xFF),
g((color >> 8) & 0xFF),
a(255)
:
r((color >> 16) & 0xFF),
g((color >> 8) & 0xFF),
b((color >> 8) & 0xFF),
a(255)
{
}

Color::Color(int ar, int ag, int ab, int aa)
:
r(ar),
g(ag),
b(ab),
a(aa)
:
r(ar),
g(ag),
b(ab),
a(aa)
{
}

Color Color::operator+(const Color& color) const
{
Color result(r + color.r, g + color.g, b + color.b, 255);

result.r = (result.r>255?255:(result.r<0?0:result.r));
result.g = (result.g>255?255:(result.g<0?0:result.g));
result.b = (result.b>255?255:(result.b<0?0:result.b));
result.r = result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r);
result.g = result.g > 255 ? 255 : (result.g < 0 ? 0 : result.g);
result.b = result.b > 255 ? 255 : (result.b < 0 ? 0 : result.b);

return result;
}
Expand All @@ -104,9 +104,9 @@ namespace gcn
{
Color result(r - color.r, g - color.g, b - color.b, 255);

result.r = (result.r>255?255:(result.r<0?0:result.r));
result.g = (result.g>255?255:(result.g<0?0:result.g));
result.b = (result.b>255?255:(result.b<0?0:result.b));
result.r = result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r);
result.g = result.g > 255 ? 255 : (result.g < 0 ? 0 : result.g);
result.b = result.b > 255 ? 255 : (result.b < 0 ? 0 : result.b);

return result;
}
Expand All @@ -115,9 +115,9 @@ namespace gcn
{
Color result((int)(r * value), (int)(g * value), (int)(b * value), a);

result.r = (result.r>255?255:(result.r<0?0:result.r));
result.g = (result.g>255?255:(result.g<0?0:result.g));
result.b = (result.b>255?255:(result.b<0?0:result.b));
result.r = result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r);
result.g = result.g > 255 ? 255 : (result.g < 0 ? 0 : result.g);
result.b = result.b > 255 ? 255 : (result.b < 0 ? 0 : result.b);

return result;
}
Expand All @@ -135,6 +135,6 @@ namespace gcn
std::ostream& operator<<(std::ostream& out, const Color& color)
{
return out << "Color [r = " << color.r << ", g = " << color.g << ", b = " << color.b
<< ", a = " << color.a << "]";
<< ", a = " << color.a << "]";
}
}
Loading

0 comments on commit 36482f7

Please sign in to comment.