00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include <string.h>
00028
00029 #include "const.h"
00030 #include "gvplugin_loadimage.h"
00031 #include "gvcint.h"
00032 #include "gvcproc.h"
00033
00034
00035 #include "graph.h"
00036
00037 static int gvloadimage_select(GVJ_t * job, char *str)
00038 {
00039 gvplugin_available_t *plugin;
00040 gvplugin_installed_t *typeptr;
00041
00042 plugin = gvplugin_load(job->gvc, API_loadimage, str);
00043 if (plugin) {
00044 typeptr = plugin->typeptr;
00045 job->loadimage.engine = (gvloadimage_engine_t *) (typeptr->engine);
00046 job->loadimage.id = typeptr->id;
00047 return GVRENDER_PLUGIN;
00048 }
00049 return NO_SUPPORT;
00050 }
00051
00052 void gvloadimage(GVJ_t * job, usershape_t *us, boxf b, boolean filled, char *target)
00053 {
00054 gvloadimage_engine_t *gvli;
00055 char type[SMALLBUF];
00056
00057 strcpy(type, us->stringtype);
00058 strcat(type, ":");
00059 strcat(type, target);
00060
00061 if (gvloadimage_select(job, type) == NO_SUPPORT)
00062 agerr (AGWARN, "No loadimage plugin for \"%s\"\n", type);
00063
00064 if ((gvli = job->loadimage.engine) && gvli->loadimage)
00065 gvli->loadimage(job, us, b, filled);
00066 }