~ubuntu-branches/ubuntu/quantal/terminal.app/quantal

« back to all changes in this revision

Viewing changes to TerminalParser_Linux.m

  • Committer: Package Import Robot
  • Author(s): Yavor Doganov
  • Date: 2012-06-14 13:55:31 UTC
  • mfrom: (4.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120614135531-xbagikvsm7nmcq25
Tags: 0.9.8-1
* New upstream release:
  + Fixes FTBFS with ld that defaults to --as-needed (Closes: #639040).
* TerminalParser_LinuxPrefs.m:
* TerminalView.m (-initWithFrame:):
* TerminalViewPrefs.m:
* ServicesPrefs.m: Revert all direct modifications.
* debian/control (Maintainer, Uploaders): Make the team maintainer, add
  myself.
  (Section): Change to `gnustep'.
  (Build-Depends): Require debhelper >= 8.  Remove version requirement
  for libgnustep-gui-dev.  Add dpkg-dev (>= 1.16.1~) and imagemagick.
  Drop gnustep-make.
  (Homepage): Point to the new location.
  (Vcs-Git, Vcs-Browser): New fields.
  (Conflicts, Replaces): Remove, no longer needed.
  (Depends): Add ${misc:Depends}.
  (Standards-Version): Claim compliance with 3.9.3 as of this release.
* debian/compat: Bump to 8.
* debian/rules: Get rid of gs_make.  Enable hardening, verbose builds,
  support for `noopt'.
  (d_app): New convenience variable.
  (build-stamp): Convert the app icon in XPM format.
  (clean): Delete the generated icon.
  (install): Replace the deprecated `dh_clean -k' with dh_prep.  Don't
  install lintian overrides.  Install the XPM icon.
  (binary-arch): Remove unnecessary arguments to dh_installman and
  dh_shlibdeps.  Move arch-independent Resources to /usr/share.
* debian/source/format: New file; set format to 3.0 (quilt).
* debian/overrides: Delete.
* debian/prerm: Don't ignore errors.
* debian/preinst:
* debian/watch: New file.
* debian/menu: Add icon.
* debian/Terminal.desktop: Make it valid.  Add Bulgarian translation.
* debian/Terminal.1: Fix errors from man.  Update homepage.
* debian/docs: Delete; duplicated by the manpage.
* debian/copyright: Switch to format 1.0, update copyright years, add
  many copyright holders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
copyright 2002, 2003 Alexander Malmberg <alexander@malmberg.org>
 
3
2009-2011 GAP Project
3
4
 
4
5
This file is a part of Terminal.app. Terminal.app is free software; you
5
6
can redistribute it and/or modify it under the terms of the GNU General
16
17
 */
17
18
 
18
19
 
19
 
#include <Foundation/NSString.h>
20
 
#include <Foundation/NSDebug.h>
21
 
#include <AppKit/NSGraphics.h>
 
20
#import <Foundation/NSString.h>
 
21
#import <Foundation/NSDebug.h>
 
22
#import <Foundation/NSNotification.h>
 
23
#import <AppKit/NSGraphics.h>
22
24
 
23
25
#include <netinet/in.h>
24
26
 
25
27
/* TODO */
26
 
#include "TerminalViewPrefs.h"
27
 
#include <AppKit/NSEvent.h>
28
 
 
29
 
#include "TerminalParser_Linux.h"
30
 
 
31
 
#include "TerminalParser_LinuxPrefs.h"
 
28
#import "TerminalViewPrefs.h"
 
29
#import <AppKit/NSEvent.h>
 
30
 
 
31
#import "TerminalParser_Linux.h"
 
32
 
 
33
#import "TerminalParser_LinuxPrefs.h"
32
34
 
33
35
 
34
36
#include "charmaps.h"
684
686
        case 127:
685
687
//              del(currcons);
686
688
                return;
687
 
        case 128+27:
688
 
                vc_state = ESsquare;
689
 
                return;
 
689
        case 128+27:                    // This kills UTF-8 unless we do some funky stuff
 
690
                if (!utf_count) {
 
691
                        vc_state = ESsquare;
 
692
                        return;
 
693
                }
690
694
        }
691
695
        switch(vc_state) {
692
696
        case ESesc:
1118
1122
                        screen_char_t ch;
1119
1123
 
1120
1124
                        char *inp;
1121
 
                        int in_size;
 
1125
                        size_t in_size;
1122
1126
                        char *outp;
1123
 
                        int out_size;
 
1127
                        size_t out_size;
1124
1128
                        int char_width;
1125
1129
 
1126
1130
                        int ret;
1147
1151
                        {
1148
1152
                                outp=(char *)&unich;
1149
1153
                                out_size=4;
 
1154
                                utf_count=0;    // reset the non-internal utf count
1150
1155
 
1151
 
                                ret=iconv(iconv_state,&inp,&in_size,&outp,&out_size);
 
1156
                                ret=iconv(iconv_state,(char **)&inp,&in_size,&outp,&out_size);
1152
1157
 
1153
1158
                                if (out_size==0)
1154
1159
                                {
1168
1173
 
1169
1174
                                if (errno==EINVAL)
1170
1175
                                { /* incomplete input sequence. wait for more input. */
 
1176
                                        utf_count=1;    // FIXME: is this the right thing to do?
1171
1177
                                        break;
1172
1178
                                }
1173
1179
 
1211
1217
        if (iconv_input_state)
1212
1218
        {
1213
1219
                unsigned int *inp;
1214
 
                int insize;
 
1220
                size_t insize;
1215
1221
                char *outp;
1216
1222
                char buf[16+1];
1217
 
                int outsize;
1218
 
                int ret;
 
1223
                size_t outsize;
1219
1224
        
1220
1225
                for (i=0;i<l;i++)
1221
1226
                {
1228
1233
                        insize=4;
1229
1234
                        outsize=sizeof(buf);
1230
1235
                        outp=buf;
1231
 
                        ret=iconv(iconv_input_state,(char **)&inp,&insize,&outp,&outsize);
 
1236
                        iconv(iconv_input_state,(char **)&inp,&insize,&outp,&outsize);
1232
1237
                        if (outsize!=sizeof(buf))
1233
1238
                        {
1234
1239
                                [ts ts_sendCString: buf  length: sizeof(buf)-outsize];
1247
1252
                        if (ucs<256)
1248
1253
                        {
1249
1254
                                buf=ucs;
1250
 
                                [ts ts_sendCString: &buf  length: 1];
 
1255
                                [ts ts_sendCString: (char *)&buf  length: 1];
1251
1256
                        }
1252
1257
                        else
1253
1258
                                NSBeep();
1337
1342
 
1338
1343
        {
1339
1344
                BOOL commandAsMeta=[TerminalViewKeyboardPrefs commandAsMeta];
 
1345
                BOOL altIsNotMeta =[TerminalViewKeyboardPrefs altIsNotMeta];
1340
1346
 
1341
1347
                /*
1342
1348
                Thanks to different keyboard layouts and dumb default key handling
1351
1357
                left alt to be meta, and, if right alt is AltGr, right alt not to be
1352
1358
                meta. Thus, when command-as-meta option is active, we intercept
1353
1359
                command presses and treat them as meta, and we ignore alternate.
 
1360
 
 
1361
                altIsNotMeta is needed to keep Alt as Alt and not as Meta.
1354
1362
                
1355
1363
                */
1356
1364
 
1357
1365
                if ((commandAsMeta && (mask&NSCommandKeyMask)) ||
1358
 
                    (!commandAsMeta && (mask&NSAlternateKeyMask)))
 
1366
                    (!commandAsMeta && !altIsNotMeta && (mask&NSAlternateKeyMask)))
1359
1367
                {
1360
1368
                        NSDebugLLog(@"key",@"  meta");
1361
1369
                        [ts ts_sendCString: "\e"];
1382
1390
                unsigned char tmp;
1383
1391
                tmp=ch2;
1384
1392
                NSDebugLLog(@"key",@"  send %02x",ch2);
1385
 
                [ts ts_sendCString: &tmp  length: 1];
 
1393
                [ts ts_sendCString: (char *)&tmp  length: 1];
1386
1394
        }
1387
1395
}
1388
1396