Lines Matching defs:surface

348 // A surface is an abstraction for something than can be drawn on. The surface
375 // Copy a region of the surface to another surface.
396 // Get a zero origin rectangle width the surface size.
1011 // be given a surface that have exactly this number of lines.
1023 // Draw the field in the given subpad surface. The surface have a height that
1026 virtual void FieldDelegateDraw(Surface &surface, bool is_selected) = 0;
1107 // Get the cursor X position in the surface coordinate.
1112 void DrawContent(Surface &surface, bool is_selected) {
1113 UpdateScrolling(surface.GetWidth());
1115 surface.MoveCursor(0, 0);
1117 surface.PutCString(text, surface.GetWidth());
1120 surface.MoveCursor(GetCursorXPosition(), 0);
1122 surface.AttributeOn(A_REVERSE);
1125 surface.PutChar(' ');
1127 surface.PutChar(m_content[m_cursor_position]);
1129 surface.AttributeOff(A_REVERSE);
1132 void DrawField(Surface &surface, bool is_selected) {
1133 surface.TitledBox(m_label.c_str());
1135 Rect content_bounds = surface.GetFrame();
1137 Surface content_surface = surface.SubSurface(content_bounds);
1142 void DrawError(Surface &surface) {
1145 surface.MoveCursor(0, 0);
1146 surface.AttributeOn(COLOR_PAIR(RedOnBlack));
1147 surface.PutChar(ACS_DIAMOND);
1148 surface.PutChar(' ');
1149 surface.PutCStringTruncated(1, GetError().c_str());
1150 surface.AttributeOff(COLOR_PAIR(RedOnBlack));
1153 void FieldDelegateDraw(Surface &surface, bool is_selected) override {
1154 Rect frame = surface.GetFrame();
1157 Surface field_surface = surface.SubSurface(field_bounds);
1158 Surface error_surface = surface.SubSurface(error_bounds);
1465 void FieldDelegateDraw(Surface &surface, bool is_selected) override {
1466 surface.MoveCursor(0, 0);
1467 surface.PutChar('[');
1469 surface.AttributeOn(A_REVERSE);
1470 surface.PutChar(m_content ? ACS_DIAMOND : ' ');
1472 surface.AttributeOff(A_REVERSE);
1473 surface.PutChar(']');
1474 surface.PutChar(' ');
1475 surface.PutCString(m_label.c_str());
1545 void DrawContent(Surface &surface, bool is_selected) {
1548 surface.MoveCursor(0, i);
1553 surface.AttributeOn(A_REVERSE);
1554 surface.PutChar(current_choice == m_choice ? ACS_DIAMOND : ' ');
1555 surface.PutCString(text);
1557 surface.AttributeOff(A_REVERSE);
1561 void FieldDelegateDraw(Surface &surface, bool is_selected) override {
1564 surface.TitledBox(m_label.c_str());
1566 Rect content_bounds = surface.GetFrame();
1568 Surface content_surface = surface.SubSurface(content_bounds);
1773 void DrawRemoveButton(Surface &surface, int highlight) {
1774 surface.MoveCursor(1, surface.GetHeight() / 2);
1776 surface.AttributeOn(A_REVERSE);
1777 surface.PutCString("[Remove]");
1779 surface.AttributeOff(A_REVERSE);
1782 void DrawFields(Surface &surface, bool is_selected) {
1784 int width = surface.GetWidth();
1791 Surface field_surface = surface.SubSurface(field_bounds);
1792 Surface remove_button_surface = surface.SubSurface(remove_button_bounds);
1807 void DrawNewButton(Surface &surface, bool is_selected) {
1809 int x = (surface.GetWidth() - sizeof(button_text) - 1) / 2;
1810 surface.MoveCursor(x, 0);
1814 surface.AttributeOn(A_REVERSE);
1815 surface.PutCString(button_text);
1817 surface.AttributeOff(A_REVERSE);
1820 void FieldDelegateDraw(Surface &surface, bool is_selected) override {
1821 surface.TitledBox(m_label.c_str());
1823 Rect content_bounds = surface.GetFrame();
1828 Surface fields_surface = surface.SubSurface(fields_bounds);
1829 Surface new_button_surface = surface.SubSurface(new_button_bounds);
2070 void DrawArrow(Surface &surface) {
2071 surface.MoveCursor(0, 1);
2072 surface.PutChar(ACS_RARROW);
2075 void FieldDelegateDraw(Surface &surface, bool is_selected) override {
2076 Rect bounds = surface.GetFrame();
2084 Surface key_field_surface = surface.SubSurface(key_field_bounds);
2085 Surface arrow_surface = surface.SubSurface(arrow_bounds);
2086 Surface value_field_surface = surface.SubSurface(value_field_bounds);
2264 void Draw(Surface &surface, bool is_selected) {
2265 int x = (surface.GetWidth() - m_label.length()) / 2;
2266 surface.MoveCursor(x, 0);
2268 surface.AttributeOn(A_REVERSE);
2269 surface.PutChar('[');
2270 surface.PutCString(m_label.c_str());
2271 surface.PutChar(']');
2273 surface.AttributeOff(A_REVERSE);
2547 void UpdateScrolling(Surface &surface) {
2550 int surface_height = surface.GetHeight();
2571 void DrawError(Surface &surface) {
2574 surface.MoveCursor(0, 0);
2575 surface.AttributeOn(COLOR_PAIR(RedOnBlack));
2576 surface.PutChar(ACS_DIAMOND);
2577 surface.PutChar(' ');
2578 surface.PutCStringTruncated(1, m_delegate_sp->GetError().c_str());
2579 surface.AttributeOff(COLOR_PAIR(RedOnBlack));
2581 surface.MoveCursor(0, 1);
2582 surface.HorizontalLine(surface.GetWidth());
2585 void DrawFields(Surface &surface) {
2587 int width = surface.GetWidth();
2596 Surface field_surface = surface.SubSurface(bounds);
2602 void DrawActions(Surface &surface) {
2604 int width = surface.GetWidth() / number_of_actions;
2611 Surface action_surface = surface.SubSurface(bounds);
2617 void DrawElements(Surface &surface) {
2618 Rect frame = surface.GetFrame();
2620 frame.HorizontalSplit(surface.GetHeight() - GetActionsHeight(),
2622 Surface fields_surface = surface.SubSurface(fields_bounds);
2623 Surface actions_surface = surface.SubSurface(actions_bounds);
2632 void DrawContent(Surface &surface) {
2633 UpdateScrolling(surface);
2635 int width = surface.GetWidth();
2648 int copy_height = std::min(surface.GetHeight(), pad.GetHeight());
2649 pad.CopyToSurface(surface, Point(0, m_first_visible_line), Point(),
2653 void DrawSubmitHint(Surface &surface, bool is_active) {
2654 surface.MoveCursor(2, surface.GetHeight() - 1);
2656 surface.AttributeOn(A_BOLD | COLOR_PAIR(BlackOnWhite));
2657 surface.Printf("[Press Alt+Enter to %s]",
2660 surface.AttributeOff(A_BOLD | COLOR_PAIR(BlackOnWhite));
3703 void UpdateScrolling(Surface &surface) {
3709 int height = surface.GetHeight();
3716 void DrawMatches(Surface &surface) {
3720 UpdateScrolling(surface);
3722 int count = GetNumberOfVisibleMatches(surface.GetHeight());
3724 surface.MoveCursor(1, i);
3727 surface.AttributeOn(A_REVERSE);
3728 surface.PutCString(
3731 surface.AttributeOff(A_REVERSE);
3735 void DrawContent(Surface &surface) {
3736 Rect content_bounds = surface.GetFrame();
3740 Surface text_field_surface = surface.SubSurface(text_field_bounds);
3741 Surface matches_surface = surface.SubSurface(matchs_bounds);