/*************************************************************************************** * * main.cc is part of SimpleSkyCam. * *****************************************************************************************/ #include #include "config.h" #include "gui.h" #include "filter.h" #include "detect.h" ////////////////////////////////////////////////////////////////////////////////////////////////// // // global variables // GtkBuilder *_builder_ = NULL; // work around for the thread situation Filter filter; Detect detect; int main (int argc, char **argv) { GtkBuilder *builder; GObject *window; #ifdef BUILD_WINDOWS char buffer[16]; setvbuf (stdout, buffer, _IONBF, 16); #endif printf ("SimpleSkyCam - %s\n", VERSION); printf (" written by Steffen Pohle \n"); gtk_init (&argc, &argv); _builder_ = builder = gtk_builder_new (); gtk_builder_add_from_file (builder, BUILDER_FILE, NULL); gtk_builder_connect_signals(builder, builder); // // #if defined _WIN32 || defined _WIN64 || defined __CYGWIN__ // #else // #endif // window = gtk_builder_get_object (builder, "window-main"); if(window == NULL) { printf("ERROR: gtk_builder_get_object() failed\n"); return 1; } gtk_widget_show_all (GTK_WIDGET(window)); gtk_main (); return 0; } float get_cycletime(struct timeval *t) { struct timeval t1; float f = 0.0; t1 = *t; gettimeofday(t, NULL); f = (float)(t->tv_sec - t1.tv_sec) + ((t->tv_usec - t1.tv_usec) / 1000000.0); return f; }