From c913beea0a677e8b767883ff8867e87995a95110 Mon Sep 17 00:00:00 2001 From: K D Hedger Date: Sun, 21 Apr 2024 16:24:21 +0100 Subject: [PATCH] see changelogs --- LFSDock/ChangeLog | 1 + LFSDock/LFSDock/sources | 2 +- LFSDock/LFSDock/src/globals.cpp | 12 +++--- LFSDock/LFSDock/src/main.cpp | 13 +++--- LFSToolKit/ChangeLog | 3 ++ LFSToolKit/LFSToolKit/app/Makefile.am | 1 + LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp | 4 ++ LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp | 43 ++++++++++++++++++- LFSToolKit/LFSToolKit/lfstk/LFSTKImage.h | 3 +- LFSToolKit/Makefile.am | 6 +-- LFSToolKit/configure.ac | 4 +- LFSToolKit/examples/RunExamples.cpp | 2 +- LFSToolKit/examples/image.cpp | 47 ++++++++++++++++++++- LFSWM2/Makefile.am | 2 - makeall | 12 +++--- 15 files changed, 125 insertions(+), 30 deletions(-) diff --git a/LFSDock/ChangeLog b/LFSDock/ChangeLog index f6bc028..8d2e400 100644 --- a/LFSDock/ChangeLog +++ b/LFSDock/ChangeLog @@ -1,4 +1,5 @@ 0.2.0 +Better display of transparent BG image. Added optional background image to dock. Fixed finding desktop files. Minor fix for launchers. diff --git a/LFSDock/LFSDock/sources b/LFSDock/LFSDock/sources index 4d9e712..1876800 100644 --- a/LFSDock/LFSDock/sources +++ b/LFSDock/LFSDock/sources @@ -1 +1 @@ -COMMONSRC = ../src/globals.cpp ../src/calendar.cpp ../src/callbacks.cpp ../src/clock.cpp ../src/desktopSwitcher.cpp ../src/launchers.cpp ../src/taskBar.cpp ../src/slider.cpp ../src/main.cpp +COMMONSRC = ../src/calendar.cpp ../src/callbacks.cpp ../src/clock.cpp ../src/desktopSwitcher.cpp ../src/globals.cpp ../src/launchers.cpp ../src/main.cpp ../src/slider.cpp ../src/taskBar.cpp diff --git a/LFSDock/LFSDock/src/globals.cpp b/LFSDock/LFSDock/src/globals.cpp index fca5955..526afcb 100644 --- a/LFSDock/LFSDock/src/globals.cpp +++ b/LFSDock/LFSDock/src/globals.cpp @@ -139,12 +139,12 @@ void setGadgetDetails(LFSTK_gadgetClass *gadget) gadget->LFSTK_setAlpha(1.0); gadget->LFSTK_setStyle(BEVELNONE); - if(useBG==true) - { - gadget->LFSTK_setTile(dockBGImage.c_str(),-1); - gadget->gadgetDetails.geomRelativeToMainWindow=true; - } - else +// if(useBG==true) +// { +// gadget->LFSTK_setTile(dockBGImage.c_str(),-1); +// gadget->gadgetDetails.geomRelativeToMainWindow=true; +// } +// else { gadget->LFSTK_setTile(NULL,0); gadget->LFSTK_setGadgetColours(GADGETBG,"#00000000","#00000000","#00000000","#00000000"); diff --git a/LFSDock/LFSDock/src/main.cpp b/LFSDock/LFSDock/src/main.cpp index 6729d35..f2aaf61 100644 --- a/LFSDock/LFSDock/src/main.cpp +++ b/LFSDock/LFSDock/src/main.cpp @@ -330,14 +330,17 @@ int main(int argc,char **argv) if(useBG==true) { - dockWindow->LFSTK_setTile(dockBGImage.c_str(),-1); + //dockWindow->LFSTK_setTile(dockBGImage.c_str(),-1); dockBGWindow->LFSTK_showWindow(true); + //dockBGWindow->LFSTK_setKeepAbove(true); + //dockWindow->LFSTK_setKeepAbove(true); } - else - dockWindow->LFSTK_setTile(NULL,0); + //else + // dockWindow->LFSTK_setTile(NULL,0); - dockWindow->LFSTK_showWindow(true); - dockWindow->LFSTK_setKeepAbove(true); + //dockWindow->LFSTK_showWindow(true); + //dockWindow->LFSTK_setKeepAbove(true); + //dockBGWindow->LFSTK_setKeepAbove(true); if(useTaskBar==true) updateTaskBar(true); diff --git a/LFSToolKit/ChangeLog b/LFSToolKit/ChangeLog index 9df23f1..debb969 100644 --- a/LFSToolKit/ChangeLog +++ b/LFSToolKit/ChangeLog @@ -1,4 +1,7 @@ 0.6.1 +Vairous build files tweaks. +Added mouse enter/exit call backs to image class. +Fixed cairo surface sizes. Gadget and window tile fixes. Fixes to find class. Minor tweaks to LFSTKFindClass. diff --git a/LFSToolKit/LFSToolKit/app/Makefile.am b/LFSToolKit/LFSToolKit/app/Makefile.am index 1b8e2d3..90bf5b2 100644 --- a/LFSToolKit/LFSToolKit/app/Makefile.am +++ b/LFSToolKit/LFSToolKit/app/Makefile.am @@ -1,3 +1,4 @@ +#ACLOCAL_AMFLAGS = "-I m4" AUTOMAKE_OPTIONS = subdir-objects include ../flagsandlibs diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp index 9ac123b..a9e8dfe 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.cpp @@ -1572,6 +1572,10 @@ void LFSTK_gadgetClass::LFSTK_setTile(const char *path,int size) { if((this->gadgetDetails.gadgetGeom.w!=0) && (this->gadgetDetails.gadgetGeom.h!=0)) cairo_xlib_surface_set_size(this->sfc,cairo_image_surface_get_width(tempimage)+1,cairo_image_surface_get_height(tempimage)+1); + + if((cairo_xlib_surface_get_width(this->sfc)==0) || (cairo_xlib_surface_get_height(this->sfc)==0)) + cairo_xlib_surface_set_size(this->sfc,this->gadgetDetails.gadgetGeom.w,this->gadgetDetails.gadgetGeom.h); + this->pattern=cairo_pattern_create_for_surface(tempimage); cairo_surface_destroy(tempimage); cairo_pattern_set_extend(pattern,CAIRO_EXTEND_REPEAT); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp index 1acc898..eafa72e 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.cpp @@ -31,6 +31,46 @@ LFSTK_imageClass::LFSTK_imageClass() { } +/** +* Mouse exit callback. +* \param e XButtonEvent passed from mainloop->listener. +* \return Return true if event fully handeled or false to pass it on. +*/ +bool LFSTK_imageClass::mouseExit(XButtonEvent *e) +{ + bool retval=true; + + this->keyEvent=NULL; +//no callbacks + if((this->callBacks.runTheCallback==false) || (this->isActive==false) ) + return(true); + + if((this->callBacks.validCallbacks & MOUSEEXITCB) && (this->noRunCB==false)) + retval=this->callBacks.mouseExitCallback(this,this->callBacks.mouseMoveUserData); + return(retval); +} + +/** +* Mouse enter callback. +* \param e XButtonEvent passed from mainloop->listener. +* \return Return true if event fully handeled or false to pass it on. +*/ +bool LFSTK_imageClass::mouseEnter(XButtonEvent *e) +{ + bool retval=true; + + this->keyEvent=NULL; + +//no callbacks + if((this->callBacks.runTheCallback==false) || (this->isActive==false) ) + return(true); + + if((this->callBacks.validCallbacks & MOUSEENTERCB) && (this->noRunCB==false)) + retval=this->callBacks.mouseEnterCallback(this,this->callBacks.mouseMoveUserData); + + return(retval); +} + /** * Mouse up callback. * \param e XButtonEvent passed from mainloop->listener. @@ -123,7 +163,8 @@ LFSTK_imageClass::LFSTK_imageClass(LFSTK_windowClass* parentwc,const char* image this->gc=XCreateGC(this->wc->app->display,this->window,0,NULL); this->wc->globalLib->LFSTK_setCairoSurface(this->wc->app->display,this->window,this->wc->app->visual,&this->sfc,&this->cr,w,h); this->LFSTK_setCairoFontData(); - XSelectInput(this->wc->app->display,this->window,ButtonPressMask|ButtonReleaseMask|ExposureMask|ButtonMotionMask); + XSelectInput(this->wc->app->display,this->window,ButtonPressMask|ButtonReleaseMask|ExposureMask|ButtonMotionMask| EnterWindowMask | LeaveWindowMask); +// long gadgetEventMask=(ButtonReleaseMask | ButtonPressMask | ExposureMask | EnterWindowMask | LeaveWindowMask|ButtonMotionMask|FocusChangeMask|KeyReleaseMask|KeyPressMask); this->ml->function=&LFSTK_lib::LFSTK_gadgetEvent; this->ml->gadget=this; diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.h b/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.h index 93d8b4f..20f822a 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.h +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKImage.h @@ -36,7 +36,8 @@ class LFSTK_imageClass : public LFSTK_gadgetClass LFSTK_imageClass(LFSTK_windowClass* parentwc,const char* imagepath,int x,int y,unsigned w,unsigned h,int gravity,bool scale); bool mouseUp(XButtonEvent *e); - + bool mouseEnter(XButtonEvent *e); + bool mouseExit(XButtonEvent *e); void LFSTK_clearWindow(void); cairo_surface_t *shapesfc=NULL; diff --git a/LFSToolKit/Makefile.am b/LFSToolKit/Makefile.am index cdcb470..955f1ae 100644 --- a/LFSToolKit/Makefile.am +++ b/LFSToolKit/Makefile.am @@ -5,7 +5,6 @@ EXTRA_DIST = lfstk.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lfstk.pc DISTCLEANFILES = lfstk.pc -#ACLOCAL_AMFLAGS = "-I m4" .PHONY: docs @@ -22,9 +21,8 @@ docs-install: docs-uninstall: rm -rv $(DESTDIR)$(docdir) -remake: - $(shell ./remakesourcelist) - purge: rm $(DESTDIR)${libdir}/liblfstoolkit.*||true rm -r $(DESTDIR)${includedir}/lfstk||true + +#ACLOCAL_AMFLAGS = "-I m4" diff --git a/LFSToolKit/configure.ac b/LFSToolKit/configure.ac index c61b266..718f247 100644 --- a/LFSToolKit/configure.ac +++ b/LFSToolKit/configure.ac @@ -1,4 +1,5 @@ + m4_define([LFSTOOLKIT_MAJ_N],[0]) m4_define([LFSTOOLKIT_MIN_N],[6]) m4_define([LFSTOOLKIT_REV_N],[1]) @@ -11,10 +12,11 @@ AC_INIT([LFSToolKit],[LFSTOOLKIT_MAJ_N.LFSTOOLKIT_MIN_N.LFSTOOLKIT_REV_N],[PROJ] AC_CONFIG_HEADERS([config.h]) AC_PROG_CXX #AC_CONFIG_MACRO_DIRS() +AC_CONFIG_MACRO_DIRS([m4]) AM_INIT_AUTOMAKE -AC_PROG_CC +#AC_PROG_CC LT_INIT([disable-static]) diff --git a/LFSToolKit/examples/RunExamples.cpp b/LFSToolKit/examples/RunExamples.cpp index a384a3f..6def8c2 100755 --- a/LFSToolKit/examples/RunExamples.cpp +++ b/LFSToolKit/examples/RunExamples.cpp @@ -26,7 +26,7 @@ exit $retval #include "lfstk/LFSTKGlobals.h" #define BOXLABEL "Examples" -#define MAKEFLAGS "-j10" +#define MAKEFLAGS "-j10 --output-sync" LFSTK_applicationClass *apc=NULL; LFSTK_windowClass *wc=NULL; diff --git a/LFSToolKit/examples/image.cpp b/LFSToolKit/examples/image.cpp index 58711ab..69f95a5 100755 --- a/LFSToolKit/examples/image.cpp +++ b/LFSToolKit/examples/image.cpp @@ -82,6 +82,7 @@ bool contextCB(void *p,void* ud) bool mouseUpCB(void *p,void* ud) { geometryStruct geom; + fprintf(stderr,"mouseUpCB\n"); if(p!=NULL) { static_cast(p)->LFSTK_getGeom(&geom); @@ -94,6 +95,47 @@ bool mouseUpCB(void *p,void* ud) return(true); } +bool mouseDownCB(void *p,void* ud) +{ + geometryStruct geom; + fprintf(stderr,"mouseDownCB\n"); +// if(p!=NULL) +// { +// static_cast(p)->LFSTK_getGeom(&geom); +////DEBUGFUNC("%b",static_cast(p)->isDoubleClick); +// if(static_cast(p)->isDoubleClick==true) +// fprintf(stderr,"double click x=%i y=%i\n",geom.x,geom.y); +// // else +// // fprintf(stderr,"x=%i y=%i\n",geom.x,geom.y); +// } + return(true); +} +bool moveCB(LFSTK_gadgetClass*p,void* ud) +{ + if(ud!=NULL) + { + XEvent event; + geometryStruct geom; + printf(">>>Mouse In %s<<<\n",(const char*)ud); + + //p->LFSTK_getGeomWindowRelative(&geom,apc->rootWindow); + //popWindow->LFSTK_moveWindow(geom.x,geom.y-GADGETHITE,true); + //popWindow->LFSTK_showWindow(); + //popWindow->LFSTK_clearWindow(true); + } + return(true); +} + +bool exitCB(LFSTK_gadgetClass*p,void* ud) +{ + if(ud!=NULL) + { + printf(">>>Mouse Out %s<<<\n",(const char*)ud); + //popWindow->LFSTK_hideWindow(); + } + return(true); +} + int main(int argc, char **argv) { int sy=BORDER; @@ -118,7 +160,8 @@ int main(int argc, char **argv) // tux->LFSTK_setLimits(10,-1,440,-1); // tux->LFSTK_setLimits(-1,10,-1,440); tux->LFSTK_setLimits(10,10,440,120); - tux->LFSTK_setMouseCallBack(NULL,mouseUpCB,NULL); + tux->LFSTK_setMouseCallBack(mouseDownCB,mouseUpCB,NULL); + tux->LFSTK_setMouseMoveCallBack(moveCB,exitCB,USERDATA("Left Enter/Exit")); sy+=YSPACING*3; @@ -168,7 +211,7 @@ int main(int argc, char **argv) win->w=200; win->h=200; win->wc=wc; - win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); win->decorated=false; win->overRide=true; diff --git a/LFSWM2/Makefile.am b/LFSWM2/Makefile.am index 32e147f..5faa850 100644 --- a/LFSWM2/Makefile.am +++ b/LFSWM2/Makefile.am @@ -1,6 +1,4 @@ SUBDIRS = LFSWM2/app -remake: - $(shell ./remakesourcelist) diff --git a/makeall b/makeall index 4c8e1f8..164a305 100755 --- a/makeall +++ b/makeall @@ -96,22 +96,22 @@ deploy () { runCommand "make distclean"||true runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}" - runCommand "make $MAKEFLAGS"||make -j1||exit 100 - runCommand "make install" + runCommand "make $MAKEFLAGS --output-sync"||"make -j1 --output-sync"||exit 100 + runCommand "make install --output-sync" } deploytest () { runCommand "make distclean"||true runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}" - runCommand "make $MAKEFLAGS"||make -j1||exit 100 - runCommand "make install DESTDIR=/tmp/lfsdesktop-deploy" + runCommand "make $MAKEFLAGS --output-sync"||"make -j1 --output-sync"||exit 100 + runCommand "make install DESTDIR=/tmp/lfsdesktop-deploy --output-sync" } makeit () { runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}" - runCommand "make $MAKEFLAGS"||make -j1||exit 100 + runCommand "make $MAKEFLAGS --output-sync"||"make -j1 --output-sync"||exit 100 } makelocal () @@ -126,7 +126,7 @@ makelocal () export CFLAGS CXXFLAGS runCommand "./autogen.sh --prefix=/usr" fi - runCommand "make $MAKEFLAGS" + runCommand "make $MAKEFLAGS --output-sync" } ownit ()