~ubuntu-branches/debian/jessie/italc/jessie

« back to all changes in this revision

Viewing changes to ica/x11/x11vnc/tkx11vnc.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2011-02-11 14:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110211145022-sn173siax6lywjus
Tags: upstream-1.0.13
ImportĀ upstreamĀ versionĀ 1.0.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
"exec wish \"$0\" \"$@\"\n"
15
15
"catch {rename send {}}\n"
16
16
"#\n"
17
 
"# Copyright (c) 2004-2006 Karl J. Runge <runge@karlrunge.com>\n"
 
17
"# Copyright (C) 2004-2009 Karl J. Runge <runge@karlrunge.com>\n"
18
18
"# All rights reserved.\n"
19
19
"#\n"
20
20
"#  This is free software; you can redistribute it and/or modify\n"
134
134
"       afteraccept:\n"
135
135
"       gone:\n"
136
136
"       vncconnect\n"
137
 
"       avahi\n"
 
137
"       zeroconf\n"
138
138
"       -- D\n"
139
139
"       tightfilexfer\n"
140
140
"       ultrafilexfer\n"
 
141
"       proxy:\n"
 
142
"       =GAL Chat::\n"
 
143
"       chatwindow\n"
 
144
"       =DRA chaton\n"
 
145
"       =DRA chatoff\n"
 
146
"       =GAL LOFF\n"
141
147
"       =GAL Java-applet::\n"
142
148
"       =D http\n"
143
149
"       httpdir:\n"
153
159
"       =S reflect:\n"
154
160
"       =D desktop:\n"
155
161
"       =D rfbport:\n"
 
162
"       =S autoport:\n"
156
163
"       =0 gui:\n"
157
164
"\n"
158
165
"Screen\n"
180
187
"       =GAL SubWindow::\n"
181
188
"       id:\n"
182
189
"       sid:\n"
 
190
"       =RA id_cmd:\n"
183
191
"       =GAL LOFF\n"
184
192
"       =GAL ResizeRotate::\n"
185
193
"       = xrandr\n"
241
249
"       buttonmap:\n"
242
250
"       --\n"
243
251
"       xwarppointer\n"
 
252
"       always_inject\n"
244
253
"\n"
245
254
"Misc\n"
246
255
"       =GD-C:full,icon,tray WindowView:\n"
258
267
"       =GAL LOFF\n"
259
268
"       =GAL X-ext::\n"
260
269
"       xtrap\n"
261
 
"       xrecord\n"
 
270
"       noxrecord\n"
262
271
"       =RQA reset_record\n"
263
272
"       =GAL LOFF\n"
264
273
"       =GAL MacOSX::\n"
271
280
"       macmenu\n"
272
281
"       =GAL LOFF\n"
273
282
"       --\n"
 
283
"       6\n"
 
284
"       noipv6\n"
 
285
"       noipv4\n"
 
286
"       --\n"
274
287
"       nofb\n"
275
288
"       =D nobell\n"
276
289
"       nolookup\n"
278
291
"       bg\n"
279
292
"       =S loop\n"
280
293
"       =S loopbg\n"
 
294
"       =S sleepin:\n"
281
295
"       =-C:ignore,exit sigpipe:\n"
282
296
"       =0 inetd\n"
283
297
"\n"
338
352
"       =F ssldir:\n"
339
353
"       =F sslverify:\n"
340
354
"       ssltimeout:\n"
 
355
"       --\n"
 
356
"       enc:\n"
341
357
"       =GAL LOFF\n"
342
358
"       =GAL Misc-Perms::\n"
343
359
"       safer\n"
351
367
"       grabkbd\n"
352
368
"       grabptr\n"
353
369
"       grabalways\n"
 
370
"       grablocal:\n"
354
371
"       forcedpms\n"
355
372
"       clientdpms\n"
356
373
"       noserverdpms\n"
413
430
"       gaps:\n"
414
431
"       grow:\n"
415
432
"       fuzz:\n"
 
433
"       extra_fbur:\n"
416
434
"       wait_ui:\n"
 
435
"       setdefer:\n"
417
436
"       nowait_bog\n"
418
437
"       slow_fb:\n"
419
438
"       xrefresh:\n"
708
727
"    Stop x11vnc     - Directs the x11vnc server to disconnect all vncviewers\n"
709
728
"                      and then exit.  The tray/icon GUI then exits as well.\n"
710
729
"\n"
 
730
"    Logfile         - Show the logfile if x11vnc is being run with one.\n"
 
731
"\n"
711
732
"    Custom          - If you have a \\$HOME/.x11vnc.gui file each uncommented\n"
712
733
"                      line in it becomes an additional menu item for this\n"
713
734
"                      menu.  The remote control command is run directly\n"
746
767
"                      non-standard listening port use \\\"host:port\\\".\n"
747
768
"\n"
748
769
"                      Pressing \\\"OK\\\" will initiate the reverse\n"
749
 
"                      connection.  Use a blank hostname to skip it.\n"
 
770
"                      connection.  Use a blank hostname to skip it, or\n"
 
771
"                      delete (\\\"X-out\\\") the window.\n"
750
772
"    \n"
751
773
"\"\n"
752
774
"\n"
755
777
"running x11vnc server.  After modifying them press \\\"OK\\\" or \\\"Apply\\\"\n"
756
778
"to apply the changes, or press \\\"Cancel\\\" to skip applying them.\n"
757
779
"\n"
758
 
" - \\\"Accept Connections\\\" toggles whether VNC viewers are allowed\n"
759
 
"   to connect or not.  It corresponds to the \\\"-R unlock\\\" and \\\"-R lock\\\"\n"
760
 
"   remote-control commands.\n"
761
 
"   \n"
762
 
" - \\\"Ask for Confirmation\\\" toggles whether a popup menu will be presented\n"
763
 
"   at the X display when a new VNC viewer attempts to connect.  The person\n"
764
 
"   sitting at the X display can choose to accept or reject the connection\n"
765
 
"   or accept the connection in View-Only mode.  It corresponds to the \n"
766
 
"   \\\"-R accept:popup\\\" and \\\"-R accept:\\\" remote-control commands.\n"
767
 
"   \n"
768
 
" - \\\"All Clients ViewOnly\\\" toggles whether the entire VNC desktop is\n"
769
 
"   view only.  All clients will only be able to watch when this is set\n"
770
 
"   (regardless of how they logged in).  It corresponds to the\n"
771
 
"   \\\"-R viewonly\\\" and \\\"-R noviewonly\\\" remote-control commands.\n"
772
 
"   \n"
773
 
" - \\\"Shared\\\" toggles whether multiple simultaneous connections are\n"
774
 
"   allowed or not.  It corresponds to the \\\"-R shared\\\" and \\\"-R noshared\\\"\n"
775
 
"   remote-control commands.\n"
776
 
"\n"
777
 
" - \\\"Password\\\" lets you set the session password viewers may use to gain full\n"
778
 
"   access to the display.  This will only work if x11vnc was started with \n"
 
780
" Accept Connections:\n"
 
781
"\n"
 
782
"   Toggles whether VNC viewers are allowed to connect or not.  It corresponds\n"
 
783
"   to the \\\"-R unlock\\\" and \\\"-R lock\\\" remote-control commands.\n"
 
784
"\n"
 
785
" Ask for Confirmation:\n"
 
786
"\n"
 
787
"   Toggles whether a popup menu will be presented at the X display when\n"
 
788
"   a new VNC viewer attempts to connect.  The person sitting at the X\n"
 
789
"   display can choose to accept or reject the connection or accept the\n"
 
790
"   connection in ViewOnly mode.  It corresponds to the \\\"-R accept:popup\\\"\n"
 
791
"   and \\\"-R accept:\\\" remote-control commands.\n"
 
792
"   \n"
 
793
" All Clients ViewOnly:\n"
 
794
"\n"
 
795
"   Toggles whether the entire VNC desktop is view only.  All clients\n"
 
796
"   will only be able to watch when this is set (regardless of how they\n"
 
797
"   logged in).  It corresponds to the \\\"-R viewonly\\\" and \\\"-R noviewonly\\\"\n"
 
798
"   remote-control commands.\n"
 
799
"   \n"
 
800
" Shared:\n"
 
801
"\n"
 
802
"   Toggles whether multiple simultaneous viewer connections are allowed\n"
 
803
"   or not.  It corresponds to the \\\"-R shared\\\" and \\\"-R noshared\\\"\n"
 
804
"   remote-control commands.\n"
 
805
"\n"
 
806
" Advertise Service (Zeroconf):\n"
 
807
"\n"
 
808
"   Toggles whether this VNC server should advertize itself via Zeroconf\n"
 
809
"   (also called Bonjour, mDNS, and avahi).  Then VNC viewers can then find\n"
 
810
"   this service on the local network.  It corresponds to the \\\"-R zeroconf\\\"\n"
 
811
"   and \\\"-R nozeroconf\\\" remote-control commands.\n"
 
812
"\n"
 
813
" Serve Java Viewer Applet:\n"
 
814
"\n"
 
815
"   Toggles whether this VNC server should serve up a Java VNC Viewer\n"
 
816
"   applet via HTTP on http://hostname:5800/ (or port 5800+n for VNC\n"
 
817
"   port 5900+n).  A java enabled Web Browser can then connect to the\n"
 
818
"   desktopby VNC.  If SSL is active then the HTTPS URL https://hostname:5900/\n"
 
819
"   (etc.) will work as well.  This requires the x11vnc java viewer jar file\n"
 
820
"   (shared/x11vnc/classes) to be installed.  It corresponds to the\n"
 
