~ubuntu-branches/ubuntu/raring/lmms/raring-proposed

« back to all changes in this revision

Viewing changes to plugins/zynaddsubfx/fltk/src/Fl_Input_.cxx

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_Input_.cxx 7672 2010-07-10 09:44:45Z matt $"
 
2
// "$Id: Fl_Input_.cxx 8413 2011-02-11 16:37:06Z manolo $"
3
3
//
4
4
// Common input widget routines for the Fast Light Tool Kit (FLTK).
5
5
//
6
 
// Copyright 1998-2009 by Bill Spitzak and others.
 
6
// Copyright 1998-2010 by Bill Spitzak and others.
7
7
//
8
8
// This library is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU Library General Public
37
37
#include <ctype.h>
38
38
 
39
39
#define MAXBUF 1024
 
40
#if defined(USE_X11) && !USE_XFT
 
41
const int secret_char = '*'; // asterisk to hide secret input
 
42
#else
 
43
const int secret_char = 0x2022; // bullet to hide secret input
 
44
#endif
 
45
static int l_secret;
40
46
 
41
47
extern void fl_draw(const char*, int, float, float);
42
48
 
67
73
 
68
74
  if (input_type()==FL_SECRET_INPUT) {
69
75
    while (o<e && p < value_+size_) {
70
 
      if (fl_utf8len((char)p[0]) >= 1) *o++ = '*';
 
76
      if (fl_utf8len((char)p[0]) >= 1) {
 
77
        l_secret = fl_utf8encode(secret_char, o);
 
78
        o += l_secret;
 
79
      }
71
80
      p++;
72
81
    }
73
82
 
124
133
) const {
125
134
  int n = 0;
126
135
  int chr = 0;
 
136
  int l;
127
137
  if (input_type()==FL_SECRET_INPUT) {
128
138
    while (p<e) {
129
 
      if (fl_utf8len((char)p[0]) >= 1) n++;
130
 
      p++;
 
139
      l = fl_utf8len((char)p[0]);
 
140
      if (l >= 1) n += l_secret;
 
141
      p += l;
131
142
    }
132
143
  } else while (p<e) {
133
144
    int c = *p & 255;
358
369
    if (Fl::focus() == this && selstart == selend &&
359
370
        position() >= p-value() && position() <= e-value()) {
360
371
      fl_color(cursor_color());
 
372
      // cursor position may need to be recomputed (see STR #2486)
 
373
      curx = int(expandpos(p, value()+position(), buf, 0)+.5);
361
374
      if (readonly()) {
362
375
        fl_line((int)(xpos+curx-2.5f), Y+ypos+height-1,
363
376
                (int)(xpos+curx+0.5f), Y+ypos+height-4,
844
857
*/
845
858
int Fl_Input_::undo() {
846
859
  was_up_down = 0;
847
 
  if (undowidget != this || !undocut && !undoinsert) return 0;
 
860
  if ( undowidget != this || (!undocut && !undoinsert) ) return 0;
848
861
 
849
862
  int ilen = undocut;
850
863
  int xlen = undoinsert;
1057
1070
  maximum_size_ = 32767;
1058
1071
  shortcut_ = 0;
1059
1072
  set_flag(SHORTCUT_LABEL);
 
1073
  tab_nav(1);
1060
1074
}
1061
1075
 
1062
1076
/**
1254
1268
}
1255
1269
 
1256
1270
//
1257
 
// End of "$Id: Fl_Input_.cxx 7672 2010-07-10 09:44:45Z matt $".
 
1271
// End of "$Id: Fl_Input_.cxx 8413 2011-02-11 16:37:06Z manolo $".
1258
1272
//