summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evlog.c54
-rw-r--r--evlog.edc30
2 files changed, 84 insertions, 0 deletions
diff --git a/evlog.c b/evlog.c
index bb2cde2..8e41472 100644
--- a/evlog.c
+++ b/evlog.c
@@ -1143,6 +1143,53 @@ _add_log_frame_object(Evas_Object *win, Evas_Object *grid, Event *ev)
1143} 1143}
1144 1144
1145static Evas_Object * 1145static Evas_Object *
1146_add_log_event_event_object(Evas_Object *win, Evas_Object *grid, Event *ev)
1147{
1148 Evas_Object *o, *oe;
1149 int col[4] = {255, 255, 255, 255}, i, max;
1150 char *s;
1151 char buf[512];
1152
1153 o = elm_layout_add(win);
1154 oe = elm_layout_edje_get(o);
1155 elm_layout_file_set(o, "./evlog.edj", "event");
1156 i = 0;
1157 max = 0;
1158 for (s = ev->event; *s; s++)
1159 {
1160 col[i % 3] ^= *s;
1161 if (col[i % 3] > max) max = col[i % 3];
1162 i++;
1163 }
1164 if (max > 0)
1165 {
1166 for (i = 0; i < 3; i++)
1167 {
1168 col[i] = (col[i] * 255) / max;
1169 }
1170 }
1171 edje_object_color_class_set(oe, "event",
1172 (3 * col[0]) / 4, (3 * col[1]) / 4, (3 * col[2]) / 4, (3 * col[3]) / 4,
1173 255, 255, 255, 255,
1174 255, 255, 255, 255);
1175 if (ev->detail)
1176 {
1177 snprintf(buf, sizeof(buf), "%s (%s)", ev->event, ev->detail);
1178 edje_object_part_text_set(oe, "text", buf);
1179 }
1180 else
1181 edje_object_part_text_set(oe, "text", ev->event);
1182 elm_grid_pack(grid, o, ev->t0 * RES, ev->n, 0, 1);
1183 if (ev->detail)
1184 snprintf(buf, sizeof(buf), "%s (%s) - %1.5fms", ev->event, ev->detail, ev->t0 * 1000.0);
1185 else
1186 snprintf(buf, sizeof(buf), "%s - %1.5fms", ev->event, ev->t0 * 1000.0);
1187 elm_object_tooltip_text_set(o, buf);
1188 evas_object_show(o);
1189 return o;
1190}
1191
1192static Evas_Object *
1146_add_log_cpufreq_object(Evas_Object *win, Evas_Object *grid, Event *ev, int mhzmax) 1193_add_log_cpufreq_object(Evas_Object *win, Evas_Object *grid, Event *ev, int mhzmax)
1147{ 1194{
1148 Evas_Object *o, *oe; 1195 Evas_Object *o, *oe;
@@ -1223,6 +1270,13 @@ _cb_fill_end(void *data, Ecore_Thread *thread)
1223 ev); 1270 ev);
1224 ev->obj = o; 1271 ev->obj = o;
1225 } 1272 }
1273 else
1274 {
1275 o = _add_log_event_event_object(inf->win,
1276 inf->grid.over,
1277 ev);
1278 ev->obj = o;
1279 }
1226 } 1280 }
1227 else if (ev->slot == -2) // cpufreq 1281 else if (ev->slot == -2) // cpufreq
1228 { 1282 {
diff --git a/evlog.edc b/evlog.edc
index 224259b..940a542 100644
--- a/evlog.edc
+++ b/evlog.edc
@@ -105,4 +105,34 @@ collections {
105 } 105 }
106 } 106 }
107 } 107 }
108
109 group { name: "event";
110 parts {
111 part { name: "base"; type: RECT; mouse_events: 0;
112 description { state: "default" 0.0;
113 color_class: "event";
114 min: 1 1;
115 }
116 }
117 part { name: "over"; type: RECT;
118 description { state: "default" 0.0;
119 color: 0 0 0 0;
120 min: 5 1;
121 }
122 }
123 part { name: "text"; type: TEXT;
124 scale: 1;
125 description { state: "default" 0.0;
126 rel1.relative: 0.0 1.0;
127 rel2.relative: 1.0 1.0;
128 align: 0.5 0.0;
129 color_class: "event";
130 text { font: "Sans"; size: 10;
131 min: 1 1;
132 align: 0.5 0.0;
133 }
134 }
135 }
136 }
137 }
108} 138}