Back to index

im-sdk  12.3.91
status-placement.c
Go to the documentation of this file.
00001 /* GIMLET: GNOME Input Method Language Enabing Tool
00002  *
00003  * Copyright (C) 2004 Red Hat, Inc.
00004  * Copyright (C) 2003 Sun Microsystems
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the
00018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  * Boston, MA 02111-1307, USA.
00020  */
00021 
00022 #include <glib.h>
00023 #include <string.h>
00024 
00025 #include "status-placement.h"
00026 
00027 #define PANEL_PLACEMENT "panel"       /* XIMStatusNothing */
00028 #define APPL_PLACEMENT "application"  /* XIMStatusCallbacks */
00029 
00030 IMStatusPlacement
00031 gimlet_status_placement (char *str)
00032 {
00033   if (str && (strcmp (str, PANEL_PLACEMENT) == 0))
00034     return ON_DESKTOP_PANEL;
00035   else if (str && (strcmp (str, APPL_PLACEMENT) == 0))
00036     return ATTACH_TO_APP_FRAME;
00037   else
00038     return ATTACH_TO_APP_FRAME;
00039 }
00040 
00041 char *
00042 gimlet_status_placement_name (IMStatusPlacement placement)
00043 {
00044   switch (placement)
00045     {
00046     case ON_DESKTOP_PANEL:
00047       return PANEL_PLACEMENT;
00048       break;
00049     case ATTACH_TO_APP_FRAME:
00050       return APPL_PLACEMENT;
00051       break;
00052     }
00053   g_return_val_if_reached("placement name error");
00054 }