Compare commits

...

16 Commits
master ... osx

Author SHA1 Message Date
Filippo Scognamiglio
462831ca66 Merge pull request #134 from sschueller/patch-1
Update README.md
2014-10-02 22:14:00 +02:00
Stefan Schüller
273ac3d126 Update README.md 2014-10-02 13:35:20 +02:00
Filippo Scognamiglio
4a7e23f024 Merge pull request #65 from e1senh0rn/osx
Various OSX fixes.
2014-08-04 18:00:08 +02:00
Dmitry Shaposhnik
84e0feb626 Add OS X build instructions to README 2014-08-04 08:39:42 -05:00
Dmitry Shaposhnik
906e981449 Add 'imports' to gitignore 2014-08-04 08:39:36 -05:00
Dmitry Shaposhnik
d887842bdc Do not list 'app' in project subdirs 2014-08-04 08:31:48 -05:00
Dmitry Shaposhnik
ed701b0ac6 Remove auto-generated makefile 2014-08-04 08:28:51 -05:00
Filippo Scognamiglio
e9e3732b26 Merge pull request #58 from guitorri/osx-headers
fix compilation errors, OSX 10.6-10.9
2014-08-03 15:22:26 +02:00
Guilherme Brondani Torri
2f11060364 fix compilation errors, OSX 10.6-10.9
* add missing headers
* https://github.com/Swordifish90/cool-old-term/issues/12
2014-08-02 18:16:50 +02:00
Filippo Scognamiglio
d3d1407ca7 Remove dummy signal. Shame on me. 2014-08-01 18:09:36 +02:00
Filippo Scognamiglio
5586c36efe Fix missing sources in konsole-qml-plugin.pro. 2014-08-01 14:09:48 +02:00
Filippo Scognamiglio
4064a38998 Merge branch 'master' of https://github.com/aacalfa/cool-old-term into osx 2014-08-01 14:03:46 +02:00
aacalfa
5978a0de70 Reorganizing last commit. Changes to kpty.cpp were moved to file utmpmac.cpp. Thus I modified .pro
file to add this new file utmpmac to be compiled. I have put both .cpp and .h files inside a macro
so that they are only considered when building from a mac. Same with include from kpty.cpp.
2014-07-31 22:28:12 -03:00
aacalfa
9d7efad798 Reverting PreprocessedTerminal.qml to be used in pull request. 2014-07-31 14:25:23 -03:00
aacalfa
d063e888a3 Another workaround to solve blur problem. 2014-07-31 12:16:43 -03:00
aacalfa
c612a1d586 Workaround to work for MacOS X. 2014-07-31 11:55:52 -03:00
9 changed files with 231 additions and 5528 deletions

2
.gitignore vendored
View File

@ -34,3 +34,5 @@ Makefile*
# Others # Others
*.xcf *.xcf
/imports/

View File

