Compare commits

...

69 Commits

Author SHA1 Message Date
Daniel Zaoui 73668cfb0e Fix APIs change
Related to Eolian and Text

Still there are compilation issues with focus feature
2020-01-19 22:08:35 +02:00
Daniel Zaoui 243e4c4dc8 Fix compilation after event rename 2019-09-08 21:27:32 +03:00
Daniel Zaoui ff15ac77f4 Fix unused variable 2019-06-24 20:06:36 +03:00
Daniel Zaoui 4664d39e13 Adapt code to latest EFL 2019-06-24 20:04:29 +03:00
Mykyta Biliavskyi af282ab41a Fix build with efl 1.22 release.
Fixed using efl API accordingly to the latest changes.
2019-05-01 12:09:44 +03:00
Marcel Hollerbach 1baa498b55 clouseau: fixup previous patches
the function arguments were passed in the wrong order, which resulted in
a wonderfull backtrace. Further more, eolian decided to return NULL as
class parents, and extensions. This _at_least_ brings back the basic
works.
2018-11-26 16:32:35 +01:00
Daniel Zaoui a3b3135d33 Remove useless union 2018-11-26 13:26:44 +02:00
Daniel Zaoui b23b7f9ab6 CMake: remove useless Eolian definition 2018-11-26 13:26:44 +02:00
Daniel Zaoui e0cbb82680 Adapt code to Eolian APIs changes 2018-11-26 13:26:42 +02:00
Daniel Zaoui d813400307 Support of structs parameters
@fix T7102
2018-07-12 15:54:02 +03:00
Marcel Hollerbach 1f7667819b updates class names 2018-07-03 16:31:11 +02:00
Daniel Zaoui 0ddf1692a5 ObjIntrospection: freeze only after the snapshot starts
If, for some reason, the application didn't load clouseau_debug.so, the
snapshot opcodes are not known, resulting in Clouseau freezing forever.

fix T7017
2018-06-18 10:28:29 +03:00
Daniel Zaoui 669bb5390c Remove useless dependency on library
The client binary doesn't depend on clouseau_debug.so. Only the objects
introspection extension does.
2018-06-18 10:27:31 +03:00
Daniel Zaoui aee290a401 Inform the user about the connection establishment
For the local mode, in case the connection cannot be established, the
user is proposed to launch the daemon, in which case the connection is
retried right after that step.
For the remote mode, the user is just informed that the setup has to be
verified.
2018-06-17 23:02:12 +03:00
Daniel Zaoui e032a521d9 Move break statement into case braces 2018-06-17 10:52:02 +03:00
Daniel Zaoui 41ad146676 Add clouseau script
This script launches the daemon, the given program and the Clouseau
client.

fix T5856
2018-06-16 23:35:59 +03:00
Daniel Zaoui 64ac1ca966 Add pid support as argument
By using -p pid, clouseau_client can connect to the program directly.
The connection mode must be given anyway.
2018-06-16 22:41:10 +03:00
Daniel Zaoui 24eee06b53 Add README 2018-06-15 11:09:39 +03:00
Hermet Park 4b6a03e963 fix a crash on vector drawing.
Basically, our efl objects need parents.
This code just obeys that efl programming rule.
2018-06-14 20:50:14 +09:00
Marcel Hollerbach 5fdd956379 focus_inspector: do not leak memory 2018-05-06 11:43:22 +02:00
Marcel Hollerbach 1d05baf59f focus_inspector: add a reload button 2018-05-06 11:43:22 +02:00
Marcel Hollerbach 92e3461f5b focus_inspector: clear out visuals when reloading 2018-05-06 11:43:22 +02:00
Daniel Zaoui 31732fbf5c Fix screenshot handling 2018-05-06 12:29:28 +03:00
Daniel Zaoui 6367fbdf86 Fix after Eolian validation changes 2018-05-06 09:34:10 +03:00
Daniel Zaoui 8627aacaeb Fix compilation after EFL Eo API changes 2018-05-05 23:54:23 +03:00
Marcel Hollerbach 19fe1c898e clouseau: use correct data type 2018-04-01 20:34:38 +02:00
Marcel Hollerbach 1060bd4b23 clouseau-focus: better displaying of the appearing focus managers
now with name and pointer
2018-04-01 20:22:17 +02:00
Marcel Hollerbach a5b70e6903 clouseu_debug: remove old leftover 2018-04-01 18:37:16 +02:00
Marcel Hollerbach 5b20f26f76 clouseu: filter the manager objects better 2018-04-01 18:34:54 +02:00
q66 70e1087187 fix build by updating an Eolian API name 2018-03-27 17:05:21 +02:00
Daniel Zaoui 28713189a0 Update code after Eolian changes in EFL
Use latest EFL from GIT
2018-03-14 12:48:43 +02:00
Davide Andreoli c64d481e70 Make clouseau works again after recent eolian changes
Note: you need latest efl from git
2018-03-01 18:12:40 +01:00
Marcel Hollerbach 5fd8f312a5 clouseau: make it run with python
we can now debug python apps!
2018-02-25 10:32:15 +01:00
Marcel Hollerbach 2737e98a5b clouseau: display the complete tree of objects!
#finally

http://www.enlightenment.org/ss/e-5a91c4a00b11c5.18227919.jpgideP
2018-02-24 21:03:29 +01:00
Marcel Hollerbach e4e3838767 object_introspection: this one is dead. 2018-02-24 21:03:29 +01:00
Marcel Hollerbach 8d07e441f2 clouseau: this api changed 2018-02-24 21:03:29 +01:00
Marcel Hollerbach d882c9f0af clouseau: eolian changed api
and that only in a semantical way, not syntactical, without even a
notice in the docs! Lovely to debug :)

 #communication
2018-02-24 21:03:29 +01:00
Marcel Hollerbach 244f33420d clouseau: map legacy name to installed names, so it works 2018-02-24 21:03:29 +01:00
Marcel Hollerbach 067726dea8 clouseau: init the correct field
#classic
2018-02-24 21:03:29 +01:00
Marcel Hollerbach c029379b6d clouseau: replace internal functions be eolians implementation
this just removes code and uses the eolian functions for that,
this also means that we dont need to deal with eolian_units at all
anymore
2018-02-24 21:03:29 +01:00
Marcel Hollerbach 8bb9cce1ca Revert "Eolian api usage fix."
This reverts commit 318ee74c88.

The changed there let to segfaults here, and it barelly worked, so new
changes are done after that, to get clouseau back to work mode now.
2018-02-24 21:02:56 +01:00
Marcel Hollerbach 5b0b1a0f91 fix latest eo api breaks
Thx for taking care of our debugging infrastructure ;)
2018-01-31 15:33:49 +01:00
Marcel Hollerbach 8ed75b7448 focus_inspector: use a namescheme, so autodetect works 2018-01-31 15:33:31 +01:00
Mykyta Biliavskyi cfcf900910 Profiling Viewer: improve UI.
Summary:
Due to latest changes in Profiling Viewer project the UI was  updated.
Added toolbar with next buttons:
 - Start/stop processing data from eina_debug.
 - Update displayed interval by latest received data.
 - Open filters dialog window.
 - Open find dialog window .
 - Open time range dialog window.
 - Open preference window (disable until not merged into Profiling
   Viewer project master branch.)

Reviewers: Deepwarrior, i.furs

Reviewed By: Deepwarrior

Tags: PHID-PROJ-r7aoq2gq7sou6dugjj5o, #clouseau

Maniphest Tasks: T6348

Differential Revision: https://phab.enlightenment.org/D5443
2017-12-22 13:56:06 +02:00
Jean-Philippe Andre f5c971b734 gui: Don't include non-existing files 2017-12-18 19:02:11 +09:00
Mykyta Biliavskyi 318ee74c88 Eolian api usage fix.
Summary:
All eolian API's require to use Eolian object.
The object introspection still doesn't works for me. At least clouseau
is compiling now.

Test Plan: Compile Clouseau with git efl.

Reviewers: ajwillia.ms, JackDanielZ, Deepwarrior, i.furs

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D5632
2017-12-10 21:07:38 +00:00
Mykyta Biliavskyi 0130202924 Client: delete extensions on close application.
Summary:
The Profiling viewer extension require to be notifyed that clouseau_client
is closing. Another extensions also could require to make some routine
before extension will be closed. Such as storing session info etc .

Reviewers: i.furs, JackDanielZ, Deepwarrior

Reviewed By: JackDanielZ, Deepwarrior

Differential Revision: https://phab.enlightenment.org/D5608
2017-12-08 10:14:23 +02:00
Daniel Zaoui 5b0a310145 Fix warnings 2017-11-29 11:15:32 +02:00
Daniel Zaoui 432ed396db Extensions: display lib path when mouse is on extension menu item 2017-11-10 11:19:05 +02:00
Daniel Zaoui 6b643a7f57 Extensions: support automatic loading from install directory 2017-11-10 11:18:30 +02:00
Marcel Hollerbach 5dedb7054f clouseau_debug: only copy of rel is not NULL 2017-11-10 09:00:48 +01:00
Marcel Hollerbach 4a94694bc0 clouseau: focus, display arrows correctly
there have been some bad actions in the arrow code, every arrow should
now be displayed in a correct manner
2017-11-07 23:21:34 +01:00
Marcel Hollerbach ccefc5e57b clouseau: stop arrows beeing backwards 2017-11-07 21:52:25 +01:00
Marcel Hollerbach 7dadc722c5 clouseau: fix now private eo symbols 2017-11-07 20:32:09 +01:00
Marcel Hollerbach ef625c3d68 clouseau: EVAS_CANVAS is private now
we should check for EFL_CANVAS_INTERFACE which is simular, but also
applies to efl.ui.win, which is a problem
2017-11-07 20:14:42 +01:00
Marcel Hollerbach 2514cff9e4 clouseau: add arrow into clouseau for indicating relations 2017-11-03 20:12:05 +01:00
Marcel Hollerbach 65d89b92c2 clouseau: introduce focus inspector
This for now shows the nodes that are registered in a manager, in the
hirarchy that is used. Redirects are displayed red, logicals gray and
normals in a e-style blue. If something is part of the focus history its
green.
2017-10-31 16:33:36 +01:00
Marcel Hollerbach 4ae284bd0b clouseau: move those macros to a header, they are usefull 2017-10-31 16:31:35 +01:00
Daniel Zaoui 1013671a37 Adapt code after Eolian changes 2017-09-27 23:55:14 +03:00
Daniel Zaoui b962f53712 Fix bg creation after EFL changes 2017-09-27 23:55:01 +03:00
Mykyta Biliavskyi 4df7f37839 Fix build: Use Eina for Efl.Gfx API. 2017-09-20 17:08:01 +03:00
Mykyta Biliavskyi 170923b164 Add profiling viewer extension.
Summary:
Due to splitting efl_profiling_viewer to the library this
extension was prepared. This is a first version of extension and will be
improved. After @Deepwarrior will publish code for efl_profiling_viewer that
make possible to work with real time data from efl_debug system, it will
be possible compile clouseau with efl_profiling_viewer support.

Test Plan:
Inctall Profiling_Viewer library in the system.
Build clouseau.
Launch clouseau and select Profiling viewer extesion.

Reviewers: Deepwarrior, JackDanielZ

Reviewed By: Deepwarrior

Tags: #clouseau, PHID-PROJ-w56dx3enc43oqdzz2xpa

Differential Revision: https://phab.enlightenment.org/D5061
2017-09-01 14:06:21 +03:00
Daniel Zaoui 26c85dda2d Specify Clouseau library to link the extension
During compilation of the objects introspection extension, the
clouseau_debug library is needed.
In Ubuntu machines, it seems that this MUST be specified in the
CMakeLists.txt. Without it, dlopen the extension fails on trying to find
a function present in the Clouseau library.

Thanks to Woohyun for using Ubuntu :-)

@fix
2017-08-21 10:28:09 +03:00
Daniel Zaoui dc7ee20d22 Reorder includes to get the EAPI definition 2017-08-16 20:42:26 +03:00
Daniel Zaoui c1dd9ae043 Fix API visibility
It seems that, after EFL update, dlsym began to make issues to find
EAPI functions.
Setting the EAPI definition in the extension file solves the issue.
2017-08-15 20:50:02 +03:00
Cedric BAIL 64b36848af ui: use legacy call. 2017-08-07 14:03:42 -07:00
Jérémy Zurcher eca7479b59 ELM_PANES_CLASS -> EFL_UI_PANES_CLASS, follow efl commit 40945d9859 2017-08-07 09:24:35 +02:00
Marcel Hollerbach 79e62083c9 Use Eo to evaluate if a function is implemented
So, there is one problem, there is the case that you just have the
notation in eolian that a special object implements a interface, to
bring the actual logic to it, you are going to composite_attach a other
object to it. The problem then in clouseau was that clouseau doesnt know
a implementation does exist, so it didnt display the implementation.

