summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/libpreload/preload.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/core/launcher/libpreload/preload.cpp b/core/launcher/libpreload/preload.cpp
index 4505428..10d8313 100644
--- a/core/launcher/libpreload/preload.cpp
+++ b/core/launcher/libpreload/preload.cpp
@@ -2,12 +2,13 @@
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 <qwsdecoration_qws.h> 6#include <qwsdecoration_qws.h>
7#include <qcommonstyle.h> 7#include <qcommonstyle.h>
8
8//#include <qapplication.h> 9//#include <qapplication.h>
9//#include <qfont.h> 10//#include <qfont.h>
10 11
11//class QStyle; 12//class QStyle;
12class QApplication; 13class QApplication;
13class QFont; 14class QFont;
@@ -17,17 +18,17 @@ class QFont;
17#include <unistd.h> 18#include <unistd.h>
18#include <stdio.h> 19#include <stdio.h>
19#include <stdlib.h> 20#include <stdlib.h>
20 21
21 22
22typedef void ( *qapp_setstyle_t ) ( QStyle * ); 23typedef void ( *qapp_setstyle_t ) ( QStyle * );
23typedef void ( *qapp_setdeco_t ) ( QApplication *, QWSDecoration * ); 24typedef void ( *qapp_setdeco_t ) ( QWSDecoration * );
24typedef void ( *qapp_setfont_t ) ( const QFont &, bool, const char * ); 25typedef void ( *qapp_setfont_t ) ( const QFont &, bool, const char * );
25 26
26 27
27static bool *opie_block_style_p = 0; 28static int *opie_block_style_p = 0;
28 29
29extern "C" { 30extern "C" {
30 31
31static void *resolve_symbol ( const char *sym ) 32static void *resolve_symbol ( const char *sym )
32{ 33{
33 void *adr = ::dlsym ( RTLD_NEXT, sym ); 34 void *adr = ::dlsym ( RTLD_NEXT, sym );
@@ -43,50 +44,46 @@ extern void setStyle__12QApplicationP6QStyle ( QStyle *style )
43 static qapp_setstyle_t qsetstyle = 0; 44 static qapp_setstyle_t qsetstyle = 0;
44 45
45 if ( !qsetstyle ) 46 if ( !qsetstyle )
46 qsetstyle = (qapp_setstyle_t) resolve_symbol ( "setStyle__12QApplicationP6QStyle" ); 47 qsetstyle = (qapp_setstyle_t) resolve_symbol ( "setStyle__12QApplicationP6QStyle" );
47 48
48 if ( !opie_block_style_p ) 49 if ( !opie_block_style_p )
49 opie_block_style_p = (bool *) resolve_symbol ( "opie_block_style" ); 50 opie_block_style_p = (int *) resolve_symbol ( "opie_block_style" );
50 51
51 if ( !qsetstyle || ( opie_block_style_p && *opie_block_style_p )) { 52 if ( !qsetstyle || ( opie_block_style_p && ( *opie_block_style_p & 0x01 )))
52 delete style; 53 delete style;
53 return;
54 }
55 else 54 else
56 ( *qsetstyle ) ( style ); 55 ( *qsetstyle ) ( style );
57} 56}
58 57
59extern void setFont__12QApplicationRC5QFontbPCc ( const QFont &fnt, bool informWidgets, const char * className ) 58extern void setFont__12QApplicationRC5QFontbPCc ( const QFont &fnt, bool informWidgets, const char * className )
60{ 59{
61 static qapp_setfont_t qsetfont = 0; 60 static qapp_setfont_t qsetfont = 0;
62 61
63 if ( !qsetfont ) 62 if ( !qsetfont )
64 qsetfont = (qapp_setfont_t) resolve_symbol ( "setFont__12QApplicationRC5QFontbPCc" ); 63 qsetfont = (qapp_setfont_t) resolve_symbol ( "setFont__12QApplicationRC5QFontbPCc" );
65 64
66 if ( !opie_block_style_p ) 65 if ( !opie_block_style_p )
67 opie_block_style_p = (bool *) resolve_symbol ( "opie_block_style" ); 66 opie_block_style_p = (int *) resolve_symbol ( "opie_block_style" );
68 67
69 if ( qsetfont && !( opie_block_style_p && *opie_block_style_p )) 68 if ( qsetfont && !( opie_block_style_p && ( *opie_block_style_p & 0x02 )))
70 ( *qsetfont ) ( fnt, informWidgets, className ); 69 ( *qsetfont ) ( fnt, informWidgets, className );
71} 70}
72 71
73 72
74extern void qwsSetDecoration__12QApplicationP13QWSDecoration ( QApplication *app, QWSDecoration *deco ) 73extern void qwsSetDecoration__12QApplicationP13QWSDecoration ( QWSDecoration *deco )
75{ 74{
76 static qapp_setdeco_t qsetdeco = 0; 75 static qapp_setdeco_t qsetdeco = 0;
77 76
78 if ( !qsetdeco ) 77 if ( !qsetdeco )
79 qsetdeco = (qapp_setdeco_t) resolve_symbol ( "qwsSetDecoration__12QApplicationP13QWSDecoration" ); 78 qsetdeco = (qapp_setdeco_t) resolve_symbol ( "qwsSetDecoration__12QApplicationP13QWSDecoration" );
80 79
81 if ( !opie_block_style_p ) 80 if ( !opie_block_style_p )
82 opie_block_style_p = (bool *) resolve_symbol ( "opie_block_style" ); 81 opie_block_style_p = (int *) resolve_symbol ( "opie_block_style" );
83 82
84 if ( !qsetdeco || ( opie_block_style_p && *opie_block_style_p )) { 83 if ( !qsetdeco || ( opie_block_style_p && ( *opie_block_style_p & 0x04 )))
85 delete deco; 84 delete deco;
86 return;
87 }
88 else 85 else
89 ( *qsetdeco ) ( app, deco ); 86 ( *qsetdeco ) ( deco );
90} 87}
91 88
92} 89}