Skip to content

Commit

Permalink
see changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithDHedger committed Jan 3, 2024
1 parent 4530672 commit 9eabc3a
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 72 deletions.
8 changes: 7 additions & 1 deletion LFSApplications/LFSApplications/app/apps.local
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ if [[ $1 = "conf" ]];then
popd
fi

LD_LIBRARY_PATH="../../../LFSToolKit/LFSToolKit/app/.libs" ./$@
if [[ $USEVALGRIND -eq 1 ]];then
VALGRIND="valgrind --leak-check=full"
else
VALGRIND=
fi

LD_LIBRARY_PATH="../../../LFSToolKit/LFSToolKit/app/.libs" $VALGRIND $@
6 changes: 4 additions & 2 deletions LFSApplications/LFSApplications/src/lfsfontselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ int main(int argc, char **argv)
fd=fontdialog->LFSTK_getFontData(false);
if(fd->isValid==true)
if(useDetail==false)
printf("fontString=%s\n",fd->fontString);
printf("fontString=%s\n",fd->fontString.c_str());
else
printf("Font String:%s\nFont:%s\nSize:%i\nBold:%s\nItalic:%s\n",fd->fontString,fd->fontName,fd->fontSize,bools[fd->bold],bools[fd->italic]);
printf("Font String:%s\nFont:%s\nSize:%i\nBold:%s\nItalic:%s\n",fd->fontString.c_str(),fd->fontName.c_str(),fd->fontSize,bools[fd->bold],bools[fd->italic]);

delete apc;
cairo_debug_reset_static_data();

