Mercurial > hg > xemacs-beta
comparison src/scrollbar.c @ 5140:e5380fdaf8f1
merge
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Sat, 13 Mar 2010 05:38:34 -0600 |
| parents | a9c41067dd88 |
| children | f965e31a35f0 |
comparison
equal
deleted
inserted
replaced
| 5139:a48ef26d87ee | 5140:e5380fdaf8f1 |
|---|---|
| 1 /* Generic scrollbar implementation. | 1 /* Generic scrollbar implementation. |
| 2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | 2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. |
| 3 Copyright (C) 1995 Free Software Foundation, Inc. | 3 Copyright (C) 1995 Free Software Foundation, Inc. |
| 4 Copyright (C) 1995 Sun Microsystems, Inc. | 4 Copyright (C) 1995 Sun Microsystems, Inc. |
| 5 Copyright (C) 1995 Darrell Kindred <dkindred+@cmu.edu>. | 5 Copyright (C) 1995 Darrell Kindred <dkindred+@cmu.edu>. |
| 6 Copyright (C) 2003 Ben Wing. | 6 Copyright (C) 2003, 2010 Ben Wing. |
| 7 | 7 |
| 8 This file is part of XEmacs. | 8 This file is part of XEmacs. |
| 9 | 9 |
| 10 XEmacs is free software; you can redistribute it and/or modify it | 10 XEmacs is free software; you can redistribute it and/or modify it |
| 11 under the terms of the GNU General Public License as published by the | 11 under the terms of the GNU General Public License as published by the |
| 94 return wrap_scrollbar_instance (data->next); | 94 return wrap_scrollbar_instance (data->next); |
| 95 else | 95 else |
| 96 return Qnil; | 96 return Qnil; |
| 97 } | 97 } |
| 98 | 98 |
| 99 DEFINE_LRECORD_IMPLEMENTATION ("scrollbar-instance", scrollbar_instance, | 99 DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("scrollbar-instance", scrollbar_instance, |
| 100 0, /*dumpable-flag*/ | 100 mark_scrollbar_instance, |
| 101 mark_scrollbar_instance, | 101 scrollbar_instance_description, |
| 102 internal_object_printer, 0, 0, 0, | 102 struct scrollbar_instance); |
| 103 scrollbar_instance_description, | |
| 104 struct scrollbar_instance); | |
| 105 | 103 |
| 106 static void | 104 static void |
| 107 free_scrollbar_instance (struct scrollbar_instance *instance, | 105 free_scrollbar_instance (struct scrollbar_instance *instance, |
| 108 struct frame *frame) | 106 struct frame *frame) |
| 109 { | 107 { |
| 196 | 194 |
| 197 static struct scrollbar_instance * | 195 static struct scrollbar_instance * |
| 198 create_scrollbar_instance (struct frame *f, int vertical) | 196 create_scrollbar_instance (struct frame *f, int vertical) |
| 199 { | 197 { |
| 200 struct device *d = XDEVICE (f->device); | 198 struct device *d = XDEVICE (f->device); |
| 201 struct scrollbar_instance *instance = | 199 Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (scrollbar_instance); |
| 202 ALLOC_LCRECORD_TYPE (struct scrollbar_instance, | 200 struct scrollbar_instance *instance = XSCROLLBAR_INSTANCE (obj); |
| 203 &lrecord_scrollbar_instance); | |
| 204 | 201 |
| 205 MAYBE_DEVMETH (d, create_scrollbar_instance, (f, vertical, instance)); | 202 MAYBE_DEVMETH (d, create_scrollbar_instance, (f, vertical, instance)); |
| 206 | 203 |
| 207 return instance; | 204 return instance; |
| 208 } | 205 } |
| 270 if (HAS_DEVMETH_P(d, compute_scrollbar_instance_usage)) | 267 if (HAS_DEVMETH_P(d, compute_scrollbar_instance_usage)) |
| 271 total += DEVMETH (d, compute_scrollbar_instance_usage, (d, inst, ovstats)); | 268 total += DEVMETH (d, compute_scrollbar_instance_usage, (d, inst, ovstats)); |
| 272 | 269 |
| 273 while (inst) | 270 while (inst) |
| 274 { | 271 { |
| 275 total += LISPOBJ_STORAGE_SIZE (inst, sizeof (*inst), ovstats); | 272 total += lisp_object_storage_size (wrap_scrollbar_instance (inst), |
| 273 ovstats); | |
| 276 inst = inst->next; | 274 inst = inst->next; |
| 277 } | 275 } |
| 278 | 276 |
| 279 return total; | 277 return total; |
| 280 } | 278 } |
| 926 /************************************************************************/ | 924 /************************************************************************/ |
| 927 | 925 |
| 928 void | 926 void |
| 929 syms_of_scrollbar (void) | 927 syms_of_scrollbar (void) |
| 930 { | 928 { |
| 931 INIT_LRECORD_IMPLEMENTATION (scrollbar_instance); | 929 INIT_LISP_OBJECT (scrollbar_instance); |
| 932 | 930 |
| 933 DEFSYMBOL (Qscrollbar_line_up); | 931 DEFSYMBOL (Qscrollbar_line_up); |
| 934 DEFSYMBOL (Qscrollbar_line_down); | 932 DEFSYMBOL (Qscrollbar_line_down); |
| 935 DEFSYMBOL (Qscrollbar_page_up); | 933 DEFSYMBOL (Qscrollbar_page_up); |
| 936 DEFSYMBOL (Qscrollbar_page_down); | 934 DEFSYMBOL (Qscrollbar_page_down); |
