-rw-r--r-- | noncore/net/opierdesktop/qtwin.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/noncore/net/opierdesktop/qtwin.cpp b/noncore/net/opierdesktop/qtwin.cpp index d2a5ef1..e350bf6 100644 --- a/noncore/net/opierdesktop/qtwin.cpp +++ b/noncore/net/opierdesktop/qtwin.cpp | |||
@@ -1,128 +1,120 @@ | |||
1 | /* | 1 | /* |
2 | rdesktop: A Remote Desktop Protocol client. | 2 | rdesktop: A Remote Desktop Protocol client. |
3 | User interface services - X Window System | 3 | User interface services - X Window System |
4 | Copyright (C) Matthew Chapman 1999-2002 | 4 | Copyright (C) Matthew Chapman 1999-2002 |
5 | qt.cpp by Jay Sorg | 5 | qt.cpp by Jay Sorg |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
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; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "rdesktop.h" | 22 | #include "rdesktop.h" |
23 | #ifdef SHARP | ||
24 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
25 | #else | ||
26 | #include <qapplication.h> | ||
27 | #endif | ||
28 | #include <qmainwindow.h> | 24 | #include <qmainwindow.h> |
29 | #include <qwidget.h> | 25 | #include <qwidget.h> |
30 | #include <qpainter.h> | 26 | #include <qpainter.h> |
31 | #include <qimage.h> | 27 | #include <qimage.h> |
32 | #include <qsocketnotifier.h> | 28 | #include <qsocketnotifier.h> |
33 | #include <qscrollview.h> | 29 | #include <qscrollview.h> |
34 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
35 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
36 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
37 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
38 | #include <qlabel.h> | 34 | #include <qlabel.h> |
39 | #include <qfile.h> | 35 | #include <qfile.h> |
40 | #include <qcheckbox.h> | 36 | #include <qcheckbox.h> |
41 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
42 | #include "qtwin.h" | 38 | #include "qtwin.h" |
43 | #include <stdlib.h> | 39 | #include <stdlib.h> |
44 | 40 | ||
45 | uint32 flags; | 41 | uint32 flags; |
46 | char server[64] = ""; | 42 | char server[64] = ""; |
47 | char domain[16] = ""; | 43 | char domain[16] = ""; |
48 | char password[16] = ""; | 44 | char password[16] = ""; |
49 | char shell[128] = ""; | 45 | char shell[128] = ""; |
50 | char directory[32] = ""; | 46 | char directory[32] = ""; |
51 | 47 | ||
52 | extern int g_width; | 48 | extern int g_width; |
53 | extern int g_height; | 49 | extern int g_height; |
54 | extern int server_bpp; | 50 | extern int server_bpp; |
55 | extern BOOL fullscreen; | 51 | extern BOOL fullscreen; |
56 | extern char username[]; | 52 | extern char username[]; |
57 | int global_sock; | 53 | int global_sock; |
58 | 54 | ||
59 | QSocketNotifier* SocketNotifier; | 55 | QSocketNotifier* SocketNotifier; |
60 | #ifdef SHARP | ||
61 | QPEApplication* App; | 56 | QPEApplication* App; |
62 | #else | ||
63 | QApplication* App; | ||
64 | #endif | ||
65 | QMyMainWindow* MW; | 57 | QMyMainWindow* MW; |
66 | QMyScrollView* SV; | 58 | QMyScrollView* SV; |
67 | struct QColorMap | 59 | struct QColorMap |
68 | { | 60 | { |
69 | uint32 RGBColors[256]; | 61 | uint32 RGBColors[256]; |
70 | int NumColors; | 62 | int NumColors; |
71 | }; | 63 | }; |
72 | QColorMap* CM; | 64 | QColorMap* CM; |
73 | uint8* BS; | 65 | uint8* BS; |
74 | int clipx; | 66 | int clipx; |
75 | int clipy; | 67 | int clipy; |
76 | int clipcx; | 68 | int clipcx; |
77 | int clipcy; | 69 | int clipcy; |
78 | 70 | ||
79 | struct bitmap | 71 | struct bitmap |
80 | { | 72 | { |
81 | int w; | 73 | int w; |
82 | int h; | 74 | int h; |
83 | uint8* data; | 75 | uint8* data; |
84 | }; | 76 | }; |
85 | 77 | ||
86 | BOOL owncolmap = False; | 78 | BOOL owncolmap = False; |
87 | 79 | ||
88 | //***************************************************************************** | 80 | //***************************************************************************** |
89 | void CleanString(QString* Item) | 81 | void CleanString(QString* Item) |
90 | { | 82 | { |
91 | int i; | 83 | int i; |
92 | 84 | ||
93 | i = Item->length() - 1; | 85 | i = Item->length() - 1; |
94 | while (i >= 0) | 86 | while (i >= 0) |
95 | { | 87 | { |
96 | if (Item->at(i) == 10 || Item->at(i) == 13) | 88 | if (Item->at(i) == 10 || Item->at(i) == 13) |
97 | Item->remove(i, 1); | 89 | Item->remove(i, 1); |
98 | i--; | 90 | i--; |
99 | } | 91 | } |
100 | } | 92 | } |
101 | 93 | ||
102 | //***************************************************************************** | 94 | //***************************************************************************** |
103 | QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true) | 95 | QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true) |
104 | { | 96 | { |
105 | int i, j; | 97 | int i, j; |
106 | char* home; | 98 | char* home; |
107 | char Text[256]; | 99 | char Text[256]; |
108 | QString Line; | 100 | QString Line; |
109 | QString ItemName; | 101 | QString ItemName; |
110 | QString ItemValue; | 102 | QString ItemValue; |
111 | 103 | ||
112 | // resize dialog | 104 | // resize dialog |
113 | resize(230, 270); | 105 | resize(230, 270); |
114 | // main list box | 106 | // main list box |
115 | ListBox = new QListBox(this); | 107 | ListBox = new QListBox(this); |
116 | ListBox->move(10, 10); | 108 | ListBox->move(10, 10); |
117 | ListBox->resize(200, 100); | 109 | ListBox->resize(200, 100); |
118 | connect(ListBox, SIGNAL(selectionChanged()), this, SLOT(ListBoxChanged())); | 110 | connect(ListBox, SIGNAL(selectionChanged()), this, SLOT(ListBoxChanged())); |
119 | connect(ListBox, SIGNAL(selected(int)), this, SLOT(ListBoxSelected(int))); | 111 | connect(ListBox, SIGNAL(selected(int)), this, SLOT(ListBoxSelected(int))); |
120 | // server | 112 | // server |
121 | Label1 = new QLabel(this); | 113 | Label1 = new QLabel(this); |
122 | Label1->setText("Server Desc"); | 114 | Label1->setText("Server Desc"); |
123 | Label1->move(10, 120); | 115 | Label1->move(10, 120); |
124 | Label1->resize(100, 20); | 116 | Label1->resize(100, 20); |
125 | ServerNameEdit = new QLineEdit(this); | 117 | ServerNameEdit = new QLineEdit(this); |
126 | ServerNameEdit->move(75, 120); | 118 | ServerNameEdit->move(75, 120); |
127 | ServerNameEdit->resize(100, 20); | 119 | ServerNameEdit->resize(100, 20); |
128 | // username | 120 | // username |
@@ -966,133 +958,129 @@ bool WarpCoords(int* x, int* y, int* cx, int* cy, int* srcx, int* srcy) | |||
966 | void QMyMainWindow::paintEvent(QPaintEvent* pe) | 958 | void QMyMainWindow::paintEvent(QPaintEvent* pe) |
967 | { | 959 | { |
968 | QImage* Image; | 960 | QImage* Image; |
969 | QPainter* Painter; | 961 | QPainter* Painter; |
970 | QRect Rect; | 962 | QRect Rect; |
971 | int i, j, w, h, l, t; | 963 | int i, j, w, h, l, t; |
972 | uint8* data; | 964 | uint8* data; |
973 | 965 | ||
974 | if (!testWFlags(WRepaintNoErase)) | 966 | if (!testWFlags(WRepaintNoErase)) |
975 | setWFlags(WRepaintNoErase); | 967 | setWFlags(WRepaintNoErase); |
976 | if (CM != NULL) | 968 | if (CM != NULL) |
977 | { | 969 | { |
978 | Rect = pe->rect(); | 970 | Rect = pe->rect(); |
979 | l = Rect.left(); | 971 | l = Rect.left(); |
980 | t = Rect.top(); | 972 | t = Rect.top(); |
981 | w = Rect.width(); | 973 | w = Rect.width(); |
982 | h = Rect.height(); | 974 | h = Rect.height(); |
983 | if (w > 0 && h > 0 && CM->NumColors > 0) | 975 | if (w > 0 && h > 0 && CM->NumColors > 0) |
984 | { | 976 | { |
985 | data = (uint8*)xmalloc(w * h); | 977 | data = (uint8*)xmalloc(w * h); |
986 | for (i = 0; i < h; i++) | 978 | for (i = 0; i < h; i++) |
987 | for (j = 0; j < w; j++) | 979 | for (j = 0; j < w; j++) |
988 | data[i * w + j] = get_pixel(l + j, t + i); | 980 | data[i * w + j] = get_pixel(l + j, t + i); |
989 | Image = new QImage(data, w, h, 8,(QRgb*)CM->RGBColors, CM->NumColors, QImage::IgnoreEndian); | 981 | Image = new QImage(data, w, h, 8,(QRgb*)CM->RGBColors, CM->NumColors, QImage::IgnoreEndian); |
990 | Painter = new QPainter(this); | 982 | Painter = new QPainter(this); |
991 | Painter->drawImage(l, t, *Image, 0, 0, w, h); | 983 | Painter->drawImage(l, t, *Image, 0, 0, w, h); |
992 | xfree(data); | 984 | xfree(data); |
993 | delete Painter; | 985 | delete Painter; |
994 | delete Image; | 986 | delete Image; |
995 | } | 987 | } |
996 | } | 988 | } |
997 | } | 989 | } |
998 | 990 | ||
999 | //***************************************************************************** | 991 | //***************************************************************************** |
1000 | void QMyMainWindow::closeEvent(QCloseEvent* e) | 992 | void QMyMainWindow::closeEvent(QCloseEvent* e) |
1001 | { | 993 | { |
1002 | e->accept(); | 994 | e->accept(); |
1003 | } | 995 | } |
1004 | 996 | ||
1005 | //***************************************************************************** | 997 | //***************************************************************************** |
1006 | void QMyMainWindow::dataReceived() | 998 | void QMyMainWindow::dataReceived() |
1007 | { | 999 | { |
1008 | if (rdp_main_loop()) | 1000 | if (rdp_main_loop()) |
1009 | return; | 1001 | return; |
1010 | else | 1002 | else |
1011 | SV->close(); | 1003 | SV->close(); |
1012 | } | 1004 | } |
1013 | 1005 | ||
1014 | //***************************************************************************** | 1006 | //***************************************************************************** |
1015 | void redraw(int x, int y, int cx, int cy) | 1007 | void redraw(int x, int y, int cx, int cy) |
1016 | { | 1008 | { |
1017 | if (WarpCoords(&x, &y, &cx, &cy, NULL, NULL)) | 1009 | if (WarpCoords(&x, &y, &cx, &cy, NULL, NULL)) |
1018 | { | 1010 | { |
1019 | MW->update(x, y, cx, cy); | 1011 | MW->update(x, y, cx, cy); |
1020 | } | 1012 | } |
1021 | } | 1013 | } |
1022 | 1014 | ||
1023 | /* | 1015 | /* |
1024 | BOOL ui_init(void) | 1016 | BOOL ui_init(void) |
1025 | { | 1017 | { |
1026 | QWidget* d; | 1018 | QWidget* d; |
1027 | 1019 | ||
1028 | CM = NULL; | 1020 | CM = NULL; |
1029 | BS = NULL; | 1021 | BS = NULL; |
1030 | #ifdef SHARP | ||
1031 | App = new QPEApplication(g_argc, g_argv); | 1022 | App = new QPEApplication(g_argc, g_argv); |
1032 | #else | ||
1033 | App = new QApplication(g_argc, g_argv, QApplication::GuiServer); | ||
1034 | #endif | ||
1035 | if (fullscreen) | 1023 | if (fullscreen) |
1036 | { | 1024 | { |
1037 | d = QApplication::desktop(); | 1025 | d = QApplication::desktop(); |
1038 | width = d->width(); // returns screen width | 1026 | width = d->width(); // returns screen width |
1039 | height = d->height(); // returns screen height | 1027 | height = d->height(); // returns screen height |
1040 | } | 1028 | } |
1041 | return True; | 1029 | return True; |
1042 | } | 1030 | } |
1043 | */ | 1031 | */ |
1044 | 1032 | ||
1045 | /* | 1033 | /* |
1046 | void ui_deinit(void) | 1034 | void ui_deinit(void) |
1047 | { | 1035 | { |
1048 | delete App; | 1036 | delete App; |
1049 | } | 1037 | } |
1050 | */ | 1038 | */ |
1051 | 1039 | ||
1052 | /* | 1040 | /* |
1053 | BOOL ui_create_window(void) | 1041 | BOOL ui_create_window(void) |
1054 | { | 1042 | { |
1055 | MW = new QMyMainWindow(); | 1043 | MW = new QMyMainWindow(); |
1056 | MW->resize(width, height); | 1044 | MW->resize(width, height); |
1057 | SV = new QMyScrollView(); | 1045 | SV = new QMyScrollView(); |
1058 | SV->resize(width + 4, height + 4); | 1046 | SV->resize(width + 4, height + 4); |
1059 | App->setMainWidget(SV); | 1047 | App->setMainWidget(SV); |
1060 | SV->addChild(MW); | 1048 | SV->addChild(MW); |
1061 | MW->setMouseTracking(true); | 1049 | MW->setMouseTracking(true); |
1062 | SocketNotifier = new QSocketNotifier(global_sock, QSocketNotifier::Read, MW); | 1050 | SocketNotifier = new QSocketNotifier(global_sock, QSocketNotifier::Read, MW); |
1063 | MW->connect(SocketNotifier, SIGNAL(activated(int)), MW, SLOT(dataReceived())); | 1051 | MW->connect(SocketNotifier, SIGNAL(activated(int)), MW, SLOT(dataReceived())); |
1064 | if (fullscreen) | 1052 | if (fullscreen) |
1065 | SV->showFullScreen(); | 1053 | SV->showFullScreen(); |
1066 | else | 1054 | else |
1067 | SV->showMaximized(); | 1055 | SV->showMaximized(); |
1068 | BS = (uint8*)xmalloc(width * height); | 1056 | BS = (uint8*)xmalloc(width * height); |
1069 | memset(BS, 0, width * height); | 1057 | memset(BS, 0, width * height); |
1070 | clipx = 0; | 1058 | clipx = 0; |
1071 | clipy = 0; | 1059 | clipy = 0; |
1072 | clipcx = width; | 1060 | clipcx = width; |
1073 | clipcy = height; | 1061 | clipcy = height; |
1074 | CM = (QColorMap*)xmalloc(sizeof(struct QColorMap)); | 1062 | CM = (QColorMap*)xmalloc(sizeof(struct QColorMap)); |
1075 | memset(CM, 0, sizeof(struct QColorMap)); | 1063 | memset(CM, 0, sizeof(struct QColorMap)); |
1076 | SV->timer_id = SV->startTimer(1000); | 1064 | SV->timer_id = SV->startTimer(1000); |
1077 | return True; | 1065 | return True; |
1078 | } | 1066 | } |
1079 | */ | 1067 | */ |
1080 | 1068 | ||
1081 | /* | 1069 | /* |
1082 | void ui_destroy_window(void) | 1070 | void ui_destroy_window(void) |
1083 | { | 1071 | { |
1084 | delete MW; | 1072 | delete MW; |
1085 | delete SV; | 1073 | delete SV; |
1086 | xfree(BS); | 1074 | xfree(BS); |
1087 | xfree(CM); | 1075 | xfree(CM); |
1088 | } | 1076 | } |
1089 | */ | 1077 | */ |
1090 | 1078 | ||
1091 | //***************************************************************************** | 1079 | //***************************************************************************** |
1092 | /* Returns 0 after user quit, 1 otherwise */ | 1080 | /* Returns 0 after user quit, 1 otherwise */ |
1093 | int ui_select(int rdp_socket) | 1081 | int ui_select(int rdp_socket) |
1094 | { | 1082 | { |
1095 | global_sock = rdp_socket; | 1083 | global_sock = rdp_socket; |
1096 | return 1; | 1084 | return 1; |
1097 | } | 1085 | } |
1098 | 1086 | ||
@@ -1555,133 +1543,129 @@ void ui_draw_text(uint8 font, uint8 flags, int mixmode, | |||
1555 | if ((((uint8 *) (entry->data))[1] == 0) && (!(flags & TEXT2_IMPLICIT_X))) | 1543 | if ((((uint8 *) (entry->data))[1] == 0) && (!(flags & TEXT2_IMPLICIT_X))) |
1556 | { | 1544 | { |
1557 | if (flags & TEXT2_VERTICAL) | 1545 | if (flags & TEXT2_VERTICAL) |
1558 | y += text[i + 2]; | 1546 | y += text[i + 2]; |
1559 | else | 1547 | else |
1560 | x += text[i + 2]; | 1548 | x += text[i + 2]; |
1561 | } | 1549 | } |
1562 | for (j = 0; j < entry->size; j++) | 1550 | for (j = 0; j < entry->size; j++) |
1563 | DO_GLYPH(((uint8 *) (entry->data)), j); | 1551 | DO_GLYPH(((uint8 *) (entry->data)), j); |
1564 | } | 1552 | } |
1565 | if (i + 2 < length) | 1553 | if (i + 2 < length) |
1566 | i += 3; | 1554 | i += 3; |
1567 | else | 1555 | else |
1568 | i += 2; | 1556 | i += 2; |
1569 | length -= i; | 1557 | length -= i; |
1570 | /* this will move pointer from start to first character after FE command */ | 1558 | /* this will move pointer from start to first character after FE command */ |
1571 | text = &(text[i]); | 1559 | text = &(text[i]); |
1572 | i = 0; | 1560 | i = 0; |
1573 | break; | 1561 | break; |
1574 | 1562 | ||
1575 | default: | 1563 | default: |
1576 | DO_GLYPH(text, i); | 1564 | DO_GLYPH(text, i); |
1577 | i++; | 1565 | i++; |
1578 | break; | 1566 | break; |
1579 | } | 1567 | } |
1580 | } | 1568 | } |
1581 | if (boxcx > 1) | 1569 | if (boxcx > 1) |
1582 | redraw(boxx, boxy, boxcx, boxcy); | 1570 | redraw(boxx, boxy, boxcx, boxcy); |
1583 | else | 1571 | else |
1584 | redraw(clipx, clipy, clipcx, clipcy); | 1572 | redraw(clipx, clipy, clipcx, clipcy); |
1585 | } | 1573 | } |
1586 | 1574 | ||
1587 | //***************************************************************************** | 1575 | //***************************************************************************** |
1588 | void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy) | 1576 | void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy) |
1589 | { | 1577 | { |
1590 | uint8* data; | 1578 | uint8* data; |
1591 | int i, j; | 1579 | int i, j; |
1592 | 1580 | ||
1593 | data = (uint8*)xmalloc(cx * cy); | 1581 | data = (uint8*)xmalloc(cx * cy); |
1594 | for (i = 0; i < cy; i++) | 1582 | for (i = 0; i < cy; i++) |
1595 | for (j = 0; j < cx; j++) | 1583 | for (j = 0; j < cx; j++) |
1596 | data[i * cx + j] = get_pixel(x + j, y + i); | 1584 | data[i * cx + j] = get_pixel(x + j, y + i); |
1597 | cache_put_desktop(offset, cx, cy, cx, 1, data); | 1585 | cache_put_desktop(offset, cx, cy, cx, 1, data); |
1598 | xfree(data); | 1586 | xfree(data); |
1599 | } | 1587 | } |
1600 | 1588 | ||
1601 | //***************************************************************************** | 1589 | //***************************************************************************** |
1602 | void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy) | 1590 | void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy) |
1603 | { | 1591 | { |
1604 | uint8* data; | 1592 | uint8* data; |
1605 | int i, j; | 1593 | int i, j; |
1606 | 1594 | ||
1607 | data = cache_get_desktop(offset, cx, cy, 1); | 1595 | data = cache_get_desktop(offset, cx, cy, 1); |
1608 | for (i = 0; i < cy; i++) | 1596 | for (i = 0; i < cy; i++) |
1609 | for (j = 0; j < cx; j++) | 1597 | for (j = 0; j < cx; j++) |
1610 | set_pixel(x + j, y + i, data[i * cx + j]); | 1598 | set_pixel(x + j, y + i, data[i * cx + j]); |
1611 | redraw(x, y, cx, cy); | 1599 | redraw(x, y, cx, cy); |
1612 | } | 1600 | } |
1613 | 1601 | ||
1614 | //***************************************************************************** | 1602 | //***************************************************************************** |
1615 | int main(int argc, char** argv) | 1603 | int main(int argc, char** argv) |
1616 | { | 1604 | { |
1617 | CM = NULL; | 1605 | CM = NULL; |
1618 | BS = NULL; | 1606 | BS = NULL; |
1619 | #ifdef SHARP | ||
1620 | App = new QPEApplication(argc, argv); | 1607 | App = new QPEApplication(argc, argv); |
1621 | #else | ||
1622 | App = new QApplication(argc, argv, QApplication::GuiServer); | ||
1623 | #endif | ||
1624 | SV = new QMyScrollView(); | 1608 | SV = new QMyScrollView(); |
1625 | App->setMainWidget(SV); | 1609 | App->setMainWidget(SV); |
1626 | SV->showMaximized(); | 1610 | SV->showMaximized(); |
1627 | SV->timer_id = SV->startTimer(1000); | 1611 | SV->timer_id = SV->startTimer(1000); |
1628 | App->exec(); | 1612 | App->exec(); |
1629 | delete SV; | 1613 | delete SV; |
1630 | delete App; | 1614 | delete App; |
1631 | if (CM != NULL) | 1615 | if (CM != NULL) |
1632 | xfree(CM); | 1616 | xfree(CM); |
1633 | if (BS !=NULL) | 1617 | if (BS !=NULL) |
1634 | xfree(BS); | 1618 | xfree(BS); |
1635 | return 0; | 1619 | return 0; |
1636 | } | 1620 | } |
1637 | 1621 | ||
1638 | /* | 1622 | /* |
1639 | MW = new QMyMainWindow(); | 1623 | MW = new QMyMainWindow(); |
1640 | MW->resize(width, height); | 1624 | MW->resize(width, height); |
1641 | SV->resize(width + 4, height + 4); | 1625 | SV->resize(width + 4, height + 4); |
1642 | App->setMainWidget(SV); | 1626 | App->setMainWidget(SV); |
1643 | SV->addChild(MW); | 1627 | SV->addChild(MW); |
1644 | MW->setMouseTracking(true); | 1628 | MW->setMouseTracking(true); |
1645 | SocketNotifier = new QSocketNotifier(global_sock, QSocketNotifier::Read, MW); | 1629 | SocketNotifier = new QSocketNotifier(global_sock, QSocketNotifier::Read, MW); |
1646 | MW->connect(SocketNotifier, SIGNAL(activated(int)), MW, SLOT(dataReceived())); | 1630 | MW->connect(SocketNotifier, SIGNAL(activated(int)), MW, SLOT(dataReceived())); |
1647 | if (fullscreen) | 1631 | if (fullscreen) |
1648 | SV->showFullScreen(); | 1632 | SV->showFullScreen(); |
1649 | else | 1633 | else |
1650 | SV->showMaximized(); | 1634 | SV->showMaximized(); |
1651 | BS = (uint8*)xmalloc(width * height); | 1635 | BS = (uint8*)xmalloc(width * height); |
1652 | memset(BS, 0, width * height); | 1636 | memset(BS, 0, width * height); |
1653 | clipx = 0; | 1637 | clipx = 0; |
1654 | clipy = 0; | 1638 | clipy = 0; |
1655 | clipcx = width; | 1639 | clipcx = width; |
1656 | clipcy = height; | 1640 | clipcy = height; |
1657 | CM = (QColorMap*)xmalloc(sizeof(struct QColorMap)); | 1641 | CM = (QColorMap*)xmalloc(sizeof(struct QColorMap)); |
1658 | memset(CM, 0, sizeof(struct QColorMap)); | 1642 | memset(CM, 0, sizeof(struct QColorMap)); |
1659 | SV->timer_id = SV->startTimer(1000); | 1643 | SV->timer_id = SV->startTimer(1000); |
1660 | return True; | 1644 | return True; |
1661 | 1645 | ||
1662 | 1646 | ||
1663 | 1647 | ||
1664 | 1648 | ||
1665 | 1649 | ||
1666 | int main(int argc, char ** argv) | 1650 | int main(int argc, char ** argv) |
1667 | { | 1651 | { |
1668 | uint32 flags; | 1652 | uint32 flags; |
1669 | int i, total_params; | 1653 | int i, total_params; |
1670 | char server[64] = "192.168.0.164"; | 1654 | char server[64] = "192.168.0.164"; |
1671 | char domain[16] = ""; | 1655 | char domain[16] = ""; |
1672 | char password[16] = ""; | 1656 | char password[16] = ""; |
1673 | char shell[128] = ""; | 1657 | char shell[128] = ""; |
1674 | char directory[32] = ""; | 1658 | char directory[32] = ""; |
1675 | char* p; | 1659 | char* p; |
1676 | QString param, s1, s2, s3; | 1660 | QString param, s1, s2, s3; |
1677 | 1661 | ||
1678 | flags = RDP_LOGON_NORMAL; | 1662 | flags = RDP_LOGON_NORMAL; |
1679 | 1663 | ||
1680 | g_argc = argc; | 1664 | g_argc = argc; |
1681 | g_argv = argv; | 1665 | g_argv = argv; |
1682 | 1666 | ||
1683 | if (!ui_init()) | 1667 | if (!ui_init()) |
1684 | return 1; | 1668 | return 1; |
1685 | 1669 | ||
1686 | total_params = App->argc(); | 1670 | total_params = App->argc(); |
1687 | 1671 | ||