Mercurial > emacs
comparison src/w32term.c @ 50038:8054c23b6726
(w32_make_rdb): New function.
(w32_term_init): Use it to initialize xrdb member of w32_display_info struct.
Delete leftover code.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 06 Mar 2003 13:00:04 +0000 |
parents | 85246e86a2cd |
children | a1b6fe38d1f2 |
comparison
equal
deleted
inserted
replaced
50037:bb427a9406c3 | 50038:8054c23b6726 |
---|---|
11132 dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW); | 11132 dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW); |
11133 /* TODO: dpyinfo->gray */ | 11133 /* TODO: dpyinfo->gray */ |
11134 | 11134 |
11135 } | 11135 } |
11136 | 11136 |
11137 /* Create an xrdb-style database of resources to supercede registry settings. | |
11138 The database is just a concatenation of C strings, finished by an additional | |
11139 \0. The string are submitted to some basic normalization, so | |
11140 | |
11141 [ *]option[ *]:[ *]value... | |
11142 | |
11143 becomes | |
11144 | |
11145 option:value... | |
11146 | |
11147 but any whitespace following value is not removed. */ | |
11148 | |
11149 static char * | |
11150 w32_make_rdb (xrm_option) | |
11151 char *xrm_option; | |
11152 { | |
11153 char *buffer = xmalloc (strlen (xrm_option) + 2); | |
11154 char *current = buffer; | |
11155 char ch; | |
11156 int in_option = 1; | |
11157 int before_value = 0; | |
11158 | |
11159 do { | |
11160 ch = *xrm_option++; | |
11161 | |
11162 if (ch == '\n') | |
11163 { | |
11164 *current++ = '\0'; | |
11165 in_option = 1; | |
11166 before_value = 0; | |
11167 } | |
11168 else if (ch != ' ') | |
11169 { | |
11170 *current++ = ch; | |
11171 if (in_option && (ch == ':')) | |
11172 { | |
11173 in_option = 0; | |
11174 before_value = 1; | |
11175 } | |
11176 else if (before_value) | |
11177 { | |
11178 before_value = 0; | |
11179 } | |
11180 } | |
11181 else if (!(in_option || before_value)) | |
11182 { | |
11183 *current++ = ch; | |
11184 } | |
11185 } while (ch); | |
11186 | |
11187 *current = '\0'; | |
11188 | |
11189 return buffer; | |
11190 } | |
11191 | |
11137 struct w32_display_info * | 11192 struct w32_display_info * |
11138 w32_term_init (display_name, xrm_option, resource_name) | 11193 w32_term_init (display_name, xrm_option, resource_name) |
11139 Lisp_Object display_name; | 11194 Lisp_Object display_name; |
11140 char *xrm_option; | 11195 char *xrm_option; |
11141 char *resource_name; | 11196 char *resource_name; |
11149 { | 11204 { |
11150 w32_initialize (); | 11205 w32_initialize (); |
11151 w32_initialized = 1; | 11206 w32_initialized = 1; |
11152 } | 11207 } |
11153 | 11208 |
11154 { | |
11155 int argc = 0; | |
11156 char *argv[3]; | |
11157 | |
11158 argv[0] = ""; | |
11159 argc = 1; | |
11160 if (xrm_option) | |
11161 { | |
11162 argv[argc++] = "-xrm"; | |
11163 argv[argc++] = xrm_option; | |
11164 } | |
11165 } | |
11166 | |
11167 w32_initialize_display_info (display_name); | 11209 w32_initialize_display_info (display_name); |
11168 | 11210 |
11169 dpyinfo = &one_w32_display_info; | 11211 dpyinfo = &one_w32_display_info; |
11212 | |
11213 dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL; | |
11170 | 11214 |
11171 /* Put this display on the chain. */ | 11215 /* Put this display on the chain. */ |
11172 dpyinfo->next = x_display_list; | 11216 dpyinfo->next = x_display_list; |
11173 x_display_list = dpyinfo; | 11217 x_display_list = dpyinfo; |
11174 | 11218 |