<commit_before>/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/************************************************

  rbgtkrecentchooser.c -

  $Author: sakai $
  $Date: 2007/07/08 03:00:49 $

  Copyright (C) 2006 <NAME>
************************************************/

#include "global.h"

#if GTK_CHECK_VERSION(2,10,0)

#define _SELF(self) (GTK_RECENT_CHOOSER(RVAL2GOBJ(self)))

/* Defined as Properties 
void        gtk_recent_chooser_set_show_private
                                            (GtkRecentChooser *chooser,
                                             gboolean show_private);
gboolean    gtk_recent_chooser_get_show_private
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_not_found
                                            (GtkRecentChooser *chooser,
                                             gboolean show_not_found);
gboolean    gtk_recent_chooser_get_show_not_found
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_icons
                                            (GtkRecentChooser *chooser,
                                             gboolean show_icons);
gboolean    gtk_recent_chooser_get_show_icons
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_select_multiple
                                            (GtkRecentChooser *chooser,
                                             gboolean select_multiple);
gboolean    gtk_recent_chooser_get_select_multiple
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_local_only
                                            (GtkRecentChooser *chooser,
                                             gboolean local_only);
gboolean    gtk_recent_chooser_get_local_only
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_limit    (GtkRecentChooser *chooser,
                                             gint limit);
gint        gtk_recent_chooser_get_limit    (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_tips
                                            (GtkRecentChooser *chooser,
                                             gboolean show_tips);
gboolean    gtk_recent_chooser_get_show_tips
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_sort_type
                                            (GtkRecentChooser *chooser,
                                             GtkRecentSortType sort_type);
GtkRecentSortType gtk_recent_chooser_get_sort_type
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_filter   (GtkRecentChooser *chooser,
                                             GtkRecentFilter *filter);
GtkRecentFilter* gtk_recent_chooser_get_filter
                                            (GtkRecentChooser *chooser);

*/
static VALUE
rc_set_show_numbers(VALUE self, VALUE val)
{
    gtk_recent_chooser_set_show_numbers(_SELF(self), RVAL2CBOOL(val));
    return self;
}

static VALUE
rc_get_show_numbers(VALUE self)
{
    return CBOOL2RVAL(gtk_recent_chooser_get_show_numbers(_SELF(self)));
}

struct callback_arg
{
    VALUE callback;
    VALUE a, b;
};

static VALUE
invoke_callback(VALUE data)
{
    struct callback_arg *arg = (struct callback_arg *)data;
    return rb_funcall(arg->callback, id_call, 1, arg->a, arg->b);
}

static void
remove_callback_reference(callback)
    gpointer callback;
{
    G_CHILD_REMOVE(mGtk, (VALUE)callback);
}

static gint
sort_func(GtkRecentInfo *a, GtkRecentInfo *b, gpointer func)
{
    struct callback_arg arg;<commit_msg>* change to ANSI C style.<commit_after>/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/************************************************

  rbgtkrecentchooser.c -

  $Author: sakai $
  $Date: 2007/07/08 03:00:49 $

  Copyright (C) 2006 <NAME>
************************************************/

#include "global.h"

#if GTK_CHECK_VERSION(2,10,0)

#define _SELF(self) (GTK_RECENT_CHOOSER(RVAL2GOBJ(self)))

/* Defined as Properties 
void        gtk_recent_chooser_set_show_private
                                            (GtkRecentChooser *chooser,
                                             gboolean show_private);
gboolean    gtk_recent_chooser_get_show_private
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_not_found
                                            (GtkRecentChooser *chooser,
                                             gboolean show_not_found);
gboolean    gtk_recent_chooser_get_show_not_found
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_icons
                                            (GtkRecentChooser *chooser,
                                             gboolean show_icons);
gboolean    gtk_recent_chooser_get_show_icons
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_select_multiple
                                            (GtkRecentChooser *chooser,
                                             gboolean select_multiple);
gboolean    gtk_recent_chooser_get_select_multiple
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_local_only
                                            (GtkRecentChooser *chooser,
                                             gboolean local_only);
gboolean    gtk_recent_chooser_get_local_only
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_limit    (GtkRecentChooser *chooser,
                                             gint limit);
gint        gtk_recent_chooser_get_limit    (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_show_tips
                                            (GtkRecentChooser *chooser,
                                             gboolean show_tips);
gboolean    gtk_recent_chooser_get_show_tips
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_sort_type
                                            (GtkRecentChooser *chooser,
                                             GtkRecentSortType sort_type);
GtkRecentSortType gtk_recent_chooser_get_sort_type
                                            (GtkRecentChooser *chooser);
void        gtk_recent_chooser_set_filter   (GtkRecentChooser *chooser,
                                             GtkRecentFilter *filter);
GtkRecentFilter* gtk_recent_chooser_get_filter
                                            (GtkRecentChooser *chooser);

*/
static VALUE
rc_set_show_numbers(VALUE self, VALUE val)
{
    gtk_recent_chooser_set_show_numbers(_SELF(self), RVAL2CBOOL(val));
    return self;
}

static VALUE
rc_get_show_numbers(VALUE self)
{
    return CBOOL2RVAL(gtk_recent_chooser_get_show_numbers(_SELF(self)));
}

struct callback_arg
{
    VALUE callback;
    VALUE a, b;
};

static VALUE
invoke_callback(VALUE data)
{
    struct callback_arg *arg = (struct callback_arg *)data;
    return rb_funcall(arg->callback, id_call, 1, arg->a, arg->b);
}

static void
remove_callback_reference(gpointer callback)
{
    G_CHILD_REMOVE(mGtk, (VALUE)callback);
}

static gint
sort_func(GtkRecentInfo *a, GtkRecentInfo *b, gpointer func)
{
    struct callback_arg arg;
{'fraction_non_alphanumeric': 0.08285036880927292, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 1.6382904794996525, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 96, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4493108', 'n_tokens_mistral': 2151, 'n_tokens_neox': 1927, 'n_words': 347}