821
"   \\\"-R http\\\" and \\\"-R nohttp\\\" remote commands.\n"
 
822
"\n"
 
823
" Solid Background Color:\n"
 
824
"\n"
 
825
"   To improve VNC performance, if this option is set, then x11vnc will try\n"
 
826
"   to make the desktop background a solid color (which compresses extremely\n"
 
827
"   well compared to photo images, etc.)  It corresponds to the \\\"-R solid\\\"\n"
 
828
"   and \\\"-R nosolid\\\" remote commands.\n"
 
829
"\n"
 
830
" Password:\n"
 
831
"\n"
 
832
"   Lets you set the session password viewers may use to gain full access\n"
 
833
"   to the display.  This will only work if x11vnc was started with the\n"
 
834
"   -gui icon or -gui tray mode.\n"
 
835
"   \n"
 
836
" ViewOnly Password:\n"
 
837
"\n"
 
838
"   Lets you set the session password viewers may use to gain view only\n"
 
839
"   access to the display.  This will only work if x11vnc was started with\n"
779
840
"   the -gui icon or -gui tray mode.\n"
780
 
"   \n"
781
 
" - \\\"ViewOnly Password\\\" lets you set the session password viewers may\n"
782
 
"   use to gain view only access to the display.  This will only work if\n"
783
 
"   x11vnc was started with the -gui icon or -gui tray mode.\n"
784
 
"\n"
785
 
"NOTE: These \\\"session\\\" passwords only last for the current x11vnc\n"
786
 
"session (they are not remembered, see the -storepasswd, -passwdfile,\n"
787
 
"and -rfbauth x11vnc options for using stored passwords).\n"
788
 
"\n"
789
 
"If you set \\\"Password\\\" to the empty string that makes the \\\"View-Only\n"
790
 
"Password\\\" empty as well and removes the need for any password to log in.\n"
791
 
"\n"
792
 
"If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
793
 
"the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
 
841
"\n"
 
842
"\n"
 
843
" NOTE: These \\\"session\\\" passwords only last for the current x11vnc\n"
 
844
" session (they are not remembered, see the -storepasswd, -passwdfile,\n"
 
845
" and -rfbauth x11vnc options for using stored passwords).\n"
 
846
"\n"
 
847
" If you set \\\"Password\\\" to the empty string that makes the \\\"ViewOnly\n"
 
848
" Password\\\" empty as well and removes the need for any password to log in.\n"
 
849
"\n"
 
850
" If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
 
851
" the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
794
852
"\n"
795
853
" - The \\\"Help\\\" button shows this help text.\n"
796
854
"   \n"
798
856
"   tkx11vnc GUI.  All dynamic settings can be modified in the full GUI.\n"
799
857
"\n"
800
858
"\n"
801
 
"--------------------------------------------------------------------\n"
 
859
"==========================================================================\n"
 
860
"\n"
802
861
"Don't Lock Yourself Out:\n"
803
862
"\n"
804
863
"   If you are sitting at the physical X display you cannot get into too\n"
1068
1127
"but this can be altered by -httpport, etc.\n"
1069
1128
"\"\n"
1070
1129
"\n"
 
1130
"       set helptext(Chat:) \"\n"
 
1131
"In this sub-menu are some options for enabling a local chat window\n"
 
1132
"and starting or stopping the current chat.  This is the UltraVNC \n"
 
1133
"Text Chat support in x11vnc.\n"
 
1134
"\"\n"
 
1135
"\n"
1071
1136
"       set helptext(ScrollCopyRect:) \"\n"
1072
1137
"This sub-menu has some options for the x11vnc Scroll detection and\n"
1073
1138
"CopyRect speedup scheme.\n"
1642
1707
"               if {[regexp {^These options} $line]} {\n"
1643
1708
"                       continue;\n"
1644
1709
"               }\n"
 
1710
"               # tweak aliases:\n"
 
1711
"               regsub {^-zeroconf} $line \"-zero_conf\" line\n"
 
1712
"               regsub {^-avahi   } $line \"-zeroconf\" line\n"
1645
1713
"\n"
1646
1714
"               if {! $sawopts} {\n"
1647
1715
"                       continue;\n"
2480
2548
"}\n"
2481
2549
"\n"
2482
2550
"proc get_default_vars {} {\n"
2483
 
"       global default_var\n"
 
2551
"       global default_var env\n"
2484
2552
"\n"
2485
2553
"       set qry [all_query_vars]\n"
2486
2554
"\n"
2487
2555
"       append qry \",vncconnect\"\n"
2488
2556
"\n"
2489
 
"       set qargs [list \"-QD\" $qry]\n"
2490
 
"       set all [run_remote_cmd $qargs]\n"
 
2557
"       set q \"\"\n"
 
2558
"       set i 0\n"
 
2559
"       set all \"\"\n"
 
2560
"       foreach s [split $qry \",\"] {\n"
 
2561
"               if {$q != \"\"} {\n"
 
2562
"                       append q \",\"\n"
 
2563
"               }\n"
 
2564
"               append q $s\n"
 
2565
"               incr i\n"
 
2566
"               if {$i > 50} {\n"
 
2567
"                       set qargs [list \"-QD\" $q]\n"
 
2568
"                       set a [run_remote_cmd $qargs]\n"
 
2569
"                       if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
 
2570
"                               puts $q\n"
 
2571
"                               puts $a\n"
 
2572
"                               puts \"---------------\"\n"
 
2573
"                       }\n"
 
2574
"                       if {$all != \"\"} {\n"
 
2575
"                               append all \",\"\n"
 
2576
"                       }\n"
 
2577
"                       append all $a\n"
 
2578
"                       set q \"\"\n"
 
2579
"                       set i 0\n"
 
2580
"               }\n"
 
2581
"       }\n"
 
2582
"       if {$q != \"\"} {\n"
 
2583
"               set qargs [list \"-QD\" $q]\n"
 
2584
"               set a [run_remote_cmd $qargs]\n"
 
2585
"               if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
 
2586
"                       puts $q\n"
 
2587
"                       puts $a\n"
 
2588
"                       puts \"---------------\"\n"
 
2589
"               }\n"
 
2590
"               if {$all != \"\"} {\n"
 
2591
"                       append all \",\"\n"
 
2592
"               }\n"
 
2593
"               append all $a\n"
 
2594
"       }\n"
 
2595
"\n"
 
2596
"# old way, qry too long...\n"
 
2597
"#      set qargs [list \"-QD\" $qry]\n"
 
2598
"#      set all [run_remote_cmd $qargs]\n"
2491
2599
"\n"
2492
2600
"       if {[regexp {ans=} $all]} {\n"
2493
2601
"               #append_text \"Retrieved all default settings.\\n\"\n"
2640
2748
"\n"
2641
2749
"proc update_menu_vars {{query \"\"}} {\n"
2642
2750
"       global all_settings menu_var query_result_list\n"
 
2751
"       global x11vnc_icon_mode\n"
2643
2752
"\n"
2644
2753
"       set debug [in_debug_mode]\n"
2645
2754
"\n"
2653
2762
"\n"
2654
2763
"       foreach piece $query_result_list {\n"
2655
2764
"#puts stderr \"UMV: $piece\"\n"
 
2765
"               if [regexp {icon_mode:0} $piece] {\n"
 
2766
"                       set x11vnc_icon_mode 0\n"
 
2767
"                       #puts stderr \"x11vnc_icon_mode: $x11vnc_icon_mode\"\n"
 
2768
"               }\n"
 
2769
"               if [regexp {icon_mode:1} $piece] {\n"
 
2770
"                       set x11vnc_icon_mode 1\n"
 
2771
"                       #puts stderr \"x11vnc_icon_mode: $x11vnc_icon_mode\"\n"
 
2772
"               }\n"
 
2773
"               # XXX ipv6\n"
2656
2774
"               if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {\n"
2657
2775
"                       if {[info exists menu_var($item)]} {\n"
2658
2776
"                               set old $menu_var($item)\n"
2906
3024
"       }\n"
2907
3025
"       set cache_all_query_vars $qry\n"
2908
3026
"\n"
 
3027
"       global env\n"
 
3028
"       if [info exists env(TKX11VNC_PRINT_ALL_VARS)] {\n"
 
3029
"               puts \"--------------- BEGIN ALL VARS ---------------\"\n"
 
3030
"               puts $qry\n"
 
3031
"               puts \"--------------- END ALL VARS ---------------\"\n"
 
3032
"       }\n"
 
3033
"\n"
2909
3034
"       return $qry\n"
2910
3035
"}\n"
2911
3036
"\n"
2913
3038
"       global query_ans_list query_aro_list all_settings\n"
2914
3039
"       global last_query_all_time\n"
2915
3040
"\n"
 
3041
"       dtime 1\n"
2916
3042
"       set qry [all_query_vars]\n"
2917
3043
"\n"
2918
3044
"       set qargs [list \"-Q\" $qry]\n"
2930
3056
"               }\n"
2931
3057
"       }\n"
2932
3058
"       set last_query_all_time [clock seconds]\n"
 
3059
"       dtime 2\n"
2933
3060
"       return $all\n"
2934
3061
"}\n"
2935
3062
"\n"
4017
4144
"}\n"
4018
4145
"\n"
4019
4146
"proc props_apply {} {\n"
4020
 
"       global props_accept props_confirm props_viewonly props_shared\n"
 
4147
"       global props_accept props_confirm props_viewonly props_shared \n"
 
4148
"       global props_zeroconf props_javaview props_solid\n"
4021
4149
"       global props_passwd props_viewpasswd\n"
4022
4150
"       global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
 
