You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(23) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(2) |
Feb
(7) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(7) |
Sep
(8) |
Oct
(5) |
Nov
(11) |
Dec
(2) |
| 2008 |
Jan
(8) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
| 2009 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(16) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <Ste...@us...> - 2011-02-24 00:14:03
|
Revision: 324
http://g15tools.svn.sourceforge.net/g15tools/?rev=324&view=rev
Author: SteelSide
Date: 2011-02-24 00:13:57 +0000 (Thu, 24 Feb 2011)
Log Message:
-----------
Applied the G510 patch supplied by multitude.
Modified Paths:
--------------
trunk/libg15/libg15.c
trunk/libg15/libg15.h
Modified: trunk/libg15/libg15.c
===================================================================
--- trunk/libg15/libg15.c 2011-01-09 15:49:05 UTC (rev 323)
+++ trunk/libg15/libg15.c 2011-02-24 00:13:57 UTC (rev 324)
@@ -49,6 +49,8 @@
DEVICE("Logitech Gamepanel",0x46d,0xc251,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
DEVICE("Logitech G13",0x46d,0xc21c,G15_LCD|G15_KEYS|G15_DEVICE_G13),
DEVICE("Logitech G110",0x46d,0xc22b,G15_KEYS),
+ DEVICE("Logitech G510",0x46d,0xc22d,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED|G15_DEVICE_G510), /* without audio activated */
+ DEVICE("Logitech G510",0x46d,0xc22e,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED|G15_DEVICE_G510), /* with audio activated */
DEVICE(NULL,0,0,0)
};
@@ -166,6 +168,10 @@
struct usb_config_descriptor *cfg = &dev->config[j];
for (i=0;i<cfg->bNumInterfaces; i++){
+ if (g15DeviceCapabilities()&G15_DEVICE_G510){
+ if (i==G510_STANDARD_KEYBOARD_INTERFACE) continue;
+ }
+
struct usb_interface *ifp = &cfg->interface[i];
/* if endpoints are already known, finish up */
if(g15_keys_endpoint && g15_lcd_endpoint)
@@ -539,6 +545,9 @@
unsigned char m_led_buf[4] = { 2, 4, 0, 0 };
m_led_buf[2] = ~(unsigned char)leds;
+ if(g15DeviceCapabilities()&G15_DEVICE_G510)
+ setG510LEDColor(0, 255, 0);
+
if(shared_device>0)
return G15_ERROR_UNSUPPORTED;
@@ -599,6 +608,21 @@
return retval;
}
+int setG510LEDColor(unsigned char r, unsigned char g, unsigned char b)
+{
+ int retval = 0;
+ unsigned char usb_data[] = { 4, 0, 0, 0 };
+
+ usb_data[1] = r;
+ usb_data[2] = g;
+ usb_data[3] = b;
+
+ pthread_mutex_lock(&libusb_mutex);
+ retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x305, 1, (char*)usb_data, 4, 10000);
+ pthread_mutex_unlock(&libusb_mutex);
+ return retval;
+}
+
static unsigned char g15KeyToLogitechKeyCode(int key)
{
// first 12 G keys produce F1 - F12, thats 0x3a + key
@@ -852,6 +876,94 @@
if (buffer[2]&0x1)
*pressed_keys |= G15_KEY_LIGHT;
}
+
+ // G510
+ if (buffer[0] == 0x03)
+ {
+ if (buffer[1]&0x01)
+ *pressed_keys |= G15_KEY_G1;
+
+ if (buffer[1]&0x02)
+ *pressed_keys |= G15_KEY_G2;
+
+ if (buffer[1]&0x04)
+ *pressed_keys |= G15_KEY_G3;
+
+ if (buffer[1]&0x08)
+ *pressed_keys |= G15_KEY_G4;
+
+ if (buffer[1]&0x10)
+ *pressed_keys |= G15_KEY_G5;
+
+ if (buffer[1]&0x20)
+ *pressed_keys |= G15_KEY_G6;
+
+ if (buffer[1]&0x40)
+ *pressed_keys |= G15_KEY_G7;
+
+ if (buffer[1]&0x80)
+ *pressed_keys |= G15_KEY_G8;
+
+ if (buffer[2]&0x01)
+ *pressed_keys |= G15_KEY_G9;
+
+ if (buffer[2]&0x02)
+ *pressed_keys |= G15_KEY_G10;
+
+ if (buffer[2]&0x04)
+ *pressed_keys |= G15_KEY_G11;
+
+ if (buffer[2]&0x08)
+ *pressed_keys |= G15_KEY_G12;
+
+ if (buffer[2]&0x10)
+ *pressed_keys |= G15_KEY_G13;
+
+ if (buffer[2]&0x20)
+ *pressed_keys |= G15_KEY_G14;
+
+ if (buffer[2]&0x40)
+ *pressed_keys |= G15_KEY_G15;
+
+ if (buffer[2]&0x80)
+ *pressed_keys |= G15_KEY_G16;
+
+ if (buffer[3]&0x01)
+ *pressed_keys |= G15_KEY_G17;
+
+ if (buffer[3]&0x02)
+ *pressed_keys |= G15_KEY_G18;
+
+ if (buffer[3]&0x10)
+ *pressed_keys |= G15_KEY_M1;
+
+ if (buffer[3]&0x20)
+ *pressed_keys |= G15_KEY_M2;
+
+ if (buffer[3]&0x40)
+ *pressed_keys |= G15_KEY_M3;
+
+ if (buffer[3]&0x80)
+ *pressed_keys |= G15_KEY_MR;
+
+ if (buffer[4]&0x1)
+ *pressed_keys |= G15_KEY_L1;
+
+ if (buffer[4]&0x2)
+ *pressed_keys |= G15_KEY_L2;
+
+ if (buffer[4]&0x4)
+ *pressed_keys |= G15_KEY_L3;
+
+ if (buffer[4]&0x8)
+ *pressed_keys |= G15_KEY_L4;
+
+ if (buffer[4]&0x10)
+ *pressed_keys |= G15_KEY_L5;
+
+ if (buffer[3]&0x8)
+ *pressed_keys |= G15_KEY_LIGHT;
+ }
}
static void processKeyEvent4Byte(unsigned int *pressed_keys, unsigned char *buffer)
@@ -934,7 +1046,7 @@
if(buffer[0] == 1)
return G15_ERROR_TRY_AGAIN;
}
-
+
caps = g15DeviceCapabilities();
if((caps & G15_DEVICE_G13) && buffer[0]==0x25){
processKeyEventG13(pressed_keys, buffer);
Modified: trunk/libg15/libg15.h
===================================================================
--- trunk/libg15/libg15.h 2011-01-09 15:49:05 UTC (rev 323)
+++ trunk/libg15/libg15.h 2011-02-24 00:13:57 UTC (rev 324)
@@ -33,8 +33,10 @@
#define G15_DEVICE_IS_SHARED 4
#define G15_DEVICE_5BYTE_RETURN 8
#define G15_DEVICE_G13 16
+#define G15_DEVICE_G510 32
#define G15_KEY_READ_LENGTH 9
+#define G510_STANDARD_KEYBOARD_INTERFACE 0x0
typedef struct libg15_devices_t libg15_devices_t;
@@ -167,6 +169,7 @@
int setLEDs(unsigned int leds);
int setLCDBrightness(unsigned int level);
int setKBBrightness(unsigned int level);
+ int setG510LEDColor(unsigned char r, unsigned char g, unsigned char b);
/* Please be warned
* the g15 sends two different usb msgs for each key press
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ste...@us...> - 2011-01-09 15:49:11
|
Revision: 323
http://g15tools.svn.sourceforge.net/g15tools/?rev=323&view=rev
Author: SteelSide
Date: 2011-01-09 15:49:05 +0000 (Sun, 09 Jan 2011)
Log Message:
-----------
Applied g110 patch found on forums.
Modified Paths:
--------------
trunk/libg15/libg15.c
Modified: trunk/libg15/libg15.c
===================================================================
--- trunk/libg15/libg15.c 2011-01-02 22:58:24 UTC (rev 322)
+++ trunk/libg15/libg15.c 2011-01-09 15:49:05 UTC (rev 323)
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006-2007 The G15tools Project - g15tools.sf.net
-
+
$Revision$ - $Date$ $Author$
*/
@@ -48,6 +48,7 @@
DEVICE("Logitech G15 v2",0x46d,0xc227,G15_LCD|G15_KEYS|G15_DEVICE_5BYTE_RETURN),
DEVICE("Logitech Gamepanel",0x46d,0xc251,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
DEVICE("Logitech G13",0x46d,0xc21c,G15_LCD|G15_KEYS|G15_DEVICE_G13),
+ DEVICE("Logitech G110",0x46d,0xc22b,G15_KEYS),
DEVICE(NULL,0,0,0)
};
@@ -89,11 +90,11 @@
unsigned int found = 0;
for (i=0; g15_devices[i].name !=NULL;i++)
- for (bus = usb_busses; bus; bus = bus->next)
+ for (bus = usb_busses; bus; bus = bus->next)
{
for (dev = bus->devices; dev; dev = dev->next)
{
- if ((dev->descriptor.idVendor == g15_devices[i].vendorid && dev->descriptor.idProduct == g15_devices[i].productid))
+ if ((dev->descriptor.idVendor == g15_devices[i].vendorid && dev->descriptor.idProduct == g15_devices[i].productid))
found++;
}
}
@@ -109,7 +110,7 @@
* usb_find_busses and usb_find_devices both report the number of devices
* / busses added / removed since the last call. since this is the first
* call we have to return values != 0 or else we didnt find anything */
-
+
if (!usb_find_busses())
return G15_ERROR_OPENING_USB_DEVICE;
@@ -126,12 +127,12 @@
int retries=0;
int j,i,k,l;
int interface=0;
-
- for (bus = usb_busses; bus; bus = bus->next)
+
+ for (bus = usb_busses; bus; bus = bus->next)
{
for (dev = bus->devices; dev; dev = dev->next)
{
- if ((dev->descriptor.idVendor == handled_device.vendorid && dev->descriptor.idProduct == handled_device.productid))
+ if ((dev->descriptor.idVendor == handled_device.vendorid && dev->descriptor.idProduct == handled_device.productid))
{
int ret=0;
char name_buffer[65535];
@@ -177,9 +178,9 @@
if(as->bInterfaceClass==USB_CLASS_HID){
g15_log(stderr, G15_LOG_INFO, "Interface %i has %i Endpoints\n", i, as->bNumEndpoints);
usleep(50*1000);
- /* libusb functions ending in _np are not portable between OS's
+ /* libusb functions ending in _np are not portable between OS's
* Non-linux users will need some way to detach the HID driver from
- * the G15 until we work out how to do this for other OS's automatically.
+ * the G15 until we work out how to do this for other OS's automatically.
* For the moment, we just skip this code..
*/
#ifdef LIBUSB_HAS_GET_DRIVER_NP
@@ -203,7 +204,7 @@
}
}
-#endif
+#endif
/* don't set configuration if device is shared */
if(0 == shared_device) {
ret = usb_set_configuration(devh, 1);
@@ -236,7 +237,7 @@
if(0x80 & ep->bEndpointAddress) {
g15_keys_endpoint = ep->bEndpointAddress;
} else {
- g15_lcd_endpoint = ep->bEndpointAddress;
+ g15_lcd_endpoint = ep->bEndpointAddress;
}
#if 0
usb_resetep(devh,ep->bEndpointAddress);
@@ -254,10 +255,10 @@
g15_log(stderr,G15_LOG_INFO,"Done opening the keyboard\n");
- usleep(500*1000); // sleep a bit for good measure
+ usleep(500*1000); // sleep a bit for good measure
return devh;
}
- }
+ }
}
return 0;
}
@@ -286,14 +287,14 @@
* usb_find_busses and usb_find_devices both report the number of devices
* / busses added / removed since the last call. since this is the first
* call we have to return values != 0 or else we didnt find anything */
-
+
if (!usb_find_devices())
return G15_ERROR_OPENING_USB_DEVICE;
-
+
keyboard_device = findAndOpenG15();
if (!keyboard_device)
return G15_ERROR_OPENING_USB_DEVICE;
-
+
return G15_NO_ERROR;
}
@@ -305,18 +306,18 @@
return retval;
g15_log(stderr,G15_LOG_INFO,"%s\n",PACKAGE_STRING);
-
+
#ifdef SUN_LIBUSB
g15_log(stderr,G15_LOG_INFO,"Using Sun libusb.\n");
#endif
g15NumberOfConnectedDevices();
-
+
keyboard_device = findAndOpenG15();
if (!keyboard_device)
return G15_ERROR_OPENING_USB_DEVICE;
- pthread_mutex_init(&libusb_mutex, NULL);
+ pthread_mutex_init(&libusb_mutex, NULL);
return retval;
}
@@ -347,7 +348,7 @@
/*
For a set of bytes (A, B, C, etc.) the bits representing pixels will appear on the LCD like this:
-
+
A0 B0 C0
A1 B1 C1
A2 B2 C2
@@ -356,7 +357,7 @@
A5 B5 C5
A6 B6 C6
A7 B7 C7
-
+
A0
A1 <- second 8-pixel-high row starts straight after the last byte on
A2 the previous row
@@ -376,8 +377,8 @@
A0
A1 <- only the first three bits are shown on the bottom row (the last three
A2 pixels of the 43-pixel high display.)
-
+
*/
unsigned int output_offset = G15_LCD_OFFSET;
@@ -399,7 +400,7 @@
{
unsigned int bit = curr_col % 8;
/* Copy a 1x8 column of pixels across from the source image to the LCD buffer. */
-
+
lcd_buffer[output_offset] =
(((data[base_offset ] << bit) & 0x80) >> 7) |
(((data[base_offset + G15_LCD_WIDTH/8 ] << bit) & 0x80) >> 6) |
@@ -436,10 +437,10 @@
case -EAGAIN: /* try again */
case -EFBIG: /* too many frames to handle */
case -EMSGSIZE: /* msgsize is invalid */
- g15_log(stderr,G15_LOG_INFO,"usb error: %s %s (%i)\n",prefix,usb_strerror(),ret);
+ g15_log(stderr,G15_LOG_INFO,"usb error: %s %s (%i)\n",prefix,usb_strerror(),ret);
break;
case -EPIPE: /* endpoint is stalled */
- g15_log(stderr,G15_LOG_INFO,"usb error: %s EPIPE! clearing...\n",prefix);
+ g15_log(stderr,G15_LOG_INFO,"usb error: %s EPIPE! clearing...\n",prefix);
pthread_mutex_lock(&libusb_mutex);
usb_clear_halt(keyboard_device, 0x81);
pthread_mutex_unlock(&libusb_mutex);
@@ -463,17 +464,17 @@
if(!(g15_devices[found_devicetype].caps & G15_LCD))
return 0;
-
+
/* the keyboard needs this magic byte */
lcd_buffer[0] = 0x03;
/* in an attempt to reduce peak bus utilisation, we break the transfer into 32 byte chunks and sleep a bit in between.
- It shouldnt make much difference, but then again, the g15 shouldnt be flooding the bus enough to cause ENOSPC, yet
+ It shouldnt make much difference, but then again, the g15 shouldnt be flooding the bus enough to cause ENOSPC, yet
apparently does on some machines...
I'm not sure how successful this will be in combatting ENOSPC, but we'll give it try in the real-world. */
if(enospc_slowdown != 0){
#ifndef LIBUSB_BLOCKS
- pthread_mutex_lock(&libusb_mutex);
+ pthread_mutex_lock(&libusb_mutex);
#endif
for(transfercount = 0;transfercount<=31;transfercount++){
ret = usb_interrupt_write(keyboard_device, g15_lcd_endpoint, (char*)lcd_buffer+(32*transfercount), 32, 1000);
@@ -486,7 +487,7 @@
}
#ifndef LIBUSB_BLOCKS
pthread_mutex_unlock(&libusb_mutex);
-#endif
+#endif
}else{
/* transfer entire buffer in one hit */
#ifdef LIBUSB_BLOCKS
@@ -511,21 +512,21 @@
{
int retval = 0;
unsigned char usb_data[] = { 2, 32, 129, 0 };
-
+
if(shared_device>0)
return G15_ERROR_UNSUPPORTED;
-
- switch(level)
+
+ switch(level)
{
- case 1:
- usb_data[3] = 22;
+ case 1:
+ usb_data[3] = 22;
break;
- case 2:
+ case 2:
usb_data[3] = 26;
break;
default:
usb_data[3] = 18;
- }
+ }
pthread_mutex_lock(&libusb_mutex);
retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)usb_data, 4, 10000);
pthread_mutex_unlock(&libusb_mutex);
@@ -537,12 +538,12 @@
int retval = 0;
unsigned char m_led_buf[4] = { 2, 4, 0, 0 };
m_led_buf[2] = ~(unsigned char)leds;
-
+
if(shared_device>0)
return G15_ERROR_UNSUPPORTED;
pthread_mutex_lock(&libusb_mutex);
- retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)m_led_buf, 4, 10000);
+ retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)m_led_buf, 4, 10000);
pthread_mutex_unlock(&libusb_mutex);
return retval;
}
@@ -551,23 +552,23 @@
{
int retval = 0;
unsigned char usb_data[] = { 2, 2, 0, 0 };
-
+
if(shared_device>0)
return G15_ERROR_UNSUPPORTED;
-
- switch(level)
+
+ switch(level)
{
- case 1 :
- usb_data[2] = 0x10;
+ case 1 :
+ usb_data[2] = 0x10;
break;
- case 2 :
- usb_data[2] = 0x20;
+ case 2 :
+ usb_data[2] = 0x20;
break;
default:
usb_data[2] = 0x00;
}
pthread_mutex_lock(&libusb_mutex);
- retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)usb_data, 4, 10000);
+ retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)usb_data, 4, 10000);
pthread_mutex_unlock(&libusb_mutex);
return retval;
}
@@ -577,23 +578,23 @@
{
int retval = 0;
unsigned char usb_data[] = { 2, 1, 0, 0 };
-
+
if(shared_device>0)
return G15_ERROR_UNSUPPORTED;
- switch(level)
+ switch(level)
{
- case 1 :
- usb_data[2] = 0x1;
+ case 1 :
+ usb_data[2] = 0x1;
break;
- case 2 :
- usb_data[2] = 0x2;
+ case 2 :
+ usb_data[2] = 0x2;
break;
default:
usb_data[2] = 0x0;
}
pthread_mutex_lock(&libusb_mutex);
- retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)usb_data, 4, 10000);
+ retval = usb_control_msg(keyboard_device, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x302, 0, (char*)usb_data, 4, 10000);
pthread_mutex_unlock(&libusb_mutex);
return retval;
}
@@ -705,68 +706,68 @@
static void processKeyEvent9Byte(unsigned int *pressed_keys, unsigned char *buffer)
{
int i;
-
+
*pressed_keys = 0;
-
+
g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x, %x, %x, %x, %x, %x, %x, %x\n",buffer[0],buffer[1],buffer[2],buffer[3],buffer[4],buffer[5],buffer[6],buffer[7],buffer[8]);
-
+
if (buffer[0] == 0x02)
{
if (buffer[1]&0x01)
*pressed_keys |= G15_KEY_G1;
-
+
if (buffer[2]&0x02)
*pressed_keys |= G15_KEY_G2;
if (buffer[3]&0x04)
*pressed_keys |= G15_KEY_G3;
-
+
if (buffer[4]&0x08)
*pressed_keys |= G15_KEY_G4;
-
+
if (buffer[5]&0x10)
*pressed_keys |= G15_KEY_G5;
if (buffer[6]&0x20)
*pressed_keys |= G15_KEY_G6;
-
+
if (buffer[2]&0x01)
*pressed_keys |= G15_KEY_G7;
-
+
if (buffer[3]&0x02)
*pressed_keys |= G15_KEY_G8;
-
+
if (buffer[4]&0x04)
*pressed_keys |= G15_KEY_G9;
-
+
if (buffer[5]&0x08)
*pressed_keys |= G15_KEY_G10;
-
+
if (buffer[6]&0x10)
*pressed_keys |= G15_KEY_G11;
-
+
if (buffer[7]&0x20)
*pressed_keys |= G15_KEY_G12;
-
+
if (buffer[1]&0x04)
*pressed_keys |= G15_KEY_G13;
-
+
if (buffer[2]&0x08)
*pressed_keys |= G15_KEY_G14;
-
+
if (buffer[3]&0x10)
*pressed_keys |= G15_KEY_G15;
-
+
if (buffer[4]&0x20)
*pressed_keys |= G15_KEY_G16;
-
+
if (buffer[5]&0x40)
*pressed_keys |= G15_KEY_G17;
-
+
if (buffer[8]&0x40)
*pressed_keys |= G15_KEY_G18;
-
+
if (buffer[6]&0x01)
*pressed_keys |= G15_KEY_M1;
if (buffer[7]&0x02)
@@ -796,16 +797,16 @@
static void processKeyEvent5Byte(unsigned int *pressed_keys, unsigned char *buffer)
{
int i;
-
+
*pressed_keys = 0;
-
+
g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x, %x, %x, %x\n",buffer[0],buffer[1],buffer[2],buffer[3],buffer[4]);
-
+
if (buffer[0] == 0x02)
{
if (buffer[1]&0x01)
*pressed_keys |= G15_KEY_G1;
-
+
if (buffer[1]&0x02)
*pressed_keys |= G15_KEY_G2;
@@ -820,40 +821,102 @@
if (buffer[1]&0x20)
*pressed_keys |= G15_KEY_G6;
-
+
if (buffer[1]&0x40)
*pressed_keys |= G15_KEY_M1;
-
+
if (buffer[1]&0x80)
*pressed_keys |= G15_KEY_M2;
-
+
if (buffer[2]&0x20)
*pressed_keys |= G15_KEY_M3;
-
+
if (buffer[2]&0x40)
*pressed_keys |= G15_KEY_MR;
if (buffer[2]&0x80)
*pressed_keys |= G15_KEY_L1;
-
+
if (buffer[2]&0x2)
*pressed_keys |= G15_KEY_L2;
-
+
if (buffer[2]&0x4)
*pressed_keys |= G15_KEY_L3;
if (buffer[2]&0x8)
*pressed_keys |= G15_KEY_L4;
-
+
if (buffer[2]&0x10)
*pressed_keys |= G15_KEY_L5;
-
+
if (buffer[2]&0x1)
*pressed_keys |= G15_KEY_LIGHT;
}
}
+static void processKeyEvent4Byte(unsigned int *pressed_keys, unsigned char *buffer)
+{
+ int i;
+ *pressed_keys = 0;
+
+ g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x, %x, %x\n",buffer[0],buffer[1],buffer[2],buffer[3]);
+
+ if (buffer[0] == 0x02)
+ {
+ if (buffer[1]&0x01)
+ *pressed_keys |= G15_KEY_G1;
+
+ if (buffer[1]&0x02)
+ *pressed_keys |= G15_KEY_G2;
+
+ if (buffer[1]&0x04)
+ *pressed_keys |= G15_KEY_G3;
+
+ if (buffer[1]&0x08)
+ *pressed_keys |= G15_KEY_G4;
+
+ if (buffer[1]&0x10)
+ *pressed_keys |= G15_KEY_G5;
+
+ if (buffer[1]&0x20)
+ *pressed_keys |= G15_KEY_G6;
+
+ if (buffer[1]&0x40)
+ *pressed_keys |= G15_KEY_G7;
+
+ if (buffer[1]&0x80)
+ *pressed_keys |= G15_KEY_G8;
+
+ if (buffer[2]&0x01)
+ *pressed_keys |= G15_KEY_G9;
+
+ if (buffer[2]&0x02)
+ *pressed_keys |= G15_KEY_G10;
+
+ if (buffer[2]&0x04)
+ *pressed_keys |= G15_KEY_G11;
+
+ if (buffer[2]&0x08)
+ *pressed_keys |= G15_KEY_G12;
+
+ if (buffer[2]&0x10)
+ *pressed_keys |= G15_KEY_M1;
+
+ if (buffer[2]&0x20)
+ *pressed_keys |= G15_KEY_M2;
+
+ if (buffer[2]&0x40)
+ *pressed_keys |= G15_KEY_M3;
+
+ if (buffer[2]&0x80)
+ *pressed_keys |= G15_KEY_MR;
+
+ if (buffer[3]&0x1)
+ *pressed_keys |= G15_KEY_LIGHT;
+ }
+}
+
int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
{
unsigned char buffer[G15_KEY_READ_LENGTH];
@@ -869,7 +932,7 @@
#endif
if(ret>0) {
if(buffer[0] == 1)
- return G15_ERROR_TRY_AGAIN;
+ return G15_ERROR_TRY_AGAIN;
}
caps = g15DeviceCapabilities();
@@ -879,6 +942,9 @@
}
switch(ret) {
+ case 4:
+ processKeyEvent4Byte(pressed_keys, buffer);
+ return G15_NO_ERROR;
case 5:
processKeyEvent5Byte(pressed_keys, buffer);
return G15_NO_ERROR;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ste...@us...> - 2011-01-02 22:58:30
|
Revision: 322
http://g15tools.svn.sourceforge.net/g15tools/?rev=322&view=rev
Author: SteelSide
Date: 2011-01-02 22:58:24 +0000 (Sun, 02 Jan 2011)
Log Message:
-----------
Fixed PixelOverlay in g15composer according to bug & patch from #3088409, thanks Predicate.
Modified Paths:
--------------
trunk/g15composer/g15composer.y
Modified: trunk/g15composer/g15composer.y
===================================================================
--- trunk/g15composer/g15composer.y 2010-02-05 05:04:51 UTC (rev 321)
+++ trunk/g15composer/g15composer.y 2011-01-02 22:58:24 UTC (rev 322)
@@ -108,11 +108,11 @@
;
nt_command:
- nt_pixel_command
- | nt_draw_command
+ nt_pixel_command
+ | nt_draw_command
| nt_wbmp_command
- | nt_mode_command
- | nt_font_command
+ | nt_mode_command
+ | nt_font_command
| nt_text_command
{
((struct parserData *)param)->itemptr = ((struct parserData *)param)->listptr->first_string;
@@ -127,13 +127,13 @@
((struct parserData *)param)->listptr = NULL;
((struct parserData *)param)->itemptr = NULL;
}
- | nt_key_command
- | nt_lcd_command
+ | nt_key_command
+ | nt_lcd_command
| nt_screen_command
;
nt_string:
- T_STRING
+ T_STRING
{
$$ = $1;
}
@@ -144,8 +144,8 @@
$$ = new_strList ();
}
- |
-
+ |
+
nt_strings nt_string
{
add_string ($1, $2);
@@ -184,25 +184,25 @@
T_PIXELOVERLAY T_NUMBER T_NUMBER T_NUMBER T_NUMBER nt_string T_NEWLINE
{
if (((struct parserData *)param)->background == 1)
- return (0);
- short output_line[G15_BUFFER_LEN];
+ return (0);
+ short output_line[G15_LCD_HEIGHT * G15_LCD_WIDTH];
int len = strlen ($6);
int exp = $4 * $5;
- if ((len != exp) || (len > G15_BUFFER_LEN))
- {
- fprintf (stderr, "Error: Expected %d pixels but received %d.\n", exp, len);
+ if ((len != exp) || (len > G15_LCD_HEIGHT * G15_LCD_WIDTH))
+ {
+ fprintf (stderr, "Error: Expected %d pixels but received %d.\n", exp, len);
return (1);
- }
+ }
int i = 0;
for (i = 0; i < len; ++i)
- {
- output_line[i] = 0;
- if ($6[i] == '1')
- output_line[i] = 1;
- }
+ {
+ output_line[i] = 0;
+ if ($6[i] == '1')
+ output_line[i] = 1;
+ }
g15r_pixelOverlay (((struct parserData *)param)->canvas, $2, $3, $4, $5, output_line);
free ($6);
}
@@ -280,7 +280,7 @@
{
if (((struct parserData *)param)->background == 1)
return (0);
-
+
struct bufItem *buf = ((struct parserData *)param)->buflist->first_buf;
while ((buf->id != $2) && (buf != NULL))
@@ -298,7 +298,7 @@
{
if (((struct parserData *)param)->background == 1)
return (0);
-
+
struct bufItem *buf = ((struct parserData *)param)->buflist->first_buf;
while ((buf->id != $2) && (buf != NULL))
@@ -435,9 +435,9 @@
int fore = ($2 == 0 ? 1 : 0);
int rear = ($2 == 1 ? 1 : 0);
int revert = ($2 == 2 ? 1 : 0);
-
+
int dummy=0;
-
+
int at_front = g15_send_cmd (((struct parserData *)param)->g15screen_fd, G15DAEMON_IS_FOREGROUND, dummy);
int user_to_front = g15_send_cmd(((struct parserData *)param)->g15screen_fd,G15DAEMON_IS_USER_SELECTED, dummy);
@@ -561,7 +561,7 @@
{
unsigned int dispcol = 0;
unsigned int len = strlen (((struct parserData *)param)->itemptr->string);
-
+
dispcol = getDispCol (len, $4, $5);
g15r_renderString (((struct parserData *)param)->canvas, ((struct parserData *)param)->itemptr->string, row, $4, dispcol, $3);
}
@@ -573,7 +573,7 @@
;
nt_key_command:
- T_KEYL T_NUMBER T_NEWLINE
+ T_KEYL T_NUMBER T_NEWLINE
{
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2010-02-05 05:04:57
|
Revision: 321
http://g15tools.svn.sourceforge.net/g15tools/?rev=321&view=rev
Author: aneurysm9
Date: 2010-02-05 05:04:51 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
G15v1 was catching spurius keypress events that appeared to be G13 keypress events. Add caps to ensure only the G13 gets its keypress events.
Modified Paths:
--------------
trunk/libg15/libg15.c
trunk/libg15/libg15.h
Modified: trunk/libg15/libg15.c
===================================================================
--- trunk/libg15/libg15.c 2010-02-05 03:27:12 UTC (rev 320)
+++ trunk/libg15/libg15.c 2010-02-05 05:04:51 UTC (rev 321)
@@ -47,7 +47,7 @@
DEVICE("Logitech Z-10",0x46d,0x0a07,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
DEVICE("Logitech G15 v2",0x46d,0xc227,G15_LCD|G15_KEYS|G15_DEVICE_5BYTE_RETURN),
DEVICE("Logitech Gamepanel",0x46d,0xc251,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
- DEVICE("Logitech G13",0x46d,0xc21c,G15_LCD|G15_KEYS),
+ DEVICE("Logitech G13",0x46d,0xc21c,G15_LCD|G15_KEYS|G15_DEVICE_G13),
DEVICE(NULL,0,0,0)
};
@@ -858,6 +858,8 @@
{
unsigned char buffer[G15_KEY_READ_LENGTH];
int ret = 0;
+ int caps = 0;
+
#ifdef LIBUSB_BLOCKS
ret = usb_interrupt_read(keyboard_device, g15_keys_endpoint, (char*)buffer, G15_KEY_READ_LENGTH, timeout);
#else
@@ -870,7 +872,8 @@
return G15_ERROR_TRY_AGAIN;
}
- if(buffer[0]==0x25){
+ caps = g15DeviceCapabilities();
+ if((caps & G15_DEVICE_G13) && buffer[0]==0x25){
processKeyEventG13(pressed_keys, buffer);
return G15_NO_ERROR;
}
Modified: trunk/libg15/libg15.h
===================================================================
--- trunk/libg15/libg15.h 2010-02-05 03:27:12 UTC (rev 320)
+++ trunk/libg15/libg15.h 2010-02-05 05:04:51 UTC (rev 321)
@@ -32,6 +32,7 @@
#define G15_KEYS 2
#define G15_DEVICE_IS_SHARED 4
#define G15_DEVICE_5BYTE_RETURN 8
+#define G15_DEVICE_G13 16
#define G15_KEY_READ_LENGTH 9
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2010-02-05 03:27:18
|
Revision: 320
http://g15tools.svn.sourceforge.net/g15tools/?rev=320&view=rev
Author: aneurysm9
Date: 2010-02-05 03:27:12 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
Update testlibg15 to support the extra keys exported by the G13
Modified Paths:
--------------
trunk/testlibg15/testlibg15.cpp
Modified: trunk/testlibg15/testlibg15.cpp
===================================================================
--- trunk/testlibg15/testlibg15.cpp 2010-02-05 03:26:34 UTC (rev 319)
+++ trunk/testlibg15/testlibg15.cpp 2010-02-05 03:27:12 UTC (rev 320)
@@ -62,6 +62,14 @@
cout << "G17 ";
if (key_state & G15_KEY_G18)
cout << "G18 ";
+ if (key_state & G15_KEY_G19)
+ cout << "G19 ";
+ if (key_state & G15_KEY_G20)
+ cout << "G20 ";
+ if (key_state & G15_KEY_G21)
+ cout << "G21 ";
+ if (key_state & G15_KEY_G22)
+ cout << "G22 ";
if (key_state & G15_KEY_M1)
cout << "M1 " ;
@@ -84,6 +92,13 @@
cout << "L5 " ;
if (key_state & G15_KEY_LIGHT)
cout << "LIGHT ";
+/* if (key_state & G15_KEY_JOYBL)
+ cout << "JOYBL ";
+ if (key_state & G15_KEY_JOYBD)
+ cout << "JOYBD ";
+ if (key_state & G15_KEY_JOYBS)
+ cout << "JOYBS ";
+ */
cout << endl;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2010-02-05 03:26:41
|
Revision: 319
http://g15tools.svn.sourceforge.net/g15tools/?rev=319&view=rev
Author: aneurysm9
Date: 2010-02-05 03:26:34 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
Add support for the Logitech G13 game device. Thanks to Devlin from the G15tools.com forums.
Modified Paths:
--------------
trunk/libg15/ChangeLog
trunk/libg15/Makefile.am
trunk/libg15/README
trunk/libg15/configure.in
trunk/libg15/libg15.c
trunk/libg15/libg15.h
Modified: trunk/libg15/ChangeLog
===================================================================
--- trunk/libg15/ChangeLog 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/ChangeLog 2010-02-05 03:26:34 UTC (rev 319)
@@ -47,3 +47,5 @@
* Add laptop GamePanel support.
1.2.7
* Fix keypress detection for G15v2 keyboards
+1.3
+* Add support for the G13 device
Modified: trunk/libg15/Makefile.am
===================================================================
--- trunk/libg15/Makefile.am 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/Makefile.am 2010-02-05 03:26:34 UTC (rev 319)
@@ -1,7 +1,7 @@
LLIBDIR=@LIBDIR@
lib_LTLIBRARIES = libg15.la
libg15_la_SOURCES = libg15.h libg15.c
-libg15_la_LDFLAGS = -version-info 1:0:0
+libg15_la_LDFLAGS = -version-info 1:1:0
include_HEADERS= libg15.h
EXTRA_DIST = debian rpm
Modified: trunk/libg15/README
===================================================================
--- trunk/libg15/README 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/README 2010-02-05 03:26:34 UTC (rev 319)
@@ -7,3 +7,4 @@
- Z10 speakers
- 2nd revision of the G15 (amber backlight, 6 'G' keys, LCD)
- Gamepanel available on some laptops
+- G13 game device
Modified: trunk/libg15/configure.in
===================================================================
--- trunk/libg15/configure.in 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/configure.in 2010-02-05 03:26:34 UTC (rev 319)
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(libg15, 1.2.7, mla...@us...)
+AC_INIT(libg15, 1.3, mla...@us...)
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET()
Modified: trunk/libg15/libg15.c
===================================================================
--- trunk/libg15/libg15.c 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/libg15.c 2010-02-05 03:26:34 UTC (rev 319)
@@ -47,6 +47,7 @@
DEVICE("Logitech Z-10",0x46d,0x0a07,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
DEVICE("Logitech G15 v2",0x46d,0xc227,G15_LCD|G15_KEYS|G15_DEVICE_5BYTE_RETURN),
DEVICE("Logitech Gamepanel",0x46d,0xc251,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
+ DEVICE("Logitech G13",0x46d,0xc21c,G15_LCD|G15_KEYS),
DEVICE(NULL,0,0,0)
};
@@ -611,6 +612,96 @@
}
}
+static void processKeyEventG13(unsigned int *pressed_keys, unsigned char *buffer)
+{
+ int i;
+
+ *pressed_keys = 0;
+
+ g15_log(stderr,G15_LOG_WARN,"Keyboard G13: %x, %x, %x, %x, %x, %x, %x, %x, %x\n",buffer[0],buffer[1],buffer[2],buffer[3],buffer[4],buffer[5],buffer[6],buffer[7],buffer[8]);
+
+ if (buffer[0] == 0x25)
+ {
+ if (buffer[3]&0x01)
+ *pressed_keys |= G15_KEY_G1;
+ if (buffer[3]&0x02)
+ *pressed_keys |= G15_KEY_G2;
+ if (buffer[3]&0x04)
+ *pressed_keys |= G15_KEY_G3;
+ if (buffer[3]&0x08)
+ *pressed_keys |= G15_KEY_G4;
+ if (buffer[3]&0x10)
+ *pressed_keys |= G15_KEY_G5;
+ if (buffer[3]&0x20)
+ *pressed_keys |= G15_KEY_G6;
+ if (buffer[3]&0x40)
+ *pressed_keys |= G15_KEY_G7;
+ if (buffer[3]&0x80)
+ *pressed_keys |= G15_KEY_G8;
+
+ if (buffer[4]&0x01)
+ *pressed_keys |= G15_KEY_G9;
+ if (buffer[4]&0x02)
+ *pressed_keys |= G15_KEY_G10;
+ if (buffer[4]&0x04)
+ *pressed_keys |= G15_KEY_G11;
+ if (buffer[4]&0x08)
+ *pressed_keys |= G15_KEY_G12;
+ if (buffer[4]&0x10)
+ *pressed_keys |= G15_KEY_G13;
+ if (buffer[4]&0x20)
+ *pressed_keys |= G15_KEY_G14;
+ if (buffer[4]&0x40)
+ *pressed_keys |= G15_KEY_G15;
+ if (buffer[4]&0x80)
+ *pressed_keys |= G15_KEY_G16;
+ if (buffer[5]&0x01)
+ *pressed_keys |= G15_KEY_G17;
+ if (buffer[5]&0x02)
+ *pressed_keys |= G15_KEY_G18;
+ if (buffer[5]&0x04)
+ *pressed_keys |= G15_KEY_G19;
+ if (buffer[5]&0x08)
+ *pressed_keys |= G15_KEY_G20;
+ if (buffer[5]&0x10)
+ *pressed_keys |= G15_KEY_G21;
+ if (buffer[5]&0x20)
+ *pressed_keys |= G15_KEY_G22;
+ if (buffer[5]&0x80)
+ *pressed_keys |= G15_KEY_LIGHT;
+
+ if (buffer[6]&0x01)
+ *pressed_keys |= G15_KEY_L1;
+ if (buffer[6]&0x02)
+ *pressed_keys |= G15_KEY_L2;
+ if (buffer[6]&0x04)
+ *pressed_keys |= G15_KEY_L3;
+ if (buffer[6]&0x08)
+ *pressed_keys |= G15_KEY_L4;
+ if (buffer[6]&0x10)
+ *pressed_keys |= G15_KEY_L5;
+
+ if (buffer[6]&0x20)
+ *pressed_keys |= G15_KEY_M1;
+ if (buffer[6]&0x40)
+ *pressed_keys |= G15_KEY_M2;
+ if (buffer[6]&0x80)
+ *pressed_keys |= G15_KEY_M3;
+ if (buffer[7]&0x01)
+ *pressed_keys |= G15_KEY_MR;
+
+ /*
+ if (buffer[7]&0x02)
+ *pressed_keys |= G15_KEY_JOYBL;
+ if (buffer[7]&0x04)
+ *pressed_keys |= G15_KEY_JOYBD;
+ if (buffer[7]&0x08)
+ *pressed_keys |= G15_KEY_JOYBS;
+ */
+ }
+
+}
+
static void processKeyEvent9Byte(unsigned int *pressed_keys, unsigned char *buffer)
{
int i;
@@ -778,6 +869,11 @@
if(buffer[0] == 1)
return G15_ERROR_TRY_AGAIN;
}
+
+ if(buffer[0]==0x25){
+ processKeyEventG13(pressed_keys, buffer);
+ return G15_NO_ERROR;
+ }
switch(ret) {
case 5:
Modified: trunk/libg15/libg15.h
===================================================================
--- trunk/libg15/libg15.h 2009-09-23 23:05:21 UTC (rev 318)
+++ trunk/libg15/libg15.h 2010-02-05 03:26:34 UTC (rev 319)
@@ -126,22 +126,31 @@
G15_KEY_G16 = 1<<15,
G15_KEY_G17 = 1<<16,
G15_KEY_G18 = 1<<17,
-
+ G15_KEY_G19 = 1<<28,
+ G15_KEY_G20 = 1<<29,
+ G15_KEY_G21 = 1<<30,
+ G15_KEY_G22 = 1<<31,
+
G15_KEY_M1 = 1<<18,
G15_KEY_M2 = 1<<19,
G15_KEY_M3 = 1<<20,
G15_KEY_MR = 1<<21,
-
+
G15_KEY_L1 = 1<<22,
G15_KEY_L2 = 1<<23,
G15_KEY_L3 = 1<<24,
G15_KEY_L4 = 1<<25,
G15_KEY_L5 = 1<<26,
-
+
G15_KEY_LIGHT = 1<<27
+
+ //need to add them to the enum but not enough positions left
+ // G15_KEY_JOYBL = 1<<32,
+ // G15_KEY_JOYBD = 1<<33,
+ // G15_KEY_JOYBS = 1<<34
};
-
+
/* this one return G15_NO_ERROR on success, something
* else otherwise (for instance G15_ERROR_OPENING_USB_DEVICE */
int initLibG15();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ste...@us...> - 2009-06-10 13:07:59
|
Revision: 316
http://g15tools.svn.sourceforge.net/g15tools/?rev=316&view=rev
Author: SteelSide
Date: 2009-06-10 13:07:48 +0000 (Wed, 10 Jun 2009)
Log Message:
-----------
Return the FT_New_Face returncode in ttfLoad. Changed drawIcon according to forum patch (see TODO item).
Modified Paths:
--------------
trunk/libg15render/src/libg15render.h
trunk/libg15render/src/pixel.c
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-24 00:24:11 UTC (rev 315)
+++ trunk/libg15render/src/libg15render.h 2009-06-10 13:07:48 UTC (rev 316)
@@ -65,9 +65,9 @@
/** g15glyph::buffer holds glyph data */
unsigned char *buffer;
/** g15glyph::width - width of the glyph, without padding */
- unsigned char width;
+ unsigned char width;
/** g15glyph::gap - recommended gap between this character and the next */
- unsigned char gap;
+ unsigned char gap;
}g15glyph;
/** \brief Structure holding a single font. One g15font struct is needed per size. */
@@ -165,7 +165,7 @@
/** \brief render glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph */
int g15r_renderG15Glyph(g15canvas *canvas, g15font *font,
unsigned char character,
- int top_left_pixel_x, int top_left_pixel_y,
+ int top_left_pixel_x, int top_left_pixel_y,
int colour, int paint_bg);
/** \brief Render a string in font 'font' to canvas */
void g15r_G15FontRenderString (g15canvas * canvas, g15font *font,
@@ -173,12 +173,12 @@
int row, unsigned int sx, unsigned int sy,
int colour, int paint_bg);
/** \brief Print a string using the G15 default font at size 'size' */
-void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y,
+void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y,
int size, int center, int colour, int row);
#ifdef TTF_SUPPORT
/** \brief Loads a font through the FreeType2 library*/
- void g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize,
+ int g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize,
int face_num);
/** \brief Prints a string in a given font*/
void g15r_ttfPrint (g15canvas * canvas, int x, int y, int fontsize,
Modified: trunk/libg15render/src/pixel.c
===================================================================
--- trunk/libg15render/src/pixel.c 2009-04-24 00:24:11 UTC (rev 315)
+++ trunk/libg15render/src/pixel.c 2009-06-10 13:07:48 UTC (rev 316)
@@ -32,11 +32,11 @@
*y = tmp;
}
-/**
+/**
* The area with an upper left corner at (x1, y1) and lower right corner at (x2, y2) will be
* filled with color if fill>0 or the current contents of the area will be reversed if fill==0.
- *
- * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x1 Defines leftmost bound of area to be filled.
* \param y1 Defines uppermost bound of area to be filled.
* \param x2 Defines rightmost bound of area to be filled.
@@ -65,7 +65,7 @@
/**
* A 1-bit bitmap defined in colormap[] is drawn to the canvas with an upper left corner at (x1, y1)
* and a lower right corner at (x1+width, y1+height).
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x1 Defines the leftmost bound of the area to be drawn.
* \param y1 Defines the uppermost bound of the area to be drawn.
@@ -90,7 +90,7 @@
/**
* A line of color is drawn from (px1, py1) to (px2, py2).
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param px1 X component of point 1.
* \param py1 Y component of point 1.
@@ -102,7 +102,7 @@
g15r_drawLine (g15canvas * canvas, int px1, int py1, int px2, int py2,
const int color)
{
- /*
+ /*
* Bresenham's Line Algorithm
* http://en.wikipedia.org/wiki/Bresenham's_algorithm
*/
@@ -150,10 +150,10 @@
/**
* Draws a box around the area bounded by (x1, y1) and (x2, y2).
- *
+ *
* The box will be filled if fill != 0 and the sides will be thick pixels wide.
- *
- * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x1 Defines leftmost bound of the box.
* \param y1 Defines uppermost bound of the box.
* \param x2 Defines rightmost bound of the box.
@@ -192,10 +192,10 @@
/**
* Draws a circle centered at (x, y) with a radius of r.
- *
+ *
* The circle will be filled if fill != 0.
- *
- * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x Defines horizontal center of the circle.
* \param y Defines vertical center of circle.
* \param r Defines radius of circle.
@@ -240,10 +240,10 @@
/**
* Draws a rounded box around the area bounded by (x1, y1) and (x2, y2).
- *
+ *
* The box will be filled if fill != 0.
- *
- * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x1 Defines leftmost bound of the box.
* \param y1 Defines uppermost bound of the box.
* \param x2 Defines rightmost bound of the box.
@@ -325,7 +325,7 @@
/**
* Given a maximum value, and a value between 0 and that maximum value, calculate and draw a bar showing that percentage.
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x1 Defines leftmost bound of the bar.
* \param y1 Defines uppermost bound of the bar.
@@ -381,16 +381,16 @@
/**
* wbmp splash screen loader - assumes image is 160x43
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param filename A string holding the path to the wbmp to be displayed.
*/
-int
+int
g15r_loadWbmpSplash(g15canvas *canvas, char *filename)
{
int width=0, height=0;
char *buf;
-
+
buf = g15r_loadWbmpToBuf(filename,
&width,
&height);
@@ -400,7 +400,7 @@
}
/**
- * Draw an icon to a canvas
+ * Draw an icon to a canvas
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated in is found.
* \param buf A pointer to the buffer holding the icon to be displayed.
@@ -409,15 +409,18 @@
* \param width Width of the image in buf.
* \param height Height of the image in buf.
*/
-void
+void
g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height)
{
int y,x,val;
unsigned int pixel_offset = 0;
unsigned int byte_offset, bit_offset;
- for (y=0; y < height - 1; y++)
- for (x=0; x < width - 1; x++)
+ //TODO:http://www.g15tools.com/forum/viewtopic.php?p=314#p314
+ // Does his new piece of code work? Is it better than below? If so, replace.
+ for (y=0; y < height; y++)
+ {
+ for (x=0; x < width; x++)
{
pixel_offset = y * width + x;
byte_offset = pixel_offset / BYTE_SIZE;
@@ -426,6 +429,7 @@
val = (buf[byte_offset] & (1 << bit_offset)) >> bit_offset;
g15r_setPixel (canvas, x + my_x, y + my_y, val);
}
+ }
}
/**
@@ -441,7 +445,7 @@
* \param start_y Y offset for reading sprite from buf.
* \param total_width Width of the set of sprites held in buf.
*/
-void
+void
g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)
{
int y,x,val;
@@ -467,7 +471,7 @@
* \param img_width A pointer to an int that will hold the image width on return.
* \param img_height A pointer to an int that will hold the image height on return.
*/
-char *
+char *
g15r_loadWbmpToBuf(char *filename, int *img_width, int *img_height)
{
int wbmp_fd;
@@ -478,14 +482,14 @@
unsigned char headerbytes[5];
unsigned int pixel_offset = 0;
unsigned int byte_offset, bit_offset;
-
+
wbmp_fd=open(filename,O_RDONLY);
if(!wbmp_fd){
return NULL;
}
-
+
retval=read(wbmp_fd,headerbytes,5);
-
+
if(retval){
if (headerbytes[2] & 1) {
*img_width = ((unsigned char)headerbytes[2] ^ 1) | (unsigned char)headerbytes[3];
@@ -543,19 +547,19 @@
* \param y2 Defines bottommost bound of the number.
* \param color The number will be drawn this color.
* \param num The number to be drawn.
- */
-void
+ */
+void
g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)
{
x1 += 2;
x2 -= 2;
-
+
switch(num){
case 0:
g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
g15r_pixelBox (canvas, x1 +5, y1 +5, x2 -5, y2 - 6, 1 - color, 1, 1);
break;
- case 1:
+ case 1:
g15r_pixelBox (canvas, x2-5, y1, x2, y2 , color, 1, 1);
g15r_pixelBox (canvas, x1, y1, x2 -5, y2, 1 - color, 1, 1);
break;
@@ -598,11 +602,11 @@
g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), 1 - color, 1, 1);
g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2, 1 - color, 1, 1);
break;
- case 10:
+ case 10:
g15r_pixelBox (canvas, x2-5, y1+5, x2, y1+10 , color, 1, 1);
g15r_pixelBox (canvas, x2-5, y2-10, x2, y2-5 , color, 1, 1);
break;
- case 11:
+ case 11:
g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), color, 1, 1);
break;
case 12:
@@ -628,7 +632,7 @@
int z = 0;
unsigned char byte;
int bytes_per_row = ceil ((double) width / 8);
-
+
int bits_left = width;
int current_bit = 0;
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-24 00:24:11 UTC (rev 315)
+++ trunk/libg15render/src/text.c 2009-06-10 13:07:48 UTC (rev 316)
@@ -23,7 +23,7 @@
static g15font *defaultfont[40];
-/** Render a character in std large font
+/** Render a character in std large font
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param col size-dependent column to start rendering.
* \param row size-dependent row to start rendering.
@@ -82,7 +82,7 @@
}
-/**
+/**
* Render a string in the designated size
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param stringOut An unsigned char pointer to the string which is to be printed.
@@ -101,13 +101,14 @@
#ifdef TTF_SUPPORT
/**
* Load a font for use with FreeType2 font support
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param fontname Absolute pathname to font file to be loaded.
* \param fontsize Size in points for font to be loaded.
* \param face_num Slot into which font face will be loaded.
+ * \return 0 for success or FreeType2 errorcode.
*/
-void
+int
g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize, int face_num)
{
int errcode = 0;
@@ -139,6 +140,7 @@
FT_Set_Char_Size (canvas->ttf_face[face_num][0], 0,
canvas->ttf_fontsize[face_num] * 64, 90, 0);
}
+ return errcode;
}
int
@@ -235,7 +237,7 @@
/**
* Render a string with a FreeType2 font
- *
+ *
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x initial x position for string.
* \param y initial y position for string.
@@ -280,7 +282,7 @@
/* G15Font Support */
-/**
+/**
* Load a g15 font from file.
* \param filename string containing full name and location of font to load.
* \return pointer to completed g15font structure.
@@ -298,7 +300,7 @@
fprintf(stderr,"loadG15Font: %s exists but cannot be read. Permissions problem?\n",filename);
return NULL;
}
-
+
if(!(file=fopen(filename,"rb")))
return NULL;
@@ -316,16 +318,16 @@
font->font_height = buffer[4] | (buffer[5] << 8);
font->ascender_height = buffer[6] | (buffer[7] << 8);
font->lineheight = buffer[8] | (buffer[9] << 8);
-
+
/* any future expansion that require more than one bit to be set should be recorded at the end of the file, */
/* with the extended-feature bit (not defined as yet, probably 1) set here */
/* The first byte of the extended packet should indicate the extension data type (none defined yet) */
/* The second byte should indicate length in bytes of the packet to read, not inclusive of these two bytes */
/* followed by the extended data. This should allow for a degree of backward compatibility between future versions */
/* should they arise. */
-
+
/* features = buffer[10] | (buffer[11] << 8) */
-
+
font->numchars = buffer[12] | (buffer[13] << 8);
font->default_gap = buffer[14];
unsigned int current_alloc = 2048;
@@ -349,12 +351,12 @@
font->active[character] = 1;
glyphPtr+=(font->font_height * ((font->glyph[character].width + 7) / 8));
}
-
+
fclose(file);
- return (font);
+ return (font);
}
-/**
+/**
* Save g15font struct to given file.
* \param oFilename string containing full name and location of font to save.
* \param font g15font structure containing glyphs. Glyphs to be saved should have the corresponding active[glyph] set.
@@ -365,10 +367,10 @@
FILE *f;
unsigned int i;
unsigned char fntheader[G15_FONT_HEADER_SIZE];
-
+
if(font==NULL)
return -1;
-
+
f = fopen(oFilename, "w+b");
if(f==NULL)
return -1;
@@ -420,7 +422,7 @@
return 0;
}
-/**
+/**
* De-allocate memory associated with g15font struct, including glyph buffers
* \param font g15font structure containing glyphs.
*/
@@ -433,7 +435,7 @@
}
}
-/**
+/**
* Calculate width (in pixels) of given string if rendered in font 'font'.
* \param font Loaded g15font structure as returned by g15r_loadG15Font()
* \param string Pointer to string for width calculations.
@@ -443,7 +445,7 @@
int i;
int totalwidth=0;
if(font==NULL) return 0;
-
+
font->glyph[32].gap = 0;
for(i=0;i<strlen(string);i++)
@@ -452,18 +454,18 @@
return totalwidth;
}
-/**
+/**
* Return g15font structure containing the default font at requested size
* loading the font if needed.
* \param integer pointsize argument in the range of 0-39
* \return pointer to g15font struct containing font at requested size or NULL if not valid.
*/
-g15font * g15r_requestG15DefaultFont (int size)
+g15font * g15r_requestG15DefaultFont (int size)
{
char filename[128];
if (size<0) size=0;
if (size>39) size=39;
-
+
/* check if previously loaded, otherwise load it now */
if(!defaultfont[size]) {
snprintf(filename,128,"%s/G15/default-%.2i.fnt",G15FONT_DIR,size);
@@ -500,19 +502,19 @@
top_left_pixel_y-=font->font_height - font->ascender_height - 1 ;
w = font->glyph[character].width + (7-(font->glyph[character].width % 8 ));
- if(font->glyph[character].width%8==0)
+ if(font->glyph[character].width%8==0)
w = font->glyph[character].width-1;
x=0;y=0;
if(paint_bg)
- g15r_pixelBox (canvas, top_left_pixel_x, top_left_pixel_y-1,
- top_left_pixel_x + font->glyph[character].width+font->default_gap,
+ g15r_pixelBox (canvas, top_left_pixel_x, top_left_pixel_y-1,
+ top_left_pixel_x + font->glyph[character].width+font->default_gap,
top_left_pixel_y + font->lineheight, colour^1, 1, 1);
for (bp=0;bp<bufferlen ;bp++){
for (i=0;i<8;i++) {
- if( x > w ) {
+ if( x > w ) {
x=0;y++;
}
x++;
@@ -523,7 +525,7 @@
if(paint_bg)
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,colour^1);
}
- }
+ }
}
if(character!=32)
return font->glyph[character].width + font->default_gap;
@@ -547,9 +549,9 @@
int prevwidth=0;
if(font==NULL)
return;
-
+
sy += ( font->lineheight * row );
-
+
for(i=0;i<strlen(string);i++){
prevwidth = g15r_renderG15Glyph (canvas, font,string[i], sx += prevwidth, sy, colour, paint_bg);
}
@@ -568,11 +570,11 @@
/* print string with the default G15Font, with on-demand loading of required sized bitmaps */
void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y, int size, int center, int colour, int row) {
int xc, paint_bg;
-
+
/* check if previously loaded, otherwise load it now */
if(g15r_requestG15DefaultFont(size)==NULL)
return;
-
+
if(size<3)
{
paint_bg=1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-24 00:24:23
|
Revision: 315
http://g15tools.svn.sourceforge.net/g15tools/?rev=315&view=rev
Author: mlampard
Date: 2009-04-24 00:24:11 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
Add defines for text justification.
Modified Paths:
--------------
trunk/libg15render/src/libg15render.h
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-23 17:06:14 UTC (rev 314)
+++ trunk/libg15render/src/libg15render.h 2009-04-24 00:24:11 UTC (rev 315)
@@ -39,6 +39,9 @@
#define G15_CHAR_HEADER_SIZE 4
#define G15_MAX_GLYPH 256
+#define G15_JUSTIFY_LEFT 0
+#define G15_JUSTIFY_CENTER 1
+#define G15_JUSTIFY_RIGHT 2
/** \brief This structure holds the data need to render objects to the LCD screen.*/
typedef struct g15canvas
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2009-04-23 17:06:24
|
Revision: 314
http://g15tools.svn.sourceforge.net/g15tools/?rev=314&view=rev
Author: robynhub
Date: 2009-04-23 17:06:14 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
Updated version number
Modified Paths:
--------------
trunk/g15cat/configure.ac
trunk/g15cat/g15cat.h
Modified: trunk/g15cat/configure.ac
===================================================================
--- trunk/g15cat/configure.ac 2009-04-23 17:03:30 UTC (rev 313)
+++ trunk/g15cat/configure.ac 2009-04-23 17:06:14 UTC (rev 314)
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT(g15cat, 1.1, rob...@gm...)
+AC_INIT(g15cat, 1.3, rob...@gm...)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([g15cat.c])
Modified: trunk/g15cat/g15cat.h
===================================================================
--- trunk/g15cat/g15cat.h 2009-04-23 17:03:30 UTC (rev 313)
+++ trunk/g15cat/g15cat.h 2009-04-23 17:06:14 UTC (rev 314)
@@ -29,7 +29,7 @@
#define TM_LINES 5
#define TS_LINES 7
#define TL_LINES 3
-#define G15CAT_VERSION "1.2"
+#define G15CAT_VERSION "1.3"
#define TRUE 1
#define FALSE 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2009-04-23 17:03:44
|
Revision: 313
http://g15tools.svn.sourceforge.net/g15tools/?rev=313&view=rev
Author: robynhub
Date: 2009-04-23 17:03:30 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
Update M and L sizes to truetype fonts. From this version libg15render 1.3 is needed.
Modified Paths:
--------------
trunk/g15cat/g15cat.c
trunk/g15cat/g15cat.h
Modified: trunk/g15cat/g15cat.c
===================================================================
--- trunk/g15cat/g15cat.c 2009-04-23 00:44:39 UTC (rev 312)
+++ trunk/g15cat/g15cat.c 2009-04-23 17:03:30 UTC (rev 313)
@@ -140,11 +140,11 @@
} else if(*format == 'M'){
num_chars = TM_CHARS;
num_lines = TM_LINES;
- dim = G15_TEXT_MED;
+ dim = 7;
} else if(*format == 'L'){
num_chars = TL_CHARS;
num_lines = TL_LINES;
- dim = G15_TEXT_LARGE;
+ dim = 11;
} else {
main_usage();
}
Modified: trunk/g15cat/g15cat.h
===================================================================
--- trunk/g15cat/g15cat.h 2009-04-23 00:44:39 UTC (rev 312)
+++ trunk/g15cat/g15cat.h 2009-04-23 17:03:30 UTC (rev 313)
@@ -27,8 +27,8 @@
#define TS_CHARS 40
#define TL_CHARS 20
#define TM_LINES 5
-#define TS_LINES 6
-#define TL_LINES 4
+#define TS_LINES 7
+#define TL_LINES 3
#define G15CAT_VERSION "1.2"
#define TRUE 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-23 00:44:41
|
Revision: 312
http://g15tools.svn.sourceforge.net/g15tools/?rev=312&view=rev
Author: mlampard
Date: 2009-04-23 00:44:39 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
The g15font api has beed extended slightly. Add define to notify apps.
Modified Paths:
--------------
trunk/libg15render/src/libg15render.h
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-23 00:38:55 UTC (rev 311)
+++ trunk/libg15render/src/libg15render.h 2009-04-23 00:44:39 UTC (rev 312)
@@ -19,6 +19,7 @@
#endif
#define G15R_FONT_SUPPORT 1
+#define G15R_FONT_API_V2 1
#define BYTE_SIZE 8
#define G15_BUFFER_LEN 1048
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-23 00:39:03
|
Revision: 311
http://g15tools.svn.sourceforge.net/g15tools/?rev=311&view=rev
Author: mlampard
Date: 2009-04-23 00:38:55 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
change default linespacing to use the typefaces embedded lineheight rather than ascender height. minor cosmetic changes.
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 18:12:23 UTC (rev 310)
+++ trunk/libg15render/src/text.c 2009-04-23 00:38:55 UTC (rev 311)
@@ -453,7 +453,8 @@
}
/**
- * Return g15font structure containing the default font at requested size
+ * Return g15font structure containing the default font at requested size
+ * loading the font if needed.
* \param integer pointsize argument in the range of 0-39
* \return pointer to g15font struct containing font at requested size or NULL if not valid.
*/
@@ -546,9 +547,11 @@
int prevwidth=0;
if(font==NULL)
return;
- sy=sy+(font->ascender_height*row);
+
+ sy += ( font->lineheight * row );
+
for(i=0;i<strlen(string);i++){
- prevwidth=g15r_renderG15Glyph(canvas, font,string[i],sx+=prevwidth, sy,colour, paint_bg);
+ prevwidth = g15r_renderG15Glyph (canvas, font,string[i], sx += prevwidth, sy, colour, paint_bg);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2009-04-22 18:13:33
|
Revision: 310
http://g15tools.svn.sourceforge.net/g15tools/?rev=310&view=rev
Author: robynhub
Date: 2009-04-22 18:12:23 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Draw progress bar even at zero percent.
Modified Paths:
--------------
trunk/libg15render/src/pixel.c
Modified: trunk/libg15render/src/pixel.c
===================================================================
--- trunk/libg15render/src/pixel.c 2009-04-22 09:38:42 UTC (rev 309)
+++ trunk/libg15render/src/pixel.c 2009-04-22 18:12:23 UTC (rev 310)
@@ -341,7 +341,7 @@
int num, int max, int type)
{
float len, length;
- if (max <= 0 || num <= 0)
+ if (max <= 0 || num < 0)
return;
if (num > max)
num = max;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 09:38:44
|
Revision: 309
http://g15tools.svn.sourceforge.net/g15tools/?rev=309&view=rev
Author: mlampard
Date: 2009-04-22 09:38:42 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
remove declarations for no-longer-existant fontdata. more documentation updates.
Modified Paths:
--------------
trunk/libg15render/src/libg15render.h
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-22 09:10:14 UTC (rev 308)
+++ trunk/libg15render/src/libg15render.h 2009-04-22 09:38:42 UTC (rev 309)
@@ -66,7 +66,7 @@
unsigned char gap;
}g15glyph;
-/** \brief Structure holding a single font */
+/** \brief Structure holding a single font. One g15font struct is needed per size. */
typedef struct g15font {
/** g15font::font_height - total max height of font in pixels */
unsigned int font_height;
@@ -131,13 +131,6 @@
/** \brief Clears the canvas and resets the mode switches*/
void g15r_initCanvas (g15canvas * canvas);
-/** \brief Font data for the large (8x8) font*/
- extern unsigned char fontdata_8x8[];
-/** \brief Font data for the medium (7x5) font*/
- extern unsigned char fontdata_7x5[];
-/** \brief Font data for the small (6x4) font*/
- extern unsigned char fontdata_6x4[];
-
/** \brief Renders a character in the large font at (x, y)*/
void g15r_renderCharacterLarge (g15canvas * canvas, int x, int y,
unsigned char character, unsigned int sx,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 09:10:17
|
Revision: 308
http://g15tools.svn.sourceforge.net/g15tools/?rev=308&view=rev
Author: mlampard
Date: 2009-04-22 09:10:14 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
fix g15r_requestG15DefaultFont() docs
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 08:59:19 UTC (rev 307)
+++ trunk/libg15render/src/text.c 2009-04-22 09:10:14 UTC (rev 308)
@@ -455,7 +455,7 @@
/**
* Return g15font structure containing the default font at requested size
* \param integer pointsize argument in the range of 0-39
- * \return g15font struct containing font at requested size or NULL if not valid.
+ * \return pointer to g15font struct containing font at requested size or NULL if not valid.
*/
g15font * g15r_requestG15DefaultFont (int size)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 08:59:23
|
Revision: 307
http://g15tools.svn.sourceforge.net/g15tools/?rev=307&view=rev
Author: mlampard
Date: 2009-04-22 08:59:19 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
add g15r_requestG15DefaultFont() to simplify use of the other font routines
Modified Paths:
--------------
trunk/libg15render/src/libg15render.h
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-22 07:24:49 UTC (rev 306)
+++ trunk/libg15render/src/libg15render.h 2009-04-22 08:59:19 UTC (rev 307)
@@ -163,6 +163,8 @@
void g15r_deleteG15Font(g15font*font);
/** \brief Returns length (in pixels) of string if rendered in font 'font' */
int g15r_testG15FontWidth(g15font *font,char *string);
+/** \brief Returns g15font structure containing the default font at requested size if available */
+g15font * g15r_requestG15DefaultFont (int size);
/** \brief render glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph */
int g15r_renderG15Glyph(g15canvas *canvas, g15font *font,
unsigned char character,
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 07:24:49 UTC (rev 306)
+++ trunk/libg15render/src/text.c 2009-04-22 08:59:19 UTC (rev 307)
@@ -21,6 +21,8 @@
#include <unistd.h>
#include <fcntl.h>
+static g15font *defaultfont[40];
+
/** Render a character in std large font
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param col size-dependent column to start rendering.
@@ -450,6 +452,29 @@
return totalwidth;
}
+/**
+ * Return g15font structure containing the default font at requested size
+ * \param integer pointsize argument in the range of 0-39
+ * \return g15font struct containing font at requested size or NULL if not valid.
+*/
+g15font * g15r_requestG15DefaultFont (int size)
+{
+ char filename[128];
+ if (size<0) size=0;
+ if (size>39) size=39;
+
+ /* check if previously loaded, otherwise load it now */
+ if(!defaultfont[size]) {
+ snprintf(filename,128,"%s/G15/default-%.2i.fnt",G15FONT_DIR,size);
+ defaultfont[size] = g15r_loadG15Font(filename);
+ if((defaultfont[size])==NULL) {
+ fprintf(stderr,"libg15render: Unable to load font \"%s\"\n",filename);
+ return NULL;
+ }
+ }
+ return defaultfont[size];
+}
+
/** Render a character in given font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param font Loaded g15font structure as returned by g15r_loadG15Font()
@@ -539,24 +564,11 @@
*/
/* print string with the default G15Font, with on-demand loading of required sized bitmaps */
void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y, int size, int center, int colour, int row) {
- static g15font *defaultfont[40];
- char filename[128];
int xc, paint_bg;
- if(size<0)
- size=0;
- if(size>39)
- size=39;
-
/* check if previously loaded, otherwise load it now */
- if(!defaultfont[size]) {
- snprintf(filename,128,"%s/G15/default-%.2i.fnt",G15FONT_DIR,size);
- defaultfont[size] = g15r_loadG15Font(filename);
- if((defaultfont[size])==NULL) {
- fprintf(stderr,"libg15render: Unable to load font \"%s\"\n",filename);
- return;
- }
- }
+ if(g15r_requestG15DefaultFont(size)==NULL)
+ return;
if(size<3)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 07:24:51
|
Revision: 306
http://g15tools.svn.sourceforge.net/g15tools/?rev=306&view=rev
Author: mlampard
Date: 2009-04-22 07:24:49 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Fully fill in the background, including gaps, when paint_bg is requested
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 05:10:01 UTC (rev 305)
+++ trunk/libg15render/src/text.c 2009-04-22 07:24:49 UTC (rev 306)
@@ -479,6 +479,11 @@
x=0;y=0;
+ if(paint_bg)
+ g15r_pixelBox (canvas, top_left_pixel_x, top_left_pixel_y-1,
+ top_left_pixel_x + font->glyph[character].width+font->default_gap,
+ top_left_pixel_y + font->lineheight, colour^1, 1, 1);
+
for (bp=0;bp<bufferlen ;bp++){
for (i=0;i<8;i++) {
if( x > w ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 05:10:02
|
Revision: 305
http://g15tools.svn.sourceforge.net/g15tools/?rev=305&view=rev
Author: mlampard
Date: 2009-04-22 05:10:01 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Tweak ascender height for default-03.fnt
Modified Paths:
--------------
trunk/libg15render/fonts/default-03.fnt
Modified: trunk/libg15render/fonts/default-03.fnt
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 04:53:03
|
Revision: 304
http://g15tools.svn.sourceforge.net/g15tools/?rev=304&view=rev
Author: mlampard
Date: 2009-04-22 04:52:52 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
ensure glyphs are set to active on font load
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 02:54:59 UTC (rev 303)
+++ trunk/libg15render/src/text.c 2009-04-22 04:52:52 UTC (rev 304)
@@ -344,6 +344,7 @@
font->glyph[character].buffer = (unsigned char*)glyphPtr;
font->glyph[character].gap = 0;
fread(font->glyph[character].buffer, font->font_height * ((font->glyph[character].width + 7) / 8), 1, file);
+ font->active[character] = 1;
glyphPtr+=(font->font_height * ((font->glyph[character].width + 7) / 8));
}
@@ -462,7 +463,7 @@
{
int x,y,w,bp;
- if(font->glyph[character].buffer==NULL)
+ if(font->glyph[character].buffer==NULL || font->active[character] == 0)
return 0;
unsigned char *buffer = font->glyph[character].buffer;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2009-04-22 02:55:09
|
Revision: 303
http://g15tools.svn.sourceforge.net/g15tools/?rev=303&view=rev
Author: aneurysm9
Date: 2009-04-22 02:54:59 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Documentation cleanup to prepare for next release
Modified Paths:
--------------
trunk/libg15render/Doxyfile
trunk/libg15render/libg15render.3
trunk/libg15render/src/libg15render.h
trunk/libg15render/src/pixel.c
trunk/libg15render/src/text.c
Modified: trunk/libg15render/Doxyfile
===================================================================
--- trunk/libg15render/Doxyfile 2009-04-22 01:07:16 UTC (rev 302)
+++ trunk/libg15render/Doxyfile 2009-04-22 02:54:59 UTC (rev 303)
@@ -450,7 +450,7 @@
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT =
+INPUT = src
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -693,7 +693,7 @@
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
-TOC_EXPAND = NO
+TOC_EXPAND = YES
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
Modified: trunk/libg15render/libg15render.3
===================================================================
--- trunk/libg15render/libg15render.3 2009-04-22 01:07:16 UTC (rev 302)
+++ trunk/libg15render/libg15render.3 2009-04-22 02:54:59 UTC (rev 303)
@@ -1,4 +1,4 @@
-.TH "libg15render" 3 "16 Nov 2006" "libg15render" \" -*- nroff -*-
+.TH "libg15render.h" 3 "21 Apr 2009" "libg15render" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -19,6 +19,14 @@
.RI "struct \fBg15canvas\fP"
.br
.RI "\fIThis structure holds the data need to render objects to the LCD screen. \fP"
+.ti -1c
+.RI "struct \fBg15font\fP"
+.br
+.RI "\fIStructure holding a single font. \fP"
+.ti -1c
+.RI "struct \fBg15glyph\fP"
+.br
+.RI "\fIStructure holding glyph data for g15render font types. \fP"
.in -1c
.SS "Defines"
@@ -30,12 +38,18 @@
.RI "#define \fBG15_BUFFER_LEN\fP 1048"
.br
.ti -1c
+.RI "#define \fBG15_CHAR_HEADER_SIZE\fP 4"
+.br
+.ti -1c
.RI "#define \fBG15_COLOR_BLACK\fP 1"
.br
.ti -1c
.RI "#define \fBG15_COLOR_WHITE\fP 0"
.br
.ti -1c
+.RI "#define \fBG15_FONT_HEADER_SIZE\fP 15"
+.br
+.ti -1c
.RI "#define \fBG15_LCD_HEIGHT\fP 43"
.br
.ti -1c
@@ -48,12 +62,18 @@
.RI "#define \fBG15_MAX_FACE\fP 5"
.br
.ti -1c
+.RI "#define \fBG15_MAX_GLYPH\fP 256"
+.br
+.ti -1c
.RI "#define \fBG15_PIXEL_FILL\fP 1"
.br
.ti -1c
.RI "#define \fBG15_PIXEL_NOFILL\fP 0"
.br
.ti -1c
+.RI "#define \fBG15_TEXT_HUGE\fP 3"
+.br
+.ti -1c
.RI "#define \fBG15_TEXT_LARGE\fP 2"
.br
.ti -1c
@@ -62,6 +82,9 @@
.ti -1c
.RI "#define \fBG15_TEXT_SMALL\fP 0"
.br
+.ti -1c
+.RI "#define \fBG15R_FONT_SUPPORT\fP 1"
+.br
.in -1c
.SS "Functions"
@@ -71,11 +94,15 @@
.br
.RI "\fIFills the screen with pixels of color. \fP"
.ti -1c
+.RI "void \fBg15r_deleteG15Font\fP (\fBg15font\fP *font)"
+.br
+.RI "\fIDe-allocate memory associated with font. \fP"
+.ti -1c
.RI "void \fBg15r_drawBar\fP (\fBg15canvas\fP *canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)"
.br
.RI "\fIDraws a completion bar. \fP"
.ti -1c
-.RI "void \fBg15r_drawBigNum\fP (\fBg15canvas\fP *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
+.RI "void \fBg15r_drawBigNum\fP (\fBg15canvas\fP *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)"
.br
.RI "\fIDraw a large number. \fP"
.ti -1c
@@ -99,6 +126,18 @@
.br
.RI "\fIDraw a sprite to the screen from a wbmp buffer. \fP"
.ti -1c
+.RI "void \fBg15r_drawXBM\fP (\fBg15canvas\fP *canvas, unsigned char *data, int width, int height, int pos_x, int pos_y)"
+.br
+.RI "\fIDraw an XBM image. \fP"
+.ti -1c
+.RI "void \fBg15r_G15FontRenderString\fP (\fBg15canvas\fP *canvas, \fBg15font\fP *font, char *string, int row, unsigned int sx, unsigned int sy, int colour, int paint_bg)"
+.br
+.RI "\fIRender a string in font 'font' to canvas. \fP"
+.ti -1c
+.RI "void \fBg15r_G15FPrint\fP (\fBg15canvas\fP *canvas, char *string, int x, int y, int size, int center, int colour, int row)"
+.br
+.RI "\fIPrint a string using the G15 default font at size 'size'. \fP"
+.ti -1c
.RI "int \fBg15r_getPixel\fP (\fBg15canvas\fP *canvas, unsigned int x, unsigned int y)"
.br
.RI "\fIGets the value of the pixel at (x, y). \fP"
@@ -107,11 +146,15 @@
.br
.RI "\fIClears the canvas and resets the mode switches. \fP"
.ti -1c
+.RI "\fBg15font\fP * \fBg15r_loadG15Font\fP (char *filename)"
+.br
+.RI "\fILoad G15 font and return it in \fBg15font\fP struct. \fP"
+.ti -1c
.RI "int \fBg15r_loadWbmpSplash\fP (\fBg15canvas\fP *canvas, char *filename)"
.br
.RI "\fIDraw a splash screen from 160x43 wbmp file. \fP"
.ti -1c
-.RI "int \fBg15r_loadWbmpToBuf\fP (char *buf, char *filename, int *img_width, int *img_height, int maxlen)"
+.RI "char * \fBg15r_loadWbmpToBuf\fP (char *filename, int *img_width, int *img_height)"
.br
.RI "\fILoad a wbmp file into a buffer. \fP"
.ti -1c
@@ -139,14 +182,26 @@
.br
.RI "\fIRenders a character in the small font at (x, y). \fP"
.ti -1c
+.RI "int \fBg15r_renderG15Glyph\fP (\fBg15canvas\fP *canvas, \fBg15font\fP *font, unsigned char character, int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)"
+.br
+.RI "\fIrender glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph \fP"
+.ti -1c
.RI "void \fBg15r_renderString\fP (\fBg15canvas\fP *canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)"
.br
.RI "\fIRenders a string with font size in row. \fP"
.ti -1c
+.RI "int \fBg15r_saveG15Font\fP (char *oFilename, \fBg15font\fP *font)"
+.br
+.RI "\fISave font in font struct to given file, return 0 on success. \fP"
+.ti -1c
.RI "void \fBg15r_setPixel\fP (\fBg15canvas\fP *canvas, unsigned int x, unsigned int y, int val)"
.br
.RI "\fISets the value of the pixel at (x, y). \fP"
.ti -1c
+.RI "int \fBg15r_testG15FontWidth\fP (\fBg15font\fP *font, char *string)"
+.br
+.RI "\fIReturns length (in pixels) of string if rendered in font 'font'. \fP"
+.ti -1c
.RI "void \fBg15r_ttfLoad\fP (\fBg15canvas\fP *canvas, char *fontname, int fontsize, int face_num)"
.br
.RI "\fILoads a font through the FreeType2 library. \fP"
@@ -175,63 +230,84 @@
.PP
.SS "#define BYTE_SIZE 8"
.PP
-Definition at line 21 of file libg15render.h.
+Definition at line 23 of file libg15render.h.
.PP
Referenced by g15r_drawIcon(), g15r_drawSprite(), g15r_getPixel(), g15r_loadWbmpToBuf(), and g15r_setPixel().
.SS "#define G15_BUFFER_LEN 1048"
.PP
-Definition at line 22 of file libg15render.h.
+Definition at line 24 of file libg15render.h.
.PP
Referenced by g15r_clearScreen(), g15r_initCanvas(), and g15r_loadWbmpSplash().
+.SS "#define G15_CHAR_HEADER_SIZE 4"
+.PP
+Definition at line 38 of file libg15render.h.
+.PP
+Referenced by g15r_loadG15Font(), and g15r_saveG15Font().
.SS "#define G15_COLOR_BLACK 1"
.PP
-Definition at line 27 of file libg15render.h.
+Definition at line 29 of file libg15render.h.
.PP
-Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by g15r_drawRoundBox(), g15r_drawXBM(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), g15r_renderCharacterSmall(), and g15r_renderString().
.SS "#define G15_COLOR_WHITE 0"
.PP
-Definition at line 26 of file libg15render.h.
+Definition at line 28 of file libg15render.h.
.PP
-Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by g15r_drawRoundBox(), and g15r_pixelOverlay().
+.SS "#define G15_FONT_HEADER_SIZE 15"
+.PP
+Definition at line 37 of file libg15render.h.
+.PP
+Referenced by g15r_loadG15Font(), and g15r_saveG15Font().
.SS "#define G15_LCD_HEIGHT 43"
.PP
-Definition at line 24 of file libg15render.h.
+Definition at line 26 of file libg15render.h.
.PP
Referenced by g15r_getPixel(), and g15r_setPixel().
.SS "#define G15_LCD_OFFSET 32"
.PP
-Definition at line 23 of file libg15render.h.
+Definition at line 25 of file libg15render.h.
.SS "#define G15_LCD_WIDTH 160"
.PP
-Definition at line 25 of file libg15render.h.
+Definition at line 27 of file libg15render.h.
.PP
Referenced by g15r_getPixel(), and g15r_setPixel().
.SS "#define G15_MAX_FACE 5"
.PP
-Definition at line 33 of file libg15render.h.
+Definition at line 36 of file libg15render.h.
.PP
Referenced by g15r_ttfLoad().
+.SS "#define G15_MAX_GLYPH 256"
+.PP
+Definition at line 39 of file libg15render.h.
+.PP
+Referenced by g15r_saveG15Font().
.SS "#define G15_PIXEL_FILL 1"
.PP
-Definition at line 32 of file libg15render.h.
+Definition at line 35 of file libg15render.h.
.SS "#define G15_PIXEL_NOFILL 0"
.PP
-Definition at line 31 of file libg15render.h.
+Definition at line 34 of file libg15render.h.
+.SS "#define G15_TEXT_HUGE 3"
+.PP
+Definition at line 33 of file libg15render.h.
.SS "#define G15_TEXT_LARGE 2"
.PP
-Definition at line 30 of file libg15render.h.
+Definition at line 32 of file libg15render.h.
.PP
-Referenced by g15r_renderString().
+Referenced by g15r_renderCharacterLarge().
.SS "#define G15_TEXT_MED 1"
.PP
-Definition at line 29 of file libg15render.h.
+Definition at line 31 of file libg15render.h.
.PP
-Referenced by g15r_renderString().
+Referenced by g15r_renderCharacterMedium().
.SS "#define G15_TEXT_SMALL 0"
.PP
-Definition at line 28 of file libg15render.h.
+Definition at line 30 of file libg15render.h.
.PP
-Referenced by g15r_renderString().
+Referenced by g15r_renderCharacterSmall().
+.SS "#define G15R_FONT_SUPPORT 1"
+.PP
+Definition at line 21 of file libg15render.h.
.SH "Function Documentation"
.PP
.SS "void g15r_clearScreen (\fBg15canvas\fP * canvas, int color)"
@@ -253,6 +329,23 @@
.PP
References g15canvas::buffer, and G15_BUFFER_LEN.
.PP
+.SS "void g15r_deleteG15Font (\fBg15font\fP * font)"
+.PP
+De-allocate memory associated with font.
+.PP
+De-allocate memory associated with \fBg15font\fP struct, including glyph buffers
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfont\fP \fBg15font\fP structure containing glyphs.
+.RE
+.PP
+
+.PP
+Definition at line 424 of file text.c.
+.PP
+References g15font::glyph_buffer.
+.PP
.SS "void g15r_drawBar (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)"
.PP
Draws a completion bar.
@@ -282,11 +375,11 @@
.PP
.PP
-Definition at line 337 of file pixel.c.
+Definition at line 340 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_pixelBox().
.PP
-.SS "void g15r_drawBigNum (\fBg15canvas\fP * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
+.SS "void g15r_drawBigNum (\fBg15canvas\fP * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)"
.PP
Draw a large number.
.PP
@@ -304,14 +397,16 @@
.br
\fIy2\fP Defines bottommost bound of the number.
.br
+\fIcolor\fP The number will be drawn this color.
+.br
\fInum\fP The number to be drawn.
.RE
.PP
.PP
-Definition at line 542 of file pixel.c.
+Definition at line 548 of file pixel.c.
.PP
-References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_pixelBox().
+References g15r_pixelBox().
.PP
.SS "void g15r_drawCircle (\fBg15canvas\fP * canvas, int x, int y, int r, int fill, int color)"
.PP
@@ -338,7 +433,7 @@
.PP
.PP
-Definition at line 203 of file pixel.c.
+Definition at line 206 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
@@ -365,7 +460,7 @@
.PP
.PP
-Definition at line 408 of file pixel.c.
+Definition at line 413 of file pixel.c.
.PP
References BYTE_SIZE, and g15r_setPixel().
.PP
@@ -392,7 +487,7 @@
.PP
.PP
-Definition at line 99 of file pixel.c.
+Definition at line 102 of file pixel.c.
.PP
References g15r_setPixel(), and swap().
.PP
@@ -425,7 +520,7 @@
.PP
.PP
-Definition at line 252 of file pixel.c.
+Definition at line 255 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, g15r_drawLine(), and g15r_setPixel().
.PP
@@ -458,10 +553,103 @@
.PP
.PP
-Definition at line 440 of file pixel.c.
+Definition at line 445 of file pixel.c.
.PP
References BYTE_SIZE, and g15r_setPixel().
.PP
+.SS "void g15r_drawXBM (\fBg15canvas\fP * canvas, unsigned char * data, int width, int height, int pos_x, int pos_y)"
+.PP
+Draw an XBM image.
+.PP
+Draw an XBM Image to the canvas
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated in is found.
+.br
+\fIdata\fP A pointer to the buffer holding the icon to be displayed.
+.br
+\fIwidth\fP Width of the image in data.
+.br
+\fIheight\fP Height of the image in data.
+.br
+\fIpos_x\fP Leftmost boundary of image.
+.br
+\fIpos_y\fP Topmost boundary of image.
+.RE
+.PP
+
+.PP
+Definition at line 625 of file pixel.c.
+.PP
+References G15_COLOR_BLACK, and g15r_setPixel().
+.PP
+.SS "void g15r_G15FontRenderString (\fBg15canvas\fP * canvas, \fBg15font\fP * font, char * string, int row, unsigned int sx, unsigned int sy, int colour, int paint_bg)"
+.PP
+Render a string in font 'font' to canvas.
+.PP
+Render a string in given font.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
+.br
+\fIstring\fP Pointer to string to operate on.
+.br
+\fIrow\fP vertical font-dependent row to start printing on. can usually be left at 0
+.br
+\fIsx\fP horizontal top-left pixel location.
+.br
+\fIsy\fP vertical top-left pixel location.
+.br
+\fIcolour\fP desired colour of character when rendered.
+.br
+\fIpaint_bg\fP if !0, pixels in the glyph background will also be painted, obstructing any image behind the text.
+.RE
+.PP
+
+.PP
+Definition at line 512 of file text.c.
+.PP
+References g15font::ascender_height, and g15r_renderG15Glyph().
+.PP
+Referenced by g15r_G15FPrint().
+.PP
+.SS "void g15r_G15FPrint (\fBg15canvas\fP * canvas, char * string, int x, int y, int size, int center, int colour, int row)"
+.PP
+Print a string using the G15 default font at size 'size'.
+.PP
+Render a string in the default font.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIstring\fP Pointer to string to operate on.
+.br
+\fIx\fP horizontal top-left pixel location.
+.br
+\fIy\fP vertical top-left pixel location.
+.br
+\fIsize\fP if size>= 4, denotes height in pixels. if size<4, standard font sizes are used.
+.br
+\fIcenter\fP Desired text justification. 0==left, 1==centered, 2==right justified.
+.br
+\fIcolour\fP desired colour of character when rendered.
+.br
+\fIrow\fP vertical font-dependent row to start printing on. can usually be left at 0
+.RE
+.PP
+
+.PP
+Definition at line 535 of file text.c.
+.PP
+References g15r_G15FontRenderString(), g15r_loadG15Font(), and g15r_testG15FontWidth().
+.PP
+Referenced by g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), g15r_renderCharacterSmall(), g15r_renderString(), and g15r_ttfPrint().
+.PP
.SS "int g15r_getPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y)"
.PP
Gets the value of the pixel at (x, y).
@@ -502,6 +690,30 @@
.PP
References g15canvas::buffer, g15canvas::ftLib, G15_BUFFER_LEN, g15canvas::mode_cache, g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
+.SS "\fBg15font\fP* g15r_loadG15Font (char * filename)"
+.PP
+Load G15 font and return it in \fBg15font\fP struct.
+.PP
+Load a g15 font from file.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfilename\fP string containing full name and location of font to load.
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+pointer to completed \fBg15font\fP structure.
+.RE
+.PP
+
+.PP
+Definition at line 286 of file text.c.
+.PP
+References g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, G15_CHAR_HEADER_SIZE, G15_FONT_HEADER_SIZE, g15glyph::gap, g15font::glyph, g15font::lineheight, g15font::numchars, and g15glyph::width.
+.PP
+Referenced by g15r_G15FPrint().
+.PP
.SS "int g15r_loadWbmpSplash (\fBg15canvas\fP * canvas, char * filename)"
.PP
Draw a splash screen from 160x43 wbmp file.
@@ -517,32 +729,28 @@
.PP
.PP
-Definition at line 385 of file pixel.c.
+Definition at line 389 of file pixel.c.
.PP
References g15canvas::buffer, G15_BUFFER_LEN, and g15r_loadWbmpToBuf().
.PP
-.SS "int g15r_loadWbmpToBuf (char * buf, char * filename, int * img_width, int * img_height, int maxlen)"
+.SS "char* g15r_loadWbmpToBuf (char * filename, int * img_width, int * img_height)"
.PP
Load a wbmp file into a buffer.
.PP
-basic wbmp loader - loads wbmp into pre-prepared buf.
+basic wbmp loader - loads a wbmp image into a buffer.
.PP
\fBParameters:\fP
.RS 4
-\fIbuf\fP A pointer to the buffer into which the wbmp will be loaded.
-.br
\fIfilename\fP A string holding the path to the wbmp to be loaded.
.br
\fIimg_width\fP A pointer to an int that will hold the image width on return.
.br
\fIimg_height\fP A pointer to an int that will hold the image height on return.
-.br
-\fImaxlen\fP The maximum number of bytes that should be read from filename.
.RE
.PP
.PP
-Definition at line 468 of file pixel.c.
+Definition at line 471 of file pixel.c.
.PP
References BYTE_SIZE.
.PP
@@ -577,7 +785,7 @@
.PP
.PP
-Definition at line 163 of file pixel.c.
+Definition at line 166 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
@@ -606,7 +814,7 @@
.PP
.PP
-Definition at line 74 of file pixel.c.
+Definition at line 77 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
.PP
@@ -635,48 +843,173 @@
.PP
.PP
-Definition at line 45 of file pixel.c.
+Definition at line 48 of file pixel.c.
.PP
References g15r_getPixel(), and g15r_setPixel().
.PP
-.SS "void g15r_renderCharacterLarge (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
+.SS "void g15r_renderCharacterLarge (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the large font at (x, y).
.PP
-Definition at line 22 of file text.c.
+Render a character in std large font
.PP
-References fontdata_8x8, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIcol\fP size-dependent column to start rendering.
+.br
+\fIrow\fP size-dependent row to start rendering.
+.br
+\fIcharacter\fP ascii character to render.
+.br
+\fIsx\fP horizontal top-left pixel location.
+.br
+\fIsy\fP vertical top-left pixel location.
+.RE
.PP
-Referenced by g15r_renderString().
+
.PP
-.SS "void g15r_renderCharacterMedium (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
+Definition at line 33 of file text.c.
.PP
+References G15_COLOR_BLACK, G15_TEXT_LARGE, and g15r_G15FPrint().
+.PP
+.SS "void g15r_renderCharacterMedium (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
+.PP
Renders a character in the meduim font at (x, y).
.PP
-Definition at line 50 of file text.c.
+Render a character in std medium font.
.PP
-References fontdata_7x5, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIcol\fP size-dependent column to start rendering.
+.br
+\fIrow\fP size-dependent row to start rendering.
+.br
+\fIcharacter\fP ascii character to render.
+.br
+\fIsx\fP horizontal top-left pixel location.
+.br
+\fIsy\fP vertical top-left pixel location.
+.RE
.PP
-Referenced by g15r_renderString().
+
.PP
-.SS "void g15r_renderCharacterSmall (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
+Definition at line 52 of file text.c.
.PP
+References G15_COLOR_BLACK, G15_TEXT_MED, and g15r_G15FPrint().
+.PP
+.SS "void g15r_renderCharacterSmall (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
+.PP
Renders a character in the small font at (x, y).
.PP
-Definition at line 77 of file text.c.
+Render a character in std small font.
.PP
-References fontdata_6x4, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIcol\fP size-dependent column to start rendering.
+.br
+\fIrow\fP size-dependent row to start rendering.
+.br
+\fIcharacter\fP ascii character to render.
+.br
+\fIsx\fP horizontal top-left pixel location.
+.br
+\fIsy\fP vertical top-left pixel location.
+.RE
.PP
-Referenced by g15r_renderString().
+
.PP
+Definition at line 72 of file text.c.
+.PP
+References G15_COLOR_BLACK, G15_TEXT_SMALL, and g15r_G15FPrint().
+.PP
+.SS "int g15r_renderG15Glyph (\fBg15canvas\fP * canvas, \fBg15font\fP * font, unsigned char character, int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)"
+.PP
+render glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph
+.PP
+Render a character in given font.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
+.br
+\fIcharacter\fP ascii character to render.
+.br
+\fItop_left_pixel_x\fP horizontal top-left pixel location.
+.br
+\fItop_left_pixel_y\fP vertical top-left pixel location.
+.br
+\fIcolour\fP desired colour of character when rendered.
+.br
+\fIpaint_bg\fP should the background of the character cell be painted?
+.RE
+.PP
+
+.PP
+Definition at line 461 of file text.c.
+.PP
+References g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, g15r_setPixel(), g15font::glyph, and g15glyph::width.
+.PP
+Referenced by g15r_G15FontRenderString().
+.PP
.SS "void g15r_renderString (\fBg15canvas\fP * canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)"
.PP
Renders a string with font size in row.
.PP
-Definition at line 104 of file text.c.
+Render a string in the designated size
.PP
-References G15_TEXT_LARGE, G15_TEXT_MED, G15_TEXT_SMALL, g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIstringOut\fP An unsigned char pointer to the string which is to be printed.
+.br
+\fIrow\fP size-dependent row to start rendering.
+.br
+\fIsize\fP size of printed string. May be 0-3 for standard sizes, or 5-39 in pixel height.
+.br
+\fIsx\fP horizontal top-left pixel location.
+.br
+\fIsy\fP vertical top-left pixel location.
+.RE
.PP
+
+.PP
+Definition at line 93 of file text.c.
+.PP
+References G15_COLOR_BLACK, and g15r_G15FPrint().
+.PP
+.SS "int g15r_saveG15Font (char * oFilename, \fBg15font\fP * font)"
+.PP
+Save font in font struct to given file, return 0 on success.
+.PP
+Save \fBg15font\fP struct to given file.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIoFilename\fP string containing full name and location of font to save.
+.br
+\fIfont\fP \fBg15font\fP structure containing glyphs. Glyphs to be saved should have the corresponding active[glyph] set.
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+0 on success, -1 on failure.
+.RE
+.PP
+
+.PP
+Definition at line 361 of file text.c.
+.PP
+References g15font::active, g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, G15_CHAR_HEADER_SIZE, G15_FONT_HEADER_SIZE, G15_MAX_GLYPH, g15font::glyph, g15font::lineheight, g15font::numchars, and g15glyph::width.
+.PP
.SS "void g15r_setPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y, int val)"
.PP
Sets the value of the pixel at (x, y).
@@ -700,8 +1033,34 @@
.PP
References g15canvas::buffer, BYTE_SIZE, G15_LCD_HEIGHT, G15_LCD_WIDTH, g15r_getPixel(), g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
-Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawIcon(), g15r_drawLine(), g15r_drawRoundBox(), g15r_drawSprite(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawIcon(), g15r_drawLine(), g15r_drawRoundBox(), g15r_drawSprite(), g15r_drawXBM(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), and g15r_renderG15Glyph().
.PP
+.SS "int g15r_testG15FontWidth (\fBg15font\fP * font, char * string)"
+.PP
+Returns length (in pixels) of string if rendered in font 'font'.
+.PP
+Calculate width (in pixels) of given string if rendered in font 'font'.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
+.br
+\fIstring\fP Pointer to string for width calculations.
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+total width in pixels of given string.
+.RE
+.PP
+
+.PP
+Definition at line 439 of file text.c.
+.PP
+References g15font::default_gap, g15glyph::gap, g15font::glyph, and g15glyph::width.
+.PP
+Referenced by g15r_G15FPrint().
+.PP
.SS "void g15r_ttfLoad (\fBg15canvas\fP * canvas, char * fontname, int fontsize, int face_num)"
.PP
Loads a font through the FreeType2 library.
@@ -721,7 +1080,7 @@
.PP
.PP
-Definition at line 145 of file text.c.
+Definition at line 109 of file text.c.
.PP
References g15canvas::ftLib, G15_MAX_FACE, g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
@@ -752,9 +1111,9 @@
.PP
.PP
-Definition at line 283 of file text.c.
+Definition at line 247 of file text.c.
.PP
-References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.
+References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15r_G15FPrint(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
.SH "Variable Documentation"
.PP
@@ -762,17 +1121,14 @@
.PP
Font data for the small (6x4) font.
.PP
-Referenced by g15r_renderCharacterSmall().
.SS "unsigned char \fBfontdata_7x5\fP[]"
.PP
Font data for the medium (7x5) font.
.PP
-Referenced by g15r_renderCharacterMedium().
.SS "unsigned char \fBfontdata_8x8\fP[]"
.PP
Font data for the large (8x8) font.
.PP
-Referenced by g15r_renderCharacterLarge().
.SH "Author"
.PP
Anthony J. Mirabella <mir...@gm...>
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-04-22 01:07:16 UTC (rev 302)
+++ trunk/libg15render/src/libg15render.h 2009-04-22 02:54:59 UTC (rev 303)
@@ -36,6 +36,7 @@
#define G15_MAX_FACE 5
#define G15_FONT_HEADER_SIZE 15
#define G15_CHAR_HEADER_SIZE 4
+#define G15_MAX_GLYPH 256
/** \brief This structure holds the data need to render objects to the LCD screen.*/
typedef struct g15canvas
@@ -76,11 +77,11 @@
/** g15font::numchars - number of glyphs available in this font */
unsigned int numchars;
/** g15font::glyph - contains all glyphs available in this font */
- g15glyph glyph[256]; // allow 256 chars.. ought to be enough for our purposes
+ g15glyph glyph[G15_MAX_GLYPH]; // allow 256 chars.. ought to be enough for our purposes
/** g15font::default_gap - default gap between glyphs (in pixels). */
unsigned int default_gap;
/** g15font::active - each active glyph is set to 1 else 0 */
- unsigned char active[256];
+ unsigned char active[G15_MAX_GLYPH];
/** g15font::glyph_buffer memory pool for glyphs */
char *glyph_buffer;
}g15font;
@@ -116,7 +117,7 @@
char *g15r_loadWbmpToBuf(char *filename, int *img_width, int *img_height);
/** \brief Draw a large number*/
void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num);
-/** \brief Draw an XML image*/
+/** \brief Draw an XBM image*/
void
g15r_drawXBM (g15canvas *canvas, unsigned char* data, int width, int height, int pos_x, int pos_y);
Modified: trunk/libg15render/src/pixel.c
===================================================================
--- trunk/libg15render/src/pixel.c 2009-04-22 01:07:16 UTC (rev 302)
+++ trunk/libg15render/src/pixel.c 2009-04-22 02:54:59 UTC (rev 303)
@@ -541,6 +541,7 @@
* \param y1 Defines uppermost bound of the number.
* \param x2 Defines rightmost bound of the number.
* \param y2 Defines bottommost bound of the number.
+ * \param color The number will be drawn this color.
* \param num The number to be drawn.
*/
void
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-22 01:07:16 UTC (rev 302)
+++ trunk/libg15render/src/text.c 2009-04-22 02:54:59 UTC (rev 303)
@@ -353,7 +353,7 @@
/**
* Save g15font struct to given file.
- * \param ofilename string containing full name and location of font to save.
+ * \param oFilename string containing full name and location of font to save.
* \param font g15font structure containing glyphs. Glyphs to be saved should have the corresponding active[glyph] set.
* \return 0 on success, -1 on failure.
*/
@@ -371,7 +371,7 @@
return -1;
font->numchars=0;
- for(i=0;i<256;i++) {
+ for(i=0;i<G15_MAX_GLYPH;i++) {
if(font->active[i]) {
font->numchars++;
}
@@ -401,7 +401,7 @@
fwrite (fntheader, G15_FONT_HEADER_SIZE, 1, f);
- for(i=0;i<256;i++) {
+ for(i=0;i<G15_MAX_GLYPH;i++) {
if(font->active[i]) {
unsigned char charheader[G15_CHAR_HEADER_SIZE];
@@ -456,6 +456,7 @@
* \param top_left_pixel_x horizontal top-left pixel location.
* \param top_left_pixel_y vertical top-left pixel location.
* \param colour desired colour of character when rendered.
+ * \param paint_bg should the background of the character cell be painted?
*/
int g15r_renderG15Glyph(g15canvas *canvas, g15font *font,unsigned char character,int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-22 01:07:35
|
Revision: 302
http://g15tools.svn.sourceforge.net/g15tools/?rev=302&view=rev
Author: mlampard
Date: 2009-04-22 01:07:16 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Dont render glyph wider than it really is.
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-19 03:22:06 UTC (rev 301)
+++ trunk/libg15render/src/text.c 2009-04-22 01:07:16 UTC (rev 302)
@@ -483,11 +483,13 @@
x=0;y++;
}
x++;
- if( buffer[bp] & (0x80 >> i))
+ if(x<=font->glyph[character].width) {
+ if( buffer[bp] & (0x80 >> i))
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,colour);
- else
+ else
if(paint_bg)
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,colour^1);
+ }
}
}
if(character!=32)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-19 03:22:13
|
Revision: 301
http://g15tools.svn.sourceforge.net/g15tools/?rev=301&view=rev
Author: mlampard
Date: 2009-04-19 03:22:06 +0000 (Sun, 19 Apr 2009)
Log Message:
-----------
output error if G15 font cannot be read for some reason.
Modified Paths:
--------------
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-04-19 02:33:09 UTC (rev 300)
+++ trunk/libg15render/src/text.c 2009-04-19 03:22:06 UTC (rev 301)
@@ -288,22 +288,29 @@
g15font *font = calloc(1,sizeof(g15font));
unsigned char buffer[128];
int i;
- if(access(filename,O_RDONLY)!=0)
+ if(access(filename,F_OK)!=0) {
+ fprintf(stderr,"loadG15Font: %s doesn't exist or has permissions problem.\n",filename);
return NULL;
-
+ }
+ if(access(filename,R_OK)!=0) {
+ fprintf(stderr,"loadG15Font: %s exists but cannot be read. Permissions problem?\n",filename);
+ return NULL;
+ }
+
if(!(file=fopen(filename,"rb")))
return NULL;
- fread(buffer,G15_FONT_HEADER_SIZE,1,file);
- if(buffer[0] != 'G' ||
- buffer[1] != 'F' ||
- buffer[2] != 'N' ||
- buffer[3] != 'T' )
- {
- fclose(file);
- return NULL;
- }
-
+ if(fread(buffer,G15_FONT_HEADER_SIZE,1,file)) {
+ if(buffer[0] != 'G' ||
+ buffer[1] != 'F' ||
+ buffer[2] != 'N' ||
+ buffer[3] != 'T' )
+ {
+ fclose(file);
+ return NULL;
+ }
+ } else
+ return NULL;
font->font_height = buffer[4] | (buffer[5] << 8);
font->ascender_height = buffer[6] | (buffer[7] << 8);
font->lineheight = buffer[8] | (buffer[9] << 8);
@@ -537,6 +544,7 @@
snprintf(filename,128,"%s/G15/default-%.2i.fnt",G15FONT_DIR,size);
defaultfont[size] = g15r_loadG15Font(filename);
if((defaultfont[size])==NULL) {
+ fprintf(stderr,"libg15render: Unable to load font \"%s\"\n",filename);
return;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2009-04-19 02:33:17
|
Revision: 300
http://g15tools.svn.sourceforge.net/g15tools/?rev=300&view=rev
Author: mlampard
Date: 2009-04-19 02:33:09 +0000 (Sun, 19 Apr 2009)
Log Message:
-----------
Cleanup compiler warnings. Remove unused vars. Change g15r_drawXBM declaration to non-static so it can be used by apps.
Modified Paths:
--------------
trunk/libg15render/src/g15fontconvert.c
trunk/libg15render/src/libg15render.h
trunk/libg15render/src/pixel.c
trunk/libg15render/src/text.c
Modified: trunk/libg15render/src/g15fontconvert.c
===================================================================
--- trunk/libg15render/src/g15fontconvert.c 2009-03-29 07:37:05 UTC (rev 299)
+++ trunk/libg15render/src/g15fontconvert.c 2009-04-19 02:33:09 UTC (rev 300)
@@ -20,6 +20,7 @@
#include "libg15render.h"
#include <sys/types.h>
#include <fcntl.h>
+#include <unistd.h>
#ifdef TTF_SUPPORT
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -82,11 +83,11 @@
if(font->ascender_height==0) {
font->ascender_height = font->font_height;
face->size->metrics.ascender = font->font_height<<6;
- printf("modded ascender to %i\n", face->size->metrics.ascender>>6);
+ printf("modded ascender to %i\n", (int)face->size->metrics.ascender>>6);
}
if(face->size->metrics.descender==0) {
face->size->metrics.descender = (font->font_height<<6) - (face->available_sizes->size) ;
- printf("modded descender to %i\n",face->size->metrics.descender>>6);
+ printf("modded descender to %i\n",(int)face->size->metrics.descender>>6);
font->font_height = (face->size->metrics.ascender >> 6) + (face->size->metrics.descender >> 6);
}
if(font->lineheight==0) {
Modified: trunk/libg15render/src/libg15render.h
===================================================================
--- trunk/libg15render/src/libg15render.h 2009-03-29 07:37:05 UTC (rev 299)
+++ trunk/libg15render/src/libg15render.h 2009-04-19 02:33:09 UTC (rev 300)
@@ -117,7 +117,7 @@
/** \brief Draw a large number*/
void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num);
/** \brief Draw an XML image*/
-static void
+void
g15r_drawXBM (g15canvas *canvas, unsigned char* data, int width, int height, int pos_x, int pos_y);
/** \brief Gets the value of the pixel at (x, y)*/
Modified: trunk/libg15render/src/pixel.c
===================================================================
--- trunk/libg15render/src/pixel.c 2009-03-29 07:37:05 UTC (rev 299)
+++ trunk/libg15render/src/pixel.c 2009-04-19 02:33:09 UTC (rev 300)
@@ -341,7 +341,6 @@
int num, int max, int type)
{
float len, length;
- int x;
if (max <= 0 || num <= 0)
return;
if (num > max)
@@ -621,7 +620,7 @@
* \param pos_x Leftmost boundary of image.
* \param pos_y Topmost boundary of image.
*/
-static void
+void
g15r_drawXBM (g15canvas *canvas, unsigned char* data, int width, int height, int pos_x, int pos_y)
{
int y = 0;
Modified: trunk/libg15render/src/text.c
===================================================================
--- trunk/libg15render/src/text.c 2009-03-29 07:37:05 UTC (rev 299)
+++ trunk/libg15render/src/text.c 2009-04-19 02:33:09 UTC (rev 300)
@@ -37,7 +37,7 @@
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
- g15r_G15FPrint (canvas, buf, ((col * 8) + sx), sy, G15_TEXT_LARGE, 0, G15_COLOR_BLACK, row);
+ g15r_G15FPrint (canvas, (char*)buf, ((col * 8) + sx), sy, G15_TEXT_LARGE, 0, G15_COLOR_BLACK, row);
}
/** Render a character in std medium font.
@@ -56,7 +56,7 @@
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
- g15r_G15FPrint (canvas, buf, ((col * 5) + sx), sy, G15_TEXT_MED, 0, G15_COLOR_BLACK, row);
+ g15r_G15FPrint (canvas, (char*)buf, ((col * 5) + sx), sy, G15_TEXT_MED, 0, G15_COLOR_BLACK, row);
}
@@ -76,7 +76,7 @@
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
- g15r_G15FPrint (canvas, buf, ((col * 4) + sx), sy, G15_TEXT_SMALL, 0, G15_COLOR_BLACK, row);
+ g15r_G15FPrint (canvas, (char*)buf, ((col * 4) + sx), sy, G15_TEXT_SMALL, 0, G15_COLOR_BLACK, row);
}
@@ -93,7 +93,7 @@
g15r_renderString (g15canvas * canvas, unsigned char stringOut[], int row,
int size, unsigned int sx, unsigned int sy)
{
- g15r_G15FPrint (canvas, stringOut, sx, sy, size, 0, G15_COLOR_BLACK, row);
+ g15r_G15FPrint (canvas, (char*)stringOut, sx, sy, size, 0, G15_COLOR_BLACK, row);
}
#ifdef TTF_SUPPORT
@@ -247,7 +247,6 @@
g15r_ttfPrint (g15canvas * canvas, int x, int y, int fontsize, int face_num,
int color, int center, char *print_string)
{
- int errcode = 0;
if (canvas->ttf_fontsize[face_num])
{
@@ -335,7 +334,7 @@
current_alloc+=((font->font_height * ((font->glyph[character].width + 7) / 8)*(font->numchars - i)));
glyphBuf = realloc(glyphBuf,(size_t)current_alloc);
}
- font->glyph[character].buffer = glyphPtr;
+ font->glyph[character].buffer = (unsigned char*)glyphPtr;
font->glyph[character].gap = 0;
fread(font->glyph[character].buffer, font->font_height * ((font->glyph[character].width + 7) / 8), 1, file);
glyphPtr+=(font->font_height * ((font->glyph[character].width + 7) / 8));
@@ -416,7 +415,7 @@
* \param font g15font structure containing glyphs.
*/
void g15r_deleteG15Font(g15font*font){
- int i;
+
if(font) {
if(font->glyph_buffer!=NULL)
free(font->glyph_buffer);
@@ -525,7 +524,6 @@
/* print string with the default G15Font, with on-demand loading of required sized bitmaps */
void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y, int size, int center, int colour, int row) {
static g15font *defaultfont[40];
- static int initialised = 0;
char filename[128];
int xc, paint_bg;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ste...@us...> - 2009-03-09 19:39:10
|
Revision: 297
http://g15tools.svn.sourceforge.net/g15tools/?rev=297&view=rev
Author: SteelSide
Date: 2009-03-09 19:39:01 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
Specfile fix
Modified Paths:
--------------
trunk/libg15/rpm/libg15.spec
Modified: trunk/libg15/rpm/libg15.spec
===================================================================
--- trunk/libg15/rpm/libg15.spec 2009-02-05 04:15:45 UTC (rev 296)
+++ trunk/libg15/rpm/libg15.spec 2009-03-09 19:39:01 UTC (rev 297)
@@ -5,7 +5,7 @@
Name: libg15
Version: 1.2.7
Release: 1
-Copyright: GPL
+License: GPL
Group: Applications/System
Source: http://prdownloads.sourceforge.net/g15tools/libg15-1.2.7.tar.bz2
URL: http://sourceforge.net/projects/g15tools
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2009-02-05 04:15:49
|
Revision: 296
http://g15tools.svn.sourceforge.net/g15tools/?rev=296&view=rev
Author: aneurysm9
Date: 2009-02-05 04:15:45 +0000 (Thu, 05 Feb 2009)
Log Message:
-----------
Initial import of G15Tools++
Added Paths:
-----------
trunk/G15Tools++/
trunk/G15Tools++/AUTHORS
trunk/G15Tools++/COPYING
trunk/G15Tools++/ChangeLog
trunk/G15Tools++/INSTALL
trunk/G15Tools++/Makefile.am
trunk/G15Tools++/NEWS
trunk/G15Tools++/README
trunk/G15Tools++/bootstrap
trunk/G15Tools++/config/
trunk/G15Tools++/configure.in
trunk/G15Tools++/src/
trunk/G15Tools++/src/G15Canvas.cpp
trunk/G15Tools++/src/G15Canvas.h
trunk/G15Tools++/src/G15Screen.cpp
trunk/G15Tools++/src/G15Screen.h
trunk/G15Tools++/src/Makefile.am
trunk/G15Tools++/test/
trunk/G15Tools++/test/Makefile.am
trunk/G15Tools++/test/g15logo.h
trunk/G15Tools++/test/test.cpp
Added: trunk/G15Tools++/AUTHORS
===================================================================
--- trunk/G15Tools++/AUTHORS (rev 0)
+++ trunk/G15Tools++/AUTHORS 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1 @@
+Anthony J. Mirabella <mir...@gm...>
Added: trunk/G15Tools++/COPYING
===================================================================
--- trunk/G15Tools++/COPYING (rev 0)
+++ trunk/G15Tools++/COPYING 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Added: trunk/G15Tools++/ChangeLog
===================================================================
--- trunk/G15Tools++/ChangeLog (rev 0)
+++ trunk/G15Tools++/ChangeLog 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,2 @@
+1.0
+* Initial Release
Added: trunk/G15Tools++/INSTALL
===================================================================
--- trunk/G15Tools++/INSTALL (rev 0)
+++ trunk/G15Tools++/INSTALL 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *Note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
Added: trunk/G15Tools++/Makefile.am
===================================================================
--- trunk/G15Tools++/Makefile.am (rev 0)
+++ trunk/G15Tools++/Makefile.am 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1 @@
+SUBDIRS = src test
Added: trunk/G15Tools++/README
===================================================================
--- trunk/G15Tools++/README (rev 0)
+++ trunk/G15Tools++/README 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1 @@
+This is a simple library providing C++ object interfaces to libg15daemon_client and libg15render.
Added: trunk/G15Tools++/bootstrap
===================================================================
--- trunk/G15Tools++/bootstrap (rev 0)
+++ trunk/G15Tools++/bootstrap 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -x
+aclocal -I config
+libtoolize --force --copy
+autoheader
+automake --add-missing --copy
+autoconf
Property changes on: trunk/G15Tools++/bootstrap
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/G15Tools++/configure.in
===================================================================
--- trunk/G15Tools++/configure.in (rev 0)
+++ trunk/G15Tools++/configure.in 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,21 @@
+AC_INIT(G15Tools++, 1.0)
+AC_PREFIX_DEFAULT(/usr)
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE
+AC_LANG(C++)
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+# Checks for libraries.
+AC_CHECK_LIB([g15], [initLibG15],,AC_MSG_ERROR(["libg15 (or its devel package) not found. please install it"]))
+AC_CHECK_LIB([g15daemon_client], [g15_send], ,AC_MSG_ERROR(["libg15daemon_client not found. please install it"]))
+AC_CHECK_LIB([g15render], [g15r_loadWbmpSplash],,AC_MSG_ERROR([">=libg15render-1.2 (or its devel package) not found. please install it"]))
+# Checks for header files.
+AC_CHECK_HEADERS([libg15.h libg15render.h g15daemon_client.h])
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+test/Makefile
+])
+AC_OUTPUT
Added: trunk/G15Tools++/src/G15Canvas.cpp
===================================================================
--- trunk/G15Tools++/src/G15Canvas.cpp (rev 0)
+++ trunk/G15Tools++/src/G15Canvas.cpp 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,271 @@
+#include <libg15.h>
+#include "G15Canvas.h"
+#include <iostream>
+#include <string>
+
+using namespace G15Tools;
+
+G15Canvas::G15Canvas(bool debug) : debug(debug)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Created." << std::endl;
+ }
+ this->canvas = new g15canvas;
+}
+
+G15Canvas::G15Canvas(const G15Canvas& in)
+{
+ this->debug = in.debug;
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Created as copy from G15Canvas(" << &in << ")." << std::endl;
+ }
+ this->canvas = new g15canvas;
+ memcpy(this->canvas->buffer, in.canvas->buffer, G15_BUFFER_LEN);
+}
+
+G15Canvas::~G15Canvas()
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Destroyed." << std::endl;
+ }
+ delete this->canvas;
+}
+
+void G15Canvas::render(G15Screen &screen)
+{
+ if (!this->canvas->mode_cache)
+ {
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Rendering to G15Screen(" << &screen << ")." << std::endl;
+ }
+ screen.sendData((char *) this->canvas->buffer, G15_BUFFER_LEN);
+ }
+}
+
+void G15Canvas::clearScreen(int color)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Clearing screen to " << ((color == G15_COLOR_BLACK) ? "black" : "white") << "." << std::endl;
+ }
+ g15r_clearScreen(this->canvas, color);
+}
+
+void G15Canvas::drawBar(int x1, int y1, int x2, int y2, int color, int num, int max, int type)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " bar ";
+ std::cerr << "of type " << type << " ";
+ std::cerr << "from (" << x1 << "," << y1 << ") ";
+ std::cerr << "to (" << x2 << "," << y2 << ") ";
+ std::cerr << "filled to " << num << " of max " << max << "." << std::endl;
+ }
+ g15r_drawBar(this->canvas, x1, y1, x2, y2, color, num, max, type);
+}
+
+void G15Canvas::drawBigNum(int x1, int y1, int x2, int y2, int color, int num)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing large " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " number " << num;
+ std::cerr << " from (" << x1 << "," << y1 << ") ";
+ std::cerr << "to (" << x2 << "," << y2 << ")." << std::endl;
+ }
+ g15r_drawBigNum(this->canvas, x1, y1, x2, y2, color, num);
+}
+
+void G15Canvas::drawCircle(int x, int y, int r, bool fill, int color)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " circle centered at (" << x << "," << y << ") with radius " << r << ", ";
+ if (!fill)
+ {
+ std::cerr << "not ";
+ }
+ std::cerr << "filled." << std::endl;
+ }
+ g15r_drawCircle(this->canvas, x, y, r, fill, color);
+}
+
+void G15Canvas::drawLine(int x1, int y1, int x2, int y2, int color)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " line ";
+ std::cerr << "from (" << x1 << "," << y1 << ") ";
+ std::cerr << "to (" << x2 << "," << y2 << ")." << std::endl;
+ }
+ g15r_drawLine(this->canvas, x1, y1, x2, y2, color);
+}
+
+void G15Canvas::drawRoundBox(int x1, int y1, int x2, int y2, bool fill, int color)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing round " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " box ";
+ std::cerr << "from (" << x1 << "," << y1 << ") ";
+ std::cerr << "to (" << x2 << "," << y2 << "), ";
+ if (!fill)
+ {
+ std::cerr << "not ";
+ }
+ std::cerr << "filled." << std::endl;
+ }
+ g15r_drawRoundBox(this->canvas, x1, y1, x2, y2, fill, color);
+}
+
+void G15Canvas::drawBox(int x1, int y1, int x2, int y2, int color, int thick, bool fill)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << ((color == G15_COLOR_BLACK) ? "black" : "white") << " box ";
+ std::cerr << "from (" << x1 << "," << y1 << ") ";
+ std::cerr << "to (" << x2 << "," << y2 << "), ";
+ if (!fill)
+ {
+ std::cerr << "with edges " << thick << " pixels thick, not ";
+ }
+ std::cerr << "filled." << std::endl;
+ }
+ g15r_pixelBox(this->canvas, x1, y1, x2, y2, color, thick, fill);
+}
+
+void G15Canvas::drawOverlay(int x, int y, int width, int height, short colormap[])
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << width << "x" << height << " overlay ";
+ std::cerr << "at (" << x << "," << y << ")." << std::endl;
+ }
+ g15r_pixelOverlay(this->canvas, x, y, width, height, colormap);
+}
+
+void G15Canvas::drawCharacter(int size, int x, int y, unsigned char character, int sx, int sy)
+{
+ if (this->debug)
+ {
+ std::string textSize;
+ switch (size)
+ {
+ case G15_TEXT_SMALL:
+ {
+ textSize = "small";
+ break;
+ }
+ case G15_TEXT_MED:
+ {
+ textSize = "medium";
+ break;
+ }
+ case G15_TEXT_LARGE:
+ {
+ textSize = "large";
+ break;
+ }
+
+ }
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << textSize << " character \"" << character << "\" ";
+ std::cerr << "at (" << x << "," << y << ")";
+ if (sx > 0 || sy > 0)
+ {
+ std::cerr << " with offset (" << sx << "," << sy << ")";
+ }
+ std::cerr << "." << std::endl;
+ }
+
+ switch (size)
+ {
+ case G15_TEXT_SMALL:
+ {
+ g15r_renderCharacterSmall(this->canvas, x, y, character, sx, sy);
+ break;
+ }
+ case G15_TEXT_MED:
+ {
+ g15r_renderCharacterMedium(this->canvas, x, y, character, sx, sy);
+ break;
+ }
+ case G15_TEXT_LARGE:
+ {
+ g15r_renderCharacterLarge(this->canvas, x, y, character, sx, sy);
+ break;
+ }
+
+ }
+}
+
+void G15Canvas::drawString(std::string stringOut, int row, int size, int sx, int sy)
+{
+ if (this->debug)
+ {
+ std::string textSize;
+ switch (size)
+ {
+ case G15_TEXT_SMALL:
+ {
+ textSize = "small";
+ break;
+ }
+ case G15_TEXT_MED:
+ {
+ textSize = "medium";
+ break;
+ }
+ case G15_TEXT_LARGE:
+ {
+ textSize = "large";
+ break;
+ }
+
+ }
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Drawing " << textSize << " string \"" << stringOut << "\" ";
+ std::cerr << "in row " << row;
+ if (sx > 0 || sy > 0)
+ {
+ std::cerr << " with offset (" << sx << "," << sy << ")";
+ }
+ std::cerr << "." << std::endl;
+ }
+ g15r_renderString(this->canvas, (unsigned char*)stringOut.c_str(), row, size, sx, sy);
+}
+
+int G15Canvas::getPixel(int x, int y)
+{
+ int r = g15r_getPixel(this->canvas, x, y);
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "The pixel at (" << x << "," << y << ") has value " << r << "." << std::endl;
+ }
+ return r;
+}
+
+void G15Canvas::setPixel(int x, int y, int color)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15Canvas(" << this << "): ";
+ std::cerr << "Setting pixel at (" << x << "," << y << ") to " << color << "." << std::endl;
+ }
+ g15r_setPixel(this->canvas, x, y, color);
+}
Added: trunk/G15Tools++/src/G15Canvas.h
===================================================================
--- trunk/G15Tools++/src/G15Canvas.h (rev 0)
+++ trunk/G15Tools++/src/G15Canvas.h 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,36 @@
+#ifndef G15CANVAS_H_
+#define G15CANVAS_H_
+
+#include <G15Screen.h>
+#include <libg15render.h>
+#include <string>
+
+namespace G15Tools
+{
+ class G15Canvas {
+ protected:
+ g15canvas *canvas;
+ bool debug;
+
+ public:
+ explicit G15Canvas(bool debug = false);
+ G15Canvas(const G15Canvas& in);
+ ~G15Canvas();
+ void render(G15Screen &screen);
+ void clearScreen(int color);
+ void drawBar(int x1, int y1, int x2, int y2, int color, int num, int max, int type);
+ void drawBigNum(int x1, int y1, int x2, int y2, int color, int num);
+ void drawCircle(int x, int y, int r, bool fill, int color);
+ void drawLine(int x1, int y1, int x2, int y2, int color);
+ void drawRoundBox(int x1, int y1, int x2, int y2, bool fill, int color);
+ void drawBox(int x1, int y1, int x2, int y2, int color, int thick, bool fill);
+ void drawOverlay(int x, int y, int width, int height, short colormap[]);
+ void drawCharacter(int size, int x, int y, unsigned char character, int sx = 0, int sy = 0);
+ void drawString(std::string stringOut, int row, int size, int sx = 0, int sy = 0);
+
+ void setPixel(int x, int y, int color);
+ int getPixel(int x, int y);
+ };
+}
+
+#endif
Added: trunk/G15Tools++/src/G15Screen.cpp
===================================================================
--- trunk/G15Tools++/src/G15Screen.cpp (rev 0)
+++ trunk/G15Tools++/src/G15Screen.cpp 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,142 @@
+#include "G15Screen.h"
+#include <libg15.h>
+#include <g15daemon_client.h>
+#include <iostream>
+
+using namespace G15Tools;
+
+G15Screen::G15Screen(bool debug) : debug(debug)
+{
+ this->_init(G15_G15RBUF);
+}
+
+G15Screen::G15Screen(int type, bool debug) : debug(debug)
+{
+ this->_init(type);
+}
+
+G15Screen::G15Screen(const G15Screen& in)
+{
+ this->debug = in.debug;
+ if (this->debug)
+ {
+ std::cerr << "G15Screen(" << this << "): ";
+ std::cerr << "Created as copy from G15Screen(" << &in << ")." << std::endl;
+ }
+ this->_init(in.type);
+ this->keys = in.keys;
+}
+
+G15Screen::~G15Screen()
+{
+ if (this->debug)
+ {
+ std::cerr << "G15screen(" << this << "): ";
+ std::cerr << "Destroyed." << std::endl;
+ }
+ g15_close_screen(this->g15screen_fd);
+}
+
+void G15Screen::_init(int type)
+{
+ this->g15screen_fd = new_g15_screen(type);
+ this->keys = 0;
+ this->type = type;
+ if (this->debug)
+ {
+ std::cerr << "G15screen(" << this << "): ";
+ std::cerr << "Created with g15screen_fd=" << this->g15screen_fd << "." << std::endl;
+ }
+}
+
+int G15Screen::_sendCommand(unsigned char command, unsigned char value)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15screen(" << this << "): ";
+ std::cerr << "Sending command: " << (int)command << " with value: " << (int)value << "." << std::endl;
+ }
+ return g15_send_cmd(this->g15screen_fd, command, value);
+}
+
+int G15Screen::sendData(char *data, unsigned int len)
+{
+ if (this->debug)
+ {
+ std::cerr << "G15screen(" << this << "): ";
+ std::cerr << "Sending " << len << " bytes." << std::endl;
+ }
+ return g15_send(this->g15screen_fd, data, len);
+}
+
+int G15Screen::setKeyboardBacklight(unsigned char brightness)
+{
+ return this->_sendCommand(G15DAEMON_KB_BACKLIGHT, brightness);
+}
+
+int G15Screen::setBacklight(unsigned char brightness)
+{
+ return this->_sendCommand(G15DAEMON_BACKLIGHT, brightness);
+}
+
+int G15Screen::setContrast(unsigned char contrast)
+{
+ return this->_sendCommand(G15DAEMON_CONTRAST, contrast);
+}
+
+int G15Screen::setM1Led(bool on)
+{
+ if (on)
+ {
+ this->keys = this->keys | G15_LED_M1;
+ }
+ else
+ {
+ this->keys = this->keys & ~G15_LED_M1;
+ }
+ return this->_sendCommand(G15DAEMON_MKEYLEDS, this->keys);
+}
+
+int G15Screen::setM2Led(bool on)
+{
+ if (on)
+ {
+ this->keys = this->keys | G15_LED_M2;
+ }
+ else
+ {
+ this->keys = this->keys & ~G15_LED_M2;
+ }
+ return this->_sendCommand(G15DAEMON_MKEYLEDS, this->keys);
+}
+
+int G15Screen::setM3Led(bool on)
+{
+ if (on)
+ {
+ this->keys = this->keys | G15_LED_M3;
+ }
+ else
+ {
+ this->keys = this->keys & ~G15_LED_M3;
+ }
+ return this->_sendCommand(G15DAEMON_MKEYLEDS, this->keys);
+}
+
+int G15Screen::setMRLed(bool on)
+{
+ if (on)
+ {
+ this->keys = this->keys | G15_LED_MR;
+ }
+ else
+ {
+ this->keys = this->keys & ~G15_LED_MR;
+ }
+ return this->_sendCommand(G15DAEMON_MKEYLEDS, this->keys);
+}
+
+int G15Screen::getKeystate()
+{
+ return this->_sendCommand(G15DAEMON_GET_KEYSTATE, 0);
+}
Added: trunk/G15Tools++/src/G15Screen.h
===================================================================
--- trunk/G15Tools++/src/G15Screen.h (rev 0)
+++ trunk/G15Tools++/src/G15Screen.h 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,31 @@
+#ifndef G15SCREEN_H_
+#define G15SCREEN_H_
+
+namespace G15Tools
+{
+ class G15Screen {
+ protected:
+ int g15screen_fd;
+ int type;
+ bool debug;
+ unsigned char keys;
+ void _init(int type);
+ int _sendCommand(unsigned char command, unsigned char value);
+ public:
+ explicit G15Screen(bool debug = false);
+ explicit G15Screen(int type, bool debug = false);
+ G15Screen(const G15Screen& in);
+ ~G15Screen();
+ int sendData(char *data, unsigned int len);
+ int setKeyboardBacklight(unsigned char brightness);
+ int setBacklight(unsigned char brightness);
+ int setContrast(unsigned char contrast);
+ int setM1Led(bool on = true);
+ int setM2Led(bool on = true);
+ int setM3Led(bool on = true);
+ int setMRLed(bool on = true);
+ int getKeystate();
+ };
+}
+
+#endif
Added: trunk/G15Tools++/src/Makefile.am
===================================================================
--- trunk/G15Tools++/src/Makefile.am (rev 0)
+++ trunk/G15Tools++/src/Makefile.am 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,4 @@
+include_HEADERS = G15Canvas.h G15Screen.h
+lib_LTLIBRARIES = libG15Tools++.la
+libG15Tools___la_LDFLAGS = -version-info 1:0:0
+libG15Tools___la_SOURCES = G15Canvas.h G15Canvas.cpp G15Screen.h G15Screen.cpp
Added: trunk/G15Tools++/test/Makefile.am
===================================================================
--- trunk/G15Tools++/test/Makefile.am (rev 0)
+++ trunk/G15Tools++/test/Makefile.am 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,4 @@
+noinst_PROGRAMS = test
+test_SOURCES = test.cpp g15logo.h
+test_LDADD = $(LIBOBJS) $(top_builddir)/src/libG15Tools++.la
+INCLUDES = -I$(top_builddir)/src
Added: trunk/G15Tools++/test/g15logo.h
===================================================================
--- trunk/G15Tools++/test/g15logo.h (rev 0)
+++ trunk/G15Tools++/test/g15logo.h 2009-02-05 04:15:45 UTC (rev 296)
@@ -0,0 +1,434 @@
+/* GIMP header image file format (INDEXED): /home/mjl/g15logo.h */
+
+short logo_data[] = {
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1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