nux-1.16.0
nux::BasePainter Class Reference

List of all members.

Public Member Functions

virtual void Draw2DTexture (GraphicsEngine &GfxContext, BaseTexture *Texture, int x, int y) const
 Draw unscaled texture at position (x, y). The size of the quad is the size of the texture.
virtual void Draw2DTextureAligned (GraphicsEngine &GfxContext, BaseTexture *Texture, const Geometry &g, TextureAlignmentStyle tex_align) const
virtual int PaintColorTextLineEdit (GraphicsEngine &GfxContext, const Geometry &g, const NString &Str, Color TextColor, bool WriteAlphaChannel, Color SelectedTextColor, Color SelectedTextBackgroundColor, Color TextBlinkColor, Color CursorColor, bool ShowCursor, unsigned int CursorPosition, int offset=0, int selection_start=0, int selection_end=0) const
virtual int PaintTextLineStatic (GraphicsEngine &GfxContext, ObjectPtr< FontTexture > Font, const Geometry &g, const NString &Str, const Color &color=Color(0.0f, 0.0f, 0.0f, 1.0f), bool WriteAlphaChannel=true, TextAlignment alignment=eAlignTextLeft) const
void Paint2DQuadColor (GraphicsEngine &GfxContext, const Geometry &g, Color c0) const
void Paint2DQuadColor (GraphicsEngine &GfxContext, const Geometry &g, Color c0_top_left, Color c1_bottom_left, Color c2_bottom_right, Color c3_top_right) const
void Paint2DQuadColor (GraphicsEngine &GfxContext, int x, int y, int width, int height, Color c0) const
void Paint2DQuadColor (GraphicsEngine &GfxContext, int x, int y, int width, int height, Color c0_top_left, Color c1_bottom_left, Color c2_bottom_right, Color c3_top_right) const
void Paint2DQuadVGradient (GraphicsEngine &GfxContext, const Geometry &g, Color TopColor, Color BottomColor) const
 Paint a 2D quad with a gradient color going from Top to Bottom.
void Paint2DQuadHGradient (GraphicsEngine &GfxContext, const Geometry &g, Color LeftColor, Color RightColor) const
 Paint a 2D quad with a gradient color going from Left to Right.
void Paint2DQuadWireframe (GraphicsEngine &GfxContext, const Geometry &g, Color c0) const
void Paint2DQuadWireframe (GraphicsEngine &GfxContext, const Geometry &g, Color c_top_left, Color c_bottom_left, Color c_bottom_right, Color c_top_right) const
void Paint2DQuadWireframe (GraphicsEngine &GfxContext, int x, int y, int width, int height, Color c0) const
void Paint2DQuadWireframe (GraphicsEngine &GfxContext, int x, int y, int width, int height, Color c_top_left, Color c_bottom_left, Color c_bottom_right, Color c_top_right) const
void Draw2DTriangleColor (GraphicsEngine &GfxContext, int x0, int y0, int x1, int y1, int x2, int y2, Color c0)
void Draw2DTriangleColor (GraphicsEngine &GfxContext, int x0, int y0, int x1, int y1, int x2, int y2, Color c0, Color c1, Color c2)
void Draw2DLine (GraphicsEngine &GfxContext, int x0, int y0, int x1, int y1, Color c0) const
void Draw2DLine (GraphicsEngine &GfxContext, int x0, int y0, int x1, int y1, Color c0, Color c1) const
void PaintShape (GraphicsEngine &GfxContext, const Geometry &geo, Color c0, UXStyleImageRef style, bool WriteAlpha=true) const
void PaintShapeCorner (GraphicsEngine &GfxContext, const Geometry &geo, Color c0, UXStyleImageRef style, long corners, bool WriteAlpha=true) const
void PaintShapeROP (GraphicsEngine &GfxContext, const Geometry &geo, Color c0, UXStyleImageRef style, bool WriteAlpha=true, const ROPConfig &ROP=ROPConfig::Default) const
void PaintShapeCornerROP (GraphicsEngine &GfxContext, const Geometry &geo, Color c0, UXStyleImageRef style, long corners, bool WriteAlpha=true, const ROPConfig &ROP=ROPConfig::Default) const
void PaintTextureShape (GraphicsEngine &GfxContext, const Geometry &geo, UXStyleImageRef style) const
void PaintTextureShape (GraphicsEngine &GfxContext, const Geometry &geo, BaseTexture *Texture, int border_left, int border_right, int border_top, int border_bottom, bool draw_borders_only, bool premultiply=true) const
void PaintCheckBox (GraphicsEngine &GfxContext, const Geometry &geo, const InteractState &interaction_state, Color check_mark_color=Color(0x0), Color check_box_color=Color(0x0))
 Draw Check Box.
