LCOV - code coverage report
Current view: top level - shumate/vector - shumate-vector-expression-private.h (source / functions) Hit Total Coverage
Test: Code coverage Lines: 2 2 100.0 %
Date: 2024-05-11 21:41:31 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 27 54 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * Copyright (C) 2021 James Westman <james@jwestman.net>
       3                 :            :  *
       4                 :            :  * This library is free software; you can redistribute it and/or
       5                 :            :  * modify it under the terms of the GNU Lesser General Public
       6                 :            :  * License as published by the Free Software Foundation; either
       7                 :            :  * version 2.1 of the License, or (at your option) any later version.
       8                 :            :  *
       9                 :            :  * This library is distributed in the hope that it will be useful,
      10                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      11                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      12                 :            :  * Lesser General Public License for more details.
      13                 :            :  *
      14                 :            :  * You should have received a copy of the GNU Lesser General Public
      15                 :            :  * License along with this library; if not, see <https://www.gnu.org/licenses/>.
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <json-glib/json-glib.h>
      21                 :            : #include "shumate-vector-render-scope-private.h"
      22                 :            : #include "shumate-vector-symbol-info-private.h"
      23                 :            : #include "shumate-vector-value-private.h"
      24                 :            : #include "shumate-vector-index-private.h"
      25                 :            : 
      26                 :            : G_BEGIN_DECLS
      27                 :            : 
      28                 :            : typedef struct _ShumateVectorExpressionContext ShumateVectorExpressionContext;
      29                 :            : struct _ShumateVectorExpressionContext {
      30                 :            :   ShumateVectorExpressionContext *parent;
      31                 :            :   GHashTable *variables;
      32                 :            : };
      33                 :            : 
      34                 :            : void shumate_vector_expression_context_clear (ShumateVectorExpressionContext *ctx);
      35                 :            : 
      36                 :          9 : G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (ShumateVectorExpressionContext, shumate_vector_expression_context_clear)
      37                 :            : 
      38                 :            : #define SHUMATE_TYPE_VECTOR_EXPRESSION (shumate_vector_expression_get_type())
      39   [ +  -  +  -  :       8316 : G_DECLARE_DERIVABLE_TYPE (ShumateVectorExpression, shumate_vector_expression, SHUMATE, VECTOR_EXPRESSION, GObject)
          +  -  +  -  +  
          -  +  -  -  +  
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  -  +  +  
          -  +  -  +  -  
          +  -  +  -  +  
             -  +  -  +  
                      - ]
      40                 :            : 
      41                 :            : struct _ShumateVectorExpressionClass
      42                 :            : {
      43                 :            :   GObjectClass parent_class;
      44                 :            : 
      45                 :            :   gboolean (*eval) (ShumateVectorExpression  *self,
      46                 :            :                     ShumateVectorRenderScope *scope,
      47                 :            :                     ShumateVectorValue       *out);
      48                 :            : 
      49                 :            :   ShumateVectorIndexBitset *(*eval_bitset) (ShumateVectorExpression  *self,
      50                 :            :                                             ShumateVectorRenderScope *scope,
      51                 :            :                                             ShumateVectorIndexBitset *mask);
      52                 :            : 
      53                 :            :   void (*collect_indexes) (ShumateVectorExpression       *self,
      54                 :            :                            const char                    *layer_name,
      55                 :            :                            ShumateVectorIndexDescription *index_description);
      56                 :            : };
      57                 :            : 
      58                 :            : ShumateVectorExpression *shumate_vector_expression_from_json (JsonNode  *json,
      59                 :            :                                                               GError   **error);
      60                 :            : ShumateVectorExpression *shumate_vector_expression_filter_from_format (const char *format,
      61                 :            :                                                                        GError **error);
      62                 :            : 
      63                 :            : gboolean shumate_vector_expression_eval (ShumateVectorExpression  *self,
      64                 :            :                                          ShumateVectorRenderScope *scope,
      65                 :            :                                          ShumateVectorValue       *out);
      66                 :            : 
      67                 :            : ShumateVectorIndexBitset *shumate_vector_expression_eval_bitset (ShumateVectorExpression  *self,
      68                 :            :                                                                  ShumateVectorRenderScope *scope,
      69                 :            :                                                                  ShumateVectorIndexBitset *mask);
      70                 :            : 
      71                 :            : void shumate_vector_expression_collect_indexes (ShumateVectorExpression       *self,
      72                 :            :                                                 const char                    *layer_name,
      73                 :            :                                                 ShumateVectorIndexDescription *index_description);
      74                 :            : 
      75                 :            : double shumate_vector_expression_eval_number (ShumateVectorExpression  *self,
      76                 :            :                                               ShumateVectorRenderScope *scope,
      77                 :            :                                               double                    default_val);
      78                 :            : 
      79                 :            : gboolean shumate_vector_expression_eval_boolean (ShumateVectorExpression  *self,
      80                 :            :                                                  ShumateVectorRenderScope *scope,
      81                 :            :                                                  gboolean                  default_val);
      82                 :            : 
      83                 :            : 
      84                 :            : char *shumate_vector_expression_eval_string (ShumateVectorExpression  *self,
      85                 :            :                                              ShumateVectorRenderScope *scope,
      86                 :            :                                              const char               *default_val);
      87                 :            : 
      88                 :            : 
      89                 :            : void shumate_vector_expression_eval_color (ShumateVectorExpression  *self,
      90                 :            :                                            ShumateVectorRenderScope *scope,
      91                 :            :                                            GdkRGBA                  *color);
      92                 :            : 
      93                 :            : ShumateVectorSprite *shumate_vector_expression_eval_image (ShumateVectorExpression  *self,
      94                 :            :                                                            ShumateVectorRenderScope *scope);
      95                 :            : 
      96                 :            : ShumateVectorAlignment shumate_vector_expression_eval_alignment (ShumateVectorExpression  *self,
      97                 :            :                                                                  ShumateVectorRenderScope *scope);
      98                 :            : ShumateVectorPlacement shumate_vector_expression_eval_placement (ShumateVectorExpression  *self,
      99                 :            :                                                                  ShumateVectorRenderScope *scope);
     100                 :            : 
     101                 :            : ShumateVectorAnchor shumate_vector_expression_eval_anchor (ShumateVectorExpression  *self,
     102                 :            :                                                            ShumateVectorRenderScope *scope);
     103                 :            : 
     104                 :            : ShumateVectorOverlap shumate_vector_expression_eval_overlap (ShumateVectorExpression  *self,
     105                 :            :                                                              ShumateVectorExpression  *allow_overlap,
     106                 :            :                                                              ShumateVectorRenderScope *scope);
     107                 :            : 
     108                 :            : G_END_DECLS

Generated by: LCOV version 1.14