96 files changed, 1386 insertions, 528 deletions
diff --git a/noncore/applets/networkapplet/opie-networkapplet.control b/noncore/applets/networkapplet/opie-networkapplet.control index ae07eb3..f4ee7be 100644 --- a/noncore/applets/networkapplet/opie-networkapplet.control +++ b/noncore/applets/networkapplet/opie-networkapplet.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-networkapplet | 1 | Package: opie-networkapplet |
2 | Files: plugins/applets/libnetworkapplet.so* pics/networkapplet | 2 | Files: plugins/applets/libnetworkapplet.so* pics/networkapplet |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> | 5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, libopie2 (1.8.1), opie-networksettings | 7 | Depends: task-opie-minimal, libopie2 (1.8.1), opie-networksettings |
9 | Description: Network Applet | 8 | Description: Network Applet |
10 | A taskbar applet for controlling network interfaces | 9 | A taskbar applet for controlling network interfaces |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/applets/notesapplet/opie-notesapplet.control b/noncore/applets/notesapplet/opie-notesapplet.control index da02b44..f19b964 100644 --- a/noncore/applets/notesapplet/opie-notesapplet.control +++ b/noncore/applets/notesapplet/opie-notesapplet.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-notesapplet | 1 | Package: opie-notesapplet |
2 | Files: plugins/applets/libnotesapplet.so* | 2 | Files: plugins/applets/libnotesapplet.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: L. J. Potter <ljp@llornkcor.com> | 5 | Maintainer: L. J. Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Screenshot Applet | 8 | Description: Notes Applet |
10 | A simple taskbar applet for making quick notes. | 9 | A simple taskbar applet for making quick notes. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/applets/wirelessapplet/opie-wirelessapplet.control b/noncore/applets/wirelessapplet/opie-wirelessapplet.control index ac7fad2..6dfa214 100644 --- a/noncore/applets/wirelessapplet/opie-wirelessapplet.control +++ b/noncore/applets/wirelessapplet/opie-wirelessapplet.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-wirelessapplet | 1 | Package: opie-wirelessapplet |
2 | Files: plugins/applets/libwirelessapplet.so* | 2 | Files: plugins/applets/libwirelessapplet.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 5 | Maintainer: Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Wireless Applet | 8 | Description: Wireless Applet |
10 | A wireless network card status taskbar applet for the Opie environment | 9 | A wireless network card status taskbar applet for the Opie environment |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 400298d..2103df9 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp | |||
@@ -26,46 +26,36 @@ | |||
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlistview.h> | 27 | #include <qlistview.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qstringlist.h> | 30 | #include <qstringlist.h> |
31 | 31 | ||
32 | #include <opie/otabwidget.h> | ||
33 | |||
34 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) | 32 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) |
35 | { | 33 | { |
36 | setCaption( tr( "Options" ) ); | 34 | setCaption( tr( "Options" ) ); |
37 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); | 35 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); |
38 | tab = new OTabWidget( this, "OTabWidget_tab", OTabWidget::Global, OTabWidget::Bottom ); | 36 | search_tab = new QWidget( this , "search_tab" ); |
39 | vbox_layout->addWidget( tab ); | ||
40 | |||
41 | /*general settings*/ | ||
42 | settings_tab = new QWidget( tab , "settings_tab" ); | ||
43 | |||
44 | /*searchmethods*/ | ||
45 | search_tab = new QWidget( tab , "search_tab" ); | ||
46 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); | 37 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); |
47 | 38 | ||
48 | QHBox *hbox = new QHBox( search_tab ); | 39 | QHBox *hbox = new QHBox( search_tab ); |
49 | list = new QListView( hbox ); | 40 | list = new QListView( hbox ); |
50 | list->addColumn( tr( "Searchmethod" ) ); | 41 | list->addColumn( tr( "Searchmethod" ) ); |
51 | loadSearchMethodNames(); | 42 | loadSearchMethodNames(); |
52 | 43 | ||
53 | QVBox *vbox = new QVBox( hbox ); | 44 | QVBox *vbox = new QVBox( hbox ); |
54 | new_button = new QPushButton( "New" , vbox ); | 45 | new_button = new QPushButton( tr( "New" ) , vbox ); |
55 | change_button = new QPushButton( "Change" , vbox ); | 46 | change_button = new QPushButton( tr( "Change" ) , vbox ); |
56 | delete_button = new QPushButton( "Delete" , vbox ); | 47 | delete_button = new QPushButton( tr( "Delete" ) , vbox ); |
57 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); | 48 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); |
58 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); | 49 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); |
59 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); | 50 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); |
60 | 51 | ||
61 | vbox_layout_searchtab->addWidget( hbox ); | 52 | vbox_layout_searchtab->addWidget( hbox ); |
62 | 53 | ||
63 | /*add the tabs and maximize*/ | 54 | vbox_layout->addWidget( search_tab ); |
64 | tab->addTab( settings_tab, "pass", tr( "General Settings" ) ); | 55 | |
65 | tab->addTab( search_tab, "zoom", tr( "Searchmethods" ) ); | ||
66 | showMaximized(); | 56 | showMaximized(); |
67 | } | 57 | } |
68 | 58 | ||
69 | void ConfigDlg::slotNewMethod() | 59 | void ConfigDlg::slotNewMethod() |
70 | { | 60 | { |
71 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); | 61 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); |
diff --git a/noncore/apps/odict/configdlg.h b/noncore/apps/odict/configdlg.h index e3ef3ce..6c85989 100644 --- a/noncore/apps/odict/configdlg.h +++ b/noncore/apps/odict/configdlg.h | |||
@@ -5,13 +5,12 @@ | |||
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | class QWidget; | 10 | class QWidget; |
11 | class OTabWidget; | ||
12 | class QListView; | 11 | class QListView; |
13 | class QPushButton; | 12 | class QPushButton; |
14 | 13 | ||
15 | #include <qdialog.h> | 14 | #include <qdialog.h> |
16 | 15 | ||
17 | class ConfigDlg : public QDialog | 16 | class ConfigDlg : public QDialog |
@@ -19,13 +18,12 @@ class ConfigDlg : public QDialog | |||
19 | Q_OBJECT | 18 | Q_OBJECT |
20 | 19 | ||
21 | public: | 20 | public: |
22 | ConfigDlg(QWidget *parent, const char *name, bool modal=FALSE ); | 21 | ConfigDlg(QWidget *parent, const char *name, bool modal=FALSE ); |
23 | 22 | ||
24 | private: | 23 | private: |
25 | OTabWidget *tab; | ||
26 | QWidget *settings_tab, *search_tab; | 24 | QWidget *settings_tab, *search_tab; |
27 | QListView *list; | 25 | QListView *list; |
28 | QPushButton *new_button, *change_button, *delete_button; | 26 | QPushButton *new_button, *change_button, *delete_button; |
29 | 27 | ||
30 | void loadSearchMethodNames(); | 28 | void loadSearchMethodNames(); |
31 | 29 | ||
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index 2028701..010545e 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -38,13 +38,13 @@ | |||
38 | 38 | ||
39 | ODict::ODict() : QMainWindow() | 39 | ODict::ODict() : QMainWindow() |
40 | { | 40 | { |
41 | activated_name = QString::null; | 41 | activated_name = QString::null; |
42 | 42 | ||
43 | vbox = new QVBox( this ); | 43 | vbox = new QVBox( this ); |
44 | setCaption( tr( "OPIE-Dictionary" ) ); | 44 | setCaption( tr( "Opie-Dictionary" ) ); |
45 | setupMenus(); | 45 | setupMenus(); |
46 | 46 | ||
47 | QHBox *hbox = new QHBox( vbox ); | 47 | QHBox *hbox = new QHBox( vbox ); |
48 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); | 48 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); |
49 | query_label->show(); | 49 | query_label->show(); |
50 | query_le = new QLineEdit( hbox ); | 50 | query_le = new QLineEdit( hbox ); |
@@ -73,13 +73,12 @@ void ODict::loadConfig() | |||
73 | */ | 73 | */ |
74 | QString lastname; | 74 | QString lastname; |
75 | 75 | ||
76 | Config cfg ( "odict" ); | 76 | Config cfg ( "odict" ); |
77 | cfg.setGroup( "generalsettings" ); | 77 | cfg.setGroup( "generalsettings" ); |
78 | casesens = cfg.readEntry( "casesens" ).toInt(); | 78 | casesens = cfg.readEntry( "casesens" ).toInt(); |
79 | regexp = cfg.readEntry( "regexp" ).toInt(); | ||
80 | 79 | ||
81 | QString lastDict = cfg.readEntry( "lastdict" ); | 80 | QString lastDict = cfg.readEntry( "lastdict" ); |
82 | int i = 0, e = 0; | 81 | int i = 0, e = 0; |
83 | 82 | ||
84 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); | 83 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); |
85 | query_co->clear(); | 84 | query_co->clear(); |
@@ -124,13 +123,12 @@ void ODict::lookupLanguageNames( QString dictname ) | |||
124 | 123 | ||
125 | void ODict::saveConfig() | 124 | void ODict::saveConfig() |
126 | { | 125 | { |
127 | Config cfg ( "odict" ); | 126 | Config cfg ( "odict" ); |
128 | cfg.setGroup( "generalsettings" ); | 127 | cfg.setGroup( "generalsettings" ); |
129 | cfg.writeEntry( "casesens" , casesens ); | 128 | cfg.writeEntry( "casesens" , casesens ); |
130 | cfg.writeEntry( "regexp" , regexp ); | ||
131 | cfg.writeEntry( "lastdict" , query_co->currentText() ); | 129 | cfg.writeEntry( "lastdict" , query_co->currentText() ); |
132 | } | 130 | } |
133 | 131 | ||
134 | void ODict::slotStartQuery() | 132 | void ODict::slotStartQuery() |
135 | { | 133 | { |
136 | QString querystring = query_le->text(); | 134 | QString querystring = query_le->text(); |
@@ -182,19 +180,12 @@ void ODict::slotSetParameter( int count ) | |||
182 | if ( casesens ) | 180 | if ( casesens ) |
183 | casesens = false; | 181 | casesens = false; |
184 | else | 182 | else |
185 | casesens = true; | 183 | casesens = true; |
186 | } | 184 | } |
187 | 185 | ||
188 | if ( count == 1 ) | ||
189 | { | ||
190 | if ( regexp ) | ||
191 | regexp = false; | ||
192 | else | ||
193 | regexp = true; | ||
194 | } | ||
195 | saveConfig(); | 186 | saveConfig(); |
196 | } | 187 | } |
197 | 188 | ||
198 | void ODict::slotMethodChanged( const QString& methodnumber ) | 189 | void ODict::slotMethodChanged( const QString& methodnumber ) |
199 | { | 190 | { |
200 | activated_name = methodnumber; | 191 | activated_name = methodnumber; |
@@ -219,12 +210,11 @@ void ODict::setupMenus() | |||
219 | setting_a->addTo( settings ); | 210 | setting_a->addTo( settings ); |
220 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); | 211 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); |
221 | 212 | ||
222 | parameter = new QPopupMenu( menu ); | 213 | parameter = new QPopupMenu( menu ); |
223 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); | 214 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); |
224 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); | 215 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); |
225 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); | ||
226 | parameter->insertSeparator(); | 216 | parameter->insertSeparator(); |
227 | 217 | ||
228 | menu->insertItem( tr( "Settings" ) , settings ); | 218 | menu->insertItem( tr( "Settings" ) , settings ); |
229 | menu->insertItem( tr( "Parameter" ) , parameter ); | 219 | menu->insertItem( tr( "Parameter" ) , parameter ); |
230 | } | 220 | } |
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h index 9c037ea..be2a532 100644 --- a/noncore/apps/odict/odict.h +++ b/noncore/apps/odict/odict.h | |||
@@ -46,13 +46,13 @@ class ODict : public QMainWindow | |||
46 | QVBoxLayout *vbox_layout; | 46 | QVBoxLayout *vbox_layout; |
47 | 47 | ||
48 | QAction *setting_a, *setting_b; | 48 | QAction *setting_a, *setting_b; |
49 | 49 | ||
50 | void setupMenus(); | 50 | void setupMenus(); |
51 | 51 | ||
52 | bool casesens, completewords, regexp; | 52 | bool casesens, completewords; |
53 | 53 | ||
54 | void loadConfig(); | 54 | void loadConfig(); |
55 | void saveConfig(); | 55 | void saveConfig(); |
56 | 56 | ||
57 | QString activated_name; | 57 | QString activated_name; |
58 | QLabel *bottom_name, | 58 | QLabel *bottom_name, |
diff --git a/noncore/apps/odict/odict.pro b/noncore/apps/odict/odict.pro index 427a5c6..82f6a41 100644 --- a/noncore/apps/odict/odict.pro +++ b/noncore/apps/odict/odict.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | HEADERS = odict.h \ | 4 | HEADERS = odict.h \ |
5 | searchmethoddlg.h \ | 5 | searchmethoddlg.h \ |
6 | configdlg.h \ | 6 | configdlg.h \ |
7 | dingwidget.h \ | 7 | dingwidget.h |
8 | 8 | ||
9 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
10 | odict.cpp \ | 10 | odict.cpp \ |
11 | searchmethoddlg.cpp \ | 11 | searchmethoddlg.cpp \ |
12 | configdlg.cpp \ | 12 | configdlg.cpp \ |
13 | dingwidget.cpp | 13 | dingwidget.cpp |
diff --git a/noncore/apps/odict/opie-odict.control b/noncore/apps/odict/opie-odict.control index 2fa731f..f684716 100644 --- a/noncore/apps/odict/opie-odict.control +++ b/noncore/apps/odict/opie-odict.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-odict | 1 | Package: opie-odict |
2 | Files: bin/odict apps/Applications/odict.desktop pics/odict/odict.png | 2 | Files: bin/odict apps/Applications/odict.desktop pics/odict/odict.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: applications | 4 | Section: applications |
5 | Maintainer: Carsten Niehaus <cniehaus@handhelds.org> | 5 | Maintainer: Carsten Niehaus <cniehaus@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Dictionarylookupprogram | 8 | Description: Dictionarylookupprogram |
10 | Look up words :) | 9 | Look up words :) |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp index 7418a85..94fec36 100644 --- a/noncore/apps/tableviewer/db/xmlsource.cpp +++ b/noncore/apps/tableviewer/db/xmlsource.cpp | |||
@@ -18,12 +18,14 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "xmlsource.h" | 20 | #include "xmlsource.h" |
21 | #include <qdict.h> | 21 | #include <qdict.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <qtextstream.h> | 23 | #include <qtextstream.h> |
24 | #include "../xmlencodeattr.h" | ||
25 | |||
24 | 26 | ||
25 | 27 | ||
26 | DBXml::DBXml(DBStore *d) | 28 | DBXml::DBXml(DBStore *d) |
27 | { | 29 | { |
28 | dstore = d; | 30 | dstore = d; |
29 | } | 31 | } |
@@ -65,13 +67,13 @@ bool DBXml::saveSource(QIODevice *outDev) | |||
65 | while(it.current()) { | 67 | while(it.current()) { |
66 | if (!it.current()->delFlag()) { | 68 | if (!it.current()->delFlag()) { |
67 | outstream << "<key name=\"KEYID" << it.currentKey() << "\" "; | 69 | outstream << "<key name=\"KEYID" << it.currentKey() << "\" "; |
68 | outstream << "type=\"" | 70 | outstream << "type=\"" |
69 | << TVVariant::typeToName(it.current()->type()) | 71 | << TVVariant::typeToName(it.current()->type()) |
70 | << "\">"; | 72 | << "\">"; |
71 | outstream << it.current()->name() << "</key>" << endl; | 73 | outstream << encodeAttr(it.current()->name()) << "</key>" << endl; |
72 | } | 74 | } |
73 | ++it; | 75 | ++it; |
74 | } | 76 | } |
75 | 77 | ||
76 | outstream << "</header>" << endl; | 78 | outstream << "</header>" << endl; |
77 | 79 | ||
@@ -91,13 +93,13 @@ bool DBXml::saveSource(QIODevice *outDev) | |||
91 | // dates in files are different from displayed dates | 93 | // dates in files are different from displayed dates |
92 | QDate date = elem->getField(i).toDate(); | 94 | QDate date = elem->getField(i).toDate(); |
93 | outstream << date.day() << "/" | 95 | outstream << date.day() << "/" |
94 | << date.month() << "/" | 96 | << date.month() << "/" |
95 | << date.year(); | 97 | << date.year(); |
96 | } else { | 98 | } else { |
97 | outstream << elem->toQString(i); | 99 | outstream << encodeAttr(elem->toQString(i)); |
98 | } | 100 | } |
99 | outstream << "</KEYID" << i << ">" << endl; | 101 | outstream << "</KEYID" << i << ">" << endl; |
100 | } | 102 | } |
101 | ++it; | 103 | ++it; |
102 | } | 104 | } |
103 | outstream << "</record>" << endl; | 105 | outstream << "</record>" << endl; |
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro index 6f73400..f047e0b 100644 --- a/noncore/apps/tableviewer/tableviewer.pro +++ b/noncore/apps/tableviewer/tableviewer.pro | |||
@@ -1,11 +1,12 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | SUBDIRS = db ui | 4 | SUBDIRS = db ui |
5 | HEADERS = tableviewer.h \ | 5 | HEADERS = tableviewer.h \ |
6 | xmlencodeattr.h \ | ||
6 | ui/commonwidgets.h \ | 7 | ui/commonwidgets.h \ |
7 | ui/tvbrowseview.h \ | 8 | ui/tvbrowseview.h \ |
8 | ui/tvlistview.h \ | 9 | ui/tvlistview.h \ |
9 | ui/tvfilterview.h \ | 10 | ui/tvfilterview.h \ |
10 | ui/tveditview.h \ | 11 | ui/tveditview.h \ |
11 | ui/browsekeyentry.h \ | 12 | ui/browsekeyentry.h \ |
@@ -14,12 +15,13 @@ HEADERS = tableviewer.h \ | |||
14 | db/datacache.h \ | 15 | db/datacache.h \ |
15 | db/common.h \ | 16 | db/common.h \ |
16 | db/xmlsource.h \ | 17 | db/xmlsource.h \ |
17 | db/csvsource.h | 18 | db/csvsource.h |
18 | SOURCES = main.cpp \ | 19 | SOURCES = main.cpp \ |
19 | tableviewer.cpp \ | 20 | tableviewer.cpp \ |
21 | xmlencodeattr.cpp \ | ||
20 | ui/commonwidgets.cpp \ | 22 | ui/commonwidgets.cpp \ |
21 | ui/tvbrowseview.cpp \ | 23 | ui/tvbrowseview.cpp \ |
22 | ui/tvfilterview.cpp \ | 24 | ui/tvfilterview.cpp \ |
23 | ui/browsekeyentry.cpp \ | 25 | ui/browsekeyentry.cpp \ |
24 | ui/filterkeyentry.cpp \ | 26 | ui/filterkeyentry.cpp \ |
25 | ui/tvlistview.cpp \ | 27 | ui/tvlistview.cpp \ |
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp index f5f2555..22bac55 100644 --- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp +++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp | |||
@@ -20,12 +20,13 @@ | |||
20 | #include "tvbrowseview.h" | 20 | #include "tvbrowseview.h" |
21 | #include "browsekeyentry.h" | 21 | #include "browsekeyentry.h" |
22 | #include <qtoolbutton.h> | 22 | #include <qtoolbutton.h> |
23 | #include <qtextview.h> | 23 | #include <qtextview.h> |
24 | #include <qtextbrowser.h> | 24 | #include <qtextbrowser.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include "../xmlencodeattr.h" | ||
26 | 27 | ||
27 | /*! | 28 | /*! |
28 | \class TVBrowseView | 29 | \class TVBrowseView |
29 | \brief The widget describing how to draw the browse view user interface | 30 | \brief The widget describing how to draw the browse view user interface |
30 | 31 | ||
31 | This widget allows for the user to browse through the table, one element | 32 | This widget allows for the user to browse through the table, one element |
@@ -99,18 +100,18 @@ void TVBrowseView::setDisplayText(const DataElem *element) | |||
99 | KeyListIterator it(*ts->kRep); | 100 | KeyListIterator it(*ts->kRep); |
100 | 101 | ||
101 | while (it.current()) { | 102 | while (it.current()) { |
102 | if (element->hasValidValue(it.currentKey())) { | 103 | if (element->hasValidValue(it.currentKey())) { |
103 | if(it.currentKey() == ts->current_column) { | 104 | if(it.currentKey() == ts->current_column) { |
104 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" | 105 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" |
105 | + it.current()->name() | 106 | + encodeAttr(it.current()->name()) |
106 | + ":</FONT></B> "; | 107 | + ":</FONT></B> "; |
107 | } else { | 108 | } else { |
108 | rep += "<B>" + it.current()->name() + ":</B> "; | 109 | rep += "<B>" + encodeAttr(it.current()->name()) + ":</B> "; |
109 | } | 110 | } |
110 | rep += element->toQString(it.currentKey()) + "<BR>"; | 111 | rep += encodeAttr(element->toQString(it.currentKey())) + "<BR>"; |
111 | } | 112 | } |
112 | ++it; | 113 | ++it; |
113 | } | 114 | } |
114 | 115 | ||
115 | textViewDisplay->setText(rep); | 116 | textViewDisplay->setText(rep); |
116 | textViewDisplay->scrollToAnchor("ckey"); | 117 | textViewDisplay->scrollToAnchor("ckey"); |
diff --git a/noncore/apps/tableviewer/xmlencodeattr.cpp b/noncore/apps/tableviewer/xmlencodeattr.cpp new file mode 100644 index 0000000..de264f7 --- a/dev/null +++ b/noncore/apps/tableviewer/xmlencodeattr.cpp | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * xmlencodeattr.h | ||
3 | * | ||
4 | * copyright : (c) 2003 by Joseph Wenninger | ||
5 | * except for a small modification it's identical to qdom.cpp:encodeAttr | ||
6 | * email : jowenn@handhelds.org | ||
7 | * | ||
8 | */ | ||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #include "xmlencodeattr.h" | ||
19 | QString encodeAttr( const QString& str ) | ||
20 | { | ||
21 | QString tmp( str ); | ||
22 | uint len = tmp.length(); | ||
23 | uint i = 0; | ||
24 | while ( i < len ) { | ||
25 | if ( tmp[(int)i] == '<' ) { | ||
26 | tmp.replace( i, 1, "<" ); | ||
27 | len += 3; | ||
28 | i += 4; | ||
29 | } else if ( tmp[(int)i] == '"' ) { | ||
30 | tmp.replace( i, 1, """ ); | ||
31 | len += 5; | ||
32 | i += 6; | ||
33 | } else if ( tmp[(int)i] == '&' ) { | ||
34 | tmp.replace( i, 1, "&" ); | ||
35 | len += 4; | ||
36 | i += 5; | ||
37 | } else if ( tmp[(int)i] == '>' ) { | ||
38 | tmp.replace( i, 1, ">" ); | ||
39 | len += 3; | ||
40 | i += 4; | ||
41 | } else { | ||
42 | ++i; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | return tmp; | ||
47 | } | ||
48 | |||
diff --git a/noncore/apps/tableviewer/xmlencodeattr.h b/noncore/apps/tableviewer/xmlencodeattr.h new file mode 100644 index 0000000..5fd3b95 --- a/dev/null +++ b/noncore/apps/tableviewer/xmlencodeattr.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * xmlencodeattr.h | ||
3 | * | ||
4 | * copyright : (c) 2003 by Joseph Wenninger | ||
5 | * except for a small modification it's identical to qdom.cpp:encodeAttr | ||
6 | * email : jowenn@handhelds.org | ||
7 | * | ||
8 | */ | ||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #ifndef _XML_ENCODE_ATTR_ | ||
19 | #define _XML_ENCODE_ATTR_ | ||
20 | |||
21 | #include <qstring.h> | ||
22 | |||
23 | QString encodeAttr( const QString& str ); | ||
24 | |||
25 | #endif | ||
26 | |||
diff --git a/noncore/comm/keypebble/keypebble.pro b/noncore/comm/keypebble/keypebble.pro index 04f4b64..7af60f9 100644 --- a/noncore/comm/keypebble/keypebble.pro +++ b/noncore/comm/keypebble/keypebble.pro | |||
@@ -8,14 +8,13 @@ HEADERS = d3des.h \ | |||
8 | krfbdecoder.h \ | 8 | krfbdecoder.h \ |
9 | krfblogin.h \ | 9 | krfblogin.h \ |
10 | krfbserver.h \ | 10 | krfbserver.h \ |
11 | krfbserverinfo.h \ | 11 | krfbserverinfo.h \ |
12 | kvnc.h \ | 12 | kvnc.h \ |
13 | kvncconndlg.h \ | 13 | kvncconndlg.h \ |
14 | kvncbookmarkdlg.h \ | 14 | kvncbookmarkdlg.h \ |
15 | version.h \ | ||
16 | vncauth.h | 15 | vncauth.h |
17 | SOURCES = d3des.c \ | 16 | SOURCES = d3des.c \ |
18 | vncauth.c \ | 17 | vncauth.c \ |
19 | krfbbuffer.cpp \ | 18 | krfbbuffer.cpp \ |
20 | krfbcanvas.cpp \ | 19 | krfbcanvas.cpp \ |
21 | krfbconnection.cpp \ | 20 | krfbconnection.cpp \ |
diff --git a/noncore/comm/keypebble/opie-keypebble.control b/noncore/comm/keypebble/opie-keypebble.control index 123f307..23e4e89 100644 --- a/noncore/comm/keypebble/opie-keypebble.control +++ b/noncore/comm/keypebble/opie-keypebble.control | |||
@@ -2,10 +2,10 @@ Package: opie-keypebble | |||
2 | Files: bin/keypebble apps/Applications/keypebble.desktop pics/vnc | 2 | Files: bin/keypebble apps/Applications/keypebble.desktop pics/vnc |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Arch: iPAQ | 7 | Arch: iPAQ |
8 | Version: $QPE_VERSION-$SUB_VERSION | ||
9 | Depends: task-opie-minimal | 8 | Depends: task-opie-minimal |
10 | Description: VNC Viewer | 9 | Description: VNC Viewer |
11 | Virtual Network Computing (VNC) viewer | 10 | Virtual Network Computing (VNC) viewer |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/comm/mobilemsg/opie-mobilemsg.control b/noncore/comm/mobilemsg/opie-mobilemsg.control index 1713af5..c5fbc7f 100644 --- a/noncore/comm/mobilemsg/opie-mobilemsg.control +++ b/noncore/comm/mobilemsg/opie-mobilemsg.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-mobilemsg | 1 | Package: opie-mobilemsg |
2 | Files: bin/mobilemsg apps/Applications/mobilemsg.desktop | 2 | Files: bin/mobilemsg apps/Applications/mobilemsg.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/comm | 4 | Section: opie/comm |
5 | Maintainer: Bruno Rodrigues <bruno.rodrigues@litux.org> | 5 | Maintainer: Bruno Rodrigues <bruno.rodrigues@litux.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Mobile Messaging | 8 | Description: Mobile Messaging |
10 | For the Opie environment. | 9 | For the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/decorations/flat/opie-deco-flat.control b/noncore/decorations/flat/opie-deco-flat.control index ae64aae..311f37b 100644 --- a/noncore/decorations/flat/opie-deco-flat.control +++ b/noncore/decorations/flat/opie-deco-flat.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-deco-flat | 1 | Package: opie-deco-flat |
2 | Files: plugins/decorations/libflat.so* | 2 | Files: plugins/decorations/libflat.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/decorations | 4 | Section: opie/decorations |
5 | Maintainer: Robert Griebl <sandman@handhelds.org> | 5 | Maintainer: Robert Griebl <sandman@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: OPIE window decoration style | 8 | Description: OPIE window decoration style |
10 | Flat window decoration style for OPIE. | 9 | Flat window decoration style for OPIE. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/decorations/liquid/opie-deco-liquid.control b/noncore/decorations/liquid/opie-deco-liquid.control index 2f91612..c14b8bf 100644 --- a/noncore/decorations/liquid/opie-deco-liquid.control +++ b/noncore/decorations/liquid/opie-deco-liquid.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-deco-liquid | 1 | Package: opie-deco-liquid |
2 | Files: plugins/decorations/libliquid.so* | 2 | Files: plugins/decorations/libliquid.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/decorations | 4 | Section: opie/decorations |
5 | Maintainer: Robert Griebl <sandman@handhelds.org> | 5 | Maintainer: Robert Griebl <sandman@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: OPIE window decoration style | 8 | Description: OPIE window decoration style |
10 | Liquid (KDE3) window decoration style for OPIE. | 9 | Liquid (KDE3) window decoration style for OPIE. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/decorations/polished/opie-deco-polished.control b/noncore/decorations/polished/opie-deco-polished.control index 4d4b4e3..15afa83 100644 --- a/noncore/decorations/polished/opie-deco-polished.control +++ b/noncore/decorations/polished/opie-deco-polished.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-deco-polished | 1 | Package: opie-deco-polished |
2 | Files: plugins/decorations/libpolished.so* | 2 | Files: plugins/decorations/libpolished.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/decorations | 4 | Section: opie/decorations |
5 | Maintainer: Robert Griebl <sandman@handhelds.org> | 5 | Maintainer: Robert Griebl <sandman@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: OPIE window decoration style | 8 | Description: OPIE window decoration style |
10 | Blended window decoration style for OPIE. | 9 | Blended window decoration style for OPIE. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/backgammon/backgammon.control b/noncore/games/backgammon/backgammon.control index b75bc60..6468181 100644 --- a/noncore/games/backgammon/backgammon.control +++ b/noncore/games/backgammon/backgammon.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: backgammon | 1 | Package: backgammon |
2 | Files: bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html | 2 | Files: bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Ralf Waspe <rwaspe@web.de> | 5 | Maintainer: Ralf Waspe <rwaspe@web.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Backgammon Game | 8 | Description: Backgammon Game |
10 | A Backgammon game for the Opie environment. | 9 | A Backgammon game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp index db1a058..06523f1 100644 --- a/noncore/games/backgammon/backgammon.cpp +++ b/noncore/games/backgammon/backgammon.cpp | |||
@@ -132,14 +132,12 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) | |||
132 | 132 | ||
133 | QWidget* mainarea=new QWidget(this); | 133 | QWidget* mainarea=new QWidget(this); |
134 | setCentralWidget(mainarea); | 134 | setCentralWidget(mainarea); |
135 | //the main area | 135 | //the main area |
136 | QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom); | 136 | QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom); |
137 | area=new QCanvas(235,235); | 137 | area=new QCanvas(235,235); |
138 | QColor bgColor=palette().color(QPalette::Normal,QColorGroup::Background); | ||
139 | area->setBackgroundColor(bgColor); | ||
140 | boardview=new BackGammonView(area,mainarea); | 138 | boardview=new BackGammonView(area,mainarea); |
141 | boardview->setMaximumHeight(240); | 139 | boardview->setMaximumHeight(240); |
142 | layout->addWidget(boardview); | 140 | layout->addWidget(boardview); |
143 | connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int))); | 141 | connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int))); |
144 | //status bar | 142 | //status bar |
145 | message=new QLabel("<b>Backgammon</b>",mainarea); | 143 | message=new QLabel("<b>Backgammon</b>",mainarea); |
diff --git a/noncore/games/backgammon/backgammon.h b/noncore/games/backgammon/backgammon.h index d803489..e3276f1 100644 --- a/noncore/games/backgammon/backgammon.h +++ b/noncore/games/backgammon/backgammon.h | |||
@@ -15,12 +15,13 @@ | |||
15 | 15 | ||
16 | 16 | ||
17 | class BackGammon : public QMainWindow | 17 | class BackGammon : public QMainWindow |
18 | { | 18 | { |
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | private: | 20 | private: |
21 | //GUI | ||
21 | //the "status" bar | 22 | //the "status" bar |
22 | QLabel* message; | 23 | QLabel* message; |
23 | //the main drawing area | 24 | //the main drawing area |
24 | QCanvas* area; | 25 | QCanvas* area; |
25 | BackGammonView* boardview; | 26 | BackGammonView* boardview; |
26 | CanvasImageItem* board; | 27 | CanvasImageItem* board; |
diff --git a/noncore/games/bounce/kbounce.cpp b/noncore/games/bounce/kbounce.cpp index 5d8aba3..50f4ef6 100644 --- a/noncore/games/bounce/kbounce.cpp +++ b/noncore/games/bounce/kbounce.cpp | |||
@@ -110,22 +110,22 @@ void KJezzball::newGame() | |||
110 | startLevel(); | 110 | startLevel(); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | void KJezzball::about() | 114 | void KJezzball::about() |
115 | { | 115 | { |
116 | QMessageBox::information( this, "About", | 116 | QMessageBox::information( this, tr("About"), |
117 | "Written by: Stefan Schimanski\n" | 117 | tr("Written by: Stefan Schimanski\n" |
118 | "Ported by: Martin Imobersteg\n" | 118 | "Ported by: Martin Imobersteg\n" |
119 | "\n" | 119 | "\n" |
120 | "Click to form walls.\n" | 120 | "Click to form walls.\n" |
121 | "Hit space to switch wall direction.\n" | 121 | "Hit space to switch wall direction.\n" |
122 | "Try to reduce total space by 75%.\n" | 122 | "Try to reduce total space by 75%.\n" |
123 | "\n" | 123 | "\n" |
124 | "This program is distributed under\n" | 124 | "This program is distributed under\n" |
125 | "the terms of the GPL v2." ); | 125 | "the terms of the GPL v2.") ); |
126 | } | 126 | } |
127 | 127 | ||
128 | void KJezzball::closeGame() | 128 | void KJezzball::closeGame() |
129 | { | 129 | { |
130 | if ( m_state!=Idle ) | 130 | if ( m_state!=Idle ) |
131 | { | 131 | { |
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp index b870a59..97a17a1 100644 --- a/noncore/games/buzzword/buzzword.cpp +++ b/noncore/games/buzzword/buzzword.cpp | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> | 2 | * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public | 5 | * modify it under the terms of the GNU General Public |
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License,Life or (at your option) any later version. | 7 | * version 2 of the License,Life or (at your option) any later version. |
8 | * | 8 | * |
@@ -99,20 +99,20 @@ void BuzzWord::drawGrid() | |||
99 | l << t.readLine(); | 99 | l << t.readLine(); |
100 | } | 100 | } |
101 | 101 | ||
102 | f.close(); | 102 | f.close(); |
103 | 103 | ||
104 | grid = new QGrid(gridVal, this); | 104 | grid = new QGrid(gridVal, this); |
105 | grid->setFixedSize(240,240); | 105 | //grid->setFixedSize( 480, 480 ); |
106 | 106 | ||
107 | for( int c = 0 ; c < gridVal ; c++ ) | 107 | for( int c = 0 ; c < gridVal ; c++ ) |
108 | { | 108 | { |
109 | for( int r = 0 ; r < gridVal ; r++ ) | 109 | for( int r = 0 ; r < gridVal ; r++ ) |
110 | { | 110 | { |
111 | uint pos = rand() % l. count(); | 111 | uint pos = rand() % l. count(); |
112 | 112 | ||
113 | QString word = QStringList::split(" ", l[pos]).join("\n"); | 113 | QString word = QStringList::split(" ", l[pos]).join("\n"); |
114 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); | 114 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); |
115 | connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); | 115 | connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); |
116 | map[c][r] = 0; | 116 | map[c][r] = 0; |
117 | 117 | ||
118 | l.remove( l.at( pos )); | 118 | l.remove( l.at( pos )); |
@@ -125,13 +125,13 @@ void BuzzWord::clicked(int row, int column) | |||
125 | if ( ! gameOver ) | 125 | if ( ! gameOver ) |
126 | { | 126 | { |
127 | int rowTotal = 0; | 127 | int rowTotal = 0; |
128 | int columnTotal = 0; | 128 | int columnTotal = 0; |
129 | 129 | ||
130 | map[column][row] = 1; | 130 | map[column][row] = 1; |
131 | 131 | ||
132 | for( int c = 0 ; c < gridVal ; c++ ) | 132 | for( int c = 0 ; c < gridVal ; c++ ) |
133 | { | 133 | { |
134 | for( int r = 0 ; r < gridVal ; r++ ) | 134 | for( int r = 0 ; r < gridVal ; r++ ) |
135 | { | 135 | { |
136 | if ( map[c][r] == 1 ) | 136 | if ( map[c][r] == 1 ) |
137 | rowTotal++; | 137 | rowTotal++; |
diff --git a/noncore/games/fifteen/opie-fifteen.control b/noncore/games/fifteen/opie-fifteen.control index 662fd03..8fa355f 100644 --- a/noncore/games/fifteen/opie-fifteen.control +++ b/noncore/games/fifteen/opie-fifteen.control | |||
@@ -2,10 +2,10 @@ Package: opie-fifteen | |||
2 | Files: bin/fifteen apps/Games/fifteen.desktop pics/fifteen | 2 | Files: bin/fifteen apps/Games/fifteen.desktop pics/fifteen |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Arch: iPAQ | 7 | Arch: iPAQ |
8 | Version: $QPE_VERSION-$SUB_VERSION | ||
9 | Depends: task-opie-minimal | 8 | Depends: task-opie-minimal |
10 | Description: Fifteen pieces game | 9 | Description: Fifteen pieces game |
11 | A game for the Opie environment. | 10 | A game for the Opie environment. |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/go/opie-go.control b/noncore/games/go/opie-go.control index 061c02c..24929de 100644 --- a/noncore/games/go/opie-go.control +++ b/noncore/games/go/opie-go.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-go | 1 | Package: opie-go |
2 | Files: bin/go apps/Games/go.desktop pics/go | 2 | Files: bin/go apps/Games/go.desktop pics/go |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Warwick Allison <warwick@trolltech.com> | 5 | Maintainer: Warwick Allison <warwick@trolltech.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: The game of Go | 8 | Description: The game of Go |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp index 812e9ea..df27c76 100644 --- a/noncore/games/kpacman/kpacman.cpp +++ b/noncore/games/kpacman/kpacman.cpp | |||
@@ -31,13 +31,13 @@ Kpacman::Kpacman(QWidget *parent, const char *name) | |||
31 | m_layout = new QGridLayout( m_view ); | 31 | m_layout = new QGridLayout( m_view ); |
32 | m_layout->setMargin( 7 ); | 32 | m_layout->setMargin( 7 ); |
33 | 33 | ||
34 | view = new KpacmanWidget( this, QString(name)+"widget"); | 34 | view = new KpacmanWidget( this, QString(name)+"widget"); |
35 | m_layout->addWidget( view, 0, 0 ); | 35 | m_layout->addWidget( view, 0, 0 ); |
36 | 36 | ||
37 | setCaption( "KPacman" ); | 37 | setCaption( tr("KPacman") ); |
38 | 38 | ||
39 | view->referee->setFocus(); | 39 | view->referee->setFocus(); |
40 | 40 | ||
41 | connect(view->referee, SIGNAL(setScore(int, int)), | 41 | connect(view->referee, SIGNAL(setScore(int, int)), |
42 | view->score, SLOT(setScore(int, int))); | 42 | view->score, SLOT(setScore(int, int))); |
43 | connect(view->referee, SIGNAL(setPoints(int)), | 43 | connect(view->referee, SIGNAL(setPoints(int)), |
diff --git a/noncore/games/mindbreaker/opie-mindbreaker.control b/noncore/games/mindbreaker/opie-mindbreaker.control index 7623d6a..7b5ead6 100644 --- a/noncore/games/mindbreaker/opie-mindbreaker.control +++ b/noncore/games/mindbreaker/opie-mindbreaker.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-mindbreaker | 1 | Package: opie-mindbreaker |
2 | Files: bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker | 2 | Files: bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: crack the coloured code | 8 | Description: Game: crack the coloured code |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/minesweep/opie-minesweep.control b/noncore/games/minesweep/opie-minesweep.control index 7236cf8..32f0352 100644 --- a/noncore/games/minesweep/opie-minesweep.control +++ b/noncore/games/minesweep/opie-minesweep.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-minesweep | 1 | Package: opie-minesweep |
2 | Files: bin/minesweep apps/Games/minesweep.desktop pics/minesweep | 2 | Files: bin/minesweep apps/Games/minesweep.desktop pics/minesweep |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: find the mines | 8 | Description: Game: find the mines |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/parashoot/opie-parashoot.control b/noncore/games/parashoot/opie-parashoot.control index ad955f5..758d24d 100644 --- a/noncore/games/parashoot/opie-parashoot.control +++ b/noncore/games/parashoot/opie-parashoot.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-parashoot | 1 | Package: opie-parashoot |
2 | Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot | 2 | Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: shoot the parachutists | 8 | Description: Game: shoot the parachutists |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/qasteroids/opie-qasteroids.control b/noncore/games/qasteroids/opie-qasteroids.control index 49cc6b2..25a49b4 100644 --- a/noncore/games/qasteroids/opie-qasteroids.control +++ b/noncore/games/qasteroids/opie-qasteroids.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-qasteroids | 1 | Package: opie-qasteroids |
2 | Files: bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/* | 2 | Files: bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Jones <mjones@trolltech.com> | 5 | Maintainer: Martin Jones <mjones@trolltech.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: shoot the asteroids | 8 | Description: Game: shoot the asteroids |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/sfcave-sdl/sfcave-sdl.control b/noncore/games/sfcave-sdl/sfcave-sdl.control index c017280..9bf43ba 100644 --- a/noncore/games/sfcave-sdl/sfcave-sdl.control +++ b/noncore/games/sfcave-sdl/sfcave-sdl.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Files: bin/sfcave-sdl apps/Games/sfcave-sdl.desktop pics/sfcave-sdl sounds/sfcave-sdl | 1 | Files: bin/sfcave-sdl apps/Games/sfcave-sdl.desktop pics/sfcave-sdl sounds/sfcave-sdl |
2 | Package: sfcave-sdl | 2 | Package: sfcave-sdl |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: Games | 4 | Section: Games |
5 | Version: $QPE_VERSION-$SUB_VERSION | ||
6 | Architecture: arm | 5 | Architecture: arm |
7 | Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) | 6 | Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) |
8 | Depends: libSDL,libSDL_-mixer,libSDL-image,libSDL-gfx | 7 | Depends: libSDL,libSDL_-mixer,libSDL-image,libSDL-gfx |
9 | Description: SFCave SDL for the Zaurus. Fly though the cave avoiding the walls. | 8 | Description: SFCave SDL for the Zaurus. Fly though the cave avoiding the walls. |
10 | 9 | ||
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/sfcave/opie-sfcave.control b/noncore/games/sfcave/opie-sfcave.control index 1566959..0ff3e2c 100644 --- a/noncore/games/sfcave/opie-sfcave.control +++ b/noncore/games/sfcave/opie-sfcave.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-sfcave | 1 | Package: opie-sfcave |
2 | Files: bin/sfcave apps/Games/sfcave.desktop pics/sfcave | 2 | Files: bin/sfcave apps/Games/sfcave.desktop pics/sfcave |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Andy Qua <andy.qua@blueyonder.co.uk> | 5 | Maintainer: Andy Qua <andy.qua@blueyonder.co.uk> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: SFCave for the Zaurus. Fly the dot though the cave avoiding the walls. | 8 | Description: SFCave for the Zaurus. Fly the dot though the cave avoiding the walls. |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/snake/interface.cpp b/noncore/games/snake/interface.cpp index 0f312ac..68e0f14 100644 --- a/noncore/games/snake/interface.cpp +++ b/noncore/games/snake/interface.cpp | |||
@@ -97,13 +97,13 @@ void SnakeGame::welcomescreen() | |||
97 | "crash into the walls, edges or its tail."), | 97 | "crash into the walls, edges or its tail."), |
98 | &canvas); | 98 | &canvas); |
99 | w = instr->boundingRect().width(); | 99 | w = instr->boundingRect().width(); |
100 | instr->move(canvas.width()/2-w/2, canvas.height()/2-20); | 100 | instr->move(canvas.width()/2-w/2, canvas.height()/2-20); |
101 | instr->setColor(white); | 101 | instr->setColor(white); |
102 | instr->show(); | 102 | instr->show(); |
103 | QCanvasText* cont = new QCanvasText(tr("Press Any Key To Start"), &canvas); | 103 | QCanvasText* cont = new QCanvasText(tr("Press any key to start"), &canvas); |
104 | w = cont->boundingRect().width(); | 104 | w = cont->boundingRect().width(); |
105 | cont->move(canvas.width()/2-w/2, canvas.height()-20); | 105 | cont->move(canvas.width()/2-w/2, canvas.height()-20); |
106 | cont->setColor(yellow); | 106 | cont->setColor(yellow); |
107 | cont->show(); | 107 | cont->show(); |
108 | 108 | ||
109 | } | 109 | } |
@@ -193,13 +193,13 @@ void SnakeGame::gameOver() | |||
193 | } | 193 | } |
194 | 194 | ||
195 | void SnakeGame::wait() | 195 | void SnakeGame::wait() |
196 | { | 196 | { |
197 | waitover = true; | 197 | waitover = true; |
198 | pauseTimer->stop(); | 198 | pauseTimer->stop(); |
199 | QCanvasText* cont = new QCanvasText(tr("Press Any Key to Begin a New Game."), | 199 | QCanvasText* cont = new QCanvasText(tr("Press any key to begin a new game."), |
200 | &canvas); | 200 | &canvas); |
201 | cont->setZ(100); | 201 | cont->setZ(100); |
202 | cont->setColor(white); | 202 | cont->setColor(white); |
203 | int w = cont->boundingRect().width(); | 203 | int w = cont->boundingRect().width(); |
204 | cont->move(canvas.width()/2 -w/2, canvas.height()/2); | 204 | cont->move(canvas.width()/2 -w/2, canvas.height()/2); |
205 | cont->show(); | 205 | cont->show(); |
diff --git a/noncore/games/snake/opie-snake.control b/noncore/games/snake/opie-snake.control index 3ab6640..ef4fc61 100644 --- a/noncore/games/snake/opie-snake.control +++ b/noncore/games/snake/opie-snake.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-snake | 1 | Package: opie-snake |
2 | Files: bin/snake apps/Games/snake.desktop pics/snake | 2 | Files: bin/snake apps/Games/snake.desktop pics/snake |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: control the snake | 8 | Description: Game: control the snake |
10 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index e836eb2..317a02d 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp | |||
@@ -67,14 +67,14 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
67 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); | 67 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); |
68 | menu->insertItem(tr("&Game"), file); | 68 | menu->insertItem(tr("&Game"), file); |
69 | 69 | ||
70 | menu->insertSeparator(); | 70 | menu->insertSeparator(); |
71 | 71 | ||
72 | settings = new QPopupMenu; | 72 | settings = new QPopupMenu; |
73 | settings->insertItem(tr("&Change Card Backs"), this, SLOT(changeCardBacks()), Key_F2); | 73 | settings->insertItem(tr("&Change card backs"), this, SLOT(changeCardBacks()), Key_F2); |
74 | snap_id = settings->insertItem(tr("&Snap To Position"), this, SLOT(snapToggle()), Key_F3); | 74 | snap_id = settings->insertItem(tr("&Snap to position"), this, SLOT(snapToggle()), Key_F3); |
75 | settings->setCheckable(TRUE); | 75 | settings->setCheckable(TRUE); |
76 | menu->insertItem(tr("&Settings"),settings); | 76 | menu->insertItem(tr("&Settings"),settings); |
77 | 77 | ||
78 | menu->insertSeparator(); | 78 | menu->insertSeparator(); |
79 | 79 | ||
80 | QPopupMenu* help = new QPopupMenu; | 80 | QPopupMenu* help = new QPopupMenu; |
@@ -93,17 +93,17 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
93 | menu->insertItem(tr("Play"), file); | 93 | menu->insertItem(tr("Play"), file); |
94 | 94 | ||
95 | menu->insertSeparator(); | 95 | menu->insertSeparator(); |
96 | 96 | ||
97 | settings = new QPopupMenu; | 97 | settings = new QPopupMenu; |
98 | settings->setCheckable(TRUE); | 98 | settings->setCheckable(TRUE); |
99 | settings->insertItem(tr("Change Card Backs"), this, SLOT(changeCardBacks())); | 99 | settings->insertItem(tr("Change card backs"), this, SLOT(changeCardBacks())); |
100 | snap_id = settings->insertItem(tr("Snap To Position"), this, SLOT(snapToggle())); | 100 | snap_id = settings->insertItem(tr("Snap to position"), this, SLOT(snapToggle())); |
101 | QString m; | 101 | QString m; |
102 | 102 | ||
103 | drawId = settings->insertItem(tr("Turn One Card"), this, SLOT(drawnToggle())); | 103 | drawId = settings->insertItem(tr("Turn one card"), this, SLOT(drawnToggle())); |
104 | menu->insertItem(tr("Settings"),settings); | 104 | menu->insertItem(tr("Settings"),settings); |
105 | settings->setCheckable(TRUE); | 105 | settings->setCheckable(TRUE); |
106 | 106 | ||
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | menu->show(); | 109 | menu->show(); |
@@ -280,15 +280,15 @@ void CanvasCardWindow::drawnToggle() | |||
280 | cfg.writeEntry( "DrawThree", drawThree); | 280 | cfg.writeEntry( "DrawThree", drawThree); |
281 | cfg.write(); | 281 | cfg.write(); |
282 | } | 282 | } |
283 | 283 | ||
284 | void CanvasCardWindow::updateDraw() { | 284 | void CanvasCardWindow::updateDraw() { |
285 | if(cardGame->cardsDrawn() == 3){ | 285 | if(cardGame->cardsDrawn() == 3){ |
286 | settings->changeItem(drawId, tr("Turn One Card")); | 286 | settings->changeItem(drawId, tr("Turn one card")); |
287 | } else { | 287 | } else { |
288 | settings->changeItem(drawId, tr("Turn Three Cards")); | 288 | settings->changeItem(drawId, tr("Turn three cards")); |
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
293 | void CanvasCardWindow::setCardBacks() | 293 | void CanvasCardWindow::setCardBacks() |
294 | { | 294 | { |
diff --git a/noncore/games/solitaire/opie-solitaire.control b/noncore/games/solitaire/opie-solitaire.control index 76e7208..5fa521f 100644 --- a/noncore/games/solitaire/opie-solitaire.control +++ b/noncore/games/solitaire/opie-solitaire.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-solitaire | 1 | Package: opie-solitaire |
2 | Files: bin/patience apps/Games/patience.desktop pics/cards | 2 | Files: bin/patience apps/Games/patience.desktop pics/cards |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Game: solitaire card games | 8 | Description: Game: solitaire card games |
10 | A solitaire game for the Opie environment. | 9 | A solitaire game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/tetrix/opie-tetrix.control b/noncore/games/tetrix/opie-tetrix.control index e335507..e901dbf 100644 --- a/noncore/games/tetrix/opie-tetrix.control +++ b/noncore/games/tetrix/opie-tetrix.control | |||
@@ -2,10 +2,10 @@ Package: opie-tetrix | |||
2 | Files: bin/tetrix apps/Games/tetrix.desktop pics/tetrix/* | 2 | Files: bin/tetrix apps/Games/tetrix.desktop pics/tetrix/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Arch: iPAQ | 7 | Arch: iPAQ |
8 | Version: $QPE_VERSION-$SUB_VERSION | ||
9 | Depends: task-opie-minimal | 8 | Depends: task-opie-minimal |
10 | Description: Game: control falling blocks | 9 | Description: Game: control falling blocks |
11 | A game for the Opie environment. | 10 | A game for the Opie environment. |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/tictac/main.cpp b/noncore/games/tictac/main.cpp index f2ab334..78fb3b7 100644 --- a/noncore/games/tictac/main.cpp +++ b/noncore/games/tictac/main.cpp | |||
@@ -22,10 +22,10 @@ int main( int argc, char **argv ) | |||
22 | if ( n < 3 || n > 10 ) { // out of range | 22 | if ( n < 3 || n > 10 ) { // out of range |
23 | qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] ); | 23 | qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] ); |
24 | return 1; | 24 | return 1; |
25 | } | 25 | } |
26 | TicTacToe ttt( n ); // create game | 26 | TicTacToe ttt( n ); // create game |
27 | a.setMainWidget( &ttt ); | 27 | a.setMainWidget( &ttt ); |
28 | ttt.setCaption("TicTac"); | 28 | ttt.setCaption( QObject::tr("TicTac") ); |
29 | ttt.show(); // show widget | 29 | ttt.show(); // show widget |
30 | return a.exec(); // go | 30 | return a.exec(); // go |
31 | } | 31 | } |
diff --git a/noncore/games/tictac/opie-tictac.control b/noncore/games/tictac/opie-tictac.control index c4ee36c..0074505 100644 --- a/noncore/games/tictac/opie-tictac.control +++ b/noncore/games/tictac/opie-tictac.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tictac | 1 | Package: opie-tictac |
2 | Files: bin/tictac apps/Games/tictac.desktop pics/tictac | 2 | Files: bin/tictac apps/Games/tictac.desktop pics/tictac |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: ljp <ljp@llornkcor.com> | 5 | Maintainer: ljp <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Tic Tac Toe game. | 8 | Description: Tic Tac Toe game. |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/wordgame/opie-wordgame.control b/noncore/games/wordgame/opie-wordgame.control index 3be8e8f..c7dc126 100644 --- a/noncore/games/wordgame/opie-wordgame.control +++ b/noncore/games/wordgame/opie-wordgame.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-wordgame | 1 | Package: opie-wordgame |
2 | Files: bin/wordgame apps/Games/wordgame.desktop pics/wordgame | 2 | Files: bin/wordgame apps/Games/wordgame.desktop pics/wordgame |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Crossword game | 8 | Description: Crossword game |
10 | A crossword game for the Opie environment. | 9 | A crossword game for the Opie environment. |
11 | Play against the computer or human opponents. | 10 | Play against the computer or human opponents. |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index d3160f4..d46e824 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -287,13 +287,13 @@ bool WordGame::loadRules(const QString &name) | |||
287 | return FALSE; | 287 | return FALSE; |
288 | 288 | ||
289 | QTextStream ts( &file ); | 289 | QTextStream ts( &file ); |
290 | 290 | ||
291 | QString title = name; | 291 | QString title = name; |
292 | title.truncate( title.length() - 6 ); | 292 | title.truncate( title.length() - 6 ); |
293 | setCaption( title ); | 293 | //setCaption( title ); |
294 | 294 | ||
295 | QString shapepixmap; | 295 | QString shapepixmap; |
296 | ts >> shapepixmap; | 296 | ts >> shapepixmap; |
297 | int htiles,vtiles; | 297 | int htiles,vtiles; |
298 | ts >> htiles >> vtiles; | 298 | ts >> htiles >> vtiles; |
299 | 299 | ||
@@ -311,13 +311,13 @@ bool WordGame::loadRules(const QString &name) | |||
311 | ts >> e; | 311 | ts >> e; |
312 | while ( e && re < 10 ) { | 312 | while ( e && re < 10 ) { |
313 | rule_effects[re] = e; | 313 | rule_effects[re] = e; |
314 | if ( re++ < 10 ) ts >> e; | 314 | if ( re++ < 10 ) ts >> e; |
315 | } | 315 | } |
316 | 316 | ||
317 | QImage shim = Resource::loadImage("wordgame/wordgame_shapes.xpm"); | 317 | QImage shim = Resource::loadImage("wordgame/wordgame_shapes"); |
318 | shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); | 318 | shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); |
319 | QPixmap bgshapes; | 319 | QPixmap bgshapes; |
320 | bgshapes.convertFromImage(shim); | 320 | bgshapes.convertFromImage(shim); |
321 | 321 | ||
322 | rule_effects[re++] = 100; // default bonus | 322 | rule_effects[re++] = 100; // default bonus |
323 | board = new Board(bgshapes, htiles, vtiles, vbox); | 323 | board = new Board(bgshapes, htiles, vtiles, vbox); |
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 4db6208..aac6bc1 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -275,24 +275,30 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
275 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 275 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
276 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 276 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
277 | m_pBrushColorToolButton->setPopupDelay(0); | 277 | m_pBrushColorToolButton->setPopupDelay(0); |
278 | 278 | ||
279 | changeBrushColor(Qt::white); | 279 | changeBrushColor(Qt::white); |
280 | 280 | ||
281 | } | ||
282 | |||
283 | |||
284 | void DrawPad::finishStartup() | ||
285 | { | ||
281 | // init pages | 286 | // init pages |
282 | 287 | ||
283 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 288 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
284 | 289 | ||
285 | if (file.open(IO_ReadOnly)) { | 290 | if (file.open(IO_ReadOnly)) { |
286 | m_pDrawPadCanvas->load(&file); | 291 | m_pDrawPadCanvas->load(&file); |
287 | file.close(); | 292 | file.close(); |
288 | } else { | 293 | } else { |
289 | m_pDrawPadCanvas->initialPage(); | 294 | m_pDrawPadCanvas->initialPage(); |
290 | } | 295 | } |
291 | 296 | ||
292 | loadConfig(); | 297 | loadConfig(); |
298 | |||
293 | } | 299 | } |
294 | 300 | ||
295 | DrawPad::~DrawPad() | 301 | DrawPad::~DrawPad() |
296 | { | 302 | { |
297 | saveConfig(); | 303 | saveConfig(); |
298 | 304 | ||
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 7306228..2cae700 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -37,12 +37,13 @@ public: | |||
37 | 37 | ||
38 | Tool* tool() { return m_pTool; } | 38 | Tool* tool() { return m_pTool; } |
39 | QPen pen() { return m_pen; } | 39 | QPen pen() { return m_pen; } |
40 | QBrush brush() { return m_brush; } | 40 | QBrush brush() { return m_brush; } |
41 | 41 | ||
42 | bool antiAliasing(); | 42 | bool antiAliasing(); |
43 | void finishStartup(); | ||
43 | 44 | ||
44 | private slots: | 45 | private slots: |
45 | void newPage(); | 46 | void newPage(); |
46 | void clearPage(); | 47 | void clearPage(); |
47 | void deletePage(); | 48 | void deletePage(); |
48 | 49 | ||
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 025bebb..dec498b 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -179,25 +179,31 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
179 | xmlSimpleReader.setContentHandler(&drawPadCanvasXmlHandler); | 179 | xmlSimpleReader.setContentHandler(&drawPadCanvasXmlHandler); |
180 | xmlSimpleReader.parse(xmlInputSource); | 180 | xmlSimpleReader.parse(xmlInputSource); |
181 | 181 | ||
182 | m_pages = drawPadCanvasXmlHandler.pages(); | 182 | m_pages = drawPadCanvasXmlHandler.pages(); |
183 | 183 | ||
184 | if (m_pages.isEmpty()) { | 184 | if (m_pages.isEmpty()) { |
185 | m_pages.append(new Page("", contentsRect().size())); | 185 | m_pages.append(new Page("", |
186 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
187 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
186 | m_pages.current()->pixmap()->fill(Qt::white); | 188 | m_pages.current()->pixmap()->fill(Qt::white); |
187 | } | 189 | } |
188 | 190 | ||
189 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 191 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
190 | viewport()->update(); | 192 | viewport()->update(); |
191 | 193 | ||
192 | emit pagesChanged(); | 194 | emit pagesChanged(); |
193 | } | 195 | } |
194 | 196 | ||
195 | void DrawPadCanvas::initialPage() | 197 | void DrawPadCanvas::initialPage() |
196 | { | 198 | { |
197 | m_pages.append(new Page("", 236, 232)); | 199 | m_pages.append(new Page("", |
200 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
201 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
202 | //236, 232)); no more fixed sizes | ||
203 | |||
198 | m_pages.current()->pixmap()->fill(Qt::white); | 204 | m_pages.current()->pixmap()->fill(Qt::white); |
199 | 205 | ||
200 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 206 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
201 | viewport()->update(); | 207 | viewport()->update(); |
202 | 208 | ||
203 | emit pagesChanged(); | 209 | emit pagesChanged(); |
@@ -346,13 +352,16 @@ void DrawPadCanvas::selectPage(uint pagePosition) | |||
346 | } | 352 | } |
347 | 353 | ||
348 | void DrawPadCanvas::deleteAll() | 354 | void DrawPadCanvas::deleteAll() |
349 | { | 355 | { |
350 | m_pages.clear(); | 356 | m_pages.clear(); |
351 | 357 | ||
352 | m_pages.append(new Page("", contentsRect().size())); | 358 | m_pages.append(new Page("", |
359 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
360 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
361 | |||
353 | m_pages.current()->pixmap()->fill(Qt::white); | 362 | m_pages.current()->pixmap()->fill(Qt::white); |
354 | 363 | ||
355 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 364 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
356 | viewport()->update(); | 365 | viewport()->update(); |
357 | 366 | ||
358 | emit pagesChanged(); | 367 | emit pagesChanged(); |
@@ -379,13 +388,16 @@ void DrawPadCanvas::clearPage() | |||
379 | 388 | ||
380 | void DrawPadCanvas::deletePage() | 389 | void DrawPadCanvas::deletePage() |
381 | { | 390 | { |
382 | m_pages.remove(m_pages.current()); | 391 | m_pages.remove(m_pages.current()); |
383 | 392 | ||
384 | if (m_pages.isEmpty()) { | 393 | if (m_pages.isEmpty()) { |
385 | m_pages.append(new Page("", contentsRect().size())); | 394 | m_pages.append(new Page("", |
395 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
396 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
397 | |||
386 | m_pages.current()->pixmap()->fill(Qt::white); | 398 | m_pages.current()->pixmap()->fill(Qt::white); |
387 | } | 399 | } |
388 | 400 | ||
389 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 401 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
390 | viewport()->update(); | 402 | viewport()->update(); |
391 | 403 | ||
diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index 5b11c0e..adbd612 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp | |||
@@ -10,13 +10,13 @@ | |||
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "exportdialog.h" | 14 | #include "exportdialog.h" |
15 | 15 | ||
16 | #include <qpe/fileselector.h> | 16 | #include <opie/ofileselector.h> |
17 | 17 | ||
18 | #include <qbuttongroup.h> | 18 | #include <qbuttongroup.h> |
19 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
20 | #include <qgroupbox.h> | 20 | #include <qgroupbox.h> |
21 | #include <qimage.h> | 21 | #include <qimage.h> |
22 | #include <qlabel.h> | 22 | #include <qlabel.h> |
@@ -63,15 +63,18 @@ ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const c | |||
63 | 63 | ||
64 | m_pNameLineEdit = new QLineEdit(exportGroupBox); | 64 | m_pNameLineEdit = new QLineEdit(exportGroupBox); |
65 | 65 | ||
66 | m_pFormatComboBox = new QComboBox(exportGroupBox); | 66 | m_pFormatComboBox = new QComboBox(exportGroupBox); |
67 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); | 67 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); |
68 | 68 | ||
69 | FileSelector* fileSelector = new FileSelector("image/*", this, "fileselector"); | 69 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); |
70 | fileSelector->setNewVisible(false); | 70 | OFileSelector* fileSelector = new OFileSelector(this, OFileSelector::FileSelector, |
71 | fileSelector->setCloseVisible(false); | 71 | OFileSelector::Normal, |
72 | QString::null, QString::null, | ||
73 | types ); | ||
74 | fileSelector->setNameVisible( false ); | ||
72 | 75 | ||
73 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 76 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
74 | selectionButtonGroup->layout()->setSpacing(4); | 77 | selectionButtonGroup->layout()->setSpacing(4); |
75 | exportGroupBox->layout()->setSpacing(4); | 78 | exportGroupBox->layout()->setSpacing(4); |
76 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); | 79 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); |
77 | QHBoxLayout* rangeLayout = new QHBoxLayout(); | 80 | QHBoxLayout* rangeLayout = new QHBoxLayout(); |
diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index 1c447cb..9a59a20 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp | |||
@@ -11,29 +11,33 @@ | |||
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "importdialog.h" | 14 | #include "importdialog.h" |
15 | 15 | ||
16 | #include <qpe/applnk.h> | 16 | #include <qpe/applnk.h> |
17 | #include <qpe/fileselector.h> | 17 | #include <opie/ofileselector.h> |
18 | 18 | ||
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qimage.h> | 20 | #include <qimage.h> |
21 | #include <qlabel.h> | 21 | #include <qlabel.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | 24 | ||
25 | ImportDialog::ImportDialog(QWidget* parent, const char* name) | 25 | ImportDialog::ImportDialog(QWidget* parent, const char* name) |
26 | : QDialog(parent, name, true) | 26 | : QDialog(parent, name, true) |
27 | { | 27 | { |
28 | setCaption(tr("DrawPad - Import")); | 28 | setCaption(tr("DrawPad - Import")); |
29 | 29 | ||
30 | m_pFileSelector = new FileSelector("image/*", this, "fileselector"); | 30 | MimeTypes types; types.insert( tr("All images"),"image/*" ); |
31 | m_pFileSelector = new OFileSelector(this, | ||
32 | OFileSelector::FileSelector, | ||
33 | OFileSelector::Normal, | ||
34 | QString::null, | ||
35 | QString::null, types ); | ||
36 | m_pFileSelector->setNameVisible( false ); | ||
31 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); | 37 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); |
32 | m_pFileSelector->setNewVisible(false); | ||
33 | m_pFileSelector->setCloseVisible(false); | ||
34 | 38 | ||
35 | m_pPreviewLabel = new QLabel(this); | 39 | m_pPreviewLabel = new QLabel(this); |
36 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 40 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
37 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | 41 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
38 | m_pPreviewLabel->setFixedSize(114, 114); | 42 | m_pPreviewLabel->setFixedSize(114, 114); |
39 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); | 43 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); |
@@ -65,13 +69,13 @@ ImportDialog::~ImportDialog() | |||
65 | { | 69 | { |
66 | } | 70 | } |
67 | 71 | ||
68 | const DocLnk* ImportDialog::selected() | 72 | const DocLnk* ImportDialog::selected() |
69 | { | 73 | { |
70 | // FIXME change from pointer to reference -zecke | 74 | // FIXME change from pointer to reference -zecke |
71 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); | 75 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); |
72 | return lnk; | 76 | return lnk; |
73 | } | 77 | } |
74 | 78 | ||
75 | void ImportDialog::fileChanged() | 79 | void ImportDialog::fileChanged() |
76 | { | 80 | { |
77 | if (m_pAutomaticPreviewCheckBox->isChecked()) { | 81 | if (m_pAutomaticPreviewCheckBox->isChecked()) { |
diff --git a/noncore/graphics/drawpad/importdialog.h b/noncore/graphics/drawpad/importdialog.h index ef51d7c..ed655a5 100644 --- a/noncore/graphics/drawpad/importdialog.h +++ b/noncore/graphics/drawpad/importdialog.h | |||
@@ -14,13 +14,13 @@ | |||
14 | #ifndef IMPORTDIALOG_H | 14 | #ifndef IMPORTDIALOG_H |
15 | #define IMPORTDIALOG_H | 15 | #define IMPORTDIALOG_H |
16 | 16 | ||
17 | #include <qdialog.h> | 17 | #include <qdialog.h> |
18 | 18 | ||
19 | class DocLnk; | 19 | class DocLnk; |
20 | class FileSelector; | 20 | class OFileSelector; |
21 | 21 | ||
22 | class QCheckBox; | 22 | class QCheckBox; |
23 | class QLabel; | 23 | class QLabel; |
24 | 24 | ||
25 | class ImportDialog : public QDialog | 25 | class ImportDialog : public QDialog |
26 | { | 26 | { |
@@ -34,12 +34,12 @@ public: | |||
34 | 34 | ||
35 | private slots: | 35 | private slots: |
36 | void fileChanged(); | 36 | void fileChanged(); |
37 | void preview(); | 37 | void preview(); |
38 | 38 | ||
39 | private: | 39 | private: |
40 | FileSelector* m_pFileSelector; | 40 | OFileSelector* m_pFileSelector; |
41 | QLabel* m_pPreviewLabel; | 41 | QLabel* m_pPreviewLabel; |
42 | QCheckBox* m_pAutomaticPreviewCheckBox; | 42 | QCheckBox* m_pAutomaticPreviewCheckBox; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #endif // IMPORTDIALOG_H | 45 | #endif // IMPORTDIALOG_H |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index ec628cc..12f8084 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -18,10 +18,10 @@ | |||
18 | int main(int argc, char **argv) | 18 | int main(int argc, char **argv) |
19 | { | 19 | { |
20 | QPEApplication a(argc, argv); | 20 | QPEApplication a(argc, argv); |
21 | 21 | ||
22 | DrawPad mw; // = new DrawPad();; | 22 | DrawPad mw; // = new DrawPad();; |
23 | a.showMainWidget(&mw ); | 23 | a.showMainWidget(&mw ); |
24 | 24 | mw.finishStartup(); | |
25 | 25 | ||
26 | return a.exec(); | 26 | return a.exec(); |
27 | } | 27 | } |
diff --git a/noncore/graphics/drawpad/opie-drawpad.control b/noncore/graphics/drawpad/opie-drawpad.control index 1c22186..5095b52 100644 --- a/noncore/graphics/drawpad/opie-drawpad.control +++ b/noncore/graphics/drawpad/opie-drawpad.control | |||
@@ -1,12 +1,12 @@ | |||
1 | Package: opie-drawpad | 1 | Package: opie-drawpad |
2 | Files: bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad | 2 | Files: bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> | 5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, libopie1 | 7 | Depends: task-opie-minimal, libopie1 |
9 | Description: A note taking program with basic draw tools | 8 | Description: A note taking program with basic draw tools |
10 | DrawPad is an easy note taking program for Zaurus. It can also | 9 | DrawPad is an easy note taking program for Zaurus. It can also |
11 | be used to draw simple images. DrawPad was developed for the Opie | 10 | be used to draw simple images. DrawPad was developed for the Opie |
12 | project, an alternative to the standard Zaurus environment. | 11 | project, an alternative to the standard Zaurus environment. |
12 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/graphics/drawpad/texttool.h b/noncore/graphics/drawpad/texttool.h index 3187675..17556a1 100644 --- a/noncore/graphics/drawpad/texttool.h +++ b/noncore/graphics/drawpad/texttool.h | |||
@@ -19,12 +19,13 @@ | |||
19 | #include <qdialog.h> | 19 | #include <qdialog.h> |
20 | 20 | ||
21 | class QLineEdit; | 21 | class QLineEdit; |
22 | 22 | ||
23 | class TextToolDialog : public QDialog | 23 | class TextToolDialog : public QDialog |
24 | { | 24 | { |
25 | Q_OBJECT | ||
25 | public: | 26 | public: |
26 | TextToolDialog(QWidget* parent = 0, const char* name = 0); | 27 | TextToolDialog(QWidget* parent = 0, const char* name = 0); |
27 | ~TextToolDialog(); | 28 | ~TextToolDialog(); |
28 | 29 | ||
29 | QString text(); | 30 | QString text(); |
30 | 31 | ||
diff --git a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-Pod.control b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-Pod.control index 2de15e9..faa041b 100644 --- a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-Pod.control +++ b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-Pod.control | |||
@@ -1,8 +1,8 @@ | |||
1 | Package: opie-mediaplayer2-skin-Pod | 1 | Package: opie-mediaplayer2-skin-Pod |
2 | Files: pics/mediaplayer/skins/Pod | 2 | Files: pics/mediaplayer/skins/Pod |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: ljp <llornkcor@handhelds.org> | 5 | Maintainer: ljp <llornkcor@handhelds.org> |
6 | Version: $QPE_VERSION-$SUB_VERSION | ||
7 | Description: Opie Mediaplayer's skin. | 6 | Description: Opie Mediaplayer's skin. |
8 | 7 | ||
8 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default-landscape.control b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default-landscape.control index 570b25a..4bc3c60 100644 --- a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default-landscape.control +++ b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default-landscape.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-mediaplayer2-skin-default-landscape | 1 | Package: opie-mediaplayer2-skin-default-landscape |
2 | Files: pics/opieplayer2/skins/default_landscape | 2 | Files: pics/opieplayer2/skins/default_landscape |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/playerskins | 4 | Section: opie/playerskins |
5 | Maintainer: L.J.Potter <ljp@llornkcor.com> | 5 | Maintainer: L.J.Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Landscape skin for opie mediaplayer's | 8 | Description: Landscape skin for opie mediaplayer's |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default.control b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default.control index 5cd7509..d076fab 100644 --- a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default.control +++ b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-default.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-mediaplayer2-skin-default | 1 | Package: opie-mediaplayer2-skin-default |
2 | Files: pics/opieplayer2/skins/default | 2 | Files: pics/opieplayer2/skins/default |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/playerskins | 4 | Section: opie/playerskins |
5 | Maintainer: L.J.Potter <ljp@llornkcor.com> | 5 | Maintainer: L.J.Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Default skin for opie mediaplayer's | 8 | Description: Default skin for opie mediaplayer's |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-techno.control b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-techno.control index 0ff1427..ad8c1f8 100644 --- a/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-techno.control +++ b/noncore/multimedia/mediaplayerskins/opie-mediaplayer2-skin-techno.control | |||
@@ -1,8 +1,8 @@ | |||
1 | Package: opie-mediaplayer2-skin-techno | 1 | Package: opie-mediaplayer2-skin-techno |
2 | Files: pics/mediaplayer/skins/techno | 2 | Files: pics/mediaplayer/skins/techno |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: ljp <llornkcor@handhelds.org> | 5 | Maintainer: ljp <llornkcor@handhelds.org> |
6 | Version: $QPE_VERSION-$SUB_VERSION | ||
7 | Description: Techno Opie Mediaplayer's skin. Adapted from Qtopia | 6 | Description: Techno Opie Mediaplayer's skin. Adapted from Qtopia |
8 | 7 | ||
8 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 5d929cb..2c54ae6 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -28,26 +28,12 @@ | |||
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | ||
35 | #include <qpe/resource.h> | ||
36 | #include <qpe/config.h> | ||
37 | #include <opie/oticker.h> | ||
38 | |||
39 | #include <qwidget.h> | ||
40 | #include <qpixmap.h> | ||
41 | #include <qbutton.h> | ||
42 | #include <qpainter.h> | ||
43 | #include <qframe.h> | ||
44 | #include <qlayout.h> | ||
45 | #include <qdir.h> | ||
46 | #include <stdlib.h> | ||
47 | #include <stdio.h> | ||
48 | 34 | ||
49 | #include "audiowidget.h" | 35 | #include "audiowidget.h" |
50 | #include "mediaplayerstate.h" | 36 | #include "mediaplayerstate.h" |
51 | #include "playlistwidget.h" | 37 | #include "playlistwidget.h" |
52 | 38 | ||
53 | namespace | 39 | namespace |
@@ -187,13 +173,13 @@ void AudioWidget::loadSkin() | |||
187 | // Config cofg("qpe"); | 173 | // Config cofg("qpe"); |
188 | // cofg.setGroup("Appearance"); | 174 | // cofg.setGroup("Appearance"); |
189 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); | 175 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); |
190 | 176 | ||
191 | time.setFocusPolicy( QWidget::NoFocus ); | 177 | time.setFocusPolicy( QWidget::NoFocus ); |
192 | time.setAlignment( Qt::AlignCenter ); | 178 | time.setAlignment( Qt::AlignCenter ); |
193 | 179 | ||
194 | // time.setFrame(FALSE); | 180 | // time.setFrame(FALSE); |
195 | // changeTextColor( &time ); | 181 | // changeTextColor( &time ); |
196 | 182 | ||
197 | resizeEvent( 0 ); | 183 | resizeEvent( 0 ); |
198 | } | 184 | } |
199 | 185 | ||
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 53dbb88..b436239 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -31,20 +31,13 @@ | |||
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef AUDIO_WIDGET_H | 34 | #ifndef AUDIO_WIDGET_H |
35 | #define AUDIO_WIDGET_H | 35 | #define AUDIO_WIDGET_H |
36 | 36 | ||
37 | #include <qpainter.h> | ||
38 | #include <qdrawutil.h> | ||
39 | #include <qpixmap.h> | ||
40 | #include <qstring.h> | ||
41 | #include <qslider.h> | ||
42 | #include <qframe.h> | ||
43 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
44 | #include <qimage.h> | ||
45 | 38 | ||
46 | #include <opie/oticker.h> | 39 | #include <opie/oticker.h> |
47 | 40 | ||
48 | #include "mediawidget.h" | 41 | #include "mediawidget.h" |
49 | 42 | ||
50 | class QPixmap; | 43 | class QPixmap; |
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index d04af08..11ad745 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -28,19 +28,15 @@ | |||
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <stdio.h> | 34 | |
35 | #include <stdlib.h> | ||
36 | #include <qimage.h> | ||
37 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
38 | #include <qpe/resource.h> | ||
39 | 36 | ||
40 | #include <qfile.h> | ||
41 | #include <qdir.h> | 37 | #include <qdir.h> |
42 | 38 | ||
43 | #include <qgfx_qws.h> | 39 | #include <qgfx_qws.h> |
44 | #include <qdirectpainter_qws.h> | 40 | #include <qdirectpainter_qws.h> |
45 | 41 | ||
46 | #include <assert.h> | 42 | #include <assert.h> |
@@ -69,13 +65,13 @@ extern "C" { | |||
69 | 65 | ||
70 | void null_preload_decoders( xine_stream_t *stream ); | 66 | void null_preload_decoders( xine_stream_t *stream ); |
71 | } | 67 | } |
72 | 68 | ||
73 | using namespace XINE; | 69 | using namespace XINE; |
74 | 70 | ||
75 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | 71 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) |
76 | { | 72 | { |
77 | m_initialized = false; | 73 | m_initialized = false; |
78 | m_duringInitialization = false; | 74 | m_duringInitialization = false; |
79 | m_video = false; | 75 | m_video = false; |
80 | m_wid = widget; | 76 | m_wid = widget; |
81 | printf("Lib"); | 77 | printf("Lib"); |
@@ -85,12 +81,22 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | |||
85 | // not really OO, should be an extra class, later | 81 | // not really OO, should be an extra class, later |
86 | if ( !QFile::exists(configPath) ) { | 82 | if ( !QFile::exists(configPath) ) { |
87 | QFile f(configPath); | 83 | QFile f(configPath); |
88 | f.open(IO_WriteOnly); | 84 | f.open(IO_WriteOnly); |
89 | QTextStream ts( &f ); | 85 | QTextStream ts( &f ); |
90 | ts << "misc.memcpy_method:glibc\n"; | 86 | ts << "misc.memcpy_method:glibc\n"; |
87 | ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; | ||
88 | ts << "codec.ffmpeg_pp_quality:3\n"; | ||
89 | ts << "audio.num_buffers:50\n"; | ||
90 | ts << "audio.size_buffers:4160\n"; | ||
91 | ts << "video.num_buffers:20\n"; | ||
92 | ts << "video.size_buffers:4096\n"; | ||
93 | ts << "audio.out_num_audio_buf:16\n"; | ||
94 | ts << "audio.out_size_audio_buf:8096\n"; | ||
95 | ts << "audio.out_size_zero_buf:1024\n"; | ||
96 | ts << "audio.passthrough_offset:0\n"; | ||
91 | f.close(); | 97 | f.close(); |
92 | } | 98 | } |
93 | 99 | ||
94 | if ( initMode == InitializeImmediately ) { | 100 | if ( initMode == InitializeImmediately ) { |
95 | initialize(); | 101 | initialize(); |
96 | m_initialized = true; | 102 | m_initialized = true; |
@@ -136,13 +142,13 @@ void Lib::initialize() | |||
136 | } | 142 | } |
137 | 143 | ||
138 | m_queue = xine_event_new_queue (m_stream); | 144 | m_queue = xine_event_new_queue (m_stream); |
139 | 145 | ||
140 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 146 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
141 | 147 | ||
142 | ::null_preload_decoders( m_stream ); | 148 | ::null_preload_decoders( m_stream ); |
143 | 149 | ||
144 | m_duringInitialization = false; | 150 | m_duringInitialization = false; |
145 | } | 151 | } |
146 | 152 | ||
147 | Lib::~Lib() { | 153 | Lib::~Lib() { |
148 | assert( isRunning() == false ); | 154 | assert( isRunning() == false ); |
@@ -188,14 +194,22 @@ int Lib::subVersion() { | |||
188 | xine_get_version ( &major, &minor, &sub ); | 194 | xine_get_version ( &major, &minor, &sub ); |
189 | return sub; | 195 | return sub; |
190 | } | 196 | } |
191 | 197 | ||
192 | int Lib::play( const QString& fileName, int startPos, int start_time ) { | 198 | int Lib::play( const QString& fileName, int startPos, int start_time ) { |
193 | assert( m_initialized ); | 199 | assert( m_initialized ); |
200 | // FIXME actually a hack imho. Should not be needed to dispose the whole stream | ||
201 | // but without we get wrong media length reads from libxine for the second media | ||
202 | //xine_dispose ( m_stream ); | ||
194 | 203 | ||
195 | QString str = fileName.stripWhiteSpace(); | 204 | QString str = fileName.stripWhiteSpace(); |
205 | |||
206 | //m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); | ||
207 | //m_queue = xine_event_new_queue (m_stream); | ||
208 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); | ||
209 | |||
196 | if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) { | 210 | if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) { |
197 | return 0; | 211 | return 0; |
198 | } | 212 | } |
199 | return xine_play( m_stream, startPos, start_time); | 213 | return xine_play( m_stream, startPos, start_time); |
200 | } | 214 | } |
201 | 215 | ||
@@ -240,21 +254,42 @@ int Lib::currentPosition() const { | |||
240 | 254 | ||
241 | int Lib::currentTime() const { | 255 | int Lib::currentTime() const { |
242 | assert( m_initialized ); | 256 | assert( m_initialized ); |
243 | 257 | ||
244 | int pos, time, length; | 258 | int pos, time, length; |
245 | xine_get_pos_length( m_stream, &pos, &time, &length ); | 259 | xine_get_pos_length( m_stream, &pos, &time, &length ); |
246 | return time/1000; | 260 | if ( time > 0 ) { |
261 | return time/1000; | ||
262 | } else { | ||
263 | return 0; | ||
264 | } | ||
247 | } | 265 | } |
248 | 266 | ||
249 | int Lib::length() const { | 267 | int Lib::length() const { |
250 | assert( m_initialized ); | 268 | assert( m_initialized ); |
251 | 269 | ||
252 | int pos, time, length; | 270 | int pos, time, length; |
253 | xine_get_pos_length( m_stream, &pos, &time, &length ); | 271 | /* dilb: patch to solve the wrong stream length reported to the GUI*/ |
254 | return length/1000; | 272 | int iRetVal=0, iTestLoop=0; |
273 | |||
274 | do | ||
275 | { | ||
276 | iRetVal = xine_get_pos_length( m_stream, &pos, &time, &length ); | ||
277 | if (iRetVal) | ||
278 | {/* if the function didn't return 0, then pos, time and length are valid.*/ | ||
279 | return length/1000; | ||
280 | } | ||
281 | /*don't poll too much*/ | ||
282 | usleep(100000); | ||
283 | iTestLoop++; | ||
284 | } | ||
285 | while ( iTestLoop < 10 ); /* if after 1s, we still don't have any | ||
286 | valid stream, then return -1 (this value could be used to make the stream | ||
287 | unseekable, but it should never occur!! Mr. Murphy ? :) ) */ | ||
288 | |||
289 | return -1; | ||
255 | } | 290 | } |
256 | 291 | ||
257 | bool Lib::isSeekable() const { | 292 | bool Lib::isSeekable() const { |
258 | assert( m_initialized ); | 293 | assert( m_initialized ); |
259 | 294 | ||
260 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); | 295 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); |
@@ -363,15 +398,13 @@ void Lib::setScaling( bool scale ) { | |||
363 | ::null_set_scaling( m_videoOutput, scale ); | 398 | ::null_set_scaling( m_videoOutput, scale ); |
364 | } | 399 | } |
365 | 400 | ||
366 | void Lib::setGamma( int value ) { | 401 | void Lib::setGamma( int value ) { |
367 | assert( m_initialized ); | 402 | assert( m_initialized ); |
368 | 403 | ||
369 | //qDebug( QString( "%1").arg(value) ); | 404 | ::null_set_videoGamma( m_videoOutput, value ); |
370 | /* int gammaValue = ( 100 + value ); */ | ||
371 | ::null_set_videoGamma( m_videoOutput, value ); | ||
372 | } | 405 | } |
373 | 406 | ||
374 | bool Lib::isScaling() const { | 407 | bool Lib::isScaling() const { |
375 | assert( m_initialized ); | 408 | assert( m_initialized ); |
376 | 409 | ||
377 | return ::null_is_scaling( m_videoOutput ); | 410 | return ::null_is_scaling( m_videoOutput ); |
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 181735c..0ff14d0 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -31,18 +31,13 @@ | |||
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef ZECKEXINELIB_H | 34 | #ifndef ZECKEXINELIB_H |
35 | #define ZECKEXINELIB_H | 35 | #define ZECKEXINELIB_H |
36 | 36 | ||
37 | #include <qcstring.h> | ||
38 | #include <qstring.h> | ||
39 | #include <qobject.h> | ||
40 | |||
41 | #include <xine.h> | 37 | #include <xine.h> |
42 | //#include "xine.h" | ||
43 | 38 | ||
44 | #include "threadutil.h" | 39 | #include "threadutil.h" |
45 | 40 | ||
46 | class XineVideoWidget; | 41 | class XineVideoWidget; |
47 | 42 | ||
48 | namespace XINE { | 43 | namespace XINE { |
diff --git a/noncore/multimedia/opieplayer2/mediadetect.cpp b/noncore/multimedia/opieplayer2/mediadetect.cpp deleted file mode 100644 index 91137db..0000000 --- a/noncore/multimedia/opieplayer2/mediadetect.cpp +++ b/dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | #include <qstring.h> | ||
2 | #include "mediadetect.h" | ||
3 | |||
4 | |||
5 | MediaDetect::MediaDetect() { | ||
6 | } | ||
7 | |||
8 | MediaDetect::~MediaDetect() { | ||
9 | } | ||
10 | |||
11 | char MediaDetect::videoOrAudio( const QString& fileName ) { | ||
12 | if( (fileName.lower()).right(4) == ".avi" || | ||
13 | (fileName.lower()).right(4) == ".mpg" || | ||
14 | (fileName.lower()).right(4) == ".asf" || | ||
15 | (fileName.lower()).right(4) == ".mov" || | ||
16 | (fileName.lower()).right(5) == ".mpeg" ) { | ||
17 | qDebug("Video out taken"); | ||
18 | return 'v'; | ||
19 | } else if ( (fileName.lower()).right(4) == "·mp1" || | ||
20 | (fileName.lower()).right(4) == ".mp3" || | ||
21 | (fileName.lower()).right(4) == ".ogg" || | ||
22 | (fileName.lower()).right(4) == ".wav" ) { | ||
23 | qDebug("AUDIO out taken"); | ||
24 | return 'a'; | ||
25 | } else if ( (fileName.lower()).left(7) == "http://" && | ||
26 | (fileName.lower()).right(1) == "/" ) { | ||
27 | return 'a'; | ||
28 | } else { | ||
29 | return 'f'; | ||
30 | } | ||
31 | } | ||
32 | |||
33 | bool MediaDetect::isStreaming( const QString& fileName ) { | ||
34 | // ugly | ||
35 | if( (fileName.lower()).left(4) == "http" ) { | ||
36 | return true; | ||
37 | } else if ( (fileName.lower()).left(3) == "ftp" ) { | ||
38 | return true; | ||
39 | } else { | ||
40 | return false; | ||
41 | } | ||
42 | } | ||
43 | |||
diff --git a/noncore/multimedia/opieplayer2/mediadetect.h b/noncore/multimedia/opieplayer2/mediadetect.h deleted file mode 100644 index bd5ea1d..0000000 --- a/noncore/multimedia/opieplayer2/mediadetect.h +++ b/dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | |||
2 | #ifndef MEDIADETECT_H | ||
3 | #define MEDIADETECT_H | ||
4 | |||
5 | |||
6 | class QString; | ||
7 | class MediaDetect { | ||
8 | |||
9 | public: | ||
10 | MediaDetect(); | ||
11 | ~MediaDetect(); | ||
12 | |||
13 | /** | ||
14 | * Look at the filename and decide which gui is to be used | ||
15 | * | ||
16 | * @param filename the filename | ||
17 | * @return the char - a for audio gui, v for video, f for error | ||
18 | */ | ||
19 | char videoOrAudio( const QString& fileName ); | ||
20 | |||
21 | /** | ||
22 | * Find out if it is a streaming media file | ||
23 | * | ||
24 | * @param filename the filename | ||
25 | * @return if it is a streaming url or not | ||
26 | */ | ||
27 | bool isStreaming( const QString& fileName ); | ||
28 | |||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index d4396d2..9f51006 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -1,35 +1,26 @@ | |||
1 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
2 | #include <qpe/qlibrary.h> | ||
3 | #include <qpe/resource.h> | ||
4 | #include <qpe/config.h> | 2 | #include <qpe/config.h> |
5 | #include <qpe/qcopenvelope_qws.h> | 3 | #include <qpe/qcopenvelope_qws.h> |
6 | #include <qfileinfo.h> | 4 | #include <qfileinfo.h> |
7 | 5 | ||
8 | #include <qmainwindow.h> | ||
9 | #include <qmessagebox.h> | ||
10 | #include <qwidgetstack.h> | ||
11 | #include <qfile.h> | ||
12 | |||
13 | #include "mediaplayer.h" | 6 | #include "mediaplayer.h" |
14 | #include "playlistwidget.h" | 7 | #include "playlistwidget.h" |
15 | #include "audiowidget.h" | 8 | #include "audiowidget.h" |
16 | #include "videowidget.h" | 9 | #include "videowidget.h" |
17 | #include "volumecontrol.h" | 10 | #include "volumecontrol.h" |
18 | #include "lib.h" | 11 | #include "lib.h" |
19 | 12 | ||
20 | #include "mediaplayerstate.h" | 13 | #include "mediaplayerstate.h" |
21 | 14 | ||
22 | // for setBacklight() | 15 | // for setBacklight() |
23 | #include <linux/fb.h> | 16 | #include <linux/fb.h> |
24 | #include <sys/file.h> | 17 | #include <sys/file.h> |
25 | #include <sys/ioctl.h> | 18 | #include <sys/ioctl.h> |
26 | 19 | ||
27 | 20 | ||
28 | |||
29 | |||
30 | #define FBIOBLANK 0x4611 | 21 | #define FBIOBLANK 0x4611 |
31 | 22 | ||
32 | MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) | 23 | MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) |
33 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { | 24 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { |
34 | 25 | ||
35 | m_audioUI = 0; | 26 | m_audioUI = 0; |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h index cbe4d86..34ff064 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.h +++ b/noncore/multimedia/opieplayer2/mediaplayer.h | |||
@@ -31,15 +31,12 @@ | |||
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef MEDIA_PLAYER_H | 34 | #ifndef MEDIA_PLAYER_H |
35 | #define MEDIA_PLAYER_H | 35 | #define MEDIA_PLAYER_H |
36 | 36 | ||
37 | #include <qmainwindow.h> | ||
38 | #include <qframe.h> | ||
39 | |||
40 | #include "xinecontrol.h" | 37 | #include "xinecontrol.h" |
41 | 38 | ||
42 | #include "playlistwidget.h" | 39 | #include "playlistwidget.h" |
43 | #include "skin.h" | 40 | #include "skin.h" |
44 | 41 | ||
45 | class DocLnk; | 42 | class DocLnk; |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 3953d92..b1f88c9 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -17,12 +17,14 @@ | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; see the file COPYING. If not, write to | 18 | along with this program; see the file COPYING. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <assert.h> | ||
24 | |||
23 | #include "mediawidget.h" | 25 | #include "mediawidget.h" |
24 | #include "playlistwidget.h" | 26 | #include "playlistwidget.h" |
25 | #include "skin.h" | 27 | #include "skin.h" |
26 | 28 | ||
27 | #include <assert.h> | 29 | #include <assert.h> |
28 | 30 | ||
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 841d950..7183fb4 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp | |||
@@ -71,21 +71,15 @@ void Om3u::readM3u() { | |||
71 | QString name = f.baseName(); | 71 | QString name = f.baseName(); |
72 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 72 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
73 | s=s.replace( QRegExp( "\\" ), "/" ); | 73 | s=s.replace( QRegExp( "\\" ), "/" ); |
74 | append(s); | 74 | append(s); |
75 | // qDebug(s); | 75 | // qDebug(s); |
76 | } else { // is url | 76 | } else { // is url |
77 | s.replace( QRegExp( "%20" )," " ); | ||
78 | QString name; | 77 | QString name; |
79 | // if( name.left( 4 ) == "http" ) { | 78 | name = s; |
80 | // name = s.right( s.length() - 7 ); | ||
81 | // } else { | ||
82 | name = s; | ||
83 | // } | ||
84 | append(name); | 79 | append(name); |
85 | // qDebug(name); | ||
86 | } | 80 | } |
87 | } | 81 | } |
88 | } | 82 | } |
89 | } | 83 | } |
90 | 84 | ||
91 | void Om3u::readPls() { //it's a pls file | 85 | void Om3u::readPls() { //it's a pls file |
@@ -144,13 +138,13 @@ void Om3u::add(const QString &filePath) { //adds to m3u file | |||
144 | void Om3u::remove(const QString &filePath) { //removes from m3u list | 138 | void Om3u::remove(const QString &filePath) { //removes from m3u list |
145 | QString list, currentFile; | 139 | QString list, currentFile; |
146 | if(count()>0) { | 140 | if(count()>0) { |
147 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 141 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
148 | currentFile=*it; | 142 | currentFile=*it; |
149 | // qDebug(*it); | 143 | // qDebug(*it); |
150 | 144 | ||
151 | if( filePath != currentFile) | 145 | if( filePath != currentFile) |
152 | list += currentFile+"\n"; | 146 | list += currentFile+"\n"; |
153 | } | 147 | } |
154 | f.writeBlock( list, list.length() ); | 148 | f.writeBlock( list, list.length() ); |
155 | } | 149 | } |
156 | } | 150 | } |
diff --git a/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.control b/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.control new file mode 100644 index 0000000..0e71fc5 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.control | |||
@@ -0,0 +1,10 @@ | |||
1 | Package: opie-mediaplayer2-codecs | ||
2 | Files: root/usr/lib/libao.so* root/usr/lib/libogg* root/usr/lib/libvorbisidec.so* root/usr/lib/libxine.so* root/usr/lib/xine/* | ||
3 | Section: opie/multimedia | ||
4 | Essential: no | ||
5 | Priority: optional | ||
6 | Version: 0.7-$SUB_VERSION.3 | ||
7 | Architecture: arm | ||
8 | Maintainer: Maximilian Reiss <harlekin@handhelds.org> | ||
9 | Depends: libc6 (>= 2.1), opie-mediaplayer2 | ||
10 | Description: Codecs for opieplayer 2 | ||
diff --git a/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.postinst b/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.postinst new file mode 100755 index 0000000..8e60212 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/opie-mediaplayer2-codecs.postinst | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ "$1" = "configure" ] || exit 1 | ||
4 | |||
5 | ldconfig \ No newline at end of file | ||
diff --git a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control index c072308..10c5d19 100644 --- a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control +++ b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-mediaplayer2 | 1 | Package: opie-mediaplayer2 |
2 | Files: bin/opieplayer2 apps/Applications/mediaplayer.desktop pics/opieplayer2/add_to_playlist.png pics/opieplayer2/cut.png pics/opieplayer2/delete.png pics/opieplayer2/down.png pics/opieplayer2/loop.png pics/opieplayer2/MPEGPlayer.png pics/opieplayer2/musicfile.png pics/opieplayer2/playlist2.png pics/opieplayer2/play.png pics/opieplayer2/remove_from_playlist.png pics/opieplayer2/shuffle.png pics/opieplayer2/up.png pics/opieplayer2/videofile.png | 2 | Files: bin/opieplayer2 apps/Applications/mediaplayer.desktop pics/opieplayer2/add_to_playlist.png pics/opieplayer2/cut.png pics/opieplayer2/delete.png pics/opieplayer2/down.png pics/opieplayer2/loop.png pics/opieplayer2/MPEGPlayer.png pics/opieplayer2/musicfile.png pics/opieplayer2/playlist2.png pics/opieplayer2/play.png pics/opieplayer2/remove_from_playlist.png pics/opieplayer2/shuffle.png pics/opieplayer2/up.png pics/opieplayer2/videofile.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: L.J.Potter <ljp@llornkcor.com>, Maximilian Reiss <harlekin@handhelds.org> | 5 | Maintainer: L.J.Potter <ljp@llornkcor.com>, Maximilian Reiss <harlekin@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | 7 | Depends: task-opie-minimal, libopie1, zlib1g, libstdc++2.10-glibc2.2, opie-mediaplayer2-skin-default | opie-mediaplayer2-skin-default-landscape , libxine1 | opie-mediaplayer2-codecs |
8 | Depends: task-opie-minimal, libopie1, zlib1g, opie-mediaplayer2-skin-default | opie-mediaplayer2-skin-default-landscape , libxine1 | opie-mediaplayer-codecs | ||
9 | Description: The Opie media player | 8 | Description: The Opie media player |
10 | The mediaplayer for Opie. It plays mp3, mpeg, wav, ogg, quicktime, divx and | 9 | The mediaplayer for Opie. It plays mp3, mpeg, wav, ogg, quicktime, divx and |
11 | more. Also it is streaming capable. | 10 | more. Also it is streaming capable. |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 57cd18f..5dabbab 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -8,13 +8,13 @@ HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ | |||
8 | skin.h | 8 | skin.h |
9 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ | 10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ |
11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ | 11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ |
12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ | 12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ |
13 | playlistwidgetgui.cpp\ | 13 | playlistwidgetgui.cpp\ |
14 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ | 14 | alphablend.c yuv2rgb.c yuv2rgb_arm2.c yuv2rgb_arm4l.S \ |
15 | threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp \ | 15 | threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp \ |
16 | skin.cpp | 16 | skin.cpp |
17 | TARGET = opieplayer2 | 17 | TARGET = opieplayer2 |
18 | INCLUDEPATH += $(OPIEDIR)/include | 18 | INCLUDEPATH += $(OPIEDIR)/include |
19 | DEPENDPATH += $(OPIEDIR)/include | 19 | DEPENDPATH += $(OPIEDIR)/include |
20 | LIBS += -lqpe -lpthread -lopie -lxine -lstdc++ | 20 | LIBS += -lqpe -lpthread -lopie -lxine -lstdc++ |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 5f750ba..a1a1016 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -28,37 +28,26 @@ | |||
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpetoolbar.h> | 34 | #include <qtoolbar.h> |
35 | #include <qpe/qpeapplication.h> | ||
36 | #include <qpe/storage.h> | ||
37 | #include <qpe/mimetype.h> | ||
38 | #include <qpe/global.h> | ||
39 | #include <qpe/resource.h> | ||
40 | #include <qpe/config.h> | ||
41 | 35 | ||
42 | #include <opie/ofiledialog.h> | 36 | #include <opie/ofiledialog.h> |
43 | 37 | ||
44 | #include <qdatetime.h> | ||
45 | #include <qdir.h> | ||
46 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
47 | #include <qregexp.h> | ||
48 | #include <qtextstream.h> | ||
49 | 39 | ||
50 | #include "playlistselection.h" | 40 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 41 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 42 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 43 | #include "inputDialog.h" |
54 | #include "om3u.h" | 44 | #include "om3u.h" |
55 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
56 | 46 | ||
57 | //only needed for the random play | 47 | //only needed for the random play |
58 | #include <stdlib.h> | ||
59 | #include <assert.h> | 48 | #include <assert.h> |
60 | 49 | ||
61 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 50 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
62 | : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) | 51 | : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) |
63 | { | 52 | { |
64 | 53 | ||
@@ -664,45 +653,47 @@ void PlayListWidget::openFile() { | |||
664 | Config cfg( "OpiePlayer" ); | 653 | Config cfg( "OpiePlayer" ); |
665 | cfg.setGroup("Dialog"); | 654 | cfg.setGroup("Dialog"); |
666 | MimeTypes types; | 655 | MimeTypes types; |
667 | QStringList audio, video, all; | 656 | QStringList audio, video, all; |
668 | audio << "audio/*"; | 657 | audio << "audio/*"; |
669 | audio << "playlist/plain"; | 658 | audio << "playlist/plain"; |
659 | audio << "application/ogg"; | ||
670 | audio << "audio/x-mpegurl"; | 660 | audio << "audio/x-mpegurl"; |
671 | 661 | ||
672 | video << "video/*"; | 662 | video << "video/*"; |
673 | video << "playlist/plain"; | 663 | video << "playlist/plain"; |
674 | 664 | ||
675 | all += audio; | 665 | all += audio; |
676 | all += video; | 666 | all += video; |
677 | types.insert("All Media Files", all ); | 667 | types.insert("All Media Files", all ); |
678 | types.insert("Audio", audio ); | 668 | types.insert("Audio", audio ); |
679 | types.insert("Video", video ); | 669 | types.insert("Video", video ); |
680 | 670 | ||
681 | QString str = OFileDialog::getOpenFileName( 1, | 671 | QString str = OFileDialog::getOpenFileName( 1, |
682 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | 672 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", |
683 | types, 0 ); | 673 | types, 0 ); |
684 | if(str.left(2) == "//") str=str.right(str.length()-1); | ||
685 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); | ||
686 | 674 | ||
675 | if(str.left(2) == "//") { | ||
676 | str=str.right(str.length()-1); | ||
677 | } | ||
678 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); | ||
687 | 679 | ||
688 | if( !str.isEmpty() ) { | 680 | if( !str.isEmpty() ) { |
681 | |||
689 | qDebug( "Selected filename is " + str ); | 682 | qDebug( "Selected filename is " + str ); |
690 | filename = str; | 683 | filename = str; |
691 | DocLnk lnk; | 684 | DocLnk lnk; |
692 | Config cfg( "OpiePlayer" ); | ||
693 | cfg.setGroup("PlayList"); | ||
694 | 685 | ||
695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { | 686 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { |
696 | readListFromFile( filename ); | 687 | readListFromFile( filename ); |
697 | } else { | 688 | } else { |
698 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 689 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
699 | lnk.setFile( filename ); //sets file name | 690 | lnk.setFile( filename ); //sets file name |
700 | d->selectedFiles->addToSelection( lnk); | 691 | d->selectedFiles->addToSelection( lnk ); |
701 | writeCurrentM3u(); | 692 | writeCurrentM3u(); |
702 | d->selectedFiles->setSelectedItem( lnk.name()); | 693 | d->selectedFiles->setSelectedItem( lnk.name() ); |
703 | } | 694 | } |
704 | } | 695 | } |
705 | } | 696 | } |
706 | 697 | ||
707 | 698 | ||
708 | void PlayListWidget::readListFromFile( const QString &filename ) { | 699 | void PlayListWidget::readListFromFile( const QString &filename ) { |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 5230b03..fc305cd 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -31,24 +31,19 @@ | |||
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef PLAY_LIST_WIDGET_H | 34 | #ifndef PLAY_LIST_WIDGET_H |
35 | #define PLAY_LIST_WIDGET_H | 35 | #define PLAY_LIST_WIDGET_H |
36 | 36 | ||
37 | #include <qmainwindow.h> | 37 | |
38 | #include <qpe/applnk.h> | ||
39 | #include <qtabwidget.h> | ||
40 | #include <qpe/fileselector.h> | ||
41 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
42 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
43 | #include <qpe/qcopenvelope_qws.h> | 40 | #include <qpe/qcopenvelope_qws.h> |
44 | 41 | ||
45 | #include "playlistwidgetgui.h" | 42 | #include "playlistwidgetgui.h" |
46 | 43 | ||
47 | |||
48 | //class PlayListWidgetPrivate; | ||
49 | class Config; | 44 | class Config; |
50 | class QListViewItem; | 45 | class QListViewItem; |
51 | class QListView; | 46 | class QListView; |
52 | class QPoint; | 47 | class QPoint; |
53 | class QAction; | 48 | class QAction; |
54 | class QLabel; | 49 | class QLabel; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 5fc0c39..293bf45 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -28,57 +28,45 @@ | |||
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpemenubar.h> | 34 | |
35 | #include <qpe/qpetoolbar.h> | 35 | #include <qtoolbar.h> |
36 | #include <qpe/fileselector.h> | ||
37 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
38 | #include <qpe/storage.h> | 37 | |
39 | #include <qpe/mimetype.h> | ||
40 | #include <qpe/config.h> | ||
41 | #include <qpe/global.h> | ||
42 | #include <qpe/resource.h> | ||
43 | |||
44 | #include <qpopupmenu.h> | ||
45 | #include <qaction.h> | ||
46 | #include <qcursor.h> | ||
47 | #include <qdir.h> | ||
48 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | #include <qmenubar.h> | ||
49 | 40 | ||
50 | #include "playlistselection.h" | 41 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 42 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 43 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 44 | #include "inputDialog.h" |
54 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
55 | 46 | ||
56 | //only needed for the random play | ||
57 | #include <stdlib.h> | ||
58 | |||
59 | #include "mediaplayerstate.h" | 47 | #include "mediaplayerstate.h" |
60 | 48 | ||
61 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) | 49 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) |
62 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { | 50 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { |
63 | 51 | ||
64 | d = new PlayListWidgetPrivate; | 52 | d = new PlayListWidgetPrivate; |
65 | d->setDocumentUsed = FALSE; | 53 | d->setDocumentUsed = FALSE; |
66 | 54 | ||
67 | setBackgroundMode( PaletteButton ); | 55 | setBackgroundMode( PaletteButton ); |
68 | setToolBarsMovable( FALSE ); | 56 | setToolBarsMovable( FALSE ); |
69 | 57 | ||
70 | // Create Toolbar | 58 | // Create Toolbar |
71 | QPEToolBar *toolbar = new QPEToolBar( this ); | 59 | QToolBar *toolbar = new QToolBar( this ); |
72 | toolbar->setHorizontalStretchable( TRUE ); | 60 | toolbar->setHorizontalStretchable( TRUE ); |
73 | 61 | ||
74 | // Create Menubar | 62 | // Create Menubar |
75 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 63 | QMenuBar *menu = new QMenuBar( toolbar ); |
76 | menu->setMargin( 0 ); | 64 | menu->setMargin( 0 ); |
77 | 65 | ||
78 | bar = new QPEToolBar( this ); | 66 | bar = new QToolBar( this ); |
79 | bar->setLabel( tr( "Play Operations" ) ); | 67 | bar->setLabel( tr( "Play Operations" ) ); |
80 | 68 | ||
81 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 69 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
82 | tbDeletePlaylist->setFlat( TRUE ); | 70 | tbDeletePlaylist->setFlat( TRUE ); |
83 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 71 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
84 | 72 | ||
@@ -145,13 +133,13 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg | |||
145 | aTab = new QWidget( tabWidget, "aTab" ); | 133 | aTab = new QWidget( tabWidget, "aTab" ); |
146 | 134 | ||
147 | QGridLayout *Alayout = new QGridLayout( aTab ); | 135 | QGridLayout *Alayout = new QGridLayout( aTab ); |
148 | Alayout->setSpacing( 2 ); | 136 | Alayout->setSpacing( 2 ); |
149 | Alayout->setMargin( 2 ); | 137 | Alayout->setMargin( 2 ); |
150 | // no m3u's here please | 138 | // no m3u's here please |
151 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg", "opieplayer2/musicfile", aTab, "Audioview" ); | 139 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" ); |
152 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 140 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
153 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 141 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
154 | 142 | ||
155 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 143 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
156 | 144 | ||
157 | QWidget *vTab; | 145 | QWidget *vTab; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index c965b0d..c0cd37a 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h | |||
@@ -32,31 +32,28 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef PLAY_LIST_WIDGET_GUI_H | 34 | #ifndef PLAY_LIST_WIDGET_GUI_H |
35 | #define PLAY_LIST_WIDGET_GUI_H | 35 | #define PLAY_LIST_WIDGET_GUI_H |
36 | 36 | ||
37 | #include <qmainwindow.h> | 37 | #include <qmainwindow.h> |
38 | #include <qpe/applnk.h> | ||
39 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
40 | #include <qpe/qpemenubar.h> | ||
41 | 39 | ||
42 | #include <qtabwidget.h> | 40 | #include <qtabwidget.h> |
43 | #include <qpe/fileselector.h> | 41 | #include <qpe/fileselector.h> |
44 | #include <qpushbutton.h> | ||
45 | #include <qpopupmenu.h> | ||
46 | #include <qaction.h> | 42 | #include <qaction.h> |
43 | #include <qtoolbutton.h> | ||
47 | #include <qslider.h> | 44 | #include <qslider.h> |
48 | #include <qlcdnumber.h> | 45 | #include <qlcdnumber.h> |
49 | 46 | ||
50 | class PlayListWidgetPrivate; | 47 | class PlayListWidgetPrivate; |
51 | class PlayListSelection; | 48 | class PlayListSelection; |
52 | class MediaPlayerState; | 49 | class MediaPlayerState; |
53 | class PlayListFileView; | 50 | class PlayListFileView; |
54 | 51 | ||
55 | class Config; | 52 | class Config; |
56 | class QPEToolBar; | 53 | class QToolBar; |
57 | class QListViewItem; | 54 | class QListViewItem; |
58 | class QListView; | 55 | class QListView; |
59 | class QPoint; | 56 | class QPoint; |
60 | class QAction; | 57 | class QAction; |
61 | class QLabel; | 58 | class QLabel; |
62 | 59 | ||
@@ -77,13 +74,12 @@ public: | |||
77 | setTextLabel( name ); | 74 | setTextLabel( name ); |
78 | setPixmap( Resource::loadPixmap( icon ) ); | 75 | setPixmap( Resource::loadPixmap( icon ) ); |
79 | setAutoRaise( TRUE ); | 76 | setAutoRaise( TRUE ); |
80 | setFocusPolicy( QWidget::NoFocus ); | 77 | setFocusPolicy( QWidget::NoFocus ); |
81 | setToggleButton( t ); | 78 | setToggleButton( t ); |
82 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 79 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
83 | QPEMenuToolFocusManager::manager()->addWidget( this ); | ||
84 | } | 80 | } |
85 | }; | 81 | }; |
86 | 82 | ||
87 | class MenuItem : public QAction { | 83 | class MenuItem : public QAction { |
88 | 84 | ||
89 | public: | 85 | public: |
@@ -118,13 +114,13 @@ protected: | |||
118 | QPopupMenu *pmPlayList; | 114 | QPopupMenu *pmPlayList; |
119 | FileSelector* playLists; | 115 | FileSelector* playLists; |
120 | QPopupMenu *skinsMenu; | 116 | QPopupMenu *skinsMenu; |
121 | PlayListWidgetPrivate *d; // Private implementation data | 117 | PlayListWidgetPrivate *d; // Private implementation data |
122 | QVBox *vbox1; | 118 | QVBox *vbox1; |
123 | QVBox *vbox5; | 119 | QVBox *vbox5; |
124 | QPEToolBar *bar; | 120 | QToolBar *bar; |
125 | QWidget *playListTab; | 121 | QWidget *playListTab; |
126 | void setActiveWindow(); // need to handle this to show the right view | 122 | void setActiveWindow(); // need to handle this to show the right view |
127 | void setView( char ); | 123 | void setView( char ); |
128 | 124 | ||
129 | MediaPlayerState &mediaPlayerState; | 125 | MediaPlayerState &mediaPlayerState; |
130 | }; | 126 | }; |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 755cd22..c829e03 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -28,22 +28,12 @@ | |||
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | ||
35 | #include <qpe/resource.h> | ||
36 | #include <qpe/config.h> | ||
37 | |||
38 | |||
39 | #include <qwidget.h> | ||
40 | #include <qpainter.h> | ||
41 | #include <qpixmap.h> | ||
42 | #include <qslider.h> | ||
43 | #include <qdrawutil.h> | ||
44 | #include "videowidget.h" | 34 | #include "videowidget.h" |
45 | #include "mediaplayerstate.h" | 35 | #include "mediaplayerstate.h" |
46 | #include "playlistwidget.h" | 36 | #include "playlistwidget.h" |
47 | 37 | ||
48 | 38 | ||
49 | #ifdef Q_WS_QWS | 39 | #ifdef Q_WS_QWS |
@@ -71,13 +61,13 @@ const MediaWidget::SkinButtonInfo skinInfo[] = | |||
71 | }; | 61 | }; |
72 | 62 | ||
73 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 63 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
74 | 64 | ||
75 | } | 65 | } |
76 | 66 | ||
77 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 67 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
78 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) | 68 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) |
79 | { | 69 | { |
80 | setCaption( tr("OpiePlayer - Video") ); | 70 | setCaption( tr("OpiePlayer - Video") ); |
81 | 71 | ||
82 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 72 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
83 | 73 | ||
@@ -92,13 +82,13 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
92 | setPosition( mediaPlayerState.position() ); | 82 | setPosition( mediaPlayerState.position() ); |
93 | setFullscreen( mediaPlayerState.isFullscreen() ); | 83 | setFullscreen( mediaPlayerState.isFullscreen() ); |
94 | setPlaying( mediaPlayerState.isPlaying() ); | 84 | setPlaying( mediaPlayerState.isPlaying() ); |
95 | } | 85 | } |
96 | 86 | ||
97 | 87 | ||
98 | VideoWidget::~VideoWidget() | 88 | VideoWidget::~VideoWidget() |
99 | { | 89 | { |
100 | } | 90 | } |
101 | 91 | ||
102 | MediaWidget::GUIInfo VideoWidget::guiInfo() | 92 | MediaWidget::GUIInfo VideoWidget::guiInfo() |
103 | { | 93 | { |
104 | return GUIInfo( "V" /* infix */, ::skinInfo, ::buttonCount ); | 94 | return GUIInfo( "V" /* infix */, ::skinInfo, ::buttonCount ); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 84bc964..8c6896b 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -31,17 +31,13 @@ | |||
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef VIDEO_WIDGET_H | 34 | #ifndef VIDEO_WIDGET_H |
35 | #define VIDEO_WIDGET_H | 35 | #define VIDEO_WIDGET_H |
36 | 36 | ||
37 | #include <qwidget.h> | ||
38 | #include <qimage.h> | ||
39 | #include <qpixmap.h> | ||
40 | #include "xinevideowidget.h" | 37 | #include "xinevideowidget.h" |
41 | |||
42 | #include "mediawidget.h" | 38 | #include "mediawidget.h" |
43 | 39 | ||
44 | class QPixmap; | 40 | class QPixmap; |
45 | class QSlider; | 41 | class QSlider; |
46 | 42 | ||
47 | class VideoWidget : public MediaWidget { | 43 | class VideoWidget : public MediaWidget { |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 1c489e3..a392f4a 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -33,28 +33,29 @@ | |||
33 | 33 | ||
34 | 34 | ||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | |||
39 | #include "xinecontrol.h" | 40 | #include "xinecontrol.h" |
40 | #include "mediaplayerstate.h" | 41 | #include "mediaplayerstate.h" |
41 | #include "xinevideowidget.h" | 42 | #include "xinevideowidget.h" |
42 | 43 | ||
43 | XineControl::XineControl( XineVideoWidget *xineWidget, | 44 | XineControl::XineControl( XineVideoWidget *xineWidget, |
44 | MediaPlayerState &_mediaPlayerState, | 45 | MediaPlayerState &_mediaPlayerState, |
45 | QObject *parent, const char *name ) | 46 | QObject *parent, const char *name ) |
46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 47 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
47 | { | 48 | { |
48 | libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); | 49 | libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); |
49 | 50 | ||
50 | init(); | 51 | init(); |
51 | } | 52 | } |
52 | 53 | ||
53 | XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, | 54 | XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, |
54 | MediaPlayerState &_mediaPlayerState, | 55 | MediaPlayerState &_mediaPlayerState, |
55 | QObject *parent, const char *name ) | 56 | QObject *parent, const char *name ) |
56 | : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 57 | : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
57 | { | 58 | { |
58 | xine->ensureInitialized(); | 59 | xine->ensureInitialized(); |
59 | 60 | ||
60 | xine->setWidget( xineWidget ); | 61 | xine->setWidget( xineWidget ); |
@@ -85,12 +86,13 @@ XineControl::~XineControl() { | |||
85 | } | 86 | } |
86 | #endif | 87 | #endif |
87 | delete libXine; | 88 | delete libXine; |
88 | } | 89 | } |
89 | 90 | ||
90 | void XineControl::play( const QString& fileName ) { | 91 | void XineControl::play( const QString& fileName ) { |
92 | |||
91 | hasVideoChannel = FALSE; | 93 | hasVideoChannel = FALSE; |
92 | hasAudioChannel = FALSE; | 94 | hasAudioChannel = FALSE; |
93 | m_fileName = fileName; | 95 | m_fileName = fileName; |
94 | 96 | ||
95 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 97 | qDebug("<<FILENAME: " + fileName + ">>>>"); |
96 | 98 | ||
@@ -100,13 +102,12 @@ void XineControl::play( const QString& fileName ) { | |||
100 | mediaPlayerState.setPlaying( false ); | 102 | mediaPlayerState.setPlaying( false ); |
101 | return; | 103 | return; |
102 | } | 104 | } |
103 | mediaPlayerState.setPlaying( true ); | 105 | mediaPlayerState.setPlaying( true ); |
104 | 106 | ||
105 | MediaPlayerState::DisplayType displayType; | 107 | MediaPlayerState::DisplayType displayType; |
106 | // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); | ||
107 | if ( !libXine->hasVideo() ) { | 108 | if ( !libXine->hasVideo() ) { |
108 | displayType = MediaPlayerState::Audio; | 109 | displayType = MediaPlayerState::Audio; |
109 | qDebug("HAS AUDIO"); | 110 | qDebug("HAS AUDIO"); |
110 | libXine->setShowVideo( false ); | 111 | libXine->setShowVideo( false ); |
111 | hasAudioChannel = TRUE; | 112 | hasAudioChannel = TRUE; |
112 | } else { | 113 | } else { |
@@ -194,13 +195,12 @@ long XineControl::position() { | |||
194 | long emitPos = (long)m_position; | 195 | long emitPos = (long)m_position; |
195 | emit positionChanged( emitPos ); | 196 | emit positionChanged( emitPos ); |
196 | if( mediaPlayerState.isPlaying() ) { | 197 | if( mediaPlayerState.isPlaying() ) { |
197 | // needs to be stopped the media is stopped | 198 | // needs to be stopped the media is stopped |
198 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | 199 | QTimer::singleShot( 1000, this, SLOT( position() ) ); |
199 | } | 200 | } |
200 | // qDebug("POSITION : %d", m_position); | ||
201 | return m_position; | 201 | return m_position; |
202 | } | 202 | } |
203 | 203 | ||
204 | /** | 204 | /** |
205 | * Set videoplayback to fullscreen | 205 | * Set videoplayback to fullscreen |
206 | * @param isSet | 206 | * @param isSet |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 0e985d6..3f44f2e 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -32,13 +32,12 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef XINECONTROL_H | 34 | #ifndef XINECONTROL_H |
35 | #define XINECONTROL_H | 35 | #define XINECONTROL_H |
36 | 36 | ||
37 | #include "lib.h" | 37 | #include "lib.h" |
38 | #include <qobject.h> | ||
39 | 38 | ||
40 | #include "mediaplayerstate.h" | 39 | #include "mediaplayerstate.h" |
41 | 40 | ||
42 | class XineControl : public QObject { | 41 | class XineControl : public QObject { |
43 | Q_OBJECT | 42 | Q_OBJECT |
44 | public: | 43 | public: |
diff --git a/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c b/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c new file mode 100644 index 0000000..cbd32e8 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c | |||
@@ -0,0 +1,875 @@ | |||
1 | /* | ||
2 | * yuv2rgb_arm2.c | ||
3 | * Copyright (C) 2002 Frederic 'dilb' Boulay. | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Author: Frederic Boulay <dilb@handhelds.org> | ||
7 | * | ||
8 | * you can redistribute this file and/or modify | ||
9 | * it under the terms of the GNU General Public License (version 2) | ||
10 | * as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This file is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * | ||
22 | * The function defined in this file, are derived from work done in the xine | ||
23 | * project. | ||
24 | * In order to improve performance, by strongly reducing memory bandwidth | ||
25 | * needed, the scaling functions are merged with the yuv2rgb function. | ||
26 | */ | ||
27 | |||
28 | #ifdef __arm__ | ||
29 | |||
30 | #include <stdio.h> | ||
31 | #include <stdlib.h> | ||
32 | #include <string.h> | ||
33 | #include <inttypes.h> | ||
34 | |||
35 | #include "yuv2rgb.h" | ||
36 | #include <xine/xineutils.h> | ||
37 | |||
38 | /* Prototypes of the "local" functions available here: */ | ||
39 | /* first prototype, function called when no scaling is needed: */ | ||
40 | static void arm_rgb16_noscale(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
41 | /* second prototype, function called when no horizontal scaling is needed: */ | ||
42 | static void arm_rgb16_step_dx_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
43 | /* third prototype, function called when scaling is needed for zooming in: */ | ||
44 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
45 | /* fourth prototype, function called when scaling is needed for zooming out (between 1x and 2x): */ | ||
46 | static void arm_rgb16_step_dx_bet_32768_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
47 | /* fifth prototype, function called when scaling is needed for zooming out (greater than 2x): */ | ||
48 | static void arm_rgb16_step_dx_sup_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
49 | /* sixth prototype, function where the decision of the scaling function to use is made.*/ | ||
50 | static void arm_rgb16_2 (yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | ||
51 | |||
52 | |||
53 | |||
54 | |||
55 | /* extern function: */ | ||
56 | |||
57 | /* Function: */ | ||
58 | void yuv2rgb_init_arm (yuv2rgb_factory_t *this) | ||
59 | /* This function initialise the member yuv2rgb_fun, if everything is right | ||
60 | the function optimised for the arm target should be used.*/ | ||
61 | { | ||
62 | if (this->swapped) | ||
63 | return; /*no swapped pixel output upto now*/ | ||
64 | |||
65 | switch (this->mode) | ||
66 | { | ||
67 | case MODE_16_RGB: | ||
68 | this->yuv2rgb_fun = arm_rgb16_2; | ||
69 | break; | ||
70 | default: | ||
71 | } | ||
72 | } | ||
73 | |||
74 | |||
75 | |||
76 | /* local functions: */ | ||
77 | |||
78 | /* Function: */ | ||
79 | static void arm_rgb16_2 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
80 | /* This function takes care of applying the right scaling conversion | ||
81 | (yuv2rgb is included in each scaling function!)*/ | ||
82 | { | ||
83 | if (!this->do_scale) | ||
84 | { | ||
85 | arm_rgb16_noscale(this, _dst, _py, _pu, _pv); | ||
86 | return; | ||
87 | } | ||
88 | if (this->step_dx<32768) | ||
89 | { | ||
90 | arm_rgb16_step_dx_inf_32768(this, _dst, _py, _pu, _pv); | ||
91 | return; | ||
92 | } | ||
93 | if (this->step_dx==32768) | ||
94 | { | ||
95 | arm_rgb16_step_dx_32768(this, _dst, _py, _pu, _pv); | ||
96 | return; | ||
97 | } | ||
98 | if (this->step_dx<65536) | ||
99 | { | ||
100 | arm_rgb16_step_dx_bet_32768_65536(this, _dst, _py, _pu, _pv); | ||
101 | return; | ||
102 | } | ||
103 | arm_rgb16_step_dx_sup_65536(this, _dst, _py, _pu, _pv); | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | |||
108 | /* Function: */ | ||
109 | static void arm_rgb16_noscale(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
110 | /* This function is called when the source and the destination pictures have the same size. | ||
111 | In this case, scaling part is not needed. | ||
112 | (This code is probably far from being optimised, in particular, the asm | ||
113 | generated is not the most efficient, a pure asm version will probably | ||
114 | emerge sooner or later). But at least, this version is faster than what | ||
115 | was used before.*/ | ||
116 | { | ||
117 | int height; | ||
118 | |||
119 | height=this->dest_height; | ||
120 | |||
121 | while (height>0) | ||
122 | { | ||
123 | uint16_t *r, *g, *b; | ||
124 | uint8_t *py, *py2, *pu, *pv; | ||
125 | uint16_t *dst, *dst2; | ||
126 | int width; | ||
127 | register uint8_t p1y, p1u, p1v; | ||
128 | |||
129 | height-=2; | ||
130 | width=this->dest_width; | ||
131 | dst = _dst; | ||
132 | dst2 = _dst + this->rgb_stride; | ||
133 | py = _py; | ||
134 | py2 = _py + this->y_stride; | ||
135 | pu = _pu; | ||
136 | pv = _pv; | ||
137 | |||
138 | while (width>0) | ||
139 | { | ||
140 | width-=2; | ||
141 | p1y=*py++; | ||
142 | p1u=*pu++; | ||
143 | p1v=*pv++; | ||
144 | |||
145 | r = this->table_rV[p1v]; | ||
146 | g = (void *) (((uint8_t *)this->table_gU[p1u]) + this->table_gV[p1v]); | ||
147 | b = this->table_bU[p1u]; | ||
148 | |||
149 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | ||
150 | p1y=*py++; | ||
151 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | ||
152 | |||
153 | p1y=*py2++; | ||
154 | |||
155 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; | ||
156 | p1y=*py2++; | ||
157 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; | ||
158 | } | ||
159 | _dst += (this->rgb_stride)<<1; | ||
160 | _py += (this->y_stride)<<1; | ||
161 | _pu += this->uv_stride; | ||
162 | _pv += this->uv_stride; | ||
163 | } | ||
164 | } | ||
165 | |||
166 | |||
167 | /* Function: */ | ||
168 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
169 | /* This function is called when the destination picture is bigger than the size | ||
170 | of the source picture. | ||
171 | */ | ||
172 | { | ||
173 | int recal_uv, height; /* Note about recal_uv: bit0 is for | ||
174 | applying scale on u and v, bit1 is for increments of u and v pointers.*/ | ||
175 | int dy; | ||
176 | |||
177 | dy = 0; | ||
178 | height = this->dest_height; | ||
179 | recal_uv=1; // 1 for evaluation of scale_line, needed the first time | ||
180 | |||
181 | while(1) | ||
182 | { | ||
183 | register int dxy; | ||
184 | register int dxuv; | ||
185 | register uint8_t p1y, p2y; | ||
186 | uint8_t dest1y, dest2y; | ||
187 | register uint8_t p1u, p2u; | ||
188 | register uint8_t p1v, p2v; | ||
189 | uint8_t dest1u; | ||
190 | uint8_t dest1v; | ||
191 | int width; | ||
192 | uint8_t *u_buffer; | ||
193 | uint8_t *v_buffer; | ||
194 | uint16_t *r, *g, *b; | ||
195 | uint8_t *py, *pu, *pv; | ||
196 | uint16_t *dst; | ||
197 | |||
198 | dxy = 0; | ||
199 | dxuv = 0; | ||
200 | width = this->dest_width; | ||
201 | u_buffer=this->u_buffer; | ||
202 | v_buffer=this->v_buffer; | ||
203 | dst = (uint16_t*)_dst; | ||
204 | py = _py; | ||
205 | pu = _pu; | ||
206 | pv = _pv; | ||
207 | |||
208 | //proceed with line scaling/conversion | ||
209 | if ((recal_uv&1)!=0) | ||
210 | { | ||
211 | recal_uv^=1; //reset bit0. | ||
212 | // init values: | ||
213 | p1u = *pu++; | ||
214 | p2u = *pu++; | ||
215 | p1v = *pv++; | ||
216 | p2v = *pv++; | ||
217 | p1y = *py++; | ||
218 | p2y = *py++; | ||
219 | |||
220 | //width loop (compute all data for a line). | ||
221 | while (width>0) | ||
222 | { | ||
223 | // proceed with u and v first (ok, and y too finally :)) [scaling part]: | ||
224 | // evaluate 1u, 1v, and 2y | ||
225 | //block1_uvy | ||
226 | dest1u=p1u + ((dxuv*(p2u-p1u))>>15); | ||
227 | dest1v=p1v + ((dxuv*(p2v-p1v))>>15); | ||
228 | // as u and v are evaluated, better save them now | ||
229 | *u_buffer++ = (uint8_t)dest1u; | ||
230 | *v_buffer++ = (uint8_t)dest1v; | ||
231 | |||
232 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
233 | |||
234 | dxuv += this->step_dx; | ||
235 | dxy += this->step_dx; | ||
236 | if (dxuv > 32768) | ||
237 | { | ||
238 | dxuv -= 32768; | ||
239 | p1u = p2u; | ||
240 | p2u = *pu++; //idee pour asm, cf cas then, un merge est possible!!! | ||
241 | p1v = p2v; | ||
242 | p2v = *pv++; | ||
243 | } | ||
244 | if (dxy > 32768) | ||
245 | { | ||
246 | dxy -= 32768; | ||
247 | p1y = p2y; | ||
248 | p2y = *py++; | ||
249 | } | ||
250 | //end block1_uvy | ||
251 | |||
252 | //block2_y | ||
253 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
254 | |||
255 | dxy += this->step_dx; | ||
256 | if (dxy > 32768) | ||
257 | { | ||
258 | dxy -= 32768; | ||
259 | p1y = p2y; | ||
260 | p2y = *py++; // idee pour asm, cf cas then, un merge est possible!!! | ||
261 | } | ||
262 | //end block2_y | ||
263 | |||
264 | // proceed now with YUV2RGB [conversion part]: | ||
265 | // u and v are currently in dest1u and dest1v | ||
266 | // the 2 y are in dest1y and dest2y. | ||
267 | // RGB(0),DST1(0), RGB(1), DST1(1) | ||
268 | r = this->table_rV[dest1v]; | ||
269 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
270 | b = this->table_bU[dest1u]; | ||
271 | |||
272 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
273 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
274 | |||
275 | width -=2; | ||
276 | } | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | // this case is simple, u and v are already evaluated, | ||
281 | // Note pour moi: r, g et b pourraient etre reutilises!! | ||
282 | |||
283 | // init values: | ||
284 | p1y = *py++; | ||
285 | p2y = *py++; | ||
286 | |||
287 | //width loop (compute all data for a line). | ||
288 | while (width>0) | ||
289 | { | ||
290 | // proceed with y [scaling part]: | ||
291 | // evaluate 2y | ||
292 | //block1_y | ||
293 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
294 | |||
295 | dxy += this->step_dx; | ||
296 | if (dxy > 32768) | ||
297 | { | ||
298 | dxy -= 32768; | ||
299 | p1y = p2y; | ||
300 | p2y = *py++; | ||
301 | } | ||
302 | //end block1_uvy | ||
303 | |||
304 | //block2_y | ||
305 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
306 | |||
307 | dxy += this->step_dx; | ||
308 | if (dxy > 32768) | ||
309 | { | ||
310 | dxy -= 32768; | ||
311 | p1y = p2y; | ||
312 | p2y = *py++; // idee pour asm, cf cas then, un merge est possible!!! | ||
313 | } | ||
314 | //end block2_y | ||
315 | |||
316 | // proceed now with YUV2RGB [conversion part]: | ||
317 | // u and v are currently in dest1u and dest1v | ||
318 | // the 2 y are in dest1y and dest2y. | ||
319 | // RGB(0),DST1(0) | ||
320 | dest1u=*u_buffer++; | ||
321 | dest1v=*v_buffer++; | ||
322 | r = this->table_rV[dest1v]; | ||
323 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
324 | b = this->table_bU[dest1u]; | ||
325 | |||
326 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
327 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
328 | |||
329 | width -=2; | ||
330 | } | ||
331 | } | ||
332 | // end of line scaling/conversion | ||
333 | dy += this->step_dy; | ||
334 | _dst += this->rgb_stride; | ||
335 | |||
336 | while (--height > 0 && dy < 32768) | ||
337 | { | ||
338 | xine_fast_memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2); // *2 because of int8 cast! | ||
339 | dy += this->step_dy; | ||
340 | _dst += this->rgb_stride; | ||
341 | } | ||
342 | |||
343 | |||
344 | if (height <= 0) | ||
345 | break; | ||
346 | |||
347 | do | ||
348 | { | ||
349 | dy -= 32768; | ||
350 | _py += this->y_stride; | ||
351 | |||
352 | recal_uv^=2; /*bit 0 for reevaluation of scanline, bit 1 for offset.*/ | ||
353 | |||
354 | if ((recal_uv&2)==0) | ||
355 | { | ||
356 | _pu += this->uv_stride; | ||
357 | _pv += this->uv_stride; | ||
358 | recal_uv|=1; // if update, then reevaluate scanline! | ||
359 | } | ||
360 | } | ||
361 | while( dy>=32768); | ||
362 | } | ||
363 | } | ||
364 | |||
365 | |||
366 | |||
367 | /* Function: */ | ||
368 | static void arm_rgb16_step_dx_32768(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
369 | /* This function is called when the widht of the destination picture is the | ||
370 | same as the size of the source picture. | ||
371 | */ | ||
372 | { | ||
373 | int recal_uv, height; | ||
374 | int dy; | ||
375 | |||
376 | dy = 0; | ||
377 | height=this->dest_height; | ||
378 | recal_uv=0; | ||
379 | |||
380 | while (1) | ||
381 | { | ||
382 | uint16_t *r, *g, *b; | ||
383 | uint8_t *py, *pu, *pv; | ||
384 | uint16_t *dst; | ||
385 | int width; | ||
386 | register uint8_t p1y, p1u, p1v; | ||
387 | |||
388 | width=this->dest_width; | ||
389 | dst = (uint16_t*)_dst; | ||
390 | py = _py; | ||
391 | pu = _pu; | ||
392 | pv = _pv; | ||
393 | |||
394 | while (width>0) | ||
395 | { | ||
396 | width-=2; | ||
397 | p1y=*py++; | ||
398 | p1u=*pu++; | ||
399 | p1v=*pv++; | ||
400 | |||
401 | r = this->table_rV[p1v]; | ||
402 | g = (void *) (((uint8_t *)this->table_gU[p1u]) + this->table_gV[p1v]); | ||
403 | b = this->table_bU[p1u]; | ||
404 | |||
405 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | ||
406 | p1y=*py++; | ||
407 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | ||
408 | } | ||
409 | |||
410 | |||
411 | |||
412 | // end of line scaling/conversion | ||
413 | dy += this->step_dy; | ||
414 | _dst += this->rgb_stride; | ||
415 | |||
416 | while (--height > 0 && dy < 32768) | ||
417 | { | ||
418 | xine_fast_memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2); // *2 because of int8 cast! | ||
419 | dy += this->step_dy; | ||
420 | _dst += this->rgb_stride; | ||
421 | } | ||
422 | |||
423 | |||
424 | if (height <= 0) | ||
425 | break; | ||
426 | |||
427 | do | ||
428 | { | ||
429 | dy -= 32768; | ||
430 | _py += this->y_stride; | ||
431 | |||
432 | recal_uv^=2; /*bit 0 for reevaluation of scanline, bit 1 for offset.*/ | ||
433 | |||
434 | if ((recal_uv&2)==0) | ||
435 | { | ||
436 | _pu += this->uv_stride; | ||
437 | _pv += this->uv_stride; | ||
438 | recal_uv|=1; // if update, then reevaluate scanline! | ||
439 | } | ||
440 | } | ||
441 | while( dy>=32768); | ||
442 | } | ||
443 | } | ||
444 | |||
445 | |||
446 | |||
447 | /* Function: */ | ||
448 | static void arm_rgb16_step_dx_bet_32768_65536(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
449 | /* This function is called when the destination picture is between the size | ||
450 | of the source picture, and half its size. | ||
451 | */ | ||
452 | { | ||
453 | int recal_uv, height; /* Note about recal_uv: bit0 is for | ||
454 | applying scale on u and v, bit1 is for increments of u and v pointers.*/ | ||
455 | int dy; | ||
456 | |||
457 | dy = 0; | ||
458 | height = this->dest_height; | ||
459 | recal_uv=1; // 1 for evaluation of scale_line, needed the first time | ||
460 | |||
461 | while(1) | ||
462 | { | ||
463 | register int dxy; | ||
464 | register int dxuv; | ||
465 | register uint8_t p1y, p2y; | ||
466 | uint8_t dest1y, dest2y; | ||
467 | register uint8_t p1u, p2u; | ||
468 | register uint8_t p1v, p2v; | ||
469 | uint8_t dest1u; | ||
470 | uint8_t dest1v; | ||
471 | int width; | ||
472 | uint8_t *u_buffer; | ||
473 | uint8_t *v_buffer; | ||
474 | uint16_t *r, *g, *b; | ||
475 | uint8_t *py, *pu, *pv; | ||
476 | uint16_t *dst; | ||
477 | |||
478 | dxy = 0; | ||
479 | dxuv = 0; | ||
480 | width = this->dest_width; | ||
481 | u_buffer=this->u_buffer; | ||
482 | v_buffer=this->v_buffer; | ||
483 | dst = (uint16_t*)_dst; | ||
484 | py = _py; | ||
485 | pu = _pu; | ||
486 | pv = _pv; | ||
487 | |||
488 | //proceed with line scaling/conversion | ||
489 | if ((recal_uv&1)!=0) | ||
490 | { | ||
491 | recal_uv^=1; //reset bit0. | ||
492 | // init values: | ||
493 | p1u = *pu++; | ||
494 | p2u = *pu++; | ||
495 | p1v = *pv++; | ||
496 | p2v = *pv++; | ||
497 | p1y = *py++; | ||
498 | p2y = *py++; | ||
499 | |||
500 | //width loop (compute all data for a line). | ||
501 | while (width>0) | ||
502 | { | ||
503 | // proceed with u and v first (ok, and y too finally :)) [scaling part]: | ||
504 | // evaluate 1u, 1v, and 2y | ||
505 | //block1_uvy | ||
506 | dest1u=p1u + ((dxuv*(p2u-p1u))>>15); | ||
507 | dest1v=p1v + ((dxuv*(p2v-p1v))>>15); | ||
508 | // as u and v are evaluated, better save them now | ||
509 | *u_buffer++ = (uint8_t)dest1u; | ||
510 | *v_buffer++ = (uint8_t)dest1v; | ||
511 | |||
512 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
513 | |||
514 | dxuv += this->step_dx; | ||
515 | dxy += this->step_dx; | ||
516 | if (dxuv > 65536) | ||
517 | { | ||
518 | dxuv -= 65536; | ||
519 | p1u = *pu++; | ||
520 | p2u = *pu++; | ||
521 | p1v = *pv++; | ||
522 | p2v = *pv++; | ||
523 | } | ||
524 | else | ||
525 | { | ||
526 | dxuv -= 32768; | ||
527 | p1u = p2u; | ||
528 | p2u = *pu++; //idee pour asm, cf cas then, un merge est possible!!! | ||
529 | p1v = p2v; | ||
530 | p2v = *pv++; | ||
531 | } | ||
532 | if (dxy > 65536) | ||
533 | { | ||
534 | dxy -= 65536; | ||
535 | p1y = *py++; | ||
536 | p2y = *py++; | ||
537 | } | ||
538 | else | ||
539 | { | ||
540 | dxy -= 32768; | ||
541 | p1y = p2y; | ||
542 | p2y = *py++; | ||
543 | } | ||
544 | //end block1_uvy | ||
545 | |||
546 | //block2_y | ||
547 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
548 | |||
549 | dxy += this->step_dx; | ||
550 | if (dxy > 65536) | ||
551 | { | ||
552 | dxy -= 65536; | ||
553 | p1y = *py++; | ||
554 | p2y = *py++; | ||
555 | } | ||
556 | else | ||
557 | { | ||
558 | dxy -= 32768; | ||
559 | p1y = p2y; | ||
560 | p2y = *py++; // idee pour asm, cf cas then, un merge est possible!!! | ||
561 | } | ||
562 | //end block2_y | ||
563 | |||
564 | // proceed now with YUV2RGB [conversion part]: | ||
565 | // u and v are currently in dest1u and dest1v | ||
566 | // the 2 y are in dest1y and dest2y. | ||
567 | // RGB(0),DST1(0), RGB(1), DST1(1) | ||
568 | r = this->table_rV[dest1v]; | ||
569 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
570 | b = this->table_bU[dest1u]; | ||
571 | |||
572 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
573 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
574 | |||
575 | width -=2; | ||
576 | } | ||
577 | } | ||
578 | else | ||
579 | { | ||
580 | // this case is simple, u and v are already evaluated, | ||
581 | // Note pour moi: r, g et b pourraient etre reutilises!! | ||
582 | |||
583 | // init values: | ||
584 | p1y = *py++; | ||
585 | p2y = *py++; | ||
586 | |||
587 | //width loop (compute all data for a line). | ||
588 | while (width>0) | ||
589 | { | ||
590 | // proceed with y [scaling part]: | ||
591 | // evaluate 2y | ||
592 | //block1_y | ||
593 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
594 | |||
595 | dxy += this->step_dx; | ||
596 | if (dxy > 65536) | ||
597 | { | ||
598 | dxy -= 65536; | ||
599 | p1y = *py++; | ||
600 | p2y = *py++; | ||
601 | } | ||
602 | else | ||
603 | { | ||
604 | dxy -= 32768; | ||
605 | p1y = p2y; | ||
606 | p2y = *py++; | ||
607 | } | ||
608 | //end block1_uvy | ||
609 | |||
610 | //block2_y | ||
611 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
612 | |||
613 | dxy += this->step_dx; | ||
614 | if (dxy > 65536) | ||
615 | { | ||
616 | dxy -= 65536; | ||
617 | p1y = *py++; | ||
618 | p2y = *py++; | ||
619 | } | ||
620 | else | ||
621 | { | ||
622 | dxy -= 32768; | ||
623 | p1y = p2y; | ||
624 | p2y = *py++; // idee pour asm, cf cas then, un merge est possible!!! | ||
625 | } | ||
626 | //end block2_y | ||
627 | |||
628 | // proceed now with YUV2RGB [conversion part]: | ||
629 | // u and v are currently in dest1u and dest1v | ||
630 | // the 2 y are in dest1y and dest2y. | ||
631 | // RGB(0),DST1(0) | ||
632 | dest1u=*u_buffer++; | ||
633 | dest1v=*v_buffer++; | ||
634 | r = this->table_rV[dest1v]; | ||
635 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
636 | b = this->table_bU[dest1u]; | ||
637 | |||
638 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
639 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
640 | |||
641 | width -=2; | ||
642 | } | ||
643 | } | ||
644 | // end of line scaling/conversion | ||
645 | dy += this->step_dy; | ||
646 | _dst += this->rgb_stride; | ||
647 | |||
648 | while (--height > 0 && dy < 32768) | ||
649 | { | ||
650 | xine_fast_memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2); // *2 because of int8 cast! | ||
651 | dy += this->step_dy; | ||
652 | _dst += this->rgb_stride; | ||
653 | } | ||
654 | |||
655 | |||
656 | if (height <= 0) | ||
657 | break; | ||
658 | |||
659 | do | ||
660 | { | ||
661 | dy -= 32768; | ||
662 | _py += this->y_stride; | ||
663 | |||
664 | recal_uv^=2; /*bit 0 for reevaluation of scanline, bit 1 for offset.*/ | ||
665 | |||
666 | if ((recal_uv&2)==0) | ||
667 | { | ||
668 | _pu += this->uv_stride; | ||
669 | _pv += this->uv_stride; | ||
670 | recal_uv|=1; // if update, then reevaluate scanline! | ||
671 | } | ||
672 | } | ||
673 | while( dy>=32768); | ||
674 | } | ||
675 | } | ||
676 | |||
677 | |||
678 | |||
679 | /* Function: */ | ||
680 | static void arm_rgb16_step_dx_sup_65536(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | ||
681 | /* This function is called when the destination picture is smaller than half | ||
682 | the size of the source picture, and half its size. | ||
683 | */ | ||
684 | { | ||
685 | int recal_uv, height; /* Note about recal_uv: bit0 is for | ||
686 | applying scale on u and v, bit1 is for increments of u and v pointers.*/ | ||
687 | int dy; | ||
688 | |||
689 | dy = 0; | ||
690 | height = this->dest_height; | ||
691 | recal_uv=1; // 1 for evaluation of scale_line, needed the first time | ||
692 | |||
693 | while(1) | ||
694 | { | ||
695 | register int dxy; | ||
696 | register int dxuv; | ||
697 | int offdxy, offdxuv; | ||
698 | register uint8_t p1y, p2y; | ||
699 | uint8_t dest1y, dest2y; | ||
700 | register uint8_t p1u, p2u; | ||
701 | register uint8_t p1v, p2v; | ||
702 | uint8_t dest1u; | ||
703 | uint8_t dest1v; | ||
704 | int width; | ||
705 | uint8_t *u_buffer; | ||
706 | uint8_t *v_buffer; | ||
707 | uint16_t *r, *g, *b; | ||
708 | uint8_t *py, *pu, *pv; | ||
709 | uint16_t *dst; | ||
710 | |||
711 | dxy = 0; | ||
712 | dxuv = 0; | ||
713 | width = this->dest_width; | ||
714 | u_buffer=this->u_buffer; | ||
715 | v_buffer=this->v_buffer; | ||
716 | dst = (uint16_t*)_dst; | ||
717 | py = _py; | ||
718 | pu = _pu; | ||
719 | pv = _pv; | ||
720 | |||
721 | //proceed with line scaling/conversion | ||
722 | if ((recal_uv&1)!=0) | ||
723 | { | ||
724 | recal_uv^=1; //reset bit0. | ||
725 | // init values: | ||
726 | p1u = *pu++; | ||
727 | p2u = *pu++; | ||
728 | p1v = *pv++; | ||
729 | p2v = *pv++; | ||
730 | p1y = *py++; | ||
731 | p2y = *py++; | ||
732 | |||
733 | //width loop (compute all data for a line). | ||
734 | while (width>0) | ||
735 | { | ||
736 | // proceed with u and v first (ok, and y too finally :)) [scaling part]: | ||
737 | // evaluate 1u, 1v, and 2y | ||
738 | //block1_uvy | ||
739 | dest1u=p1u + ((dxuv*(p2u-p1u))>>15); | ||
740 | dest1v=p1v + ((dxuv*(p2v-p1v))>>15); | ||
741 | // as u and v are evaluated, better save them now | ||
742 | *u_buffer++ = (uint8_t)dest1u; | ||
743 | *v_buffer++ = (uint8_t)dest1v; | ||
744 | |||
745 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
746 | |||
747 | dxuv += this->step_dx; | ||
748 | dxy += this->step_dx; | ||
749 | |||
750 | offdxuv=((dxuv-1)>>15); | ||
751 | dxuv-=offdxuv<<15; | ||
752 | pu+=offdxuv-2; | ||
753 | pv+=offdxuv-2; | ||
754 | p1u = *pu++; | ||
755 | p2u = *pu++; | ||
756 | p1v = *pv++; | ||
757 | p2v = *pv++; | ||
758 | offdxy=((dxy-1)>>15); | ||
759 | dxy-=offdxy<<15; | ||
760 | py+=offdxy-2; | ||
761 | p1y = *py++; | ||
762 | p2y = *py++; | ||
763 | |||
764 | //block2_y | ||
765 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
766 | |||
767 | dxy += this->step_dx; | ||
768 | offdxy=((dxy-1)>>15); | ||
769 | dxy-=offdxy<<15; | ||
770 | py+=offdxy-2; | ||
771 | p1y = *py++; | ||
772 | p2y = *py++; | ||
773 | |||
774 | // proceed now with YUV2RGB [conversion part]: | ||
775 | // u and v are currently in dest1u and dest1v | ||
776 | // the 2 y are in dest1y and dest2y. | ||
777 | // RGB(0),DST1(0), RGB(1), DST1(1) | ||
778 | r = this->table_rV[dest1v]; | ||
779 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
780 | b = this->table_bU[dest1u]; | ||
781 | |||
782 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
783 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
784 | |||
785 | width -=2; | ||
786 | } | ||
787 | } | ||
788 | else | ||
789 | { | ||
790 | // this case is simple, u and v are already evaluated, | ||
791 | // Note pour moi: r, g et b pourraient etre reutilises!! | ||
792 | |||
793 | // init values: | ||
794 | p1y = *py++; | ||
795 | p2y = *py++; | ||
796 | |||
797 | //width loop (compute all data for a line). | ||
798 | while (width>0) | ||
799 | { | ||
800 | // proceed with y [scaling part]: | ||
801 | // evaluate 2y | ||
802 | //block1_y | ||
803 | dest1y=p1y + ((dxy*(p2y-p1y))>>15); | ||
804 | |||
805 | dxy += this->step_dx; | ||
806 | offdxy=((dxy-1)>>15); | ||
807 | dxy-=offdxy<<15; | ||
808 | py+=offdxy-2; | ||
809 | p1y = *py++; | ||
810 | p2y = *py++; | ||
811 | |||
812 | //end block1_uvy | ||
813 | |||
814 | //block2_y | ||
815 | dest2y=p1y + ((dxy*(p2y-p1y))>>15); | ||
816 | |||
817 | dxy += this->step_dx; | ||
818 | offdxy=((dxy-1)>>15); | ||
819 | dxy-=offdxy<<15; | ||
820 | py+=offdxy-2; | ||
821 | p1y = *py++; | ||
822 | p2y = *py++; | ||
823 | //end block2_y | ||
824 | |||
825 | // proceed now with YUV2RGB [conversion part]: | ||
826 | // u and v are currently in dest1u and dest1v | ||
827 | // the 2 y are in dest1y and dest2y. | ||
828 | // RGB(0),DST1(0) | ||
829 | dest1u=*u_buffer++; | ||
830 | dest1v=*v_buffer++; | ||
831 | r = this->table_rV[dest1v]; | ||
832 | g = (void *) (((uint8_t *)this->table_gU[dest1u]) + this->table_gV[dest1v]); | ||
833 | b = this->table_bU[dest1u]; | ||
834 | |||
835 | *dst++ = r[dest1y] + g[dest1y] + b[dest1y]; | ||
836 | *dst++ = r[dest2y] + g[dest2y] + b[dest2y]; | ||
837 | |||
838 | width -=2; | ||
839 | } | ||
840 | } | ||
841 | // end of line scaling/conversion | ||
842 | dy += this->step_dy; | ||
843 | _dst += this->rgb_stride; | ||
844 | |||
845 | while (--height > 0 && dy < 32768) | ||
846 | { | ||
847 | xine_fast_memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2); // *2 because of int8 cast! | ||
848 | dy += this->step_dy; | ||
849 | _dst += this->rgb_stride; | ||
850 | } | ||
851 | |||
852 | |||
853 | if (height <= 0) | ||
854 | break; | ||
855 | |||
856 | do | ||
857 | { | ||
858 | dy -= 32768; | ||
859 | _py += this->y_stride; | ||
860 | |||
861 | recal_uv^=2; /*bit 0 for reevaluation of scanline, bit 1 for offset.*/ | ||
862 | |||
863 | if ((recal_uv&2)==0) | ||
864 | { | ||
865 | _pu += this->uv_stride; | ||
866 | _pv += this->uv_stride; | ||
867 | recal_uv|=1; // if update, then reevaluate scanline! | ||
868 | } | ||
869 | } | ||
870 | while( dy>=32768); | ||
871 | } | ||
872 | } | ||
873 | |||
874 | |||
875 | #endif | ||
diff --git a/noncore/multimedia/opierec/opierec.control b/noncore/multimedia/opierec/opierec.control index 96c1b69..a1a2b7e 100644 --- a/noncore/multimedia/opierec/opierec.control +++ b/noncore/multimedia/opierec/opierec.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-rec | 1 | Package: opierec |
2 | Files: bin/opierec pics/opierec apps/Applications/opierec.desktop | 2 | Files: bin/opierec pics/opierec apps/Applications/opierec.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: multimedia/applications | 4 | Section: multimedia/applications |
5 | Maintainer: L.J. Potter <ljp@llornkcor.com> | 5 | Maintainer: L.J. Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.5-2 | 7 | Depends: opie ($QPE_VERSION) |
8 | Depends: task-opie-minimal | ||
9 | Description: audio sampling recorder | 8 | Description: audio sampling recorder |
10 | A simple audio recording/playing application. | 9 | A simple audio recording/playing application. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index 0307d99..147f63d 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp | |||
@@ -446,13 +446,13 @@ void QtRec::init() { | |||
446 | // timeSlider->setTickmarks(QSlider::Above); | 446 | // timeSlider->setTickmarks(QSlider::Above); |
447 | 447 | ||
448 | timeLabel = new QLabel( tab, "TimeLabel" ); | 448 | timeLabel = new QLabel( tab, "TimeLabel" ); |
449 | layout1->addMultiCellWidget( timeLabel, 0, 0, 0, 3); | 449 | layout1->addMultiCellWidget( timeLabel, 0, 0, 0, 3); |
450 | 450 | ||
451 | playLabel2 = new QLabel(tab, "PlayLabel2" ); | 451 | playLabel2 = new QLabel(tab, "PlayLabel2" ); |
452 | playLabel2->setText("Play"); | 452 | playLabel2->setText(tr("Play") ); |
453 | playLabel2->setFixedHeight(18); | 453 | playLabel2->setFixedHeight(18); |
454 | layout1->addMultiCellWidget( playLabel2, 0, 0, 4, 4); | 454 | layout1->addMultiCellWidget( playLabel2, 0, 0, 4, 4); |
455 | 455 | ||
456 | Stop_PushButton = new QPushButton( tab, "Stop_PushButton" ); | 456 | Stop_PushButton = new QPushButton( tab, "Stop_PushButton" ); |
457 | layout1->addMultiCellWidget( Stop_PushButton, 1, 1, 4, 4); | 457 | layout1->addMultiCellWidget( Stop_PushButton, 1, 1, 4, 4); |
458 | Stop_PushButton->setFixedSize(22,22); | 458 | Stop_PushButton->setFixedSize(22,22); |
@@ -467,13 +467,13 @@ void QtRec::init() { | |||
467 | layout1->addMultiCellWidget( toEndButton, 1, 1, 6, 6); | 467 | layout1->addMultiCellWidget( toEndButton, 1, 1, 6, 6); |
468 | toEndButton->setFixedSize(22,22); | 468 | toEndButton->setFixedSize(22,22); |
469 | toEndButton->setPixmap( Resource::loadPixmap( "fastforward" ) ); | 469 | toEndButton->setPixmap( Resource::loadPixmap( "fastforward" ) ); |
470 | 470 | ||
471 | QLabel *recLabel2; | 471 | QLabel *recLabel2; |
472 | recLabel2 = new QLabel( tab, "recLabel2" ); | 472 | recLabel2 = new QLabel( tab, "recLabel2" ); |
473 | recLabel2->setText("Rec"); | 473 | recLabel2->setText(tr("Rec")); |
474 | recLabel2->setFixedHeight(18); | 474 | recLabel2->setFixedHeight(18); |
475 | layout1->addMultiCellWidget( recLabel2, 0, 0, 7, 7); | 475 | layout1->addMultiCellWidget( recLabel2, 0, 0, 7, 7); |
476 | 476 | ||
477 | Rec_PushButton = new QPushButton( tab, "Rec_PushButton" ); | 477 | Rec_PushButton = new QPushButton( tab, "Rec_PushButton" ); |
478 | layout1->addMultiCellWidget( Rec_PushButton, 1, 1, 7, 7); | 478 | layout1->addMultiCellWidget( Rec_PushButton, 1, 1, 7, 7); |
479 | Rec_PushButton->setFixedSize(22,22); | 479 | Rec_PushButton->setFixedSize(22,22); |
@@ -497,15 +497,15 @@ void QtRec::init() { | |||
497 | 497 | ||
498 | ListView1->addColumn( tr( "Name" ) ); | 498 | ListView1->addColumn( tr( "Name" ) ); |
499 | ListView1->setColumnWidth(0,140); | 499 | ListView1->setColumnWidth(0,140); |
500 | ListView1->setSorting( 1, false); | 500 | ListView1->setSorting( 1, false); |
501 | ListView1->addColumn( tr( "Time" ) ); //in seconds | 501 | ListView1->addColumn( tr( "Time" ) ); //in seconds |
502 | ListView1->setColumnWidth(1,50); | 502 | ListView1->setColumnWidth(1,50); |
503 | ListView1->addColumn( "Location"); | 503 | ListView1->addColumn( tr("Location") ); |
504 | ListView1->setColumnWidth(2,50); | 504 | ListView1->setColumnWidth(2,50); |
505 | ListView1->addColumn( "Date"); | 505 | ListView1->addColumn( tr("Date") ); |
506 | ListView1->setColumnWidth(3,63); | 506 | ListView1->setColumnWidth(3,63); |
507 | 507 | ||
508 | ListView1->setColumnWidthMode(0,QListView::Manual); | 508 | ListView1->setColumnWidthMode(0,QListView::Manual); |
509 | ListView1->setColumnAlignment(1,QListView::AlignCenter); | 509 | ListView1->setColumnAlignment(1,QListView::AlignCenter); |
510 | ListView1->setColumnAlignment(2,QListView::AlignRight); | 510 | ListView1->setColumnAlignment(2,QListView::AlignRight); |
511 | ListView1->setColumnAlignment(3,QListView::AlignLeft); | 511 | ListView1->setColumnAlignment(3,QListView::AlignLeft); |
@@ -591,16 +591,16 @@ void QtRec::init() { | |||
591 | bitRateComboBox->insertItem( tr( "16" ) ); | 591 | bitRateComboBox->insertItem( tr( "16" ) ); |
592 | bitRateComboBox->insertItem( tr( "8" ) ); | 592 | bitRateComboBox->insertItem( tr( "8" ) ); |
593 | bitRateComboBox->setGeometry( QRect( 5, 20, 50, 25 ) ); | 593 | bitRateComboBox->setGeometry( QRect( 5, 20, 50, 25 ) ); |
594 | 594 | ||
595 | Layout18->addWidget( bitGroup ); | 595 | Layout18->addWidget( bitGroup ); |
596 | 596 | ||
597 | compressionCheckBox = new QCheckBox ( "Wave Compression (smaller files)", tab_3 ); | 597 | compressionCheckBox = new QCheckBox ( tr("Wave Compression (smaller files)"), tab_3 ); |
598 | Layout18->addWidget( compressionCheckBox ); | 598 | Layout18->addWidget( compressionCheckBox ); |
599 | 599 | ||
600 | autoMuteCheckBox= new QCheckBox ( "auto Mute", tab_3 ); | 600 | autoMuteCheckBox= new QCheckBox ( tr("auto Mute"), tab_3 ); |
601 | Layout18->addWidget( autoMuteCheckBox ); | 601 | Layout18->addWidget( autoMuteCheckBox ); |
602 | 602 | ||
603 | Layout19->addLayout( Layout18 ); | 603 | Layout19->addLayout( Layout18 ); |
604 | 604 | ||
605 | QWidget *d = QApplication::desktop(); | 605 | QWidget *d = QApplication::desktop(); |
606 | int width=d->width(); | 606 | int width=d->width(); |
@@ -641,16 +641,16 @@ void QtRec::init() { | |||
641 | 641 | ||
642 | OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_5,(const char *) "OutputSlider" ); | 642 | OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_5,(const char *) "OutputSlider" ); |
643 | OutputSlider->setTickmarks(QSlider::Both); | 643 | OutputSlider->setTickmarks(QSlider::Both); |
644 | 644 | ||
645 | Layout15b->addWidget( OutputSlider ); | 645 | Layout15b->addWidget( OutputSlider ); |
646 | 646 | ||
647 | outMuteCheckBox = new QCheckBox ( "mute", tab_5 ); | 647 | outMuteCheckBox = new QCheckBox ( tr("mute"), tab_5 ); |
648 | Layout15->addWidget( outMuteCheckBox ); | 648 | Layout15->addWidget( outMuteCheckBox ); |
649 | 649 | ||
650 | inMuteCheckBox = new QCheckBox ( "mute", tab_5 ); | 650 | inMuteCheckBox = new QCheckBox ( tr("mute"), tab_5 ); |
651 | inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus ); | 651 | inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus ); |
652 | Layout15b->addWidget( inMuteCheckBox ); | 652 | Layout15b->addWidget( inMuteCheckBox ); |
653 | 653 | ||
654 | 654 | ||
655 | Layout19a->addLayout( Layout15 ); | 655 | Layout19a->addLayout( Layout15 ); |
656 | Layout19a->addLayout( Layout15b ); | 656 | Layout19a->addLayout( Layout15b ); |
@@ -688,16 +688,16 @@ void QtRec::init() { | |||
688 | 688 | ||
689 | OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_3,(const char *) "OutputSlider" ); | 689 | OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_3,(const char *) "OutputSlider" ); |
690 | // OutputSlider->setTickmarks(QSlider::Both); | 690 | // OutputSlider->setTickmarks(QSlider::Both); |
691 | 691 | ||
692 | Layout15b->addWidget( OutputSlider ); | 692 | Layout15b->addWidget( OutputSlider ); |
693 | 693 | ||
694 | outMuteCheckBox = new QCheckBox ( "mute", tab_3 ); | 694 | outMuteCheckBox = new QCheckBox ( tr("mute"), tab_3 ); |
695 | Layout15->addWidget( outMuteCheckBox ); | 695 | Layout15->addWidget( outMuteCheckBox ); |
696 | 696 | ||
697 | inMuteCheckBox = new QCheckBox ( "mute", tab_3 ); | 697 | inMuteCheckBox = new QCheckBox ( tr("mute"), tab_3 ); |
698 | inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus ); | 698 | inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus ); |
699 | Layout15b->addWidget( inMuteCheckBox ); | 699 | Layout15b->addWidget( inMuteCheckBox ); |
700 | 700 | ||
701 | 701 | ||
702 | Layout19->addLayout( Layout15 ); | 702 | Layout19->addLayout( Layout15 ); |
703 | Layout19->addLayout( Layout15b ); | 703 | Layout19->addLayout( Layout15b ); |
@@ -872,17 +872,17 @@ void QtRec::stop() { | |||
872 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << true; // mute device | 872 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << true; // mute device |
873 | } | 873 | } |
874 | 874 | ||
875 | void QtRec::doPlayBtn() { | 875 | void QtRec::doPlayBtn() { |
876 | 876 | ||
877 | if(!stopped) { | 877 | if(!stopped) { |
878 | playLabel2->setText("Play"); | 878 | playLabel2->setText(tr("Play")); |
879 | stop(); | 879 | stop(); |
880 | } else { | 880 | } else { |
881 | if(ListView1->currentItem() == 0) return; | 881 | if(ListView1->currentItem() == 0) return; |
882 | playLabel2->setText("Stop"); | 882 | playLabel2->setText(tr("Stop")); |
883 | currentFile = ListView1->currentItem()->text(0); | 883 | currentFile = ListView1->currentItem()->text(0); |
884 | start(); | 884 | start(); |
885 | } | 885 | } |
886 | } | 886 | } |
887 | 887 | ||
888 | void QtRec::start() { //play | 888 | void QtRec::start() { //play |
@@ -907,13 +907,13 @@ bool QtRec::rec() { //record | |||
907 | qDebug("rec:: !stopped"); | 907 | qDebug("rec:: !stopped"); |
908 | monitoring=true; | 908 | monitoring=true; |
909 | return false; | 909 | return false; |
910 | } else { | 910 | } else { |
911 | qDebug("go ahead and record"); | 911 | qDebug("go ahead and record"); |
912 | secCount=1; | 912 | secCount=1; |
913 | playLabel2->setText("Stop"); | 913 | playLabel2->setText(tr("Stop")); |
914 | monitoring=false; | 914 | monitoring=false; |
915 | setRecordButton(true); | 915 | setRecordButton(true); |
916 | stopped=false; | 916 | stopped=false; |
917 | 917 | ||
918 | if( setupAudio( true)) | 918 | if( setupAudio( true)) |
919 | if(setUpFile()) { | 919 | if(setUpFile()) { |
@@ -2156,21 +2156,21 @@ void QtRec::setRecordButton(bool b) { | |||
2156 | 2156 | ||
2157 | Rec_PushButton->setDown(true); | 2157 | Rec_PushButton->setDown(true); |
2158 | QPixmap image3( ( const char** ) image3_data ); | 2158 | QPixmap image3( ( const char** ) image3_data ); |
2159 | Stop_PushButton->setPixmap( image3 ); | 2159 | Stop_PushButton->setPixmap( image3 ); |
2160 | if(Stop_PushButton->isDown()) | 2160 | if(Stop_PushButton->isDown()) |
2161 | Stop_PushButton->setDown(true); | 2161 | Stop_PushButton->setDown(true); |
2162 | playLabel2->setText("Stop"); | 2162 | playLabel2->setText(tr("Stop") ); |
2163 | 2163 | ||
2164 | } else { //about to stop | 2164 | } else { //about to stop |
2165 | 2165 | ||
2166 | QPixmap image4( ( const char** ) image4_data ); | 2166 | QPixmap image4( ( const char** ) image4_data ); |
2167 | Stop_PushButton->setPixmap( image4); | 2167 | Stop_PushButton->setPixmap( image4); |
2168 | if(Stop_PushButton->isDown()) | 2168 | if(Stop_PushButton->isDown()) |
2169 | Stop_PushButton->setDown(false); | 2169 | Stop_PushButton->setDown(false); |
2170 | playLabel2->setText("Play"); | 2170 | playLabel2->setText(tr("Play") ); |
2171 | if(Rec_PushButton->isDown()) | 2171 | if(Rec_PushButton->isDown()) |
2172 | Rec_PushButton->setDown( false); | 2172 | Rec_PushButton->setDown( false); |
2173 | } | 2173 | } |
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | void QtRec::fillDirectoryCombo() { | 2176 | void QtRec::fillDirectoryCombo() { |
diff --git a/noncore/multimedia/showimg/opie-showimg.control b/noncore/multimedia/showimg/opie-showimg.control index 9dacd94..c543335 100644 --- a/noncore/multimedia/showimg/opie-showimg.control +++ b/noncore/multimedia/showimg/opie-showimg.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-showimg | 1 | Package: opie-showimg |
2 | Files: bin/showimg apps/Applications/showimg.desktop pics/imageviewer | 2 | Files: bin/showimg apps/Applications/showimg.desktop pics/imageviewer |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Warwick Allison <warwick@trolltech.com> | 5 | Maintainer: Warwick Allison <warwick@trolltech.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Image Viewer | 8 | Description: Image Viewer |
10 | The image viewer for the Opie environment. Supports | 9 | The image viewer for the Opie environment. Supports |
11 | Whichever formats are compiled into Qt/Embedded (eg. PNG). | 10 | Whichever formats are compiled into Qt/Embedded (eg. PNG). |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/net/ftplib/ftplib.control b/noncore/net/ftplib/ftplib.control index 3dcb02a..918bcd2 100644 --- a/noncore/net/ftplib/ftplib.control +++ b/noncore/net/ftplib/ftplib.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: ftplib | 1 | Package: ftplib |
2 | Files: $OPIEDIR/lib/libftplib.* | 2 | Files: $OPIEDIR/lib/libftplib.* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: Communications | 4 | Section: Communications |
5 | Maintainer: L.J. Potter <ljp@llornkcor.com> | 5 | Maintainer: L.J. Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Libftp | 8 | Description: Libftp |
10 | The ftp library for the Opie environment. | 9 | The ftp library for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/net/mailit/opie-mailit.control b/noncore/net/mailit/opie-mailit.control index 65b5b36..77d4102 100644 --- a/noncore/net/mailit/opie-mailit.control +++ b/noncore/net/mailit/opie-mailit.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-mailit | 1 | Package: opie-mailit |
2 | Files: bin/mailit apps/1Pim/mailit.desktop pics/mailit | 2 | Files: bin/mailit apps/1Pim/mailit.desktop pics/mailit |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie | 4 | Section: opie |
5 | Maintainer: L.J. Potter <llornkcor@handhelds.org> | 5 | Maintainer: L.J. Potter <llornkcor@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $OPIE_VERSION-$SUB_VERSION | 7 | Version: $QPE_VERSION$EXTRAVERSION |
8 | Description: EMail | 8 | Description: EMail |
9 | A simple POP3 email client for the Opie environment. | 9 | A simple POP3 email client for the Opie environment. |
diff --git a/noncore/net/opieftp/opie-ftp.control b/noncore/net/opieftp/opie-ftp.control index 090e9a8..1e82523 100644 --- a/noncore/net/opieftp/opie-ftp.control +++ b/noncore/net/opieftp/opie-ftp.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-ftp | 1 | Package: opie-ftp |
2 | Files: bin/opieftp pics/opieftp apps/Applications/opieftp.desktop | 2 | Files: bin/opieftp pics/opieftp apps/Applications/opieftp.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: Communications | 4 | Section: Communications |
5 | Maintainer: L.J. Potter <ljp@llornkcor.com> | 5 | Maintainer: L.J. Potter <ljp@llornkcor.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, ftplib | 7 | Depends: task-opie-minimal, ftplib |
9 | Replaces: opieftp | 8 | Replaces: opieftp |
10 | Description: Opie-Ftp | 9 | Description: Opie-Ftp |
11 | The ftp client for the Opie environment. | 10 | The ftp client for the Opie environment. |
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/net/opieirc/opie-irc.control b/noncore/net/opieirc/opie-irc.control index f1e6ff8..51a8049 100644 --- a/noncore/net/opieirc/opie-irc.control +++ b/noncore/net/opieirc/opie-irc.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-irc | 1 | Package: opie-irc |
2 | Files: bin/opieirc pics/opieirc apps/Applications/opieirc.desktop help/en/html/opieirc.html help/en/html/opieirc | 2 | Files: bin/opieirc pics/opieirc apps/Applications/opieirc.desktop help/en/html/opieirc.html help/en/html/opieirc |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: Communications | 4 | Section: Communications |
5 | Maintainer: Wenzel Jakob <root@wazlaf.de> | 5 | Maintainer: Wenzel Jakob <root@wazlaf.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, libopie1 | 7 | Depends: task-opie-minimal, libopie1 |
9 | Description: The Opie IRC client lets you chat on your favorite IRC server using your handheld computer | 8 | Description: The Opie IRC client lets you chat on your favorite IRC server using your handheld computer |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/net/opietooth/applet/opie-bluetoothapplet.control b/noncore/net/opietooth/applet/opie-bluetoothapplet.control index b9bd63c..55b9ab0 100644 --- a/noncore/net/opietooth/applet/opie-bluetoothapplet.control +++ b/noncore/net/opietooth/applet/opie-bluetoothapplet.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-bluetoothapplet | 1 | Package: opie-bluetoothapplet |
2 | Files: plugins/applets/libbluetoothapplet.so* pics/bluetoothapplet/* | 2 | Files: plugins/applets/libbluetoothapplet.so* pics/bluetoothapplet/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Maximilian Reiss <max.reiss@gmx.de> | 5 | Maintainer: Maximilian Reiss <max.reiss@gmx.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
8 | Depends: task-opie-minimal, libopietooth1 | 7 | Depends: task-opie-minimal, libopietooth1 |
9 | Description: Bluetooth Applet | 8 | Description: Bluetooth Applet |
10 | An bluetooth taskbar applet for the Opie environment | 9 | An bluetooth taskbar applet for the Opie environment |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/net/opietooth/lib/libopietooth1.control b/noncore/net/opietooth/lib/libopietooth1.control index 041c9d5..850f0dc 100644 --- a/noncore/net/opietooth/lib/libopietooth1.control +++ b/noncore/net/opietooth/lib/libopietooth1.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: libopietooth1 | 1 | Package: libopietooth1 |
2 | Files: $OPIEDIR/lib/libopietooth.so.1.0.0 $OPIEDIR/lib/libopietooth.so.1.0 $OPIEDIR/lib/libopietooth.so.1 | 2 | Files: $OPIEDIR/lib/libopietooth.so.1.0.0 $OPIEDIR/lib/libopietooth.so.1.0 $OPIEDIR/lib/libopietooth.so.1 |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> | 5 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Replaces: libopietooth | 7 | Replaces: libopietooth |
9 | Depends: libqte2 (>=2.3.4), libopie, task-bluez | 8 | Depends: libqte2 (>=2.3.4), libopie, task-bluez |
10 | Description: Opie bluetooth library | 9 | Description: Opie bluetooth library |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/unsupported/gsmtool/gsmtool.pro b/noncore/unsupported/gsmtool/gsmtool.pro index 180195f..40d5942 100644 --- a/noncore/unsupported/gsmtool/gsmtool.pro +++ b/noncore/unsupported/gsmtool/gsmtool.pro | |||
@@ -4,13 +4,13 @@ CONFIG = qt warn_on release | |||
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = gsmtool.h | 5 | HEADERS = gsmtool.h |
6 | SOURCES = main.cpp gsmtool.cpp | 6 | SOURCES = main.cpp gsmtool.cpp |
7 | # This doesn't actually work... | 7 | # This doesn't actually work... |
8 | TMAKE_CXXFLAGS += -fexceptions | 8 | TMAKE_CXXFLAGS += -fexceptions |
9 | INCLUDEPATH+= $(OPIEDIR)/include | 9 | INCLUDEPATH+= $(OPIEDIR)/include |
10 | INCLUDEPATH+= $(GSMLIBDIR) | 10 | #INCLUDEPATH+= $(GSMLIBDIR) |
11 | DEPENDPATH+= $(OPIEDIR)/include | 11 | DEPENDPATH+= $(OPIEDIR)/include |
12 | LIBS += -lqpe -L$(GSMLIBDIR)/gsmlib/.libs -lgsmme | 12 | LIBS += -lqpe -L$(GSMLIBDIR)/gsmlib/.libs -lgsmme |
13 | INTERFACES= gsmtoolbase.ui | 13 | INTERFACES= gsmtoolbase.ui |
14 | TARGET = gsmtool | 14 | TARGET = gsmtool |
15 | 15 | ||
16 | TRANSLATIONS = ../../../i18n/de/gsmtool.ts \ | 16 | TRANSLATIONS = ../../../i18n/de/gsmtool.ts \ |
diff --git a/noncore/unsupported/mail2/addresspicker.cpp b/noncore/unsupported/mail2/addresspicker.cpp index 7f32725..a97b33f 100644 --- a/noncore/unsupported/mail2/addresspicker.cpp +++ b/noncore/unsupported/mail2/addresspicker.cpp | |||
@@ -21,12 +21,13 @@ AddressPicker::AddressPicker(QWidget *parent, const char *name, bool modal, | |||
21 | 21 | ||
22 | QFile f((QString) getenv("HOME") + "/Applications/" | 22 | QFile f((QString) getenv("HOME") + "/Applications/" |
23 | + "addressbook/addressbook.xml"); | 23 | + "addressbook/addressbook.xml"); |
24 | 24 | ||
25 | if (f.open(IO_ReadOnly)) { | 25 | if (f.open(IO_ReadOnly)) { |
26 | QTextStream stream(&f); | 26 | QTextStream stream(&f); |
27 | stream.setEncoding( QTextStream::UnicodeUTF8 ); | ||
27 | QString content; | 28 | QString content; |
28 | while (!f.atEnd()) content += stream.readLine() + "\n"; | 29 | while (!f.atEnd()) content += stream.readLine() + "\n"; |
29 | QStringList lines = QStringList::split(QRegExp("\\n"), content); | 30 | QStringList lines = QStringList::split(QRegExp("\\n"), content); |
30 | QStringList::Iterator it; | 31 | QStringList::Iterator it; |
31 | for (it = lines.begin(); it != lines.end(); it++) { | 32 | for (it = lines.begin(); it != lines.end(); it++) { |
32 | if ((*it).find(QRegExp("^<Contact.*")) != -1) { | 33 | if ((*it).find(QRegExp("^<Contact.*")) != -1) { |
diff --git a/noncore/unsupported/mail2/bend/opie-mailapplet.control b/noncore/unsupported/mail2/bend/opie-mailapplet.control index e5d3c6e..d618643 100644 --- a/noncore/unsupported/mail2/bend/opie-mailapplet.control +++ b/noncore/unsupported/mail2/bend/opie-mailapplet.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-mailapplet | 1 | Package: opie-mailapplet |
2 | Files: plugins/applets/libbend.so* | 2 | Files: plugins/applets/libbend.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Constantin Bergemann <cbergemann@lisa.de> | 5 | Maintainer: Constantin Bergemann <cbergemann@lisa.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 0.0.9-$SUB_VERSION | 7 | Version: $QPE_VERSION$EXTRAVERSION |
8 | Depends: task-opie-minimal libopie1 opie-mail2 | 8 | Depends: task-opie-minimal, libopie1, opie-mail2 |
9 | Description: A Biff-Like mailchecker | 9 | Description: A Biff-Like mailchecker |
10 | License: LGPL | 10 | License: LGPL |
diff --git a/noncore/unsupported/mail2/opie-mail2.control b/noncore/unsupported/mail2/opie-mail2.control index 7f8aeb6..976dc0b 100644 --- a/noncore/unsupported/mail2/opie-mail2.control +++ b/noncore/unsupported/mail2/opie-mail2.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-mail2 | 1 | Package: opie-mail2 |
2 | Files: bin/mail $OPIEDIR/lib/libmail.so* apps/1Pim/mail.desktop pics/mail/*.png sounds/mail/*.wav | 2 | Files: bin/mail $OPIEDIR/lib/libmail.so* apps/1Pim/mail.desktop pics/mail/*.png sounds/mail/*.wav |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Constantin Bergemann <cbergemann@lisa.de> | 5 | Maintainer: Constantin Bergemann <cbergemann@lisa.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 0.0.9-$SUB_VERSION | 7 | Version: $QPE_VERSION$EXTRAVERSION |
8 | Depends: task-opie-minimal, libopie1 | 8 | Depends: task-opie-minimal, libopie1 |
9 | Description: An IMAP mail client | 9 | Description: An IMAP mail client |
10 | License: LGPL | 10 | License: LGPL |
diff --git a/noncore/unsupported/mailit/opie-mailit.control b/noncore/unsupported/mailit/opie-mailit.control index 65b5b36..77d4102 100644 --- a/noncore/unsupported/mailit/opie-mailit.control +++ b/noncore/unsupported/mailit/opie-mailit.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-mailit | 1 | Package: opie-mailit |
2 | Files: bin/mailit apps/1Pim/mailit.desktop pics/mailit | 2 | Files: bin/mailit apps/1Pim/mailit.desktop pics/mailit |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie | 4 | Section: opie |
5 | Maintainer: L.J. Potter <llornkcor@handhelds.org> | 5 | Maintainer: L.J. Potter <llornkcor@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $OPIE_VERSION-$SUB_VERSION | 7 | Version: $QPE_VERSION$EXTRAVERSION |
8 | Description: EMail | 8 | Description: EMail |
9 | A simple POP3 email client for the Opie environment. | 9 | A simple POP3 email client for the Opie environment. |
diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp index 52237f5..022d938 100644 --- a/noncore/unsupported/qpdf/QOutputDev.cpp +++ b/noncore/unsupported/qpdf/QOutputDev.cpp | |||
@@ -83,31 +83,31 @@ static QOutFontSubst qStdFonts [] = { | |||
83 | { "Courier-Oblique", "Courier", false, true, QFont::Courier }, | 83 | { "Courier-Oblique", "Courier", false, true, QFont::Courier }, |
84 | { "Courier-Bold", "Courier", true, false, QFont::Courier }, | 84 | { "Courier-Bold", "Courier", true, false, QFont::Courier }, |
85 | { "Courier-BoldOblique", "Courier", true, true, QFont::Courier }, | 85 | { "Courier-BoldOblique", "Courier", true, true, QFont::Courier }, |
86 | 86 | ||
87 | { "Symbol", 0, false, false, QFont::AnyStyle }, | 87 | { "Symbol", 0, false, false, QFont::AnyStyle }, |
88 | { "Zapf-Dingbats", 0, false, false, QFont::AnyStyle }, | 88 | { "Zapf-Dingbats", 0, false, false, QFont::AnyStyle }, |
89 | 89 | ||
90 | { 0, 0, false, false, QFont::AnyStyle } | 90 | { 0, 0, false, false, QFont::AnyStyle } |
91 | }; | 91 | }; |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
99 | QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp_t m22 ) | 99 | QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp_t m22 ) |
100 | { | 100 | { |
101 | static QDict<QOutFontSubst> stdfonts; | 101 | static QDict<QOutFontSubst> stdfonts; |
102 | 102 | ||
103 | // build dict for std. fonts on first invocation | 103 | // build dict for std. fonts on first invocation |
104 | if ( stdfonts. isEmpty ( )) { | 104 | if ( stdfonts. isEmpty ( )) { |
105 | for ( QOutFontSubst *ptr = qStdFonts; ptr-> m_name; ptr++ ) { | 105 | for ( QOutFontSubst *ptr = qStdFonts; ptr-> m_name; ptr++ ) { |
106 | stdfonts. insert ( QString ( ptr-> m_name ), ptr ); | 106 | stdfonts. insert ( QString ( ptr-> m_name ), ptr ); |
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | // compute size and normalized transform matrix | 110 | // compute size and normalized transform matrix |
111 | int size = lrint ( sqrt ( m21 * m21 + m22 * m22 )); | 111 | int size = lrint ( sqrt ( m21 * m21 + m22 * m22 )); |
112 | 112 | ||
113 | QPDFDBG( printf ( "SET FONT: Name=%s, Size=%d, Bold=%d, Italic=%d, Mono=%d, Serif=%d, Symbol=%d, CID=%d, EmbFN=%s, M=(%f,%f,%f,%f)\n", | 113 | QPDFDBG( printf ( "SET FONT: Name=%s, Size=%d, Bold=%d, Italic=%d, Mono=%d, Serif=%d, Symbol=%d, CID=%d, EmbFN=%s, M=(%f,%f,%f,%f)\n", |
@@ -116,62 +116,62 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp | |||
116 | gfxFont-> isBold ( ), | 116 | gfxFont-> isBold ( ), |
117 | gfxFont-> isItalic ( ), | 117 | gfxFont-> isItalic ( ), |
118 | gfxFont-> isFixedWidth ( ), | 118 | gfxFont-> isFixedWidth ( ), |
119 | gfxFont-> isSerif ( ), | 119 | gfxFont-> isSerif ( ), |
120 | gfxFont-> isSymbolic ( ), | 120 | gfxFont-> isSymbolic ( ), |
121 | gfxFont-> isCIDFont ( ), | 121 | gfxFont-> isCIDFont ( ), |
122 | ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName ( ) : "<n/a>" ), | 122 | ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName()-> getCString ( ) : "<n/a>" ), |
123 | (double) m11, (double) m12, (double) m21, (double) m22 )); | 123 | (double) m11, (double) m12, (double) m21, (double) m22 ) ); |
124 | 124 | ||
125 | 125 | ||
126 | QString fname (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ); | 126 | QString fname (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ); |
127 | 127 | ||
128 | QFont f; | 128 | QFont f; |
129 | f. setPixelSize ( size > 0 ? size : 8 ); // type3 fonts misbehave sometimes | 129 | f. setPixelSize ( size > 0 ? size : 8 ); // type3 fonts misbehave sometimes |
130 | 130 | ||
131 | // fast lookup for std. fonts | 131 | // fast lookup for std. fonts |
132 | QOutFontSubst *subst = stdfonts [fname]; | 132 | QOutFontSubst *subst = stdfonts [fname]; |
133 | 133 | ||
134 | if ( subst ) { | 134 | if ( subst ) { |
135 | if ( subst-> m_sname ) | 135 | if ( subst-> m_sname ) |
136 | f. setFamily ( subst-> m_sname ); | 136 | f. setFamily ( subst-> m_sname ); |
137 | f. setStyleHint ( subst-> m_hint, (QFont::StyleStrategy) ( QFont::PreferOutline | QFont::PreferQuality )); | 137 | f. setStyleHint ( subst-> m_hint, (QFont::StyleStrategy) ( QFont::PreferOutline | QFont::PreferQuality )); |
138 | f. setBold ( subst-> m_bold ); | 138 | f. setBold ( subst-> m_bold ); |
139 | f. setItalic ( subst-> m_italic ); | 139 | f. setItalic ( subst-> m_italic ); |
140 | } | 140 | } |
141 | else { | 141 | else { |
142 | QFont::StyleHint sty; | 142 | QFont::StyleHint sty; |
143 | 143 | ||
144 | if ( gfxFont-> isSerif ( )) | 144 | if ( gfxFont-> isSerif ( )) |
145 | sty = QFont::Serif; | 145 | sty = QFont::Serif; |
146 | else if ( gfxFont-> isFixedWidth ( )) | 146 | else if ( gfxFont-> isFixedWidth ( )) |
147 | sty = QFont::TypeWriter; | 147 | sty = QFont::TypeWriter; |
148 | else | 148 | else |
149 | sty = QFont::Helvetica; | 149 | sty = QFont::Helvetica; |
150 | 150 | ||
151 | f. setStyleHint ( sty, (QFont::StyleStrategy) ( QFont::PreferOutline | QFont::PreferQuality )); | 151 | f. setStyleHint ( sty, (QFont::StyleStrategy) ( QFont::PreferOutline | QFont::PreferQuality )); |
152 | f. setBold ( gfxFont-> isBold ( ) > 0 ); | 152 | f. setBold ( gfxFont-> isBold ( ) > 0 ); |
153 | f. setItalic ( gfxFont-> isItalic ( ) > 0 ); | 153 | f. setItalic ( gfxFont-> isItalic ( ) > 0 ); |
154 | f. setFixedPitch ( gfxFont-> isFixedWidth ( ) > 0 ); | 154 | f. setFixedPitch ( gfxFont-> isFixedWidth ( ) > 0 ); |
155 | 155 | ||
156 | // common specifiers in font names | 156 | // common specifiers in font names |
157 | if ( fname. contains ( "Oblique" ) || fname. contains ( "Italic" )) | 157 | if ( fname. contains ( "Oblique" ) || fname. contains ( "Italic" )) |
158 | f. setItalic ( true ); | 158 | f. setItalic ( true ); |
159 | if ( fname. contains ( "Bold" )) | 159 | if ( fname. contains ( "Bold" )) |
160 | f. setWeight ( QFont::Bold ); | 160 | f. setWeight ( QFont::Bold ); |
161 | if ( fname. contains ( "Demi" )) | 161 | if ( fname. contains ( "Demi" )) |
162 | f. setWeight ( QFont::DemiBold ); | 162 | f. setWeight ( QFont::DemiBold ); |
163 | if ( fname. contains ( "Light" )) | 163 | if ( fname. contains ( "Light" )) |
164 | f. setWeight ( QFont::Light ); | 164 | f. setWeight ( QFont::Light ); |
165 | if ( fname. contains ( "Black" )) | 165 | if ( fname. contains ( "Black" )) |
166 | f. setWeight ( QFont::Black ); | 166 | f. setWeight ( QFont::Black ); |
167 | } | 167 | } |
168 | // Treat x-sheared fonts as italic | 168 | // Treat x-sheared fonts as italic |
169 | if (( m12 > -0.1 ) && ( m12 < 0.1 ) && ((( m21 > -5.0 ) && ( m21 < -0.1 )) || (( m21 > 0.1 ) && ( m21 < 5.0 )))) { | 169 | if (( m12 > -0.1 ) && ( m12 < 0.1 ) && ((( m21 > -5.0 ) && ( m21 < -0.1 )) || (( m21 > 0.1 ) && ( m21 < 5.0 )))) { |
170 | f. setItalic ( true ); | 170 | f. setItalic ( true ); |
171 | } | 171 | } |
172 | return f; | 172 | return f; |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | //------------------------------------------------------------------------ | 177 | //------------------------------------------------------------------------ |
@@ -179,180 +179,193 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp | |||
179 | //------------------------------------------------------------------------ | 179 | //------------------------------------------------------------------------ |
180 | 180 | ||
181 | QOutputDev::QOutputDev ( QWidget *parent, const char *name, int flags ) : QScrollView ( parent, name, WRepaintNoErase | WResizeNoErase | flags ) | 181 | QOutputDev::QOutputDev ( QWidget *parent, const char *name, int flags ) : QScrollView ( parent, name, WRepaintNoErase | WResizeNoErase | flags ) |
182 | { | 182 | { |
183 | m_pixmap = 0; | 183 | m_pixmap = 0; |
184 | m_painter = 0; | 184 | m_painter = 0; |
185 | 185 | ||
186 | // create text object | 186 | // create text object |
187 | m_text = new TextPage ( gFalse ); | 187 | m_text = new TextPage ( gFalse ); |
188 | } | 188 | } |
189 | 189 | ||
190 | QOutputDev::~QOutputDev ( ) | 190 | QOutputDev::~QOutputDev ( ) |
191 | { | 191 | { |
192 | delete m_painter; | 192 | delete m_painter; |
193 | delete m_pixmap; | 193 | delete m_pixmap; |
194 | delete m_text; | 194 | delete m_text; |
195 | } | 195 | } |
196 | 196 | ||
197 | 197 | ||
198 | void QOutputDev::startPage ( int /*pageNum*/, GfxState *state ) | 198 | void QOutputDev::startPage ( int /*pageNum*/, GfxState *state ) |
199 | { | 199 | { |
200 | delete m_pixmap; | 200 | delete m_pixmap; |
201 | delete m_painter; | 201 | delete m_painter; |
202 | 202 | ||
203 | m_pixmap = new QPixmap ( lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( ))); | 203 | m_pixmap = new QPixmap ( lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( ))); |
204 | m_painter = new QPainter ( m_pixmap ); | 204 | m_painter = new QPainter ( m_pixmap ); |
205 | 205 | ||
206 | QPDFDBG( printf ( "NEW PIXMAP (%ld x %ld)\n", lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( )))); | 206 | QPDFDBG( printf ( "NEW PIXMAP (%ld x %ld)\n", lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( )))); |
207 | 207 | ||
208 | resizeContents ( m_pixmap-> width ( ), m_pixmap-> height ( )); | 208 | resizeContents ( m_pixmap-> width ( ), m_pixmap-> height ( )); |
209 | setContentsPos ( 0, 0 ); | 209 | setContentsPos ( 0, 0 ); |
210 | 210 | ||
211 | m_pixmap-> fill ( white ); // clear window | 211 | m_pixmap-> fill ( white ); // clear window |
212 | m_text-> clear ( ); // cleat text object | 212 | m_text-> clear ( ); // cleat text object |
213 | viewport ( )-> repaint ( ); | 213 | viewport ( )-> repaint ( ); |
214 | } | 214 | } |
215 | 215 | ||
216 | void QOutputDev::endPage ( ) | 216 | void QOutputDev::endPage ( ) |
217 | { | 217 | { |
218 | QPDFDBG( printf("End page\n") ); | ||
218 | m_text-> coalesce ( ); | 219 | m_text-> coalesce ( ); |
219 | 220 | ||
221 | /* | ||
222 | * I get stupid crashes after endPage is called and then we do clipping | ||
223 | * and other stuff..... | ||
224 | */ | ||
225 | #if 0 | ||
220 | delete m_painter; | 226 | delete m_painter; |
221 | m_painter = 0; | 227 | m_painter = 0; |
222 | 228 | #endif | |
229 | |||
223 | updateContents ( 0, 0, contentsWidth ( ), contentsHeight ( )); | 230 | updateContents ( 0, 0, contentsWidth ( ), contentsHeight ( )); |
224 | } | 231 | } |
225 | 232 | ||
226 | void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ ) | 233 | void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ ) |
227 | { | 234 | { |
228 | fp_t x1, y1, x2, y2, w; | 235 | fp_t x1, y1, x2, y2, w; |
229 | 236 | ||
230 | link-> getBorder ( &x1, &y1, &x2, &y2, &w ); | 237 | link-> getBorder ( &x1, &y1, &x2, &y2, &w ); |
231 | 238 | ||
232 | if ( w > 0 ) { | 239 | if ( w > 0 ) { |
233 | int x, y, dx, dy; | 240 | int x, y, dx, dy; |
234 | 241 | ||
235 | cvtUserToDev ( x1, y1, &x, &y ); | 242 | cvtUserToDev ( x1, y1, &x, &y ); |
236 | cvtUserToDev ( x2, y2, &dx, &dy ); | 243 | cvtUserToDev ( x2, y2, &dx, &dy ); |
237 | 244 | ||
238 | QPen oldpen = m_painter-> pen ( ); | 245 | QPen oldpen = m_painter-> pen ( ); |
239 | m_painter-> setPen ( blue ); | 246 | m_painter-> setPen ( blue ); |
240 | m_painter-> drawRect ( x, y, dx, dy ); | 247 | m_painter-> drawRect ( x, y, dx, dy ); |
241 | m_painter-> setPen ( oldpen ); | 248 | m_painter-> setPen ( oldpen ); |
242 | } | 249 | } |
243 | } | 250 | } |
244 | 251 | ||
245 | void QOutputDev::saveState ( GfxState */*state*/ ) | 252 | void QOutputDev::saveState ( GfxState */*state*/ ) |
246 | { | 253 | { |
254 | if ( ! m_painter ) | ||
255 | return; | ||
256 | |||
247 | QPDFDBG( printf ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); | 257 | QPDFDBG( printf ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); |
248 | 258 | ||
249 | m_painter-> save ( ); | 259 | m_painter-> save ( ); |
250 | } | 260 | } |
251 | 261 | ||
252 | void QOutputDev::restoreState ( GfxState */*state*/ ) | 262 | void QOutputDev::restoreState ( GfxState */*state*/ ) |
253 | { | 263 | { |
264 | if( ! m_painter ) | ||
265 | return; | ||
266 | |||
254 | m_painter-> restore ( ); | 267 | m_painter-> restore ( ); |
255 | 268 | ||
256 | //m_painter-> setClipRegion ( QRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ))); | 269 | //m_painter-> setClipRegion ( QRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ))); |
257 | //m_painter-> setClipping ( false ); | 270 | //m_painter-> setClipping ( false ); |
258 | QPDFDBG ( printf ( "RESTORE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); | 271 | QPDFDBG ( printf ( "RESTORE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); |
259 | } | 272 | } |
260 | 273 | ||
261 | void QOutputDev::updateAll ( GfxState *state ) | 274 | void QOutputDev::updateAll ( GfxState *state ) |
262 | { | 275 | { |
263 | updateLineAttrs ( state, gTrue ); | 276 | updateLineAttrs ( state, gTrue ); |
264 | //updateFlatness ( state ); | 277 | //updateFlatness ( state ); |
265 | //updateMiterLimit ( state ); | 278 | //updateMiterLimit ( state ); |
266 | updateFillColor ( state ); | 279 | updateFillColor ( state ); |
267 | updateStrokeColor ( state ); | 280 | updateStrokeColor ( state ); |
268 | updateFont ( state ); | 281 | updateFont ( state ); |
269 | } | 282 | } |
270 | 283 | ||
271 | void QOutputDev::updateCTM ( GfxState *state, fp_t /*m11*/, fp_t /*m12*/, fp_t /*m21*/, fp_t /*m22*/, fp_t /*m31*/, fp_t /*m32*/ ) | 284 | void QOutputDev::updateCTM ( GfxState *state, fp_t /*m11*/, fp_t /*m12*/, fp_t /*m21*/, fp_t /*m22*/, fp_t /*m31*/, fp_t /*m32*/ ) |
272 | { | 285 | { |
273 | updateLineAttrs ( state, gTrue ); | 286 | updateLineAttrs ( state, gTrue ); |
274 | } | 287 | } |
275 | 288 | ||
276 | void QOutputDev::updateLineDash ( GfxState *state ) | 289 | void QOutputDev::updateLineDash ( GfxState *state ) |
277 | { | 290 | { |
278 | updateLineAttrs ( state, gTrue ); | 291 | updateLineAttrs ( state, gTrue ); |
279 | } | 292 | } |
280 | 293 | ||
281 | void QOutputDev::updateFlatness ( GfxState */*state*/ ) | 294 | void QOutputDev::updateFlatness ( GfxState */*state*/ ) |
282 | { | 295 | { |
283 | // not supported | 296 | // not supported |
284 | QPDFDBG( printf ( "updateFlatness not supported !\n" )); | 297 | QPDFDBG( printf ( "updateFlatness not supported !\n" )); |
285 | } | 298 | } |
286 | 299 | ||
287 | void QOutputDev::updateLineJoin ( GfxState *state ) | 300 | void QOutputDev::updateLineJoin ( GfxState *state ) |
288 | { | 301 | { |
289 | updateLineAttrs ( state, gFalse ); | 302 | updateLineAttrs ( state, gFalse ); |
290 | } | 303 | } |
291 | 304 | ||
292 | void QOutputDev::updateLineCap ( GfxState *state ) | 305 | void QOutputDev::updateLineCap ( GfxState *state ) |
293 | { | 306 | { |
294 | updateLineAttrs ( state, gFalse ); | 307 | updateLineAttrs ( state, gFalse ); |
295 | } | 308 | } |
296 | 309 | ||
297 | // unimplemented | 310 | // unimplemented |
298 | void QOutputDev::updateMiterLimit ( GfxState */*state*/ ) | 311 | void QOutputDev::updateMiterLimit ( GfxState */*state*/ ) |
299 | { | 312 | { |
300 | QPDFDBG( printf ( "updateMiterLimit not supported !\n" )); | 313 | QPDFDBG( printf ( "updateMiterLimit not supported !\n" )); |
301 | } | 314 | } |
302 | 315 | ||
303 | void QOutputDev::updateLineWidth ( GfxState *state ) | 316 | void QOutputDev::updateLineWidth ( GfxState *state ) |
304 | { | 317 | { |
305 | updateLineAttrs ( state, gFalse ); | 318 | updateLineAttrs ( state, gFalse ); |
306 | } | 319 | } |
307 | 320 | ||
308 | void QOutputDev::updateLineAttrs ( GfxState *state, GBool updateDash ) | 321 | void QOutputDev::updateLineAttrs ( GfxState *state, GBool updateDash ) |
309 | { | 322 | { |
310 | fp_t *dashPattern; | 323 | fp_t *dashPattern; |
311 | int dashLength; | 324 | int dashLength; |
312 | fp_t dashStart; | 325 | fp_t dashStart; |
313 | 326 | ||
314 | Qt::PenCapStyle cap; | 327 | Qt::PenCapStyle cap; |
315 | Qt::PenJoinStyle join; | 328 | Qt::PenJoinStyle join; |
316 | int width; | 329 | int width; |
317 | 330 | ||
318 | width = lrint ( state-> getTransformedLineWidth ( )); | 331 | width = lrint ( state-> getTransformedLineWidth ( )); |
319 | 332 | ||
320 | switch ( state-> getLineCap ( )) { | 333 | switch ( state-> getLineCap ( )) { |
321 | case 0: cap = FlatCap; break; | 334 | case 0: cap = FlatCap; break; |
322 | case 1: cap = RoundCap; break; | 335 | case 1: cap = RoundCap; break; |
323 | case 2: cap = SquareCap; break; | 336 | case 2: cap = SquareCap; break; |
324 | default: | 337 | default: |
325 | qWarning ( "Bad line cap style (%d)\n", state-> getLineCap ( )); | 338 | qWarning ( "Bad line cap style (%d)\n", state-> getLineCap ( )); |
326 | cap = FlatCap; | 339 | cap = FlatCap; |
327 | break; | 340 | break; |
328 | } | 341 | } |
329 | 342 | ||
330 | switch (state->getLineJoin()) { | 343 | switch (state->getLineJoin()) { |
331 | case 0: join = MiterJoin; break; | 344 | case 0: join = MiterJoin; break; |
332 | case 1: join = RoundJoin; break; | 345 | case 1: join = RoundJoin; break; |
333 | case 2: join = BevelJoin; break; | 346 | case 2: join = BevelJoin; break; |
334 | default: | 347 | default: |
335 | qWarning ( "Bad line join style (%d)\n", state->getLineJoin ( )); | 348 | qWarning ( "Bad line join style (%d)\n", state->getLineJoin ( )); |
336 | join = MiterJoin; | 349 | join = MiterJoin; |
337 | break; | 350 | break; |
338 | } | 351 | } |
339 | 352 | ||
340 | state-> getLineDash ( &dashPattern, &dashLength, &dashStart ); | 353 | state-> getLineDash ( &dashPattern, &dashLength, &dashStart ); |
341 | 354 | ||
342 | QColor oldcol = m_painter-> pen ( ). color ( ); | 355 | QColor oldcol = m_painter-> pen ( ). color ( ); |
343 | GfxRGB rgb; | 356 | GfxRGB rgb; |
344 | 357 | ||
345 | state-> getStrokeRGB ( &rgb ); | 358 | state-> getStrokeRGB ( &rgb ); |
346 | oldcol = q_col ( rgb ); | 359 | oldcol = q_col ( rgb ); |
347 | 360 | ||
348 | m_painter-> setPen ( QPen ( oldcol, width, dashLength > 0 ? DashLine : SolidLine, cap, join )); | 361 | m_painter-> setPen ( QPen ( oldcol, width, dashLength > 0 ? DashLine : SolidLine, cap, join )); |
349 | 362 | ||
350 | if ( updateDash && ( dashLength > 0 )) { | 363 | if ( updateDash && ( dashLength > 0 )) { |
351 | // Not supported by QT | 364 | // Not supported by QT |
352 | /* | 365 | /* |
353 | char dashList[20]; | 366 | char dashList[20]; |
354 | if (dashLength > 20) | 367 | if (dashLength > 20) |
355 | dashLength = 20; | 368 | dashLength = 20; |
356 | for ( int i = 0; i < dashLength; ++i ) { | 369 | for ( int i = 0; i < dashLength; ++i ) { |
357 | dashList[i] = xoutRound(state->transformWidth(dashPattern[i])); | 370 | dashList[i] = xoutRound(state->transformWidth(dashPattern[i])); |
358 | if (dashList[i] == 0) | 371 | if (dashList[i] == 0) |
@@ -360,82 +373,82 @@ void QOutputDev::updateLineAttrs ( GfxState *state, GBool updateDash ) | |||
360 | } | 373 | } |
361 | XSetDashes(display, strokeGC, xoutRound(dashStart), dashList, dashLength); | 374 | XSetDashes(display, strokeGC, xoutRound(dashStart), dashList, dashLength); |
362 | */ | 375 | */ |
363 | } | 376 | } |
364 | } | 377 | } |
365 | 378 | ||
366 | void QOutputDev::updateFillColor ( GfxState *state ) | 379 | void QOutputDev::updateFillColor ( GfxState *state ) |
367 | { | 380 | { |
368 | GfxRGB rgb; | 381 | GfxRGB rgb; |
369 | state-> getFillRGB ( &rgb ); | 382 | state-> getFillRGB ( &rgb ); |
370 | 383 | ||
371 | m_painter-> setBrush ( q_col ( rgb )); | 384 | m_painter-> setBrush ( q_col ( rgb )); |
372 | } | 385 | } |
373 | 386 | ||
374 | void QOutputDev::updateStrokeColor ( GfxState *state ) | 387 | void QOutputDev::updateStrokeColor ( GfxState *state ) |
375 | { | 388 | { |
376 | GfxRGB rgb; | 389 | GfxRGB rgb; |
377 | state-> getStrokeRGB ( &rgb ); | 390 | state-> getStrokeRGB ( &rgb ); |
378 | 391 | ||
379 | QPen pen = m_painter-> pen ( ); | 392 | QPen pen = m_painter-> pen ( ); |
380 | pen. setColor ( q_col ( rgb )); | 393 | pen. setColor ( q_col ( rgb )); |
381 | m_painter-> setPen ( pen ); | 394 | m_painter-> setPen ( pen ); |
382 | } | 395 | } |
383 | 396 | ||
384 | void QOutputDev::updateFont ( GfxState *state ) | 397 | void QOutputDev::updateFont ( GfxState *state ) |
385 | { | 398 | { |
386 | fp_t m11, m12, m21, m22; | 399 | fp_t m11, m12, m21, m22; |
387 | GfxFont *gfxFont = state-> getFont ( ); | 400 | GfxFont *gfxFont = state-> getFont ( ); |
388 | 401 | ||
389 | if ( !gfxFont ) | 402 | if ( !gfxFont ) |
390 | return; | 403 | return; |
391 | 404 | ||
392 | state-> getFontTransMat ( &m11, &m12, &m21, &m22 ); | 405 | state-> getFontTransMat ( &m11, &m12, &m21, &m22 ); |
393 | m11 *= state-> getHorizScaling ( ); | 406 | m11 *= state-> getHorizScaling ( ); |
394 | m12 *= state-> getHorizScaling ( ); | 407 | m12 *= state-> getHorizScaling ( ); |
395 | 408 | ||
396 | QFont font = matchFont ( gfxFont, m11, m12, m21, m22 ); | 409 | QFont font = matchFont ( gfxFont, m11, m12, m21, m22 ); |
397 | 410 | ||
398 | m_painter-> setFont ( font ); | 411 | m_painter-> setFont ( font ); |
399 | m_text-> updateFont ( state ); | 412 | m_text-> updateFont ( state ); |
400 | } | 413 | } |
401 | 414 | ||
402 | void QOutputDev::stroke ( GfxState *state ) | 415 | void QOutputDev::stroke ( GfxState *state ) |
403 | { | 416 | { |
404 | QPointArray points; | 417 | QPointArray points; |
405 | QArray<int> lengths; | 418 | QArray<int> lengths; |
406 | 419 | ||
407 | // transform points | 420 | // transform points |
408 | int n = convertPath ( state, points, lengths ); | 421 | int n = convertPath ( state, points, lengths ); |
409 | 422 | ||
410 | QPDFDBG( printf ( "DRAWING: %d POLYS\n", n )); | 423 | QPDFDBG( printf ( "DRAWING: %d POLYS\n", n )); |
411 | 424 | ||
412 | // draw each subpath | 425 | // draw each subpath |
413 | int j = 0; | 426 | int j = 0; |
414 | for ( int i = 0; i < n; i++ ) { | 427 | for ( int i = 0; i < n; i++ ) { |
415 | int len = lengths [i]; | 428 | int len = lengths [i]; |
416 | 429 | ||
417 | if ( len >= 2 ) { | 430 | if ( len >= 2 ) { |
418 | QPDFDBG( printf ( " - POLY %d: ", i )); | 431 | QPDFDBG( printf ( " - POLY %d: ", i )); |
419 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) | 432 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) |
420 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); | 433 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
421 | QPDFDBG( printf ( "\n" )); | 434 | QPDFDBG( printf ( "\n" )); |
422 | 435 | ||
423 | m_painter-> drawPolyline ( points, j, len ); | 436 | m_painter-> drawPolyline ( points, j, len ); |
424 | } | 437 | } |
425 | j += len; | 438 | j += len; |
426 | } | 439 | } |
427 | qApp-> processEvents ( ); | 440 | qApp-> processEvents ( ); |
428 | } | 441 | } |
429 | 442 | ||
430 | void QOutputDev::fill ( GfxState *state ) | 443 | void QOutputDev::fill ( GfxState *state ) |
431 | { | 444 | { |
432 | doFill ( state, true ); | 445 | doFill ( state, true ); |
433 | } | 446 | } |
434 | 447 | ||
435 | void QOutputDev::eoFill ( GfxState *state ) | 448 | void QOutputDev::eoFill ( GfxState *state ) |
436 | { | 449 | { |
437 | doFill ( state, false ); | 450 | doFill ( state, false ); |
438 | } | 451 | } |
439 | 452 | ||
440 | // | 453 | // |
441 | // X doesn't color the pixels on the right-most and bottom-most | 454 | // X doesn't color the pixels on the right-most and bottom-most |
@@ -443,93 +456,93 @@ void QOutputDev::eoFill ( GfxState *state ) | |||
443 | // are not colored at all. I think this is supposed to be a | 456 | // are not colored at all. I think this is supposed to be a |
444 | // feature, but I can't figure out why. So after it fills a | 457 | // feature, but I can't figure out why. So after it fills a |
445 | // polygon, it also draws lines around the border. This is done | 458 | // polygon, it also draws lines around the border. This is done |
446 | // only for single-component polygons, since it's not very | 459 | // only for single-component polygons, since it's not very |
447 | // compatible with the compound polygon kludge (see convertPath()). | 460 | // compatible with the compound polygon kludge (see convertPath()). |
448 | // | 461 | // |
449 | void QOutputDev::doFill ( GfxState *state, bool winding ) | 462 | void QOutputDev::doFill ( GfxState *state, bool winding ) |
450 | { | 463 | { |
451 | QPointArray points; | 464 | QPointArray points; |
452 | QArray<int> lengths; | 465 | QArray<int> lengths; |
453 | 466 | ||
454 | // transform points | 467 | // transform points |
455 | int n = convertPath ( state, points, lengths ); | 468 | int n = convertPath ( state, points, lengths ); |
456 | 469 | ||
457 | QPDFDBG( printf ( "FILLING: %d POLYS\n", n )); | 470 | QPDFDBG( printf ( "FILLING: %d POLYS\n", n )); |
458 | 471 | ||
459 | QPen oldpen = m_painter-> pen ( ); | 472 | QPen oldpen = m_painter-> pen ( ); |
460 | m_painter-> setPen ( QPen ( NoPen )); | 473 | m_painter-> setPen ( QPen ( NoPen )); |
461 | 474 | ||
462 | // draw each subpath | 475 | // draw each subpath |
463 | int j = 0; | 476 | int j = 0; |
464 | for ( int i = 0; i < n; i++ ) { | 477 | for ( int i = 0; i < n; i++ ) { |
465 | int len = lengths [i]; | 478 | int len = lengths [i]; |
466 | 479 | ||
467 | if ( len >= 3 ) { | 480 | if ( len >= 3 ) { |
468 | QPDFDBG( printf ( " - POLY %d: ", i )); | 481 | QPDFDBG( printf ( " - POLY %d: ", i )); |
469 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) | 482 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) |
470 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); | 483 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
471 | QPDFDBG( printf ( "\n" )); | 484 | QPDFDBG( printf ( "\n" )); |
472 | 485 | ||
473 | m_painter-> drawPolygon ( points, winding, j, len ); | 486 | m_painter-> drawPolygon ( points, winding, j, len ); |
474 | } | 487 | } |
475 | j += len; | 488 | j += len; |
476 | } | 489 | } |
477 | m_painter-> setPen ( oldpen ); | 490 | m_painter-> setPen ( oldpen ); |
478 | 491 | ||
479 | qApp-> processEvents ( ); | 492 | qApp-> processEvents ( ); |
480 | } | 493 | } |
481 | 494 | ||
482 | void QOutputDev::clip ( GfxState *state ) | 495 | void QOutputDev::clip ( GfxState *state ) |
483 | { | 496 | { |
484 | doClip ( state, true ); | 497 | doClip ( state, true ); |
485 | } | 498 | } |
486 | 499 | ||
487 | void QOutputDev::eoClip ( GfxState *state ) | 500 | void QOutputDev::eoClip ( GfxState *state ) |
488 | { | 501 | { |
489 | doClip ( state, false ); | 502 | doClip ( state, false ); |
490 | } | 503 | } |
491 | 504 | ||
492 | void QOutputDev::doClip ( GfxState *state, bool winding ) | 505 | void QOutputDev::doClip ( GfxState *state, bool winding ) |
493 | { | 506 | { |
494 | QPointArray points; | 507 | QPointArray points; |
495 | QArray<int> lengths; | 508 | QArray<int> lengths; |
496 | 509 | ||
497 | // transform points | 510 | // transform points |
498 | int n = convertPath ( state, points, lengths ); | 511 | int n = convertPath ( state, points, lengths ); |
499 | 512 | ||
500 | QRegion region; | 513 | QRegion region; |
501 | 514 | ||
502 | QPDFDBG( printf ( "CLIPPING: %d POLYS\n", n )); | 515 | QPDFDBG( printf ( "CLIPPING: %d POLYS\n", n )); |
503 | 516 | ||
504 | // draw each subpath | 517 | // draw each subpath |
505 | int j = 0; | 518 | int j = 0; |
506 | for ( int i = 0; i < n; i++ ) { | 519 | for ( int i = 0; i < n; i++ ) { |
507 | int len = lengths [i]; | 520 | int len = lengths [i]; |
508 | 521 | ||
509 | if ( len >= 3 ) { | 522 | if ( len >= 3 ) { |
510 | QPointArray dummy; | 523 | QPointArray dummy; |
511 | dummy. setRawData ( points. data ( ) + j, len ); | 524 | dummy. setRawData ( points. data ( ) + j, len ); |
512 | 525 | ||
513 | QPDFDBG( printf ( " - POLY %d: ", i )); | 526 | QPDFDBG( printf ( " - POLY %d: ", i )); |
514 | QPDFDBG( for ( int ii = 0; ii < len; ii++ ) printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); | 527 | QPDFDBG( for ( int ii = 0; ii < len; ii++ ) printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
515 | QPDFDBG( printf ( "\n" )); | 528 | QPDFDBG( printf ( "\n" )); |
516 | 529 | ||
517 | region |= QRegion ( dummy, winding ); | 530 | region |= QRegion ( dummy, winding ); |
518 | 531 | ||
519 | dummy. resetRawData ( points. data ( ) + j, len ); | 532 | dummy. resetRawData ( points. data ( ) + j, len ); |
520 | } | 533 | } |
521 | j += len; | 534 | j += len; |
522 | } | 535 | } |
523 | 536 | ||
524 | if ( m_painter-> hasClipping ( )) | 537 | if ( m_painter && m_painter-> hasClipping ( )) |
525 | region &= m_painter-> clipRegion ( ); | 538 | region &= m_painter-> clipRegion ( ); |
526 | 539 | ||
527 | //m_painter-> setClipRegion ( region ); | 540 | //m_painter-> setClipRegion ( region ); |
528 | //m_painter-> setClipping ( true ); | 541 | //m_painter-> setClipping ( true ); |
529 | 542 | ||
530 | //m_painter-> fillRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ), red ); | 543 | //m_painter-> fillRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ), red ); |
531 | //m_painter-> drawText ( points [0]. x ( ) + 10, points [0]. y ( ) + 10, "Bla bla" ); | 544 | //m_painter-> drawText ( points [0]. x ( ) + 10, points [0]. y ( ) + 10, "Bla bla" ); |
532 | qApp-> processEvents ( ); | 545 | qApp-> processEvents ( ); |
533 | } | 546 | } |
534 | 547 | ||
535 | // | 548 | // |
@@ -538,13 +551,13 @@ void QOutputDev::doClip ( GfxState *state, bool winding ) | |||
538 | // If <fillHack> is set, close any unclosed subpaths and activate a | 551 | // If <fillHack> is set, close any unclosed subpaths and activate a |
539 | // kludge for polygon fills: First, it divides up the subpaths into | 552 | // kludge for polygon fills: First, it divides up the subpaths into |
540 | // non-overlapping polygons by simply comparing bounding rectangles. | 553 | // non-overlapping polygons by simply comparing bounding rectangles. |
541 | // Then it connects subaths within a single compound polygon to a single | 554 | // Then it connects subaths within a single compound polygon to a single |
542 | // point so that X can fill the polygon (sort of). | 555 | // point so that X can fill the polygon (sort of). |
543 | // | 556 | // |
544 | int QOutputDev::convertPath ( GfxState *state, QPointArray &points, QArray<int> &lengths ) | 557 | int QOutputDev::convertPath ( GfxState *state, QPointArray &points, QArray<int> &lengths ) |
545 | { | 558 | { |
546 | GfxPath *path = state-> getPath ( ); | 559 | GfxPath *path = state-> getPath ( ); |
547 | int n = path-> getNumSubpaths ( ); | 560 | int n = path-> getNumSubpaths ( ); |
548 | 561 | ||
549 | lengths. resize ( n ); | 562 | lengths. resize ( n ); |
550 | 563 | ||
@@ -566,65 +579,65 @@ int QOutputDev::convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArr | |||
566 | int oldcnt = points. count ( ); | 579 | int oldcnt = points. count ( ); |
567 | 580 | ||
568 | fp_t x0, y0, x1, y1, x2, y2, x3, y3; | 581 | fp_t x0, y0, x1, y1, x2, y2, x3, y3; |
569 | 582 | ||
570 | int m = subpath-> getNumPoints ( ); | 583 | int m = subpath-> getNumPoints ( ); |
571 | int i = 0; | 584 | int i = 0; |
572 | 585 | ||
573 | while ( i < m ) { | 586 | while ( i < m ) { |
574 | if ( i >= 1 && subpath-> getCurve ( i )) { | 587 | if ( i >= 1 && subpath-> getCurve ( i )) { |
575 | state-> transform ( subpath-> getX ( i - 1 ), subpath-> getY ( i - 1 ), &x0, &y0 ); | 588 | state-> transform ( subpath-> getX ( i - 1 ), subpath-> getY ( i - 1 ), &x0, &y0 ); |
576 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); | 589 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); |
577 | state-> transform ( subpath-> getX ( i + 1 ), subpath-> getY ( i + 1 ), &x2, &y2 ); | 590 | state-> transform ( subpath-> getX ( i + 1 ), subpath-> getY ( i + 1 ), &x2, &y2 ); |
578 | state-> transform ( subpath-> getX ( i + 2 ), subpath-> getY ( i + 2 ), &x3, &y3 ); | 591 | state-> transform ( subpath-> getX ( i + 2 ), subpath-> getY ( i + 2 ), &x3, &y3 ); |
579 | 592 | ||
580 | QPointArray tmp; | 593 | QPointArray tmp; |
581 | tmp. setPoints ( 4, lrint ( x0 ), lrint ( y0 ), lrint ( x1 ), lrint ( y1 ), | 594 | tmp. setPoints ( 4, lrint ( x0 ), lrint ( y0 ), lrint ( x1 ), lrint ( y1 ), |
582 | lrint ( x2 ), lrint ( y2 ), lrint ( x3 ), lrint ( y3 )); | 595 | lrint ( x2 ), lrint ( y2 ), lrint ( x3 ), lrint ( y3 )); |
583 | 596 | ||
584 | #if QT_VERSION < 300 | 597 | #if QT_VERSION < 300 |
585 | tmp = tmp. quadBezier ( ); | 598 | tmp = tmp. quadBezier ( ); |
586 | 599 | ||
587 | for ( uint loop = 0; loop < tmp. count ( ); loop++ ) { | 600 | for ( uint loop = 0; loop < tmp. count ( ); loop++ ) { |
588 | QPoint p = tmp. point ( loop ); | 601 | QPoint p = tmp. point ( loop ); |
589 | points. putPoints ( points. count ( ), 1, p. x ( ), p. y ( )); | 602 | points. putPoints ( points. count ( ), 1, p. x ( ), p. y ( )); |
590 | } | 603 | } |
591 | #else | 604 | #else |
592 | tmp = tmp. cubicBezier ( ); | 605 | tmp = tmp. cubicBezier ( ); |
593 | points. putPoints ( points. count ( ), tmp. count ( ), tmp ); | 606 | points. putPoints ( points. count ( ), tmp. count ( ), tmp ); |
594 | #endif | 607 | #endif |
595 | 608 | ||
596 | i += 3; | 609 | i += 3; |
597 | } | 610 | } |
598 | else { | 611 | else { |
599 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); | 612 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); |
600 | 613 | ||
601 | points. putPoints ( points. count ( ), 1, lrint ( x1 ), lrint ( y1 )); | 614 | points. putPoints ( points. count ( ), 1, lrint ( x1 ), lrint ( y1 )); |
602 | ++i; | 615 | ++i; |
603 | } | 616 | } |
604 | } | 617 | } |
605 | return points. count ( ) - oldcnt; | 618 | return points. count ( ) - oldcnt; |
606 | } | 619 | } |
607 | 620 | ||
608 | 621 | ||
609 | void QOutputDev::beginString ( GfxState *state, GString */*s*/ ) | 622 | void QOutputDev::beginString ( GfxState *state, GString */*s*/ ) |
610 | { | 623 | { |
611 | m_text-> beginString ( state ); | 624 | m_text-> beginString ( state ); |
612 | } | 625 | } |
613 | 626 | ||
614 | void QOutputDev::endString ( GfxState */*state*/ ) | 627 | void QOutputDev::endString ( GfxState */*state*/ ) |
615 | { | 628 | { |
616 | m_text-> endString ( ); | 629 | m_text-> endString ( ); |
617 | } | 630 | } |
618 | 631 | ||
619 | void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | 632 | void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, |
620 | fp_t dx, fp_t dy, fp_t originX, fp_t originY, | 633 | fp_t dx, fp_t dy, fp_t originX, fp_t originY, |
621 | CharCode code, Unicode *u, int uLen ) | 634 | CharCode code, Unicode *u, int uLen ) |
622 | { | 635 | { |
623 | fp_t x1, y1, dx1, dy1; | 636 | fp_t x1, y1, dx1, dy1; |
624 | 637 | ||
625 | if ( uLen > 0 ) | 638 | if ( uLen > 0 ) |
626 | m_text-> addChar ( state, x, y, dx, dy, u, uLen ); | 639 | m_text-> addChar ( state, x, y, dx, dy, u, uLen ); |
627 | 640 | ||
628 | // check for invisible text -- this is used by Acrobat Capture | 641 | // check for invisible text -- this is used by Acrobat Capture |
629 | if (( state-> getRender ( ) & 3 ) == 3 ) { | 642 | if (( state-> getRender ( ) & 3 ) == 3 ) { |
630 | return; | 643 | return; |
@@ -636,155 +649,155 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
636 | state-> transformDelta ( dx, dy, &dx1, &dy1 ); | 649 | state-> transformDelta ( dx, dy, &dx1, &dy1 ); |
637 | 650 | ||
638 | 651 | ||
639 | if ( uLen > 0 ) { | 652 | if ( uLen > 0 ) { |
640 | QString str; | 653 | QString str; |
641 | QFontMetrics fm = m_painter-> fontMetrics ( ); | 654 | QFontMetrics fm = m_painter-> fontMetrics ( ); |
642 | 655 | ||
643 | for ( int i = 0; i < uLen; i++ ) { | 656 | for ( int i = 0; i < uLen; i++ ) { |
644 | QChar c = QChar ( u [i] ); | 657 | QChar c = QChar ( u [i] ); |
645 | 658 | ||
646 | if ( fm. inFont ( c )) { | 659 | if ( fm. inFont ( c )) { |
647 | str [i] = QChar ( u [i] ); | 660 | str [i] = QChar ( u [i] ); |
648 | } | 661 | } |
649 | else { | 662 | else { |
650 | str [i] = ' '; | 663 | str [i] = ' '; |
651 | QPDFDBG( printf ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( ))); | 664 | QPDFDBG( printf ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( ))); |
652 | } | 665 | } |
653 | } | 666 | } |
654 | 667 | ||
655 | if (( uLen == 1 ) && ( str [0] == ' ' )) | 668 | if (( uLen == 1 ) && ( str [0] == ' ' )) |
656 | return; | 669 | return; |
657 | 670 | ||
658 | 671 | ||
659 | fp_t m11, m12, m21, m22; | 672 | fp_t m11, m12, m21, m22; |
660 | 673 | ||
661 | state-> getFontTransMat ( &m11, &m12, &m21, &m22 ); | 674 | state-> getFontTransMat ( &m11, &m12, &m21, &m22 ); |
662 | m11 *= state-> getHorizScaling ( ); | 675 | m11 *= state-> getHorizScaling ( ); |
663 | m12 *= state-> getHorizScaling ( ); | 676 | m12 *= state-> getHorizScaling ( ); |
664 | 677 | ||
665 | fp_t fsize = m_painter-> font ( ). pixelSize ( ); | 678 | fp_t fsize = m_painter-> font ( ). pixelSize ( ); |
666 | 679 | ||
667 | #ifndef QT_NO_TRANSFORMATIONS | 680 | #ifndef QT_NO_TRANSFORMATIONS |
668 | QWMatrix oldmat; | 681 | QWMatrix oldmat; |
669 | |||
670 | bool dorot = (( m12 < -0.1 ) || ( m12 > 0.1 )) && (( m21 < -0.1 ) || ( m21 > 0.1 )); | ||
671 | 682 | ||
672 | if ( dorot ) { | 683 | bool dorot = (( m12 < -0.1 ) || ( m12 > 0.1 )) && (( m21 < -0.1 ) || ( m21 > 0.1 )); |
684 | |||
685 | if ( dorot ) { | ||
673 | oldmat = m_painter-> worldMatrix ( ); | 686 | oldmat = m_painter-> worldMatrix ( ); |
674 | 687 | ||
675 | std::cerr << std::endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl; | 688 | std::cerr << std::endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl; |
676 | 689 | ||
677 | QWMatrix mat ( lrint ( m11 / fsize ), lrint ( m12 / fsize ), -lrint ( m21 / fsize ), -lrint ( m22 / fsize ), lrint ( x1 ), lrint ( y1 )); | 690 | QWMatrix mat ( lrint ( m11 / fsize ), lrint ( m12 / fsize ), -lrint ( m21 / fsize ), -lrint ( m22 / fsize ), lrint ( x1 ), lrint ( y1 )); |
678 | 691 | ||
679 | m_painter-> setWorldMatrix ( mat ); | 692 | m_painter-> setWorldMatrix ( mat ); |
680 | 693 | ||
681 | x1 = 0; | 694 | x1 = 0; |
682 | y1 = 0; | 695 | y1 = 0; |
683 | } | 696 | } |
684 | #endif | 697 | #endif |
685 | 698 | ||
686 | QPen oldpen = m_painter-> pen ( ); | 699 | QPen oldpen = m_painter-> pen ( ); |
687 | 700 | ||
688 | if (!( state-> getRender ( ) & 1 )) { | 701 | if (!( state-> getRender ( ) & 1 )) { |
689 | QPen fillpen = oldpen; | 702 | QPen fillpen = oldpen; |
690 | 703 | ||
691 | fillpen. setColor ( m_painter-> brush ( ). color ( )); | 704 | fillpen. setColor ( m_painter-> brush ( ). color ( )); |
692 | m_painter-> setPen ( fillpen ); | 705 | m_painter-> setPen ( fillpen ); |
693 | } | 706 | } |
694 | 707 | ||
695 | if ( fsize > 5 ) | 708 | if ( fsize > 5 ) |
696 | m_painter-> drawText ( lrint ( x1 ), lrint ( y1 ), str ); | 709 | m_painter-> drawText ( lrint ( x1 ), lrint ( y1 ), str ); |
697 | else | 710 | else |
698 | m_painter-> fillRect ( lrint ( x1 ), lrint ( y1 ), lrint ( QMAX( fp_t(1), dx1 )), lrint ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( )); | 711 | m_painter-> fillRect ( lrint ( x1 ), lrint ( y1 ), lrint ( QMAX( fp_t(1), dx1 )), lrint ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( )); |
699 | 712 | ||
700 | m_painter-> setPen ( oldpen ); | 713 | m_painter-> setPen ( oldpen ); |
701 | 714 | ||
702 | #ifndef QT_NO_TRANSFORMATIONS | 715 | #ifndef QT_NO_TRANSFORMATIONS |
703 | if ( dorot ) | 716 | if ( dorot ) |
704 | m_painter-> setWorldMatrix ( oldmat ); | 717 | m_painter-> setWorldMatrix ( oldmat ); |
705 | #endif | 718 | #endif |
706 | 719 | ||
707 | QPDFDBG( printf ( "DRAW TEXT: \"%s\" at (%ld/%ld)\n", str. local8Bit ( ). data ( ), lrint ( x1 ), lrint ( y1 ))); | 720 | QPDFDBG( printf ( "DRAW TEXT: \"%s\" at (%ld/%ld)\n", str. local8Bit ( ). data ( ), lrint ( x1 ), lrint ( y1 ))); |
708 | } | 721 | } |
709 | else if ( code != 0 ) { | 722 | else if ( code != 0 ) { |
710 | // some PDF files use CID 0, which is .notdef, so just ignore it | 723 | // some PDF files use CID 0, which is .notdef, so just ignore it |
711 | qWarning ( "Unknown character (CID=%d Unicode=%hx)\n", code, (unsigned short) ( uLen > 0 ? u [0] : (Unicode) 0 )); | 724 | qWarning ( "Unknown character (CID=%d Unicode=%hx)\n", code, (unsigned short) ( uLen > 0 ? u [0] : (Unicode) 0 )); |
712 | } | 725 | } |
713 | qApp-> processEvents ( ); | 726 | qApp-> processEvents ( ); |
714 | } | 727 | } |
715 | 728 | ||
716 | 729 | ||
717 | 730 | ||
718 | void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, int width, int height, GBool invert, GBool inlineImg ) | 731 | void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, int width, int height, GBool invert, GBool inlineImg ) |
719 | { | 732 | { |
720 | // get CTM, check for singular matrix | 733 | // get CTM, check for singular matrix |
721 | fp_t *ctm = state-> getCTM ( ); | 734 | fp_t *ctm = state-> getCTM ( ); |
722 | 735 | ||
723 | if ( fabs ( ctm [0] * ctm [3] - ctm [1] * ctm [2] ) < 0.000001 ) { | 736 | if ( fabs ( ctm [0] * ctm [3] - ctm [1] * ctm [2] ) < 0.000001 ) { |
724 | qWarning ( "Singular CTM in drawImage\n" ); | 737 | qWarning ( "Singular CTM in drawImage\n" ); |
725 | 738 | ||
726 | if ( inlineImg ) { | 739 | if ( inlineImg ) { |
727 | str-> reset ( ); | 740 | str-> reset ( ); |
728 | int j = height * (( width + 7 ) / 8 ); | 741 | int j = height * (( width + 7 ) / 8 ); |
729 | for ( int i = 0; i < j; i++ ) | 742 | for ( int i = 0; i < j; i++ ) |
730 | str->getChar(); | 743 | str->getChar(); |
731 | 744 | ||
732 | str->close(); | 745 | str->close(); |
733 | } | 746 | } |
734 | return; | 747 | return; |
735 | } | 748 | } |
736 | 749 | ||
737 | GfxRGB rgb; | 750 | GfxRGB rgb; |
738 | state-> getFillRGB ( &rgb ); | 751 | state-> getFillRGB ( &rgb ); |
739 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); | 752 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); |
740 | 753 | ||
741 | 754 | ||
742 | QImage img ( width, height, 32 ); | 755 | QImage img ( width, height, 32 ); |
743 | img. setAlphaBuffer ( true ); | 756 | img. setAlphaBuffer ( true ); |
744 | 757 | ||
745 | QPDFDBG( printf ( "IMAGE MASK (%dx%d)\n", width, height )); | 758 | QPDFDBG( printf ( "IMAGE MASK (%dx%d)\n", width, height )); |
746 | 759 | ||
747 | // initialize the image stream | 760 | // initialize the image stream |
748 | ImageStream *imgStr = new ImageStream ( str, width, 1, 1 ); | 761 | ImageStream *imgStr = new ImageStream ( str, width, 1, 1 ); |
749 | imgStr-> reset ( ); | 762 | imgStr-> reset ( ); |
750 | 763 | ||
751 | uchar **scanlines = img. jumpTable ( ); | 764 | uchar **scanlines = img. jumpTable ( ); |
752 | 765 | ||
753 | if ( ctm [3] > 0 ) | 766 | if ( ctm [3] > 0 ) |
754 | scanlines += ( height - 1 ); | 767 | scanlines += ( height - 1 ); |
755 | 768 | ||
756 | for ( int y = 0; y < height; y++ ) { | 769 | for ( int y = 0; y < height; y++ ) { |
757 | QRgb *scanline = (QRgb *) *scanlines; | 770 | QRgb *scanline = (QRgb *) *scanlines; |
758 | 771 | ||
759 | if ( ctm [0] < 0 ) | 772 | if ( ctm [0] < 0 ) |
760 | scanline += ( width - 1 ); | 773 | scanline += ( width - 1 ); |
761 | 774 | ||
762 | for ( int x = 0; x < width; x++ ) { | 775 | for ( int x = 0; x < width; x++ ) { |
763 | Guchar alpha; | 776 | Guchar alpha; |
764 | 777 | ||
765 | imgStr-> getPixel ( &alpha ); | 778 | imgStr-> getPixel ( &alpha ); |
766 | 779 | ||
767 | if ( invert ) | 780 | if ( invert ) |
768 | alpha ^= 1; | 781 | alpha ^= 1; |
769 | 782 | ||
770 | *scanline = ( alpha == 0 ) ? 0xff000000 | val : val; | 783 | *scanline = ( alpha == 0 ) ? 0xff000000 | val : val; |
771 | 784 | ||
772 | ctm [0] < 0 ? scanline-- : scanline++; | 785 | ctm [0] < 0 ? scanline-- : scanline++; |
773 | } | 786 | } |
774 | ctm [3] > 0 ? scanlines-- : scanlines++; | 787 | ctm [3] > 0 ? scanlines-- : scanlines++; |
775 | 788 | ||
776 | qApp-> processEvents ( ); | 789 | qApp-> processEvents ( ); |
777 | } | 790 | } |
778 | 791 | ||
779 | #ifndef QT_NO_TRANSFORMATIONS | 792 | #ifndef QT_NO_TRANSFORMATIONS |
780 | QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); | 793 | QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); |
781 | 794 | ||
782 | std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl | 795 | std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl |
783 | << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl; | 796 | << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl; |
784 | 797 | ||
785 | QWMatrix oldmat = m_painter-> worldMatrix ( ); | 798 | QWMatrix oldmat = m_painter-> worldMatrix ( ); |
786 | m_painter-> setWorldMatrix ( mat, true ); | 799 | m_painter-> setWorldMatrix ( mat, true ); |
787 | 800 | ||
788 | #ifdef QWS | 801 | #ifdef QWS |
789 | QPixmap pm; | 802 | QPixmap pm; |
790 | pm. convertFromImage ( img ); | 803 | pm. convertFromImage ( img ); |
@@ -799,162 +812,162 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, | |||
799 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { | 812 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { |
800 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); | 813 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); |
801 | } | 814 | } |
802 | else { | 815 | else { |
803 | int x = lrint ( ctm [4] ); | 816 | int x = lrint ( ctm [4] ); |
804 | int y = lrint ( ctm [5] ); | 817 | int y = lrint ( ctm [5] ); |
805 | 818 | ||
806 | int w = lrint ( ctm [0] ); | 819 | int w = lrint ( ctm [0] ); |
807 | int h = lrint ( ctm [3] ); | 820 | int h = lrint ( ctm [3] ); |
808 | 821 | ||
809 | if ( w < 0 ) { | 822 | if ( w < 0 ) { |
810 | x += w; | 823 | x += w; |
811 | w = -w; | 824 | w = -w; |
812 | } | 825 | } |
813 | if ( h < 0 ) { | 826 | if ( h < 0 ) { |
814 | y += h; | 827 | y += h; |
815 | h = -h; | 828 | h = -h; |
816 | } | 829 | } |
817 | 830 | ||
818 | QPDFDBG( printf ( "DRAWING IMAGE MASKED: %d/%d - %dx%d\n", x, y, w, h )); | 831 | QPDFDBG( printf ( "DRAWING IMAGE MASKED: %d/%d - %dx%d\n", x, y, w, h )); |
819 | 832 | ||
820 | img = img. smoothScale ( w, h ); | 833 | img = img. smoothScale ( w, h ); |
821 | qApp-> processEvents ( ); | 834 | qApp-> processEvents ( ); |
822 | m_painter-> drawImage ( x, y, img ); | 835 | m_painter-> drawImage ( x, y, img ); |
823 | } | 836 | } |
824 | 837 | ||
825 | #endif | 838 | #endif |
826 | 839 | ||
827 | delete imgStr; | 840 | delete imgStr; |
828 | qApp-> processEvents ( ); | 841 | qApp-> processEvents ( ); |
829 | } | 842 | } |
830 | 843 | ||
831 | 844 | ||
832 | void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg ) | 845 | void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg ) |
833 | { | 846 | { |
834 | int nComps, nVals, nBits; | 847 | int nComps, nVals, nBits; |
835 | 848 | ||
836 | // image parameters | 849 | // image parameters |
837 | nComps = colorMap->getNumPixelComps ( ); | 850 | nComps = colorMap->getNumPixelComps ( ); |
838 | nVals = width * nComps; | 851 | nVals = width * nComps; |
839 | nBits = colorMap-> getBits ( ); | 852 | nBits = colorMap-> getBits ( ); |
840 | 853 | ||
841 | // get CTM, check for singular matrix | 854 | // get CTM, check for singular matrix |
842 | fp_t *ctm = state-> getCTM ( ); | 855 | fp_t *ctm = state-> getCTM ( ); |
843 | 856 | ||
844 | if ( fabs ( ctm [0] * ctm [3] - ctm [1] * ctm [2] ) < 0.000001 ) { | 857 | if ( fabs ( ctm [0] * ctm [3] - ctm [1] * ctm [2] ) < 0.000001 ) { |
845 | qWarning ( "Singular CTM in drawImage\n" ); | 858 | qWarning ( "Singular CTM in drawImage\n" ); |
846 | 859 | ||
847 | if ( inlineImg ) { | 860 | if ( inlineImg ) { |
848 | str-> reset ( ); | 861 | str-> reset ( ); |
849 | int j = height * (( nVals * nBits + 7 ) / 8 ); | 862 | int j = height * (( nVals * nBits + 7 ) / 8 ); |
850 | for ( int i = 0; i < j; i++ ) | 863 | for ( int i = 0; i < j; i++ ) |
851 | str->getChar(); | 864 | str->getChar(); |
852 | 865 | ||
853 | str->close(); | 866 | str->close(); |
854 | } | 867 | } |
855 | return; | 868 | return; |
856 | } | 869 | } |
857 | 870 | ||
858 | QImage img ( width, height, 32 ); | 871 | QImage img ( width, height, 32 ); |
859 | 872 | ||
860 | if ( maskColors ) | 873 | if ( maskColors ) |
861 | img. setAlphaBuffer ( true ); | 874 | img. setAlphaBuffer ( true ); |
862 | 875 | ||
863 | QPDFDBG( printf ( "IMAGE (%dx%d)\n", width, height )); | 876 | QPDFDBG( printf ( "IMAGE (%dx%d)\n", width, height )); |
864 | 877 | ||
865 | // initialize the image stream | 878 | // initialize the image stream |
866 | ImageStream *imgStr = new ImageStream ( str, width, nComps, nBits ); | 879 | ImageStream *imgStr = new ImageStream ( str, width, nComps, nBits ); |
867 | imgStr-> reset ( ); | 880 | imgStr-> reset ( ); |
868 | 881 | ||
869 | Guchar pixBuf [gfxColorMaxComps]; | 882 | Guchar pixBuf [gfxColorMaxComps]; |
870 | GfxRGB rgb; | 883 | GfxRGB rgb; |
871 | 884 | ||
872 | 885 | ||
873 | uchar **scanlines = img. jumpTable ( ); | 886 | uchar **scanlines = img. jumpTable ( ); |
874 | 887 | ||
875 | if ( ctm [3] > 0 ) | 888 | if ( ctm [3] > 0 ) |
876 | scanlines += ( height - 1 ); | 889 | scanlines += ( height - 1 ); |
877 | 890 | ||
878 | for ( int y = 0; y < height; y++ ) { | 891 | for ( int y = 0; y < height; y++ ) { |
879 | QRgb *scanline = (QRgb *) *scanlines; | 892 | QRgb *scanline = (QRgb *) *scanlines; |
880 | 893 | ||
881 | if ( ctm [0] < 0 ) | 894 | if ( ctm [0] < 0 ) |
882 | scanline += ( width - 1 ); | 895 | scanline += ( width - 1 ); |
883 | 896 | ||
884 | for ( int x = 0; x < width; x++ ) { | 897 | for ( int x = 0; x < width; x++ ) { |
885 | imgStr-> getPixel ( pixBuf ); | 898 | imgStr-> getPixel ( pixBuf ); |
886 | colorMap-> getRGB ( pixBuf, &rgb ); | 899 | colorMap-> getRGB ( pixBuf, &rgb ); |
887 | 900 | ||
888 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); | 901 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); |
889 | 902 | ||
890 | if ( maskColors ) { | 903 | if ( maskColors ) { |
891 | for ( int k = 0; k < nComps; ++k ) { | 904 | for ( int k = 0; k < nComps; ++k ) { |
892 | if (( pixBuf [k] < maskColors [2 * k] ) || ( pixBuf [k] > maskColors [2 * k] )) { | 905 | if (( pixBuf [k] < maskColors [2 * k] ) || ( pixBuf [k] > maskColors [2 * k] )) { |
893 | val |= 0xff000000; | 906 | val |= 0xff000000; |
894 | break; | 907 | break; |
895 | } | 908 | } |
896 | } | 909 | } |
897 | } | 910 | } |
898 | *scanline = val; | 911 | *scanline = val; |
899 | 912 | ||
900 | ctm [0] < 0 ? scanline-- : scanline++; | 913 | ctm [0] < 0 ? scanline-- : scanline++; |
901 | } | 914 | } |
902 | ctm [3] > 0 ? scanlines-- : scanlines++; | 915 | ctm [3] > 0 ? scanlines-- : scanlines++; |
903 | 916 | ||
904 | qApp-> processEvents ( ); | 917 | qApp-> processEvents ( ); |
905 | } | 918 | } |
906 | 919 | ||
907 | 920 | ||
908 | #ifndef QT_NO_TRANSFORMATIONS | 921 | #ifndef QT_NO_TRANSFORMATIONS |
909 | QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); | 922 | QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); |
910 | 923 | ||
911 | std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl | 924 | std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl |
912 | << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl; | 925 | << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl; |
913 | 926 | ||
914 | QWMatrix oldmat = m_painter-> worldMatrix ( ); | 927 | QWMatrix oldmat = m_painter-> worldMatrix ( ); |
915 | m_painter-> setWorldMatrix ( mat, true ); | 928 | m_painter-> setWorldMatrix ( mat, true ); |
916 | 929 | ||
917 | #ifdef QWS | 930 | #ifdef QWS |
918 | QPixmap pm; | 931 | QPixmap pm; |
919 | pm. convertFromImage ( img ); | 932 | pm. convertFromImage ( img ); |
920 | m_painter-> drawPixmap ( 0, 0, pm ); | 933 | m_painter-> drawPixmap ( 0, 0, pm ); |
921 | #else | 934 | #else |
922 | m_painter-> drawImage ( QPoint ( 0, 0 ), img ); | 935 | m_painter-> drawImage ( QPoint ( 0, 0 ), img ); |
923 | #endif | 936 | #endif |
924 | 937 | ||
925 | m_painter-> setWorldMatrix ( oldmat ); | 938 | m_painter-> setWorldMatrix ( oldmat ); |
926 | 939 | ||
927 | #else // QT_NO_TRANSFORMATIONS | 940 | #else // QT_NO_TRANSFORMATIONS |
928 | 941 | ||
929 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { | 942 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { |
930 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); | 943 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); |
931 | } | 944 | } |
932 | else { | 945 | else { |
933 | int x = lrint ( ctm [4] ); | 946 | int x = lrint ( ctm [4] ); |
934 | int y = lrint ( ctm [5] ); | 947 | int y = lrint ( ctm [5] ); |
935 | 948 | ||
936 | int w = lrint ( ctm [0] ); | 949 | int w = lrint ( ctm [0] ); |
937 | int h = lrint ( ctm [3] ); | 950 | int h = lrint ( ctm [3] ); |
938 | 951 | ||
939 | if ( w < 0 ) { | 952 | if ( w < 0 ) { |
940 | x += w; | 953 | x += w; |
941 | w = -w; | 954 | w = -w; |
942 | } | 955 | } |
943 | if ( h < 0 ) { | 956 | if ( h < 0 ) { |
944 | y += h; | 957 | y += h; |
945 | h = -h; | 958 | h = -h; |
946 | } | 959 | } |
947 | 960 | ||
948 | QPDFDBG( printf ( "DRAWING IMAGE: %d/%d - %dx%d\n", x, y, w, h )); | 961 | QPDFDBG( printf ( "DRAWING IMAGE: %d/%d - %dx%d\n", x, y, w, h )); |
949 | 962 | ||
950 | img = img. smoothScale ( w, h ); | 963 | img = img. smoothScale ( w, h ); |
951 | qApp-> processEvents ( ); | 964 | qApp-> processEvents ( ); |
952 | m_painter-> drawImage ( x, y, img ); | 965 | m_painter-> drawImage ( x, y, img ); |
953 | } | 966 | } |
954 | 967 | ||
955 | #endif | 968 | #endif |
956 | 969 | ||
957 | 970 | ||
958 | delete imgStr; | 971 | delete imgStr; |
959 | qApp-> processEvents ( ); | 972 | qApp-> processEvents ( ); |
960 | } | 973 | } |
@@ -974,41 +987,41 @@ bool QOutputDev::findText ( const QString &str, QRect &r, bool top, bool bottom | |||
974 | 987 | ||
975 | bool QOutputDev::findText ( const QString &str, int &l, int &t, int &w, int &h, bool top, bool bottom ) | 988 | bool QOutputDev::findText ( const QString &str, int &l, int &t, int &w, int &h, bool top, bool bottom ) |
976 | { | 989 | { |
977 | bool found = false; | 990 | bool found = false; |
978 | uint len = str. length ( ); | 991 | uint len = str. length ( ); |
979 | Unicode *s = new Unicode [len]; | 992 | Unicode *s = new Unicode [len]; |
980 | 993 | ||
981 | for ( uint i = 0; i < len; i++ ) | 994 | for ( uint i = 0; i < len; i++ ) |
982 | s [i] = str [i]. unicode ( ); | 995 | s [i] = str [i]. unicode ( ); |
983 | 996 | ||
984 | fp_t x1 = (fp_t) l; | 997 | fp_t x1 = (fp_t) l; |
985 | fp_t y1 = (fp_t) t; | 998 | fp_t y1 = (fp_t) t; |
986 | fp_t x2 = (fp_t) l + w - 1; | 999 | fp_t x2 = (fp_t) l + w - 1; |
987 | fp_t y2 = (fp_t) t + h - 1; | 1000 | fp_t y2 = (fp_t) t + h - 1; |
988 | 1001 | ||
989 | if ( m_text-> findText ( s, len, top, bottom, &x1, &y1, &x2, &y2 )) { | 1002 | if ( m_text-> findText ( s, len, top, bottom, &x1, &y1, &x2, &y2 )) { |
990 | l = lrint ( x1 ); | 1003 | l = lrint ( x1 ); |
991 | t = lrint ( y1 ); | 1004 | t = lrint ( y1 ); |
992 | w = lrint ( x2 ) - l + 1; | 1005 | w = lrint ( x2 ) - l + 1; |
993 | h = lrint ( y2 ) - t + 1; | 1006 | h = lrint ( y2 ) - t + 1; |
994 | found = true; | 1007 | found = true; |
995 | } | 1008 | } |
996 | delete [] s; | 1009 | delete [] s; |
997 | 1010 | ||
998 | return found; | 1011 | return found; |
999 | } | 1012 | } |
1000 | 1013 | ||
1001 | GBool QOutputDev::findText ( Unicode *s, int len, GBool top, GBool bottom, int *xMin, int *yMin, int *xMax, int *yMax ) | 1014 | GBool QOutputDev::findText ( Unicode *s, int len, GBool top, GBool bottom, int *xMin, int *yMin, int *xMax, int *yMax ) |
1002 | { | 1015 | { |
1003 | bool found = false; | 1016 | bool found = false; |
1004 | fp_t xMin1 = (double) *xMin; | 1017 | fp_t xMin1 = (double) *xMin; |
1005 | fp_t yMin1 = (double) *yMin; | 1018 | fp_t yMin1 = (double) *yMin; |
1006 | fp_t xMax1 = (double) *xMax; | 1019 | fp_t xMax1 = (double) *xMax; |
1007 | fp_t yMax1 = (double) *yMax; | 1020 | fp_t yMax1 = (double) *yMax; |
1008 | 1021 | ||
1009 | if ( m_text-> findText ( s, len, top, bottom, &xMin1, &yMin1, &xMax1, &yMax1 )) { | 1022 | if ( m_text-> findText ( s, len, top, bottom, &xMin1, &yMin1, &xMax1, &yMax1 )) { |
1010 | *xMin = lrint ( xMin1 ); | 1023 | *xMin = lrint ( xMin1 ); |
1011 | *xMax = lrint ( xMax1 ); | 1024 | *xMax = lrint ( xMax1 ); |
1012 | *yMin = lrint ( yMin1 ); | 1025 | *yMin = lrint ( yMin1 ); |
1013 | *yMax = lrint ( yMax1 ); | 1026 | *yMax = lrint ( yMax1 ); |
1014 | found = true; | 1027 | found = true; |
@@ -1018,23 +1031,23 @@ GBool QOutputDev::findText ( Unicode *s, int len, GBool top, GBool bottom, int * | |||
1018 | 1031 | ||
1019 | QString QOutputDev::getText ( int l, int t, int w, int h ) | 1032 | QString QOutputDev::getText ( int l, int t, int w, int h ) |
1020 | { | 1033 | { |
1021 | GString *gstr = m_text-> getText ( l, t, l + w - 1, t + h - 1 ); | 1034 | GString *gstr = m_text-> getText ( l, t, l + w - 1, t + h - 1 ); |
1022 | QString str = gstr-> getCString ( ); | 1035 | QString str = gstr-> getCString ( ); |
1023 | delete gstr; | 1036 | delete gstr; |
1024 | return str; | 1037 | return str; |
1025 | } | 1038 | } |
1026 | 1039 | ||
1027 | QString QOutputDev::getText ( const QRect &r ) | 1040 | QString QOutputDev::getText ( const QRect &r ) |
1028 | { | 1041 | { |
1029 | return getText ( r. left ( ), r. top ( ), r. width ( ), r. height ( )); | 1042 | return getText ( r. left ( ), r. top ( ), r. width ( ), r. height ( )); |
1030 | } | 1043 | } |
1031 | 1044 | ||
1032 | 1045 | ||
1033 | 1046 | ||
1034 | void QOutputDev::drawContents ( QPainter *p, int clipx, int clipy, int clipw, int cliph ) | 1047 | void QOutputDev::drawContents ( QPainter *p, int clipx, int clipy, int clipw, int cliph ) |
1035 | { | 1048 | { |
1036 | if ( m_pixmap ) | 1049 | if ( m_pixmap ) |
1037 | p-> drawPixmap ( clipx, clipy, *m_pixmap, clipx, clipy, clipw, cliph ); | 1050 | p-> drawPixmap ( clipx, clipy, *m_pixmap, clipx, clipy, clipw, cliph ); |
1038 | else | 1051 | else |
1039 | p-> fillRect ( clipx, clipy, clipw, cliph, white ); | 1052 | p-> fillRect ( clipx, clipy, clipw, cliph, white ); |
1040 | } | 1053 | } |
diff --git a/noncore/unsupported/qpdf/opie-qpdf.control b/noncore/unsupported/qpdf/opie-qpdf.control index 33df3e1..208dcb1 100644 --- a/noncore/unsupported/qpdf/opie-qpdf.control +++ b/noncore/unsupported/qpdf/opie-qpdf.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-qpdf | 1 | Package: opie-qpdf |
2 | Files: bin/qpdf apps/Applications/qpdf.desktop pics/qpdf/qpdf_icon.png | 2 | Files: bin/qpdf apps/Applications/qpdf.desktop pics/qpdf/qpdf_icon.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Robert Griebl <sandman@handhelds.org> | 5 | Maintainer: Robert Griebl <sandman@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, gzip | 7 | Depends: task-opie-minimal, gzip |
9 | Description: A PDF viewer for OPIE. | 8 | Description: A PDF viewer for OPIE. |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp index 61f097b..de1dcf3 100644 --- a/noncore/unsupported/qpdf/qpdf.cpp +++ b/noncore/unsupported/qpdf/qpdf.cpp | |||
@@ -504,13 +504,13 @@ void QPdfDlg::openFile ( const DocLnk &f ) | |||
504 | m_currentdoc = QString::null; | 504 | m_currentdoc = QString::null; |
505 | } | 505 | } |
506 | 506 | ||
507 | updateCaption ( ); | 507 | updateCaption ( ); |
508 | } | 508 | } |
509 | else | 509 | else |
510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist !" )); | 510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist!" )); |
511 | } | 511 | } |
512 | 512 | ||
513 | void QPdfDlg::setDocument ( const QString &f ) | 513 | void QPdfDlg::setDocument ( const QString &f ) |
514 | { | 514 | { |
515 | if ( f. find ( ".desktop", 0, true ) == -1 ) | 515 | if ( f. find ( ".desktop", 0, true ) == -1 ) |
516 | openFile ( f ); | 516 | openFile ( f ); |