void PaintRadioButton (GraphicsEngine &GfxContext, const Geometry &geo, const InteractState &interaction_state, Color check_mark_color=Color(0x0), Color check_box_color=Color(0x0))
void PaintHorizontalGradientQuad (GraphicsEngine &GfxContext, const Geometry &geo, int num_color, float *percentage_array, Color *color_array)
void PushColorLayer (GraphicsEngine &GfxContext, const Geometry &geo, Color color, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushShapeLayer (GraphicsEngine &GfxContext, Geometry geo, UXStyleImageRef imageStyle, const Color &color, unsigned long Corners=eAllCorners, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushSliceScaledTextureLayer (GraphicsEngine &GfxContext, Geometry geo, UXStyleImageRef imageStyle, const Color &color, unsigned long Corners=eAllCorners, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushTextureLayer (GraphicsEngine &GfxContext, Geometry geo, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm texxform, const Color &color, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushDrawColorLayer (GraphicsEngine &GfxContext, const Geometry &geo, Color color, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushDrawShapeLayer (GraphicsEngine &GfxContext, Geometry geo, UXStyleImageRef imageStyle, const Color &color, unsigned long Corners=eAllCorners, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushDrawSliceScaledTextureLayer (GraphicsEngine &GfxContext, Geometry geo, UXStyleImageRef imageStyle, const Color &color, unsigned long Corners=eAllCorners, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushDrawTextureLayer (GraphicsEngine &GfxContext, Geometry geo, ObjectPtr< IOpenGLBaseTexture > DeviceTexture, TexCoordXForm texxform, const Color &color, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void PushLayer (GraphicsEngine &GfxContext, const Geometry &geo, AbstractPaintLayer *layer)
void PushDrawLayer (GraphicsEngine &GfxContext, const Geometry &geo, AbstractPaintLayer *layer)
void RenderSinglePaintLayer (GraphicsEngine &GfxContext, Geometry geo, AbstractPaintLayer *paint_layer)
 Render a paint layer.
void PopBackground (int level=1)
void EmptyBackgroundStack ()
void PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo)
void PushBackgroundStack ()
void PopBackgroundStack ()

Public Attributes

int intTest

Detailed Description

Definition at line 138 of file Painter.h.


Member Function Documentation

void nux::BasePainter::Paint2DQuadHGradient ( GraphicsEngine GfxContext,
const Geometry g,
Color  LeftColor,
Color  RightColor 
) const

Paint a 2D quad with a gradient color going from Left to Right.

Paint a 2D quad with a gradient color going from Left to Right.

Parameters:
gGeometry of the quad.
LeftColorcolor at the top of the quad.
RightColorcolor at the bottom of the quad.

Definition at line 312 of file Painter.cpp.

  {
    Paint2DQuadColor (GfxContext, g, LeftColor, LeftColor, RightColor, LeftColor);
  }
void nux::BasePainter::Paint2DQuadVGradient ( GraphicsEngine GfxContext,
const Geometry g,
Color  TopColor,
Color  BottomColor 
) const

Paint a 2D quad with a gradient color going from Top to Bottom.

Paint a 2D quad with a gradient color going from Top to Bottom.

Parameters:
gGeometry of the quad.
TopColorcolor at the top of the quad.
TopColorcolor at the bottom of the quad.

Definition at line 307 of file Painter.cpp.

  {
    Paint2DQuadColor (GfxContext, g, TopColor, BottomColor, BottomColor, TopColor);
  }
void nux::BasePainter::PaintCheckBox ( GraphicsEngine GfxContext,
const Geometry geo,
const InteractState interaction_state,
Color  check_mark_color = Color (0x0),
Color  check_box_color = Color (0x0) 
)

Draw Check Box.

Draw a Check box.

Definition at line 685 of file Painter.cpp.

References nux::ComputeGeometryPositioning(), and Draw2DTexture().

  {

    GeometryPositioning pctx (eHACenter, eVACenter);
    pctx.m_stretch_horizontal = false;
    pctx.m_stretch_vertical = false;

    const PainterImage *pimage = GetTheme().GetImage (eCHECKBOX_NORMAL_ON);

    if (pimage == 0)
      return;

    BaseTexture *texture = pimage->texture;
    Geometry content_geo (0, 0, texture->GetWidth(), texture->GetHeight() ) ;
    content_geo = ComputeGeometryPositioning (geo, content_geo, pctx);

    GfxContext.GetRenderStates().SetBlend (true, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    if (interaction_state.is_focus && interaction_state.is_on)
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_FOCUS_ON)->texture, content_geo.x, content_geo.y);
    }
    else if (interaction_state.is_focus && !interaction_state.is_on)
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_FOCUS_OFF)->texture, content_geo.x, content_geo.y);
    }
    else if (interaction_state.is_prelight && interaction_state.is_on)
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_PRELIGHT_ON)->texture, content_geo.x, content_geo.y);
    }
    else if (interaction_state.is_prelight && !interaction_state.is_on)
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_PRELIGHT_OFF)->texture, content_geo.x, content_geo.y);
    }
    else if (interaction_state.is_on)
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_NORMAL_ON)->texture, content_geo.x, content_geo.y);
    }
    else
    {
      Draw2DTexture (GfxContext, GetTheme().GetImage (eCHECKBOX_NORMAL_OFF)->texture, content_geo.x, content_geo.y);
    }

    GfxContext.GetRenderStates().SetBlend (false);
    //PaintShape(content_geo, check_box_color, eSHAPE_CHECK_BOX);
    //Draw2DTexture(GetTheme().GetImage(eSHAPE_CHECK_BOX)->texture, content_geo);

    //PaintShape(const Geometry& geo, Color c0, UXStyleImageRef style)
  }
void nux::BasePainter::PopBackground ( int  level = 1)

Pop a number of levels off the painter background stack.

Definition at line 932 of file Painter.cpp.

Referenced by nux::TableCtrl::PopItemBackground().

  {
    nuxAssert (level >= 0);

    while ((level >= 1) && (m_BackgroundStack.size() > 0))
    {
      AbstractPaintLayer *paint_layer = (*m_BackgroundStack.begin() );
      delete paint_layer;
      m_BackgroundStack.pop_front();
      level--;
    }
  }
void nux::BasePainter::RenderSinglePaintLayer ( GraphicsEngine GfxContext,
Geometry  geo,
AbstractPaintLayer paint_layer 
)

Render a paint layer.

When calling this function make sure to assign a correct geometry to the paint layer parameter.

Definition at line 821 of file Painter.cpp.

  {
    paint_layer->Renderlayer (GfxContext);
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends