<commit_before>#define GE_IS_SCROLLED_WINDOW(object) ((object) && objectIsA((GObject*)(object), "GtkScrolledWindow"))

static void qtcScrolledWindowCleanup(GtkWidget *widget)
{
    if (widget && g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_DESTROY_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_UNREALIZE_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_STYLE_SET_ID"));
        if(ENTRY_MO)
        {
            g_signal_handler_disconnect(G_OBJECT(widget),
                                        (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_ENTER_ID"));
            g_signal_handler_disconnect(G_OBJECT(widget),
                                        (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_LEAVE_ID"));
        }
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_IN_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_OUT_ID"));
        g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET");
    }
}

static gboolean qtcScrolledWindowStyleSet(GtkWidget *widget, GtkStyle *previous_style, gpointer user_data)
{
    qtcScrolledWindowCleanup(widget);
    return FALSE;
}

static gboolean qtcScrolledWindowDestroy(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
    qtcScrolledWindowCleanup(widget);
    return FALSE;
}

static GtkWidget *qtcScrolledWindowFocus=NULL;
static GtkWidget *qtcScrolledWindowHover=NULL;

static qtcScrolledWindowHasFocus(GtkWidget *widget)
{
    return widget && (qtcWidgetHasFocus(widget) || widget==qtcScrolledWindowFocus);
}

static qtcScrolledWindowHovered(GtkWidget *widget)
{
    return widget && (GTK_STATE_PRELIGHT==qtcWidgetGetState(widget) || widget==qtcScrolledWindowHover);
}

static gboolean qtcScrolledWindowEnter(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowHover!=w)
    {
        qtcScrolledWindowHover=w;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowLeave(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowHover==w)
    {
        qtcScrolledWindowHover=NULL;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowFocusIn(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowFocus!=w)
    {
        qtcScrolledWindowFocus=w;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowFocusOut(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowFocus==w)
    {
        qtcScrolledWindowFocus=NULL;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static void qtcScrolledWindowSetupConnections(GtkWidget *widget, GtkWidget *parent)
{
    if (widget && !g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        gtk_widget_add_events(widget, GDK_LEAVE_NOTIFY_MASK|GDK_ENTER_NOTIFY_MASK|GDK_FOCUS_CHANGE_MASK);
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET", (gpointer)1);
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_DESTROY_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "destroy-event", G_CALLBACK(qtcScrolledWindowDestroy), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_UNREALIZE_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "unrealize", G_CALLBACK(qtcScrolledWindowDestroy), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_STYLE_SET_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "style-set", G_CALLBACK(qtcScrolledWindowStyleSet), parent));
        if(ENTRY_MO)
        {
            g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_ENTER_ID",
                              (gpointer)g_signal_connect(G_OBJECT(widget), "enter-notify-event", G_CALLBACK(qtcScrolledWindowEnter), parent));
            g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_LEAVE_ID",
                             (gpointer)g_signal_connect(G_OBJECT(widget), "leave-notify-event", G_CALLBACK(qtcScrolledWindowLeave), parent));
        }
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_IN_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "focus-in-event", G_CALLBACK(qtcScrolledWindowFocusIn), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_OUT_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "focus-out-event", G_CALLBACK(qtcScrolledWindowFocusOut), parent));

        if(parent && ENTRY_MO)
        {
            gint          x, y;
            GtkAllocation alloc=qtcWidgetGetAllocation(parent);

            gdk_window_get_pointer(qtcWidgetGetWindow(parent), &x, &y, 0L);
            if(x>=0 && x<alloc.width && y>=0 && y<alloc.height)
                qtcScrolledWindowHover=parent;
        }
    }
}

static void qtcScrolledWindowRegisterChild(GtkWidget *child)
{
    GtkWidget *parent=child ? qtcWidgetGetParent(child) : NULL;

    if(parent && GTK_IS_SCROLLED_WINDOW(parent) && g_object_get_data(G_OBJECT(parent), "QTC_SCROLLED_WINDOW_SET"))
        qtcScrolledWindowSetupConnections(child, parent);
}

static void qtcScrolledWindowSetup(GtkWidget *widget)
{
    if (widget && GTK_IS_SCROLLED_WINDOW(widget) && !g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        GtkScrolledWindow *scrolledWindow=GTK_SCROLLED_WINDOW(widget);
        GtkWidget         *child;

        if((child=gtk_scrolled_window_get_hscrollbar(scrolledWindow)))
            qtcScrolledWindowSetupConnections(child, widget);
        if((child=gtk_scrolled_window_get_vscrollbar(scrolledWindow)))
            qtcScrolledWindowSetupConnections(child, widget);
        if((child=gtk_bin_get_child(GTK_BIN(widget))))
        {
            if(GTK_IS_TREE_VIEW(child))<commit_msg>scrollview highlight for text and icon views<commit_after>#define GE_IS_SCROLLED_WINDOW(object) ((object) && objectIsA((GObject*)(object), "GtkScrolledWindow"))

static void qtcScrolledWindowCleanup(GtkWidget *widget)
{
    if (widget && g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_DESTROY_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_UNREALIZE_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_STYLE_SET_ID"));
        if(ENTRY_MO)
        {
            g_signal_handler_disconnect(G_OBJECT(widget),
                                        (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_ENTER_ID"));
            g_signal_handler_disconnect(G_OBJECT(widget),
                                        (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_LEAVE_ID"));
        }
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_IN_ID"));
        g_signal_handler_disconnect(G_OBJECT(widget),
                                    (gint)g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_OUT_ID"));
        g_object_steal_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET");
    }
}

static gboolean qtcScrolledWindowStyleSet(GtkWidget *widget, GtkStyle *previous_style, gpointer user_data)
{
    qtcScrolledWindowCleanup(widget);
    return FALSE;
}

static gboolean qtcScrolledWindowDestroy(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
    qtcScrolledWindowCleanup(widget);
    return FALSE;
}

static GtkWidget *qtcScrolledWindowFocus=NULL;
static GtkWidget *qtcScrolledWindowHover=NULL;

static qtcScrolledWindowHasFocus(GtkWidget *widget)
{
    return widget && (qtcWidgetHasFocus(widget) || widget==qtcScrolledWindowFocus);
}

static qtcScrolledWindowHovered(GtkWidget *widget)
{
    return widget && (GTK_STATE_PRELIGHT==qtcWidgetGetState(widget) || widget==qtcScrolledWindowHover);
}

static gboolean qtcScrolledWindowEnter(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowHover!=w)
    {
        qtcScrolledWindowHover=w;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowLeave(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowHover==w)
    {
        qtcScrolledWindowHover=NULL;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowFocusIn(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowFocus!=w)
    {
        qtcScrolledWindowFocus=w;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static gboolean qtcScrolledWindowFocusOut(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
{
    GtkWidget *w=user_data ? (GtkWidget *)user_data : widget;
    if(GE_IS_SCROLLED_WINDOW(w) && qtcScrolledWindowFocus==w)
    {
        qtcScrolledWindowFocus=NULL;
        gtk_widget_queue_draw(w);
    }
    return FALSE;
}

static void qtcScrolledWindowSetupConnections(GtkWidget *widget, GtkWidget *parent)
{
    if (widget && !g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        gtk_widget_add_events(widget, GDK_LEAVE_NOTIFY_MASK|GDK_ENTER_NOTIFY_MASK|GDK_FOCUS_CHANGE_MASK);
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET", (gpointer)1);
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_DESTROY_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "destroy-event", G_CALLBACK(qtcScrolledWindowDestroy), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_UNREALIZE_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "unrealize", G_CALLBACK(qtcScrolledWindowDestroy), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_STYLE_SET_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "style-set", G_CALLBACK(qtcScrolledWindowStyleSet), parent));
        if(ENTRY_MO)
        {
            g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_ENTER_ID",
                              (gpointer)g_signal_connect(G_OBJECT(widget), "enter-notify-event", G_CALLBACK(qtcScrolledWindowEnter), parent));
            g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_LEAVE_ID",
                             (gpointer)g_signal_connect(G_OBJECT(widget), "leave-notify-event", G_CALLBACK(qtcScrolledWindowLeave), parent));
        }
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_IN_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "focus-in-event", G_CALLBACK(qtcScrolledWindowFocusIn), parent));
        g_object_set_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_FOCUS_OUT_ID",
                          (gpointer)g_signal_connect(G_OBJECT(widget), "focus-out-event", G_CALLBACK(qtcScrolledWindowFocusOut), parent));

        if(parent && ENTRY_MO)
        {
            gint          x, y;
            GtkAllocation alloc=qtcWidgetGetAllocation(parent);

            gdk_window_get_pointer(qtcWidgetGetWindow(parent), &x, &y, 0L);
            if(x>=0 && x<alloc.width && y>=0 && y<alloc.height)
                qtcScrolledWindowHover=parent;
        }
    }
}

static void qtcScrolledWindowRegisterChild(GtkWidget *child)
{
    GtkWidget *parent=child ? qtcWidgetGetParent(child) : NULL;

    if(parent && GTK_IS_SCROLLED_WINDOW(parent) && g_object_get_data(G_OBJECT(parent), "QTC_SCROLLED_WINDOW_SET"))
        qtcScrolledWindowSetupConnections(child, parent);
}

static void qtcScrolledWindowSetup(GtkWidget *widget)
{
    if (widget && GTK_IS_SCROLLED_WINDOW(widget) && !g_object_get_data(G_OBJECT(widget), "QTC_SCROLLED_WINDOW_SET"))
    {
        GtkScrolledWindow *scrolledWindow=GTK_SCROLLED_WINDOW(widget);
        GtkWidget         *child;

        if((child=gtk_scrolled_window_get_hscrollbar(scrolledWindow)))
            qtcScrolledWindowSetupConnections(child, widget);
        if((child=gtk_scrolled_window_get_vscrollbar(scrolledWindow)))
            qtcScrolledWindowSetupConnections(child, widget);
        if((child=gtk_bin_get_child(GTK_BIN(widget))))
        {
            if(GTK_IS_TREE_VIEW(child) || GTK_IS_TEXT_VIEW(child) || GTK_IS_ICON_VIEW(child))
{'fraction_non_alphanumeric': 0.10018044027426921, 'fraction_numerical': 0.000577408877661494, 'mean_word_length': 3.8668774148226204, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083807', 'n_tokens_mistral': 4829, 'n_tokens_neox': 4820, 'n_words': 535}