summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Davenport <DaveDavenport@users.noreply.github.com>2017-03-10 23:39:29 +0100
committerGitHub <noreply@github.com>2017-03-10 23:39:29 +0100
commitcee753bd3cc2f96743e8771d0cd82beee32fcd2e (patch)
tree63d492fcd35830758e9009093d249878b69a20be /include
parent25678d7a59ba7419a2d3b018971d5539124cf750 (diff)
Zeltakmadness (#572)
* Allow modi to set extra pango attributes on displayed rows * Fix some documentation, only highlight the mode name with color. * Small rename.
Diffstat (limited to 'include')
-rw-r--r--include/mode-private.h5
-rw-r--r--include/mode.h4
-rw-r--r--include/theme.h28
3 files changed, 33 insertions, 4 deletions
diff --git a/include/mode-private.h b/include/mode-private.h
index 04e0ea9d..633065f0 100644
--- a/include/mode-private.h
+++ b/include/mode-private.h
@@ -2,7 +2,7 @@
#define ROFI_MODE_PRIVATE_H
#include <gmodule.h>
-#define ABI_VERSION 0x00000003
+#define ABI_VERSION 0x00000004
/**
* @param data Pointer to #Mode object.
@@ -15,13 +15,14 @@ typedef void ( *_mode_free )( Mode *data );
* @param sw The #Mode pointer
* @param selected_line The selected line
* @param state The state to display [out]
+ * @param attribute_list List of extra (pango) attribute to apply when displaying. [out][null]
* @param get_entry if it should only return the state
*
* Get the value for displaying.
*
* @return the string and state for displaying.
*/
-typedef char * ( *_mode_get_display_value )( const Mode *sw, unsigned int selected_line, int *state, int get_entry );
+typedef char * ( *_mode_get_display_value )( const Mode *sw, unsigned int selected_line, int *state, GList **attribute_list, int get_entry );
/**
* @param sw The #Mode pointer
diff --git a/include/mode.h b/include/mode.h
index 0dbef79c..f56a935b 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -1,6 +1,5 @@
#ifndef ROFI_MODE_H
#define ROFI_MODE_H
-
/**
* @defgroup MODE Mode
*
@@ -85,13 +84,14 @@ unsigned int mode_get_num_entries ( const Mode *sw );
* @param mode The mode to query
* @param selected_line The entry to query
* @param state The state of the entry [out]
+ * @param attribute_list List of extra (pango) attribute to apply when displaying. [out][null]
* @param get_entry If the should be returned.
*
* Returns the string as it should be displayed for the entry and the state of how it should be displayed.
*
* @returns allocated new string and state when get_entry is TRUE otherwise just the state.
*/
-char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, int get_entry );
+char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry );
/**
* @param mode The mode to query
diff --git a/include/theme.h b/include/theme.h
index 37cdf29c..ae1fdf5d 100644
--- a/include/theme.h
+++ b/include/theme.h
@@ -382,4 +382,32 @@ void distance_get_linestyle ( Distance d, cairo_t *draw );
*/
void rofi_theme_convert_old_theme ( void );
#endif
+
+/**
+ * Low-level functions.
+ * These can be used by non-widgets to obtain values.
+ */
+/**
+ * @param name The name of the element to find.
+ * @param state The state of the element.
+ * @param exact If the match should be exact, or parent can be included.
+ *
+ * Find the theme element. If not exact, the closest specified element is returned.
+ *
+ * @returns the ThemeWidget if found, otherwise NULL.
+ */
+ThemeWidget *rofi_theme_find_widget ( const char *name, const char *state, gboolean exact );
+
+/**
+ * @param widget The widget to find the property on.
+ * @param type The %PropertyType to find.
+ * @param property The property to find.
+ * @param exact If the property should only be found on this widget, or on parents if not found.
+ *
+ * Find the property on the widget. If not exact, the parents are searched recursively until match is found.
+ *
+ * @returns the Property if found, otherwise NULL.
+ */
+Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, const char *property, gboolean exact );
+
#endif