Exemplo n.º 1
0
void
menus_remove (Gimp *gimp)
{
  g_return_if_fail (GIMP_IS_GIMP (gimp));

  gtk_accel_map_foreach (gimp, menus_remove_accels);
}
Exemplo n.º 2
0
static void
gtk_application_window_update_accels (GtkApplicationWindow *window)
{
    free_accel_closures (window);

    gtk_accel_map_foreach (window, add_accel_closure);
}
Exemplo n.º 3
0
static void
gtk_application_window_update_accels (GtkApplicationWindow *window)
{
  AccelData data;

  free_accel_closures (window);

  data.window = window;
  data.actions = G_ACTION_GROUP (window->priv->muxer);

  gtk_accel_map_foreach (&data, add_accel_closure);
}
Exemplo n.º 4
0
BseErrorType
bst_rc_dump (const gchar *file_name)
{
  SfiWStore *wstore;
  GValue *value;
  SfiRec *rec;
  gint fd;

  g_return_val_if_fail (file_name != NULL, BSE_ERROR_INTERNAL);

  sfi_make_dirname_path (file_name);
  fd = open (file_name,
	     O_WRONLY | O_CREAT | O_TRUNC, /* O_EXCL, */
	     0666);

  if (fd < 0)
    return errno == EEXIST ? BSE_ERROR_FILE_EXISTS : BSE_ERROR_IO;

  wstore = sfi_wstore_new ();

  sfi_wstore_printf (wstore, "; rc-file for BEAST v%s\n", BST_VERSION);

  /* store BstGConfig */
  sfi_wstore_puts (wstore, "\n; BstGConfig Dump\n");
  rec = bst_gconfig_to_rec (bst_gconfig_get_global ());
  value = sfi_value_rec (rec);
  sfi_wstore_put_param (wstore, value, bst_gconfig_pspec());
  sfi_value_free (value);
  sfi_rec_unref (rec);
  sfi_wstore_puts (wstore, "\n");

  /* store accelerator paths */
  sfi_wstore_puts (wstore, "\n; Gtk+ Accel Map Path Dump\n");
  sfi_wstore_puts (wstore, "(menu-accelerators ");
  sfi_wstore_push_level (wstore);
  gtk_accel_map_foreach (wstore, accel_map_print);
  sfi_wstore_break (wstore);	/* make sure this is no comment line */
  sfi_wstore_puts (wstore, ")\n");
  sfi_wstore_pop_level (wstore);

  /* flush buffers to file */
  sfi_wstore_flush_fd (wstore, fd);
  sfi_wstore_destroy (wstore);

  return close (fd) < 0 ? BSE_ERROR_IO : BSE_ERROR_NONE;
}
Exemplo n.º 5
0
/**
 * gtk_accel_map_save_fd:
 * @fd: a valid writable file descriptor
 *
 * Filedescriptor variant of gtk_accel_map_save().
 *
 * Note that the file descriptor will not be closed by this function.
 */
void
gtk_accel_map_save_fd (gint fd)
{
  GString *gstring;

  g_return_if_fail (fd >= 0);

  gstring = g_string_new ("; ");
  if (g_get_prgname ())
    g_string_append (gstring, g_get_prgname ());
  g_string_append (gstring, " GtkAccelMap rc-file         -*- scheme -*-\n");
  g_string_append (gstring, "; this file is an automated accelerator map dump\n");
  g_string_append (gstring, ";\n");

  write_all (fd, gstring->str, gstring->len);
  
  g_string_free (gstring, TRUE);

  gtk_accel_map_foreach (GINT_TO_POINTER (fd), accel_map_print);
}
Exemplo n.º 6
0
int
clip_GTK_ACCELMAPFOREACH(ClipMachine * ClipMachineMemory)
{
   C_widget *cwid = _fetch_cw_arg(ClipMachineMemory);

   ClipVar  *cfunc = _clip_spar(ClipMachineMemory, 2);

   C_var    *c = 0;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKARG2(2, PCODE_type_of_ClipVarType, CCODE_type_of_ClipVarType);

   c->ClipMachineMemory = ClipMachineMemory;
   c->cw = cwid;
   _clip_mclone(ClipMachineMemory, &c->cfunc, cfunc);
   gtk_accel_map_foreach(c, (GtkAccelMapForeach) _accel_map_foreach_func);

   return 0;
 err:
   return 1;
}