2014-12-01 14:54:17 -08:00
|
|
|
#ifndef _EDI_CONFIG_H_
|
|
|
|
# define _EDI_CONFIG_H_ 1
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
|
2015-05-16 01:56:39 -07:00
|
|
|
#include "Edi.h"
|
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-03-08 14:07:02 -07:00
|
|
|
extern int EDI_EVENT_CONFIG_CHANGED;
|
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
typedef struct _Edi_Config_Project Edi_Config_Project;
|
2015-02-07 08:37:36 -08:00
|
|
|
typedef struct _Edi_Config_Mime_Association Edi_Config_Mime_Association;
|
2014-12-01 14:54:17 -08:00
|
|
|
typedef struct _Edi_Config Edi_Config;
|
|
|
|
|
2015-05-16 01:56:39 -07:00
|
|
|
typedef struct _Edi_Project_Config Edi_Project_Config;
|
2015-05-18 08:32:46 -07:00
|
|
|
typedef struct _Edi_Project_Config_Tab Edi_Project_Config_Tab;
|
2015-05-16 01:56:39 -07:00
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
struct _Edi_Config_Project
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *path;
|
|
|
|
};
|
|
|
|
|
2015-02-07 08:37:36 -08:00
|
|
|
struct _Edi_Config_Mime_Association
|
2015-02-07 00:13:40 -08:00
|
|
|
{
|
|
|
|
const char *id;
|
|
|
|
const char *mime;
|
|
|
|
};
|
|
|
|
|
2015-05-16 01:56:39 -07:00
|
|
|
struct _Edi_Config
|
|
|
|
{
|
|
|
|
int version;
|
|
|
|
|
|
|
|
Eina_Bool autosave;
|
|
|
|
|
|
|
|
Eina_List *projects;
|
|
|
|
Eina_List *mime_assocs;
|
|
|
|
};
|
|
|
|
|
2015-05-18 08:32:46 -07:00
|
|
|
struct _Edi_Project_Config_Tab
|
|
|
|
{
|
|
|
|
const char *path;
|
|
|
|
Eina_Bool windowed;
|
|
|
|
};
|
|
|
|
|
2015-05-16 01:56:39 -07:00
|
|
|
struct _Edi_Project_Config
|
2014-12-01 14:54:17 -08:00
|
|
|
{
|
|
|
|
int version;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
} font;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eina_Bool translucent;
|
2014-12-03 15:52:12 -08:00
|
|
|
int width, height, bottomtab;
|
|
|
|
double leftsize, bottomsize;
|
|
|
|
Eina_Bool leftopen, bottomopen;
|
2015-03-14 06:10:38 -07:00
|
|
|
Eina_Bool show_whitespace;
|
2015-03-29 12:40:24 -07:00
|
|
|
unsigned int width_marker, tabstop;
|
2014-12-01 14:54:17 -08:00
|
|
|
} gui;
|
2015-05-18 08:32:46 -07:00
|
|
|
|
|
|
|
Eina_List *tabs;
|
2014-12-01 14:54:17 -08:00
|
|
|
};
|
|
|
|
|
2015-05-16 01:56:39 -07:00
|
|
|
extern Edi_Config *_edi_config;
|
|
|
|
extern Edi_Project_Config *_edi_project_config;
|
2014-12-01 14:54:17 -08:00
|
|
|
|
2015-05-18 08:32:46 -07:00
|
|
|
// General configuration management
|
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
Eina_Bool _edi_config_init(void);
|
|
|
|
Eina_Bool _edi_config_shutdown(void);
|
2015-05-18 08:32:46 -07:00
|
|
|
|
|
|
|
// Global configuration handling
|
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
void _edi_config_load(void);
|
|
|
|
void _edi_config_save(void);
|
|
|
|
|
|
|
|
void _edi_config_project_add(const char *path);
|
2015-01-15 15:13:14 -08:00
|
|
|
void _edi_config_project_remove(const char *path);
|
2014-12-01 14:54:17 -08:00
|
|
|
|
2015-02-07 00:13:40 -08:00
|
|
|
void _edi_config_mime_add(const char *mime, const char* id);
|
|
|
|
const char* _edi_config_mime_search(const char *mime);
|
|
|
|
|
2015-05-18 08:32:46 -07:00
|
|
|
// Project based configuration handling
|
|
|
|
|
|
|
|
void _edi_project_config_load(void);
|
|
|
|
void _edi_project_config_save(void);
|
|
|
|
|
|
|
|
void _edi_project_config_tab_add(const char *path, Eina_Bool windowed);
|
|
|
|
void _edi_project_config_tab_remove(const char *path);
|
|
|
|
|
2014-12-01 14:54:17 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _EDI_CONFIG_H_ */
|