Author Topic: event sequence question?  (Read 16020 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
event sequence question?
« on: September 03, 2011, 02:44:49 pm »
By reading the CC's source, I'm totally confused about the events sent from the C::B core and the event sequences.

I'd like to see the official development document about all the C::B's event sending sequence and other official C::B event.

I remember several years ago, we have a discussion: Puzzling cbEVT_EDITOR_* event behavior

But that discussion does not show all the sequence, so are there any documents?

If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: event sequence question?
« Reply #1 on: September 03, 2011, 10:40:45 pm »
But that discussion does not show all the sequence, so are there any documents?
No, of course, the source is the only documentation, because it is the most up to date resource
and it is too easy if there are docs, real programmers don't write docs and don't need docs :)  (the last one is me joking)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9657
Re: event sequence question?
« Reply #2 on: September 05, 2011, 07:25:07 am »
If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.
There are two of this plugins - Jens's was called EventsDisplay (IIRC). However, adding this to trunk makes no sense as it would seriously spoil down C::B in terms of performance and stability. Just search the forums (it should be still there) and compile it yourself... it's a pretty simple plugin in the end. (However, I doubt it is still up-to-date...?!)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: event sequence question?
« Reply #3 on: September 05, 2011, 08:09:55 am »
If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.
There are two of this plugins - Jens's was called EventsDisplay (IIRC). However, adding this to trunk makes no sense as it would seriously spoil down C::B in terms of performance and stability. Just search the forums (it should be still there) and compile it yourself... it's a pretty simple plugin in the end. (However, I doubt it is still up-to-date...?!)
I just updated it, and will upload it to my server.
It might also be added to the plugins (not contrib), just like the headerguard-plugin for example, without being included in automake-system and contrib-plugins workspace.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: event sequence question?
« Reply #4 on: September 05, 2011, 09:02:37 am »
I just updated it, and will upload it to my server.

Here it is:
http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
unpack it into src/plugins subdirectory of C::B's sources (not in contrib !!).
Don't forget to run src/update[.bat] afterwards, to copy the plugin from devel- to output-folder.

The Makefile.am is not tested, so it might or might not work after integrating it into automake-system.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: event sequence question?
« Reply #5 on: September 05, 2011, 09:07:32 am »
I just updated it, and will upload it to my server.

Here it is:
http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
unpack it into src/plugins subdirectory of C::B's sources (not in contrib !!).
Don't forget to run src/update[.bat] afterwards, to copy the plugin from devel- to output-folder.

The Makefile.am is not tested, so it might or might not work after integrating it into automake-system.
Thank you for the sharing! I will try it now.
I currently work on Windows, so I don't need automake-system. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: event sequence question?
« Reply #6 on: September 05, 2011, 02:43:18 pm »
This plugin works fine on Windows.

I'm testing on the trunk code( I also remove the codecompletion.dll and debuger.dll when testing), the strange thing is after I recieved a cbEVT_EDITOR_TOOLTIP event, if I hit the ctrl key, then I do not receive the cbEVT_EDITOR_TOOLTIP_CANCEL event. This indicates that something we have done in debugger branch (change the scintilla related dwell code to filter the ctrl) should reconsidered. :D


BTW:
Please remove the *.so file in the package: http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
It is Linux only file.

« Last Edit: September 05, 2011, 03:42:43 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: event sequence question?
« Reply #7 on: September 05, 2011, 02:59:43 pm »
BTW:
Please remove the *.so file in the package: http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
It is Linux only file.

 :oops:
Removed, thank you.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: event sequence question?
« Reply #8 on: May 12, 2014, 03:43:32 pm »
Hi, Jens, this plugin (DisplayEvents plugin - CodeBlocks)has a build error when building against trunk code(rev9765).
Those three events do not exist in SDK, so they should be removed.
Code
cbEVT_EDITOR_BREAKPOINT_ADD
cbEVT_EDITOR_BREAKPOINT_EDIT
cbEVT_EDITOR_BREAKPOINT_DELETE

Also, I just open a sample project (which created by a wx wizard), and I receive those logs, I don't know why there are so many cbEVT_EDITOR_ACTIVATED events. Before open the project, I have only C::B startup-home-page opened, after opening the project, two editors are opened.

