static int prep_timer (mstime when, void* arg) { rb_poller* poll; poll = (rb_poller*)arg; if (server_timer (poll->interval, poller_timer, poll) == -1) log_error ("couldn't setup poller timer"); /* Run the poll the first time */ poller_timer (when, poll); return 0; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { this->timer = new QTimer(this); connect(this->timer, SIGNAL(timeout()), this, SLOT(server_timer())); ui->setupUi(this); this->screen = new Screen(false, this); this->router = new Router(this->screen, this); this->ui->gv_Visualizer->setBackgroundBrush(Qt::black); this->ui->gv_Visualizer->setScene(new QGraphicsScene()); Parameters::get()->setScreen(this->screen); this->drawLines(std::vector<Point>()); this->cal = new calibrer(0,this->screen); }
int main (int argc, char* argv[]) { #ifdef _WIN32 WSADATA WSAData; WSAStartup (MAKEWORD (2, 2), &WSAData); #endif main_loop = g_main_loop_new (NULL, FALSE); // start server server_timer (NULL); g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 500, (GSourceFunc) server_timer, NULL, NULL); // start client thread g_thread_new ("ipc-client", (GThreadFunc) client_thread, NULL); g_main_loop_run (main_loop); #ifdef _WIN32 WSACleanup (); #endif return 0; // EXIT_SUCCESS }