<commit_before>#include <stdlib.h>
#include <stdarg.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_gfxPrimitives.h>
#include <sqlite3.h>

#define SCREEN_WIDTH                    320
#define SCREEN_HEIGHT                   240
#define SCREEN_BPP                      24
#define MENU_PADDING                    24
#define MENU_ROWHEIGHT                  24
#define MENUITEM_FLAG_NORMAL            0
#define MENUITEM_FLAG_BLOCKED           1
#define MENUITEM_FLAG_SELECTED          2
#define TEXT_XPADDING                   12
#define TEXT_YPADDING                   4

struct box
{

    unsigned int x;
    unsigned int y;
    unsigned int w;
    unsigned int h;

};

struct text
{

    char *content;

};

struct menuitem
{

    struct text text;
    unsigned int id;
    unsigned int type;

};

struct menu
{

    unsigned int parentmenu;
    struct menuitem *items;
    unsigned int total;
    unsigned int currentitem;
    struct box box;

};

struct view
{

    void (*init)();
    void (*destroy)();
    void (*render)();
    void (*handlekey)(unsigned int id);
    void (*handleevent)(unsigned int id);

};

SDL_Surface *display;
SDL_Surface *background;
SDL_Surface *blur;
TTF_Font *font;
unsigned int currentstate = 1;

struct menuitem front_menuitems[32] = {
    {{"Apps"}, 1, MENUITEM_FLAG_NORMAL | MENUITEM_FLAG_SELECTED},
    {{"Browse"}, 2, MENUITEM_FLAG_NORMAL},
    {{"Downloads"}, 0, MENUITEM_FLAG_BLOCKED},
    {{"Exit"}, 8, MENUITEM_FLAG_NORMAL}
};

struct menu frontmenu = {0, front_menuitems, 4, 0, {0, 96, 320, 144}};
struct menu appsmenu = {0, 0, 0, 0, {0, 0, 320, 240}};
struct menu browsemenu = {0, 0, 0, 0, {0, 0, 320, 240}};
struct view front;
struct view apps;
struct view browse;
struct view *currentview;

void changestate(unsigned int state)
{

    currentstate = state;

}

void showview(struct view *view)
{

    if (currentview && currentview->destroy)
        currentview->destroy();

    currentview = view;

    if (currentview && currentview->init)
        currentview->init();

}

void menu_setrow(struct menu *menu, unsigned int index)
{
<commit_msg>more work<commit_after>#include <stdlib.h>
#include <stdarg.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_gfxPrimitives.h>
#include <sqlite3.h>

#define SCREEN_WIDTH                    320
#define SCREEN_HEIGHT                   240
#define SCREEN_BPP                      24
#define MENU_PADDING                    24
#define MENU_ROWHEIGHT                  24
#define MENUITEM_FLAG_NORMAL            0
#define MENUITEM_FLAG_BLOCKED           1
#define MENUITEM_FLAG_SELECTED          2
#define TEXT_XPADDING                   12
#define TEXT_YPADDING                   4

struct box
{

    unsigned int x;
    unsigned int y;
    unsigned int w;
    unsigned int h;

};

struct text
{

    char *content;

};

struct menuitem
{

    struct text text;
    unsigned int id;
    unsigned int type;

};

struct menu
{

    struct menuitem *items;
    unsigned int total;
    unsigned int currentitem;
    struct box box;

};

struct view
{

    void (*init)();
    void (*destroy)();
    void (*render)();
    void (*handlekey)(unsigned int id);
    void (*handleevent)(unsigned int id);

};

SDL_Surface *display;
SDL_Surface *background;
SDL_Surface *blur;
TTF_Font *font;
unsigned int currentstate = 1;

struct menuitem front_menuitems[32] = {
    {{"Apps"}, 1, MENUITEM_FLAG_NORMAL | MENUITEM_FLAG_SELECTED},
    {{"Browse"}, 2, MENUITEM_FLAG_NORMAL},
    {{"Downloads"}, 0, MENUITEM_FLAG_BLOCKED},
    {{"Exit"}, 8, MENUITEM_FLAG_NORMAL}
};

struct menu frontmenu = {front_menuitems, 4, 0, {0, 96, 320, 144}};
struct menu appsmenu = {0, 0, 0, {0, 0, 320, 240}};
struct menu browsemenu = {0, 0, 0, {0, 0, 320, 240}};
struct view front;
struct view apps;
struct view browse;
struct view *currentview;

void changestate(unsigned int state)
{

    currentstate = state;

}

void showview(struct view *view)
{

    if (currentview && currentview->destroy)
        currentview->destroy();

    currentview = view;

    if (currentview && currentview->init)
        currentview->init();

}

void menu_setrow(struct menu *menu, unsigned int index)
{

{'fraction_non_alphanumeric': 0.1130558183538316, 'fraction_numerical': 0.028618732261116366, 'mean_word_length': 2.8306159420289854, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3880710', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1438, 'n_words': 407}