LCOV - code coverage report
Current view: top level - pencil/include/layout - layout_diagram.inl (source / functions) Hit Total Coverage
Test: crystal-facet-uml_v1.61.0_covts Lines: 17 36 47.2 %
Date: 2024-10-26 21:44:38 Functions: 3 10 30.0 %

          Line data    Source code
       1             : /* File: layout_diagram.inl; Copyright and License: see below */
       2             : 
       3             : #include <assert.h>
       4             : 
       5           5 : static inline void layout_diagram_init ( layout_diagram_t *this_, const data_diagram_t *diagram_data )
       6             : {
       7           5 :     assert ( NULL != diagram_data );
       8             : 
       9           5 :     geometry_rectangle_init_empty( &((*this_).bounds) );
      10           5 :     geometry_rectangle_init_empty( &((*this_).draw_area) );
      11           5 :     geometry_rectangle_init_empty( &((*this_).label_box) );
      12           5 :     (*this_).data = diagram_data;
      13           5 : }
      14             : 
      15           4 : static inline void layout_diagram_destroy ( layout_diagram_t *this_ )
      16             : {
      17           4 :     geometry_rectangle_destroy( &((*this_).bounds) );
      18           4 :     geometry_rectangle_destroy( &((*this_).draw_area) );
      19           4 :     geometry_rectangle_destroy( &((*this_).label_box) );
      20           4 :     (*this_).data = NULL;
      21           4 : }
      22             : 
      23          13 : static inline bool layout_diagram_is_valid ( const layout_diagram_t *this_ )
      24             : {
      25             :     bool result;
      26          13 :     if ( (*this_).data == NULL )
      27             :     {
      28           0 :         result = false;  /* cannot happen on initialized objects */
      29             :     }
      30             :     else
      31             :     {
      32          13 :         result = data_diagram_is_valid( (*this_).data );
      33             :     }
      34          13 :     return result;
      35             : }
      36             : 
      37           0 : static inline const geometry_rectangle_t *layout_diagram_get_bounds_const ( const layout_diagram_t *this_ )
      38             : {
      39           0 :     return &((*this_).bounds);
      40             : }
      41             : 
      42           0 : static inline void layout_diagram_set_bounds ( layout_diagram_t *this_, const geometry_rectangle_t *diagram_bounds )
      43             : {
      44           0 :     geometry_rectangle_replace( &((*this_).bounds), diagram_bounds );
      45           0 : }
      46             : 
      47           0 : static inline const geometry_rectangle_t *layout_diagram_get_draw_area_const ( const layout_diagram_t *this_ )
      48             : {
      49           0 :     return &((*this_).draw_area);
      50             : }
      51             : 
      52           0 : static inline void layout_diagram_set_draw_area ( layout_diagram_t *this_, const geometry_rectangle_t *diagram_draw_area )
      53             : {
      54           0 :     geometry_rectangle_replace( &((*this_).draw_area), diagram_draw_area );
      55           0 : }
      56             : 
      57           0 : static inline const geometry_rectangle_t *layout_diagram_get_label_box_const ( const layout_diagram_t *this_ )
      58             : {
      59           0 :     return &((*this_).label_box);
      60             : }
      61             : 
      62           0 : static inline void layout_diagram_set_label_box ( layout_diagram_t *this_, const geometry_rectangle_t *label_box )
      63             : {
      64           0 :     geometry_rectangle_replace( &((*this_).label_box), label_box );
      65           0 : }
      66             : 
      67           0 : static inline const data_diagram_t *layout_diagram_get_data_const ( const layout_diagram_t *this_ )
      68             : {
      69           0 :     assert ( NULL != (*this_).data );
      70           0 :     return (*this_).data;
      71             : }
      72             : 
      73             : static inline data_row_id_t layout_diagram_get_diagram_id ( const layout_diagram_t *this_ )
      74             : {
      75             :     return data_diagram_get_row_id( (*this_).data );
      76             : }
      77             : 
      78             : 
      79             : /*
      80             : Copyright 2018-2024 Andreas Warnke
      81             : 
      82             : Licensed under the Apache License, Version 2.0 (the "License");
      83             : you may not use this file except in compliance with the License.
      84             : You may obtain a copy of the License at
      85             : 
      86             :     http://www.apache.org/licenses/LICENSE-2.0
      87             : 
      88             : Unless required by applicable law or agreed to in writing, software
      89             : distributed under the License is distributed on an "AS IS" BASIS,
      90             : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      91             : See the License for the specific language governing permissions and
      92             : limitations under the License.
      93             : */

Generated by: LCOV version 1.16