Back to index

im-sdk  12.3.91
Functions
status.c File Reference
#include "xiiimp.h"
#include "guiIM.h"
#include "composeIM.h"
#include "status.h"
#include "iiimpIM.h"

Go to the source code of this file.

Functions

static Bool setup_local_status_ext (XicCommon ic)
void Ximp_Local_Status_Create (XicCommon ic)
void Ximp_Local_Status_Start (XicCommon ic)
void Ximp_Local_Status_Draw (XicCommon ic)
void Ximp_Local_Status_Window (XicCommon ic)
void Ximp_Local_Status_Done (XicCommon ic)
void Ximp_Local_Status_Destroy (XicCommon ic)
void Ximp_Local_Status_Set (XicCommon ic)
void Ximp_Local_Status_Reset (XicCommon ic)

Function Documentation

static Bool setup_local_status_ext ( XicCommon  ic) [static]

Definition at line 49 of file status.c.

{
  LocalStatusExt *hook = (LocalStatusExt *)(ic->local_icpart->status_ext);

  if (hook) return (True);

  hook = (LocalStatusExt *)Xmalloc(sizeof(LocalStatusExt));
  if(!hook)
    return (False);
  memset(hook, 0, sizeof(LocalStatusExt));

  ic->local_icpart->status_ext = hook;
  return(True);
}

Here is the caller graph for this function:

Definition at line 66 of file status.c.

                                       {
  setup_local_status_ext(ic);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 140 of file status.c.

                                        {
  LocalStatusExt *hook = (LocalStatusExt *)(ic->local_icpart->status_ext);

  if (!hook) return;

  Xfree(hook);
  ic->local_icpart->status_ext = 0;
  return;
}

Definition at line 134 of file status.c.

                                     {
  /* do nothing */
  return;
}

Definition at line 84 of file status.c.

                                     {
  LocalStatusExt *hook = (LocalStatusExt *)(ic->local_icpart->status_ext);
  XIMDrawTextStruct status_draw;

  if (!(ic->ximp_icpart->value_mask & XIMP_CLIENT_WIN) ||
      !ic->core.client_window)
    return;

  if (!hook) {
    Ximp_Local_Status_Start(ic);
    hook = (LocalStatusExt *)(ic->local_icpart->status_ext);
    if (!hook) return;
  }
  if (hook->text.length == 0) return;

  if (XIM_USE_UNICODE(ic->core.im)) {
    XIMText status_text;
    size_t native_len = 64; /* enough */
    char buffer[64], *pbuffer;
    memset(&buffer, 0, 64);
    pbuffer = buffer;

    memset(&status_text, 0, sizeof(XIMText)) ;
    if (IMConvertFromUTF8(hook->text.string.multi_byte,
                       strlen(hook->text.string.multi_byte),
                       (char**)&pbuffer, &native_len) != -1) {
      status_text.string.multi_byte = buffer;
      status_text.length = 64 - native_len;
    } else {
      status_text.string.multi_byte = hook->text.string.multi_byte;
      status_text.length = strlen(hook->text.string.multi_byte);
    }
    status_draw.call_data = (XPointer)&status_text;
    status_draw.feedback_list = 0;
    XIC_GUI(ic, change_status)((XIC)ic, STATUS_DRAW, (XPointer)&status_draw);
  } else {
    status_draw.call_data = (XPointer)&hook->text;
    status_draw.feedback_list = 0;
    XIC_GUI(ic, change_status)((XIC)ic, STATUS_DRAW, (XPointer)&status_draw);
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 191 of file status.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 151 of file status.c.

                                    {
  LocalIMState *imstate = ic->local_icpart->imstate;
  LocalStatusExt *hook = (LocalStatusExt *)(ic->local_icpart->status_ext);
  char *state_name;

  if (!hook) {
    if (!setup_local_status_ext(ic))
      return;
    hook = (LocalStatusExt *)(ic->local_icpart->status_ext);
  }

  state_name = imstate->name;
  hook->text.string.multi_byte = state_name;
  hook->text.length = strlen(state_name);
  hook->text.feedback = 0;
  hook->text.encoding_is_wchar = False;
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 72 of file status.c.

                                      {
  LocalStatusExt *hook = (LocalStatusExt *)(ic->local_icpart->status_ext);

  if (!hook) {
    if (!setup_local_status_ext(ic))
      return;
    hook = (LocalStatusExt *)(ic->local_icpart->status_ext);
  }
  XIC_GUI(ic, change_status)((XIC)ic, STATUS_START, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 128 of file status.c.

                                       {
  XIC_GUI(ic, change_status)((XIC)ic, STATUS_WIN, (XPointer)NULL);
  return;
}

Here is the caller graph for this function: