Re: UrShape coding update




Lars Clausen wrote:

On Thu, 26 Jul 2001, John Palmieri wrote:

--I sent this earlier but I am not sure if it got through

Well I've got a skeleton compiling, and installing.  Dia is loading the
library but it doesn't seem to show up on the sheet.  Here is the code I
am using to register it:

DIA_PLUGIN_CHECK_INIT

PluginInitResult
dia_plugin_init(PluginInfo *info)
{
   if(!dia_plugin_info_init(info, "UrShapes", "Test", NULL,NULL))
        return DIA_PLUGIN_INIT_ERROR;
   object_register_type(&urshape_type);
   return DIA_PLUGIN_INIT_OK;
}

Is this right?  Should there be more?

You updated the top-level configure.in to include your Makefile?  There's
some other thing I also forget, as well...


I did all that.  Yay, I just got a sheet to show up with an icon.  It seems that
just registering it is not enough, one must create a .sheet file also.  For some
odd reason the UrShapes sheet is showing up twice.  I don't really like how it
attaches to the plugin.  I think UUID's should be used instead of names to
identify resources but I guess that is something to put on the list for the
future.

Well I have it loading and crashing for now.  Hehe, seems like I have to add an
init_default_values method somewhere.  I'm glad I went through all that trouble
getting things to work. I now have a good idea of the structure of Dia.  I have to
say that it is very well organized.  Since I can separate UrShape from the main
program there is no need for diffs except for in the Makefile.am's if the core
team feels that they want it as part of the main distro.  I'll have to write a doc
on how to create Dia plugins at some point.  After I am done with the basic setup
stuff and have some working code I will separate it from the main sources and
place it in CVS along with a tarball posted to this list.

Well I am off to parooze the new Linux Device Drivers book O'Reilly just GPL'ed.
I will get back to coding a little later.

--J5






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]