static void unmark_balls (HWND hWnd)
{
    old_x = -1;
    old_y = -1;
    disable_timeout (hWnd);
    untag_all (hWnd);
}
예제 #2
0
파일: same-gnome.c 프로젝트: cstrahan/aduni
static void
mark_balls (int x, int y)
{
	if (x == old_x && y == old_y)
		return;
	old_x = x;
	old_y = y;

	untag_all ();
	disable_timeout ();
	if (!field [x][y].color)
		return;
	
	tagged_count = flood_fill (x, y, field [x][y].color);
	
	if (tagged_count > 1)
		ball_timeout_id = gtk_timeout_add (100, move_tagged_balls, 0);
}
static void mark_balls (HWND hwnd, int x, int y)
{
    if (x == old_x && y == old_y)
        return;

    old_x = x;
    old_y = y;

    untag_all (hwnd);
    disable_timeout (hwnd);
    if (!field [x][y].color)
        return;
    
    tagged_count = flood_fill (x, y, field [x][y].color);
    
    if (tagged_count > 1) {
        SetTimer (hwnd, ID_TIMER, 10); 
        ball_timeout_id = ID_TIMER;
    }
}
예제 #4
0
파일: same-gnome.c 프로젝트: cstrahan/aduni
static gint
area_event (GtkWidget *widget, GdkEvent *event, void *d)
{
	switch (event->type){
	case GDK_EXPOSE: {
		GdkEventExpose *e = (GdkEventExpose *) event;
		paint (&e->area);
		return TRUE;
	}
	
	case GDK_BUTTON_PRESS: {
		int x, y;
		gtk_widget_get_pointer (widget, &x, &y);
		kill_balls (x / STONE_SIZE, y / STONE_SIZE);
		old_x = -1;
		old_y = -1;
	}

	case GDK_ENTER_NOTIFY:
	case GDK_MOTION_NOTIFY: {
		int x, y;
		
		gtk_widget_get_pointer (widget, &x, &y);
		mark_balls (x / STONE_SIZE, y / STONE_SIZE);
		return TRUE;
	}
	
	case GDK_LEAVE_NOTIFY:
		old_x = -1;
		old_y = -1;
		disable_timeout ();
		untag_all ();
		return TRUE;

	default:
		return FALSE;
	}
}