hal/libhal-storage libhal-storage.c, 1.31, 1.32 libhal-storage.h, 1.16, 1.17

David Zeuthen david at kemper.freedesktop.org
Wed Feb 22 16:23:16 PST 2006


Update of /cvs/hal/hal/libhal-storage
In directory kemper:/tmp/cvs-serv8991/libhal-storage

Modified Files:
	libhal-storage.c libhal-storage.h 
Log Message:
2006-02-22  David Zeuthen  <davidz at redhat.com>

        Patch from Artem Kachitchkine <Artem.Kachitchkin at Sun.COM>,
        slightly tweaked by myself.

        * libhal-storage/libhal-storage.[ch]: Teach libhal-storage about
        Blu-ray and HD DVD.



Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- libhal-storage.c	22 Feb 2006 06:35:09 -0000	1.31
+++ libhal-storage.c	23 Feb 2006 00:23:13 -0000	1.32
@@ -294,7 +294,18 @@
                         else
                                 second = "/DVD±RW";
                 }
-
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_BDROM)
+			second = "/BD-ROM";
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_BDR)
+			second = "/BD-R";
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_BDRE)
+			second = "/BD-RE";
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_HDDVDROM)
+			second = "/HD DVD-ROM";
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_HDDVDR)
+			second = "/HD DVD-R";
+		if (drive_cdrom_caps & LIBHAL_DRIVE_CDROM_CAPS_HDDVDRW)
+			second = "/HD DVD-RW";
 
 		if (drive_is_hotpluggable) {
 			snprintf (buf, MAX_STRING_SZ, _("External %s%s Drive"), first, second);
@@ -448,6 +459,43 @@
 			else
 				name = strdup (_("DVD+R Dual-Layer"));
 			break;
+		
+		case LIBHAL_VOLUME_DISC_TYPE_BDROM:
+			name = strdup (_("BD-ROM"));
+			break;
+			
+		case LIBHAL_VOLUME_DISC_TYPE_BDR:
+			if (libhal_volume_disc_is_blank (volume))
+				name = strdup (_("Blank BD-R"));
+			else
+				name = strdup (_("BD-R"));
+			break;
+		
+		case LIBHAL_VOLUME_DISC_TYPE_BDRE:
+			if (libhal_volume_disc_is_blank (volume))
+				name = strdup (_("Blank BD-RE"));
+			else
+				name = strdup (_("BD-RE"));
+			break;
+		
+		case LIBHAL_VOLUME_DISC_TYPE_HDDVDROM:
+			name = strdup (_("HD DVD-ROM"));
+			break;
+			
+		case LIBHAL_VOLUME_DISC_TYPE_HDDVDR:
+			if (libhal_volume_disc_is_blank (volume))
+				name = strdup (_("Blank HD DVD-R"));
+			else
+				name = strdup (_("HD DVD-R"));
+			break;
+			
+		case LIBHAL_VOLUME_DISC_TYPE_HDDVDRW:
+			if (libhal_volume_disc_is_blank (volume))
+				name = strdup (_("Blank HD DVD-RW"));
+			else
+				name = strdup (_("HD DVD-RW"));
+			break;
+
 		}
 		
 		/* Special case for pure audio disc */
@@ -898,6 +946,12 @@
 		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.dvdr", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_DVDR);
 		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.dvdrw", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_DVDRW);
 		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.dvdram", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_DVDRAM);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.bd", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_BDROM);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.bdr", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_BDR);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.bdre", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_BDRE);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.hddvd", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_HDDVDROM);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.hddvdr", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_HDDVDR);
+		LIBHAL_PROP_EXTRACT_BOOL_BITFIELD ("storage.cdrom.hddvdrw", drive->cdrom_caps, LIBHAL_DRIVE_CDROM_CAPS_HDDVDRW);
 
 		LIBHAL_PROP_EXTRACT_BOOL   ("storage.policy.should_mount",        drive->should_mount);
 		LIBHAL_PROP_EXTRACT_STRING ("storage.policy.desired_mount_point", drive->desired_mount_point);
