comparison src/glyphs-x.c @ 422:95016f13131a r21-2-19

Import from CVS: tag r21-2-19
author cvs
date Mon, 13 Aug 2007 11:25:01 +0200
parents 41dbb7a9d5f2
children 11054d720c21
comparison
equal deleted inserted replaced
421:fff06e11db74 422:95016f13131a
2130 #endif 2130 #endif
2131 2131
2132 static void 2132 static void
2133 x_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h) 2133 x_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h)
2134 { 2134 {
2135 XResizeWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (ii)), 2135 if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW)
2136 IMAGE_INSTANCE_X_SUBWINDOW_ID (ii), 2136 {
2137 w, h); 2137 XResizeWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (ii)),
2138 IMAGE_INSTANCE_X_SUBWINDOW_ID (ii),
2139 w, h);
2140 }
2141 else /* must be a widget */
2142 {
2143 Arg al[2];
2144 XtSetArg (al [0], XtNwidth, (Dimension)w);
2145 XtSetArg (al [1], XtNheight, (Dimension)h);
2146 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 2);
2147 }
2138 } 2148 }
2139 2149
2140 /************************************************************************/ 2150 /************************************************************************/
2141 /* widgets */ 2151 /* widgets */
2142 /************************************************************************/ 2152 /************************************************************************/
2156 Extbyte* nm=0; 2166 Extbyte* nm=0;
2157 Widget wid; 2167 Widget wid;
2158 Arg al [32]; 2168 Arg al [32];
2159 int ac = 0; 2169 int ac = 0;
2160 int id = new_lwlib_id (); 2170 int id = new_lwlib_id ();
2171 #ifdef LWLIB_USES_MOTIF
2172 XmFontList fontList;
2173 #endif
2161 2174
2162 if (!DEVICE_X_P (d)) 2175 if (!DEVICE_X_P (d))
2163 signal_simple_error ("Not an mswindows device", device); 2176 signal_simple_error ("Not an mswindows device", device);
2164 2177
2165 /* have to set the type this late in case there is no device 2178 /* have to set the type this late in case there is no device
2186 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); 2199 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
2187 bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); 2200 bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
2188 2201
2189 XtSetArg (al [ac], XtNbackground, bcolor.pixel); ac++; 2202 XtSetArg (al [ac], XtNbackground, bcolor.pixel); ac++;
2190 XtSetArg (al [ac], XtNforeground, fcolor.pixel); ac++; 2203 XtSetArg (al [ac], XtNforeground, fcolor.pixel); ac++;
2204 #ifdef LWLIB_USES_MOTIF
2205 fontList = XmFontListCreate
2206 ((void*)FONT_INSTANCE_X_FONT
2207 (XFONT_INSTANCE (widget_face_font_info
2208 (domain, IMAGE_INSTANCE_WIDGET_FACE (ii),
2209 0, 0))), XmSTRING_DEFAULT_CHARSET);
2210 XtSetArg (al [ac], XmNfontList, fontList ); ac++;
2211 #else
2191 XtSetArg (al [ac], XtNfont, (void*)FONT_INSTANCE_X_FONT 2212 XtSetArg (al [ac], XtNfont, (void*)FONT_INSTANCE_X_FONT
2192 (XFONT_INSTANCE (widget_face_font_info 2213 (XFONT_INSTANCE (widget_face_font_info
2193 (domain, 2214 (domain,
2194 IMAGE_INSTANCE_WIDGET_FACE (ii), 2215 IMAGE_INSTANCE_WIDGET_FACE (ii),
2195 0, 0)))); ac++; 2216 0, 0)))); ac++;
2217 #endif
2196 2218
2197 wv->nargs = ac; 2219 wv->nargs = ac;
2198 wv->args = al; 2220 wv->args = al;
2199 2221
2200 wid = lw_create_widget (type, wv->name, id, wv, FRAME_X_CONTAINER_WIDGET (f), 2222 wid = lw_create_widget (type, wv->name, id, wv, FRAME_X_CONTAINER_WIDGET (f),
2201 False, 0, popup_selection_callback, 0); 2223 False, 0, popup_selection_callback, 0);
2202 2224
2203 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id; 2225 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id;
2204 2226 #ifdef LWLIB_USES_MOTIF
2227 XmFontListFree (fontList);
2228 #endif
2205 /* because the EmacsManager is the widgets parent we have to 2229 /* because the EmacsManager is the widgets parent we have to
2206 offset the redisplay of the widget by the amount the text 2230 offset the redisplay of the widget by the amount the text
2207 widget is inside the manager. */ 2231 widget is inside the manager. */
2208 ac = 0; 2232 ac = 0;
2209 XtSetArg (al [ac], XtNwidth, 2233 XtSetArg (al [ac], XtNwidth,
2451 INITIALIZE_DEVICE_IIFORMAT (x, xbm); 2475 INITIALIZE_DEVICE_IIFORMAT (x, xbm);
2452 IIFORMAT_HAS_DEVMETHOD (x, xbm, instantiate); 2476 IIFORMAT_HAS_DEVMETHOD (x, xbm, instantiate);
2453 2477
2454 INITIALIZE_DEVICE_IIFORMAT (x, subwindow); 2478 INITIALIZE_DEVICE_IIFORMAT (x, subwindow);
2455 IIFORMAT_HAS_DEVMETHOD (x, subwindow, instantiate); 2479 IIFORMAT_HAS_DEVMETHOD (x, subwindow, instantiate);
2456 2480 #ifdef LWLIB_USES_MOTIF
2457 /* button widget */ 2481 /* button widget */
2458 INITIALIZE_DEVICE_IIFORMAT (x, button); 2482 INITIALIZE_DEVICE_IIFORMAT (x, button);
2459 IIFORMAT_HAS_DEVMETHOD (x, button, property); 2483 IIFORMAT_HAS_DEVMETHOD (x, button, property);
2460 IIFORMAT_HAS_DEVMETHOD (x, button, instantiate); 2484 IIFORMAT_HAS_DEVMETHOD (x, button, instantiate);
2461 2485
2467 IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, set_property); 2491 IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, set_property);
2468 IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, instantiate); 2492 IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, instantiate);
2469 /* text field */ 2493 /* text field */
2470 INITIALIZE_DEVICE_IIFORMAT (x, edit_field); 2494 INITIALIZE_DEVICE_IIFORMAT (x, edit_field);
2471 IIFORMAT_HAS_DEVMETHOD (x, edit_field, instantiate); 2495 IIFORMAT_HAS_DEVMETHOD (x, edit_field, instantiate);
2496 #if 0 /* XmVERSION > 1*/
2472 /* combo box */ 2497 /* combo box */
2473 INITIALIZE_DEVICE_IIFORMAT (x, combo_box); 2498 INITIALIZE_DEVICE_IIFORMAT (x, combo_box);
2474 IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate); 2499 IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate);
2475 2500 #endif
2501 #endif
2476 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (cursor_font, "cursor-font"); 2502 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (cursor_font, "cursor-font");
2477 IIFORMAT_VALID_CONSOLE (x, cursor_font); 2503 IIFORMAT_VALID_CONSOLE (x, cursor_font);
2478 2504
2479 IIFORMAT_HAS_METHOD (cursor_font, validate); 2505 IIFORMAT_HAS_METHOD (cursor_font, validate);
2480 IIFORMAT_HAS_METHOD (cursor_font, possible_dest_types); 2506 IIFORMAT_HAS_METHOD (cursor_font, possible_dest_types);