Code
21:24:23,250  =>  cbEVT_EDITOR_CLOSE
Loading project file...
Parsing project file...
21:24:23,296  =>  cbEVT_PROJECT_RENAMED
21:24:23,296  =>  cbEVT_BUILDTARGET_ADDED
21:24:23,296  =>  cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Debug
21:24:23,296  =>  cbEVT_BUILDTARGET_ADDED
21:24:23,296  =>  cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release
Loading project files...
21:24:23,296  =>  cbEVT_PROJECT_BEGIN_ADD_FILES
21:24:23,328  =>  cbEVT_PROJECT_END_ADD_FILES
6 files loaded
Done loading project in 78ms
Project's base path: E:\code\cb\test_code\wx3-hang\
Project's common toplevel path: E:\code\cb\test_code\wx3-hang\
21:24:23,359  =>  cbEVT_BUILDTARGET_SELECTED
21:24:23,359  =>  cbEVT_EDITOR_SWITCHED
21:24:23,359  =>  cbEVT_EDITOR_ACTIVATED
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Windows Chinese Simplified (CP 936) (ID: 28)
Conversion succeeded using wxCSConv (buffer size = 691, converted size = 692.
21:24:23,375  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.cpp
21:24:23,375  =>  cbEVT_EDITOR_SWITCHED
21:24:23,375  =>  cbEVT_EDITOR_ACTIVATED
21:24:23,390  =>  cbEVT_EDITOR_DEACTIVATED
21:24:23,390  =>  cbEVT_EDITOR_SWITCHED
21:24:23,390  =>  cbEVT_EDITOR_ACTIVATED
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Windows Chinese Simplified (CP 936) (ID: 28)
Conversion succeeded using wxCSConv (buffer size = 465, converted size = 466.
21:24:23,406  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.h
Top Editor: E:\code\cb\test_code\wx3-hang\wx3_hangApp.h
21:24:23,406  =>  cbEVT_EDITOR_SWITCHED
21:24:23,406  =>  cbEVT_EDITOR_ACTIVATED
21:24:23,421  =>  cbEVT_PROJECT_OPEN
21:24:23,421  =>  cbEVT_WORKSPACE_CHANGED
21:24:23,421  =>  cbEVT_PROJECT_ACTIVATE
21:24:23,484  =>  cbEVT_EDITOR_UPDATE_UI
21:24:24,500  =>  cbEVT_EDITOR_TOOLTIP
21:24:27,000  =>  cbEVT_EDITOR_TOOLTIP_CANCEL
21:24:28,218  =>  cbEVT_EDITOR_TOOLTIP
21:24:32,078  =>  cbEVT_EDITOR_TOOLTIP_CANCEL
21:24:33,250  =>  cbEVT_EDITOR_TOOLTIP
21:24:33,609  =>  cbEVT_EDITOR_TOOLTIP_CANCEL

Any one can help to explain why four cbEVT_EDITOR_ACTIVATED happens. The strange thing is this cbEVT_EDITOR_ACTIVATED is always following after cbEVT_EDITOR_SWITCHED event.

Especially, why there are two cbEVT_EDITOR_ACTIVATED events after
Code
21:24:23,375  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.cpp

PS: I'm hunting a CC deadlock bug...
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: event sequence question?
« Reply #9 on: October 08, 2018, 01:45:20 pm »
Hi,

I added/updated project files, removed obsolete events and add new ones from sdk_events.h (svn11494). You can download from attachment.

Note: I tested only cbDisplayEvents_wx31_64.cbp and did NOT touch cbDisplayEvents-unix.cbp.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: event sequence question?
« Reply #10 on: October 08, 2018, 04:15:53 pm »
Hi, Quiss, many thanks.
Can you put those source code in a more "safe" place instead of an attachment of a forum post. I mean the attachment maybe cleaned up by forum administrators, maybe a good place is put the source in github.com or sourceforge.net, then post the link here. Thank you!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: event sequence question?
« Reply #11 on: October 10, 2018, 09:57:06 am »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #13 on: January 14, 2022, 07:19:50 pm »
Should this plugin be added to the core plugins?. I think it can be very useful, not only for plugin developers but for core developers.

It might also be added to the plugins (not contrib), just like the headerguard-plugin for example, without being included in automake-system and contrib-plugins workspace.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #14 on: January 14, 2022, 09:36:57 pm »
It would be very useful. IMHO Worst case add it as a contrib plugin, but I agree is would be better as a core plugin.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5623
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: event sequence question?
« Reply #15 on: January 15, 2022, 03:10:49 am »
I think it should be a core plugin.

But this plugin should be excluded from the normal C::B user.  It's mainly for developers.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #16 on: January 15, 2022, 11:39:59 am »
I have just added the plugin.

It is isolated from the workspaces and autotools, so it must be compiled explicitly if wanted (and should be disabled when not needed).

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #17 on: January 16, 2022, 07:15:46 am »
Under Linux the cbDisplayEvents-unix.cbp will not build as it has not been updated for wx30... and if you compare it to other unix project files there are a few other changes to bring it up to the current standard.
Attached is the project file I have building. I have not tested it yet as it will take about another hour to get everything saved, re-built and quickly tested on Linux.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5366
Re: event sequence question?
« Reply #18 on: January 16, 2022, 10:56:38 am »
please activate it also in the autotools and indeed bring it up to date. in line with other project files, that would be great.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #19 on: January 16, 2022, 11:39:33 am »
I have added it to autotools in r12657, but I am not an autotools expert, so please review it.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #20 on: January 16, 2022, 11:51:02 am »
The display events plugin loads using the cbp attached to the post above. I now have the Linux workspace building in about 6 minutes instead of 189 after changing the -wall to -w as there are a HUGE number of warning that slow the build down due to the amount of text that needs to be processed due to the warnings.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #21 on: January 16, 2022, 12:05:08 pm »
Added in r12658, thank you.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #22 on: January 16, 2022, 12:13:35 pm »
I am also not an  autotools expert, but you have the following line:
Code
dsplayevents_default="yes"

This would cause the plugin to be built by default, but I thought you did not want it built by default.
IMHO The Windows and Unix builds should be in sync with regards to building it by default or not.  Either way a change is needed. I will deal with the unix project files as part of ticket 1175 once the decision is made for the default to build or not.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #23 on: January 16, 2022, 12:40:58 pm »
@Miguel I am merging the code into my local source tree and spotted that there are issues with indention differences with the change in the src\plugins\Makefile.am where your changes use space, but the rest of the file uses tabs. I have not checked the other files.As there is no a ticket for this change I am including my feedback in this thread. If there was a ticket (I am assuming there is not a ticket) I would include the feedback in the ticket. There needs to be a way of giving feedback to changes that do not have a ticket, but I have no idea how this could be done easily or how to do this on SF SVN repo's.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5366
Re: event sequence question?
« Reply #24 on: January 16, 2022, 01:22:40 pm »
The display events plugin loads using the cbp attached to the post above. I now have the Linux workspace building in about 6 minutes instead of 189 after changing the -wall to -w as there are a HUGE number of warning that slow the build down due to the amount of text that needs to be processed due to the warnings.

I think the better solution, is to fix those warnings, and worst case pragma them out.

Note : for gcc, certain include paths can be silenced easily (eg wx) instead of -I<include_path> ==> -isystem<include_path>
That way we can focus on out own code and ignore the ones beyond out control.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5366
Re: event sequence question?
« Reply #25 on: January 16, 2022, 05:58:56 pm »
displayevents is in plugins (so not in contrib) which is ok, but I think it better acts as the other plugins then, meaning it does not have its own cbp files, but integrates directly in the CodeBlocks_wx<...>.cbp

What do you think ?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #26 on: January 16, 2022, 06:38:19 pm »
You know better the build system than me. The only constraint is the plugin should not be in the nightly/release, because plugins activate automatically and this would waste time without any benefit for users.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: event sequence question?
« Reply #27 on: January 17, 2022, 09:40:24 am »
I read somewhere that this plugin should be treated like the headerguard, i.e. a core plugin not added to the main project. I think this is the better solution, this way you can install it if needed but it will never go in the nightly/release.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 647
Re: event sequence question?
« Reply #28 on: January 17, 2022, 10:32:01 am »
I was looking at the header guard and the other plugins by same author last night and they were not included because they can cause bad side affects if not used/configured correctly. As such these are probably not the best to use as a template.

Headerguard info:    URL info: https://wiki.codeblocks.org/index.php/Header_Guard_plugin    Problem:  The Header Guard plugin is included in Code::Blocks' source code (src/plugins/headerguard/), however, it is not built by default to prevent unexpected behavior.
It would probably be better to do one f the following:1) Create the cbplugin via the project file and leave it up toe the dev to manually install it2) Create the plugin in the devel directory but mod the profess so it does not copy the files to the output directory so it does not get released, but can be used when running he C::B as a debugee.3) Do both options 1 and 2
I am inclined to think option 3 would benefit the developers the most.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9657
Re: event sequence question?
« Reply #29 on: January 28, 2022, 07:15:46 am »
Just keep in mind that some plugins are for pros and spoeciual needs., These are:
* header guard
* debuggergdbmi
* DisplayEvents
* EventsDisplay
* loghacker
* modpoller
* tidy cmt
(Some of them form different sources.)

These I would consider as "special plugins" meaning its partially more a tech-demo or debugging tool and the average user won't use these. In fact, as written above they may cause unexpected side-effects. So any use should be done with care.
I would also think about whether or not to add these at all to a release. From my point of view they should probably all be in a separate workspace/project.
For an installer I would expect these on a separate page with a clear warning message and not to be installed by default.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