The new solution uses eo to fetch the function pointer to the actual
implementation to know if the function is really implemented or not.
2017-08-02 20:09:07 +03:00
Marcel Hollerbach a6eedef550 Highlight everything that has a geometry 2017-08-02 20:09:01 +03:00
29 changed files with 2614 additions and 379 deletions

1
.gitignore vendored
View File

@ -11,7 +11,6 @@ Makefile.in
.*.sw[po]
*.gcov
*.gcno
/README
/aclocal.m4
/autom4te.cache/
/config.cache

View File

@ -18,6 +18,7 @@ find_package(Elementary REQUIRED)
find_package(Ecore REQUIRED)
find_package(Evas REQUIRED)
find_package(Ffi REQUIRED)
find_package(efl_profiler QUIET)
add_subdirectory(src/bin)
add_subdirectory(src/lib)

28
README Normal file
View File

@ -0,0 +1,28 @@
Clouseau
Clouseau is a UI inspection tool aimed to debug EFL applications.
Requirements:
efl (1.20 +)
Compiling:
1. mkdir build
2. cd build
3. cmake -DCMAKE_INSTALL_PREFIX=/your_install_path ..
4. make
5. (sudo) make install
How to use it?
1. Run efl_debugd on the machine where the program to debug has to run
2. Run your program
3. Run clouseau_client -l / -r [port]
4. Choose the extension you want to use
5. Choose your application
clouseau_client can run in three modes:
- locally: it connects to the local daemon (efl_debugd)
- remotely: you have to establish a connection (SSH...) and to supply the port to use to Clouseau
- offline: this is for the case you want to visualize a snapshot saved earlier

View File

@ -3,13 +3,20 @@ add_custom_command (
COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_SOURCE_DIR}/evlog.edc clouseau_evlog.edj
DEPENDS evlog.edc
)
add_custom_command (
OUTPUT clouseau_focus_inspector.edj
COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_SOURCE_DIR}/focus_inspector.edc clouseau_focus_inspector.edj
DEPENDS focus_inspector.edc
)
add_custom_target (
clouseau_evlog_edj
DEPENDS clouseau_evlog.edj evlog.edc
)
add_custom_target(focus_inspector_theme DEPENDS clouseau_focus_inspector.edj)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/clouseau_evlog.edj images/show-screenshot.png images/take-screenshot.png
FILES ${CMAKE_CURRENT_BINARY_DIR}/clouseau_focus_inspector.edj ${CMAKE_CURRENT_BINARY_DIR}/clouseau_evlog.edj images/show-screenshot.png images/take-screenshot.png
DESTINATION share/${PROJECT_NAME_LOWER}
)

91
data/focus_inspector.edc Normal file
View File

@ -0,0 +1,91 @@
collections {
images {
image: "focus_inspector_history.svg" COMP;
image: "focus_inspector_logical.svg" COMP;
image: "focus_inspector_regular.svg" COMP;
image: "focus_inspector_redirect.svg" COMP;
}
group { "focus_inspector/regular";
parts {
image { "indicator";
desc { "default";
rel1.to: "widget_name";
rel1.offset: -3px -3px;
rel2.to: "widget_name";
rel2.offset: 3px 3px;
image {
border: 1 1 1 1;
normal: "focus_inspector_regular.svg";
}
}
}
text { "widget_name";
desc { "default";
text {
font: Sans;
text: "<widget-name>";
size: 8;
min: 1 1;
max: 1 1;
}
}
}
}
}
group { "focus_inspector/logical";
inherit: "focus_inspector/regular";
parts {
image { "indicator";
desc { "default";
rel1.to: "widget_name";
rel1.offset: -3px -3px;
rel2.to: "widget_name";
rel2.offset: 3px 3px;
image {
border: 1 1 1 1;
normal: "focus_inspector_logical.svg";
}
}
}
}
}
group { "focus_inspector/history";
inherit: "focus_inspector/regular";
parts {
image { "indicator";
desc { "default";
rel1.to: "widget_name";
rel1.offset: -3px -3px;
rel2.to: "widget_name";
rel2.offset: 3px 3px;
image {
border: 1 1 1 1;
normal: "focus_inspector_history.svg";
}
}
}
}
}
group { "focus_inspector/redirect";
inherit: "focus_inspector/regular";
parts {
image { "indicator";
desc { "default";
rel1.to: "widget_name";
rel1.offset: -3px -3px;
rel2.to: "widget_name";
rel2.offset: 3px 3px;
image {
border: 1 1 1 1;
normal: "focus_inspector_redirect.svg";
}
}
}
}
}
}

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="99.855179mm"
height="28.76149mm"
viewBox="0 0 99.855179 28.76149"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="focus_inspector_history.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-3.7169149"
inkscape:cy="-166.01003"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.58634746,-0.38263321)">
<rect
style="fill:#484e4d;fill-opacity:1;fill-rule:nonzero;stroke:#259700;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4504"
width="98.355179"
height="27.26149"
x="1.3363475"
y="1.1326332"
ry="8.5526237"
rx="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="99.855179mm"
height="28.76149mm"
viewBox="0 0 99.855179 28.76149"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="focus_inspector_logical.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-3.7169149"
inkscape:cy="-166.01003"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.58634746,-0.38263321)">
<rect
style="fill:#484e4d;fill-opacity:1;fill-rule:nonzero;stroke:#787878;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4504"
width="98.355179"
height="27.26149"
x="1.3363475"
y="1.1326332"
ry="8.5526237"
rx="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="99.855179mm"
height="28.76149mm"
viewBox="0 0 99.855179 28.76149"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="focus_inspector_redirect.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-3.7169149"
inkscape:cy="-166.01003"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.58634746,-0.38263321)">
<rect
style="fill:#484e4d;fill-opacity:1;fill-rule:nonzero;stroke:#c0392b;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4504"
width="98.355179"
height="27.26149"
x="1.3363475"
y="1.1326332"
ry="8.5526237"
rx="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="99.855179mm"
height="28.76149mm"
viewBox="0 0 99.855179 28.76149"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="focus_inspector_regular.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-3.7169149"
inkscape:cy="-166.01003"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.58634746,-0.38263321)">
<rect
style="fill:#484e4d;fill-opacity:1;fill-rule:nonzero;stroke:#2288ee;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4504"
width="98.355179"
height="27.26149"
x="1.3363475"
y="1.1326332"
ry="8.5526237"
rx="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -24,7 +24,6 @@ add_executable(clouseau_client ${SOURCES})
target_link_libraries(clouseau_client
pthread
clouseau_debug
${EFL_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${EINA_LIBRARIES}
@ -37,3 +36,4 @@ target_link_libraries(clouseau_client
)
install(TARGETS clouseau_client DESTINATION bin)
install(PROGRAMS clouseau DESTINATION bin)

11
src/bin/clouseau Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage: clouseau <executable> [executable parameters]"
else
# Start the local daemon. In case it is already running, it exits directly.
efl_debugd &
# Start the application
$@ &
clouseau_client -l -p $!
fi

View File

@ -10,9 +10,11 @@
#include <getopt.h>
#include <Efreet.h>
#include <Efl_Ui.h>
#include <Elementary.h>
#include <Evas.h>
#include <Ecore_File.h>
#include <Eo.h>
#include "gui.h"
#include "Clouseau.h"
@ -87,7 +89,8 @@ struct _Extension_Config
typedef struct
{
Eina_List *extensions_cfgs;
Eina_List *import_extensions_cfgs;
Eina_List *extensions_cfgs; /* Imported + auto-loaded*/
const char *last_extension_name;
} Config;
@ -116,6 +119,7 @@ static Config *_config = NULL;
static Eina_List *_extensions = NULL;
static int _selected_port = -1;
static int _arg_pid = -1;
static Eina_Bool _clients_info_added_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _clients_info_deleted_cb(Eina_Debug_Session *, int, void *, int);
@ -123,6 +127,8 @@ static Eina_Bool _clients_info_deleted_cb(Eina_Debug_Session *, int, void *, int
static void _extension_view(void *, Evas_Object *, void *);
static void _fs_extension_import_show(void *, Evas_Object *, void *);
static void _connection_type_change(Connection_Type);
EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"Daemon/Client/register_observer", &_cl_stat_reg_op, NULL},
{"Daemon/Client/added", NULL, _clients_info_added_cb},
@ -159,7 +165,7 @@ _config_eet_load()
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Config);
_config_edd = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_config_edd, Config, "extensions_cfgs", extensions_cfgs, ext_edd);
EET_DATA_DESCRIPTOR_ADD_LIST(_config_edd, Config, "import_extensions_cfgs", import_extensions_cfgs, ext_edd);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Config, "last_extension_name",
last_extension_name, EET_T_STRING);
}
@ -205,8 +211,8 @@ static void
_ui_freeze(Clouseau_Extension *ext EINA_UNUSED, Eina_Bool on)
{
elm_progressbar_pulse(_main_widgets->freeze_pulse, on);
efl_gfx_visible_set(_main_widgets->freeze_pulse, on);
efl_gfx_visible_set(_main_widgets->freeze_inwin, on);
efl_gfx_entity_visible_set(_main_widgets->freeze_pulse, on);
efl_gfx_entity_visible_set(_main_widgets->freeze_inwin, on);
}
static Extension_Config *
@ -276,15 +282,32 @@ _extension_configs_validate()
if (ext_cfg->menu_item || !ext_cfg->name) continue;
ext_cfg->menu_item = elm_menu_item_add(_main_widgets->ext_selector_menu,
NULL, NULL, ext_cfg->name, _extension_view, ext_cfg);
elm_object_item_tooltip_text_set(ext_cfg->menu_item, ext_cfg->lib_path);
efl_wref_add(ext_cfg->menu_item, &ext_cfg->menu_item);
if (!ext_cfg->ready) elm_object_item_disabled_set(ext_cfg->menu_item, EINA_TRUE);
}
}
static void
_ext_cfg_load(const char *name, const char *path, void *data EINA_UNUSED)
{
if (strncmp(name, "libclouseau_", 12)) return;
if (!eina_str_has_suffix(name, ".so")) return;
if (!_ext_cfg_find_by_path(path))
{
Extension_Config *ext_cfg;
char fname[1024];
sprintf(fname, "%s/%s", path, name);
ext_cfg = calloc(1, sizeof(*ext_cfg));
ext_cfg->lib_path = eina_stringshare_add(fname);
_config->extensions_cfgs = eina_list_append(_config->extensions_cfgs, ext_cfg);
}
}
static void
_configs_load()
{
Extension_Config *ext_cfg;
char path[1024];
sprintf(path, "%s/clouseau", efreet_config_home_get());
@ -303,19 +326,8 @@ _configs_load()
eet_close(file);
}
if (!_ext_cfg_find_by_path(INSTALL_PREFIX"/lib/libclouseau_objects_introspection.so"))
{
ext_cfg = calloc(1, sizeof(*ext_cfg));
ext_cfg->lib_path = eina_stringshare_add(INSTALL_PREFIX"/lib/libclouseau_objects_introspection.so");
_config->extensions_cfgs = eina_list_append(_config->extensions_cfgs, ext_cfg);
}
if (!_ext_cfg_find_by_path(INSTALL_PREFIX"/lib/libclouseau_evlog.so"))
{
ext_cfg = calloc(1, sizeof(*ext_cfg));
ext_cfg->lib_path = eina_stringshare_add(INSTALL_PREFIX"/lib/libclouseau_evlog.so");
_config->extensions_cfgs = eina_list_append(_config->extensions_cfgs, ext_cfg);
}
_config->extensions_cfgs = eina_list_clone(_config->import_extensions_cfgs);
eina_file_dir_list(INSTALL_PREFIX"/lib", EINA_TRUE, _ext_cfg_load, NULL);
_config_save();
}
@ -420,6 +432,10 @@ _clients_info_added_cb(Eina_Debug_Session *session EINA_UNUSED, int src EINA_UNU
NULL, "home", name, _menu_selected_app, ai);
efl_wref_add(ai->menu_item, &ai->menu_item);
}
if (_arg_pid == pid)
{
_menu_selected_app(ai, _main_widgets->apps_selector_menu, ai->menu_item);
}
}
len = strlen(buf) + 1;
buf += len;
@ -489,8 +505,8 @@ _session_populate()
case OFFLINE:
{
if (ext->session_changed_cb) ext->session_changed_cb(ext);
break;
}
break;
case LOCAL_CONNECTION:
{
ext->session = eina_debug_local_connect(EINA_TRUE);
@ -510,6 +526,89 @@ _session_populate()
}
}
static void
_dialog_cancel(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *win = data;
efl_del(win);
}
static void
_dialog_box_create(const char *title, const char *content, const char *but1_str, const char *but2_str,
Efl_Event_Cb cb1, Efl_Event_Cb cb2)
{
Eo *win, *bx, *lb;
win = efl_add(EFL_UI_WIN_CLASS, _main_widgets->main_win,
efl_ui_win_type_set(efl_added, ELM_WIN_DIALOG_BASIC),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_text_set(efl_added, title),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_content_set(win, bx);
lb = efl_add(EFL_UI_TEXTBOX_CLASS, bx,
efl_text_multiline_set(efl_added, EINA_TRUE),
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_text_horizontal_align_set(efl_added, 0.5),
efl_text_set(efl_added, content),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_pack(bx, lb);
if (but1_str || but2_str)
{
Eo *bx2;
bx2 = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_pack(bx, bx2);
if (but1_str)
{
Eo *bt1 = efl_add(EFL_UI_BUTTON_CLASS, bx2,
efl_text_set(efl_added, but1_str),
efl_gfx_hint_weight_set(efl_added, 0, 0),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
if (cb1) efl_event_callback_add(bt1, EFL_INPUT_EVENT_CLICKED, cb1, win);
efl_pack(bx2, bt1);
}
if (but2_str)
{
Eo *bt2 = efl_add(EFL_UI_BUTTON_CLASS, bx2,
efl_text_set(efl_added, but2_str),
efl_gfx_hint_weight_set(efl_added, 0, 0),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
if (cb2) efl_event_callback_add(bt2, EFL_INPUT_EVENT_CLICKED, cb2, win);
efl_pack(bx2, bt2);
}
}
}
static Eina_Bool
_local_reconnect(void *data EINA_UNUSED)
{
_connection_type_change(LOCAL_CONNECTION);
return ECORE_CALLBACK_CANCEL;
}
static void
_daemon_launch(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *win = data;
ecore_exe_pipe_run("efl_debugd", ECORE_EXE_NONE, NULL);
ecore_timer_add(1.0, _local_reconnect, NULL);
efl_del(win);
}
static void
_connection_type_change(Connection_Type conn_type)
{
@ -537,16 +636,40 @@ _connection_type_change(Connection_Type conn_type)
case LOCAL_CONNECTION:
{
_selected_port = -1;
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
_session = eina_debug_local_connect(EINA_TRUE);
eina_debug_session_dispatch_override(_session, _disp_cb);
if (!_session)
{
_dialog_box_create("Can't connect",
"Clouseau cannot connect to the local daemon.\nDo you want Clouseau to launch it?",
"Launch", "Don't launch and stay offline",
_daemon_launch, _dialog_cancel);
_connection_type_change(OFFLINE);
return;
}
else
{
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
eina_debug_session_dispatch_override(_session, _disp_cb);
}
break;
}
case REMOTE_CONNECTION:
{
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
_session = eina_debug_remote_connect(_selected_port);
eina_debug_session_dispatch_override(_session, _disp_cb);
if (!_session)
{
_dialog_box_create("Can't connect",
"Clouseau cannot connect to the remote daemon.\nCheck it is running on the remote device and\nthat the port forwarding (e.g SSH) has been set.",
"Ok", NULL,
_dialog_cancel, NULL);
_connection_type_change(OFFLINE);
return;
}
else
{
eina_debug_session_dispatch_override(_session, _disp_cb);
}
break;
}
default: return;
@ -570,10 +693,10 @@ _connection_type_change(Connection_Type conn_type)
}
void
remote_port_entry_changed(void *data, const Efl_Event *event)
remote_port_entry_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Eo *inwin = data;
const char *ptr = elm_entry_entry_get(event->object);
const char *ptr = elm_entry_entry_get(obj);
_selected_port = atoi(ptr);
_connection_type_change(REMOTE_CONNECTION);
efl_del(inwin);
@ -665,6 +788,7 @@ _fs_extension_import(void *data, Evas_Object *fs EINA_UNUSED, void *ev)
{
Extension_Config *ext_cfg = calloc(1, sizeof(*ext_cfg));
ext_cfg->lib_path = eina_stringshare_add(filename);
_config->import_extensions_cfgs = eina_list_append(_config->import_extensions_cfgs, ext_cfg);
_config->extensions_cfgs = eina_list_append(_config->extensions_cfgs, ext_cfg);
_config_save();
_extension_configs_validate();
@ -771,13 +895,13 @@ _extensions_cfgs_inwin_create(const char *filename)
Eo *box = elm_box_add(inwin);
evas_object_size_hint_weight_set(box, 1, 1);
evas_object_size_hint_align_set(box, -1, -1);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
Eo *label = efl_add(ELM_LABEL_CLASS, box);
Eo *label = elm_label_add(box);
elm_object_text_set(label, "Choose an extension to open the file with:");
evas_object_size_hint_align_set(label, 0, -1);
evas_object_size_hint_weight_set(label, 1, 1);
efl_gfx_visible_set(label, EINA_TRUE);
efl_gfx_entity_visible_set(label, EINA_TRUE);
elm_box_pack_end(box, label);
Eo *list = elm_list_add(inwin);
@ -927,6 +1051,14 @@ save_load_perform(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
else _fs_activate(EINA_FALSE);
}
static void
_main_window_del(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
_all_extensions_delete();
}
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
@ -946,12 +1078,13 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{"help", no_argument, 0, 'h'},
{"local", no_argument, 0, 'l'},
{"remote", required_argument, 0, 'r'},
{"pid", required_argument, 0, 'p'},
{"file", required_argument, 0, 'f'},
{0, 0, 0, 0}
};
while ((opt = getopt_long(argc, argv,"hlr:f:", long_options, &long_index )) != -1)
while ((opt = getopt_long(argc, argv,"hlr:p:f:", long_options, &long_index )) != -1)
{
if (conn_type != OFFLINE || offline_filename)
if (opt != 'p' && (conn_type != OFFLINE || offline_filename))
{
printf("You cannot use more than one option at a time\n");
help = EINA_TRUE;
@ -975,6 +1108,11 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
offline_filename = eina_stringshare_add(optarg);
break;
}
case 'p':
{
_arg_pid = atoi(optarg);
break;
}
case 'h': help = EINA_TRUE; break;
default: help = EINA_TRUE;
}
@ -985,12 +1123,15 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
printf(" --help/-h Print that help\n");
printf(" --local/-l Create a local connection\n");
printf(" --remote/-r Create a remote connection by using the given port\n");
printf(" --pid/-p PID of the program to connect to\n");
printf(" --file/-f Run in offline mode and load the given file\n");
return 0;
}
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
_main_widgets = gui_main_win_create(NULL);
evas_object_smart_callback_add(_main_widgets->main_win, "delete,request",
_main_window_del, NULL);
for (i = 0; i < LAST_CONNECTION; i++)
{

View File

@ -8,9 +8,6 @@
#define ELM_INTERNAL_API_ARGESFSDFEFC
#endif
#include <Elementary.h>
#include "elm_widget_container.h"
#include "elm_interface_scrollable.h"
#include "elm_interface_fileselector.h"
#include "gui.h"
extern void
@ -18,7 +15,7 @@ conn_menu_show(void *data, Evas_Object *obj, void *event_info);
extern void
save_load_perform(void *data, Evas_Object *obj, void *event_info);
extern void
remote_port_entry_changed(void *data, const Efl_Event *event);
remote_port_entry_changed(void *data, Evas_Object *obj, void *event_info);
static void
_pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
@ -43,17 +40,17 @@ gui_main_win_create(Eo *__main_parent)
pub_widgets->main_win = main_win;
elm_win_autodel_set(main_win, EINA_TRUE);
elm_win_title_set(main_win, "Clouseau");
efl_gfx_size_set(main_win, 478, 484);
efl_gfx_entity_size_set(main_win, EINA_SIZE2D(478, 484));
bg = efl_add(ELM_BG_CLASS, main_win);
bg = elm_bg_add(main_win);
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
efl_gfx_visible_set(bg, EINA_TRUE);
efl_gfx_position_set(bg, 0, 0);
efl_gfx_entity_visible_set(bg, EINA_TRUE);
efl_gfx_entity_position_set(bg, EINA_POSITION2D(0, 0));
elm_win_resize_object_add(main_win, bg);
main_box = elm_box_add(main_win);
evas_object_size_hint_weight_set(main_box, 1.000000, 1.000000);
efl_gfx_visible_set(main_box, EINA_TRUE);
efl_gfx_entity_visible_set(main_box, EINA_TRUE);
elm_win_resize_object_add(main_win, main_box);
tb = elm_toolbar_add(main_win);
@ -85,7 +82,7 @@ gui_main_win_create(Eo *__main_parent)
*/
elm_box_pack_end(main_box, tb);
efl_gfx_visible_set(tb, EINA_TRUE);
efl_gfx_entity_visible_set(tb, EINA_TRUE);
freeze_pulse = elm_progressbar_add(main_win);
pub_widgets->freeze_pulse = freeze_pulse;
@ -101,14 +98,14 @@ gui_main_win_create(Eo *__main_parent)
pub_widgets->ext_box = ext_box;
evas_object_size_hint_weight_set(ext_box, 1.000000, 1.000000);
evas_object_size_hint_align_set(ext_box, -1.000000, -1.000000);
efl_gfx_visible_set(ext_box, EINA_TRUE);
efl_gfx_entity_visible_set(ext_box, EINA_TRUE);
elm_box_pack_end(main_box, ext_box);
freeze_inwin = elm_win_inwin_add(main_win);
pub_widgets->freeze_inwin = freeze_inwin;
elm_object_style_set(freeze_inwin, "minimal");
efl_gfx_visible_set(main_win, EINA_TRUE);
efl_gfx_entity_visible_set(main_win, EINA_TRUE);
efl_event_callback_add(main_win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;
@ -129,7 +126,7 @@ gui_remote_port_win_create(Eo *__main_parent)
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_object_part_text_set(entry, "guide", "Port to connect to remote device");
efl_event_callback_add(entry, ELM_ENTRY_EVENT_ACTIVATED, remote_port_entry_changed, inwin);
evas_object_smart_callback_add(entry, "activated", remote_port_entry_changed, inwin);
evas_object_show(entry);
elm_win_inwin_content_set(inwin, entry);

View File

@ -16,6 +16,8 @@ target_link_libraries(clouseau_debug
${EINA_LIBRARIES}
${EO_LIBRARIES}
${EOLIAN_LIBRARIES}
${EVAS_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${FFI_LIBRARIES}
)

View File

@ -31,6 +31,7 @@
#include <Eo.h>
#include <Eolian.h>
#include <Elementary.h>
typedef void (*Eo_Debug_Class_Extract_Cb)(void *data, uint64_t kl, char *kl_name);
@ -49,16 +50,15 @@ typedef enum
EOLIAN_DEBUG_LONG,
EOLIAN_DEBUG_UINT,
EOLIAN_DEBUG_LIST,
EOLIAN_DEBUG_VOID
EOLIAN_DEBUG_OBJECT,
EOLIAN_DEBUG_VOID,
EOLIAN_DEBUG_STRUCT
} Eolian_Debug_Basic_Type;
typedef struct
{
Eolian_Debug_Basic_Type type;
union
{
uint64_t value;
} value;
uint64_t value;
Eina_List *complex_type_values;
} Eolian_Debug_Value;
@ -106,6 +106,28 @@ typedef struct
int tm_hour;
} Evas_Debug_Screenshot;
typedef struct {
Eo *redirect_manager;
Eo *focused;
const char *class_name;
Eina_List *relations;
} Clouseau_Focus_Manager_Data;
typedef struct {
Efl_Ui_Focus_Relations relation;
const char *class_name;
Evas_Object *vis;
} Clouseau_Focus_Relation;
typedef struct {
uintptr_t ptr;
const char *helper_name;
} Clouseau_Focus_List_Item;
typedef struct {
Eina_List *managers;
} Clouseau_Focus_Managers;
EAPI void *eo_debug_eoids_request_prepare(int *size, ...);
EAPI void eo_debug_klids_extract(void *buffer, int size, Eo_Debug_Class_Extract_Cb cb, void *data);
@ -119,4 +141,38 @@ eolian_debug_object_information_decode(char *buffer, unsigned int size);
EAPI Evas_Debug_Screenshot *
evas_debug_screenshot_decode(char *buffer, unsigned int size);
typedef struct
{
Eina_Debug_Session *session;
int srcid;
void *buffer;
unsigned int size;
} Main_Loop_Info;
#define WRAPPER_TO_XFER_MAIN_LOOP(foo) \
static void \
_intern_main_loop ## foo(void *data) \
{ \
Main_Loop_Info *info = data; \
_main_loop ## foo(info->session, info->srcid, info->buffer, info->size); \
free(info->buffer); \
free(info); \
} \
static Eina_Bool \
foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \
{ \
Main_Loop_Info *info = calloc(1, sizeof(*info)); \
info->session = session; \
info->srcid = srcid; \
info->size = size; \
if (info->size) \
{ \
info->buffer = malloc(info->size); \
memcpy(info->buffer, buffer, info->size); \
} \
ecore_main_loop_thread_safe_call_async(_intern_main_loop ## foo, info); \
return EINA_TRUE; \
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
static void
_init_manager_details_descriptors(void)
{
Eet_Data_Descriptor_Class klass;
Eet_Data_Descriptor *relations_eed;
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_Relation);
relations_eed = eet_data_descriptor_file_new(&klass);
#define BASIC(field, type) EET_DATA_DESCRIPTOR_ADD_BASIC(relations_eed, Clouseau_Focus_Relation, #field , field, type)
BASIC(class_name, EET_T_STRING);
BASIC(relation.next, EET_T_LONG_LONG);
BASIC(relation.prev, EET_T_LONG_LONG);
BASIC(relation.logical, EET_T_CHAR);
BASIC(relation.parent, EET_T_LONG_LONG);
BASIC(relation.redirect, EET_T_LONG_LONG);
BASIC(relation.node, EET_T_LONG_LONG);
BASIC(relation.position_in_history, EET_T_INT);
#undef BASIC
#define LIST(field, type) EET_DATA_DESCRIPTOR_ADD_LIST(relations_eed, Clouseau_Focus_Relation, #field , field, type)
/*LIST(relation.right, EET_T_UINT);
LIST(relation.left, EET_T_UINT);
LIST(relation.top, EET_T_UINT);
LIST(relation.down, EET_T_UINT);*/
#undef LIST
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_Manager_Data);
manager_details = eet_data_descriptor_file_new(&klass);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "redirect_manager", redirect_manager, EET_T_LONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "focused", focused, EET_T_LONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "class_name", class_name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_LIST(manager_details, Clouseau_Focus_Manager_Data, "relations", relations, relations_eed);
}
static void
_init_manager_list_descriptors(void)
{
Eet_Data_Descriptor_Class klass;
Eet_Data_Descriptor *detail_eed;
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_List_Item);
detail_eed = eet_data_descriptor_file_new(&klass);
#define BASIC(field, type) EET_DATA_DESCRIPTOR_ADD_BASIC(detail_eed, Clouseau_Focus_List_Item, #field , field, type)
BASIC(helper_name, EET_T_STRING);
BASIC(ptr, EET_T_LONG_LONG);
#undef BASIC
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_Managers);
manager_list = eet_data_descriptor_file_new(&klass);
EET_DATA_DESCRIPTOR_ADD_LIST(manager_list, Clouseau_Focus_Managers, "managers", managers, detail_eed);
}
static void
_init_data_descriptors(void)
{
_init_manager_list_descriptors();
_init_manager_details_descriptors();
}

View File

@ -1,2 +1,7 @@
add_subdirectory(objects_introspection)
add_subdirectory(evlog)
add_subdirectory(focus_inspector)
if (${EFL_PROFILER_FOUND})
add_subdirectory(profiling_viewer)
endif (${EFL_PROFILER_FOUND})

View File

@ -1501,7 +1501,7 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
o2 = elm_button_add(bar_box);
elm_object_part_content_set(o2, "icon", o);
elm_box_pack_end(bar_box, o2);
efl_gfx_visible_set(o2, EINA_TRUE);
efl_gfx_entity_visible_set(o2, EINA_TRUE);
evas_object_smart_callback_add(o2, "clicked", _evlog_clear, ext);
inf->record_icon = o = elm_icon_add(bar_box);
@ -1511,23 +1511,23 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
inf->record_button = o = elm_button_add(bar_box);
elm_object_part_content_set(o, "icon", inf->record_icon);
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
evas_object_smart_callback_add(o, "clicked", _process_recording, ext);
o = elm_separator_add(bar_box);
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
o = elm_label_add(bar_box);
elm_object_text_set(o, "Refresh interval (in seconds):");
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
inf->refresh_interval_entry = o = elm_entry_add(bar_box);
elm_entry_single_line_set(o, EINA_TRUE);
elm_object_text_set(o, "0.2");
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
inf->zoom_slider = o = elm_slider_add(inf->main);
evas_object_data_set(o, "inf", inf);

View File

@ -0,0 +1,34 @@
set(CMAKE_BUILD_TYPE Debug)
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DFOCUS_EDJ="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/clouseau_focus_inspector.edj")
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${ELEMENTARY_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EET_INCLUDE_DIRS}
${EOLIAN_INCLUDE_DIRS}
)
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
add_library(clouseau_focus_inspector SHARED main.c gui.c tree_view.c)
target_link_libraries(clouseau_focus_inspector
${ELEMENTARY_LIBRARIES}
${EVAS_LIBRARIES}
${EO_LIBRARIES}
${EINA_LIBRARIES}
${EET_LIBRARIES}
${EOLIAN_LIBRARIES}
clouseau_debug
)
add_dependencies(clouseau_focus_inspector focus_inspector_theme)
INSTALL(TARGETS clouseau_focus_inspector LIBRARY DESTINATION lib)