@@ -1106,6 +1160,18 @@
 			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_DVDPLUSRW;
 		} else if (strcmp (disc_type_textual, "dvd_plus_r_dl") == 0) {
 			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR_DL;
+		} else if (strcmp (disc_type_textual, "bd_rom") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_BDROM;
+		} else if (strcmp (disc_type_textual, "bd_r") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_BDR;
+		} else if (strcmp (disc_type_textual, "bd_re") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_BDRE;
+		} else if (strcmp (disc_type_textual, "hddvd_rom") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_HDDVDROM;
+		} else if (strcmp (disc_type_textual, "hddvd_r") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_HDDVDR;
+		} else if (strcmp (disc_type_textual, "hddvd_rw") == 0) {
+			vol->disc_type = LIBHAL_VOLUME_DISC_TYPE_HDDVDRW;
 		}
 	}
 

Index: libhal-storage.h
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- libhal-storage.h	22 Feb 2006 06:35:09 -0000	1.16
+++ libhal-storage.h	23 Feb 2006 00:23:13 -0000	1.17
@@ -121,7 +121,14 @@
 	LIBHAL_STORAGE_ICON_DISC_DVDR                      = 0x30005,
 	LIBHAL_STORAGE_ICON_DISC_DVDRW                     = 0x30006,
 	LIBHAL_STORAGE_ICON_DISC_DVDPLUSR                  = 0x30007,
-	LIBHAL_STORAGE_ICON_DISC_DVDPLUSRW                 = 0x30008
+	LIBHAL_STORAGE_ICON_DISC_DVDPLUSRW                 = 0x30008,
+	LIBHAL_STORAGE_ICON_DISC_DVDPLUSRWDL               = 0x30009,
+	LIBHAL_STORAGE_ICON_DISC_BDROM                     = 0x3000a,
+	LIBHAL_STORAGE_ICON_DISC_BDR                       = 0x3000b,
+	LIBHAL_STORAGE_ICON_DISC_BDRE                      = 0x3000c,
+	LIBHAL_STORAGE_ICON_DISC_HDDVDROM                  = 0x3000d,
+	LIBHAL_STORAGE_ICON_DISC_HDDVDR                    = 0x3000e,
+	LIBHAL_STORAGE_ICON_DISC_HDDVDRW                   = 0x3000f
 } LibHalStoragePolicyIcon;
 
 typedef struct {
@@ -177,8 +184,13 @@
 	LIBHAL_DRIVE_CDROM_CAPS_DVDRW      = 0x0040,
 	LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSR   = 0x0080,
 	LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRW  = 0x0100,
-	LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRDL = 0x0120
-
+	LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRDL = 0x0200,
+	LIBHAL_DRIVE_CDROM_CAPS_BDROM      = 0x0400,
+	LIBHAL_DRIVE_CDROM_CAPS_BDR        = 0x0800,
+	LIBHAL_DRIVE_CDROM_CAPS_BDRE       = 0x1000,
+	LIBHAL_DRIVE_CDROM_CAPS_HDDVDROM   = 0x2000,
+	LIBHAL_DRIVE_CDROM_CAPS_HDDVDR     = 0x4000,
+	LIBHAL_DRIVE_CDROM_CAPS_HDDVDRW    = 0x8000
 } LibHalDriveCdromCaps;
 
 LibHalDrive         *libhal_drive_from_udi                    (LibHalContext *hal_ctx, 
@@ -253,7 +265,13 @@
 	LIBHAL_VOLUME_DISC_TYPE_DVDRW       = 0x06,
 	LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR    = 0x07,
 	LIBHAL_VOLUME_DISC_TYPE_DVDPLUSRW   = 0x08,
-	LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR_DL = 0x09
+	LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR_DL = 0x09,
+	LIBHAL_VOLUME_DISC_TYPE_BDROM       = 0x0a,
+	LIBHAL_VOLUME_DISC_TYPE_BDR         = 0x0b,
+	LIBHAL_VOLUME_DISC_TYPE_BDRE        = 0x0c,
+	LIBHAL_VOLUME_DISC_TYPE_HDDVDROM    = 0x0d,
+	LIBHAL_VOLUME_DISC_TYPE_HDDVDR      = 0x0e,
+	LIBHAL_VOLUME_DISC_TYPE_HDDVDRW     = 0x0f
 } LibHalVolumeDiscType;
 
 LibHalVolume     *libhal_volume_from_udi                      (LibHalContext *hal_ctx, 




More information about the hal-commit mailing list