Skip to content

Commit

Permalink
lib version update etc see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithDHedger committed Nov 16, 2023
1 parent 80dd7ad commit c66bcc6
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LFSSetWallpaper/LFSSetWallpaper/app/lfs*
LFSWManager/LFSWManager/app/lfs*
LFSWManager/LFSWManager/helper/appmenu
LFSWM2/LFSWM2/app/lfswm2
LFSDock/LFSDock/app/lfsdock
.setup.local
LFSToolKit/examples/a.out
LFSToolKit/examples/diskmenu
Expand Down
2 changes: 1 addition & 1 deletion LFSApplications/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PKG_CHECK_MODULES(CAIRO, $CAIRO_MODULES)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(CAIRO_CFLAGS)

LFSTK_MODULES="lfstk >= 0.5.1"
LFSTK_MODULES="lfstk >= 0.6.0"
PKG_CHECK_MODULES(LFSTK, $LFSTK_MODULES)
AC_SUBST(LFSTK_LIBS)
AC_SUBST(LFSTK_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion LFSDesktop/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PKG_CHECK_MODULES(LIBUDEV, $LIBUDEV_MODULES)
AC_SUBST(LIBUDEV_LIBS)
AC_SUBST(LIBUDEV_CFLAGS)

LFSTK_MODULES="lfstk >= 0.5.1"
LFSTK_MODULES="lfstk >= 0.6.0"
PKG_CHECK_MODULES(LFSTK, $LFSTK_MODULES)
AC_SUBST(LFSTK_LIBS)
AC_SUBST(LFSTK_CFLAGS)
Expand Down
25 changes: 12 additions & 13 deletions LFSDock/LFSDock/src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ int queueID;
msgBuffer buffer;

const char *desktopTheme=NULL;
// char *panelID="";
bool realMainLoop=true;

int refreshRate=1;
Expand All @@ -52,22 +51,21 @@ int iconSize=16;
//panel window
LFSTK_applicationClass *apc=NULL;
LFSTK_windowClass *mainwind=NULL;
int rightOffset=0;
int leftOffset=0;
int launcherSide=NOLAUNCHERS;

//atoms
Atom WM_STATE=None;
Atom NET_WM_WINDOW_TYPE_NORMAL=None;
Atom NET_WM_STATE_HIDDEN=None;
Atom NET_WM_WINDOW_TYPE_DIALOG=None;
Atom NET_WM_DESKTOP=None;
Atom NET_WM_WINDOW_TYPE=None;
Atom NET_WM_STATE=None;
Atom NET_WM_NAME=None;
Atom UTF8_STRING=None;

const char *possibleError="Unknown";
Atom WM_STATE=None;
Atom NET_WM_WINDOW_TYPE_NORMAL=None;
Atom NET_WM_STATE_HIDDEN=None;
Atom NET_WM_WINDOW_TYPE_DIALOG=None;
Atom NET_WM_DESKTOP=None;
Atom NET_WM_WINDOW_TYPE=None;
Atom NET_WM_STATE=None;
Atom NET_WM_NAME=None;
Atom UTF8_STRING=None;

const char *possibleError="Unknown";

void setSizes(int *x,int *y,int *w,int *h,int *size,int *grav,bool fromleft)
{
Expand Down Expand Up @@ -114,6 +112,7 @@ void sendNotify(const char *name,const char *message)//TODO//could be better
#ifdef _GOTNOTIFYSEND_
char *command;
asprintf(&command,"notify-send -u low -t 2000 -i stock_dialog-info \"%s\" \"%s ...\" &",name,message);
fprintf(stderr,"%s\n",command);
system(command);
free(command);
#endif
Expand Down
3 changes: 0 additions & 3 deletions LFSDock/LFSDock/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,13 @@ extern msgBuffer buffer;
extern bool realMainLoop;

extern const char *desktopTheme;
// const char *panelID;

extern int refreshRate;

extern int iconSize;

//panel window
extern LFSTK_applicationClass *apc;
extern LFSTK_windowClass *mainwind;
extern int rightOffset;
extern int leftOffset;
extern int launcherSide;

Expand Down
22 changes: 8 additions & 14 deletions LFSDock/LFSDock/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "slider.h"

#define RCNAME "lfsdock"
#define REFRESHMULTI 4

void loadPrefs(const char *env)
{
Expand All @@ -46,7 +45,7 @@ void loadPrefs(const char *env)
noButtons=prefs.LFSTK_getBool(prefs.LFSTK_hashFromKey("nobuttons"));
}

void addLeftGadgets(void)
void addGadgets(void)
{
int offset=leftOffset;

Expand Down Expand Up @@ -121,20 +120,16 @@ int main(int argc,char **argv)
{prefs.LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,0}},
{prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}},

{prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}},
{prefs.LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand","xterm",false,0}},
{prefs.LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand","xterm",false,0}},
{prefs.LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand","xterm",false,0}},
{prefs.LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright","L",false,0}},
{prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}},

{prefs.LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,0}},
{prefs.LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,0}},

{prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}},
{prefs.LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",false,0}},
{prefs.LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour","",false,0}},
{prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}
{prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}},

{prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}},
{prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}},
};
realMainLoop=true;

