Mercurial > hg > xemacs-beta
comparison src/extents.c @ 934:c925bacdda60
[xemacs-hg @ 2002-07-29 09:21:12 by michaels]
2002-07-17 Marcus Crestani <crestani@informatik.uni-tuebingen.de>
Markus Kaltenbach <makalten@informatik.uni-tuebingen.de>
Mike Sperber <mike@xemacs.org>
configure flag to turn these changes on: --use-kkcc
First we added a dumpable flag to lrecord_implementation. It shows,
if the object is dumpable and should be processed by the dumper.
* lrecord.h (struct lrecord_implementation): added dumpable flag
(MAKE_LRECORD_IMPLEMENTATION): fitted the different makro definitions
to the new lrecord_implementation and their calls.
Then we changed mark_object, that it no longer needs a mark method for
those types that have pdump descritions.
* alloc.c:
(mark_object): If the object has a description, the new mark algorithm
is called, and the object is marked according to its description.
Otherwise it uses the mark method like before.
These procedures mark objects according to their descriptions. They
are modeled on the corresponding pdumper procedures.
(mark_with_description):
(get_indirect_count):
(structure_size):
(mark_struct_contents):
These procedures still call mark_object, this is needed while there are
Lisp_Objects without descriptions left.
We added pdump descriptions for many Lisp_Objects:
* extents.c: extent_auxiliary_description
* database.c: database_description
* gui.c: gui_item_description
* scrollbar.c: scrollbar_instance_description
* toolbar.c: toolbar_button_description
* event-stream.c: command_builder_description
* mule-charset.c: charset_description
* device-msw.c: devmode_description
* dialog-msw.c: mswindows_dialog_id_description
* eldap.c: ldap_description
* postgresql.c: pgconn_description
pgresult_description
* tooltalk.c: tooltalk_message_description
tooltalk_pattern_description
* ui-gtk.c: emacs_ffi_description
emacs_gtk_object_description
* events.c:
* events.h:
* event-stream.c:
* event-Xt.c:
* event-gtk.c:
* event-tty.c:
To write a pdump description for Lisp_Event, we converted every struct
in the union event to a Lisp_Object. So we created nine new
Lisp_Objects: Lisp_Key_Data, Lisp_Button_Data, Lisp_Motion_Data,
Lisp_Process_Data, Lisp_Timeout_Data, Lisp_Eval_Data,
Lisp_Misc_User_Data, Lisp_Magic_Data, Lisp_Magic_Eval_Data.
We also wrote makro selectors and mutators for the fields of the new
designed Lisp_Event and added everywhere these new abstractions.
We implemented XD_UNION support in (mark_with_description), so
we can describe exspecially console/device specific data with XD_UNION.
To describe with XD_UNION, we added a field to these objects, which
holds the variant type of the object. This field is initialized in
the appendant constructor. The variant is an integer, it has also to
be described in an description, if XD_UNION is used.
XD_UNION is used in following descriptions:
* console.c: console_description
(get_console_variant): returns the variant
(create_console): added variant initialization
* console.h (console_variant): the different console types
* console-impl.h (struct console): added enum console_variant contype
* device.c: device_description
(Fmake_device): added variant initialization
* device-impl.h (struct device): added enum console_variant devtype
* objects.c: image_instance_description
font_instance_description
(Fmake_color_instance): added variant initialization
(Fmake_font_instance): added variant initialization
* objects-impl.h (struct Lisp_Color_Instance): added color_instance_type
* objects-impl.h (struct Lisp_Font_Instance): added font_instance_type
* process.c: process_description
(make_process_internal): added variant initialization
* process.h (process_variant): the different process types
author | michaels |
---|---|
date | Mon, 29 Jul 2002 09:21:25 +0000 |
parents | 79c6ff3eef26 |
children | bb19cebf6809 |
comparison
equal
deleted
inserted
replaced
933:f6bc42928b34 | 934:c925bacdda60 |
---|---|
907 | 907 |
908 /************************************************************************/ | 908 /************************************************************************/ |
909 /* Auxiliary extent structure */ | 909 /* Auxiliary extent structure */ |
910 /************************************************************************/ | 910 /************************************************************************/ |
911 | 911 |
912 #ifdef USE_KKCC | |
913 static const struct lrecord_description extent_auxiliary_description[] ={ | |
914 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, begin_glyph) }, | |
915 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, end_glyph) }, | |
916 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, parent) }, | |
917 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, children) }, | |
918 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, invisible) }, | |
919 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, read_only) }, | |
920 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, mouse_face) }, | |
921 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, initial_redisplay_function) }, | |
922 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, before_change_functions) }, | |
923 { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, after_change_functions) }, | |
924 { XD_END } | |
925 }; | |
926 #endif /* USE_KKCC */ | |
912 static Lisp_Object | 927 static Lisp_Object |
913 mark_extent_auxiliary (Lisp_Object obj) | 928 mark_extent_auxiliary (Lisp_Object obj) |
914 { | 929 { |
915 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); | 930 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); |
916 mark_object (data->begin_glyph); | 931 mark_object (data->begin_glyph); |
923 mark_object (data->before_change_functions); | 938 mark_object (data->before_change_functions); |
924 mark_object (data->after_change_functions); | 939 mark_object (data->after_change_functions); |
925 return data->parent; | 940 return data->parent; |
926 } | 941 } |
927 | 942 |
943 #ifdef USE_KKCC | |
944 DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, | |
945 0, /*dumpable-flag*/ | |
946 mark_extent_auxiliary, internal_object_printer, | |
947 0, 0, 0, extent_auxiliary_description, struct extent_auxiliary); | |
948 #else /* not USE_KKCC */ | |
928 DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, | 949 DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, |
929 mark_extent_auxiliary, internal_object_printer, | 950 mark_extent_auxiliary, internal_object_printer, |
930 0, 0, 0, 0, struct extent_auxiliary); | 951 0, 0, 0, 0, struct extent_auxiliary); |
931 | 952 #endif /* not USE_KKCC */ |
932 void | 953 void |
933 allocate_extent_auxiliary (EXTENT ext) | 954 allocate_extent_auxiliary (EXTENT ext) |
934 { | 955 { |
935 Lisp_Object extent_aux; | 956 Lisp_Object extent_aux; |
936 struct extent_auxiliary *data = | 957 struct extent_auxiliary *data = |
970 | 991 |
971 static struct stack_of_extents *allocate_soe (void); | 992 static struct stack_of_extents *allocate_soe (void); |
972 static void free_soe (struct stack_of_extents *soe); | 993 static void free_soe (struct stack_of_extents *soe); |
973 static void soe_invalidate (Lisp_Object obj); | 994 static void soe_invalidate (Lisp_Object obj); |
974 | 995 |
996 #ifdef USE_KKCC | |
997 static const struct struct_description extent_list_description = { | |
998 }; | |
999 | |
1000 static const struct lrecord_description extent_info_description [] = { | |
1001 { XD_STRUCT_PTR, offsetof (struct extent_info, extents), | |
1002 XD_INDIRECT (0, 0), &extent_list_description }, | |
1003 { XD_END } | |
1004 }; | |
1005 #endif /* USE_KKCC */ | |
1006 | |
975 static Lisp_Object | 1007 static Lisp_Object |
976 mark_extent_info (Lisp_Object obj) | 1008 mark_extent_info (Lisp_Object obj) |
977 { | 1009 { |
978 struct extent_info *data = (struct extent_info *) XEXTENT_INFO (obj); | 1010 struct extent_info *data = (struct extent_info *) XEXTENT_INFO (obj); |
979 int i; | 1011 int i; |
1020 free_extent_list (data->extents); | 1052 free_extent_list (data->extents); |
1021 data->extents = 0; | 1053 data->extents = 0; |
1022 } | 1054 } |
1023 } | 1055 } |
1024 | 1056 |
1057 #ifdef USE_KKCC | |
1058 DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, | |
1059 0, /*dumpable-flag*/ | |
1060 mark_extent_info, internal_object_printer, | |
1061 finalize_extent_info, 0, 0, | |
1062 0 /*extent_info_description*/, | |
1063 struct extent_info); | |
1064 #else /* not USE_KKCC */ | |
1025 DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, | 1065 DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, |
1026 mark_extent_info, internal_object_printer, | 1066 mark_extent_info, internal_object_printer, |
1027 finalize_extent_info, 0, 0, 0, | 1067 finalize_extent_info, 0, 0, 0, |
1028 struct extent_info); | 1068 struct extent_info); |
1069 #endif /* not USE_KKCC */ | |
1029 | 1070 |
1030 static Lisp_Object | 1071 static Lisp_Object |
1031 allocate_extent_info (void) | 1072 allocate_extent_info (void) |
1032 { | 1073 { |
1033 Lisp_Object extent_info; | 1074 Lisp_Object extent_info; |
3173 extent_plist (Lisp_Object obj) | 3214 extent_plist (Lisp_Object obj) |
3174 { | 3215 { |
3175 return Fextent_properties (obj); | 3216 return Fextent_properties (obj); |
3176 } | 3217 } |
3177 | 3218 |
3219 #ifdef USE_KKCC | |
3220 DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, | |
3221 1, /*dumpable-flag*/ | |
3222 mark_extent, | |
3223 print_extent, | |
3224 /* NOTE: If you declare a | |
3225 finalization method here, | |
3226 it will NOT be called. | |
3227 Shaft city. */ | |
3228 0, | |
3229 extent_equal, extent_hash, | |
3230 extent_description, | |
3231 extent_getprop, extent_putprop, | |
3232 extent_remprop, extent_plist, | |
3233 struct extent); | |
3234 #else /* not USE_KKCC */ | |
3178 DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, | 3235 DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, |
3179 mark_extent, | 3236 mark_extent, |
3180 print_extent, | 3237 print_extent, |
3181 /* NOTE: If you declare a | 3238 /* NOTE: If you declare a |
3182 finalization method here, | 3239 finalization method here, |
3186 extent_equal, extent_hash, | 3243 extent_equal, extent_hash, |
3187 extent_description, | 3244 extent_description, |
3188 extent_getprop, extent_putprop, | 3245 extent_getprop, extent_putprop, |
3189 extent_remprop, extent_plist, | 3246 extent_remprop, extent_plist, |
3190 struct extent); | 3247 struct extent); |
3191 | 3248 #endif /* not USE_KKCC */ |
3192 | 3249 |
3193 /************************************************************************/ | 3250 /************************************************************************/ |
3194 /* basic extent accessors */ | 3251 /* basic extent accessors */ |
3195 /************************************************************************/ | 3252 /************************************************************************/ |
3196 | 3253 |