Ejemplo n.º 1
0
Archivo: main.c Proyecto: 4179e1/gtkqq
int main(int argc, char **argv)
{
#ifdef USE_GSTREAMER
	gst_init(&argc , &argv);
#endif
    gtk_init(&argc, &argv);

    log_init();
    info = qq_init(NULL);
    if(info == NULL){
        return -1;
    }
    cfg = gqq_config_new(info);

    send_loop = gqq_msgloop_start("Send");
    if(send_loop == NULL){
        return -1;
    }
    get_info_loop = gqq_msgloop_start("Get informain");
    if(get_info_loop == NULL){
        return -1;
    }
    get_number_faceimg_loop = gqq_msgloop_start("Get Number and face images");
    if(get_number_faceimg_loop == NULL){
        return -1;
    }

    /* GtkWidget *win = qq_mainwindow_new(); */
	main_win = qq_mainwindow_new();
    tray = qq_tray_new();
    gtk_widget_show_all(main_win);

    gtk_main();

    g_object_unref(G_OBJECT(tray));

    qq_logout(info, NULL);
    gqq_msgloop_stop(get_info_loop);
    gqq_msgloop_stop(send_loop);

    //Save config
    gqq_config_save(cfg);
    qq_finalize(info, NULL);
    return 0;
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
	GError *error = NULL;
	GOptionContext *context;
	context = g_option_context_new(NULL);
	g_option_context_add_main_entries(context, entries, NULL);
	g_option_context_add_group(context, gtk_get_option_group(TRUE));
#ifdef USE_GSTREAMER
	g_option_context_add_group(context, gst_init_get_option_group());
#endif
	if (!g_option_context_parse(context, &argc, &argv, &error)) {
		g_print("option parsing failed: %s\n", error->message);
		exit(1);
	}
	g_option_context_free(context);

#ifdef USE_GSTREAMER
	gst_init(NULL, NULL);
#endif
	gtk_init(&argc, &argv);

    gui_init();
#if 0
    log_init(debug);
    info = qq_init(NULL);
    if(info == NULL){
        return -1;
    }
    cfg = gqq_config_new(info);
#endif

    send_loop = gqq_msgloop_start("Send");
    if(send_loop == NULL){
        return -1;
    }
    get_info_loop = gqq_msgloop_start("Get informain");
    if(get_info_loop == NULL){
        return -1;
    }
    get_number_faceimg_loop = gqq_msgloop_start("Get Number and face images");
    if(get_number_faceimg_loop == NULL){
        return -1;
    }

    /* GtkWidget *win = qq_mainwindow_new(); */
	main_win = qq_mainwindow_new();
    tray = qq_tray_new();
    gtk_widget_show_all(main_win);

    gtk_main();

    g_object_unref(G_OBJECT(tray));

    gui_finalize();
#if 0
    qq_logout(info, NULL);
#endif
    gqq_msgloop_stop(get_info_loop);
    gqq_msgloop_stop(send_loop);

    //Save config
#if 0
    gqq_config_save(cfg);
    qq_finalize(info, NULL);
#endif
    return 0;
}