1. Plug-Ins and Other Things

Hey!

Anybody here with some experience with the programming of plug-ins? I'm
working on a EUPHORIA program that I'd like to enable plug-in
functionality, in case somebody wants to add their own ideas. Can
anybody here shed some light on that subject...?

I'm familiar with the concept (i.e., a paint program allows you to use
filter plug-ins), but I'm not sure about how to implement that. Thanks
in advance.

And somebody please respond to this message so I can know I'm actually
reaching the list.

Thanks!
ck

new topic     » topic index » view message » categorize

2. Re: Plug-Ins and Other Things

Well, I see my own message, so I know I'm makin' it to the list. Now
somebody answer the first part. ;)

C & K L wrote:
>
> Hey!
>
> Anybody here with some experience with the programming of plug-ins? I'm
> working on a EUPHORIA program that I'd like to enable plug-in
> functionality, in case somebody wants to add their own ideas. Can
> anybody here shed some light on that subject...?
>
> I'm familiar with the concept (i.e., a paint program allows you to use
> filter plug-ins), but I'm not sure about how to implement that. Thanks
> in advance.
>
> And somebody please respond to this message so I can know I'm actually
> reaching the list.
>
> Thanks!
> ck

new topic     » goto parent     » topic index » view message » categorize

3. Re: Plug-Ins and Other Things

On Fri, 20 Nov 1998 19:23:22 -0600, C & K L <candk at TICNET.COM> wrote:

>Hey!
>
>Anybody here with some experience with the programming of plug-ins? I'm
>working on a EUPHORIA program that I'd like to enable plug-in
>functionality, in case somebody wants to add their own ideas. Can
>anybody here shed some light on that subject...?
>
>I'm familiar with the concept (i.e., a paint program allows you to use
>filter plug-ins), but I'm not sure about how to implement that. Thanks
>in advance.

In Dos32 you can't, as best I can determine. Rob says there's
no way to "dynamically" load or unload parts of a program.
Bummer.

Win32 allows calling routines in DLL's , so I guess you could
write your filter in C, compile it into a dll, and call it.
Ditto.

Irv
Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: Plug-Ins and Other Things

>> Anybody here with some experience with the programming of plug-ins?

Not really, but listen anyway. :) (Also, this information is good for the
EuBots stuff so if you're part of that group, read it, also. [Please. ;)
])

>> I'm working on a EUPHORIA program that I'd like to enable plug-in
>> functionality, in case somebody wants to add their own ideas. Can
>> anybody here shed some light on that subject...?
>>
>> I'm familiar with the concept (i.e., a paint program allows you to
>> use filter plug-ins), but I'm not sure about how to implement that.
>> Thanks in advance.

Well, here's an idea, not tested, and may not even work, but maybe it'll
help:

First, you'll need a file that contains all the plugins:

filter
coolstuf
loadmore

Inside each include file that is named in the file, you'll have a
procedure (or function, but it'll either have to be always function, or
always procedure).

global procedure loadmore()   --support to load more types of files.

Now, inside the source code of your program:

sequence plugin_list, plugin_id
integer fn

plugin_list = Load_PlugIn_Names()  --Load up names and trim \n
plugin_id = {}

fn = open("plugins.e", "w")
for i = 1 to length(plugin_list) do
    puts(fn, "include " & plugin_list[i] & ".e\n")
end for
close(fn)

-- Now we've created an include file, now we can include it!
include plugins.e  -- The files are now included!

for i = 1 to length(plugin_list) do
    plugin_id = append(plugin_id, routine_id(plugin_list[i])
end for

Now, to call the plugin:

call_proc(plugin_id[PlugInToCall], {})


That was the easy part. The hard part is figuring out WHEN to call it.
Maybe instead of a default procedure, you have a default function that
returns data as to when to call the plugin:

for i = 1 to length(plugin_list) do
    to_call = append(to_call, call_func(plugin_id[i], {}))
end for

to_call contains data your program understands as to when to call the
plugin. Also, the plugin will need to have access to the variables in
your program, so the program can't be shrouded or bound.. In my opinion,
this is a bit too much trouble, except for use in the EuBots programs,
where it can be used to loadup the 'Bots easier. (Just have a function
that shows the users which 'Bots can be picked (from a dir("*.bot")) and
then use that data to build the plugin.e.

Maybe this information can be used somehow to figure out a way to create
plugins for bound files, but I doubt it.

Hope this helps, somehow...

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu