#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#include <getopt.h>
#include <libublsettings.h>
#include <libublsettings-gtk3.h>
#include <libublsettingsui-gtk3.h>
// #define WEBKIT_INCLUDE
#ifdef WEBKIT_INCLUDE
    #include <webkit2/webkit2.h>
#endif 
#include "ubl-strings.h"

#define _(String) gettext(String)

#define glade_path "/com/ublinux/ui/ubl-panel-ubmanager.glade"
#define CssPath "/com/ublinux/css/ubl-panel-ubmanager.css"
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
#define icon_path "com.ublinux.ubl-panel-ubmanager"

#define LocaleName "ubl-panel-ubmanager"

#define LocalePath "/usr/share/locale"

#define ConnectionAdress "http://localhost:9090/"

typedef char* string;

__attribute__((unused)) static \
string version_application;

typedef struct {
    template_config_fields
    int save_config;
    config_str launch_arguments;
    int launch_size;
} config;

extern config main_config;

typedef struct {
    template_window_fields;
    GtkWidget *WebView;
    GtkWidget *BrowserButton;
} main_window;


typedef struct {
    GtkWidget *Window;

    GtkWidget *HatText;
    GtkWidget *HeaderText;
    GtkWidget *InfoText;
    GtkWidget *AlwaysOpenCheck;

    GtkWidget *CloseButton;
    GtkWidget *AcceptButton;
} documentation_confirmation_window;


#ifdef WEBKIT_INCLUDE
    void on_browser(GtkWidget* self);
    void on_browser_failed(GtkWidget* self,  WebKitLoadEvent ,  gchar* ,  GError* error, main_window *widgets);
    main_window *yon_main_window_complete(main_window *widgets);
#endif 