Expand Down Expand Up @@ -179,7 +174,6 @@ int main(int argc,char **argv)
desktopTheme=mainwind->globalLib->desktopIconTheme.c_str();
mons=apc->LFSTK_getMonitorData(onMonitor);

rightOffset=0;
leftOffset=0;

if(useTheme==false)
Expand All @@ -188,15 +182,15 @@ int main(int argc,char **argv)
mainwind->LFSTK_setWindowColourName(NORMALCOLOUR,panelColour);
}

addLeftGadgets();
addGadgets();

if((leftOffset==0) && (rightOffset==0))
if(leftOffset==0)
{
fprintf(stderr,"Not using empty panel ...\n");
exit(0);
}

psize=leftOffset+abs(rightOffset);
psize=leftOffset;
px=mons->x;
py=mons->y;
switch(panelGravity)
Expand Down
Empty file added LFSDock/README
Empty file.
34 changes: 34 additions & 0 deletions LFSDock/config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* config.h.in. Generated from configure.ac by autoheader. */

/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#undef PACKAGE_NAME

/* Define to the full name and version of this package. */
#undef PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME

/* Define to the home page for this package. */
#undef PACKAGE_URL

/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* Version number of package */
#undef VERSION

/* Enable debug code */
#undef _ENABLEDEBUG_

/* send notify */
#undef _GOTNOTIFYSEND_

/* Enable warn debug code */
#undef _WARN_ENABLEDEBUG_
2 changes: 1 addition & 1 deletion LFSDock/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PKG_CHECK_MODULES(CAIRO, $CAIRO_MODULES)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(CAIRO_CFLAGS)

