tools.hxx (aaef562f) | tools.hxx (7ee1d29c) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 57 unchanged lines hidden (view full) --- 66 namespace internal 67 { 68 class UnoView; 69 class Shape; 70 class ShapeAttributeLayer; 71 72 typedef ::boost::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr; 73 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 57 unchanged lines hidden (view full) --- 66 namespace internal 67 { 68 class UnoView; 69 class Shape; 70 class ShapeAttributeLayer; 71 72 typedef ::boost::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr; 73 |
74 template <typename T> 75 inline ::std::size_t hash_value( T * const& p ) 76 { 77 ::std::size_t d = static_cast< ::std::size_t >( 78 reinterpret_cast< ::std::ptrdiff_t >(p) ); 79 return d + (d >> 3); 80 } |
|
74 // xxx todo: remove with boost::hash when 1.33 is available 75 template <typename T> 76 struct hash : ::std::unary_function<T, ::std::size_t> 77 { 78 ::std::size_t operator()( T const& val ) const { 79 return hash_value(val); 80 } 81 }; | 81 // xxx todo: remove with boost::hash when 1.33 is available 82 template <typename T> 83 struct hash : ::std::unary_function<T, ::std::size_t> 84 { 85 ::std::size_t operator()( T const& val ) const { 86 return hash_value(val); 87 } 88 }; |
82 template <typename T> 83 inline ::std::size_t hash_value( T * const& p ) 84 { 85 ::std::size_t d = static_cast< ::std::size_t >( 86 reinterpret_cast< ::std::ptrdiff_t >(p) ); 87 return d + (d >> 3); 88 } 89 | 89 } 90} 91 92namespace com { namespace sun { namespace star { namespace uno { |
90 // xxx todo: shift to namespace com::sun::star::uno when 91 // 1.33 is available 92 template <typename T> 93 inline ::std::size_t hash_value( 94 ::com::sun::star::uno::Reference<T> const& x ) 95 { 96 // normalize to object root, because _only_ XInterface is defined 97 // to be stable during object lifetime: 98 ::com::sun::star::uno::Reference< 99 ::com::sun::star::uno::XInterface> const xRoot( 100 x, ::com::sun::star::uno::UNO_QUERY ); | 93 // xxx todo: shift to namespace com::sun::star::uno when 94 // 1.33 is available 95 template <typename T> 96 inline ::std::size_t hash_value( 97 ::com::sun::star::uno::Reference<T> const& x ) 98 { 99 // normalize to object root, because _only_ XInterface is defined 100 // to be stable during object lifetime: 101 ::com::sun::star::uno::Reference< 102 ::com::sun::star::uno::XInterface> const xRoot( 103 x, ::com::sun::star::uno::UNO_QUERY ); |
101 return hash<void *>()(xRoot.get()); | 104 return slideshow::internal::hash<void *>()(xRoot.get()); |
102 } | 105 } |
106}}}} |
|
103 | 107 |
108namespace slideshow 109{ 110 namespace internal 111 { |
|
104 /** Cycle mode of intrinsic animations 105 */ 106 enum CycleMode 107 { 108 /// loop the animation back to back 109 CYCLE_LOOP, 110 /// loop, but play backwards from end to start 111 CYCLE_PINGPONGLOOP --- 289 unchanged lines hidden --- | 112 /** Cycle mode of intrinsic animations 113 */ 114 enum CycleMode 115 { 116 /// loop the animation back to back 117 CYCLE_LOOP, 118 /// loop, but play backwards from end to start 119 CYCLE_PINGPONGLOOP --- 289 unchanged lines hidden --- |