return(0);
}
22 changes: 11 additions & 11 deletions LFSApplications/LFSApplications/src/lfsmimeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ void setMimeTypesList(char *filepath)
{
listit.label=strdup(buffer);
listit.imageType=NOTHUMB;
if(listit.label[strlen(listit.label)-1]==';')
listit.label[strlen(listit.label)-1]=0;
char *ptr=strchr(listit.label,'=');
if(listit.label[listit.label.length()-1]==';')
listit.label[listit.label.length()-1]=0;
char *ptr=strchr((char*)listit.label.c_str(),'=');
*ptr=0;
ptr++;
listit.userData=ptr;
Expand Down Expand Up @@ -137,10 +137,10 @@ void reWriteMimeFile(void)
{
if(j!=mimeList->currentItem)
{
ptr=mimeList->listDataArray->at(j).label;
ptr+=strlen(mimeList->listDataArray->at(j).label);
ptr=(char*)mimeList->listDataArray->at(j).label.c_str();
ptr+=mimeList->listDataArray->at(j).label.length();
ptr++;
fprintf(file,"%s=%s;\n",mimeList->listDataArray->at(j).label,ptr);
fprintf(file,"%s=%s;\n",mimeList->listDataArray->at(j).label.c_str(),ptr);
}
}

Expand Down Expand Up @@ -175,10 +175,10 @@ bool doUpdate(void *p,void* ud)
}
else
{
ptr=mimeList->listDataArray->at(j).label;
ptr+=strlen(mimeList->listDataArray->at(j).label);
ptr=(char*)mimeList->listDataArray->at(j).label.c_str();
ptr+=mimeList->listDataArray->at(j).label.length();
ptr++;
fprintf(file,"%s=%s;\n",mimeList->listDataArray->at(j).label,ptr);
fprintf(file,"%s=%s;\n",mimeList->listDataArray->at(j).label.c_str(),ptr);
}
}
fprintf(file,"%s=%s.desktop;\n",editLine->LFSTK_getCStr(),appLine->LFSTK_getCStr());
Expand All @@ -199,7 +199,7 @@ bool doUpdate(void *p,void* ud)
bool doInsert(void *p,void* ud)
{
char *command;
const char *data=mimeList->listDataArray->at(mimeList->currentItem).label;
const char *data=mimeList->listDataArray->at(mimeList->currentItem).label.c_str();

asprintf(&command,"sed -i 's@\\(%s.*\\)@\\1\\n%s=Custom.desktop@' \"%s\"",data,data,mimeTypesFile);
system(command);
Expand Down Expand Up @@ -234,7 +234,7 @@ bool doDelete(void *p,void* ud)
bool doApply(void *p,void* ud)
{
char *command;
const char *data=mimeList->listDataArray->at(mimeList->currentItem).label;
const char *data=mimeList->listDataArray->at(mimeList->currentItem).label.c_str();

asprintf(&command,"cp \"%s\" \"%s/.config\"",mimeTypesFile,getenv("HOME"));
system(command);
Expand Down
4 changes: 2 additions & 2 deletions LFSDock/LFSDock/src/desktopSwitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ bool deskSwitcherEnterCB(LFSTK_gadgetClass*p,void* ud)
for(int j=0;j<deskNames.size();j++)
{
label=deskNames.at(j);
ls.label=strdup((char*)label.c_str());
ls.label=label;
ls.imageType=NOTHUMB;
ls.data.imagePath=NULL;
ls.imagePath;
ls.userData=USERDATA(DESKTOPSWITCHER);
popActionList->LFSTK_appendToList(ls);
}
Expand Down
4 changes: 2 additions & 2 deletions LFSDock/LFSDock/src/launchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ bool launcherEnterCB(LFSTK_gadgetClass*p,void* ud)

setGadgetPosition(p,true);
popActionList->LFSTK_freeList();
ls.label=strdup((char*)lds.name.c_str());
ls.label=lds.name;
ls.imageType=NOTHUMB;
ls.data.imagePath=NULL;
ls.imagePath;
ls.userData=USERDATA(p);

popActionList->LFSTK_appendToList(ls);
Expand Down
4 changes: 2 additions & 2 deletions LFSDock/LFSDock/src/taskBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool taskSwitcherEnterCB(LFSTK_gadgetClass*p,void* ud)
label=filltasks.at(d).taskName;
ls.label=strdup((char*)label.c_str());
ls.imageType=NOTHUMB;
ls.data.imagePath=NULL;
ls.imagePath;
ls.userData=USERDATA(filltasks.at(d).winid);
popActionList->LFSTK_appendToList(ls);

Expand All @@ -57,7 +57,7 @@ bool taskSwitcherEnterCB(LFSTK_gadgetClass*p,void* ud)
label=filltasks.at(d).tasks.at(j).taskName;
ls.label=strdup((char*)label.c_str());
ls.imageType=NOTHUMB;
ls.data.imagePath=NULL;
ls.imagePath;
ls.userData=USERDATA(filltasks.at(d).tasks.at(j).winid);
popActionList->LFSTK_appendToList(ls);
}
Expand Down
3 changes: 3 additions & 0 deletions LFSToolKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
0.6.0
Fixed calendar example.
Fixed minor faults.
Fixed leak in listgadget.
Removing old 'c' code ...
Removing old 'c' code ...
Added small utility class for static functions.
Expand Down
26 changes: 13 additions & 13 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,54 +71,54 @@ void LFSTK_fileDialogClass::getFileList(void)
this->fileListGadget->LFSTK_freeList();
for(int j=0;j<this->fileListCnt;j++)
{
ls.label=strdup(this->fc->data.at(j).name.c_str());
ls.label=this->fc->data.at(j).name.c_str();
ls.imageType=CAIROTHUMB;
switch(this->fc->data.at(j).fileType)
{
case FOLDERTYPE:
ls.data.surface=this->folderImage;
ls.surface=this->folderImage;
break;

case FILETYPE:
if((strcasestr(ls.label,".jpg")!=NULL) || (strcasestr(ls.label,".png")!=NULL))
if((LFSTK_UtilityClass::LFSTK_strStr(ls.label,".jpg",true).length()>0) || (LFSTK_UtilityClass::LFSTK_strStr(ls.label,".png",true).length()>0))
{
if(this->useThumbs==true)
{
ls.imageType=FILETHUMB;
ls.data.imagePath=strdup(this->fc->data.at(j).path.c_str());
ls.imagePath=this->fc->data.at(j).path;
}
else
ls.data.surface=this->imageImage;
ls.surface=this->imageImage;
}
else
ls.data.surface=this->fileImage;
ls.surface=this->fileImage;
break;

case FOLDERLINKTYPE:
ls.data.surface=this->folderImageLink;
ls.surface=this->folderImageLink;
break;

case FILELINKTYPE:
if((strcasestr(ls.label,".jpg")!=NULL) || (strcasestr(ls.label,".png")!=NULL))
if((LFSTK_UtilityClass::LFSTK_strStr(ls.label,".jpg",true).length()>0) || (LFSTK_UtilityClass::LFSTK_strStr(ls.label,".png",true).length()>0))
{
if(this->useThumbs==true)
{
ls.imageType=FILETHUMB;
ls.data.imagePath=strdup(this->fc->data.at(j).path.c_str());
ls.imagePath=this->fc->data.at(j).path;
}
else
ls.data.surface=this->imageImageLink;
ls.surface=this->imageImageLink;
}
else
ls.data.surface=this->fileImageLink;
ls.surface=this->fileImageLink;
break;

case BROKENLINKTYPE:
ls.data.surface=this->brokenLink;
ls.surface=this->brokenLink;
break;

default:
ls.data.surface=this->fileImage;
ls.surface=this->fileImage;
break;
}
fileListGadget->LFSTK_appendToList(ls);
Expand Down
18 changes: 10 additions & 8 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKFontDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,20 @@ void LFSTK_fontDialogClass::loadFontStrings(void)
/*
* Private parse fontstring.
*/
void LFSTK_fontDialogClass::parseFontString(std::string fontstr)
void LFSTK_fontDialogClass::parseFontString(std::string fontstr)//TODO//
{
std::vector<std::string> tokenstrings;

tokenstrings=LFSTK_UtilityClass::LFSTK_strTok(fontstr,":");

this->fontlist->LFSTK_findByLabel(tokenstrings.at(0).c_str());
this->boldcheck->LFSTK_setValue(tokenstrings.at(2).c_str());
this->italiccheck->LFSTK_setValue(tokenstrings.at(3).c_str());
this->fontsize->LFSTK_setBuffer(tokenstrings.at(1).substr(5,(tokenstrings.at(1).length()-5)).c_str());
this->LFSTK_getFontData(true);

if(tokenstrings.size()>3)
{
this->fontlist->LFSTK_findByLabel(tokenstrings.at(0).c_str());
this->boldcheck->LFSTK_setValue(tokenstrings.at(2).c_str());
this->italiccheck->LFSTK_setValue(tokenstrings.at(3).c_str());
this->fontsize->LFSTK_setBuffer(tokenstrings.at(1).substr(5,(tokenstrings.at(1).length()-5)).c_str());
this->LFSTK_getFontData(true);
}
return;
}

Expand Down Expand Up @@ -230,7 +232,7 @@ void LFSTK_fontDialogClass::buildDialog(void)

for(int j=0;j<this->maxFonts;j++)
{
ls.label=strdup(this->fontsAZV.at(j).c_str());
ls.label=this->fontsAZV.at(j);
ls.imageType=NOTHUMB;
fontlist->LFSTK_appendToList(ls);
}
Expand Down
1 change: 1 addition & 0 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ void LFSTK_gadgetClass::LFSTK_setCairoFontData(void)
this->fontName=tokenstrings.at(0);

cairo_save(this->cr);
//fprintf(stderr,"fontString=>>%s<< his->fontName.c_str()=>>%s<< slant=%i weight=%i sixe=%i \n",this->fontString.c_str(),this->fontName.c_str(),this->slant,this->weight,this->fontSize);
cairo_select_font_face(this->cr,this->fontName.c_str(),this->slant,this->weight);
cairo_set_font_size(this->cr,this->fontSize);
cairo_font_extents(this->cr,&this->fontExtents);
Expand Down
3 changes: 2 additions & 1 deletion LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <vector>
#include <iomanip>
#include <filesystem>
#include <algorithm>

#include <dirent.h>

Expand All @@ -47,7 +48,7 @@
#include <experimental/filesystem>


#define COPYRITE "Copyright © 2013-2023 K.D.Hedger"
#define COPYRITE "Copyright © 2013-2024 K.D.Hedger"
#define PERSONAL "[email protected]"
#define MYWEBSITE "https://keithdhedger.github.io/"

Expand Down
3 changes: 2 additions & 1 deletion LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ LFSTK_imageClass::LFSTK_imageClass(LFSTK_windowClass* parentwc,const char* image
this->ml->gadget=this;
this->ml->type=IMAGEGADGET;
this->wc->LFSTK_addMappedListener(this->window,ml);
if(imagepath!=NULL)
this->LFSTK_setImageFromPath(std::string(imagepath),gravity,scale);

this->LFSTK_setImageFromPath(imagepath,gravity,scale);
this->useTile=this->wc->useTile;
this->gadgetDetails={&this->wc->windowColourNames[NORMALCOLOUR],BEVELNONE,NOINDICATOR,NORMALCOLOUR,0,false,{0,0,w,h},{0,0,0,0},false,false,false};

Expand Down
2 changes: 1 addition & 1 deletion LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,8 @@ void LFSTK_lib::LFSTK_getFileInfo(const char* path,fileInformation* info)
file=g_file_new_for_path(path);
file_info=g_file_query_info(file,"standard::*",G_FILE_QUERY_INFO_NONE,NULL,&error);
th=g_file_info_get_content_type(file_info);
g_clear_object(&file);
g_clear_object(&file_info);
g_clear_object(&file);
if(th.length()!=0)
info->mimeType=th;
else
Expand Down
28 changes: 15 additions & 13 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKListGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void LFSTK_listGadgetClass::LFSTK_setListFromFile(const char *filepath,bool incl
{
if(strlen(buffer)>0)
{
ls.label=strdup(buffer);
ls.label=buffer;
ls.userData=USERDATA(userdata);
this->LFSTK_appendToList(ls);
}
Expand Down Expand Up @@ -191,9 +191,9 @@ void LFSTK_listGadgetClass::LFSTK_updateList(void)
this->labelsArray->at(j)->LFSTK_setLabelGravity(MENU);
this->listDataArray->at(j+this->listOffset).listPos=j;
if(this->listDataArray->at(j+this->listOffset).imageType==CAIROTHUMB)
this->labelsArray->at(j)->LFSTK_setImageFromSurface(this->listDataArray->at(j+this->listOffset).data.surface,MENU,true);
this->labelsArray->at(j)->LFSTK_setImageFromSurface(this->listDataArray->at(j+this->listOffset).surface,MENU,true);
if(this->listDataArray->at(j+this->listOffset).imageType==FILETHUMB)
this->labelsArray->at(j)->LFSTK_setImageFromPath(this->listDataArray->at(j+this->listOffset).data.imagePath,MENU,true);
this->labelsArray->at(j)->LFSTK_setImageFromPath(this->listDataArray->at(j+this->listOffset).imagePath,MENU,true);
this->labelsArray->at(j)->LFSTK_showGadget();
this->labelsArray->at(j)->LFSTK_clearWindow();
}
Expand Down Expand Up @@ -353,11 +353,11 @@ void LFSTK_listGadgetClass::freeList(void)
{
for(int j=0;j<this->listDataArray->size();j++)
{
freeAndNull(&this->listDataArray->at(j).label);
if((this->listDataArray->at(j).imageType==CAIROTHUMB) && (this->listDataArray->at(j).data.surface!=NULL) && (this->freeCairoImages==true))
cairo_surface_destroy(this->listDataArray->at(j).data.surface);
if((this->listDataArray->at(j).imageType==FILETHUMB) && (this->listDataArray->at(j).data.imagePath!=NULL))
freeAndNull(&this->listDataArray->at(j).data.imagePath);
//freeAndNull(&this->listDataArray->at(j).label);
if((this->listDataArray->at(j).imageType==CAIROTHUMB) && (this->listDataArray->at(j).surface!=NULL) && (this->freeCairoImages==true))
cairo_surface_destroy(this->listDataArray->at(j).surface);
//if((this->listDataArray->at(j).imageType==FILETHUMB) && (this->listDataArray->at(j).imagePath.length()>0))
// freeAndNull(&this->listDataArray->at(j).imagePath);
}
this->listDataArray->clear();
}
Expand All @@ -374,10 +374,10 @@ void LFSTK_listGadgetClass::LFSTK_freeList(void)
* Get selected label.
* \return const char *label;
*/
const char *LFSTK_listGadgetClass::LFSTK_getSelectedLabel(void)
const char *LFSTK_listGadgetClass::LFSTK_getSelectedLabel(void)//TODO//
{
if(this->listDataArray->size()>this->currentItem)
return(this->listDataArray->at(this->currentItem).label);
return(this->listDataArray->at(this->currentItem).label.c_str());

return("");
}
Expand All @@ -387,12 +387,12 @@ const char *LFSTK_listGadgetClass::LFSTK_getSelectedLabel(void)
* \param int Index.
* \return const char *label;
*/
const char *LFSTK_listGadgetClass::LFSTK_getLabelAtIndex(int index)
const char *LFSTK_listGadgetClass::LFSTK_getLabelAtIndex(int index)//TODO//
{
if((index>this->listDataArray->size()-1) || (index<0))
return(NULL);

return(this->listDataArray->at(index).label);
return(this->listDataArray->at(index).label.c_str());
}

/**
Expand Down Expand Up @@ -508,7 +508,9 @@ int LFSTK_listGadgetClass::LFSTK_findByLabel(const char *needle,bool select)
{
for(int j=0;j<this->listDataArray->size();j++)
{
if(strcmp(this->listDataArray->at(j).label,needle)==0)
//if(strcmp(this->listDataArray->at(j).label,needle)==0)//TODO//
//if(strcmp(this->listDataArray->at(j).label.c_str(),needle)==0)
if(this->listDataArray->at(j).label.compare(needle)==0)
{
if(select==true)
this->LFSTK_selectByIndex(j);
Expand Down
15 changes: 6 additions & 9 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKListGadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ enum {NOTHUMB=0,CAIROTHUMB,FILETHUMB};

struct listLabelStruct
{
char *label;
int imageType;
void *userData;
int listPos;
union imageData
{
char *imagePath=NULL;
cairo_surface_t *surface;
} data;
std::string label;
int imageType;
void *userData;
int listPos;
std::string imagePath;
cairo_surface_t *surface;
};

/**
Expand Down
Loading

0 comments on commit 9eabc3a

Please sign in to comment.