LFSTK_MODULES="lfstk >= 0.5.1"
LFSTK_MODULES="lfstk >= 0.6.0"
PKG_CHECK_MODULES(LFSTK, $LFSTK_MODULES)
AC_SUBST(LFSTK_LIBS)
AC_SUBST(LFSTK_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion LFSPanel/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PKG_CHECK_MODULES(CAIRO, $CAIRO_MODULES)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(CAIRO_CFLAGS)

LFSTK_MODULES="lfstk >= 0.5.1"
LFSTK_MODULES="lfstk >= 0.6.0"
PKG_CHECK_MODULES(LFSTK, $LFSTK_MODULES)
AC_SUBST(LFSTK_LIBS)
AC_SUBST(LFSTK_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion LFSSetWallpaper/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PKG_CHECK_MODULES(IMLIB, $IMLIB_MODULES)
AC_SUBST(IMLIB_LIBS)
AC_SUBST(IMLIB_CFLAGS)

LFSTK_MODULES="lfstk >= 0.5.1"
LFSTK_MODULES="lfstk >= 0.6.0"
PKG_CHECK_MODULES(LFSTK, $LFSTK_MODULES)
AC_SUBST(LFSTK_LIBS)
AC_SUBST(LFSTK_CFLAGS)
Expand Down
8 changes: 8 additions & 0 deletions LFSToolKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.6.0
Fixed version number in .pc file.
Fixed spurious enter/exit callbacks when clicking gadget.
Fixed set/unset keep above/below.
Fixed setting gadget callbacks to NULL to stop callback.
Fixed setting enter/exit, mouse pressed/released separately.
Added callback for mouse enter/exit.

0.5.2
Added support for colour names including a 8 bit alpha def eg "#80ff00ff".
Added transparent windows ( see examples/subwindows ).
Expand Down
55 changes: 49 additions & 6 deletions LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ void LFSTK_gadgetClass::LFSTK_setCommon(LFSTK_windowClass* parentwc,const char*
*/
void LFSTK_gadgetClass::LFSTK_setKeyCallBack(bool (*downcb)(void *,void*),bool (*releasecb)(void *,void*),void* ud)
{
this->callBacks.validCallbacks=this->callBacks.validCallbacks & ALLCB & (~(KEYPRESSCB|KEYRELEASECB));
if(downcb!=NULL)
this->callBacks.validCallbacks|=KEYPRESSCB;
if(releasecb!=NULL)
Expand All @@ -324,7 +325,7 @@ void LFSTK_gadgetClass::LFSTK_setKeyCallBack(bool (*downcb)(void *,void*),bool (
this->callBacks.keyReleaseCallback=releasecb;
this->callBacks.keyUserData=ud;
this->callBacks.runTheCallback=true;
this->callBacks.ignoreOrphanModKeys=true;
// this->callBacks.ignoreOrphanModKeys=true;
}

/**
Expand All @@ -337,11 +338,36 @@ void LFSTK_gadgetClass::LFSTK_setKeyCallBack(bool (*downcb)(void *,void*),bool (
*/
void LFSTK_gadgetClass::LFSTK_setGadgetDropCallBack(bool (*dropped)(void*,propertyStruct *data,void*),void* ud)
{
this->callBacks.validCallbacks|=GADGETDROPCB;
this->callBacks.validCallbacks=this->callBacks.validCallbacks & ALLCB & (~GADGETDROPCB);
if(dropped!=NULL)
this->callBacks.validCallbacks|=GADGETDROPCB;
this->callBacks.droppedGadgetCallback=dropped;
this->callBacks.droppedUserData=ud;
this->callBacks.runTheCallback=true;
this->callBacks.ignoreOrphanModKeys=true;
// this->callBacks.ignoreOrphanModKeys=true;
}

/**
* Set mouse enter/exit callback for widget.
* \param entercb mouse enter callback.
* \param exitcb mouse exit callback.
* \note Format for callback is "bool functioname(void *p,void* ud)"
* \note First param passed to callback is pointer to object.
* \note Second param passed to callback is user data.
*/
void LFSTK_gadgetClass::LFSTK_setMouseMoveCallBack(bool (*entercb)(LFSTK_gadgetClass*,void*),bool (*exitcb)(LFSTK_gadgetClass*,void*),void* ud)
{
this->callBacks.validCallbacks=this->callBacks.validCallbacks & ALLCB & (~(MOUSEENTERCB|MOUSEEXITCB));
if(entercb!=NULL)
this->callBacks.validCallbacks|=MOUSEENTERCB;

if(exitcb!=NULL)
this->callBacks.validCallbacks|=MOUSEEXITCB;
this->callBacks.mouseEnterCallback=entercb;
this->callBacks.mouseExitCallback=exitcb;
this->callBacks.mouseMoveUserData=ud;
this->callBacks.runTheCallback=true;
// this->callBacks.ignoreOrphanModKeys=true;
}

/**
Expand All @@ -354,6 +380,7 @@ void LFSTK_gadgetClass::LFSTK_setGadgetDropCallBack(bool (*dropped)(void*,proper
*/
void LFSTK_gadgetClass::LFSTK_setMouseCallBack(bool (*downcb)(void*,void*),bool (*releasecb)(void*,void*),void* ud)
{
this->callBacks.validCallbacks=this->callBacks.validCallbacks & ALLCB & (~(MOUSEPRESSCB|MOUSERELEASECB));
if(downcb!=NULL)
this->callBacks.validCallbacks|=MOUSEPRESSCB;
if(releasecb!=NULL)
Expand All @@ -362,7 +389,7 @@ void LFSTK_gadgetClass::LFSTK_setMouseCallBack(bool (*downcb)(void*,void*),bool
this->callBacks.mouseReleaseCallback=releasecb;
this->callBacks.mouseUserData=ud;
this->callBacks.runTheCallback=true;
this->callBacks.ignoreOrphanModKeys=true;
// this->callBacks.ignoreOrphanModKeys=true;
}

/**
Expand Down Expand Up @@ -731,6 +758,7 @@ bool LFSTK_gadgetClass::mouseUp(XButtonEvent *e)
if(this->toParent==true)
return(false);
}

return(retval);
}

Expand All @@ -746,6 +774,7 @@ bool LFSTK_gadgetClass::mouseDown(XButtonEvent *e)
this->mouseDownX=e->x;
this->mouseDownY=e->y;
this->keyEvent=NULL;

//no callbacks
if((this->callBacks.runTheCallback==false) || (this->isActive==false))
return(true);
Expand Down Expand Up @@ -774,10 +803,12 @@ bool LFSTK_gadgetClass::mouseDown(XButtonEvent *e)
*/
bool LFSTK_gadgetClass::mouseExit(XButtonEvent *e)
{
bool retval=true;

this->keyEvent=NULL;

//no callbacks
if((this->callBacks.runTheCallback==false) || (this->isActive==false))
if((this->callBacks.runTheCallback==false) || (this->isActive==false) )
return(true);

if(strcmp(this->label,"--")==0)
Expand All @@ -787,8 +818,13 @@ bool LFSTK_gadgetClass::mouseExit(XButtonEvent *e)
this->gadgetDetails.state=NORMALCOLOUR;
this->LFSTK_clearWindow();
this->inWindow=false;

if((this->callBacks.validCallbacks & MOUSEEXITCB) && (this->noRunCB==false))
retval=this->callBacks.mouseExitCallback(this,this->callBacks.mouseMoveUserData);

if(this->toParent==true)
return(false);

return(true);
}

Expand All @@ -799,10 +835,12 @@ bool LFSTK_gadgetClass::mouseExit(XButtonEvent *e)
*/
bool LFSTK_gadgetClass::mouseEnter(XButtonEvent *e)
{
bool retval=true;

this->keyEvent=NULL;

//no callbacks
if((this->callBacks.runTheCallback==false) || (this->isActive==false))
if((this->callBacks.runTheCallback==false) || (this->isActive==false) )
return(true);

if(strcmp(this->label,"--")==0)
Expand All @@ -812,8 +850,13 @@ bool LFSTK_gadgetClass::mouseEnter(XButtonEvent *e)
this->gadgetDetails.state=PRELIGHTCOLOUR;
this->LFSTK_clearWindow();
this->inWindow=true;

if((this->callBacks.validCallbacks & MOUSEENTERCB) && (this->noRunCB==false))
retval=this->callBacks.mouseEnterCallback(this,this->callBacks.mouseMoveUserData);

if(this->toParent==true)
return(false);

return(true);
}

Expand Down
5 changes: 4 additions & 1 deletion LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class LFSTK_gadgetClass
void LFSTK_setKeyCallBack(bool (*downcb)(void *,void*),bool (*releasecb)(void *,void*),void* ud);
void LFSTK_setGadgetDropCallBack(bool (*dropped)(void*,propertyStruct *data,void*),void* ud=NULL);
void LFSTK_setCallBacks(callbackStruct cbs);
void LFSTK_setMouseMoveCallBack(bool (*entercb)(LFSTK_gadgetClass*,void*),bool (*exitcb)(LFSTK_gadgetClass*,void*),void* ud);
bool noRunCB=false;

callbackStruct callBacks;

//colours
Expand All @@ -116,7 +119,7 @@ class LFSTK_gadgetClass
const char *LFSTK_getLabel(void);
void LFSTK_setLabelGravity(int orient);

//grahics
//graphics
void drawImage();
void LFSTK_setIndicator(indicatorType indictype);
cairo_status_t LFSTK_setImageFromPath(const char *file,int orient,bool scale);
Expand Down
Loading

0 comments on commit c66bcc6

Please sign in to comment.