Go to the FreeLists Home Page Home Signup Help Login
 



Browse shell-coding: This Month's ArchiveMain Archive PageRelated postsPrevious by DateNext by Date

[shell-coding] Dynamic variables

  • From: "Erik Christiansson" <erik@xxxxxxxxxxxxx>
  • To: <shell-coding@xxxxxxxxxxxxx>
  • Date: Wed, 17 Jul 2002 13:28:04 +0200
Yesterday I started working on an implementation of dynamic variables in
Litestep. The most widespread use of it would probably be to have your theme
resize when icons are added/removed in the systray, but the possibilities
are endless.
By using dynamic variables together with the built-in math functions in LS
you could define a setting based on others and have the modules
automatically adapt. This would allow for a new level of dynamicness (if
that's a word) in Litestep themes.

Form the modules side the current implementations works like this. On
startup the module sends a LM_REGISTERVARCHANGE message to Litestep with the
name of the dynamic variable and a window handle as parameters. When LS
detects a change in a variable it sends out a LM_VARCHANGE message with the
name of the changed variable as a parameter to all windows that have
registered themselves to receive changes in that variable.

When Litestep is parsing the .rc's it searches through all variable values
to see if it contains any $'s. If it does it means that the variable depends
on other variables (probably, might just be some static math). The variable
is then sent to a function that reads through the line and finds out what
variables it depends on and stores it in a map<string, vector<string>>.
The string is the name of the variable that other variables depend on and
the vector is a list of all variables that depends on the variables stored
in the string.
Whenever a variable is changed I just loop through the vector and send a
LM_VARCHANGED to all windows that have registered for notification on this
variable.

What I'd want is your opinions. I just threw this together in a few hours so
it not that well through thought but it does work...

Erik (aka Sci)




__________________________________________________
Subscription options and archive:
http://www.freelists.org/list/shell-coding

Other related posts:

  • [shell-coding] Dynamic variables
  • [shell-coding] Re: Dynamic variables




  • [ Home | Signup | Help | Login | Archives | Lists ]

    All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
    Everything else ©2008 Avenir Technologies, LLC.