4151
"       global prop0_zeroconf prop0_javaview prop0_solid\n"
4023
4152
"       global prop0_passwd prop0_viewpasswd\n"
4024
4153
"       global menu_var\n"
4025
4154
"       global client_sock\n"
4034
4163
"       }\n"
4035
4164
"       set did 0\n"
4036
4165
"\n"
4037
 
"       if {$props_accept != $prop0_accept} {\n"
4038
 
"               if {$did > 0} {after $aft}; incr did\n"
4039
 
"               if {$props_accept} {\n"
4040
 
"                       push_new_value \"unlock\" \"unlock\" 1 0\n"
4041
 
"               } else {\n"
4042
 
"                       push_new_value \"lock\" \"lock\" 1 0\n"
4043
 
"               }\n"
4044
 
"               set prop0_accept $props_accept\n"
4045
 
"       }\n"
 
4166
"       set fail 0\n"
4046
4167
"\n"
4047
4168
"       if {$props_confirm != $prop0_confirm} {\n"
4048
4169
"               if {$did > 0} {after $aft}; incr did\n"
4056
4177
"               } elseif {$menu_var(accept) == \"\"} {\n"
4057
4178
"                       set props_confirm 0\n"
4058
4179
"               }\n"
 
4180
"               if {$props_confirm == $prop0_confirm} {incr fail}\n"
4059
4181
"               set prop0_confirm $props_confirm\n"
4060
4182
"       }\n"
4061
4183
"\n"
4071
4193
"               } else {\n"
4072
4194
"                       set props_viewonly 0\n"
4073
4195
"               }\n"
 
4196
"               if {$props_viewonly == $prop0_viewonly} {incr fail}\n"
4074
4197
"               set prop0_viewonly $props_viewonly\n"
4075
4198
"       }\n"
4076
4199
"\n"
4086
4209
"               } else {\n"
4087
4210
"                       set props_shared 0\n"
4088
4211
"               }\n"
 
4212
"               if {$props_shared == $prop0_shared} {incr fail}\n"
4089
4213
"               set prop0_shared $props_shared\n"
4090
4214
"       }\n"
4091
4215
"\n"
 
4216
"       if {$props_zeroconf != $prop0_zeroconf} {\n"
 
4217
"               if {$did > 0} {after $aft}; incr did\n"
 
4218
"               if {$props_zeroconf} {\n"
 
4219
"                       push_new_value \"zeroconf\" \"zeroconf\" 1 1\n"
 
4220
"               } else {\n"
 
4221
"                       push_new_value \"zeroconf\" \"nozeroconf\" 1 1\n"
 
4222
"               }\n"
 
4223
"               if {$menu_var(zeroconf)} {\n"
 
4224
"                       set props_zeroconf 1\n"
 
4225
"               } else {\n"
 
4226
"                       set props_zeroconf 0\n"
 
4227
"               }\n"
 
4228
"               if {$props_zeroconf == $prop0_zeroconf} {incr fail}\n"
 
4229
"               set prop0_zeroconf $props_zeroconf\n"
 
4230
"       }\n"
 
4231
"\n"
 
4232
"       if {$props_javaview != $prop0_javaview} {\n"
 
4233
"               if {$did > 0} {after $aft}; incr did\n"
 
4234
"               if {$props_javaview} {\n"
 
4235
"                       push_new_value \"http\" \"http\" 1 1\n"
 
4236
"               } else {\n"
 
4237
"                       push_new_value \"http\" \"nohttp\" 1 1\n"
 
4238
"               }\n"
 
4239
"               if {$menu_var(http)} {\n"
 
4240
"                       set props_javaview 1\n"
 
4241
"               } else {\n"
 
4242
"                       set props_javaview 0\n"
 
4243
"               }\n"
 
4244
"               if {$props_javaview == $prop0_javaview} {incr fail}\n"
 
4245
"               set prop0_javaview $props_javaview\n"
 
4246
"       }\n"
 
4247
"\n"
 
4248
"       if {$props_solid != $prop0_solid} {\n"
 
4249
"               if {$did > 0} {after $aft}; incr did\n"
 
4250
"               if {$props_solid} {\n"
 
4251
"                       push_new_value \"solid\" \"solid\" 1 1\n"
 
4252
"               } else {\n"
 
4253
"                       push_new_value \"solid\" \"nosolid\" 1 1\n"
 
4254
"               }\n"
 
4255
"               if {$menu_var(solid)} {\n"
 
4256
"                       set props_solid 1\n"
 
4257
"               } else {\n"
 
4258
"                       set props_solid 0\n"
 
4259
"               }\n"
 
4260
"               if {$props_solid == $prop0_solid} {incr fail}\n"
 
4261
"               set prop0_solid $props_solid\n"
 
4262
"       }\n"
 
4263
"\n"
4092
4264
"       set fpw 0\n"
4093
4265
"       if {$props_passwd != $prop0_passwd} {\n"
4094
4266
"               set fpw 1\n"
4153
4325
"               if {$case == \"fpw\"} {\n"
4154
4326
"                       if {$did > 0} {after $aft}; incr did\n"
4155
4327
"                       push_new_value \"passwd\" \"passwd\" \"$props_passwd\" 1\n"
 
4328
"                       if {$props_passwd == $prop0_passwd} {incr fail}\n"
4156
4329
"                       set prop0_passwd $props_passwd\n"
4157
4330
"               }\n"
4158
4331
"               if {$case == \"vpw\"} {\n"
4159
4332
"                       if {$did > 0} {after $aft}; incr did\n"
4160
4333
"                       push_new_value \"viewpasswd\" \"viewpasswd\" \"$props_viewpasswd\" 1\n"
 
4334
"                       if {$props_viewpasswd == $prop0_viewpasswd} {incr fail}\n"
4161
4335
"                       set prop0_viewpasswd $props_viewpasswd\n"
4162
4336
"               }\n"
4163
4337
"       }\n"
4164
4338
"\n"
 
4339
"       if {$props_accept != $prop0_accept} {\n"
 
4340
"               if {$did > 0} {after $aft}; incr did\n"
 
4341
"               if {$props_accept} {\n"
 
4342
"                       push_new_value \"unlock\" \"unlock\" 1 0\n"
 
4343
"               } else {\n"
 
4344
"                       push_new_value \"lock\" \"lock\" 1 0\n"
 
4345
"               }\n"
 
4346
"               if {$props_accept == $prop0_accept} {incr fail}\n"
 
4347
"               set prop0_accept $props_accept\n"
 
4348
"       }\n"
 
4349
"\n"
4165
4350
"       props_widgets normal\n"
 
4351
"       if {$fail > 0} {\n"
 
4352
"               return 0\n"
 
4353
"       } else {\n"
 
4354
"               return 1\n"
 
4355
"       }\n"
4166
4356
"}\n"
4167
4357
"\n"
4168
4358
"proc props_advanced {} {\n"
4169
 
"       global icon_mode icon_win props_win full_win\n"
 
4359
"       global icon_mode props_win full_win\n"
4170
4360
"       global props_advanced_first\n"
4171
4361
"\n"
4172
4362
"       if ![info exists props_advanced_first] {\n"
4184
4374
"               set w $full_win\n"
4185
4375
"               wm minsize $w [winfo width $w] [winfo height $w]\n"
4186
4376
"       }\n"
 
4377
"       push_new_value \"remote-cmd\" \"remote-cmd\" \"Q:clients\" 1\n"
4187
4378
"}\n"
4188
4379
"\n"
4189
 
"proc do_props {{msg \"\"}} {\n"
 
4380
"proc do_props {} {\n"
4190
4381
"       global props_accept props_confirm props_viewonly props_shared\n"
 
4382
"       global props_zeroconf props_javaview props_solid\n"
4191
4383
"       global props_passwd props_viewpasswd\n"
4192
4384
"       global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
 
4385
"       global prop0_zeroconf prop0_javaview prop0_solid\n"
4193
4386
"       global prop0_passwd prop0_viewpasswd\n"
4194
4387
"       global menu_var unset_str\n"
4195
4388
"       global have_labelframes ffont bfont\n"
4196
4389
"       global props_buttons icon_noadvanced\n"
4197
4390
"       global icon_mode icon_mode_at_startup\n"
4198
4391
"       global screen_height screen_width\n"
 
4392
"       global do_props_msg\n"
 
4393
"\n"
 
4394
"       set msg \"\"\n"
 
4395
"       if {[info exists do_props_msg]} {\n"
 
4396
"               set msg $do_props_msg\n"
 
4397
"       }\n"
4199
4398
"\n"
4200
4399
"       check_update_vars\n"
4201
4400
"\n"
4202
 
"       set pady 1m\n"
 
4401
"       set pady 0.5m\n"
 
4402
"       set pady 0.3m\n"
4203
4403
"       if {$screen_height <= 360} {\n"
4204
4404
"               set pady 0m\n"
4205
4405
"       }\n"
4256
4456
"       }\n"
4257
4457
"       set prop0_shared $props_shared\n"
4258
4458
"\n"
 
4459
"       if [info exists menu_var(zeroconf)] {\n"
 
4460
"               if {$menu_var(zeroconf) == $unset_str || $menu_var(zeroconf) == \"\"} {\n"
 
4461
"                       set props_zeroconf 0\n"
 
4462
"               } elseif ($menu_var(zeroconf)) {\n"
 
4463
"                       set props_zeroconf 1\n"
 
4464
"               } else {\n"
 
4465
"                       set props_zeroconf 0\n"
 
4466
"               }\n"
 
4467
"       } else {\n"
 
4468
"               set menu_var(zeroconf) 0\n"
 
4469
"               set props_zeroconf 0\n"
 
4470
"       }\n"
 
