Ejemplo n.º 1
0
int
main(int argc, char *argv[])
{
  if (uim_init() < 0) {
    fprintf(stderr, "uim_init() failed.\n");
    return -1;
  }

  if (uim_custom_enable()) {
    /* save custom variables into ~/.uim.d/customs/custom-*.scm */
    uim_custom_save();

    /*
      broadcast updated custom variables to every uim client processes
      via uim-helper-server
    */
  } else {
    fprintf(stderr, "uim_custom_enable() failed.\n");
    uim_quit();
    return -1;
  }

  uim_quit();

  return 0;
}
Ejemplo n.º 2
0
Archivo: gtk.c Proyecto: NgoHuy/uim
static void
apply_button_clicked(GtkButton *button, gpointer user_data)
{
  /*const char *group_name = user_data;*/

  if (uim_pref_gtk_value_changed) {
    uim_custom_save();
    uim_custom_broadcast_reload_request();
    uim_pref_gtk_unmark_value_changed();
  }
}
Ejemplo n.º 3
0
int
main(int argc, char *argv[])
{
  if (uim_init() < 0) {
    fprintf(stderr, "uim_init() failed.\n");
    return -1;
  }

  if (uim_custom_enable()) {
    uim_bool succeeded;
    struct uim_custom *custom;

    custom = uim_custom_get("anthy-candidate-op-count");
    if (custom) {
      inspect_custom(custom);

      printf("\ntrying that modify the custom value to 100\n");
      custom->value->as_int = 100;  /* out of range */
      succeeded = uim_custom_set(custom);
      printf("succeeded = %s\n", succeeded ? "true" : "false");

      printf("\ncurrent status of struct uim_custom *custom\n");
      inspect_custom(custom);  /* shows 100 as value */
      uim_custom_free(custom);

      printf("\ncurrent status of real custom value\n");
      custom = uim_custom_get("anthy-candidate-op-count");
      inspect_custom(custom);  /* shows real value */

      printf("\ntrying that modify the custom value to 5\n");
      custom->value->as_int = 5;  /* valid */
      succeeded = uim_custom_set(custom);
      printf("succeeded = %s\n\n", succeeded ? "true" : "false");
      inspect_custom(custom);

      uim_custom_free(custom);
    }

    uim_custom_save();  /* save updated custom value into ~/.uim.d/customs/ */
  } else {
    fprintf(stderr, "uim_custom_enable() failed.\n");
    uim_quit();
    return -1;
  }

  uim_quit();

  return 0;
}
Ejemplo n.º 4
0
Archivo: qt4.cpp Proyecto: m8a/uim
void UimPrefDialog::slotApply()
{
    if( !m_isValueChanged )
        return;

#if defined(ENABLE_DEBUG)
    qDebug("start saving....");
#endif

    uim_custom_save();
    uim_custom_broadcast_reload_request();

    m_isValueChanged = false;
    m_applyButton->setEnabled( false );
}
Ejemplo n.º 5
0
Archivo: gtk.c Proyecto: NgoHuy/uim
static void
save_confirm_dialog_response_cb(GtkDialog *dialog, gint arg, gpointer user_data)
{
  switch (arg)
  {
  case GTK_RESPONSE_YES:
    uim_custom_save();
    uim_custom_broadcast();
    uim_pref_gtk_value_changed = FALSE;
    break;
  case GTK_RESPONSE_NO:
    uim_pref_gtk_value_changed = FALSE;
    break;
  default:
    break;
  }
}