author | zecke <zecke> | 2002-10-15 21:42:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-15 21:42:20 (UTC) |
commit | 676be5604cbdb3213c00775e0ff66f4e766f8dcb (patch) (side-by-side diff) | |
tree | 63c29adab530a60371f78880ff75e2689398e239 | |
parent | b774e015816e51ac65e5d1c685306f8404a3a19e (diff) | |
download | opie-676be5604cbdb3213c00775e0ff66f4e766f8dcb.zip opie-676be5604cbdb3213c00775e0ff66f4e766f8dcb.tar.gz opie-676be5604cbdb3213c00775e0ff66f4e766f8dcb.tar.bz2 |
Actually most of them are -+ cause I opened them in xemacs..
The main goal is to
replace some header names to let them be overwritten by external once
so "qpeapplication.h" is now <qpe/qpeapplication.h>
I'll check if it's building on non Qt2/X11 systems...
-rw-r--r-- | library/alarmserver.cpp | 4 | ||||
-rw-r--r-- | library/backend/vcc.y | 2 | ||||
-rw-r--r-- | library/backend/vcc_yacc.cpp | 2 | ||||
-rw-r--r-- | library/backend/vobject.cpp | 4 | ||||
-rw-r--r-- | library/datebookmonth.cpp | 2 | ||||
-rw-r--r-- | library/fileselector.cpp | 6 | ||||
-rw-r--r-- | library/fontdatabase.cpp | 2 | ||||
-rw-r--r-- | library/fontdatabase.h | 1 | ||||
-rw-r--r-- | library/mimetype.cpp | 2 | ||||
-rw-r--r-- | library/qpedialog.cpp | 2 | ||||
-rw-r--r-- | library/qpestyle.cpp | 2 | ||||
-rw-r--r-- | library/resource.cpp | 2 | ||||
-rw-r--r-- | library/timestring.cpp | 2 |
13 files changed, 17 insertions, 16 deletions
diff --git a/library/alarmserver.cpp b/library/alarmserver.cpp index 1ee05c6..177a0cb 100644 --- a/library/alarmserver.cpp +++ b/library/alarmserver.cpp @@ -1,128 +1,128 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qdir.h> #include <qfile.h> #include <qmessagebox.h> #include <qtextstream.h> -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "global.h" #include "resource.h" #if defined(Q_WS_QWS) && !defined(QT_NO_COP) -#include "qcopenvelope_qws.h" +#include <qpe/qcopenvelope_qws.h> #endif #include "alarmserver.h" #include <qpe/timeconversion.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <unistd.h> struct timerEventItem { time_t UTCtime; QCString channel, message; int data; bool operator==( const timerEventItem &right ) const { return ( UTCtime == right.UTCtime && channel == right.channel && message == right.message && data == right.data ); } }; class TimerReceiverObject : public QObject { public: TimerReceiverObject() { } ~TimerReceiverObject() { } void resetTimer(); void setTimerEventItem(); void deleteTimer(); protected: void timerEvent( QTimerEvent *te ); private: QString atfilename; }; TimerReceiverObject *timerEventReceiver = NULL; QList<timerEventItem> timerEventList; timerEventItem *nearestTimerEvent = NULL; // set the timer to go off on the next event in the list void setNearestTimerEvent() { nearestTimerEvent = NULL; QListIterator<timerEventItem> it( timerEventList ); if ( *it ) nearestTimerEvent = *it; for ( ; *it; ++it ) if ( (*it)->UTCtime < nearestTimerEvent->UTCtime ) nearestTimerEvent = *it; if (nearestTimerEvent) timerEventReceiver->resetTimer(); else timerEventReceiver->deleteTimer(); } //store current state to file //Simple implementation. Should run on a timer. static void saveState() { QString savefilename = Global::applicationFileName( "AlarmServer", "saveFile" ); if ( timerEventList.isEmpty() ) { unlink( savefilename ); return; } QFile savefile(savefilename+".new"); if ( savefile.open(IO_WriteOnly) ) { QDataStream ds( &savefile ); //save QListIterator<timerEventItem> it( timerEventList ); for ( ; *it; ++it ) { ds << it.current()->UTCtime; ds << it.current()->channel; ds << it.current()->message; ds << it.current()->data; } savefile.close(); unlink( savefilename ); QDir d; d.rename(savefilename+".new",savefilename); } } /*! Sets up the alarm server. Restoring to previous state (session management). */ void AlarmServer::initialize() diff --git a/library/backend/vcc.y b/library/backend/vcc.y index 5bcf0cb..6781312 100644 --- a/library/backend/vcc.y +++ b/library/backend/vcc.y @@ -29,193 +29,193 @@ DAMAGE. EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
The software is provided with RESTRICTED RIGHTS. Use, duplication, or
disclosure by the government are subject to restrictions set forth in
DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
***************************************************************************/
/*
* src: vcc.c
* doc: Parser for vCard and vCalendar. Note that this code is
* generated by a yacc parser generator. Generally it should not
* be edited by hand. The real source is vcc.y. The #line directives
* can be commented out here to make it easier to trace through
* in a debugger. However, if a bug is found it should
* be fixed in vcc.y and this file regenerated.
*/
/* debugging utilities */
#if __DEBUG
#define DBG_(x) printf x
#else
#define DBG_(x)
#endif
/**** External Functions ****/
/* assign local name to parser variables and functions so that
we can use more than one yacc based parser.
*/
#if 0
#define yyparse mime_parse
#define yylex mime_lex
#define yyerror mime_error
#define yychar mime_char
/* #define p_yyval p_mime_val */
#undef yyval
#define yyval mime_yyval
/* #define p_yylval p_mime_lval */
#undef yylval
#define yylval mime_yylval
#define yydebug mime_debug
#define yynerrs mime_nerrs
#define yyerrflag mime_errflag
#define yyss mime_ss
#define yyssp mime_ssp
#define yyvs mime_vs
#define yyvsp mime_vsp
#define yylhs mime_lhs
#define yylen mime_len
#define yydefred mime_defred
#define yydgoto mime_dgoto
#define yysindex mime_sindex
#define yyrindex mime_rindex
#define yygindex mime_gindex
#define yytable mime_table
#define yycheck mime_check
#define yyname mime_name
#define yyrule mime_rule
#ifdef YYPREFIX
#undef YYPREFIX
#endif
#define YYPREFIX "mime_"
#endif
#ifndef _NO_LINE_FOLDING
#define _SUPPORT_LINE_FOLDING 1
#endif
/* undef below if compile with MFC */
/* #define INCLUDEMFC 1 */
#if defined(WIN32) || defined(_WIN32)
#ifdef INCLUDEMFC
#include <afx.h>
#endif
#endif
#include <string.h>
#ifndef __MWERKS__
#include <stdlib.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
//#ifdef PALMTOPCENTER
//#include <qpe/vobject_p.h>
//#else
-#include "vobject_p.h"
+#include <qtopia/private/vobject_p.h> //#endif
/**** Types, Constants ****/
#define YYDEBUG 0 /* 1 to compile in some debugging code */
#define MAXTOKEN 256 /* maximum token (line) length */
#define YYSTACKSIZE 100 // ~unref ?
#define MAXLEVEL 10 /* max # of nested objects parseable */
/* (includes outermost) */
/**** Global Variables ****/
int mime_lineNum, mime_numErrors; /* yyerror() can use these */
static VObject* vObjList;
static VObject *curProp;
static VObject *curObj;
static VObject* ObjStack[MAXLEVEL];
static int ObjStackTop;
/* A helpful utility for the rest of the app. */
#if __CPLUSPLUS__
extern "C" {
#endif
extern void yyerror(char *s);
#if __CPLUSPLUS__
};
#endif
int yyparse();
enum LexMode {
L_NORMAL,
L_VCARD,
L_VCAL,
L_VEVENT,
L_VTODO,
L_VALUES,
L_BASE64,
L_QUOTED_PRINTABLE
};
/**** Private Forward Declarations ****/
static int pushVObject(const char *prop);
static VObject* popVObject();
static void lexPopMode(int top);
static int lexWithinMode(enum LexMode mode);
static void lexPushMode(enum LexMode mode);
static void enterProps(const char *s);
static void enterAttr(const char *s1, const char *s2);
static void enterValues(const char *value);
#define mime_error yyerror
void mime_error(char *s);
void mime_error_(char *s);
%}
/***************************************************************************/
/*** The grammar ****/
/***************************************************************************/
%union {
char *str;
VObject *vobj;
}
%token
EQ COLON DOT SEMICOLON SPACE HTAB LINESEP NEWLINE
BEGIN_VCARD END_VCARD BEGIN_VCAL END_VCAL
BEGIN_VEVENT END_VEVENT BEGIN_VTODO END_VTODO
ID
/*
* NEWLINE is the token that would occur outside a vCard,
* while LINESEP is the token that would occur inside a vCard.
*/
%token <str>
STRING ID
%type <str> name value
%type <vobj> vcard vcal vobject
%start mime
%%
mime: vobjects
;
vobjects: vobjects vobject
{ addList(&vObjList, $2); curObj = 0; }
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp index 19a108f..b2b0c14 100644 --- a/library/backend/vcc_yacc.cpp +++ b/library/backend/vcc_yacc.cpp @@ -65,193 +65,193 @@ DAMAGE. EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
The software is provided with RESTRICTED RIGHTS. Use, duplication, or
disclosure by the government are subject to restrictions set forth in
DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
***************************************************************************/
/*
* src: vcc.c
* doc: Parser for vCard and vCalendar. Note that this code is
* generated by a yacc parser generator. Generally it should not
* be edited by hand. The real source is vcc.y. The #line directives
* can be commented out here to make it easier to trace through
* in a debugger. However, if a bug is found it should
* be fixed in vcc.y and this file regenerated.
*/
/* debugging utilities */
#if __DEBUG
#define DBG_(x) printf x
#else
#define DBG_(x)
#endif
/**** External Functions ****/
/* assign local name to parser variables and functions so that
we can use more than one yacc based parser.
*/
#if 0
#define yyparse mime_parse
#define yylex mime_lex
#define yyerror mime_error
#define yychar mime_char
/* #define p_yyval p_mime_val */
#undef yyval
#define yyval mime_yyval
/* #define p_yylval p_mime_lval */
#undef yylval
#define yylval mime_yylval
#define yydebug mime_debug
#define yynerrs mime_nerrs
#define yyerrflag mime_errflag
#define yyss mime_ss
#define yyssp mime_ssp
#define yyvs mime_vs
#define yyvsp mime_vsp
#define yylhs mime_lhs
#define yylen mime_len
#define yydefred mime_defred
#define yydgoto mime_dgoto
#define yysindex mime_sindex
#define yyrindex mime_rindex
#define yygindex mime_gindex
#define yytable mime_table
#define yycheck mime_check
#define yyname mime_name
#define yyrule mime_rule
#ifdef YYPREFIX
#undef YYPREFIX
#endif
#define YYPREFIX "mime_"
#endif
#ifndef _NO_LINE_FOLDING
#define _SUPPORT_LINE_FOLDING 1
#endif
/* undef below if compile with MFC */
/* #define INCLUDEMFC 1 */
#if defined(WIN32) || defined(_WIN32)
#ifdef INCLUDEMFC
#include <afx.h>
#endif
#endif
#include <string.h>
#ifndef __MWERKS__
#include <stdlib.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
/*#ifdef PALMTOPCENTER
*/ /*#include <qpe/vobject_p.h>
*/ /*#else
*/ -#include "vobject_p.h"
+#include <qtopia/private/vobject_p.h> /*#endif
*/ /**** Types, Constants ****/
#define YYDEBUG 0 /* 1 to compile in some debugging code */
#define MAXTOKEN 256 /* maximum token (line) length */
#define YYSTACKSIZE 100 /* ~unref ?
*/ #define MAXLEVEL 10 /* max # of nested objects parseable */
/* (includes outermost) */
/**** Global Variables ****/
int mime_lineNum, mime_numErrors; /* yyerror() can use these */
static VObject* vObjList;
static VObject *curProp;
static VObject *curObj;
static VObject* ObjStack[MAXLEVEL];
static int ObjStackTop;
/* A helpful utility for the rest of the app. */
#if __CPLUSPLUS__
extern "C" {
#endif
extern void yyerror(char *s);
#if __CPLUSPLUS__
};
#endif
int yyparse();
enum LexMode {
L_NORMAL,
L_VCARD,
L_VCAL,
L_VEVENT,
L_VTODO,
L_VALUES,
L_BASE64,
L_QUOTED_PRINTABLE
};
/**** Private Forward Declarations ****/
static int pushVObject(const char *prop);
static VObject* popVObject();
static void lexPopMode(int top);
static int lexWithinMode(enum LexMode mode);
static void lexPushMode(enum LexMode mode);
static void enterProps(const char *s);
static void enterAttr(const char *s1, const char *s2);
static void enterValues(const char *value);
#define mime_error yyerror
void mime_error(char *s);
void mime_error_(char *s);
#line 189 "backend/vcc.y" typedef union {
char *str;
VObject *vobj;
} YYSTYPE; #line 225 "y.tab.c" #define EQ 257 #define COLON 258 #define DOT 259 #define SEMICOLON 260 #define SPACE 261 #define HTAB 262 #define LINESEP 263 #define NEWLINE 264 #define BEGIN_VCARD 265 #define END_VCARD 266 #define BEGIN_VCAL 267 #define END_VCAL 268 #define BEGIN_VEVENT 269 #define END_VEVENT 270 #define BEGIN_VTODO 271 #define END_VTODO 272 #define ID 273 #define STRING 274 #define YYERRCODE 256 short vcclhs[] = { -1, 0, 6, 6, 5, 5, 8, 3, 9, 3, 7, 7, 13, 10, 10, 15, 11, 11, 14, 14, 16, 17, 17, 1, 18, 12, 12, 2, 2, 20, 4, 21, 4, 19, 19, 22, 22, 22, 25, 23, 26, 23, 27, 24, 28, 24, }; short vcclen[] = { 2, 1, 2, 1, 1, 1, 0, 4, 0, 3, 2, 1, 0, 5, 1, 0, 3, 1, 2, 1, 2, 1, 3, 1, 0, 4, 1, 1, 0, 0, 4, 0, 3, 2, 1, 1, 1, 1, 0, 4, 0, 3, 0, 4, 0, 3, }; diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp index e6f6b78..dab128e 100644 --- a/library/backend/vobject.cpp +++ b/library/backend/vobject.cpp @@ -1,146 +1,146 @@ /*************************************************************************** (C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International Business Machines Corporation and Siemens Rolm Communications Inc. For purposes of this license notice, the term Licensors shall mean, collectively, Apple Computer, Inc., AT&T Corp., International Business Machines Corporation and Siemens Rolm Communications Inc. The term Licensor shall mean any of the Licensors. Subject to acceptance of the following conditions, permission is hereby granted by Licensors without the need for written agreement and without license or royalty fees, to use, copy, modify and distribute this software for any purpose. The above copyright notice and the following four paragraphs must be reproduced in all copies of this software and any software including this software. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS. IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The software is provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the government are subject to restrictions set forth in DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. ***************************************************************************/ /* * src: vobject.c * doc: vobject and APIs to construct vobject, APIs pretty print * vobject, and convert a vobject into its textual representation. */ #ifndef MWERKS #include <malloc.h> #endif -#include "vobject_p.h" -#include "qfiledirect_p.h" +#include <qtopia/private/vobject_p.h> +#include <qtopia/private/qfiledirect_p.h> #include <string.h> #include <stdio.h> #include <fcntl.h> //#include <io.h> #define NAME_OF(o) o->id #define VALUE_TYPE(o) o->valType #define STRINGZ_VALUE_OF(o) o->val.strs #define INTEGER_VALUE_OF(o) o->val.i #define LONG_VALUE_OF(o) o->val.l #define ANY_VALUE_OF(o) o->val.any #define VOBJECT_VALUE_OF(o) o->val.vobj typedef union ValueItem { const char *strs; unsigned int i; unsigned long l; void *any; VObject *vobj; } ValueItem; struct VObject { VObject *next; const char *id; VObject *prop; unsigned short valType; ValueItem val; }; typedef struct StrItem StrItem; struct StrItem { StrItem *next; const char *s; unsigned int refCnt; }; const char** fieldedProp; /*---------------------------------------------------------------------- The following functions involve with memory allocation: newVObject deleteVObject dupStr deleteStr newStrItem deleteStrItem ----------------------------------------------------------------------*/ DLLEXPORT(VObject*) newVObject_(const char *id) { VObject *p = (VObject*)malloc(sizeof(VObject)); p->next = 0; p->id = id; p->prop = 0; VALUE_TYPE(p) = 0; ANY_VALUE_OF(p) = 0; return p; } DLLEXPORT(VObject*) newVObject(const char *id) { return newVObject_(lookupStr(id)); } DLLEXPORT(void) deleteVObject(VObject *p) { unUseStr(p->id); free(p); } DLLEXPORT(char*) dupStr(const char *s, unsigned int size) { char *t; if (size == 0) { size = strlen(s); } t = (char*)malloc(size+1); if (t) { memcpy(t,s,size); t[size] = 0; return t; } else { return (char*)0; } } DLLEXPORT(void) deleteStr(const char *p) { if (p) free((void*)p); } diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp index 272c223..4a9dcbd 100644 --- a/library/datebookmonth.cpp +++ b/library/datebookmonth.cpp @@ -1,121 +1,121 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "config.h" #include "datebookmonth.h" #include "datebookdb.h" #include <qtopia/private/event.h> #include "resource.h" -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "timestring.h" #include <qtoolbutton.h> #include <qspinbox.h> #include <qcombobox.h> #include <qdatetime.h> #include <qpainter.h> #include <qpopupmenu.h> #include <qvaluestack.h> #include <qwhatsthis.h> DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name ) : QHBox( parent, name ) { setBackgroundMode( PaletteButton ); begin = new QToolButton( this ); begin->setFocusPolicy(NoFocus); begin->setPixmap( Resource::loadPixmap( "start" ) ); begin->setAutoRaise( TRUE ); begin->setFixedSize( begin->sizeHint() ); QWhatsThis::add( begin, tr("Show January in the selected year") ); back = new QToolButton( this ); back->setFocusPolicy(NoFocus); back->setPixmap( Resource::loadPixmap( "back" ) ); back->setAutoRaise( TRUE ); back->setFixedSize( back->sizeHint() ); QWhatsThis::add( back, tr("Show the previous month") ); month = new QComboBox( FALSE, this ); for ( int i = 0; i < 12; ++i ) month->insertItem( Calendar::nameOfMonth( i + 1 ) ); year = new QSpinBox( 1752, 8000, 1, this ); next = new QToolButton( this ); next->setFocusPolicy(NoFocus); next->setPixmap( Resource::loadPixmap( "forward" ) ); next->setAutoRaise( TRUE ); next->setFixedSize( next->sizeHint() ); QWhatsThis::add( next, tr("Show the next month") ); end = new QToolButton( this ); end->setFocusPolicy(NoFocus); end->setPixmap( Resource::loadPixmap( "finish" ) ); end->setAutoRaise( TRUE ); end->setFixedSize( end->sizeHint() ); QWhatsThis::add( end, tr("Show December in the selected year") ); connect( month, SIGNAL( activated( int ) ), this, SLOT( updateDate() ) ); connect( year, SIGNAL( valueChanged( int ) ), this, SLOT( updateDate() ) ); connect( begin, SIGNAL( clicked() ), this, SLOT( firstMonth() ) ); connect( end, SIGNAL( clicked() ), this, SLOT( lastMonth() ) ); connect( back, SIGNAL( clicked() ), this, SLOT( monthBack() ) ); connect( next, SIGNAL( clicked() ), this, SLOT( monthForward() ) ); back->setAutoRepeat( TRUE ); next->setAutoRepeat( TRUE ); } DateBookMonthHeader::~DateBookMonthHeader() { } void DateBookMonthHeader::updateDate() { emit dateChanged( year->value(), month->currentItem() + 1 ); } void DateBookMonthHeader::firstMonth() { emit dateChanged( year->value(), 1 ); month->setCurrentItem( 0 ); } void DateBookMonthHeader::lastMonth() { emit dateChanged( year->value(), 12 ); month->setCurrentItem( 11 ); } void DateBookMonthHeader::monthBack() { if ( month->currentItem() > 0 ) { emit dateChanged( year->value(), month->currentItem() ); month->setCurrentItem( month->currentItem() - 1 ); } else { diff --git a/library/fileselector.cpp b/library/fileselector.cpp index 7ff09b4..052a29e 100644 --- a/library/fileselector.cpp +++ b/library/fileselector.cpp @@ -1,138 +1,138 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ // WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT // have this class. #define QTOPIA_INTERNAL_FSLP #include "fileselector.h" #include "fileselector_p.h" #include "global.h" #include "resource.h" #include "config.h" #include "applnk.h" #include "storage.h" #include "qpemenubar.h" #ifdef QWS -#include "qcopchannel_qws.h" +#include <qcopchannel_qws.h> #endif #include "lnkproperties.h" #include "applnk.h" -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "categorymenu.h" #include "categoryselect.h" #include "mimetype.h" -#include "categories.h" +#include <qpe/categories.h> #include <stdlib.h> #include <qdir.h> #include <qwidget.h> #include <qpopupmenu.h> #include <qtoolbutton.h> #include <qpushbutton.h> #include <qheader.h> #include <qtooltip.h> #include <qwhatsthis.h> class TypeCombo : public QComboBox { Q_OBJECT public: TypeCombo( QWidget *parent, const char *name=0 ) : QComboBox( parent, name ) { connect( this, SIGNAL(activated(int)), this, SLOT(selectType(int)) ); } void reread( DocLnkSet &files, const QString &filter ); signals: void selected( const QString & ); protected slots: void selectType( int idx ) { emit selected( typelist[idx] ); } protected: QStringList typelist; QString prev; }; void TypeCombo::reread( DocLnkSet &files, const QString &filter ) { typelist.clear(); QStringList filters = QStringList::split( ';', filter ); int pos = filter.find( '/' ); //### do for each filter if ( filters.count() == 1 && pos >= 0 && filter[pos+1] != '*' ) { typelist.append( filter ); clear(); QString minor = filter.mid( pos+1 ); minor[0] = minor[0].upper(); insertItem( tr("%1 files").arg(minor) ); setCurrentItem(0); setEnabled( FALSE ); return; } QListIterator<DocLnk> dit( files.children() ); for ( ; dit.current(); ++dit ) { if ( !typelist.contains( (*dit)->type() ) ) typelist.append( (*dit)->type() ); } QStringList types; QStringList::ConstIterator it; for (it = typelist.begin(); it!=typelist.end(); ++it) { QString t = *it; if ( t.left(12) == "application/" ) { MimeType mt(t); const AppLnk* app = mt.application(); if ( app ) t = app->name(); else t = t.mid(12); } else { QString major, minor; int pos = t.find( '/' ); if ( pos >= 0 ) { major = t.left( pos ); minor = t.mid( pos+1 ); } if ( minor.find( "x-" ) == 0 ) minor = minor.mid( 2 ); minor[0] = minor[0].upper(); major[0] = major[0].upper(); if ( filters.count() > 1 ) t = tr("%1 %2", "minor mimetype / major mimetype").arg(minor).arg(major); else t = minor; } types += tr("%1 files").arg(t); } for (it = filters.begin(); it!=filters.end(); ++it) { typelist.append( *it ); int pos = (*it).find( '/' ); if ( pos >= 0 ) { QString maj = (*it).left( pos ); maj[0] = maj[0].upper(); types << tr("All %1 files").arg(maj); diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp index c64e645..2b5e0d2 100644 --- a/library/fontdatabase.cpp +++ b/library/fontdatabase.cpp @@ -1,117 +1,117 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "fontfactoryinterface.h" #include "fontdatabase.h" #include <qpe/qlibrary.h> #ifdef QWS #include <qfontmanager_qws.h> #endif #include <qdir.h> #include <qdict.h> #include <stdio.h> #include <stdlib.h> static QString fontDir() { QString qtdir = getenv("QTDIR"); if ( qtdir.isEmpty() ) qtdir = "/usr/local/qt-embedded"; return qtdir+"/lib/fonts/"; } #ifdef QT_NO_FONTDATABASE static QString fontFamily( const QString& key ) { int u0 = key.find('_'); int u1 = key.find('_',u0+1); int u2 = key.find('_',u1+1); QString family = key.left(u0); //int pointSize = key.mid(u0+1,u1-u0-1).toInt(); //int weight = key.mid(u1+1,u2-u1-1).toInt(); //bool italic = key.mid(u2-1,1) == "i"; // #### ignores _t and _I fields return family; } #endif QValueList<FontFactory> *FontDatabase::factoryList = 0; /*! \class FontDatabase fontdatabase.h \brief The FontDatabase class provides information about available fonts. Most often you will simply want to query the database for the available font families(). Use FontDatabase rather than QFontDatabase when you may need access to fonts that are not normally available. For example, if the freetype library and the Qtopia freetype plugin are installed, TrueType fonts will be available to your application. Font renderer plugins have greater resource requirements than system fonts so they should be used only when necessary. You can force the loading of font renderer plugins with loadRenderers(). \ingroup qtopiaemb */ /*! Constructs a FontDatabase object. */ FontDatabase::FontDatabase() #ifndef QT_NO_FONTDATABASE : QFontDatabase() #endif { if ( !factoryList ) loadRenderers(); } /*! Returns a list of names of all the available font families. */ QStringList FontDatabase::families() const { #ifndef QT_NO_FONTDATABASE return QFontDatabase::families(); #else QStringList list; QDict<void> familyDict; QDiskFont *qdf; for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0; qdf=qt_fontmanager->diskfonts.next()) { QString familyname = qdf->name; if ( !familyDict.find( familyname ) ) { familyDict.insert( familyname, (void *)1 ); list.append( familyname ); } } QDir dir(fontDir(),"*.qpf"); for (int i=0; i<(int)dir.count(); i++) { QString familyname = fontFamily(dir[i]); if ( !familyDict.find( familyname ) ) { familyDict.insert( familyname, (void *)1 ); list.append( familyname ); } } diff --git a/library/fontdatabase.h b/library/fontdatabase.h index 10aec91..991847b 100644 --- a/library/fontdatabase.h +++ b/library/fontdatabase.h @@ -1,62 +1,63 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef FONTFACTORY_H #define FONTFACTORY_H #include <qpe/fontfactoryinterface.h> #include <qfontdatabase.h> #include <qvaluelist.h> class QLibrary; struct FontFactory { #ifndef QT_NO_COMPONENT QLibrary *library; #endif FontFactoryInterface *interface; QFontFactory *factory; }; +#undef QT_NO_FONTDATABASE class FontDatabase #ifndef QT_NO_FONTDATABASE : public QFontDatabase #endif { public: FontDatabase(); // minimal functionality QStringList families () const; #ifdef QT_NO_FONTDATABASE static QValueList<int> standardSizes (); #endif static void loadRenderers(); private: static void readFonts( QFontFactory *factory ); private: static QValueList<FontFactory> *factoryList; }; #endif diff --git a/library/mimetype.cpp b/library/mimetype.cpp index 92fe5e6..ef5d619 100644 --- a/library/mimetype.cpp +++ b/library/mimetype.cpp @@ -1,121 +1,121 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #define QTOPIA_INTERNAL_MIMEEXT #include "mimetype.h" #include "applnk.h" #include "resource.h" -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "config.h" #include <qfile.h> #include <qdict.h> #include <qregexp.h> #include <qstringlist.h> #include <qtextstream.h> #include <qmap.h> static void cleanupMime() { MimeType::clear(); } class MimeTypeData { public: MimeTypeData(const QString& i) : id(i) { apps.setAutoDelete(TRUE); } QString id; QString extension; QList<AppLnk> apps; QString description() { if ( desc.isEmpty() ) desc = QPEApplication::tr("%1 document").arg(apps.first()->name()); return desc; } QPixmap regIcon() { if ( regicon.isNull() ) loadPixmaps(); return regicon; } QPixmap bigIcon() { if ( bigicon.isNull() ) loadPixmaps(); return bigicon; } private: void loadPixmaps() { if ( apps.count() ) { QString icon; for (AppLnk* lnk = apps.first(); icon.isNull() && lnk; lnk=apps.next()) { QStringList icons = lnk->mimeTypeIcons(); if ( icons.count() ) { QStringList types = lnk->mimeTypes(); for (QStringList::ConstIterator t=types.begin(),i=icons.begin(); t!=types.end() && i!=icons.end(); ++i,++t) { if ( *t == id ) { icon = *i; break; } } } } if ( icon.isNull() ) { AppLnk* lnk = apps.first(); regicon = lnk->pixmap(); bigicon = lnk->bigPixmap(); } else { QImage unscaledIcon = Resource::loadImage( icon ); regicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); bigicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ) ); } } } QPixmap regicon; QPixmap bigicon; QString desc; }; class MimeType::Private : public QDict<MimeTypeData> { public: Private() {} ~Private() {} // ... }; MimeType::Private* MimeType::d=0; static QMap<QString,QString> *typeFor = 0; static QMap<QString,QStringList> *extFor = 0; MimeType::Private& MimeType::data() { if ( !d ) { diff --git a/library/qpedialog.cpp b/library/qpedialog.cpp index 0db161b..b98e42e 100644 --- a/library/qpedialog.cpp +++ b/library/qpedialog.cpp @@ -1,46 +1,46 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #define protected public #include <qdialog.h> #undef protected #include "qpedialog.h" -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> QPEDialogListener::QPEDialogListener(QDialog *di ) : QObject(di) { dialog = di; connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), this, SLOT(appMessage(const QCString&, const QByteArray&)) ); } QPEDialogListener::~QPEDialogListener() {} void QPEDialogListener::appMessage( const QCString &msg, const QByteArray & ) { if (!dialog) return; if (msg == "accept()") { dialog->accept(); } else if (msg == "reject()") { dialog->reject(); } } diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp index dfd300f..665910c 100644 --- a/library/qpestyle.cpp +++ b/library/qpestyle.cpp @@ -1,118 +1,118 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qpestyle.h" -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include <qpushbutton.h> #include <qpainter.h> #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) #if QT_VERSION >= 300 #include <qdrawutil.h> #include <qcombobox.h> #include <qtabbar.h> QPEStyle::QPEStyle() { } QPEStyle::~QPEStyle() { } void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, const QStyleOption &data) const { switch ( pe ) { case PE_ButtonTool: { QColorGroup mycg = cg; if ( flags & Style_On ) { QBrush fill( cg.mid(), Dense4Pattern ); mycg.setBrush( QColorGroup::Button, fill ); } drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data ); break; } case PE_ButtonCommand: case PE_ButtonDefault: case PE_ButtonBevel: case PE_HeaderSection: { QPen oldPen = p->pen(); p->fillRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2, cg.brush(QColorGroup::Button) ); int x2 = r.right(); int y2 = r.bottom(); if ( flags & (Style_Sunken | Style_Down | Style_On) ) p->setPen( cg.dark() ); else p->setPen( cg.light() ); p->drawLine( r.x(), r.y()+1, r.x(), y2-1 ); p->drawLine( r.x()+1, r.y(), x2-1, r.y() ); if ( flags & (Style_Sunken | Style_Down | Style_On) ) p->setPen( cg.light() ); else p->setPen( cg.dark() ); p->drawLine( x2, r.y()+1, x2, y2-1 ); p->drawLine( r.x()+1, y2, x2-1, y2 ); p->setPen( oldPen ); break; } case PE_FocusRect: break; case PE_Indicator: { QColorGroup mycg( cg ); QBrush fill; if ( flags & Style_Down ) fill = cg.brush( QColorGroup::Button ); else fill = cg.brush( (flags&Style_Enabled) ? QColorGroup::Base : QColorGroup::Background ); mycg.setBrush( QColorGroup::Button, fill ); if ( flags&Style_Enabled ) flags |= Style_Sunken; drawPrimitive( PE_ButtonBevel, p, r, mycg, flags ); if ( flags & Style_On ) { QPointArray a( 7*2 ); int i, xx, yy; xx = r.x()+3; yy = r.y()+5; for ( i=0; i<3; i++ ) { a.setPoint( 2*i, xx, yy ); a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy++; } yy -= 2; for ( i=3; i<7; i++ ) { a.setPoint( 2*i, xx, yy ); a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy--; } if ( flags & Style_NoChange ) { p->setPen( mycg.dark() ); } else { p->setPen( mycg.text() ); } diff --git a/library/resource.cpp b/library/resource.cpp index bdcd603..0920b67 100644 --- a/library/resource.cpp +++ b/library/resource.cpp @@ -1,118 +1,118 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #define QTOPIA_INTERNAL_MIMEEXT -#include "qpeapplication.h" +#include <qpe/qpeapplication.h> #include "resource.h" #include "mimetype.h" #include <qdir.h> #include <qfile.h> #include <qregexp.h> #include <qpixmapcache.h> #include <qpainter.h> // this namespace is just a workaround for a gcc bug // gcc exports inline functions in the generated file // inlinepics_p.h namespace { #include "inlinepics_p.h" } /*! \class Resource resource.h \brief The Resource class provides access to named resources. The resources may be provided from files or other sources. The allSounds() function returns a list of all the sounds available. A particular sound can be searched for using findSound(). Images can be loaded with loadImage(), loadPixmap(), loadBitmap() and loadIconSet(). \ingroup qtopiaemb */ /*! \fn Resource::Resource() \internal */ /*! Returns the QPixmap called \a pix. You should avoid including any filename type extension (e.g. .png, .xpm). */ QPixmap Resource::loadPixmap( const QString &pix ) { QPixmap pm; QString key="QPE_"+pix; if ( !QPixmapCache::find(key,pm) ) { pm.convertFromImage(loadImage(pix)); QPixmapCache::insert(key,pm); } return pm; } /*! Returns the QBitmap called \a pix. You should avoid including any filename type extension (e.g. .png, .xpm). */ QBitmap Resource::loadBitmap( const QString &pix ) { QBitmap bm; bm = loadPixmap(pix); return bm; } /*! Returns the filename of a pixmap called \a pix. You should avoid including any filename type extension (e.g. .png, .xpm). Normally you will use loadPixmap() rather than this function. */ QString Resource::findPixmap( const QString &pix ) { QString picsPath = QPEApplication::qpeDir() + "pics/"; QString f; // Common case optimizations... f = picsPath + pix + ".png"; if ( QFile( f ).exists() ) return f; f = picsPath + pix + ".xpm"; if ( QFile( f ).exists() ) return f; // All formats... QStrList fileFormats = QImageIO::inputFormats(); QString ff = fileFormats.first(); while ( fileFormats.current() ) { QStringList exts = MimeType("image/"+ff.lower()).extensions(); for ( QStringList::ConstIterator it = exts.begin(); it!=exts.end(); ++it ) { QString f = picsPath + pix + "." + *it; if ( QFile(f).exists() ) return f; } ff = fileFormats.next(); } // Finally, no (or existing) extension... diff --git a/library/timestring.cpp b/library/timestring.cpp index 4c6fa72..6443b6b 100644 --- a/library/timestring.cpp +++ b/library/timestring.cpp @@ -1,119 +1,119 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "timestring.h" #include <qobject.h> -#include "qpeapplication.h" //for qApp +#include <qpe/qpeapplication.h> //for qApp #include "config.h" class TimeStringFormatKeeper : public QObject { Q_OBJECT public: static DateFormat currentFormat() { if ( !self ) self = new TimeStringFormatKeeper; return self->format; } private slots: void formatChanged( DateFormat f ) { format = f; } private: static TimeStringFormatKeeper *self; DateFormat format; TimeStringFormatKeeper() : QObject( qApp ) { Config config("qpe"); config.setGroup( "Date" ); format = DateFormat(QChar(config.readEntry("Separator", "/")[0]), (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear), (DateFormat::Order)config.readNumEntry("LongOrder", DateFormat::DayMonthYear)); connect( qApp, SIGNAL( dateFormatChanged(DateFormat) ), this, SLOT( formatChanged( DateFormat ) ) ); } }; TimeStringFormatKeeper *TimeStringFormatKeeper::self = 0; QString DateFormat::toNumberString() const { QString buf = ""; // for each part of the order for (int i = 0; i < 3; i++) { // switch on the relavent 3 bits. switch((_shortOrder >> (i * 3)) & 0x0007) { case 0x0001: buf += QObject::tr( "D" ); break; case 0x0002: buf += QObject::tr( "M" ); break; case 0x0004: buf += QObject::tr( "Y" ); break; } if (i < 2) buf += _shortSeparator; } return buf; } QString DateFormat::toWordString() const { QString buf = ""; // for each part of the order for (int i = 0; i < 3; i++) { // switch on the relavent 3 bits. switch((_longOrder >> (i * 3)) & 0x0007) { case 0x0001: buf += QObject::tr( "day" ); if (i < 2) { if ((_shortOrder << ((i+1) * 3)) & 0x0007) buf += ", "; else buf += " "; } break; case 0x0002: buf += QObject::tr( "month" ); if (i < 2) buf += " "; break; case 0x0004: buf += QObject::tr( "year" ); if (i < 2) buf += ", "; break; } } return buf; } QString DateFormat::numberDate(const QDate &d, int v) const { QString buf = ""; |