Line data Source code
1 : /* File: io_txt_icon.inl; Copyright and License: see below */ 2 : 3 : #include <assert.h> 4 : #include "u8/u8_trace.h" 5 : #include "u8/u8_log.h" 6 : 7 : #define IO_TXT_ICON_TWO_MIDDLE_DOTS "\xC2\xB7\xC2\xB7" 8 : 9 0 : static inline void io_txt_icon_init( io_txt_icon_t *this_ ) 10 : { 11 0 : } 12 : 13 0 : static inline void io_txt_icon_destroy( io_txt_icon_t *this_ ) 14 : { 15 0 : } 16 : 17 0 : static inline const char* io_txt_icon_get_relationship ( io_txt_icon_t *this_, data_relationship_type_t type ) 18 : { 19 : const char* result; 20 : 21 0 : switch (type) 22 : { 23 0 : case DATA_RELATIONSHIP_TYPE_UML_DEPENDENCY: 24 : { 25 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 26 : } 27 0 : break; 28 : 29 0 : case DATA_RELATIONSHIP_TYPE_UML_ASSOCIATION: 30 : { 31 0 : result = "-->"; 32 : } 33 0 : break; 34 : 35 0 : case DATA_RELATIONSHIP_TYPE_UML_AGGREGATION: 36 : { 37 0 : result = "o--"; 38 : } 39 0 : break; 40 : 41 0 : case DATA_RELATIONSHIP_TYPE_UML_COMPOSITION: 42 : { 43 0 : result = "*--"; 44 : } 45 0 : break; 46 : 47 0 : case DATA_RELATIONSHIP_TYPE_UML_GENERALIZATION: 48 : { 49 0 : result = "--|>"; 50 : } 51 0 : break; 52 : 53 0 : case DATA_RELATIONSHIP_TYPE_UML_REALIZATION: 54 : { 55 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS "|>"; 56 : } 57 0 : break; 58 : 59 0 : case DATA_RELATIONSHIP_TYPE_UML_ASYNC_CALL: 60 : { 61 0 : result = "-->"; 62 : } 63 0 : break; 64 : 65 0 : case DATA_RELATIONSHIP_TYPE_UML_SYNC_CALL: 66 : { 67 0 : result = "-->>"; 68 : } 69 0 : break; 70 : 71 0 : case DATA_RELATIONSHIP_TYPE_UML_RETURN_CALL: 72 : { 73 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">>"; 74 : } 75 0 : break; 76 : 77 0 : case DATA_RELATIONSHIP_TYPE_UML_COMMUNICATION_PATH: 78 : { 79 0 : result = "--"; 80 : } 81 0 : break; 82 : 83 0 : case DATA_RELATIONSHIP_TYPE_UML_CONTROL_FLOW: 84 : { 85 0 : result = "-->"; 86 : } 87 0 : break; 88 : 89 0 : case DATA_RELATIONSHIP_TYPE_UML_OBJECT_FLOW: 90 : { 91 0 : result = "#-->"; 92 : } 93 0 : break; 94 : 95 0 : case DATA_RELATIONSHIP_TYPE_UML_DEPLOY: 96 : { 97 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 98 : } 99 0 : break; 100 : 101 0 : case DATA_RELATIONSHIP_TYPE_UML_MANIFEST: 102 : { 103 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 104 : } 105 0 : break; 106 : 107 0 : case DATA_RELATIONSHIP_TYPE_UML_EXTEND: 108 : { 109 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 110 : } 111 0 : break; 112 : 113 0 : case DATA_RELATIONSHIP_TYPE_UML_INCLUDE: 114 : { 115 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 116 : } 117 0 : break; 118 : 119 0 : case DATA_RELATIONSHIP_TYPE_UML_CONTAINMENT: 120 : { 121 0 : result = "+--"; 122 : } 123 0 : break; 124 : 125 0 : case DATA_RELATIONSHIP_TYPE_UML_REFINE: 126 : { 127 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 128 : } 129 0 : break; 130 : 131 0 : case DATA_RELATIONSHIP_TYPE_UML_TRACE: 132 : { 133 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 134 : } 135 0 : break; 136 : 137 0 : default: 138 : { 139 0 : result = IO_TXT_ICON_TWO_MIDDLE_DOTS ">"; 140 0 : U8_LOG_ERROR("error: unknown data_relationship_type_t."); 141 0 : assert(false); 142 : } 143 : break; 144 : } 145 0 : return ( result ); 146 : } 147 : 148 : 149 : /* 150 : Copyright 2023-2024 Andreas Warnke 151 : 152 : Licensed under the Apache License, Version 2.0 (the "License"); 153 : you may not use this file except in compliance with the License. 154 : You may obtain a copy of the License at 155 : 156 : http://www.apache.org/licenses/LICENSE-2.0 157 : 158 : Unless required by applicable law or agreed to in writing, software 159 : distributed under the License is distributed on an "AS IS" BASIS, 160 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 161 : See the License for the specific language governing permissions and 162 : limitations under the License. 163 : */