1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[Test] Fix the test.

This commit is contained in:
Dave Davenport 2021-06-15 12:31:32 +02:00
parent 0f21541327
commit 74144db77d
14 changed files with 144 additions and 13 deletions

View file

@ -218,22 +218,22 @@ static char * combi_mgrv ( const Mode *sw, unsigned int selected_line, int *stat
char * str = retv = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE ); char * str = retv = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE );
const char *dname = mode_get_display_name ( pd->switchers[i].mode ); const char *dname = mode_get_display_name ( pd->switchers[i].mode );
if ( !config.combi_hide_mode_prefix ) { if ( !config.combi_hide_mode_prefix ) {
retv = g_strdup_printf ( "%s %s", dname, str ); retv = g_strdup_printf ( "%s %s", dname, str );
g_free ( str ); g_free ( str );
}
if ( attr_list != NULL ) { if ( attr_list != NULL ) {
ThemeWidget *wid = rofi_config_find_widget ( sw->name, NULL, TRUE ); ThemeWidget *wid = rofi_config_find_widget ( sw->name, NULL, TRUE );
Property *p = rofi_theme_find_property ( wid, P_COLOR, pd->switchers[i].mode->name, TRUE ); Property *p = rofi_theme_find_property ( wid, P_COLOR, pd->switchers[i].mode->name, TRUE );
if ( p != NULL ) { if ( p != NULL ) {
PangoAttribute *pa = pango_attr_foreground_new ( PangoAttribute *pa = pango_attr_foreground_new (
p->value.color.red * 65535, p->value.color.red * 65535,
p->value.color.green * 65535, p->value.color.green * 65535,
p->value.color.blue * 65535 ); p->value.color.blue * 65535 );
pa->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING; pa->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING;
pa->end_index = strlen ( dname ); pa->end_index = strlen ( dname );
*attr_list = g_list_append ( *attr_list, pa ); *attr_list = g_list_append ( *attr_list, pa );
} }
}
} }
return retv; return retv;
} }

View file

@ -153,8 +153,15 @@ void mode_set_private_data ( Mode *mode, void *pd )
const char *mode_get_display_name ( const Mode *mode ) const char *mode_get_display_name ( const Mode *mode )
{ {
if ( mode->display_name != NULL ) { ThemeWidget *wid = rofi_config_find_widget ( mode->name, NULL, TRUE );
return mode->display_name; if ( wid ) {
Property *p = rofi_theme_find_property ( wid, P_STRING, "display-name", FALSE );
if ( p != NULL ) {
return p->value.s;
}
}
if ( mode->display_name != NULL ) {
return mode->display_name;
} }
return mode->name; return mode->name;
} }

View file

@ -16,6 +16,8 @@ const char * const PropertyTypeName[P_NUM_TYPES] = {
"Boolean", "Boolean",
/** Color */ /** Color */
"Color", "Color",
/** Image */
"Iamge",
/** Padding */ /** Padding */
"Padding", "Padding",
/** Link to global setting */ /** Link to global setting */

View file

@ -62,6 +62,17 @@ unsigned int test =0;
abort ( ); \ abort ( ); \
} \ } \
} }
ThemeWidget *rofi_configuration = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
int monitor_active ( G_GNUC_UNUSED workarea *mon ) int monitor_active ( G_GNUC_UNUSED workarea *mon )

View file

@ -55,6 +55,16 @@ static int test = 0;
} }
#include "theme.h" #include "theme.h"
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean rofi_theme_parse_string ( const char *string ) gboolean rofi_theme_parse_string ( const char *string )
{ {

View file

@ -56,6 +56,16 @@ static int test = 0;
} }
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
double textbox_get_estimated_char_height ( void ) double textbox_get_estimated_char_height ( void )
{ {
return 12.0; return 12.0;

View file

@ -48,6 +48,16 @@ static int test = 0;
#include "theme.h" #include "theme.h"
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean rofi_theme_parse_string ( const char *string ) gboolean rofi_theme_parse_string ( const char *string )
{ {
return FALSE; return FALSE;

View file

@ -63,12 +63,24 @@ static int test = 0;
} }
#include "widgets/textbox.h" #include "widgets/textbox.h"
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
gboolean rofi_theme_parse_string ( const char *string ) gboolean rofi_theme_parse_string ( const char *string )
{ {
return FALSE; return FALSE;
} }
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
double textbox_get_estimated_char_height ( void ) double textbox_get_estimated_char_height ( void )
{ {
return 12.0; return 12.0;

View file

@ -45,6 +45,16 @@
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean rofi_theme_parse_string ( G_GNUC_UNUSED const char *string ) gboolean rofi_theme_parse_string ( G_GNUC_UNUSED const char *string )
{ {
return FALSE; return FALSE;

View file

@ -49,6 +49,16 @@
ThemeWidget *rofi_theme = NULL; ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean rofi_theme_parse_string ( const char *string ) gboolean rofi_theme_parse_string ( const char *string )
{ {
return FALSE; return FALSE;

View file

@ -56,6 +56,18 @@ unsigned int test =0;
} \ } \
} }
ThemeWidget *rofi_configuration = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
int monitor_active ( G_GNUC_UNUSED workarea *mon ) int monitor_active ( G_GNUC_UNUSED workarea *mon )
{ {
return 0; return 0;

View file

@ -52,6 +52,19 @@ unsigned int normal_window_mode = 0;
#include "view.h" #include "view.h"
ThemeWidget *rofi_configuration = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error ) gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{ {
return FALSE; return FALSE;

View file

@ -48,6 +48,17 @@
#define REAL_COMPARE_DELTA 0.001 #define REAL_COMPARE_DELTA 0.001
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup )
{ {
fputs ( msg, stderr ); fputs ( msg, stderr );

View file

@ -43,6 +43,19 @@ unsigned int test =0;
assert ( a ); \ assert ( a ); \
printf ( "Test %3u passed (%s)\n", ++test, # a ); \ printf ( "Test %3u passed (%s)\n", ++test, # a ); \
} }
ThemeWidget *rofi_configuration = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
return 0;
}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error ) gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{ {
return FALSE; return FALSE;