/[antiright]/antiright/src/arshell/arshell.c
ViewVC logotype

Diff of /antiright/src/arshell/arshell.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by jefbed, Thu Jul 28 04:44:03 2005 UTC revision 1.17 by jefbed, Sun Jul 31 16:19:50 2005 UTC
# Line 23  Line 23 
23  #include "arshell.h"  #include "arshell.h"
24    
25  void  void
26  arshell_setup_mainwindow()  arshell_setup_mainwindow ()
27  {  {
28    ARCLARG;    ARCLARG;
29    antiright_set(XmNshadowThickness, 0);    antiright_set (XmNshadowThickness, 0);
30    arshell.gui.widgets.mainwindow=    arshell.gui.widgets.mainwindow =
31      XmCreateMainWindow(antiright.parent_widget,      XmCreateMainWindow (antiright.parent_widget,
32                         "mainwindow_manager_widget",                          "mainwindow_manager_widget",
33                         antiright.arguments,                          antiright.arguments, antiright.arguments_int);
34                         antiright.arguments_int);    XtManageChild (arshell.gui.widgets.mainwindow);
   XtManageChild(arshell.gui.widgets.mainwindow);  
35  }  }
36    
37  Boolean  Boolean
38  arshell_override_is_set()  arshell_override_is_set ()
39  {  {
40    Boolean override_is_set;    Boolean override_is_set;
41    ARCLARG;    ARCLARG;
42    antiright_set(XmNoverrideRedirect, (XtArgVal)&override_is_set);    antiright_set (XmNoverrideRedirect, (XtArgVal) & override_is_set);
43    XtGetValues(antiright.parent_widget,    XtGetValues (antiright.parent_widget,
44                antiright.arguments,                 antiright.arguments, antiright.arguments_int);
               antiright.arguments_int);  
45    ARCLARG;    ARCLARG;
46    return(override_is_set);    return (override_is_set);
47  }  }
48    
49  void  void
50  arshell_handle_panel_override()  arshell_handle_panel_override ()
51  {  {
52  #ifdef XmNtoolTipEnable  #ifdef XmNtoolTipEnable
53    if(!arshell_override_is_set() || arshell.flags.force_tooltips)    if (!arshell_override_is_set () || arshell.flags.force_tooltips)
54      {      {
55        XtVaSetValues(antiright.parent_widget,        XtVaSetValues (antiright.parent_widget, XmNtoolTipEnable, True, NULL);
                     XmNtoolTipEnable, True,  
                     NULL);  
56      }      }
57  #endif /* XmNtoolTipEnable  */  #endif /* XmNtoolTipEnable  */
58  }  }
59    
60  void  void
61  arshell_check_if_lowered()  arshell_check_if_lowered ()
62  {  {
63    if(arshell.flags.lowered)    if (arshell.flags.lowered)
64      {      {
65        XLowerWindow(antiright.display,        XLowerWindow (antiright.display, XtWindow (antiright.parent_widget));
                    XtWindow(antiright.parent_widget));  
66        /* This is a small hack to ensure that a window stays lowered if        /* This is a small hack to ensure that a window stays lowered if
67           such is specified at the command line.  This mainly is           such is specified at the command line.  This mainly is
68           intended to fix operation of AntiRight with fvwm2.  */           intended to fix operation of AntiRight with fvwm2.  */
69        arshell_add_updater(antiright.parent_widget, "lower");        arshell_add_updater (antiright.parent_widget, "lower");
70      }      }
71  }  }
72    
73  void  void
74  arshell_place_arshell()  arshell_place_arshell ()
75  {  {
76    XtRealizeWidget(antiright.parent_widget);    XtRealizeWidget (antiright.parent_widget);
77    if(arshell.use_graph)    if (arshell.use_graph)
78      {      {
79        antiright_set(XmNresizePolicy, XmRESIZE_NONE);        antiright_set (XmNresizePolicy, XmRESIZE_NONE);
80        arshell.gui.widgets.work=        arshell.gui.widgets.work =
81          antiright_create_graph(arshell.gui.widgets.mainwindow);          antiright_create_graph (arshell.gui.widgets.mainwindow);
82        arshell_setup_work_window();        arshell_setup_work_window ();
83      }      }
84    /*arshell_handle_panel_override();*/    /*arshell_handle_panel_override(); */
85    arshell_check_if_lowered();    arshell_check_if_lowered ();
86  }  }
87    
88  void  void
89  arshell_start_event_loop()  arshell_start_event_loop ()
90  {  {
91    arshell_place_arshell();    arshell_place_arshell ();
92    XtAppMainLoop(antiright.app_context);    XtAppMainLoop (antiright.app_context);
93  }  }
94    
95  void  void
96  arshell_setup_work_row()  arshell_setup_work_row ()
97  {  {
98    ARCLARG;    ARCLARG;
99    antiright_set(XmNmarginHeight, 0);    antiright_set (XmNmarginHeight, 0);
100    antiright_set(XmNmarginWidth, 0);    antiright_set (XmNmarginWidth, 0);
101    arshell.gui.widgets.row=antiright_row(arshell.gui.widgets.mainwindow);    arshell.gui.widgets.row = antiright_row (arshell.gui.widgets.mainwindow);
102    
103    /* The following implements a popup menu on the ACE desktop.  */    /* The following implements a popup menu on the ACE desktop.  */
104   /*  if ( arshell_override_is_set() && arshell.flags.lowered ) */    /*  if ( arshell_override_is_set() && arshell.flags.lowered ) */
105  /*     { */  /*     { */
106        Widget menu;    Widget menu;
107        menu=antiright_popup_menu(arshell.gui.widgets.row);    menu = antiright_popup_menu (arshell.gui.widgets.row);
108        antiright_button(menu, "Terminal",    antiright_button (menu, "Terminal", antiright_system_cb, "ACE Terminal");
109                         antiright_system_cb, "ACE Terminal");    antiright_separator (menu);
110        antiright_separator(menu);    antiright_button (menu, "Restart",
111        antiright_button(menu, "Restart",                      antiright_system_cb, "ACE -A restart_desktop");
112                         antiright_system_cb, "ACE -A restart_desktop");    antiright_button (menu, "Quit Desktop",
113        antiright_button(menu, "Quit Desktop",                      antiright_system_cb, "ACE -A killdesk");
114                         antiright_system_cb, "ACE -A killdesk");    antiright_button (menu, "Logout", antiright_system_cb, "ACE -A killwm");
115        antiright_button(menu, "Logout",    /*    } */
116                         antiright_system_cb, "ACE -A killwm");  }
117   /*    } */  
118  }  void
119  void  arshell_initialize_application_data ()
120  arshell_initialize_application_data()  {
121  {    arshell.gui.menubar.file_widget = NULL;
122    arshell.gui.menubar.file_widget=NULL;    arshell.gui.widgets.work = NULL;
123    arshell.gui.widgets.work=NULL;    antiright.status_widget = NULL;
124    antiright.status_widget=NULL;    arshell.timer_id = NULL;
125    arshell.timer_id=NULL;    arshell.edit.filename[0] = '\0';
126    arshell.edit.filename[0]='\0';    arshell.update_frequency = 1000;      /* This is in miliseconds.  */
127    arshell.update_frequency=1000; /* This is in miliseconds.  */  }
128  }  
129  void  void
130  arshell_setup_work_window()  arshell_setup_work_window ()
131  {  {
132    if(arshell.gui.widgets.work!=NULL)    if (arshell.gui.widgets.work != NULL)
133      {      {
134        XtVaSetValues(arshell.gui.widgets.mainwindow,        XtVaSetValues (arshell.gui.widgets.mainwindow,
135                      XmNworkWindow, arshell.gui.widgets.work,                       XmNworkWindow, arshell.gui.widgets.work,
136                      XmNcommandWindow, arshell.gui.widgets.row,                       XmNcommandWindow, arshell.gui.widgets.row, NULL);
                     NULL);  
137      }      }
138    else    else
139      {      {
140        XtVaSetValues(arshell.gui.widgets.mainwindow,        XtVaSetValues (arshell.gui.widgets.mainwindow,
141                      XmNworkWindow, arshell.gui.widgets.row,                       XmNworkWindow, arshell.gui.widgets.row, NULL);
                     NULL);  
142      }      }
143    if(arshell.use_graph)    if (arshell.use_graph)
144      {      {
145          
146        XtVaSetValues(antiright.parent_widget,        XtVaSetValues (antiright.parent_widget,
147                      XmNheight, antiright.graph.height+10,                       XmNheight, antiright.graph.height + 10,
148                      XmNwidth, antiright.graph.width+10,                       XmNwidth, antiright.graph.width + 10, NULL);
                     NULL);  
149      }      }
150  }  }
151    
152  void  void
153  arshell_setup_message_window()  arshell_setup_message_window ()
154  {  {
155    if(antiright.status_widget!=NULL)    if (antiright.status_widget != NULL)
156      {      {
157        XtVaSetValues(arshell.gui.widgets.mainwindow,        XtVaSetValues (arshell.gui.widgets.mainwindow,
158                      XmNmessageWindow, antiright.status_widget,                       XmNmessageWindow, antiright.status_widget, NULL);
                     NULL);  
159      }      }
160  }  }
   

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26