Compare commits

...

265 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
Daniel Zaoui e2dbf08cb2 Fix strings support 2017-07-02 16:50:10 +03:00
Daniel Zaoui 9d75e1a5db Highlight objects selected in the details view
This is a porting of 24a971509b, as it has
been lost during the rewriting of Clouseau.

It has been adapted to fit the new protocol.
2017-06-26 11:22:41 +03:00
Daniel Zaoui a7432b429c Set default function return type 2017-06-26 11:21:25 +03:00
Daniel Zaoui 0808f42643 Fix classes buffer filling
Some buffers of 2K were allocated in the stack during the classes
buffering.
A crash was happening when the data was too big to fill most of the
stack buffer. This was rewriting the stack frames information.
2017-06-25 18:18:24 +03:00
Daniel Zaoui f588374b06 Fix classes hierarchy display
Interfaces were not handled correctly. The consequence was that they
were not displayed in the object information.
2017-06-25 18:18:24 +03:00
Daniel Zaoui 252f013174 Disable main window blocking when displaying a screenshot 2017-06-25 11:11:40 +03:00
Daniel Zaoui 390739d795 Improve screenshot feature
Ecore X functions are not used anymore. An Evas snapshot is created and
its data is stored when the RENDER POST event is invoked on the canvas.

It fixes the random black screenshot and the constant black region at
the bottom of the window (probably caused by some change made on the
title bar management, as it seems to be the exact size).
2017-06-25 11:11:40 +03:00
Daniel Zaoui 287e8498a7 Check strings nullity before strcmp 2017-06-23 09:58:40 +03:00
Daniel Zaoui bbd9525f4b Extension: remove nickname
name field is enough, even for configurations files.
2017-06-22 21:10:26 +03:00
Daniel Zaoui 524541c49d Improve functions tooltip display 2017-06-21 09:57:09 +03:00
Daniel Zaoui cdd91eb12c Show elements of lists
Elements of lists of Eo functions are now displayed.

Iterators are converted to lists before packing.
2017-06-21 09:35:18 +03:00
Daniel Zaoui 07474f14b7 Fix function line display
When a return value is the only parameter of the function, a blank name
was displayed.
Additionally, the param name is not shown if there is only one parameter
for the function.
2017-06-16 11:52:00 +03:00
Daniel Zaoui 9416c31515 Don't show invalid extensions
In case the library has not been found, we don't display it in the
available extensions list.
2017-06-16 11:37:06 +03:00
Daniel Zaoui c394331763 Permit extension import
A file selector is displayed so the user can select the library to load
as a Clouseau extension.
2017-06-12 11:02:10 +03:00
Daniel Zaoui b745bd6d7e Hide settings button as we don't need it 2017-06-12 10:22:59 +03:00
Daniel Zaoui d89f624d7e New version of Clouseau
This version uses Eina Debug as basis for all its communication with the
application.
All the UI and the core have been rewritten.
It supports the features of the old version of Clouseau (screenshot,
snapshot, highlight) although snapshot format is not the same, and
therefore, old snapshots won't work.
The extensions part has been redesigned.

Clouseau can connect to a local or remote application, as long as a
tunnel forwarding the port 6666 is established for the remote
connection.
2017-06-07 14:09:43 +03:00
Daniel Zaoui 43cfe6d441 Objects_Intro/settings: fix crash when filtering objects 2017-06-06 11:29:18 +03:00
Daniel Zaoui 446e39c0e3 Open the last extension used at the previous run 2017-06-06 10:51:15 +03:00
Daniel Zaoui 31d522b386 Fix classes lookup 2017-06-06 10:30:17 +03:00
Daniel Zaoui 7ce0b23e7a Remove unused include 2017-06-06 10:30:17 +03:00
Daniel Zaoui 774142353a Remove old library usage 2017-06-06 10:30:17 +03:00
Daniel Zaoui 74f279bcaf Free buffers after sending them 2017-06-06 10:30:17 +03:00
Daniel Zaoui bd725339bc Adapt opcodes registration for Windows 2017-06-06 10:30:17 +03:00
Daniel Zaoui c982cb8685 Support endianness 2017-06-06 10:30:17 +03:00
Daniel Zaoui 73a790e331 Rename opcodes strings for a better readability 2017-06-06 10:30:17 +03:00
Daniel Zaoui 952c243721 Adapt code to EFL changes 2017-06-06 10:30:17 +03:00
Daniel Zaoui 6e21f6d620 Use Eo iterators 2017-06-06 10:30:17 +03:00
Daniel Zaoui 50ea3a2740 Fix coverity issues 2017-06-06 10:30:17 +03:00
Daniel Zaoui 0baf933727 Adapt to EFL changes 2017-06-06 10:30:17 +03:00
Daniel Zaoui 8f52887d57 Use better names for daemon operations 2017-06-06 10:30:17 +03:00
Daniel Zaoui 7f709213b4 Replace remote profile support with remote port 2017-06-06 10:30:17 +03:00
Daniel Zaoui 7bf7b0a431 Set title 2017-06-06 10:30:17 +03:00
Daniel Zaoui 9948eea27a Merge the Eo/Evas/Eolian into Clouseau 2017-06-06 10:30:17 +03:00
Daniel Zaoui 57773aea05 Adapt remote connection to latest EFL changes 2017-06-06 10:30:17 +03:00
Daniel Zaoui b395635dd3 EvLog: support direct recording from the application 2017-06-06 10:30:17 +03:00
Daniel Zaoui 44aa6dd03e Fix main UI 2017-06-06 10:30:17 +03:00
Daniel Zaoui ab69add6d3 Add evlog.edc and install data images 2017-06-06 10:30:17 +03:00
Daniel Zaoui b309fa2bc2 Support storing snapshot of all the running extensions into one file
When the user wants to save the data (snapshot), Clouseau requests from
every running extension the data that is "exported".
All the data are then encapsulated into one single file.
The first idea was to use EET to store the extensions blobs as basic var
arrays. But it was taking so much time that is has been chosen that the
data itself is appended in the file after the EET blob. This one only
contains the app name/pid and the number of bytes of the blob, per
extension.
Additionnally, the objects introspection extension has been modified to
behave as the first Clouseau, i.e taking all the objects information in
one shot and using it during the interaction with the user.
The Save/Load button is now a part of the main toolbar.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 6daf22321a evlog: support data import 2017-06-06 10:30:17 +03:00
Daniel Zaoui 80c18f3bd5 Resurrect the -f option
It has been removed when the extentions feature has been introduced.

Now, when -f is used in the command line, a list of extensions is
displayed to request the user to choose the extension that needs to
handle this file.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 3c80e7bb46 Support of evlog as an extension 2017-06-06 10:30:17 +03:00
Daniel Zaoui 9fc5c432bf Introduce the extensions feature
The objects introspection, that has always been as a core part, is now
an extension, and can be not used.
The directories structure allows other extensions to be developed inside
the Clouseau tree, even if they can be developed outside.

Other extensions will be added and the extensions feature will be
adapted to fit all their requirements.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 88420d78d4 Remove unused code 2017-06-06 10:30:17 +03:00
Daniel Zaoui 4f5e0fde15 Move Clouseau module inside this repository 2017-06-06 10:30:17 +03:00
Daniel Zaoui 236a4f1c15 Support remote connection 2017-06-06 10:30:17 +03:00
Daniel Zaoui 17d00e68a9 Remove fake session use
All can be done without the intervention of Eina_Debug. We just need to
dispatch the packets by their own opcode.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 4d119765aa Redesign the tools bar
Now a toolbar widget is used instead of a box.
The settings window has been replaced by a menu, as well as the apps and
connection hoversels.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 5d65effa28 Support screenshots save in snapshot file 2017-06-06 10:30:17 +03:00
Daniel Zaoui 987d9bc250 Adapt to Evas Debug changes 2017-06-06 10:30:17 +03:00
Daniel Zaoui 358139179d Implement snapshot load 2017-06-06 10:30:17 +03:00
Daniel Zaoui d38d8f4b1b Improve object info access code 2017-06-06 10:30:17 +03:00
Daniel Zaoui 7cf8e2e425 Add snapshot save feature
It doesn't save the screenshots yet. Should be done soon.

During save, the UI is frozen until the last packet is received.

The snapshot file contains info about the application, opcodes that will
be needed during loading and the buffers received from the application
describing the objects and their information.
2017-06-06 10:30:17 +03:00
Daniel Zaoui 7cb901e58f Store apps info into a dedicated structure 2017-06-06 10:30:11 +03:00
Daniel Zaoui 4a2c702778 Fix apps hoversel during selection 2017-06-06 10:28:31 +03:00
Daniel Zaoui a42bc82db8 Fix functions names typo 2017-06-06 10:28:31 +03:00
Daniel Zaoui ca58cb9f9b Support screenshots download and display
Many shots can be taken and displayed. Timestamp is set to each.

To do:
- Fix black bottom region
2017-06-06 10:28:31 +03:00
Daniel Zaoui 07710c01fc Implement jump to pointer feature 2017-06-06 10:28:31 +03:00
Daniel Zaoui e2869aa298 Implement highlight option 2017-06-06 10:28:30 +03:00
Daniel Zaoui 449d833d80 Implement reloading 2017-06-06 10:28:30 +03:00
Daniel Zaoui 0a99a22086 Remove prints 2017-06-06 10:28:30 +03:00
Daniel Zaoui febe013c2e Add missing elements to the toolbar 2017-06-06 10:28:30 +03:00
Daniel Zaoui 601eb80e07 Support parameters
Connection type can be chosen.
2017-06-06 10:28:30 +03:00
Daniel Zaoui a792302ca9 Remove the profiles window
It was useless, ugly and not functional.

Now you can choose the connection type by opening the connections menu
in the main window.
In this way, you can easily choose the remote profile or move to another
connection type.
2017-06-06 10:28:30 +03:00
Daniel Zaoui 73dff60926 Enable Eolian params retrieval 2017-06-06 10:28:30 +03:00
Daniel Zaoui e9eb0d29bc Shorten opcodes variables names 2017-06-06 10:28:30 +03:00
Daniel Zaoui 9b9ab9f07f New features
Adapt to eina_debug latest changes
Support multi-threads objects
Improve modules initialization
Add config window
Support all Evas objects or Elm Widgets display
2017-06-06 10:28:30 +03:00
Daniel Zaoui 03423ff979 First patch for the Clouseau rewriting
- Removal of all old code
- Create the new directories tree
- Move to cmake
- Connection to daemon
2017-06-06 10:26:45 +03:00
Vyacheslav Reutskiy b79b2f9033 clouseau_client: expand/collapse item by double click
Open/Close the tree item in Genlist by double click make work with
clouseau more comfortable.
2017-04-26 09:44:04 +03:00
Daniel Zaoui ee36702153 Invoke server del/free only if needed 2017-03-06 10:00:55 +02:00
Shuhrat Dehkanov a2af39e8cd Remove redundant addition operator
Reviewers: marcelhollerbach, cedric, minkyu, bu5hm4n

Reviewed By: minkyu, bu5hm4n

Subscribers: bu5hm4n, minkyu

Differential Revision: https://phab.enlightenment.org/D4481
2016-12-16 09:38:24 +01:00
Marcel Hollerbach ce049917b2 clouseau_client: use cnp when string is clicked
Copy the string content of a value into the selection buffer once its
clicked.
2016-11-21 20:24:47 +01:00
Marcel Hollerbach d4aaaad679 clouseau_pre: add backtraces to every eo object
they are added now to the debug informations. In the new code it is created
in the style of eina_backtrace, so the backtraces can be made visible with
eina_btlog.
2016-11-21 20:24:47 +01:00
Marcel Hollerbach 01d83bd6bd clouseau_client: do not compact items which are bigger than 10 items
otherwise things are getting really unreadable
2016-11-21 20:24:47 +01:00
Marcel Hollerbach 24a971509b closeau: highlight objects in the detail view
if there is a pointer in the detailview, and the pointer is clicked,
highlight the object which is pointed to by that pointer.

You can test this patch by downloading
https://devs.enlightenment.org/~bu5hm4n/elm_focus_test
and opening the file in clouseau's offline mode. The elements with
can_focus=1 are having a focus section in the property view, if you
click on those, and the screenshot is open, you will see a highlight.
2016-11-21 20:24:47 +01:00
Shuhrat Dehkanov eafc27dc05 call _shutdown() before return/exit
Reviewers: jeanguyomarch, cedric

Reviewed By: cedric

Subscribers: minkyu

Differential Revision: https://phab.enlightenment.org/D4394

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-11-17 15:55:26 -08:00
Marcel Hollerbach eac39b5359 clouseau_client: add command line options
with -f you can specify a file which will get loaded. With -a you can
specify a address of a daemon.
2016-11-15 18:00:22 +01:00
Marcel Hollerbach b4bc63f028 clouseau_client: change the name of those symbols,
because of the preload, and the fact that _add is also used in
clouseau_app.c it was not possible to connect to a deamon while beeing in
a clouseau_start environment.

This enables the usecase of starting enlightenment with "clouseau_start
enlightenment_start" now you can connect with clouseau_client to your e
and debug the widgets.
2016-11-15 17:59:57 +01:00
Marcel Hollerbach e53de2b36c clouseau_data: use EET_COMPRESSION instead of EINA_TRUE
even if its not a functional change, passing there a boolean value is
wrong, it requires a compression from the enumaration
2016-11-14 13:46:25 +01:00
Marcel Hollerbach e462833622 clouseau_data: use stream not file
if a Clouseau item is added via a function call stringshares are used.
To get the same allocation when reading the Clouseau item from the fs we
can use eina stream instead of eina file. This fixes T4888.
2016-11-14 13:46:25 +01:00
Marcel Hollerbach 9083738d10 clouseau: lets bring back highlight in offline mode
if the screenshot of a offline app is open it will be highlighted again.
The problem was that the highlight in the offline mode still worked with
legacy data which was not generated. Now this informations are just
searched from the Efl_Dbg_Info structs.

To test this you can just take a screenshot of a app, save the app with
the button in the upper right. Then start clouseau again in offline
mode, after that you can select a file. Select the file where you have
saved your app before. If you now display the screenshot and click on a
element, this object is displayed.
2016-11-14 13:46:12 +01:00
Cedric Bail 11c42ebdf9 actually returning a value != from 0 would be more useful. 2016-11-11 10:55:16 -08:00
Shuhrat Dehkanov 9f62d59140 return 0 from main()
Summary:
Although, underlying value of EINA_FALSE is 0 the type former is Bool.
Hence, for the sake of consistency, let's return 0 from main().

Reviewers: jeanguyomarch, jeyzu

Subscribers: hyunseok, minkyu

Differential Revision: https://phab.enlightenment.org/D4392

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-11-11 09:47:05 -08:00
Jean Guyomarc'h 92abcec41b lib: fix compile-time warning
The expected type of the parameter to eet_data_image_read()
is Eet_Image_Encoding*, but int* was passed.
2016-08-21 22:00:42 +02:00
Jérémy Zurcher 0f9a7e2d03 follow namespace switch from Eo to Efl 2016-08-18 09:41:36 +02:00
Tom Hacohen c18c74eb29 Adjust according to changes in efl. 2016-06-22 17:29:40 +01:00
Tom Hacohen 0773475ab0 Adjust according to recent Eo4 changes. 2016-03-03 14:02:26 +00:00
Amitesh Singh a56abd48ab increase the genlist scroll height a bit
Genlist scrolls when no. items are higher than eight.
2015-08-26 09:42:30 +05:30
Amitesh Singh 7cf2984305 use hover + genlist instead of hoversel.
Summary: This is required to support scroll in case of application list is long.

Reviewers: tasn

Subscribers: seoz

