main.c
/*
 * This functions called every time when somthing
 * changes on the field. It refreshs information
 * about current field state. Else it called
 * every time when a button pressed. Structure
 * DisplayField contains a pointer to this function
 * and so we can call it everywhere where we have
 * access to some DisplayField structure in order to
 * inform player about a changes.
 */
This functions called every time when somthing
changes on the field. It refreshs information
about current field state. Else it called
every time when a button pressed. Structure
DisplayField contains a pointer to this function
and so we can call it everywhere where we have
access to some DisplayField structure in order to
inform player about a changes.
This functions called every time when somthing changes on the field . It refreshs information about current field state . Else it called every time when a button pressed . Structure DisplayField contains a pointer to this function and so we can call it everywhere where we have access to some DisplayField structure in order to inform player about a changes .
void field_change_status_handler(GObject *widget,
                                 MinesField *mf)
{
	char string[0x10];
	if (mf->is_fail)
		gtk_label_set_text(GTK_LABEL(widget), "FAIL");
	if (mf->fully_opened) {
		gtk_label_set_text(GTK_LABEL(widget), "OPENED");
		if (set_predefined_time(&miner_config, &main_window))
			gtk_label_set_text(GTK_LABEL(widget), "RECORD!");
	}
	if (mf->opened_count == 0)
		gtk_label_set_text(GTK_LABEL(widget), "READY");
	if (mf->opened_count > 0 && !mf->is_fail && !mf->fully_opened
	        && main_window.time.tv_sec == 0
	        && main_window.time.tv_usec == 0) {
		sprintf(string, "3BV: %3.3d", mf_get_3BV(mf));
		gtk_label_set_text(GTK_LABEL(main_window._3BV_widget), string);
		g_timeout_add(5, (GSourceFunc)timer_function, (gpointer)mf);
		g_timeout_add(40, (GSourceFunc)video_recorder_function, (gpointer)mf);
	}
	if (mf->opened_count > 0 && !mf->is_fail
	        && !mf->fully_opened) {
		sprintf(string, "M: %2.2d", mf->bombs - mf->marked_count);
		gtk_label_set_text(GTK_LABEL(main_window.mines_count_widget), string);
	}
}
void field_change_status_handler ( GObject * widget , MinesField * mf ) { char string [ 0x10 ] ; if ( mf -> is_fail ) gtk_label_set_text ( GTK_LABEL ( widget ) , " " ) ; if ( mf -> fully_opened ) { gtk_label_set_text ( GTK_LABEL ( widget ) , " " ) ; if ( set_predefined_time ( & miner_config , & main_window ) ) gtk_label_set_text ( GTK_LABEL ( widget ) , " " ) ; } if ( mf -> opened_count == 0 ) gtk_label_set_text ( GTK_LABEL ( widget ) , " " ) ; if ( mf -> opened_count > 0 && ! mf -> is_fail && ! mf -> fully_opened && main_window . time . tv_sec == 0 && main_window . time . tv_usec == 0 ) { sprintf ( string , " " , mf_get_3BV ( mf ) ) ; gtk_label_set_text ( GTK_LABEL ( main_window . _3BV_widget ) , string ) ; g_timeout_add ( 5 , ( GSourceFunc ) timer_function , ( gpointer ) mf ) ; g_timeout_add ( 40 , ( GSourceFunc ) video_recorder_function , ( gpointer ) mf ) ; } if ( mf -> opened_count > 0 && ! mf -> is_fail && ! mf -> fully_opened ) { sprintf ( string , " " , mf -> bombs - mf -> marked_count ) ; gtk_label_set_text ( GTK_LABEL ( main_window . mines_count_widget ) , string ) ; } }
This functions called every time when somthing
 changes on the field.
This functions called every time when somthing changes on the field .