~ubuntu-branches/ubuntu/precise/uim/precise

« back to all changes in this revision

Viewing changes to xim/convdisp.cpp

  • Committer: Package Import Robot
  • Author(s): Ilya Barygin
  • Date: 2011-12-18 16:35:38 UTC
  • mfrom: (1.1.13) (15.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20111218163538-8ktir39z2mjpii8z
Tags: 1:1.7.1-3ubuntu1
* Merge from Debian testing (LP: #818199).
* Remaining changes:
  - debian/uim-qt.install: Fix plugin path for multiarch location.
* Dropped changes:
  - uim-applet-gnome removal (GNOME 3 applet is available)
  - 19_as-needed_compile_fix.dpatch (accepted into Debian package)
* translations.patch: add several files to POTFILE.in to prevent
  intltool-update failure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
 
  Copyright (c) 2003-2009 uim Project http://code.google.com/p/uim/
 
3
  Copyright (c) 2003-2011 uim Project http://code.google.com/p/uim/
4
4
 
5
5
  All rights reserved.
6
6
 
42
42
#if HAVE_XFT_UTF8_STRING
43
43
#include <X11/Xft/Xft.h>
44
44
#endif
45
 
#include <stdlib.h>
46
 
#include <locale.h>
 
45
#include <clocale>
 
46
#include <cstdlib>
47
47
#include "xim.h"
48
48
#include "ximserver.h"
49
49
#include "convdisp.h"
489
489
            native_str = im->utf8_to_native_str(utf8);
490
490
            if (!native_str)
491
491
                return;
492
 
            len = strlen(native_str);
 
492
            len = static_cast<int>(strlen(native_str));
493
493
            XmbDrawImageString(XimServer::gDpy, mPixmap, mFontset,
494
494
                           gc, x, y, native_str, len);
495
495
            free(native_str);
499
499
 
500
500
void PeWin::set_back(unsigned long p)
501
501
{
502
 
    mBack = p;
 
502
    mBack = static_cast<unsigned int>(p);
503
503
    XSetBackground(XimServer::gDpy, mGC, p);
504
504
    XSetForeground(XimServer::gDpy, mClearGC, p);
505
505
#if HAVE_XFT_UTF8_STRING
518
518
 
519
519
void PeWin::set_fore(unsigned long p)
520
520
{
521
 
    mFore = p;
 
521
    mFore = static_cast<unsigned int>(p);
522
522
    XSetForeground(XimServer::gDpy, mGC, p);
523
523
    XSetBackground(XimServer::gDpy, mClearGC, p);
524
524
#if HAVE_XFT_UTF8_STRING
719
719
            native_str = im->utf8_to_native_str(utf8);
720
720
            if (!native_str)
721
721
                return 0;
722
 
            len = strlen(native_str);
 
722
            len = static_cast<int>(strlen(native_str));
723
723
            XmbTextExtents(mFontset, native_str, len, &ink, &logical);
724
724
            free(native_str);
725
725
        }
1395
1395
    }
1396
1396
 
1397
1397
    if (!m_atr->has_atr(ICA_Foreground))
1398
 
        m_atr->foreground_pixel = BlackPixel(XimServer::gDpy,
1399
 
                                             DefaultScreen(XimServer::gDpy));
 
1398
        m_atr->foreground_pixel
 
1399
                = static_cast<C32>(BlackPixel(XimServer::gDpy,
 
1400
                                              DefaultScreen(XimServer::gDpy)));
1400
1401
 
1401
1402
    if (!m_atr->has_atr(ICA_Background))
1402
 
        m_atr->background_pixel = WhitePixel(XimServer::gDpy,
1403
 
                                             DefaultScreen(XimServer::gDpy));
 
1403
        m_atr->background_pixel
 
1404
                = static_cast<C32>(WhitePixel(XimServer::gDpy,
 
1405
                                              DefaultScreen(XimServer::gDpy)));
1404
1406
 
1405
1407
    return true;
1406
1408
}
1463
1465
                    logical.width = 0;
1464
1466
                    logical.height = (unsigned short)((i > 0) ? m_ce[i - 1].height : 0);
1465
1467
                } else {
1466
 
                    len = strlen(str);
 
1468
                    len = static_cast<int>(strlen(str));
1467
1469
                    XmbTextExtents(m_atr->font_set, str, len, &ink, &logical);
1468
1470
                    free(str);
1469
1471
                }
1655
1657
    char *c = im->uStringToCtext(&s);
1656
1658
    int i, len = 0;
1657
1659
    if (c)
1658
 
        len = strlen(c);
 
1660
        len = static_cast<int>(strlen(c));
1659
1661
    t->pushC16((C16)len); // LENGTH
1660
1662
    for (i = 0; i < len; i++) {
1661
1663
        t->pushC8(c[i]); // CTEXT
1664
1666
    for (i = 0; i < len; i++) {
1665
1667
        t->pushC8(0); // PADDING
1666
1668
    }
1667
 
    if (c)
1668
 
        free(c);
 
1669
    free(c);
1669
1670
}
1670
1671
 
1671
1672
void ConvdispOs::compose_feedback_array(TxPacket *t)
1676
1677
    t->pushC16(0);
1677
1678
    std::list<pe_ustring>::iterator it;
1678
1679
    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); ++it) {
1679
 
        len = (*it).s.size();
 
1680
        len = static_cast<int>((*it).s.size());
1680
1681
        stat = (*it).stat;
1681
1682
        xstat = FB_None;
1682
1683
        if (stat & PE_REVERSE)