comparison src/glyphs-widget.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 7473844a83d3
children 13a418960a88
comparison
equal deleted inserted replaced
2285:914c5afaac33 2286:04bc9d2f42c7
147 && !GLYPHP (data) && !VECTORP (data)) 147 && !GLYPHP (data) && !VECTORP (data))
148 invalid_argument ("unknown border style for layout", data); 148 invalid_argument ("unknown border style for layout", data);
149 } 149 }
150 150
151 static void 151 static void
152 check_valid_anything (Lisp_Object data) 152 check_valid_anything (Lisp_Object UNUSED (data))
153 { 153 {
154 } 154 }
155 155
156 static void 156 static void
157 check_valid_callback (Lisp_Object data) 157 check_valid_callback (Lisp_Object data)
657 } 657 }
658 658
659 /* we need to convert things like glyphs to images, eval expressions 659 /* we need to convert things like glyphs to images, eval expressions
660 etc.*/ 660 etc.*/
661 static Lisp_Object 661 static Lisp_Object
662 widget_normalize (Lisp_Object inst, Lisp_Object console_type, 662 widget_normalize (Lisp_Object inst, Lisp_Object UNUSED (console_type),
663 Lisp_Object dest_mask) 663 Lisp_Object UNUSED (dest_mask))
664 { 664 {
665 /* This function can call lisp */ 665 /* This function can call lisp */
666 Lisp_Object glyph = find_keyword_in_vector (inst, Q_image); 666 Lisp_Object glyph = find_keyword_in_vector (inst, Q_image);
667 667
668 /* we need to eval glyph if its an expression, we do this for the 668 /* we need to eval glyph if its an expression, we do this for the
868 if (pw) IMAGE_INSTANCE_WIDTH (ii) = pw; 868 if (pw) IMAGE_INSTANCE_WIDTH (ii) = pw;
869 if (ph) IMAGE_INSTANCE_HEIGHT (ii) = ph; 869 if (ph) IMAGE_INSTANCE_HEIGHT (ii) = ph;
870 } 870 }
871 871
872 static void 872 static void
873 widget_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 873 widget_post_instantiate (Lisp_Object UNUSED (image_instance),
874 Lisp_Object domain) 874 #ifdef DEBUG_WIDGETS
875 Lisp_Object instantiator,
876 #else
877 Lisp_Object UNUSED (instantiator),
878 #endif
879 Lisp_Object UNUSED (domain))
875 { 880 {
876 #ifdef DEBUG_WIDGETS 881 #ifdef DEBUG_WIDGETS
877 debug_widget_instances++; 882 debug_widget_instances++;
878 stderr_out ("instantiated "); 883 stderr_out ("instantiated ");
879 debug_print (instantiator); 884 debug_print (instantiator);
884 /* Get the geometry of a button control. We need to adjust the size 889 /* Get the geometry of a button control. We need to adjust the size
885 depending on the type of button. */ 890 depending on the type of button. */
886 static void 891 static void
887 button_query_geometry (Lisp_Object image_instance, 892 button_query_geometry (Lisp_Object image_instance,
888 int* width, int* height, 893 int* width, int* height,
889 enum image_instance_geometry disp, Lisp_Object domain) 894 enum image_instance_geometry UNUSED (disp),
895 Lisp_Object domain)
890 { 896 {
891 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 897 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
892 int w, h; 898 int w, h;
893 widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii), 899 widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
894 IMAGE_INSTANCE_WIDGET_FACE (ii), 900 IMAGE_INSTANCE_WIDGET_FACE (ii),
909 } 915 }
910 916
911 /* Get the geometry of an edit field. */ 917 /* Get the geometry of an edit field. */
912 static void 918 static void
913 edit_field_query_geometry (Lisp_Object image_instance, 919 edit_field_query_geometry (Lisp_Object image_instance,
914 int* width, int* height, 920 int* width, int* height,
915 enum image_instance_geometry disp, Lisp_Object domain) 921 enum image_instance_geometry UNUSED (disp),
922 Lisp_Object domain)
916 { 923 {
917 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 924 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
918 int w, h; 925 int w, h;
919 widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii), 926 widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
920 IMAGE_INSTANCE_WIDGET_FACE (ii), 927 IMAGE_INSTANCE_WIDGET_FACE (ii),
928 935
929 /* tree-view geometry - get the height right */ 936 /* tree-view geometry - get the height right */
930 static void 937 static void
931 tree_view_query_geometry (Lisp_Object image_instance, 938 tree_view_query_geometry (Lisp_Object image_instance,
932 int* width, int* height, 939 int* width, int* height,
933 enum image_instance_geometry disp, Lisp_Object domain) 940 enum image_instance_geometry UNUSED (disp),
941 Lisp_Object domain)
934 { 942 {
935 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 943 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
936 Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); 944 Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
937 945
938 946
956 /* Get the geometry of a tab control. This is based on the number of 964 /* Get the geometry of a tab control. This is based on the number of
957 items and text therin in the tab control. */ 965 items and text therin in the tab control. */
958 static void 966 static void
959 tab_control_query_geometry (Lisp_Object image_instance, 967 tab_control_query_geometry (Lisp_Object image_instance,
960 int* width, int* height, 968 int* width, int* height,
961 enum image_instance_geometry disp, Lisp_Object domain) 969 enum image_instance_geometry UNUSED (disp),
970 Lisp_Object domain)
962 { 971 {
963 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 972 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
964 Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); 973 Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
965 Lisp_Object rest; 974 Lisp_Object rest;
966 int tw = 0, th = 0; 975 int tw = 0, th = 0;
1230 window. */ 1239 window. */
1231 layout_update (image_instance, instantiator); 1240 layout_update (image_instance, instantiator);
1232 } 1241 }
1233 1242
1234 static void 1243 static void
1235 layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 1244 layout_post_instantiate (Lisp_Object UNUSED (image_instance),
1236 Lisp_Object domain) 1245 Lisp_Object UNUSED (instantiator),
1246 Lisp_Object UNUSED (domain))
1237 { 1247 {
1238 } 1248 }
1239 1249
1240 /* Layout widget. Sizing commentary: we have a number of problems that 1250 /* Layout widget. Sizing commentary: we have a number of problems that
1241 we would like to address. Some consider some of these more 1251 we would like to address. Some consider some of these more
1308 1318
1309 /* Query the geometry of a layout widget. */ 1319 /* Query the geometry of a layout widget. */
1310 static void 1320 static void
1311 layout_query_geometry (Lisp_Object image_instance, int* width, 1321 layout_query_geometry (Lisp_Object image_instance, int* width,
1312 int* height, enum image_instance_geometry disp, 1322 int* height, enum image_instance_geometry disp,
1313 Lisp_Object domain) 1323 Lisp_Object UNUSED (domain))
1314 { 1324 {
1315 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 1325 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
1316 Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest; 1326 Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest;
1317 int maxph = 0, maxpw = 0, nitems = 0, ph_adjust = 0; 1327 int maxph = 0, maxpw = 0, nitems = 0, ph_adjust = 0;
1318 int gheight, gwidth, luh; 1328 int gheight, gwidth, luh;
1417 #endif 1427 #endif
1418 } 1428 }
1419 1429
1420 int 1430 int
1421 layout_layout (Lisp_Object image_instance, 1431 layout_layout (Lisp_Object image_instance,
1422 int width, int height, int xoffset, int yoffset, 1432 int width, int height, int UNUSED (xoffset), int yoffset,
1423 Lisp_Object domain) 1433 Lisp_Object UNUSED (domain))
1424 { 1434 {
1425 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 1435 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
1426 Lisp_Object rest; 1436 Lisp_Object rest;
1427 Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii); 1437 Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii);
1428 int x, y, maxph = 0, maxpw = 0, nitems = 0, 1438 int x, y, maxph = 0, maxpw = 0, nitems = 0,
1634 DEFUN ("widget-logical-to-character-width", Fwidget_logical_to_character_width, 1, 3, 0, /* 1644 DEFUN ("widget-logical-to-character-width", Fwidget_logical_to_character_width, 1, 3, 0, /*
1635 Convert the width in logical widget units to characters. 1645 Convert the width in logical widget units to characters.
1636 Logical widget units do not take into account adjusments made for 1646 Logical widget units do not take into account adjusments made for
1637 layout borders, so this adjusment is approximated. 1647 layout borders, so this adjusment is approximated.
1638 */ 1648 */
1639 (width, face, domain)) 1649 (width, UNUSED (face), domain))
1640 { 1650 {
1641 int w, neww, charwidth; 1651 int w, neww, charwidth;
1642 int border_width = DEFAULT_WIDGET_BORDER_WIDTH; 1652 int border_width = DEFAULT_WIDGET_BORDER_WIDTH;
1643 1653
1644 if (NILP (domain)) 1654 if (NILP (domain))
1672 identical alignment for their subcontrols. 1682 identical alignment for their subcontrols.
1673 1683
1674 Since frame sizes are measured in characters, this function allows you 1684 Since frame sizes are measured in characters, this function allows you
1675 to do appropriate conversion between logical units and characters. 1685 to do appropriate conversion between logical units and characters.
1676 */ 1686 */
1677 (height, face, domain)) 1687 (height, UNUSED (face), domain))
1678 { 1688 {
1679 int h, newh, charheight; 1689 int h, newh, charheight;
1680 1690
1681 CHECK_INT (height); 1691 CHECK_INT (height);
1682 if (NILP (domain)) 1692 if (NILP (domain))