~shnatsel/unity/old-school-dash

« back to all changes in this revision

Viewing changes to src/StaticCairoText.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-11 12:42:33 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411124233-aey6czshkijifje0
Tags: 3.8.6-0ubuntu1
* New upstream release.
  - compiz crashed with SIGABRT in raise() (LP: #748163)
  - System freezes when maximize button is clicked (LP: #754063)
  - compiz crashed with SIGSEGV in QuicklistView::IsMenuItemSeperator()
    (LP: #754302)
  - compiz crashed with SIGSEGV in std::_List_node_base::_M_hook()
    (LP: #754235)
  - compiz crashed with SIGSEGV in ubus_server_pump_message_queue()
    (LP: #754657)
  - drag from dash to launcher (LP: #662616)
  - Add a test case for unity-decorator regressions (LP: #736878)
  - the files place category combo has empty space (LP: #741641)
  - panel superposition (LP: #742859)
  - Unity Launcher stops autohiding and is not responsive (LP: #744325)
  - Unity Launcher stops autohiding and is not responsive (LP: #744325)
  - [FFE] Need API to set urgency from background process (LP: #747677)
  - Launcher - Escape from 'drag behind the Launcher' interaction
    (LP: #750298)
  - Launcher needs to be desaturated when Dash is open, not transparent.
    (LP: #750358)
  - compiz crashed with SIGSEGV in free() (LP: #752293)
  - migrate_favorites.py crashed with ImportError in __main__: No module
    named gconf (LP: #752176)
  - compiz crashed with SIGSEGV in PluginClassHandler<DecorWindow,
    CompWindow, 0>::get() (LP: #743807)
  - cannot close the dash by clicking on the bfb (LP: #753914)
  - Animation for Grid Previews is broken (LP: #754088)
  - compiz crashed with SIGSEGV in PanelMenuView::OnPlaceViewShown()
    (LP: #754585)
  - Pressing F10 then "left arrow" wit Unity on Natty makes the system
    unusable (LP: #756867)
  - compiz crashed with SIGSEGV in __pthread_mutex_lock() (LP: #711231)
  - Tooltips and Dash Font Problems (LP: #741605)
  - Title elipisising incorrect.  Type “Shotwell” for a good example
    (LP: #750350)
  - compiz crashed with SIGSEGV in Launcher::Launcher() (LP: #748096)
  - BFB - Turn top left corner blue rather than Ubuntu logo (LP: #755286)
  - launcher appears and gets stuck when resizing windows with mouse
    (LP: #754690)
  - Wrong item gets dragged out (LP: #729796)
  - Launcher - when the launcher is folded, the bottom icon partially falls
    off the end of the screen (LP: #731869)
  - unity-window-decorator: Resize padding: Tiny focused windows lose resize
    padding and shadow when <69 pixels wide (LP: #737707)
  - Deinstalling an application with launcher entry leaves orphaned shortcut
    (LP: #748107)
  - Two Nautilus windows open when clicked on a device icon on Launcher
    (started after 3.8.2) (LP: #748299)
  - compiz crashed with SIGSEGV in Launcher::AnimationTimeout()
    (LP: #749890)
* debian/control:
  - build-dep on latest nux (ABI break)
* debian/unity-common.install:
  - install the desktop file for the new capplet

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
  gfxContext.GetRenderStates ().GetBlend (alpha, src, dest);
185
185
  gfxContext.GetRenderStates ().SetBlend (true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
186
186
 
187
 
  Color col = Color::Black;
 
187
  Color col = Colors::Black;
188
188
  col.SetAlpha (0.0f);
189
189
  gfxContext.QRP_Color (base.x,
190
190
                        base.y,
310
310
    return;
311
311
  }
312
312
 
313
 
 
314
313
  int maxwidth = GetMaximumWidth ();
315
314
 
316
315
  surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1);
318
317
  cairo_set_font_options (cr, gdk_screen_get_font_options (screen));
319
318
  layout = pango_cairo_create_layout (cr);
320
319
  desc = pango_font_description_from_string (font);
321
 
  pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
322
320
  pango_layout_set_font_description (layout, desc);
323
321
  pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
324
322
 
338
336
  else
339
337
    pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT);
340
338
 
341
 
 
342
339
  pango_layout_set_markup (layout, _text.GetTCharPtr(), -1);
343
340
  pango_layout_set_height (layout, _lines);
344
341
  pango_layout_set_width (layout, maxwidth * PANGO_SCALE);
360
357
  pango_layout_context_changed (layout);
361
358
  pango_layout_get_extents (layout, NULL, &logRect);
362
359
 
363
 
  width  = logRect.width / PANGO_SCALE;
364
 
  height = logRect.height / PANGO_SCALE;
 
360
  width  = (logRect.x + logRect.width) / PANGO_SCALE;
 
361
  height = (logRect.y + logRect.height) / PANGO_SCALE;
365
362
  _cached_extent_height = height;
366
363
  _cached_extent_width = width;
367
364
 
370
367
  g_object_unref (layout);
371
368
  cairo_destroy (cr);
372
369
  cairo_surface_destroy (surface);
373
 
 
374
370
}
375
371
 
376
372
void StaticCairoText::DrawText (cairo_t*   cr,
394
390
    fontName = g_strdup (_fontstring);
395
391
 
396
392
  GetTextExtents (fontName, textWidth, textHeight);
397
 
 
 
393
    
398
394
  cairo_set_font_options (cr, gdk_screen_get_font_options (screen));
399
395
  layout = pango_cairo_create_layout (cr);
400
396
  desc = pango_font_description_from_string (fontName);
411
407
  else
412
408
    pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE);
413
409
 
414
 
 
415
410
  if (_align == NUX_ALIGN_LEFT)
416
411
    pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
417
412
  else if (_align == NUX_ALIGN_CENTRE)
421
416
 
422
417
  pango_layout_set_markup (layout, _text.GetTCharPtr(), -1);
423
418
  pango_layout_set_width (layout, textWidth * PANGO_SCALE);
 
419
 
424
420
  pango_layout_set_height (layout, _lines);
425
421
  pangoCtx = pango_layout_get_context (layout); // is not ref'ed
426
422
  pango_cairo_context_set_font_options (pangoCtx,
492
488
  _texture2D = GetThreadGLDeviceFactory()->CreateSystemCapableTexture ();
493
489
  _texture2D->Update (bitmap);
494
490
 
 
491
  delete bitmap;
 
492
 
495
493
  cairo_destroy (cr);
496
494
 
497
495
  delete _cairoGraphics;