4471
"       set prop0_zeroconf $props_zeroconf\n"
 
4472
"\n"
 
4473
"       if [info exists menu_var(http)] {\n"
 
4474
"               if {$menu_var(http) == $unset_str || $menu_var(http) == \"\"} {\n"
 
4475
"                       set props_javaview 0\n"
 
4476
"               } elseif ($menu_var(http)) {\n"
 
4477
"                       set props_javaview 1\n"
 
4478
"               } else {\n"
 
4479
"                       set props_javaview 0\n"
 
4480
"               }\n"
 
4481
"       } else {\n"
 
4482
"               set menu_var(http) 0\n"
 
4483
"               set props_javaview 0\n"
 
4484
"       }\n"
 
4485
"       set prop0_javaview $props_javaview\n"
 
4486
"\n"
 
4487
"       if [info exists menu_var(solid)] {\n"
 
4488
"               if {$menu_var(solid) == $unset_str || $menu_var(solid) == \"\"} {\n"
 
4489
"                       set props_solid 0\n"
 
4490
"               } elseif ($menu_var(solid)) {\n"
 
4491
"                       set props_solid 1\n"
 
4492
"               } else {\n"
 
4493
"                       set props_solid 0\n"
 
4494
"               }\n"
 
4495
"       } else {\n"
 
4496
"               set menu_var(solid) 0\n"
 
4497
"               set props_solid 0\n"
 
4498
"       }\n"
 
4499
"       set prop0_solid $props_solid\n"
 
4500
"\n"
4259
4501
"       if ![info exists props_passwd] {\n"
4260
4502
"               set props_passwd \"\"\n"
4261
4503
"       }\n"
4271
4513
"       }\n"
4272
4514
"       set props_buttons [list]\n"
4273
4515
"\n"
4274
 
"       set w .props\n"
4275
 
"       catch {destroy $w}\n"
4276
 
"       toplevel $w\n"
4277
 
"       wm title $w \"x11vnc Properties\"\n"
 
4516
"       set wp .props\n"
 
4517
"       set w $wp\n"
 
4518
"       catch {destroy $wp}\n"
 
4519
"       toplevel $wp\n"
 
4520
"       wm title $wp \"x11vnc Properties\"\n"
 
4521
"       frame $w.lf\n"
 
4522
"       set w $w.lf\n"
4278
4523
"       set b1 \"$w.buttons1\"\n"
4279
4524
"       frame $b1\n"
4280
 
"       button $b1.ok -text OK -command \"props_apply; destroy $w\" -font $bfont\n"
4281
 
"       button $b1.cancel -text Cancel -command \"destroy $w\" -font $bfont\n"
 
4525
"       button $b1.ok -text OK -command \"if {\\[props_apply\\]} {destroy $wp}\" -font $bfont\n"
 
4526
"       button $b1.cancel -text Cancel -command \"destroy $wp\" -font $bfont\n"
4282
4527
"       button $b1.apply  -text Apply -command \"props_apply\" -font $bfont\n"
4283
4528
"\n"
4284
 
"       bind $w <KeyPress-Escape> \"destroy $w\"\n"
 
4529
"       bind $w <KeyPress-Escape> \"destroy $wp\"\n"
4285
4530
"\n"
4286
4531
"       pack $b1.ok $b1.cancel $b1.apply -side left -expand 0\n"
4287
4532
"       lappend props_buttons $b1.apply $b1.cancel $b1.ok\n"
4289
4534
"       set b2 \"$w.buttons2\"\n"
4290
4535
"       frame $b2\n"
4291
4536
"\n"
4292
 
"       button $b2.advanced -text \"Advanced ...\" \\\n"
4293
 
"               -command \"destroy $w; props_advanced\" -font $bfont\n"
 
4537
"       button $b2.advanced -text \" Advanced ... \" \\\n"
 
4538
"               -command \"destroy $wp; props_advanced\" -font $bfont\n"
4294
4539
"       if {! $icon_noadvanced} {\n"
4295
4540
"               lappend props_buttons $b2.advanced\n"
4296
4541
"               pack $b2.advanced -side left -expand 0\n"
4297
4542
"       }\n"
4298
4543
"\n"
4299
 
"       button $b2.help -text \"Help\" -command \"menu_help Properties\" -font $bfont\n"
 
4544
"       button $b2.help -text \"  Help  \" -command \"menu_help Properties\" -font $bfont\n"
4300
4545
"       lappend props_buttons $b2.help\n"
4301
4546
"       pack $b2.help -side left -expand 0\n"
4302
4547
"\n"
 
4548
"       set pw \"$w.passwd\"\n"
 
4549
"       if {$have_labelframes} {\n"
 
4550
"               labelframe $pw -text \"Password\" -font $bfont\n"
 
4551
"       } else {\n"
 
4552
"               frame $pw\n"
 
4553
"               set l $pw.l\n"
 
4554
"               label $l -text \"Password:\" -justify left -anchor w -font $bfont\n"
 
4555
"               pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
 
4556
"       }\n"
 
4557
"       entry $pw.e -show \"*\" -textvariable props_passwd -font $bfont\n"
 
4558
"       pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
 
4559
"\n"
 
4560
"       global x11vnc_icon_mode\n"
 
4561
"       if {! $x11vnc_icon_mode} {\n"
 
4562
"               catch { $pw.e configure -state disabled}\n"
 
4563
"               if {! $have_labelframes} {\n"
 
4564
"                       catch { $pw.l configure -state disabled}\n"
 
4565
"               }\n"
 
4566
"       } else {\n"
 
4567
"               lappend props_buttons $pw.e\n"
 
4568
"       }\n"
 
4569
"\n"
 
4570
"\n"
4303
4571
"       set vp \"$w.viewpw\"\n"
4304
4572
"       if {$have_labelframes} {\n"
4305
4573
"               labelframe $vp -text \"ViewOnly Password\" -font $bfont\n"
4312
4580
"       entry $vp.e -show \"*\" -textvariable props_viewpasswd -font $bfont\n"
4313
4581
"       pack $vp.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
4314
4582
"\n"
4315
 
"\n"
4316
 
"       lappend props_buttons $vp.e\n"
4317
 
"\n"
4318
 
"       set pw \"$w.passwd\"\n"
4319
 
"       if {$have_labelframes} {\n"
4320
 
"               labelframe $pw -text \"Password\" -font $bfont\n"
 
4583
"       if {! $x11vnc_icon_mode} {\n"
 
4584
"               catch { $vp.e configure -state disabled}\n"
 
4585
"               if {! $have_labelframes} {\n"
 
4586
"                       catch { $vp.l configure -state disabled}\n"
 
4587
"               }\n"
4321
4588
"       } else {\n"
4322
 
"               frame $pw\n"
4323
 
"               set l $pw.l\n"
4324
 
"               label $l -text \"Password:\" -justify left -anchor w -font $bfont\n"
4325
 
"               pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
 
4589
"               lappend props_buttons $vp.e\n"
4326
4590
"       }\n"
4327
 
"       entry $pw.e -show \"*\" -textvariable props_passwd -font $bfont\n"
4328
 
"       pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
4329
4591
"\n"
4330
4592
"       if {! $icon_mode_at_startup} {\n"
4331
4593
"               $vp.e configure -state disabled\n"
4338
4600
"               catch {$pw configure -foreground grey60}\n"
4339
4601
"       }\n"
4340
4602
"\n"
4341
 
"       lappend props_buttons $pw.e\n"
 
4603
"       set sb \"$w.solid\"\n"
 
4604
"       frame $sb\n"
 
4605
"       checkbutton $sb.button -text \"Solid Background Color\" \\\n"
 
4606
"               -variable props_solid -anchor w -font $bfont\n"
 
4607
"       pack $sb.button -fill x -expand 1 -padx 1m -pady $pady\n"
 
4608
"\n"
 
4609
"       set jv \"$w.javaview\"\n"
 
4610
"       frame $jv\n"
 
4611
"       checkbutton $jv.button -text \"Serve Java Viewer Applet\" \\\n"
 
4612
"               -variable props_javaview -anchor w -font $bfont\n"
 
4613
"       pack $jv.button -fill x -expand 1 -padx 1m -pady $pady\n"
 
4614
"\n"
 
4615
"       set zc \"$w.zeroconf\"\n"
 
4616
"       frame $zc\n"
 
4617
"       checkbutton $zc.button -text \"Advertise Service (Zeroconf)\" \\\n"
 
4618
"               -variable props_zeroconf -anchor w -font $bfont\n"
 
4619
"       pack $zc.button -fill x -expand 1 -padx 1m -pady $pady\n"
4342
4620
"\n"
4343
4621
"       set sh \"$w.shared\"\n"
4344
4622
"       frame $sh\n"
4369
4647
"       pack $b2 -side bottom -fill x -pady $pady -padx $px\n"
4370
4648
"       pack $vp -side bottom -fill x -pady $pady -padx $px\n"
4371
4649
"       pack $pw -side bottom -fill x -pady $pady -padx $px\n"
 
4650
"       pack $sb -side bottom -fill x -pady 0m -padx $px\n"
 
4651
"       pack $jv -side bottom -fill x -pady 0m -padx $px\n"
 
4652
"       pack $zc -side bottom -fill x -pady 0m -padx $px\n"
4372
4653
"       pack $sh -side bottom -fill x -pady 0m -padx $px\n"
4373
4654
"       pack $vo -side bottom -fill x -pady 0m -padx $px\n"
4374
4655
"       pack $cf -side bottom -fill x -pady 0m -padx $px\n"
4375
4656
"       pack $ac -side bottom -fill x -pady 0m -padx $px\n"
4376
4657
"\n"
 
