File: gcin-exit.cpp

package info (click to toggle)
gcin 2.9.4%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,812 kB
  • sloc: cpp: 34,326; ansic: 9,319; makefile: 648; sh: 556
file content (27 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "gcin.h"
#include "gcin-im-client.h"

#if WIN32
 #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
#endif

int main()
{
#if UNIX
  gdk_init(NULL, NULL);
#endif

#if UNIX
  Display *dpy = GDK_DISPLAY();
  if (find_gcin_window(dpy)==None)
    return 0;
  send_gcin_message(dpy, GCIN_EXIT_MESSAGE);
#else
  if (!find_gcin_window())
    return 0;
  send_gcin_message(GCIN_EXIT_MESSAGE);
  Sleep(2000);
#endif

  return 0;
}