Back to index

im-sdk  12.3.91
Functions | Variables
guiIMStsArea.c File Reference
#include "xiiimp.h"
#include "guiIMSts.h"
#include "XimpIm.h"

Go to the source code of this file.

Functions

static void create (XicCommon ic, XPointer call_data)
static void set_window (XicCommon ic, XPointer call_data)
static void HideStatus (XicCommon ic, XPointer call_data)
void ChangeStatusArea (XIC xic, StatusAttr reason, XPointer call_data)

Variables

static StatusCB status_area_methods []

Function Documentation

void ChangeStatusArea ( XIC  xic,
StatusAttr  reason,
XPointer  call_data 
)

Definition at line 158 of file guiIMStsArea.c.

                                                                 {
  XicCommon ic = (XicCommon)xic;
  if (reason > STATUS_HIDE) return;
  status_area_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

static void create ( XicCommon  ic,
XPointer  call_data 
) [static]

Definition at line 48 of file guiIMStsArea.c.

                                         {
  StatusWin status = (StatusWin)(ic->gui_icpart->status);
  XWindowAttributes attr;

  if (!(ic->ximp_icpart->value_mask & XIMP_CLIENT_WIN)) return;

  if (!status) {
    SetupStatusExt(ic);
    status = (StatusWin)(ic->gui_icpart->status);
  }

  if (status->parent != 0) {
    /* status window is already created  */
    return;
  }
  if (XGetWindowAttributes(ic->core.im->core.display, 
                        ic->core.client_window,
                        &attr) > 0) {
    if (attr.map_state == IsUnmapped) {
      /* not yet ready to create status window */
      return;
    }
    SetupStatusWindow(ic, ic->core.client_window);
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void HideStatus ( XicCommon  ic,
XPointer  call_data 
) [static]

Definition at line 138 of file guiIMStsArea.c.

                                             {
  /* nothing to do in StatusArea input style */
  return;
}
static void set_window ( XicCommon  ic,
XPointer  call_data 
) [static]

Definition at line 76 of file guiIMStsArea.c.

                                             {
  StatusWin status = (StatusWin)(ic->gui_icpart->status);
  CacheRec *status_cache;

  if (!XIMP_CHK_STSAREAMASK(ic) ||
      ic->core.status_attr.area.width == 0 ||
      ic->core.status_attr.area.height == 0)
    return;

  if (!status) {
    create(ic, NULL);
    status = (StatusWin)(ic->gui_icpart->status);
    if (!status) return;
  }

  status_cache = (CacheRec*)&(status->status_cache);

  if (status_cache->win_x == ic->core.status_attr.area.x &&
      status_cache->win_y == ic->core.status_attr.area.y &&
      status_cache->win_width == ic->core.status_attr.area.width &&
      status_cache->win_height == ic->core.status_attr.area.height &&
      status_cache->font_set == status->fontset) {
    return;
  }
      
  status->x = 0;

  if (!status->fontset) {
    SetStatusFont(ic, NULL);
  }
  if (status->fontset) {
    XFontSetExtents *fse;
    int height_diff;
    fse = XExtentsOfFontSet(status->fontset);
    height_diff =
           (ic->core.status_attr.area.height - fse->max_ink_extent.height);
    height_diff += (height_diff & 1);
    status->y = abs((-fse->max_ink_extent.y) + (height_diff / 2));
  } else {
    status->y = ic->core.status_attr.area.height;
  }

  if (!status->window)
    SetupStatusWindow(ic, ic->core.client_window);
  if (status->window)
    XMoveResizeWindow(ic->core.im->core.display,
                    status->window,
                    ic->core.status_attr.area.x,
                    ic->core.status_attr.area.y,
                    ic->core.status_attr.area.width,
                    ic->core.status_attr.area.height);
  /* data cache */
  status_cache->win_x = ic->core.status_attr.area.x;
  status_cache->win_y = ic->core.status_attr.area.y;
  status_cache->win_width = ic->core.status_attr.area.width;
  status_cache->win_height = ic->core.status_attr.area.height;
  status_cache->font_set = status->fontset;

  return;
}

Here is the call graph for this function:


Variable Documentation