4658
"       global show_props_instructions\n"
 
4659
"       if {![info exists show_props_instructions]} {\n"
 
4660
"               set show_props_instructions 1\n"
 
4661
"       }\n"
 
4662
"\n"
 
4663
"       wm withdraw .props\n"
 
4664
"\n"
 
4665
"       set wl $w\n"
 
4666
"\n"
 
4667
"       pack $wl -side left\n"
 
4668
"\n"
4377
4669
"       if {$msg != \"\"} {\n"
4378
4670
"               set tw [textwidth $msg]\n"
4379
4671
"               set th [textheight $msg]\n"
4380
4672
"               set th [expr $th - 1]\n"
4381
 
"               set ms \"$w.msg\"\n"
 
4673
"               set ms \".props.msg\"\n"
4382
4674
"               text $ms -font $ffont -relief ridge -width $tw -height $th\n"
4383
4675
"               $ms insert 1.0 $msg\n"
4384
 
"               pack $ms -side bottom -fill x -pady $pady -padx $px\n"
 
4676
"\n"
 
4677
"               set si \"$wl.instructions\"\n"
 
4678
"               frame $si\n"
 
4679
"               checkbutton $si.button -text \"Show Instructions\" \\\n"
 
4680
"                       -variable show_props_instructions -anchor w -font $bfont \\\n"
 
4681
"                       -command \"toggle_instructions $ms $pady $px\"\n"
 
4682
"\n"
 
4683
"               pack $si.button -fill x -expand 1 -padx 1m -pady $pady\n"
 
4684
"               pack $si -side bottom -fill x -pady 0m -padx $px\n"
 
4685
"\n"
 
4686
"               if {$show_props_instructions} {\n"
 
4687
"                       pack $ms -side left -fill both\n"
 
4688
"               }\n"
 
4689
"\n"
4385
4690
"               update\n"
4386
4691
"       }\n"
4387
4692
"\n"
4388
 
"       lappend props_buttons $ac.button $cf.button $vo.button $sh.button\n"
4389
 
"\n"
 
4693
"\n"
 
4694
"       lappend props_buttons $ac.button $cf.button $vo.button $sh.button $zc.button $jv.button $sb.button\n"
 
4695
"\n"
 
4696
"       \n"
 
4697
"       set w .props\n"
 
4698
"       update\n"
4390
4699
"       wm resizable $w 1 0\n"
4391
4700
"       center_win $w\n"
4392
4701
"       update\n"
4393
 
"       wm minsize $w [winfo width $w] [winfo height $w]\n"
 
4702
"\n"
 
4703
"       #wm minsize $w [winfo width $w] [winfo height $w]\n"
4394
4704
"\n"
4395
4705
"       tkwait window $w\n"
 
4706
"       set show_props_instructions 0\n"
 
4707
"}\n"
 
4708
"\n"
 
4709
"proc toggle_instructions {ms pady px} {\n"
 
4710
"       global show_props_instructions\n"
 
4711
"       if {$show_props_instructions} {\n"
 
4712
"               pack $ms -side left -fill both\n"
 
4713
"       } else {\n"
 
4714
"               pack forget $ms\n"
 
4715
"       }\n"
 
4716
"       catch {pack .props}\n"
 
4717
"       update\n"
4396
4718
"}\n"
4397
4719
"\n"
4398
4720
"proc do_new_client {} {\n"
4541
4863
"proc read_client_info {channel} {\n"
4542
4864
"       global x11vnc_client_file client_str client_info_read\n"
4543
4865
"       global read_client_info_lock\n"
 
4866
"       global read_clients\n"
4544
4867
"       set db 0\n"
4545
4868
"\n"
 
4869
"       set read_clients 0\n"
 
4870
"\n"
4546
4871
"       if {![info exists read_client_info_lock]} {\n"
4547
4872
"               set read_client_info_lock 0\n"
4548
4873
"       }\n"
4574
4899
"                               ;\n"
4575
4900
"                       } elseif [regexp {^clients:} $str] {\n"
4576
4901
"                               regsub {^clients:} $str \"\" str\n"
 
4902
"                               set read_clients 1\n"
4577
4903
"                               if {$str == \"none\"} {\n"
4578
4904
"                                       set str \"\"\n"
4579
4905
"                               }\n"
4586
4912
"       }\n"
4587
4913
"}\n"
4588
4914
"\n"
 
4915
"proc check_set_vnc_display {} {\n"
 
4916
"       \n"
 
4917
"       global read_clients check_set_vnc_display_done\n"
 
4918
"\n"
 
4919
"       if {[info exists check_set_vnc_display_done]} {\n"
 
4920
"               return\n"
 
4921
"       }\n"
 
4922
"       if {[info exists read_clients]} {\n"
 
4923
"               if {$read_clients} {\n"
 
4924
"                       after 250\n"
 
4925
"                       query_all\n"
 
4926
"                       global client_str\n"
 
4927
"                       set_client_balloon $client_str\n"
 
4928
"                       set check_set_vnc_display_done 1\n"
 
4929
"               }\n"
 
4930
"       }\n"
 
4931
"}\n"
 
4932
"\n"
4589
4933
"proc read_client_tail {} {\n"
4590
4934
"       global client_tail\n"
4591
4935
"\n"
4592
4936
"       if {$client_tail != \"\"} {\n"
4593
4937
"               read_client_info $client_tail\n"
 
4938
"               check_set_vnc_display\n"
4594
4939
"       }\n"
4595
4940
"}\n"
4596
4941
"\n"
4599
4944
"\n"
4600
4945
"       if {$client_sock != \"\"} {\n"
4601
4946
"               read_client_info $client_sock\n"
 
4947
"               check_set_vnc_display\n"
4602
4948
"       }\n"
4603
4949
"}\n"
4604
4950
"\n"
4614
4960
"       if {$client_balloon == \"\"} {\n"
4615
4961
"               set client_balloon $noinfo\n"
4616
4962
"       }\n"
 
4963
"       if {! [info exists icon_win]} {\n"
 
4964
"               return\n"
 
4965
"       } elseif {$icon_win == \"\"} {\n"
 
4966
"               return\n"
 
4967
"       } elseif {! [winfo exists $icon_win]} {\n"
 
4968
"               return\n"
 
4969
"       }\n"
4617
4970
"\n"
4618
4971
"       set x [expr [winfo rootx $icon_win] + ([winfo width $icon_win]/2)]\n"
4619
4972
"       set y [expr [winfo rooty $icon_win] + [winfo height $icon_win] + 4]\n"
4662
5015
"proc icon_win_cfg {clients} {\n"
4663
5016
"       global icon_win client_tail client_sock client_info_read\n"
4664
5017
"\n"
4665
 
"       if {![info exists icon_win]} {\n"
4666
 
"               return\n"
4667
 
"       }\n"
4668
 
"       if {$icon_win == \"\"} {\n"
 
5018
"       if {! [info exists icon_win]} {\n"
 
5019
"               return\n"
 
5020
"       } elseif {$icon_win == \"\"} {\n"
 
5021
"               return\n"
 
5022
"       } elseif {! [winfo exists $icon_win]} {\n"
4669
5023
"               return\n"
4670
5024
"       }\n"
4671
5025
"       if {$clients > 0} {\n"
4825
5179
"       global icon_win\n"
4826
5180
"\n"
4827
5181
"       set lab [get_icon_label]\n"
 
5182
"\n"
 
5183
"       if {! [info exists icon_win]} {\n"
 
5184
"               return\n"
 
5185
"       } elseif {$icon_win == \"\"} {\n"
 
5186
"               return\n"
 
5187
"       } elseif {! [winfo exists $icon_win]} {\n"
 
5188
"               return\n"
 
5189
"       }\n"
4828
5190
"       \n"
4829
5191
"       if {[info exists icon_win]} {\n"
4830
5192
"               $icon_win configure -text $lab\n"
4839
5201
"       if {$icon_minimal} {\n"
4840
5202
"               set lab [get_vnc_display_number]\n"
4841
5203
"               if {$lab != \"none\"} {\n"
4842
 
"                       set lab \"  :$lab\"\n"
 
5204
"                       #set lab \"  :$lab\"\n"
 
5205
"                       set lab \":$lab\"\n"
 
5206
"               } else {\n"
 
5207
"                       set lab \"-\"\n"
4843
5208
"               }\n"
4844
5209
"       } else {\n"
4845
5210
"               set lab $lab0\n"
5014
5379
"       menu $menu -tearoff 0 -postcommand \"popup_post $menu\"\n"
5015
5380
"       $menu add command -font $mfont -label \"Properties\" -command do_props\n"
5016
5381
"       $menu add command -font $mfont -label \"Help\" -command \"menu_help Tray\"\n"
 
5382
"       $menu add command -font $mfont -label \"Logfile\" -command show_logfile\n"
5017
5383
"       $menu add separator\n"
5018
5384
"       $menu add command -font $mfont -label \"New Client\" -command do_new_client\n"
5019
5385
"\n"
5085
5451
"       wm title . \"tkx11vnc\"\n"
5086
5452
"       update\n"
5087
5453
"       if {$tray_embed && $tray_running} {\n"
5088
 
"               wm deiconify .\n"
 
5454
"               #wm deiconify .;   #  why did we have this???\n"
5089
5455
"               #after 10000 {wm deiconify .; puts \"reqheight [winfo reqheight .]\"; puts \"reqwidth  [winfo reqwidth  .]\"; puts \"height [winfo height .]\"; puts \"width  [winfo width  .]\"}\n"
5090
5456
"       } else {\n"
5091
5457
"               wm deiconify .\n"
5129
5495
"               textwin \"Warning\" \"Warning\" $m\n"
5130
5496
"               update\n"
5131
5497
"       }\n"
 