Differential Revision: https://phab.enlightenment.org/D2800
2015-07-15 10:08:39 +01:00
Tom Hacohen 237f6e1cc1 Add arc config. 2015-07-08 12:12:12 +01:00
Daniel Zaoui 6ea12a9746 Fix display of UINT64 in compactable lists
UINT64 should be displayed in hexadecimal.
2015-06-15 13:12:26 +03:00
Daniel Juyung Seo 32e1b22404 client: Focus the entry on startup. 2014-11-14 18:55:05 +09:00
Tom Hacohen a99981bada Update code to use the new class names generated by eolian 2014-06-03 11:52:39 +01:00
Daniel Juyung Seo 492fe62a85 client: do not use deprecated APIs.
elm_fileselector_button_is_save_set -> elm_fileselector_is_save_set
elm_fileselector_button_path_set -> elm_fileselector_path_set
2014-04-14 00:41:17 +09:00
Tom Hacohen e2f255684d Show edje part name in the client.
This shows the part name of an edje part in the client. It uses the mock
class "Edje_Part" Which is appended at the end of the class list.
2014-03-31 16:36:57 +01:00
Tom Hacohen 450b8bf916 Only call smart members get on smart objects. 2014-03-14 12:02:03 +00:00
Jean-Philippe Andre 79bfcef585 Fix crash in clouseau client
Reproducible crash on NULL pointer when clicking, in the right panel,
on an Evas_Image entry.

This happened to me when inspecting E itself, in
the Wallpaper Settings panel in particular.
2014-01-13 13:43:38 +09:00
Tom Hacohen 15ac4b90ac Client: An hack to fix jump to entry. 2014-01-07 10:55:10 +00:00
Tom Hacohen e764f9552f Canvas Sanity Checker: Implemented first version.
This is as requested by Mike T660.
I think the logic doesn't make sense, but I implemented it as requested.

This fixes T660.
2013-12-31 15:13:46 +00:00
Tom Hacohen 506d32917a Client: Fixed pointer printing.
A fix to bbdcab85c8.
2013-12-31 14:13:52 +00:00
Tom Hacohen 9935915231 Fixed assignment of NULL to an int (changed to 0). 2013-12-31 13:55:13 +00:00
Tom Hacohen bbdcab85c8 Client: Fixed pointer printing. 2013-12-31 13:22:33 +00:00
Tom Hacohen a3b8caf5c9 Added stub module -- currently disabled. 2013-12-30 15:54:45 +00:00
Tom Hacohen 038457f44c Client: Added basic extensions support.
Quite hackish. API is subject to changes. Doesn't really let you do much
at the moment. Only list and run modules from the menu.
2013-12-30 15:52:07 +00:00
Tom Hacohen e6800e9c9d Return to previously selected item on reload. 2013-12-16 17:16:36 +00:00
Tom Hacohen c3166d6a5d Client: Merged several instances of a string into a macro. 2013-12-13 12:49:16 +00:00
Tom Hacohen 18ce861cff Revert "Clouseau: Don't clear the list if an app has exited."
It's not correct. It breaks cleaning up of apps that have been closed,
even if not currently open. Should be reworked.

This fixes T638.

This reverts commit 81d2d9d021.
2013-12-13 12:48:54 +00:00
Tom Hacohen 758e8e8249 App: Changed unknown app name from clouseau to unknown.
Should make what happenning more obvious.
2013-12-13 12:24:25 +00:00
Tom Hacohen 896a0b2f5e App: Show legacy object types for old smart classes.
Those kinds of classes return Evas_Smart as the Eo object type
which is not really useful.
This change makes the visible value nicer "Smart_Class (Eo_Class)".

First step towards fixing T638.
2013-12-13 12:00:01 +00:00
Tom Hacohen b8c6c03b66 Enable the macro needed to use Eo API. 2013-12-13 11:59:58 +00:00
Daniel Juyung Seo 2d044dd76a Client: Use popup instead of inwin for the config dialog. 2013-11-07 23:01:48 +09:00
Tom Hacohen 618a820e3b client: init the config pointer to NULL. 2013-11-07 13:44:08 +00:00
Tom Hacohen 0b37c98fc5 client: updated Elm-only to work with recent elm changes. 2013-11-07 11:45:51 +00:00
Tom Hacohen 763175865e client: get eo class name, not evas object name as name.
The Eo class name works for more types of objects and is also more
correct.
2013-11-07 10:37:56 +00:00
Tom Hacohen 25ad368bfd client: put object name before the pointer.
This looks much better and much more usable.
2013-11-07 10:30:36 +00:00
Tom Hacohen f86d84faa8 Client: Allow users (on by default) to only show elm widgets.
This lets users choose to only see elm widgets, no "low-level" objects.
This is simpler for most people, but some more advanced users would
still prefer seeing the low-level objects.
2013-11-07 10:13:41 +00:00
Tom Hacohen 87c046e9ad Client: Added a GUI settings dialog.
This is a continuation of the previous commit actually letting you
control the settings from a nice settings dialog.
2013-11-07 10:11:46 +00:00
Tom Hacohen 8cabe8fb7c client: only show elm widget (config option, no GUI).
This commit changes clouseau to only show elm widgets (no evas/edje/or
whatever). This is controllable by config (eet), but no GUI for it just
yet.
2013-11-06 17:14:56 +00:00
Tom Hacohen 91edbfe243 client: Also delete the backtrace label.
I forgot to remove that when removing the backtrace panel.
2013-11-06 17:10:08 +00:00
Tom Hacohen bef368ce35 client: made the config persistent. 2013-11-06 17:04:15 +00:00
Tom Hacohen cedce52f13 Fixed stupid gitignore. 2013-11-06 17:03:26 +00:00
Tom Hacohen d95fc3e02b Get rid of the bottom backtrace panel for the meanwhile. 2013-11-06 16:12:29 +00:00
Daniel Zaoui e79702cbb9 Pointer search: navigation to the widget was not working.
strtol was used to convert the string into a number. For no reason, it
returns -1 (maybe due to the pointer MSB to 1).
Now, we use strtoul because we really don't care about some sign.
2013-10-20 19:51:41 +03:00
discomfitor 4a9c23648a fix crash from connection errors where address is NULL (don't ask) 2013-10-20 16:52:22 +01:00
Rafael Antognolli d95ff67dd6 Make systemd config files installation optional. 2013-10-03 15:52:00 -03:00
Tom Hacohen 81d2d9d021 Clouseau: Don't clear the list if an app has exited. 2013-10-02 17:28:45 +01:00
Tom Hacohen bded5a9950 Highlight map area of object if exists.
This changes the highlighting code to highlight the map geometry of an object
instead of it's geometry when highlighting a mapped object.

While doing that, I also simplified the highlighting code a bit, more
specifically, removed the unused PADDING option.
2013-09-12 16:10:01 +01:00
Carsten Haitzler 5178b28ce6 add some frame padding to the widget layout... looks nicer. 2013-09-10 18:36:30 +09:00
Tom Hacohen dd93bda89d Always put the hilight object at the highest layer. 2013-09-06 17:02:11 +01:00
Tom 'TAsn' Hacohen 78d88626c8 Use elm guide in the 'Jump To' field and improve it a bit. 2013-08-30 11:55:33 +01:00
Tom Hacohen 2d737c67c2 Better comply to our coding convention. 2013-08-19 14:12:04 +01:00
Tom Hacohen 9588ca1a5c Added a "Jump To" entry.
This lets us jump to specific objects in the tree. Really useful.
2013-08-19 13:34:38 +01:00
Tom Hacohen 7638eb7c4f Button text: Less shouting in the UI's text. 2013-08-16 14:34:09 +01:00
Tom Hacohen da084b320a Change the text on "Load Tree" button to "Reload" right from the start. 2013-08-16 14:32:23 +01:00
Cedric Bail 3521719685 clouseau: we are using beta API. 2013-07-23 11:39:54 +09:00
Cedric Bail a9bad4f65d clouseau: fix header order. 2013-07-23 11:39:35 +09:00
Daniel Zaoui 47ee4cc859 Clouseau: add possibility to give the IP and port as parameters.
Now, you can execute clouseau_client with the optional parameters ip and
port. The format is clouseau_client [ip:[port]].
2013-06-04 11:03:06 +03:00
Tom Hacohen e1a515321a Free the con_server after the eet_server.
Thanks to JackDanielZ for finally being useful. ;P
2013-05-21 14:19:03 +01:00
Tom Hacohen 9a06a9b433 Actually disconnect clouseau clients when requested. 2013-05-21 14:11:19 +01:00
Tom Hacohen 337a44976a Added clouseau_app_disconnect and added a call for it. 2013-05-20 15:04:17 +01:00
Tom Hacohen 9df23ed8d7 Call clouseau_disconnect on shutdown. 2013-05-20 14:59:19 +01:00
Doug Newgard 951c057863 Update v_rev for switch to Git. 2013-05-07 11:42:55 +01:00
Doug Newgard 801f6f8b78 Add Eo to EFL requirements. 2013-05-07 11:41:42 +01:00
Tom Hacohen 3ae0b13de7 Override ELM_CLOUSEAU env var so we don't inspect ourselves. 2013-04-29 15:17:06 +01:00
Tom Hacohen 892497273a Cleaned up script generation and got rid of the atrocious gen_script.sh 2013-04-19 17:02:54 +01:00
Cedric Bail 85432f9a10 always distribute the .service/.socket. 2013-04-13 10:55:00 +09:00
Jérémy Zurcher cd2a4b9d00 remove *~ file and add pattern to gitignore 2013-04-08 00:58:47 +02:00
Cedric BAIL 4c41468124 clouseau: wheel need elm_progressbar_pulse_set to spin. 2013-03-18 15:38:31 +09:00
Cedric Bail b9296086cb clouseau: add support for systemd user session. 2013-03-17 11:52:10 +09:00
Daniel Zaoui d2a95a6c42 Clouseau: Fix for class layers displaying.
The bugs happens when a class layer doesn't contain lists (like edje).
The item will be set as tree but the text_get function will check if it
can be compacted and will return true. So we will have the info inside
edje displayed twice, on the layer line and as items of the layer.

The fix forces the layer item to be a tree, no matter the nature of the
contents. It has been done by assigning an item class different for
layers and for infos inside layers. The text_get of the layer item class
just returns the name of the layer without compaction.
2013-02-26 16:54:43 +02:00
Daniel Zaoui 8e0ab01156 Clouseau: Merge list elements into one line
This change only affects the clouseau_client appearance.
The merge is done if there are only basic types into the list (i.e no
other lists).
This has been done to be backward compatible with the previous client
displaying way.

Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 84373
2013-02-26 06:29:30 +00:00
Tom Hacohen d9e6561d08 Clouseau: Fixed a leak.
SVN revision: 83953
2013-02-15 13:15:56 +00:00
Tom Hacohen 7a39938657 Clouseau: Ship the header file.
Although it's not usable at the moment because it actually includes non-shipped
headers. This will be solved soon, this is just infra work.

SVN revision: 83697
2013-02-06 17:52:06 +00:00
Tom Hacohen d32bbe9895 Clouseau: Start Daemon from app instead of script.
SVN revision: 83694
2013-02-06 15:55:53 +00:00
Tom Hacohen 5effaef84b Clouseau: Moved private enum to the private header.
SVN revision: 83693
2013-02-06 15:55:51 +00:00
Tom Hacohen 4d951106c6 Clouseau: Cleaned up preload a bit and moved more to lib.
SVN revision: 83692
2013-02-06 15:55:48 +00:00
Tom Hacohen 71bd89eb2b Clouseau: Started spliting clouseau.c
SVN revision: 83691
2013-02-06 15:55:46 +00:00
Tom Hacohen af32e57679 Clouseau: Some scope and naming clean-ups.
SVN revision: 83690
2013-02-06 15:55:44 +00:00
Tom Hacohen cc28cbfbbc Clouseau: Pass appname to client_connect, not init.
SVN revision: 83689
2013-02-06 15:55:41 +00:00
Tom Hacohen 20df08e176 Clouseau: libclouseau_preload is now correctly split.
SVN revision: 83681
2013-02-06 13:19:28 +00:00
Aharon Hillel eb977554a7 Clouseau: Rename files to stop confusion.
src/bin: clouseau.c to clouseau_client.c
src/lib: clouseau_client.c to clouseau.c

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 83650
2013-02-06 06:19:22 +00:00
Tom Hacohen 8c2a96b8aa Clouseau: Fixed bad change to use pointer for type in the eet.
SVN revision: 83631
2013-02-05 13:53:44 +00:00
Tom Hacohen e9fe6cb2c0 Clouseau: Minor cosmetic changes.
SVN revision: 83534
2013-01-31 18:05:32 +00:00
Tom Hacohen 5f9e775820 Clouseau: Fix seg on 32 bit.
SVN revision: 83528
2013-01-31 16:30:48 +00:00
Tom Hacohen 18e031694d Clouseau: renamed the libs.
libclouseau.so -> libclouseua_preload.so
libclouseau_client.so -> libclouseau.so

SVN revision: 83515
2013-01-31 12:00:10 +00:00
Tom Hacohen 74407dec92 Clouseau: Changed file naming a bit.
Preload is now in it's own file. Will sort the lib names next.

SVN revision: 83514
2013-01-31 12:00:07 +00:00
Tom Hacohen ca8f724773 Clouseau: Fixed a (potential?) memory leak.
SVN revision: 83512
2013-01-31 11:10:01 +00:00
Tom Hacohen 54ffd3ebc9 Clouseau: Moved the legacy eet descriptors to a separate file.
This cleans up the code a bit and will let us get rid of it
easily when the time comes.

SVN revision: 83510
2013-01-31 11:01:16 +00:00
Tom Hacohen 12c379a500 Clouseau: Remove the Clouseau.h header and use clouseau_private2.h instead.
This wasn't really a public header. It exposed a lot of stuff it shouldn't have and it was just confusing.
We'll just create a public header when we'll be ready, i.e know
exactly what we need to expose.

SVN revision: 83492
2013-01-30 17:18:16 +00:00
Tom Hacohen baae415aee Clouseau: We don't need access to internal elm stuff.
SVN revision: 83491
2013-01-30 17:18:14 +00:00
Tom Hacohen 8d5ad68be6 Clouseau: Use the new Eo_Dbg_Info a bit more.
The mission: use it all across. Atm we still rely on it because of the
eet conversion.

SVN revision: 83490
2013-01-30 17:18:11 +00:00
Tom Hacohen a709682d07 Clouseau: Fixed memory leak.
SVN revision: 83489
2013-01-30 17:18:08 +00:00
Tom Hacohen c02621026f Clouseau: Added legacy<->eina value conversion functions.
SVN revision: 83488
2013-01-30 17:18:05 +00:00
Tom Hacohen 1de87473e9 Clouseau: Minor clean up.
SVN revision: 83487
2013-01-30 17:18:03 +00:00
Tom Hacohen f9c664c014 Clouseau: type should be LONG LONG.
SVN revision: 83486
2013-01-30 16:47:51 +00:00
Tom Hacohen c87ffb64a0 Clouseau: Some more cleanups.
SVN revision: 83482
2013-01-30 13:46:27 +00:00
Tom Hacohen 456bf94cea Clouseau: Improved log messages a bit.!
SVN revision: 83477
2013-01-30 11:23:03 +00:00
Tom Hacohen f8fb1f73f5 Clouseau: Remove some client specific stuff from the lib.
SVN revision: 83475
2013-01-30 11:13:50 +00:00
Tom Hacohen 3d4fd428a0 Clouseau: Use the new Eo_Dbg_Info structure.
SVN revision: 83446
2013-01-29 16:36:25 +00:00
Tom Hacohen 0483c95e54 Clouseau: Removed useless code.
SVN revision: 83445
2013-01-29 16:36:23 +00:00
Tom Hacohen fb34d37986 Clouseaud: Make it POSIX instead of linux only.
SVN revision: 83435
2013-01-29 14:08:18 +00:00
Tom 'TAsn' Hacohen 1b8a403058 Clouseau: Remove the daemonising code, use proper logging and proper locking.
Signed-off-by: Tom 'TAsn' Hacohen <tom@stosb.com>

SVN revision: 83434
2013-01-29 13:56:49 +00:00
Daniel Zaoui 119cfd5235 Clouseau: Added static to private functions
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 83425
2013-01-29 10:11:49 +00:00
Aharon Hillel 9eff55d073 Clouseau: Added EO info support
The Clouseau client is compatible with old Clouseau applications
supporting EcoreConnEet.

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 83412
2013-01-29 06:39:51 +00:00
Tom Hacohen c2894f28ac Clouseau: Make script less awful.
SVN revision: 83391
2013-01-28 20:43:53 +00:00
Tom Hacohen 33cbf06c7f Clouseau: Fix warnings.
SVN revision: 82888
2013-01-16 13:47:57 +00:00
Leif Middelschulte 39a13121e4 Yet another LC_ALL=C'ed svnversion output for grep
SVN revision: 82833
2013-01-15 17:41:21 +00:00
Cedric BAIL 7922047e6e clouseau: is going to become more a library infra than just a tool.
SVN revision: 82401
2013-01-08 10:17:41 +00:00
Cedric BAIL 275a69a11d autotools: move to AC_CONFIG_HEADERS.
Patch by Doug Newgard <scimmia22@outlook.com>.


SVN revision: 82135
2013-01-04 00:55:00 +00:00
Daniel Juyung Seo fadfa0a3a2 clouseau clouseau.c: Use entry activated smart callback for remote address.
SVN revision: 81718
2012-12-26 16:34:13 +00:00
Daniel Zaoui 5ad51a30b8 Fix segmentation fault when the file dialog of snapshot feature is
opened, closed (cancel button), reopened and save is clicked.

Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 81657
2012-12-23 11:58:58 +00:00
Daniel Zaoui 98a23a6112 Fix segmentation fault if no bitmap was present in the snapshot file
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 81653
2012-12-23 09:07:12 +00:00
Daniel Zaoui cfd867dff4 Fix for some KlocWork and parasoft issues
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 80238
2012-12-05 12:41:49 +00:00
Daniel Zaoui 81276bfbc8 Fix for make clean
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 80236
2012-12-05 12:41:45 +00:00
Daniel Zaoui bd7ddfd507 Revert "elm test_gengrid.c: Use elm_gengrid_item_class_new/free() APIs."
This reverts commit a562f94c5615ffa7f35b4b5851eb4ac43f7adfc4. These
files were not supposed to be rollbacked.

SVN revision: 80128
2012-12-04 06:57:44 +00:00
Daniel Juyung Seo 5e39cbd7f9 elm test_gengrid.c: Use elm_gengrid_item_class_new/free() APIs.
SVN revision: 80081
2012-12-03 16:27:03 +00:00
Aharon Hillel 65e9f49ccd clouseau: Adopted ecore_con_eet interface. This is a whole-new clouseau
utilizing the new ecore_con_eet API. Clouseau looks the same as before, changed communication handling.

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 79825
2012-11-29 11:09:10 +00:00
68 changed files with 8822 additions and 5186 deletions

4
.arcconfig Normal file
View File

@ -0,0 +1,4 @@
{
"project_id" : "clouseau",
"conduit_uri" : "https://phab.enlightenment.org/"
}

5
.gitignore vendored
View File

@ -7,10 +7,10 @@
Makefile
Makefile.in
*.so
*~
.*.sw[po]
*.gcov
*.gcno
/README
/aclocal.m4
/autom4te.cache/
/config.cache
@ -41,8 +41,7 @@ coverage
/m4/ltversion.m4
/m4/lt~obsolete.m4
INSTALL
src/bin/client
src/bin/clouseaud
src/scripts/clouseau
src/bin/clouseau_client
src/scripts/clouseau_start
build/

View File

@ -1 +0,0 @@
Tom Hacohen <tom@stosb.com>

27
CMakeLists.txt Normal file
View File

@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 2.8.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
project(CLOUSEAU)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
set(DEBUG_COMMON_DEFINITIONS -DEFL_EO_API_SUPPORT -DEFL_BETA_API_SUPPORT)
add_definitions(${DEBUG_COMMON_DEFINITIONS})
find_package(Efl REQUIRED)
find_package(Eina REQUIRED)
find_package(Eet REQUIRED)
find_package(Efreet REQUIRED)
find_package(Eolian REQUIRED)
find_package(Eo REQUIRED)
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)
add_subdirectory(data)
add_dependencies(clouseau_evlog clouseau_evlog_edj)

