TextRegion::TextRegion() { line1_ = 0; column1_ = 0; line2_ = 0; column2_ = 0; WidgetKit* kit = WidgetKit::instance(); Style* style = kit->style(); String gui("monochrome"); if (gui == kit->gui()) { color_ = new Color(*kit->foreground(), 0.25); } else { color_ = new Color(.7, .8, 1, 1); } Resource::ref(color_); }
Text::Text(unsigned initialLines, unsigned initialColumns, TextBuffer* t) { handler_ = new TextHandler(this); Resource::ref(handler_); dirty_ = false; text_ = t; insertion_.line_ = 0; insertion_.column_ = 0; WidgetKit* kit = WidgetKit::instance(); Style* s = kit->style(); String gui("monochrome"); if (gui == kit->gui()) insertion_.color_ = new Color(*kit->foreground()); else insertion_.color_ = new Color(1, .5, .5, 1); Resource::ref(insertion_.color_); insertion_.width_ = 2; initialLines_ = Math::max(initialLines, 1u); initialColumns_ = Math::max(initialColumns, 1u); font_ = kit->font(); Resource::ref(font_); textColor_ = new Color(*kit->foreground()); Resource::ref(textColor_); readOnly_ = false; canvas_ = 0; allocation_ = 0; curLowerX_ = 0; curUpperX_ = 0; curLowerY_ = 0; curUpperY_ = 0; textBuffer_ = 0; needWidth_ = false; width_ = 0; ctl_pn_col_ = -1; escape_ = 10; }