AffData

Introduction

AffData is a simple struct in which all the main Affinity settings are stored. This allows for very easy access to settings. From the main AffinityApp instance, AffData is called settings. Example usage:

if (!app->settings->normal_buttons)
{
  //draw different buttons
  //...
}

This is currently the entire AffData struct. Plugin-specific settings, such as lock_screen, log_out, etc. will eventually be moved to their respective plugins.

typedef struct
{
  gpointer *app;
 
  /* exec */
  gchar *open_uri;
  gchar *computer;
  gchar *network;
 
  /* keybinding */
  gchar *key_binding;
 
  /* favourites and recent searches */
  gchar *favourites;
  gchar *searches;
 
  /* window position */
  gint window_x;
  gint window_y;
 
  /* only hide manually */
  gboolean hide_man_only;
 
  /* filters */
  gchar *apps;
  gchar *books;
  gchar *contacts;
  gchar *docs;
  gchar *emails;
  gchar *images;
  gchar *music;
  gchar *vids;
 
  /* system calls */
  gchar *config_software;
  gchar *control_panel;
  gchar *lock_screen;
  gchar *log_out;
 
  /* Appearence */
  gboolean rounded_corners;
  AffColor back_step_1;
  AffColor back_step_2;
  AffColor hi_step_1;
  AffColor hi_step_2;
  AffColor highlight;
  AffColor border;
  AffColor widget_border;
  AffColor widget_highlight;
  gchar *text_color;
 
  /* standard gtk options */
  gboolean normal_buttons;
  gboolean gtk_colors;
  gboolean pretty_frames;
 
  /* Plugins */
  gchar *top_start;
  gchar *top_end;
  gchar *l_sidebar_start;
  gchar *l_sidebar_end;
  gchar *center_start;
  gchar *center_end;
  gchar *r_sidebar_start;
  gchar *r_sidebar_end;
  gchar *bottom_start;
  gchar *bottom_end;
 
  /* Applet specific */
  gchar *applet_icon;
  gchar *applet_name;
} AffData;

AffColor

AffColor is a simple struct designed for use with Cairo functions, which all take floating-point color values from 0.0 to 1.0.

typedef struct
{
  float red;
  float green;
  float blue;
  float alpha;
} AffColor;

There is a function for converting a GdkColor into an AffColor.

AffColor aff_color_from_gdk_color(GdkColor gcolor);
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License