From c66bcc6bdd048e319fe046074b9bb4b45903813a Mon Sep 17 00:00:00 2001 From: K D Hedger Date: Thu, 16 Nov 2023 14:02:19 +0000 Subject: [PATCH] lib version update etc see changelog --- .gitignore | 1 + LFSApplications/configure.ac | 2 +- LFSDesktop/configure.ac | 2 +- LFSDock/LFSDock/src/globals.cpp | 25 +++++----- LFSDock/LFSDock/src/globals.h | 3 -- LFSDock/LFSDock/src/main.cpp | 22 +++------ LFSDock/README | 0 LFSDock/config.h.in | 34 +++++++++++++ LFSDock/configure.ac | 2 +- LFSPanel/configure.ac | 2 +- LFSSetWallpaper/configure.ac | 2 +- LFSToolKit/ChangeLog | 8 +++ LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp | 55 ++++++++++++++++++--- LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h | 5 +- LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h | 20 +++++--- LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp | 13 ++++- LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp | 19 +------ LFSToolKit/configure.ac | 6 +-- LFSToolKit/examples/basic.cpp | 30 ++++++++++- LFSWM2/configure.ac | 2 +- 20 files changed, 180 insertions(+), 73 deletions(-) create mode 100644 LFSDock/README create mode 100644 LFSDock/config.h.in diff --git a/.gitignore b/.gitignore index cea77a95..250c95f3 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/LFSApplications/configure.ac b/LFSApplications/configure.ac index 60dc35a7..3f03dbfd 100644 --- a/LFSApplications/configure.ac +++ b/LFSApplications/configure.ac @@ -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) diff --git a/LFSDesktop/configure.ac b/LFSDesktop/configure.ac index d85f0958..7b3d9898 100644 --- a/LFSDesktop/configure.ac +++ b/LFSDesktop/configure.ac @@ -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) diff --git a/LFSDock/LFSDock/src/globals.cpp b/LFSDock/LFSDock/src/globals.cpp index 91647096..50d834e1 100644 --- a/LFSDock/LFSDock/src/globals.cpp +++ b/LFSDock/LFSDock/src/globals.cpp @@ -42,7 +42,6 @@ int queueID; msgBuffer buffer; const char *desktopTheme=NULL; -// char *panelID=""; bool realMainLoop=true; int refreshRate=1; @@ -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) { @@ -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 diff --git a/LFSDock/LFSDock/src/globals.h b/LFSDock/LFSDock/src/globals.h index c3015c92..4c6213a9 100644 --- a/LFSDock/LFSDock/src/globals.h +++ b/LFSDock/LFSDock/src/globals.h @@ -82,8 +82,6 @@ extern msgBuffer buffer; extern bool realMainLoop; extern const char *desktopTheme; -// const char *panelID; - extern int refreshRate; extern int iconSize; @@ -91,7 +89,6 @@ extern int iconSize; //panel window extern LFSTK_applicationClass *apc; extern LFSTK_windowClass *mainwind; -extern int rightOffset; extern int leftOffset; extern int launcherSide; diff --git a/LFSDock/LFSDock/src/main.cpp b/LFSDock/LFSDock/src/main.cpp index 46e6861c..d8b372f7 100644 --- a/LFSDock/LFSDock/src/main.cpp +++ b/LFSDock/LFSDock/src/main.cpp @@ -30,7 +30,6 @@ #include "slider.h" #define RCNAME "lfsdock" -#define REFRESHMULTI 4 void loadPrefs(const char *env) { @@ -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; @@ -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; @@ -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) @@ -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) diff --git a/LFSDock/README b/LFSDock/README new file mode 100644 index 00000000..e69de29b diff --git a/LFSDock/config.h.in b/LFSDock/config.h.in new file mode 100644 index 00000000..8058d498 --- /dev/null +++ b/LFSDock/config.h.in @@ -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_ diff --git a/LFSDock/configure.ac b/LFSDock/configure.ac index 9ee6320f..1b218caa 100644 --- a/LFSDock/configure.ac +++ b/LFSDock/configure.ac @@ -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) diff --git a/LFSPanel/configure.ac b/LFSPanel/configure.ac index 9f99b44f..8c78dce5 100644 --- a/LFSPanel/configure.ac +++ b/LFSPanel/configure.ac @@ -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) diff --git a/LFSSetWallpaper/configure.ac b/LFSSetWallpaper/configure.ac index 66e6c18f..3f184598 100644 --- a/LFSSetWallpaper/configure.ac +++ b/LFSSetWallpaper/configure.ac @@ -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) diff --git a/LFSToolKit/ChangeLog b/LFSToolKit/ChangeLog index 66eb7d7d..0f9323b9 100644 --- a/LFSToolKit/ChangeLog +++ b/LFSToolKit/ChangeLog @@ -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 ). diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp index 341bead2..ff4d3196 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp @@ -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) @@ -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; } /** @@ -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; } /** @@ -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) @@ -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; } /** @@ -731,6 +758,7 @@ bool LFSTK_gadgetClass::mouseUp(XButtonEvent *e) if(this->toParent==true) return(false); } + return(retval); } @@ -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); @@ -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) @@ -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); } @@ -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) @@ -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); } diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h index 2bae98d5..e198abcc 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h @@ -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 @@ -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); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h b/LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h index 03ff3414..4d62d81c 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKGlobals.h @@ -240,22 +240,24 @@ class LFSTK_gadgetClass; class LFSTK_applicationClass; #define NOCB 0x0 #define MOUSEPRESSCB 0x1 -#define MOUSERELEASECB 0x2 -#define KEYPRESSCB 0x4 +#define MOUSERELEASECB 0x2 +#define KEYPRESSCB 0x4 #define KEYRELEASECB 0x8 #define WINDOWDROPCB 0x10 #define GADGETDROPCB 0x20 -#define DOUBLECLICKCB 0x40 -#define TIMERCB 0x80 -#define ALLCB 0x8F +#define DOUBLECLICKCB 0x40 +#define TIMERCB 0x80 +#define MOUSEENTERCB 0x100 +#define MOUSEEXITCB 0x200 +#define ALLCB 0x2ff struct propertyStruct { unsigned char *data; int format; int nitems; - Atom type; - char *mimeType; + Atom type; + char *mimeType; int dropX=-1; int dropY=-1; }; @@ -270,12 +272,16 @@ struct callbackStruct bool (*droppedGadgetCallback)(void*,propertyStruct *data,void*)=NULL; bool (*doubleClickCallback)(void*,void*)=NULL; bool (*timerCallback)(LFSTK_applicationClass*,void*)=NULL; + bool (*mouseEnterCallback)(LFSTK_gadgetClass*,void*)=NULL; + bool (*mouseExitCallback)(LFSTK_gadgetClass*,void*)=NULL; + void *mouseMoveUserData=NULL; void *mouseUserData=NULL; void *droppedUserData=NULL; void *keyUserData=NULL; bool runTheCallback=true; bool ignoreOrphanModKeys=true; int validCallbacks=NOCB; + }; struct pointStruct diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp index 9bf23bce..b6038661 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp @@ -341,19 +341,29 @@ const char* LFSTK_lib::bestFontColour(long pixel) */ bool LFSTK_lib::LFSTK_gadgetEvent(void *self,XEvent *e,int type) { - bool retval=true; + bool retval=true; LFSTK_gadgetClass *gadget=NULL; geometryStruct geom; + Window sink; + Window childwindow; + int sinkx; + int sinky; + unsigned int buttonmask; gadget=static_cast(self); gadget->xEvent=e; + XQueryPointer(gadget->wc->app->display,gadget->wc->app->rootWindow,&sink,&childwindow,&sinkx,&sinky,&sinkx,&sinky,&buttonmask); switch (e->type) { case EnterNotify: + if(buttonmask!=0) + gadget->noRunCB=true; retval=gadget->mouseEnter(&e->xbutton); break; case LeaveNotify: + if(buttonmask!=0) + gadget->noRunCB=true; retval=gadget->mouseExit(&e->xbutton); break; case ButtonRelease: @@ -380,6 +390,7 @@ bool LFSTK_lib::LFSTK_gadgetEvent(void *self,XEvent *e,int type) } retval=gadget->mouseUp(&e->xbutton); + gadget->noRunCB=false; break; case ButtonPress: diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp index b0a5bc89..c9c20a79 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp @@ -632,9 +632,7 @@ void LFSTK_windowClass::LFSTK_setKeepAbove(bool set) xclient.data.l[0] =_NET_WM_STATE_REMOVE; xclient.data.l[1] =xa1; xclient.data.l[2]=0; -// XSendEvent(this->app->display,this->app->rootWindow,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); - XSendEvent(this->app->display,this->window,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); - XRaiseWindow(this->app->display,this->window); + XSendEvent(this->app->display,this->app->rootWindow,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); } /** @@ -1493,20 +1491,7 @@ void LFSTK_windowClass::sendUTF8(XSelectionRequestEvent *sev) static bool flag=false; static geometryStruct oldwindowGeom{0,0,0,0}; int LFSTK_windowClass::LFSTK_handleWindowEvents(XEvent *event) -{ - //this->LFSTK_clearWindow(false); - -//if(this->customwindow==true) -//{ -// cairo_save(this->cr); -// cairo_reset_clip (this->cr); -// cairo_set_source_rgba(this->cr,0,0.1,.4,0.2); -// cairo_paint(this->cr); -// cairo_restore(this->cr); -// return(1); -// -//} - +{ int retval=0; switch(event->type) { diff --git a/LFSToolKit/configure.ac b/LFSToolKit/configure.ac index 512911c5..d657a028 100644 --- a/LFSToolKit/configure.ac +++ b/LFSToolKit/configure.ac @@ -1,12 +1,12 @@ m4_define([LFSTOOLKIT_MAJ_N],[0]) -m4_define([LFSTOOLKIT_MIN_N],[5]) -m4_define([LFSTOOLKIT_REV_N],[2]) +m4_define([LFSTOOLKIT_MIN_N],[6]) +m4_define([LFSTOOLKIT_REV_N],[0]) m4_define([lfstk_api_version], [2.0]) m4_define([lfstk_version],[LFSTOOLKIT_MAJ_N.LFSTOOLKIT_MIN_N.LFSTOOLKIT_REV_N]) -AC_INIT([LFSToolKit],[0.5.2],[PROJ],[LFSToolKit]) +AC_INIT([LFSToolKit],[LFSTOOLKIT_MAJ_N.LFSTOOLKIT_MIN_N.LFSTOOLKIT_REV_N],[PROJ],[LFSToolKit]) AC_CONFIG_HEADERS([config.h]) AC_PROG_CXX diff --git a/LFSToolKit/examples/basic.cpp b/LFSToolKit/examples/basic.cpp index 507be856..7cd06556 100755 --- a/LFSToolKit/examples/basic.cpp +++ b/LFSToolKit/examples/basic.cpp @@ -87,6 +87,26 @@ bool mouseCB(void *p,void* ud) if(ud!=NULL) { printf(">>>%s<<<\n",(const char*)ud); + //wc->LFSTK_setKeepBelow(false); + + } + return(true); +} + +bool moveCB(LFSTK_gadgetClass*p,void* ud) +{ + if(ud!=NULL) + { + printf(">>>Mouse In %s<<<\n",(const char*)ud); + } + return(true); +} + +bool exitCB(LFSTK_gadgetClass*p,void* ud) +{ + if(ud!=NULL) + { + printf(">>>Mouse Out %s<<<\n",(const char*)ud); } return(true); } @@ -195,7 +215,11 @@ int main(int argc, char **argv) leftButton->LFSTK_setLabelGravity(LEFT); leftButton->LFSTK_setKeyCallBack(NULL,keyCB,USERDATA("Key Left")); leftButton->LFSTK_setMouseCallBack(NULL,mouseCB,USERDATA("Left")); + leftButton->LFSTK_setMouseMoveCallBack(moveCB,exitCB,USERDATA("Left Enter/Exit")); + //leftButton->LFSTK_setMouseMoveCallBack(NULL,exitCB,USERDATA("Left Exit")); + //leftButton->LFSTK_setMouseMoveCallBack(moveCB,NULL,USERDATA("Left Exit")); sy+=YSPACING; + //centre centreButton=new LFSTK_buttonClass(wc,"Label Centre",DIALOGMIDDLE-HALFGADGETWIDTH,sy,GADGETWIDTH,GADGETHITE); centreButton->LFSTK_setLabelGravity(CENTRE); @@ -211,6 +235,7 @@ int main(int argc, char **argv) dropButton->LFSTK_setKeyCallBack(NULL,keyCB,USERDATA("Key Drop")); dropButton->LFSTK_setMouseCallBack(NULL,mouseCB,USERDATA("Drop")); dropButton->LFSTK_setGadgetDropCallBack(gadgetDrop,NULL); + //dropButton->LFSTK_setGadgetDropCallBack(NULL,NULL); dropButton->gadgetAcceptsDnD=true; sy+=YSPACING; @@ -252,12 +277,13 @@ int main(int argc, char **argv) sy+=YSPACING; wc->LFSTK_resizeWindow(DIALOGWIDTH,sy,true); + wc->LFSTK_setKeepAbove(true); //wc->LFSTK_setWindowPixmap(apc->globalLib->LFSTK_getWindowPixmap(apc->display,apc->rootWindow),apc->displayWidth,apc->displayHeight); //wc->LFSTK_showWindow(); printf("Number of gadgets in window=%i\n",wc->LFSTK_gadgetCount()); - apc->LFSTK_setTimer(2); - apc->LFSTK_setTimerCallBack(timerCB,NULL); + //apc->LFSTK_setTimer(2); + //apc->LFSTK_setTimerCallBack(timerCB,NULL); int retval=apc->LFSTK_runApp(); delete apc; diff --git a/LFSWM2/configure.ac b/LFSWM2/configure.ac index 560b2f54..ea54f6a4 100644 --- a/LFSWM2/configure.ac +++ b/LFSWM2/configure.ac @@ -46,7 +46,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)