Ejemplo n.º 1
0
static gboolean
window_state_event_cb (GtkWidget *widget,
                       GdkEventWindowState *event,
                       WindowState *state)
{
  _games_debug_print (GAMES_DEBUG_WINDOW_STATE,
                      "[window %p] state event, mask:%x new-state:%x current state: is-maximised:%s is-fullscreen:%s\n",
                      state->window,
                      event->changed_mask, event->new_window_state,
                      state->is_maximised ? "t" : "f",
                      state->is_fullscreen ? "t" : "f");

  if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
    state->is_maximised = (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
    games_conf_set_boolean (state->group, window_state_key_name[STATE_KEY_MAXIMISED], state->is_maximised);
  }
  if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) {
    state->is_fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
    games_conf_set_boolean (state->group, window_state_key_name[STATE_KEY_FULLSCREEN], state->is_fullscreen);
  }

  _games_debug_print (GAMES_DEBUG_WINDOW_STATE,
                      "  > new state: is-maximised:%s is-fullscreen:%s\n",
                      state->is_maximised ? "t" : "f",
                      state->is_fullscreen ? "t" : "f");


  return FALSE;
}
Ejemplo n.º 2
0
void
gnibbles_properties_set_worm_relative_movement (gint i, gboolean value)
{
  char key[64];
  g_snprintf (key, sizeof (key), KEY_WORM_REL_MOVE, i);
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, key, value);
}
Ejemplo n.º 3
0
void Tetris::saveBgOptions ()
{
	gchar cbuffer[64];

	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_USE_BG_IMAGE, usebg);

	g_snprintf (cbuffer, sizeof (cbuffer), "#%04x%04x%04x",
		    bgcolour.red, bgcolour.green, bgcolour.blue);
	games_conf_set_string (KEY_OPTIONS_GROUP, KEY_BG_COLOUR, cbuffer);
}
Ejemplo n.º 4
0
void
Tetris::setTarget (GtkWidget *widget, void *data)
{
	Tetris *t;

	t = (Tetris *)data;

	t->useTarget = GTK_TOGGLE_BUTTON (widget)->active;

	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_USE_TARGET,
				t->useTarget);
}
Ejemplo n.º 5
0
void
conf_set_show_toolbar (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_SHOW_TOOLBAR, value);
}
Ejemplo n.º 6
0
void
conf_set_enable_sound (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_ENABLE_SOUND, value);
}
Ejemplo n.º 7
0
void
conf_set_use_super_safe_moves (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_SUPER_SAFE_MOVES, value);
}
Ejemplo n.º 8
0
void
gnibbles_properties_set_sound (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_SOUND, value);
}
Ejemplo n.º 9
0
void
gnibbles_properties_set_random (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_RANDOM, value);
}
Ejemplo n.º 10
0
void
gnibbles_properties_set_fakes (gboolean value)
{
  games_conf_set_boolean (KEY_PREFERENCES_GROUP, KEY_FAKES, value);
}
Ejemplo n.º 11
0
void
Tetris::setRotateCounterClockWise(GtkWidget *widget, void *d)
{
	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_ROTATE_COUNTER_CLOCKWISE,
				GTK_TOGGLE_BUTTON (widget)->active);
}
Ejemplo n.º 12
0
void
Tetris::setSelectionBlocks(GtkWidget *widget, void *d)
{
	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_RANDOM_BLOCK_COLORS,
				GTK_TOGGLE_BUTTON (widget)->active);
}
Ejemplo n.º 13
0
void
Tetris::setSelectionPreview(GtkWidget *widget, void *d)
{
	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_DO_PREVIEW,
				GTK_TOGGLE_BUTTON (widget)->active);
}
Ejemplo n.º 14
0
void
Tetris::setSound (GtkWidget *widget, gpointer data)
{
	games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_SOUND,
				GTK_TOGGLE_BUTTON (widget)->active);
}
Ejemplo n.º 15
0
static void
do_setup (GtkWidget * widget, gpointer data)
{
  const gchar  *type_name = NULL;
  int i;
  char **player_names;
  gsize n_player_names;

  NumberOfComputers =
    gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (ComputerSpinner));
  NumberOfHumans =
    gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (HumanSpinner));
    
  if (tmpDoDelay == -1)
    tmpDoDelay = DoDelay;
  else
    DoDelay = tmpDoDelay;

  DisplayComputerThoughts = tmpDisplayComputerThoughts;

  for (i = 0; i < MAX_NUMBER_OF_PLAYERS; i++) {
    if (players[i].name != _(DefaultPlayerNames[i]))
      g_free (players[i].name);
    players[i].name =
      g_strdup (gtk_entry_get_text (GTK_ENTRY (PlayerNames[i])));

    if (i < NumberOfPlayers)
      score_list_set_column_title (ScoreList, i + 1, players[i].name);
  }

  setupdialog_destroy (setupdialog, 1);

  n_player_names = MAX_NUMBER_OF_PLAYERS;
  player_names = g_newa (char *, n_player_names);
  for (i = 0; i < MAX_NUMBER_OF_PLAYERS; ++i) {
    player_names[i] = players[i].name;
  }

  games_conf_set_string_list (NULL, KEY_PLAYER_NAMES,
                              (const char * const *) player_names,
                              n_player_names);

  games_conf_set_integer (NULL, KEY_NUMBER_OF_COMPUTERS, NumberOfComputers);

  games_conf_set_integer (NULL, KEY_NUMBER_OF_HUMANS, NumberOfHumans);

  games_conf_set_boolean (NULL, KEY_DELAY_BETWEEN_ROLLS, DoDelay);

  type_name = game_type_name(NewGameType);
  if (type_name) {
    games_conf_set_string (NULL, KEY_GAME_TYPE, type_name);
  }

  games_conf_set_integer (NULL, KEY_NUMTRIALS, NUM_TRIALS);

  if (((NumberOfComputers != OriginalNumberOfComputers)
       || (NumberOfHumans != OriginalNumberOfHumans) 
       || (NewGameType != game_type))
      && !GameIsOver ())
    WarnNumPlayersChanged ();
}