// dirwin_core.h  - core non-gui types and functions for Flan
#ifndef __dirwin_core_h
#define __dirwin_core_h

#include <Fl/Fl_Box.h>

// The class Fl_DND_Box is based on an article "Initiating Drag and Drop by Example" 
// by "alvin" on the FLTK.org website, which carries a general copyright
// "1998-2008 by Bill Spitzak and others"
class Fl_DND_Box : public Fl_Box
{
    public:
        static void callback_deferred(void *v);
        Fl_DND_Box(int X, int Y, int W, int H, const char *L = 0);
        virtual ~Fl_DND_Box();
        int event();
        const char* event_text();
        int event_length();
        int handle(int e);

    protected:
        // The event which caused Fl_DND_Box to execute its callback
        int evt;
        char *evt_txt;
        int evt_len;
};

class File_Detail_List_Browser : public Fl_Multi_Browser {
    protected:
    void draw(void); 

    public:
    int handle(int e);
    int dragx;
    int dragy;
    int dragging;
    int partitioning;
    int list_item_height;
    File_Detail_List_Browser(int x, int y, int w, int h, const char* label_text);
    //int num_selected(void);
    //long long size_selected(void);
    void record_item_height(void);
};


void scan_for_access_points(void);

void populate_net_list(void);

void load_configuration(void);

void save_configuration(void);

void configure_colors(void);

void handle_gui_event(Fl_Widget* w, void* data);

void pre_gui_setup(int argc, char** argv);
void gui_setup(void);
void gui_init(void);

void dnd_cb(Fl_Widget *o, void *v);

#endif
