mnote-canon-tag.c

Go to the documentation of this file.
00001 /* mnote-canon-tag.c
00002  *
00003  * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful, 
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details. 
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #include <config.h>
00022 #include "mnote-canon-tag.h"
00023 
00024 #include <stdlib.h>
00025 
00026 #include <libexif/i18n.h>
00027 
00028 static struct {
00029         MnoteCanonTag tag;
00030         const char *name;
00031         const char *title;
00032         const char *description;
00033 } table[] = {
00034         {MNOTE_CANON_TAG_SETTINGS_1, "Settings1", N_("Settings (first part)"), ""},
00035         {MNOTE_CANON_TAG_SETTINGS_2, "Settings2", N_("Settings (second part)"), ""},
00036         {MNOTE_CANON_TAG_IMAGE_TYPE, "ImageType", N_("Image type"), ""},
00037         {MNOTE_CANON_TAG_FIRMWARE, "FirmwareVersion", N_("Firmware version"), ""},
00038         {MNOTE_CANON_TAG_IMAGE_NUMBER, "ImageNumber", N_("Image number"), ""},
00039         {MNOTE_CANON_TAG_OWNER, "OwnerName", N_("Owner name"), ""},
00040         {MNOTE_CANON_TAG_SERIAL_NUMBER, "SerialNumber", N_("Serial number"), ""},
00041         {MNOTE_CANON_TAG_CUSTOM_FUNCS, "CustomFunctions", N_("Custom functions"), ""},
00042         {0, NULL, NULL, NULL}
00043 };
00044 
00045 static struct {
00046         MnoteCanonTag tag;
00047         unsigned int subtag;
00048         const char *name;
00049 } table_sub[] = {
00050         {MNOTE_CANON_TAG_SETTINGS_1,  0, N_("Macro mode")},
00051         {MNOTE_CANON_TAG_SETTINGS_1,  1, N_("Self time")},
00052         {MNOTE_CANON_TAG_SETTINGS_1,  2, N_("Quality")},
00053         {MNOTE_CANON_TAG_SETTINGS_1,  3, N_("Flash mode")},
00054         {MNOTE_CANON_TAG_SETTINGS_1,  4, N_("Continuous drive mode")},
00055         {MNOTE_CANON_TAG_SETTINGS_1,  6, N_("Focus mode")},
00056         {MNOTE_CANON_TAG_SETTINGS_1,  9, N_("Image size")},
00057         {MNOTE_CANON_TAG_SETTINGS_1, 10, N_("Easy shooting mode")},
00058         {MNOTE_CANON_TAG_SETTINGS_1, 12, N_("Contrast")},
00059         {MNOTE_CANON_TAG_SETTINGS_1, 13, N_("Saturation")},
00060         {MNOTE_CANON_TAG_SETTINGS_1, 14, N_("Sharpness")},
00061         {MNOTE_CANON_TAG_SETTINGS_1, 15, N_("ISO")},
00062         {MNOTE_CANON_TAG_SETTINGS_1, 16, N_("Metering mode")},
00063         {MNOTE_CANON_TAG_SETTINGS_1, 17, N_("Focus type")},
00064         {MNOTE_CANON_TAG_SETTINGS_1, 18, N_("AF point selected")},
00065         {MNOTE_CANON_TAG_SETTINGS_1, 19, N_("Exposure mode")},
00066         {MNOTE_CANON_TAG_SETTINGS_1, 21, N_("Lens type")},
00067         {MNOTE_CANON_TAG_SETTINGS_1, 22, N_("Long focal length of lens")},
00068         {MNOTE_CANON_TAG_SETTINGS_1, 23, N_("Short focal length of lens")},
00069         {MNOTE_CANON_TAG_SETTINGS_1, 24, N_("Focal units per mm")},
00070         {MNOTE_CANON_TAG_SETTINGS_1, 25, N_("Maximal aperture")},
00071         {MNOTE_CANON_TAG_SETTINGS_1, 27, N_("Flash activity")},
00072         {MNOTE_CANON_TAG_SETTINGS_1, 28, N_("Flash details")},
00073         {MNOTE_CANON_TAG_SETTINGS_1, 31, N_("Focus mode")},
00074         {MNOTE_CANON_TAG_SETTINGS_1, 35, N_("Zoomed resolution")},
00075         {MNOTE_CANON_TAG_SETTINGS_1, 36, N_("Zoomed resolution base")},
00076         {MNOTE_CANON_TAG_SETTINGS_1, 41, N_("Color tone")},
00077         {MNOTE_CANON_TAG_SETTINGS_2,  6, N_("White balance")},
00078         {MNOTE_CANON_TAG_SETTINGS_2,  8, N_("Sequence number")},
00079         {MNOTE_CANON_TAG_SETTINGS_2, 13, N_("AF point used")},
00080         {MNOTE_CANON_TAG_SETTINGS_2, 14, N_("Flash bias")},
00081         {MNOTE_CANON_TAG_SETTINGS_2, 18, N_("Subject distance")},
00082         {0, 0, NULL}
00083 };
00084 
00085 const char *
00086 mnote_canon_tag_get_name (MnoteCanonTag t)
00087 {
00088         unsigned int i;
00089 
00090         for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00091                 if (table[i].tag == t) return (_(table[i].name));
00092         return NULL;
00093 }
00094 
00095 const char *
00096 mnote_canon_tag_get_name_sub (MnoteCanonTag t, unsigned int s)
00097 {
00098         unsigned int i;
00099         for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++)
00100                 if ((table_sub[i].tag == t) && (table_sub[i].subtag == s))
00101                         return _(table_sub[i].name);
00102         return mnote_canon_tag_get_name (t);
00103 }
00104 
00105 const char *
00106 mnote_canon_tag_get_title (MnoteCanonTag t)
00107 {
00108         unsigned int i;
00109 
00110         bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 
00111         for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00112                 if (table[i].tag == t) return (_(table[i].title));
00113         return NULL;
00114 }
00115 
00116 const char *
00117 mnote_canon_tag_get_title_sub (MnoteCanonTag t, unsigned int s)
00118 {
00119         unsigned int i;
00120         for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++)
00121                 if ((table_sub[i].tag == t) && (table_sub[i].subtag == s))
00122                         return _(table_sub[i].name);
00123         return mnote_canon_tag_get_title (t);
00124 }
00125 
00126 const char *
00127 mnote_canon_tag_get_description (MnoteCanonTag t)
00128 {
00129         unsigned int i;
00130 
00131         bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
00132         for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00133                 if (table[i].tag == t) return (_(table[i].description));
00134         return NULL;
00135 }

Generated on Tue Dec 19 14:33:53 2006 for EXIF library (libexif) Internals by  doxygen 1.5.1