Esempio n. 1
0
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;
    }
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
void indexed_vector<T>::resize(unsigned data_size) {
    clear();
    m_data.resize(data_size, numeric_traits<T>::zero());
    SASSERT(is_OK());
}