Ignore:
Timestamp:
Mar 15, 2008, 12:55:44 AM (11 years ago)
Author:
Sam Hocevar
Message:
  • Rename the "eh" variable to "wm" because it's a window manager, not an event handler.
  • No longer pass the window manager to functions, there's only one.

Inspired by Win32 Abuse changelog for January 28, 2001:

  • Starting work on singleton code; will get rid of all

references to an arbitrary window_manager* because
there's only going to be one, and it's not ever
going to change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/guistat.cpp

    r56 r106  
    1010#include "config.h"
    1111
     12#include "input.hpp"
    1213#include "status.hpp"
    1314#include "timing.hpp"
     
    2122  visual_object *show;
    2223  jwindow *stat_win;
    23   window_manager *wm;
    2424  int last_update;
    2525  time_marker last_time;
    26   gui_status_node(char const *Name, visual_object *Show, window_manager *WM, gui_status_node *Next)
     26  gui_status_node(char const *Name, visual_object *Show, gui_status_node *Next)
    2727  { name=strcpy((char *)jmalloc(strlen(Name)+1,"status name"),Name);
    2828    show=Show;
     
    3030    last_update=0;
    3131    stat_win=NULL;
    32     wm=WM;
    3332  }
    3433  ~gui_status_node();
     
    7372void gui_status_manager::push(char const *name, visual_object *show)
    7473{
    75   first=new gui_status_node(name,show,wm,first); 
     74  first=new gui_status_node(name,show,first); 
    7675}
    7776
    78 gui_status_manager::gui_status_manager(window_manager *WM)
     77gui_status_manager::gui_status_manager()
    7978{
    80   wm=WM;
    8179  first=NULL;
    8280  strcpy(title,"STATUS");
     
    9593      {
    9694        long wx=xres/2,wy=10,len1=strlen(first->name)*wm->font()->width()+10,len2=0,len3,
    97           h1=wm->font()->height()+5,h2=first->show ? first->show->height(wm) : 0;
     95          h1=wm->font()->height()+5,h2=first->show ? first->show->height() : 0;
    9896
    99         if (first->show) len2=first->show->width(wm)/2;
     97        if (first->show) len2=first->show->width()/2;
    10098        if (len2>len1) len3=len2; else len3=len1;
    10199        wx-=len3/2;
     
    112110        if (first->show)
    113111          first->show->draw(first->stat_win->screen,(first->stat_win->x2()-first->stat_win->x1())/2-
    114                             first->show->width(wm)/2,my+h1,wm,NULL);
     112                            first->show->width()/2,my+h1,NULL);
    115113
    116114        draw_bar(first,percentage);
Note: See TracChangeset for help on using the changeset viewer.