25
COPYING
View File

@ -1,25 +0,0 @@
Copyright notice for Clouseau:
Copyright (C) 2000-2011 Tom Hacohen and various contributors (see AUTHORS)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1 +0,0 @@
The icons in this repository are herefore released into the Public Domain.

View File

View File

@ -1,10 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
depcomp libtool missing
EXTRA_DIST = README AUTHORS COPYING autogen.sh
SUBDIRS = src data
ACLOCAL_AMFLAGS = -I m4

0
NEWS
View File

39
README
View File

@ -1,19 +1,28 @@
An UI inspection tool for the EFL. This tool lets you inspect UI elements and get a lot of their properties, e.g position, size and weight.
Clouseau
Clouseau consists of a client (clouseau_client) and launcher (clouseau_server). This design means we can:
1. Run the application we are debugging on one device and the clouseau_client itself on another.
2. Run the application we are debugging with a different environment/theme/etc compared to the clouseau client.
Clouseau is a UI inspection tool aimed to debug EFL applications.
Clouseau provides a wrapper script that automatically launches the application with clouseau support, and launches the client, the script is called "clouseau".
Requirements:
Usage:
1. Using the wrapper script:
"clouseau elementary_test" or "clouseau elementary_test Entry".
2. Using the split client/server approach (different machines/environments/setups):
"clouseau_start elementary_test" and then "clouseau_client"
As mentioned above, this is done over the network, so it can be run from different machines
efl (1.20 +)
Using the clouseau client:
When the client opens you'll be asked to enter the server's IP address. That's the IP address of where you ran clouseau_start from. When in doubt, just use the default, 127.0.0.1.
Then press "Ok" to connect to the server, and the rest should be fairly straightforward.
TBD
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

18
TODO
View File

@ -1,18 +0,0 @@
* Make it possible to hide rects? or show only elm-widgets? or something similar? too much clutter atm.
* Add filter?
* Make it an elm module (or setting an env var without a module?) so I'll be able to remotely connect to elm apps.
* Split UI and actual program code (better to do the previous bullet first).
* Add "grab screenshot" button.
* Add a clipping range rectangle.
* Add special per object info, for example edje part names?
* When items are coloured, show the exact colour using a rect?
* Handle map/proxy
* add a way to filter object with some regexp on the name and also finding a specific object according to name.
* Add general info like hinting/whole interface scale/finger size and etc.
* Things to show per-object
* clipping info.
* callback list?
* Fix has_focus.
* Hook on feed events or something and let us see who gets what?

View File

@ -1,14 +0,0 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

View File

@ -0,0 +1,40 @@
# - Try to find ffi
# Once done this will define
# FFI_FOUND - System has ffi
# FFI_INCLUDE_DIRS - The ffi include directories
# FFI_LIBRARIES - The libraries needed to use ffi
# FFI_LDFLAGS_OTHER - Other LDFLAGS needed te use ffi.
# FFI_DEFINITIONS - Compiler switches required for using ffi
find_package(PkgConfig)
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1")
# "QUIET" was introduced in 2.8.2
set(_QUIET QUIET)
endif ()
pkg_check_modules(PC_LIBFFI ${_QUIET} libffi)
#set(FFI_DEFINITIONS ${PC_LIBFFI_CFLAGS_OTHER})
#set(FFI_LDFLAGS_OTHER ${PC_LIBFFI_LDFLAGS_OTHER})
# before verison 2.8.11 variable CMAKE_LIBRARY_ARCHITECTURE wasn't automatically added to search path
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.11")
set(FIND_PATH_HINTS ${PC_LIBFFI_INCLUDEDIR}/${CMAKE_LIBRARY_ARCHITECTURE})
endif ()
find_path(FFI_INCLUDE_DIR ffi.h
HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
${FIND_PATH_HINTS}
)
find_library(FFI_LIBRARY NAMES ffi libffi
HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS})
set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR})
set(FFI_LIBRARIES ${FFI_LIBRARY})
#include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set EINA_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ffi DEFAULT_MSG
FFI_LIBRARY)
mark_as_advanced(FFI_INCLUDE_DIRS FFI_LIBRARY)

View File

@ -1,94 +0,0 @@
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [0])
m4_define([v_min], [2])
m4_define([v_mic], [0])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##-- When released, remove the dnl on the below line
dnl m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_INIT(clouseau, [v_ver], tom@stosb.com)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.ac)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6 dist-bzip2)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(config.h)
AC_GNU_SOURCE
AC_PROG_LIBTOOL
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
PKG_CHECK_MODULES([EFL],
[
eina >= 1.0.0
eet >= 1.0.0
elementary >= 0.7.0
evas >= 1.0.0
ecore >= 1.0.0
ecore-ipc >= 1.0.0
edje >= 1.0.0
]
)
### Checks for linker characteristics
lt_enable_auto_import=""
case "${host_os}" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
case "$host_vendor" in
ps3*)
# Escape had already been checked to exist
;;
esac
AC_SUBST([lt_enable_auto_import])
EFL_ATTRIBUTE_UNUSED
AC_CHECK_LIB(dl,dlopen)
AC_CHECK_FUNCS(dlopen dlerror)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/lib/Makefile
src/bin/Makefile
src/scripts/Makefile
data/Makefile
data/images/Makefile
])
AC_OUTPUT

22
data/CMakeLists.txt Normal file
View File

@ -0,0 +1,22 @@
add_custom_command (
OUTPUT clouseau_evlog.edj
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_focus_inspector.edj ${CMAKE_CURRENT_BINARY_DIR}/clouseau_evlog.edj images/show-screenshot.png images/take-screenshot.png
DESTINATION share/${PROJECT_NAME_LOWER}
)

View File

@ -1,2 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = images

138
data/evlog.edc Normal file
View File

@ -0,0 +1,138 @@
#define TILED_PATTERN(_WIDTH, _HEIGHT) \
fill { size { relative: 0.0 0.0; offset: _WIDTH _HEIGHT; } }
collections {
images.image: "box_glow.png" COMP;
images.image: "box_outline.png" COMP;
group { name: "range";
parts {
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
color_class: "range";
}
}
part { name: "text"; type: TEXT;
scale: 1;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
color: 255 255 255 255;
text { font: "Sans"; size: 10;
min: 0 1;
align: 0.0 1.0;
}
}
}
}
}
group { name: "cpufreq";
parts {
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
// rel1.offset: 1 1;
// rel2.offset: -2 -2;
color_class: "range";
}
}
}
}
group { name: "cpuused";
parts {
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
// rel1.offset: 1 1;
// rel2.offset: -2 -2;
color_class: "range";
}
}
}
}
images.image: "diagonal_stripes.png" COMP;
group { name: "state";
parts {
part { name: "bg";
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
color_class: "state";
TILED_PATTERN(240, 240)
image.normal: "diagonal_stripes.png";
}
}
part { name: "text"; type: TEXT;
scale: 1;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
color: 255 255 255 255;
text { font: "Sans"; size: 10;
min: 0 1;
align: 0.0 1.0;
}
}
}
}
}
images.image: "handle_pick_up_right.png" COMP;
group { name: "frame";
parts {
part { name: "base"; type: RECT;
description { state: "default" 0.0;
color: 51 153 255 128;
min: 1 1;
}
}
part { name: "bg";
description { state: "default" 0.0;
image.normal: "handle_pick_up_right.png";
rel1.offset: -12 -11;
rel1.relative: 0.0 1.0;
rel2.offset: -12 -11;
rel2.relative: 0.0 1.0;
align: 0.0 0.0;
min: 42 54;
max: 42 54;
}
}
}
}
group { name: "event";
parts {
part { name: "base"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
color_class: "event";
min: 1 1;
}
}
part { name: "over"; type: RECT;
description { state: "default" 0.0;
color: 0 0 0 0;
min: 5 1;
}
}
part { name: "text"; type: TEXT;
scale: 1;
description { state: "default" 0.0;
rel1.relative: 0.0 1.0;
rel2.relative: 1.0 1.0;
align: 0.5 0.0;
color_class: "event";
text { font: "Sans"; size: 10;
min: 1 1;
align: 0.5 0.0;
}
}
}
}
}
}

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

@ -1,12 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
filesdir = $(datadir)/clouseau/images
files_DATA = \
clipper.png \
hidden.png \
background.png \
screenshot-missing.png \
show-screenshot.png \
take-screenshot.png
EXTRA_DIST = $(files_DATA)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.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_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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

0
m4/A
View File

View File

@ -1,56 +0,0 @@
dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macros for checking if the compiler supports some __attribute__ uses
dnl Usage: EFL_ATTRIBUTE_UNUSED
dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
[
AC_MSG_CHECKING([for __attribute__ ((unused))])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
void foo(int x __attribute__ ((unused))) {}
]],
[[
]])],
[have_attribute_unused="yes"],
[have_attribute_unused="no"])
AC_MSG_RESULT([${have_attribute_unused}])
if test "x${have_attribute_unused}" = "xyes" ; then
AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
else
AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
fi
])
dnl Usage: EFL_ATTRIBUTE_VECTOR
dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
[
AC_MSG_CHECKING([for __attribute__ ((vector))])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
typedef int v4si __attribute__ ((vector_size (16)));
]],
[[
if (sizeof(v4si) == 16)
return 0;
else
return -1;
]])],
[have_attribute_vector="yes"],
[have_attribute_vector="no"])
AC_MSG_RESULT([${have_attribute_vector}])
if test "x${have_attribute_vector}" = "xyes" ; then
AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
fi
])
dnl End of efl_attribute.m4

View File

@ -1,4 +0,0 @@
#!/bin/sh
gcc -Wall -Wextra -fPIC -rdynamic -g3 -O0 -c libclouseau.c `pkg-config --libs --cflags elementary ecore evas`
gcc -g3 -O0 -shared -Wl,-soname,libclouseau.so.1 -o libclouseau.so.1.0.1 libclouseau.o -lc -ldl `pkg-config --libs --cflags elementary`

View File

@ -1,4 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = lib bin scripts

39
src/bin/CMakeLists.txt Normal file
View File

