~danieljabailey/inkscape/arc_node_editor

« back to all changes in this revision

Viewing changes to src/profile-manager.cpp

  • Committer: scislac
  • Date: 2009-08-12 07:57:52 UTC
  • Revision ID: scislac@users.sourceforge.net-20090812075752-3zt99jgeqr3bm16j
much better quality multi-size windows icon, thanks ChrisMorgan

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Inkscape::ProfileManager - a view of a document's color profiles.
3
3
 *
4
4
 * Copyright 2007  Jon A. Cruz  <jon@joncruz.org>
5
 
 *   Abhishek Sharma
6
5
 *
7
6
 * Released under GNU GPL, read the file 'COPYING' for more information
8
7
 */
13
12
#include "document.h"
14
13
#include "color-profile.h"
15
14
 
16
 
#include <cstring>
17
 
 
18
15
namespace Inkscape {
19
16
 
20
17
ProfileManager::ProfileManager(SPDocument *document) :
21
18
    _doc(document),
22
19
    _knownProfiles()
23
20
{
24
 
    _resource_connection = _doc->connectResourcesChanged(  "iccprofile", sigc::mem_fun(*this, &ProfileManager::_resourcesChanged) );
 
21
    _resource_connection = sp_document_resources_changed_connect( _doc, "iccprofile", sigc::mem_fun(*this, &ProfileManager::_resourcesChanged) );
25
22
}
26
23
 
27
24
ProfileManager::~ProfileManager()
28
25
{
29
 
    _resource_connection.disconnect();
30
 
    _doc = 0;
31
26
}
32
27
 
33
28
void ProfileManager::_resourcesChanged()
34
29
{
35
30
    std::vector<SPObject*> newList;
36
31
    if (_doc) {
37
 
        std::set<SPObject *> current = _doc->getResourceList( "iccprofile" );
38
 
        for (std::set<SPObject *>::const_iterator i = current.begin(); i != current.end(); ++i)
39
 
            newList.push_back(*i);
 
32
        const GSList *current = sp_document_get_resource_list( _doc, "iccprofile" );
 
33
        while ( current ) {
 
34
            newList.push_back(SP_OBJECT(current->data));
 
35
            current = g_slist_next(current);
 
36
        }
40
37
    }
41
38
    sort( newList.begin(), newList.end() );
42
39
 
76
73
        for ( unsigned int index = 0; index < howMany; index++ ) {
77
74
            SPObject *obj = nthChildOf(NULL, index);
78
75
            ColorProfile* prof = reinterpret_cast<ColorProfile*>(obj);
79
 
            if (prof && (prof->name && !strcmp(name, prof->name))) {
 
76
            if ( prof && prof->name && !strcmp(name, prof->name) ) {
80
77
                match = prof;
81
78
                break;
82
79
            }
97
94
  fill-column:99
98
95
  End:
99
96
*/
100
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
 
97
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :