An implementation of different mouse cursors for BeOS.

r=mozilla@switkin.com
This commit is contained in:
arougthopher%lizardland.net 2002-02-08 03:26:58 +00:00
Родитель a972f0ed13
Коммит c5db6d50f5
2 изменённых файлов: 316 добавлений и 814 удалений

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
* *
@ -19,8 +19,10 @@
* Portions created by the Initial Developer are Copyright (C) 1998 * Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* Yannick Koehler <koehler@mythrium.com> * Yannick Koehler <koehler@mythrium.com>
* Paul Ashford <arougthopher@lizardland.net>
*
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -41,765 +43,235 @@
#include <app/Cursor.h> #include <app/Cursor.h>
static const uint8 cursorHyperlink[] = {
0x10, 0x01, 0x2, 0x2, static unsigned char cursorHyperlink[] = {16,1,2,2,
// Icon Data 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42,
0x00, 0x00, 8,1,60,33,76,113,66,113,48,249,12,249,2,0,1,0,
0x00, 0x00, 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254,
0x38, 0x00, 15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248
0x24, 0x00,
0x24, 0x00,
0x13, 0xE0,
0x12, 0x5C,
0x09, 0x2A,
0x08, 0x01,
0x3C, 0x21,
0x4C, 0x71,
0x42, 0x71,
0x30, 0xF9,
0x0C, 0xF9,
0x02, 0x00,
0x01, 0x00,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x38, 0x00,
0x3C, 0x00,
0x3C, 0x00,
0x1F, 0xE0,
0x1F, 0xFD,
0x0F, 0xFE,
0x0F, 0xFF,
0x3F, 0xFF,
0x7F, 0xFF,
0x7F, 0xFF,
0x3F, 0xFF,
0x0F, 0xFF,
0x03, 0xFE,
0x01, 0xF8
}; };
static const BCursor bCursorHyperlink(cursorHyperlink); static const BCursor bCursorHyperlink(cursorHyperlink);
#define B_CURSOR_HYPERLINK &bCursorHyperlink #define B_CURSOR_HYPERLINK &bCursorHyperlink
static const uint8 cursorHelp[] = { static unsigned char cursorHelp[] = {16,1,2,2,
0x10, 0x01, 0x2, 0x2, 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42,
// Icon Data 8,1,60,121,76,205,66,25,48,49,12,49,2,0,1,48,
0x00, 0x00, 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254,
0x00, 0x00, 15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248
0x38, 0x00,
0x24, 0x00,
0x24, 0x00,
0x13, 0xE0,
0x12, 0x5C,
0x09, 0x2A,
0x08, 0x01,
0x3C, 0x79,
0x4C, 0xCD,
0x42, 0x0D,
0x30, 0x39,
0x0C, 0x31,
0x02, 0x00,
0x01, 0x30,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x38, 0x00,
0x3C, 0x00,
0x3C, 0x00,
0x1F, 0xE0,
0x1F, 0xFD,
0x0F, 0xFE,
0x0F, 0xFF,
0x3F, 0xFF,
0x7F, 0xFF,
0x7F, 0xFF,
0x3F, 0xFF,
0x0F, 0xFF,
0x03, 0xFE,
0x01, 0xF8
}; };
static const BCursor bCursorHelp(cursorHelp); static const BCursor bCursorHelp(cursorHelp);
#define B_CURSOR_HELP &bCursorHelp #define B_CURSOR_HELP &bCursorHelp
static const uint8 cursorWait[] = { static unsigned char cursorCrosshair[] = {16,1,8,8,
0x10, 0x01, 0x7, 0x8, 0,0,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
// Icon Data 127,255,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
0x00, 0x04, 0,0,0,128,0,128,0,128,0,128,0,128,0,128,0,128,
0x07, 0xC6, 127,255,0,128,0,128,0,128,0,128,0,128,0,128,0,128
0x18, 0x3F,
0x21, 0x0C,
0x41, 0x04,
0x41, 0x04,
0x81, 0x02,
0x81, 0x02,
0x81, 0x02,
0x82, 0x02,
0x84, 0x02,
0x48, 0x04,
0x40, 0x04,
0x20, 0x08,
0x18, 0x30,
0x07, 0xC0,
// Bitmask Data
0x00, 0x04,
0x07, 0xC6,
0x1F, 0xFF,
0x3F, 0xFC,
0x7F, 0xFC,
0x7F, 0xFC,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x7F, 0xFC,
0x7F, 0xFC,
0x3F, 0xF8,
0x1F, 0xF0,
0x07, 0xC0
}; };
static const BCursor bCursorWait(cursorWait); static const BCursor bCursorCross(cursorCrosshair);
#define B_CURSOR_WAIT &bCursorWait
static const uint8 cursorSpinning[] = {
0x10, 0x01, 0x7, 0x7,
// Icon Data
0x07, 0xC0,
0x1F, 0x30,
0x3F, 0x08,
0x7F, 0x04,
0x7F, 0x04,
0xFF, 0x02,
0xFF, 0x02,
0xFF, 0xFE,
0x81, 0xFE,
0x81, 0xFE,
0x41, 0xFC,
0x41, 0xFC,
0x21, 0xF8,
0x19, 0xF0,
0x07, 0xC0,
0x00, 0x00,
// Bitmask Data
0x07, 0xC0,
0x1F, 0xF0,
0x3F, 0xF8,
0x7F, 0xFC,
0x7F, 0xFC,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x7F, 0xFC,
0x7F, 0xFC,
0x3F, 0xF8,
0x1F, 0xF0,
0x07, 0xC0,
0x00, 0x00
};
static const BCursor bCursorSpinning(cursorSpinning);
#define B_CURSOR_SPINNING &bCursorSpinning
static const uint8 cursorNorthSouth[] = {
0x10, 0x01, 0x7, 0x7,
// Icon Data
0x01, 0x00,
0x03, 0x80,
0x07, 0xC0,
0x0F, 0xE0,
0x01, 0x00,
0x01, 0x00,
0x7F, 0xFE,
0x00, 0x00,
0x00, 0x00,
0x7F, 0xFE,
0x01, 0x00,
0x01, 0x00,
0x0F, 0xE0,
0x07, 0xC0,
0x03, 0x80,
0x01, 0x00,
// Bitmask Data
0x01, 0x00,
0x03, 0x80,
0x07, 0xC0,
0x0F, 0xE0,
0x01, 0x00,
0x01, 0x00,
0x7F, 0xFE,
0x00, 0x00,
0x00, 0x00,
0x7F, 0xFE,
0x01, 0x00,
0x01, 0x00,
0x0F, 0xE0,
0x07, 0xC0,
0x03, 0x80,
0x01, 0x00
};
static const BCursor bCursorNorthSouth(cursorNorthSouth);
#define B_CURSOR_NORTHSOUTH &bCursorNorthSouth
static const uint8 cursorWestEast[] = {
0x10, 0x01, 0x7, 0x7,
// Icon Data
0x00, 0x00,
0x02, 0x40,
0x02, 0x40,
0x02, 0x40,
0x12, 0x48,
0x32, 0x4C,
0x72, 0x4E,
0xFE, 0x7F,
0x72, 0x4E,
0x32, 0x4C,
0x12, 0x48,
0x02, 0x40,
0x02, 0x40,
0x02, 0x40,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x00, 0x00,
0x02, 0x40,
0x02, 0x40,
0x02, 0x40,
0x12, 0x48,
0x32, 0x4C,
0x72, 0x4E,
0xFE, 0x7F,
0x72, 0x4E,
0x32, 0x4C,
0x12, 0x48,
0x02, 0x40,
0x02, 0x40,
0x02, 0x40,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorWestEast(cursorWestEast);
#define B_CURSOR_WESTEAST &bCursorWestEast
static const uint8 cursorSouthEast[] = {
0x10, 0x01, 0xD, 0xD,
// Icon Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x04, 0x06,
0x02, 0x26,
0x01, 0x26,
0x00, 0xA6,
0x00, 0x66,
0x03, 0xE6,
0x00, 0x06,
0x00, 0x06,
0x07, 0xFE,
0x07, 0xFE,
0x00, 0x00,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x04, 0x0F,
0x0E, 0x7F,
0x07, 0x7F,
0x03, 0xFF,
0x01, 0xFF,
0x07, 0xFF,
0x07, 0xFF,
0x07, 0xFF,
0x0F, 0xFF,
0x0F, 0xFF,
0x0F, 0xFF,
0x0F, 0xFF
};
static const BCursor bCursorSouthEast(cursorSouthEast);
#define B_CURSOR_SOUTHEAST &bCursorSouthEast
static const uint8 cursorSouthWest[] = {
0x10, 0x01, 0xD, 0x2,
// Icon Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x60, 0x20,
0x64, 0x40,
0x64, 0x80,
0x65, 0x00,
0x66, 0x00,
0x67, 0xC0,
0x60, 0x00,
0x60, 0x00,
0x7F, 0xE0,
0x7F, 0xE0,
0x00, 0x00,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0xF0, 0x20,
0xFE, 0x70,
0xFE, 0xE0,
0xFF, 0xC0,
0xFF, 0x80,
0xFF, 0xE0,
0xFF, 0xE0,
0xFF, 0xE0,
0xFF, 0xF0,
0xFF, 0xF0,
0xFF, 0xF0,
0xFF, 0xF0
};
static const BCursor bCursorSouthWest(cursorSouthWest);
#define B_CURSOR_SOUTHWEST &bCursorSouthWest
static const uint8 cursorNorthWest[] = {
0x10, 0x01, 0x2, 0x2,
// Icon Data
0x00, 0x00,
0x7F, 0xE0,
0x7F, 0xE0,
0x60, 0x00,
0x60, 0x00,
0x67, 0xC0,
0x66, 0x00,
0x65, 0x00,
0x64, 0x80,
0x64, 0x40,
0x60, 0x20,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0xFF, 0xF0,
0xFF, 0xF0,
0xFF, 0xF0,
0xFF, 0xF0,
0xFF, 0xE0,
0xFF, 0xE0,
0xFF, 0xE0,
0xFF, 0x80,
0xFF, 0xC0,
0xFE, 0xE0,
0xFE, 0x70,
0xF0, 0x20,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorNorthWest(cursorNorthWest);
#define B_CURSOR_NORTHWEST &bCursorNorthWest
static const uint8 cursorNorthEast[] = {
0x10, 0x01, 0x2, 0xD,
// Icon Data
0x00, 0x00,
0x07, 0xFE,
0x07, 0xFE,
0x00, 0x06,
0x00, 0x06,
0x03, 0xE6,
0x00, 0x66,
0x00, 0x96,
0x01, 0x26,
0x02, 0x26,
0x04, 0x06,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x0F, 0xFF,
0x0F, 0xFF,
0x0F, 0xFF,
0x0F, 0xFF,
0x0E, 0xFF,
0x0E, 0xFF,
0x0E, 0xFF,
0x01, 0xFF,
0x03, 0xFF,
0x07, 0x7F,
0x0E, 0x7F,
0x04, 0x0F,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorNorthEast(cursorNorthEast);
#define B_CURSOR_NORTHEAST &bCursorNorthEast
static const uint8 cursorNorth[] = {
0x10, 0x01, 0x2, 0x7,
// Icon Data
0x00, 0x00,
0x3F, 0xF8,
0x3F, 0xF8,
0x00, 0x00,
0x00, 0x00,
0x01, 0x00,
0x03, 0x80,
0x05, 0x40,
0x09, 0x20,
0x01, 0x00,
0x01, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x7F, 0xFC,
0x7F, 0xFC,
0x7F, 0xFC,
0x7F, 0xFC,
0x01, 0x00,
0x03, 0x80,
0x07, 0xC0,
0x0F, 0xE0,
0x1F, 0xF0,
0x0B, 0xA0,
0x03, 0x80,
0x03, 0x80,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorNorth(cursorNorth);
#define B_CURSOR_NORTH &bCursorNorth
static const uint8 cursorSouth[] = {
0x10, 0x01, 0xD, 0x7,
// Icon Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x01, 0x00,
0x01, 0x00,
0x09, 0x20,
0x05, 0x40,
0x03, 0x80,
0x01, 0x00,
0x00, 0x00,
0x00, 0x00,
0x3F, 0xF8,
0x3F, 0xF8,
0x00, 0x00,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x03, 0x80,
0x03, 0x80,
0x0B, 0xA0,
0x1F, 0xF0,
0x0F, 0xE0,
0x07, 0xC0,
0x03, 0x80,
0x01, 0x00,
0x7F, 0xFC,
0x7F, 0xFC,
0x7F, 0xFC,
0x7F, 0xFC
};
static const BCursor bCursorSouth(cursorSouth);
#define B_CURSOR_SOUTH &bCursorSouth
static const uint8 cursorEast[] = {
0x10, 0x01, 0x6, 0xD,
// Icon Data
0x00, 0x00,
0x00, 0x06,
0x00, 0x06,
0x01, 0x06,
0x00, 0x86,
0x00, 0x46,
0x0F, 0xE6,
0x00, 0x46,
0x00, 0x86,
0x01, 0x06,
0x00, 0x06,
0x00, 0x06,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x00, 0x0F,
0x00, 0x0F,
0x01, 0x0F,
0x03, 0x8F,
0x01, 0xCF,
0x1F, 0xEF,
0x1F, 0xFF,
0x1F, 0xEF,
0x01, 0xCF,
0x03, 0x8F,
0x01, 0x0F,
0x00, 0x0F,
0x00, 0x0F,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorEast(cursorEast);
#define B_CURSOR_EAST &bCursorEast
static const uint8 cursorWest[] = {
0x10, 0x01, 0x6, 0x2,
// Icon Data
0x00, 0x00,
0x60, 0x00,
0x60, 0x00,
0x60, 0x80,
0x61, 0x00,
0x62, 0x00,
0x67, 0xE0,
0x62, 0x00,
0x61, 0x00,
0x60, 0x80,
0x60, 0x00,
0x60, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0xF0, 0x00,
0xF0, 0x00,
0xF0, 0x80,
0xF1, 0xC0,
0xF3, 0x80,
0xF7, 0xF0,
0xFF, 0xF0,
0xF7, 0xF0,
0xF3, 0x80,
0xF1, 0xC0,
0xF0, 0x80,
0xF0, 0x00,
0xF0, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00
};
static const BCursor bCursorWest(cursorWest);
#define B_CURSOR_WEST &bCursorWest
static const uint8 cursorCross[] = {
0x10, 0x01, 0x7, 0x7,
// Icon Data
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0xFF, 0xFF,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x01, 0x00,
0x00, 0x00,
// Bitmask Data
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0xFF, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x03, 0x80,
0x00, 0x00
};
static const BCursor bCursorCross(cursorCross);
#define B_CURSOR_CROSS &bCursorCross #define B_CURSOR_CROSS &bCursorCross
static const uint8 cursorGrab[] = { static unsigned char cursorCopy[] = {16,1,2,2,
0x10, 0x01, 0x7, 0x5, 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42,
// Icon Data 8,1,60,1,76,1,66,17,48,17,12,125,2,17,1,16,
0x00, 0x00, 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254,
0x00, 0x00, 15,255,63,255,127,255,127,255,63,255,15,255,3,255,1,248
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x0F, 0xE0,
0x12, 0x5C,
0x11, 0x2A,
0x18, 0x01,
0x24, 0x01,
0x24, 0x01,
0x22, 0x01,
0x10, 0x01,
0x0C, 0x01,
0x02, 0x00,
0x01, 0x00,
// Bitmask Data
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x0F, 0xE0,
0x1F, 0xFC,
0x1F, 0xFE,
0x1F, 0xFF,
0x3F, 0xFF,
0x3F, 0xFF,
0x3F, 0xFF,
0x1F, 0xFF,
0x0F, 0xFF,
0x03, 0xFE,
0x01, 0xF8
};
static const BCursor bCursorGrab(cursorGrab);
#define B_CURSOR_GRAB &bCursorGrab
static const uint8 cursorMove[] = {
0x10, 0x01, 0x0, 0x1,
// Icon Data
0x30, 0x00,
0x48, 0x00,
0x48, 0x00,
0x27, 0xC0,
0x24, 0xB8,
0x12, 0x54,
0x10, 0x02,
0x78, 0x02,
0x98, 0x02,
0x84, 0x02,
0x60, 0x57,
0x18, 0xAA,
0x04, 0x41,
0x02, 0x82,
0x00, 0x55,
0x00, 0xAA,
// Bitmask Data
0x30, 0x00,
0x78, 0x00,
0x78, 0x00,
0x3F, 0xC0,
0x3F, 0xF8,
0x1F, 0xFC,
0x1F, 0xFE,
0x7F, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x7F, 0xFF,
0x1F, 0xFF,
0x07, 0xFF,
0x03, 0xFF,
0x00, 0xFF,
0x00, 0xFF
};
static const BCursor bCursorMove(cursorMove);
#define B_CURSOR_MOVE &bCursorMove
static const uint8 cursorCopy[] = {
0x10, 0x01, 0x0, 0x1,
// Icon Data
0x30, 0x00,
0x48, 0x00,
0x48, 0x00,
0x27, 0xC0,
0x24, 0xB8,
0x12, 0x54,
0x10, 0x02,
0x78, 0x02,
0x98, 0x02,
0x84, 0x22,
0x60, 0x22,
0x18, 0xFA,
0x04, 0x22,
0x02, 0x22,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x30, 0x00,
0x78, 0x00,
0x78, 0x00,
0x3F, 0xC0,
0x3F, 0xF8,
0x1F, 0xFC,
0x1F, 0xFE,
0x7F, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x7F, 0xFE,
0x1F, 0xFE,
0x07, 0xFE,
0x03, 0xFE,
0x00, 0x00,
0x00, 0x00
}; };
static const BCursor bCursorCopy(cursorCopy); static const BCursor bCursorCopy(cursorCopy);
#define B_CURSOR_COPY &bCursorCopy #define B_CURSOR_COPY &bCursorCopy
static const uint8 cursorAlias[] = { static unsigned char cursorAlias[] = {16,1,2,2,
0x10, 0x01, 0x0, 0x1, 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42,
// Icon Data 8,1,60,1,76,113,66,137,48,157,12,137,2,65,1,0,
0x30, 0x00, 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254,
0x48, 0x00, 15,255,63,255,127,255,127,255,63,255,15,255,3,255,1,248
0x48, 0x00,
0x27, 0xC0,
0x24, 0xB8,
0x12, 0x54,
0x10, 0x02,
0x78, 0x02,
0x98, 0xF2,
0x84, 0x72,
0x60, 0xF2,
0x18, 0x92,
0x04, 0x40,
0x02, 0x00,
0x00, 0x00,
0x00, 0x00,
// Bitmask Data
0x30, 0x00,
0x78, 0x00,
0x78, 0x00,
0x3F, 0xC0,
0x3F, 0xF8,
0x1F, 0xFC,
0x1F, 0xFE,
0x7F, 0xFE,
0xFF, 0xFE,
0xFF, 0xFE,
0x7F, 0xFE,
0x1F, 0xFE,
0x07, 0xFE,
0x03, 0xFE,
0x00, 0x00,
0x00, 0x00
}; };
static const BCursor bCursorAlias(cursorAlias); static const BCursor bCursorAlias(cursorAlias);
#define B_CURSOR_ALIAS &bCursorAlias #define B_CURSOR_ALIAS &bCursorAlias
static unsigned char cursorGrabbing[] = {16,1,8,2,
0,0,0,0,0,0,0,0,15,224,18,92,33,42,40,1,
60,1,20,1,18,1,8,1,4,1,2,1,1,0,0,128,
0,0,0,0,0,0,0,0,15,224,31,252,63,254,63,255,
63,255,31,255,31,255,15,255,7,255,3,255,1,254,0,248
};
static const BCursor bCursorGrabbing(cursorGrabbing);
#define B_CURSOR_GRABBING &bCursorGrabbing
static unsigned char cursorGrab[] = {16,1,2,2,
0,0,0,0,59,64,36,168,36,148,18,74,18,74,9,37,
8,1,60,1,76,1,68,1,48,1,12,1,2,0,1,0,
0,0,0,0,59,64,63,232,63,252,31,254,31,254,15,255,
15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248
};
static const BCursor bCursorGrab(cursorGrab);
#define B_CURSOR_GRAB &bCursorGrab
static unsigned char cursorLowerRight[] = {16,1,13,13,
0,0,0,0,0,0,0,0,0,0,4,6,2,38,1,38,
0,166,0,102,3,230,0,6,0,6,7,254,7,254,0,0,
0,0,0,0,0,0,0,0,4,15,14,127,7,127,3,255,
1,255,7,255,7,255,7,255,15,255,15,255,15,255,15,255
};
static const BCursor bCursorSouthEast(cursorLowerRight);
#define B_CURSOR_SOUTHEAST &bCursorSouthEast
static unsigned char cursorLowerLeft[] = {16,1,13,2,
0,0,0,0,0,0,0,0,0,0,96,32,100,64,100,128,
101,0,102,0,103,192,96,0,96,0,127,224,127,224,0,0,
0,0,0,0,0,0,0,0,240,32,254,112,254,224,255,192,
255,128,255,224,255,224,255,224,255,240,255,240,255,240,255,240
};
static const BCursor bCursorSouthWest(cursorLowerLeft);
#define B_CURSOR_SOUTHWEST &bCursorSouthWest
static unsigned char cursorUpperLeft[] = {16,1,2,2,
0,0,127,224,127,224,96,0,96,0,103,192,102,0,101,0,
100,128,100,64,96,32,0,0,0,0,0,0,0,0,0,0,
255,240,255,240,255,240,255,240,255,224,255,224,255,224,255,128,
255,192,254,224,254,112,240,32,0,0,0,0,0,0,0,0
};
static const BCursor bCursorNorthWest(cursorUpperLeft);
#define B_CURSOR_NORTHWEST &bCursorNorthWest
static unsigned char cursorUpperRight[] = {16,1,2,13,
0,0,7,254,7,254,0,6,0,6,3,230,0,102,0,166,
1,38,2,38,4,6,0,0,0,0,0,0,0,0,0,0,
15,255,15,255,15,255,15,255,7,255,7,255,7,255,1,255,
3,255,7,127,14,127,4,15,0,0,0,0,0,0,0,0
};
static const BCursor bCursorNorthEast(cursorUpperRight);
#define B_CURSOR_NORTHEAST &bCursorNorthEast
static unsigned char cursorRight[] = {16,1,6,13,
0,0,0,6,0,6,1,6,0,134,0,70,15,230,0,70,
0,134,1,6,0,6,0,6,0,0,0,0,0,0,0,0,
0,15,0,15,1,15,3,143,1,207,31,239,31,255,31,239,
1,207,3,143,1,15,0,15,0,15,0,0,0,0,0,0
};
static const BCursor bCursorEast(cursorRight);
#define B_CURSOR_EAST &bCursorEast
static unsigned char cursorLeft[] = {16,1,6,2,
0,0,96,0,96,0,96,128,97,0,98,0,103,224,98,0,
97,0,96,128,96,0,96,0,0,0,0,0,0,0,0,0,
240,0,240,0,240,128,241,192,243,128,247,240,255,240,247,240,
243,128,241,192,240,128,240,0,240,0,0,0,0,0,0,0
};
static const BCursor bCursorWest(cursorLeft);
#define B_CURSOR_WEST &bCursorWest
static unsigned char cursorTop[] = {16,1,2,7,
0,0,63,248,63,248,0,0,0,0,1,0,3,128,5,64,
9,32,1,0,1,0,0,0,0,0,0,0,0,0,0,0,
127,252,127,252,127,252,127,252,1,0,3,128,7,192,15,224,
31,240,11,160,3,128,3,128,0,0,0,0,0,0,0,0
};
static const BCursor bCursorNorth(cursorTop);
#define B_CURSOR_NORTH &bCursorNorth
static unsigned char cursorBottom[] = {16,1,13,7,
0,0,0,0,0,0,0,0,0,0,1,0,1,0,9,32,
5,64,3,128,1,0,0,0,0,0,63,248,63,248,0,0,
0,0,0,0,0,0,0,0,3,128,3,128,11,160,31,240,
15,224,7,192,3,128,1,0,127,252,127,252,127,252,127,252
};
static const BCursor bCursorSouth(cursorBottom);
#define B_CURSOR_SOUTH &bCursorSouth
static unsigned char cursorHorizontalDrag[] = {16,1,7,7,
1,128,1,128,1,128,1,128,1,128,17,136,49,140,125,190,
125,190,49,140,17,136,1,128,1,128,1,128,1,128,1,128,
3,192,3,192,3,192,3,192,27,216,59,220,127,254,255,255,
255,255,127,254,59,220,27,216,3,192,3,192,3,192,3,192
};
static const BCursor bCursorWestEast(cursorHorizontalDrag);
#define B_CURSOR_WESTEAST &bCursorWestEast
static unsigned char cursorVerticalDrag[] = {16,1,7,7,
0,0,1,128,3,192,7,224,1,128,1,128,0,0,255,255,
255,255,0,0,1,128,1,128,7,224,3,192,1,128,0,0,
1,128,3,192,7,224,15,240,15,240,3,192,255,255,255,255,
255,255,255,255,3,192,15,240,15,240,7,224,3,192,1,128
};
static const BCursor bCursorNorthSouth(cursorVerticalDrag);
#define B_CURSOR_NORTHSOUTH &bCursorNorthSouth
static unsigned char cursorWatch1[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,86,4,146,2,146,1,130,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning1(cursorWatch1);
static unsigned char cursorWatch2[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,138,2,146,1,130,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning2(cursorWatch2);
#define B_CURSOR_SPINNING &bCursorSpinning2
static unsigned char cursorWatch3[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,130,2,158,1,130,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning3(cursorWatch3);
static unsigned char cursorWatch4[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,130,2,146,1,138,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning4(cursorWatch4);
static unsigned char cursorWatch5[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,130,2,146,1,146,0,213,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning5(cursorWatch5);
static unsigned char cursorWatch6[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,130,2,146,1,162,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning6(cursorWatch6);
static unsigned char cursorWatch7[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,130,2,242,1,130,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning7(cursorWatch7);
static unsigned char cursorWatch8[] = {16,1,0,1,
112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2,
152,2,132,2,96,58,24,70,4,162,2,146,1,130,0,197,
112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254,
255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255
};
static const BCursor bCursorSpinning8(cursorWatch8);
static const BCursor bCursorsSpinning[] = {
bCursorSpinning1,
bCursorSpinning2,
bCursorSpinning3,
bCursorSpinning4,
bCursorSpinning5,
bCursorSpinning6,
bCursorSpinning7,
bCursorSpinning8
};
#endif // nsBeOSCursors_h__ #endif // nsBeOSCursors_h__

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* Paul Ashford <arougthopher@lizardland.net>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -60,6 +61,8 @@
#include <app/MessageRunner.h> #include <app/MessageRunner.h>
#include <support/String.h> #include <support/String.h>
#include <nsBeOSCursors.h>
#ifdef DRAG_DROP #ifdef DRAG_DROP
//#include "nsDropTarget.h" //#include "nsDropTarget.h"
#include "DragDrop.h" #include "DragDrop.h"
@ -1306,84 +1309,111 @@ NS_METHOD nsWindow::SetFont(const nsFont &aFont)
NS_METHOD nsWindow::SetCursor(nsCursor aCursor) NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
{ {
if(!mView)
return NS_ERROR_FAILURE;
// Only change cursor if it's changing // Only change cursor if it's changing
if (aCursor != mCursor) {
BCursor const *newCursor = B_CURSOR_SYSTEM_DEFAULT;
//XXX mCursor isn't always right. Scrollbars and others change it, too. switch (aCursor) {
//XXX If we want this optimization we need a better way to do it. case eCursor_standard:
//if (aCursor != mCursor) { case eCursor_wait:
// HCURSOR newCursor = NULL; case eCursor_move:
newCursor = B_CURSOR_SYSTEM_DEFAULT;
break;
switch(aCursor) { case eCursor_select:
case eCursor_select: newCursor = B_CURSOR_I_BEAM;
// newCursor = ::LoadCursor(NULL, IDC_IBEAM); break;
break;
case eCursor_wait:
// newCursor = ::LoadCursor(NULL, IDC_WAIT);
break;
case eCursor_hyperlink: { case eCursor_hyperlink:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_SELECTANCHOR)); newCursor = B_CURSOR_HYPERLINK;
break; break;
case eCursor_sizeWE:
newCursor = B_CURSOR_WESTEAST;
break;
case eCursor_sizeNS:
newCursor = B_CURSOR_NORTHSOUTH;
break;
case eCursor_sizeNW:
newCursor = B_CURSOR_NORTHWEST;
break;
case eCursor_sizeSE:
newCursor = B_CURSOR_SOUTHEAST;
break;
case eCursor_sizeNE:
newCursor = B_CURSOR_NORTHEAST;
break;
case eCursor_sizeSW:
newCursor = B_CURSOR_SOUTHWEST;
break;
case eCursor_arrow_north:
case eCursor_arrow_north_plus:
newCursor = B_CURSOR_NORTH;
break;
case eCursor_arrow_south:
case eCursor_arrow_south_plus:
newCursor = B_CURSOR_SOUTH;
break;
case eCursor_arrow_east:
case eCursor_arrow_east_plus:
newCursor = B_CURSOR_EAST;
break;
case eCursor_arrow_west:
case eCursor_arrow_west_plus:
newCursor = B_CURSOR_WEST;
break;
case eCursor_crosshair:
newCursor = B_CURSOR_CROSS;
break;
case eCursor_help:
newCursor = B_CURSOR_HELP;
break;
case eCursor_grab:
newCursor = B_CURSOR_GRAB;
break;
case eCursor_grabbing:
newCursor = B_CURSOR_GRABBING;
break;
case eCursor_copy:
newCursor = B_CURSOR_COPY;
break;
case eCursor_alias:
newCursor = B_CURSOR_ALIAS;
break;
case eCursor_spinning:
newCursor = B_CURSOR_SPINNING;
break;
default:
NS_ASSERTION(0, "Invalid cursor type");
break;
} }
case eCursor_standard: if (mView && mView->LockLooper()) {
// newCursor = ::LoadCursor(NULL, IDC_ARROW);
break;
case eCursor_sizeWE:
// newCursor = ::LoadCursor(NULL, IDC_SIZEWE);
break;
case eCursor_sizeNS:
// newCursor = ::LoadCursor(NULL, IDC_SIZENS);
break;
case eCursor_arrow_north:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWNORTH));
break;
case eCursor_arrow_north_plus:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWNORTHPLUS));
break;
case eCursor_arrow_south:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWSOUTH));
break;
case eCursor_arrow_south_plus:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWSOUTHPLUS));
break;
case eCursor_arrow_east:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWEAST));
break;
case eCursor_arrow_east_plus:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWEASTPLUS));
break;
case eCursor_arrow_west:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWWEST));
break;
case eCursor_arrow_west_plus:
// newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_ARROWWESTPLUS));
break;
default:
NS_ASSERTION(0, "Invalid cursor type");
break;
}
#if 0
if (NULL != newCursor) {
mCursor = aCursor; mCursor = aCursor;
HCURSOR oldCursor = ::SetCursor(newCursor); mView->SetViewCursor(newCursor, true);
mView->UnlockLooper();
} }
#endif }
//}
return NS_OK; return NS_OK;
} }
@ -2100,7 +2130,7 @@ PRBool nsWindow::DispatchKeyEvent(PRUint32 aEventType, PRUint32 aCharCode,
event.charCode = aCharCode; event.charCode = aCharCode;
event.keyCode = aKeyCode; event.keyCode = aKeyCode;
#ifdef KE_DEBUG #ifdef KB_DEBUG
static int cnt=0; static int cnt=0;
printf("%d DispatchKE Type: %s charCode 0x%x keyCode 0x%x ", cnt++, printf("%d DispatchKE Type: %s charCode 0x%x keyCode 0x%x ", cnt++,
(NS_KEY_PRESS == aEventType)?"PRESS":(aEventType == NS_KEY_UP?"Up":"Down"), (NS_KEY_PRESS == aEventType)?"PRESS":(aEventType == NS_KEY_UP?"Up":"Down"),