| 1 |
/* File: pencil_relationship_painter.h; Copyright and License: see below */ |
| 2 |
|
| 3 |
#ifndef PENCIL_RELATIONSHIP_PAINTER_H |
| 4 |
#define PENCIL_RELATIONSHIP_PAINTER_H |
| 5 |
|
| 6 |
/* public file for the doxygen documentation: */ |
| 7 |
/*! |
| 8 |
* \file |
| 9 |
* \brief Renders a relationship into a cairo drawing context |
| 10 |
*/ |
| 11 |
|
| 12 |
#include "pencil_marker.h" |
| 13 |
#include "pencil_size.h" |
| 14 |
#include "layout/layout_relationship.h" |
| 15 |
#include "draw/draw_relationship_label.h" |
| 16 |
#include "draw/draw_stereotype_icon.h" |
| 17 |
#include "geometry/geometry_connector.h" |
| 18 |
#include "set/data_profile_part.h" |
| 19 |
#include "set/data_visible_set.h" |
| 20 |
#include "set/data_profile_part.h" |
| 21 |
#include "set/data_small_set.h" |
| 22 |
#include "entity/data_diagram.h" |
| 23 |
#include "entity/data_id.h" |
| 24 |
#include <cairo.h> |
| 25 |
#include <stdint.h> |
| 26 |
|
| 27 |
/*! |
| 28 |
* \brief attributes of the relationship painter |
| 29 |
* |
| 30 |
* \note This class is stateless. |
| 31 |
* It may either be instantiated once and used many times or be instantiated per use. |
| 32 |
*/ |
| 33 |
struct pencil_relationship_painter_struct { |
| 34 |
pencil_marker_t marker; /*!< own instance of a marker */ |
| 35 |
draw_relationship_label_t draw_relationship_label; /*!< collection of draw label functions */ |
| 36 |
}; |
| 37 |
|
| 38 |
typedef struct pencil_relationship_painter_struct pencil_relationship_painter_t; |
| 39 |
|
| 40 |
/*! |
| 41 |
* \brief initializes the painter |
| 42 |
* |
| 43 |
* \param this_ pointer to own object attributes |
| 44 |
*/ |
| 45 |
void pencil_relationship_painter_init( pencil_relationship_painter_t *this_ ); |
| 46 |
|
| 47 |
/*! |
| 48 |
* \brief destroys the painter |
| 49 |
* |
| 50 |
* \param this_ pointer to own object attributes |
| 51 |
*/ |
| 52 |
void pencil_relationship_painter_destroy( pencil_relationship_painter_t *this_ ); |
| 53 |
|
| 54 |
/*! |
| 55 |
* \brief draws the chosen classifier contents into the diagram_bounds area of the cairo drawing context |
| 56 |
* |
| 57 |
* \param this_ pointer to own object attributes |
| 58 |
* \param layouted_relationship pointer to the layout-information and data to be drawn |
| 59 |
* \param mark_focused true if the object is to be marked as "focused" |
| 60 |
* \param mark_highlighted true if the object is to be marked as "highlighted" |
| 61 |
* \param mark_selected true if the object is to be marked as "selected" |
| 62 |
* \param profile pointer to the profile-part that provides the stereotypes of the elements to be drawn |
| 63 |
* \param pencil_size set of sizes and colors for drawing lines and text |
| 64 |
* \param layout structure to layout fonts |
| 65 |
* \param cr a cairo drawing context |
| 66 |
*/ |
| 67 |
void pencil_relationship_painter_draw ( pencil_relationship_painter_t *this_, |
| 68 |
const layout_relationship_t *layouted_relationship, |
| 69 |
bool mark_focused, |
| 70 |
bool mark_highlighted, |
| 71 |
bool mark_selected, |
| 72 |
const data_profile_part_t *profile, |
| 73 |
const pencil_size_t *pencil_size, |
| 74 |
PangoLayout *layout, |
| 75 |
cairo_t *cr |
| 76 |
); |
| 77 |
|
| 78 |
#endif /* PENCIL_RELATIONSHIP_PAINTER_H */ |
| 79 |
|
| 80 |
|
| 81 |
/* |
| 82 |
Copyright 2017-2026 Andreas Warnke |
| 83 |
|
| 84 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 85 |
you may not use this file except in compliance with the License. |
| 86 |
You may obtain a copy of the License at |
| 87 |
|
| 88 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 89 |
|
| 90 |
Unless required by applicable law or agreed to in writing, software |
| 91 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 92 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 93 |
See the License for the specific language governing permissions and |
| 94 |
limitations under the License. |
| 95 |
*/ |