View File

@ -0,0 +1,191 @@
#include <Elementary.h>
#include "../../Clouseau_Debug.h"
#include "gui.h"
static Evas_Object *table, *managers, *redirect, *history, *scroller;
static Elm_Genlist_Item_Class *itc;
static Clouseau_Focus_List_Item *selected_manager = NULL;
static char*
_text_get(void *data, Elm_Genlist *list EINA_UNUSED, const char *part EINA_UNUSED)
{
Clouseau_Focus_List_Item *it = data;
Eina_Strbuf *res = eina_strbuf_new();
eina_strbuf_append_printf(res, "%s - %p", it->helper_name, (void*)it->ptr);
return eina_strbuf_release(res);
}
static void
_sel_relation_func(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Instance *inst = evas_object_data_get(obj, "__instance");
tree_view_relation_display(inst, elm_radio_state_value_get(obj));
elm_radio_value_set(obj, elm_radio_state_value_get(obj));
}
static void
_reload(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
if (selected_manager)
com_defailt_manager(data, (void*)selected_manager->ptr);
}
EAPI Evas_Object*
ui_create(Instance *inst, Evas_Object *obj)
{
Evas_Object *o, *ic, *table2, *group = NULL;
o = table = elm_table_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
ic = elm_icon_add(obj);
elm_icon_standard_set(ic, "edit-redo");
evas_object_show(ic);
o = elm_button_add(obj);
elm_object_part_content_set(o, "icon", ic);
evas_object_show(o);
elm_table_pack(table, o, 0, 0, 1, 1);
evas_object_smart_callback_add(o, "clicked", _reload, inst);
o = managers = elm_combobox_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_part_text_set(o, "guide", "Manager to inspect");
evas_object_show(o);
elm_table_pack(table, o, 1, 0, 1, 1);
itc = elm_genlist_item_class_new();
itc->func.text_get = _text_get;
o = elm_label_add(obj);
elm_object_text_set(o, "Redirect:");
evas_object_show(o);
elm_table_pack(table, o, 2, 0, 1, 1);
o = redirect = elm_label_add(obj);
evas_object_show(o);
elm_table_pack(table, o, 3, 0, 1, 1);
o = history = elm_hoversel_add(obj);
elm_object_text_set(o, "History");
evas_object_show(o);
elm_table_pack(table, o, 4, 0, 1, 1);
o = scroller = elm_scroller_add(table);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
elm_table_pack(table, o, 0, 1, 5, 1);
o = table2 = elm_table_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
char *text[] = {"Tree","Next","Prev","None"};
for (int i = 0; i <= RELATION_NONE; ++i)
{
o = elm_radio_add(table);
evas_object_data_set(o, "__instance", inst);
evas_object_smart_callback_add(o, "changed", _sel_relation_func, NULL);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(o, text[i]);
evas_object_show(o);
elm_table_pack(table2, o, i % 5, i/5, 1, 1);
if (!group)
group = o;
else
elm_radio_group_add(o, group);
elm_radio_state_value_set(o, i);
}
elm_radio_value_set(group, RELATION_NONE);
elm_table_pack(table, table2, 0, 2, 5, 1);
return table;
}
static void
_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Clouseau_Focus_List_Item *it = elm_object_item_data_get(event_info);
com_defailt_manager(data, (void*)it->ptr);
selected_manager = it;
}
EAPI void
ui_managers_add(Instance *inst, Clouseau_Focus_Managers *clouseau_managers)
{
Clouseau_Focus_List_Item *it;
Eina_List *n;
elm_genlist_clear(managers);
selected_manager = NULL;
if (!clouseau_managers) return;
EINA_LIST_FOREACH(clouseau_managers->managers, n, it)
{
elm_genlist_item_append(managers, itc, it, NULL, 0, _sel, inst);
}
free(clouseau_managers);
}
static int
_sort(const void *a_raw, const void *b_raw)
{
const Clouseau_Focus_Relation *a = a_raw;
const Clouseau_Focus_Relation *b = b_raw;
int val_a, val_b;
if (a) val_a = a->relation.position_in_history;
if (b) val_b = b->relation.position_in_history;
return val_a - val_b;
}
EAPI void
ui_manager_data_arrived(Instance *inst, Clouseau_Focus_Manager_Data *data)
{
Clouseau_Focus_Relation *rel;
Evas_Object *o;
Eina_List *n, *sorted = NULL;
EINA_LIST_FREE(inst->realized.objects, o)
evas_object_del(o);
inst->realized.focusable_to_cfr = eina_hash_pointer_new(NULL);
if (inst->realized.data)
free(inst->realized.data);
inst->realized.data = data;
elm_hoversel_clear(history);
if (!inst->realized.data) return;
EINA_LIST_FOREACH(data->relations, n, rel)
{
if (rel->relation.position_in_history != -1)
sorted = eina_list_sorted_insert(sorted, _sort, rel);
eina_hash_add(inst->realized.focusable_to_cfr, &rel->relation.node, rel);
}
EINA_LIST_FOREACH(sorted, n, rel)
{
elm_hoversel_item_add(history, rel->class_name, NULL, 0, NULL, NULL);
}
tree_view_update(inst, scroller);
}

View File

@ -0,0 +1,34 @@
#ifndef GUI_H
#define GUI_H
#include "../../Clouseau.h"
#include "../../Clouseau_Debug.h"
typedef struct {
Clouseau_Extension *ext;
struct {
Eina_Hash *focusable_to_cfr;
Eina_List *objects, *relation_objects;
Clouseau_Focus_Manager_Data *data;
} realized;
} Instance;
typedef enum {
RELATION_TREE = 0,
RELATION_NEXT = 1,
RELATION_PREV = 2,
RELATION_NONE = 3
} Relations;
#define PUSH_CLEANUP(inst, o) inst->realized.objects = eina_list_append(inst->realized.objects, o)
#define PUSH_RELAION_CLEANUP(inst, o) inst->realized.relation_objects = eina_list_append(inst->realized.relation_objects, o)
EAPI void tree_view_update(Instance *inst, Evas_Object *scroller);
EAPI void tree_view_relation_display(Instance *inst, Relations rel);
EAPI void ui_managers_add(Instance *inst, Clouseau_Focus_Managers *clouseau_managers);
EAPI void ui_manager_data_arrived(Instance *inst, Clouseau_Focus_Manager_Data *data);
EAPI Evas_Object* ui_create(Instance *inst, Evas_Object *obj);
EAPI void com_refresh_managers(Instance *inst);
EAPI void com_defailt_manager(Instance *inst, Efl_Ui_Focus_Manager *manager);
#endif

