home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / CFLIB-11.LZH / src / userdef.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-04  |  13.9 KB  |  634 lines

  1. /*
  2.  * userdef.c
  3.  *
  4.  * Ist MagiC nicht vorhanden, werden die neuen Objekttypen von MagiC
  5.  * emuliert.
  6.  * Emuliert werden Radio- und Kreuzknopf, Gruppenrahmen, unterstrichener
  7.  * String sowie die Shortcuts.
  8.  * Zusätzlich zu den MagiC-Objekten gibt es noch den Gruppenrahmen und
  9.  * Überschrift in kleiner Schrift (Flags CHECKED).
  10.  *
  11.  */
  12.  
  13. #include "intern.h"
  14. #ifdef __MINT__
  15. #include "gemx.h"
  16. #endif
  17.  
  18. #ifndef TXT_LIGHT
  19. #define TXT_LIGHT            0x0002
  20. #define TXT_UNDERLINED    0x0008
  21. #endif
  22.  
  23. #include "inline.rsh"
  24. #include "inline.rh"
  25.  
  26. OBJECT    *cf_ascii_tab = NULL;
  27. OBJECT    *cf_alert_box = NULL;
  28.  
  29. static int            handle = -1, ud_wchar, ud_hchar, ud_wbox, ud_hbox;
  30. static USERBLK     menu_blk, popup_blk;
  31. static int             gnva, use_3D, mx_buttons, mx_shortcut;
  32. static int            back_col;
  33. static CICONBLK    *radio_cib, *check_cib;
  34. static int            mask_col[2] = {0, 0},
  35.                         icon_col[2] = {1, 0};
  36. static int            use_all_userdefs = FALSE;
  37.  
  38. /* -- diverser Kleinkram ----------------------------------------------------- */
  39.  
  40. static int get_txtlen(char *str)
  41. {
  42.     int    pxy[8];
  43.     
  44.     if (gl_nvdi >= 0x300)
  45.         vqt_real_extent(handle, 0, 0, str, pxy);
  46.     else
  47.         vqt_extent(handle, str, pxy);
  48.     return pxy[2] - pxy[0];
  49. }
  50.  
  51.  
  52. /* -- allgemeine Zeichenroutinen --------------------------------------------- */
  53.  
  54. static void draw_string(OBJECT *tree, int obj, int x, int y, char *str, int effect)
  55. {
  56.     int    l, pos;
  57.     char    c;
  58.  
  59.     if (tree[obj].ob_state & DISABLED)
  60.         effect |= TXT_LIGHT;
  61.  
  62.     vst_effects(handle, effect);
  63.  
  64.     v_gtext(handle, x, y, str);
  65.  
  66.     /* Gibts einen Shortcut? */
  67.     pos = get_magx_shortcut(tree, obj, &c);
  68.     if (pos != -1)
  69.     {
  70.         char    chr[2] = "A";
  71.         char    s2[128];
  72.  
  73.         /* Start-Pos */
  74.         strcpy(s2, str);
  75.         s2[pos] = EOS;
  76.         l = get_txtlen(s2);
  77.  
  78.         vswr_mode(handle, MD_TRANS);
  79.         vst_effects(handle, effect|TXT_UNDERLINED);
  80.         chr[0] = c;
  81.         v_gtext(handle, x + l, y, chr);
  82.     }
  83. }
  84.  
  85.  
  86. static void draw_bitblk(short *data, int planes, int mode, int *col, int x, int y)
  87. {
  88.     MFDB    dst, src;
  89.     int    pxy[8];
  90.  
  91.     src.fd_addr = data;
  92.     src.fd_w = radio_cib->monoblk.ib_wicon;
  93.     src.fd_h = radio_cib->monoblk.ib_hicon;
  94.     src.fd_wdwidth = src.fd_w / 16;
  95.     src.fd_stand = 0;
  96.     src.fd_nplanes = planes;
  97.  
  98.     dst.fd_addr = NULL;
  99.  
  100.     pxy[0] = 0;
  101.     pxy[1] = 0;
  102.     pxy[2] = src.fd_w - 1;
  103.     pxy[3] = src.fd_h - 1;
  104.     pxy[4] = x;
  105.     pxy[5] = y;
  106.     pxy[6] = pxy[4] + pxy[2];
  107.     pxy[7] = pxy[5] + pxy[3];
  108.  
  109.     if (planes == 1)
  110.         vrt_cpyfm(handle, mode, pxy, &src, &dst, col);
  111.     else
  112.         vro_cpyfm(handle, mode, pxy, &src, &dst);
  113. }
  114.  
  115.  
  116. /* -- Zeichenroutinen für die Objekte ---------------------------------------- */
  117.  
  118. static int cdecl draw_radiobutton(PARMBLK *p)
  119. {
  120.     char    *str;
  121.     int    wchar, d, i_m;
  122.     short *m_d, *i_d;
  123.  
  124.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  125.     vswr_mode(handle, MD_TRANS);
  126.  
  127.     if (p->pb_currstate & SELECTED)
  128.     {
  129.         i_d = (short *)radio_cib->mainlist->sel_data;
  130.         m_d = (short *)radio_cib->mainlist->sel_mask;
  131.     }
  132.     else
  133.     {
  134.         i_d = (short *)radio_cib->mainlist->col_data;
  135.         m_d = (short *)radio_cib->mainlist->col_mask;
  136.     }
  137.  
  138.     /* Maske */
  139.     draw_bitblk(m_d, 1, MD_TRANS, mask_col, p->pb_x, p->pb_y);
  140.     /* Icon */
  141.     if (radio_cib->mainlist->num_planes > 1)
  142.     {
  143.         if (radio_cib->mainlist->num_planes > 8)
  144.             i_m = S_AND_D;
  145.         else
  146.             i_m = S_OR_D;
  147.     }
  148.     else
  149.         i_m = MD_TRANS;
  150.     draw_bitblk(i_d, radio_cib->mainlist->num_planes, i_m, icon_col, p->pb_x, p->pb_y);
  151.  
  152.     /* Text nur beim objc_draw ausgeben */
  153.     if (p->pb_prevstate == p->pb_currstate)
  154.     {
  155.         str = (char *)p->pb_parm;
  156.         vst_font(handle, sys_big_id);
  157.         vst_height(handle, sys_big_height, &wchar, &d, &d, &d);
  158.         draw_string(p->pb_tree, p->pb_obj, p->pb_x + p->pb_h + wchar, p->pb_y, str, 0);
  159.     }
  160.     return (p->pb_currstate & ~(SELECTED|DISABLED));
  161. }
  162.  
  163.  
  164. static int cdecl draw_checkbutton(PARMBLK *p)
  165. {
  166.     char    *str;
  167.     int    wchar, d, i_m;
  168.     short *m_d, *i_d;
  169.  
  170.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  171.     vswr_mode(handle, MD_TRANS);
  172.  
  173.     if (p->pb_currstate & SELECTED)
  174.     {
  175.         i_d = (short *)check_cib->mainlist->sel_data;
  176.         m_d = (short *)check_cib->mainlist->sel_mask;
  177.     }
  178.     else
  179.     {
  180.         i_d = (short *)check_cib->mainlist->col_data;
  181.         m_d = (short *)check_cib->mainlist->col_mask;
  182.     }
  183.  
  184.     /* Maske */
  185.     draw_bitblk(m_d, 1, MD_TRANS, mask_col, p->pb_x, p->pb_y);
  186.     /* Icon */
  187.     if (radio_cib->mainlist->num_planes > 1)
  188.     {
  189.         if (radio_cib->mainlist->num_planes > 8)
  190.             i_m = S_AND_D;
  191.         else
  192.             i_m = S_OR_D;
  193.     }
  194.     else
  195.         i_m = MD_TRANS;
  196.     draw_bitblk(i_d, check_cib->mainlist->num_planes, i_m, icon_col, p->pb_x, p->pb_y);
  197.  
  198.     /* Text nur beim objc_draw ausgeben */
  199.     if (p->pb_prevstate == p->pb_currstate)
  200.     {
  201.         str = (char *)p->pb_parm;
  202.         vst_font(handle, sys_big_id);
  203.         vst_height(handle, sys_big_height, &wchar, &d, &d, &d);
  204.         draw_string(p->pb_tree, p->pb_obj, p->pb_x + p->pb_h + wchar, p->pb_y, str, 0);
  205.     }
  206.     return (p->pb_currstate & ~(SELECTED|DISABLED));
  207. }
  208.  
  209.  
  210. static int cdecl draw_underline(PARMBLK *p)
  211. {
  212.     char    *str;
  213.     int    d, len, pxy[8], wBox, hBox;
  214.  
  215.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  216.     vswr_mode(handle, MD_TRANS);
  217.  
  218.     /* Font */
  219.     vst_font(handle, sys_big_id);
  220.     vst_height(handle, sys_big_height, &d, &d, &wBox, &hBox);
  221.  
  222.     /* Text ausgeben */
  223.     str = (char *)p->pb_parm;
  224.     draw_string(p->pb_tree, p->pb_obj, p->pb_x, p->pb_y, str, 0);
  225.  
  226.     /* Linie */
  227. /*    len = get_txtlen(str);*/
  228.     len = p->pb_w;
  229.  
  230.     if (use_3D)
  231.         vsl_color(handle, 9);
  232.     else
  233.         vsl_color(handle, 1);
  234.     pxy[0] = p->pb_x;            pxy[1] = p->pb_y + hBox;
  235.     pxy[2] = p->pb_x + len; pxy[3] = pxy[1];
  236.     v_pline(handle, 2, pxy);
  237.  
  238.     if (use_3D)
  239.     {
  240.         vsl_color(handle, 0);
  241.         pxy[1]--; pxy[3]--;
  242.         v_pline(handle, 2, pxy);        
  243.     }
  244.  
  245.     return (p->pb_currstate & ~(CHECKED|DISABLED));
  246. }
  247.  
  248.  
  249. int cdecl draw_groupbox(PARMBLK *p)
  250. {
  251.     int    pxy[12], len, wBox, hBox, d;
  252.     int    x, y, w, h;
  253.     char    *str;
  254.  
  255.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  256.  
  257.     /* Font */
  258.     if (p->pb_tree[p->pb_obj].ob_state & CHECKED)        /* kleine Schrift */
  259.     {
  260.         vst_font(handle, sys_sml_id);
  261.         vst_height(handle, sys_sml_height, &d, &d, &wBox, &hBox);
  262.     }
  263.     else
  264.     {
  265.         vst_font(handle, sys_big_id);
  266.         vst_height(handle, sys_big_height, &d, &d, &wBox, &hBox);
  267.     }
  268.  
  269.     /* Text */
  270.     vswr_mode(handle, MD_TRANS);
  271.     str = (char *)p->pb_parm;
  272.  
  273.     x = p->pb_x + wBox;
  274.     y = p->pb_y + (sys_hbox - hBox) / 2 + 1;
  275.     draw_string(p->pb_tree, p->pb_obj, x, y, str, 0);
  276.     len = get_txtlen(str);
  277.  
  278.     /* Rahmen */
  279.     x = p->pb_x;
  280.     y = p->pb_y + sys_hbox / 2;
  281.     if (use_3D)
  282.     {
  283.         /* weißer Rahmen wird außen gemalt -> 1 Pixel schmaler */
  284.         w = p->pb_w - 1;
  285.         h = p->pb_h - 1 - sys_hbox / 2;
  286.     }
  287.     else
  288.     {
  289.         w = p->pb_w;
  290.         h = p->pb_h - sys_hbox / 2;
  291.     }    
  292.     
  293.     /* Frame */
  294.     vswr_mode(handle, MD_REPLACE);
  295.     if (use_3D)
  296.         vsl_color(handle, 9);
  297.     else
  298.         vsl_color(handle, 1);
  299.     
  300.     pxy[0] = x + wBox;            pxy[1] = y;
  301.     pxy[2] = x;                     pxy[3] = y;
  302.     pxy[4] = x;                     pxy[5] = y + h - 1;
  303.     pxy[6] = x + w - 1;            pxy[7] = pxy[5];
  304.     pxy[8] = pxy[6];                 pxy[9] = y;
  305.     pxy[10] = x + wBox + len;    pxy[11] = y;
  306.     v_pline(handle, 6, pxy);
  307.     
  308.     if (use_3D)
  309.     {
  310.         vsl_color(handle, 0);
  311.         pxy[1]++; pxy[2]++; pxy[3]++; pxy[4]++; pxy[5]--;
  312.         v_pline(handle, 3, pxy);
  313.     
  314.         pxy[0] = x;         pxy[1] = y + h;
  315.         pxy[2] = x + w;    pxy[3] = pxy[1];
  316.         pxy[4] = pxy[2];     pxy[5] = y;
  317.         v_pline(handle, 3, pxy);
  318.     
  319.         pxy[0] = x + w - 2;    pxy[1] = y + 1;
  320.         pxy[2] = pxy[10];     pxy[3] = pxy[1];
  321.         v_pline(handle, 2, pxy);
  322.     }
  323.     return 0;
  324. }
  325.  
  326.  
  327. static int cdecl draw_scstring(PARMBLK *p)
  328. {
  329.     char    *str;
  330.     int    d;
  331.  
  332.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  333.     vswr_mode(handle, MD_TRANS);
  334.  
  335.     vst_font(handle, sys_big_id);
  336.     vst_height(handle, sys_big_height, &d, &d, &d, &d);
  337.  
  338.     /* Text ausgeben */
  339.     str = (char *)p->pb_parm;
  340.     draw_string(p->pb_tree, p->pb_obj, p->pb_x, p->pb_y, str, 0);
  341.  
  342.     return 0;
  343. }
  344.  
  345.  
  346. /*
  347.  * Menü-Tuning: Trennlinien als Linie (für Hauptmenüs)
  348.  * (ST-Computer 3/92, Seite 87)
  349.  */
  350. static int cdecl draw_menuline(PARMBLK *p)
  351. {
  352.     int    pxy[4];
  353.  
  354.     /* Unter TOS und N.AES 1.x gibt es für das Hauptmenü falsche Clippingdaten. */
  355.     /* Unter Geneva (Tear-Away-Menüs) sowie MagiC stimmen sie */
  356.     if (gnva || gl_magx)
  357.         set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  358.     else
  359.         vs_clip(handle, 0, pxy);
  360.  
  361.     pxy[0] = p->pb_x;
  362.     pxy[1] = p->pb_y + (p->pb_h / 2) - 1;
  363.     pxy[2] = p->pb_x + p->pb_w - 1;
  364.     pxy[3] = p->pb_y + (p->pb_h / 2);
  365.  
  366.     if (use_3D)
  367.     {
  368.         vsf_interior(handle, FIS_SOLID);
  369.         vsf_color(handle, LBLACK);
  370.     }
  371.     else
  372.     {
  373.         vsf_interior(handle, FIS_PATTERN);
  374.         vsf_style(handle, 4);
  375.         vsf_color(handle, BLACK);
  376.     }
  377.     vr_recfl(handle, pxy);
  378.  
  379.     return 0;
  380. }
  381.  
  382. /*
  383.  * Dünne Trennlinien für Popupmenüs.
  384.  * Von Joachim Fornallaz <jfornall@stud.ee.ethz.ch>
  385.  */
  386. static int cdecl draw_popupline(PARMBLK *p)
  387. {
  388.     int    pxy[4];
  389.  
  390.     set_clipping(handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
  391.  
  392.     pxy[0] = p->pb_x;
  393.     pxy[1] = p->pb_y + (p->pb_h / 2) - 1;
  394.     pxy[2] = p->pb_x + p->pb_w - 1;
  395.     pxy[3] = pxy[1]; /*p->pb_y + (p->pb_h / 2); */
  396.  
  397.     if (use_3D)
  398.     {
  399.         vsl_color(handle, LBLACK);
  400.         v_pline(handle, 2, pxy);
  401.         
  402.         pxy[1] = p->pb_y + (p->pb_h / 2);
  403.         pxy[3] = pxy[1];
  404.         
  405.         vsl_color(handle, WHITE);
  406.         v_pline(handle, 2, pxy);
  407.     }
  408.     else
  409.     {
  410.         vsf_interior(handle, FIS_PATTERN);
  411.         vsf_style(handle, 4);
  412.         vsf_color(handle, BLACK);
  413.         vr_recfl(handle, pxy);
  414.     }
  415.  
  416.     return 0;
  417. }
  418.  
  419. /* -- sonstige Hilfsfunktionen ----------------------------------------------- */
  420.  
  421. static void init_inline_rsc(void)
  422. {
  423.     int    i, obj;
  424.     
  425.     for (i = 0; i < NUM_OBS; i++)
  426.         rsrc_obfix(&rs_object[i], 0);
  427.  
  428.     cf_ascii_tab = rs_trindex[ASCIITAB];
  429.     fix_dial(cf_ascii_tab);
  430.  
  431.     cf_alert_box = rs_trindex[ALERTBOX];
  432.     fix_dial(cf_alert_box);
  433.  
  434.     if (use_3D)
  435.         i = gl_planes;
  436.     else
  437.         i = 1;        /* keine Farbicons unter TOS */
  438.  
  439.     obj = (gl_hchar > 8) ? BT_RADIO : BT_RLOW;
  440.     radio_cib = (CICONBLK *)get_obspec(rs_trindex[BUTTONS], obj);
  441.     radio_cib->mainlist = fix_cicon(radio_cib, i, handle);
  442.  
  443.     obj = (gl_hchar > 8) ? BT_CHECK : BT_CLOW;
  444.     check_cib = (CICONBLK *)get_obspec(rs_trindex[BUTTONS], obj);
  445.     check_cib->mainlist = fix_cicon(check_cib, i, handle);
  446. }
  447.  
  448. static void make_userdef(OBJECT *tree, int obj, int cdecl (*proc)(PARMBLK *p))
  449. {
  450.     USERBLK    *uPtr;
  451.  
  452.     uPtr = (USERBLK *)cf_malloc(sizeof(USERBLK), "make_userdef", FALSE);
  453.     if (uPtr != NULL)
  454.     {
  455.         uPtr->ub_code = proc;                                /* neue Zeichenfunktion */
  456.         uPtr->ub_parm = tree[obj].ob_spec.index;        /* alte obSpec sichern */
  457.                                         /* alten Typ hochschieben und neuen eintragen */
  458.         tree[obj].ob_type = (tree[obj].ob_type << 8) + G_USERDEF;
  459.         tree[obj].ob_spec.index = (long)uPtr;            /* Userblock eintragen */
  460.     }
  461. }
  462.  
  463. /* -- exportierte Funtkionen ------------------------------------------------- */
  464.  
  465. void fix_dial(OBJECT *tree)
  466. {
  467.     int    mtyp, obj;
  468.  
  469.     if (!tree)
  470.         return;
  471.  
  472.     obj = -1;
  473.     do
  474.     {
  475.         obj++;
  476.         mtyp = get_magx_obj(tree, obj);
  477.  
  478.         /* Ein paar Erweiterungen, die MagiC auch nicht kann */
  479.         switch (mtyp)
  480.         {
  481.             case MX_GROUPBOX2:
  482.                 make_userdef(tree, obj, draw_groupbox);
  483.                 break;
  484.         }
  485.  
  486.         /* den Rest nur, wenn keine WHITEBACK-Buttons verfügbar sind */
  487. /*        if ((gl_magx <= 0x200 && gl_naes < 0x0200) || use_all_userdefs) */
  488.         if (!mx_buttons || use_all_userdefs)
  489.         {
  490.             switch (mtyp)
  491.             {
  492.                 case MX_UNDERLINE :
  493.                     make_userdef(tree, obj, draw_underline);
  494.                     break;
  495.                 case MX_GROUPBOX :
  496.                     make_userdef(tree, obj, draw_groupbox);
  497.                     break;
  498.                 case MX_RADIO :
  499.                 case MX_SCRADIO :
  500.                     make_userdef(tree, obj, draw_radiobutton);
  501.                     break;
  502.                 case MX_CHECK :
  503.                 case MX_SCCHECK :
  504.                     make_userdef(tree, obj, draw_checkbutton);
  505.                     break;
  506.                 case MX_SCSTRING :
  507.                     make_userdef(tree, obj, draw_scstring);
  508.                     break;
  509.             }
  510.         }
  511.     }
  512.     while (!(tree[obj].ob_flags & LASTOB));
  513. }
  514.  
  515.  
  516. void fix_menu(OBJECT *tree)
  517. {
  518.     int    i = -1;
  519.  
  520.     do
  521.     {
  522.         i++;
  523.         if (tree[i].ob_type == G_STRING)
  524.         {
  525.             if ((tree[i].ob_state & DISABLED) && (tree[i].ob_spec.free_string[0] == '-'))
  526.             {
  527.                 tree[i].ob_type = (tree[i].ob_type << 8) + G_USERDEF;
  528.                 tree[i].ob_spec.userblk = &menu_blk; 
  529.             }
  530.         }
  531.     }
  532.     while (!(tree[i].ob_flags & LASTOB));
  533. }
  534.  
  535. void fix_popup(OBJECT *tree, int thin_line)
  536. {
  537.     int    i = -1;
  538.     
  539.     do
  540.     {
  541.         i++;
  542.         if (tree[i].ob_type == G_STRING)
  543.         {
  544.             if (mx_shortcut)
  545.                 tree[i].ob_type = G_SHORTCUT;
  546.     
  547.             if ((tree[i].ob_state & DISABLED) && (tree[i].ob_spec.free_string[0] == '-'))
  548.             {
  549.                 tree[i].ob_type = (tree[i].ob_type << 8) + G_USERDEF;
  550.                 if (thin_line)
  551.                     tree[i].ob_spec.userblk = &popup_blk; 
  552.                 else                
  553.                     tree[i].ob_spec.userblk = &menu_blk; 
  554.             }
  555.         }
  556.     }
  557.     while (!(tree[i].ob_flags & LASTOB));
  558. }
  559.  
  560.  
  561. void init_userdef(void)
  562. {
  563.     int    work_out[57], d, ap1, ap2, ap3, ap4;
  564.  
  565.     handle = open_vwork(work_out);
  566.  
  567.     if (appl_xgetinfo(13, &ap1, &ap2, &ap3, &ap4))
  568.     {
  569.         /* 3D aktiv? und Hintergrundfarbe ermitteln */
  570.         use_3D = ((work_out[13] >= 16) && ap1 == 1);
  571.         if (use_3D)
  572.             objc_sysvar(0, 5, 0, 0, &back_col, &d);
  573.  
  574.         mx_buttons  = (ap4 & 0x4) != 0; /* WHITEBAK steuert Unterstriche */
  575.         mx_shortcut = (ap4 & 0x8) != 0; /* type G_SHORTCUT vorhanden? */
  576.     }
  577.     else
  578.     {
  579.         use_3D = FALSE;
  580.         back_col = 0;
  581.         
  582.         mx_buttons = FALSE;
  583.         mx_shortcut = FALSE;
  584.     }
  585.  
  586. debug("init_userdef:\n");
  587. debug("  use_3D:      %d\n", use_3D);
  588. debug("  back_col:    %d\n", back_col);
  589. debug("  mx_buttons:  %d\n", mx_buttons);
  590. debug("  mx_shortcut: %d\n", mx_shortcut);
  591.  
  592.     if (gl_gdos)
  593.     {
  594.         vst_load_fonts(handle, 0);
  595.         vst_font(handle, sys_big_id);
  596.         vst_height(handle, sys_big_height, &ud_wchar, &ud_hchar, &ud_wbox, &ud_hbox);
  597.     }
  598.     else
  599.     {
  600.         ud_wchar = gl_wchar;
  601.         ud_hchar = gl_hchar;
  602.     }
  603.     vst_alignment(handle, TA_LEFT, TA_TOP, &d, &d);
  604.  
  605.     init_inline_rsc();
  606.  
  607.     menu_blk.ub_parm = 0;
  608.     menu_blk.ub_code = draw_menuline;
  609.     gnva = getcookie("Gnva", NULL);
  610.  
  611.     popup_blk.ub_parm = 0;
  612.     popup_blk.ub_code = draw_popupline;
  613. }
  614.  
  615.  
  616. void term_userdef(void)
  617. {
  618.     if (handle != -1)
  619.     {
  620.         if (gl_gdos)
  621.             vst_unload_fonts(handle, 0);
  622.         v_clsvwk(handle);
  623.     }
  624. }
  625.  
  626. /*
  627.  * Nur für internen Gebrauch: bei TRUE werden alle Objekte auch unter
  628.  * MagiC in USERDEFs umgewandelt.
  629. */
  630. void cf_use_all_userdefs(int all)
  631. {
  632.     use_all_userdefs = all;
  633. }
  634.