comparison src/glyphs.c @ 2286:04bc9d2f42c7

[xemacs-hg @ 2004-09-20 19:18:55 by james] Mark all unused parameters as unused. Also eliminate some unneeded local variables.
author james
date Mon, 20 Sep 2004 19:20:08 +0000
parents 51ce4f55d8c3
children 13a418960a88
comparison
equal deleted inserted replaced
2285:914c5afaac33 2286:04bc9d2f42c7
636 return Fvector (len, elt); 636 return Fvector (len, elt);
637 } 637 }
638 638
639 #ifdef ERROR_CHECK_GLYPHS 639 #ifdef ERROR_CHECK_GLYPHS
640 static int 640 static int
641 check_instance_cache_mapper (Lisp_Object key, Lisp_Object value, 641 check_instance_cache_mapper (Lisp_Object UNUSED (key), Lisp_Object value,
642 void *flag_closure) 642 void *flag_closure)
643 { 643 {
644 /* This function can GC */ 644 /* This function can GC */
645 /* value can be nil; we cache failures as well as successes */ 645 /* value can be nil; we cache failures as well as successes */
646 if (!NILP (value)) 646 if (!NILP (value))
2245 return IMAGE_NOTHING_MASK; 2245 return IMAGE_NOTHING_MASK;
2246 } 2246 }
2247 2247
2248 static void 2248 static void
2249 nothing_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2249 nothing_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
2250 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2250 Lisp_Object UNUSED (pointer_fg),
2251 int dest_mask, Lisp_Object domain) 2251 Lisp_Object UNUSED (pointer_bg),
2252 int dest_mask, Lisp_Object UNUSED (domain))
2252 { 2253 {
2253 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2254 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2254 2255
2255 if (dest_mask & IMAGE_NOTHING_MASK) 2256 if (dest_mask & IMAGE_NOTHING_MASK)
2256 { 2257 {
2272 { 2273 {
2273 face_must_be_present (instantiator); 2274 face_must_be_present (instantiator);
2274 } 2275 }
2275 2276
2276 static Lisp_Object 2277 static Lisp_Object
2277 inherit_normalize (Lisp_Object inst, Lisp_Object console_type, 2278 inherit_normalize (Lisp_Object inst, Lisp_Object UNUSED (console_type),
2278 Lisp_Object dest_mask) 2279 Lisp_Object UNUSED (dest_mask))
2279 { 2280 {
2280 Lisp_Object face; 2281 Lisp_Object face;
2281 2282
2282 assert (XVECTOR_LENGTH (inst) == 3); 2283 assert (XVECTOR_LENGTH (inst) == 3);
2283 face = XVECTOR_DATA (inst)[2]; 2284 face = XVECTOR_DATA (inst)[2];
2291 { 2292 {
2292 return IMAGE_MONO_PIXMAP_MASK; 2293 return IMAGE_MONO_PIXMAP_MASK;
2293 } 2294 }
2294 2295
2295 static void 2296 static void
2296 inherit_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2297 inherit_instantiate (Lisp_Object UNUSED (image_instance),
2297 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2298 Lisp_Object UNUSED (instantiator),
2298 int dest_mask, Lisp_Object domain) 2299 Lisp_Object UNUSED (pointer_fg),
2300 Lisp_Object UNUSED (pointer_bg),
2301 int UNUSED (dest_mask), Lisp_Object UNUSED (domain))
2299 { 2302 {
2300 /* handled specially in image_instantiate */ 2303 /* handled specially in image_instantiate */
2301 abort (); 2304 abort ();
2302 } 2305 }
2303 2306
2319 } 2322 }
2320 2323
2321 /* Called from autodetect_instantiate() */ 2324 /* Called from autodetect_instantiate() */
2322 void 2325 void
2323 string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2326 string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
2324 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2327 Lisp_Object UNUSED (pointer_fg),
2328 Lisp_Object UNUSED (pointer_bg),
2325 int dest_mask, Lisp_Object domain) 2329 int dest_mask, Lisp_Object domain)
2326 { 2330 {
2327 Lisp_Object string = find_keyword_in_vector (instantiator, Q_data); 2331 Lisp_Object string = find_keyword_in_vector (instantiator, Q_data);
2328 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2332 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2329 2333
2444 } 2448 }
2445 2449
2446 static void 2450 static void
2447 text_query_geometry (Lisp_Object image_instance, 2451 text_query_geometry (Lisp_Object image_instance,
2448 int* width, int* height, 2452 int* width, int* height,
2449 enum image_instance_geometry disp, Lisp_Object domain) 2453 enum image_instance_geometry UNUSED (disp),
2454 Lisp_Object domain)
2450 { 2455 {
2451 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2456 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2452 int descent = 0; 2457 int descent = 0;
2453 2458
2454 query_string_geometry (IMAGE_INSTANCE_TEXT_STRING (ii), 2459 query_string_geometry (IMAGE_INSTANCE_TEXT_STRING (ii),
2749 2754
2750 /* Normalize method for XBM's. */ 2755 /* Normalize method for XBM's. */
2751 2756
2752 static Lisp_Object 2757 static Lisp_Object
2753 xbm_normalize (Lisp_Object inst, Lisp_Object console_type, 2758 xbm_normalize (Lisp_Object inst, Lisp_Object console_type,
2754 Lisp_Object dest_mask) 2759 Lisp_Object UNUSED (dest_mask))
2755 { 2760 {
2756 Lisp_Object file = Qnil, mask_file = Qnil; 2761 Lisp_Object file = Qnil, mask_file = Qnil;
2757 struct gcpro gcpro1, gcpro2, gcpro3; 2762 struct gcpro gcpro1, gcpro2, gcpro3;
2758 Lisp_Object alist = Qnil; 2763 Lisp_Object alist = Qnil;
2759 2764
2833 file_or_data_must_be_present (instantiator); 2838 file_or_data_must_be_present (instantiator);
2834 } 2839 }
2835 2840
2836 static Lisp_Object 2841 static Lisp_Object
2837 xface_normalize (Lisp_Object inst, Lisp_Object console_type, 2842 xface_normalize (Lisp_Object inst, Lisp_Object console_type,
2838 Lisp_Object dest_mask) 2843 Lisp_Object UNUSED (dest_mask))
2839 { 2844 {
2840 /* This function can call lisp */ 2845 /* This function can call lisp */
2841 Lisp_Object file = Qnil, mask_file = Qnil; 2846 Lisp_Object file = Qnil, mask_file = Qnil;
2842 struct gcpro gcpro1, gcpro2, gcpro3; 2847 struct gcpro gcpro1, gcpro2, gcpro3;
2843 Lisp_Object alist = Qnil; 2848 Lisp_Object alist = Qnil;
3050 return results; 3055 return results;
3051 } 3056 }
3052 3057
3053 static Lisp_Object 3058 static Lisp_Object
3054 xpm_normalize (Lisp_Object inst, Lisp_Object console_type, 3059 xpm_normalize (Lisp_Object inst, Lisp_Object console_type,
3055 Lisp_Object dest_mask) 3060 Lisp_Object UNUSED (dest_mask))
3056 { 3061 {
3057 Lisp_Object file = Qnil; 3062 Lisp_Object file = Qnil;
3058 Lisp_Object color_symbols; 3063 Lisp_Object color_symbols;
3059 struct gcpro gcpro1, gcpro2; 3064 struct gcpro gcpro1, gcpro2;
3060 Lisp_Object alist = Qnil; 3065 Lisp_Object alist = Qnil;
3210 /* Given a specification for an image, return an instance of 3215 /* Given a specification for an image, return an instance of
3211 the image which matches the given instantiator and which can be 3216 the image which matches the given instantiator and which can be
3212 displayed in the given domain. */ 3217 displayed in the given domain. */
3213 3218
3214 static Lisp_Object 3219 static Lisp_Object
3215 image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, 3220 image_instantiate (Lisp_Object specifier, Lisp_Object UNUSED (matchspec),
3216 Lisp_Object domain, Lisp_Object instantiator, 3221 Lisp_Object domain, Lisp_Object instantiator,
3217 Lisp_Object depth) 3222 Lisp_Object depth)
3218 { 3223 {
3219 Lisp_Object glyph = IMAGE_SPECIFIER_ATTACHEE (XIMAGE_SPECIFIER (specifier)); 3224 Lisp_Object glyph = IMAGE_SPECIFIER_ATTACHEE (XIMAGE_SPECIFIER (specifier));
3220 int dest_mask = XIMAGE_SPECIFIER_ALLOWED (specifier); 3225 int dest_mask = XIMAGE_SPECIFIER_ALLOWED (specifier);
3504 IMAGE_SPECIFIER_ATTACHEE (image) = face_or_glyph; 3509 IMAGE_SPECIFIER_ATTACHEE (image) = face_or_glyph;
3505 IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image) = property; 3510 IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image) = property;
3506 } 3511 }
3507 3512
3508 static Lisp_Object 3513 static Lisp_Object
3509 image_going_to_add (Lisp_Object specifier, Lisp_Object locale, 3514 image_going_to_add (Lisp_Object specifier, Lisp_Object UNUSED (locale),
3510 Lisp_Object tag_set, Lisp_Object instantiator) 3515 Lisp_Object tag_set, Lisp_Object instantiator)
3511 { 3516 {
3512 Lisp_Object possible_console_types = Qnil; 3517 Lisp_Object possible_console_types = Qnil;
3513 Lisp_Object rest; 3518 Lisp_Object rest;
3514 Lisp_Object retlist = Qnil; 3519 Lisp_Object retlist = Qnil;
3650 3655
3651 return glyph->plist; 3656 return glyph->plist;
3652 } 3657 }
3653 3658
3654 static void 3659 static void
3655 print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 3660 print_glyph (Lisp_Object obj, Lisp_Object printcharfun,
3661 int UNUSED (escapeflag))
3656 { 3662 {
3657 Lisp_Glyph *glyph = XGLYPH (obj); 3663 Lisp_Glyph *glyph = XGLYPH (obj);
3658 3664
3659 if (print_readably) 3665 if (print_readably)
3660 printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid); 3666 printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid);
4182 return retval; 4188 return retval;
4183 } 4189 }
4184 } 4190 }
4185 4191
4186 Lisp_Object 4192 Lisp_Object
4187 glyph_face (Lisp_Object glyph, Lisp_Object domain) 4193 glyph_face (Lisp_Object glyph, Lisp_Object UNUSED (domain))
4188 { 4194 {
4189 /* #### Domain parameter not currently used but it will be */ 4195 /* #### Domain parameter not currently used but it will be */
4190 return GLYPHP (glyph) ? GLYPH_FACE (XGLYPH (glyph)) : Qnil; 4196 return GLYPHP (glyph) ? GLYPH_FACE (XGLYPH (glyph)) : Qnil;
4191 } 4197 }
4192 4198
4450 is necessary because GC will not guarantee the order things get 4456 is necessary because GC will not guarantee the order things get
4451 deleted in and moreover, frame finalization deletes the window 4457 deleted in and moreover, frame finalization deletes the window
4452 system windows before deleting XEmacs windows, and hence 4458 system windows before deleting XEmacs windows, and hence
4453 subwindows. */ 4459 subwindows. */
4454 int 4460 int
4455 unmap_subwindow_instance_cache_mapper (Lisp_Object key, Lisp_Object value, 4461 unmap_subwindow_instance_cache_mapper (Lisp_Object UNUSED (key),
4456 void* finalize) 4462 Lisp_Object value, void* finalize)
4457 { 4463 {
4458 /* value can be nil; we cache failures as well as successes */ 4464 /* value can be nil; we cache failures as well as successes */
4459 if (!NILP (value)) 4465 if (!NILP (value))
4460 { 4466 {
4461 struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value)); 4467 struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value));
4782 void 4788 void
4783 map_subwindow (Lisp_Object subwindow, int x, int y, 4789 map_subwindow (Lisp_Object subwindow, int x, int y,
4784 struct display_glyph_area *dga) 4790 struct display_glyph_area *dga)
4785 { 4791 {
4786 Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); 4792 Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
4787 struct frame* f;
4788 4793
4789 ERROR_CHECK_IMAGE_INSTANCE (subwindow); 4794 ERROR_CHECK_IMAGE_INSTANCE (subwindow);
4790 4795
4791 if (!(image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) 4796 if (!(image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii))
4792 & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK))) 4797 & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)))
4795 #ifdef DEBUG_WIDGETS 4800 #ifdef DEBUG_WIDGETS
4796 stderr_out ("mapping subwindow %p, %dx%d@%d+%d\n", 4801 stderr_out ("mapping subwindow %p, %dx%d@%d+%d\n",
4797 IMAGE_INSTANCE_SUBWINDOW_ID (ii), 4802 IMAGE_INSTANCE_SUBWINDOW_ID (ii),
4798 dga->width, dga->height, x, y); 4803 dga->width, dga->height, x, y);
4799 #endif 4804 #endif
4800 f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); 4805 /* Error check by side effect */
4806 (void) XFRAME (IMAGE_INSTANCE_FRAME (ii));
4801 IMAGE_INSTANCE_DISPLAY_X (ii) = x; 4807 IMAGE_INSTANCE_DISPLAY_X (ii) = x;
4802 IMAGE_INSTANCE_DISPLAY_Y (ii) = y; 4808 IMAGE_INSTANCE_DISPLAY_Y (ii) = y;
4803 IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width; 4809 IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width;
4804 IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) = dga->height; 4810 IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) = dga->height;
4805 4811
4821 } 4827 }
4822 4828
4823 /* Partially instantiate a subwindow. */ 4829 /* Partially instantiate a subwindow. */
4824 void 4830 void
4825 subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 4831 subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
4826 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 4832 Lisp_Object UNUSED (pointer_fg),
4833 Lisp_Object UNUSED (pointer_bg),
4827 int dest_mask, Lisp_Object domain) 4834 int dest_mask, Lisp_Object domain)
4828 { 4835 {
4829 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 4836 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
4830 Lisp_Object device = image_instance_device (image_instance); 4837 Lisp_Object device = image_instance_device (image_instance);
4831 Lisp_Object frame = DOMAIN_FRAME (domain); 4838 Lisp_Object frame = DOMAIN_FRAME (domain);
4862 } 4869 }
4863 4870
4864 /* This is just a backup in case no-one has assigned a suitable geometry. 4871 /* This is just a backup in case no-one has assigned a suitable geometry.
4865 #### It should really query the enclose window for geometry. */ 4872 #### It should really query the enclose window for geometry. */
4866 static void 4873 static void
4867 subwindow_query_geometry (Lisp_Object image_instance, int* width, 4874 subwindow_query_geometry (Lisp_Object UNUSED (image_instance),
4868 int* height, enum image_instance_geometry disp, 4875 int* width, int* height,
4869 Lisp_Object domain) 4876 enum image_instance_geometry UNUSED (disp),
4877 Lisp_Object UNUSED (domain))
4870 { 4878 {
4871 if (width) *width = 20; 4879 if (width) *width = 20;
4872 if (height) *height = 20; 4880 if (height) *height = 20;
4873 } 4881 }
4874 4882