5498
"       dtime C\n"
5132
5499
"}\n"
5133
5500
"\n"
5134
5501
"proc clean_client_tail {} {\n"
5157
5524
"}\n"
5158
5525
"\n"
5159
5526
"proc make_gui {mode} {\n"
5160
 
"       global icon_mode tray_embed full_win icon_win\n"
 
5527
"       global icon_mode tray_embed tray_running full_win icon_win\n"
5161
5528
"       global top_widget_names x11vnc_gui_geom\n"
5162
5529
"       global gui_current_state make_gui_count\n"
5163
5530
"       global x11vnc_connect connected_to_x11vnc\n"
5237
5604
"\n"
5238
5605
"\n"
5239
5606
"       update\n"
5240
 
"       wm deiconify .\n"
 
5607
"       if {!$tray_embed || !$tray_running} {\n"
 
5608
"               wm deiconify .\n"
 
5609
"       }\n"
5241
5610
"       update idletasks\n"
5242
5611
"       wm minsize $w [winfo width $w] [winfo height $w]\n"
5243
5612
"       if {$mode == \"full\" && $make_gui_count > 1} {\n"
5616
5985
"                       continue\n"
5617
5986
"               } elseif {$item == \"rc\" || $item == \"norc\"} {\n"
5618
5987
"                       continue\n"
 
5988
"               } elseif {$item == \"loop\"} {\n"
 
5989
"                       continue\n"
 
5990
"               } elseif {$item == \"loopbg\"} {\n"
 
5991
"                       continue\n"
5619
5992
"               }\n"
5620
5993
"\n"
5621
5994
"               set def \"\"\n"
5623
5996
"                       set def $default_var($item)\n"
5624
5997
"               }\n"
5625
5998
"\n"
 
5999
"\n"
5626
6000
"               set qst \"\"\n"
5627
6001
"               set hmm \"#? \"\n"
5628
6002
"               if {$item == \"display\"} {\n"
5635
6009
"                       set qst $hmm\n"
5636
6010
"               } elseif {$item == \"nevershared\"} {\n"
5637
6011
"                       set qst $hmm\n"
 
6012
"               } elseif {$item == \"gui\"} {\n"
 
6013
"                       set qst $hmm\n"
5638
6014
"               }\n"
5639
6015
"\n"
5640
6016
"               if {![info exists menu_var($item)]} {\n"
5642
6018
"               } else {\n"
5643
6019
"                       set mv $menu_var($item)\n"
5644
6020
"               }\n"
 
6021
"#puts \"item=$item def=$def mv=$mv\"\n"
5645
6022
"               if {$mv == $unset_str} {\n"
5646
6023
"                       set mv \"\"\n"
5647
6024
"               }\n"
5971
6348
"               }\n"
5972
6349
"\n"
5973
6350
"               if {$db} {puts stderr \"run_remote_cmd_via_sock: $docmd \\\"$str\\\"\"}\n"
5974
 
"               puts $client_sock $str\n"
 
6351
"               catch {puts $client_sock $str}\n"
5975
6352
"               if {$db} {puts stderr \"run_remote_cmd_via_sock: flush\"}\n"
5976
 
"               flush $client_sock\n"
 
6353
"               catch {flush $client_sock}\n"
5977
6354
"               if {$db} {puts stderr \"run_remote_cmd_via_sock: gets\"}\n"
5978
 
"               gets $client_sock res\n"
 
6355
"               catch {gets $client_sock res}\n"
5979
6356
"               if {$db} {puts stderr \"run_remote_cmd_via_sock: \\\"$res\\\"\"}\n"
5980
6357
"               set res [string trim $res]\n"
5981
6358
"\n"
 
6359
"               if [regexp {=clients:} $res] {\n"
 
6360
"                       regsub {^.*=clients:} $res \"\" cres\n"
 
6361
"                       regsub {,aro=.*$} $cres \"\" cres\n"
 
6362
"                       regsub {,ans=.*$} $cres \"\" cres\n"
 
6363
"                       if {$cres == \"none\"} {\n"
 
6364
"                               set cres \"\"\n"
 
6365
"                       }\n"
 
6366
"                       update_clients_menu $cres\n"
 
6367
"                       set client_str $cres\n"
 
6368
"                       set_client_balloon $cres\n"
 
6369
"               }\n"
 
6370
"\n"
5982
6371
"               if [regexp {^clients:} $res] {\n"
5983
6372
"                       regsub {^clients:} $res \"\" tmp\n"
5984
6373
"                       if {$tmp == \"none\"} {\n"
6168
6557
"       return $menu_var(WindowView)\n"
6169
6558
"}\n"
6170
6559
"\n"
 
6560
"proc dono {a b c} {\n"
 
6561
"       exit 1;\n"
 
6562
"}\n"
 
6563
"\n"
 
6564
"proc do_port_prompt {} {\n"
 
6565
"       global bfont ffont\n"
 
6566
"       global port_reply port_set\n"
 
6567
"\n"
 
6568
"       set guess 5900\n"
 
6569
"       for {set i 0} {$i < 50} {incr i} {\n"
 
6570
"               set fh \"\"\n"
 
6571
"               set try [expr $guess + $i]\n"
 
6572
"               catch {set fh [socket -server dono $try]}\n"
 
6573
"               if {$fh != \"\"} {\n"
 
6574
"                       catch {close $fh}\n"
 
6575
"                       set guess $try\n"
 
6576
"                       break;\n"
 
6577
"               }\n"
 
6578
"       }\n"
 
6579
"       set hn \"\"\n"
 
6580
"       catch {set hn [exec uname -n]}\n"
 
6581
"       if {$hn == \"\"} {\n"
 
6582
"               set hn \"hostname\"\n"
 
6583
"       }\n"
 
6584
"\n"
 
6585
"       set text \" Set the x11vnc Listening Port:\n"
 
6586
"\n"
 
6587
"    VNC Display :0 corresponds to TCP port 5900\n"
 
6588
"    VNC Display :1 corresponds to TCP port 5901\n"
 
6589
"    etc.\n"
 
6590
"\n"
 
6591
" In the Entry below, indicate a Port for x11vnc to listen on. \n"
 
6592
"\n"
 
6593
" Note that to connect to x11vnc, a VNC Viewer will need to\n"
 
6594
" know your selection, for example:\n"
 
6595
"\n"
 
6596
"    vncviewer $hn:0\n"
 
6597
"    vncviewer $hn:1\n"
 
6598
"    etc.\n"
 
6599
"\n"
 
6600
" Your firewall may block incoming connections to TCP ports;\n"
 
6601
" if it does you may need to reconfigure it. \n"
 
6602
"    \n"
 
6603
" You can also set some additional parameters:\n"
 
6604
"\n"
 
6605
"    - Enable SSL encryption.\n"
 
6606
"      (requires an SSL enabled vncviewer, such as SSVNC)  \n"
 
6607
"    - Listen only on localhost. (e.g. for an SSH tunnel)\n"
 
6608
"    - Enable UltraVNC or TightVNC File transfer.\n"
 
6609
"\"\n"
 
6610
"       set port_set $guess\n"
 
6611
"       set port_reply \"\"\n"
 
6612
"\n"
 
6613
"       toplevel .pp\n"
 
6614
"       wm title .pp \"Select x11vnc port\"\n"
 
6615
"\n"
 
6616
"       wm protocol .   WM_DELETE_WINDOW \"destroy .; exit\"\n"
 
6617
"       wm protocol .pp WM_DELETE_WINDOW \"destroy .pp; exit\"\n"
 
6618
"\n"
 
6619
"       label .pp.m -text \"$text\" -relief ridge -justify left -font $ffont\n"
 
6620
"\n"
 
6621
"       global tk_version\n"
 
6622
"       set tkold 0\n"
 
6623
"       if [info exists tk_version] {\n"
 
6624
"               if [regexp {^8\\.[0-3]$} $tk_version] {\n"
 
6625
"                       set tkold 1\n"
 
6626
"               }\n"
 
6627
"               if [regexp {^[3-7]\\.} $tk_version] {\n"
 
6628
"                       set tkold 1\n"
 
6629
"               }\n"
 
6630
"       }\n"
 
6631
"\n"
 
6632
"       if {$tkold} {\n"
 
6633
"               frame .pp.f -bd 1 -relief ridge\n"
 
6634
"       } else {\n"
 
6635
"               frame .pp.f -bd 1 -relief ridge -pady 2\n"
 
6636
"       }\n"
 
6637
"       label .pp.f.l -text \"Port: \" -font $bfont\n"
 
6638
"       entry .pp.f.e -width 8 -textvariable port_set -font $ffont\n"
 
6639
"       global enable_ssl; set enable_ssl 0\n"
 
6640
"       if [info exists env(X11VNC_SSL_ENABLED)] {\n"
 
6641
"               set enable_ssl 1\n"
 
6642
"       }\n"
 
6643
"       checkbutton .pp.f.ssl -relief raised -pady 3 -padx 3 -text \"Enable SSL\" -variable enable_ssl -font $bfont\n"
 
6644
"       global localhost; set localhost 0\n"
 
6645
"       if [info exists env(X11VNC_LOCALHOST_ENABLED)] {\n"
 
6646
"               set localhost 1\n"
 
6647
"       }\n"
 
6648
"       checkbutton .pp.f.loc -relief raised -pady 3 -padx 3 -text \"Listen on localhost\" -variable localhost -font $bfont\n"
 
6649
"       pack .pp.f.l .pp.f.e -side left\n"
 
6650
"       pack .pp.f.loc .pp.f.ssl -side right\n"
 