@ -0,0 +1,39 @@
set(CMAKE_BUILD_TYPE Debug)
LIST(APPEND SOURCES clouseau_client.c gui.c)
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/data/images")
add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
include_directories(
${CMAKE_SOURCE_DIR}/src/lib
${ELEMENTARY_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EET_INCLUDE_DIRS}
${EFREET_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${ECORE_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
)
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
add_executable(clouseau_client ${SOURCES})
target_link_libraries(clouseau_client
pthread
${EFL_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${EINA_LIBRARIES}
${EET_LIBRARIES}
${EFREET_LIBRARIES}
${EO_LIBRARIES}
${ECORE_LIBRARIES}
${EVAS_LIBRARIES}
ecore_file
)
install(TARGETS clouseau_client DESTINATION bin)
install(PROGRAMS clouseau DESTINATION bin)

View File

@ -1,18 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = clouseaud clouseau_client
clouseaud_SOURCES = clouseaud.c
clouseau_client_SOURCES = clouseau.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/include \
-I$(top_builddir)/src/include \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EFL_CFLAGS@
clouseaud_LDADD = $(top_builddir)/src/lib/libclouseau_client.la @EFL_LIBS@
clouseau_client_LDADD = $(top_builddir)/src/lib/libclouseau_client.la @EFL_LIBS@

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

File diff suppressed because it is too large Load Diff

1169
src/bin/clouseau_client.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,475 +0,0 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <fcntl.h>
#include <Ecore_Ipc.h>
#include "clouseau_private.h"
#define RUNNING_DIR "/tmp"
#define LOCK_FILE ".clouseaud.lock"
#define LOG_FILE "clouseaud.log"
static Eina_List *gui = NULL; /* List of app_info_st for gui clients */
static Eina_List *app = NULL; /* List of app_info_st for app clients */
Ecore_Ipc_Server *ipc_svr = NULL;
/* For Debug */
char msg_buf[MAX_LINE+1];
struct _tree_info_st
{
void *app; /* app ptr to identify where the data came from */
void *data; /* Tree data */
};
typedef struct _tree_info_st tree_info_st;
static void
log_message(char *filename, char *mode, char *message)
{
FILE *logfile;
logfile=fopen(filename, mode);
if(!logfile) return;
fprintf(logfile,"%s\n",message);
fclose(logfile);
}
static void
_daemon_cleanup(void)
{ /* Free strings */
app_info_st *p;
sprintf(msg_buf,"Clients connected to this server when exiting: %d\n",
eina_list_count(ecore_ipc_server_clients_get(ipc_svr)));
log_message(LOG_FILE, "a", msg_buf);
EINA_LIST_FREE(gui, p)
{
if(p->file)
free(p->file);
free(p->name);
free(p);
}
EINA_LIST_FREE(app, p)
{
if(p->file)
free(p->file);
free(p->name);
free(p);
}
gui = app = NULL;
ipc_svr = NULL;
clouseau_data_shutdown();
ecore_ipc_shutdown();
ecore_shutdown();
eina_shutdown();
}
void daemonize(void)
{
int i,lfp;
char str[10];
time_t currentTime;
if(getppid()==1) return; /* already a daemon */
i=fork();
if (i<0) exit(1); /* fork error */
if (i>0) exit(0); /* parent exits */
time (&currentTime);
/* child (daemon) continues */
setsid(); /* obtain a new process group */
for (i=getdtablesize();i>=0;--i) close(i); /* close all descriptors */
i=open("/dev/null",O_RDWR);
if (dup(i) == -1) return; /* handle standart I/O */
if (dup(i) == -1) return; /* handle standart I/O */
umask(027); /* set newly created file permissions */
if (chdir(RUNNING_DIR) == -1) return; /* change running directory */
lfp=open(LOCK_FILE,O_RDWR|O_CREAT,0640);
if (lfp<0) exit(1); /* can not open */
if (lockf(lfp,F_TLOCK,0)<0) exit(0); /* can not lock */
/* first instance continues */
sprintf(str,"%d\n",getpid());
if (write(lfp,str,strlen(str)) == -1) return; /* record pid to lockfile */
signal(SIGCHLD,SIG_IGN); /* ignore child */
signal(SIGTSTP,SIG_IGN); /* ignore tty signals */
signal(SIGTTOU,SIG_IGN);
signal(SIGTTIN,SIG_IGN);
log_message(LOG_FILE, "w", "Daemon Started");
log_message(LOG_FILE, "a", ctime(&currentTime));
}
/* START - Ecore communication callbacks */
static int
_client_ptr_cmp(const void *d1, const void *d2)
{
return (((app_info_st *) d1)->ptr - ((unsigned long long) (uintptr_t) d2));
}
static Eina_List *
_add_client(Eina_List *clients, connect_st *t, void *client)
{
if(!eina_list_search_unsorted(clients, _client_ptr_cmp, client))
{
app_info_st *st = calloc(1, sizeof(app_info_st));
st->name = strdup(t->name);
st->pid = t->pid;
st->ptr = (unsigned long long) (uintptr_t) client;
return eina_list_append(clients, st);
}
return clients;
}
static Eina_List *
_remove_client(Eina_List *clients, void *client)
{
app_info_st *p = eina_list_search_unsorted(clients, _client_ptr_cmp, client);
if (p)
{
free(p->name);
free(p);
return eina_list_remove(clients, p);
}
return clients;
}
Eina_Bool
_add(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Add *ev)
{
ecore_ipc_client_data_size_max_set(ev->client, -1);
sprintf(msg_buf, "<%s> msg from <%p>", __func__, ev->client);
log_message(LOG_FILE, "a", msg_buf);
return ECORE_CALLBACK_RENEW;
}
Eina_Bool
_del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Del *ev)
{
if (!ev->client)
return ECORE_CALLBACK_RENEW;
sprintf(msg_buf, "<%s> msg from <%p>", __func__, ev->client);
log_message(LOG_FILE, "a", msg_buf);
/* Now we need to find if its an APP or GUI client */
app_info_st *i = eina_list_search_unsorted(gui, _client_ptr_cmp, ev->client);
if (i) /* Only need to remove GUI client from list */
gui = _remove_client(gui, ev->client);
i = eina_list_search_unsorted(app, _client_ptr_cmp, ev->client);
if (i)
{ /* Notify all GUI clients to remove this APP */
app_closed_st t = { (unsigned long long) (uintptr_t) ev->client };
Eina_List *l;
int size;
void *p = clouseau_data_packet_compose(CLOUSEAU_APP_CLOSED,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
EINA_LIST_FOREACH(gui, l, i)
{
ecore_ipc_client_send((void *) (uintptr_t) i->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush((void *) (uintptr_t) i->ptr);
}
free(p);
}
app = _remove_client(app, ev->client);
}
ecore_ipc_client_del(ev->client);
if (!eina_list_count(ecore_ipc_server_clients_get(ipc_svr)))
{ /* Trigger cleanup and exit when all clients disconneced */
ecore_main_loop_quit();
}
return ECORE_CALLBACK_RENEW;
}
Eina_Bool
_data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data *ev)
{
void *p;
int size = 0;
sprintf(msg_buf, "<%s> msg from <%p>", __func__, ev->client);
log_message(LOG_FILE, "a", msg_buf);
Variant_st *v = clouseau_data_packet_info_get(ev->data, ev->size);
/* This is where daemon impl communication protocol.
* In order to simplify, all messages also contains recipient ptr
* as saved by daemon.
* Thus we only need to peek this info then FWD, reply to this recipient */
if (!v)
{
log_message(LOG_FILE, "a", "Failed to decode data.");
return ECORE_CALLBACK_RENEW;
}
switch(clouseau_data_packet_mapping_type_get(v->type))
{
case CLOUSEAU_APP_CLIENT_CONNECT:
{ /* Register APP then notify GUI about it */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
app_info_st m = { t->pid, (char *) t->name, NULL,
(unsigned long long) (uintptr_t) ev->client, NULL, 0 };
app = _add_client(app, t, ev->client);
p = clouseau_data_packet_compose(CLOUSEAU_APP_ADD,
&m, sizeof(m), &size, NULL, 0);
if (p)
{
EINA_LIST_FOREACH(gui, l, st)
{ /* Notify all GUI clients to add APP */
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
}
free(p);
}
}
break;
case CLOUSEAU_GUI_CLIENT_CONNECT:
{ /* Register GUI, then notify about all APP */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
gui = _add_client(gui, t, ev->client);
EINA_LIST_FOREACH(app, l, st)
{ /* Add all registered apps to newly open GUI */
p = clouseau_data_packet_compose(CLOUSEAU_APP_ADD,
st, sizeof(*st), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(ev->client,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(ev->client);
free(p);
}
}
}
break;
case CLOUSEAU_DATA_REQ:
{ /* msg coming from GUI, FWD this to app specified in req */
data_req_st *req = v->data;
if (req->app)
{ /* Requesting specific app data */
if(eina_list_search_unsorted(app,
_client_ptr_cmp,
(void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) req->app };
p = clouseau_data_packet_compose(CLOUSEAU_DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
else
{ /* requesting ALL apps data */
Eina_List *l;
app_info_st *st;
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) NULL };
EINA_LIST_FOREACH(app, l, st)
{
t.app = (unsigned long long) (uintptr_t) st->ptr;
p = clouseau_data_packet_compose(CLOUSEAU_DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
free(p);
}
}
}
}
break;
case CLOUSEAU_TREE_DATA:
{ /* Tree Data comes from APP, GUI client specified in msg */
tree_data_st *td = v->data;
if (td->gui)
{ /* Sending tree data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) td->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) td->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) td->gui);
}
}
else
{ /* Sending tree data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
clouseau_data_tree_free(td->tree);
}
break;
case CLOUSEAU_HIGHLIGHT:
{ /* FWD this message to app */
highlight_st *ht = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) ht->app))
{ /* Do the req only of APP connected to daemon */
ecore_ipc_client_send((void *)
(uintptr_t) ht->app, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush((void *) (uintptr_t) ht->app);
}
}
break;
case CLOUSEAU_BMP_REQ:
{
bmp_req_st *req = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
bmp_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
req->app, req->object, req->ctr };
p = clouseau_data_packet_compose(CLOUSEAU_BMP_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{ /* FWD req to app with client data */
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
break;
case CLOUSEAU_BMP_DATA:
{ /* Bmp Data comes from APP, GUI client specified in msg */
bmp_info_st *st = v->data;
if (st->gui)
{ /* Sending BMP data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) st->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) st->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->gui);
}
}
else
{ /* Sending BMP data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
if (st->bmp)
free(st->bmp);
}
break;
default:
break;
}
clouseau_data_variant_free(v);
log_message(LOG_FILE, "a", "_data() finished");
return ECORE_CALLBACK_RENEW;
}
/* END - Ecore communication callbacks */
int main(void)
{
daemonize();
eina_init();
ecore_init();
ecore_ipc_init();
clouseau_data_init();
if (!(ipc_svr = ecore_ipc_server_add(ECORE_IPC_REMOTE_SYSTEM,
LISTEN_IP, PORT, NULL)))
exit(1);
ecore_ipc_server_data_size_max_set(ipc_svr, -1);
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL);
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL);
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL);
ecore_main_loop_begin();
_daemon_cleanup();
return 0;
}

595
src/bin/gui Normal file
View File

@ -0,0 +1,595 @@
{
"JSON_Version":"1",
"Settings":
{
"project":"gui",
"start_points":["main_win"]
},
"Resources":
{
"Images":
{
"SCREENSHOT_ICON":"../../data/images/show-screenshot.png"
},
"Eo_Callbacks":
{
"profile_close":"_profile_win_close_cb",
"new_profile_save":"_new_profile_save_cb",
"new_profile_cancel":"_new_profile_cancel_cb",
"profile_del":"_profile_del_cb",
"screenshot_request":"screenshot_req_cb"
}
},
"Widgets":
{
"main_win":
{
"Desc":
{
"parent":null,
"class":"Elm.Win",
"public":true
},
"Properties":
{
"Elm.Win.type":["ELM_WIN_BASIC"],
"Elm.Widget.part_text":[null, "Window"],
"Elm.Win.autodel":[true],
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[478, 484]
},
"Contains":["elm_bg1", "elm_box1"]
},
"elm_bg1":
{
"Desc":
{
"parent":"main_win",
"class":"Elm.Bg"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.position":[0, 0]
}
},
"elm_box1":
{
"Desc":
{
"parent":"main_win",
"class":"Elm.Box"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[643, 598],
"Efl.Gfx.Base.position":[-7, -2],
"Elm.Box.padding":[0, 0],
"Elm.Box.align":[0, 0]
},
"Contains":["apps_selector", "elm_panes1"]
},
"apps_selector":
{
"Desc":
{
"parent":"elm_box1",
"class":"Elm.Hoversel",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 0],
"Evas.Object.size_hint_align":[0.50, 0],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[1174, 643],
"Efl.Gfx.Base.position":[-8, -2],
"Elm.Widget.part_text":[null, "Select App"]
}
},
"elm_panes1":
{
"Desc":
{
"parent":"elm_box1",
"class":"Elm.Panes"
},
"Properties":
{
"Elm.Panes.content_right_size":[0.60],
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.size":[75, 75],
"Efl.Gfx.Base.visible":[true],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.size_hint_align":[-1, -1]
},
"Contains":
{
"objects_list":["left"],
"object_infos_list":["right"]
}
},
"object_infos_list":
{
"Desc":
{
"parent":"elm_panes1",
"class":"Elm.Genlist",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true]
}
},
"objects_list":
{
"Desc":
{
"parent":"elm_panes1",
"class":"Elm.Genlist",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true]
}
},
"profiles_win":
{
"Desc":
{
"parent":null,
"class":"Elm.Win",
"public":true
},
"Properties":
{
"Elm.Win.name":["Win"],
"Elm.Win.type":["ELM_WIN_BASIC"],
"Elm.Win.autodel":[true],
"Elm.Widget.part_text":[null, "Window"],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[347, 362],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.freeze_events":[false],
"Evas.Object.repeat_events":[false],
"Elm.Win.title":["Profiles"]
},
"Contains":["elm_bg2", "elm_box2"]
},
"elm_bg2":
{
"Desc":
{
"parent":"profiles_win",
"class":"Elm.Bg"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true]
}
},
"elm_box2":
{
"Desc":
{
"parent":"profiles_win",
"class":"Elm.Box"
},
"Properties":
{
"Elm.Box.padding":[7, 0],
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.size":[200, 200],
"Efl.Gfx.Base.visible":[true]
},
"Contains":["profiles_list", "elm_box3"]
},
"elm_box3":
{
"Desc":
{
"parent":"elm_box2",
"class":"Elm.Box"
},
"Properties":
{
"Elm.Box.padding":[7, 0],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.visible":[true],
"Elm.Box.horizontal":[true],
"Efl.Gfx.Base.size":[200, 139],
"Efl.Gfx.Base.position":[289, 742],
"Evas.Object.size_hint_weight":[1, 0.20]
},
"Contains":["profile_ok_button", "profile_cancel_button", "profile_new_button", "profile_delete_button"]
},
"profile_delete_button":
{
"Desc":
{
"parent":"elm_box3",
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Efl.Gfx.Base.visible":[true],
"Elm.Widget.disabled":[true],
"Elm.Widget.part_text":[null, "Delete profile"],
"Efl.Gfx.Base.size":[115, 30],
"Efl.Gfx.Base.position":[-42, 0],
"Evas.Object.size_hint_align":[0.50, 0.50],
"Evas.Object.size_hint_weight":[1, 1]
},
"Callbacks":
{
"clicked":["Invoke", "profile_del", null]
}
},
"profile_ok_button":
{
"Desc":
{
"parent":"elm_box3",
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30],
"Elm.Widget.part_text":[null, "Ok"],
"Elm.Widget.disabled":[true]
},
"Callbacks":
{
"clicked":["Invoke", "profile_close", null]
}
},
"profile_cancel_button":
{
"Desc":
{
"parent":"elm_box3",
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30],
"Elm.Widget.part_text":[null, "Cancel"]
}
},
"profile_new_button":
{
"Desc":
{
"parent":"elm_box3",
"class":"Elm.Button"
},
"Properties":
{
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30],
"Elm.Widget.part_text":[null, "New profile"],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.size_hint_align":[0.50, 0.50]
},
"Callbacks":
{
"clicked":["Create", "new_profile_win", null]
}
},
"profiles_list":
{
"Desc":
{
"parent":"elm_box2",
"class":"Elm.Genlist",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Evas.Object.size_hint_align":[-1, -1]
}
},
"new_profile_win":
{
"Desc":
{
"parent":null,
"class":"Elm.Win",
"public":true
},
"Properties":
{
"Elm.Win.type":["ELM_WIN_BASIC"],
"Elm.Win.autodel":[true],
"Elm.Widget.part_text":[null, "Window"],
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[689, 390],
"Elm.Win.title":["New profile..."],
"Elm.Win.modal":[true]
},
"Contains":["elm_bg4", "elm_box5"]
},
"elm_bg4":
{
"Desc":
{
"parent":"new_profile_win",
"class":"Elm.Bg"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true]
}
},
"elm_box5":
{
"Desc":
{
"parent":"new_profile_win",
"class":"Elm.Box"
},
"Properties":
{
"Elm.Box.padding":[7, 0],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.size":[200, 200],
"Efl.Gfx.Base.visible":[true]
},
"Contains":["elm_box6", "elm_label1", "new_profile_command", "elm_label2", "new_profile_script", "elm_box4"]
},
"elm_box4":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Box"
},
"Properties":
{
"Elm.Box.padding":[7, 0],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.size":[200, 200],
"Efl.Gfx.Base.visible":[true],
"Elm.Box.horizontal":[true]
},
"Contains":["new_profile_save_button", "new_profile_cancel_button"]
},
"new_profile_cancel_button":
{
"Desc":
{
"parent":"elm_box4",
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30],
"Elm.Widget.part_text":[null, "Cancel"]
}
},
"new_profile_save_button":
{
"Desc":
{
"parent":"elm_box4",
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30],
"Elm.Widget.part_text":[null, "Save"]
},
"Callbacks":
{
"clicked":["Invoke", "new_profile_save", null]
}
},
"elm_box6":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Box"
},
"Properties":
{
"Elm.Box.padding":[7, 0],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.size":[200, 200],
"Efl.Gfx.Base.visible":[true],
"Elm.Box.horizontal":[true]
},
"Contains":["new_profile_type_selector", "elm_label3", "new_profile_name"]
},
"new_profile_type_selector":
{
"Desc":
{
"parent":"elm_box6",
"class":"Elm.Hoversel",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[60, 40],
"Evas.Object.size_hint_align":[0, 0.50],
"Elm.Widget.part_text":[null, "Choose the profile type"]
}
},
"elm_label3":
{
"Desc":
{
"parent":"elm_box6",
"class":"Elm.Label"
},
"Properties":
{
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[60, 30],
"Evas.Object.size_hint_align":[1, -1],
"Elm.Widget.part_text":[null, "Name: "],
"Evas.Object.size_hint_weight":[0, 1]
}
},
"new_profile_name":
{
"Desc":
{
"parent":"elm_box6",
"class":"Elm.Entry",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[65, 35],
"Elm.Entry.scrollable":[true],
"Elm.Entry.single_line":[true],
"Evas.Object.size_hint_weight":[4, 1],
"Elm.Entry.editable":[true],
"Elm.Widget.part_text":[null, ""]
}
},
"elm_label1":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Label"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[115, 30],
"Efl.Gfx.Base.position":[847, 0],
"Elm.Widget.part_text":[null, "Command: "],
"Evas.Object.size_hint_align":[0, 2]
}
},
"new_profile_command":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Entry",
"public":true
},
"Properties":
{
"Elm.Entry.scrollable":[true],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[65, 35],
"Elm.Entry.single_line":[true],
"Evas.Object.size_hint_weight":[1, 2],
"Elm.Widget.disabled":[true]
}
},
"elm_label2":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Label"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[60, 30],
"Evas.Object.size_hint_align":[0, 1],
"Elm.Widget.part_text":[null, "Script: "]
}
},
"new_profile_script":
{
"Desc":
{
"parent":"elm_box5",
"class":"Elm.Entry",
"public":true
},
"Properties":
{
"Elm.Entry.scrollable":[true],
"Evas.Object.size_hint_align":[-1, -1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[65, 35],
"Evas.Object.size_hint_weight":[1, 8],
"Elm.Widget.disabled":[true]
}
},
"screenshot_button":
{
"Desc":
{
"parent":null,
"class":"Elm.Button",
"public":true
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[73, 30]
},
"Callbacks":
{
"clicked":["Invoke", "screenshot_request", null]
},
"Contains":
{
"elm_icon1":["icon"]
}
},
"elm_icon1":
{
"Desc":
{
"parent":"screenshot_button",
"class":"Elm.Icon"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Efl.Gfx.Base.visible":[true],
"Efl.Gfx.Base.size":[40, 40],
"Efl.File.file":["SCREENSHOT_ICON", null]
}
}
}
}

