cleanup: Adapt to removed ClutterColor
It was replaced by CoglColor Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3142>
This commit is contained in:
parent
55027bb084
commit
7f0b1e98cf
@ -1,6 +1,7 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gio from 'gi://Gio';
|
||||
@ -54,8 +55,8 @@ const DRAG_PAGE_SWITCH_REPEAT_TIMEOUT = 1000;
|
||||
|
||||
const DELAYED_MOVE_TIMEOUT = 200;
|
||||
|
||||
const DIALOG_SHADE_NORMAL = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 204});
|
||||
const DIALOG_SHADE_HIGHLIGHT = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 85});
|
||||
const DIALOG_SHADE_NORMAL = new Cogl.Color({red: 0, green: 0, blue: 0, alpha: 204});
|
||||
const DIALOG_SHADE_HIGHLIGHT = new Cogl.Color({red: 0, green: 0, blue: 0, alpha: 85});
|
||||
|
||||
const DEFAULT_FOLDERS = {
|
||||
'Utilities': {
|
||||
@ -2732,7 +2733,7 @@ export const AppFolderDialog = GObject.registerClass({
|
||||
this.child.get_transformed_position();
|
||||
|
||||
this.ease({
|
||||
background_color: new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 0}),
|
||||
background_color: new Cogl.Color({red: 0, green: 0, blue: 0, alpha: 0}),
|
||||
duration: FOLDER_DIALOG_ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
});
|
||||
|
@ -94,6 +94,7 @@
|
||||
// MetaBackgroundImage MetaBackgroundImage
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import GDesktopEnums from 'gi://GDesktopEnums';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
@ -107,7 +108,7 @@ import * as LoginManager from '../misc/loginManager.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color({red: 40, green: 40, blue: 40, alpha: 255});
|
||||
const DEFAULT_BACKGROUND_COLOR = new Cogl.Color({red: 40, green: 40, blue: 40, alpha: 255});
|
||||
|
||||
const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
|
||||
const PRIMARY_COLOR_KEY = 'primary-color';
|
||||
@ -355,9 +356,9 @@ const Background = GObject.registerClass({
|
||||
let colorString, res_, color, secondColor;
|
||||
|
||||
colorString = this._settings.get_string(PRIMARY_COLOR_KEY);
|
||||
[res_, color] = Clutter.Color.from_string(colorString);
|
||||
[res_, color] = Cogl.Color.from_string(colorString);
|
||||
colorString = this._settings.get_string(SECONDARY_COLOR_KEY);
|
||||
[res_, secondColor] = Clutter.Color.from_string(colorString);
|
||||
[res_, secondColor] = Cogl.Color.from_string(colorString);
|
||||
|
||||
let shadingType = this._settings.get_enum(COLOR_SHADING_TYPE_KEY);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
import Atspi from 'gi://Atspi';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import GDesktopEnums from 'gi://GDesktopEnums';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
@ -406,7 +407,7 @@ export class Magnifier extends Signals.EventEmitter {
|
||||
*/
|
||||
setCrosshairsColor(color) {
|
||||
if (this._crossHairs) {
|
||||
let [res_, clutterColor] = Clutter.Color.from_string(color);
|
||||
let [res_, clutterColor] = Cogl.Color.from_string(color);
|
||||
this._crossHairs.setColor(clutterColor);
|
||||
}
|
||||
}
|
||||
@ -1908,13 +1909,13 @@ class Crosshairs extends Clutter.Actor {
|
||||
* setColor:
|
||||
* Set the color of the crosshairs.
|
||||
*
|
||||
* @param {Clutter.Color} clutterColor The color
|
||||
* @param {Cogl.Color} color The color
|
||||
*/
|
||||
setColor(clutterColor) {
|
||||
this._horizLeftHair.background_color = clutterColor;
|
||||
this._horizRightHair.background_color = clutterColor;
|
||||
this._vertTopHair.background_color = clutterColor;
|
||||
this._vertBottomHair.background_color = clutterColor;
|
||||
setColor(color) {
|
||||
this._horizLeftHair.background_color = color;
|
||||
this._horizRightHair.background_color = color;
|
||||
this._vertTopHair.background_color = color;
|
||||
this._vertBottomHair.background_color = color;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2131,7 +2132,7 @@ class MagShaderEffects {
|
||||
|
||||
// Enable the effect if the contrast OR brightness change are such that
|
||||
// it modifies the brightness and/or contrast.
|
||||
// should be able to use Clutter.color_equal(), but that complains of
|
||||
// should be able to use Cogl.Color.equal(), but that complains of
|
||||
// a null first argument.
|
||||
let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
|
||||
this._brightnessContrast.set_enabled(
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
@ -818,7 +819,7 @@ export const QuickSettingsMenu = class extends PopupMenu.PopupMenu {
|
||||
|
||||
_setDimmed(dim) {
|
||||
const val = 127 * (1 + (dim ? 1 : 0) * DIM_BRIGHTNESS);
|
||||
const color = new Clutter.Color({
|
||||
const color = new Cogl.Color({
|
||||
red: val,
|
||||
green: val,
|
||||
blue: val,
|
||||
|
@ -2877,11 +2877,11 @@ const RecolorEffect = GObject.registerClass({
|
||||
color: GObject.ParamSpec.boxed(
|
||||
'color', 'color', 'replacement color',
|
||||
GObject.ParamFlags.WRITABLE,
|
||||
Clutter.Color.$gtype),
|
||||
Cogl.Color.$gtype),
|
||||
chroma: GObject.ParamSpec.boxed(
|
||||
'chroma', 'chroma', 'color to replace',
|
||||
GObject.ParamFlags.WRITABLE,
|
||||
Clutter.Color.$gtype),
|
||||
Cogl.Color.$gtype),
|
||||
threshold: GObject.ParamSpec.float(
|
||||
'threshold', 'threshold', 'threshold',
|
||||
GObject.ParamFlags.WRITABLE,
|
||||
@ -2893,8 +2893,8 @@ const RecolorEffect = GObject.registerClass({
|
||||
},
|
||||
}, class RecolorEffect extends Shell.GLSLEffect {
|
||||
_init(params) {
|
||||
this._color = new Clutter.Color();
|
||||
this._chroma = new Clutter.Color();
|
||||
this._color = new Cogl.Color();
|
||||
this._chroma = new Cogl.Color();
|
||||
this._threshold = 0;
|
||||
this._smoothing = 0;
|
||||
|
||||
@ -3031,7 +3031,7 @@ class PickPixel extends St.Widget {
|
||||
this.add_action(action);
|
||||
|
||||
this._recolorEffect = new RecolorEffect({
|
||||
chroma: new Clutter.Color({
|
||||
chroma: new Cogl.Color({
|
||||
red: 80,
|
||||
green: 219,
|
||||
blue: 181,
|
||||
|
@ -1,6 +1,7 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
@ -149,7 +150,7 @@ class WindowDimmer extends Clutter.BrightnessContrastEffect {
|
||||
|
||||
setDimmed(dimmed, animate) {
|
||||
let val = 127 * (1 + (dimmed ? 1 : 0) * DIM_BRIGHTNESS);
|
||||
const color = new Clutter.Color({
|
||||
const color = new Cogl.Color({
|
||||
red: val,
|
||||
green: val,
|
||||
blue: val,
|
||||
|
@ -1120,7 +1120,7 @@ shell_screenshot_screenshot_window_finish (ShellScreenshot *screenshot,
|
||||
* @callback: (scope async): function to call returning success or failure
|
||||
* of the async grabbing
|
||||
*
|
||||
* Picks the pixel at @x, @y and returns its color as #ClutterColor.
|
||||
* Picks the pixel at @x, @y and returns its color as #CoglColor.
|
||||
*
|
||||
*/
|
||||
void
|
||||
@ -1183,7 +1183,7 @@ shell_screenshot_pick_color (ShellScreenshot *screenshot,
|
||||
gboolean
|
||||
shell_screenshot_pick_color_finish (ShellScreenshot *screenshot,
|
||||
GAsyncResult *result,
|
||||
ClutterColor *color,
|
||||
CoglColor *color,
|
||||
GError **error)
|
||||
{
|
||||
ShellScreenshotPrivate *priv;
|
||||
|
@ -70,7 +70,7 @@ void shell_screenshot_pick_color (ShellScreenshot *screenshot,
|
||||
gpointer user_data);
|
||||
gboolean shell_screenshot_pick_color_finish (ShellScreenshot *screenshot,
|
||||
GAsyncResult *result,
|
||||
ClutterColor *color,
|
||||
CoglColor *color,
|
||||
GError **error);
|
||||
|
||||
void shell_screenshot_composite_to_stream (CoglTexture *texture,
|
||||
|
@ -23,7 +23,7 @@ struct _ShellTrayManager
|
||||
|
||||
struct _ShellTrayManagerPrivate {
|
||||
NaTrayManager *na_manager;
|
||||
ClutterColor bg_color;
|
||||
CoglColor bg_color;
|
||||
|
||||
GHashTable *icons;
|
||||
StWidget *theme_widget;
|
||||
@ -53,7 +53,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (ShellTrayManager, shell_tray_manager, G_TYPE_OBJECT)
|
||||
|
||||
static guint shell_tray_manager_signals [LAST_SIGNAL] = { 0 };
|
||||
|
||||
static const ClutterColor default_color = { 0x00, 0x00, 0x00, 0xff };
|
||||
static const CoglColor default_color = { 0x00, 0x00, 0x00, 0xff };
|
||||
|
||||
static void shell_tray_manager_release_resources (ShellTrayManager *manager);
|
||||
|
||||
@ -91,7 +91,7 @@ shell_tray_manager_set_property(GObject *object,
|
||||
{
|
||||
case PROP_BG_COLOR:
|
||||
{
|
||||
ClutterColor *color = g_value_get_boxed (value);
|
||||
CoglColor *color = g_value_get_boxed (value);
|
||||
if (color)
|
||||
manager->priv->bg_color = *color;
|
||||
else
|
||||
@ -176,7 +176,7 @@ shell_tray_manager_class_init (ShellTrayManagerClass *klass)
|
||||
g_param_spec_boxed ("bg-color",
|
||||
"BG Color",
|
||||
"Background color (only if we don't have transparency)",
|
||||
CLUTTER_TYPE_COLOR,
|
||||
COGL_TYPE_COLOR,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ st_entry_style_changed (StWidget *self)
|
||||
StEntryPrivate *priv = ST_ENTRY_PRIV (self);
|
||||
StThemeNode *theme_node;
|
||||
StShadow *shadow_spec;
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
gdouble size;
|
||||
|
||||
theme_node = st_widget_get_theme_node (self);
|
||||
|
@ -112,10 +112,10 @@ st_icon_colors_equal (StIconColors *colors,
|
||||
if (colors == NULL || other == NULL)
|
||||
return FALSE;
|
||||
|
||||
return clutter_color_equal (&colors->foreground, &other->foreground) &&
|
||||
clutter_color_equal (&colors->warning, &other->warning) &&
|
||||
clutter_color_equal (&colors->error, &other->error) &&
|
||||
clutter_color_equal (&colors->success, &other->success);
|
||||
return cogl_color_equal (&colors->foreground, &other->foreground) &&
|
||||
cogl_color_equal (&colors->warning, &other->warning) &&
|
||||
cogl_color_equal (&colors->error, &other->error) &&
|
||||
cogl_color_equal (&colors->success, &other->success);
|
||||
}
|
||||
|
||||
G_DEFINE_BOXED_TYPE (StIconColors,
|
||||
|
@ -21,10 +21,10 @@ typedef struct _StIconColors StIconColors;
|
||||
* icon.
|
||||
*/
|
||||
struct _StIconColors {
|
||||
ClutterColor foreground;
|
||||
ClutterColor warning;
|
||||
ClutterColor error;
|
||||
ClutterColor success;
|
||||
CoglColor foreground;
|
||||
CoglColor warning;
|
||||
CoglColor error;
|
||||
CoglColor success;
|
||||
};
|
||||
|
||||
GType st_icon_colors_get_type (void) G_GNUC_CONST;
|
||||
|
@ -3638,7 +3638,7 @@ symbolic_cache_get_proxy (SymbolicPixbufCache *symbolic_cache,
|
||||
}
|
||||
|
||||
static char *
|
||||
color_to_string_noalpha (const ClutterColor *color)
|
||||
color_to_string_noalpha (const CoglColor *color)
|
||||
{
|
||||
return g_strdup_printf ("rgb(%d,%d,%d)",
|
||||
color->red,
|
||||
@ -3647,7 +3647,7 @@ color_to_string_noalpha (const ClutterColor *color)
|
||||
}
|
||||
|
||||
static void
|
||||
color_to_pixel(const ClutterColor *color,
|
||||
color_to_pixel(const CoglColor *color,
|
||||
uint8_t pixel[4])
|
||||
{
|
||||
pixel[0] = color->red;
|
||||
|
@ -111,7 +111,7 @@ _st_set_text_from_style (ClutterText *text,
|
||||
StThemeNode *theme_node)
|
||||
{
|
||||
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
StTextDecoration decoration;
|
||||
PangoAttrList *attribs = NULL;
|
||||
const PangoFontDescription *font;
|
||||
|
@ -50,7 +50,7 @@ G_DEFINE_BOXED_TYPE (StShadowHelper, st_shadow_helper, st_shadow_helper_copy, st
|
||||
* Returns: the newly allocated shadow. Use st_shadow_free() when done
|
||||
*/
|
||||
StShadow *
|
||||
st_shadow_new (ClutterColor *color,
|
||||
st_shadow_new (CoglColor *color,
|
||||
gdouble xoffset,
|
||||
gdouble yoffset,
|
||||
gdouble blur,
|
||||
@ -130,7 +130,7 @@ st_shadow_equal (StShadow *shadow,
|
||||
* that a few false negatives are mostly harmless.
|
||||
*/
|
||||
|
||||
return (clutter_color_equal (&shadow->color, &other->color) &&
|
||||
return (cogl_color_equal (&shadow->color, &other->color) &&
|
||||
shadow->xoffset == other->xoffset &&
|
||||
shadow->yoffset == other->yoffset &&
|
||||
shadow->blur == other->blur &&
|
||||
|
@ -45,7 +45,7 @@ typedef struct _StShadowHelper StShadowHelper;
|
||||
* Attributes of the -st-shadow property.
|
||||
*/
|
||||
struct _StShadow {
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
gdouble xoffset;
|
||||
gdouble yoffset;
|
||||
gdouble blur;
|
||||
@ -55,7 +55,7 @@ struct _StShadow {
|
||||
|
||||
GType st_shadow_get_type (void) G_GNUC_CONST;
|
||||
|
||||
StShadow *st_shadow_new (ClutterColor *color,
|
||||
StShadow *st_shadow_new (CoglColor *color,
|
||||
gdouble xoffset,
|
||||
gdouble yoffset,
|
||||
gdouble blur,
|
||||
|
@ -42,9 +42,9 @@
|
||||
****/
|
||||
|
||||
typedef struct {
|
||||
ClutterColor color;
|
||||
ClutterColor border_color_1;
|
||||
ClutterColor border_color_2;
|
||||
CoglColor color;
|
||||
CoglColor border_color_1;
|
||||
CoglColor border_color_2;
|
||||
guint radius;
|
||||
guint border_width_1;
|
||||
guint border_width_2;
|
||||
@ -228,7 +228,7 @@ load_corner (StTextureCache *cache,
|
||||
#define MULT(c,a) NORM(c*a)
|
||||
|
||||
static void
|
||||
premultiply (ClutterColor *color)
|
||||
premultiply (CoglColor *color)
|
||||
{
|
||||
guint t;
|
||||
color->red = MULT (color->red, color->alpha);
|
||||
@ -237,7 +237,7 @@ premultiply (ClutterColor *color)
|
||||
}
|
||||
|
||||
static void
|
||||
unpremultiply (ClutterColor *color)
|
||||
unpremultiply (CoglColor *color)
|
||||
{
|
||||
if (color->alpha != 0)
|
||||
{
|
||||
@ -248,13 +248,13 @@ unpremultiply (ClutterColor *color)
|
||||
}
|
||||
|
||||
static void
|
||||
over (const ClutterColor *source,
|
||||
const ClutterColor *destination,
|
||||
ClutterColor *result)
|
||||
over (const CoglColor *source,
|
||||
const CoglColor *destination,
|
||||
CoglColor *result)
|
||||
{
|
||||
guint t;
|
||||
ClutterColor src = *source;
|
||||
ClutterColor dst = *destination;
|
||||
CoglColor src = *source;
|
||||
CoglColor dst = *destination;
|
||||
|
||||
premultiply (&src);
|
||||
premultiply (&dst);
|
||||
@ -418,7 +418,7 @@ st_theme_node_lookup_corner (StThemeNode *node,
|
||||
if (node->box_shadow == NULL)
|
||||
return NULL;
|
||||
else /* We still need a corner texture to render the box-shadow */
|
||||
corner.color = (ClutterColor) {0, 0, 0, 255};
|
||||
corner.color = (CoglColor) {0, 0, 0, 255};
|
||||
}
|
||||
|
||||
key = corner_to_string (&corner);
|
||||
@ -569,7 +569,7 @@ get_background_position (StThemeNode *self,
|
||||
*/
|
||||
static void
|
||||
get_arbitrary_border_color (StThemeNode *node,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
if (color)
|
||||
st_theme_node_get_border_color (node, ST_SIDE_TOP, color);
|
||||
@ -1031,7 +1031,7 @@ st_theme_node_prerender_background (StThemeNode *node,
|
||||
gboolean interior_dirty;
|
||||
gboolean draw_background_image_shadow = FALSE;
|
||||
gboolean has_visible_outline;
|
||||
ClutterColor border_color;
|
||||
CoglColor border_color;
|
||||
guint border_width[4];
|
||||
guint rowstride;
|
||||
guchar *data;
|
||||
@ -1722,7 +1722,7 @@ st_theme_node_paint_borders (StThemeNodePaintState *state,
|
||||
guint max_border_radius = 0;
|
||||
guint max_width_radius[4];
|
||||
int corner_id, side_id;
|
||||
ClutterColor border_color;
|
||||
CoglColor border_color;
|
||||
guint8 alpha;
|
||||
gboolean corners_are_transparent;
|
||||
CoglColor pipeline_color;
|
||||
@ -1757,7 +1757,7 @@ st_theme_node_paint_borders (StThemeNodePaintState *state,
|
||||
border_width[ST_SIDE_BOTTOM] > 0 ||
|
||||
border_width[ST_SIDE_LEFT] > 0)
|
||||
{
|
||||
ClutterColor effective_border;
|
||||
CoglColor effective_border;
|
||||
gboolean skip_corner_1, skip_corner_2;
|
||||
float rects[16];
|
||||
|
||||
@ -2028,8 +2028,8 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
|
||||
gfloat shadow_blur_radius, x_spread_factor, y_spread_factor;
|
||||
float rectangles[8 * 9];
|
||||
gint idx;
|
||||
ClutterColor background_color;
|
||||
static const ClutterColor invisible_occluded = {3, 2, 1, 0};
|
||||
CoglColor background_color;
|
||||
static const CoglColor invisible_occluded = {3, 2, 1, 0};
|
||||
|
||||
if (paint_opacity == 0)
|
||||
return;
|
||||
@ -2189,7 +2189,7 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
|
||||
|
||||
/* Center middle is not definitely occluded? */
|
||||
st_theme_node_get_background_color (node, &background_color);
|
||||
if (!clutter_color_equal (&background_color, &invisible_occluded) ||
|
||||
if (!cogl_color_equal (&background_color, &invisible_occluded) ||
|
||||
paint_opacity < 255 ||
|
||||
xoffset > shadow_blur_radius || left < 0 ||
|
||||
yoffset > shadow_blur_radius || top < 0)
|
||||
@ -2493,8 +2493,7 @@ st_theme_node_paint_outline (StThemeNode *node,
|
||||
float width, height;
|
||||
int outline_width;
|
||||
float rects[16];
|
||||
ClutterColor outline_color, effective_outline;
|
||||
CoglColor pipeline_color;
|
||||
CoglColor outline_color, effective_outline, pipeline_color;
|
||||
guint8 alpha;
|
||||
|
||||
width = box->x2 - box->x1;
|
||||
|
@ -37,10 +37,10 @@ struct _StThemeNode {
|
||||
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
ClutterColor background_color;
|
||||
CoglColor background_color;
|
||||
/* If gradient is set, then background_color is the gradient start */
|
||||
StGradientType background_gradient_type;
|
||||
ClutterColor background_gradient_end;
|
||||
CoglColor background_gradient_end;
|
||||
|
||||
int background_position_x;
|
||||
int background_position_y;
|
||||
@ -49,9 +49,9 @@ struct _StThemeNode {
|
||||
gint background_size_w;
|
||||
gint background_size_h;
|
||||
|
||||
ClutterColor foreground_color;
|
||||
ClutterColor border_color[4];
|
||||
ClutterColor outline_color;
|
||||
CoglColor foreground_color;
|
||||
CoglColor border_color[4];
|
||||
CoglColor outline_color;
|
||||
|
||||
int border_width[4];
|
||||
int border_radius[4];
|
||||
|
@ -34,11 +34,11 @@
|
||||
static void st_theme_node_dispose (GObject *object);
|
||||
static void st_theme_node_finalize (GObject *object);
|
||||
|
||||
static const ClutterColor BLACK_COLOR = { 0, 0, 0, 0xff };
|
||||
static const ClutterColor TRANSPARENT_COLOR = { 0, 0, 0, 0 };
|
||||
static const ClutterColor DEFAULT_SUCCESS_COLOR = { 0x4e, 0x9a, 0x06, 0xff };
|
||||
static const ClutterColor DEFAULT_WARNING_COLOR = { 0xf5, 0x79, 0x3e, 0xff };
|
||||
static const ClutterColor DEFAULT_ERROR_COLOR = { 0xcc, 0x00, 0x00, 0xff };
|
||||
static const CoglColor BLACK_COLOR = { 0, 0, 0, 0xff };
|
||||
static const CoglColor TRANSPARENT_COLOR = { 0, 0, 0, 0 };
|
||||
static const CoglColor DEFAULT_SUCCESS_COLOR = { 0x4e, 0x9a, 0x06, 0xff };
|
||||
static const CoglColor DEFAULT_WARNING_COLOR = { 0xf5, 0x79, 0x3e, 0xff };
|
||||
static const CoglColor DEFAULT_ERROR_COLOR = { 0xcc, 0x00, 0x00, 0xff };
|
||||
|
||||
G_DEFINE_TYPE (StThemeNode, st_theme_node, G_TYPE_OBJECT)
|
||||
|
||||
@ -518,7 +518,7 @@ color_component_from_double (double component)
|
||||
|
||||
static GetFromTermResult
|
||||
get_color_from_rgba_term (CRTerm *term,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
CRTerm *arg = term->ext_content.func_param;
|
||||
CRNum *num;
|
||||
@ -598,7 +598,7 @@ get_color_from_rgba_term (CRTerm *term,
|
||||
static GetFromTermResult
|
||||
get_color_from_term (StThemeNode *node,
|
||||
CRTerm *term,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
CRRgb rgb;
|
||||
enum CRStatus status;
|
||||
@ -670,7 +670,7 @@ gboolean
|
||||
st_theme_node_lookup_color (StThemeNode *node,
|
||||
const char *property_name,
|
||||
gboolean inherit,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
|
||||
int i;
|
||||
@ -729,12 +729,12 @@ st_theme_node_lookup_color (StThemeNode *node,
|
||||
void
|
||||
st_theme_node_get_color (StThemeNode *node,
|
||||
const char *property_name,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
if (!st_theme_node_lookup_color (node, property_name, FALSE, color))
|
||||
{
|
||||
g_warning ("Did not find color property '%s'", property_name);
|
||||
memset (color, 0, sizeof (ClutterColor));
|
||||
memset (color, 0, sizeof (CoglColor));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1353,7 +1353,7 @@ do_border_property (StThemeNode *node,
|
||||
{
|
||||
const char *property_name = decl->property->stryng->str + 6; /* Skip 'border' */
|
||||
StSide side = (StSide)-1;
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
gboolean color_set = FALSE;
|
||||
int width = 0; /* suppress warning */
|
||||
gboolean width_set = FALSE;
|
||||
@ -1486,7 +1486,7 @@ do_outline_property (StThemeNode *node,
|
||||
CRDeclaration *decl)
|
||||
{
|
||||
const char *property_name = decl->property->stryng->str + 7; /* Skip 'outline' */
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
gboolean color_set = FALSE;
|
||||
int width = 0; /* suppress warning */
|
||||
gboolean width_set = FALSE;
|
||||
@ -1921,7 +1921,7 @@ st_theme_node_get_outline_width (StThemeNode *node)
|
||||
*/
|
||||
void
|
||||
st_theme_node_get_outline_color (StThemeNode *node,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
g_return_if_fail (ST_IS_THEME_NODE (node));
|
||||
|
||||
@ -2270,7 +2270,7 @@ _st_theme_node_ensure_background (StThemeNode *node)
|
||||
*/
|
||||
void
|
||||
st_theme_node_get_background_color (StThemeNode *node,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
g_return_if_fail (ST_IS_THEME_NODE (node));
|
||||
|
||||
@ -2304,7 +2304,7 @@ st_theme_node_get_background_image (StThemeNode *node)
|
||||
*/
|
||||
void
|
||||
st_theme_node_get_foreground_color (StThemeNode *node,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
g_return_if_fail (ST_IS_THEME_NODE (node));
|
||||
|
||||
@ -2353,8 +2353,8 @@ st_theme_node_get_foreground_color (StThemeNode *node,
|
||||
void
|
||||
st_theme_node_get_background_gradient (StThemeNode *node,
|
||||
StGradientType *type,
|
||||
ClutterColor *start,
|
||||
ClutterColor *end)
|
||||
CoglColor *start,
|
||||
CoglColor *end)
|
||||
{
|
||||
g_return_if_fail (ST_IS_THEME_NODE (node));
|
||||
|
||||
@ -2379,7 +2379,7 @@ st_theme_node_get_background_gradient (StThemeNode *node,
|
||||
void
|
||||
st_theme_node_get_border_color (StThemeNode *node,
|
||||
StSide side,
|
||||
ClutterColor *color)
|
||||
CoglColor *color)
|
||||
{
|
||||
g_return_if_fail (ST_IS_THEME_NODE (node));
|
||||
g_return_if_fail (side >= ST_SIDE_TOP && side <= ST_SIDE_LEFT);
|
||||
@ -3382,7 +3382,7 @@ _st_theme_node_apply_margins (StThemeNode *node,
|
||||
static GetFromTermResult
|
||||
parse_shadow_property (StThemeNode *node,
|
||||
CRDeclaration *decl,
|
||||
ClutterColor *color,
|
||||
CoglColor *color,
|
||||
gdouble *xoffset,
|
||||
gdouble *yoffset,
|
||||
gdouble *blur,
|
||||
@ -3526,7 +3526,7 @@ st_theme_node_lookup_shadow (StThemeNode *node,
|
||||
gboolean inherit,
|
||||
StShadow **shadow)
|
||||
{
|
||||
ClutterColor color = { 0., };
|
||||
CoglColor color = { 0., };
|
||||
gdouble xoffset = 0.;
|
||||
gdouble yoffset = 0.;
|
||||
gdouble blur = 0.;
|
||||
@ -3769,7 +3769,7 @@ st_theme_node_get_icon_colors (StThemeNode *node)
|
||||
|
||||
gboolean shared_with_parent;
|
||||
int i;
|
||||
ClutterColor color = { 0, };
|
||||
CoglColor color = { 0, };
|
||||
|
||||
guint still_need = FOREGROUND | WARNING | ERROR | SUCCESS;
|
||||
|
||||
@ -4220,14 +4220,14 @@ st_theme_node_paint_equal (StThemeNode *node,
|
||||
_st_theme_node_ensure_background (node);
|
||||
_st_theme_node_ensure_background (other);
|
||||
|
||||
if (!clutter_color_equal (&node->background_color, &other->background_color))
|
||||
if (!cogl_color_equal (&node->background_color, &other->background_color))
|
||||
return FALSE;
|
||||
|
||||
if (node->background_gradient_type != other->background_gradient_type)
|
||||
return FALSE;
|
||||
|
||||
if (node->background_gradient_type != ST_GRADIENT_NONE &&
|
||||
!clutter_color_equal (&node->background_gradient_end, &other->background_gradient_end))
|
||||
!cogl_color_equal (&node->background_gradient_end, &other->background_gradient_end))
|
||||
return FALSE;
|
||||
|
||||
if ((node->background_image != NULL) &&
|
||||
@ -4244,7 +4244,7 @@ st_theme_node_paint_equal (StThemeNode *node,
|
||||
return FALSE;
|
||||
|
||||
if (node->border_width[i] > 0 &&
|
||||
!clutter_color_equal (&node->border_color[i], &other->border_color[i]))
|
||||
!cogl_color_equal (&node->border_color[i], &other->border_color[i]))
|
||||
return FALSE;
|
||||
|
||||
if (node->border_radius[i] != other->border_radius[i])
|
||||
@ -4255,7 +4255,7 @@ st_theme_node_paint_equal (StThemeNode *node,
|
||||
return FALSE;
|
||||
|
||||
if (node->outline_width > 0 &&
|
||||
!clutter_color_equal (&node->outline_color, &other->outline_color))
|
||||
!cogl_color_equal (&node->outline_color, &other->outline_color))
|
||||
return FALSE;
|
||||
|
||||
border_image = st_theme_node_get_border_image (node);
|
||||
|
@ -204,7 +204,7 @@ GStrv st_theme_node_get_pseudo_classes (StThemeNode *node);
|
||||
gboolean st_theme_node_lookup_color (StThemeNode *node,
|
||||
const char *property_name,
|
||||
gboolean inherit,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
gboolean st_theme_node_lookup_double (StThemeNode *node,
|
||||
const char *property_name,
|
||||
gboolean inherit,
|
||||
@ -229,7 +229,7 @@ gboolean st_theme_node_lookup_url (StThemeNode *node,
|
||||
/* Easier-to-use variants of the above, for application-level use */
|
||||
void st_theme_node_get_color (StThemeNode *node,
|
||||
const char *property_name,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
gdouble st_theme_node_get_double (StThemeNode *node,
|
||||
const char *property_name);
|
||||
gdouble st_theme_node_get_length (StThemeNode *node,
|
||||
@ -242,13 +242,13 @@ GFile *st_theme_node_get_url (StThemeNode *node,
|
||||
/* Specific getters for particular properties: cached
|
||||
*/
|
||||
void st_theme_node_get_background_color (StThemeNode *node,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
void st_theme_node_get_foreground_color (StThemeNode *node,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
void st_theme_node_get_background_gradient (StThemeNode *node,
|
||||
StGradientType *type,
|
||||
ClutterColor *start,
|
||||
ClutterColor *end);
|
||||
CoglColor *start,
|
||||
CoglColor *end);
|
||||
|
||||
GFile *st_theme_node_get_background_image (StThemeNode *node);
|
||||
|
||||
@ -258,11 +258,11 @@ int st_theme_node_get_border_radius (StThemeNode *node,
|
||||
StCorner corner);
|
||||
void st_theme_node_get_border_color (StThemeNode *node,
|
||||
StSide side,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
|
||||
int st_theme_node_get_outline_width (StThemeNode *node);
|
||||
void st_theme_node_get_outline_color (StThemeNode *node,
|
||||
ClutterColor *color);
|
||||
CoglColor *color);
|
||||
|
||||
double st_theme_node_get_padding (StThemeNode *node,
|
||||
StSide side);
|
||||
|
@ -127,11 +127,11 @@ assert_foreground_color (StThemeNode *node,
|
||||
const char *node_description,
|
||||
const char *expected)
|
||||
{
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
g_autofree char* value;
|
||||
|
||||
st_theme_node_get_foreground_color (node, &color);
|
||||
value = clutter_color_to_string (&color);
|
||||
value = cogl_color_to_string (&color);
|
||||
|
||||
if (g_strcmp0 (expected, value) != 0)
|
||||
{
|
||||
@ -146,11 +146,11 @@ assert_background_color (StThemeNode *node,
|
||||
const char *node_description,
|
||||
const char *expected)
|
||||
{
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
g_autofree char* value;
|
||||
|
||||
st_theme_node_get_background_color (node, &color);
|
||||
value = clutter_color_to_string (&color);
|
||||
value = cogl_color_to_string (&color);
|
||||
|
||||
if (g_strcmp0 (expected, value) != 0)
|
||||
{
|
||||
@ -184,11 +184,11 @@ assert_border_color (StThemeNode *node,
|
||||
StSide side,
|
||||
const char *expected)
|
||||
{
|
||||
ClutterColor color;
|
||||
CoglColor color;
|
||||
g_autofree char* value;
|
||||
|
||||
st_theme_node_get_border_color (node, side, &color);
|
||||
value = clutter_color_to_string (&color);
|
||||
value = cogl_color_to_string (&color);
|
||||
|
||||
if (g_strcmp0 (expected, value) != 0)
|
||||
{
|
||||
|
@ -71,10 +71,10 @@ struct _NaTrayManager
|
||||
Atom message_data_atom;
|
||||
|
||||
Window window;
|
||||
ClutterColor fg;
|
||||
ClutterColor error;
|
||||
ClutterColor warning;
|
||||
ClutterColor success;
|
||||
CoglColor fg;
|
||||
CoglColor error;
|
||||
CoglColor warning;
|
||||
CoglColor success;
|
||||
|
||||
unsigned int event_func_id;
|
||||
|
||||
@ -670,17 +670,17 @@ na_tray_manager_manage (NaTrayManager *manager)
|
||||
|
||||
void
|
||||
na_tray_manager_set_colors (NaTrayManager *manager,
|
||||
ClutterColor *fg,
|
||||
ClutterColor *error,
|
||||
ClutterColor *warning,
|
||||
ClutterColor *success)
|
||||
CoglColor *fg,
|
||||
CoglColor *error,
|
||||
CoglColor *warning,
|
||||
CoglColor *success)
|
||||
{
|
||||
g_return_if_fail (NA_IS_TRAY_MANAGER (manager));
|
||||
|
||||
if (!clutter_color_equal (&manager->fg, fg) ||
|
||||
!clutter_color_equal (&manager->error, error) ||
|
||||
!clutter_color_equal (&manager->warning, warning) ||
|
||||
!clutter_color_equal (&manager->success, success))
|
||||
if (!cogl_color_equal (&manager->fg, fg) ||
|
||||
!cogl_color_equal (&manager->error, error) ||
|
||||
!cogl_color_equal (&manager->warning, warning) ||
|
||||
!cogl_color_equal (&manager->success, success))
|
||||
{
|
||||
manager->fg = *fg;
|
||||
manager->error = *error;
|
||||
|
@ -36,10 +36,10 @@ NaTrayManager *na_tray_manager_new (MetaX11Display *x11_display);
|
||||
gboolean na_tray_manager_manage (NaTrayManager *manager);
|
||||
|
||||
void na_tray_manager_set_colors (NaTrayManager *manager,
|
||||
ClutterColor *fg,
|
||||
ClutterColor *error,
|
||||
ClutterColor *warning,
|
||||
ClutterColor *success);
|
||||
CoglColor *fg,
|
||||
CoglColor *error,
|
||||
CoglColor *warning,
|
||||
CoglColor *success);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -842,7 +842,7 @@ get_pixel_details (unsigned long pixel_mask,
|
||||
|
||||
void
|
||||
na_xembed_set_background_color (NaXembed *xembed,
|
||||
const ClutterColor *color)
|
||||
const CoglColor *color)
|
||||
{
|
||||
NaXembedPrivate *priv = na_xembed_get_instance_private (xembed);
|
||||
XVisualInfo *xvisual_info;
|
||||
|
@ -60,7 +60,7 @@ void na_xembed_get_size (NaXembed *xembed,
|
||||
int *height);
|
||||
|
||||
void na_xembed_set_background_color (NaXembed *xembed,
|
||||
const ClutterColor *color);
|
||||
const CoglColor *color);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user