6651
"\n"
 
6652
"       if {$tkold} {\n"
 
6653
"               frame .pp.t -bd 1 -relief ridge\n"
 
6654
"       } else {\n"
 
6655
"               frame .pp.t -bd 1 -relief ridge -pady 2\n"
 
6656
"       }\n"
 
6657
"       global file_transfer; set file_transfer \"none\"\n"
 
6658
"       if [info exists env(X11VNC_FILETRANSFER_ENABLED)] {\n"
 
6659
"               set file_transfer $env(X11VNC_FILETRANSFER_ENABLED)\n"
 
6660
"       }\n"
 
6661
"       label .pp.t.l -text \"File Transfer: \" -font $bfont\n"
 
6662
"       radiobutton .pp.t.none  -text \"None\" -variable file_transfer -value \"none\" -font $bfont\n"
 
6663
"       radiobutton .pp.t.ultra -text \"UltraVNC\" -variable file_transfer -value \"ultra\" -font $bfont\n"
 
6664
"       radiobutton .pp.t.tight -text \"TightVNC\" -variable file_transfer -value \"tight\" -font $bfont\n"
 
6665
"       pack .pp.t.l .pp.t.none .pp.t.ultra .pp.t.tight -side left\n"
 
6666
"\n"
 
6667
"       frame .pp.o -bd 1 -relief ridge\n"
 
6668
"       button .pp.o.ok -text \"OK\" -command \"set port_reply 1; destroy .pp\" -font $bfont\n"
 
6669
"       button .pp.o.cancel -text \"Cancel\" -command \"set port_reply 0; destroy .pp\" -font $bfont\n"
 
6670
"       pack .pp.o.ok .pp.o.cancel -side left -fill x -expand 1\n"
 
6671
"       pack .pp.m -side top -fill x -expand 1 \n"
 
6672
"       pack .pp.f .pp.t .pp.o -side top -fill x\n"
 
6673
"\n"
 
6674
"       focus .pp.f.e\n"
 
6675
"       .pp.f.e icursor end\n"
 
6676
"\n"
 
6677
"       wm withdraw .pp\n"
 
6678
"       update\n"
 
6679
"       center_win .pp\n"
 
6680
"\n"
 
6681
"       wm minsize .pp [winfo width .pp] [winfo height .pp]\n"
 
6682
"\n"
 
6683
"       bind .pp.f.e <KeyPress-Return> \"set port_reply 1; destroy .pp\"\n"
 
6684
"\n"
 
6685
"       vwait port_reply\n"
 
6686
"\n"
 
6687
"       if {$port_reply} {\n"
 
6688
"               regsub -all {^:} $port_set \"\" port_set\n"
 
6689
"               regsub -all {[ \\t]} $port_set \"\" port_set\n"
 
6690
"               if {[regexp {^[0-9][0-9]*$} $port_set]} {\n"
 
6691
"                       if {$port_set < 0} {\n"
 
6692
"                               set port_set [expr 0 - $port_set]\n"
 
6693
"                       } elseif {$port_set < 200} {\n"
 
6694
"                               set port_set [expr $port_set + 5900]\n"
 
6695
"                       } \n"
 
6696
"                       puts \"$port_set:ssl${enable_ssl}:localhost$localhost:ft_$file_transfer\"\n"
 
6697
"               }\n"
 
6698
"       }\n"
 
6699
"}\n"
 
6700
"\n"
6171
6701
"proc change_view_state {} {\n"
6172
6702
"       global menu_var gui_current_state\n"
6173
6703
"\n"
6198
6728
"                       exit\n"
6199
6729
"               }\n"
6200
6730
"               make_gui $new\n"
 
6731
"               if {$new == \"tray\"} {\n"
 
6732
"                       wm withdraw .\n"
 
6733
"               }\n"
6201
6734
"       } else {\n"
6202
6735
"               set_view_variable $old\n"
6203
6736
"       }\n"
6222
6755
"}\n"
6223
6756
"\n"
6224
6757
"proc setup_tray_embed {} {\n"
6225
 
"       global icon_win\n"
6226
6758
"       update\n"
6227
6759
"       set w [winfo width .]\n"
6228
6760
"       set h [winfo height .]\n"
6277
6809
"               exit 1;\n"
6278
6810
"       }\n"
6279
6811
"       set tmp \"/tmp/x11vnc[pid]\"\n"
6280
 
"       file delete -force $tmp\n"
6281
 
"       if {[file exists $tmp]} {\n"
6282
 
"               puts stderr \"failure in restart_everything.\"\n"
6283
 
"               exit 1;\n"
 
6812
"       append tmp [clock clicks]\n"
 
6813
"       set tmp2 \"\"\n"
 
6814
"       catch {set tmp2 [exec mktemp $tmp.XXXXXX 2>/dev/null]}\n"
 
6815
"       if {$tmp2 != \"\" && [file exists $tmp2]} {\n"
 
6816
"               set tmp $tmp2\n"
 
6817
"       } else {\n"
 
6818
"               file delete -force $tmp\n"
 
6819
"               if {[file exists $tmp]} {\n"
 
6820
"                       puts stderr \"failure in restart_everything.\"\n"
 
6821
"                       exit 1;\n"
 
6822
"               }\n"
6284
6823
"       }\n"
6285
6824
"       set fh [open $tmp \"a\"]\n"
6286
6825
"       if {![file owned $tmp]}  {\n"
6306
6845
"}\n"
6307
6846
"\n"
6308
6847
"proc undo_tray_embed {} {\n"
6309
 
"       global icon_win\n"
6310
6848
"       set wid [winfo id .]    \n"
6311
6849
"       push_new_value \"remote-cmd\" \"remote-cmd\" \"trayunembed:$wid\" 0\n"
6312
6850
"}\n"
6334
6872
"global connected_to_x11vnc\n"
6335
6873
"global cache_all_query_vars\n"
6336
6874
"global last_query_all_time query_all_freq client_tail client_sock client_info_read\n"
6337
 
"global icon_mode icon_mode_at_startup\n"
 
6875
"global icon_mode icon_mode_at_startup x11vnc_icon_mode\n"
6338
6876
"global tray_embed tray_running icon_setpasswd icon_embed_id\n"
6339
6877
"global icon_noadvanced icon_minimal\n"
6340
6878
"global make_gui_count text_area_str\n"
6353
6891
"set snfont \"-adobe-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*\"\n"
6354
6892
"set ffont \"fixed\"\n"
6355
6893
"\n"
 
6894
"set got_helv 0\n"
 
6895
"catch {\n"
 
6896
"       foreach fam [font families]  {\n"
 
6897
"               if {$fam == \"helvetica\"} {\n"
 
6898
"                       set got_helv 1\n"
 
6899
"               }\n"
 
6900
"               if {$fam == \"Helvetica\"} {\n"
 
6901
"                       set got_helv 1\n"
 
6902
"               }\n"
 
6903
"       }\n"
 
6904
"}\n"
 
6905
"\n"
 
6906
"if {$got_helv} {\n"
 
6907
"       set bfont  \"Helvetica -12 bold\"\n"
 
6908
"       set sfont  \"Helvetica -10 bold\"\n"
 
6909
"       set snfont \"Helvetica -10\"\n"
 
6910
"}\n"
 
6911
"\n"
6356
6912
"set ls \"\"\n"
6357
6913
"catch {set ls [font metrics $bfont -linespace]}\n"
6358
 
"if {$ls != \"\"} {\n"
6359
 
"    if {$ls > 14} {\n"
6360
 
"       # some recent setups have BIG rendering for the above fonts:\n"
 
6914
"if {$ls != \"\" && $ls > 14} {\n"
 
6915
"       # some recent setups have BIG rendering for the above fonts.\n"
 
6916
"       # on recent (8/08) debian these are really ragged:\n"
6361
6917
"       set bfont \"-adobe-helvetica-bold-r-*-*-*-90-*-*-*-*-*-*\"\n"
6362
6918
"       set sfont \"-adobe-helvetica-bold-r-*-*-*-75-*-*-*-*-*-*\"\n"
6363
6919
"       set snfont \"-adobe-helvetica-medium-r-*-*-*-75-*-*-*-*-*-*\"\n"
6364
 
"    }\n"
6365
 
"}\n"
 
6920
"\n"
 
6921
"       set ls \"\"\n"
 
6922
"       catch {set ls [font metrics $bfont -linespace]}\n"
 
6923
"       if {$ls != \"\" && $ls < 14} {\n"
 
6924
"               # these are bigger but look better... but for how long?\n"
 
6925
"               set bfont \"-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*\"\n"
 
6926
"               set sfont \"-adobe-helvetica-bold-r-*-*-*-80-*-*-*-*-*-*\"\n"
 
6927
"               set snfont \"-adobe-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*\"\n"
 
6928
"\n"
 
6929
"               # maybe consider... {-font font Font {Helvetica -12 bold} {Helvetica -12 bold}}\n"
 
6930
"               # or stick with system font like ssvnc.\n"
 
6931
"       }\n"
 
6932
"}\n"
 
6933
"\n"
 
6934
"# need to check if \"fixed\" font under XFT on tk8.5 is actually fixed width!!\n"
 
6935
"set ls \"\"\n"
 
6936
"catch {set ls [font metrics $ffont -linespace]}\n"
 
6937
"set fs \"\"\n"
 
6938
"catch {set fs [font metrics $ffont -fixed]}\n"
 
6939
"set redo 0\n"
 
6940
"if {$fs != \"\" && $fs != \"1\"} {\n"
 
6941
"       set redo 1\n"
 
6942
"}\n"
 
