diff --git a/src/lib/views/sunlight/include/vContext.h b/src/lib/views/sunlight/include/vContext.h index a224571..dccbc8f 100644 --- a/src/lib/views/sunlight/include/vContext.h +++ b/src/lib/views/sunlight/include/vContext.h @@ -19,16 +19,16 @@ bool attached; public: vContext(vContext *); - virtual vContext * Attach(vContext *); - virtual void DeleteAllStyles(void) { styles.clear(); }; - virtual bool DeleteStyle(const std::string); - virtual void Draw(void) = 0; - virtual vContext * Detach(vContext *); - virtual sStyle * GetStyle(const std::string); - virtual bool IsAttached(void) { return attached; } - virtual void SetPos(int32, int32); - virtual void SetSize(uInt32, uInt32); - virtual void SetStyle(const std::string, sStyle *); + virtual vContext * vAttach(vContext *); + virtual void vDeleteAllStyles(void) { styles.clear(); }; + virtual bool vDeleteStyle(const std::string); + virtual void vDraw(void) = 0; + virtual vContext * vDetach(vContext *); + virtual sStyle * vGetStyle(const std::string); + virtual bool vIsAttached(void) { return attached; } + virtual void vSetPos(int32, int32); + virtual void vSetSize(uInt32, uInt32); + virtual void vSetStyle(const std::string, sStyle *); virtual ~vContext(); }; // vContext diff --git a/src/lib/views/sunlight/include/vTitleTab.h b/src/lib/views/sunlight/include/vTitleTab.h index 4aaea95..9ec8ad2 100644 --- a/src/lib/views/sunlight/include/vTitleTab.h +++ b/src/lib/views/sunlight/include/vTitleTab.h @@ -11,8 +11,8 @@ std::string title; public: vTitleTab(vContext *); - virtual void Draw(void); - void SetTitle(const std::string); + virtual void vDraw(void); + void vSetTitle(const std::string); virtual ~vTitleTab(void); }; // vTitleTab diff --git a/src/lib/views/sunlight/vContext.cpp b/src/lib/views/sunlight/vContext.cpp index 7ce20d8..fc367f7 100644 --- a/src/lib/views/sunlight/vContext.cpp +++ b/src/lib/views/sunlight/vContext.cpp @@ -14,21 +14,21 @@ } // vContext::vContext vContext * -vContext::Attach(vContext * context) { +vContext::vAttach(vContext * context) { /* - * vContext::Attach() + * vContext::vAttach() * Accepts a vContext as a parameter and attaches it to the * current child context list. * Returns the child context pointer */ cContexts.push_back(context); return context; -} // vContext::Attach +} // vContext::vAttach bool -vContext::DeleteStyle(const std::string styleKey) { +vContext::vDeleteStyle(const std::string styleKey) { /* - * vContext::DeleteStyle() + * vContext::vDeleteStyle() * returns true if style existed and was deleted * returns false if style didn't exist (or wasn't deleted) */ @@ -36,14 +36,14 @@ sStyle * tmpStyle = styles[styleKey]; styles.erase(styleKey); delete tmpStyle; - return (NULL != tmpStyle); -} // vContext::DeleteStyle + return (tmpStyle != NULL); +} // vContext::vDeleteStyle vContext * -vContext::Detach(vContext * context) { +vContext::vDetach(vContext * context) { cContexts.remove(context); return context; -} // vContext::Detach +} // vContext::vDetach /* * void @@ -53,7 +53,7 @@ */ sStyle * -vContext::GetStyle(const std::string styleKey) { +vContext::vGetStyle(const std::string styleKey) { /* * GetStyle() * retreives a style out of the style map using the styleKey string @@ -61,45 +61,45 @@ */ sStyle * tmpStyle = styles[styleKey]; - if ((NULL == tmpStyle) && (NULL != pContext)) { - return pContext->GetStyle(styleKey); + if ((tmpStyle == NULL) && (pContext != NULL)) { + return pContext->vGetStyle(styleKey); } // if return tmpStyle; -} // vContext::GetStyle +} // vContext::vGetStyle void -vContext::SetPos(int32 newX, int32 newY) { +vContext::vSetPos(int32 newX, int32 newY) { /* * vContext::SetPos() * Sets new position relative to parent's upper left corner */ // I really should detach from the parent here - if (pContext != NULL) pContext->Detach(this); + if (pContext != NULL) pContext->vDetach(this); curX = newX; curY = newY; // and reattach to parent here - if (pContext != NULL) pContext->Attach(this); + if (pContext != NULL) pContext->vAttach(this); return; -} // vContext::SetPos +} // vContext::vSetPos void -vContext::SetSize(uInt32 newWidth, uInt32 newHeight) { +vContext::vSetSize(uInt32 newWidth, uInt32 newHeight) { width = newWidth; height = newHeight; -} // vContext::SetSize +} // vContext::vSetSize void -vContext::SetStyle(const std::string styleKey, sStyle * style) { +vContext::vSetStyle(const std::string styleKey, sStyle * style) { // I probably should check to see if a style exists before setting it // if the style is null, then just exit out without setting it - if (NULL == style) return; + if (style == NULL) return; // set the new style styles[styleKey] = style; -} // vContext::SetStyle +} // vContext::vSetStyle vContext::~vContext(void) { delete realView; diff --git a/src/lib/views/sunlight/vTitleTab.cpp b/src/lib/views/sunlight/vTitleTab.cpp index e7378e3..c0e62a5 100644 --- a/src/lib/views/sunlight/vTitleTab.cpp +++ b/src/lib/views/sunlight/vTitleTab.cpp @@ -11,46 +11,46 @@ title = ""; // Retrieve the default font filename out of the style tree - sString * fontFileName = dynamic_cast(GetStyle("default.font.filename")); + sString * fontFileName = dynamic_cast(vGetStyle("default.font.filename")); // Attempt to load the font - if (NULL != fontFileName) { + if (fontFileName != NULL) { // I should check for failure here, although everything fails quietly... // so even if it does fail it won't matter much font->Load(fontFileName->c_str(), 0); } - sRGBA8Color * color = dynamic_cast(GetStyle("default.font.color.background")); + sRGBA8Color * color = dynamic_cast(vGetStyle("default.font.color.background")); if (NULL != color) font->SetBGColor(color->red, color->blue, color->green, color->alpha); - color = dynamic_cast(GetStyle("defualt.font.color.foreground")); - if (NULL != color) + color = dynamic_cast(vGetStyle("defualt.font.color.foreground")); + if (color != NULL) font->SetFGColor(color->red, color->blue, color->green, color->alpha); return; } // vTitleTab::vTitleTab void -vTitleTab::Draw(void) { +vTitleTab::vDraw(void) { ogPoint2d points[4]; - sBGColor * BGColor = dynamic_cast(GetStyle("passive title color")); - if (NULL == BGColor) return; + sBGColor * BGColor = dynamic_cast(vGetStyle("passive title color")); + if (BGColor == NULL) return; points[0].x = points[0].y = points[1].y = points[3].x = 0; - points[1].x = points[2].x = GetMaxX()+1; - points[2].y = points[3].y = GetMaxY(); + points[1].x = points[2].x = ogGetMaxX()+1; + points[2].y = points[3].y = ogGetMaxY(); - FillGouraudPolygon(4, points, BGColor->colors); + ogFillGouraudPolygon(4, points, BGColor->colors); font->JustifyText(*this, centerText, centerText, title.c_str()); return; -} // vTitleTab::Draw() +} // vTitleTab::vDraw() void -vTitleTab::SetTitle(const std::string newTitle) { +vTitleTab::vSetTitle(const std::string newTitle) { title = newTitle; return; -} // vTitleTab::SetTitle +} // vTitleTab::vSetTitle vTitleTab::~vTitleTab(void) { delete font;