View File

@ -0,0 +1,126 @@
#include <Eina.h>
#include <Elementary.h>
#include "../../Clouseau.h"
#include "../../Clouseau_Debug.h"
#include "gui.h"
static Instance inst;
static int _focus_manager_list_op = EINA_DEBUG_OPCODE_INVALID;
static int _focus_manager_detail_op = EINA_DEBUG_OPCODE_INVALID;
static Eet_Data_Descriptor *manager_details = NULL, *manager_list = NULL;
#include "../../clouseau_focus_serialization.x"
static Eina_Bool
_main_loop_focus_manager_list_cb(Eina_Debug_Session *session, int src EINA_UNUSED, void *buffer, int size)
{
Clouseau_Extension *ext = eina_debug_session_data_get(session);
Clouseau_Focus_Managers *managers;
if (!manager_list) _init_manager_list_descriptors();
managers = eet_data_descriptor_decode(manager_list, buffer, size);
ui_managers_add(ext->data, managers);
return EINA_TRUE;
}
WRAPPER_TO_XFER_MAIN_LOOP(_focus_manager_list_cb)
static Eina_Bool
_main_loop_focus_manager_detail_cb(Eina_Debug_Session *session, int src EINA_UNUSED, void *buffer, int size)
{
Clouseau_Extension *ext = eina_debug_session_data_get(session);
Clouseau_Focus_Manager_Data *pd;
if (!manager_details) _init_data_descriptors();
pd = eet_data_descriptor_decode(manager_details, buffer, size);
ui_manager_data_arrived(ext->data, pd);
return EINA_TRUE;
}
WRAPPER_TO_XFER_MAIN_LOOP(_focus_manager_detail_cb)
EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"Clouseau/Elementary_Focus/list", &_focus_manager_list_op, &_focus_manager_list_cb},
{"Clouseau/Elementary_Focus/detail", &_focus_manager_detail_op, &_focus_manager_detail_cb},
{NULL, NULL, NULL}
);
static void
_session_changed(Clouseau_Extension *ext)
{
int i = 0;
Eina_Debug_Opcode *ops = _ops();
while (ops[i].opcode_name)
{
if (ops[i].opcode_id) *(ops[i].opcode_id) = EINA_DEBUG_OPCODE_INVALID;
i++;
}
if (ext->session)
{
eina_debug_session_data_set(ext->session, ext);
eina_debug_opcodes_register(ext->session, ops, NULL, ext);
}
ui_managers_add(ext->data, NULL);
ui_manager_data_arrived(ext->data, NULL);
}
static void
_app_changed(Clouseau_Extension *ext)
{
ui_managers_add(ext->data, NULL);
ui_manager_data_arrived(ext->data, NULL);
com_refresh_managers(ext->data);
}
EAPI void
com_refresh_managers(Instance *ext_inst)
{
eina_debug_session_send(ext_inst->ext->session, ext_inst->ext->app_id, _focus_manager_list_op, NULL, 0);
}
EAPI void
com_defailt_manager(Instance *ext_inst, Efl_Ui_Focus_Manager *manager)
{
void *tmp[1];
tmp[0] = manager;
eina_debug_session_send(ext_inst->ext->session, ext_inst->ext->app_id, _focus_manager_detail_op, tmp, sizeof(void*));
}
EAPI const char *
extension_name_get()
{
return "Focus Inspector";
}
EAPI Eina_Bool
extension_start(Clouseau_Extension *ext, Eo *parent)
{
eina_init();
inst.ext = ext;
ext->data = &inst;
ext->ui_object = ui_create(ext->data, parent);
ext->session_changed_cb = _session_changed;
ext->app_changed_cb = _app_changed;
return !!ext->ui_object;
}
EAPI Eina_Bool
extension_stop(Clouseau_Extension *ext)
{
efl_del(ext->ui_object);
eina_shutdown();
return EINA_TRUE;
}

View File

@ -0,0 +1,313 @@
#include <Elementary.h>
#include "../../Clouseau_Debug.h"
#include "gui.h"
static void
find(Instance *pd, void *parent, void (*found)(void *data, Instance *pd, Clouseau_Focus_Relation *relation), void *data)
{
for (unsigned int i = 0; pd->realized.data->relations && i < eina_list_count(pd->realized.data->relations); ++i)
{
Clouseau_Focus_Relation *rel;
rel = eina_list_nth(pd->realized.data->relations, i);
if (rel->relation.parent == parent)
found(data, pd, rel);
}
}
void
tree_level(void *data, Instance *inst, Clouseau_Focus_Relation *relation)
{
Evas_Object *box, *childbox, *vis;
int maxw, maxh, minw, minh;
Eina_Strbuf *buf;
char group[PATH_MAX];
box = evas_object_box_add(evas_object_evas_get(data));
evas_object_box_padding_set(box, 20, 20);
evas_object_show(box);
PUSH_CLEANUP(inst, box);
buf = eina_strbuf_new();
eina_strbuf_append_printf(buf, "%p", relation->relation.node);
vis = edje_object_add(evas_object_evas_get(data));
evas_object_size_hint_weight_set(vis, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(vis, 0.0, EVAS_HINT_FILL);
if (relation->relation.position_in_history != -1 )
snprintf(group, sizeof(group), "focus_inspector/history");
else if (relation->relation.redirect)
snprintf(group, sizeof(group), "focus_inspector/redirect");
else if (relation->relation.logical)
snprintf(group, sizeof(group), "focus_inspector/logical");
else
snprintf(group, sizeof(group), "focus_inspector/regular");
edje_object_file_set(vis, FOCUS_EDJ, group);
edje_object_part_text_set(vis, "widget_name", relation->class_name);
evas_object_show(vis);
evas_object_box_append(box, vis);
edje_object_size_max_get(vis, &maxw, &maxh);
edje_object_size_min_get(vis, &minw, &minh);
if ((minw <= 0) && (minh <= 0))
edje_object_size_min_calc(vis, &minw, &minh);
evas_object_size_hint_max_set(vis, maxw, maxh);
evas_object_size_hint_min_set(vis, minw, minh);
relation->vis = vis;
PUSH_CLEANUP(inst, vis);
childbox = evas_object_box_add(evas_object_evas_get(data));
evas_object_box_padding_set(childbox, 20, 20);
evas_object_box_layout_set(childbox, evas_object_box_layout_vertical, NULL, NULL);
evas_object_box_append(box, childbox);
evas_object_show(childbox);
PUSH_CLEANUP(inst, childbox);
find(inst, relation->relation.node, tree_level, childbox);
evas_object_box_append(data, box);
}
EAPI void
tree_view_update(Instance *inst, Evas_Object *scroller)
{
Evas_Object *box;
box = evas_object_box_add(evas_object_evas_get(scroller));
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_box_layout_set(box, evas_object_box_layout_vertical, NULL, NULL);
evas_object_show(box);
PUSH_CLEANUP(inst, box);
if (inst->realized.data)
find(inst, NULL, tree_level, box);
elm_object_content_set(scroller, box);
tree_view_relation_display(inst, RELATION_NONE);
}
static Evas_Object*
_create_arrow(Evas *e)
{
Evas_Object *vg;
Efl_VG *cont, *tail, *front;
vg = evas_object_vg_add(e);
cont = evas_vg_container_add(vg);
tail = evas_vg_shape_add(cont);
evas_vg_node_color_set(tail, 0, 0, 0, 255);
evas_vg_shape_stroke_color_set(tail, 128, 10,10, 128);
evas_vg_shape_stroke_width_set(tail, 2.0);
evas_vg_shape_stroke_join_set(tail, EFL_GFX_JOIN_MITER);
evas_vg_shape_append_move_to(tail, 0, 0);
evas_vg_shape_append_line_to(tail, -100, 0);
efl_name_set(tail, "tail");
front = evas_vg_shape_add(cont);
evas_vg_node_color_set(front, 0, 0, 0, 255);
evas_vg_shape_stroke_color_set(front, 128, 10,10, 128);
evas_vg_shape_stroke_width_set(front, 2.0);
evas_vg_shape_stroke_join_set(front, EFL_GFX_JOIN_MITER);
evas_vg_shape_append_move_to(front, -6, -6);
evas_vg_shape_append_line_to(front, 0, 0);
evas_vg_shape_append_line_to(front, -6, 6);
evas_vg_shape_append_line_to(front, -6, -6);
efl_name_set(front, "front");
evas_object_vg_root_node_set(vg, cont);
return vg;
}
static void
_arrow_from_to(Evas_Object *vg, Eina_Position2D from, Eina_Position2D to)
{
Eina_Rect pos;
Eina_Matrix3 tmp, root_m;
Efl_VG *shape;
double distance, deg;
shape = evas_object_vg_root_node_get(vg);
EINA_SAFETY_ON_NULL_RETURN(shape);
pos.x = MIN(from.x, to.x);
pos.y = MIN(from.y, to.y);
pos.w = MAX(from.x, to.x) - pos.x;
pos.h = MAX(from.y, to.y) - pos.y;
distance = sqrt(pow(pos.w, 2)+pow(pos.h, 2));
eina_matrix3_identity(&tmp);
eina_matrix3_scale(&tmp, distance/100, 1.0);
evas_vg_node_transformation_set(evas_vg_container_child_get(shape, "tail"), &tmp);
Eina_Size2D size = EINA_SIZE2D((from.x - to.x), (from.y - to.y));
if (from.y - to.y == 0)
{
deg = 0;
}
else if (from.x - to.x == 0)
{
if (from.y > to.y)
deg = M_PI_2;
else
deg = M_PI + M_PI_2;
}
else
{
double di = ((double)(double)from.y - to.y) / ((double)from.x - to.x);
deg = atan(di);
}
if (from.x >= to.x)
{
size.w = 0;
deg += M_PI;
}
if (to.y <= from.y)
{
size.h = 0;
}
size.h = MAX(abs(size.h), 0) + 10;
size.w = MAX(abs(size.w), 0) + 10;
eina_matrix3_identity(&root_m);
eina_matrix3_identity(&tmp);
eina_matrix3_translate(&tmp, size.w, size.h);
eina_matrix3_multiply_copy(&root_m, &root_m, &tmp);
eina_matrix3_identity(&tmp);
eina_matrix3_rotate(&tmp, deg);
eina_matrix3_multiply_copy(&root_m, &root_m, &tmp);
evas_vg_node_transformation_set(shape, &root_m);
evas_object_geometry_set(vg, pos.x - 10, pos.y - 10, pos.w + 20, pos.h + 20);
}
static void
_geom_change(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eina_Rectangle pos1, pos2;
Eina_Position2D from, to;
Evas_Object *line, *vis1, *vis2;
line = data;
vis1 = evas_object_data_get(line, "__from");
vis2 = evas_object_data_get(line, "__to");
evas_object_geometry_get(vis1, &pos1.x, &pos1.y, &pos1.w, &pos1.h);
evas_object_geometry_get(vis2, &pos2.x, &pos2.y, &pos2.w, &pos2.h);
from.x = pos1.x + pos1.w / 2;
from.y = pos1.y + pos1.h / 2;
to.x = pos2.x + pos2.w / 2;
to.y = pos2.y + pos2.h / 2;
_arrow_from_to(line, from, to);
}
static void
_relation_display(Instance *inst, Evas_Object *vis1, Evas_Object *vis2)
{
Evas_Object *line;
Evas_Object *smart;
line = _create_arrow(evas_object_evas_get(vis1));
//evas_object_anti_alias_set(line, EINA_FALSE);
evas_object_pass_events_set(line, EINA_TRUE);
evas_object_data_set(line, "__from", vis1);
evas_object_data_set(line, "__to", vis2);
evas_object_show(line);
smart = evas_object_smart_parent_get(vis1);
evas_object_smart_member_add(line, smart);
_geom_change(line, evas_object_evas_get(vis1), vis1, NULL);
PUSH_RELAION_CLEANUP(inst, line);
evas_object_event_callback_add(vis1, EVAS_CALLBACK_MOVE, _geom_change, line);
evas_object_event_callback_add(vis1, EVAS_CALLBACK_RESIZE, _geom_change, line);
evas_object_event_callback_add(vis2, EVAS_CALLBACK_MOVE, _geom_change, line);
evas_object_event_callback_add(vis2, EVAS_CALLBACK_RESIZE, _geom_change, line);
}
EAPI void
tree_view_relation_display(Instance *inst, Relations rel_type)
{
Evas_Object *o;
EINA_LIST_FREE(inst->realized.relation_objects, o)
{
Evas_Object *vis1, *vis2;
vis1 = evas_object_data_get(o, "__from");
vis2 = evas_object_data_get(o, "__to");
evas_object_event_callback_del_full(vis1, EVAS_CALLBACK_MOVE, _geom_change, o);
evas_object_event_callback_del_full(vis1, EVAS_CALLBACK_RESIZE, _geom_change, o);
evas_object_event_callback_del_full(vis2, EVAS_CALLBACK_MOVE, _geom_change, o);
evas_object_event_callback_del_full(vis2, EVAS_CALLBACK_RESIZE, _geom_change, o);
evas_object_del(o);
}
if (rel_type == RELATION_NONE) return;
if (!inst->realized.data) return;
Clouseau_Focus_Relation *rel;
Eina_List *n;
EINA_LIST_FOREACH(inst->realized.data->relations, n, rel)
{
Eo *from;
Eo *to;
if (rel_type == RELATION_TREE)
{
if (!rel->relation.parent) continue;
from = rel->relation.parent;
to = rel->relation.node;
}
else if (rel_type == RELATION_NEXT)
{
if (!rel->relation.next) continue;
to = rel->relation.next;
from = rel->relation.node;
}
else if (rel_type == RELATION_PREV)
{
if (!rel->relation.prev) continue;
to = rel->relation.prev;
from = rel->relation.node;
}
Clouseau_Focus_Relation *c_from, *c_to;
c_from = eina_hash_find(inst->realized.focusable_to_cfr, &from);
c_to = eina_hash_find(inst->realized.focusable_to_cfr, &to);
EINA_SAFETY_ON_NULL_GOTO(c_from, next);
EINA_SAFETY_ON_NULL_GOTO(c_to, next);
_relation_display(inst, c_from->vis, c_to->vis);
next:
(void) n;
}
}

View File

@ -1,14 +1,9 @@
set(CMAKE_BUILD_TYPE Debug)
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}")
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT)
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${ELEMENTARY_INCLUDE_DIRS}
@ -30,6 +25,7 @@ target_link_libraries(clouseau_objects_introspection
${EINA_LIBRARIES}
${EET_LIBRARIES}
${EOLIAN_LIBRARIES}
clouseau_debug
)
INSTALL(TARGETS clouseau_objects_introspection LIBRARY DESTINATION lib)