6943
"if {$ls != \"\" && $ls > 14} {\n"
 
6944
"       set redo 1\n"
 
6945
"}\n"
 
6946
"if {$redo} {\n"
 
6947
"       foreach fn [font names] {\n"
 
6948
"               if {$fn == \"TkFixedFont\"} {\n"
 
6949
"                       set ffont $fn\n"
 
6950
"                       break\n"
 
6951
"               }\n"
 
6952
"       }\n"
 
6953
"}\n"
 
6954
"\n"
6366
6955
"set help_indent 24;\n"
6367
6956
"set reply_xdisplay \"\"\n"
6368
6957
"set all_settings \"None so far.\"\n"
6396
6985
"\n"
6397
6986
"set screen_height [winfo screenheight .]\n"
6398
6987
"set screen_width  [winfo screenwidth  .]\n"
6399
 
"if {$screen_height < 500} {\n"
6400
 
"       # short screen, PDA?\n"
6401
 
"       set max_text_height 22\n"
6402
 
"       set text_height 13\n"
6403
 
"       if {$screen_height <= 360} {\n"
6404
 
"               # very short.\n"
6405
 
"               set max_text_height 16\n"
6406
 
"               set max_text_width  60\n"
6407
 
"               set text_height 11\n"
 
6988
"if {$screen_height < 700} {\n"
 
6989
"       # short screen, netbook?\n"
 
6990
"       set max_text_height 30\n"
 
6991
"       if {$screen_height < 500} {\n"
 
6992
"               # short screen, PDA?\n"
 
6993
"               set max_text_height 22\n"
 
6994
"               set text_height 13\n"
 
6995
"               if {$screen_height <= 360} {\n"
 
6996
"                       # very short.\n"
 
6997
"                       set max_text_height 16\n"
 
6998
"                       set max_text_width  60\n"
 
6999
"                       set text_height 11\n"
 
7000
"               }\n"
6408
7001
"       }\n"
6409
7002
"}\n"
6410
7003
"if {[info exists env(X11VNC_GUI_TEXT_HEIGHT)]} {\n"
6441
7034
"       exit 0\n"
6442
7035
"}\n"
6443
7036
"\n"
6444
 
"\n"
6445
7037
"set_view_variable \"full\"\n"
6446
7038
"\n"
6447
7039
"#puts [exec env | grep X11VNC]\n"
6499
7091
"       set x11vnc_gui_params \"\"\n"
6500
7092
"}\n"
6501
7093
"\n"
 
7094
"if {[info exists env(X11VNC_FONT_BOLD)]} {\n"
 
7095
"       set bfont $env(X11VNC_FONT_BOLD)\n"
 
7096
"}\n"
 
7097
"if {[info exists env(X11VNC_FONT_BOLD_SMALL)]} {\n"
 
7098
"       set sfont $env(X11VNC_FONT_BOLD_SMALL)\n"
 
7099
"}\n"
 
7100
"if {[info exists env(X11VNC_FONT_REG_SMALL)]} {\n"
 
7101
"       set snfont $env(X11VNC_FONT_REG_SMALL)\n"
 
7102
"}\n"
 
7103
"if {[info exists env(X11VNC_FONT_FIXED)]} {\n"
 
7104
"       set ffont $env(X11VNC_FONT_FIXED)\n"
 
7105
"}\n"
 
7106
"\n"
6502
7107
"if {[info exists env(X11VNC_CONNECT_FILE)]} {\n"
6503
7108
"       set x11vnc_connect_file $env(X11VNC_CONNECT_FILE);\n"
6504
7109
"} else {\n"
6541
7146
"}\n"
6542
7147
"\n"
6543
7148
"set icon_mode 0\n"
 
7149
"set x11vnc_icon_mode 0\n"
6544
7150
"set tray_embed 0\n"
6545
7151
"set tray_running 0\n"
6546
7152
"\n"
6608
7214
"       set bfont {system}\n"
6609
7215
"}\n"
6610
7216
"\n"
 
7217
"if {\"$argv\" == \"-portprompt\"} {\n"
 
7218
"       do_port_prompt\n"
 
7219
"       exit 0\n"
 
7220
"}\n"
 
7221
"\n"
6611
7222
"#puts [exec env]\n"
6612
7223
"#puts \"x11vnc_xdisplay: $x11vnc_xdisplay\"\n"
6613
7224
"\n"
6638
7249
"dtime D\n"
6639
7250
"\n"
6640
7251
"proc check_setpasswd {} {\n"
6641
 
"       global icon_setpasswd\n"
 
7252
"       global env icon_setpasswd\n"
 
7253
"       global do_props_msg\n"
 
7254
"       set do_props_msg \"\"\n"
6642
7255
"       if {$icon_setpasswd} {\n"
6643
 
"               set m \"You must specify a Session Password\\n\" \n"
6644
 
"               set m \"${m}before VNC clients can connect.\\n\" \n"
6645
 
"               set m \"${m}Enter one in the Password field\\n\" \n"
6646
 
"               set m \"${m}and Press \\\"OK\\\". The password(s) is\\n\" \n"
6647
 
"               set m \"${m}only for this x11vnc session.\\n\" \n"
6648
 
"               do_props $m\n"
6649
 
"               #push_new_value \"unlock\" \"unlock\" 1 0\n"
 
7256
"               set m \"\\n\"\n"
 
7257
"               set m \"${m} Note the x11vnc icon in the system tray.\\n\" \n"
 
7258
"               set m \"${m} This panel is its 'Properties' dialog.\\n\" \n"
 
7259
"               set m \"${m}\\n\" \n"
 
7260
"               set m \"${m} To specify a Session Password and to\\n\" \n"
 
7261
"               set m \"${m} allow VNC viewers to connect, follow\\n\" \n"
 
7262
"               set m \"${m} these steps:\\n\" \n"
 
7263
"               set m \"${m}\\n\" \n"
 
7264
"               set m \"${m} Enter a passwd in the Password field\\n\" \n"
 
7265
"               set m \"${m} (it can be left blank.)  You can also\\n\" \n"
 
7266
"               set m \"${m} supply a ViewOnly passwd if desired.\\n\" \n"
 
7267
"               set m \"${m}\\n\" \n"
 
7268
"               set m \"${m} Set 'Accept Connections' and then Press \\n\" \n"
 
7269
"               set m \"${m} 'Apply' to allow incoming connections.\\n\" \n"
 
7270
"               set m \"${m}\\n\" \n"
 
7271
"               set m \"${m} No Viewer can connect until you do this.\\n\" \n"
 
7272
"               set m \"${m}\\n\" \n"
 
7273
"               set m \"${m} The passwords are only for this x11vnc\\n\" \n"
 
7274
"               set m \"${m} session and are not saved.  Run x11vnc\\n\" \n"
 
7275
"               set m \"${m} manually for more control (e.g. -rfbauth \\n\" \n"
 
7276
"               set m \"${m} for a saved password.)\\n\" \n"
 
7277
"               set m \"${m}\\n\" \n"
 
7278
"               set m \"${m} See 'Help' for details on each option.\\n\" \n"
 
7279
"\n"
 
7280
"               global x11vnc_cmdline\n"
 
7281
"\n"
 
7282
"               set dossl 0\n"
 
7283
"               if {[info exists x11vnc_cmdline]} {\n"
 
7284
"                       if [regexp -- {-ssl} $x11vnc_cmdline] {\n"
 
7285
"                               set dossl 1\n"
 
7286
"                       }\n"
 
7287
"               }\n"
 
7288
"               if {$dossl || [info exists env(X11VNC_GOT_SSL)]} {\n"
 
7289
"                       set m \"${m}\\n\" \n"
 
7290
"                       set m \"${m} SSL encryption mode active.  You can\\n\" \n"
 
7291
"                       set m \"${m} find your Public Cert in the Logfile\\n\" \n"
 
7292
"                       set m \"${m} and also the ~/.vnc/certs directory.\\n\" \n"
 
7293
"               }\n"
 
7294
"\n"
 
7295
"               if {[info exists env(X11VNC_SETPASS_FAIL)]} {\n"
 
7296
"                       set pp 5900\n"
 
7297
"                       if {[info exists env(X11VNC_GOT_RFBPORT_VAL)]} {\n"
 
7298
"                               if {$env(X11VNC_GOT_RFBPORT_VAL) > 0} {\n"
 
7299
"                                       set pp $env(X11VNC_GOT_RFBPORT_VAL)\n"
 
7300
"                               }\n"
 
7301
"                       }\n"
 
7302
"                       \n"
 
7303
"                       set m     \" The x11vnc program failed to start! \\n\"\n"
 
7304
"                       set m \"${m}\\n\" \n"
 
7305
"                       set m \"${m} Maybe there is another VNC server\\n\"\n"
 
7306
"                       set m \"${m} already listening on port $pp?\\n\"\n"
 
7307
"                       set m \"${m}\\n\" \n"
 
7308
"                       set m \"${m} You will need to start over after\\n\"\n"
 
7309
"                       set m \"${m} you make sure x11vnc can start.\\n\"\n"
 
7310
"               }\n"
 
7311
"               \n"
 
7312
"               set do_props_msg $m\n"
 
7313
"               do_props\n"
6650
7314
"       }\n"
6651
7315
"}\n"
6652
7316
"\n"
6671
7335
"       dtime G\n"
6672
7336
"       old_balloon\n"
6673
7337
"       check_setpasswd\n"
 
7338
"       push_new_value \"remote-cmd\" \"remote-cmd\" \"Q:clients\" 1\n"
6674
7339
"} else {\n"
6675
7340
"       make_gui \"full\"\n"
6676
7341
"       dtime G\n"