139
src/bin/gui.c Normal file
View File

@ -0,0 +1,139 @@
#ifndef EFL_BETA_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#endif
#ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT
#endif
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
#define ELM_INTERNAL_API_ARGESFSDFEFC
#endif
#include <Elementary.h>
#include "gui.h"
extern void
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, Evas_Object *obj, void *event_info);
static void
_pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
free(data);
}
Gui_Main_Win_Widgets *
gui_main_win_create(Eo *__main_parent)
{
Gui_Main_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *main_win;
Eo *bg;
Eo *main_box, *ext_box;
Eo *tb;
Eo *ext_selector;
Eo *freeze_pulse;
Eo *freeze_inwin;
main_win = elm_win_add(__main_parent, "Window", ELM_WIN_BASIC);
pub_widgets->main_win = main_win;
elm_win_autodel_set(main_win, EINA_TRUE);
elm_win_title_set(main_win, "Clouseau");
efl_gfx_entity_size_set(main_win, EINA_SIZE2D(478, 484));
bg = elm_bg_add(main_win);
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
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_entity_visible_set(main_box, EINA_TRUE);
elm_win_resize_object_add(main_win, main_box);
tb = elm_toolbar_add(main_win);
elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
evas_object_size_hint_weight_set(tb, 0, 0);
evas_object_size_hint_align_set(tb, -1, 0);
elm_toolbar_menu_parent_set(tb, main_win);
pub_widgets->conn_selector = elm_toolbar_item_append(tb, "call-start", "Connection", NULL, NULL);
elm_toolbar_item_menu_set(pub_widgets->conn_selector, EINA_TRUE);
pub_widgets->conn_selector_menu = elm_toolbar_item_menu_get(pub_widgets->conn_selector);
pub_widgets->apps_selector = elm_toolbar_item_append(tb, "view-list-details", "Select App", NULL, NULL);
elm_toolbar_item_menu_set(pub_widgets->apps_selector, EINA_TRUE);
pub_widgets->apps_selector_menu = elm_toolbar_item_menu_get(pub_widgets->apps_selector);
pub_widgets->save_load_bt = elm_toolbar_item_append(tb, "document-export", "Save", save_load_perform, NULL);
ext_selector = elm_toolbar_item_append(tb, "system-reboot", "Extensions", NULL, NULL);
elm_toolbar_item_menu_set(ext_selector, EINA_TRUE);
pub_widgets->ext_selector_menu = elm_toolbar_item_menu_get(ext_selector);
/*
Eo *settings_it = elm_toolbar_item_append(tb, "system-run", "Settings", NULL, NULL);
elm_toolbar_item_menu_set(settings_it, EINA_TRUE);
*/
elm_box_pack_end(main_box, tb);
efl_gfx_entity_visible_set(tb, EINA_TRUE);
freeze_pulse = elm_progressbar_add(main_win);
pub_widgets->freeze_pulse = freeze_pulse;
elm_object_style_set(freeze_pulse, "wheel");
elm_object_text_set(freeze_pulse, "Style: wheel");
elm_progressbar_pulse_set(freeze_pulse, EINA_TRUE);
elm_progressbar_pulse(freeze_pulse, EINA_FALSE);
evas_object_size_hint_align_set(freeze_pulse, 0.5, 0.0);
evas_object_size_hint_weight_set(freeze_pulse, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(main_win, freeze_pulse);
ext_box = elm_box_add(main_box);
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_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_entity_visible_set(main_win, EINA_TRUE);
efl_event_callback_add(main_win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;
}
Gui_Remote_Port_Win_Widgets *
gui_remote_port_win_create(Eo *__main_parent)
{
Gui_Remote_Port_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *inwin;
Eo *entry;
inwin = elm_win_inwin_add(__main_parent);
pub_widgets->inwin = inwin;
entry = elm_entry_add(inwin);
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");
evas_object_smart_callback_add(entry, "activated", remote_port_entry_changed, inwin);
evas_object_show(entry);
elm_win_inwin_content_set(inwin, entry);
elm_win_inwin_activate(inwin);
efl_event_callback_add(inwin, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;
}

33
src/bin/gui.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef _gui_h_
#define _gui_h_
#include <Eo.h>
#include <Elementary.h>
typedef struct
{
Eo *main_win;
Eo *ext_box;
Eo *conn_selector;
Eo *conn_selector_menu;
Eo *apps_selector;
Eo *apps_selector_menu;
Eo *save_load_bt;
Eo *ext_selector_menu;
Eo *freeze_pulse;
Eo *freeze_inwin;
} Gui_Main_Win_Widgets;
typedef struct
{
Eo *inwin;
Eo *cancel_button;
Eo *save_button;
Eo *name_entry;
Eo *port_entry;
} Gui_Remote_Port_Win_Widgets;
Gui_Main_Win_Widgets *gui_main_win_create(Eo *parent);
Gui_Remote_Port_Win_Widgets *gui_remote_port_win_create(Eo *parent);
#endif

28
src/lib/CMakeLists.txt Normal file
View File

@ -0,0 +1,28 @@
set(CMAKE_BUILD_TYPE Debug)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${EINA_INCLUDE_DIRS}
${EOLIAN_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${FFI_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${ELEMENTARY_INCLUDE_DIRS}
)
add_library(clouseau_debug SHARED clouseau_debug.c)
target_link_libraries(clouseau_debug
${EINA_LIBRARIES}
${EO_LIBRARIES}
${EOLIAN_LIBRARIES}
${EVAS_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${FFI_LIBRARIES}
)
INSTALL(FILES Clouseau.h DESTINATION include)
INSTALL(TARGETS clouseau_debug LIBRARY DESTINATION lib)
add_subdirectory(extensions)

View File

@ -1,160 +1,61 @@
#ifndef _LIBCLOUSEAU_H
#define _LIBCLOUSEAU_H
#ifndef _CLOUSEAU_H
#define _CLOUSEAU_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#ifdef EAPI
# undef EAPI
#endif
#include <Elementary.h>
#ifdef _WIN32
# ifdef DEBUG_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# endif /* ! DEBUG_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif /* ! _WIN32 */
#define ELM_INTERNAL_API_ARGESFSDFEFC
#include <elm_widget.h>
#include <Eina.h>
typedef struct _Clouseau_Evas_Props Clouseau_Evas_Props;
typedef struct _Clouseau_Evas_Text_Props Clouseau_Evas_Text_Props;
typedef struct _Clouseau_Evas_Image_Props Clouseau_Evas_Image_Props;
typedef struct _Clouseau_Elm_Props Clouseau_Elm_Props;
typedef struct _Clouseau_Edje_Props Clouseau_Edje_Props;
typedef struct _Clouseau_Evas_Map_Point_Props Clouseau_Evas_Map_Point_Props;
typedef struct _Extension_Config Extension_Config;
typedef struct _Clouseau_Extension Clouseau_Extension;
typedef struct _Clouseau_Extra_Props Clouseau_Extra_Props;
typedef struct _Clouseau_Object Clouseau_Object;
typedef struct _Clouseau_Bitmap Clouseau_Bitmap;
typedef Eo *(*Ui_Get_Cb)(Clouseau_Extension *ext, Eo *parent);
typedef void (*Session_Changed_Cb)(Clouseau_Extension *ext);
typedef void (*App_Changed_Cb)(Clouseau_Extension *ext);
typedef void (*Import_Data_Cb)(Clouseau_Extension *ext, void *buffer, int size, int version);
typedef void *(*Export_Data_Cb)(Clouseau_Extension *ext, int *size, int *version);
typedef struct _Clouseau_Tree_Item Clouseau_Tree_Item;
typedef Eo *(*Inwin_Create_Cb)();
typedef void (*Ui_Freeze_Cb)(Clouseau_Extension *ext, Eina_Bool freeze);
/* The color of the highlight */
enum {
HIGHLIGHT_R = 255,
HIGHLIGHT_G = 128,
HIGHLIGHT_B = 128,
HIGHLIGHT_A = 255,
/* How much padding around the highlight box.
* Currently we don't want any. */
PADDING = 0,
};
typedef enum
struct _Clouseau_Extension
{
CLOUSEAU_OBJ_TYPE_UNKNOWN,
CLOUSEAU_OBJ_TYPE_OTHER,
CLOUSEAU_OBJ_TYPE_ELM,
CLOUSEAU_OBJ_TYPE_TEXT,
CLOUSEAU_OBJ_TYPE_IMAGE,
CLOUSEAU_OBJ_TYPE_EDJE,
CLOUSEAU_OBJ_TYPE_TEXTBLOCK
} Clouseau_Object_Type;
struct _Clouseau_Evas_Map_Point_Props
{
Evas_Coord x, y, z;
const char *name; /* Name filled by the extension */
Eina_Debug_Session *session; /* Current session */
int app_id; /* Current application */
Eina_Stringshare *path_to_config; /* Path to configuration directory */
Eo *ui_object; /* Main object of the UI extension */
Session_Changed_Cb session_changed_cb; /* Function called when the session changed */
App_Changed_Cb app_changed_cb; /* Function called when the app changed */
Import_Data_Cb import_data_cb; /* Function called when data has to be imported */
Export_Data_Cb export_data_cb; /* Function called when data has to be exported */
Inwin_Create_Cb inwin_create_cb; /* Function to call to create a Inwin */
Ui_Freeze_Cb ui_freeze_cb; /* Function to call to freeze/thaw the UI */
void *data; /* Data allocated and managed by the extension */
Extension_Config *ext_cfg; /* Extention configuration - used by Clouseau */
};
struct _Clouseau_Evas_Props
{
const char *name;
const char *bt;
short layer;
Evas_Coord x, y, w, h;
double scale;
Evas_Coord min_w, min_h, max_w, max_h, req_w, req_h;
double align_x, align_y;
double weight_x, weight_y;
int r, g, b, a;
Eina_Bool pass_events;
Eina_Bool repeat_events;
Eina_Bool propagate_events;
Eina_Bool has_focus;
Eina_Bool is_clipper;
Eina_Bool is_visible;
Evas_Object_Pointer_Mode mode;
Clouseau_Evas_Map_Point_Props *points;
int points_count;
unsigned long long clipper;
};
struct _Clouseau_Evas_Text_Props
{
const char *font;
int size;
const char *source;
const char *text;
};
struct _Clouseau_Evas_Image_Props
{
const char *file, *key;
void *source;
const char *load_err;
};
struct _Clouseau_Evas_Textblock_Props
{
const char *style;
const char *text;
};
typedef struct _Clouseau_Evas_Textblock_Props Clouseau_Evas_Textblock_Props;
struct _Clouseau_Edje_Props
{
const char *file, *group;
const char *load_err;
};
struct _Clouseau_Elm_Props
{
const char *type;
const char *style;
double scale;
Eina_Bool has_focus;
Eina_Bool is_disabled;
Eina_Bool is_mirrored;
Eina_Bool is_mirrored_automatic;
};
struct _Clouseau_Extra_Props
{ /* as Example_Union */
Clouseau_Object_Type type;
union {
Clouseau_Elm_Props elm;
Clouseau_Evas_Text_Props text;
Clouseau_Evas_Image_Props image;
Clouseau_Edje_Props edje;
Clouseau_Evas_Textblock_Props textblock;
} u;
};
struct _Clouseau_Object
{
Clouseau_Evas_Props evas_props;
Clouseau_Extra_Props extra_props;
};
struct _Clouseau_Bitmap
{
unsigned char *bmp;
int bmp_count; /* is (w * h), for EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY */
Evas_Coord w;
Evas_Coord h;
};
struct _Clouseau_Tree_Item
{
Eina_List *children;
const char *name;
unsigned long long ptr; /* Just a ptr, we keep the value but not accessing mem */
Clouseau_Object *info;
Eina_Bool is_obj;
Eina_Bool is_clipper;
Eina_Bool is_visible;
};
Eet_Data_Descriptor *clouseau_object_desc_make(void);
void clouseau_object_desc_shutdown(void);
void clouseau_object_information_list_clear(void);
/* Public */
EAPI Evas_Object *clouseau_object_information_list_add(Evas_Object *parent);
EAPI void clouseau_object_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb);
#endif

178
src/lib/Clouseau_Debug.h Normal file
View File

@ -0,0 +1,178 @@
#ifndef _CLOUSEAU_DEBUG_H
#define _CLOUSEAU_DEBUG_H
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
# ifdef DEBUG_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# endif /* ! DEBUG_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif /* ! _WIN32 */
#define EOLIAN_DEBUG_MAXARGS 15
#include <Eo.h>
#include <Eolian.h>
#include <Elementary.h>
typedef void (*Eo_Debug_Class_Extract_Cb)(void *data, uint64_t kl, char *kl_name);
typedef void (*Eo_Debug_Object_Extract_Cb)(void *data, uint64_t obj, uint64_t kl, uint64_t parent);
typedef enum
{
EOLIAN_DEBUG_INVALID_TYPE = 0,
EOLIAN_DEBUG_POINTER,
EOLIAN_DEBUG_STRING,
EOLIAN_DEBUG_CHAR,
EOLIAN_DEBUG_INT,
EOLIAN_DEBUG_SHORT,
EOLIAN_DEBUG_DOUBLE,
EOLIAN_DEBUG_BOOLEAN,
EOLIAN_DEBUG_LONG,
EOLIAN_DEBUG_UINT,
EOLIAN_DEBUG_LIST,
EOLIAN_DEBUG_OBJECT,
EOLIAN_DEBUG_VOID,
EOLIAN_DEBUG_STRUCT
} Eolian_Debug_Basic_Type;
typedef struct
{
Eolian_Debug_Basic_Type type;
uint64_t value;
Eina_List *complex_type_values;
} Eolian_Debug_Value;
typedef struct
{
Eolian_Debug_Value value;
const Eolian_Function_Parameter *eparam;
} Eolian_Debug_Parameter;
typedef struct
{
Eolian_Debug_Value value;
const Eolian_Type *etype;
} Eolian_Debug_Return;
typedef struct
{
const Eolian_Function *efunc;
Eolian_Debug_Return ret;
Eina_List *params; /* List of Eolian_Debug_Parameter * */
} Eolian_Debug_Function;
typedef struct
{
const Eolian_Unit *unit;
const Eolian_Class *ekl;
Eina_List *functions; /* List of Eolian_Debug_Function * */
} Eolian_Debug_Class;
typedef struct
{
uint64_t obj; /* Eo * */
Eina_List *classes; /* List of Eolian_Debug_Class * */
} Eolian_Debug_Object_Information;
typedef struct
{
uint64_t obj;
int w;
int h;
char *img;
int img_size;
int tm_sec;
int tm_min;
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);
EAPI void eo_debug_eoids_extract(void *buffer, int size, Eo_Debug_Object_Extract_Cb cb, void *data);
EAPI void eolian_debug_object_information_free(Eolian_Debug_Object_Information *main);
EAPI Eolian_Debug_Object_Information *
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

View File

@ -1,35 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir)/src/include \
-I$(top_builddir)/src/include \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EFL_CFLAGS@
EXTRA_DIST = \
Clouseau.h \
clouseau_private.h
pkgdir = $(libdir)/clouseau
pkg_LTLIBRARIES = libclouseau.la libclouseau_client.la
libclouseau_la_SOURCES = \
clouseau_client.c \
clouseau_object_information.c \
clouseau_data.c
libclouseau_la_LDFLAGS = -module -avoid-version -rdynamic
libclouseau_la_DEPENDENCIES = $(top_builddir)/config.h
libclouseau_la_LIBADD = @EFL_LIBS@
libclouseau_la_CFLAGS = @EFL_CFLAGS@
libclouseau_client_la_SOURCES = clouseau_object_information.c \
clouseau_data.c
libclouseau_client_la_DEPENDENCIES = $(top_builddir)/config.h
libclouseau_client_la_LIBADD = @EFL_LIBS@
libclouseau_client_la_CFLAGS = @EFL_CFLAGS@
libclouseau_client_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@

View File

@ -1,385 +0,0 @@
#include "Clouseau.h"
#include <dlfcn.h>
#include <execinfo.h>
#include <Ecore_Ipc.h>
#include <Edje.h>
#include <Evas.h>
#include <Elementary.h>
#include <Ecore_X.h>
#include "clouseau_private.h"
static Eina_Bool _elm_is_init = EINA_FALSE;
static const char *_my_app_name = NULL;
static void
libclouseau_item_add(Evas_Object *o, Clouseau_Tree_Item *parent)
{
Clouseau_Tree_Item *treeit;
Eina_List *children;
Evas_Object *child;
treeit = calloc(1, sizeof(Clouseau_Tree_Item));
if (!treeit) return ;
treeit->ptr = (uintptr_t) o;
treeit->is_obj = EINA_TRUE;
treeit->name = eina_stringshare_add(evas_object_type_get(o));
treeit->is_clipper = !!evas_object_clipees_get(o);
treeit->is_visible = evas_object_visible_get(o);
treeit->info = clouseau_object_information_get(treeit);
parent->children = eina_list_append(parent->children, treeit);
/* if (!evas_object_smart_data_get(o)) return ; */
/* Do this only for smart object */
children = evas_object_smart_members_get(o);
EINA_LIST_FREE(children, child)
libclouseau_item_add(child, treeit);
}
static void *
_canvas_bmp_get(Ecore_Evas *ee, Evas_Coord *w_out, Evas_Coord *h_out)
{
Ecore_X_Image *img;
Ecore_X_Window_Attributes att;
unsigned char *src;
unsigned int *dst;
int bpl = 0, rows = 0, bpp = 0;
Evas_Coord w, h;
/* Check that this window still exists */
Eina_List *eeitr, *ees = ecore_evas_ecore_evas_list_get();
Ecore_Evas *eel;
Eina_Bool found_evas = EINA_FALSE;
EINA_LIST_FOREACH(ees, eeitr, eel)
if (eel == ee)
{
found_evas = EINA_TRUE;
break;
}
Ecore_X_Window xwin = (found_evas) ?
(Ecore_X_Window) ecore_evas_window_get(ee) : 0;
if (!xwin)
{
printf("Can't grab X window.\n");
*w_out = *h_out = 0;
return NULL;
}
Evas *e = ecore_evas_get(ee);
evas_output_size_get(e, &w, &h);
memset(&att, 0, sizeof(Ecore_X_Window_Attributes));
ecore_x_window_attributes_get(xwin, &att);
img = ecore_x_image_new(w, h, att.visual, att.depth);
ecore_x_image_get(img, xwin, 0, 0, 0, 0, w, h);
src = ecore_x_image_data_get(img, &bpl, &rows, &bpp);
dst = malloc(w * h * sizeof(int)); /* Will be freed by the user */
if (!ecore_x_image_is_argb32_get(img))
{ /* Fill dst buffer with image convert */
ecore_x_image_to_argb_convert(src, bpp, bpl,
att.colormap, att.visual,
0, 0, w, h,
dst, (w * sizeof(int)), 0, 0);
}
else
{ /* Fill dst buffer by copy */
memcpy(dst, src, (w * h * sizeof(int)));
}
/* dst now holds window bitmap */
ecore_x_image_free(img);
*w_out = w;
*h_out = h;
return (void *) dst;
}
static Eina_List *
_load_list(void)
{
Eina_List *tree = NULL;
Eina_List *ees;
Ecore_Evas *ee;
ees = ecore_evas_ecore_evas_list_get();
EINA_LIST_FREE(ees, ee)
{
Eina_List *objs;
Evas_Object *obj;
Clouseau_Tree_Item *treeit;
Evas *e;
int w, h;
e = ecore_evas_get(ee);
evas_output_size_get(e, &w, &h);
treeit = calloc(1, sizeof(Clouseau_Tree_Item));
if (!treeit) continue ;
treeit->name = eina_stringshare_add(ecore_evas_title_get(ee));
treeit->ptr = (uintptr_t) ee;
tree = eina_list_append(tree, treeit);
objs = evas_objects_in_rectangle_get(e, SHRT_MIN, SHRT_MIN,
USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE);
EINA_LIST_FREE(objs, obj)
libclouseau_item_add(obj, treeit);
}
return tree; /* User has to call clouseau_tree_free() */
}
static Eina_Bool
_add(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Add *ev)
{
void *p;
int size = 0;
ecore_ipc_server_data_size_max_set(ev->server, -1);
connect_st t = { getpid(), _my_app_name };
p = clouseau_data_packet_compose(CLOUSEAU_APP_CLIENT_CONNECT,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_server_flush(ev->server);
free(p);
}
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Del *ev)
{
if (!ev->server)
{
printf("Failed to establish connection to the server.\nExiting.\n");
ecore_main_loop_quit();
return ECORE_CALLBACK_RENEW;
}
printf("Lost server with ip %s!\n", ecore_ipc_server_ip_get(ev->server));
ecore_ipc_server_del(ev->server);
ecore_main_loop_quit();
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data *ev)
{
Variant_st *v;
v = clouseau_data_packet_info_get(ev->data, ev->size);
switch (clouseau_data_packet_mapping_type_get(v->type))
{
case CLOUSEAU_DATA_REQ:
{ /* data req includes ptr to GUI, to tell which client asking */
int size = 0;
data_req_st *req = v->data;
tree_data_st t;
t.gui = req->gui; /* GUI client requesting data from daemon */
t.app = req->app; /* APP client sending data to daemon */
t.tree = _load_list();
if (t.tree)
{ /* Reply with tree data to data request */
void *p = clouseau_data_packet_compose(CLOUSEAU_TREE_DATA,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_server_flush(ev->server);
free(p);
}
clouseau_data_tree_free(t.tree);
}
}
break;
case CLOUSEAU_HIGHLIGHT:
{ /* Highlight msg contains PTR of object to highlight */
highlight_st *ht = v->data;
Evas_Object *obj = (Evas_Object *) (uintptr_t) ht->object;
clouseau_data_object_highlight(obj, NULL, NULL);
}
break;
case CLOUSEAU_BMP_REQ:
{ /* Bitmap req msg contains PTR of Ecore Evas */
bmp_req_st *req = v->data;
Evas_Coord w, h;
int size = 0;
void *bmp = _canvas_bmp_get((Ecore_Evas *) (uintptr_t)
req->object, &w, &h);
bmp_info_st t = { req->gui,
req->app, req->object , req->ctr, w, h,
NULL,NULL, NULL, 1.0,
NULL, NULL, NULL, NULL, NULL, NULL };
void *p = clouseau_data_packet_compose(CLOUSEAU_BMP_DATA,
&t, sizeof(t), &size, bmp, (w * h * sizeof(int)));
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_server_flush(ev->server);
free(p);
}
if (bmp)
free(bmp);
}
break;
default:
break;
}
clouseau_data_variant_free(v);
return ECORE_CALLBACK_RENEW;
}
static int
_connect_to_daemon(void)
{
Ecore_Ipc_Server *svr;
const char *address = LOCALHOST;
eina_init();
ecore_init();
ecore_ipc_init();
svr = ecore_ipc_server_connect(ECORE_IPC_REMOTE_SYSTEM,
LOCALHOST, PORT, NULL);
if (!svr)
{
printf("could not connect to the server: %s, port %d.\n",
address, PORT);
return EINA_FALSE;
}
ecore_ipc_server_data_size_max_set(svr, -1);
/* set event handler for server connect */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
(Ecore_Event_Handler_Cb)_add, NULL);
/* set event handler for server disconnect */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
(Ecore_Event_Handler_Cb)_del, NULL);
/* set event handler for receiving server data */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
(Ecore_Event_Handler_Cb)_data, NULL);
return EINA_TRUE;
}
/* Hook on the elm_init
* We only do something here if we didn't already go into elm_init,
* which probably means we are not using elm. */
EAPI int
elm_init(int argc, char **argv)
{
int (*_elm_init)(int, char **) = dlsym(RTLD_NEXT, __func__);
if (!_elm_is_init)
{
_my_app_name = argv[0];
_elm_is_init = EINA_TRUE;
}
return _elm_init(argc, argv);
}
/* Hook on the main loop
* We only do something here if we didn't already go into elm_init,
* which probably means we are not using elm. */
EAPI void
ecore_main_loop_begin(void)
{
void (*_ecore_main_loop_begin)(void) = dlsym(RTLD_NEXT, __func__);
if (!_elm_is_init)
{
_my_app_name = "clouseau";
}
if(!_connect_to_daemon())
{
printf("Failed to connect to server.\n");
return;
}
clouseau_data_init();
_ecore_main_loop_begin();
clouseau_data_shutdown();
return;
}
#define EINA_LOCK_DEBUG_BT_NUM 64
typedef void (*Eina_Lock_Bt_Func) ();
EAPI Evas_Object *
evas_object_new(Evas *e)
{
Eina_Lock_Bt_Func lock_bt[EINA_LOCK_DEBUG_BT_NUM];
int lock_bt_num;
Evas_Object *(*_evas_object_new)(Evas *e) = dlsym(RTLD_NEXT, __func__);
Eina_Strbuf *str;
Evas_Object *r;
char **strings;
int i;
r = _evas_object_new(e);
if (!r) return NULL;
lock_bt_num = backtrace((void **)lock_bt, EINA_LOCK_DEBUG_BT_NUM);
strings = backtrace_symbols((void **)lock_bt, lock_bt_num);
str = eina_strbuf_new();
for (i = 1; i < lock_bt_num; ++i)
eina_strbuf_append_printf(str, "%s\n", strings[i]);
evas_object_data_set(r, ".clouseau.bt", eina_stringshare_add(eina_strbuf_string_get(str)));
free(strings);
eina_strbuf_free(str);
return r;
}
EAPI void
evas_object_free(Evas_Object *obj, int clean_layer)
{
void (*_evas_object_free)(Evas_Object *obj, int clean_layer) = dlsym(RTLD_NEXT, __func__);
const char *tmp;
tmp = evas_object_data_get(obj, ".clouseau.bt");
eina_stringshare_del(tmp);
_evas_object_free(obj, clean_layer);
}

