diff -ru idesk-0.3.5/Desk.cc idesk-0.3.5-simeng/Desk.cc --- idesk-0.3.5/Desk.cc 2002-11-09 19:06:16.000000000 +0100 +++ idesk-0.3.5-simeng/Desk.cc 2003-02-14 02:56:30.000000000 +0100 @@ -100,7 +100,12 @@ if( HighContrast ) Back.color.alpha = 21845; - + + if ( !strcmp( (char*)Config->Query( "DoubleClick" ).c_str(), "true" ) ) + DoubleClick = true; + else + DoubleClick = false; + Transparency = atoi( (char*)Config->Query( "Transparency" ).c_str() ); if( !strcmp( ( char * )Config->Query( "Locked" ).c_str(), "true" ) ) LockDesk(); @@ -123,13 +128,22 @@ for(int i=0; id_name; IconDb = new Database(FileName); - if(!(IconTb = IconDb->Query("Icon"))) + + if(IconDb->Tables.size() == 0) { free( Files[ i ] ); delete IconDb; continue; } - AddIcon( (char*)FileName.c_str(), (char*)IconTb->Query("Icon").c_str(), (char*)IconTb->Query("Caption").c_str(), (char*)IconTb->Query("Command").c_str(), atoi(IconTb->Query("X").c_str()), atoi(IconTb->Query("Y").c_str()) ); + for (int y=0; yTables.size(); y++) { + IconTb = IconDb->Tables[y]; + AddIcon( (char*)FileName.c_str(), + (char*)IconTb->Query("Icon").c_str(), + (char*)IconTb->Query("Caption").c_str(), + (char*)IconTb->Query("Command").c_str(), + atoi(IconTb->Query("X").c_str()), + atoi(IconTb->Query("Y").c_str()) ); + } free( Files[ i ] ); delete IconDb; delete IconTb; @@ -151,12 +165,20 @@ char Num[10]; IconDb = new Database(I->FileName); - if(!(IconTb = IconDb->Query("Icon"))) return; - sprintf(Num, "%d", I->X); - IconTb->Set("X", Num); - sprintf(Num, "%d", I->Y); - IconTb->Set("Y", Num); + if(IconDb->Tables.size() == 0) return; + + for (int i=0; iTables.size(); i++) { + IconTb = IconDb->Tables[i]; + if (IconTb->Query("Caption") == I->Caption) + { + sprintf(Num, "%d", I->X); + IconTb->Set("X", Num); + sprintf(Num, "%d", I->Y); + IconTb->Set("Y", Num); + } + } IconDb->Write(); + delete IconTb; delete IconDb; } @@ -292,6 +314,10 @@ return( Transparency ); } + bool Desk::GetDoubleClick( ) { + return( DoubleClick ); + } + bool Desk::GetContrast( ) { return( HighContrast ); } diff -ru idesk-0.3.5/Desk.h idesk-0.3.5-simeng/Desk.h --- idesk-0.3.5/Desk.h 2002-11-09 19:06:16.000000000 +0100 +++ idesk-0.3.5-simeng/Desk.h 2003-02-14 02:47:20.000000000 +0100 @@ -24,6 +24,7 @@ bool Locked; bool HighContrast; bool ShadowFlag; + bool DoubleClick; int ShadowX; int ShadowY; int BoldVal; @@ -44,6 +45,7 @@ void SaveIcon( Icon *I ); void Loop(); int GetTransparency( ); + bool GetDoubleClick( ); bool GetContrast( ); bool GetShadow(int &x, int &y ); diff -ru idesk-0.3.5/Icon.cc idesk-0.3.5-simeng/Icon.cc --- idesk-0.3.5/Icon.cc 2002-11-09 19:06:16.000000000 +0100 +++ idesk-0.3.5-simeng/Icon.cc 2003-02-14 02:57:27.000000000 +0100 @@ -73,14 +73,11 @@ for( int i=0, a=0; i<(3*Width*Height); i+=3, a++) { int alevel = ( (alpha_levels != 0) ? alpha_levels[a] : 255 ); - if( alevel == 0 ) { bgrgb[i] = bgrgb[i+2] = 255; bgrgb[i+1] = 0; continue; } bgrgb[i+0] = (bgrgb[i+0] * (255-alevel))/255 + (rgb[i+0] * alevel)/255; bgrgb[i+1] = (bgrgb[i+1] * (255-alevel))/255 + (rgb[i+1] * alevel)/255; bgrgb[i+2] = (bgrgb[i+2] * (255-alevel))/255 + (rgb[i+2] * alevel)/255; } - ImlibColor IClr={255,0,255,0}; - Imlib_set_image_shape(D->Data, Bg, &IClr); Imlib_apply_image( D->Data, Bg, Win ); Imlib_kill_image( D->Data, Bg ); @@ -146,17 +143,33 @@ bool locked = D->IsLocked(); - if( Ev->type == ButtonRelease ) + if( D->GetDoubleClick() ) { - // Something of a special case. - if( Ev->xbutton.time - Time <= 200 ) + if( Ev->type == ButtonRelease ) { - D->Execute( Command ); - Time = 0; + // Something of a special case. Doubleclick + if( Ev->xbutton.time - Time <= 200 ) + { + D->Execute( Command ); + Time = 0; + } + else Time = Ev->xbutton.time; } - else Time = Ev->xbutton.time; } - + else + { + // If buttontime is less than 200ms we click, else we drag. Singleclick + if( Ev->type == ButtonPress ) + Time = Ev->xbutton.time; + + if( Ev->type == ButtonRelease && + Ev->xbutton.time - Time <= 200 ) + { + D->Execute( Command ); + Time = 0; + } + } + if( locked ) return; switch( Ev->type ) diff -ru idesk-0.3.5/Icon.h idesk-0.3.5-simeng/Icon.h --- idesk-0.3.5/Icon.h 2002-10-28 22:30:03.000000000 +0100 +++ idesk-0.3.5-simeng/Icon.h 2003-02-13 21:46:42.000000000 +0100 @@ -7,7 +7,7 @@ class Icon { private: Desk *D; - char *Command, *Caption; + char *Command; XGlyphInfo FontInfo; bool FreeAlpha; bool Glowing; @@ -18,6 +18,7 @@ Window Win, Text; XftDraw *Draw; + char *Caption; char FileName[128]; unsigned char *rgb, *alpha, *alpha2; int LoadPng( char *filename ); diff -ru idesk-0.3.5/README idesk-0.3.5-simeng/README --- idesk-0.3.5/README 2002-11-09 19:06:16.000000000 +0100 +++ idesk-0.3.5-simeng/README 2003-02-14 03:05:08.000000000 +0100 @@ -26,6 +26,7 @@ PaddingY: 25 Locked: false HighContrast: false + DoubleClick: true Transparency: 150 Shadow: true ShadowColor: #000000 @@ -41,6 +42,9 @@ it is true. It will draw it in an arbitary colour if it "#aa00aa", for example. And it will not draw anything at all if it is set to "false". +"DoubleClick" when set true it requires you to doubleclick on an icon to +execute programs while only a single click is required when set to false. + "Shadow" is boolean (true/false). Turning this on will draw a drop shadow of color ShadowColor behind the text. The shadow will be ShadowX pixels right and ShadowY pixels down (negative values will work). Both ShadowX and ShadowY @@ -62,7 +66,7 @@ executes the command you assigned it. You can double-middle click on any icon to reload the icon files in the -.idestop directory and the .ideskrc settings. +.idesktop directory and the .ideskrc settings. After you move your icons around to get them where you want them, you can change "Locked" from false to true in the config file.