void handle_button_down(Display* display, GC gc, XButtonEvent* button_event, unsigned int win_width, unsigned int win_height) { int x = button_event->x; int y = button_event->y; if(is_OK(x, y)) { prevx = x; prevy = y; } }
void handle_drag(Display* display, GC gc, XButtonEvent* drag_event, unsigned int win_width, unsigned int win_height, int sockfd) { int x, y; x = drag_event->x; y = drag_event->y; if(is_OK(x, y)) { XDrawLine(display, drag_event->window, gc, prevx, prevy, x, y); XDrawLine(display, back_buffer, gc, prevx, prevy, x, y); if(sending) send_comm(sockfd, prevx, prevy, x, y, 0); prevx = x; prevy = y; } XFlush(display); }
void indexed_vector<T>::resize(unsigned data_size) { clear(); m_data.resize(data_size, numeric_traits<T>::zero()); SASSERT(is_OK()); }