Mxx_ru 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYING +26 -0
- data/NEWS +52 -0
- data/README +21 -0
- data/Rakefile +32 -0
- data/examples/exe_and_lib/main.cpp +15 -0
- data/examples/exe_and_lib/prj.rb +11 -0
- data/examples/exe_and_lib/say.cpp +13 -0
- data/examples/exe_and_lib/say.hpp +11 -0
- data/examples/exe_and_lib/say.rb +7 -0
- data/examples/exe_dll_lib/inout.cpp +15 -0
- data/examples/exe_dll_lib/inout.hpp +26 -0
- data/examples/exe_dll_lib/inout.rb +18 -0
- data/examples/exe_dll_lib/main.cpp +23 -0
- data/examples/exe_dll_lib/prj.rb +11 -0
- data/examples/exe_dll_lib/say.cpp +13 -0
- data/examples/exe_dll_lib/say.hpp +12 -0
- data/examples/exe_dll_lib/say.rb +9 -0
- data/examples/exe_dll_lib_2/build.rb +7 -0
- data/examples/exe_dll_lib_2/inout/inout.cpp +15 -0
- data/examples/exe_dll_lib_2/inout/inout.hpp +26 -0
- data/examples/exe_dll_lib_2/inout/prj.rb +16 -0
- data/examples/exe_dll_lib_2/main/main.cpp +23 -0
- data/examples/exe_dll_lib_2/main/prj.rb +9 -0
- data/examples/exe_dll_lib_2/say/prj.rb +8 -0
- data/examples/exe_dll_lib_2/say/say.cpp +13 -0
- data/examples/exe_dll_lib_2/say/say.hpp +12 -0
- data/examples/simple_exe/main.cpp +26 -0
- data/examples/simple_exe/prj.rb +7 -0
- data/lib/mxx_ru/abstract_target.rb +283 -0
- data/lib/mxx_ru/binary_target.rb +89 -0
- data/lib/mxx_ru/binary_unittest.rb +130 -0
- data/lib/mxx_ru/cpp/analyzer.rb +230 -0
- data/lib/mxx_ru/cpp/composite.rb +106 -0
- data/lib/mxx_ru/cpp/detect_toolset.rb +122 -0
- data/lib/mxx_ru/cpp/mode.rb +85 -0
- data/lib/mxx_ru/cpp/obj_placement.rb +321 -0
- data/lib/mxx_ru/cpp/qt.rb +333 -0
- data/lib/mxx_ru/cpp/rucodegen.rb +114 -0
- data/lib/mxx_ru/cpp/source_file.rb +71 -0
- data/lib/mxx_ru/cpp/target.rb +1371 -0
- data/lib/mxx_ru/cpp/toolset.rb +1029 -0
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +52 -0
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +451 -0
- data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +56 -0
- data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +56 -0
- data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +273 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +54 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +382 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +60 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +144 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +87 -0
- data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -0
- data/lib/mxx_ru/cpp/toolsets/vc8.rb +452 -0
- data/lib/mxx_ru/cpp/toolsets/vc_family.rb +428 -0
- data/lib/mxx_ru/cpp.rb +36 -0
- data/lib/mxx_ru/ex.rb +134 -0
- data/lib/mxx_ru/makestyle_generator.rb +138 -0
- data/lib/mxx_ru/textfile_unittest.rb +284 -0
- data/lib/mxx_ru/util.rb +258 -0
- data/tests/c/pcre/chartables.c +183 -0
- data/tests/c/pcre/config.h +99 -0
- data/tests/c/pcre/dftables.c +167 -0
- data/tests/c/pcre/get.c +349 -0
- data/tests/c/pcre/internal.h +677 -0
- data/tests/c/pcre/maketables.c +140 -0
- data/tests/c/pcre/pcre.c +8304 -0
- data/tests/c/pcre/pcre.h +193 -0
- data/tests/c/pcre/pcre.rb +14 -0
- data/tests/c/pcre/pcredemo.c +316 -0
- data/tests/c/pcre/pcregrep.c +642 -0
- data/tests/c/pcre/pcreposix.c +305 -0
- data/tests/c/pcre/pcreposix.h +88 -0
- data/tests/c/pcre/pcretest.c +1483 -0
- data/tests/c/pcre/perltest +211 -0
- data/tests/c/pcre/printint.c +360 -0
- data/tests/c/pcre/study.c +472 -0
- data/tests/cpp/mswin_res_dll/build.rb +14 -0
- data/tests/cpp/mswin_res_dll/dll.cpp +17 -0
- data/tests/cpp/mswin_res_dll/dll.rb +30 -0
- data/tests/cpp/mswin_res_dll/dll.rc +48 -0
- data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -0
- data/tests/cpp/mswin_res_dll/h/res.h +3 -0
- data/tests/cpp/mswin_res_dll/main.cpp +13 -0
- data/tests/cpp/mswin_res_dll/main.rb +20 -0
- data/tests/cpp/mswin_res_dll/res/tree_fol.bmp +0 -0
- data/tests/cpp/mswin_res_dll/res/tree_state_1.bmp +0 -0
- data/tests/cpp/mswin_res_dll/res/tree_state_2.bmp +0 -0
- data/tests/cpp/mswin_res_exe/build.rb +23 -0
- data/tests/cpp/mswin_res_exe/h/res.h +3 -0
- data/tests/cpp/mswin_res_exe/main.cpp +17 -0
- data/tests/cpp/mswin_res_exe/main.rc +48 -0
- data/tests/cpp/mswin_res_exe/res/tree_fol.bmp +0 -0
- data/tests/cpp/mswin_res_exe/res/tree_state_1.bmp +0 -0
- data/tests/cpp/mswin_res_exe/res/tree_state_2.bmp +0 -0
- data/tests/cpp/rucodegen/host_config.cpp +20 -0
- data/tests/cpp/rucodegen/host_config.rb +14 -0
- data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -0
- data/tests/cpp/rucodegen/impl/conn_params.rb +14 -0
- data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -0
- data/tests/cpp/rucodegen/prj.rb +17 -0
- data/tests/cpp/textfile_unittest/build.rb +8 -0
- data/tests/cpp/textfile_unittest/etalons/out_0.txt +0 -0
- data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -0
- data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -0
- data/tests/cpp/textfile_unittest/main.cpp +89 -0
- data/tests/cpp/textfile_unittest/prj.rb +8 -0
- data/tests/cpp/textfile_unittest/prj.ut.rb +18 -0
- data/tests/cpp/toolset_name.rb +6 -0
- data/tests/cpp/vc_cleanup/cout.log +72 -0
- data/tests/cpp/vc_cleanup/dll_hi.cpp +5 -0
- data/tests/cpp/vc_cleanup/exe_hi.cpp +10 -0
- data/tests/cpp/vc_cleanup/lib_hi.cpp +5 -0
- data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -0
- data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -0
- data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -0
- data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -0
- data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -0
- data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -0
- data/tests/cpp/vc_cleanup/prj_lib.rb +10 -0
- data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -0
- data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +60 -0
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -0
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -0
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -0
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -0
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -0
- data/tests/mxx_ru/change_default_value/ok/build.rb +8 -0
- data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -0
- data/tests/mxx_ru/tc_makestyle_generator.rb +117 -0
- data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -0
- data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -0
- data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -0
- data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -0
- data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -0
- data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -0
- data/tests/mxx_ru/vc8/ts_vc8.rb +10 -0
- data/tests/qt/aclock/aclock.cpp +148 -0
- data/tests/qt/aclock/aclock.h +45 -0
- data/tests/qt/aclock/main.cpp +28 -0
- data/tests/qt/aclock/prj.rb +21 -0
- data/tests/qt/iconview/main.cpp +76 -0
- data/tests/qt/iconview/prj.rb +21 -0
- data/tests/qt/toplevel/main.cpp +9 -0
- data/tests/qt/toplevel/options.ui +587 -0
- data/tests/qt/toplevel/options.ui.h +98 -0
- data/tests/qt/toplevel/prj.rb +21 -0
- metadata +241 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
|
|
3
|
+
require 'mxx_ru/cpp'
|
|
4
|
+
require 'mxx_ru/cpp/toolsets/vc8'
|
|
5
|
+
|
|
6
|
+
class TC_DropDefaultManifest < Test::Unit::TestCase
|
|
7
|
+
def test_drop_default_manifest
|
|
8
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest( nil )
|
|
9
|
+
|
|
10
|
+
manifest_desc = Mxx_ru::Cpp::Toolsets::Vc8::default_manifest
|
|
11
|
+
|
|
12
|
+
assert_nil( manifest_desc )
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
|
|
3
|
+
require 'mxx_ru/cpp'
|
|
4
|
+
require 'mxx_ru/cpp/toolsets/vc8'
|
|
5
|
+
|
|
6
|
+
class TC_DefaultManifest < Test::Unit::TestCase
|
|
7
|
+
def test_invalid_resource_id
|
|
8
|
+
assert_nothing_raised() do
|
|
9
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
10
|
+
:autogen => :to_default_file,
|
|
11
|
+
:mt => {}
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
assert_nothing_raised() do
|
|
15
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :mt => {
|
|
16
|
+
:manifest => 'some_file',
|
|
17
|
+
:resource_id => :default }
|
|
18
|
+
|
|
19
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :mt => {
|
|
20
|
+
:manifest => 'some_file',
|
|
21
|
+
:resource_id => :process_manifest }
|
|
22
|
+
|
|
23
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
24
|
+
:autogen => :to_default_file,
|
|
25
|
+
:mt => { :resource_id => :isolationaware_manifest }
|
|
26
|
+
|
|
27
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
28
|
+
:autogen => 'some_file',
|
|
29
|
+
:mt => { :resource_id => :isolationaware_nostaticimport_manifest }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
assert_raise( Mxx_ru::Invalid_value_ex ) do
|
|
33
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :mt => {
|
|
34
|
+
:manifest => 'some_file',
|
|
35
|
+
:resource_id => :process_manifest_id }
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def test_missing_manifest_name
|
|
40
|
+
assert_raise( Mxx_ru::Invalid_value_ex ) do
|
|
41
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :mt => {
|
|
42
|
+
:resource_id => :process_manifest }
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def test_invalid_autogen
|
|
47
|
+
assert_nothing_raised() do
|
|
48
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :autogen => :to_default_file
|
|
49
|
+
|
|
50
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :autogen => 'some_file'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
assert_raise( Mxx_ru::Invalid_value_ex ) do
|
|
54
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :autogen => :to_def_file
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
assert_raise( Mxx_ru::Invalid_value_ex ) do
|
|
58
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest :autogen => 1
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def test_keep_manifest_file
|
|
63
|
+
assert_nothing_raised() do
|
|
64
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
65
|
+
:autogen => :to_default_file,
|
|
66
|
+
:mt => { :keep_manifest_file => true }
|
|
67
|
+
|
|
68
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
69
|
+
:autogen => :to_default_file,
|
|
70
|
+
:mt => { :keep_manifest_file => false }
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
assert_raise( Mxx_ru::Invalid_value_ex ) do
|
|
74
|
+
Mxx_ru::Cpp::Toolsets::Vc8::manifest \
|
|
75
|
+
:autogen => :to_default_file,
|
|
76
|
+
:mt => { :keep_manifest_file => 1 }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
** $Id: qt/aclock.cpp 3.3.3 edited Dec 10 2003 $
|
|
3
|
+
**
|
|
4
|
+
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
5
|
+
**
|
|
6
|
+
** This file is part of an example program for Qt. This example
|
|
7
|
+
** program may be used, distributed and modified without limitation.
|
|
8
|
+
**
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
|
|
11
|
+
#include "aclock.h"
|
|
12
|
+
#include <qtimer.h>
|
|
13
|
+
#include <qpainter.h>
|
|
14
|
+
#include <qbitmap.h>
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
// Constructs an analog clock widget that uses an internal QTimer.
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
AnalogClock::AnalogClock( QWidget *parent, const char *name )
|
|
21
|
+
: QWidget( parent, name )
|
|
22
|
+
{
|
|
23
|
+
time = QTime::currentTime(); // get current time
|
|
24
|
+
internalTimer = new QTimer( this ); // create internal timer
|
|
25
|
+
connect( internalTimer, SIGNAL(timeout()), SLOT(timeout()) );
|
|
26
|
+
internalTimer->start( 5000 ); // emit signal every 5 seconds
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
void AnalogClock::mousePressEvent( QMouseEvent *e )
|
|
30
|
+
{
|
|
31
|
+
if(isTopLevel())
|
|
32
|
+
clickPos = e->pos() + QPoint(geometry().topLeft() - frameGeometry().topLeft());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
void AnalogClock::mouseMoveEvent( QMouseEvent *e )
|
|
36
|
+
{
|
|
37
|
+
if(isTopLevel())
|
|
38
|
+
move( e->globalPos() - clickPos );
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//
|
|
42
|
+
// The QTimer::timeout() signal is received by this slot.
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
//
|
|
46
|
+
// When we set an explicit time we don't want the timeout() slot to be
|
|
47
|
+
// called anymore as this relies on currentTime()
|
|
48
|
+
//
|
|
49
|
+
void AnalogClock::setTime( const QTime & t )
|
|
50
|
+
{
|
|
51
|
+
time = t;
|
|
52
|
+
disconnect( internalTimer, SIGNAL(timeout()), this, SLOT(timeout()) );
|
|
53
|
+
if (autoMask())
|
|
54
|
+
updateMask();
|
|
55
|
+
else
|
|
56
|
+
update();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
void AnalogClock::timeout()
|
|
61
|
+
{
|
|
62
|
+
QTime old_time = time;
|
|
63
|
+
time = QTime::currentTime();
|
|
64
|
+
if ( old_time.minute() != time.minute()
|
|
65
|
+
|| old_time.hour() != time.hour() ) { // minute or hour has changed
|
|
66
|
+
if (autoMask())
|
|
67
|
+
updateMask();
|
|
68
|
+
else
|
|
69
|
+
update();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
void AnalogClock::paintEvent( QPaintEvent * )
|
|
75
|
+
{
|
|
76
|
+
if ( autoMask() )
|
|
77
|
+
return;
|
|
78
|
+
QPainter paint( this );
|
|
79
|
+
paint.setBrush( colorGroup().foreground() );
|
|
80
|
+
drawClock( &paint );
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// If the clock is transparent, we use updateMask()
|
|
84
|
+
// instead of paintEvent()
|
|
85
|
+
|
|
86
|
+
void AnalogClock::updateMask() // paint clock mask
|
|
87
|
+
{
|
|
88
|
+
QBitmap bm( size() );
|
|
89
|
+
bm.fill( color0 ); //transparent
|
|
90
|
+
|
|
91
|
+
QPainter paint;
|
|
92
|
+
paint.begin( &bm, this );
|
|
93
|
+
paint.setBrush( color1 ); // use non-transparent color
|
|
94
|
+
paint.setPen( color1 );
|
|
95
|
+
|
|
96
|
+
drawClock( &paint );
|
|
97
|
+
|
|
98
|
+
paint.end();
|
|
99
|
+
setMask( bm );
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//
|
|
103
|
+
// The clock is painted using a 1000x1000 square coordinate system, in
|
|
104
|
+
// the a centered square, as big as possible. The painter's pen and
|
|
105
|
+
// brush colors are used.
|
|
106
|
+
//
|
|
107
|
+
void AnalogClock::drawClock( QPainter *paint )
|
|
108
|
+
{
|
|
109
|
+
paint->save();
|
|
110
|
+
|
|
111
|
+
paint->setWindow( -500,-500, 1000,1000 );
|
|
112
|
+
|
|
113
|
+
QRect v = paint->viewport();
|
|
114
|
+
int d = QMIN( v.width(), v.height() );
|
|
115
|
+
paint->setViewport( v.left() + (v.width()-d)/2,
|
|
116
|
+
v.top() + (v.height()-d)/2, d, d );
|
|
117
|
+
|
|
118
|
+
QPointArray pts;
|
|
119
|
+
|
|
120
|
+
paint->save();
|
|
121
|
+
paint->rotate( 30*(time.hour()%12-3) + time.minute()/2 );
|
|
122
|
+
pts.setPoints( 4, -20,0, 0,-20, 300,0, 0,20 );
|
|
123
|
+
paint->drawConvexPolygon( pts );
|
|
124
|
+
paint->restore();
|
|
125
|
+
|
|
126
|
+
paint->save();
|
|
127
|
+
paint->rotate( (time.minute()-15)*6 );
|
|
128
|
+
pts.setPoints( 4, -10,0, 0,-10, 400,0, 0,10 );
|
|
129
|
+
paint->drawConvexPolygon( pts );
|
|
130
|
+
paint->restore();
|
|
131
|
+
|
|
132
|
+
for ( int i=0; i<12; i++ ) {
|
|
133
|
+
paint->drawLine( 440,0, 460,0 );
|
|
134
|
+
paint->rotate( 30 );
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
paint->restore();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
void AnalogClock::setAutoMask(bool b)
|
|
142
|
+
{
|
|
143
|
+
if (b)
|
|
144
|
+
setBackgroundMode( PaletteForeground );
|
|
145
|
+
else
|
|
146
|
+
setBackgroundMode( PaletteBackground );
|
|
147
|
+
QWidget::setAutoMask(b);
|
|
148
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
** $Id: qt/aclock.h 3.3.3 edited Dec 10 2003 $
|
|
3
|
+
**
|
|
4
|
+
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
5
|
+
**
|
|
6
|
+
** This file is part of an example program for Qt. This example
|
|
7
|
+
** program may be used, distributed and modified without limitation.
|
|
8
|
+
**
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
|
|
11
|
+
#ifndef ACLOCK_H
|
|
12
|
+
#define ACLOCK_H
|
|
13
|
+
|
|
14
|
+
#include <qwidget.h>
|
|
15
|
+
#include <qdatetime.h>
|
|
16
|
+
|
|
17
|
+
class QTimer;
|
|
18
|
+
class AnalogClock : public QWidget // analog clock widget
|
|
19
|
+
{
|
|
20
|
+
Q_OBJECT
|
|
21
|
+
public:
|
|
22
|
+
AnalogClock( QWidget *parent=0, const char *name=0 );
|
|
23
|
+
void setAutoMask(bool b);
|
|
24
|
+
|
|
25
|
+
protected:
|
|
26
|
+
void updateMask();
|
|
27
|
+
void paintEvent( QPaintEvent *);
|
|
28
|
+
void mousePressEvent( QMouseEvent *);
|
|
29
|
+
void mouseMoveEvent( QMouseEvent *);
|
|
30
|
+
void drawClock( QPainter* );
|
|
31
|
+
|
|
32
|
+
private slots:
|
|
33
|
+
void timeout();
|
|
34
|
+
|
|
35
|
+
public slots:
|
|
36
|
+
void setTime( const QTime & t );
|
|
37
|
+
|
|
38
|
+
private:
|
|
39
|
+
QPoint clickPos;
|
|
40
|
+
QTime time;
|
|
41
|
+
QTimer *internalTimer;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
#endif // ACLOCK_H
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
** $Id: qt/main.cpp 3.3.3 edited May 27 2003 $
|
|
3
|
+
**
|
|
4
|
+
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
5
|
+
**
|
|
6
|
+
** This file is part of an example program for Qt. This example
|
|
7
|
+
** program may be used, distributed and modified without limitation.
|
|
8
|
+
**
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
|
|
11
|
+
#include "aclock.h"
|
|
12
|
+
#include <qapplication.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
int main( int argc, char **argv )
|
|
16
|
+
{
|
|
17
|
+
QApplication a( argc, argv );
|
|
18
|
+
AnalogClock *clock = new AnalogClock;
|
|
19
|
+
if ( argc == 2 && strcmp( argv[1], "-transparent" ) == 0 )
|
|
20
|
+
clock->setAutoMask( TRUE );
|
|
21
|
+
clock->resize( 100, 100 );
|
|
22
|
+
a.setMainWidget( clock );
|
|
23
|
+
clock->setCaption("Qt Example - Analog Clock");
|
|
24
|
+
clock->show();
|
|
25
|
+
int result = a.exec();
|
|
26
|
+
delete clock;
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'mxx_ru/cpp/qt'
|
|
2
|
+
|
|
3
|
+
Mxx_ru::setup_target(
|
|
4
|
+
Mxx_ru::Cpp::Exe_target.new( "prj.rb" ) {
|
|
5
|
+
|
|
6
|
+
threading_mode( Mxx_ru::Cpp::THREADING_MULTI )
|
|
7
|
+
rtl_mode( Mxx_ru::Cpp::RTL_SHARED )
|
|
8
|
+
|
|
9
|
+
target( "aclock" )
|
|
10
|
+
|
|
11
|
+
qt = generator( Mxx_ru::Cpp::Qt_gen.new( self ) )
|
|
12
|
+
# qt.moc_result_subdir = nil
|
|
13
|
+
|
|
14
|
+
lib( "qt-mt333.lib" )
|
|
15
|
+
|
|
16
|
+
qt.h2moc( "aclock.h" )
|
|
17
|
+
|
|
18
|
+
cpp_source( "main.cpp" )
|
|
19
|
+
cpp_source( "aclock.cpp" )
|
|
20
|
+
}
|
|
21
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
** $Id: qt/main.cpp 3.3.3 edited May 27 2003 $
|
|
3
|
+
**
|
|
4
|
+
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
5
|
+
**
|
|
6
|
+
** This file is part of an example program for Qt. This example
|
|
7
|
+
** program may be used, distributed and modified without limitation.
|
|
8
|
+
**
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
|
|
11
|
+
#include <qiconview.h>
|
|
12
|
+
#include <qapplication.h>
|
|
13
|
+
#include <qdragobject.h>
|
|
14
|
+
#include <qpixmap.h>
|
|
15
|
+
#include <qiconset.h>
|
|
16
|
+
|
|
17
|
+
#include <qmime.h>
|
|
18
|
+
#include <stdio.h>
|
|
19
|
+
|
|
20
|
+
class ListenDND : public QObject
|
|
21
|
+
{
|
|
22
|
+
Q_OBJECT
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
ListenDND( QWidget *w )
|
|
26
|
+
: view( w )
|
|
27
|
+
{}
|
|
28
|
+
|
|
29
|
+
public slots:
|
|
30
|
+
void dropped( QDropEvent *mime ) {
|
|
31
|
+
qDebug( "Dropped Mimesource %p into the view %p", mime, view );
|
|
32
|
+
qDebug( " Formats:" );
|
|
33
|
+
int i = 0;
|
|
34
|
+
const char *str = mime->format( i );
|
|
35
|
+
qDebug( " %s", str );
|
|
36
|
+
while ( str ) {
|
|
37
|
+
qDebug( " %s", str );
|
|
38
|
+
str = mime->format( ++i );
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
void moved() {
|
|
42
|
+
qDebug( "All selected items were moved to another widget" );
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
protected:
|
|
46
|
+
QWidget *view;
|
|
47
|
+
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
int main( int argc, char **argv )
|
|
51
|
+
{
|
|
52
|
+
QApplication a( argc, argv );
|
|
53
|
+
|
|
54
|
+
QIconView qiconview;
|
|
55
|
+
qiconview.setSelectionMode( QIconView::Extended );
|
|
56
|
+
|
|
57
|
+
for ( unsigned int i = 0; i < 3000; i++ ) {
|
|
58
|
+
QIconViewItem *item = new QIconViewItem( &qiconview, QString( "Item %1" ).arg( i + 1 ) );
|
|
59
|
+
item->setRenameEnabled( TRUE );
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
qiconview.setCaption( "Qt Example - Iconview" );
|
|
63
|
+
|
|
64
|
+
ListenDND listen_dnd( &qiconview );
|
|
65
|
+
QObject::connect( &qiconview, SIGNAL( dropped( QDropEvent *, const QValueList<QIconDragItem> & ) ),
|
|
66
|
+
&listen_dnd, SLOT( dropped( QDropEvent * ) ) );
|
|
67
|
+
QObject::connect( &qiconview, SIGNAL( moved() ), &listen_dnd, SLOT( moved() ) );
|
|
68
|
+
|
|
69
|
+
a.setMainWidget( &qiconview );
|
|
70
|
+
qiconview.show();
|
|
71
|
+
qiconview.resize( qiconview.sizeHint() );
|
|
72
|
+
|
|
73
|
+
return a.exec();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#include "main.moc"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'mxx_ru/cpp/qt'
|
|
2
|
+
|
|
3
|
+
Mxx_ru::setup_target(
|
|
4
|
+
Mxx_ru::Cpp::Exe_target.new( "prj.rb" ) {
|
|
5
|
+
|
|
6
|
+
threading_mode( Mxx_ru::Cpp::THREADING_MULTI )
|
|
7
|
+
rtl_mode( Mxx_ru::Cpp::RTL_SHARED )
|
|
8
|
+
|
|
9
|
+
target( "iconview" )
|
|
10
|
+
|
|
11
|
+
qt = generator( Mxx_ru::Cpp::Qt_gen.new( self ) )
|
|
12
|
+
qt.moc_result_subdir = nil
|
|
13
|
+
|
|
14
|
+
qt.cpp2moc( "main.cpp" )
|
|
15
|
+
|
|
16
|
+
cpp_source( "main.cpp" )
|
|
17
|
+
|
|
18
|
+
lib( "qt-mt333.lib" )
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
)
|