Rapicorn - Experimental UI Toolkit - Source Code 10.08.1
regionimpl.h
Go to the documentation of this file.
00001 /* Rapicorn region handling
00002  * Copyright (C) 2006 Tim Janik
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * A copy of the GNU Lesser General Public License should ship along
00015  * with this library; if not, see http://www.gnu.org/copyleft/.
00016  */
00017 #ifndef __RAPICORN_REGION_IMPL_H__
00018 #define __RAPICORN_REGION_IMPL_H__
00019 
00020 #include <rcore/rapicorncdefs.h>
00021 
00022 RAPICORN_EXTERN_C_BEGIN();
00023 
00024 /* --- types & macros --- */
00025 typedef enum {
00026   RAPICORN_REGION_OUTSIDE = 0,
00027   RAPICORN_REGION_INSIDE  = 1,
00028   RAPICORN_REGION_PARTIAL = 2
00029 } RapicornRegionCType;
00030 typedef struct _RapicornRegion    RapicornRegion;
00031 typedef struct {
00032   RapicornInt64 x1, y1, x2, y2;
00033 } RapicornRegionBox;
00034 typedef struct {
00035   RapicornInt64 x, y;
00036 } RapicornRegionPoint;
00037 
00038 /* --- functions --- */
00039 RapicornRegion*         _rapicorn_region_create         (void);
00040 void                    _rapicorn_region_free           (RapicornRegion            *region);
00041 void                    _rapicorn_region_init           (RapicornRegion            *region,
00042                                                          int                        region_size);
00043 void                    _rapicorn_region_uninit         (RapicornRegion            *region);
00044 void                    _rapicorn_region_copy           (RapicornRegion            *region,
00045                                                          const RapicornRegion      *region2);
00046 void                    _rapicorn_region_clear          (RapicornRegion            *region);
00047 bool                    _rapicorn_region_empty          (const RapicornRegion      *region);
00048 bool                    _rapicorn_region_equal          (const RapicornRegion      *region,
00049                                                          const RapicornRegion      *region2);
00050 int                     _rapicorn_region_cmp            (const RapicornRegion      *region,
00051                                                          const RapicornRegion      *region2);
00052 void                    _rapicorn_region_swap           (RapicornRegion            *region,
00053                                                          RapicornRegion            *region2);
00054 void                    _rapicorn_region_extents        (const RapicornRegion      *region,
00055                                                          RapicornRegionBox         *rect);
00056 bool                    _rapicorn_region_point_in       (const RapicornRegion      *region,
00057                                                          const RapicornRegionPoint *point);
00058 RapicornRegionCType     _rapicorn_region_rect_in        (const RapicornRegion      *region,
00059                                                          const RapicornRegionBox   *rect);
00060 RapicornRegionCType     _rapicorn_region_region_in      (const RapicornRegion      *region,
00061                                                          const RapicornRegion      *region2);
00062 int                     _rapicorn_region_get_rects      (const RapicornRegion      *region,
00063                                                          int                        n_rects,
00064                                                          RapicornRegionBox         *rects);
00065 void                    _rapicorn_region_union_rect     (RapicornRegion            *region,
00066                                                          const RapicornRegionBox   *rect);
00067 void                    _rapicorn_region_union          (RapicornRegion            *region,
00068                                                          const RapicornRegion      *region2);
00069 void                    _rapicorn_region_subtract       (RapicornRegion            *region,
00070                                                          const RapicornRegion      *region2);
00071 void                    _rapicorn_region_intersect      (RapicornRegion            *region,
00072                                                          const RapicornRegion      *region2);
00073 void                    _rapicorn_region_xor            (RapicornRegion            *region,
00074                                                          const RapicornRegion      *region2);
00075 void                    _rapicorn_region_debug          (const char                *format,
00076                                                          ...) RAPICORN_PRINTF (1, 2);
00077 
00078 RAPICORN_EXTERN_C_END();
00079 
00080 #endif /* __RAPICORN_REGION_IMPL_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines