~ubuntu-branches/ubuntu/oneiric/codelite/oneiric

« back to all changes in this revision

Viewing changes to Plugin/drawingutils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-07-29 19:42:47 UTC
  • mfrom: (0.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100729194247-hqgxamd2yl8f1l7x
* New upstream release.
* Bump Standards.
* Refresh patches.
* Add license information about files under ./Debugger/

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
//////////////////////////////////////////////////
35
35
// Colour methods to convert HSL <-> RGB
36
36
//////////////////////////////////////////////////
37
 
static float __min(float x, float y, float z)
 
37
static float cl_min(float x, float y, float z)
38
38
{
39
39
        float m = x < y ? x : y;
40
40
        m = m < z ? m : z;
41
41
        return m;
42
42
}
43
43
 
44
 
static float __max(float x, float y, float z)
 
44
static float cl_max(float x, float y, float z)
45
45
{
46
46
        float m = x > y ? x : y;
47
47
        m = m > z ? m : z;
54
54
        float var_G = ( g / 255.0 );
55
55
        float var_B = ( b / 255.0 );
56
56
 
57
 
        float var_Min = __min( var_R, var_G, var_B );    //Min. value of RGB
58
 
        float var_Max = __max( var_R, var_G, var_B );    //Max. value of RGB
 
57
        float var_Min = cl_min( var_R, var_G, var_B );    //Min. value of RGB
 
58
        float var_Max = cl_max( var_R, var_G, var_B );    //Max. value of RGB
59
59
        float del_Max = var_Max - var_Min;             //Delta RGB value
60
60
 
61
61
        *l = ( var_Max + var_Min ) / 2.0;
345
345
#ifdef __WXGTK__
346
346
        static bool     intitialized(false);
347
347
        static wxColour bgColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
348
 
        
 
348
 
349
349
        if( !intitialized ) {
350
350
                // try to get the background colour from a menu
351
351
                GtkWidget *menu = gtk_window_new(GTK_WINDOW_TOPLEVEL);
352
352
                GtkStyle   *def = gtk_rc_get_style( menu );
353
353
                if(!def)
354
354
                        def = gtk_widget_get_default_style();
355
 
                
 
355
 
356
356
                if(def) {
357
357
                        GdkColor col = def->bg[GTK_STATE_NORMAL];
358
358
                        bgColour = wxColour(col);
371
371
#ifdef __WXGTK__
372
372
        static bool     intitialized(false);
373
373
        static wxColour textColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
374
 
        
 
374
 
375
375
        if( !intitialized ) {
376
376
                // try to get the background colour from a menu
377
377
                GtkWidget *textCtrl = gtk_text_view_new();
378
378
                GtkStyle   *def = gtk_rc_get_style( textCtrl );
379
379
                if(!def)
380
380
                        def = gtk_widget_get_default_style();
381
 
                
 
381
 
382
382
                if(def) {
383
383
                        GdkColor col = def->text[GTK_STATE_NORMAL];
384
384
                        textColour = wxColour(col);