int main (int argc, char **argv) { GtkWidget *window; pixman_image_t *image; app_t *app; gtk_init (&argc, &argv); if (argc < 2) { printf ("%s <image file>\n", argv[0]); return -1; } if (!(image = pixman_image_from_file (argv[1], PIXMAN_a8r8g8b8))) { printf ("Could not load image \"%s\"\n", argv[1]); return -1; } app = app_new (image); window = get_widget (app, "main"); g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL); gtk_window_set_default_size (GTK_WINDOW (window), 1024, 768); gtk_widget_show_all (window); gtk_main (); return 0; }
static void on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { GError *error; guint registration_id; _global_app = app_new (connection); error = NULL; registration_id = g_dbus_connection_register_object (connection, "/org/gnome/Shell/CalendarServer", introspection_data->interfaces[0], &interface_vtable, _global_app, NULL, /* user_data_free_func */ &error); if (registration_id == 0) { g_printerr ("Error exporting object: %s (%s %d)", error->message, g_quark_to_string (error->domain), error->code); g_error_free (error); _exit (1); } print_debug ("Connected to the session bus"); }
gint main (gint argc, gchar** argv) { App* app; g_thread_init (NULL); gtk_init (&argc, &argv); app = app_new (); if (!parse_options (app, &argc, &argv)) { goto beach; } app_create_ui (app); /* g_timeout_add_seconds (5, (GSourceFunc) app_fetch_feed, app); */ g_idle_add ((GSourceFunc) app_fetch_feed, (gpointer) app); gtk_main (); beach: app_free (app); return 0; }
int main (int argc, char *argv[]) { App *app; gint ret; if (!video_output_init (&argc, argv, g_options)) g_error ("failed to initialize video output subsystem"); app = app_new (); if (!app) g_error ("failed to create application context"); ret = !app_run (app, argc, argv); app_free (app); g_free (g_codec_str); video_output_exit (); return ret; }
int main(int argc, char *argv[]) { App *app; int ret = EXIT_FAILURE; if (argc == 1) { print_help(argv[0]); return EXIT_SUCCESS; } app = app_new(); if (!app || !app_parse_options(app, argc, argv) || !app_run(app)) goto cleanup; ret = EXIT_SUCCESS; cleanup: app_free(app); return ret; }
int mpm_app_new2(char *name, int appid) { int i; for (i = 0; i < APPNUM; ++i) { if (0 == apparray[i].dlhandle) { break; } } // DANGEROUS printf("mpm_app_new2 %d %s\n", i, name); apparray[i].id = appid; if (0 == app_new(&apparray[i], name)) { return 0; } else { return 1; } }
int main (int argc, char *argv[]) { App *app; int ret = EXIT_FAILURE; gchar *input_fn; if (!parse_options (&argc, argv)) return EXIT_FAILURE; /* @TODO: iterate all the input files */ input_fn = g_input_files ? g_input_files[0] : NULL; if (input_fn && !g_file_test (input_fn, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) { g_warning ("input file \"%s\" doesn't exist", input_fn); goto bail; } app = app_new (input_fn, g_output_file_name); if (!app) goto bail; print_yuv_info (app); ret = app_run (app); print_num_frame (app); app_free (app); bail: g_free (g_codec_str); g_free (g_output_file_name); g_strfreev (g_input_files); gst_deinit (); return ret; }