~ubuntu-branches/ubuntu/saucy/bochs/saucy-proposed

« back to all changes in this revision

Viewing changes to gui/rfb.cc

  • Committer: Bazaar Package Importer
  • Author(s): David Futcher
  • Date: 2009-04-30 07:46:11 UTC
  • mfrom: (1.1.11 upstream) (4.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090430074611-6dih80a5mk2uvxhk
Tags: 2.3.7+20090416-1ubuntu1
* Merge from debian unstable (LP: #370427), remaining changes:
  - debian/patches/12_no-ssp.patch: Build bios with -fno-stack-protector
  - Add Replaces/Conflicts for bochsbios-qemu (<< 2.3.6-2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/////////////////////////////////////////////////////////////////////////
2
 
// $Id: rfb.cc,v 1.58 2008/04/07 20:20:04 sshwarts Exp $
 
2
// $Id: rfb.cc,v 1.63 2009/02/08 09:05:52 vruppert Exp $
3
3
/////////////////////////////////////////////////////////////////////////
4
4
//
5
5
//  Copyright (C) 2000  Psyon.Org!
19
19
//
20
20
//  You should have received a copy of the GNU Lesser General Public
21
21
//  License along with this library; if not, write to the Free Software
22
 
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
22
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
23
23
 
24
24
// RFB still to do :
25
25
// - properly handle SetPixelFormat, including big/little-endian flag
51
51
  DECLARE_GUI_VIRTUAL_METHODS()
52
52
  DECLARE_GUI_NEW_VIRTUAL_METHODS()
53
53
  void get_capabilities(Bit16u *xres, Bit16u *yres, Bit16u *bpp);
54
 
  void statusbar_setitem(int element, bx_bool active);
 
54
  void statusbar_setitem(int element, bx_bool active, bx_bool w=0);
55
55
#if BX_SHOW_IPS
56
56
  void show_ips(Bit32u ips_count);
57
57
#endif
58
58
};
59
59
 
 
60
void rfbSetStatusText(int element, const char *text, bx_bool active, bx_bool w=0);
 
61
 
60
62
// declare one instance of the gui object and call macro to insert the
61
63
// plugin code
62
64
static bx_rfb_gui_c *theGui = NULL;
288
290
  dialog_caps = 0;
289
291
}
290
292
 
291
 
void rfbSetStatusText(int element, const char *text, bx_bool active)
 
293
void rfbSetStatusText(int element, const char *text, bx_bool active, bx_bool w)
292
294
{
293
295
  char *newBits;
294
296
  unsigned xleft, xsize, color, i, len;
302
304
    newBits[((xsize / 8) + 1) * i] = 0;
303
305
  }
304
306
  if (element > 0) {
305
 
    color = active?0xa0:0xf7;
 
307
    color = active?(w?0xc0:0xa0):0xf7;
306
308
  } else {
307
309
    color = 0xf0;
308
310
  }
320
322
  rfbUpdateRegion.updated = true;
321
323
}
322
324
 
323
 
void bx_rfb_gui_c::statusbar_setitem(int element, bx_bool active)
 
325
void bx_rfb_gui_c::statusbar_setitem(int element, bx_bool active, bx_bool w)
324
326
{
325
327
  if (element < 0) {
326
328
    for (unsigned i = 0; i < statusitem_count; i++) {
327
 
      rfbSetStatusText(i+1, statusitem_text[i], active);
 
329
      rfbSetStatusText(i+1, statusitem_text[i], active, w);
328
330
    }
329
331
  } else if ((unsigned)element < statusitem_count) {
330
 
    rfbSetStatusText(element+1, statusitem_text[element], active);
 
332
    rfbSetStatusText(element+1, statusitem_text[element], active, w);
331
333
  }
332
334
}
333
335
 
843
845
  info->green_mask = 0x38;
844
846
  info->blue_mask = 0xc0;
845
847
  info->is_indexed = 0;
 
848
#ifdef BX_LITTLE_ENDIAN
846
849
  info->is_little_endian = 1;
 
850
#else
 
851
  info->is_little_endian = 0;
 
852
#endif
847
853
 
848
854
  return info;
849
855
}