2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#include <glitz-glx.h>
28
#include <cairo-glitz.h>
31
#include "cairo-dock-icons.h"
32
#include "cairo-dock-draw.h"
33
#include "cairo-dock-load.h"
34
#include "cairo-dock-surface-factory.h"
35
#include "cairo-dock-log.h"
36
#include "cairo-dock-internal-icons.h"
37
#include "cairo-dock-dock-factory.h"
38
#include "cairo-dock-separator-factory.h"
39
#include "cairo-dock-icon-loader.h"
40
#include "cairo-dock-separator-manager.h"
43
cairo_surface_t *cairo_dock_create_separator_surface (int iWidth, int iHeight)
45
cairo_surface_t *pNewSurface = NULL;
46
if (myIcons.cSeparatorImage == NULL)
48
pNewSurface = cairo_dock_create_blank_surface (
54
gchar *cImagePath = cairo_dock_generate_file_path (myIcons.cSeparatorImage);
56
pNewSurface = cairo_dock_create_surface_from_image_simple (cImagePath,
67
static void _load_separator (Icon *icon)
69
int iWidth = icon->iImageWidth;
70
int iHeight = icon->iImageHeight;
72
icon->pIconBuffer = cairo_dock_create_separator_surface (
77
Icon *cairo_dock_create_separator_icon (int iSeparatorType, CairoDock *pDock)
79
//g_print ("%s ()\n", __func__);
80
if ((iSeparatorType & 1) && ! myIcons.iSeparateIcons)
83
//\____________ On cree l'icone.
84
Icon *icon = cairo_dock_new_separator_icon (iSeparatorType);
85
icon->iface.load_image = _load_separator;
87
//\____________ On remplit ses buffers.
89
cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock));
95
void cairo_dock_insert_automatic_separator_in_dock (int iSeparatorType, const gchar *cParentDockName, CairoDock *pDock)
97
Icon *pSeparatorIcon = cairo_dock_create_separator_icon (iSeparatorType, pDock);
98
if (pSeparatorIcon != NULL)
100
pSeparatorIcon->cParentDockName = g_strdup (cParentDockName);
101
pDock->icons = g_list_insert_sorted (pDock->icons,
103
(GCompareFunc) cairo_dock_compare_icons_order);
104
pSeparatorIcon->fWidth *= pDock->container.fRatio;
105
pSeparatorIcon->fHeight *= pDock->container.fRatio;
106
pDock->fFlatDockWidth += myIcons.iIconGap + pSeparatorIcon->fWidth;
107
///pDock->iMaxIconHeight = MAX (pDock->iMaxIconHeight, pSeparatorIcon->fHeight);