<commit_before>/*
 * IceWM
 *
 * Copyright (C) 1997-2001 <NAME>
 */
#include "config.h"

#ifndef LITE

#include "ylib.h"
#include "wmminiicon.h"

#include "wmframe.h"
#include "yxapp.h"
#include "yrect.h"
#include "yicon.h"
#include "prefs.h"

#include <string.h>

static ref<YFont> minimizedWindowFont;
static YColor *normalMinimizedWindowBg = 0;
static YColor *normalMinimizedWindowFg = 0;
static YColor *activeMinimizedWindowBg = 0;
static YColor *activeMinimizedWindowFg = 0;

MiniIcon::MiniIcon(YWindow *aParent, YFrameWindow *frame):
    YWindow(aParent, 0, xapp->depth(), xapp->visual(), xapp->colormap()) {
    if (minimizedWindowFont == null)
        minimizedWindowFont = YFont::getFont(XFA(minimizedWindowFontName));
    if (normalMinimizedWindowBg == 0)
        normalMinimizedWindowBg = new YColor(clrNormalMinimizedWindow);
    if (normalMinimizedWindowFg == 0)
        normalMinimizedWindowFg = new YColor(clrNormalMinimizedWindowText);
    if (activeMinimizedWindowBg == 0)
        activeMinimizedWindowBg = new YColor(clrActiveMinimizedWindow);
    if (activeMinimizedWindowFg == 0)
        activeMinimizedWindowFg = new YColor(clrActiveMinimizedWindowText);

    fFrame = frame;
    selected = 0;
    setGeometry(YRect(0, 0, 120, 24));
}

MiniIcon::~MiniIcon() {
}

void MiniIcon::paint(Graphics &g, const YRect &/*r*/) {
    bool focused = getFrame()->focused();
    YColor *bg = focused ? activeMinimizedWindowBg : normalMinimizedWindowBg;;
    YColor *fg = focused ? activeMinimizedWindowFg : normalMinimizedWindowFg;;<commit_msg>prevent disturbing flashing on miniicons<commit_after>/*
 * IceWM
 *
 * Copyright (C) 1997-2001 <NAME>
 */
#include "config.h"

#ifndef LITE

#include "ylib.h"
#include "wmminiicon.h"

#include "wmframe.h"
#include "yxapp.h"
#include "yrect.h"
#include "yicon.h"
#include "prefs.h"

#include <string.h>

static ref<YFont> minimizedWindowFont;
static YColor *normalMinimizedWindowBg = 0;
static YColor *normalMinimizedWindowFg = 0;
static YColor *activeMinimizedWindowBg = 0;
static YColor *activeMinimizedWindowFg = 0;

MiniIcon::MiniIcon(YWindow *aParent, YFrameWindow *frame):
    YWindow(aParent) {
    if (minimizedWindowFont == null)
        minimizedWindowFont = YFont::getFont(XFA(minimizedWindowFontName));
    if (normalMinimizedWindowBg == 0)
        normalMinimizedWindowBg = new YColor(clrNormalMinimizedWindow);
    if (normalMinimizedWindowFg == 0)
        normalMinimizedWindowFg = new YColor(clrNormalMinimizedWindowText);
    if (activeMinimizedWindowBg == 0)
        activeMinimizedWindowBg = new YColor(clrActiveMinimizedWindow);
    if (activeMinimizedWindowFg == 0)
        activeMinimizedWindowFg = new YColor(clrActiveMinimizedWindowText);

    fFrame = frame;
    selected = 0;
    setGeometry(YRect(0, 0, 120, 24));
}

MiniIcon::~MiniIcon() {
}

void MiniIcon::paint(Graphics &g, const YRect &/*r*/) {
    bool focused = getFrame()->focused();
    YColor *bg = focused ? activeMinimizedWindowBg : normalMinimizedWindowBg;;
    YColor *fg = focused ? activeMinimizedWindowFg : normalMinimizedWindowFg;;
{'fraction_non_alphanumeric': 0.11829704257393565, 'fraction_numerical': 0.015924601884952875, 'mean_word_length': 4.9192307692307695, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, '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': '2438286', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1068, 'n_words': 221}