summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-12 15:37:57 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-12 15:37:57 +0200
commite719cd6eba23381b663bb57e176769cf371712b7 (patch)
tree46ceaf4b2dd4f3e526bc3d1b1cf55f1c790f292e
parentSubstituted the long button labels with shorter ones. The long ones were writ... (diff)
downloadufed-e719cd6eba23381b663bb57e176769cf371712b7.tar.gz
ufed-e719cd6eba23381b663bb57e176769cf371712b7.tar.bz2
ufed-e719cd6eba23381b663bb57e176769cf371712b7.zip
sWrap_: new struct to support description line wrapping
-rw-r--r--ufed-curses-types.c4
-rw-r--r--ufed-curses-types.h36
2 files changed, 30 insertions, 10 deletions
diff --git a/ufed-curses-types.c b/ufed-curses-types.c
index 10504cf..a09336b 100644
--- a/ufed-curses-types.c
+++ b/ufed-curses-types.c
@@ -63,6 +63,10 @@ sFlag* addFlag (sFlag** root, const char* name, int line, int ndesc, const char
newFlag->desc[i].stateForced = ' ';
newFlag->desc[i].stateMasked = ' ';
newFlag->desc[i].statePackage = ' ';
+ newFlag->desc[i].wrap = NULL;
+ newFlag->desc[i].wrapOrder = e_order;
+ newFlag->desc[i].wrapStripped = e_desc;
+ newFlag->desc[i].wrapWidth = 0;
}
} else
ERROR_EXIT(-1, "Unable to allocate %lu bytes for %d sDesc_ structs\n",
diff --git a/ufed-curses-types.h b/ufed-curses-types.h
index e53a58c..33b94a1 100644
--- a/ufed-curses-types.h
+++ b/ufed-curses-types.h
@@ -100,20 +100,36 @@ typedef enum eWin_ {
* ===============
*/
+
+/** @struct sWrap_
+ * @brief Describe one start and length of a wrapped description line
+**/
+typedef struct sWrap_ {
+ size_t len; //!< Length of the wrapped line part
+ size_t pos; //!< Starting position of a wrapped line part
+ struct
+ sWrap_* next; //!< Next part of the wrapped line
+} sWrap;
+
/** @struct sDesc_
* @brief Describe one description line
**/
typedef struct sDesc_ {
- char* desc; //!< The description line
- char* desc_alt; //!< The alternative description line
- bool isGlobal; //!< true if this is the global description and setting
- bool isInstalled; //!< global: at least one pkg is installed, local: all in *pkg are installed.
- char* pkg; //!< affected packages
- char stateForced; //!< unforced '-', forced '+' or not set ' ' by *use.force
- char stateMasked; //!< unmasked '-', masked '+' or not sed ' ' by *use.mask
- char stateDefault; //!< disabled '-', enabled '+' or not set ' ' ebuilds IUSE (installed packages only)
- char statePackage; //!< disabled '-', enabled '+' or not set ' ' by profiles package.use
- char statePkgUse; //!< disabled '-', enabled '+' or not set ' ' by users package.use
+ char* desc; //!< The description line
+ char* desc_alt; //!< The alternative description line
+ bool isGlobal; //!< true if this is the global description and setting
+ bool isInstalled; //!< global: at least one pkg is installed, local: all in *pkg are installed.
+ char* pkg; //!< affected packages
+ char stateForced; //!< unforced '-', forced '+' or not set ' ' by *use.force
+ char stateMasked; //!< unmasked '-', masked '+' or not sed ' ' by *use.mask
+ char stateDefault; //!< disabled '-', enabled '+' or not set ' ' ebuilds IUSE (installed packages only)
+ char statePackage; //!< disabled '-', enabled '+' or not set ' ' by profiles package.use
+ char statePkgUse; //!< disabled '-', enabled '+' or not set ' ' by users package.use
+ sWrap* wrap; //!< If lines are wrapped, this list describes the parts
+ int wrapCount; //!< How many parts there are.
+ eOrder wrapOrder; //!< State of e_order when the wrap parts were calculated last
+ eDesc wrapStripped; //!< State of e_desc when the wrap parts were calculated last
+ size_t wrapWidth; //!< The width available the wrap parts are calculated from
} sDesc;