View Full Version : command_changed or something similar?
Ron
October 13th, 2002, 03:55 PM
I'm not sure what you want to know. But not every plugin is informed of an action, plugins can be informed of their own actions and of events.
Ron
October 13th, 2002, 03:55 PM
this probably has to do with the UTF encoding, just ignore that, you should not see it in the actuall svalue1.
Ron
October 13th, 2002, 03:55 PM
There is an internal ID but the plugins do not have access to this, you can use one of the datafields and put a number in there for your own use.
Ron
October 13th, 2002, 03:55 PM
Updating is pretty easy. When you are done with that we can talk about the variables. :-) (Which are easy too)
Ron
October 13th, 2002, 03:55 PM
most of the functions from the old api have a direct translation to the new api. Try to find the matching functions.
For example
http://www.girder.nl/devel32/api32.php#1-2
init_dll and init_device -> gir_open
Close_dll and clean_up_device -> gir_close
command_execute -> gir_event
http://www.girder.nl/devel32/api32.php#1-5
command_changed -> gir_command_changed
command_gui -> gir_command_gui
name_dll -> gir_name
http://www.girder.nl/devel32/api32.php#1-1
Ron
October 13th, 2002, 03:55 PM
You'll also need the new Girder header, its available in the developers sections. Be sure to read the new API there too.
You'll know when it works when Girder loads your plugin without complaining...
Ron
October 13th, 2002, 03:55 PM
if you are sending a string to girder you'll need to use gir_malloc / gir_free / gir_realloc_pchar. If this data stays withing your plugin feel free to use malloc/free.
there is no equivalent to realloc in girder. (Not needed)
The only time you'll use gir_malloc/gir_free is when you are working with the binary field in the p_command structure, so don't worry about it.
Ron
October 13th, 2002, 03:55 PM
this is called when something changes, when you press the settings button and when the treeview position changes. The settings button is to make sure that your plugin is using the correct command structure.
mattwire
October 13th, 2002, 03:55 PM
In my experience it would be easier to update the plugin to 3.2 first. Some things are easier to do in 3.2 API anyway and you won't have to go through and update your new code as well.
mitko
October 13th, 2002, 03:55 PM
I finally decide to test my self as a plugin developer
:)
Matt have sent me the source of KeySelecter which wasn't working in Win2k/XP and I think I found the bug and fixed it but now I have to update it to the new 3.2 API
:(
I'm not sure I'll be able to do this but I'll try.
As my first task I want to make it work even better (some new functionality) in 3.1 and then convert it (me or someone else willing to do it).
So now back to the question:
Is there a way a plugin to know when another command (other plugin) is called so it can make some action of reseting it's variables and states?
I'm asking for this because I can't make the reinitializing in the beginnig of "command_execute" because there are actions taken depending on the count of times the command is called
Any ideas?
mitko
October 13th, 2002, 03:55 PM
:(
I guessed so but had to ask
I'll have to find another way to solve my problem
Another quesiont:
Can someone tell what's the reason to have (char)254 at the end of a command->svalue1?
The plugin doesn't need it but if I try to remove it from the .gml file Girder sais that it can'g load the datafile
??!?!
do I need to attach the source or is it clear enough?
mitko
October 13th, 2002, 03:55 PM
about the char 254 - I did see it but when I removet all references of it in the plugin it no more appeared
Again a question:
how can I distinguish two commands from one another?
is there a unique ID of some kind?
mitko
October 13th, 2002, 03:55 PM
:(
OK.....
I look for another solution
Again a question:
Is it easy to add support for girder variables? Can someone show me an example or a hint where to look?
Will I have better possibilities if update to 3.2 and then continue work on the plugin?
mitko
October 13th, 2002, 03:55 PM
Thanks for the info, Matt
:)
But as I'm totaly new to this process will some one guide me trough or show me examples or if possible even do it?
:oops:
mitko
October 13th, 2002, 03:55 PM
:)
It's easy to say it when you've done it a dozen times but when you are a total newbee it's tough
can some give me a hint where to start looking?
mitko
October 13th, 2002, 03:55 PM
OK
I get the idea
How can I tell if I succeded? Is there a way to tell if I changed all the needed functions or I missed one? Will it compile if not all are changed?
mitko
October 13th, 2002, 03:55 PM
I need to make a buffer to store some string values. I was thinking of using 'malloc' and 'free' but then I saw that in the new API thera are functions 'gir_malloc' and 'gir_free'. What are they for? Do I have to use them or I can still use 'malloc' nad 'free'.
What about 'realloc'? is there girder equivalent
I saw realloc_pchar but I need to define the size so I can't use it
:(
mitko
October 13th, 2002, 03:55 PM
I just started to understand things and now I'm confused again
:(
isn't the gir_command_changed supposed to be called ONLY when the command in the TreeView is changed? In my plugin it gets called very often - for example when I press the Settings button
!?!?!?
Ron (or someone else), can you enlighten me what I did wrong?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.