Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
regionimpl.h
Go to the documentation of this file.
00001  // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __RAPICORN_REGION_IMPL_H__
00003 #define __RAPICORN_REGION_IMPL_H__
00004 
00005 #include <rcore/rapicornconfig.h>
00006 #include <stdint.h>
00007 #include <stdbool.h>
00008 
00009 RAPICORN_EXTERN_C_BEGIN();
00010 
00011 /* --- types & macros --- */
00012 typedef signed long long int llint64_t;
00013 typedef char llint64_size_assertion_t[-!(sizeof (llint64_t) == 8)];
00014 typedef enum {
00015   RAPICORN_REGION_OUTSIDE = 0,
00016   RAPICORN_REGION_INSIDE  = 1,
00017   RAPICORN_REGION_PARTIAL = 2
00018 } RapicornRegionCType;
00019 typedef struct _RapicornRegion    RapicornRegion;
00020 typedef struct {
00021   llint64_t x1, y1, x2, y2;
00022 } RapicornRegionBox;
00023 typedef struct {
00024   llint64_t x, y;
00025 } RapicornRegionPoint;
00026 
00027 /* --- functions --- */
00028 RapicornRegion*         _rapicorn_region_create         (void);
00029 void                    _rapicorn_region_free           (RapicornRegion            *region);
00030 void                    _rapicorn_region_init           (RapicornRegion            *region,
00031                                                          int                        region_size);
00032 void                    _rapicorn_region_uninit         (RapicornRegion            *region);
00033 void                    _rapicorn_region_copy           (RapicornRegion            *region,
00034                                                          const RapicornRegion      *region2);
00035 void                    _rapicorn_region_clear          (RapicornRegion            *region);
00036 bool                    _rapicorn_region_empty          (const RapicornRegion      *region);
00037 bool                    _rapicorn_region_equal          (const RapicornRegion      *region,
00038                                                          const RapicornRegion      *region2);
00039 int                     _rapicorn_region_cmp            (const RapicornRegion      *region,
00040                                                          const RapicornRegion      *region2);
00041 void                    _rapicorn_region_swap           (RapicornRegion            *region,
00042                                                          RapicornRegion            *region2);
00043 void                    _rapicorn_region_extents        (const RapicornRegion      *region,
00044                                                          RapicornRegionBox         *rect);
00045 bool                    _rapicorn_region_point_in       (const RapicornRegion      *region,
00046                                                          const RapicornRegionPoint *point);
00047 RapicornRegionCType     _rapicorn_region_rect_in        (const RapicornRegion      *region,
00048                                                          const RapicornRegionBox   *rect);
00049 RapicornRegionCType     _rapicorn_region_region_in      (const RapicornRegion      *region,
00050                                                          const RapicornRegion      *region2);
00051 int                     _rapicorn_region_get_rects      (const RapicornRegion      *region,
00052                                                          int                        n_rects,
00053                                                          RapicornRegionBox         *rects);
00054 int                     _rapicorn_region_get_rect_count (const RapicornRegion      *region);
00055 void                    _rapicorn_region_union_rect     (RapicornRegion            *region,
00056                                                          const RapicornRegionBox   *rect);
00057 void                    _rapicorn_region_union          (RapicornRegion            *region,
00058                                                          const RapicornRegion      *region2);
00059 void                    _rapicorn_region_subtract       (RapicornRegion            *region,
00060                                                          const RapicornRegion      *region2);
00061 void                    _rapicorn_region_intersect      (RapicornRegion            *region,
00062                                                          const RapicornRegion      *region2);
00063 void                    _rapicorn_region_xor            (RapicornRegion            *region,
00064                                                          const RapicornRegion      *region2);
00065 
00066 RAPICORN_EXTERN_C_END();
00067 
00068 #endif /* __RAPICORN_REGION_IMPL_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines