File: cheese-test-flash.c

package info (click to toggle)
cheese 44.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,312 kB
  • sloc: ansic: 6,621; xml: 293; sh: 183; python: 55; makefile: 21
file content (42 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdlib.h>
#include <gtk/gtk.h>
#include "cheese-flash.h"

static gboolean
delete_callback (GtkWidget *window,
                 GdkEvent  *event,
                 gpointer   data)
{
  gtk_widget_destroy (window);
  gtk_main_quit ();
  return FALSE;
}

static void
button_clicked (GtkButton *button,
		CheeseFlash *flash)
{
	cheese_flash_fire (flash);
}

int main (int argc, char **argv)
{
	GtkWidget *window, *button;
	CheeseFlash *flash;

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (window), "delete-event",
			G_CALLBACK (delete_callback), NULL);
	flash = cheese_flash_new (window);
	button = gtk_button_new_with_label ("Fire flash");
	g_signal_connect (G_OBJECT (button), "clicked",
			  G_CALLBACK (button_clicked), flash);
	gtk_container_add (GTK_CONTAINER (window), button);
	gtk_widget_show_all (window);

	gtk_main ();

	return EXIT_SUCCESS;
}