File diff suppressed because it is too large Load Diff

1587
src/lib/clouseau_debug.c Normal file

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,643 +0,0 @@
#include "Clouseau.h"
typedef struct _Inf_Clouseau_Tree_Item Inf_Clouseau_Tree_Item;
struct _Inf_Clouseau_Tree_Item
{
Eina_List *children;
Evas_Object *icon;
const char *string;
};
static Eina_List *information_tree = NULL;
static Evas_Object *prop_list = NULL;
static Elm_Genlist_Item_Class itc;
static void
_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
/* Currently do nothing */
return;
}
static void
gl_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
Inf_Clouseau_Tree_Item *parent = elm_object_item_data_get(glit);
Inf_Clouseau_Tree_Item *tit;
Eina_List *itr;
EINA_LIST_FOREACH(parent->children, itr, tit)
{
Elm_Genlist_Item_Type iflag = (tit->children) ?
ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE;
elm_genlist_item_append(prop_list, &itc, tit, glit,
iflag, _gl_selected, NULL);
}
}
static void
gl_con(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
elm_genlist_item_subitems_clear(glit);
}
static void
gl_exp_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_TRUE);
}
static void
gl_con_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
elm_genlist_item_expanded_set(glit, EINA_FALSE);
}
static Evas_Object *
item_icon_get(void *data EINA_UNUSED, Evas_Object *parent EINA_UNUSED,
const char *part EINA_UNUSED)
{
return NULL;
}
static char *
item_text_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
Inf_Clouseau_Tree_Item *tit = data;
return strdup(tit->string);
}
EAPI Evas_Object *
clouseau_object_information_list_add(Evas_Object *parent)
{
prop_list = elm_genlist_add(parent);
itc.item_style = "default";
itc.func.text_get = item_text_get;
itc.func.content_get = item_icon_get;
itc.func.state_get = NULL;
itc.func.del = NULL;
evas_object_smart_callback_add(prop_list, "expand,request", gl_exp_req,
prop_list);
evas_object_smart_callback_add(prop_list, "contract,request", gl_con_req,
prop_list);
evas_object_smart_callback_add(prop_list, "expanded", gl_exp, prop_list);
evas_object_smart_callback_add(prop_list, "contracted", gl_con, prop_list);
evas_object_smart_callback_add(prop_list, "selected", _gl_selected, NULL);
return prop_list;
}
static void
_clouseau_item_tree_item_free(Inf_Clouseau_Tree_Item *parent)
{
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(parent->children, treeit)
{
_clouseau_item_tree_item_free(treeit);
}
eina_stringshare_del(parent->string);
free(parent);
}
static void
_clouseau_item_tree_free(void)
{
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(information_tree, treeit)
{
_clouseau_item_tree_item_free(treeit);
}
}
EAPI void
clouseau_object_information_free(Clouseau_Object *oinfo)
{
if (!oinfo)
return;
eina_stringshare_del(oinfo->evas_props.name);
eina_stringshare_del(oinfo->evas_props.bt);
if (oinfo->evas_props.points)
free(oinfo->evas_props.points);
switch (oinfo->extra_props.type)
{
case CLOUSEAU_OBJ_TYPE_ELM:
eina_stringshare_del(oinfo->extra_props.u.elm.type);
eina_stringshare_del(oinfo->extra_props.u.elm.style);
break;
case CLOUSEAU_OBJ_TYPE_TEXT:
eina_stringshare_del(oinfo->extra_props.u.text.font);
eina_stringshare_del(oinfo->extra_props.u.text.source);
eina_stringshare_del(oinfo->extra_props.u.text.text);
break;
case CLOUSEAU_OBJ_TYPE_IMAGE:
eina_stringshare_del(oinfo->extra_props.u.image.file);
eina_stringshare_del(oinfo->extra_props.u.image.key);
eina_stringshare_del(oinfo->extra_props.u.image.load_err);
break;
case CLOUSEAU_OBJ_TYPE_EDJE:
eina_stringshare_del(oinfo->extra_props.u.edje.file);
eina_stringshare_del(oinfo->extra_props.u.edje.group);
eina_stringshare_del(oinfo->extra_props.u.edje.load_err);
break;
case CLOUSEAU_OBJ_TYPE_TEXTBLOCK:
eina_stringshare_del(oinfo->extra_props.u.textblock.style);
eina_stringshare_del(oinfo->extra_props.u.textblock.text);
break;
case CLOUSEAU_OBJ_TYPE_UNKNOWN:
case CLOUSEAU_OBJ_TYPE_OTHER:
break;
}
free(oinfo);
}
EAPI Clouseau_Object *
clouseau_object_information_get(Clouseau_Tree_Item *treeit)
{
Clouseau_Object *oinfo;
Evas_Object *obj = (void*) (uintptr_t) treeit->ptr;
const Evas_Map *map = NULL;
if (!treeit->is_obj)
return NULL;
oinfo = calloc(1, sizeof(Clouseau_Object));
oinfo->evas_props.pass_events = evas_object_pass_events_get(obj);
oinfo->evas_props.repeat_events = evas_object_repeat_events_get(obj);
oinfo->evas_props.propagate_events = evas_object_propagate_events_get(obj);
oinfo->evas_props.has_focus = evas_object_focus_get(obj);
oinfo->evas_props.is_visible = evas_object_visible_get(obj);
oinfo->evas_props.name = eina_stringshare_add(evas_object_name_get(obj));
oinfo->evas_props.layer = evas_object_layer_get(obj);
evas_object_geometry_get(obj, &oinfo->evas_props.x, &oinfo->evas_props.y,
&oinfo->evas_props.w, &oinfo->evas_props.h);
oinfo->evas_props.scale = evas_object_scale_get(obj);
evas_object_size_hint_min_get(obj, &oinfo->evas_props.min_w,
&oinfo->evas_props.min_h);
evas_object_size_hint_max_get(obj, &oinfo->evas_props.max_w,
&oinfo->evas_props.max_h);
evas_object_size_hint_request_get(obj, &oinfo->evas_props.req_w,
&oinfo->evas_props.req_h);
evas_object_size_hint_align_get(obj, &oinfo->evas_props.align_x,
&oinfo->evas_props.align_y);
evas_object_size_hint_weight_get(obj, &oinfo->evas_props.weight_x,
&oinfo->evas_props.weight_y);
evas_object_color_get(obj, &oinfo->evas_props.r, &oinfo->evas_props.g,
&oinfo->evas_props.b, &oinfo->evas_props.a);
oinfo->evas_props.mode = evas_object_pointer_mode_get(obj);
oinfo->evas_props.is_clipper = !!evas_object_clipees_get(obj);
oinfo->evas_props.clipper = (uintptr_t) evas_object_clip_get(obj);
oinfo->evas_props.bt = eina_stringshare_ref(evas_object_data_get(obj, ".clouseau.bt"));
map = evas_object_map_get(obj);
if (map)
{ /* Save map coords count info if object has map */
oinfo->evas_props.points_count = evas_map_count_get(map);
if (oinfo->evas_props.points_count)
{
int i;
Clouseau_Evas_Map_Point_Props *p;
oinfo->evas_props.points = calloc(oinfo->evas_props.points_count,
sizeof(Clouseau_Evas_Map_Point_Props));
for(i = 0 ; i < oinfo->evas_props.points_count; i++)
{
p = &oinfo->evas_props.points[i];
evas_map_point_coord_get(map, i, &p->x, &p->y, &p->z);
}
}
}
if (elm_widget_is(obj))
{
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_ELM;
oinfo->extra_props.u.elm.type =
eina_stringshare_add(elm_widget_type_get(obj));
oinfo->extra_props.u.elm.style =
eina_stringshare_add(elm_widget_style_get(obj));
oinfo->extra_props.u.elm.scale = elm_widget_scale_get(obj);
oinfo->extra_props.u.elm.has_focus = elm_object_focus_get(obj);
oinfo->extra_props.u.elm.is_disabled = elm_widget_disabled_get(obj);
oinfo->extra_props.u.elm.is_mirrored = elm_widget_mirrored_get(obj);
oinfo->extra_props.u.elm.is_mirrored_automatic =
elm_widget_mirrored_automatic_get(obj);
}
else if (!strcmp("text", evas_object_type_get(obj)))
{
const char *font;
int size;
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_TEXT;
evas_object_text_font_get(obj, &font, &size);
oinfo->extra_props.u.text.font = eina_stringshare_add(font);
oinfo->extra_props.u.text.size = size;
oinfo->extra_props.u.text.source =
eina_stringshare_add(evas_object_text_font_source_get(obj));
oinfo->extra_props.u.text.text = eina_stringshare_add(evas_object_text_text_get(obj));
}
else if (!strcmp("image", evas_object_type_get(obj)))
{
const char *file, *key;
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_IMAGE;
evas_object_image_file_get(obj, &file, &key);
oinfo->extra_props.u.image.file = eina_stringshare_add(file);
oinfo->extra_props.u.image.key = eina_stringshare_add(key);
oinfo->extra_props.u.image.source = evas_object_image_source_get(obj);
if (evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE)
{
oinfo->extra_props.u.image.load_err = eina_stringshare_add(
evas_load_error_str(evas_object_image_load_error_get(obj)));
}
}
else if (!strcmp("edje", evas_object_type_get(obj)))
{
const char *file, *group;
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_EDJE;
edje_object_file_get(obj, &file, &group);
oinfo->extra_props.u.edje.file = eina_stringshare_add(file);
oinfo->extra_props.u.edje.group = eina_stringshare_add(group);
if (edje_object_load_error_get(obj) != EDJE_LOAD_ERROR_NONE)
{
oinfo->extra_props.u.edje.load_err = eina_stringshare_add(
edje_load_error_str(edje_object_load_error_get(obj)));
}
}
else if (!strcmp("textblock", evas_object_type_get(obj)))
{
const char *style;
const char *text;
char shorttext[48];
const Evas_Textblock_Style *ts;
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_TEXTBLOCK;
ts = evas_object_textblock_style_get(obj);
style = evas_textblock_style_get(ts);
text = evas_object_textblock_text_markup_get(obj);
strncpy(shorttext, text, 38);
if (shorttext[37])
strcpy(shorttext + 37, "\xe2\x80\xa6"); /* HORIZONTAL ELLIPSIS */
oinfo->extra_props.u.textblock.style = eina_stringshare_add(style);
oinfo->extra_props.u.textblock.text = eina_stringshare_add(shorttext);
}
else
{
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_OTHER;
}
return oinfo;
}
static const struct {
const char *text;
Evas_Object_Pointer_Mode mode;
} pointer_mode[3] = {
# define POINTER_MODE(Value) { #Value, Value }
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_AUTOGRAB),
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB),
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
# undef POINTER_MODE
};
static void
_clouseau_information_buffer_to_tree(Inf_Clouseau_Tree_Item *parent, const char *buffer)
{
Inf_Clouseau_Tree_Item *item;
item = calloc(1, sizeof (Inf_Clouseau_Tree_Item));
if (!item) return ;
item->string = eina_stringshare_add(buffer);
parent->children = eina_list_append(parent->children, item);
}
static void
_clouseau_information_string_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, const char *value)
{
char *buffer;
int length;
if (!value) return ;
length = strlen(name) + 5;
length += strlen(value);
buffer = alloca(length);
snprintf(buffer, length, "%s: '%s'", name, value);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_geometry_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, int xw, int yh)
{
char *buffer;
int length;
length = strlen(name) + 4 + 20;
buffer = alloca(length);
snprintf(buffer, length, "%s: %d %d", name, xw, yh);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_bool_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, Eina_Bool value)
{
_clouseau_information_string_to_tree(parent, name, value ? "EINA_TRUE" : "EINA_FALSE");
}
static void
_clouseau_information_double_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, double d)
{
char *buffer;
int length;
length = strlen(name) + 3 + 64;
buffer = alloca(length);
snprintf(buffer, length, "%s: %.6lg", name, d);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_hint_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, double xw, double yh)
{
char *buffer;
int length;
length = strlen(name) + 3 + 128;
buffer = alloca(length);
snprintf(buffer, length, "%s: %.6lg %.61g", name, xw, yh);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static const struct {
Clouseau_Object_Type type;
const char *name;
} _clouseau_types[] = {
{ CLOUSEAU_OBJ_TYPE_ELM, "Elementary" },
{ CLOUSEAU_OBJ_TYPE_TEXT, "Text" },
{ CLOUSEAU_OBJ_TYPE_IMAGE, "Image" },
{ CLOUSEAU_OBJ_TYPE_EDJE, "Edje" },
{ CLOUSEAU_OBJ_TYPE_TEXTBLOCK, "Textblock" }
};
static const char *
_clouseau_type_to_string(Clouseau_Object_Type type)
{
unsigned int i;
for (i = 0; i < sizeof (_clouseau_types) / sizeof (_clouseau_types[0]); ++i)
if (_clouseau_types[i].type == type)
return eina_stringshare_add(_clouseau_types[i].name);
return NULL;
}
static Inf_Clouseau_Tree_Item *
_clouseau_type_to_parent(Eina_List **main, const char *name)
{
Inf_Clouseau_Tree_Item *item;
if (!name) return NULL;
item = calloc(1, sizeof(Inf_Clouseau_Tree_Item));
item->string = eina_stringshare_add(name);
*main = eina_list_append(*main, item);
return item;
}
EAPI void
clouseau_object_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb)
{
Inf_Clouseau_Tree_Item *main_tit;
Clouseau_Object *oinfo;
char buf[1024];
unsigned int i;
clouseau_object_information_list_clear();
if (!treeit->is_obj)
return;
oinfo = treeit->info;
/* Populate evas properties list */
main_tit = _clouseau_type_to_parent(&information_tree, "Evas");
_clouseau_information_bool_to_tree(main_tit, "Visibility",
oinfo->evas_props.is_visible);
_clouseau_information_string_to_tree(main_tit, "Name", oinfo->evas_props.name);
snprintf(buf, sizeof(buf), "Layer: %hd", oinfo->evas_props.layer);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_geometry_to_tree(main_tit, "Position",
oinfo->evas_props.x,
oinfo->evas_props.y);
_clouseau_information_geometry_to_tree(main_tit, "Size",
oinfo->evas_props.w,
oinfo->evas_props.h);
_clouseau_information_double_to_tree(main_tit, "Scale", oinfo->evas_props.scale);
#if 0
if (evas_object_clip_get(obj))
{
evas_object_geometry_get(evas_object_clip_get(obj), &x, &y, &w, &h);
_clouseau_information_geometry_to_tree(main_tit, "Clipper position", x, y);
_clouseau_information_geometry_to_tree(main_tit, "Clipper size", w, h);
}
#endif
_clouseau_information_geometry_to_tree(main_tit, "Min size",
oinfo->evas_props.min_w,
oinfo->evas_props.min_h);
_clouseau_information_geometry_to_tree(main_tit, "Max size",
oinfo->evas_props.max_w,
oinfo->evas_props.max_h);
_clouseau_information_geometry_to_tree(main_tit, "Request size",
oinfo->evas_props.req_w,
oinfo->evas_props.req_h);
_clouseau_information_hint_to_tree(main_tit, "Align",
oinfo->evas_props.align_x,
oinfo->evas_props.align_y);
_clouseau_information_hint_to_tree(main_tit, "Weight",
oinfo->evas_props.weight_x,
oinfo->evas_props.weight_y);
#if 0
evas_object_size_hint_aspect_get(obj, &w, &h);
_clouseau_information_geometry_to_tree(main_tit, "Aspect", w, h);
#endif
snprintf(buf, sizeof(buf), "Color: %d %d %d %d",
oinfo->evas_props.r, oinfo->evas_props.g, oinfo->evas_props.b,
oinfo->evas_props.a);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_bool_to_tree(main_tit, "Has focus",
oinfo->evas_props.has_focus);
for (i = 0; i < sizeof (pointer_mode) / sizeof (pointer_mode[0]); ++i)
if (pointer_mode[i].mode == oinfo->evas_props.mode)
{
_clouseau_information_string_to_tree(main_tit, "Pointer mode",
pointer_mode[i].text);
break;
}
_clouseau_information_bool_to_tree(main_tit, "Pass events",
oinfo->evas_props.pass_events);
_clouseau_information_bool_to_tree(main_tit, "Repeat events",
oinfo->evas_props.repeat_events);
_clouseau_information_bool_to_tree(main_tit, "Propagate events",
oinfo->evas_props.propagate_events);
_clouseau_information_bool_to_tree(main_tit, "Has clipees",
oinfo->evas_props.is_clipper);
if (oinfo->evas_props.clipper)
{
snprintf(buf, sizeof(buf), "%llx", oinfo->evas_props.clipper);
_clouseau_information_string_to_tree(main_tit, "Clipper", buf);
}
if (oinfo->evas_props.points_count)
{
main_tit = _clouseau_type_to_parent(&main_tit->children, "Evas Map");
Clouseau_Evas_Map_Point_Props *p;
for(i = 0 ; (int) i < oinfo->evas_props.points_count; i++)
{
p = &oinfo->evas_props.points[i];
snprintf(buf, sizeof(buf), "Coords: %d %d %d", p->x, p->y, p->z);
_clouseau_information_buffer_to_tree(main_tit, buf);
}
}
main_tit = _clouseau_type_to_parent(&information_tree,
_clouseau_type_to_string(oinfo->extra_props.type));
if (main_tit)
{
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
{
_clouseau_information_string_to_tree(main_tit, "Wid-Type", oinfo->extra_props.u.elm.type);
#if 0
/* Extract actual data from theme? */
_clouseau_information_string_to_tree(main_tit, "Theme", elm_widget_theme_get(obj));
#endif
_clouseau_information_string_to_tree(main_tit, "Style", oinfo->extra_props.u.elm.style);
_clouseau_information_double_to_tree(main_tit, "Scale",
oinfo->extra_props.u.elm.scale);
_clouseau_information_bool_to_tree(main_tit, "Disabled",
oinfo->extra_props.u.elm.is_disabled);
_clouseau_information_bool_to_tree(main_tit, "Has focus",
oinfo->extra_props.u.elm.has_focus);
_clouseau_information_bool_to_tree(main_tit, "Mirrored",
oinfo->extra_props.u.elm.is_mirrored);
_clouseau_information_bool_to_tree(main_tit, "Automatic mirroring",
oinfo->extra_props.u.elm.is_mirrored_automatic);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
{
_clouseau_information_string_to_tree(main_tit, "Font", oinfo->extra_props.u.text.font);
snprintf(buf, sizeof(buf), "Size: %d", oinfo->extra_props.u.text.size);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_string_to_tree(main_tit, "Source", oinfo->extra_props.u.text.source);
_clouseau_information_string_to_tree(main_tit, "Text", oinfo->extra_props.u.text.text);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
{
_clouseau_information_string_to_tree(main_tit, "Filename", oinfo->extra_props.u.image.file);
_clouseau_information_string_to_tree(main_tit, "File key", oinfo->extra_props.u.image.key);
snprintf(buf, sizeof(buf), "Source: %p", oinfo->extra_props.u.image.source);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_string_to_tree(main_tit, "Load error", oinfo->extra_props.u.image.load_err);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
{
_clouseau_information_string_to_tree(main_tit, "File", oinfo->extra_props.u.edje.file);
_clouseau_information_string_to_tree(main_tit, "Group", oinfo->extra_props.u.edje.group);
_clouseau_information_string_to_tree(main_tit, "Load error", oinfo->extra_props.u.edje.load_err);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
{
_clouseau_information_string_to_tree(main_tit, "Style", oinfo->extra_props.u.textblock.style);
_clouseau_information_string_to_tree(main_tit, "Text", oinfo->extra_props.u.textblock.text);
}
}
/* Update backtrace text */
if (oinfo->evas_props.bt)
{ /* Build backtrace label */
char *k = malloc(strlen("Creation backtrace:\n\n") +
strlen(oinfo->evas_props.bt) + 1);
sprintf(k, "Creation backtrace:\n\n%s", oinfo->evas_props.bt);
char *p = elm_entry_utf8_to_markup(k);
elm_object_text_set(lb, p);
free(p);
free(k);
}
else
elm_object_text_set(lb, NULL);
/* Actually populate the genlist */
{
Eina_List *itr, *expand_list = NULL, *l, *l_prev;
Inf_Clouseau_Tree_Item *tit;
Elm_Object_Item *expand_it = NULL;
EINA_LIST_FOREACH(information_tree, itr, tit)
{
Elm_Object_Item *git;
git = elm_genlist_item_append(prop_list, &itc, tit, NULL,
ELM_GENLIST_ITEM_TREE, _gl_selected, NULL);
expand_list = eina_list_append(expand_list, git);
}
EINA_LIST_REVERSE_FOREACH_SAFE(expand_list, l, l_prev, expand_it)
{
elm_genlist_item_expanded_set(expand_it, EINA_TRUE);
expand_list = eina_list_remove_list(expand_list, l);
}
}
}
EAPI void
clouseau_object_information_list_clear(void)
{
_clouseau_item_tree_free();
elm_genlist_clear(prop_list);
}

View File

@ -1,169 +0,0 @@
#ifndef EET_DATA_H
#define EET_DATA_H
#include "Clouseau.h"
/* Global constants */
#define BMP_FIELD "bmp"
#define PORT (22522)
#define MAX_LINE (1023)
#define LOCALHOST "127.0.0.1"
#define LISTEN_IP "0.0.0.0" /* Avail all, no mask */
/* Define packet types, used by packet encode / decode */
#define VARIANT_PACKET 0
#define BMP_RAW_DATA 1
enum _Clouseau_Message_Type
{ /* Add any supported types of packets here */
CLOUSEAU_UNKNOWN = 0,
CLOUSEAU_GUI_CLIENT_CONNECT = 1, /* client PID, name */
CLOUSEAU_APP_CLIENT_CONNECT = 2, /* client PID, name */
CLOUSEAU_APP_ADD = 3, /* client PTR, name, PID fwd to GUI client */
CLOUSEAU_DATA_REQ = 4, /* GUI client PTR (NULL for all),APP client PTR (NULL for all) */
CLOUSEAU_TREE_DATA = 5, /* GUI client PTR (NULL for all),APP client PTR, Tree Data */
CLOUSEAU_APP_CLOSED = 6,/* APP client PTR from DAEMON to GUI */
CLOUSEAU_HIGHLIGHT = 7, /* APP client PTR, object PTR */
CLOUSEAU_BMP_REQ = 8, /* APP client PTR, object PTR */
CLOUSEAU_BMP_DATA = 9 /* bmp_info_st header + BMP raw data */
};
typedef enum _Clouseau_Message_Type Clouseau_Message_Type;
/* This is used for composing message and encoding/decoding with EET */
struct _Variant_st
{
const char *type;
void *data;
};
typedef struct _Variant_st Variant_st;
struct _connect_st
{ /* This will be used for APP, GUI client connect */
unsigned int pid;
const char *name;
};
typedef struct _connect_st connect_st;
struct _app_info_st
{ /* This will be used to register new APP in GUI client */
unsigned int pid;
char *name;
char *file; /* Valid only if was read from file in offline mode */
unsigned long long ptr; /* (void *) client ptr of app as saved by daemon */
Eina_List *view; /* Screen views view->data is (bmp_info_st *) ptr */
unsigned int refresh_ctr; /* Counter of how many times down refresh */
};
typedef struct _app_info_st app_info_st;
struct _data_req_st
{ /* This will be used to ask for tree data by DAEMON or GUI */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr APP */
};
typedef struct _data_req_st data_req_st;
struct _tree_data_st
{ /* This will be used to send tree data to/from APP/DAEMON */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr APP */
Eina_List *tree; /* The actual (Tree_Item *) list */
};
typedef struct _tree_data_st tree_data_st;
struct _app_closed_st
{ /* This will be used to notify GUI of app closed */
unsigned long long ptr; /* (void *) client ptr APP */
};
typedef struct _app_closed_st app_closed_st;
struct _highlight_st
{ /* This will be used to highlight object in APP */
unsigned long long app; /* (void *) client ptr of APP */
unsigned long long object; /* (void *) object ptr of object to highlight */
};
typedef struct _highlight_st highlight_st;
struct _bmp_req_st
{ /* This will be used to send tree data to/from APP/DAEMON */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr APP */
unsigned long long object; /* (void *) object ptr of Evas */
unsigned int ctr; /* Reload counter to match */
};
typedef struct _bmp_req_st bmp_req_st;
struct _bmp_info_st
{ /* This will be used to send app window Bitmap */
/* We are using ULONGLONG because we send this as RAW data */
/* win, bt are NOT transferred. */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr of APP */
unsigned long long object; /* (void *) object ptr of evas */
unsigned long long ctr; /* Reload counter to match */
unsigned long long w; /* BMP width, make Evas_Coord */
unsigned long long h; /* BMP hight, make Evas_Coord */
/* All the following fields are NOT transferred in EET msg */
Evas_Object *win; /* Window of view if open */
Evas_Object *scr; /* Scroller holds view */
Evas_Object *o; /* Actuall object displays BMP */
double zoom_val; /* Current zoom value */
Evas_Object *lb_mouse; /* Label contains mouse cords */
Evas_Object *lb_rgba; /* Current mouse pos rgba val */
Evas_Object *bt; /* Button opening win */
Evas_Object *lx; /* Line on X axis */
Evas_Object *ly; /* Line on Y axis */
void *bmp; /* Bitmap BLOB, size (w * h * sizeof(int)) */
};
typedef struct _bmp_info_st bmp_info_st;
struct _shot_list_st
{ /* This will be used to write a shot list to eet file */
Eina_List *view; /* Screen views eahc is (bmp_info_st *) ptr */
};
typedef struct _shot_list_st shot_list_st;
struct _data_desc
{
Eet_Data_Descriptor *bmp_data;
Eet_Data_Descriptor *bmp_req;
Eet_Data_Descriptor *bmp_info;
Eet_Data_Descriptor *shot_list;
Eet_Data_Descriptor *connect;
Eet_Data_Descriptor *app_add;
Eet_Data_Descriptor *data_req;
Eet_Data_Descriptor *tree_data;
Eet_Data_Descriptor *app_closed;
Eet_Data_Descriptor *highlight;
Eet_Data_Descriptor *tree;
Eet_Data_Descriptor *obj_info;
Eet_Data_Descriptor *_variant_descriptor;
Eet_Data_Descriptor *_variant_unified_descriptor;
};
typedef struct _data_desc data_desc;
/* Private function */
#define CLOUSEAU_APP_ADD_ENTRY "clouseau/app"
#define CLOUSEAU_TREE_DATA_ENTRY "clouseau/app/tree"
#define CLOUSEAU_BMP_LIST_ENTRY "clouseau/app/shot_list"
#define CLOUSEAU_BMP_DATA_ENTRY "clouseau/app/screenshot"
/* Exported From Object information */
EAPI void clouseau_object_information_free(Clouseau_Object *oinfo);
EAPI Clouseau_Object * clouseau_object_information_get(Clouseau_Tree_Item *treeit);
/* Exported function */
EAPI void clouseau_data_tree_free(Eina_List *tree);
EAPI Clouseau_Message_Type clouseau_data_packet_mapping_type_get(const char *name);
EAPI void clouseau_data_variant_free(Variant_st *v);
EAPI Variant_st *clouseau_data_variant_alloc(Clouseau_Message_Type t, size_t size, void *info);
EAPI void * clouseau_data_packet_compose(Clouseau_Message_Type t, void *data, int data_size, int *size, void *blob, int blob_size);
EAPI Variant_st *
clouseau_data_packet_info_get(void *data, int size);
EAPI void clouseau_data_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view);
EAPI Eina_Bool clouseau_data_eet_info_save(const char *filename, app_info_st *a, tree_data_st *ftd, Eina_List *ck_list);
EAPI Eina_Bool clouseau_data_eet_info_read(const char *filename, app_info_st **a, tree_data_st **ftd);
EAPI int clouseau_data_init(void);
EAPI int clouseau_data_shutdown(void);
#endif /* EET_DATA_H */

View File

@ -0,0 +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

@ -0,0 +1,29 @@
set(CMAKE_BUILD_TYPE Debug)
add_definitions(-DEFL_EO_API_SUPPORT -DEVLOG_EDJ="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/clouseau_evlog.edj")
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${ELEMENTARY_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EET_INCLUDE_DIRS}
)
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
add_library(clouseau_evlog SHARED main.c)
target_link_libraries(clouseau_evlog
${ELEMENTARY_LIBRARIES}
${EVAS_LIBRARIES}
${EO_LIBRARIES}
${EINA_LIBRARIES}
${EET_LIBRARIES}
)
INSTALL(TARGETS clouseau_evlog LIBRARY DESTINATION lib)

File diff suppressed because it is too large Load Diff

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

@ -0,0 +1,31 @@
set(CMAKE_BUILD_TYPE Debug)
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}")
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_objects_introspection SHARED main.c gui.c)
target_link_libraries(clouseau_objects_introspection
${ELEMENTARY_LIBRARIES}
${EVAS_LIBRARIES}
${EO_LIBRARIES}
${EINA_LIBRARIES}
${EET_LIBRARIES}
${EOLIAN_LIBRARIES}
clouseau_debug
)
INSTALL(TARGETS clouseau_objects_introspection LIBRARY DESTINATION lib)

