~ubuntu-desktop/compiz/quantal

« back to all changes in this revision

Viewing changes to compizconfig/mocks/libcompizconfig/compizconfig_ccs_integrated_setting_factory_mock.cpp

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-09-27 14:05:41 UTC
  • mfrom: (3248.2.11)
  • Revision ID: lukasz.zemczak@canonical.com-20120927140541-c1f3gk2no4x2iczw
* New upstream release.
  - FTBFS with -DCOMPIZ_BUILD_TESTING=OFF if libgtest-dev is not installed 
    (LP: #1057421)
  - [performance] glXSwapIntervalEXT called every frame, which is very slow 
    on Nvidia. (LP: #1051286)
  - opacify plugin: opacity isn't reset after switching window (LP: #1050757)
  - cmake fails on python 2.6 as sys.version_info does not contain 
    major_version or minor_version (LP: #1048964)
  - scale mode is not visible if a fullscreen window is unredirected 
    (LP: #1047168)
  - Unredirected fullscreen windows flicker briefly when another window 
    (like a menu) opens above them (LP: #1046664)
  - Week33 - Grid highlight window appears while switching between workspaces
    (LP: #1037142)
  - gtk-window-decorator leaks large numbers of pixmaps and pixmap memory 
    (LP: #1057263)
  - [fglrx] compiz crashed with SIGSEGV in glXDestroyContext() 
    [/usr/lib/fglrx/libGL.so.1] from GLScreen::~GLScreen() (LP: #1054724)
  - Maximized window gets unredirected when it's not fullscreen 
    (LP: #1053902)
  - Double shortcuts conflict with gnome-control-center ones (LP: #1050796)
  - gtk-window-decorator leaking window handles. Window operations become 
    sluggish after a few days of usage (LP: #1050610)
  - [valgrind] Up to 520,000 bytes lost when running 
    CCSGSettingsBackendConceptTest (LP: #1049169)
  - 1:0.9.8+bzr3319-0ubuntu1 regression: keeps setting gsettings keys to 
    wrong values (LP: #1042041)
  - Compiz r3275 breaks VirtualBox Guest Additions: black screen or just 
    wallpaper (LP: #1030891)
  - Incorrect (low/stuttering) refresh rate with NVIDIA driver (LP: #92599)
  - ARM build broken with 'swapInterval' is not a member of 'GL' 
    (LP: #1056645)
  - compiz.fix_927168 broke ARM building (LP: #1052838)
  - compiz crashed with SIGSEGV in __strcasestr_ia32() from 
    ccsStringToModifiers(binding=NULL) (LP: #1041535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Compiz configuration system library
 
3
 *
 
4
 * Copyright (C) 2012 Canonical Ltd.
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2.1 of the License, or (at your option) any later version.
 
10
 
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 *
 
20
 * Authored By:
 
21
 * Sam Spilsbury <sam.spilsbury@canonical.com>
 
22
 */
 
23
#include <gtest/gtest.h>
 
24
#include <gmock/gmock.h>
 
25
 
 
26
#include <ccs.h>
 
27
 
 
28
#include "compizconfig_ccs_integrated_setting_factory_mock.h"
 
29
 
 
30
const CCSIntegratedSettingFactoryInterface mockIntegratedSettingFactoryInterface =
 
31
{
 
32
    CCSIntegratedSettingFactoryGMock::ccsIntegratedSettingFactoryCreateIntegratedSettingForCCSSettingNameAndType,
 
33
    CCSIntegratedSettingFactoryGMock::ccsIntegratedSettingFactoryFree
 
34
};
 
35
 
 
36
CCSIntegratedSettingFactory *
 
37
ccsMockIntegratedSettingFactoryNew (CCSObjectAllocationInterface *ai)
 
38
{
 
39
    CCSIntegratedSettingFactory *integratedSettingFactory =
 
40
            reinterpret_cast <CCSIntegratedSettingFactory *> ((*ai->calloc_) (ai->allocator, 1, sizeof (CCSIntegratedSettingFactory)));
 
41
 
 
42
    if (!integratedSettingFactory)
 
43
        return NULL;
 
44
 
 
45
    CCSIntegratedSettingFactoryGMock *gmockFactory = new CCSIntegratedSettingFactoryGMock (integratedSettingFactory);
 
46
 
 
47
    ccsObjectInit (integratedSettingFactory, ai);
 
48
    ccsObjectSetPrivate (integratedSettingFactory, (CCSPrivate *) gmockFactory);
 
49
    ccsObjectAddInterface (integratedSettingFactory,
 
50
                           reinterpret_cast <const CCSInterface *> (&mockIntegratedSettingFactoryInterface),
 
51
                           GET_INTERFACE_TYPE (CCSIntegratedSettingFactoryInterface));
 
52
 
 
53
    ccsObjectRef (integratedSettingFactory);
 
54
 
 
55
    return integratedSettingFactory;
 
56
}
 
57
 
 
58
void
 
59
ccsMockIntegratedSettingFactoryFree (CCSIntegratedSettingFactory *integratedSettingFactory)
 
60
{
 
61
    CCSIntegratedSettingFactoryGMock *gmockFactory =
 
62
            GET_PRIVATE (CCSIntegratedSettingFactoryGMock, integratedSettingFactory);
 
63
 
 
64
    delete gmockFactory;
 
65
 
 
66
    ccsObjectSetPrivate (integratedSettingFactory, NULL);
 
67
    ccsObjectFinalize (integratedSettingFactory);
 
68
    (*integratedSettingFactory->object.object_allocation->free_)
 
69
            (integratedSettingFactory->object.object_allocation->allocator, integratedSettingFactory);
 
70
}