<commit_before>/* Color Selector
 *
 * GtkColorSelection lets the user choose a color. GtkColorSelectionDialog is
 * a prebuilt dialog containing a GtkColorSelection.
 *
 */

#include <gtk/gtk.h>

static GtkWidget *window = NULL;
static GtkWidget *da;
static GdkColor color;
static GtkWidget *frame;

/* Expose callback for the drawing area
 */
static gboolean
expose_event_callback (GtkWidget      *widget, 
                       GdkEventExpose *event, 
                       gpointer        data)
{
  if (widget->window)
    {
      GtkStyle *style;

      style = gtk_widget_get_style (widget);

      gdk_draw_rectangle (widget->window,
                          style->bg_gc[GTK_STATE_NORMAL],
                          TRUE,
                          event->area.x, event->area.y,
                          event->area.width, event->area.height);
    }

  return TRUE;
}

static void
change_color_callback (GtkWidget *button,
		       gpointer	  data)
{
  GtkWidget *dialog;
  GtkColorSelection *colorsel;
  GtkColorSelectionDialog *selection_dialog;
  gint response;<commit_msg>gtk-demo: Convert color selection example to Cairo<commit_after>/* Color Selector
 *
 * GtkColorSelection lets the user choose a color. GtkColorSelectionDialog is
 * a prebuilt dialog containing a GtkColorSelection.
 *
 */

#include <gtk/gtk.h>

static GtkWidget *window = NULL;
static GtkWidget *da;
static GdkColor color;
static GtkWidget *frame;

/* Expose callback for the drawing area
 */
static gboolean
expose_event_callback (GtkWidget      *widget, 
                       GdkEventExpose *event, 
                       gpointer        data)
{
  if (widget->window)
    {
      GtkStyle *style;
      cairo_t *cr;

      style = gtk_widget_get_style (widget);

      cr = gdk_cairo_create (widget->window);

      gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
      gdk_cairo_rectangle (cr, &event->area);
      cairo_fill (cr);

      cairo_destroy (cr);
    }

  return TRUE;
}

static void
change_color_callback (GtkWidget *button,
		       gpointer	  data)
{
  GtkWidget *dialog;
  GtkColorSelection *colorsel;
  GtkColorSelectionDialog *selection_dialog;
  gint response;
{'fraction_non_alphanumeric': 0.08455210237659963, 'fraction_numerical': 0.0, 'mean_word_length': 2.570962479608483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2611340', 'n_tokens_mistral': 694, 'n_tokens_neox': 668, 'n_words': 172}