View File

@ -7,10 +7,8 @@
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
#define ELM_INTERNAL_API_ARGESFSDFEFC
#endif
#include <Efl_Ui.h>
#include <Elementary.h>
#include "elm_widget_container.h"
#include "elm_interface_scrollable.h"
#include "elm_interface_fileselector.h"
#include "gui.h"
static const char* objs_types_strings[] =
@ -64,7 +62,7 @@ gui_win_create(Eo *__main_parent)
pub_widgets->main = box;
evas_object_size_hint_weight_set(box, 1, 1);
evas_object_size_hint_align_set(box, -1, -1);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
efl_event_callback_add(box, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
tb = elm_toolbar_add(__main_parent);
@ -73,7 +71,7 @@ gui_win_create(Eo *__main_parent)
elm_toolbar_menu_parent_set(tb, __main_parent);
evas_object_size_hint_weight_set(tb, 0, 0);
evas_object_size_hint_align_set(tb, -1, 0);
efl_gfx_visible_set(tb, EINA_TRUE);
efl_gfx_entity_visible_set(tb, EINA_TRUE);
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
@ -106,11 +104,11 @@ gui_win_create(Eo *__main_parent)
pub_widgets->highlight_ck = ck;
}
panes = efl_add(ELM_PANES_CLASS, box);
elm_obj_panes_content_right_size_set(panes, 0.600000);
panes = efl_add(EFL_UI_PANES_CLASS, box);
elm_panes_content_right_size_set(panes, 0.600000);
evas_object_size_hint_weight_set(panes, 1.000000, 1.000000);
efl_gfx_size_set(panes, 75, 75);
efl_gfx_visible_set(panes, EINA_TRUE);
efl_gfx_entity_size_set(panes, EINA_SIZE2D(75, 75));
efl_gfx_entity_visible_set(panes, EINA_TRUE);
evas_object_size_hint_weight_set(panes, 1.000000, 1.000000);
evas_object_size_hint_align_set(panes, -1.000000, -1.000000);
elm_box_pack_end(box, tb);
@ -118,11 +116,11 @@ gui_win_create(Eo *__main_parent)
object_infos_list = elm_genlist_add(panes);
pub_widgets->object_infos_list = object_infos_list;
evas_object_size_hint_weight_set(object_infos_list, 1.000000, 1.000000);
efl_gfx_visible_set(object_infos_list, EINA_TRUE);
objects_list = efl_add(ELM_GENLIST_CLASS, panes);
efl_gfx_entity_visible_set(object_infos_list, EINA_TRUE);
objects_list = elm_genlist_add(panes);
pub_widgets->objects_list = objects_list;
evas_object_size_hint_weight_set(objects_list, 1.000000, 1.000000);
efl_gfx_visible_set(objects_list, EINA_TRUE);
efl_gfx_entity_visible_set(objects_list, EINA_TRUE);
elm_object_part_content_set(panes, "left", objects_list);
elm_object_part_content_set(panes, "right", object_infos_list);
@ -137,16 +135,16 @@ gui_take_screenshot_button_create(Eo *__main_parent)
Eo *bt;
Eo *elm_icon1;
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
efl_gfx_visible_set(bt, EINA_TRUE);
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, take_screenshot_button_clicked, NULL);
evas_object_show(bt);
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, take_screenshot_button_clicked, NULL);
elm_icon1 = elm_icon_add(bt);
evas_object_size_hint_weight_set(elm_icon1, 1.000000, 1.000000);
efl_gfx_visible_set(elm_icon1, EINA_TRUE);
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON, NULL);
efl_gfx_entity_visible_set(elm_icon1, EINA_TRUE);
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON);
elm_object_part_content_set(bt, "icon", elm_icon1);
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
@ -161,18 +159,18 @@ gui_show_screenshot_button_create(Eo *__main_parent)
Eo *bt;
Eo *elm_icon1;
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
efl_gfx_visible_set(bt, EINA_TRUE);
efl_gfx_size_set(bt, 73, 30);
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, show_screenshot_button_clicked, NULL);
evas_object_show(bt);
evas_object_resize(bt, 73, 30);
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, show_screenshot_button_clicked, NULL);
elm_icon1 = elm_icon_add(bt);
evas_object_size_hint_weight_set(elm_icon1, 1.000000, 1.000000);
efl_gfx_visible_set(elm_icon1, EINA_TRUE);
efl_gfx_size_set(elm_icon1, 40, 40);
efl_file_set(elm_icon1, SHOW_SCREENSHOT_ICON, NULL);
efl_gfx_entity_visible_set(elm_icon1, EINA_TRUE);
efl_gfx_entity_size_set(elm_icon1, EINA_SIZE2D(40, 40));
efl_file_set(elm_icon1, SHOW_SCREENSHOT_ICON);
elm_object_part_content_set(bt, "icon", elm_icon1);
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
@ -190,15 +188,15 @@ gui_show_screenshot_win_create(Eo *__main_parent)
win = elm_win_add(__main_parent, "Screenshot", ELM_WIN_BASIC);
pub_widgets->win = win;
elm_win_autodel_set(win, EINA_TRUE);
efl_gfx_size_set(win, 300, 300);
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
evas_object_size_hint_weight_set(win, 1.000000, 1.000000);
elm_win_title_set(win, "Screenshot");
bg = efl_add(ELM_BG_CLASS, win);
bg = elm_bg_add(win);
pub_widgets->bg = bg;
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
efl_gfx_visible_set(bg, EINA_TRUE);
efl_gfx_entity_visible_set(bg, EINA_TRUE);
elm_win_resize_object_add(win, bg);
efl_gfx_visible_set(win, EINA_TRUE);
efl_gfx_entity_visible_set(win, EINA_TRUE);
efl_event_callback_add(win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;

View File

@ -3,8 +3,8 @@
#include "../../Clouseau_Debug.h"
#include "../../Clouseau.h"
#include "gui.h"
#include "../../Clouseau.h"
#define _EET_ENTRY "config"
@ -99,6 +99,7 @@ static Evas_Object * _obj_info_tootip(void *, Evas_Object *, Evas_Object *, void
static Eina_Bool _eoids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _klids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _obj_info_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _snapshot_started_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _snapshot_done_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _win_screenshot_get(Eina_Debug_Session *, int, void *, int);
@ -108,7 +109,7 @@ EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"Clouseau/Evas/object/highlight", &_obj_highlight_op, NULL},
{"Clouseau/Evas/window/screenshot", &_win_screenshot_op, &_win_screenshot_get},
{"Clouseau/Eolian/object/info_get", &_obj_info_op, &_obj_info_get},
{"Clouseau/Object_Introspection/snapshot_start",&_snapshot_do_op, NULL},
{"Clouseau/Object_Introspection/snapshot_start",&_snapshot_do_op, &_snapshot_started_cb},
{"Clouseau/Object_Introspection/snapshot_done", &_snapshot_done_op, &_snapshot_done_cb},
{NULL, NULL, NULL}
);
@ -197,12 +198,11 @@ _obj_highlight(Clouseau_Extension *ext, uint64_t obj)
static void
_app_snapshot_request(Clouseau_Extension *ext)
{
const char *obj_kl_name = _config->wdgs_show_type == 0 ? "Efl.Canvas.Object" : "Elm.Widget";
const char *obj_kl_name = _config->wdgs_show_type == 0 ? "Efl.Canvas.Object" : "Efl.Ui.Widget";
const char *canvas_kl_name = "Efl.Canvas";
int size = strlen(obj_kl_name) + 1 + strlen(canvas_kl_name) + 1;
char *buf = alloca(size);
ext->ui_freeze_cb(ext, EINA_TRUE);
memcpy(buf, obj_kl_name, strlen(obj_kl_name) + 1);
memcpy(buf + strlen(obj_kl_name) + 1, canvas_kl_name, strlen(canvas_kl_name) + 1);
eina_debug_session_send(ext->session, ext->app_id, _snapshot_do_op, buf, size);
@ -348,16 +348,16 @@ _snapshot_load(Clouseau_Extension *ext, void *buffer, int size, int version EINA
}
static void
_obj_info_expand_request_cb(void *data EINA_UNUSED, const Efl_Event *event)
_obj_info_expand_request_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_TRUE);
}
static void
_obj_info_contract_request_cb(void *data EINA_UNUSED, const Efl_Event *event)
_obj_info_contract_request_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_FALSE);
}
@ -368,7 +368,7 @@ _ptr_highlight(Clouseau_Extension *ext, Eolian_Debug_Value *v)
{
case EOLIAN_DEBUG_POINTER:
{
_obj_highlight(ext, v->value.value);
_obj_highlight(ext, v->value);
break;
}
case EOLIAN_DEBUG_LIST:
@ -376,7 +376,7 @@ _ptr_highlight(Clouseau_Extension *ext, Eolian_Debug_Value *v)
Eina_List *itr;
EINA_LIST_FOREACH(v->complex_type_values, itr, v)
{
_obj_highlight(ext, v->value.value);
_obj_highlight(ext, v->value);
}
break;
}
@ -401,9 +401,9 @@ _obj_info_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj,
}
static void
_obj_info_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
_obj_info_expanded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(glit);
if (itc == _obj_kl_info_itc)
{
@ -413,7 +413,7 @@ _obj_info_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
EINA_LIST_FOREACH(kl->functions, itr, func)
{
Elm_Genlist_Item *glist = elm_genlist_item_append(
event->object, _obj_func_info_itc, func, glit,
obj, _obj_func_info_itc, func, glit,
ELM_GENLIST_ITEM_NONE, _obj_info_gl_selected, NULL);
elm_genlist_item_tooltip_content_cb_set(glist, _obj_info_tootip, func, NULL);
}
@ -421,9 +421,9 @@ _obj_info_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
_obj_info_contracted_cb(void *data EINA_UNUSED, const Efl_Event *event)
_obj_info_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_subitems_clear(glit);
}
@ -435,7 +435,7 @@ _eolian_type_to_string(const Eolian_Type *param_eolian_type, Eina_Strbuf *buf)
if ((type == EOLIAN_TYPE_REGULAR || type == EOLIAN_TYPE_CLASS) &&
!eolian_type_base_type_get(param_eolian_type))
{
eina_strbuf_append_printf(buf, "%s", eolian_type_full_name_get(param_eolian_type));
eina_strbuf_append_printf(buf, "%s", eolian_type_name_get(param_eolian_type));
}
else
{
@ -443,7 +443,7 @@ _eolian_type_to_string(const Eolian_Type *param_eolian_type, Eina_Strbuf *buf)
if ((eolian_type_type_get(base) == EOLIAN_TYPE_REGULAR) ||
(eolian_type_type_get(base) == EOLIAN_TYPE_CLASS))
{
eina_strbuf_append_printf(buf, "%s *", eolian_type_full_name_get(base));
eina_strbuf_append_printf(buf, "%s *", eolian_type_name_get(base));
}
else if (eolian_type_type_get(base) == EOLIAN_TYPE_VOID)
{
@ -464,71 +464,81 @@ _eolian_value_to_string(Eolian_Debug_Value *value, Eina_Strbuf *buf)
case EOLIAN_DEBUG_STRING:
{
eina_strbuf_append_printf(buf, "\"%s\" ",
(char *)value->value.value);
(char *)value->value);
break;
}
case EOLIAN_DEBUG_POINTER:
{
eina_strbuf_append_printf(buf, "%p ",
(void *)value->value.value);
(void *)value->value);
break;
}
case EOLIAN_DEBUG_CHAR:
{
eina_strbuf_append_printf(buf, "%c ",
(char)value->value.value);
(char)value->value);
break;
}
case EOLIAN_DEBUG_INT:
{
eina_strbuf_append_printf(buf, "%d ",
(int)value->value.value);
(int)value->value);
break;
}
case EOLIAN_DEBUG_SHORT:
{
eina_strbuf_append_printf(buf, "%u ",
(unsigned int)value->value.value);
(unsigned int)value->value);
break;
}
case EOLIAN_DEBUG_DOUBLE:
{
eina_strbuf_append_printf(buf, "%f ",
(double)value->value.value);
(double)value->value);
break;
}
case EOLIAN_DEBUG_BOOLEAN:
{
eina_strbuf_append_printf(buf, "%s ",
(value->value.value ? "true" : "false"));
(value->value ? "true" : "false"));
break;
}
case EOLIAN_DEBUG_LONG:
{
eina_strbuf_append_printf(buf, "%ld ",
(long)value->value.value);
(long)value->value);
break;
}
case EOLIAN_DEBUG_UINT:
{
eina_strbuf_append_printf(buf, "%u ",
(unsigned int)value->value.value);
(unsigned int)value->value);
break;
}
case EOLIAN_DEBUG_LIST:
{
Eina_List *l = value->complex_type_values, *itr;
eina_strbuf_append_printf(buf, "%lX [", value->value.value);
eina_strbuf_append_printf(buf, "%lX [", value->value);
EINA_LIST_FOREACH(l, itr, value)
{
eina_strbuf_append_printf(buf, "%s%lX",
l != itr ? ", " : "",
value->value.value);
value->value);
}
eina_strbuf_append(buf, "]");
break;
}
default: eina_strbuf_append_printf(buf, "%lX ", value->value.value);
case EOLIAN_DEBUG_STRUCT:
{
Eina_List *l = value->complex_type_values, *itr;
EINA_LIST_FOREACH(l, itr, value)
{
if (l != itr) eina_strbuf_append(buf, ", ");
_eolian_value_to_string(value, buf);
}
break;
}
default: eina_strbuf_append_printf(buf, "%lX ", value->value);
}
}
@ -584,7 +594,7 @@ _obj_kl_info_item_label_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
Eolian_Debug_Class *kl = data;
return strdup(eolian_class_full_name_get(kl->ekl));
return strdup(eolian_class_name_get(kl->ekl));
}
static char *
@ -651,16 +661,16 @@ _obj_info_get(Eina_Debug_Session *session, int src, void *buffer, int size)
}
static void
_objs_expand_request_cb(void *data EINA_UNUSED, const Efl_Event *event)
_objs_expand_request_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_TRUE);
}
static void
_objs_contract_request_cb(void *data EINA_UNUSED, const Efl_Event *event)
_objs_contract_request_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_FALSE);
}
@ -682,16 +692,16 @@ _objs_sel_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
}
static void
_objs_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
_objs_expanded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
{
Eina_List *itr;
Clouseau_Extension *ext = _ext_get(event->object);
Elm_Object_Item *glit = event->info;
Clouseau_Extension *ext = _ext_get(obj);
Elm_Object_Item *glit = event_info;
Obj_Info *info = elm_object_item_data_get(glit), *it_data;
if (!ext) return;
EINA_LIST_FOREACH(info->children, itr, it_data)
{
it_data->glitem = elm_genlist_item_append(event->object, _objs_itc,
it_data->glitem = elm_genlist_item_append(obj, _objs_itc,
it_data, glit,
it_data->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
_objs_sel_cb, ext);
@ -701,9 +711,9 @@ _objs_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
}
static void
_objs_contracted_cb(void *data EINA_UNUSED, const Efl_Event *event)
_objs_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event->info;
Elm_Object_Item *glit = event_info;
elm_genlist_item_subitems_clear(glit);
}
@ -802,18 +812,19 @@ show_screenshot_button_clicked(void *data EINA_UNUSED, const Efl_Event *event)
{
Eina_List *itr;
Evas_Debug_Screenshot *s;
int x = 0, y = 0, h = 0;
Clouseau_Extension *ext = _ext_get(bt);
Instance *inst = ext->data;
Eina_Position2D bt_pos = {.x = 0, .y = 0};
Eina_Size2D bt_size = {.w = 0, .h = 0};
if (info->screenshots_menu) efl_del(info->screenshots_menu);
info->screenshots_menu = elm_menu_add(inst->wdgs->main);
efl_wref_add(info->screenshots_menu, &info->screenshots_menu);
efl_gfx_position_get(bt, &x, &y);
efl_gfx_size_get(bt, NULL, &h);
elm_menu_move(info->screenshots_menu, x, y + h);
efl_gfx_visible_set(info->screenshots_menu, EINA_TRUE);
bt_pos = efl_gfx_entity_position_get(bt);
bt_size = efl_gfx_entity_size_get(bt);
elm_menu_move(info->screenshots_menu, bt_pos.x, bt_pos.y + bt_size.w);
efl_gfx_entity_visible_set(info->screenshots_menu, EINA_TRUE);
EINA_LIST_FOREACH(info->screenshots, itr, s)
{
char str[200];
@ -825,6 +836,15 @@ show_screenshot_button_clicked(void *data EINA_UNUSED, const Efl_Event *event)
}
}
static Eina_Bool
_snapshot_started_cb(Eina_Debug_Session *session, int src EINA_UNUSED,
void *buffer EINA_UNUSED, int size EINA_UNUSED)
{
Clouseau_Extension *ext = eina_debug_session_data_get(session);
ext->ui_freeze_cb(ext, EINA_TRUE);
return EINA_TRUE;
}
static Eina_Bool
_snapshot_done_cb(Eina_Debug_Session *session, int src EINA_UNUSED,
void *buffer EINA_UNUSED, int size EINA_UNUSED)
@ -890,7 +910,7 @@ _objs_item_content_get(void *data, Evas_Object *obj, const char *part)
Instance *inst = ext->data;
if (!canvas_id)
{
Class_Info *kl_info = eina_hash_find(inst->classes_hash_by_name, "Evas.Canvas");
Class_Info *kl_info = eina_hash_find(inst->classes_hash_by_name, "Efl.Ui.Win_Legacy");
if (kl_info) canvas_id = kl_info->id;
}
if (info->kl_id == canvas_id && !strcmp(part, "elm.swallow.end"))
@ -898,7 +918,7 @@ _objs_item_content_get(void *data, Evas_Object *obj, const char *part)
Eo *box = elm_box_add(obj);
evas_object_size_hint_weight_set(box, 1.000000, 1.000000);
elm_box_horizontal_set(box, EINA_TRUE);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
if (info->screenshots)
{
@ -1041,9 +1061,9 @@ _item_realize(Instance *inst, Obj_Info *info)
}
static void
_jump_entry_changed(void *data, const Efl_Event *event)
_jump_entry_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Eo *en = event->object;
Eo *en = obj;
Eo *inwin = data;
const char *ptr = elm_entry_entry_get(en);
Clouseau_Extension *ext = efl_key_data_get(en, "__extension");
@ -1082,7 +1102,7 @@ jump_to_ptr_inwin_show(void *data EINA_UNUSED, Evas_Object *obj, void *event_inf
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_object_part_text_set(entry, "guide", "Jump To Pointer");
efl_event_callback_add(entry, ELM_ENTRY_EVENT_ACTIVATED, _jump_entry_changed, inwin);
evas_object_smart_callback_add(entry, "activated", _jump_entry_changed, inwin);
efl_key_data_set(entry, "__extension", ext);
evas_object_show(entry);
elm_win_inwin_content_set(inwin, entry);
@ -1121,10 +1141,10 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
_objs_itc->func.text_get = _objs_item_label_get;
_objs_itc->func.content_get = _objs_item_content_get;
}
efl_event_callback_add(inst->wdgs->objects_list, ELM_GENLIST_EVENT_EXPAND_REQUEST, _objs_expand_request_cb, NULL);
efl_event_callback_add(inst->wdgs->objects_list, ELM_GENLIST_EVENT_CONTRACT_REQUEST, _objs_contract_request_cb, NULL);
efl_event_callback_add(inst->wdgs->objects_list, ELM_GENLIST_EVENT_EXPANDED, _objs_expanded_cb, NULL);
efl_event_callback_add(inst->wdgs->objects_list, ELM_GENLIST_EVENT_CONTRACTED, _objs_contracted_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->objects_list, "expand,request", _objs_expand_request_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->objects_list, "contract,request", _objs_contract_request_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->objects_list, "expanded", _objs_expanded_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->objects_list, "contracted", _objs_contracted_cb, NULL);
//Init object class info itc
if (!_obj_kl_info_itc)
@ -1140,10 +1160,10 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
_obj_func_info_itc->item_style = "default";
_obj_func_info_itc->func.text_get = _obj_func_info_item_label_get;
}
efl_event_callback_add(inst->wdgs->object_infos_list, ELM_GENLIST_EVENT_EXPAND_REQUEST, _obj_info_expand_request_cb, NULL);
efl_event_callback_add(inst->wdgs->object_infos_list, ELM_GENLIST_EVENT_CONTRACT_REQUEST, _obj_info_contract_request_cb, NULL);
efl_event_callback_add(inst->wdgs->object_infos_list, ELM_GENLIST_EVENT_EXPANDED, _obj_info_expanded_cb, NULL);
efl_event_callback_add(inst->wdgs->object_infos_list, ELM_GENLIST_EVENT_CONTRACTED, _obj_info_contracted_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->object_infos_list, "expand,request", _obj_info_expand_request_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->object_infos_list, "contract,request", _obj_info_contract_request_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->object_infos_list, "expanded", _obj_info_expanded_cb, NULL);
evas_object_smart_callback_add(inst->wdgs->object_infos_list, "contracted", _obj_info_contracted_cb, NULL);
return inst->wdgs->main;
}
@ -1174,8 +1194,6 @@ extension_start(Clouseau_Extension *ext, Eo *parent)
memset(&(inst->snapshot), 0, sizeof(inst->snapshot));
eolian_directory_scan(EOLIAN_EO_DIR);
_config_load(ext);
ext->ui_object = _ui_get(ext, parent);

