2021-03-11 03:10:13 -08:00
|
|
|
#ifndef __EVISUM_UI_H__
|
|
|
|
#define __EVISUM_UI_H__
|
2018-06-04 03:11:21 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
2020-04-23 04:28:07 -07:00
|
|
|
#include "gettext.h"
|
2020-11-09 06:28:55 -08:00
|
|
|
|
|
|
|
#include "evisum_actions.h"
|
|
|
|
|
2020-06-28 12:02:07 -07:00
|
|
|
#include "system/machine.h"
|
2020-05-12 16:51:30 -07:00
|
|
|
#include "system/process.h"
|
2020-06-21 06:03:39 -07:00
|
|
|
#include "ui/ui_util.h"
|
2020-05-18 04:16:35 -07:00
|
|
|
#include "ui/ui_cache.h"
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2020-04-23 04:28:07 -07:00
|
|
|
#define _(STR) gettext(STR)
|
|
|
|
|
2021-03-28 02:09:51 -07:00
|
|
|
#define EVISUM_WIN_WIDTH 900
|
2020-06-28 12:04:03 -07:00
|
|
|
#define EVISUM_WIN_HEIGHT 600
|
2019-08-24 08:28:56 -07:00
|
|
|
|
2021-03-11 03:10:13 -08:00
|
|
|
typedef struct _Evisum_Ui
|
2018-06-04 03:11:21 -07:00
|
|
|
{
|
2020-12-24 02:16:19 -08:00
|
|
|
pid_t program_pid;
|
|
|
|
Ecore_Event_Handler *handler_sig;
|
2021-03-31 07:05:07 -07:00
|
|
|
Ecore_Thread *background_poll_thread;
|
2020-06-02 05:19:08 -07:00
|
|
|
|
2021-03-12 08:59:27 -08:00
|
|
|
Eina_Bool effects;
|
|
|
|
|
2021-03-31 03:35:07 -07:00
|
|
|
double cpu_usage;
|
|
|
|
uint64_t mem_total;
|
|
|
|
uint64_t mem_used;
|
2021-04-01 03:10:28 -07:00
|
|
|
Eina_List *batteries;
|
|
|
|
Eina_Bool have_power;
|
2021-03-31 03:35:07 -07:00
|
|
|
|
2021-03-30 22:40:59 -07:00
|
|
|
Eina_Bool kthreads_has_rss;
|
2020-11-09 06:28:55 -08:00
|
|
|
struct
|
|
|
|
{
|
2020-12-30 03:51:59 -08:00
|
|
|
Evas_Object *win;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
|
|
|
|
2021-01-22 01:46:55 -08:00
|
|
|
Eina_Bool has_kthreads;
|
2021-03-20 03:05:13 -07:00
|
|
|
Eina_Bool has_wchan;
|
2021-01-22 01:46:55 -08:00
|
|
|
|
2020-12-30 03:51:59 -08:00
|
|
|
int poll_delay;
|
|
|
|
int sort_type;
|
2021-02-24 03:32:21 -08:00
|
|
|
unsigned int fields;
|
2020-12-30 03:51:59 -08:00
|
|
|
Eina_Bool sort_reverse;
|
|
|
|
Eina_Bool show_self;
|
|
|
|
Eina_Bool show_kthreads;
|
|
|
|
Eina_Bool show_user;
|
2021-01-20 00:49:00 -08:00
|
|
|
|
2021-02-09 11:10:03 -08:00
|
|
|
unsigned char alpha;
|
2021-03-11 12:41:47 -08:00
|
|
|
Eina_Bool transparent;
|
2021-01-20 00:49:00 -08:00
|
|
|
Eina_Bool show_scroller;
|
2021-10-12 01:57:20 -07:00
|
|
|
Eina_Bool show_statusbar;
|
2020-12-28 12:20:15 -08:00
|
|
|
} proc;
|
|
|
|
|
2020-11-09 06:28:55 -08:00
|
|
|
Evas_Object *win_about;
|
2020-10-03 07:44:32 -07:00
|
|
|
|
2020-10-03 03:35:36 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Object *win;
|
2020-11-10 04:14:17 -08:00
|
|
|
int width;
|
|
|
|
int height;
|
2020-12-30 03:51:59 -08:00
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
2020-10-03 03:35:36 -07:00
|
|
|
} cpu;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2020-12-15 09:23:32 -08:00
|
|
|
Evas_Object *win;
|
|
|
|
int width;
|
|
|
|
int height;
|
2020-12-30 03:51:59 -08:00
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
2020-12-15 09:23:32 -08:00
|
|
|
Eina_Bool zfs_mounted;
|
2020-10-03 03:35:36 -07:00
|
|
|
} mem;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2020-12-30 03:51:59 -08:00
|
|
|
Evas_Object *win;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
2020-10-03 03:35:36 -07:00
|
|
|
} disk;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2020-12-22 05:47:41 -08:00
|
|
|
Evas_Object *win;
|
|
|
|
int width;
|
|
|
|
int height;
|
2020-12-30 03:51:59 -08:00
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
2020-10-05 08:11:26 -07:00
|
|
|
} sensors;
|
2021-03-10 04:51:21 -08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int x, y;
|
|
|
|
Eina_Bool restart;
|
|
|
|
} network;
|
2021-03-11 03:10:13 -08:00
|
|
|
} Evisum_Ui;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2021-04-01 03:10:28 -07:00
|
|
|
typedef struct _Battery
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
double usage;
|
|
|
|
char model[256];
|
|
|
|
char vendor[256];
|
|
|
|
Evas_Object *pb;
|
|
|
|
} Battery;
|
|
|
|
|
2021-03-11 03:10:13 -08:00
|
|
|
Evisum_Ui *
|
2020-10-26 18:33:20 -07:00
|
|
|
evisum_ui_init(void);
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2020-06-30 05:05:35 -07:00
|
|
|
void
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_shutdown(Evisum_Ui *ui);
|
2018-06-16 13:31:49 -07:00
|
|
|
|
2020-12-31 14:58:25 -08:00
|
|
|
Evas_Object *
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_main_menu_create(Evisum_Ui *ui, Evas_Object *parent, Evas_Object *obj);
|
2020-11-09 05:40:00 -08:00
|
|
|
|
2020-10-26 18:33:20 -07:00
|
|
|
void
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_activate(Evisum_Ui *ui, Evisum_Action action, int pid);
|
2020-10-26 18:33:20 -07:00
|
|
|
|
2020-10-29 06:26:31 -07:00
|
|
|
const char *
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_icon_cache_find(Evisum_Ui *ui, const char *cmd);
|
2020-10-29 06:26:31 -07:00
|
|
|
|
2020-11-09 05:40:00 -08:00
|
|
|
void
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_config_load(Evisum_Ui *ui);
|
2020-11-09 05:40:00 -08:00
|
|
|
|
|
|
|
void
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_config_save(Evisum_Ui *ui);
|
2020-11-09 05:40:00 -08:00
|
|
|
|
2020-12-30 03:51:59 -08:00
|
|
|
void
|
2021-03-11 03:10:13 -08:00
|
|
|
evisum_ui_restart(Evisum_Ui *ui);
|
2020-12-30 03:51:59 -08:00
|
|
|
|
2021-03-12 08:59:27 -08:00
|
|
|
Eina_Bool
|
|
|
|
evisum_ui_effects_enabled_get(Evisum_Ui *ui);
|
|
|
|
|
|
|
|
void
|
|
|
|
evisum_ui_effects_enabled_set(Evisum_Ui *ui, Eina_Bool enabled);
|
|
|
|
|
2018-06-04 03:11:21 -07:00
|
|
|
#endif
|