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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • 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: 13413
    • 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: 9694
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • 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 Jenna

  • 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: 5910
  • 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: 5910
  • 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 Jenna

  • 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: 5910
  • 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: 5910
  • 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: 5910
  • 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: 1553
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: 678
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.