Cpu in the shelf.
Removes gadman errors. Removed the graph until I get something better for this. Just displays text for now. Need to remove old module.cpu.cfg for this to work. SVN revision: 25216
This commit is contained in:
parent
c937dfab9e
commit
55c23fb67f
14
Makefile.am
14
Makefile.am
|
@ -1,6 +1,4 @@
|
||||||
MAINTAINERCLEANFILES = Makefile.in e_modules-cpu.spec
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
SUBDIRS = po
|
|
||||||
|
|
||||||
EDJE_CC = @edje_cc@
|
EDJE_CC = @edje_cc@
|
||||||
EDJE_FLAGS = -v \
|
EDJE_FLAGS = -v \
|
||||||
|
@ -16,9 +14,7 @@ EXTRA_DIST = $(files_DATA) \
|
||||||
cpu.edc \
|
cpu.edc \
|
||||||
VeraMono.ttf \
|
VeraMono.ttf \
|
||||||
cpu.png \
|
cpu.png \
|
||||||
module.eap \
|
module.eap
|
||||||
e_modules-cpu.spec \
|
|
||||||
e_modules-cpu.spec.in
|
|
||||||
|
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(datadir)
|
filesdir = $(datadir)
|
||||||
|
@ -32,11 +28,9 @@ INCLUDES = -I. \
|
||||||
pkgdir = $(datadir)/$(MODULE_ARCH)
|
pkgdir = $(datadir)/$(MODULE_ARCH)
|
||||||
pkg_LTLIBRARIES = module.la
|
pkg_LTLIBRARIES = module.la
|
||||||
module_la_SOURCES = e_mod_main.c \
|
module_la_SOURCES = e_mod_main.c \
|
||||||
e_mod_main.h \
|
e_mod_main.h
|
||||||
e_mod_config.c \
|
|
||||||
e_mod_config.h
|
|
||||||
|
|
||||||
module_la_LIBADD = @e_libs@ -lm
|
module_la_LIBADD = @e_libs@
|
||||||
module_la_LDFLAGS = -module -avoid-version
|
module_la_LDFLAGS = -module -avoid-version
|
||||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||||
|
|
||||||
|
|
13
autogen.sh
13
autogen.sh
|
@ -3,24 +3,11 @@
|
||||||
rm -rf autom4te.cache
|
rm -rf autom4te.cache
|
||||||
rm -f aclocal.m4 ltmain.sh
|
rm -f aclocal.m4 ltmain.sh
|
||||||
|
|
||||||
touch README
|
|
||||||
|
|
||||||
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
|
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
|
||||||
echo "Running autoheader..." ; autoheader || exit 1
|
echo "Running autoheader..." ; autoheader || exit 1
|
||||||
echo "Running autoconf..." ; autoconf || exit 1
|
echo "Running autoconf..." ; autoconf || exit 1
|
||||||
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
|
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
|
||||||
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
|
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
|
||||||
echo "Generating gettext cpu.pot template"; \
|
|
||||||
xgettext \
|
|
||||||
--output cpu.pot \
|
|
||||||
--output-dir=po \
|
|
||||||
--language=C \
|
|
||||||
--add-location \
|
|
||||||
--keyword=D_ \
|
|
||||||
--sort-by-file \
|
|
||||||
--copyright-holder="TODO" \
|
|
||||||
--foreign-user \
|
|
||||||
`find . -name "*.[ch]" -print` || exit 1
|
|
||||||
|
|
||||||
if [ -z "$NOCONFIGURE" ]; then
|
if [ -z "$NOCONFIGURE" ]; then
|
||||||
./configure "$@"
|
./configure "$@"
|
||||||
|
|
|
@ -17,12 +17,6 @@ AC_C_CONST
|
||||||
AM_ENABLE_SHARED
|
AM_ENABLE_SHARED
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
ALL_LINGUAS="bg eo fi it sv ja ru"
|
|
||||||
AC_SUBST(ALL_LINGUAS)
|
|
||||||
|
|
||||||
AM_GNU_GETTEXT([external])
|
|
||||||
AM_GNU_GETTEXT_VERSION(0.14)
|
|
||||||
|
|
||||||
MODULE_ARCH="$host_os-$host_cpu"
|
MODULE_ARCH="$host_os-$host_cpu"
|
||||||
AC_SUBST(MODULE_ARCH)
|
AC_SUBST(MODULE_ARCH)
|
||||||
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
|
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
|
||||||
|
@ -148,8 +142,6 @@ AC_SUBST(e_modules)
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_OUTPUT([
|
||||||
Makefile
|
Makefile
|
||||||
e_modules-cpu.spec
|
|
||||||
po/Makefile
|
|
||||||
],[
|
],[
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
72
cpu.edc
72
cpu.edc
|
@ -50,89 +50,41 @@ collections
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
part
|
part
|
||||||
{
|
{
|
||||||
name, "lines";
|
name: "load";
|
||||||
mouse_events, 0;
|
|
||||||
type, SWALLOW;
|
|
||||||
clip_to: "fade_clip";
|
|
||||||
description
|
|
||||||
{
|
|
||||||
state, "default" 0.0;
|
|
||||||
rel1
|
|
||||||
{
|
|
||||||
relative: 0.0 0.0;
|
|
||||||
}
|
|
||||||
rel2
|
|
||||||
{
|
|
||||||
relative: 1.0 1.0;
|
|
||||||
}
|
|
||||||
color, 0 0 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//close group net
|
|
||||||
|
|
||||||
group
|
|
||||||
{
|
|
||||||
name: "modules/cpu/text";
|
|
||||||
parts
|
|
||||||
{
|
|
||||||
part
|
|
||||||
{
|
|
||||||
name: "text_clip";
|
|
||||||
type: RECT;
|
|
||||||
mouse_events: 0;
|
|
||||||
description
|
|
||||||
{
|
|
||||||
state: "default" 0.0;
|
|
||||||
color: 255 255 255 255;
|
|
||||||
rel1
|
|
||||||
{
|
|
||||||
relative: 0.0 0.0;
|
|
||||||
offset: 0 0;
|
|
||||||
}
|
|
||||||
rel2
|
|
||||||
{
|
|
||||||
relative: 1.0 1.0;
|
|
||||||
offset: -1 -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
part
|
|
||||||
{
|
|
||||||
name: "in-text";
|
|
||||||
type: TEXT;
|
type: TEXT;
|
||||||
effect: SOFT_SHADOW;
|
effect: OUTLINE_SOFT_SHADOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
clip_to: "text_clip";
|
clip_to: "fade_clip";
|
||||||
description
|
description
|
||||||
{
|
{
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
align: 0.5 0.5;
|
align: 0.5 0.5;
|
||||||
rel1
|
rel1
|
||||||
{
|
{
|
||||||
relative: 0.5 0.5;
|
relative: 0.0 0.0;
|
||||||
|
to: "cpu";
|
||||||
}
|
}
|
||||||
rel2
|
rel2
|
||||||
{
|
{
|
||||||
relative: 0.5 0.5;
|
relative: 1.0 1.0;
|
||||||
|
to: "cpu";
|
||||||
}
|
}
|
||||||
color: 0 0 0 255;
|
color: 255 0 0 255;
|
||||||
color3: 255 255 255 100;
|
color2: 0 0 0 96;
|
||||||
|
color3: 0 0 0 32;
|
||||||
text
|
text
|
||||||
{
|
{
|
||||||
text: "";
|
text: "0%";
|
||||||
font: "VeraMono";
|
font: "VeraMono";
|
||||||
size: 10;
|
size: 10;
|
||||||
min: 1 1;
|
min: 1 1;
|
||||||
align: 0.5 0.5;
|
align: 0.5 0.5;
|
||||||
|
text_class: "module_large";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
115
e_mod_config.c
115
e_mod_config.c
|
@ -1,115 +0,0 @@
|
||||||
#include <e.h>
|
|
||||||
#include "e_mod_main.h"
|
|
||||||
#include "e_mod_config.h"
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
struct _E_Config_Dialog_Data
|
|
||||||
{
|
|
||||||
int check_interval;
|
|
||||||
int show_text;
|
|
||||||
int show_graph;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Protos */
|
|
||||||
static void *_create_data (E_Config_Dialog * cfd);
|
|
||||||
static void _free_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata);
|
|
||||||
static Evas_Object *_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
|
|
||||||
E_Config_Dialog_Data * cfdata);
|
|
||||||
static int _basic_apply_data (E_Config_Dialog * cfd,
|
|
||||||
E_Config_Dialog_Data * cfdata);
|
|
||||||
static void _fill_data (Cpu * c, E_Config_Dialog_Data * cfdata);
|
|
||||||
|
|
||||||
/* Config Calls */
|
|
||||||
void
|
|
||||||
_configure_cpu_module (E_Container * con, Cpu * c)
|
|
||||||
{
|
|
||||||
E_Config_Dialog *cfd;
|
|
||||||
E_Config_Dialog_View *v;
|
|
||||||
char buf[4096];
|
|
||||||
|
|
||||||
v = E_NEW (E_Config_Dialog_View, 1);
|
|
||||||
|
|
||||||
v->create_cfdata = _create_data;
|
|
||||||
v->free_cfdata = _free_data;
|
|
||||||
v->basic.apply_cfdata = _basic_apply_data;
|
|
||||||
v->basic.create_widgets = _basic_create_widgets;
|
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "%s/module.eap", e_module_dir_get (c->module));
|
|
||||||
cfd = e_config_dialog_new (con, D_ ("Cpu Configuration"), "CPU", "_e_modules_cpu_config_dialog", buf, 0, v, c);
|
|
||||||
c->cfd = cfd;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_fill_data (Cpu * c, E_Config_Dialog_Data * cfdata)
|
|
||||||
{
|
|
||||||
cfdata->check_interval = c->conf->check_interval;
|
|
||||||
cfdata->show_text = c->conf->show_text;
|
|
||||||
cfdata->show_graph = c->conf->show_graph;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *
|
|
||||||
_create_data (E_Config_Dialog * cfd)
|
|
||||||
{
|
|
||||||
E_Config_Dialog_Data *cfdata;
|
|
||||||
Cpu *c;
|
|
||||||
|
|
||||||
c = cfd->data;
|
|
||||||
cfdata = E_NEW (E_Config_Dialog_Data, 1);
|
|
||||||
|
|
||||||
_fill_data (c, cfdata);
|
|
||||||
return cfdata;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_free_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
|
|
||||||
{
|
|
||||||
Cpu *c;
|
|
||||||
|
|
||||||
c = cfd->data;
|
|
||||||
c->cfd = NULL;
|
|
||||||
free (cfdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Evas_Object *
|
|
||||||
_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
|
|
||||||
E_Config_Dialog_Data * cfdata)
|
|
||||||
{
|
|
||||||
Evas_Object *o, *of, *ob;
|
|
||||||
Cpu *c;
|
|
||||||
|
|
||||||
c = cfd->data;
|
|
||||||
|
|
||||||
o = e_widget_list_add (evas, 0, 0);
|
|
||||||
of = e_widget_framelist_add (evas, D_ ("Cpu Settings"), 0);
|
|
||||||
ob = e_widget_check_add (evas, D_ ("Show Text"), (&(cfdata->show_text)));
|
|
||||||
e_widget_framelist_object_append (of, ob);
|
|
||||||
ob = e_widget_check_add (evas, D_ ("Show Graph"), (&(cfdata->show_graph)));
|
|
||||||
e_widget_framelist_object_append (of, ob);
|
|
||||||
|
|
||||||
ob = e_widget_label_add (evas, D_ ("Check Interval:"));
|
|
||||||
e_widget_framelist_object_append (of, ob);
|
|
||||||
ob =
|
|
||||||
e_widget_slider_add (evas, 1, 0, _("%1.0f seconds"), 1, 60, 1, 0, NULL,
|
|
||||||
&(cfdata->check_interval), 150);
|
|
||||||
e_widget_framelist_object_append (of, ob);
|
|
||||||
e_widget_list_object_append (o, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
|
|
||||||
{
|
|
||||||
Cpu *c;
|
|
||||||
|
|
||||||
c = cfd->data;
|
|
||||||
c->conf->check_interval = cfdata->check_interval;
|
|
||||||
c->conf->show_text = cfdata->show_text;
|
|
||||||
c->conf->show_graph = cfdata->show_graph;
|
|
||||||
e_config_save_queue ();
|
|
||||||
if (c->face->monitor)
|
|
||||||
ecore_timer_interval_set (c->face->monitor,
|
|
||||||
(double) cfdata->check_interval);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
#ifdef E_TYPEDEFS
|
|
||||||
#else
|
|
||||||
#ifndef E_MOD_CONFIG_H
|
|
||||||
#define E_MOD_CONFIG_H
|
|
||||||
|
|
||||||
#include "e_mod_main.h"
|
|
||||||
|
|
||||||
void _configure_cpu_module(E_Container *con, Cpu *c);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
988
e_mod_main.c
988
e_mod_main.c
File diff suppressed because it is too large
Load Diff
63
e_mod_main.h
63
e_mod_main.h
|
@ -1,62 +1,33 @@
|
||||||
#define D_(str) dgettext(PACKAGE, str)
|
|
||||||
|
|
||||||
#ifndef E_MOD_MAIN_H
|
#ifndef E_MOD_MAIN_H
|
||||||
#define E_MOD_MAIN_H
|
#define E_MOD_MAIN_H
|
||||||
|
|
||||||
typedef struct _Config Config;
|
typedef struct _Config Config;
|
||||||
typedef struct _Config_Face Config_Face;
|
typedef struct _Config_Item Config_Item;
|
||||||
typedef struct _Cpu Cpu;
|
|
||||||
typedef struct _Cpu_Face Cpu_Face;
|
|
||||||
|
|
||||||
struct _Config
|
struct _Config
|
||||||
{
|
{
|
||||||
int check_interval;
|
E_Module *module;
|
||||||
int show_text;
|
E_Config_Dialog *config_dialog;
|
||||||
int show_graph;
|
E_Menu *menu, *menu_interval;
|
||||||
|
Evas_List *instances;
|
||||||
|
Evas_List *items;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Config_Face
|
struct _Config_Item
|
||||||
{
|
{
|
||||||
unsigned char enabled;
|
const char *id;
|
||||||
};
|
double interval;
|
||||||
|
|
||||||
struct _Cpu
|
|
||||||
{
|
|
||||||
E_Menu *config_menu;
|
|
||||||
Cpu_Face *face;
|
|
||||||
Config *conf;
|
|
||||||
E_Module *module;
|
|
||||||
E_Config_DD *conf_edd;
|
|
||||||
E_Config_Dialog *cfd;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _Cpu_Face
|
|
||||||
{
|
|
||||||
Evas *evas;
|
|
||||||
E_Container *con;
|
|
||||||
E_Menu *menu;
|
|
||||||
Cpu *cpu;
|
|
||||||
Evas_List *old_values[4];
|
|
||||||
|
|
||||||
Config_Face *conf;
|
|
||||||
E_Config_DD *conf_face_edd;
|
|
||||||
|
|
||||||
Evas_Object *cpu_obj;
|
|
||||||
Evas_Object *event_obj;
|
|
||||||
Evas_Object *chart_obj;
|
|
||||||
Evas_Object *txt_obj;
|
|
||||||
|
|
||||||
Ecore_Timer *monitor;
|
|
||||||
|
|
||||||
E_Gadman_Client *gmc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
||||||
EAPI void *e_modapi_init(E_Module *m);
|
EAPI void *e_modapi_init (E_Module *m);
|
||||||
EAPI int e_modapi_shutdown(E_Module *m);
|
EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save(E_Module *m);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI int e_modapi_about(E_Module *m);
|
EAPI int e_modapi_about (E_Module *m);
|
||||||
EAPI int e_modapi_config(E_Module *m);
|
|
||||||
|
//void _config_cpu_module (Config_Item *ci);
|
||||||
|
|
||||||
|
extern Config *cpu_conf;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
BIN
module.eap
BIN
module.eap
Binary file not shown.
Loading…
Reference in New Issue