@ -63,6 +63,20 @@ You can also install this [package](https://aur.archlinux.org/packages/cool-old-
--- ---
**OS X**
brew install qt5
export CPPFLAGS="-I/usr/local/opt/qt5/include"
export LDFLAGS="-L/usr/local/opt/qt5/lib"
export PATH=/usr/local/opt/qt5/bin:$PATH
git clone https://github.com/Swordifish90/cool-old-term.git
git checkout osx
qmake && make && make install
# Have fun!
./cool-old-term
---
**Anyone else** **Anyone else**
Install Qt directly from here http://qt-project.org/downloads . Once done export them in you path (replace "_/opt/Qt5.3.1/5.3/gcc_64/bin_" with your correct folder): Install Qt directly from here http://qt-project.org/downloads . Once done export them in you path (replace "_/opt/Qt5.3.1/5.3/gcc_64/bin_" with your correct folder):

View File

@ -1,4 +1,3 @@
TEMPLATE =subdirs TEMPLATE =subdirs
CONFIG += ordered CONFIG += ordered
SUBDIRS= konsole-qml-plugin\ SUBDIRS= konsole-qml-plugin
app

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,8 @@ SOURCES += \
$$PWD/src/Filter.cpp \ $$PWD/src/Filter.cpp \
$$PWD/src/ColorScheme.cpp \ $$PWD/src/ColorScheme.cpp \
$$PWD/src/TerminalDisplay.cpp \ $$PWD/src/TerminalDisplay.cpp \
$$PWD/src/ksession.cpp $$PWD/src/ksession.cpp \
$$PWD/src/utmpmac.cpp
HEADERS += \ HEADERS += \
$$PWD/src/plugin.h \ $$PWD/src/plugin.h \
@ -75,6 +76,7 @@ HEADERS += \
$$PWD/src/ColorScheme.h \ $$PWD/src/ColorScheme.h \
$$PWD/src/TerminalDisplay.h \ $$PWD/src/TerminalDisplay.h \
$$PWD/src/ksession.h $$PWD/src/ksession.h
$$PWD/src/utmpmac.h
OTHER_FILES += \ OTHER_FILES += \
$$PWD/src/qmldir \ $$PWD/src/qmldir \

View File

@ -409,8 +409,6 @@ public slots:
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
void banana(int x, int y, int z, int w);
void setSession(KSession * session); void setSession(KSession * session);
KSession * getSession() const { return m_session; } KSession * getSession() const { return m_session; }

View File

@ -135,6 +135,10 @@ extern "C" {
# endif # endif
#endif #endif
#if defined (__APPLE__)
#include "utmpmac.h"
#endif
//#include <kdebug.h> //#include <kdebug.h>
//#include <kstandarddirs.h> // findExe //#include <kstandarddirs.h> // findExe

View File

@ -0,0 +1,186 @@
#if defined (__APPLE__)
#include "utmpmac.h"
typedef enum { F=0, T=1 } boolean;
static int utmpfd = -1;
static char utmpath[PATH_MAX+1] = _PATH_UTMP;
static boolean readonly = F;
static struct utmp utmp;
struct utmp *getutent();
struct utmp *getutid( struct utmp * );
struct utmp *getutline( struct utmp * );
void pututline( struct utmp * );
void setutent();
void endutent();
void utmpname( char * );
static
struct utmp *
_getutent( struct utmp *utmp )
{
if ( utmpfd == -1 )
{
if ( (utmpfd = open(utmpath,O_RDWR)) == -1 )
{
if ( (utmpfd = open(utmpath,O_RDONLY)) == -1 )
return NULL;
else
readonly = T;
}
else
readonly = F;
}
if ( read(utmpfd,utmp,sizeof(struct utmp)) == sizeof(struct utmp) )
return utmp;
return NULL;
}
struct utmp *
getutent()
{
return _getutent( &utmp );
}
struct utmp *
getutid( struct utmp *id )
{
struct utmp *up;
if ( strncmp(id->ut_name,utmp.ut_name,UT_NAMESIZE) == 0 )
return &utmp;
while( (up = getutent()) != NULL )
{
if ( strncmp(id->ut_name,up->ut_name,UT_NAMESIZE) == 0 )
return up;
}
return NULL;
}
struct utmp *
getutline( struct utmp *line )
{
struct utmp *up;
if ( strncmp(line->ut_line,utmp.ut_line,UT_LINESIZE) == 0 )
return &utmp;
while( (up = getutent()) != NULL )
{
if ( strncmp(line->ut_line,up->ut_line,UT_LINESIZE) == 0 )
return up;
}
return NULL;
}
void
pututline( struct utmp *up )
{
struct utmp temp;
struct stat buf;
/* Note that UP might be equal to &UTMP */
if ( strncmp(up->ut_name,utmp.ut_name,UT_NAMESIZE) == 0 )
/* File already at correct position */
{
if ( ! readonly )
{
lseek( utmpfd, -(off_t)sizeof(struct utmp), SEEK_CUR );
write( utmpfd, up, sizeof(struct utmp) );
}
utmp = *up;
}
else
/* File is not at the correct postion; read forward, but do not destroy
UTMP */
{
while( _getutent(&temp) != NULL )
{
if ( strncmp(up->ut_name,temp.ut_name,UT_NAMESIZE) == 0 )
/* File is now at the correct position */
{
if ( ! readonly )
{
lseek( utmpfd, -(off_t)sizeof(struct utmp), SEEK_CUR );
write( utmpfd, up, sizeof(struct utmp) );
}
utmp = *up;
return;
}
}
/* File is now at EOF */
if ( ! readonly )
{
if ( fstat(utmpfd,&buf) == 0 && lseek(utmpfd,0,SEEK_END) != -1 )
{
if ( write(utmpfd,up,sizeof(struct utmp)) != sizeof(struct utmp)
)
ftruncate( utmpfd, buf.st_size );
}
}
utmp = *up;
}
}
void
setutent()
{
if ( utmpfd != -1 )
lseek( utmpfd, 0, SEEK_SET );
}
void
endutent()
{
if ( utmpfd != -1 )
{
close( utmpfd );
utmpfd = -1;
memset( &utmp, 0, sizeof(struct utmp) );
}
}
void
utmpname( char *file )
{
endutent();
strncpy( utmpath, file, PATH_MAX );
}
// https://dev.mobileread.com/svn/iliados/upstream/tinylogin-1.4/libbb/libc5.c
void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
{
int fd;
fd = open(wtmp_file, O_APPEND | O_WRONLY, 0);
if (fd >= 0) {
if (lockf(fd, F_LOCK, 0)==0) {
write(fd, (const char *) lutmp, sizeof(struct utmp));
lockf(fd, F_ULOCK, 0);
close(fd);
}
}
}
#endif

View File

@ -0,0 +1,21 @@
#if defined (__APPLE__)
#include <utmp.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/stat.h>
struct utmp *getutent();
struct utmp *getutid( struct utmp * );
struct utmp *getutline( struct utmp * );
void pututline( struct utmp * );
void setutent();
void endutent();
void utmpname( char * );
void updwtmp(const char *wtmp_file, const struct utmp *lutmp);
#endif