Diffstat (limited to 'core/launcher/libpreload/preload.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/libpreload/preload.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/core/launcher/libpreload/preload.cpp b/core/launcher/libpreload/preload.cpp index cc1baac..345620b 100644 --- a/core/launcher/libpreload/preload.cpp +++ b/core/launcher/libpreload/preload.cpp | |||
@@ -1,33 +1,37 @@ | |||
1 | 1 | ||
2 | #define _GNU_SOURCE | 2 | #define _GNU_SOURCE |
3 | //#define private public | 3 | //#define private public |
4 | //#define protected public | 4 | //#define protected public |
5 | 5 | ||
6 | #include <qapplication.h> | ||
6 | #include <qwsdecoration_qws.h> | 7 | #include <qwsdecoration_qws.h> |
7 | #include <qcommonstyle.h> | 8 | #include <qcommonstyle.h> |
8 | 9 | ||
9 | //#include <qapplication.h> | 10 | //#include <qapplication.h> |
10 | //#include <qfont.h> | 11 | //#include <qfont.h> |
11 | 12 | ||
12 | //class QStyle; | 13 | //class QStyle; |
13 | class QApplication; | 14 | //class QApplication; |
14 | class QFont; | 15 | class QFont; |
15 | //class QWSDecoration; | 16 | //class QWSDecoration; |
17 | class QFontDatabase; | ||
16 | 18 | ||
17 | #include <dlfcn.h> | 19 | #include <dlfcn.h> |
18 | #include <unistd.h> | 20 | #include <unistd.h> |
19 | #include <stdio.h> | 21 | #include <stdio.h> |
20 | #include <stdlib.h> | 22 | #include <stdlib.h> |
21 | 23 | ||
22 | 24 | ||
23 | typedef void ( *qapp_setstyle_t ) ( QStyle * ); | 25 | typedef void ( *qapp_setstyle_t ) ( QStyle * ); |
24 | typedef void ( *qapp_setdeco_t ) ( QWSDecoration * ); | 26 | typedef void ( *qapp_setdeco_t ) ( QWSDecoration * ); |
25 | typedef void ( *qapp_setfont_t ) ( const QFont &, bool, const char * ); | 27 | typedef void ( *qapp_setfont_t ) ( const QFont &, bool, const char * ); |
28 | typedef void ( *qapp_polish_t ) ( QApplication *, QWidget * ); | ||
29 | typedef QValueList <int> ( *qfdb_pointsizes_t ) ( QFontDatabase *, QString const &, QString const &, QString const & ); | ||
26 | 30 | ||
27 | 31 | ||
28 | static int *opie_block_style_p = 0; | 32 | static int *opie_block_style_p = 0; |
29 | 33 | ||
30 | extern "C" { | 34 | extern "C" { |
31 | 35 | ||
32 | extern void __gmon_start ( ) __attribute(( weak )); | 36 | extern void __gmon_start ( ) __attribute(( weak )); |
33 | 37 | ||
@@ -40,16 +44,55 @@ static void *resolve_symbol ( const char *sym ) | |||
40 | void *adr = ::dlsym ( RTLD_NEXT, sym ); | 44 | void *adr = ::dlsym ( RTLD_NEXT, sym ); |
41 | 45 | ||
42 | if ( !adr ) | 46 | if ( !adr ) |
43 | ::fprintf ( stderr, "PANIC: Could not resolve symbol \"%s\"\n", sym ); | 47 | ::fprintf ( stderr, "PANIC: Could not resolve symbol \"%s\"\n", sym ); |
44 | 48 | ||
45 | return adr; | 49 | return adr; |
46 | } | 50 | } |
47 | 51 | ||
52 | void polish__12QApplicationP7QWidget ( QApplication *that, QWidget *w ) | ||
53 | { | ||
54 | static qapp_polish_t qpolish = 0; | ||
55 | |||
56 | if ( !qpolish ) | ||
57 | qpolish = (qapp_polish_t) resolve_symbol ( "polish__12QApplicationP7QWidget" ); | ||
58 | |||
59 | if ( qpolish ) | ||
60 | ( *qpolish ) ( that, w ); | ||
61 | |||
62 | if (( ::strcmp ( qApp-> argv ( ) [0], "HancomMobileWord" ) == 0 ) && ( w-> inherits ( "HTextEdit" ))) { | ||
63 | QPalette pal = w-> palette ( ); | ||
64 | pal. setColor ( QColorGroup::Background, pal. color ( QPalette::Active, QColorGroup::Base )); | ||
65 | w-> setPalette ( pal ); | ||
66 | // w-> setPalette ( w-> palette ( ). active ( ). color ( QColorGroup::Base )); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | extern QValueList <int> pointSizes__13QFontDatabaseRC7QStringN21 ( QFontDatabase *that, QString const &family, QString const &style, QString const &charset ) | ||
71 | { | ||
72 | static qfdb_pointsizes_t qpointsizes = 0; | ||
73 | |||
74 | if ( !qpointsizes ) | ||
75 | qpointsizes = (qfdb_pointsizes_t) resolve_symbol ( "pointSizes__13QFontDatabaseRC7QStringN21" ); | ||
76 | |||
77 | QValueList <int> sl; | ||
78 | |||
79 | if ( qpointsizes ) { | ||
80 | sl = ( *qpointsizes ) ( that, family, style, charset ); | ||
81 | |||
82 | if ( ::strcmp ( qApp-> argv ( ) [0], "HancomMobileWord" ) == 0 ) { | ||
83 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | ||
84 | *it *= 10; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | return sl; | ||
89 | } | ||
90 | |||
48 | extern void setStyle__12QApplicationP6QStyle ( QStyle *style ) | 91 | extern void setStyle__12QApplicationP6QStyle ( QStyle *style ) |
49 | { | 92 | { |
50 | static qapp_setstyle_t qsetstyle = 0; | 93 | static qapp_setstyle_t qsetstyle = 0; |
51 | 94 | ||
52 | if ( !qsetstyle ) | 95 | if ( !qsetstyle ) |
53 | qsetstyle = (qapp_setstyle_t) resolve_symbol ( "setStyle__12QApplicationP6QStyle" ); | 96 | qsetstyle = (qapp_setstyle_t) resolve_symbol ( "setStyle__12QApplicationP6QStyle" ); |
54 | 97 | ||
55 | if ( !opie_block_style_p ) | 98 | if ( !opie_block_style_p ) |