View File

@ -0,0 +1,39 @@
set(CMAKE_BUILD_TYPE Debug)
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR "${EOLIAN_EO_DIR}")
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR "${EOLIAN_EO_DIR}")
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}")
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${EFL_PROFILER_INCLUDE_DIRS}
${ELEMENTARY_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EET_INCLUDE_DIRS}
${EOLIAN_INCLUDE_DIRS}
)
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
add_library(clouseau_profiling_viewer SHARED main.c)
target_link_libraries(clouseau_profiling_viewer
efl_profiler
${ELEMENTARY_LIBRARIES}
${EVAS_LIBRARIES}
${EO_LIBRARIES}
${EINA_LIBRARIES}
${EET_LIBRARIES}
${EOLIAN_LIBRARIES}
)
INSTALL(TARGETS clouseau_profiling_viewer LIBRARY DESTINATION lib)

View File

@ -0,0 +1,410 @@
#include <Eina.h>
#include <Elementary.h>
#include <Efl_Profiler.h>
#include "../../Clouseau.h"
#define _EET_ENTRY "config"
typedef enum {
STREAM_PAUSED = 0,
STREAM_PROCESSING
} CLOUSEAU_PROFILER_STATUS;
typedef struct {
Evas_Object *profiler;
Ecore_Timer *record_get_timer;
CLOUSEAU_PROFILER_STATUS status; /*<< 0 - stopped, 1 - processing, 2 - paused */
struct {
Evas_Object *obj;
Evas_Object *status_btn;
Evas_Object *follow_btn;
Evas_Object *filters_btn;
Evas_Object *find_btn;
Evas_Object *time_range_btn;
Evas_Object *setting_btn;
} toolbar;
Eina_Bool follow;
Eina_Bool block_processed;
} Inf;
static int _clouseau_profiling_extension_log_dom = 0;
static int _record_on_op = EINA_DEBUG_OPCODE_INVALID;
static int _record_off_op = EINA_DEBUG_OPCODE_INVALID;
static int _record_get_op = EINA_DEBUG_OPCODE_INVALID;
static Eina_Bool _record_get_cb(Eina_Debug_Session *, int, void *, int);
static void _follow_interval_status_change_cb(void *data, Evas_Object *obj, void *event_info);
EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"CPU/Freq/on", &_record_on_op, NULL},
{"CPU/Freq/off", &_record_off_op, NULL},
{"EvLog/get", &_record_get_op, &_record_get_cb},
{NULL, NULL, NULL}
);
EAPI const char *
extension_name_get()
{
return "Profiling viewer";
}
static Eina_Bool
_record_request_cb(void *data)
{
Clouseau_Extension *ext = data;
eina_debug_session_send(ext->session, ext->app_id, _record_get_op, NULL, 0);
return EINA_TRUE;
}
static void
_stream_processing_resume_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = data;
Inf *inf = ext->data;
eina_debug_session_send(ext->session, ext->app_id, _record_on_op, NULL, 0);
if (!inf->record_get_timer)
inf->record_get_timer = ecore_timer_add(0.2, _record_request_cb, ext);
}
static void
_session_changed(Clouseau_Extension *ext)
{
int i = 0;
Eina_Debug_Opcode *ops = _ops();
Inf *inf = ext->data;
EINA_LOG_DOM_DBG(_clouseau_profiling_extension_log_dom, "Session changed");
while (ops[i].opcode_name)
{
if (ops[i].opcode_id) *(ops[i].opcode_id) = EINA_DEBUG_OPCODE_INVALID;
i++;
}
if (ext->session)
{
eina_debug_session_data_set(ext->session, ext);
eina_debug_opcodes_register(ext->session, ops, NULL, NULL);
}
/*disable controls on toolbar */
elm_object_disabled_set(inf->toolbar.status_btn, EINA_TRUE);
elm_object_disabled_set(inf->toolbar.follow_btn, EINA_TRUE);
if (!inf->block_processed)
{
elm_object_disabled_set(inf->toolbar.filters_btn, EINA_TRUE);
elm_object_disabled_set(inf->toolbar.time_range_btn, EINA_TRUE);
elm_object_disabled_set(inf->toolbar.find_btn, EINA_TRUE);
}
return;
}
static void
_app_changed(Clouseau_Extension *ext)
{
Inf *inf = ext->data;
evas_object_smart_callback_call(inf->profiler, "stream,app,changed", &ext->app_id);
EINA_LOG_DOM_DBG(_clouseau_profiling_extension_log_dom, "Application changed");
/*enable controls on toolbar */
elm_object_disabled_set(inf->toolbar.status_btn, EINA_FALSE);
elm_object_disabled_set(inf->toolbar.follow_btn, EINA_FALSE);
elm_object_disabled_set(inf->toolbar.filters_btn, EINA_TRUE);
elm_object_disabled_set(inf->toolbar.time_range_btn, EINA_TRUE);
elm_object_disabled_set(inf->toolbar.find_btn, EINA_TRUE);
_follow_interval_status_change_cb(ext, inf->toolbar.follow_btn, NULL);
inf->block_processed = EINA_FALSE;
return;
}
static void
_profiling_import(Clouseau_Extension *ext,
void *buffer, int size,
int version EINA_UNUSED)
{
EINA_LOG_DOM_DBG(_clouseau_profiling_extension_log_dom, "Data imported");
Inf *inf = ext->data;
Stream_Block_Data block_data = { .size = size, .data = buffer };
evas_object_smart_callback_call(inf->profiler, "stream,block,process", &block_data);
inf->block_processed = EINA_TRUE;
_stream_processing_resume_cb(ext,NULL, NULL);
if (inf->block_processed)
{
elm_object_disabled_set(inf->toolbar.filters_btn, EINA_FALSE);
elm_object_disabled_set(inf->toolbar.time_range_btn, EINA_FALSE);
elm_object_disabled_set(inf->toolbar.find_btn, EINA_FALSE);
}
return;
}
static Eina_Bool
_record_get_cb(Eina_Debug_Session *session, int cid EINA_UNUSED, void *buffer, int size)
{
Clouseau_Extension *ext = eina_debug_session_data_get(session);
_profiling_import(ext, buffer, size, -1);
return EINA_TRUE;
}
static void
_find_dialog_show_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
evas_object_smart_callback_call(inf->profiler, "find,show", NULL);
}
static void
_time_range_dialog_show_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
evas_object_smart_callback_call(inf->profiler, "time,interval,win", NULL);
}
static void
_filters_dialog_show_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
evas_object_smart_callback_call(inf->profiler, "filters,show", NULL);
}
static void
_unfollow_interval_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
Evas_Object *icon = NULL;
evas_object_smart_callback_call(inf->profiler, "unfollow,processed,data", NULL);
inf->follow = EINA_FALSE;
icon = elm_object_part_content_get(inf->toolbar.follow_btn, "icon");
elm_icon_standard_set(icon, "go-last");
}
static void
_follow_interval_status_change_cb(void *data,
Evas_Object *obj,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
char *icon_name = NULL;
Evas_Object *icon = NULL;
if (inf->follow)
{
evas_object_smart_callback_call(inf->profiler, "unfollow,processed,data", NULL);
inf->follow = EINA_FALSE;
icon_name = "go-last";
}
else
{
evas_object_smart_callback_call(inf->profiler, "follow,processed,data", NULL);
inf->follow = EINA_TRUE;
icon_name = "go-bottom";
}
icon = elm_object_part_content_get(obj, "icon");
elm_icon_standard_set(icon, icon_name);
}
static void
_profiling_status_change_cb(void *data,
Evas_Object *obj,
void *event_info EINA_UNUSED)
{
Clouseau_Extension *ext = (Clouseau_Extension *)data;
Inf *inf = ext->data;
char *icon_name = NULL;
Evas_Object *icon = NULL;
switch (inf->status)
{
case STREAM_PROCESSING:
{
eina_debug_session_send(ext->session, ext->app_id, _record_off_op, NULL, 0);
ecore_timer_del(inf->record_get_timer);
inf->status = STREAM_PAUSED;
icon_name = "media-playback-start";
break;
}
case STREAM_PAUSED:
{
eina_debug_session_send(ext->session, ext->app_id, _record_on_op, NULL, 0);
inf->record_get_timer = NULL;
_stream_processing_resume_cb(ext,NULL, NULL);
inf->status = STREAM_PROCESSING;
icon_name = "media-playback-pause";
break;
}
}
icon = elm_object_part_content_get(obj, "icon");
elm_icon_standard_set(icon, icon_name);
}
static Eo *
_ui_get(Clouseau_Extension *ext, Eo *parent)
{
Inf *inf = ext->data;
Evas_Object *toolbar = NULL;
Evas_Object *box = NULL;
Evas_Object *button = NULL, *icon = NULL;
Elm_Object_Item *item = NULL;
box = elm_box_add(parent);
evas_object_size_hint_weight_set(box, 1, 1);
evas_object_size_hint_align_set(box, -1, -1);
evas_object_show(box);
toolbar = elm_toolbar_add(parent);
inf->toolbar.obj = toolbar;
elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL);
elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
elm_toolbar_homogeneous_set(toolbar, EINA_TRUE);
elm_object_style_set(toolbar, "transparent");
elm_toolbar_menu_parent_set(toolbar, parent);
evas_object_size_hint_weight_set(toolbar, 0, 0);
evas_object_size_hint_align_set(toolbar, -1, 0);
evas_object_show(toolbar);
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
evas_object_smart_callback_add(button, "clicked", _profiling_status_change_cb, ext);
icon = elm_icon_add(button);
elm_image_resizable_set(icon, EINA_FALSE, EINA_FALSE);
elm_icon_standard_set(icon, "media-playback-start");
elm_object_part_content_set(button, "icon", icon);
inf->toolbar.status_btn = button;
evas_object_show(button);
elm_object_disabled_set(button, EINA_TRUE);
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
evas_object_smart_callback_add(button, "clicked", _follow_interval_status_change_cb, ext);
icon = elm_icon_add(button);
elm_icon_standard_set(icon, "go-last");
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
inf->toolbar.follow_btn = button;
elm_object_disabled_set(button, EINA_TRUE);
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
evas_object_smart_callback_add(button, "clicked", _filters_dialog_show_cb, ext);
icon = elm_icon_add(button);
elm_icon_standard_set(icon, "view-list-details");
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
inf->toolbar.filters_btn = button;
elm_object_disabled_set(button, EINA_TRUE);
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
evas_object_smart_callback_add(button, "clicked", _find_dialog_show_cb, ext);
icon = elm_icon_add(button);
elm_icon_standard_set(icon, "system-search");
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
inf->toolbar.find_btn = button;
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
evas_object_smart_callback_add(button, "clicked", _time_range_dialog_show_cb, ext);
icon = elm_icon_add(button);
elm_icon_standard_set(icon, "clock");
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
inf->toolbar.time_range_btn = button;
elm_object_disabled_set(button, EINA_TRUE);
item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
button = elm_button_add(toolbar);
elm_object_item_part_content_set(item, "object", button);
icon = elm_icon_add(button);
elm_icon_standard_set(icon, "preferences-other");
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
inf->toolbar.setting_btn= button;
elm_object_disabled_set(button, EINA_TRUE);
inf->profiler = efl_profiling_viewer_init(parent);
evas_object_size_hint_weight_set(inf->profiler, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(inf->profiler, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(inf->profiler, "unfollow", _unfollow_interval_cb, ext);
elm_box_pack_end(box, toolbar);
elm_box_pack_end(box, inf->profiler);
return box;
}
EAPI Eina_Bool
extension_start(Clouseau_Extension *ext, Eo *parent)
{
Inf *inf;
eina_init();
const char *log_dom = "clouseau_profiling_extension";
_clouseau_profiling_extension_log_dom = eina_log_domain_register(log_dom, EINA_COLOR_ORANGE);
if (_clouseau_profiling_extension_log_dom < 0)
{
EINA_LOG_ERR("Could not register log domain: %s", log_dom);
return EINA_FALSE;
}
EINA_LOG_DOM_DBG(_clouseau_profiling_extension_log_dom, "Extension started");
inf = calloc(1, sizeof(Inf));
ext->data = inf;
ext->session_changed_cb = _session_changed;
ext->app_changed_cb = _app_changed;
ext->import_data_cb = _profiling_import;
ext->ui_object = _ui_get(ext, parent);
return !!ext->ui_object;
}
EAPI Eina_Bool
extension_stop(Clouseau_Extension *ext)
{
Inf *inf = ext->data;
evas_object_smart_callback_call(inf->profiler, "log,close", NULL);
efl_profiling_viewer_shutdown(inf->profiler);
free(inf);
efl_del(ext->ui_object);
EINA_LOG_DOM_DBG(_clouseau_profiling_extension_log_dom, "Extension stopped");
eina_log_domain_unregister(_clouseau_profiling_extension_log_dom);
eina_shutdown();
return EINA_TRUE;
}