View File

@ -0,0 +1,203 @@
#ifndef EFL_BETA_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#endif
#ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT
#endif
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
#define ELM_INTERNAL_API_ARGESFSDFEFC
#endif
#include <Efl_Ui.h>
#include <Elementary.h>
#include "gui.h"
static const char* objs_types_strings[] =
{
"Show all canvas objects",
"Only show Elementary widgets",
NULL
};
#ifdef GUI_IMAGES_PATH
const char *SHOW_SCREENSHOT_ICON = GUI_IMAGES_PATH"/show-screenshot.png";
const char *TAKE_SCREENSHOT_ICON = GUI_IMAGES_PATH"/take-screenshot.png";
#else
#error "Please define GUI_IMAGES_PATH"
#endif
extern void
screenshot_req_cb(void *data, const Efl_Event *event);
extern void
reload_perform(void *data, Evas_Object *obj, void *event_info);
extern void
take_screenshot_button_clicked(void *data, const Efl_Event *event);
extern void
show_screenshot_button_clicked(void *data, const Efl_Event *event);
extern void
snapshot_do(void *data, Evas_Object *fs, void *event_info);
extern void
objs_type_changed(void *data, Evas_Object *obj, void *event_info);
extern void
highlight_changed(void *data, Evas_Object *obj, void *event_info);
extern void
jump_to_ptr_inwin_show(void *data, Evas_Object *obj, void *event_info);
static void
_pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
free(data);
}
Gui_Win_Widgets *
gui_win_create(Eo *__main_parent)
{
Gui_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *box, *tb;
Eo *panes;
Eo *object_infos_list;
Eo *objects_list;
box = elm_box_add(__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_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);
pub_widgets->tb = tb;
elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
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_entity_visible_set(tb, EINA_TRUE);
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
elm_toolbar_item_append(tb, "edit-find", "Jump To Pointer", jump_to_ptr_inwin_show, NULL);
{
int i = 0;
Eo *settings_it = elm_toolbar_item_append(tb, "system-run", "Settings", NULL, NULL);
elm_toolbar_item_menu_set(settings_it, EINA_TRUE);
Eo *settings_menu = elm_toolbar_item_menu_get(settings_it);
pub_widgets->settings_menu = settings_menu;
Eo *objs_type_it = elm_menu_item_add(settings_menu, NULL, NULL,
"Objects types display", NULL, NULL);
while (objs_types_strings[i])
{
Eo *it = elm_menu_item_add(settings_menu, objs_type_it, NULL,
objs_types_strings[i], objs_type_changed, (void *)(uintptr_t)i);
Eo *rd = elm_radio_add(settings_menu);
elm_radio_state_value_set(rd, i);
if (!i) pub_widgets->objs_type_radio = rd;
else elm_radio_group_add(rd, pub_widgets->objs_type_radio);
elm_object_item_content_set(it, rd);
i++;
}
Eo *highlight_it = elm_menu_item_add(settings_menu, NULL, NULL,
"Hightlight", highlight_changed, NULL);
Eo *ck = elm_check_add(settings_menu);
elm_object_item_content_set(highlight_it, ck);
pub_widgets->highlight_ck = ck;
}
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_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);
elm_box_pack_end(box, panes);
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_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_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);
return pub_widgets;
}
Gui_Take_Screenshot_Button_Widgets *
gui_take_screenshot_button_create(Eo *__main_parent)
{
Gui_Take_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *bt;
Eo *elm_icon1;
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
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_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);
return pub_widgets;
}
Gui_Show_Screenshot_Button_Widgets *
gui_show_screenshot_button_create(Eo *__main_parent)
{
Gui_Show_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *bt;
Eo *elm_icon1;
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
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_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);
return pub_widgets;
}
Gui_Show_Screenshot_Win_Widgets *
gui_show_screenshot_win_create(Eo *__main_parent)
{
Gui_Show_Screenshot_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
Eo *win;
Eo *bg;
win = elm_win_add(__main_parent, "Screenshot", ELM_WIN_BASIC);
pub_widgets->win = win;
elm_win_autodel_set(win, EINA_TRUE);
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 = elm_bg_add(win);
pub_widgets->bg = bg;
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
efl_gfx_entity_visible_set(bg, EINA_TRUE);
elm_win_resize_object_add(win, bg);
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

@ -0,0 +1,41 @@
#ifndef _gui_h_
#define _gui_h_
#include <Eo.h>
#include <Elementary.h>
typedef struct
{
Eo *main;
Eo *tb;
Eo *settings_menu;
Eo *reload_button;
Eo *objs_type_radio;
Eo *highlight_ck;
Eo *object_infos_list;
Eo *objects_list;
} Gui_Win_Widgets;
typedef struct
{
Eo *bt;
} Gui_Take_Screenshot_Button_Widgets;
typedef struct
{
Eo *bt;
} Gui_Show_Screenshot_Button_Widgets;
typedef struct
{
Eo *win;
Eo *bg;
} Gui_Show_Screenshot_Win_Widgets;
Gui_Win_Widgets *gui_win_create(Eo *parent);
Gui_Take_Screenshot_Button_Widgets *gui_take_screenshot_button_create(Eo *parent);
Gui_Show_Screenshot_Button_Widgets *gui_show_screenshot_button_create(Eo *parent);
Gui_Show_Screenshot_Win_Widgets *gui_show_screenshot_win_create(Eo *parent);
#endif

File diff suppressed because it is too large Load Diff

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;
}

View File

@ -1,16 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = gen_script.sh
uninstall-local:
rm $(DESTDIR)$(bindir)/clouseau
rm $(DESTDIR)$(bindir)/clouseau_start
clean-local:
rm clouseau
rm clouseau_start
install-exec-local:
$(srcdir)/gen_script.sh $(libdir)/clouseau
$(INSTALL) clouseau_start $(DESTDIR)$(bindir)
$(INSTALL) clouseau $(DESTDIR)$(bindir)

View File

@ -1,26 +0,0 @@
#!/bin/sh
cat <<-ENDOFMESSAGE>clouseau_start
#!/bin/sh
if [ \$# -lt 1 ]
then
echo "Usage: clouseau_start <executable> [executable parameters]"
else
# Start clouseau daemon (will start single instance), then run app
clouseaud
LD_PRELOAD="$1/libclouseau.so" "\$@"
fi
ENDOFMESSAGE
cat <<-ENDOFMESSAGE>clouseau
#!/bin/sh
if [ \$# -gt 0 ]
then
# Start clouseau daemon (will start single instance), then run app
clouseau_start "\$@" &
fi
clouseau_client
ENDOFMESSAGE
chmod +x clouseau
chmod +x clouseau_start