コード例 #1
0
ファイル: json.c プロジェクト: GNOME/gegl
static void
json_op_class_init (gpointer klass, gpointer class_data)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
  JsonOpClass *json_op_class = (JsonOpClass *) (klass);
  const gchar *description;
  gchar *name;

  json_op_class->json_root = (JsonObject *) (class_data);

  object_class->set_property = set_property;
  object_class->get_property = get_property;
  object_class->constructor  = constructor;
  object_class->finalize = finalize;

  operation_class->attach = attach;

  json_op_class->properties = g_hash_table_new_full(g_direct_hash, g_direct_equal,
                                                    NULL, (GDestroyNotify)property_target_free);
  install_properties(json_op_class);

  description = metadata_get_property(json_op_class->json_root, "description");
  name = component2geglop(metadata_get_property(json_op_class->json_root, "name"));

  gegl_operation_class_set_keys (operation_class,
    "name",        (name) ? name : g_strdup_printf("json:%s", G_OBJECT_CLASS_NAME(object_class)),
    "categories",  "meta:json",
    "description",  (description) ? description : "",
    NULL);

  g_free(name);
}
コード例 #2
0
ファイル: xmrplayer.c プロジェクト: Juson/xmradio
static void 
xmr_player_class_init(XmrPlayerClass *klass)
{
	GObjectClass *object_class = G_OBJECT_CLASS(klass);

	object_class->get_property = xmr_player_get_property;
	object_class->set_property = xmr_player_set_property;
	object_class->dispose = xmr_player_dispose;

	init_signals(klass);
	install_properties(klass);

	klass->open = xmr_player_open;
	klass->opened = xmr_player_opened;
	klass->close = xmr_player_close;
	klass->play = xmr_player_play;
	klass->pause = xmr_player_pause;
	klass->playing = xmr_player_playing;
	klass->set_volume = xmr_player_set_volume;
	klass->get_volume = xmr_player_get_volume;
	klass->set_time = xmr_player_set_time;
	klass->get_time = xmr_player_get_time;

	g_type_class_add_private(object_class, sizeof(XmrPlayerPrivate));
}
コード例 #3
0
static void
sn_item_class_init (SnItemClass *item_class)
{
    GObjectClass *object_class;
    GtkWidgetClass *widget_class;
    GtkButtonClass *button_class;

    object_class = G_OBJECT_CLASS (item_class);
    widget_class = GTK_WIDGET_CLASS (item_class);
    button_class = GTK_BUTTON_CLASS (item_class);

    object_class->dispose = sn_item_dispose;
    object_class->finalize = sn_item_finalize;
    object_class->get_property = sn_item_get_property;
    object_class->set_property = sn_item_set_property;

    widget_class->button_press_event = sn_item_button_press_event;
    widget_class->popup_menu = sn_item_popup_menu;
    widget_class->scroll_event = sn_item_scroll_event;

    button_class->clicked = sn_item_clicked;

    item_class->ready = sn_item_ready;

    install_properties (object_class);
    install_signals (item_class);
}
コード例 #4
0
CannaJRKanji::CannaJRKanji (CannaInstance *ci)
    : m_canna (ci),
      m_enabled (false),
      m_context_id (last_created_context_id++),
      m_preediting (false),
      m_aux_string_visible (false)
{
    char **warn = NULL, **p;

    if (m_canna->m_factory->m_on_off == "On") {
        m_enabled = true;
    } else if (m_canna->m_factory->m_on_off == "Off") {
        m_enabled = false;
    } else {
        m_enabled = false;
    }

    m_iconv.set_encoding ("EUC-JP");

    // initialize canna library
    if (n_instance == 0) {
        if (m_canna->m_factory->m_specify_init_file_name) {
            const char *file = m_canna->m_factory->m_init_file_name.c_str();
            jrKanjiControl (0, KC_SETINITFILENAME, (char *) file);
        }

        if (m_canna->m_factory->m_specify_server_name) {
            const char *server = m_canna->m_factory->m_server_name.c_str();
            jrKanjiControl (0, KC_SETSERVERNAME, (char *) server);
        }

        jrKanjiControl (0, KC_INITIALIZE, (char *) &warn);

        for (p = warn; warn && *p; p++) {
            // error
        }

        jrKanjiControl (0, KC_SETAPPNAME, "scim-canna");
    }

    // initialize canna context
    m_workbuf[0]       = '\0';
    m_ksv.ks           = &m_ks;
    m_ksv.buffer       = m_workbuf;
    m_ksv.bytes_buffer = CANNA_MAX_SIZE;
    m_ksv.val          = CANNA_MODE_HenkanMode;
    jrKanjiControl (m_context_id, KC_CHANGEMODE, (char *) &m_ksv);

    n_instance++;

    // set mode line
    install_properties ();
    set_mode_line ();
}