Bool RegisterResEditIcon(Int32 id, Int32 x, Int32 y) { CriticalAssert(g_pControlImages); x *= CONTROLIMAGE_SIZE; y *= CONTROLIMAGE_SIZE; return RegisterIcon( id, g_pControlImages, x, y, CONTROLIMAGE_SIZE, CONTROLIMAGE_SIZE); }
static int CPROC ServerRegisterIcon( uint32_t *params, uint32_t param_length , uint32_t *result, uint32_t *result_length ) { // echo the data we got back to the client... // most other things will do useful functions in functions. xlprintf(LOG_NOISE)("About to RegisterIcon for %s", (char *)params); RegisterIcon((char* )params);//since one parameter is known to be passed, the name of the icon *result_length = param_length; *result_length = INVALID_INDEX; //this generates no responce. return 4; }
Bool RegisterGradient(void) { Filename fn = GeGetPluginPath()+"res"+"gradienttypes.tif"; AutoAlloc<BaseBitmap> bmp; if (IMAGERESULT_OK!=bmp->Init(fn)) return FALSE; RegisterIcon(200000135,bmp,0*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000136,bmp,1*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000137,bmp,2*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000138,bmp,3*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000139,bmp,4*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000140,bmp,5*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000141,bmp,6*32,0,32,32,ICONFLAG_COPY); RegisterIcon(200000142,bmp,7*32,0,32,32,ICONFLAG_COPY); // be sure to use a unique ID obtained from www.plugincafe.com return RegisterShaderPlugin(1001161,GeLoadString(IDS_SDKGRADIENT),0,SDKGradientClass::Alloc,"Xsdkgradient",0); }
SaneWinMain(argc, argv ) //int main( int argc, char **argv ) { int x = 0; int y = 0; uint32_t width, height; int w, h; g.pdi = GetDisplayInterface(); g.pii = GetImageInterface(); RegisterIcon( NULL ); GetDisplaySize( &width, &height ); w = width; h = height; y = x = 0; { int state = 0; int arg; g.fade_in = 500; g.show_time = 1000; for( arg = 1; arg < argc; arg++ ) { if( argv[arg][0] == '-' ) { if( argv[arg][1] == 'i' ) { g.flags.bShowInverted = 1; } else { switch( state ) { case 0: x = atoi( argv[arg]+1 ); break; case 1: y = atoi( argv[arg]+1 ); break; case 2: w = atoi( argv[arg]+1 ); break; case 3: h = atoi( argv[arg]+1 ); break; case 4: g.show_time = atoi( argv[arg]+1 ); break; case 5: g.fade_in = atoi( argv[arg]+1 ); break; } state++; } } else { Image x = LoadImageFile( argv[arg] ); if( x ) { g.nImages++; AddLink( &g.images, x ); } } } } if( g.nImages ) { g.displays[0] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); g.displays[1] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); SetRedrawHandler( g.displays[0], Output, 0 ); SetRedrawHandler( g.displays[1], Output, 1 ); if( g.nImages > 1 ) { target_in_start = GetTickCount(); AddTimer( 33, tick, 0 ); } else { //lprintf( "Show the first and only the first image." ); g.is_up[0] = 1; RestoreDisplay( g.displays[0] ); UpdateDisplay( g.displays[0] ); } while( 1 ) WakeableSleep( 10000 ); } else { } return 0; }