Example #1
0
static void xdpy_set_window_title_default(ALLEGRO_DISPLAY *display, const char *title)
{
   ALLEGRO_SYSTEM_XGLX *system = (ALLEGRO_SYSTEM_XGLX *)al_get_system_driver();
   ALLEGRO_DISPLAY_XGLX *glx = (ALLEGRO_DISPLAY_XGLX *)display;

   {
      Atom WM_NAME = XInternAtom(system->x11display, "WM_NAME", False);
      Atom _NET_WM_NAME = XInternAtom(system->x11display, "_NET_WM_NAME", False);
      char *list[1] = { (char *) title };
      XTextProperty property;

      Xutf8TextListToTextProperty(system->x11display, list, 1, XUTF8StringStyle,
         &property);
      XSetTextProperty(system->x11display, glx->window, &property, WM_NAME);
      XSetTextProperty(system->x11display, glx->window, &property, _NET_WM_NAME);
      XSetTextProperty(system->x11display, glx->window, &property, XA_WM_NAME);
      XFree(property.value);
   }
   {
      XClassHint *hint = XAllocClassHint();
      if (hint) {
         ALLEGRO_PATH *exepath = al_get_standard_path(ALLEGRO_EXENAME_PATH);
         // hint doesn't use a const char*, so we use strdup to create a non const string
         hint->res_name = strdup(al_get_path_basename(exepath));
         hint->res_class = strdup(al_get_path_basename(exepath));
         XSetClassHint(system->x11display, glx->window, hint);
         free(hint->res_name);
         free(hint->res_class);
         XFree(hint);
         al_destroy_path(exepath);
      }
   }
}
Example #2
0
SlotManager::SlotManager(bool a_blLoading,  ALLEGRO_PATH * a_pSearchpath,void (* a_pCallBack)(string))

{
    m_ColorInner     = al_map_rgb(0,0,0);
    m_ColorOuter     = al_map_rgb(100,100,255);
    m_ColorHighlight = al_map_rgb(0,0,255);
    m_pActiveSlot    = NULL;
    m_blLoading      = a_blLoading;
    m_pCallBack      = a_pCallBack;
    m_nIndex         = 1;

    if (a_pSearchpath!=NULL)
    {
        ALLEGRO_FS_ENTRY * pDir = al_create_fs_entry(al_path_cstr(a_pSearchpath,ALLEGRO_NATIVE_PATH_SEP));
        if (al_open_directory(pDir))
        {
            ALLEGRO_FS_ENTRY * pFile;
            while (pFile = al_read_directory(pDir))
            {
                ALLEGRO_PATH * pPath = al_create_path(al_get_fs_entry_name(pFile));

                AddSlot(al_get_path_basename(pPath));

                al_destroy_path(pPath);
                al_destroy_fs_entry(pFile);
            }
        }
        al_destroy_fs_entry(pDir);
    }

    if (!a_blLoading)
    {
        AddSlot("NEW SAVE...");
    }
}
Example #3
0
File: path.c Project: trezker/allua
static int allua_Path_get_basename(lua_State * L)
{
   ALLUA_path path = allua_check_path(L, 1);

   lua_pushstring(L, al_get_path_basename(path));

   return 1;
}