2 * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #ifndef __CHXJ_SPECIFIED_DEVICE_H__
18 #define __CHXJ_SPECIFIED_DEVICE_H__
27 CHXJ_SPEC_Chtml_6_0, /* use XHTML */
28 CHXJ_SPEC_Chtml_7_0, /* use XHTML */
29 CHXJ_SPEC_XHtml_Mobile_1_0,
32 CHXJ_SPEC_Jxhtml, /* use XHTML */
33 CHXJ_SPEC_iPhone2, /* use XHTML */
34 CHXJ_SPEC_iPhone3, /* use XHTML */
35 CHXJ_SPEC_iPhone4, /* use XHTML */
36 CHXJ_SPEC_softbank_android, /* use XHTML (SoftBank) */
37 CHXJ_SPEC_au_android, /* use XHTML (au KDDI) */
38 CHXJ_SPEC_docomo_android, /* use XHTML (docomo) */
39 CHXJ_SPEC_android, /* use XHTML */
43 #define CHXJ_PIC_OK (0x01)
44 #define CHXJ_PIC_NG (0x00)
46 #define IS_IPHONE(X) (((X)->html_spec_type == CHXJ_SPEC_iPhone2) \
47 || ((X)->html_spec_type == CHXJ_SPEC_iPhone3) \
48 || ((X)->html_spec_type == CHXJ_SPEC_iPhone4))
49 #define IS_ANDROID(X) ( ((X)->html_spec_type == CHXJ_SPEC_softbank_android) \
50 || ((X)->html_spec_type == CHXJ_SPEC_au_android) \
51 || ((X)->html_spec_type == CHXJ_SPEC_docomo_android) \
52 || ((X)->html_spec_type == CHXJ_SPEC_android))
55 #include "chxj_cookie.h"
58 typedef struct device_table_t device_table;
60 struct device_table_t {
61 struct device_table_t* next;
62 int provider; /* DOCOMO|AU|SOFTBANK|UNKNOWN */
63 const char* device_id;
64 const char* device_name;
65 spec_type html_spec_type;
68 /*--------------------------------------------------------------------------*/
69 /* Walll Paper Size */
70 /*--------------------------------------------------------------------------*/
73 /*--------------------------------------------------------------------------*/
75 /*--------------------------------------------------------------------------*/
77 /*--------------------------------------------------------------------------*/
78 /* Correspondence image format */
79 /* 1: It is possible to display it. */
80 /* 0: It is not possible to display it. */
81 /*--------------------------------------------------------------------------*/
87 /*--------------------------------------------------------------------------*/
89 /*--------------------------------------------------------------------------*/
92 /*--------------------------------------------------------------------------*/
93 /* Color number type */
96 /* 256 : 256 Colors */
97 /* 4096 : 4096 Colors */
98 /* 65536 : 65536 Colors */
99 /* 262144 : 262144 Colors */
100 /* 15680000: 15680000 over colors */
101 /*--------------------------------------------------------------------------*/
104 char* output_encoding; /* Output encoding */
107 typedef struct device_table_list_t device_table_list;
109 struct device_table_list_t {
110 struct device_table_list_t *next;
117 device_table **sort_table;
121 typedef struct converter_t converter_t;
124 /* convert routine */
125 char *(*converter)(request_rec *r,
126 struct device_table_t *spec,
130 struct chxjconvrule_entry *entryp,
133 char *(*encoder)(request_rec *r,
138 char *(*emoji_only_converter)(
140 struct device_table_t *spec,
145 extern converter_t convert_routine[];
147 extern device_table* chxj_specified_device(
149 const char *user_agent);